@scalar/sidebar 0.7.16 → 0.7.18
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 +5 -0
- package/dist/components/ScalarSidebar.vue.d.ts.map +1 -1
- package/dist/components/ScalarSidebar.vue.js +34 -27
- package/dist/components/SidebarHttpBadge.vue.d.ts.map +1 -1
- package/dist/components/SidebarItem.vue.d.ts +8 -0
- package/dist/components/SidebarItem.vue.d.ts.map +1 -1
- package/dist/components/SidebarItem.vue.js +113 -84
- package/package.json +4 -4
|
@@ -59,6 +59,11 @@ type __VLS_Slots = {
|
|
|
59
59
|
empty?(props: {
|
|
60
60
|
item: Item;
|
|
61
61
|
}): unknown;
|
|
62
|
+
/** Places content when an item is empty */
|
|
63
|
+
icon?(props: {
|
|
64
|
+
item: Item;
|
|
65
|
+
open: boolean;
|
|
66
|
+
}): unknown;
|
|
62
67
|
};
|
|
63
68
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
64
69
|
selectItem: (id: string) => any;
|
|
@@ -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":"AAgKA,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;AAuBF,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;AA6JF,QAAA,MAAM,eAAe;;;;;;kFAOnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarSidebar as
|
|
1
|
+
import { defineComponent as p, useSlots as S, createBlock as f, openBlock as s, unref as i, normalizeStyle as b, withCtx as a, renderSlot as l, createVNode as g, createElementVNode as D, createElementBlock as E, Fragment as $, renderList as k, createSlots as I, mergeProps as d } from "vue";
|
|
2
|
+
import { ScalarSidebar as v, ScalarSidebarItems as x } from "@scalar/components";
|
|
3
3
|
import { filterItems as F } from "../helpers/filter-items.js";
|
|
4
|
-
import
|
|
5
|
-
const
|
|
4
|
+
import B from "./SidebarItem.vue.js";
|
|
5
|
+
const w = /* @__PURE__ */ p({
|
|
6
6
|
__name: "ScalarSidebar",
|
|
7
7
|
props: {
|
|
8
8
|
layout: {},
|
|
@@ -16,59 +16,66 @@ const V = /* @__PURE__ */ y({
|
|
|
16
16
|
},
|
|
17
17
|
emits: ["reorder", "selectItem"],
|
|
18
18
|
setup(e, { emit: u }) {
|
|
19
|
-
const
|
|
20
|
-
|
|
19
|
+
const m = u, n = S(), y = (t, r) => {
|
|
20
|
+
m("reorder", t, r);
|
|
21
21
|
};
|
|
22
|
-
return (t,
|
|
22
|
+
return (t, r) => (s(), f(i(v), {
|
|
23
23
|
class: "flex min-h-0 flex-col",
|
|
24
|
-
style:
|
|
24
|
+
style: b({
|
|
25
25
|
"--scalar-sidebar-indent": e.indent + "px"
|
|
26
26
|
})
|
|
27
27
|
}, {
|
|
28
28
|
default: a(() => [
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
l(t.$slots, "header"),
|
|
30
|
+
l(t.$slots, "default", {}, () => [
|
|
31
|
+
g(i(x), { class: "custom-scroll pt-0" }, {
|
|
32
32
|
default: a(() => [
|
|
33
|
-
|
|
34
|
-
(s(!0),
|
|
35
|
-
key:
|
|
33
|
+
l(t.$slots, "before"),
|
|
34
|
+
(s(!0), E($, null, k(i(F)(e.layout, e.items), (c) => (s(), f(B, {
|
|
35
|
+
key: c.id,
|
|
36
36
|
isDraggable: e.isDraggable ?? e.layout === "client",
|
|
37
37
|
isDroppable: e.isDroppable,
|
|
38
38
|
isExpanded: e.isExpanded,
|
|
39
39
|
isSelected: e.isSelected,
|
|
40
|
-
item:
|
|
40
|
+
item: c,
|
|
41
41
|
layout: e.layout,
|
|
42
42
|
options: e.options,
|
|
43
|
-
onOnDragEnd:
|
|
44
|
-
onSelectItem:
|
|
45
|
-
},
|
|
46
|
-
|
|
43
|
+
onOnDragEnd: y,
|
|
44
|
+
onSelectItem: r[0] || (r[0] = (o) => m("selectItem", o))
|
|
45
|
+
}, I({ _: 2 }, [
|
|
46
|
+
n.decorator ? {
|
|
47
47
|
name: "decorator",
|
|
48
|
-
fn: a((
|
|
49
|
-
|
|
48
|
+
fn: a((o) => [
|
|
49
|
+
l(t.$slots, "decorator", d({ ref_for: !0 }, o))
|
|
50
50
|
]),
|
|
51
51
|
key: "0"
|
|
52
52
|
} : void 0,
|
|
53
|
-
|
|
53
|
+
n.empty ? {
|
|
54
54
|
name: "empty",
|
|
55
|
-
fn: a((
|
|
56
|
-
|
|
55
|
+
fn: a((o) => [
|
|
56
|
+
l(t.$slots, "empty", d({ ref_for: !0 }, o))
|
|
57
57
|
]),
|
|
58
58
|
key: "1"
|
|
59
|
+
} : void 0,
|
|
60
|
+
n.icon ? {
|
|
61
|
+
name: "icon",
|
|
62
|
+
fn: a((o) => [
|
|
63
|
+
l(t.$slots, "icon", d({ ref_for: !0 }, o))
|
|
64
|
+
]),
|
|
65
|
+
key: "2"
|
|
59
66
|
} : void 0
|
|
60
67
|
]), 1032, ["isDraggable", "isDroppable", "isExpanded", "isSelected", "item", "layout", "options"]))), 128))
|
|
61
68
|
]),
|
|
62
69
|
_: 3
|
|
63
70
|
}),
|
|
64
|
-
|
|
71
|
+
r[1] || (r[1] = D("div", { class: "flex-1" }, null, -1))
|
|
65
72
|
]),
|
|
66
|
-
|
|
73
|
+
l(t.$slots, "footer")
|
|
67
74
|
]),
|
|
68
75
|
_: 3
|
|
69
76
|
}, 8, ["style"]));
|
|
70
77
|
}
|
|
71
78
|
});
|
|
72
79
|
export {
|
|
73
|
-
|
|
80
|
+
w as default
|
|
74
81
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarHttpBadge.vue.d.ts","sourceRoot":"","sources":["../../src/components/SidebarHttpBadge.vue"],"names":[],"mappings":"AAyDA,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAC;
|
|
1
|
+
{"version":3,"file":"SidebarHttpBadge.vue.d.ts","sourceRoot":"","sources":["../../src/components/SidebarHttpBadge.vue"],"names":[],"mappings":"AAyDA,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAC;AAgEF,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAsB/C,QAAA,MAAM,eAAe,kSAMnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -52,6 +52,14 @@ type __VLS_Slots = {
|
|
|
52
52
|
empty?(props: {
|
|
53
53
|
item: Item;
|
|
54
54
|
}): unknown;
|
|
55
|
+
/**
|
|
56
|
+
* Adds an optional icon for each item.
|
|
57
|
+
* The slot receives an object with the current item and the open state.
|
|
58
|
+
*/
|
|
59
|
+
icon?(props: {
|
|
60
|
+
item: Item;
|
|
61
|
+
open: boolean;
|
|
62
|
+
}): unknown;
|
|
55
63
|
};
|
|
56
64
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
57
65
|
onDragEnd: (draggingItem: DraggingItem, hoveredItem: HoveredItem) => any;
|
|
@@ -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":"AAoVA,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;AAmBJ,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;AA0eF,QAAA,MAAM,eAAe;;;;;;kFAOnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarSidebarSection as
|
|
1
|
+
import { defineComponent as N, useSlots as V, resolveComponent as H, createBlock as d, unref as n, openBlock as l, mergeProps as c, toHandlers as v, withCtx as i, createTextVNode as L, toDisplayString as O, createElementBlock as f, Fragment as I, renderList as $, createSlots as b, renderSlot as r, createVNode as s, createCommentVNode as D, normalizeClass as w } from "vue";
|
|
2
|
+
import { ScalarSidebarSection as p, ScalarSidebarGroup as z, ScalarSidebarGroupToggle as A, ScalarSidebarItem as P } from "@scalar/components";
|
|
3
3
|
import { LibraryIcon as j } from "@scalar/icons/library";
|
|
4
4
|
import C from "./SidebarItemDecorator.vue.js";
|
|
5
|
-
import { filterItems as
|
|
5
|
+
import { filterItems as x } 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 g from "./SidebarItemLabel.vue.js";
|
|
11
11
|
const M = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "line-through"
|
|
14
14
|
}, Q = {
|
|
15
15
|
key: 0,
|
|
16
16
|
class: "line-through"
|
|
17
|
-
}, oe = /* @__PURE__ */
|
|
17
|
+
}, oe = /* @__PURE__ */ N({
|
|
18
18
|
__name: "SidebarItem",
|
|
19
19
|
props: {
|
|
20
20
|
item: {},
|
|
@@ -26,101 +26,115 @@ const M = {
|
|
|
26
26
|
isDroppable: { type: Function }
|
|
27
27
|
},
|
|
28
28
|
emits: ["selectItem", "onDragEnd"],
|
|
29
|
-
setup(e, { emit:
|
|
30
|
-
const y =
|
|
31
|
-
y("onDragEnd",
|
|
29
|
+
setup(e, { emit: G }) {
|
|
30
|
+
const y = G, a = V(), B = (t) => "isGroup" in t && t.isGroup, E = (t) => ("isDeprecated" in t && t.isDeprecated) ?? !1, S = (t, m) => {
|
|
31
|
+
y("onDragEnd", t, m);
|
|
32
32
|
}, { draggableAttrs: h, draggableEvents: k } = 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 (
|
|
39
|
-
const T =
|
|
40
|
-
return
|
|
41
|
-
items:
|
|
42
|
-
(
|
|
43
|
-
key:
|
|
38
|
+
return (t, m) => {
|
|
39
|
+
const T = H("SidebarItem", !0);
|
|
40
|
+
return n(q)(e.item) && B(e.item) ? (l(), d(n(p), c({ key: 0 }, n(h), v(n(k))), {
|
|
41
|
+
items: i(() => [
|
|
42
|
+
(l(!0), f(I, null, $(n(x)(e.layout, e.item.children), (u) => (l(), d(T, {
|
|
43
|
+
key: u.id,
|
|
44
44
|
isDraggable: e.isDraggable,
|
|
45
45
|
isDroppable: e.isDroppable,
|
|
46
46
|
isExpanded: e.isExpanded,
|
|
47
47
|
isSelected: e.isSelected,
|
|
48
|
-
item:
|
|
48
|
+
item: u,
|
|
49
49
|
layout: e.layout,
|
|
50
50
|
options: e.options,
|
|
51
51
|
onOnDragEnd: S,
|
|
52
|
-
onSelectItem:
|
|
53
|
-
},
|
|
54
|
-
|
|
52
|
+
onSelectItem: m[0] || (m[0] = (o) => y("selectItem", o))
|
|
53
|
+
}, b({ _: 2 }, [
|
|
54
|
+
a.decorator ? {
|
|
55
55
|
name: "decorator",
|
|
56
|
-
fn:
|
|
57
|
-
|
|
56
|
+
fn: i((o) => [
|
|
57
|
+
r(t.$slots, "decorator", c({ ref_for: !0 }, o))
|
|
58
58
|
]),
|
|
59
59
|
key: "0"
|
|
60
60
|
} : void 0,
|
|
61
|
-
|
|
61
|
+
a.empty ? {
|
|
62
62
|
name: "empty",
|
|
63
|
-
fn:
|
|
64
|
-
|
|
63
|
+
fn: i((o) => [
|
|
64
|
+
r(t.$slots, "empty", c({ ref_for: !0 }, o))
|
|
65
65
|
]),
|
|
66
66
|
key: "1"
|
|
67
|
+
} : void 0,
|
|
68
|
+
a.icon ? {
|
|
69
|
+
name: "icon",
|
|
70
|
+
fn: i((o) => [
|
|
71
|
+
r(t.$slots, "icon", c({ ref_for: !0 }, o))
|
|
72
|
+
]),
|
|
73
|
+
key: "2"
|
|
67
74
|
} : void 0
|
|
68
75
|
]), 1032, ["isDraggable", "isDroppable", "isExpanded", "isSelected", "item", "layout", "options"]))), 128))
|
|
69
76
|
]),
|
|
70
|
-
default:
|
|
71
|
-
|
|
77
|
+
default: i(() => [
|
|
78
|
+
L(O(e.item.title) + " ", 1)
|
|
72
79
|
]),
|
|
73
80
|
_: 3
|
|
74
|
-
}, 16)) :
|
|
81
|
+
}, 16)) : n(J)(e.layout, e.item, a.empty !== void 0) ? (l(), d(n(z), c({
|
|
75
82
|
key: 1,
|
|
76
83
|
active: e.isSelected(e.item.id),
|
|
77
84
|
class: "relative",
|
|
78
85
|
controlled: "",
|
|
79
86
|
open: e.isExpanded(e.item.id)
|
|
80
|
-
},
|
|
81
|
-
onClick:
|
|
82
|
-
}),
|
|
83
|
-
items:
|
|
84
|
-
(
|
|
85
|
-
key:
|
|
87
|
+
}, n(h), v(n(k)), {
|
|
88
|
+
onClick: m[2] || (m[2] = () => y("selectItem", e.item.id))
|
|
89
|
+
}), b({
|
|
90
|
+
items: i(() => [
|
|
91
|
+
(l(!0), f(I, null, $(n(x)(e.layout, e.item.children ?? []), (u) => (l(), d(T, {
|
|
92
|
+
key: u.id,
|
|
86
93
|
isDraggable: e.isDraggable,
|
|
87
94
|
isDroppable: e.isDroppable,
|
|
88
95
|
isExpanded: e.isExpanded,
|
|
89
96
|
isSelected: e.isSelected,
|
|
90
|
-
item:
|
|
97
|
+
item: u,
|
|
91
98
|
layout: e.layout,
|
|
92
99
|
options: e.options,
|
|
93
100
|
parentIds: [],
|
|
94
101
|
onOnDragEnd: S,
|
|
95
|
-
onSelectItem:
|
|
96
|
-
},
|
|
97
|
-
|
|
102
|
+
onSelectItem: m[1] || (m[1] = (o) => y("selectItem", o))
|
|
103
|
+
}, b({ _: 2 }, [
|
|
104
|
+
a.decorator ? {
|
|
98
105
|
name: "decorator",
|
|
99
|
-
fn:
|
|
100
|
-
|
|
106
|
+
fn: i((o) => [
|
|
107
|
+
r(t.$slots, "decorator", c({ ref_for: !0 }, o))
|
|
101
108
|
]),
|
|
102
109
|
key: "0"
|
|
103
110
|
} : void 0,
|
|
104
|
-
|
|
111
|
+
a.empty ? {
|
|
105
112
|
name: "empty",
|
|
106
|
-
fn:
|
|
107
|
-
|
|
113
|
+
fn: i((o) => [
|
|
114
|
+
r(t.$slots, "empty", c({ ref_for: !0 }, o))
|
|
108
115
|
]),
|
|
109
116
|
key: "1"
|
|
117
|
+
} : void 0,
|
|
118
|
+
a.icon ? {
|
|
119
|
+
name: "icon",
|
|
120
|
+
fn: i((o) => [
|
|
121
|
+
r(t.$slots, "icon", c({ ref_for: !0 }, o))
|
|
122
|
+
]),
|
|
123
|
+
key: "2"
|
|
110
124
|
} : void 0
|
|
111
125
|
]), 1032, ["isDraggable", "isDroppable", "isExpanded", "isSelected", "item", "layout", "options"]))), 128)),
|
|
112
|
-
|
|
126
|
+
a.empty && (e.item.children?.length ?? 0) === 0 ? r(t.$slots, "empty", {
|
|
113
127
|
key: 0,
|
|
114
128
|
item: e.item
|
|
115
|
-
}) :
|
|
129
|
+
}) : D("", !0)
|
|
116
130
|
]),
|
|
117
|
-
default:
|
|
118
|
-
E(e.item) ? (
|
|
119
|
-
s(
|
|
131
|
+
default: i(() => [
|
|
132
|
+
E(e.item) ? (l(), f("span", M, [
|
|
133
|
+
s(g, {
|
|
120
134
|
item: e.item,
|
|
121
135
|
operationTitleSource: e.options?.operationTitleSource
|
|
122
136
|
}, null, 8, ["item", "operationTitleSource"])
|
|
123
|
-
])) : (
|
|
137
|
+
])) : (l(), d(g, {
|
|
124
138
|
key: 1,
|
|
125
139
|
item: e.item,
|
|
126
140
|
operationTitleSource: e.options?.operationTitleSource
|
|
@@ -130,62 +144,67 @@ const M = {
|
|
|
130
144
|
}, [
|
|
131
145
|
e.item.type === "document" ? {
|
|
132
146
|
name: "icon",
|
|
133
|
-
fn:
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
},
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
147
|
+
fn: i(({ open: u }) => [
|
|
148
|
+
r(t.$slots, "icon", {
|
|
149
|
+
item: e.item,
|
|
150
|
+
open: u
|
|
151
|
+
}, () => [
|
|
152
|
+
s(n(j), {
|
|
153
|
+
class: "text-c-3 block group-hover/group-button:hidden",
|
|
154
|
+
src: "icon" in e.item && e.item.icon || "interface-content-folder"
|
|
155
|
+
}, null, 8, ["src"]),
|
|
156
|
+
s(n(A), {
|
|
157
|
+
class: "text-c-3 hidden group-hover/group-button:flex",
|
|
158
|
+
open: u
|
|
159
|
+
}, null, 8, ["open"])
|
|
160
|
+
])
|
|
142
161
|
]),
|
|
143
162
|
key: "0"
|
|
144
163
|
} : void 0,
|
|
145
164
|
"method" in e.item ? {
|
|
146
165
|
name: "aside",
|
|
147
|
-
fn:
|
|
148
|
-
"method" in e.item ? (
|
|
166
|
+
fn: i(() => [
|
|
167
|
+
"method" in e.item ? (l(), d(F, {
|
|
149
168
|
key: 0,
|
|
150
169
|
active: e.isSelected(e.item.id),
|
|
151
170
|
class: w(["ml-2 h-4 self-start", {
|
|
152
171
|
// Hide the badge when we're showing the decorator
|
|
153
|
-
"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":
|
|
172
|
+
"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": a.decorator
|
|
154
173
|
}]),
|
|
155
174
|
method: e.item.method,
|
|
156
175
|
webhook: e.item.type === "webhook"
|
|
157
|
-
}, null, 8, ["active", "class", "method", "webhook"])) :
|
|
176
|
+
}, null, 8, ["active", "class", "method", "webhook"])) : D("", !0)
|
|
158
177
|
]),
|
|
159
178
|
key: "1"
|
|
160
179
|
} : void 0,
|
|
161
|
-
|
|
180
|
+
a.decorator ? {
|
|
162
181
|
name: "after",
|
|
163
|
-
fn:
|
|
182
|
+
fn: i(() => [
|
|
164
183
|
s(C, null, {
|
|
165
|
-
default:
|
|
166
|
-
|
|
184
|
+
default: i(() => [
|
|
185
|
+
r(t.$slots, "decorator", { item: e.item })
|
|
167
186
|
]),
|
|
168
187
|
_: 3
|
|
169
188
|
})
|
|
170
189
|
]),
|
|
171
190
|
key: "2"
|
|
172
191
|
} : void 0
|
|
173
|
-
]), 1040, ["active", "open"])) : (
|
|
192
|
+
]), 1040, ["active", "open"])) : (l(), d(n(P), c({
|
|
174
193
|
key: 2,
|
|
175
194
|
is: "button"
|
|
176
|
-
},
|
|
195
|
+
}, n(h), {
|
|
177
196
|
class: "relative",
|
|
178
197
|
selected: e.isSelected(e.item.id)
|
|
179
|
-
},
|
|
180
|
-
onClick:
|
|
181
|
-
}),
|
|
182
|
-
default:
|
|
183
|
-
E(e.item) ? (
|
|
184
|
-
s(
|
|
198
|
+
}, v(n(k)), {
|
|
199
|
+
onClick: m[3] || (m[3] = () => y("selectItem", e.item.id))
|
|
200
|
+
}), b({
|
|
201
|
+
default: i(() => [
|
|
202
|
+
E(e.item) ? (l(), f("span", Q, [
|
|
203
|
+
s(g, {
|
|
185
204
|
item: e.item,
|
|
186
205
|
operationTitleSource: e.options?.operationTitleSource
|
|
187
206
|
}, null, 8, ["item", "operationTitleSource"])
|
|
188
|
-
])) : (
|
|
207
|
+
])) : (l(), d(g, {
|
|
189
208
|
key: 1,
|
|
190
209
|
item: e.item,
|
|
191
210
|
operationTitleSource: e.options?.operationTitleSource
|
|
@@ -193,33 +212,43 @@ const M = {
|
|
|
193
212
|
]),
|
|
194
213
|
_: 2
|
|
195
214
|
}, [
|
|
215
|
+
a.icon ? {
|
|
216
|
+
name: "icon",
|
|
217
|
+
fn: i(() => [
|
|
218
|
+
r(t.$slots, "icon", {
|
|
219
|
+
item: e.item,
|
|
220
|
+
open: !0
|
|
221
|
+
})
|
|
222
|
+
]),
|
|
223
|
+
key: "0"
|
|
224
|
+
} : void 0,
|
|
196
225
|
"method" in e.item ? {
|
|
197
226
|
name: "aside",
|
|
198
|
-
fn:
|
|
199
|
-
"method" in e.item ? (
|
|
227
|
+
fn: i(() => [
|
|
228
|
+
"method" in e.item ? (l(), d(F, {
|
|
200
229
|
key: 0,
|
|
201
230
|
active: e.isSelected(e.item.id),
|
|
202
231
|
class: w(["ml-2 h-4 self-start", {
|
|
203
232
|
// Hide the badge when we're showing the decorator
|
|
204
|
-
"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":
|
|
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": a.decorator
|
|
205
234
|
}]),
|
|
206
235
|
method: e.item.method,
|
|
207
236
|
webhook: e.item.type === "webhook"
|
|
208
|
-
}, null, 8, ["active", "class", "method", "webhook"])) :
|
|
237
|
+
}, null, 8, ["active", "class", "method", "webhook"])) : D("", !0)
|
|
209
238
|
]),
|
|
210
|
-
key: "
|
|
239
|
+
key: "1"
|
|
211
240
|
} : void 0,
|
|
212
|
-
|
|
241
|
+
a.decorator ? {
|
|
213
242
|
name: "after",
|
|
214
|
-
fn:
|
|
243
|
+
fn: i(() => [
|
|
215
244
|
s(C, null, {
|
|
216
|
-
default:
|
|
217
|
-
|
|
245
|
+
default: i(() => [
|
|
246
|
+
r(t.$slots, "decorator", { item: e.item })
|
|
218
247
|
]),
|
|
219
248
|
_: 3
|
|
220
249
|
})
|
|
221
250
|
]),
|
|
222
|
-
key: "
|
|
251
|
+
key: "2"
|
|
223
252
|
} : void 0
|
|
224
253
|
]), 1040, ["selected"]));
|
|
225
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.18",
|
|
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/components": "0.16.
|
|
34
|
+
"@scalar/components": "0.16.28",
|
|
35
35
|
"@scalar/helpers": "0.2.8",
|
|
36
36
|
"@scalar/themes": "0.13.26",
|
|
37
|
-
"@scalar/use-hooks": "0.3.6",
|
|
38
37
|
"@scalar/icons": "0.5.2",
|
|
39
|
-
"@scalar/
|
|
38
|
+
"@scalar/use-hooks": "0.3.6",
|
|
39
|
+
"@scalar/workspace-store": "0.26.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@tailwindcss/vite": "^4.1.18",
|