@scalar/components 0.14.33 → 0.14.35
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/ScalarButton/ScalarButton.vue.js +37 -40
- package/dist/components/ScalarCodeBlock/ScalarCodeBlock.vue3.js +1 -1
- package/dist/components/ScalarCodeBlock/ScalarCodeBlockCopy.vue.js +1 -1
- package/dist/components/ScalarColorModeToggle/ScalarColorModeToggleIcon.vue.js +1 -1
- package/dist/components/ScalarCombobox/ScalarComboboxMultiselect.vue.js +46 -49
- package/dist/components/ScalarCombobox/ScalarComboboxOptions.vue.js +144 -160
- package/dist/components/ScalarCombobox/ScalarComboboxPopover.vue.js +26 -27
- package/dist/components/ScalarCombobox/types.js +6 -6
- package/dist/components/ScalarDropdown/ScalarDropdownButton.vue.js +1 -1
- package/dist/components/ScalarDropdown/ScalarDropdownItem.vue.js +1 -1
- package/dist/components/ScalarErrorBoundary/ScalarErrorBoundary.vue.js +11 -14
- package/dist/components/ScalarFileUpload/ScalarFileUpload.vue.js +86 -91
- package/dist/components/ScalarFloating/ScalarFloating.vue.d.ts.map +1 -1
- package/dist/components/ScalarFloating/ScalarFloating.vue.js +22 -23
- package/dist/components/ScalarFloating/useResizeWithTarget.js +12 -13
- package/dist/components/ScalarIcon/ScalarIcon.vue.js +1 -1
- package/dist/components/ScalarLoading/ScalarLoading.vue.js +1 -1
- package/dist/components/ScalarMarkdown/ScalarMarkdown.vue.js +20 -21
- package/dist/components/ScalarMarkdown/ScalarMarkdown.vue3.js +1 -1
- package/dist/components/ScalarMarkdown/ScalarMarkdownSummary.vue.js +22 -26
- package/dist/components/ScalarMarkdown/ScalarMarkdownSummary.vue3.js +1 -1
- package/dist/components/ScalarMenu/ScalarMenuLink.vue.d.ts.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuLink.vue.js +6 -3
- package/dist/components/ScalarMenu/ScalarMenuProducts.vue.js +45 -48
- package/dist/components/ScalarMenu/ScalarMenuTeamPicker.vue.js +20 -23
- package/dist/components/ScalarModal/ScalarModal.vue.js +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarIndent.vue.js +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarItems.vue3.js +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarSearchInput.vue.js +16 -19
- package/dist/components/ScalarTextArea/ScalarTextArea.vue.d.ts.map +1 -1
- package/dist/components/ScalarTextArea/ScalarTextArea.vue.js +19 -22
- package/dist/components/ScalarTextInput/ScalarTextInput.vue.js +25 -29
- package/dist/components/ScalarTooltip/ScalarHotkeyTooltip.vue.js +12 -15
- package/dist/components/ScalarTooltip/ScalarTooltip.vue.js +20 -23
- package/dist/components/ScalarTooltip/ScalarTooltip.vue3.js +1 -1
- package/dist/components/ScalarTooltip/useTooltip.js +24 -31
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -6
- package/dist/style.css +1 -1
- package/package.json +15 -14
- package/dist/components/ScalarCodeBlock/ScalarCodeBlock.vue2.js +0 -4
- package/dist/components/ScalarCodeBlock/ScalarCodeBlockCopy.vue3.js +0 -4
- package/dist/components/ScalarColorModeToggle/ScalarColorModeToggleIcon.vue3.js +0 -4
- package/dist/components/ScalarDropdown/ScalarDropdownButton.vue3.js +0 -4
- package/dist/components/ScalarDropdown/ScalarDropdownItem.vue3.js +0 -4
- package/dist/components/ScalarIcon/ScalarIcon.vue3.js +0 -4
- package/dist/components/ScalarLoading/ScalarLoading.vue3.js +0 -4
- package/dist/components/ScalarMarkdown/ScalarMarkdown.vue2.js +0 -4
- package/dist/components/ScalarMarkdown/ScalarMarkdownSummary.vue2.js +0 -4
- package/dist/components/ScalarModal/ScalarModal.vue3.js +0 -4
- package/dist/components/ScalarSidebar/ScalarSidebarIndent.vue3.js +0 -4
- package/dist/components/ScalarSidebar/ScalarSidebarItems.vue2.js +0 -4
- package/dist/components/ScalarTooltip/ScalarTooltip.vue2.js +0 -4
- package/dist/style.css.js +0 -4
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Popover as
|
|
3
|
-
import { useBindCx as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
const z = /* @__PURE__ */
|
|
1
|
+
import { defineComponent as d, ref as u, createBlock as c, openBlock as _, unref as o, withCtx as t, createVNode as r, normalizeProps as v, guardReactiveProps as y, createSlots as w, renderSlot as p, mergeProps as x } from "vue";
|
|
2
|
+
import { Popover as B, PopoverButton as P, PopoverPanel as h } from "@headlessui/vue";
|
|
3
|
+
import { useBindCx as k } from "@scalar/use-hooks/useBindCx";
|
|
4
|
+
import g from "../ScalarFloating/ScalarFloating.vue.js";
|
|
5
|
+
import b from "../ScalarFloating/ScalarFloatingBackdrop.vue.js";
|
|
6
|
+
const z = /* @__PURE__ */ d({
|
|
7
7
|
inheritAttrs: !1,
|
|
8
8
|
__name: "ScalarComboboxPopover",
|
|
9
9
|
props: {
|
|
@@ -14,44 +14,43 @@ const z = /* @__PURE__ */ u({
|
|
|
14
14
|
middleware: {},
|
|
15
15
|
teleport: { type: [Boolean, String] }
|
|
16
16
|
},
|
|
17
|
-
setup(
|
|
18
|
-
const { cx:
|
|
19
|
-
|
|
20
|
-
["ArrowUp", "ArrowDown"].includes(e.key) && (e.preventDefault(), (n = e.target) == null || n.dispatchEvent(new KeyboardEvent("keydown", { key: "Enter" })));
|
|
17
|
+
setup($, { expose: l }) {
|
|
18
|
+
const { cx: s } = k(), a = u(null), f = (e) => {
|
|
19
|
+
["ArrowUp", "ArrowDown"].includes(e.key) && (e.preventDefault(), e.target?.dispatchEvent(new KeyboardEvent("keydown", { key: "Enter" })));
|
|
21
20
|
};
|
|
22
|
-
return
|
|
23
|
-
default: t(({ open:
|
|
24
|
-
r(o(
|
|
21
|
+
return l({ popoverButtonRef: a }), (e, C) => (_(), c(o(B), { as: "template" }, {
|
|
22
|
+
default: t(({ open: n }) => [
|
|
23
|
+
r(o(g), v(y(e.$props)), w({
|
|
25
24
|
default: t(() => [
|
|
26
|
-
r(o(
|
|
25
|
+
r(o(P), {
|
|
27
26
|
ref_key: "popoverButtonRef",
|
|
28
|
-
ref:
|
|
27
|
+
ref: a,
|
|
29
28
|
as: "template",
|
|
30
|
-
onKeydown:
|
|
29
|
+
onKeydown: f
|
|
31
30
|
}, {
|
|
32
31
|
default: t(() => [
|
|
33
|
-
|
|
32
|
+
p(e.$slots, "default", { open: n })
|
|
34
33
|
]),
|
|
35
34
|
_: 2
|
|
36
35
|
}, 1536)
|
|
37
36
|
]),
|
|
38
37
|
_: 2
|
|
39
38
|
}, [
|
|
40
|
-
|
|
39
|
+
n ? {
|
|
41
40
|
name: "floating",
|
|
42
|
-
fn: t(({ width:
|
|
43
|
-
r(o(
|
|
41
|
+
fn: t(({ width: i }) => [
|
|
42
|
+
r(o(h), x(
|
|
44
43
|
{
|
|
45
|
-
style: { width:
|
|
44
|
+
style: { width: i }
|
|
46
45
|
},
|
|
47
|
-
o(
|
|
46
|
+
o(s)("relative flex flex-col max-h-[inherit] w-40 rounded text-sm")
|
|
48
47
|
), {
|
|
49
|
-
default: t(({ close:
|
|
50
|
-
|
|
51
|
-
close:
|
|
52
|
-
open:
|
|
48
|
+
default: t(({ close: m }) => [
|
|
49
|
+
p(e.$slots, "popover", {
|
|
50
|
+
close: m,
|
|
51
|
+
open: n
|
|
53
52
|
}),
|
|
54
|
-
r(o(
|
|
53
|
+
r(o(b))
|
|
55
54
|
]),
|
|
56
55
|
_: 2
|
|
57
56
|
}, 1040, ["style"])
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
function
|
|
2
|
-
return
|
|
1
|
+
function n(r) {
|
|
2
|
+
return r?.options !== void 0;
|
|
3
3
|
}
|
|
4
|
-
function
|
|
5
|
-
return r[0] ?
|
|
4
|
+
function u(r) {
|
|
5
|
+
return r[0] ? n(r[0]) : !1;
|
|
6
6
|
}
|
|
7
7
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
n as isGroup,
|
|
9
|
+
u as isGroups
|
|
10
10
|
};
|
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as u, ref as n, onErrorCaptured as c, renderSlot as m, createElementBlock as s, openBlock as a, createElementVNode as p, createCommentVNode as i, toDisplayString as l } from "vue";
|
|
2
|
+
const _ = {
|
|
3
3
|
key: 1,
|
|
4
4
|
class: "rounded border bg-b-2 p-3 text-sm"
|
|
5
|
-
},
|
|
5
|
+
}, f = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "mt-2 rounded border bg-b-1 p-2 font-code text-c-2"
|
|
8
|
-
},
|
|
8
|
+
}, g = /* @__PURE__ */ u({
|
|
9
9
|
__name: "ScalarErrorBoundary",
|
|
10
|
-
setup(
|
|
11
|
-
const
|
|
12
|
-
return
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
e.value ? (d(), l("div", v, u((o = e.value) == null ? void 0 : o.name) + ": " + u((s = e.value) == null ? void 0 : s.message), 1)) : _("", !0)
|
|
17
|
-
])) : p(r.$slots, "default", { key: 0 });
|
|
18
|
-
};
|
|
10
|
+
setup(v) {
|
|
11
|
+
const t = n(!1), e = n();
|
|
12
|
+
return c((r, o, d) => (console.error("[ERROR]", r, d), t.value = !0, e.value = r, !1)), (r, o) => t.value ? (a(), s("div", _, [
|
|
13
|
+
o[0] || (o[0] = p("div", { class: "p-2" }, "Oops, something went wrong here.", -1)),
|
|
14
|
+
e.value ? (a(), s("div", f, l(e.value?.name) + ": " + l(e.value?.message), 1)) : i("", !0)
|
|
15
|
+
])) : m(r.$slots, "default", { key: 0 });
|
|
19
16
|
}
|
|
20
17
|
});
|
|
21
18
|
export {
|
|
22
|
-
|
|
19
|
+
g as default
|
|
23
20
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useBindCx as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { isExtensionList as
|
|
9
|
-
const
|
|
10
|
-
...
|
|
1
|
+
import { defineComponent as E, mergeModels as m, useModel as p, ref as c, createElementBlock as v, openBlock as r, mergeProps as F, unref as s, withModifiers as g, renderSlot as a, createCommentVNode as y, createBlock as $, createElementVNode as T, resolveDynamicComponent as w, createSlots as k, withCtx as n, createVNode as b, createTextVNode as A, toDisplayString as j } from "vue";
|
|
2
|
+
import { useBindCx as L } from "@scalar/use-hooks/useBindCx";
|
|
3
|
+
import P from "./ScalarFileUploadDropTarget.vue.js";
|
|
4
|
+
import U from "./ScalarFileUploadError.vue.js";
|
|
5
|
+
import _ from "./ScalarFileUploadInput.vue.js";
|
|
6
|
+
import q from "./ScalarFileUploadInputCompact.vue.js";
|
|
7
|
+
import z from "./ScalarFileUploadLoading.vue.js";
|
|
8
|
+
import { isExtensionList as h } from "./types.js";
|
|
9
|
+
const G = ["accept", "multiple"], H = {}, Y = /* @__PURE__ */ E({
|
|
10
|
+
...H,
|
|
11
11
|
inheritAttrs: !1,
|
|
12
12
|
__name: "ScalarFileUpload",
|
|
13
|
-
props: /* @__PURE__ */
|
|
13
|
+
props: /* @__PURE__ */ m({
|
|
14
14
|
multiple: { type: Boolean },
|
|
15
15
|
accept: { default: "*" },
|
|
16
16
|
loader: {},
|
|
@@ -21,12 +21,11 @@ const H = ["accept", "multiple"], I = {}, Z = /* @__PURE__ */ F({
|
|
|
21
21
|
error: {},
|
|
22
22
|
errorModifiers: {}
|
|
23
23
|
}),
|
|
24
|
-
emits: /* @__PURE__ */
|
|
25
|
-
setup(i, { emit:
|
|
26
|
-
const
|
|
24
|
+
emits: /* @__PURE__ */ m(["selected"], ["update:modelValue", "update:error"]),
|
|
25
|
+
setup(i, { emit: C }) {
|
|
26
|
+
const D = C, V = p(i, "modelValue"), l = p(i, "error"), d = c(), t = c(!1);
|
|
27
27
|
function u() {
|
|
28
|
-
|
|
29
|
-
(e = d.value) == null || e.click();
|
|
28
|
+
d.value?.click();
|
|
30
29
|
}
|
|
31
30
|
function f(e) {
|
|
32
31
|
if (l.value = void 0, !e || e.length < 1) {
|
|
@@ -38,92 +37,88 @@ const H = ["accept", "multiple"], I = {}, Z = /* @__PURE__ */ F({
|
|
|
38
37
|
l.value = "Too many files selected";
|
|
39
38
|
return;
|
|
40
39
|
}
|
|
41
|
-
|
|
40
|
+
V.value = o, D("selected", o);
|
|
42
41
|
}
|
|
43
|
-
function
|
|
42
|
+
function B(e) {
|
|
44
43
|
const o = e.target.files;
|
|
45
44
|
f(o);
|
|
46
45
|
}
|
|
47
|
-
function
|
|
48
|
-
|
|
49
|
-
t.value = !1, f((o = e.dataTransfer) == null ? void 0 : o.files);
|
|
46
|
+
function M(e) {
|
|
47
|
+
t.value = !1, f(e.dataTransfer?.files);
|
|
50
48
|
}
|
|
51
|
-
const { cx:
|
|
52
|
-
return (e, o) =>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
),
|
|
58
|
-
{
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
49
|
+
const { cx: N } = L();
|
|
50
|
+
return (e, o) => (r(), v("div", F(
|
|
51
|
+
s(N)(
|
|
52
|
+
"flex flex-col relative border-dashed border-1 has-[input:focus-visible]:outline outline-offset-1 rounded"
|
|
53
|
+
),
|
|
54
|
+
{
|
|
55
|
+
onDragenter: o[1] || (o[1] = (S) => t.value = !0),
|
|
56
|
+
onDragover: o[2] || (o[2] = g(() => {
|
|
57
|
+
}, ["prevent"])),
|
|
58
|
+
onDrop: g(M, ["prevent"])
|
|
59
|
+
}
|
|
60
|
+
), [
|
|
61
|
+
a(e.$slots, "default", { open: u }, () => [
|
|
62
|
+
(r(), $(w(
|
|
63
|
+
e.variant === "compact" ? q : _
|
|
64
|
+
), {
|
|
65
|
+
extensions: s(h)(e.accept) ? e.accept : void 0,
|
|
66
|
+
onClick: u
|
|
67
|
+
}, k({ _: 2 }, [
|
|
68
|
+
e.$slots.label ? {
|
|
69
|
+
name: "default",
|
|
70
|
+
fn: n(() => [
|
|
71
|
+
a(e.$slots, "label")
|
|
72
|
+
]),
|
|
73
|
+
key: "0"
|
|
74
|
+
} : void 0,
|
|
75
|
+
l.value ? {
|
|
76
|
+
name: "sublabel",
|
|
77
|
+
fn: n(() => [
|
|
78
|
+
b(U, null, {
|
|
79
|
+
default: n(() => [
|
|
80
|
+
A(j(l.value), 1)
|
|
81
|
+
]),
|
|
82
|
+
_: 1
|
|
83
|
+
})
|
|
84
|
+
]),
|
|
85
|
+
key: "1"
|
|
86
|
+
} : void 0
|
|
87
|
+
]), 1032, ["extensions"]))
|
|
88
|
+
]),
|
|
89
|
+
t.value ? (r(), v("div", {
|
|
90
|
+
key: 0,
|
|
91
|
+
class: "absolute inset-0",
|
|
92
|
+
onDragleave: o[0] || (o[0] = (S) => t.value = !1)
|
|
93
|
+
}, [
|
|
94
|
+
a(e.$slots, "drop-target", {}, () => [
|
|
95
|
+
b(P, null, k({ _: 2 }, [
|
|
96
|
+
e.$slots["drop-target-label"] ? {
|
|
73
97
|
name: "default",
|
|
74
98
|
fn: n(() => [
|
|
75
|
-
a(e.$slots, "label")
|
|
99
|
+
a(e.$slots, "drop-target-label")
|
|
76
100
|
]),
|
|
77
101
|
key: "0"
|
|
78
|
-
} : void 0,
|
|
79
|
-
l.value ? {
|
|
80
|
-
name: "sublabel",
|
|
81
|
-
fn: n(() => [
|
|
82
|
-
h(_, null, {
|
|
83
|
-
default: n(() => [
|
|
84
|
-
j(L(l.value), 1)
|
|
85
|
-
]),
|
|
86
|
-
_: 1
|
|
87
|
-
})
|
|
88
|
-
]),
|
|
89
|
-
key: "1"
|
|
90
102
|
} : void 0
|
|
91
|
-
]),
|
|
92
|
-
])
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
])
|
|
109
|
-
], 32)) : $("", !0),
|
|
110
|
-
(m = e.loader) != null && m.isLoading ? (r(), k(G, {
|
|
111
|
-
key: 1,
|
|
112
|
-
loader: e.loader
|
|
113
|
-
}, null, 8, ["loader"])) : $("", !0),
|
|
114
|
-
w("input", {
|
|
115
|
-
ref_key: "input",
|
|
116
|
-
ref: d,
|
|
117
|
-
accept: s(C)(e.accept) ? e.accept.join(",") : e.accept,
|
|
118
|
-
class: "sr-only",
|
|
119
|
-
multiple: e.multiple,
|
|
120
|
-
type: "file",
|
|
121
|
-
onChange: M
|
|
122
|
-
}, null, 40, H)
|
|
123
|
-
], 16);
|
|
124
|
-
};
|
|
103
|
+
]), 1024)
|
|
104
|
+
])
|
|
105
|
+
], 32)) : y("", !0),
|
|
106
|
+
e.loader?.isLoading ? (r(), $(z, {
|
|
107
|
+
key: 1,
|
|
108
|
+
loader: e.loader
|
|
109
|
+
}, null, 8, ["loader"])) : y("", !0),
|
|
110
|
+
T("input", {
|
|
111
|
+
ref_key: "input",
|
|
112
|
+
ref: d,
|
|
113
|
+
accept: s(h)(e.accept) ? e.accept.join(",") : e.accept,
|
|
114
|
+
class: "sr-only",
|
|
115
|
+
multiple: e.multiple,
|
|
116
|
+
type: "file",
|
|
117
|
+
onChange: B
|
|
118
|
+
}, null, 40, G)
|
|
119
|
+
], 16));
|
|
125
120
|
}
|
|
126
121
|
});
|
|
127
122
|
export {
|
|
128
|
-
|
|
123
|
+
Y as default
|
|
129
124
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarFloating.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarFloating/ScalarFloating.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarFloating.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarFloating/ScalarFloating.vue"],"names":[],"mappings":"AA+HA,OAAO,EACL,KAAK,cAAc,EAOpB,MAAM,kBAAkB,CAAA;AAIzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAa9C,KAAK,WAAW,GAAG;IACjB,kEAAkE;IAClE,OAAO,IAAI,OAAO,CAAA;IAClB,2BAA2B;IAC3B,QAAQ,CAAC,CAAC,KAAK,EAAE;QACf,4FAA4F;QAC5F,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,6FAA6F;QAC7F,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,gDAAgD;QAChD,IAAI,CAAC,EAAE,cAAc,CAAA;KACtB,GAAG,OAAO,CAAA;CACZ,CAAC;AAuIF,QAAA,MAAM,eAAe,0SAMnB,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,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as w, ref as d, computed as a, createElementBlock as
|
|
1
|
+
import { defineComponent as w, ref as d, computed as a, createElementBlock as b, openBlock as s, Fragment as z, createElementVNode as m, createBlock as S, createCommentVNode as $, normalizeClass as k, renderSlot as u, unref as n, withCtx as B, normalizeStyle as R } from "vue";
|
|
2
2
|
import { getSideAxis as c } from "@floating-ui/utils";
|
|
3
3
|
import { useFloating as x, autoUpdate as E, offset as F, flip as C, shift as M, size as H } from "@floating-ui/vue";
|
|
4
4
|
import { useResizeWithTarget as N } from "./useResizeWithTarget.js";
|
|
@@ -7,7 +7,7 @@ const D = /* @__PURE__ */ w({
|
|
|
7
7
|
inheritAttrs: !1,
|
|
8
8
|
__name: "ScalarFloating",
|
|
9
9
|
props: {
|
|
10
|
-
placement: {
|
|
10
|
+
placement: {},
|
|
11
11
|
offset: { type: [Number, Object, Function], default: 5 },
|
|
12
12
|
resize: { type: Boolean, default: !1 },
|
|
13
13
|
target: {},
|
|
@@ -15,51 +15,50 @@ const D = /* @__PURE__ */ w({
|
|
|
15
15
|
teleport: { type: [Boolean, String] }
|
|
16
16
|
},
|
|
17
17
|
setup(t) {
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
if (typeof window < "u" && n.value) {
|
|
18
|
+
const o = d(null), l = d(null), i = a(() => {
|
|
19
|
+
if (typeof window < "u" && l.value) {
|
|
21
20
|
if (typeof t.target == "string") {
|
|
22
|
-
const
|
|
23
|
-
if (
|
|
24
|
-
return
|
|
21
|
+
const e = document.getElementById(t.target);
|
|
22
|
+
if (e)
|
|
23
|
+
return e;
|
|
25
24
|
console.warn(`ScalarFloating: Target with id="${t.target}" not found`);
|
|
26
25
|
} else if (t.target instanceof HTMLElement)
|
|
27
26
|
return t.target;
|
|
28
|
-
return
|
|
27
|
+
return l.value.children?.[0] || l.value;
|
|
29
28
|
}
|
|
30
|
-
}),
|
|
29
|
+
}), r = N(i, {
|
|
31
30
|
enabled: a(() => t.resize)
|
|
32
31
|
}), g = a(
|
|
33
|
-
() => c(t.placement) === "y" ?
|
|
32
|
+
() => c(t.placement ?? "bottom") === "y" ? r.width.value : void 0
|
|
34
33
|
), h = a(
|
|
35
|
-
() => c(t.placement) === "x" ?
|
|
36
|
-
), { floatingStyles: p, middlewareData: y } = x(
|
|
37
|
-
placement: a(() => t.placement),
|
|
34
|
+
() => c(t.placement ?? "bottom") === "x" ? r.height.value : void 0
|
|
35
|
+
), { floatingStyles: p, middlewareData: y } = x(i, o, {
|
|
36
|
+
placement: a(() => t.placement ?? "bottom"),
|
|
38
37
|
whileElementsMounted: E,
|
|
39
38
|
middleware: a(() => [
|
|
40
39
|
F(t.offset),
|
|
41
40
|
C(),
|
|
42
41
|
M({ padding: 10 }),
|
|
43
42
|
H({
|
|
44
|
-
apply({ availableWidth: e, availableHeight:
|
|
43
|
+
apply({ availableWidth: e, availableHeight: f, elements: v }) {
|
|
45
44
|
Object.assign(v.floating.style, {
|
|
46
45
|
maxWidth: `${Math.max(0, e) - 20}px`,
|
|
47
|
-
maxHeight: `${Math.max(0,
|
|
46
|
+
maxHeight: `${Math.max(0, f) - 20}px`
|
|
48
47
|
});
|
|
49
48
|
}
|
|
50
49
|
}),
|
|
51
50
|
...t.middleware
|
|
52
51
|
])
|
|
53
52
|
});
|
|
54
|
-
return (e,
|
|
53
|
+
return (e, f) => (s(), b(z, null, [
|
|
55
54
|
m("div", {
|
|
56
55
|
ref_key: "wrapperRef",
|
|
57
|
-
ref:
|
|
56
|
+
ref: l,
|
|
58
57
|
class: k({ contents: !!e.$slots.default })
|
|
59
58
|
}, [
|
|
60
59
|
u(e.$slots, "default")
|
|
61
60
|
], 2),
|
|
62
|
-
e.$slots.floating ? (s(),
|
|
61
|
+
e.$slots.floating ? (s(), S(n(T), {
|
|
63
62
|
key: 0,
|
|
64
63
|
disabled: !e.teleport,
|
|
65
64
|
to: typeof e.teleport == "string" ? e.teleport : void 0
|
|
@@ -67,19 +66,19 @@ const D = /* @__PURE__ */ w({
|
|
|
67
66
|
default: B(() => [
|
|
68
67
|
m("div", {
|
|
69
68
|
ref_key: "floatingRef",
|
|
70
|
-
ref:
|
|
69
|
+
ref: o,
|
|
71
70
|
class: "relative z-context",
|
|
72
|
-
style: R(
|
|
71
|
+
style: R(n(p))
|
|
73
72
|
}, [
|
|
74
73
|
u(e.$slots, "floating", {
|
|
75
|
-
data:
|
|
74
|
+
data: n(y),
|
|
76
75
|
height: h.value,
|
|
77
76
|
width: g.value
|
|
78
77
|
})
|
|
79
78
|
], 4)
|
|
80
79
|
]),
|
|
81
80
|
_: 3
|
|
82
|
-
}, 8, ["disabled", "to"])) :
|
|
81
|
+
}, 8, ["disabled", "to"])) : $("", !0)
|
|
83
82
|
], 64));
|
|
84
83
|
}
|
|
85
84
|
});
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
function
|
|
3
|
-
const
|
|
4
|
-
return typeof ResizeObserver < "u" && (
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
[
|
|
9
|
-
|
|
10
|
-
!i || !r.value || (e ? r.value.observe(i) : r.value.disconnect());
|
|
1
|
+
import { ref as r, watch as v, toValue as t, computed as d } from "vue";
|
|
2
|
+
function s(l, a = { enabled: r(!0) }) {
|
|
3
|
+
const o = r(0), u = r(0), i = r();
|
|
4
|
+
return typeof ResizeObserver < "u" && (i.value = new ResizeObserver(([e]) => {
|
|
5
|
+
e && (o.value = e.borderBoxSize[0]?.inlineSize ?? 0, u.value = e.borderBoxSize[0]?.blockSize ?? 0);
|
|
6
|
+
})), v(
|
|
7
|
+
[() => t(a.enabled), () => t(l)],
|
|
8
|
+
([e, n]) => {
|
|
9
|
+
!n || !i.value || (e ? i.value.observe(n) : i.value.disconnect());
|
|
11
10
|
},
|
|
12
11
|
{ immediate: !0 }
|
|
13
12
|
), {
|
|
14
|
-
width:
|
|
15
|
-
height:
|
|
13
|
+
width: d(() => t(a.enabled) ? `${o.value}px` : void 0),
|
|
14
|
+
height: d(() => t(a.enabled) ? `${u.value}px` : void 0)
|
|
16
15
|
};
|
|
17
16
|
}
|
|
18
17
|
export {
|
|
19
|
-
|
|
18
|
+
s as useResizeWithTarget
|
|
20
19
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import o from "./ScalarLoading.vue2.js";
|
|
2
2
|
import { useLoadingState as i } from "./ScalarLoading.vue2.js";
|
|
3
|
-
|
|
3
|
+
/* empty css */
|
|
4
4
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
5
|
const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-f525638b"]]);
|
|
6
6
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { htmlFromMarkdown as
|
|
3
|
-
import { useBindCx as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as s, useTemplateRef as f, computed as u, createElementBlock as h, openBlock as d, mergeProps as g, unref as w } from "vue";
|
|
2
|
+
import { htmlFromMarkdown as T } from "@scalar/code-highlight";
|
|
3
|
+
import { useBindCx as p } from "@scalar/use-hooks/useBindCx";
|
|
4
|
+
const v = ["innerHTML"], B = /* @__PURE__ */ s({
|
|
5
5
|
inheritAttrs: !1,
|
|
6
6
|
__name: "ScalarMarkdown",
|
|
7
7
|
props: {
|
|
@@ -13,30 +13,29 @@ const B = ["innerHTML"], C = /* @__PURE__ */ h({
|
|
|
13
13
|
clamp: {},
|
|
14
14
|
anchorPrefix: {}
|
|
15
15
|
},
|
|
16
|
-
setup(e, { expose:
|
|
17
|
-
const { cx:
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
var n, a, m;
|
|
16
|
+
setup(e, { expose: n }) {
|
|
17
|
+
const { cx: a } = p(), o = f("div");
|
|
18
|
+
n({ el: o });
|
|
19
|
+
const m = (r) => {
|
|
21
20
|
if (!e.withAnchors)
|
|
22
|
-
return
|
|
23
|
-
const
|
|
24
|
-
return
|
|
21
|
+
return e.transform?.(r) || r;
|
|
22
|
+
const t = (r.children?.[0]?.value || "").toLowerCase().replace(/\s+/g, "-"), l = e.anchorPrefix ? `${e.anchorPrefix}/description/${t}` : t;
|
|
23
|
+
return r.data = {
|
|
25
24
|
hProperties: {
|
|
26
|
-
id:
|
|
25
|
+
id: l
|
|
27
26
|
}
|
|
28
|
-
}, e.transform ? e.transform(
|
|
29
|
-
},
|
|
27
|
+
}, e.transform ? e.transform(r) : r;
|
|
28
|
+
}, i = u(() => T(e.value ?? "", {
|
|
30
29
|
removeTags: e.withImages ? [] : ["img", "picture"],
|
|
31
|
-
transform: e.withAnchors && e.transformType === "heading" ?
|
|
30
|
+
transform: e.withAnchors && e.transformType === "heading" ? m : e.transform,
|
|
32
31
|
transformType: e.transformType
|
|
33
32
|
}));
|
|
34
|
-
return (
|
|
35
|
-
style: { "--markdown-clamp":
|
|
36
|
-
innerHTML:
|
|
37
|
-
}), null, 16,
|
|
33
|
+
return (r, c) => (d(), h("div", g({ ref: "div" }, w(a)("markdown", { "line-clamp-(--markdown-clamp)": !!r.clamp }), {
|
|
34
|
+
style: { "--markdown-clamp": r.clamp },
|
|
35
|
+
innerHTML: i.value
|
|
36
|
+
}), null, 16, v));
|
|
38
37
|
}
|
|
39
38
|
});
|
|
40
39
|
export {
|
|
41
|
-
|
|
40
|
+
B as default
|
|
42
41
|
};
|