@scalar/sidebar 0.12.12 → 0.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"SidebarItem.vue.d.ts","sourceRoot":"","sources":["../../src/components/SidebarItem.vue"],"names":[],"mappings":"AAqfA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACzB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAK3D,KAAK,WAAW,GAAG;IACjB;;OAEG;IACH,IAAI,EAAE,IAAI,CAAA;IACV;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAA;IACnC;;OAEG;IACH,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAA;IACnC;;;OAGG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IAExB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,MAAM,GAAG,SAAS,CAAA;IAE5C;;;;OAIG;IACH,WAAW,CAAC,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAA;IAChD;;;;OAIG;IACH,WAAW,CAAC,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAA;CACjD,CAAC;AAkCF,KAAK,WAAW,GAAG;IACjB;;;OAGG;IACH,SAAS,CAAC,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,IAAI,CAAA;KAAE,GAAG,OAAO,CAAA;IAC1C;;;OAGG;IACH,KAAK,CAAC,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,IAAI,CAAA;KAAE,GAAG,OAAO,CAAA;IACtC;;;OAGG;IACH,IAAI,CAAC,CAAC,KAAK,EAAE;QAAE,IAAI,EA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C,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,IAAI,CAAA;KAAE,GAAG,OAAO,CAAA;IAC1C;;;OAGG;IACH,KAAK,CAAC,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,IAAI,CAAA;KAAE,GAAG,OAAO,CAAA;IACtC;;;OAGG;IACH,IAAI,CAAC,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,IAAI,CAAC;QAAC,IAAI,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAA;CACrD,CAAC;AAu1BF,QAAA,MAAM,UAAU;;;;;;;;kFAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -4,6 +4,7 @@ import { hasChildren } from "../helpers/has-children.js";
4
4
  import { isSidebarFolder } from "../helpers/is-sidebar-folder.js";
5
5
  import { useDraggable } from "../hooks/use-draggable.js";
6
6
  import SidebarHttpBadge_default from "./SidebarHttpBadge.vue.js";
7
+ import SidebarItemBadges_default from "./SidebarItemBadges.vue.js";
7
8
  import SidebarItemLabel_default from "./SidebarItemLabel.vue.js";
8
9
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createSlots, createTextVNode, createVNode, defineComponent, mergeProps, normalizeClass, openBlock, renderList, renderSlot, resolveComponent, toDisplayString, toHandlers, unref, useSlots, withCtx } from "vue";
9
10
  import { ScalarSidebarButton, ScalarSidebarGroup, ScalarSidebarGroupToggle, ScalarSidebarGroupToggleButton, ScalarSidebarGroupToggleSpacer, ScalarSidebarIndent, ScalarSidebarItem, ScalarSidebarSection } from "@scalar/components/sidebar";
@@ -11,11 +12,11 @@ import { isPlainLeftClick } from "@scalar/helpers/dom/is-plain-left-click";
11
12
  import { LibraryIcon } from "@scalar/icons/library";
12
13
  // src/components/SidebarItem.vue?vue&type=script&setup=true&lang.ts
13
14
  var _hoisted_1 = {
14
- key: 0,
15
+ key: 1,
15
16
  class: "line-through"
16
17
  };
17
18
  var _hoisted_2 = {
18
- key: 0,
19
+ key: 1,
19
20
  class: "line-through"
20
21
  };
21
22
  var SidebarItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
@@ -56,6 +57,8 @@ var SidebarItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
56
57
  isDroppable: __props.isDroppable,
57
58
  onDragEnd
58
59
  });
60
+ /** The `x-badges` of the item, only when the sidebar is set to show them */
61
+ const badges = computed(() => __props.options?.showBadgesInSidebar && "badges" in __props.item ? __props.item.badges ?? [] : []);
59
62
  const children = computed(() => hasChildren(__props.item) ? filterItems(__props.layout, __props.item.children, __props.options?.hideOperationDefaultExamples) : []);
60
63
  /**
61
64
  * Whether this item is the one currently displayed on the page.
@@ -201,14 +204,26 @@ var SidebarItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
201
204
  label: withCtx(() => [createTextVNode(toDisplayString(open ? __props.options?.labels?.closeGroup ?? "Close Group" : __props.options?.labels?.openGroup ?? "Open Group"), 1)]),
202
205
  _: 2
203
206
  }, 1032, ["open"])) : createCommentVNode("", true)]),
204
- default: withCtx(() => [isDeprecated(__props.item) ? (openBlock(), createElementBlock("span", _hoisted_1, [createVNode(SidebarItemLabel_default, {
205
- item: __props.item,
206
- operationTitleSource: __props.options?.operationTitleSource
207
- }, null, 8, ["item", "operationTitleSource"])])) : (openBlock(), createBlock(SidebarItemLabel_default, {
208
- key: 1,
209
- item: __props.item,
210
- operationTitleSource: __props.options?.operationTitleSource
211
- }, null, 8, ["item", "operationTitleSource"]))]),
207
+ default: withCtx(() => [
208
+ badges.value.length ? (openBlock(), createBlock(SidebarItemBadges_default, {
209
+ key: 0,
210
+ badges: badges.value,
211
+ position: "before"
212
+ }, null, 8, ["badges"])) : createCommentVNode("", true),
213
+ isDeprecated(__props.item) ? (openBlock(), createElementBlock("span", _hoisted_1, [createVNode(SidebarItemLabel_default, {
214
+ item: __props.item,
215
+ operationTitleSource: __props.options?.operationTitleSource
216
+ }, null, 8, ["item", "operationTitleSource"])])) : (openBlock(), createBlock(SidebarItemLabel_default, {
217
+ key: 2,
218
+ item: __props.item,
219
+ operationTitleSource: __props.options?.operationTitleSource
220
+ }, null, 8, ["item", "operationTitleSource"])),
221
+ badges.value.length ? (openBlock(), createBlock(SidebarItemBadges_default, {
222
+ key: 3,
223
+ badges: badges.value,
224
+ position: "after"
225
+ }, null, 8, ["badges"])) : createCommentVNode("", true)
226
+ ]),
212
227
  _: 2
213
228
  }, [__props.item.type === "document" ? {
214
229
  name: "icon",
@@ -300,14 +315,26 @@ var SidebarItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
300
315
  indent: level,
301
316
  selected: __props.isSelected(__props.item.id)
302
317
  }, createSlots({
303
- default: withCtx(() => [isDeprecated(__props.item) ? (openBlock(), createElementBlock("span", _hoisted_2, [createVNode(SidebarItemLabel_default, {
304
- item: __props.item,
305
- operationTitleSource: __props.options?.operationTitleSource
306
- }, null, 8, ["item", "operationTitleSource"])])) : (openBlock(), createBlock(SidebarItemLabel_default, {
307
- key: 1,
308
- item: __props.item,
309
- operationTitleSource: __props.options?.operationTitleSource
310
- }, null, 8, ["item", "operationTitleSource"]))]),
318
+ default: withCtx(() => [
319
+ badges.value.length ? (openBlock(), createBlock(SidebarItemBadges_default, {
320
+ key: 0,
321
+ badges: badges.value,
322
+ position: "before"
323
+ }, null, 8, ["badges"])) : createCommentVNode("", true),
324
+ isDeprecated(__props.item) ? (openBlock(), createElementBlock("span", _hoisted_2, [createVNode(SidebarItemLabel_default, {
325
+ item: __props.item,
326
+ operationTitleSource: __props.options?.operationTitleSource
327
+ }, null, 8, ["item", "operationTitleSource"])])) : (openBlock(), createBlock(SidebarItemLabel_default, {
328
+ key: 2,
329
+ item: __props.item,
330
+ operationTitleSource: __props.options?.operationTitleSource
331
+ }, null, 8, ["item", "operationTitleSource"])),
332
+ badges.value.length ? (openBlock(), createBlock(SidebarItemBadges_default, {
333
+ key: 3,
334
+ badges: badges.value,
335
+ position: "after"
336
+ }, null, 8, ["badges"])) : createCommentVNode("", true)
337
+ ]),
311
338
  _: 2
312
339
  }, [slots.icon ? {
313
340
  name: "icon",
@@ -1 +1 @@
1
- {"version":3,"file":"SidebarItem.vue_vue_type_script_setup_true_lang.js","names":["_useSlots","_openBlock","_createBlock","_unref","_mergeProps","_toHandlers","_withCtx","_createElementBlock","_Fragment","_renderList","_createSlots","_renderSlot","_createTextVNode","_toDisplayString","_createVNode","SidebarHttpBadge","_normalizeClass","SidebarItemLabel","SidebarItemDecorator"],"sources":["../../src/components/SidebarItem.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport {\n ScalarSidebarButton,\n ScalarSidebarGroup,\n ScalarSidebarGroupToggle,\n ScalarSidebarGroupToggleButton,\n ScalarSidebarGroupToggleSpacer,\n ScalarSidebarIndent,\n ScalarSidebarItem,\n ScalarSidebarSection,\n} from '@scalar/components/sidebar'\nimport { isPlainLeftClick } from '@scalar/helpers/dom/is-plain-left-click'\nimport { LibraryIcon } from '@scalar/icons/library'\nimport { computed } from 'vue'\n\nimport SidebarItemDecorator from '@/components/SidebarItemDecorator.vue'\nimport { filterItems } from '@/helpers/filter-items'\nimport { hasChildren } from '@/helpers/has-children'\nimport { isSidebarFolder } from '@/helpers/is-sidebar-folder'\nimport {\n useDraggable,\n type DraggingItem,\n type HoveredItem,\n type UseDraggableOptions,\n} from '@/hooks/use-draggable'\nimport type { Item, Layout, SidebarOptions } from '@/types'\n\nimport SidebarHttpBadge from './SidebarHttpBadge.vue'\nimport SidebarItemLabel from './SidebarItemLabel.vue'\n\nconst {\n item,\n layout,\n isSelected,\n isExpanded,\n isDraggable,\n isDroppable,\n options,\n getHref,\n} = defineProps<{\n /**\n * The sidebar item to render.\n */\n item: Item\n /**\n * The layout mode for the sidebar ('client' or 'reference').\n */\n layout: Layout\n /**\n * Function to determine if an item is currently selected by id.\n */\n isSelected: (id: string) => boolean\n /**\n * Function to determine if an item is currently expanded (showing its children) by id.\n */\n isExpanded: (id: string) => boolean\n /**\n * Sidebar configuration options.\n * - operationTitleSource: sets whether operations show their path or summary as the display title.\n */\n options?: SidebarOptions\n\n /**\n * Returns the URL for a sidebar item.\n *\n * When provided (and it returns a value) items render as anchor tags\n * instead of buttons, so search engines can crawl the navigation.\n */\n getHref?: (item: Item) => string | undefined\n\n /**\n * Prevents this item from being dragged.\n *\n * @default true\n */\n isDraggable?: UseDraggableOptions['isDraggable']\n /**\n * Prevents this item from being hovered and dropped into. Can be either a function or a boolean.\n *\n * @default true\n */\n isDroppable?: UseDraggableOptions['isDroppable']\n}>()\n\nconst emit = defineEmits<{\n /**\n * Emitted when the item is selected\n * @param id - The id of the selected item\n */\n (e: 'selectItem', id: string): void\n /**\n * Emitted when a drag operation ends for this item\n * @param draggingItem - The item being dragged\n * @param hoveredItem - The item currently being hovered over\n */\n (e: 'onDragEnd', draggingItem: DraggingItem, hoveredItem: HoveredItem): void\n\n /**\n * Emitted when the group is toggled\n * @param id - The id of the group\n */\n (e: 'toggleGroup', id: string): void\n}>()\n\nconst slots = defineSlots<{\n /**\n * Adds an optional decorator for each item, such as an edit menu.\n * The slot receives an object with the current item.\n */\n decorator?(props: { item: Item }): unknown\n /**\n * Adds an optional empty state for an item.\n * The slot receives an object with the current item.\n */\n empty?(props: { item: Item }): unknown\n /**\n * Adds an optional icon for each item.\n * The slot receives an object with the current item and the open state.\n */\n icon?(props: { item: Item; open: boolean }): unknown\n}>()\n\nconst isGroup = (\n currentItem: Item,\n): currentItem is Item & { isGroup: true } => {\n return 'isGroup' in currentItem && currentItem.isGroup\n}\n\nconst isDeprecated = (\n currentItem: Item,\n): currentItem is Item & { isDeprecated: true } => {\n return ('isDeprecated' in currentItem && currentItem.isDeprecated) ?? false\n}\n\n/**\n * Handle drag end event and bubble it up to parent.\n */\nconst onDragEnd = (draggingItem: DraggingItem, hoveredItem: HoveredItem) => {\n emit('onDragEnd', draggingItem, hoveredItem)\n}\nconst { draggableAttrs, draggableEvents } = useDraggable({\n id: item.id,\n isDraggable,\n isDroppable,\n onDragEnd,\n})\n\nconst children = computed(() =>\n hasChildren(item)\n ? filterItems(layout, item.children, options?.hideOperationDefaultExamples)\n : [],\n)\n\n/**\n * Whether this item is the one currently displayed on the page.\n *\n * `isSelected` also reports true for every ancestor of the displayed item,\n * which is what the active styling of a group needs. Only the deepest\n * selected node is the current page though, so a group counts as current when\n * none of its children are selected. Leaf items already get this from the\n * `selected` prop of ScalarSidebarButton.\n */\nconst isCurrent = computed(\n () =>\n isSelected(item.id) &&\n !(hasChildren(item) && item.children.some((child) => isSelected(child.id))),\n)\n\n/** The URL for this item, when the consumer provides one it renders as a link */\nconst href = computed(() => getHref?.(item) || undefined)\n\n/**\n * Whether the group renders its toggle separately from its label.\n *\n * A label that navigates cannot also own the open state, so a group that\n * renders as a link needs a toggle button of its own. Without one there is no\n * way to collapse the group from the keyboard, because pressing Enter on the\n * label follows the link instead.\n */\nconst isDiscrete = computed(\n () => Boolean(href.value) || (layout === 'reference' && item.type === 'text'),\n)\n\n/**\n * Builds the screen reader label for the discrete group toggle.\n *\n * The title of the group is appended so the toggles can be told apart. A page\n * can hold a lot of them, and a list of identical \"Open Group\" buttons gives a\n * screen reader user nothing to navigate by.\n */\nconst getToggleLabel = (open: boolean): string => {\n const label = open\n ? (options?.labels?.closeGroup ?? 'Close Group')\n : (options?.labels?.openGroup ?? 'Open Group')\n\n return item.title ? `${label} - ${item.title}` : label\n}\n\n/**\n * Emit the select event for a click on the item label.\n *\n * When the item renders as a link we only hijack plain left clicks on the\n * link itself for in-app navigation. Modified clicks (meta, ctrl, shift,\n * alt) and middle clicks keep the browser's default behavior so the link\n * can be opened in a new tab or window, and clicks on surrounding content\n * (like the decorator menu) keep their native behavior. A click whose\n * default is already prevented has been handled by someone else, so it is\n * left alone rather than navigated a second time.\n */\nconst handleSelect = (event: MouseEvent) => {\n if (href.value) {\n const anchor =\n event.target instanceof Element ? event.target.closest('a') : null\n if (anchor?.getAttribute('href') !== href.value) {\n return\n }\n if (event.defaultPrevented || !isPlainLeftClick(event)) {\n return\n }\n event.preventDefault()\n }\n emit('selectItem', item.id)\n}\n</script>\n<template>\n <!-- Keep the client section layout; reference tags all use collapsible groups. -->\n <ScalarSidebarSection\n v-if=\"layout === 'client' && children.length > 0 && isGroup(item)\"\n :data-sidebar-id=\"item.id\"\n v-bind=\"draggableAttrs\"\n v-on=\"draggableEvents\">\n {{ item.title }}\n <template #items>\n <SidebarItem\n v-for=\"child in children\"\n :key=\"child.id\"\n :getHref=\"getHref\"\n :isDraggable=\"isDraggable\"\n :isDroppable=\"isDroppable\"\n :isExpanded=\"isExpanded\"\n :isSelected=\"isSelected\"\n :item=\"child\"\n :layout=\"layout\"\n :options=\"options\"\n @onDragEnd=\"onDragEnd\"\n @selectItem=\"(id) => emit('selectItem', id)\"\n @toggleGroup=\"(id) => emit('toggleGroup', id)\">\n <template\n v-if=\"slots.decorator\"\n #decorator=\"slotProps\">\n <slot\n v-bind=\"slotProps\"\n name=\"decorator\" />\n </template>\n <template\n v-if=\"slots.empty\"\n #empty=\"slotProps\">\n <slot\n v-bind=\"slotProps\"\n name=\"empty\" />\n </template>\n <template\n v-if=\"slots.icon\"\n #icon=\"slotProps\">\n <slot\n v-bind=\"slotProps\"\n name=\"icon\" />\n </template>\n </SidebarItem>\n </template>\n </ScalarSidebarSection>\n\n <!-- Sidebar group (folder) -->\n <ScalarSidebarGroup\n v-else-if=\"\n isSidebarFolder(\n layout,\n item,\n slots.empty !== undefined,\n options?.hideOperationDefaultExamples ?? false,\n )\n \"\n :active=\"isSelected(item.id)\"\n class=\"relative\"\n controlled\n :data-sidebar-id=\"item.id\"\n v-bind=\"draggableAttrs\"\n :discrete=\"isDiscrete\"\n :open=\"isExpanded(item.id)\"\n v-on=\"draggableEvents\">\n <template #button=\"{ open, level }\">\n <ScalarSidebarButton\n :is=\"href ? 'a' : 'button'\"\n :active=\"isSelected(item.id)\"\n :aria-current=\"isCurrent ? 'page' : undefined\"\n :aria-expanded=\"isDiscrete ? undefined : open\"\n :href=\"href\"\n :indent=\"level\"\n @click=\"handleSelect\">\n <template #indent>\n <ScalarSidebarIndent\n class=\"-my-2 mr-0\"\n :indent=\"level\" />\n </template>\n <template\n v-if=\"item.type === 'document'\"\n #icon>\n <slot\n :item=\"item\"\n name=\"icon\"\n :open=\"open\">\n <LibraryIcon\n class=\"block\"\n :src=\"\n ('icon' in item && item.icon) || 'interface-content-folder'\n \" />\n </slot>\n </template>\n <span\n v-if=\"isDeprecated(item)\"\n class=\"line-through\">\n <SidebarItemLabel\n :item\n :operationTitleSource=\"options?.operationTitleSource\" />\n </span>\n <SidebarItemLabel\n v-else\n :item\n :operationTitleSource=\"options?.operationTitleSource\" />\n <template #aside>\n <SidebarHttpBadge\n v-if=\"'method' in item\"\n :active=\"isSelected(item.id)\"\n class=\"ml-2 h-4 self-start\"\n :class=\"{\n // Hide the badge when we're showing the decorator\n 'group-hover/button:opacity-0 group-focus-visible/button:opacity-0 group-has-[~*_[aria-expanded=true]]/button:opacity-0 group-has-[~*:focus-within]/button:opacity-0 group-has-[~*:hover]/button:opacity-0':\n slots.decorator,\n }\"\n :label=\"options?.labels?.httpMethod\"\n :method=\"item.method\"\n :webhook=\"item.type === 'webhook'\" />\n <ScalarSidebarGroupToggleSpacer v-if=\"isDiscrete\" />\n <ScalarSidebarGroupToggle\n v-else-if=\"!('method' in item)\"\n class=\"text-sidebar-c-2\"\n :open>\n <template #label>\n {{\n open\n ? (options?.labels?.closeGroup ?? 'Close Group')\n : (options?.labels?.openGroup ?? 'Open Group')\n }}\n </template>\n </ScalarSidebarGroupToggle>\n </template>\n </ScalarSidebarButton>\n <ScalarSidebarGroupToggleButton\n v-if=\"isDiscrete\"\n :open\n @click=\"() => emit('toggleGroup', item.id)\">\n <template #label>{{ getToggleLabel(open) }}</template>\n </ScalarSidebarGroupToggleButton>\n </template>\n <template\n v-if=\"slots.decorator\"\n #after>\n <SidebarItemDecorator>\n <slot\n :item\n name=\"decorator\" />\n </SidebarItemDecorator>\n </template>\n <template #items>\n <SidebarItem\n v-for=\"child in children\"\n :key=\"child.id\"\n :getHref=\"getHref\"\n :isDraggable=\"isDraggable\"\n :isDroppable=\"isDroppable\"\n :isExpanded=\"isExpanded\"\n :isSelected=\"isSelected\"\n :item=\"child\"\n :layout=\"layout\"\n :options=\"options\"\n :parentIds=\"[]\"\n @onDragEnd=\"onDragEnd\"\n @selectItem=\"(id) => emit('selectItem', id)\"\n @toggleGroup=\"(id) => emit('toggleGroup', id)\">\n <template\n v-if=\"slots.decorator\"\n #decorator=\"slotProps\">\n <slot\n v-bind=\"slotProps\"\n name=\"decorator\" />\n </template>\n <template\n v-if=\"slots.empty\"\n #empty=\"slotProps\">\n <slot\n v-bind=\"slotProps\"\n name=\"empty\" />\n </template>\n <template\n v-if=\"slots.icon\"\n #icon=\"slotProps\">\n <slot\n v-bind=\"slotProps\"\n name=\"icon\" />\n </template>\n </SidebarItem>\n <template v-if=\"slots.empty && (item.children?.length ?? 0) === 0\">\n <slot\n :item\n name=\"empty\" />\n </template>\n </template>\n </ScalarSidebarGroup>\n\n <!-- Sidebar item (leaf node) -->\n <ScalarSidebarItem\n v-else\n v-bind=\"draggableAttrs\"\n class=\"relative\"\n :data-sidebar-id=\"item.id\"\n v-on=\"draggableEvents\"\n @click=\"handleSelect\">\n <template #button=\"{ level }\">\n <ScalarSidebarButton\n :is=\"href ? 'a' : 'button'\"\n :href=\"href\"\n :indent=\"level\"\n :selected=\"isSelected(item.id)\">\n <template\n v-if=\"slots.icon\"\n #icon>\n <slot\n :item=\"item\"\n name=\"icon\"\n :open=\"true\" />\n </template>\n <span\n v-if=\"isDeprecated(item)\"\n class=\"line-through\">\n <SidebarItemLabel\n :item\n :operationTitleSource=\"options?.operationTitleSource\" />\n </span>\n <SidebarItemLabel\n v-else\n :item\n :operationTitleSource=\"options?.operationTitleSource\" />\n <template\n v-if=\"'method' in item\"\n #aside>\n <SidebarHttpBadge\n :active=\"isSelected(item.id)\"\n class=\"ml-2 h-4 self-start\"\n :class=\"{\n // Hide the badge when we're showing the decorator\n 'group-hover/button:opacity-0 group-focus-visible/button:opacity-0 group-has-[~*_[aria-expanded=true]]/button:opacity-0 group-has-[~*:focus-within]/button:opacity-0 group-has-[~*:hover]/button:opacity-0':\n slots.decorator,\n }\"\n :label=\"options?.labels?.httpMethod\"\n :method=\"item.method\"\n :webhook=\"item.type === 'webhook'\" />\n </template>\n </ScalarSidebarButton>\n </template>\n <template\n v-if=\"slots.decorator\"\n #after>\n <SidebarItemDecorator>\n <slot\n :item\n name=\"decorator\" />\n </SidebarItemDecorator>\n </template>\n </ScalarSidebarItem>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoFA,MAAM,OAAO;EAoBb,MAAM,QAAQA,SAAA;EAkBd,MAAM,WACJ,gBAC4C;GAC5C,OAAO,aAAa,eAAe,YAAY;EACjD;EAEA,MAAM,gBACJ,gBACiD;GACjD,QAAQ,kBAAkB,eAAe,YAAY,iBAAiB;EACxE;;;;EAKA,MAAM,aAAa,cAA4B,gBAA6B;GAC1E,KAAK,aAAa,cAAc,WAAW;EAC7C;EACA,MAAM,EAAE,gBAAgB,oBAAoB,aAAa;GACvD,IAAI,QAAA,KAAK;GACT,aAAU,QAAA;GACV,aAAU,QAAA;GACV;EACF,CAAC;EAED,MAAM,WAAW,eACf,YAAY,QAAA,IAAI,IACZ,YAAY,QAAA,QAAQ,QAAA,KAAK,UAAU,QAAA,SAAS,4BAA4B,IACxE,CAAC,CACP;;;;;;;;;;EAWA,MAAM,YAAY,eAEd,QAAA,WAAW,QAAA,KAAK,EAAE,KAClB,EAAE,YAAY,QAAA,IAAI,KAAK,QAAA,KAAK,SAAS,MAAM,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AAA;KAHrB,SAAAZ,cAEqB,CAFrBK,WAEqB,KAAA,QAAA,aAAA,EADlB,MAAA,QAAA,KAAI,CAAA,C"}
1
+ {"version":3,"file":"SidebarItem.vue_vue_type_script_setup_true_lang.js","names":["_useSlots","_openBlock","_createBlock","_unref","_mergeProps","_toHandlers","_withCtx","_createElementBlock","_Fragment","_renderList","_createSlots","_renderSlot","_createTextVNode","_toDisplayString","_createVNode","SidebarHttpBadge","_normalizeClass","SidebarItemBadges","SidebarItemLabel","SidebarItemDecorator"],"sources":["../../src/components/SidebarItem.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport {\n ScalarSidebarButton,\n ScalarSidebarGroup,\n ScalarSidebarGroupToggle,\n ScalarSidebarGroupToggleButton,\n ScalarSidebarGroupToggleSpacer,\n ScalarSidebarIndent,\n ScalarSidebarItem,\n ScalarSidebarSection,\n} from '@scalar/components/sidebar'\nimport { isPlainLeftClick } from '@scalar/helpers/dom/is-plain-left-click'\nimport { LibraryIcon } from '@scalar/icons/library'\nimport { computed } from 'vue'\n\nimport SidebarItemDecorator from '@/components/SidebarItemDecorator.vue'\nimport { filterItems } from '@/helpers/filter-items'\nimport { hasChildren } from '@/helpers/has-children'\nimport { isSidebarFolder } from '@/helpers/is-sidebar-folder'\nimport {\n useDraggable,\n type DraggingItem,\n type HoveredItem,\n type UseDraggableOptions,\n} from '@/hooks/use-draggable'\nimport type { Item, Layout, SidebarOptions } from '@/types'\n\nimport SidebarHttpBadge from './SidebarHttpBadge.vue'\nimport SidebarItemBadges from './SidebarItemBadges.vue'\nimport SidebarItemLabel from './SidebarItemLabel.vue'\n\nconst {\n item,\n layout,\n isSelected,\n isExpanded,\n isDraggable,\n isDroppable,\n options,\n getHref,\n} = defineProps<{\n /**\n * The sidebar item to render.\n */\n item: Item\n /**\n * The layout mode for the sidebar ('client' or 'reference').\n */\n layout: Layout\n /**\n * Function to determine if an item is currently selected by id.\n */\n isSelected: (id: string) => boolean\n /**\n * Function to determine if an item is currently expanded (showing its children) by id.\n */\n isExpanded: (id: string) => boolean\n /**\n * Sidebar configuration options.\n * - operationTitleSource: sets whether operations show their path or summary as the display title.\n */\n options?: SidebarOptions\n\n /**\n * Returns the URL for a sidebar item.\n *\n * When provided (and it returns a value) items render as anchor tags\n * instead of buttons, so search engines can crawl the navigation.\n */\n getHref?: (item: Item) => string | undefined\n\n /**\n * Prevents this item from being dragged.\n *\n * @default true\n */\n isDraggable?: UseDraggableOptions['isDraggable']\n /**\n * Prevents this item from being hovered and dropped into. Can be either a function or a boolean.\n *\n * @default true\n */\n isDroppable?: UseDraggableOptions['isDroppable']\n}>()\n\nconst emit = defineEmits<{\n /**\n * Emitted when the item is selected\n * @param id - The id of the selected item\n */\n (e: 'selectItem', id: string): void\n /**\n * Emitted when a drag operation ends for this item\n * @param draggingItem - The item being dragged\n * @param hoveredItem - The item currently being hovered over\n */\n (e: 'onDragEnd', draggingItem: DraggingItem, hoveredItem: HoveredItem): void\n\n /**\n * Emitted when the group is toggled\n * @param id - The id of the group\n */\n (e: 'toggleGroup', id: string): void\n}>()\n\nconst slots = defineSlots<{\n /**\n * Adds an optional decorator for each item, such as an edit menu.\n * The slot receives an object with the current item.\n */\n decorator?(props: { item: Item }): unknown\n /**\n * Adds an optional empty state for an item.\n * The slot receives an object with the current item.\n */\n empty?(props: { item: Item }): unknown\n /**\n * Adds an optional icon for each item.\n * The slot receives an object with the current item and the open state.\n */\n icon?(props: { item: Item; open: boolean }): unknown\n}>()\n\nconst isGroup = (\n currentItem: Item,\n): currentItem is Item & { isGroup: true } => {\n return 'isGroup' in currentItem && currentItem.isGroup\n}\n\nconst isDeprecated = (\n currentItem: Item,\n): currentItem is Item & { isDeprecated: true } => {\n return ('isDeprecated' in currentItem && currentItem.isDeprecated) ?? false\n}\n\n/**\n * Handle drag end event and bubble it up to parent.\n */\nconst onDragEnd = (draggingItem: DraggingItem, hoveredItem: HoveredItem) => {\n emit('onDragEnd', draggingItem, hoveredItem)\n}\nconst { draggableAttrs, draggableEvents } = useDraggable({\n id: item.id,\n isDraggable,\n isDroppable,\n onDragEnd,\n})\n\n/** The `x-badges` of the item, only when the sidebar is set to show them */\nconst badges = computed(() =>\n options?.showBadgesInSidebar && 'badges' in item ? (item.badges ?? []) : [],\n)\n\nconst children = computed(() =>\n hasChildren(item)\n ? filterItems(layout, item.children, options?.hideOperationDefaultExamples)\n : [],\n)\n\n/**\n * Whether this item is the one currently displayed on the page.\n *\n * `isSelected` also reports true for every ancestor of the displayed item,\n * which is what the active styling of a group needs. Only the deepest\n * selected node is the current page though, so a group counts as current when\n * none of its children are selected. Leaf items already get this from the\n * `selected` prop of ScalarSidebarButton.\n */\nconst isCurrent = computed(\n () =>\n isSelected(item.id) &&\n !(hasChildren(item) && item.children.some((child) => isSelected(child.id))),\n)\n\n/** The URL for this item, when the consumer provides one it renders as a link */\nconst href = computed(() => getHref?.(item) || undefined)\n\n/**\n * Whether the group renders its toggle separately from its label.\n *\n * A label that navigates cannot also own the open state, so a group that\n * renders as a link needs a toggle button of its own. Without one there is no\n * way to collapse the group from the keyboard, because pressing Enter on the\n * label follows the link instead.\n */\nconst isDiscrete = computed(\n () => Boolean(href.value) || (layout === 'reference' && item.type === 'text'),\n)\n\n/**\n * Builds the screen reader label for the discrete group toggle.\n *\n * The title of the group is appended so the toggles can be told apart. A page\n * can hold a lot of them, and a list of identical \"Open Group\" buttons gives a\n * screen reader user nothing to navigate by.\n */\nconst getToggleLabel = (open: boolean): string => {\n const label = open\n ? (options?.labels?.closeGroup ?? 'Close Group')\n : (options?.labels?.openGroup ?? 'Open Group')\n\n return item.title ? `${label} - ${item.title}` : label\n}\n\n/**\n * Emit the select event for a click on the item label.\n *\n * When the item renders as a link we only hijack plain left clicks on the\n * link itself for in-app navigation. Modified clicks (meta, ctrl, shift,\n * alt) and middle clicks keep the browser's default behavior so the link\n * can be opened in a new tab or window, and clicks on surrounding content\n * (like the decorator menu) keep their native behavior. A click whose\n * default is already prevented has been handled by someone else, so it is\n * left alone rather than navigated a second time.\n */\nconst handleSelect = (event: MouseEvent) => {\n if (href.value) {\n const anchor =\n event.target instanceof Element ? event.target.closest('a') : null\n if (anchor?.getAttribute('href') !== href.value) {\n return\n }\n if (event.defaultPrevented || !isPlainLeftClick(event)) {\n return\n }\n event.preventDefault()\n }\n emit('selectItem', item.id)\n}\n</script>\n<template>\n <!-- Keep the client section layout; reference tags all use collapsible groups. -->\n <ScalarSidebarSection\n v-if=\"layout === 'client' && children.length > 0 && isGroup(item)\"\n :data-sidebar-id=\"item.id\"\n v-bind=\"draggableAttrs\"\n v-on=\"draggableEvents\">\n {{ item.title }}\n <template #items>\n <SidebarItem\n v-for=\"child in children\"\n :key=\"child.id\"\n :getHref=\"getHref\"\n :isDraggable=\"isDraggable\"\n :isDroppable=\"isDroppable\"\n :isExpanded=\"isExpanded\"\n :isSelected=\"isSelected\"\n :item=\"child\"\n :layout=\"layout\"\n :options=\"options\"\n @onDragEnd=\"onDragEnd\"\n @selectItem=\"(id) => emit('selectItem', id)\"\n @toggleGroup=\"(id) => emit('toggleGroup', id)\">\n <template\n v-if=\"slots.decorator\"\n #decorator=\"slotProps\">\n <slot\n v-bind=\"slotProps\"\n name=\"decorator\" />\n </template>\n <template\n v-if=\"slots.empty\"\n #empty=\"slotProps\">\n <slot\n v-bind=\"slotProps\"\n name=\"empty\" />\n </template>\n <template\n v-if=\"slots.icon\"\n #icon=\"slotProps\">\n <slot\n v-bind=\"slotProps\"\n name=\"icon\" />\n </template>\n </SidebarItem>\n </template>\n </ScalarSidebarSection>\n\n <!-- Sidebar group (folder) -->\n <ScalarSidebarGroup\n v-else-if=\"\n isSidebarFolder(\n layout,\n item,\n slots.empty !== undefined,\n options?.hideOperationDefaultExamples ?? false,\n )\n \"\n :active=\"isSelected(item.id)\"\n class=\"relative\"\n controlled\n :data-sidebar-id=\"item.id\"\n v-bind=\"draggableAttrs\"\n :discrete=\"isDiscrete\"\n :open=\"isExpanded(item.id)\"\n v-on=\"draggableEvents\">\n <template #button=\"{ open, level }\">\n <ScalarSidebarButton\n :is=\"href ? 'a' : 'button'\"\n :active=\"isSelected(item.id)\"\n :aria-current=\"isCurrent ? 'page' : undefined\"\n :aria-expanded=\"isDiscrete ? undefined : open\"\n :href=\"href\"\n :indent=\"level\"\n @click=\"handleSelect\">\n <template #indent>\n <ScalarSidebarIndent\n class=\"-my-2 mr-0\"\n :indent=\"level\" />\n </template>\n <template\n v-if=\"item.type === 'document'\"\n #icon>\n <slot\n :item=\"item\"\n name=\"icon\"\n :open=\"open\">\n <LibraryIcon\n class=\"block\"\n :src=\"\n ('icon' in item && item.icon) || 'interface-content-folder'\n \" />\n </slot>\n </template>\n <SidebarItemBadges\n v-if=\"badges.length\"\n :badges\n position=\"before\" />\n <span\n v-if=\"isDeprecated(item)\"\n class=\"line-through\">\n <SidebarItemLabel\n :item\n :operationTitleSource=\"options?.operationTitleSource\" />\n </span>\n <SidebarItemLabel\n v-else\n :item\n :operationTitleSource=\"options?.operationTitleSource\" />\n <SidebarItemBadges\n v-if=\"badges.length\"\n :badges\n position=\"after\" />\n <template #aside>\n <SidebarHttpBadge\n v-if=\"'method' in item\"\n :active=\"isSelected(item.id)\"\n class=\"ml-2 h-4 self-start\"\n :class=\"{\n // Hide the badge when we're showing the decorator\n 'group-hover/button:opacity-0 group-focus-visible/button:opacity-0 group-has-[~*_[aria-expanded=true]]/button:opacity-0 group-has-[~*:focus-within]/button:opacity-0 group-has-[~*:hover]/button:opacity-0':\n slots.decorator,\n }\"\n :label=\"options?.labels?.httpMethod\"\n :method=\"item.method\"\n :webhook=\"item.type === 'webhook'\" />\n <ScalarSidebarGroupToggleSpacer v-if=\"isDiscrete\" />\n <ScalarSidebarGroupToggle\n v-else-if=\"!('method' in item)\"\n class=\"text-sidebar-c-2\"\n :open>\n <template #label>\n {{\n open\n ? (options?.labels?.closeGroup ?? 'Close Group')\n : (options?.labels?.openGroup ?? 'Open Group')\n }}\n </template>\n </ScalarSidebarGroupToggle>\n </template>\n </ScalarSidebarButton>\n <ScalarSidebarGroupToggleButton\n v-if=\"isDiscrete\"\n :open\n @click=\"() => emit('toggleGroup', item.id)\">\n <template #label>{{ getToggleLabel(open) }}</template>\n </ScalarSidebarGroupToggleButton>\n </template>\n <template\n v-if=\"slots.decorator\"\n #after>\n <SidebarItemDecorator>\n <slot\n :item\n name=\"decorator\" />\n </SidebarItemDecorator>\n </template>\n <template #items>\n <SidebarItem\n v-for=\"child in children\"\n :key=\"child.id\"\n :getHref=\"getHref\"\n :isDraggable=\"isDraggable\"\n :isDroppable=\"isDroppable\"\n :isExpanded=\"isExpanded\"\n :isSelected=\"isSelected\"\n :item=\"child\"\n :layout=\"layout\"\n :options=\"options\"\n :parentIds=\"[]\"\n @onDragEnd=\"onDragEnd\"\n @selectItem=\"(id) => emit('selectItem', id)\"\n @toggleGroup=\"(id) => emit('toggleGroup', id)\">\n <template\n v-if=\"slots.decorator\"\n #decorator=\"slotProps\">\n <slot\n v-bind=\"slotProps\"\n name=\"decorator\" />\n </template>\n <template\n v-if=\"slots.empty\"\n #empty=\"slotProps\">\n <slot\n v-bind=\"slotProps\"\n name=\"empty\" />\n </template>\n <template\n v-if=\"slots.icon\"\n #icon=\"slotProps\">\n <slot\n v-bind=\"slotProps\"\n name=\"icon\" />\n </template>\n </SidebarItem>\n <template v-if=\"slots.empty && (item.children?.length ?? 0) === 0\">\n <slot\n :item\n name=\"empty\" />\n </template>\n </template>\n </ScalarSidebarGroup>\n\n <!-- Sidebar item (leaf node) -->\n <ScalarSidebarItem\n v-else\n v-bind=\"draggableAttrs\"\n class=\"relative\"\n :data-sidebar-id=\"item.id\"\n v-on=\"draggableEvents\"\n @click=\"handleSelect\">\n <template #button=\"{ level }\">\n <ScalarSidebarButton\n :is=\"href ? 'a' : 'button'\"\n :href=\"href\"\n :indent=\"level\"\n :selected=\"isSelected(item.id)\">\n <template\n v-if=\"slots.icon\"\n #icon>\n <slot\n :item=\"item\"\n name=\"icon\"\n :open=\"true\" />\n </template>\n <SidebarItemBadges\n v-if=\"badges.length\"\n :badges\n position=\"before\" />\n <span\n v-if=\"isDeprecated(item)\"\n class=\"line-through\">\n <SidebarItemLabel\n :item\n :operationTitleSource=\"options?.operationTitleSource\" />\n </span>\n <SidebarItemLabel\n v-else\n :item\n :operationTitleSource=\"options?.operationTitleSource\" />\n <SidebarItemBadges\n v-if=\"badges.length\"\n :badges\n position=\"after\" />\n <template\n v-if=\"'method' in item\"\n #aside>\n <SidebarHttpBadge\n :active=\"isSelected(item.id)\"\n class=\"ml-2 h-4 self-start\"\n :class=\"{\n // Hide the badge when we're showing the decorator\n 'group-hover/button:opacity-0 group-focus-visible/button:opacity-0 group-has-[~*_[aria-expanded=true]]/button:opacity-0 group-has-[~*:focus-within]/button:opacity-0 group-has-[~*:hover]/button:opacity-0':\n slots.decorator,\n }\"\n :label=\"options?.labels?.httpMethod\"\n :method=\"item.method\"\n :webhook=\"item.type === 'webhook'\" />\n </template>\n </ScalarSidebarButton>\n </template>\n <template\n v-if=\"slots.decorator\"\n #after>\n <SidebarItemDecorator>\n <slot\n :item\n name=\"decorator\" />\n </SidebarItemDecorator>\n </template>\n </ScalarSidebarItem>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqFA,MAAM,OAAO;EAoBb,MAAM,QAAQA,SAAA;EAkBd,MAAM,WACJ,gBAC4C;GAC5C,OAAO,aAAa,eAAe,YAAY;EACjD;EAEA,MAAM,gBACJ,gBACiD;GACjD,QAAQ,kBAAkB,eAAe,YAAY,iBAAiB;EACxE;;;;EAKA,MAAM,aAAa,cAA4B,gBAA6B;GAC1E,KAAK,aAAa,cAAc,WAAW;EAC7C;EACA,MAAM,EAAE,gBAAgB,oBAAoB,aAAa;GACvD,IAAI,QAAA,KAAK;GACT,aAAU,QAAA;GACV,aAAU,QAAA;GACV;EACF,CAAC;;EAGD,MAAM,SAAS,eACb,QAAA,SAAS,uBAAuB,YAAY,QAAA,OAAQ,QAAA,KAAK,UAAU,CA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,YAG0DgB,0BAAA;;OADvD,MAAA,QAAA;OACA,sBAAsB,QAAA,SAAS;;MAE1B,OAAA,MAAO,UADfjB,UAAA,GAAAC,YAGqBe,2BAAA;;OADlB,QAAA,OAAA;OACD,UAAS;;;;I,IAzBH,MAAM,O;KACX,MAAA;KACD,IAAAX,cAGiB,CAHjBK,WAGiB,KAAA,QAAA,QAAA;MAFd,MAAM,QAAA;MAEN,MAAM;;;I,YAsBS,YAAA,QAAA,O;KACjB,MAAA;KACD,IAAAL,cAUuC,CAVvCQ,YAUuCC,0BAAA;MATpC,QAAQ,QAAA,WAAW,QAAA,KAAK,EAAE;MAC3B,OAAKC,eAAA,CAAC,uBAAqB,E,6MAC2R,MAAM,U;MAK3T,OAAO,QAAA,SAAS,QAAQ;MACxB,QAAQ,QAAA,KAAK;MACb,SAAS,QAAA,KAAK,SAAI;;;;;;;;;;;;;;;;G,IAKnB,MAAM,Y;IACX,MAAA;IACD,IAAAV,cAIuB,CAJvBQ,YAIuBK,8BAAA,MAAA;KAHrB,SAAAb,cAEqB,CAFrBK,WAEqB,KAAA,QAAA,aAAA,EADlB,MAAA,QAAA,KAAI,CAAA,C"}
@@ -0,0 +1,11 @@
1
+ import type { XBadge } from '@scalar/workspace-store/schemas/extensions/operation';
2
+ type __VLS_Props = {
3
+ /** Badges from the `x-badges` extension of the sidebar item */
4
+ badges: XBadge[];
5
+ /** Which badges to render: the ones before or after the title */
6
+ position: 'before' | 'after';
7
+ };
8
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ declare const _default: typeof __VLS_export;
10
+ export default _default;
11
+ //# sourceMappingURL=SidebarItemBadges.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SidebarItemBadges.vue.d.ts","sourceRoot":"","sources":["../../src/components/SidebarItemBadges.vue"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sDAAsD,CAAA;AAGlF,KAAK,WAAW,GAAG;IACjB,+DAA+D;IAC/D,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,iEAAiE;IACjE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAA;CAC7B,CAAC;AAsDF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -0,0 +1,6 @@
1
+ import SidebarItemBadges_vue_vue_type_script_setup_true_lang_default from "./SidebarItemBadges.vue_vue_type_script_setup_true_lang.js";
2
+ // src/components/SidebarItemBadges.vue
3
+ var SidebarItemBadges_default = SidebarItemBadges_vue_vue_type_script_setup_true_lang_default;
4
+ export { SidebarItemBadges_default as default };
5
+
6
+ //# sourceMappingURL=SidebarItemBadges.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SidebarItemBadges.vue.js","names":[],"sources":[],"mappings":""}
@@ -0,0 +1,25 @@
1
+ import { Fragment, computed, createElementBlock, defineComponent, normalizeClass, normalizeStyle, openBlock, renderList, toDisplayString } from "vue";
2
+ // src/components/SidebarItemBadges.vue?vue&type=script&setup=true&lang.ts
3
+ var SidebarItemBadges_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
4
+ __name: "SidebarItemBadges",
5
+ props: {
6
+ badges: {},
7
+ position: {}
8
+ },
9
+ setup(__props) {
10
+ /** Badges without a position render after the title, like in the content */
11
+ const filteredBadges = computed(() => __props.badges.filter((badge) => (badge.position ?? "after") === __props.position));
12
+ return (_ctx, _cache) => {
13
+ return openBlock(true), createElementBlock(Fragment, null, renderList(filteredBadges.value, (badge, index) => {
14
+ return openBlock(), createElementBlock("span", {
15
+ key: `${index}-${badge.name}`,
16
+ class: normalizeClass(["sidebar-badge inline-block rounded-full border px-[5px] align-[1px] text-[10px] leading-[14px] font-semibold whitespace-nowrap", [__props.position === "before" ? "me-1" : "ms-1", badge.color ? "text-auto-contrast-(--badge-color) border-transparent bg-(--badge-color)" : "bg-b-2 text-c-2"]]),
17
+ style: normalizeStyle(badge.color ? { "--badge-color": badge.color } : void 0)
18
+ }, toDisplayString(badge.name), 7);
19
+ }), 128);
20
+ };
21
+ }
22
+ });
23
+ export { SidebarItemBadges_vue_vue_type_script_setup_true_lang_default as default };
24
+
25
+ //# sourceMappingURL=SidebarItemBadges.vue_vue_type_script_setup_true_lang.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SidebarItemBadges.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_Fragment","_renderList","_normalizeClass","_normalizeStyle","_toDisplayString"],"sources":["../../src/components/SidebarItemBadges.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { XBadge } from '@scalar/workspace-store/schemas/extensions/operation'\nimport { computed } from 'vue'\n\nconst { badges, position } = defineProps<{\n /** Badges from the `x-badges` extension of the sidebar item */\n badges: XBadge[]\n /** Which badges to render: the ones before or after the title */\n position: 'before' | 'after'\n}>()\n\n/** Badges without a position render after the title, like in the content */\nconst filteredBadges = computed(() =>\n badges.filter((badge) => (badge.position ?? 'after') === position),\n)\n</script>\n\n<template>\n <span\n v-for=\"(badge, index) in filteredBadges\"\n :key=\"`${index}-${badge.name}`\"\n class=\"sidebar-badge inline-block rounded-full border px-[5px] align-[1px] text-[10px] leading-[14px] font-semibold whitespace-nowrap\"\n :class=\"[\n position === 'before' ? 'me-1' : 'ms-1',\n badge.color\n ? 'text-auto-contrast-(--badge-color) border-transparent bg-(--badge-color)'\n : 'bg-b-2 text-c-2',\n ]\"\n :style=\"badge.color ? { '--badge-color': badge.color } : undefined\">\n {{ badge.name }}\n </span>\n</template>\n"],"mappings":";;;;;;;;;;EAYA,MAAM,iBAAiB,eACrB,QAAA,OAAO,QAAQ,WAAW,MAAM,YAAY,aAAa,QAAA,QAAQ,CACnE;;GAIE,OAAAA,UAAA,IAAA,GAAAC,mBAYOC,UAAA,MAAAC,WAXoB,eAAA,QAAjB,OAAO,UAAK;IADtB,OAAAH,UAAA,GAAAC,mBAYO,QAAA;KAVJ,KAAG,GAAK,MAAK,GAAI,MAAM;KACxB,OAAKG,eAAA,CAAC,kIAAgI,CACtH,QAAA,aAAQ,WAAA,SAAA,QAAuC,MAAM,Q;KAMpE,OAAKC,eAAE,MAAM,QAAK,EAAA,iBAAsB,MAAM,MAAK,IAAK,KAAA,CAAS;IAC/D,GAAAC,gBAAA,MAAM,IAAI,GAAA,CAAA"}
package/dist/style.css CHANGED
@@ -395,6 +395,49 @@
395
395
  }
396
396
  }
397
397
 
398
+ .light-mode, .dark-mode, .light-mode .dark-mode, .dark-mode .light-mode {
399
+ --scalar-code-keyword: var(--scalar-color-purple);
400
+ --scalar-code-string: var(--scalar-color-blue);
401
+ --scalar-code-number: var(--scalar-color-orange);
402
+ --scalar-code-function: var(--scalar-color-orange);
403
+ --scalar-code-builtin: var(--scalar-color-blue);
404
+ --scalar-code-type: var(--scalar-color-1);
405
+ --scalar-code-parameter: var(--scalar-color-red);
406
+ --scalar-code-property: var(--scalar-color-green);
407
+ --scalar-code-comment: var(--scalar-color-2);
408
+ --scalar-code-punctuation: var(--scalar-color-2);
409
+ --scalar-code-addition: var(--scalar-color-green);
410
+ --scalar-code-deletion: var(--scalar-color-red);
411
+ }
412
+
413
+ @supports (color: oklch(from white l c h)) {
414
+ .light-mode, .dark-mode .light-mode {
415
+ --scalar-code-keyword: oklch(from var(--scalar-color-purple) min(l, .395) min(c, .22) h);
416
+ --scalar-code-string: oklch(from var(--scalar-color-blue) min(l, .55) min(c, .14) h);
417
+ --scalar-code-number: oklch(from var(--scalar-color-orange) min(l, .59) min(c, .17) calc(h + 3));
418
+ --scalar-code-function: oklch(from var(--scalar-color-orange) min(l, .59) min(c, .17) calc(h + 3));
419
+ --scalar-code-builtin: oklch(from var(--scalar-color-blue) min(l, .55) min(c, .14) h);
420
+ --scalar-code-type: oklch(from var(--scalar-color-blue) min(l, .33) min(c, .1) calc(h + 8));
421
+ --scalar-code-parameter: oklch(from var(--scalar-color-red) min(l, .5) min(c, .2) calc(h - 14));
422
+ --scalar-code-property: oklch(from var(--scalar-color-green) min(l, .51) min(c, .11) h);
423
+ --scalar-code-addition: oklch(from var(--scalar-color-green) min(l, .51) min(c, .11) h);
424
+ --scalar-code-deletion: oklch(from var(--scalar-color-red) min(l, .5) min(c, .2) calc(h - 14));
425
+ }
426
+
427
+ .dark-mode, .light-mode .dark-mode {
428
+ --scalar-code-keyword: oklch(from var(--scalar-color-purple) max(l, .68) c h);
429
+ --scalar-code-string: oklch(from var(--scalar-color-blue) max(l, .68) c h);
430
+ --scalar-code-number: oklch(from var(--scalar-color-orange) max(l, .75) min(c, .16) h);
431
+ --scalar-code-function: oklch(from var(--scalar-color-orange) max(l, .75) min(c, .16) h);
432
+ --scalar-code-builtin: oklch(from var(--scalar-color-blue) max(l, .68) c h);
433
+ --scalar-code-type: oklch(from var(--scalar-color-blue) max(l, .85) min(c, .075) h);
434
+ --scalar-code-parameter: oklch(from var(--scalar-color-red) max(l, .68) min(c, .19) calc(h - 14));
435
+ --scalar-code-property: oklch(from var(--scalar-color-green) max(l, .68) c h);
436
+ --scalar-code-addition: oklch(from var(--scalar-color-green) max(l, .68) c h);
437
+ --scalar-code-deletion: oklch(from var(--scalar-color-red) max(l, .68) min(c, .19) calc(h - 14));
438
+ }
439
+ }
440
+
398
441
  :root, :host {
399
442
  --leading-snug: 1.375;
400
443
  --ease-in: cubic-bezier(.4, 0, 1, 1);
@@ -752,10 +795,6 @@
752
795
  margin-block: 2px -2px;
753
796
  }
754
797
 
755
- .scalar-app .hljs-regexp, .scalar-app .hljs-string, .scalar-app .hljs-built_in, .scalar-app .hljs-subst, .scalar-app .hljs-name, .scalar-app .hljs-doctag, .scalar-app .hljs-section, .scalar-app .hljs-title {
756
- color: var(--scalar-color-blue);
757
- }
758
-
759
798
  .scalar-code-block-pre {
760
799
  font-family: var(--scalar-font-code);
761
800
  font-variant-ligatures: none;
@@ -847,8 +886,8 @@
847
886
  filter: brightness(1.1);
848
887
  }
849
888
 
850
- .scalar-icon[data-v-b651bb23], .scalar-icon[data-v-b651bb23] * {
851
- stroke-width: var(--c07589c2);
889
+ .scalar-icon[data-v-6150d8b1], .scalar-icon[data-v-6150d8b1] * {
890
+ stroke-width: var(--scalar-icon-stroke-width);
852
891
  }
853
892
 
854
893
  :where(pre:has( > code.hljs)) {
@@ -869,13 +908,13 @@
869
908
  .scalar-app code.hljs {
870
909
  all: unset;
871
910
  font-size: inherit;
872
- color: var(--scalar-color-2);
911
+ color: var(--scalar-color-1);
873
912
  font-family: var(--scalar-font-code);
874
913
  counter-reset: linenumber;
875
914
  }
876
915
 
877
916
  .scalar-app .hljs {
878
- color: var(--scalar-color-2);
917
+ color: var(--scalar-color-1);
879
918
  background: none;
880
919
  }
881
920
 
@@ -890,64 +929,60 @@
890
929
  }
891
930
 
892
931
  .scalar-app .hljs-comment, .scalar-app .hljs-quote {
893
- color: var(--scalar-color-3);
932
+ color: var(--scalar-code-comment, var(--scalar-color-2));
894
933
  font-style: italic;
895
934
  }
896
935
 
897
- .scalar-app .hljs-number {
898
- color: var(--scalar-color-orange);
936
+ .scalar-app .hljs-punctuation, .scalar-app .hljs-operator, .scalar-app .hljs-bullet {
937
+ color: var(--scalar-code-punctuation, var(--scalar-color-2));
899
938
  }
900
939
 
901
- .scalar-app .hljs-regexp, .scalar-app .hljs-string, .scalar-app .hljs-built_in {
902
- color: var(--scalar-color-blue);
940
+ .scalar-app .hljs-number, .scalar-app .hljs-literal, .scalar-app .hljs-symbol {
941
+ color: var(--scalar-code-number, var(--scalar-color-orange));
903
942
  }
904
943
 
905
- .scalar-app .hljs-title.class_ {
906
- color: var(--scalar-color-1);
944
+ .scalar-app .hljs-regexp, .scalar-app .hljs-string {
945
+ color: var(--scalar-code-string, var(--scalar-color-blue));
907
946
  }
908
947
 
909
- .scalar-app .hljs-keyword {
910
- color: var(--scalar-color-purple);
948
+ .scalar-app .hljs-built_in, .scalar-app .hljs-meta {
949
+ color: var(--scalar-code-builtin, var(--scalar-color-blue));
911
950
  }
912
951
 
913
- .scalar-app .hljs-title.function_ {
914
- color: var(--scalar-color-orange);
952
+ .scalar-app .hljs-keyword, .scalar-app .hljs-doctag, .scalar-app .hljs-subst, .scalar-app .hljs-name {
953
+ color: var(--scalar-code-keyword, var(--scalar-color-purple));
915
954
  }
916
955
 
917
- .scalar-app .hljs-subst, .scalar-app .hljs-name {
918
- color: var(--scalar-color-blue);
956
+ .scalar-app .hljs-section, .scalar-app .hljs-link, .scalar-app .hljs-title, .scalar-app .hljs-title.function_ {
957
+ color: var(--scalar-code-function, var(--scalar-color-orange));
919
958
  }
920
959
 
921
- .scalar-app .hljs-attr, .scalar-app .hljs-attribute {
922
- color: var(--scalar-color-1);
960
+ .scalar-app .hljs-title.class_, .scalar-app .hljs-type {
961
+ color: var(--scalar-code-type, var(--scalar-color-1));
923
962
  }
924
963
 
925
- .scalar-app .hljs-addition, .scalar-app .hljs-literal, .scalar-app .hljs-selector-tag, .scalar-app .hljs-type {
926
- color: var(--scalar-color-green);
964
+ .scalar-app .hljs-params {
965
+ color: var(--scalar-code-parameter, var(--scalar-color-red));
927
966
  }
928
967
 
929
- .scalar-app .hljs-selector-attr, .scalar-app .hljs-selector-pseudo {
930
- color: var(--scalar-color-orange);
931
- }
932
-
933
- .scalar-app .hljs-doctag, .scalar-app .hljs-section, .scalar-app .hljs-title {
934
- color: var(--scalar-color-blue);
968
+ .scalar-app .hljs-property, .scalar-app .hljs-attr, .scalar-app .hljs-attribute, .scalar-app .hljs-selector-tag, .scalar-app .hljs-selector-attr, .scalar-app .hljs-selector-pseudo {
969
+ color: var(--scalar-code-property, var(--scalar-color-green));
935
970
  }
936
971
 
937
972
  .scalar-app .hljs-selector-id, .scalar-app .hljs-template-variable, .scalar-app .hljs-variable {
938
973
  color: var(--scalar-color-1);
939
974
  }
940
975
 
941
- .scalar-app .hljs-name, .scalar-app .hljs-section, .scalar-app .hljs-strong {
942
- font-weight: var(--scalar-semibold);
976
+ .scalar-app .hljs-addition {
977
+ color: var(--scalar-code-addition, var(--scalar-color-green));
943
978
  }
944
979
 
945
- .scalar-app .hljs-bullet, .scalar-app .hljs-link, .scalar-app .hljs-meta, .scalar-app .hljs-symbol {
946
- color: var(--scalar-color-blue);
980
+ .scalar-app .hljs-name, .scalar-app .hljs-section, .scalar-app .hljs-strong {
981
+ font-weight: var(--scalar-semibold);
947
982
  }
948
983
 
949
984
  .scalar-app .hljs-deletion {
950
- color: var(--scalar-color-red);
985
+ color: var(--scalar-code-deletion, var(--scalar-color-red));
951
986
  }
952
987
 
953
988
  .scalar-app .hljs-formula {
@@ -975,27 +1010,19 @@
975
1010
  }
976
1011
 
977
1012
  .hljs.language-html .hljs-attr {
978
- color: var(--scalar-color-2);
1013
+ color: var(--scalar-code-property, var(--scalar-color-green));
979
1014
  }
980
1015
 
981
1016
  .hljs.language-curl .hljs-string {
982
- color: var(--scalar-color-blue);
1017
+ color: var(--scalar-code-string, var(--scalar-color-blue));
983
1018
  }
984
1019
 
985
- .hljs.language-curl .hljs-literal {
986
- color: var(--scalar-color-1);
987
- }
988
-
989
- .hljs.language-php .hljs-variable {
990
- color: var(--scalar-color-blue);
991
- }
992
-
993
- .hljs.language-objectivec .hljs-meta {
1020
+ .hljs.language-curl .hljs-literal, .hljs.language-php .hljs-variable, .hljs.language-objectivec .hljs-meta {
994
1021
  color: var(--scalar-color-1);
995
1022
  }
996
1023
 
997
1024
  .hljs.language-objectivec .hljs-built_in {
998
- color: var(--scalar-color-orange);
1025
+ color: var(--scalar-code-builtin, var(--scalar-color-blue));
999
1026
  }
1000
1027
 
1001
1028
  .scalar-app .markdown {
@@ -2305,6 +2332,14 @@
2305
2332
  margin-block: 6px;
2306
2333
  }
2307
2334
 
2335
+ .scalar-app .ms-1 {
2336
+ margin-inline-start: 4px;
2337
+ }
2338
+
2339
+ .scalar-app .me-1 {
2340
+ margin-inline-end: 4px;
2341
+ }
2342
+
2308
2343
  .scalar-app .-mt-\(--scalar-sidebar-padding\) {
2309
2344
  margin-top: calc(var(--scalar-sidebar-padding) * -1);
2310
2345
  }
@@ -3097,10 +3132,18 @@
3097
3132
  border-color: var(--scalar-sidebar-search-border-color, var(--scalar-border-color));
3098
3133
  }
3099
3134
 
3135
+ .scalar-app .border-transparent {
3136
+ border-color: #0000;
3137
+ }
3138
+
3100
3139
  .scalar-app .border-b-sidebar-border {
3101
3140
  border-bottom-color: var(--scalar-sidebar-border-color, var(--scalar-border-color));
3102
3141
  }
3103
3142
 
3143
+ .scalar-app .bg-\(--badge-color\) {
3144
+ background-color: var(--badge-color);
3145
+ }
3146
+
3104
3147
  .scalar-app .bg-\(--bg-light\) {
3105
3148
  background-color: var(--bg-light);
3106
3149
  }
@@ -3370,6 +3413,10 @@
3370
3413
  padding-inline: 24px;
3371
3414
  }
3372
3415
 
3416
+ .scalar-app .px-\[5px\] {
3417
+ padding-inline: 5px;
3418
+ }
3419
+
3373
3420
  .scalar-app .py-0\.5 {
3374
3421
  padding-block: 2px;
3375
3422
  }
@@ -3466,6 +3513,10 @@
3466
3513
  text-align: start;
3467
3514
  }
3468
3515
 
3516
+ .scalar-app .align-\[1px\] {
3517
+ vertical-align: 1px;
3518
+ }
3519
+
3469
3520
  .scalar-app .font-code {
3470
3521
  font-family: var(--scalar-font-code);
3471
3522
  }
@@ -3509,6 +3560,10 @@
3509
3560
  font-size: var(--scalar-font-size-7);
3510
3561
  }
3511
3562
 
3563
+ .scalar-app .text-\[10px\] {
3564
+ font-size: 10px;
3565
+ }
3566
+
3512
3567
  .scalar-app .text-sm {
3513
3568
  font-size: var(--scalar-font-size-4);
3514
3569
  }
@@ -3521,6 +3576,11 @@
3521
3576
  font-size: var(--scalar-font-size-6);
3522
3577
  }
3523
3578
 
3579
+ .scalar-app .leading-\[14px\] {
3580
+ --tw-leading: 14px;
3581
+ line-height: 14px;
3582
+ }
3583
+
3524
3584
  .scalar-app .leading-\[22px\] {
3525
3585
  --tw-leading: 22px;
3526
3586
  line-height: 22px;
@@ -3577,6 +3637,22 @@
3577
3637
  white-space: pre;
3578
3638
  }
3579
3639
 
3640
+ .scalar-app .text-auto-contrast-\(--badge-color\) {
3641
+ color: var(--badge-color);
3642
+ }
3643
+
3644
+ @supports (color: color-mix(in lab, red, red)) {
3645
+ .scalar-app .text-auto-contrast-\(--badge-color\) {
3646
+ color: color-mix(in srgb, var(--badge-color), black 40%);
3647
+ }
3648
+ }
3649
+
3650
+ @supports (color: lch(from red calc((50 - l) * infinity) 0 0)) {
3651
+ .scalar-app .text-auto-contrast-\(--badge-color\) {
3652
+ color: lch(from var(--badge-color) calc((50 - l) * infinity) 0 0 / 1);
3653
+ }
3654
+ }
3655
+
3580
3656
  .scalar-app .text-b-1 {
3581
3657
  color: var(--scalar-background-1);
3582
3658
  }
package/dist/types.d.ts CHANGED
@@ -12,6 +12,12 @@ export type SidebarOptions = Partial<{
12
12
  * @default false
13
13
  */
14
14
  hideOperationDefaultExamples: boolean;
15
+ /**
16
+ * Whether to show the `x-badges` of operations, webhooks, tags, tag groups and models next to their titles.
17
+ *
18
+ * @default false
19
+ */
20
+ showBadgesInSidebar: boolean;
15
21
  labels: Partial<{
16
22
  closeGroup: string;
17
23
  httpMethod: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;AAEhF;;GAEG;AACH,MAAM,MAAM,IAAI,GAAG,cAAc,CAAA;AAEjC,MAAM,MAAM,MAAM,GAAG,QAAQ,GAAG,WAAW,CAAA;AAE3C,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC;IACnC,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAA;IACxC;;;;OAIG;IACH,4BAA4B,EAAE,OAAO,CAAA;IACrC,MAAM,EAAE,OAAO,CAAC;QACd,UAAU,EAAE,MAAM,CAAA;QAClB,UAAU,EAAE,MAAM,CAAA;QAClB,SAAS,EAAE,MAAM,CAAA;KAClB,CAAC,CAAA;CACH,CAAC,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;AAEhF;;GAEG;AACH,MAAM,MAAM,IAAI,GAAG,cAAc,CAAA;AAEjC,MAAM,MAAM,MAAM,GAAG,QAAQ,GAAG,WAAW,CAAA;AAE3C,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC;IACnC,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAA;IACxC;;;;OAIG;IACH,4BAA4B,EAAE,OAAO,CAAA;IACrC;;;;OAIG;IACH,mBAAmB,EAAE,OAAO,CAAA;IAC5B,MAAM,EAAE,OAAO,CAAC;QACd,UAAU,EAAE,MAAM,CAAA;QAClB,UAAU,EAAE,MAAM,CAAA;QAClB,SAAS,EAAE,MAAM,CAAA;KAClB,CAAC,CAAA;CACH,CAAC,CAAA"}
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "url": "git+https://github.com/scalar/scalar.git",
11
11
  "directory": "packages/sidebar"
12
12
  },
13
- "version": "0.12.12",
13
+ "version": "0.13.1",
14
14
  "engines": {
15
15
  "node": ">=22"
16
16
  },
@@ -32,12 +32,12 @@
32
32
  "dist"
33
33
  ],
34
34
  "dependencies": {
35
- "@scalar/components": "0.35.2",
36
- "@scalar/helpers": "0.18.1",
35
+ "@scalar/components": "0.35.4",
36
+ "@scalar/helpers": "0.19.0",
37
37
  "@scalar/icons": "0.7.11",
38
- "@scalar/themes": "0.20.3",
39
- "@scalar/use-hooks": "0.4.28",
40
- "@scalar/workspace-store": "0.74.0",
38
+ "@scalar/themes": "0.21.0",
39
+ "@scalar/use-hooks": "0.4.29",
40
+ "@scalar/workspace-store": "0.75.0",
41
41
  "vue": "^3.5.45"
42
42
  },
43
43
  "devDependencies": {