@scalar/sidebar 0.7.38 → 0.7.40
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/dist/components/ScalarSidebar.vue.d.ts +2 -0
- package/dist/components/ScalarSidebar.vue.d.ts.map +1 -1
- package/dist/components/ScalarSidebar.vue.js +31 -32
- package/dist/components/SidebarItem.vue.d.ts +2 -0
- package/dist/components/SidebarItem.vue.d.ts.map +1 -1
- package/dist/components/SidebarItem.vue.js +89 -84
- package/package.json +5 -5
|
@@ -67,9 +67,11 @@ type __VLS_Slots = {
|
|
|
67
67
|
};
|
|
68
68
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
69
69
|
selectItem: (id: string) => any;
|
|
70
|
+
toggleGroup: (id: string) => any;
|
|
70
71
|
reorder: (draggingItem: DraggingItem, hoveredItem: HoveredItem) => any;
|
|
71
72
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
72
73
|
onSelectItem?: ((id: string) => any) | undefined;
|
|
74
|
+
onToggleGroup?: ((id: string) => any) | undefined;
|
|
73
75
|
onReorder?: ((draggingItem: DraggingItem, hoveredItem: HoveredItem) => any) | undefined;
|
|
74
76
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
75
77
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarSidebar.vue.d.ts","sourceRoot":"","sources":["../../src/components/ScalarSidebar.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarSidebar.vue.d.ts","sourceRoot":"","sources":["../../src/components/ScalarSidebar.vue"],"names":[],"mappings":"AAsKA,OAAO,KAAK,EACV,YAAY,EACZ,WAAW,EACX,mBAAmB,EACpB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAI3C,KAAK,WAAW,GAAG;IACjB;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,KAAK,EAAE,IAAI,EAAE,CAAA;IACb;;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;QACR,oBAAoB,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAA;KACrD,CAAA;IACD;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;;OAIG;IACH,WAAW,CAAC,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAA;IAChD;;;;OAIG;IACH,WAAW,CAAC,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAA;CACjD,CAAC;AA8BF,KAAK,WAAW,GAAG;IACjB,oCAAoC;IACpC,OAAO,CAAC,IAAI,OAAO,CAAA;IACnB,iEAAiE;IACjE,SAAS,CAAC,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,IAAI,CAAA;KAAE,GAAG,OAAO,CAAA;IAC1C,yEAAyE;IACzE,MAAM,CAAC,IAAI,OAAO,CAAA;IAClB,4EAA4E;IAC5E,MAAM,CAAC,IAAI,OAAO,CAAA;IAClB,6DAA6D;IAC7D,MAAM,CAAC,IAAI,OAAO,CAAA;IAClB,2CAA2C;IAC3C,KAAK,CAAC,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,IAAI,CAAA;KAAE,GAAG,OAAO,CAAA;IACtC,2CAA2C;IAC3C,IAAI,CAAC,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,IAAI,CAAC;QAAC,IAAI,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAA;CACrD,CAAC;AAwKF,QAAA,MAAM,UAAU;;;;;;;;kFAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as y, useSlots as g, createBlock as f, openBlock as i, unref as d, normalizeStyle as S, withCtx as n, renderSlot as r, createVNode as b, createElementVNode as D, createElementBlock as E, Fragment as $, renderList as k, createSlots as I, mergeProps as m } from "vue";
|
|
2
2
|
import { ScalarSidebar as v, ScalarSidebarItems as x } from "@scalar/components";
|
|
3
3
|
import { filterItems as F } from "../helpers/filter-items.js";
|
|
4
4
|
import B from "./SidebarItem.vue.js";
|
|
5
|
-
const w = /* @__PURE__ */
|
|
5
|
+
const w = /* @__PURE__ */ y({
|
|
6
6
|
__name: "ScalarSidebar",
|
|
7
7
|
props: {
|
|
8
8
|
layout: {},
|
|
@@ -14,53 +14,52 @@ const w = /* @__PURE__ */ p({
|
|
|
14
14
|
isDraggable: {},
|
|
15
15
|
isDroppable: { type: Function }
|
|
16
16
|
},
|
|
17
|
-
emits: ["reorder", "selectItem"],
|
|
18
|
-
setup(e, { emit:
|
|
19
|
-
const
|
|
20
|
-
|
|
17
|
+
emits: ["reorder", "selectItem", "toggleGroup"],
|
|
18
|
+
setup(e, { emit: c }) {
|
|
19
|
+
const s = c, a = g(), p = (t, l) => {
|
|
20
|
+
s("reorder", t, l);
|
|
21
21
|
};
|
|
22
|
-
return (t,
|
|
22
|
+
return (t, l) => (i(), f(d(v), {
|
|
23
23
|
class: "flex min-h-0 flex-col",
|
|
24
|
-
style:
|
|
25
|
-
"--scalar-sidebar-indent": e.indent + "px"
|
|
26
|
-
})
|
|
24
|
+
style: S({ "--scalar-sidebar-indent": e.indent + "px" })
|
|
27
25
|
}, {
|
|
28
|
-
default:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
default:
|
|
33
|
-
|
|
34
|
-
(
|
|
35
|
-
key:
|
|
26
|
+
default: n(() => [
|
|
27
|
+
r(t.$slots, "header"),
|
|
28
|
+
r(t.$slots, "default", {}, () => [
|
|
29
|
+
b(d(x), { class: "custom-scroll" }, {
|
|
30
|
+
default: n(() => [
|
|
31
|
+
r(t.$slots, "before"),
|
|
32
|
+
(i(!0), E($, null, k(d(F)(e.layout, e.items), (u) => (i(), f(B, {
|
|
33
|
+
key: u.id,
|
|
36
34
|
isDraggable: e.isDraggable ?? e.layout === "client",
|
|
37
35
|
isDroppable: e.isDroppable,
|
|
38
36
|
isExpanded: e.isExpanded,
|
|
39
37
|
isSelected: e.isSelected,
|
|
40
|
-
item:
|
|
38
|
+
item: u,
|
|
41
39
|
layout: e.layout,
|
|
42
40
|
options: e.options,
|
|
43
|
-
onOnDragEnd:
|
|
44
|
-
onSelectItem:
|
|
41
|
+
onOnDragEnd: p,
|
|
42
|
+
onSelectItem: l[0] || (l[0] = (o) => s("selectItem", o)),
|
|
43
|
+
onToggleGroup: l[1] || (l[1] = (o) => s("toggleGroup", o))
|
|
45
44
|
}, I({ _: 2 }, [
|
|
46
|
-
|
|
45
|
+
a.decorator ? {
|
|
47
46
|
name: "decorator",
|
|
48
|
-
fn:
|
|
49
|
-
|
|
47
|
+
fn: n((o) => [
|
|
48
|
+
r(t.$slots, "decorator", m({ ref_for: !0 }, o))
|
|
50
49
|
]),
|
|
51
50
|
key: "0"
|
|
52
51
|
} : void 0,
|
|
53
|
-
|
|
52
|
+
a.empty ? {
|
|
54
53
|
name: "empty",
|
|
55
|
-
fn:
|
|
56
|
-
|
|
54
|
+
fn: n((o) => [
|
|
55
|
+
r(t.$slots, "empty", m({ ref_for: !0 }, o))
|
|
57
56
|
]),
|
|
58
57
|
key: "1"
|
|
59
58
|
} : void 0,
|
|
60
|
-
|
|
59
|
+
a.icon ? {
|
|
61
60
|
name: "icon",
|
|
62
|
-
fn:
|
|
63
|
-
|
|
61
|
+
fn: n((o) => [
|
|
62
|
+
r(t.$slots, "icon", m({ ref_for: !0 }, o))
|
|
64
63
|
]),
|
|
65
64
|
key: "2"
|
|
66
65
|
} : void 0
|
|
@@ -68,9 +67,9 @@ const w = /* @__PURE__ */ p({
|
|
|
68
67
|
]),
|
|
69
68
|
_: 3
|
|
70
69
|
}),
|
|
71
|
-
|
|
70
|
+
l[2] || (l[2] = D("div", { class: "flex-1" }, null, -1))
|
|
72
71
|
]),
|
|
73
|
-
|
|
72
|
+
r(t.$slots, "footer")
|
|
74
73
|
]),
|
|
75
74
|
_: 3
|
|
76
75
|
}, 8, ["style"]));
|
|
@@ -64,9 +64,11 @@ type __VLS_Slots = {
|
|
|
64
64
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
65
65
|
onDragEnd: (draggingItem: DraggingItem, hoveredItem: HoveredItem) => any;
|
|
66
66
|
selectItem: (id: string) => any;
|
|
67
|
+
toggleGroup: (id: string) => any;
|
|
67
68
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
68
69
|
onOnDragEnd?: ((draggingItem: DraggingItem, hoveredItem: HoveredItem) => any) | undefined;
|
|
69
70
|
onSelectItem?: ((id: string) => any) | undefined;
|
|
71
|
+
onToggleGroup?: ((id: string) => any) | undefined;
|
|
70
72
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
71
73
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
72
74
|
declare const _default: typeof __VLS_export;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarItem.vue.d.ts","sourceRoot":"","sources":["../../src/components/SidebarItem.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SidebarItem.vue.d.ts","sourceRoot":"","sources":["../../src/components/SidebarItem.vue"],"names":[],"mappings":"AA4VA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACzB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAK3C,KAAK,WAAW,GAAG;IACf;;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,EACH;QACE,oBAAoB,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAA;KACrD,GACD,SAAS,CAAA;IAEb;;;;OAIG;IACH,WAAW,CAAC,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAA;IAChD;;;;OAIG;IACH,WAAW,CAAC,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAA;CACjD,CAAC;AA0BJ,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,EAAE,IAAI,CAAC;QAAC,IAAI,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAA;CACrD,CAAC;AA6iBF,QAAA,MAAM,UAAU;;;;;;;;kFAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as N, useSlots as V, resolveComponent as H, createBlock as
|
|
1
|
+
import { defineComponent as N, useSlots as V, resolveComponent as H, createBlock as u, unref as n, openBlock as r, mergeProps as m, toHandlers as D, withCtx as o, createTextVNode as L, toDisplayString as O, createElementBlock as g, Fragment as E, renderList as I, createSlots as b, renderSlot as d, createVNode as y, createCommentVNode as $, normalizeClass as G } from "vue";
|
|
2
2
|
import { ScalarSidebarSection as z, ScalarSidebarGroup as A, ScalarSidebarItem as P } from "@scalar/components";
|
|
3
3
|
import { LibraryIcon as j } from "@scalar/icons/library";
|
|
4
|
-
import
|
|
5
|
-
import { filterItems as
|
|
4
|
+
import w from "./SidebarItemDecorator.vue.js";
|
|
5
|
+
import { filterItems as C } from "../helpers/filter-items.js";
|
|
6
6
|
import { hasChildren as q } from "../helpers/has-children.js";
|
|
7
7
|
import { isSidebarFolder as J } from "../helpers/is-sidebar-folder.js";
|
|
8
8
|
import { useDraggable as K } from "../hooks/use-draggable.js";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
9
|
+
import F from "./SidebarHttpBadge.vue.js";
|
|
10
|
+
import f from "./SidebarItemLabel.vue.js";
|
|
11
11
|
const M = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "line-through"
|
|
@@ -25,24 +25,24 @@ const M = {
|
|
|
25
25
|
isDraggable: {},
|
|
26
26
|
isDroppable: { type: Function }
|
|
27
27
|
},
|
|
28
|
-
emits: ["selectItem", "onDragEnd"],
|
|
29
|
-
setup(e, { emit:
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
}, { draggableAttrs: k, draggableEvents:
|
|
28
|
+
emits: ["selectItem", "onDragEnd", "toggleGroup"],
|
|
29
|
+
setup(e, { emit: x }) {
|
|
30
|
+
const s = x, l = V(), B = (t) => "isGroup" in t && t.isGroup, h = (t) => ("isDeprecated" in t && t.isDeprecated) ?? !1, S = (t, a) => {
|
|
31
|
+
s("onDragEnd", t, a);
|
|
32
|
+
}, { draggableAttrs: k, draggableEvents: v } = K({
|
|
33
33
|
id: e.item.id,
|
|
34
34
|
isDraggable: e.isDraggable,
|
|
35
35
|
isDroppable: e.isDroppable,
|
|
36
36
|
onDragEnd: S
|
|
37
37
|
});
|
|
38
|
-
return (t,
|
|
39
|
-
const
|
|
40
|
-
return
|
|
38
|
+
return (t, a) => {
|
|
39
|
+
const T = H("SidebarItem", !0);
|
|
40
|
+
return n(q)(e.item) && B(e.item) ? (r(), u(n(z), m({
|
|
41
41
|
key: 0,
|
|
42
42
|
"data-sidebar-id": e.item.id
|
|
43
|
-
},
|
|
44
|
-
items:
|
|
45
|
-
(r(!0),
|
|
43
|
+
}, n(k), D(n(v))), {
|
|
44
|
+
items: o(() => [
|
|
45
|
+
(r(!0), g(E, null, I(n(C)(e.layout, e.item.children), (c) => (r(), u(T, {
|
|
46
46
|
key: c.id,
|
|
47
47
|
isDraggable: e.isDraggable,
|
|
48
48
|
isDroppable: e.isDroppable,
|
|
@@ -52,47 +52,51 @@ const M = {
|
|
|
52
52
|
layout: e.layout,
|
|
53
53
|
options: e.options,
|
|
54
54
|
onOnDragEnd: S,
|
|
55
|
-
onSelectItem:
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
onSelectItem: a[0] || (a[0] = (i) => s("selectItem", i)),
|
|
56
|
+
onToggleGroup: a[1] || (a[1] = (i) => s("toggleGroup", i))
|
|
57
|
+
}, b({ _: 2 }, [
|
|
58
|
+
l.decorator ? {
|
|
58
59
|
name: "decorator",
|
|
59
|
-
fn:
|
|
60
|
-
|
|
60
|
+
fn: o((i) => [
|
|
61
|
+
d(t.$slots, "decorator", m({ ref_for: !0 }, i))
|
|
61
62
|
]),
|
|
62
63
|
key: "0"
|
|
63
64
|
} : void 0,
|
|
64
|
-
|
|
65
|
+
l.empty ? {
|
|
65
66
|
name: "empty",
|
|
66
|
-
fn:
|
|
67
|
-
|
|
67
|
+
fn: o((i) => [
|
|
68
|
+
d(t.$slots, "empty", m({ ref_for: !0 }, i))
|
|
68
69
|
]),
|
|
69
70
|
key: "1"
|
|
70
71
|
} : void 0,
|
|
71
|
-
|
|
72
|
+
l.icon ? {
|
|
72
73
|
name: "icon",
|
|
73
|
-
fn:
|
|
74
|
-
|
|
74
|
+
fn: o((i) => [
|
|
75
|
+
d(t.$slots, "icon", m({ ref_for: !0 }, i))
|
|
75
76
|
]),
|
|
76
77
|
key: "2"
|
|
77
78
|
} : void 0
|
|
78
79
|
]), 1032, ["isDraggable", "isDroppable", "isExpanded", "isSelected", "item", "layout", "options"]))), 128))
|
|
79
80
|
]),
|
|
80
|
-
default:
|
|
81
|
+
default: o(() => [
|
|
81
82
|
L(O(e.item.title) + " ", 1)
|
|
82
83
|
]),
|
|
83
84
|
_: 3
|
|
84
|
-
}, 16, ["data-sidebar-id"])) :
|
|
85
|
+
}, 16, ["data-sidebar-id"])) : n(J)(e.layout, e.item, l.empty !== void 0) ? (r(), u(n(A), m({
|
|
85
86
|
key: 1,
|
|
86
87
|
active: e.isSelected(e.item.id),
|
|
87
88
|
class: "relative",
|
|
88
89
|
controlled: "",
|
|
89
|
-
"data-sidebar-id": e.item.id
|
|
90
|
+
"data-sidebar-id": e.item.id
|
|
91
|
+
}, n(k), {
|
|
92
|
+
discrete: e.layout === "reference" && e.item.type === "text",
|
|
90
93
|
open: e.isExpanded(e.item.id)
|
|
91
|
-
},
|
|
92
|
-
onClick:
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
}, D(n(v)), {
|
|
95
|
+
onClick: a[4] || (a[4] = () => s("selectItem", e.item.id)),
|
|
96
|
+
onToggle: a[5] || (a[5] = () => s("toggleGroup", e.item.id))
|
|
97
|
+
}), b({
|
|
98
|
+
items: o(() => [
|
|
99
|
+
(r(!0), g(E, null, I(n(C)(e.layout, e.item.children ?? []), (c) => (r(), u(T, {
|
|
96
100
|
key: c.id,
|
|
97
101
|
isDraggable: e.isDraggable,
|
|
98
102
|
isDroppable: e.isDroppable,
|
|
@@ -103,42 +107,43 @@ const M = {
|
|
|
103
107
|
options: e.options,
|
|
104
108
|
parentIds: [],
|
|
105
109
|
onOnDragEnd: S,
|
|
106
|
-
onSelectItem:
|
|
107
|
-
|
|
108
|
-
|
|
110
|
+
onSelectItem: a[2] || (a[2] = (i) => s("selectItem", i)),
|
|
111
|
+
onToggleGroup: a[3] || (a[3] = (i) => s("toggleGroup", i))
|
|
112
|
+
}, b({ _: 2 }, [
|
|
113
|
+
l.decorator ? {
|
|
109
114
|
name: "decorator",
|
|
110
|
-
fn:
|
|
111
|
-
|
|
115
|
+
fn: o((i) => [
|
|
116
|
+
d(t.$slots, "decorator", m({ ref_for: !0 }, i))
|
|
112
117
|
]),
|
|
113
118
|
key: "0"
|
|
114
119
|
} : void 0,
|
|
115
|
-
|
|
120
|
+
l.empty ? {
|
|
116
121
|
name: "empty",
|
|
117
|
-
fn:
|
|
118
|
-
|
|
122
|
+
fn: o((i) => [
|
|
123
|
+
d(t.$slots, "empty", m({ ref_for: !0 }, i))
|
|
119
124
|
]),
|
|
120
125
|
key: "1"
|
|
121
126
|
} : void 0,
|
|
122
|
-
|
|
127
|
+
l.icon ? {
|
|
123
128
|
name: "icon",
|
|
124
|
-
fn:
|
|
125
|
-
|
|
129
|
+
fn: o((i) => [
|
|
130
|
+
d(t.$slots, "icon", m({ ref_for: !0 }, i))
|
|
126
131
|
]),
|
|
127
132
|
key: "2"
|
|
128
133
|
} : void 0
|
|
129
134
|
]), 1032, ["isDraggable", "isDroppable", "isExpanded", "isSelected", "item", "layout", "options"]))), 128)),
|
|
130
|
-
|
|
135
|
+
l.empty && (e.item.children?.length ?? 0) === 0 ? d(t.$slots, "empty", {
|
|
131
136
|
key: 0,
|
|
132
137
|
item: e.item
|
|
133
138
|
}) : $("", !0)
|
|
134
139
|
]),
|
|
135
|
-
default:
|
|
136
|
-
|
|
137
|
-
|
|
140
|
+
default: o(() => [
|
|
141
|
+
h(e.item) ? (r(), g("span", M, [
|
|
142
|
+
y(f, {
|
|
138
143
|
item: e.item,
|
|
139
144
|
operationTitleSource: e.options?.operationTitleSource
|
|
140
145
|
}, null, 8, ["item", "operationTitleSource"])
|
|
141
|
-
])) : (r(),
|
|
146
|
+
])) : (r(), u(f, {
|
|
142
147
|
key: 1,
|
|
143
148
|
item: e.item,
|
|
144
149
|
operationTitleSource: e.options?.operationTitleSource
|
|
@@ -148,12 +153,12 @@ const M = {
|
|
|
148
153
|
}, [
|
|
149
154
|
e.item.type === "document" ? {
|
|
150
155
|
name: "icon",
|
|
151
|
-
fn:
|
|
152
|
-
|
|
156
|
+
fn: o(({ open: c }) => [
|
|
157
|
+
d(t.$slots, "icon", {
|
|
153
158
|
item: e.item,
|
|
154
159
|
open: c
|
|
155
160
|
}, () => [
|
|
156
|
-
|
|
161
|
+
y(n(j), {
|
|
157
162
|
class: "block",
|
|
158
163
|
src: "icon" in e.item && e.item.icon || "interface-content-folder"
|
|
159
164
|
}, null, 8, ["src"])
|
|
@@ -163,12 +168,12 @@ const M = {
|
|
|
163
168
|
} : void 0,
|
|
164
169
|
"method" in e.item ? {
|
|
165
170
|
name: "aside",
|
|
166
|
-
fn:
|
|
167
|
-
|
|
171
|
+
fn: o(() => [
|
|
172
|
+
y(F, {
|
|
168
173
|
active: e.isSelected(e.item.id),
|
|
169
|
-
class:
|
|
174
|
+
class: G(["mr-1 ml-2 h-4 self-start", {
|
|
170
175
|
// Hide the badge when we're showing the decorator
|
|
171
|
-
"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":
|
|
176
|
+
"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": l.decorator
|
|
172
177
|
}]),
|
|
173
178
|
method: e.item.method,
|
|
174
179
|
webhook: e.item.type === "webhook"
|
|
@@ -176,35 +181,35 @@ const M = {
|
|
|
176
181
|
]),
|
|
177
182
|
key: "1"
|
|
178
183
|
} : void 0,
|
|
179
|
-
|
|
184
|
+
l.decorator ? {
|
|
180
185
|
name: "after",
|
|
181
|
-
fn:
|
|
182
|
-
|
|
183
|
-
default:
|
|
184
|
-
|
|
186
|
+
fn: o(() => [
|
|
187
|
+
y(w, null, {
|
|
188
|
+
default: o(() => [
|
|
189
|
+
d(t.$slots, "decorator", { item: e.item })
|
|
185
190
|
]),
|
|
186
191
|
_: 3
|
|
187
192
|
})
|
|
188
193
|
]),
|
|
189
194
|
key: "2"
|
|
190
195
|
} : void 0
|
|
191
|
-
]), 1040, ["active", "data-sidebar-id", "open"])) : (r(),
|
|
196
|
+
]), 1040, ["active", "data-sidebar-id", "discrete", "open"])) : (r(), u(n(P), m({
|
|
192
197
|
key: 2,
|
|
193
198
|
is: "button"
|
|
194
|
-
},
|
|
199
|
+
}, n(k), {
|
|
195
200
|
class: "relative",
|
|
196
201
|
"data-sidebar-id": e.item.id,
|
|
197
202
|
selected: e.isSelected(e.item.id)
|
|
198
|
-
},
|
|
199
|
-
onClick:
|
|
200
|
-
}),
|
|
201
|
-
default:
|
|
202
|
-
|
|
203
|
-
|
|
203
|
+
}, D(n(v)), {
|
|
204
|
+
onClick: a[6] || (a[6] = () => s("selectItem", e.item.id))
|
|
205
|
+
}), b({
|
|
206
|
+
default: o(() => [
|
|
207
|
+
h(e.item) ? (r(), g("span", Q, [
|
|
208
|
+
y(f, {
|
|
204
209
|
item: e.item,
|
|
205
210
|
operationTitleSource: e.options?.operationTitleSource
|
|
206
211
|
}, null, 8, ["item", "operationTitleSource"])
|
|
207
|
-
])) : (r(),
|
|
212
|
+
])) : (r(), u(f, {
|
|
208
213
|
key: 1,
|
|
209
214
|
item: e.item,
|
|
210
215
|
operationTitleSource: e.options?.operationTitleSource
|
|
@@ -212,10 +217,10 @@ const M = {
|
|
|
212
217
|
]),
|
|
213
218
|
_: 2
|
|
214
219
|
}, [
|
|
215
|
-
|
|
220
|
+
l.icon ? {
|
|
216
221
|
name: "icon",
|
|
217
|
-
fn:
|
|
218
|
-
|
|
222
|
+
fn: o(() => [
|
|
223
|
+
d(t.$slots, "icon", {
|
|
219
224
|
item: e.item,
|
|
220
225
|
open: !0
|
|
221
226
|
})
|
|
@@ -224,13 +229,13 @@ const M = {
|
|
|
224
229
|
} : void 0,
|
|
225
230
|
"method" in e.item ? {
|
|
226
231
|
name: "aside",
|
|
227
|
-
fn:
|
|
228
|
-
"method" in e.item ? (r(),
|
|
232
|
+
fn: o(() => [
|
|
233
|
+
"method" in e.item ? (r(), u(F, {
|
|
229
234
|
key: 0,
|
|
230
235
|
active: e.isSelected(e.item.id),
|
|
231
|
-
class:
|
|
236
|
+
class: G(["ml-2 h-4 self-start", {
|
|
232
237
|
// Hide the badge when we're showing the decorator
|
|
233
|
-
"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":
|
|
238
|
+
"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": l.decorator
|
|
234
239
|
}]),
|
|
235
240
|
method: e.item.method,
|
|
236
241
|
webhook: e.item.type === "webhook"
|
|
@@ -238,12 +243,12 @@ const M = {
|
|
|
238
243
|
]),
|
|
239
244
|
key: "1"
|
|
240
245
|
} : void 0,
|
|
241
|
-
|
|
246
|
+
l.decorator ? {
|
|
242
247
|
name: "after",
|
|
243
|
-
fn:
|
|
244
|
-
|
|
245
|
-
default:
|
|
246
|
-
|
|
248
|
+
fn: o(() => [
|
|
249
|
+
y(w, null, {
|
|
250
|
+
default: o(() => [
|
|
251
|
+
d(t.$slots, "decorator", { item: e.item })
|
|
247
252
|
]),
|
|
248
253
|
_: 3
|
|
249
254
|
})
|
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.7.
|
|
13
|
+
"version": "0.7.40",
|
|
14
14
|
"engines": {
|
|
15
15
|
"node": ">=20"
|
|
16
16
|
},
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"vue": "^3.5.26",
|
|
34
|
-
"@scalar/helpers": "0.2.15",
|
|
35
|
-
"@scalar/components": "0.19.7",
|
|
36
34
|
"@scalar/icons": "0.5.3",
|
|
35
|
+
"@scalar/helpers": "0.2.16",
|
|
37
36
|
"@scalar/themes": "0.14.0",
|
|
38
|
-
"@scalar/
|
|
39
|
-
"@scalar/
|
|
37
|
+
"@scalar/use-hooks": "0.3.7",
|
|
38
|
+
"@scalar/workspace-store": "0.34.3",
|
|
39
|
+
"@scalar/components": "0.19.9"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@tailwindcss/vite": "^4.1.18",
|