@scalar/api-reference 1.60.0 → 1.61.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/browser/chunks/{AgentScalarChatInterface-CesFQ_Ax.js → AgentScalarChatInterface-BhUn0w1j.js} +2 -2
- package/dist/browser/chunks/{ScalarTextInput.vue-C14zmVNI.js → ScalarTextInput.vue-BUzf4Z_k.js} +2 -2
- package/dist/browser/chunks/basic-shape-diamond.svg-BTEOT1FL.js +1 -1
- package/dist/browser/chunks/basic-shape-hexagon.svg-BSPzaCgF.js +1 -1
- package/dist/browser/chunks/basic-shape-primary-circle-ellipse-round.svg-DKmZ8UUU.js +1 -1
- package/dist/browser/chunks/basic-shape-primary-square-rectangle.svg-n2YRykHD.js +1 -1
- package/dist/browser/chunks/basic-shape-shield.svg-Bec9cJDA.js +1 -1
- package/dist/browser/chunks/browser-67K6wmG9.js +1 -1
- package/dist/browser/chunks/computer-device-desktop-monitor.svg-m6j893Hb.js +1 -1
- package/dist/browser/chunks/computer-device-desktop.svg-Dk1VVO7k.js +1 -1
- package/dist/browser/chunks/computer-device-laptop.svg-BNGVUCYS.js +1 -1
- package/dist/browser/chunks/computer-device-mobile-phone-android-samsung-back.svg-CC4UUTFw.js +1 -1
- package/dist/browser/chunks/computer-device-mobile-phone-android-samsung.svg-D8ExpMpL.js +1 -1
- package/dist/browser/chunks/computer-device-mobile-phone-iphone-x-back.svg-CLm7sgMM.js +1 -1
- package/dist/browser/chunks/computer-device-mobile-phone-iphone-x.svg-Xrttg6_7.js +1 -1
- package/dist/browser/chunks/computer-device-mobile-tablet-touch.svg-DQ2oTvOG.js +1 -1
- package/dist/browser/chunks/computer-device-mobile-tablet.svg-DCr0XlRc.js +1 -1
- package/dist/browser/chunks/computer-device-network-ethernet-cat6.svg-AK9l0iOl.js +1 -1
- package/dist/browser/chunks/computer-device-network-lan-www.svg-gUIdFBlE.js +1 -1
- package/dist/browser/chunks/computer-device-network-wifi-connection.svg-Be-EMm4e.js +1 -1
- package/dist/browser/chunks/computer-device-network-wifi-router.svg-Dc2VzyqK.js +1 -1
- package/dist/browser/chunks/ecology-science-erlenmeyer-flask.svg-DHgy7Jfd.js +1 -1
- package/dist/browser/chunks/image-flash-lightning.svg-EETR_y1q.js +1 -1
- package/dist/browser/chunks/image-picture-flower.svg-DN1AYzJU.js +1 -1
- package/dist/browser/chunks/interface-alert-exclamation-diamond.svg-C5NozMV_.js +1 -1
- package/dist/browser/chunks/interface-alert-exclamation-triangle-warning.svg-DaAg2fF5.js +1 -1
- package/dist/browser/chunks/interface-alert-information-circle.svg-ckkkt9Mv.js +1 -1
- package/dist/browser/chunks/interface-award-crown.svg-pjvn9hY-.js +1 -1
- package/dist/browser/chunks/interface-bookmark-tag.svg-r2r-lQq4.js +1 -1
- package/dist/browser/chunks/interface-bookmark.svg-BK9HKQBT.js +1 -1
- package/dist/browser/chunks/interface-calendar-date-one.svg-DNnF0M1I.js +1 -1
- package/dist/browser/chunks/interface-content-book-open-pages.svg-CQj_w9Vp.js +1 -1
- package/dist/browser/chunks/interface-content-book-page.svg-DppoeJRe.js +1 -1
- package/dist/browser/chunks/interface-content-file.svg-CvcD7OiY.js +1 -1
- package/dist/browser/chunks/interface-content-folder.svg-BmtS5I9A.js +1 -1
- package/dist/browser/chunks/interface-copy-clipboard.svg-Be6EI50X.js +1 -1
- package/dist/browser/chunks/interface-edit-attachment.svg-G5TKzpWX.js +1 -1
- package/dist/browser/chunks/interface-edit-binocular.svg-jzL-DvGB.js +1 -1
- package/dist/browser/chunks/interface-edit-magic-wand.svg-BOTlymvp.js +1 -1
- package/dist/browser/chunks/interface-edit-tool-paint-roller.svg-s9dwryx7.js +1 -1
- package/dist/browser/chunks/interface-edit-tool-pencil.svg-C7v0dbB3.js +1 -1
- package/dist/browser/chunks/interface-favorite-award.svg-CYHUgUG0.js +1 -1
- package/dist/browser/chunks/interface-favorite-flag.svg-C10zlKOb.js +1 -1
- package/dist/browser/chunks/interface-favorite-heart.svg-eoduXxlz.js +1 -1
- package/dist/browser/chunks/interface-favorite-star.svg-BSmxJetr.js +1 -1
- package/dist/browser/chunks/interface-favorite-stars-sparkles.svg-JTFLj3Ls.js +1 -1
- package/dist/browser/chunks/interface-hierarchy-flowchart.svg-Cg_Wy0kN.js +1 -1
- package/dist/browser/chunks/interface-home-house.svg-DytoGRnv.js +1 -1
- package/dist/browser/chunks/interface-hyperlink.svg-CuEfmmQI.js +1 -1
- package/dist/browser/chunks/interface-lighting-brightness.svg-DSK0h_Pa.js +1 -1
- package/dist/browser/chunks/interface-lock-closed.svg-Cn6TaLYv.js +1 -1
- package/dist/browser/chunks/interface-lock-open-unlock.svg-CVkG5-9W.js +1 -1
- package/dist/browser/chunks/interface-login-key.svg-y-cwwXjN.js +1 -1
- package/dist/browser/chunks/interface-search.svg-S-puVFJB.js +1 -1
- package/dist/browser/chunks/interface-setting-cog.svg-CTH4_lLg.js +1 -1
- package/dist/browser/chunks/interface-share-megaphone-bullhorn.svg-Pbp39MyC.js +1 -1
- package/dist/browser/chunks/interface-share-rocket.svg-BgCsIRZO.js +1 -1
- package/dist/browser/chunks/interface-share-satellite.svg-DAMN9d5G.js +1 -1
- package/dist/browser/chunks/interface-share-space-ship.svg-Dt-Mejxk.js +1 -1
- package/dist/browser/chunks/interface-share.svg-vFYTXSti.js +1 -1
- package/dist/browser/chunks/interface-signal-square.svg-DNG4LpAe.js +1 -1
- package/dist/browser/chunks/interface-time-clock-circle.svg-Bpz-nLxo.js +1 -1
- package/dist/browser/chunks/interface-time-hour-glass.svg-D7agfKsH.js +1 -1
- package/dist/browser/chunks/interface-users-multiple.svg-CkPJBBnG.js +1 -1
- package/dist/browser/chunks/interface-weather-moon.svg-CaTZFMPO.js +1 -1
- package/dist/browser/chunks/mail-chat-bubble-square.svg-DC8RIihp.js +1 -1
- package/dist/browser/chunks/mail-send-email-paper-airplane.svg-D8OLs9jz.js +1 -1
- package/dist/browser/chunks/mail-send-envelope.svg-CV33h5Sx.js +1 -1
- package/dist/browser/chunks/{modal-LBDjZSmM.js → modal-CKthJJWy.js} +2 -2
- package/dist/browser/chunks/{modal-BZzcBkVp.js → modal-CZI71Aau.js} +19 -19
- package/dist/browser/chunks/money-cashier-receipt.svg-CJL8C2gs.js +1 -1
- package/dist/browser/chunks/money-currency-dollar-pay.svg-VdBplCTx.js +1 -1
- package/dist/browser/chunks/money-graph-arrow-increase.svg-DcRov3zk.js +1 -1
- package/dist/browser/chunks/money-graph-bar-chart-increase.svg-Cc7KxjX-.js +1 -1
- package/dist/browser/chunks/nature-ecology-leaf.svg-DR3cTZxt.js +1 -1
- package/dist/browser/chunks/phone-telephone.svg-DyY0gUlk.js +1 -1
- package/dist/browser/chunks/programming-bug.svg-BHLT-Qhp.js +1 -1
- package/dist/browser/chunks/programming-cloud.svg-B6YW33ba.js +1 -1
- package/dist/browser/chunks/programming-computer-database-server.svg-B6o5Sdn-.js +1 -1
- package/dist/browser/chunks/programming-computer-database.svg-Cl7OVtpJ.js +1 -1
- package/dist/browser/chunks/programming-module-four-layout.svg-BQrerL1x.js +1 -1
- package/dist/browser/chunks/programming-module-three.svg-B2KTQzBM.js +1 -1
- package/dist/browser/chunks/programming-module.svg-CiID7kPm.js +1 -1
- package/dist/browser/chunks/programming-script-code.svg-D1M5rtkN.js +1 -1
- package/dist/browser/chunks/runtime-core.esm-bundler-Byrbbu5Q.js +1 -1
- package/dist/browser/chunks/shopping-cart.svg-BEegiIR9.js +1 -1
- package/dist/browser/chunks/shopping-gift-present.svg-BUHwuLix.js +1 -1
- package/dist/browser/chunks/shopping-shipping-box-parcel-package.svg-D6fxWdYx.js +1 -1
- package/dist/browser/chunks/tag-new-circle.svg-jsg1bGs0.js +1 -1
- package/dist/browser/chunks/travel-map-earth-globe.svg-ClbMiU-f.js +1 -1
- package/dist/browser/chunks/{vendor-wW8jg8wN.js → vendor-BeJNu9KM.js} +2 -2
- package/dist/browser/standalone.esm.js +6 -6
- package/dist/browser/standalone.js +248 -248
- package/dist/components/ApiReference.vue.d.ts.map +1 -1
- package/dist/components/ApiReference.vue.js +1 -1
- package/dist/components/ApiReference.vue.js.map +1 -1
- package/dist/components/ApiReference.vue.script.js +12 -6
- package/dist/components/ApiReference.vue.script.js.map +1 -1
- package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.d.ts +10 -0
- package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.d.ts.map +1 -0
- package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.js +9 -0
- package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.js.map +1 -0
- package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.script.js +43 -0
- package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.script.js.map +1 -0
- package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.d.ts.map +1 -1
- package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.js.map +1 -1
- package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.script.js +2 -0
- package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.script.js.map +1 -1
- package/dist/components/Content/AsyncApi/Channel.vue.d.ts +4 -1
- package/dist/components/Content/AsyncApi/Channel.vue.d.ts.map +1 -1
- package/dist/components/Content/AsyncApi/Channel.vue.js +1 -1
- package/dist/components/Content/AsyncApi/Channel.vue.js.map +1 -1
- package/dist/components/Content/AsyncApi/Channel.vue.script.js +98 -44
- package/dist/components/Content/AsyncApi/Channel.vue.script.js.map +1 -1
- package/dist/components/Content/AsyncApi/Message.vue.d.ts +18 -0
- package/dist/components/Content/AsyncApi/Message.vue.d.ts.map +1 -0
- package/dist/components/Content/AsyncApi/Message.vue.js +9 -0
- package/dist/components/Content/AsyncApi/Message.vue.js.map +1 -0
- package/dist/components/Content/AsyncApi/Message.vue.script.js +159 -0
- package/dist/components/Content/AsyncApi/Message.vue.script.js.map +1 -0
- package/dist/components/Content/AsyncApi/Operation.vue.d.ts +18 -0
- package/dist/components/Content/AsyncApi/Operation.vue.d.ts.map +1 -0
- package/dist/components/Content/AsyncApi/Operation.vue.js +9 -0
- package/dist/components/Content/AsyncApi/Operation.vue.js.map +1 -0
- package/dist/components/Content/AsyncApi/Operation.vue.script.js +84 -0
- package/dist/components/Content/AsyncApi/Operation.vue.script.js.map +1 -0
- package/dist/components/Content/AsyncApi/helpers/async-api-render-options.d.ts +14 -0
- package/dist/components/Content/AsyncApi/helpers/async-api-render-options.d.ts.map +1 -0
- package/dist/components/Content/AsyncApi/helpers/async-api-render-options.js +14 -0
- package/dist/components/Content/AsyncApi/helpers/async-api-render-options.js.map +1 -0
- package/dist/components/Content/AsyncApi/helpers/filter-children-by-type.d.ts +9 -0
- package/dist/components/Content/AsyncApi/helpers/filter-children-by-type.d.ts.map +1 -0
- package/dist/components/Content/AsyncApi/helpers/filter-children-by-type.js +12 -0
- package/dist/components/Content/AsyncApi/helpers/filter-children-by-type.js.map +1 -0
- package/dist/components/Content/AsyncApi/helpers/get-async-api-labels.d.ts +13 -0
- package/dist/components/Content/AsyncApi/helpers/get-async-api-labels.d.ts.map +1 -0
- package/dist/components/Content/AsyncApi/helpers/get-async-api-labels.js +23 -0
- package/dist/components/Content/AsyncApi/helpers/get-async-api-labels.js.map +1 -0
- package/dist/components/Content/AsyncApi/helpers/pick-heading.d.ts +10 -0
- package/dist/components/Content/AsyncApi/helpers/pick-heading.d.ts.map +1 -0
- package/dist/components/Content/AsyncApi/helpers/pick-heading.js +20 -0
- package/dist/components/Content/AsyncApi/helpers/pick-heading.js.map +1 -0
- package/dist/components/Content/AsyncApi/helpers/resolve-async-api-nodes.d.ts +21 -0
- package/dist/components/Content/AsyncApi/helpers/resolve-async-api-nodes.d.ts.map +1 -0
- package/dist/components/Content/AsyncApi/helpers/resolve-async-api-nodes.js +35 -0
- package/dist/components/Content/AsyncApi/helpers/resolve-async-api-nodes.js.map +1 -0
- package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.js +1 -1
- package/dist/components/Content/Schema/Schema.vue.js.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.script.js +2 -1
- package/dist/components/Content/Schema/Schema.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.js.map +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.script.js +16 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/SchemaHeading.vue.script.js +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.js.map +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.script.js +21 -6
- package/dist/components/Content/Schema/SchemaProperty.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +10 -9
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js.map +1 -1
- package/dist/helpers/get-async-api-message-payload-schema.d.ts +18 -0
- package/dist/helpers/get-async-api-message-payload-schema.d.ts.map +1 -0
- package/dist/helpers/get-async-api-message-payload-schema.js +33 -0
- package/dist/helpers/get-async-api-message-payload-schema.js.map +1 -0
- package/dist/helpers/get-async-api-model-schema.d.ts.map +1 -1
- package/dist/helpers/get-async-api-model-schema.js +2 -11
- package/dist/helpers/get-async-api-model-schema.js.map +1 -1
- package/dist/helpers/map-config-plugins.d.ts +8 -3
- package/dist/helpers/map-config-plugins.d.ts.map +1 -1
- package/dist/helpers/map-config-plugins.js +22 -4
- package/dist/helpers/map-config-plugins.js.map +1 -1
- package/dist/style.css +416 -311
- package/dist/vue-styles.css +398 -298
- package/package.json +12 -12
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { useIntersection } from "../../../hooks/use-intersection.js";
|
|
2
|
+
import SectionHeaderTag_default from "../../Section/SectionHeaderTag.vue.js";
|
|
3
|
+
import Anchor_default from "../../Anchor/Anchor.vue.js";
|
|
4
|
+
import { filterChildrenByType } from "./helpers/filter-children-by-type.js";
|
|
5
|
+
import { pickHeading } from "./helpers/pick-heading.js";
|
|
6
|
+
import { resolveAsyncApiOperation } from "./helpers/resolve-async-api-nodes.js";
|
|
7
|
+
import Message_default from "./Message.vue.js";
|
|
8
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, renderList, toDisplayString, unref, useId, useTemplateRef, withCtx } from "vue";
|
|
9
|
+
import { ScalarMarkdown } from "@scalar/components/markdown";
|
|
10
|
+
//#region src/components/Content/AsyncApi/Operation.vue?vue&type=script&setup=true&lang.ts
|
|
11
|
+
var _hoisted_1 = ["id"];
|
|
12
|
+
var _hoisted_2 = { class: "operation-header" };
|
|
13
|
+
var Operation_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
14
|
+
__name: "Operation",
|
|
15
|
+
props: {
|
|
16
|
+
operation: {},
|
|
17
|
+
document: {},
|
|
18
|
+
eventBus: {},
|
|
19
|
+
options: {},
|
|
20
|
+
expandedItems: { default: () => ({}) }
|
|
21
|
+
},
|
|
22
|
+
setup(__props) {
|
|
23
|
+
const headerId = useId();
|
|
24
|
+
const section = useTemplateRef("section");
|
|
25
|
+
useIntersection(section, () => __props.eventBus?.emit("intersecting:nav-item", { id: __props.operation.id }));
|
|
26
|
+
/**
|
|
27
|
+
* Resolve the operation from the document so we can read its summary/description.
|
|
28
|
+
* Operation traits are merged in (matching the channel connection UI) so trait-only
|
|
29
|
+
* fields render as part of the operation.
|
|
30
|
+
*/
|
|
31
|
+
const resolvedOperation = computed(() => resolveAsyncApiOperation(__props.document, __props.operation.operationName));
|
|
32
|
+
/** Heading prefers title, then summary, then the operation map key. */
|
|
33
|
+
const headingText = computed(() => pickHeading(resolvedOperation.value?.title, __props.operation.title, __props.operation.operationName));
|
|
34
|
+
const description = computed(() => resolvedOperation.value?.description || resolvedOperation.value?.summary || "");
|
|
35
|
+
/** Only the message children of this operation. */
|
|
36
|
+
const messages = computed(() => filterChildrenByType(__props.operation.children, "asyncapi-message"));
|
|
37
|
+
return (_ctx, _cache) => {
|
|
38
|
+
return openBlock(), createElementBlock("div", {
|
|
39
|
+
id: __props.operation.id,
|
|
40
|
+
ref_key: "section",
|
|
41
|
+
ref: section,
|
|
42
|
+
class: normalizeClass(["operation", `operation--${__props.operation.action}`])
|
|
43
|
+
}, [
|
|
44
|
+
createElementVNode("div", _hoisted_2, [createElementVNode("span", { class: normalizeClass(["operation-action", `operation-action--${__props.operation.action}`]) }, toDisplayString(__props.operation.action), 3), createVNode(unref(Anchor_default), { onCopyAnchorUrl: _cache[0] || (_cache[0] = () => __props.eventBus?.emit("copy-url:nav-item", { id: __props.operation.id })) }, {
|
|
45
|
+
default: withCtx(() => [createVNode(unref(SectionHeaderTag_default), {
|
|
46
|
+
id: unref(headerId),
|
|
47
|
+
class: "operation-title",
|
|
48
|
+
level: 3
|
|
49
|
+
}, {
|
|
50
|
+
default: withCtx(() => [createTextVNode(toDisplayString(headingText.value), 1)]),
|
|
51
|
+
_: 1
|
|
52
|
+
}, 8, ["id"])]),
|
|
53
|
+
_: 1
|
|
54
|
+
})]),
|
|
55
|
+
description.value ? (openBlock(), createBlock(unref(ScalarMarkdown), {
|
|
56
|
+
key: 0,
|
|
57
|
+
class: "operation-description",
|
|
58
|
+
value: description.value,
|
|
59
|
+
withImages: ""
|
|
60
|
+
}, null, 8, ["value"])) : createCommentVNode("", true),
|
|
61
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(messages.value, (message) => {
|
|
62
|
+
return openBlock(), createBlock(Message_default, {
|
|
63
|
+
key: message.id,
|
|
64
|
+
document: __props.document,
|
|
65
|
+
eventBus: __props.eventBus,
|
|
66
|
+
expandedItems: __props.expandedItems,
|
|
67
|
+
message,
|
|
68
|
+
options: __props.options
|
|
69
|
+
}, null, 8, [
|
|
70
|
+
"document",
|
|
71
|
+
"eventBus",
|
|
72
|
+
"expandedItems",
|
|
73
|
+
"message",
|
|
74
|
+
"options"
|
|
75
|
+
]);
|
|
76
|
+
}), 128))
|
|
77
|
+
], 10, _hoisted_1);
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
//#endregion
|
|
82
|
+
export { Operation_vue_vue_type_script_setup_true_lang_default as default };
|
|
83
|
+
|
|
84
|
+
//# sourceMappingURL=Operation.vue.script.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Operation.vue.script.js","names":[],"sources":["../../../../src/components/Content/AsyncApi/Operation.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport type { AsyncApiDocument } from '@scalar/types/asyncapi/3.1'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type {\n TraversedAsyncApiMessage,\n TraversedAsyncApiOperation,\n} from '@scalar/workspace-store/schemas/navigation'\nimport { computed, useId, useTemplateRef } from 'vue'\n\nimport { Anchor } from '@/components/Anchor'\nimport { SectionHeaderTag } from '@/components/Section'\nimport { useIntersection } from '@/hooks/use-intersection'\n\nimport type { AsyncApiSchemaRenderOptions } from './helpers/async-api-render-options'\nimport { filterChildrenByType } from './helpers/filter-children-by-type'\nimport { pickHeading } from './helpers/pick-heading'\nimport { resolveAsyncApiOperation } from './helpers/resolve-async-api-nodes'\nimport Message from './Message.vue'\n\n/** Subset of the configuration the nested `Message`/`Schema` renderers need. */\ntype OperationOptions = AsyncApiSchemaRenderOptions\n\nconst {\n operation,\n document,\n eventBus,\n options,\n expandedItems = {},\n} = defineProps<{\n operation: TraversedAsyncApiOperation\n document: AsyncApiDocument\n eventBus: WorkspaceEventBus | null\n options?: Partial<OperationOptions>\n /** Map of navigation item id to expanded state, shared with the sidebar. */\n expandedItems?: Record<string, boolean>\n}>()\n\nconst headerId = useId()\nconst section = useTemplateRef<HTMLElement>('section')\n\nuseIntersection(section, () =>\n eventBus?.emit('intersecting:nav-item', { id: operation.id }),\n)\n\n/**\n * Resolve the operation from the document so we can read its summary/description.\n * Operation traits are merged in (matching the channel connection UI) so trait-only\n * fields render as part of the operation.\n */\nconst resolvedOperation = computed(() =>\n resolveAsyncApiOperation(document, operation.operationName),\n)\n\n/** Heading prefers title, then summary, then the operation map key. */\nconst headingText = computed(() =>\n pickHeading(\n resolvedOperation.value?.title,\n operation.title,\n operation.operationName,\n ),\n)\n\nconst description = computed(\n () =>\n resolvedOperation.value?.description ||\n resolvedOperation.value?.summary ||\n '',\n)\n\n/** Only the message children of this operation. */\nconst messages = computed(() =>\n filterChildrenByType<TraversedAsyncApiMessage>(\n operation.children,\n 'asyncapi-message',\n ),\n)\n</script>\n\n<template>\n <div\n :id=\"operation.id\"\n ref=\"section\"\n class=\"operation\"\n :class=\"`operation--${operation.action}`\">\n <div class=\"operation-header\">\n <span\n class=\"operation-action\"\n :class=\"`operation-action--${operation.action}`\">\n {{ operation.action }}\n </span>\n <Anchor\n @copyAnchorUrl=\"\n () => eventBus?.emit('copy-url:nav-item', { id: operation.id })\n \">\n <SectionHeaderTag\n :id=\"headerId\"\n class=\"operation-title\"\n :level=\"3\">\n {{ headingText }}\n </SectionHeaderTag>\n </Anchor>\n </div>\n\n <ScalarMarkdown\n v-if=\"description\"\n class=\"operation-description\"\n :value=\"description\"\n withImages />\n\n <Message\n v-for=\"message in messages\"\n :key=\"message.id\"\n :document=\"document\"\n :eventBus=\"eventBus\"\n :expandedItems=\"expandedItems\"\n :message=\"message\"\n :options=\"options\" />\n </div>\n</template>\n\n<style scoped>\n.operation {\n margin-top: 32px;\n scroll-margin-top: var(--refs-viewport-offset);\n}\n\n.operation-header {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n.operation-title {\n font-size: var(--scalar-heading-3);\n font-weight: var(--scalar-semibold);\n color: var(--scalar-color-1);\n}\n\n/* Filled, color-coded pill carries the primary send/receive signal. */\n.operation-action {\n text-transform: uppercase;\n font-size: var(--scalar-mini);\n font-weight: var(--scalar-semibold);\n letter-spacing: 0.05em;\n border-radius: 12px;\n padding: 2px 8px;\n display: inline-flex;\n align-items: center;\n}\n.operation-action--send {\n color: var(--scalar-color-blue);\n background: color-mix(in srgb, var(--scalar-color-blue), transparent 88%);\n}\n.operation-action--receive {\n color: var(--scalar-color-green);\n background: color-mix(in srgb, var(--scalar-color-green), transparent 88%);\n}\n\n.operation-description {\n text-align: left;\n margin-top: 4px;\n}\n/* Space the first message accordion away from the operation header/description. */\n.operation > :deep(.message) {\n margin-top: 12px;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;EAsCA,MAAM,WAAW,OAAM;EACvB,MAAM,UAAU,eAA4B,UAAS;AAErD,kBAAgB,eACd,QAAA,UAAU,KAAK,yBAAyB,EAAE,IAAI,QAAA,UAAU,IAAI,CAAC,CAC/D;;;;;;EAOA,MAAM,oBAAoB,eACxB,yBAAyB,QAAA,UAAU,QAAA,UAAU,cAAc,CAC7D;;EAGA,MAAM,cAAc,eAClB,YACE,kBAAkB,OAAO,OACzB,QAAA,UAAU,OACV,QAAA,UAAU,cACX,CACH;EAEA,MAAM,cAAc,eAEhB,kBAAkB,OAAO,eACzB,kBAAkB,OAAO,WACzB,GACJ;;EAGA,MAAM,WAAW,eACf,qBACE,QAAA,UAAU,UACV,mBACD,CACH;;uBAIE,mBAsCM,OAAA;IArCH,IAAI,QAAA,UAAU;aACX;IAAJ,KAAI;IACJ,OAAK,eAAA,CAAC,aAAW,cACK,QAAA,UAAU,SAAM,CAAA;;IACtC,mBAiBM,OAjBN,YAiBM,CAhBJ,mBAIO,QAAA,EAHL,OAAK,eAAA,CAAC,oBAAkB,qBACK,QAAA,UAAU,SAAM,CAAA,EAAA,EAAA,gBAC1C,QAAA,UAAU,OAAM,EAAA,EAAA,EAErB,YAUS,MAAA,eAAA,EAAA,EATN,iBAAa,OAAA,OAAA,OAAA,WAAmB,QAAA,UAAU,KAAI,qBAAA,EAAA,IAA4B,QAAA,UAAU,IAAE,CAAA,GAAA,EAAA;4BAQpE,CALnB,YAKmB,MAAA,yBAAA,EAAA;MAJhB,IAAI,MAAA,SAAQ;MACb,OAAM;MACL,OAAO;;6BACS,CAAA,gBAAA,gBAAd,YAAA,MAAW,EAAA,EAAA,CAAA,CAAA;;;;;IAMZ,YAAA,SAAA,WAAA,EADR,YAIe,MAAA,eAAA,EAAA;;KAFb,OAAM;KACL,OAAO,YAAA;KACR,YAAA;;sBAEF,mBAOuB,UAAA,MAAA,WANH,SAAA,QAAX,YAAO;yBADhB,YAOuB,iBAAA;MALpB,KAAK,QAAQ;MACb,UAAU,QAAA;MACV,UAAU,QAAA;MACV,eAAe,QAAA;MACN;MACT,SAAS,QAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference';
|
|
2
|
+
/**
|
|
3
|
+
* Schema-ordering options shared by the AsyncAPI channel, operation, and message renderers.
|
|
4
|
+
*
|
|
5
|
+
* Each surface threads the same subset of the reference configuration through to the shared
|
|
6
|
+
* `Schema`/`ParameterList` components, so they extend this type rather than re-declaring it.
|
|
7
|
+
*/
|
|
8
|
+
export type AsyncApiSchemaRenderOptions = Pick<ApiReferenceConfigurationRaw, 'orderRequiredPropertiesFirst' | 'orderSchemaPropertiesBy' | 'expandAllSchemaProperties'>;
|
|
9
|
+
/**
|
|
10
|
+
* Fill in defaults so the shared renderers always receive a complete ordering options object,
|
|
11
|
+
* regardless of which fields the caller provided.
|
|
12
|
+
*/
|
|
13
|
+
export declare const resolveSchemaRenderOptions: (options?: Partial<AsyncApiSchemaRenderOptions>) => AsyncApiSchemaRenderOptions;
|
|
14
|
+
//# sourceMappingURL=async-api-render-options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async-api-render-options.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/AsyncApi/helpers/async-api-render-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAE/E;;;;;GAKG;AACH,MAAM,MAAM,2BAA2B,GAAG,IAAI,CAC5C,4BAA4B,EAC5B,8BAA8B,GAAG,yBAAyB,GAAG,2BAA2B,CACzF,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,0BAA0B,GACrC,UAAU,OAAO,CAAC,2BAA2B,CAAC,KAC7C,2BAID,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/components/Content/AsyncApi/helpers/async-api-render-options.ts
|
|
2
|
+
/**
|
|
3
|
+
* Fill in defaults so the shared renderers always receive a complete ordering options object,
|
|
4
|
+
* regardless of which fields the caller provided.
|
|
5
|
+
*/
|
|
6
|
+
var resolveSchemaRenderOptions = (options) => ({
|
|
7
|
+
orderRequiredPropertiesFirst: options?.orderRequiredPropertiesFirst ?? false,
|
|
8
|
+
orderSchemaPropertiesBy: options?.orderSchemaPropertiesBy ?? "preserve",
|
|
9
|
+
expandAllSchemaProperties: options?.expandAllSchemaProperties ?? false
|
|
10
|
+
});
|
|
11
|
+
//#endregion
|
|
12
|
+
export { resolveSchemaRenderOptions };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=async-api-render-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async-api-render-options.js","names":[],"sources":["../../../../../src/components/Content/AsyncApi/helpers/async-api-render-options.ts"],"sourcesContent":["import type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\n\n/**\n * Schema-ordering options shared by the AsyncAPI channel, operation, and message renderers.\n *\n * Each surface threads the same subset of the reference configuration through to the shared\n * `Schema`/`ParameterList` components, so they extend this type rather than re-declaring it.\n */\nexport type AsyncApiSchemaRenderOptions = Pick<\n ApiReferenceConfigurationRaw,\n 'orderRequiredPropertiesFirst' | 'orderSchemaPropertiesBy' | 'expandAllSchemaProperties'\n>\n\n/**\n * Fill in defaults so the shared renderers always receive a complete ordering options object,\n * regardless of which fields the caller provided.\n */\nexport const resolveSchemaRenderOptions = (\n options?: Partial<AsyncApiSchemaRenderOptions>,\n): AsyncApiSchemaRenderOptions => ({\n orderRequiredPropertiesFirst: options?.orderRequiredPropertiesFirst ?? false,\n orderSchemaPropertiesBy: options?.orderSchemaPropertiesBy ?? 'preserve',\n expandAllSchemaProperties: options?.expandAllSchemaProperties ?? false,\n})\n"],"mappings":";;;;;AAiBA,IAAa,8BACX,aACiC;CACjC,8BAA8B,SAAS,gCAAgC;CACvE,yBAAyB,SAAS,2BAA2B;CAC7D,2BAA2B,SAAS,6BAA6B;CAClE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation';
|
|
2
|
+
/**
|
|
3
|
+
* Narrow a navigation entry's children down to a single AsyncAPI node type.
|
|
4
|
+
*
|
|
5
|
+
* The channel renderer needs its operations and the operation renderer needs its messages; both
|
|
6
|
+
* share this type-guarded filter so the cast lives in one place.
|
|
7
|
+
*/
|
|
8
|
+
export declare const filterChildrenByType: <T extends TraversedEntry>(children: TraversedEntry[] | undefined, type: T["type"]) => T[];
|
|
9
|
+
//# sourceMappingURL=filter-children-by-type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter-children-by-type.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/AsyncApi/helpers/filter-children-by-type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;AAEhF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAAI,CAAC,SAAS,cAAc,EAC3D,UAAU,cAAc,EAAE,GAAG,SAAS,EACtC,MAAM,CAAC,CAAC,MAAM,CAAC,KACd,CAAC,EAAyE,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/components/Content/AsyncApi/helpers/filter-children-by-type.ts
|
|
2
|
+
/**
|
|
3
|
+
* Narrow a navigation entry's children down to a single AsyncAPI node type.
|
|
4
|
+
*
|
|
5
|
+
* The channel renderer needs its operations and the operation renderer needs its messages; both
|
|
6
|
+
* share this type-guarded filter so the cast lives in one place.
|
|
7
|
+
*/
|
|
8
|
+
var filterChildrenByType = (children, type) => (children ?? []).filter((child) => child.type === type);
|
|
9
|
+
//#endregion
|
|
10
|
+
export { filterChildrenByType };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=filter-children-by-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter-children-by-type.js","names":[],"sources":["../../../../../src/components/Content/AsyncApi/helpers/filter-children-by-type.ts"],"sourcesContent":["import type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation'\n\n/**\n * Narrow a navigation entry's children down to a single AsyncAPI node type.\n *\n * The channel renderer needs its operations and the operation renderer needs its messages; both\n * share this type-guarded filter so the cast lives in one place.\n */\nexport const filterChildrenByType = <T extends TraversedEntry>(\n children: TraversedEntry[] | undefined,\n type: T['type'],\n): T[] => (children ?? []).filter((child): child is T => child.type === type)\n"],"mappings":";;;;;;;AAQA,IAAa,wBACX,UACA,UACS,YAAY,EAAE,EAAE,QAAQ,UAAsB,MAAM,SAAS,KAAK"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AsyncApiChannelObject, AsyncApiDocument } from '@scalar/types/asyncapi/3.1';
|
|
2
|
+
/**
|
|
3
|
+
* Server names and protocols a channel is available on.
|
|
4
|
+
*
|
|
5
|
+
* Resolved from `document.servers`, restricted to `channel.servers` when the channel declares them.
|
|
6
|
+
* `webSocketOnly` is disabled so labels cover every protocol, not just WebSocket, and protocols are
|
|
7
|
+
* de-duplicated while preserving declaration order.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getChannelServerLabels: (document: AsyncApiDocument, channel: AsyncApiChannelObject | null | undefined) => {
|
|
10
|
+
servers: string[];
|
|
11
|
+
protocols: string[];
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=get-async-api-labels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-async-api-labels.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/AsyncApi/helpers/get-async-api-labels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAGzF;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,GACjC,UAAU,gBAAgB,EAC1B,SAAS,qBAAqB,GAAG,IAAI,GAAG,SAAS,KAChD;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAA;CAU1C,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { getAsyncApiServers } from "@scalar/workspace-store/channel-example";
|
|
2
|
+
//#region src/components/Content/AsyncApi/helpers/get-async-api-labels.ts
|
|
3
|
+
/**
|
|
4
|
+
* Server names and protocols a channel is available on.
|
|
5
|
+
*
|
|
6
|
+
* Resolved from `document.servers`, restricted to `channel.servers` when the channel declares them.
|
|
7
|
+
* `webSocketOnly` is disabled so labels cover every protocol, not just WebSocket, and protocols are
|
|
8
|
+
* de-duplicated while preserving declaration order.
|
|
9
|
+
*/
|
|
10
|
+
var getChannelServerLabels = (document, channel) => {
|
|
11
|
+
const entries = getAsyncApiServers(document, {
|
|
12
|
+
channel: channel ?? null,
|
|
13
|
+
webSocketOnly: false
|
|
14
|
+
});
|
|
15
|
+
return {
|
|
16
|
+
servers: entries.map((entry) => entry.name),
|
|
17
|
+
protocols: [...new Set(entries.map((entry) => entry.protocol).filter(Boolean))]
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { getChannelServerLabels };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=get-async-api-labels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-async-api-labels.js","names":[],"sources":["../../../../../src/components/Content/AsyncApi/helpers/get-async-api-labels.ts"],"sourcesContent":["import type { AsyncApiChannelObject, AsyncApiDocument } from '@scalar/types/asyncapi/3.1'\nimport { getAsyncApiServers } from '@scalar/workspace-store/channel-example'\n\n/**\n * Server names and protocols a channel is available on.\n *\n * Resolved from `document.servers`, restricted to `channel.servers` when the channel declares them.\n * `webSocketOnly` is disabled so labels cover every protocol, not just WebSocket, and protocols are\n * de-duplicated while preserving declaration order.\n */\nexport const getChannelServerLabels = (\n document: AsyncApiDocument,\n channel: AsyncApiChannelObject | null | undefined,\n): { servers: string[]; protocols: string[] } => {\n const entries = getAsyncApiServers(document, {\n channel: channel ?? null,\n webSocketOnly: false,\n })\n\n return {\n servers: entries.map((entry) => entry.name),\n protocols: [...new Set(entries.map((entry) => entry.protocol).filter(Boolean))],\n }\n}\n"],"mappings":";;;;;;;;;AAUA,IAAa,0BACX,UACA,YAC+C;CAC/C,MAAM,UAAU,mBAAmB,UAAU;EAC3C,SAAS,WAAW;EACpB,eAAe;EAChB,CAAC;AAEF,QAAO;EACL,SAAS,QAAQ,KAAK,UAAU,MAAM,KAAK;EAC3C,WAAW,CAAC,GAAG,IAAI,IAAI,QAAQ,KAAK,UAAU,MAAM,SAAS,CAAC,OAAO,QAAQ,CAAC,CAAC;EAChF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pick the first non-empty heading from a list of candidates.
|
|
3
|
+
*
|
|
4
|
+
* Each candidate is trimmed and the first one with content wins, so the AsyncAPI channel, operation,
|
|
5
|
+
* and message renderers can share a single "prefer the human-friendly title, then fall back to a
|
|
6
|
+
* key" chain instead of repeating the same `title?.trim() || fallback` logic. Returns an empty
|
|
7
|
+
* string when every candidate is missing or blank.
|
|
8
|
+
*/
|
|
9
|
+
export declare const pickHeading: (...candidates: Array<string | undefined>) => string;
|
|
10
|
+
//# sourceMappingURL=pick-heading.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pick-heading.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/AsyncApi/helpers/pick-heading.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,GAAI,GAAG,YAAY,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,KAAG,MAStE,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/components/Content/AsyncApi/helpers/pick-heading.ts
|
|
2
|
+
/**
|
|
3
|
+
* Pick the first non-empty heading from a list of candidates.
|
|
4
|
+
*
|
|
5
|
+
* Each candidate is trimmed and the first one with content wins, so the AsyncAPI channel, operation,
|
|
6
|
+
* and message renderers can share a single "prefer the human-friendly title, then fall back to a
|
|
7
|
+
* key" chain instead of repeating the same `title?.trim() || fallback` logic. Returns an empty
|
|
8
|
+
* string when every candidate is missing or blank.
|
|
9
|
+
*/
|
|
10
|
+
var pickHeading = (...candidates) => {
|
|
11
|
+
for (const candidate of candidates) {
|
|
12
|
+
const trimmed = candidate?.trim();
|
|
13
|
+
if (trimmed) return trimmed;
|
|
14
|
+
}
|
|
15
|
+
return "";
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { pickHeading };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=pick-heading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pick-heading.js","names":[],"sources":["../../../../../src/components/Content/AsyncApi/helpers/pick-heading.ts"],"sourcesContent":["/**\n * Pick the first non-empty heading from a list of candidates.\n *\n * Each candidate is trimmed and the first one with content wins, so the AsyncAPI channel, operation,\n * and message renderers can share a single \"prefer the human-friendly title, then fall back to a\n * key\" chain instead of repeating the same `title?.trim() || fallback` logic. Returns an empty\n * string when every candidate is missing or blank.\n */\nexport const pickHeading = (...candidates: Array<string | undefined>): string => {\n for (const candidate of candidates) {\n const trimmed = candidate?.trim()\n if (trimmed) {\n return trimmed\n }\n }\n\n return ''\n}\n"],"mappings":";;;;;;;;;AAQA,IAAa,eAAe,GAAG,eAAkD;AAC/E,MAAK,MAAM,aAAa,YAAY;EAClC,MAAM,UAAU,WAAW,MAAM;AACjC,MAAI,QACF,QAAO;;AAIX,QAAO"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { AsyncApiChannelObject, AsyncApiDocument, AsyncApiMessageObject, AsyncApiOperationObject } from '@scalar/types/asyncapi/3.1';
|
|
2
|
+
/**
|
|
3
|
+
* Resolve a channel from the document by its `document.channels` key.
|
|
4
|
+
*
|
|
5
|
+
* Siblings are merged so keys declared alongside a `$ref` are kept rather than dropped, matching
|
|
6
|
+
* how the rest of the OpenAPI/AsyncAPI rendering resolves references.
|
|
7
|
+
*/
|
|
8
|
+
export declare const resolveAsyncApiChannel: (document: AsyncApiDocument, channelName: string) => AsyncApiChannelObject | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Resolve a message from the channel it lives on. The navigation entry only carries the identifying
|
|
11
|
+
* keys, so we walk `document.channels[channelName].messages[messageName]`.
|
|
12
|
+
*/
|
|
13
|
+
export declare const resolveAsyncApiMessage: (document: AsyncApiDocument, channelName: string, messageName: string) => AsyncApiMessageObject | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Resolve an operation from the document by its `document.operations` key.
|
|
16
|
+
*
|
|
17
|
+
* Operation traits are merged in (matching the channel connection UI) so trait-only fields render
|
|
18
|
+
* as part of the operation.
|
|
19
|
+
*/
|
|
20
|
+
export declare const resolveAsyncApiOperation: (document: AsyncApiDocument, operationName: string) => AsyncApiOperationObject | undefined;
|
|
21
|
+
//# sourceMappingURL=resolve-async-api-nodes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-async-api-nodes.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/AsyncApi/helpers/resolve-async-api-nodes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACxB,MAAM,4BAA4B,CAAA;AAInC;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GACjC,UAAU,gBAAgB,EAC1B,aAAa,MAAM,KAClB,qBAAqB,GAAG,SAG1B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,sBAAsB,GACjC,UAAU,gBAAgB,EAC1B,aAAa,MAAM,EACnB,aAAa,MAAM,KAClB,qBAAqB,GAAG,SAI1B,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,GACnC,UAAU,gBAAgB,EAC1B,eAAe,MAAM,KACpB,uBAAuB,GAAG,SAG5B,CAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { resolveOperationWithTraits } from "@scalar/workspace-store/channel-example";
|
|
2
|
+
import { getResolvedRef, mergeSiblingReferences } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
3
|
+
//#region src/components/Content/AsyncApi/helpers/resolve-async-api-nodes.ts
|
|
4
|
+
/**
|
|
5
|
+
* Resolve a channel from the document by its `document.channels` key.
|
|
6
|
+
*
|
|
7
|
+
* Siblings are merged so keys declared alongside a `$ref` are kept rather than dropped, matching
|
|
8
|
+
* how the rest of the OpenAPI/AsyncAPI rendering resolves references.
|
|
9
|
+
*/
|
|
10
|
+
var resolveAsyncApiChannel = (document, channelName) => {
|
|
11
|
+
const node = document.channels?.[channelName];
|
|
12
|
+
return node ? getResolvedRef(node, mergeSiblingReferences) : void 0;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Resolve a message from the channel it lives on. The navigation entry only carries the identifying
|
|
16
|
+
* keys, so we walk `document.channels[channelName].messages[messageName]`.
|
|
17
|
+
*/
|
|
18
|
+
var resolveAsyncApiMessage = (document, channelName, messageName) => {
|
|
19
|
+
const node = resolveAsyncApiChannel(document, channelName)?.messages?.[messageName];
|
|
20
|
+
return node ? getResolvedRef(node, mergeSiblingReferences) : void 0;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Resolve an operation from the document by its `document.operations` key.
|
|
24
|
+
*
|
|
25
|
+
* Operation traits are merged in (matching the channel connection UI) so trait-only fields render
|
|
26
|
+
* as part of the operation.
|
|
27
|
+
*/
|
|
28
|
+
var resolveAsyncApiOperation = (document, operationName) => {
|
|
29
|
+
const node = document.operations?.[operationName];
|
|
30
|
+
return node ? resolveOperationWithTraits(getResolvedRef(node, mergeSiblingReferences)) : void 0;
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
33
|
+
export { resolveAsyncApiChannel, resolveAsyncApiMessage, resolveAsyncApiOperation };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=resolve-async-api-nodes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-async-api-nodes.js","names":[],"sources":["../../../../../src/components/Content/AsyncApi/helpers/resolve-async-api-nodes.ts"],"sourcesContent":["import type {\n AsyncApiChannelObject,\n AsyncApiDocument,\n AsyncApiMessageObject,\n AsyncApiOperationObject,\n} from '@scalar/types/asyncapi/3.1'\nimport { resolveOperationWithTraits } from '@scalar/workspace-store/channel-example'\nimport { getResolvedRef, mergeSiblingReferences } from '@scalar/workspace-store/helpers/get-resolved-ref'\n\n/**\n * Resolve a channel from the document by its `document.channels` key.\n *\n * Siblings are merged so keys declared alongside a `$ref` are kept rather than dropped, matching\n * how the rest of the OpenAPI/AsyncAPI rendering resolves references.\n */\nexport const resolveAsyncApiChannel = (\n document: AsyncApiDocument,\n channelName: string,\n): AsyncApiChannelObject | undefined => {\n const node = document.channels?.[channelName]\n return node ? getResolvedRef(node, mergeSiblingReferences) : undefined\n}\n\n/**\n * Resolve a message from the channel it lives on. The navigation entry only carries the identifying\n * keys, so we walk `document.channels[channelName].messages[messageName]`.\n */\nexport const resolveAsyncApiMessage = (\n document: AsyncApiDocument,\n channelName: string,\n messageName: string,\n): AsyncApiMessageObject | undefined => {\n const channel = resolveAsyncApiChannel(document, channelName)\n const node = channel?.messages?.[messageName]\n return node ? getResolvedRef(node, mergeSiblingReferences) : undefined\n}\n\n/**\n * Resolve an operation from the document by its `document.operations` key.\n *\n * Operation traits are merged in (matching the channel connection UI) so trait-only fields render\n * as part of the operation.\n */\nexport const resolveAsyncApiOperation = (\n document: AsyncApiDocument,\n operationName: string,\n): AsyncApiOperationObject | undefined => {\n const node = document.operations?.[operationName]\n return node ? resolveOperationWithTraits(getResolvedRef(node, mergeSiblingReferences)) : undefined\n}\n"],"mappings":";;;;;;;;;AAeA,IAAa,0BACX,UACA,gBACsC;CACtC,MAAM,OAAO,SAAS,WAAW;AACjC,QAAO,OAAO,eAAe,MAAM,uBAAuB,GAAG,KAAA;;;;;;AAO/D,IAAa,0BACX,UACA,aACA,gBACsC;CAEtC,MAAM,OADU,uBAAuB,UAAU,YAAY,EACvC,WAAW;AACjC,QAAO,OAAO,eAAe,MAAM,uBAAuB,GAAG,KAAA;;;;;;;;AAS/D,IAAa,4BACX,UACA,kBACwC;CACxC,MAAM,OAAO,SAAS,aAAa;AACnC,QAAO,OAAO,2BAA2B,eAAe,MAAM,uBAAuB,CAAC,GAAG,KAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Schema.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/Schema.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Schema.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/Schema.vue"],"names":[],"mappings":"AA8bA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAGrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AAYtE,KAAK,WAAW,GAAG;IACjB,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,+DAA+D;IAC/D,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,2CAA2C;IAC3C,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,uBAAuB;IACvB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,kCAAkC;IAClC,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,+FAA+F;IAC/F,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,uCAAuC;IACvC,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,2BAA2B;IAC3B,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,gCAAgC;IAChC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,iCAAiC;IACjC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,0EAA0E;IAC1E,OAAO,EAAE,aAAa,CAAA;IACtB,4FAA4F;IAC5F,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,uFAAuF;IACvF,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAC;AAihBF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_exp
|
|
|
2
2
|
import Schema_vue_vue_type_script_setup_true_lang_default from "./Schema.vue.script.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region src/components/Content/Schema/Schema.vue
|
|
5
|
-
var Schema_default = /* @__PURE__ */ _plugin_vue_export_helper_default(Schema_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
5
|
+
var Schema_default = /* @__PURE__ */ _plugin_vue_export_helper_default(Schema_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-ec43bfbd"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Schema_default as default };
|
|
8
8
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Schema.vue.js","names":[],"sources":["../../../../src/components/Content/Schema/Schema.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, inject, provide } from 'vue'\n\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\nimport ScreenReader from '@/components/ScreenReader.vue'\nimport { scrollTargetId } from '@/helpers/lazy-bus'\n\nimport { isEmptySchemaObject } from './helpers/is-empty-schema-object'\nimport { isTypeObject } from './helpers/is-type-object'\nimport { SCHEMA_ANCESTORS_SYMBOL } from './helpers/schema-cycle'\nimport SchemaHeading from './SchemaHeading.vue'\nimport SchemaObjectProperties from './SchemaObjectProperties.vue'\nimport SchemaProperty from './SchemaProperty.vue'\n\nconst {\n schema,\n level = 0,\n name,\n compact,\n noncollapsible = false,\n hideHeading,\n hideDescription = false,\n additionalProperties,\n discriminator,\n breadcrumb,\n hideModelNames = false,\n options,\n schemaContext,\n compositionPath,\n cycleKey,\n} = defineProps<{\n schema?: SchemaObject\n /** Track how deep we've gone */\n level?: number\n /* Show as a heading */\n name?: string\n /** A tighter layout with less borders and without a heading */\n compact?: boolean\n /** Shows a toggle to hide/show children */\n noncollapsible?: boolean\n /** Hide the heading */\n hideHeading?: boolean\n /** Hide the schema description */\n hideDescription?: boolean\n /** Show a special one way toggle for additional properties, also has a top border when open */\n additionalProperties?: boolean\n /** Hide model names in type display */\n hideModelNames?: boolean\n /** Discriminator object */\n discriminator?: DiscriminatorObject\n /** Breadcrumb for the schema */\n breadcrumb?: string[]\n /** Event bus emitting actions */\n eventBus: WorkspaceEventBus | null\n /** Move the options into a single prop so they are easy to pass around */\n options: SchemaOptions\n /** When \"requestBody\", composition dropdown selection is synced with the example snippet */\n schemaContext?: string\n /** Internal path used to sync nested request body compositions with the code sample */\n compositionPath?: string[]\n /**\n * Stable identity of this schema node, derived from its raw (unresolved)\n * value by the parent. Used to detect self-referential cycles. See\n * {@link getCycleKey}.\n */\n cycleKey?: unknown\n}>()\n\n/**\n * Cycle-safe `expandAllSchemaProperties`.\n *\n * We track ancestor schema keys along the current render path. A node is\n * treated as cyclic when its key is already present in the ancestor set, which\n * indicates that rendering has looped back onto a self-referential schema.\n *\n * This lets us default-expand finite branches while stopping automatic\n * expansion only at cycle boundaries, preventing infinite recursion.\n */\nconst ancestors = inject(SCHEMA_ANCESTORS_SYMBOL, undefined)\n\nconst isCyclic = computed(\n (): boolean => cycleKey != null && !!ancestors?.has(cycleKey),\n)\n\n// Re-provide the ancestor set augmented with this node so descendants can\n// detect cycles back to it. Built once at setup; a node's key is stable.\nconst childAncestors = new Set<unknown>(ancestors ?? [])\nif (cycleKey != null) {\n childAncestors.add(cycleKey)\n}\nprovide(SCHEMA_ANCESTORS_SYMBOL, childAncestors)\n\nconst shouldForceExpand = computed(\n (): boolean => !!options.expandAllSchemaProperties && !isCyclic.value,\n)\n\n/**\n * Determines whether to show the collapse/expand toggle button.\n * We hide the toggle for non-collapsible schemas and root-level schemas.\n */\nconst shouldShowToggle = computed((): boolean => !noncollapsible && level > 0)\n\n/**\n * Whether this schema sits on the path to the current anchor/scroll target.\n *\n * Property anchors are dot-joined breadcrumbs, so every disclosure that wraps\n * the target has a breadcrumb that is a prefix of the target id. Opening those\n * disclosures is what makes deep links to collapsed (hidden) properties work\n * without forcing every schema open via `expandAllSchemaProperties`.\n */\nconst isOnScrollTargetPath = computed((): boolean => {\n if (!breadcrumb?.length) {\n return false\n }\n const path = breadcrumb.join('.')\n const target = scrollTargetId.value\n return target === path || target.startsWith(`${path}.`)\n})\n\n/**\n * Whether the disclosure starts expanded. Non-collapsible schemas are always\n * open. When `expandAllSchemaProperties` is enabled, finite branches start\n * expanded by default while cyclic branches remain collapsed to avoid recursion\n * loops. We also open any disclosure on the path to the current scroll target so\n * deep links resolve even when the property is collapsed.\n *\n * Note: the Disclosure only reads this at mount, so it expands collapsed\n * properties on a fresh navigation (the schema mounts after the target is set),\n * not when the target changes for an already-mounted disclosure.\n */\nconst defaultOpen = computed(\n (): boolean =>\n noncollapsible || shouldForceExpand.value || isOnScrollTargetPath.value,\n)\n\n/** Gets the description to show for the schema */\nconst schemaDescription = computed(() => {\n if (hideDescription) {\n return null\n }\n\n // For the request body we want to show the base description or the first allOf schema description\n if (schema?.allOf && schema.allOf.length > 0 && name === 'Request Body') {\n return schema.description || schema.allOf[0]?.description || null\n }\n\n // Don't show description if there's no description or it's not a string\n if (!schema?.description || typeof schema.description !== 'string') {\n return null\n }\n\n // Don't show description for enum schemas (they have special handling)\n if (schema.enum) {\n return null\n }\n\n // Will be shown in the properties anyway\n if (\n !('properties' in schema) &&\n !('patternProperties' in schema) &&\n !('additionalProperties' in schema)\n ) {\n return null\n }\n\n // Return the schema's own description\n return schema.description\n})\n\n// Prevent click action if noncollapsible\nconst handleClick = (e: MouseEvent) => {\n if (noncollapsible) {\n e.stopPropagation()\n }\n}\n</script>\n<template>\n <Disclosure\n v-if=\"typeof schema === 'object' && Object.keys(schema).length\"\n v-slot=\"{ open }\"\n :defaultOpen=\"defaultOpen\">\n <div\n class=\"schema-card\"\n :class=\"[\n `schema-card--level-${level}`,\n { 'schema-card--compact': compact, 'schema-card--open': open },\n { 'border-t': additionalProperties && open },\n ]\">\n <!-- Schema description -->\n <div\n v-if=\"schemaDescription\"\n class=\"schema-card-description\">\n <ScalarMarkdown :value=\"schemaDescription\" />\n </div>\n <div\n v-if=\"isEmptySchemaObject(schema)\"\n class=\"pt-2\">\n Empty object\n </div>\n <div\n class=\"schema-properties\"\n :class=\"{\n 'schema-properties-open': open,\n }\">\n <!-- Toggle to collapse/expand long lists of properties -->\n <div\n v-if=\"additionalProperties\"\n v-show=\"!open\"\n class=\"schema-properties\">\n <DisclosureButton\n as=\"button\"\n class=\"schema-card-title schema-card-title--compact\"\n @click.capture=\"handleClick\">\n <ScalarIcon\n class=\"schema-card-title-icon\"\n icon=\"Add\"\n size=\"sm\" />\n Show additional properties\n <ScreenReader v-if=\"name\">for {{ name }}</ScreenReader>\n </DisclosureButton>\n </div>\n\n <DisclosureButton\n v-else-if=\"shouldShowToggle\"\n v-show=\"!hideHeading && !(noncollapsible && compact)\"\n :as=\"noncollapsible ? 'div' : 'button'\"\n class=\"schema-card-title\"\n :class=\"{ 'schema-card-title--compact': compact }\"\n :style=\"{\n top: `calc(var(--refs-viewport-offset) + calc(var(--schema-title-height) * ${level}))`,\n }\"\n @click.capture=\"handleClick\">\n <template v-if=\"compact\">\n <ScalarIcon\n class=\"schema-card-title-icon\"\n :class=\"{ 'schema-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <template v-if=\"open\">\n Hide {{ schema?.title ?? 'Child Attributes' }}\n </template>\n <template v-else>\n Show {{ schema?.title ?? 'Child Attributes' }}\n </template>\n <ScreenReader v-if=\"name\">for {{ name }}</ScreenReader>\n </template>\n <template v-else>\n <ScalarIcon\n class=\"schema-card-title-icon\"\n :class=\"{ 'schema-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <SchemaHeading\n :name=\"schema?.title ?? name\"\n :value=\"schema\" />\n </template>\n </DisclosureButton>\n <DisclosurePanel\n v-if=\"!additionalProperties || open\"\n as=\"ul\"\n :static=\"!shouldShowToggle\">\n <!-- Object properties -->\n <SchemaObjectProperties\n v-if=\"isTypeObject(schema)\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level=\"level + 1\"\n :options\n :schema\n :schemaContext=\"schemaContext\" />\n <!-- Not an object -->\n <template v-else>\n <SchemaProperty\n v-if=\"schema\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level\n :options\n :schema\n :schemaContext=\"schemaContext\" />\n </template>\n </DisclosurePanel>\n </div>\n </div>\n </Disclosure>\n</template>\n<style scoped>\n.error {\n background-color: var(--scalar-color-red);\n}\n.schema-card {\n font-size: var(--scalar-font-size-4);\n color: var(--scalar-color-1);\n}\n.schema-card-title {\n height: var(--schema-title-height);\n\n padding: 6px 8px;\n\n display: flex;\n align-items: center;\n gap: 4px;\n\n color: var(--scalar-color-2);\n font-weight: var(--scalar-semibold);\n font-size: var(--scalar-mini);\n border-bottom: var(--scalar-border-width) solid transparent;\n}\nbutton.schema-card-title {\n cursor: pointer;\n}\nbutton.schema-card-title:hover {\n color: var(--scalar-color-1);\n}\n.schema-card-title-icon--open {\n transform: rotate(45deg);\n}\n.schema-properties-open > .schema-card-title {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-properties-open > .schema-properties {\n width: fit-content;\n}\n.schema-card-description {\n color: var(--scalar-color-2);\n}\n.schema-card-description + .schema-properties {\n width: fit-content;\n}\n.schema-card-description + .schema-properties {\n margin-top: 8px;\n}\n.schema-card--level-0:nth-of-type(1)\n > .schema-card-description:has(+ .schema-properties) {\n margin-bottom: -8px;\n padding-bottom: 8px;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-card--level-0\n ~ .schema-card--level-0\n > .schema-card-description:has(+ .schema-properties) {\n padding-top: 8px;\n}\n\n.schema-properties-open.schema-properties,\n.schema-properties-open > .schema-card--open {\n width: 100%;\n}\n.schema-properties {\n display: flex;\n flex-direction: column;\n\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-radius: var(--scalar-radius-lg);\n width: fit-content;\n}\n.schema-properties-name {\n width: 100%;\n}\n.schema-properties .schema-properties {\n border-radius: 13.5px;\n}\n.schema-properties .schema-properties.schema-properties-open {\n border-radius: var(--scalar-radius-lg);\n}\n.schema-properties-open {\n width: 100%;\n}\n.schema-card--compact {\n align-self: flex-start;\n}\n.schema-card--compact.schema-card--open {\n align-self: initial;\n}\n.schema-card-title--compact {\n color: var(--scalar-color-2);\n padding: 6px 10px 6px 8px;\n height: auto;\n border-bottom: none;\n}\n.schema-card-title--compact > .schema-card-title-icon {\n margin: 0;\n}\n.schema-card-title--compact > .schema-card-title-icon--open {\n transform: rotate(45deg);\n}\n.schema-properties-open > .schema-card-title--compact {\n position: static;\n}\n.property--level-0\n > .schema-properties\n > .schema-card--level-0\n > .schema-properties {\n border: none;\n}\n.property--level-0\n .schema-card--level-0:not(.schema-card--compact)\n .property--level-1 {\n padding: 0 0 8px;\n}\n:not(.composition-panel)\n > .schema-card--compact.schema-card--level-0\n > .schema-properties {\n border: none;\n}\n:deep(.schema-card-description) p {\n font-size: var(--scalar-small, var(--scalar-paragraph));\n color: var(--scalar-color-2);\n margin-bottom: 0;\n display: block;\n margin-bottom: 6px;\n}\n.children .schema-card-description:first-of-type {\n padding-top: 0;\n}\n</style>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"Schema.vue.js","names":[],"sources":["../../../../src/components/Content/Schema/Schema.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, inject, provide } from 'vue'\n\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\nimport ScreenReader from '@/components/ScreenReader.vue'\nimport { scrollTargetId } from '@/helpers/lazy-bus'\n\nimport { isEmptySchemaObject } from './helpers/is-empty-schema-object'\nimport { isTypeObject } from './helpers/is-type-object'\nimport { mergeAllOfSchemas } from './helpers/merge-all-of-schemas'\nimport { SCHEMA_ANCESTORS_SYMBOL } from './helpers/schema-cycle'\nimport SchemaHeading from './SchemaHeading.vue'\nimport SchemaObjectProperties from './SchemaObjectProperties.vue'\nimport SchemaProperty from './SchemaProperty.vue'\n\nconst {\n schema,\n level = 0,\n name,\n compact,\n noncollapsible = false,\n hideHeading,\n hideDescription = false,\n additionalProperties,\n discriminator,\n breadcrumb,\n hideModelNames = false,\n options,\n schemaContext,\n compositionPath,\n cycleKey,\n} = defineProps<{\n schema?: SchemaObject\n /** Track how deep we've gone */\n level?: number\n /* Show as a heading */\n name?: string\n /** A tighter layout with less borders and without a heading */\n compact?: boolean\n /** Shows a toggle to hide/show children */\n noncollapsible?: boolean\n /** Hide the heading */\n hideHeading?: boolean\n /** Hide the schema description */\n hideDescription?: boolean\n /** Show a special one way toggle for additional properties, also has a top border when open */\n additionalProperties?: boolean\n /** Hide model names in type display */\n hideModelNames?: boolean\n /** Discriminator object */\n discriminator?: DiscriminatorObject\n /** Breadcrumb for the schema */\n breadcrumb?: string[]\n /** Event bus emitting actions */\n eventBus: WorkspaceEventBus | null\n /** Move the options into a single prop so they are easy to pass around */\n options: SchemaOptions\n /** When \"requestBody\", composition dropdown selection is synced with the example snippet */\n schemaContext?: string\n /** Internal path used to sync nested request body compositions with the code sample */\n compositionPath?: string[]\n /**\n * Stable identity of this schema node, derived from its raw (unresolved)\n * value by the parent. Used to detect self-referential cycles. See\n * {@link getCycleKey}.\n */\n cycleKey?: unknown\n}>()\n\n/**\n * Cycle-safe `expandAllSchemaProperties`.\n *\n * We track ancestor schema keys along the current render path. A node is\n * treated as cyclic when its key is already present in the ancestor set, which\n * indicates that rendering has looped back onto a self-referential schema.\n *\n * This lets us default-expand finite branches while stopping automatic\n * expansion only at cycle boundaries, preventing infinite recursion.\n */\nconst ancestors = inject(SCHEMA_ANCESTORS_SYMBOL, undefined)\n\nconst isCyclic = computed(\n (): boolean => cycleKey != null && !!ancestors?.has(cycleKey),\n)\n\n// Re-provide the ancestor set augmented with this node so descendants can\n// detect cycles back to it. Built once at setup; a node's key is stable.\nconst childAncestors = new Set<unknown>(ancestors ?? [])\nif (cycleKey != null) {\n childAncestors.add(cycleKey)\n}\nprovide(SCHEMA_ANCESTORS_SYMBOL, childAncestors)\n\nconst shouldForceExpand = computed(\n (): boolean => !!options.expandAllSchemaProperties && !isCyclic.value,\n)\n\n/**\n * Determines whether to show the collapse/expand toggle button.\n * We hide the toggle for non-collapsible schemas and root-level schemas.\n */\nconst shouldShowToggle = computed((): boolean => !noncollapsible && level > 0)\n\n/**\n * Whether this schema sits on the path to the current anchor/scroll target.\n *\n * Property anchors are dot-joined breadcrumbs, so every disclosure that wraps\n * the target has a breadcrumb that is a prefix of the target id. Opening those\n * disclosures is what makes deep links to collapsed (hidden) properties work\n * without forcing every schema open via `expandAllSchemaProperties`.\n */\nconst isOnScrollTargetPath = computed((): boolean => {\n if (!breadcrumb?.length) {\n return false\n }\n const path = breadcrumb.join('.')\n const target = scrollTargetId.value\n return target === path || target.startsWith(`${path}.`)\n})\n\n/**\n * Whether the disclosure starts expanded. Non-collapsible schemas are always\n * open. When `expandAllSchemaProperties` is enabled, finite branches start\n * expanded by default while cyclic branches remain collapsed to avoid recursion\n * loops. We also open any disclosure on the path to the current scroll target so\n * deep links resolve even when the property is collapsed.\n *\n * Note: the Disclosure only reads this at mount, so it expands collapsed\n * properties on a fresh navigation (the schema mounts after the target is set),\n * not when the target changes for an already-mounted disclosure.\n */\nconst defaultOpen = computed(\n (): boolean =>\n noncollapsible || shouldForceExpand.value || isOnScrollTargetPath.value,\n)\n\n/** Gets the description to show for the schema */\nconst schemaDescription = computed(() => {\n if (hideDescription) {\n return null\n }\n\n // For the request body we want to show the description of the merged allOf schema.\n // Merging keeps the base description (when set) and otherwise lets the last allOf\n // member win, matching how the merged composition is rendered below. The nested\n // merged Schema in `SchemaComposition` hides its own description in this case so\n // the text is not rendered twice.\n if (schema?.allOf && schema.allOf.length > 0 && name === 'Request Body') {\n return mergeAllOfSchemas(schema)?.description || null\n }\n\n // Don't show description if there's no description or it's not a string\n if (!schema?.description || typeof schema.description !== 'string') {\n return null\n }\n\n // Don't show description for enum schemas (they have special handling)\n if (schema.enum) {\n return null\n }\n\n // Will be shown in the properties anyway\n if (\n !('properties' in schema) &&\n !('patternProperties' in schema) &&\n !('additionalProperties' in schema)\n ) {\n return null\n }\n\n // Return the schema's own description\n return schema.description\n})\n\n// Prevent click action if noncollapsible\nconst handleClick = (e: MouseEvent) => {\n if (noncollapsible) {\n e.stopPropagation()\n }\n}\n</script>\n<template>\n <Disclosure\n v-if=\"typeof schema === 'object' && Object.keys(schema).length\"\n v-slot=\"{ open }\"\n :defaultOpen=\"defaultOpen\">\n <div\n class=\"schema-card\"\n :class=\"[\n `schema-card--level-${level}`,\n { 'schema-card--compact': compact, 'schema-card--open': open },\n { 'border-t': additionalProperties && open },\n ]\">\n <!-- Schema description -->\n <div\n v-if=\"schemaDescription\"\n class=\"schema-card-description\">\n <ScalarMarkdown :value=\"schemaDescription\" />\n </div>\n <div\n v-if=\"isEmptySchemaObject(schema)\"\n class=\"pt-2\">\n Empty object\n </div>\n <div\n class=\"schema-properties\"\n :class=\"{\n 'schema-properties-open': open,\n }\">\n <!-- Toggle to collapse/expand long lists of properties -->\n <div\n v-if=\"additionalProperties\"\n v-show=\"!open\"\n class=\"schema-properties\">\n <DisclosureButton\n as=\"button\"\n class=\"schema-card-title schema-card-title--compact\"\n @click.capture=\"handleClick\">\n <ScalarIcon\n class=\"schema-card-title-icon\"\n icon=\"Add\"\n size=\"sm\" />\n Show additional properties\n <ScreenReader v-if=\"name\">for {{ name }}</ScreenReader>\n </DisclosureButton>\n </div>\n\n <DisclosureButton\n v-else-if=\"shouldShowToggle\"\n v-show=\"!hideHeading && !(noncollapsible && compact)\"\n :as=\"noncollapsible ? 'div' : 'button'\"\n class=\"schema-card-title\"\n :class=\"{ 'schema-card-title--compact': compact }\"\n :style=\"{\n top: `calc(var(--refs-viewport-offset) + calc(var(--schema-title-height) * ${level}))`,\n }\"\n @click.capture=\"handleClick\">\n <template v-if=\"compact\">\n <ScalarIcon\n class=\"schema-card-title-icon\"\n :class=\"{ 'schema-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <template v-if=\"open\">\n Hide {{ schema?.title ?? 'Child Attributes' }}\n </template>\n <template v-else>\n Show {{ schema?.title ?? 'Child Attributes' }}\n </template>\n <ScreenReader v-if=\"name\">for {{ name }}</ScreenReader>\n </template>\n <template v-else>\n <ScalarIcon\n class=\"schema-card-title-icon\"\n :class=\"{ 'schema-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <SchemaHeading\n :name=\"schema?.title ?? name\"\n :value=\"schema\" />\n </template>\n </DisclosureButton>\n <DisclosurePanel\n v-if=\"!additionalProperties || open\"\n as=\"ul\"\n :static=\"!shouldShowToggle\">\n <!-- Object properties -->\n <SchemaObjectProperties\n v-if=\"isTypeObject(schema)\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level=\"level + 1\"\n :options\n :schema\n :schemaContext=\"schemaContext\" />\n <!-- Not an object -->\n <template v-else>\n <SchemaProperty\n v-if=\"schema\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level\n :options\n :schema\n :schemaContext=\"schemaContext\" />\n </template>\n </DisclosurePanel>\n </div>\n </div>\n </Disclosure>\n</template>\n<style scoped>\n.error {\n background-color: var(--scalar-color-red);\n}\n.schema-card {\n font-size: var(--scalar-font-size-4);\n color: var(--scalar-color-1);\n}\n.schema-card-title {\n height: var(--schema-title-height);\n\n padding: 6px 8px;\n\n display: flex;\n align-items: center;\n gap: 4px;\n\n color: var(--scalar-color-2);\n font-weight: var(--scalar-semibold);\n font-size: var(--scalar-mini);\n border-bottom: var(--scalar-border-width) solid transparent;\n}\nbutton.schema-card-title {\n cursor: pointer;\n}\nbutton.schema-card-title:hover {\n color: var(--scalar-color-1);\n}\n.schema-card-title-icon--open {\n transform: rotate(45deg);\n}\n.schema-properties-open > .schema-card-title {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-properties-open > .schema-properties {\n width: fit-content;\n}\n.schema-card-description {\n color: var(--scalar-color-2);\n}\n.schema-card-description + .schema-properties {\n width: fit-content;\n}\n.schema-card-description + .schema-properties {\n margin-top: 8px;\n}\n.schema-card--level-0:nth-of-type(1)\n > .schema-card-description:has(+ .schema-properties) {\n margin-bottom: -8px;\n padding-bottom: 8px;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-card--level-0\n ~ .schema-card--level-0\n > .schema-card-description:has(+ .schema-properties) {\n padding-top: 8px;\n}\n\n.schema-properties-open.schema-properties,\n.schema-properties-open > .schema-card--open {\n width: 100%;\n}\n.schema-properties {\n display: flex;\n flex-direction: column;\n\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-radius: var(--scalar-radius-lg);\n width: fit-content;\n}\n.schema-properties-name {\n width: 100%;\n}\n.schema-properties .schema-properties {\n border-radius: 13.5px;\n}\n.schema-properties .schema-properties.schema-properties-open {\n border-radius: var(--scalar-radius-lg);\n}\n.schema-properties-open {\n width: 100%;\n}\n.schema-card--compact {\n align-self: flex-start;\n}\n.schema-card--compact.schema-card--open {\n align-self: initial;\n}\n.schema-card-title--compact {\n color: var(--scalar-color-2);\n padding: 6px 10px 6px 8px;\n height: auto;\n border-bottom: none;\n}\n.schema-card-title--compact > .schema-card-title-icon {\n margin: 0;\n}\n.schema-card-title--compact > .schema-card-title-icon--open {\n transform: rotate(45deg);\n}\n.schema-properties-open > .schema-card-title--compact {\n position: static;\n}\n.property--level-0\n > .schema-properties\n > .schema-card--level-0\n > .schema-properties {\n border: none;\n}\n.property--level-0\n .schema-card--level-0:not(.schema-card--compact)\n .property--level-1 {\n padding: 0 0 8px;\n}\n:not(.composition-panel)\n > .schema-card--compact.schema-card--level-0\n > .schema-properties {\n border: none;\n}\n:deep(.schema-card-description) p {\n font-size: var(--scalar-small, var(--scalar-paragraph));\n color: var(--scalar-color-2);\n margin-bottom: 0;\n display: block;\n margin-bottom: 6px;\n}\n.children .schema-card-description:first-of-type {\n padding-top: 0;\n}\n</style>\n"],"mappings":""}
|
|
@@ -2,6 +2,7 @@ import ScreenReader_default from "../../ScreenReader.vue.js";
|
|
|
2
2
|
import { scrollTargetId } from "../../../helpers/lazy-bus.js";
|
|
3
3
|
import { isTypeObject } from "./helpers/is-type-object.js";
|
|
4
4
|
import { isEmptySchemaObject } from "./helpers/is-empty-schema-object.js";
|
|
5
|
+
import { mergeAllOfSchemas } from "./helpers/merge-all-of-schemas.js";
|
|
5
6
|
import { SCHEMA_ANCESTORS_SYMBOL } from "./helpers/schema-cycle.js";
|
|
6
7
|
import SchemaHeading_default from "./SchemaHeading.vue.js";
|
|
7
8
|
import SchemaProperty_default from "./SchemaProperty.vue.js";
|
|
@@ -103,7 +104,7 @@ var Schema_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
103
104
|
/** Gets the description to show for the schema */
|
|
104
105
|
const schemaDescription = computed(() => {
|
|
105
106
|
if (__props.hideDescription) return null;
|
|
106
|
-
if (__props.schema?.allOf && __props.schema.allOf.length > 0 && __props.name === "Request Body") return __props.schema
|
|
107
|
+
if (__props.schema?.allOf && __props.schema.allOf.length > 0 && __props.name === "Request Body") return mergeAllOfSchemas(__props.schema)?.description || null;
|
|
107
108
|
if (!__props.schema?.description || typeof __props.schema.description !== "string") return null;
|
|
108
109
|
if (__props.schema.enum) return null;
|
|
109
110
|
if (!("properties" in __props.schema) && !("patternProperties" in __props.schema) && !("additionalProperties" in __props.schema)) return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Schema.vue.script.js","names":[],"sources":["../../../../src/components/Content/Schema/Schema.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, inject, provide } from 'vue'\n\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\nimport ScreenReader from '@/components/ScreenReader.vue'\nimport { scrollTargetId } from '@/helpers/lazy-bus'\n\nimport { isEmptySchemaObject } from './helpers/is-empty-schema-object'\nimport { isTypeObject } from './helpers/is-type-object'\nimport { SCHEMA_ANCESTORS_SYMBOL } from './helpers/schema-cycle'\nimport SchemaHeading from './SchemaHeading.vue'\nimport SchemaObjectProperties from './SchemaObjectProperties.vue'\nimport SchemaProperty from './SchemaProperty.vue'\n\nconst {\n schema,\n level = 0,\n name,\n compact,\n noncollapsible = false,\n hideHeading,\n hideDescription = false,\n additionalProperties,\n discriminator,\n breadcrumb,\n hideModelNames = false,\n options,\n schemaContext,\n compositionPath,\n cycleKey,\n} = defineProps<{\n schema?: SchemaObject\n /** Track how deep we've gone */\n level?: number\n /* Show as a heading */\n name?: string\n /** A tighter layout with less borders and without a heading */\n compact?: boolean\n /** Shows a toggle to hide/show children */\n noncollapsible?: boolean\n /** Hide the heading */\n hideHeading?: boolean\n /** Hide the schema description */\n hideDescription?: boolean\n /** Show a special one way toggle for additional properties, also has a top border when open */\n additionalProperties?: boolean\n /** Hide model names in type display */\n hideModelNames?: boolean\n /** Discriminator object */\n discriminator?: DiscriminatorObject\n /** Breadcrumb for the schema */\n breadcrumb?: string[]\n /** Event bus emitting actions */\n eventBus: WorkspaceEventBus | null\n /** Move the options into a single prop so they are easy to pass around */\n options: SchemaOptions\n /** When \"requestBody\", composition dropdown selection is synced with the example snippet */\n schemaContext?: string\n /** Internal path used to sync nested request body compositions with the code sample */\n compositionPath?: string[]\n /**\n * Stable identity of this schema node, derived from its raw (unresolved)\n * value by the parent. Used to detect self-referential cycles. See\n * {@link getCycleKey}.\n */\n cycleKey?: unknown\n}>()\n\n/**\n * Cycle-safe `expandAllSchemaProperties`.\n *\n * We track ancestor schema keys along the current render path. A node is\n * treated as cyclic when its key is already present in the ancestor set, which\n * indicates that rendering has looped back onto a self-referential schema.\n *\n * This lets us default-expand finite branches while stopping automatic\n * expansion only at cycle boundaries, preventing infinite recursion.\n */\nconst ancestors = inject(SCHEMA_ANCESTORS_SYMBOL, undefined)\n\nconst isCyclic = computed(\n (): boolean => cycleKey != null && !!ancestors?.has(cycleKey),\n)\n\n// Re-provide the ancestor set augmented with this node so descendants can\n// detect cycles back to it. Built once at setup; a node's key is stable.\nconst childAncestors = new Set<unknown>(ancestors ?? [])\nif (cycleKey != null) {\n childAncestors.add(cycleKey)\n}\nprovide(SCHEMA_ANCESTORS_SYMBOL, childAncestors)\n\nconst shouldForceExpand = computed(\n (): boolean => !!options.expandAllSchemaProperties && !isCyclic.value,\n)\n\n/**\n * Determines whether to show the collapse/expand toggle button.\n * We hide the toggle for non-collapsible schemas and root-level schemas.\n */\nconst shouldShowToggle = computed((): boolean => !noncollapsible && level > 0)\n\n/**\n * Whether this schema sits on the path to the current anchor/scroll target.\n *\n * Property anchors are dot-joined breadcrumbs, so every disclosure that wraps\n * the target has a breadcrumb that is a prefix of the target id. Opening those\n * disclosures is what makes deep links to collapsed (hidden) properties work\n * without forcing every schema open via `expandAllSchemaProperties`.\n */\nconst isOnScrollTargetPath = computed((): boolean => {\n if (!breadcrumb?.length) {\n return false\n }\n const path = breadcrumb.join('.')\n const target = scrollTargetId.value\n return target === path || target.startsWith(`${path}.`)\n})\n\n/**\n * Whether the disclosure starts expanded. Non-collapsible schemas are always\n * open. When `expandAllSchemaProperties` is enabled, finite branches start\n * expanded by default while cyclic branches remain collapsed to avoid recursion\n * loops. We also open any disclosure on the path to the current scroll target so\n * deep links resolve even when the property is collapsed.\n *\n * Note: the Disclosure only reads this at mount, so it expands collapsed\n * properties on a fresh navigation (the schema mounts after the target is set),\n * not when the target changes for an already-mounted disclosure.\n */\nconst defaultOpen = computed(\n (): boolean =>\n noncollapsible || shouldForceExpand.value || isOnScrollTargetPath.value,\n)\n\n/** Gets the description to show for the schema */\nconst schemaDescription = computed(() => {\n if (hideDescription) {\n return null\n }\n\n // For the request body we want to show the base description or the first allOf schema description\n if (schema?.allOf && schema.allOf.length > 0 && name === 'Request Body') {\n return schema.description || schema.allOf[0]?.description || null\n }\n\n // Don't show description if there's no description or it's not a string\n if (!schema?.description || typeof schema.description !== 'string') {\n return null\n }\n\n // Don't show description for enum schemas (they have special handling)\n if (schema.enum) {\n return null\n }\n\n // Will be shown in the properties anyway\n if (\n !('properties' in schema) &&\n !('patternProperties' in schema) &&\n !('additionalProperties' in schema)\n ) {\n return null\n }\n\n // Return the schema's own description\n return schema.description\n})\n\n// Prevent click action if noncollapsible\nconst handleClick = (e: MouseEvent) => {\n if (noncollapsible) {\n e.stopPropagation()\n }\n}\n</script>\n<template>\n <Disclosure\n v-if=\"typeof schema === 'object' && Object.keys(schema).length\"\n v-slot=\"{ open }\"\n :defaultOpen=\"defaultOpen\">\n <div\n class=\"schema-card\"\n :class=\"[\n `schema-card--level-${level}`,\n { 'schema-card--compact': compact, 'schema-card--open': open },\n { 'border-t': additionalProperties && open },\n ]\">\n <!-- Schema description -->\n <div\n v-if=\"schemaDescription\"\n class=\"schema-card-description\">\n <ScalarMarkdown :value=\"schemaDescription\" />\n </div>\n <div\n v-if=\"isEmptySchemaObject(schema)\"\n class=\"pt-2\">\n Empty object\n </div>\n <div\n class=\"schema-properties\"\n :class=\"{\n 'schema-properties-open': open,\n }\">\n <!-- Toggle to collapse/expand long lists of properties -->\n <div\n v-if=\"additionalProperties\"\n v-show=\"!open\"\n class=\"schema-properties\">\n <DisclosureButton\n as=\"button\"\n class=\"schema-card-title schema-card-title--compact\"\n @click.capture=\"handleClick\">\n <ScalarIcon\n class=\"schema-card-title-icon\"\n icon=\"Add\"\n size=\"sm\" />\n Show additional properties\n <ScreenReader v-if=\"name\">for {{ name }}</ScreenReader>\n </DisclosureButton>\n </div>\n\n <DisclosureButton\n v-else-if=\"shouldShowToggle\"\n v-show=\"!hideHeading && !(noncollapsible && compact)\"\n :as=\"noncollapsible ? 'div' : 'button'\"\n class=\"schema-card-title\"\n :class=\"{ 'schema-card-title--compact': compact }\"\n :style=\"{\n top: `calc(var(--refs-viewport-offset) + calc(var(--schema-title-height) * ${level}))`,\n }\"\n @click.capture=\"handleClick\">\n <template v-if=\"compact\">\n <ScalarIcon\n class=\"schema-card-title-icon\"\n :class=\"{ 'schema-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <template v-if=\"open\">\n Hide {{ schema?.title ?? 'Child Attributes' }}\n </template>\n <template v-else>\n Show {{ schema?.title ?? 'Child Attributes' }}\n </template>\n <ScreenReader v-if=\"name\">for {{ name }}</ScreenReader>\n </template>\n <template v-else>\n <ScalarIcon\n class=\"schema-card-title-icon\"\n :class=\"{ 'schema-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <SchemaHeading\n :name=\"schema?.title ?? name\"\n :value=\"schema\" />\n </template>\n </DisclosureButton>\n <DisclosurePanel\n v-if=\"!additionalProperties || open\"\n as=\"ul\"\n :static=\"!shouldShowToggle\">\n <!-- Object properties -->\n <SchemaObjectProperties\n v-if=\"isTypeObject(schema)\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level=\"level + 1\"\n :options\n :schema\n :schemaContext=\"schemaContext\" />\n <!-- Not an object -->\n <template v-else>\n <SchemaProperty\n v-if=\"schema\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level\n :options\n :schema\n :schemaContext=\"schemaContext\" />\n </template>\n </DisclosurePanel>\n </div>\n </div>\n </Disclosure>\n</template>\n<style scoped>\n.error {\n background-color: var(--scalar-color-red);\n}\n.schema-card {\n font-size: var(--scalar-font-size-4);\n color: var(--scalar-color-1);\n}\n.schema-card-title {\n height: var(--schema-title-height);\n\n padding: 6px 8px;\n\n display: flex;\n align-items: center;\n gap: 4px;\n\n color: var(--scalar-color-2);\n font-weight: var(--scalar-semibold);\n font-size: var(--scalar-mini);\n border-bottom: var(--scalar-border-width) solid transparent;\n}\nbutton.schema-card-title {\n cursor: pointer;\n}\nbutton.schema-card-title:hover {\n color: var(--scalar-color-1);\n}\n.schema-card-title-icon--open {\n transform: rotate(45deg);\n}\n.schema-properties-open > .schema-card-title {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-properties-open > .schema-properties {\n width: fit-content;\n}\n.schema-card-description {\n color: var(--scalar-color-2);\n}\n.schema-card-description + .schema-properties {\n width: fit-content;\n}\n.schema-card-description + .schema-properties {\n margin-top: 8px;\n}\n.schema-card--level-0:nth-of-type(1)\n > .schema-card-description:has(+ .schema-properties) {\n margin-bottom: -8px;\n padding-bottom: 8px;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-card--level-0\n ~ .schema-card--level-0\n > .schema-card-description:has(+ .schema-properties) {\n padding-top: 8px;\n}\n\n.schema-properties-open.schema-properties,\n.schema-properties-open > .schema-card--open {\n width: 100%;\n}\n.schema-properties {\n display: flex;\n flex-direction: column;\n\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-radius: var(--scalar-radius-lg);\n width: fit-content;\n}\n.schema-properties-name {\n width: 100%;\n}\n.schema-properties .schema-properties {\n border-radius: 13.5px;\n}\n.schema-properties .schema-properties.schema-properties-open {\n border-radius: var(--scalar-radius-lg);\n}\n.schema-properties-open {\n width: 100%;\n}\n.schema-card--compact {\n align-self: flex-start;\n}\n.schema-card--compact.schema-card--open {\n align-self: initial;\n}\n.schema-card-title--compact {\n color: var(--scalar-color-2);\n padding: 6px 10px 6px 8px;\n height: auto;\n border-bottom: none;\n}\n.schema-card-title--compact > .schema-card-title-icon {\n margin: 0;\n}\n.schema-card-title--compact > .schema-card-title-icon--open {\n transform: rotate(45deg);\n}\n.schema-properties-open > .schema-card-title--compact {\n position: static;\n}\n.property--level-0\n > .schema-properties\n > .schema-card--level-0\n > .schema-properties {\n border: none;\n}\n.property--level-0\n .schema-card--level-0:not(.schema-card--compact)\n .property--level-1 {\n padding: 0 0 8px;\n}\n:not(.composition-panel)\n > .schema-card--compact.schema-card--level-0\n > .schema-properties {\n border: none;\n}\n:deep(.schema-card-description) p {\n font-size: var(--scalar-small, var(--scalar-paragraph));\n color: var(--scalar-color-2);\n margin-bottom: 0;\n display: block;\n margin-bottom: 6px;\n}\n.children .schema-card-description:first-of-type {\n padding-top: 0;\n}\n</style>\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"Schema.vue.script.js","names":[],"sources":["../../../../src/components/Content/Schema/Schema.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, inject, provide } from 'vue'\n\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\nimport ScreenReader from '@/components/ScreenReader.vue'\nimport { scrollTargetId } from '@/helpers/lazy-bus'\n\nimport { isEmptySchemaObject } from './helpers/is-empty-schema-object'\nimport { isTypeObject } from './helpers/is-type-object'\nimport { mergeAllOfSchemas } from './helpers/merge-all-of-schemas'\nimport { SCHEMA_ANCESTORS_SYMBOL } from './helpers/schema-cycle'\nimport SchemaHeading from './SchemaHeading.vue'\nimport SchemaObjectProperties from './SchemaObjectProperties.vue'\nimport SchemaProperty from './SchemaProperty.vue'\n\nconst {\n schema,\n level = 0,\n name,\n compact,\n noncollapsible = false,\n hideHeading,\n hideDescription = false,\n additionalProperties,\n discriminator,\n breadcrumb,\n hideModelNames = false,\n options,\n schemaContext,\n compositionPath,\n cycleKey,\n} = defineProps<{\n schema?: SchemaObject\n /** Track how deep we've gone */\n level?: number\n /* Show as a heading */\n name?: string\n /** A tighter layout with less borders and without a heading */\n compact?: boolean\n /** Shows a toggle to hide/show children */\n noncollapsible?: boolean\n /** Hide the heading */\n hideHeading?: boolean\n /** Hide the schema description */\n hideDescription?: boolean\n /** Show a special one way toggle for additional properties, also has a top border when open */\n additionalProperties?: boolean\n /** Hide model names in type display */\n hideModelNames?: boolean\n /** Discriminator object */\n discriminator?: DiscriminatorObject\n /** Breadcrumb for the schema */\n breadcrumb?: string[]\n /** Event bus emitting actions */\n eventBus: WorkspaceEventBus | null\n /** Move the options into a single prop so they are easy to pass around */\n options: SchemaOptions\n /** When \"requestBody\", composition dropdown selection is synced with the example snippet */\n schemaContext?: string\n /** Internal path used to sync nested request body compositions with the code sample */\n compositionPath?: string[]\n /**\n * Stable identity of this schema node, derived from its raw (unresolved)\n * value by the parent. Used to detect self-referential cycles. See\n * {@link getCycleKey}.\n */\n cycleKey?: unknown\n}>()\n\n/**\n * Cycle-safe `expandAllSchemaProperties`.\n *\n * We track ancestor schema keys along the current render path. A node is\n * treated as cyclic when its key is already present in the ancestor set, which\n * indicates that rendering has looped back onto a self-referential schema.\n *\n * This lets us default-expand finite branches while stopping automatic\n * expansion only at cycle boundaries, preventing infinite recursion.\n */\nconst ancestors = inject(SCHEMA_ANCESTORS_SYMBOL, undefined)\n\nconst isCyclic = computed(\n (): boolean => cycleKey != null && !!ancestors?.has(cycleKey),\n)\n\n// Re-provide the ancestor set augmented with this node so descendants can\n// detect cycles back to it. Built once at setup; a node's key is stable.\nconst childAncestors = new Set<unknown>(ancestors ?? [])\nif (cycleKey != null) {\n childAncestors.add(cycleKey)\n}\nprovide(SCHEMA_ANCESTORS_SYMBOL, childAncestors)\n\nconst shouldForceExpand = computed(\n (): boolean => !!options.expandAllSchemaProperties && !isCyclic.value,\n)\n\n/**\n * Determines whether to show the collapse/expand toggle button.\n * We hide the toggle for non-collapsible schemas and root-level schemas.\n */\nconst shouldShowToggle = computed((): boolean => !noncollapsible && level > 0)\n\n/**\n * Whether this schema sits on the path to the current anchor/scroll target.\n *\n * Property anchors are dot-joined breadcrumbs, so every disclosure that wraps\n * the target has a breadcrumb that is a prefix of the target id. Opening those\n * disclosures is what makes deep links to collapsed (hidden) properties work\n * without forcing every schema open via `expandAllSchemaProperties`.\n */\nconst isOnScrollTargetPath = computed((): boolean => {\n if (!breadcrumb?.length) {\n return false\n }\n const path = breadcrumb.join('.')\n const target = scrollTargetId.value\n return target === path || target.startsWith(`${path}.`)\n})\n\n/**\n * Whether the disclosure starts expanded. Non-collapsible schemas are always\n * open. When `expandAllSchemaProperties` is enabled, finite branches start\n * expanded by default while cyclic branches remain collapsed to avoid recursion\n * loops. We also open any disclosure on the path to the current scroll target so\n * deep links resolve even when the property is collapsed.\n *\n * Note: the Disclosure only reads this at mount, so it expands collapsed\n * properties on a fresh navigation (the schema mounts after the target is set),\n * not when the target changes for an already-mounted disclosure.\n */\nconst defaultOpen = computed(\n (): boolean =>\n noncollapsible || shouldForceExpand.value || isOnScrollTargetPath.value,\n)\n\n/** Gets the description to show for the schema */\nconst schemaDescription = computed(() => {\n if (hideDescription) {\n return null\n }\n\n // For the request body we want to show the description of the merged allOf schema.\n // Merging keeps the base description (when set) and otherwise lets the last allOf\n // member win, matching how the merged composition is rendered below. The nested\n // merged Schema in `SchemaComposition` hides its own description in this case so\n // the text is not rendered twice.\n if (schema?.allOf && schema.allOf.length > 0 && name === 'Request Body') {\n return mergeAllOfSchemas(schema)?.description || null\n }\n\n // Don't show description if there's no description or it's not a string\n if (!schema?.description || typeof schema.description !== 'string') {\n return null\n }\n\n // Don't show description for enum schemas (they have special handling)\n if (schema.enum) {\n return null\n }\n\n // Will be shown in the properties anyway\n if (\n !('properties' in schema) &&\n !('patternProperties' in schema) &&\n !('additionalProperties' in schema)\n ) {\n return null\n }\n\n // Return the schema's own description\n return schema.description\n})\n\n// Prevent click action if noncollapsible\nconst handleClick = (e: MouseEvent) => {\n if (noncollapsible) {\n e.stopPropagation()\n }\n}\n</script>\n<template>\n <Disclosure\n v-if=\"typeof schema === 'object' && Object.keys(schema).length\"\n v-slot=\"{ open }\"\n :defaultOpen=\"defaultOpen\">\n <div\n class=\"schema-card\"\n :class=\"[\n `schema-card--level-${level}`,\n { 'schema-card--compact': compact, 'schema-card--open': open },\n { 'border-t': additionalProperties && open },\n ]\">\n <!-- Schema description -->\n <div\n v-if=\"schemaDescription\"\n class=\"schema-card-description\">\n <ScalarMarkdown :value=\"schemaDescription\" />\n </div>\n <div\n v-if=\"isEmptySchemaObject(schema)\"\n class=\"pt-2\">\n Empty object\n </div>\n <div\n class=\"schema-properties\"\n :class=\"{\n 'schema-properties-open': open,\n }\">\n <!-- Toggle to collapse/expand long lists of properties -->\n <div\n v-if=\"additionalProperties\"\n v-show=\"!open\"\n class=\"schema-properties\">\n <DisclosureButton\n as=\"button\"\n class=\"schema-card-title schema-card-title--compact\"\n @click.capture=\"handleClick\">\n <ScalarIcon\n class=\"schema-card-title-icon\"\n icon=\"Add\"\n size=\"sm\" />\n Show additional properties\n <ScreenReader v-if=\"name\">for {{ name }}</ScreenReader>\n </DisclosureButton>\n </div>\n\n <DisclosureButton\n v-else-if=\"shouldShowToggle\"\n v-show=\"!hideHeading && !(noncollapsible && compact)\"\n :as=\"noncollapsible ? 'div' : 'button'\"\n class=\"schema-card-title\"\n :class=\"{ 'schema-card-title--compact': compact }\"\n :style=\"{\n top: `calc(var(--refs-viewport-offset) + calc(var(--schema-title-height) * ${level}))`,\n }\"\n @click.capture=\"handleClick\">\n <template v-if=\"compact\">\n <ScalarIcon\n class=\"schema-card-title-icon\"\n :class=\"{ 'schema-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <template v-if=\"open\">\n Hide {{ schema?.title ?? 'Child Attributes' }}\n </template>\n <template v-else>\n Show {{ schema?.title ?? 'Child Attributes' }}\n </template>\n <ScreenReader v-if=\"name\">for {{ name }}</ScreenReader>\n </template>\n <template v-else>\n <ScalarIcon\n class=\"schema-card-title-icon\"\n :class=\"{ 'schema-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <SchemaHeading\n :name=\"schema?.title ?? name\"\n :value=\"schema\" />\n </template>\n </DisclosureButton>\n <DisclosurePanel\n v-if=\"!additionalProperties || open\"\n as=\"ul\"\n :static=\"!shouldShowToggle\">\n <!-- Object properties -->\n <SchemaObjectProperties\n v-if=\"isTypeObject(schema)\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level=\"level + 1\"\n :options\n :schema\n :schemaContext=\"schemaContext\" />\n <!-- Not an object -->\n <template v-else>\n <SchemaProperty\n v-if=\"schema\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level\n :options\n :schema\n :schemaContext=\"schemaContext\" />\n </template>\n </DisclosurePanel>\n </div>\n </div>\n </Disclosure>\n</template>\n<style scoped>\n.error {\n background-color: var(--scalar-color-red);\n}\n.schema-card {\n font-size: var(--scalar-font-size-4);\n color: var(--scalar-color-1);\n}\n.schema-card-title {\n height: var(--schema-title-height);\n\n padding: 6px 8px;\n\n display: flex;\n align-items: center;\n gap: 4px;\n\n color: var(--scalar-color-2);\n font-weight: var(--scalar-semibold);\n font-size: var(--scalar-mini);\n border-bottom: var(--scalar-border-width) solid transparent;\n}\nbutton.schema-card-title {\n cursor: pointer;\n}\nbutton.schema-card-title:hover {\n color: var(--scalar-color-1);\n}\n.schema-card-title-icon--open {\n transform: rotate(45deg);\n}\n.schema-properties-open > .schema-card-title {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-properties-open > .schema-properties {\n width: fit-content;\n}\n.schema-card-description {\n color: var(--scalar-color-2);\n}\n.schema-card-description + .schema-properties {\n width: fit-content;\n}\n.schema-card-description + .schema-properties {\n margin-top: 8px;\n}\n.schema-card--level-0:nth-of-type(1)\n > .schema-card-description:has(+ .schema-properties) {\n margin-bottom: -8px;\n padding-bottom: 8px;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-card--level-0\n ~ .schema-card--level-0\n > .schema-card-description:has(+ .schema-properties) {\n padding-top: 8px;\n}\n\n.schema-properties-open.schema-properties,\n.schema-properties-open > .schema-card--open {\n width: 100%;\n}\n.schema-properties {\n display: flex;\n flex-direction: column;\n\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-radius: var(--scalar-radius-lg);\n width: fit-content;\n}\n.schema-properties-name {\n width: 100%;\n}\n.schema-properties .schema-properties {\n border-radius: 13.5px;\n}\n.schema-properties .schema-properties.schema-properties-open {\n border-radius: var(--scalar-radius-lg);\n}\n.schema-properties-open {\n width: 100%;\n}\n.schema-card--compact {\n align-self: flex-start;\n}\n.schema-card--compact.schema-card--open {\n align-self: initial;\n}\n.schema-card-title--compact {\n color: var(--scalar-color-2);\n padding: 6px 10px 6px 8px;\n height: auto;\n border-bottom: none;\n}\n.schema-card-title--compact > .schema-card-title-icon {\n margin: 0;\n}\n.schema-card-title--compact > .schema-card-title-icon--open {\n transform: rotate(45deg);\n}\n.schema-properties-open > .schema-card-title--compact {\n position: static;\n}\n.property--level-0\n > .schema-properties\n > .schema-card--level-0\n > .schema-properties {\n border: none;\n}\n.property--level-0\n .schema-card--level-0:not(.schema-card--compact)\n .property--level-1 {\n padding: 0 0 8px;\n}\n:not(.composition-panel)\n > .schema-card--compact.schema-card--level-0\n > .schema-properties {\n border: none;\n}\n:deep(.schema-card-description) p {\n font-size: var(--scalar-small, var(--scalar-paragraph));\n color: var(--scalar-color-2);\n margin-bottom: 0;\n display: block;\n margin-bottom: 6px;\n}\n.children .schema-card-description:first-of-type {\n padding-top: 0;\n}\n</style>\n"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaComposition.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaComposition.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SchemaComposition.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaComposition.vue"],"names":[],"mappings":"AAySA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAGrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AAQtE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAKtE,KAAK,WAAW,GAAG;IACf,oDAAoD;IACpD,WAAW,EAAE,kBAAkB,CAAA;IAC/B,4DAA4D;IAC5D,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,mCAAmC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,kDAAkD;IAClD,MAAM,EAAE,YAAY,CAAA;IACpB,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAA;IACb,oCAAoC;IACpC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,kCAAkC;IAClC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,uCAAuC;IACvC,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,gCAAgC;IAChC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,iCAAiC;IACjC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,yEAAyE;IACzE,OAAO,EAAE,aAAa,CAAA;IACtB,uEAAuE;IACvE,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,uFAAuF;IACvF,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;CAC3B,CAAC;AA0XJ,QAAA,MAAM,YAAY;aAzYJ,OAAO;iBAEH,OAAO;6EA0YvB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|