@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.
Files changed (54) hide show
  1. package/dist/components/ScalarButton/ScalarButton.vue.js +37 -40
  2. package/dist/components/ScalarCodeBlock/ScalarCodeBlock.vue3.js +1 -1
  3. package/dist/components/ScalarCodeBlock/ScalarCodeBlockCopy.vue.js +1 -1
  4. package/dist/components/ScalarColorModeToggle/ScalarColorModeToggleIcon.vue.js +1 -1
  5. package/dist/components/ScalarCombobox/ScalarComboboxMultiselect.vue.js +46 -49
  6. package/dist/components/ScalarCombobox/ScalarComboboxOptions.vue.js +144 -160
  7. package/dist/components/ScalarCombobox/ScalarComboboxPopover.vue.js +26 -27
  8. package/dist/components/ScalarCombobox/types.js +6 -6
  9. package/dist/components/ScalarDropdown/ScalarDropdownButton.vue.js +1 -1
  10. package/dist/components/ScalarDropdown/ScalarDropdownItem.vue.js +1 -1
  11. package/dist/components/ScalarErrorBoundary/ScalarErrorBoundary.vue.js +11 -14
  12. package/dist/components/ScalarFileUpload/ScalarFileUpload.vue.js +86 -91
  13. package/dist/components/ScalarFloating/ScalarFloating.vue.d.ts.map +1 -1
  14. package/dist/components/ScalarFloating/ScalarFloating.vue.js +22 -23
  15. package/dist/components/ScalarFloating/useResizeWithTarget.js +12 -13
  16. package/dist/components/ScalarIcon/ScalarIcon.vue.js +1 -1
  17. package/dist/components/ScalarLoading/ScalarLoading.vue.js +1 -1
  18. package/dist/components/ScalarMarkdown/ScalarMarkdown.vue.js +20 -21
  19. package/dist/components/ScalarMarkdown/ScalarMarkdown.vue3.js +1 -1
  20. package/dist/components/ScalarMarkdown/ScalarMarkdownSummary.vue.js +22 -26
  21. package/dist/components/ScalarMarkdown/ScalarMarkdownSummary.vue3.js +1 -1
  22. package/dist/components/ScalarMenu/ScalarMenuLink.vue.d.ts.map +1 -1
  23. package/dist/components/ScalarMenu/ScalarMenuLink.vue.js +6 -3
  24. package/dist/components/ScalarMenu/ScalarMenuProducts.vue.js +45 -48
  25. package/dist/components/ScalarMenu/ScalarMenuTeamPicker.vue.js +20 -23
  26. package/dist/components/ScalarModal/ScalarModal.vue.js +1 -1
  27. package/dist/components/ScalarSidebar/ScalarSidebarIndent.vue.js +1 -1
  28. package/dist/components/ScalarSidebar/ScalarSidebarItems.vue3.js +1 -1
  29. package/dist/components/ScalarSidebar/ScalarSidebarSearchInput.vue.js +16 -19
  30. package/dist/components/ScalarTextArea/ScalarTextArea.vue.d.ts.map +1 -1
  31. package/dist/components/ScalarTextArea/ScalarTextArea.vue.js +19 -22
  32. package/dist/components/ScalarTextInput/ScalarTextInput.vue.js +25 -29
  33. package/dist/components/ScalarTooltip/ScalarHotkeyTooltip.vue.js +12 -15
  34. package/dist/components/ScalarTooltip/ScalarTooltip.vue.js +20 -23
  35. package/dist/components/ScalarTooltip/ScalarTooltip.vue3.js +1 -1
  36. package/dist/components/ScalarTooltip/useTooltip.js +24 -31
  37. package/dist/index.d.ts +1 -1
  38. package/dist/index.js +6 -6
  39. package/dist/style.css +1 -1
  40. package/package.json +15 -14
  41. package/dist/components/ScalarCodeBlock/ScalarCodeBlock.vue2.js +0 -4
  42. package/dist/components/ScalarCodeBlock/ScalarCodeBlockCopy.vue3.js +0 -4
  43. package/dist/components/ScalarColorModeToggle/ScalarColorModeToggleIcon.vue3.js +0 -4
  44. package/dist/components/ScalarDropdown/ScalarDropdownButton.vue3.js +0 -4
  45. package/dist/components/ScalarDropdown/ScalarDropdownItem.vue3.js +0 -4
  46. package/dist/components/ScalarIcon/ScalarIcon.vue3.js +0 -4
  47. package/dist/components/ScalarLoading/ScalarLoading.vue3.js +0 -4
  48. package/dist/components/ScalarMarkdown/ScalarMarkdown.vue2.js +0 -4
  49. package/dist/components/ScalarMarkdown/ScalarMarkdownSummary.vue2.js +0 -4
  50. package/dist/components/ScalarModal/ScalarModal.vue3.js +0 -4
  51. package/dist/components/ScalarSidebar/ScalarSidebarIndent.vue3.js +0 -4
  52. package/dist/components/ScalarSidebar/ScalarSidebarItems.vue2.js +0 -4
  53. package/dist/components/ScalarTooltip/ScalarTooltip.vue2.js +0 -4
  54. package/dist/style.css.js +0 -4
@@ -1,9 +1,9 @@
1
- import { defineComponent as u, ref as c, createBlock as _, openBlock as v, unref as o, withCtx as t, createVNode as r, normalizeProps as y, guardReactiveProps as w, createSlots as x, renderSlot as l, mergeProps as B } from "vue";
2
- import { Popover as P, PopoverButton as h, PopoverPanel as k } from "@headlessui/vue";
3
- import { useBindCx as g } from "@scalar/use-hooks/useBindCx";
4
- import b from "../ScalarFloating/ScalarFloating.vue.js";
5
- import $ from "../ScalarFloating/ScalarFloatingBackdrop.vue.js";
6
- const z = /* @__PURE__ */ u({
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(C, { expose: s }) {
18
- const { cx: f } = g(), p = c(null), i = (e) => {
19
- var n;
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 s({ popoverButtonRef: p }), (e, n) => (v(), _(o(P), { as: "template" }, {
23
- default: t(({ open: a }) => [
24
- r(o(b), y(w(e.$props)), x({
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(h), {
25
+ r(o(P), {
27
26
  ref_key: "popoverButtonRef",
28
- ref: p,
27
+ ref: a,
29
28
  as: "template",
30
- onKeydown: i
29
+ onKeydown: f
31
30
  }, {
32
31
  default: t(() => [
33
- l(e.$slots, "default", { open: a })
32
+ p(e.$slots, "default", { open: n })
34
33
  ]),
35
34
  _: 2
36
35
  }, 1536)
37
36
  ]),
38
37
  _: 2
39
38
  }, [
40
- a ? {
39
+ n ? {
41
40
  name: "floating",
42
- fn: t(({ width: m }) => [
43
- r(o(k), B(
41
+ fn: t(({ width: i }) => [
42
+ r(o(h), x(
44
43
  {
45
- style: { width: m }
44
+ style: { width: i }
46
45
  },
47
- o(f)("relative flex flex-col max-h-[inherit] w-40 rounded text-sm")
46
+ o(s)("relative flex flex-col max-h-[inherit] w-40 rounded text-sm")
48
47
  ), {
49
- default: t(({ close: d }) => [
50
- l(e.$slots, "popover", {
51
- close: d,
52
- open: a
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 u(r) {
2
- return (r == null ? void 0 : r.options) !== void 0;
1
+ function n(r) {
2
+ return r?.options !== void 0;
3
3
  }
4
- function e(r) {
5
- return r[0] ? u(r[0]) : !1;
4
+ function u(r) {
5
+ return r[0] ? n(r[0]) : !1;
6
6
  }
7
7
  export {
8
- u as isGroup,
9
- e as isGroups
8
+ n as isGroup,
9
+ u as isGroups
10
10
  };
@@ -1,5 +1,5 @@
1
1
  import o from "./ScalarDropdownButton.vue2.js";
2
- import "./ScalarDropdownButton.vue3.js";
2
+ /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
4
  const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-7e7bf818"]]);
5
5
  export {
@@ -1,5 +1,5 @@
1
1
  import o from "./ScalarDropdownItem.vue2.js";
2
- import "./ScalarDropdownItem.vue3.js";
2
+ /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.js";
4
4
  const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-788cdfbc"]]);
5
5
  export {
@@ -1,23 +1,20 @@
1
- import { defineComponent as c, ref as a, onErrorCaptured as m, renderSlot as p, createElementBlock as l, openBlock as d, createElementVNode as i, createCommentVNode as _, toDisplayString as u } from "vue";
2
- const f = {
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
- }, v = {
5
+ }, f = {
6
6
  key: 0,
7
7
  class: "mt-2 rounded border bg-b-1 p-2 font-code text-c-2"
8
- }, E = /* @__PURE__ */ c({
8
+ }, g = /* @__PURE__ */ u({
9
9
  __name: "ScalarErrorBoundary",
10
- setup(b) {
11
- const n = a(!1), e = a();
12
- return m((r, t, o) => (console.error("[ERROR]", r, o), n.value = !0, e.value = r, !1)), (r, t) => {
13
- var o, s;
14
- return n.value ? (d(), l("div", f, [
15
- t[0] || (t[0] = i("div", { class: "p-2" }, "Oops, something went wrong here.", -1)),
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
- E as default
19
+ g as default
23
20
  };
@@ -1,16 +1,16 @@
1
- import { defineComponent as F, mergeModels as p, useModel as c, ref as v, createElementBlock as g, openBlock as r, mergeProps as T, unref as s, withModifiers as y, renderSlot as a, createCommentVNode as $, createBlock as k, createElementVNode as w, resolveDynamicComponent as A, createSlots as b, withCtx as n, createVNode as h, createTextVNode as j, toDisplayString as L } from "vue";
2
- import { useBindCx as P } from "@scalar/use-hooks/useBindCx";
3
- import U from "./ScalarFileUploadDropTarget.vue.js";
4
- import _ from "./ScalarFileUploadError.vue.js";
5
- import q from "./ScalarFileUploadInput.vue.js";
6
- import z from "./ScalarFileUploadInputCompact.vue.js";
7
- import G from "./ScalarFileUploadLoading.vue.js";
8
- import { isExtensionList as C } from "./types.js";
9
- const H = ["accept", "multiple"], I = {}, Z = /* @__PURE__ */ F({
10
- ...I,
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__ */ p({
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__ */ p(["selected"], ["update:modelValue", "update:error"]),
25
- setup(i, { emit: D }) {
26
- const V = D, B = c(i, "modelValue"), l = c(i, "error"), d = v(), t = v(!1);
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
- var e;
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
- B.value = o, V("selected", o);
40
+ V.value = o, D("selected", o);
42
41
  }
43
- function M(e) {
42
+ function B(e) {
44
43
  const o = e.target.files;
45
44
  f(o);
46
45
  }
47
- function N(e) {
48
- var o;
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: S } = P();
52
- return (e, o) => {
53
- var m;
54
- return r(), g("div", T(
55
- s(S)(
56
- "flex flex-col relative border-dashed border-1 has-[input:focus-visible]:outline outline-offset-1 rounded"
57
- ),
58
- {
59
- onDragenter: o[1] || (o[1] = (E) => t.value = !0),
60
- onDragover: o[2] || (o[2] = y(() => {
61
- }, ["prevent"])),
62
- onDrop: y(N, ["prevent"])
63
- }
64
- ), [
65
- a(e.$slots, "default", { open: u }, () => [
66
- (r(), k(A(
67
- e.variant === "compact" ? z : q
68
- ), {
69
- extensions: s(C)(e.accept) ? e.accept : void 0,
70
- onClick: u
71
- }, b({ _: 2 }, [
72
- e.$slots.label ? {
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
- ]), 1032, ["extensions"]))
92
- ]),
93
- t.value ? (r(), g("div", {
94
- key: 0,
95
- class: "absolute inset-0",
96
- onDragleave: o[0] || (o[0] = (E) => t.value = !1)
97
- }, [
98
- a(e.$slots, "drop-target", {}, () => [
99
- h(U, null, b({ _: 2 }, [
100
- e.$slots["drop-target-label"] ? {
101
- name: "default",
102
- fn: n(() => [
103
- a(e.$slots, "drop-target-label")
104
- ]),
105
- key: "0"
106
- } : void 0
107
- ]), 1024)
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
- Z as default
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":"AA2HA,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;AAmIF,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
+ {"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 z, openBlock as s, Fragment as S, createElementVNode as m, createBlock as $, createCommentVNode as b, normalizeClass as k, renderSlot as u, unref as o, withCtx as B, normalizeStyle as R } from "vue";
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: { default: "bottom" },
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 i = d(null), n = d(null), r = a(() => {
19
- var e;
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 l = document.getElementById(t.target);
23
- if (l)
24
- return l;
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 ((e = n.value.children) == null ? void 0 : e[0]) || n.value;
27
+ return l.value.children?.[0] || l.value;
29
28
  }
30
- }), f = N(r, {
29
+ }), r = N(i, {
31
30
  enabled: a(() => t.resize)
32
31
  }), g = a(
33
- () => c(t.placement) === "y" ? f.width.value : void 0
32
+ () => c(t.placement ?? "bottom") === "y" ? r.width.value : void 0
34
33
  ), h = a(
35
- () => c(t.placement) === "x" ? f.height.value : void 0
36
- ), { floatingStyles: p, middlewareData: y } = x(r, i, {
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: l, elements: v }) {
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, l) - 20}px`
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, l) => (s(), z(S, null, [
53
+ return (e, f) => (s(), b(z, null, [
55
54
  m("div", {
56
55
  ref_key: "wrapperRef",
57
- ref: n,
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(), $(o(T), {
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: i,
69
+ ref: o,
71
70
  class: "relative z-context",
72
- style: R(o(p))
71
+ style: R(n(p))
73
72
  }, [
74
73
  u(e.$slots, "floating", {
75
- data: o(y),
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"])) : b("", !0)
81
+ }, 8, ["disabled", "to"])) : $("", !0)
83
82
  ], 64));
84
83
  }
85
84
  });
@@ -1,20 +1,19 @@
1
- import { ref as t, watch as b, toValue as a, computed as l } from "vue";
2
- function c(v, o = { enabled: t(!0) }) {
3
- const u = t(0), n = t(0), r = t();
4
- return typeof ResizeObserver < "u" && (r.value = new ResizeObserver(([e]) => {
5
- var i, d;
6
- e && (u.value = ((i = e.borderBoxSize[0]) == null ? void 0 : i.inlineSize) ?? 0, n.value = ((d = e.borderBoxSize[0]) == null ? void 0 : d.blockSize) ?? 0);
7
- })), b(
8
- [() => a(o.enabled), () => a(v)],
9
- ([e, i]) => {
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: l(() => a(o.enabled) ? `${u.value}px` : void 0),
15
- height: l(() => a(o.enabled) ? `${n.value}px` : void 0)
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
- c as useResizeWithTarget
18
+ s as useResizeWithTarget
20
19
  };
@@ -1,5 +1,5 @@
1
1
  import o from "./ScalarIcon.vue2.js";
2
- import "./ScalarIcon.vue3.js";
2
+ /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.js";
4
4
  const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-b651bb23"]]);
5
5
  export {
@@ -1,6 +1,6 @@
1
1
  import o from "./ScalarLoading.vue2.js";
2
2
  import { useLoadingState as i } from "./ScalarLoading.vue2.js";
3
- import "./ScalarLoading.vue3.js";
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 h, useTemplateRef as d, computed as g, createElementBlock as w, openBlock as T, mergeProps as v, unref as x } from "vue";
2
- import { htmlFromMarkdown as y } from "@scalar/code-highlight";
3
- import { useBindCx as k } from "@scalar/use-hooks/useBindCx";
4
- const B = ["innerHTML"], C = /* @__PURE__ */ h({
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: o }) {
17
- const { cx: i } = k(), c = d("div");
18
- o({ el: c });
19
- const l = (t) => {
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 ((n = e.transform) == null ? void 0 : n.call(e, t)) || t;
23
- const r = (((m = (a = t.children) == null ? void 0 : a[0]) == null ? void 0 : m.value) || "").toLowerCase().replace(/\s+/g, "-"), u = e.anchorPrefix ? `${e.anchorPrefix}/description/${r}` : r;
24
- return t.data = {
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: u
25
+ id: l
27
26
  }
28
- }, e.transform ? e.transform(t) : t;
29
- }, f = g(() => y(e.value ?? "", {
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" ? l : e.transform,
30
+ transform: e.withAnchors && e.transformType === "heading" ? m : e.transform,
32
31
  transformType: e.transformType
33
32
  }));
34
- return (t, s) => (T(), w("div", v({ ref: "div" }, x(i)("markdown", { "line-clamp-(--markdown-clamp)": !!t.clamp }), {
35
- style: { "--markdown-clamp": t.clamp },
36
- innerHTML: f.value
37
- }), null, 16, B));
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
- C as default
40
+ B as default
42
41
  };
@@ -1,5 +1,5 @@
1
1
  import o from "./ScalarMarkdown.vue.js";
2
- import "./ScalarMarkdown.vue2.js";
2
+ /* empty css */
3
3
  export {
4
4
  o as default
5
5
  };