@scalar/components 0.4.9 → 0.4.11
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/index.cjs +1 -1
- package/dist/index.js +257 -251
- package/dist/main.css +1 -1
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
import "./main.css";
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { defineConfig as
|
|
4
|
-
import { extendTailwindMerge as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
2
|
+
import { defineComponent as y, useCssVars as W, openBlock as m, createElementBlock as v, normalizeClass as h, unref as c, createElementVNode as k, createCommentVNode as E, createStaticVNode as X, reactive as z, computed as $, useAttrs as H, mergeProps as M, renderSlot as T, createVNode as x, ref as C, watch as q, nextTick as K, onServerPrefetch as Y, useSSRContext as J, onMounted as B, toDisplayString as N, defineAsyncComponent as Z, createBlock as L, resolveDynamicComponent as G, withCtx as A, normalizeStyle as F, createTextVNode as Q, withKeys as ee } from "vue";
|
|
3
|
+
import { defineConfig as te } from "cva";
|
|
4
|
+
import { extendTailwindMerge as ae } from "tailwind-merge";
|
|
5
|
+
import { createHash as re, ssrState as oe } from "@scalar/oas-utils";
|
|
6
|
+
import _ from "prismjs";
|
|
7
|
+
import { Dialog as ne, DialogPanel as se, DialogTitle as ie, DialogDescription as le } from "@headlessui/vue";
|
|
8
|
+
import { useTextareaAutosize as de } from "@vueuse/core";
|
|
9
|
+
import { nanoid as ce } from "nanoid";
|
|
10
|
+
const O = "scalar-component", ue = ae({
|
|
10
11
|
extend: {
|
|
11
12
|
classGroups: {
|
|
12
13
|
// Add the scalar class prefix as a custom class to be deduped by tailwind-merge
|
|
13
14
|
[O]: [O]
|
|
14
15
|
}
|
|
15
16
|
}
|
|
16
|
-
}), { cva: I, cx: S, compose:
|
|
17
|
+
}), { cva: I, cx: S, compose: Fe } = te({
|
|
17
18
|
hooks: {
|
|
18
|
-
onComplete: (
|
|
19
|
+
onComplete: (a) => `${ue(a, O)}`
|
|
19
20
|
}
|
|
20
|
-
}),
|
|
21
|
+
}), pe = /* @__PURE__ */ X('<path class="svg-path svg-check-mark" d="m 0 60 l 30 30 l 70 -80" data-v-42a08e16></path><path class="svg-path svg-x-mark" d="m 50 50 l 40 -40" data-v-42a08e16></path><path class="svg-path svg-x-mark" d="m 50 50 l 40 40" data-v-42a08e16></path><path class="svg-path svg-x-mark" d="m 50 50 l -40 -40" data-v-42a08e16></path><path class="svg-path svg-x-mark" d="m 50 50 l -40 40" data-v-42a08e16></path>', 5), me = {
|
|
21
22
|
key: 0,
|
|
22
23
|
class: "circular-loader"
|
|
23
24
|
};
|
|
24
|
-
function
|
|
25
|
+
function Ue() {
|
|
25
26
|
return z({
|
|
26
27
|
isValid: !1,
|
|
27
28
|
isInvalid: !1,
|
|
@@ -32,44 +33,44 @@ function Me() {
|
|
|
32
33
|
stopLoading() {
|
|
33
34
|
this.isLoading = !1;
|
|
34
35
|
},
|
|
35
|
-
validate(
|
|
36
|
+
validate(a = 800) {
|
|
36
37
|
this.isValid = !0;
|
|
37
|
-
const t =
|
|
38
|
+
const t = a - 300;
|
|
38
39
|
return new Promise(
|
|
39
40
|
(e) => setTimeout(() => this.clear().then(() => e(!0)), t)
|
|
40
41
|
);
|
|
41
42
|
},
|
|
42
|
-
invalidate(
|
|
43
|
+
invalidate(a = 1100) {
|
|
43
44
|
this.isInvalid = !0;
|
|
44
|
-
const t =
|
|
45
|
+
const t = a - 300;
|
|
45
46
|
return new Promise(
|
|
46
47
|
(e) => setTimeout(() => this.clear().then(() => e(!0)), t)
|
|
47
48
|
);
|
|
48
49
|
},
|
|
49
|
-
clear(
|
|
50
|
+
clear(a = 300) {
|
|
50
51
|
return this.isValid = !1, this.isInvalid = !1, this.isLoading = !1, new Promise((t) => {
|
|
51
52
|
setTimeout(() => {
|
|
52
53
|
t(!0);
|
|
53
|
-
},
|
|
54
|
+
}, a);
|
|
54
55
|
});
|
|
55
56
|
}
|
|
56
57
|
});
|
|
57
58
|
}
|
|
58
|
-
const
|
|
59
|
+
const ge = /* @__PURE__ */ y({
|
|
59
60
|
__name: "ScalarLoading",
|
|
60
61
|
props: {
|
|
61
62
|
loadingState: {},
|
|
62
63
|
size: { default: "24px" }
|
|
63
64
|
},
|
|
64
|
-
setup(
|
|
65
|
+
setup(a) {
|
|
65
66
|
return W((t) => ({
|
|
66
67
|
"8d3a1414": t.size
|
|
67
|
-
})), (t, e) => t.loadingState ? (
|
|
68
|
+
})), (t, e) => t.loadingState ? (m(), v("div", {
|
|
68
69
|
key: 0,
|
|
69
|
-
class:
|
|
70
|
+
class: h(c(S)("loader-wrapper"))
|
|
70
71
|
}, [
|
|
71
|
-
(
|
|
72
|
-
class:
|
|
72
|
+
(m(), v("svg", {
|
|
73
|
+
class: h(["svg-loader", {
|
|
73
74
|
"icon-is-valid": t.loadingState.isValid,
|
|
74
75
|
"icon-is-invalid": t.loadingState.isInvalid
|
|
75
76
|
}]),
|
|
@@ -77,10 +78,10 @@ const ue = /* @__PURE__ */ k({
|
|
|
77
78
|
xmlns: "http://www.w3.org/2000/svg",
|
|
78
79
|
"xmlns:xlink": "http://www.w3.org/1999/xlink"
|
|
79
80
|
}, [
|
|
80
|
-
|
|
81
|
-
t.loadingState.isLoading ? (
|
|
82
|
-
|
|
83
|
-
class:
|
|
81
|
+
pe,
|
|
82
|
+
t.loadingState.isLoading ? (m(), v("g", me, [
|
|
83
|
+
k("circle", {
|
|
84
|
+
class: h(["loader-path", {
|
|
84
85
|
"loader-path-off": t.loadingState.isValid || t.loadingState.isInvalid
|
|
85
86
|
}]),
|
|
86
87
|
cx: "50",
|
|
@@ -93,12 +94,12 @@ const ue = /* @__PURE__ */ k({
|
|
|
93
94
|
], 2))
|
|
94
95
|
], 2)) : E("", !0);
|
|
95
96
|
}
|
|
96
|
-
}), D = (
|
|
97
|
-
const e =
|
|
98
|
-
for (const [
|
|
99
|
-
e[
|
|
97
|
+
}), D = (a, t) => {
|
|
98
|
+
const e = a.__vccOpts || a;
|
|
99
|
+
for (const [i, g] of t)
|
|
100
|
+
e[i] = g;
|
|
100
101
|
return e;
|
|
101
|
-
}, U = /* @__PURE__ */ D(
|
|
102
|
+
}, U = /* @__PURE__ */ D(ge, [["__scopeId", "data-v-42a08e16"]]), V = {
|
|
102
103
|
solid: [
|
|
103
104
|
"scalar-button-solid",
|
|
104
105
|
"bg-back-btn-1 text-fore-btn-1 shadow-sm active:bg-back-btn-1 active:shadow-none hocus:bg-hover-btn-1"
|
|
@@ -115,7 +116,7 @@ const ue = /* @__PURE__ */ k({
|
|
|
115
116
|
"scalar-button-danger",
|
|
116
117
|
"bg-error text-white active:brightness-90 hocus:brightness-90"
|
|
117
118
|
]
|
|
118
|
-
},
|
|
119
|
+
}, he = I({
|
|
119
120
|
base: "scalar-button row cursor-pointer items-center justify-center rounded font-medium",
|
|
120
121
|
variants: {
|
|
121
122
|
disabled: {
|
|
@@ -132,13 +133,13 @@ const ue = /* @__PURE__ */ k({
|
|
|
132
133
|
class: "bg-transparent text-ghost"
|
|
133
134
|
}
|
|
134
135
|
]
|
|
135
|
-
}),
|
|
136
|
+
}), fe = ["ariaDisabled"], ve = {
|
|
136
137
|
key: 0,
|
|
137
138
|
class: "mr-2 h-4 w-4"
|
|
138
|
-
},
|
|
139
|
+
}, be = {
|
|
139
140
|
key: 1,
|
|
140
141
|
class: "ml-2"
|
|
141
|
-
},
|
|
142
|
+
}, Se = /* @__PURE__ */ y({
|
|
142
143
|
inheritAttrs: !1,
|
|
143
144
|
__name: "ScalarButton",
|
|
144
145
|
props: {
|
|
@@ -148,34 +149,34 @@ const ue = /* @__PURE__ */ k({
|
|
|
148
149
|
size: { default: "md" },
|
|
149
150
|
variant: { default: "solid" }
|
|
150
151
|
},
|
|
151
|
-
setup(
|
|
152
|
+
setup(a) {
|
|
152
153
|
const t = $(() => {
|
|
153
|
-
const { class: e, ...
|
|
154
|
-
return { className: e || "", rest:
|
|
154
|
+
const { class: e, ...i } = H();
|
|
155
|
+
return { className: e || "", rest: i };
|
|
155
156
|
});
|
|
156
|
-
return (e,
|
|
157
|
+
return (e, i) => (m(), v("button", M(t.value.rest, {
|
|
157
158
|
ariaDisabled: e.disabled || void 0,
|
|
158
159
|
class: c(S)(
|
|
159
|
-
c(
|
|
160
|
+
c(he)({ fullWidth: e.fullWidth, disabled: e.disabled, size: e.size, variant: e.variant }),
|
|
160
161
|
{ "pl-9 pr-3": e.loading },
|
|
161
162
|
`${t.value.className}`
|
|
162
163
|
),
|
|
163
164
|
type: "button"
|
|
164
165
|
}), [
|
|
165
|
-
e.$slots.icon ? (
|
|
166
|
-
|
|
166
|
+
e.$slots.icon ? (m(), v("div", ve, [
|
|
167
|
+
T(e.$slots, "icon")
|
|
167
168
|
])) : E("", !0),
|
|
168
|
-
|
|
169
|
-
e.loading ? (
|
|
170
|
-
|
|
169
|
+
T(e.$slots, "default"),
|
|
170
|
+
e.loading ? (m(), v("div", be, [
|
|
171
|
+
x(c(U), {
|
|
171
172
|
loadingState: e.loading,
|
|
172
173
|
size: "20px"
|
|
173
174
|
}, null, 8, ["loadingState"])
|
|
174
175
|
])) : E("", !0)
|
|
175
|
-
], 16,
|
|
176
|
+
], 16, fe));
|
|
176
177
|
}
|
|
177
178
|
});
|
|
178
|
-
(function(
|
|
179
|
+
(function(a) {
|
|
179
180
|
var t = "\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b", e = {
|
|
180
181
|
pattern: /(^(["']?)\w+\2)[ \t]+\S.*/,
|
|
181
182
|
lookbehind: !0,
|
|
@@ -183,7 +184,7 @@ const ue = /* @__PURE__ */ k({
|
|
|
183
184
|
// this looks reasonably well in all themes
|
|
184
185
|
inside: null
|
|
185
186
|
// see below
|
|
186
|
-
},
|
|
187
|
+
}, i = {
|
|
187
188
|
bash: e,
|
|
188
189
|
environment: {
|
|
189
190
|
pattern: RegExp("\\$" + t),
|
|
@@ -237,7 +238,7 @@ const ue = /* @__PURE__ */ k({
|
|
|
237
238
|
// Escape sequences from echo and printf's manuals, and escaped quotes.
|
|
238
239
|
entity: /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/
|
|
239
240
|
};
|
|
240
|
-
|
|
241
|
+
a.languages.bash = {
|
|
241
242
|
shebang: {
|
|
242
243
|
pattern: /^#!\s*\/.*/,
|
|
243
244
|
alias: "important"
|
|
@@ -295,7 +296,7 @@ const ue = /* @__PURE__ */ k({
|
|
|
295
296
|
pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,
|
|
296
297
|
lookbehind: !0,
|
|
297
298
|
greedy: !0,
|
|
298
|
-
inside:
|
|
299
|
+
inside: i
|
|
299
300
|
},
|
|
300
301
|
// Here-document with quotes around the tag
|
|
301
302
|
// → No expansion (so no “inside”).
|
|
@@ -313,7 +314,7 @@ const ue = /* @__PURE__ */ k({
|
|
|
313
314
|
pattern: /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,
|
|
314
315
|
lookbehind: !0,
|
|
315
316
|
greedy: !0,
|
|
316
|
-
inside:
|
|
317
|
+
inside: i
|
|
317
318
|
},
|
|
318
319
|
{
|
|
319
320
|
// https://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html
|
|
@@ -326,7 +327,7 @@ const ue = /* @__PURE__ */ k({
|
|
|
326
327
|
pattern: /\$'(?:[^'\\]|\\[\s\S])*'/,
|
|
327
328
|
greedy: !0,
|
|
328
329
|
inside: {
|
|
329
|
-
entity:
|
|
330
|
+
entity: i.entity
|
|
330
331
|
}
|
|
331
332
|
}
|
|
332
333
|
],
|
|
@@ -334,7 +335,7 @@ const ue = /* @__PURE__ */ k({
|
|
|
334
335
|
pattern: RegExp("\\$?" + t),
|
|
335
336
|
alias: "constant"
|
|
336
337
|
},
|
|
337
|
-
variable:
|
|
338
|
+
variable: i.variable,
|
|
338
339
|
function: {
|
|
339
340
|
pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,
|
|
340
341
|
lookbehind: !0
|
|
@@ -373,8 +374,8 @@ const ue = /* @__PURE__ */ k({
|
|
|
373
374
|
pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,
|
|
374
375
|
lookbehind: !0
|
|
375
376
|
}
|
|
376
|
-
}, e.inside =
|
|
377
|
-
for (var
|
|
377
|
+
}, e.inside = a.languages.bash;
|
|
378
|
+
for (var g = [
|
|
378
379
|
"comment",
|
|
379
380
|
"function-name",
|
|
380
381
|
"for-or-select",
|
|
@@ -390,9 +391,9 @@ const ue = /* @__PURE__ */ k({
|
|
|
390
391
|
"operator",
|
|
391
392
|
"punctuation",
|
|
392
393
|
"number"
|
|
393
|
-
],
|
|
394
|
-
|
|
395
|
-
|
|
394
|
+
], b = i.variable[1].inside, s = 0; s < g.length; s++)
|
|
395
|
+
b[g[s]] = a.languages.bash[g[s]];
|
|
396
|
+
a.languages.sh = a.languages.bash, a.languages.shell = a.languages.bash;
|
|
396
397
|
})(Prism);
|
|
397
398
|
Prism.languages.json = {
|
|
398
399
|
property: {
|
|
@@ -422,7 +423,7 @@ Prism.languages.webmanifest = Prism.languages.json;
|
|
|
422
423
|
(function() {
|
|
423
424
|
if (typeof Prism > "u" || typeof document > "u")
|
|
424
425
|
return;
|
|
425
|
-
var
|
|
426
|
+
var a = "line-numbers", t = /\n(?!$)/g, e = Prism.plugins.lineNumbers = {
|
|
426
427
|
/**
|
|
427
428
|
* Get node for provided line number
|
|
428
429
|
*
|
|
@@ -430,14 +431,14 @@ Prism.languages.webmanifest = Prism.languages.json;
|
|
|
430
431
|
* @param {number} number line number
|
|
431
432
|
* @returns {Element|undefined}
|
|
432
433
|
*/
|
|
433
|
-
getLine: function(
|
|
434
|
-
if (!(
|
|
435
|
-
var o =
|
|
434
|
+
getLine: function(s, d) {
|
|
435
|
+
if (!(s.tagName !== "PRE" || !s.classList.contains(a))) {
|
|
436
|
+
var o = s.querySelector(".line-numbers-rows");
|
|
436
437
|
if (o) {
|
|
437
|
-
var
|
|
438
|
-
|
|
439
|
-
var
|
|
440
|
-
return o.children[
|
|
438
|
+
var l = parseInt(s.getAttribute("data-start"), 10) || 1, u = l + (o.children.length - 1);
|
|
439
|
+
d < l && (d = l), d > u && (d = u);
|
|
440
|
+
var r = d - l;
|
|
441
|
+
return o.children[r];
|
|
441
442
|
}
|
|
442
443
|
}
|
|
443
444
|
},
|
|
@@ -449,8 +450,8 @@ Prism.languages.webmanifest = Prism.languages.json;
|
|
|
449
450
|
* @param {HTMLElement} element A `<pre>` element with line numbers.
|
|
450
451
|
* @returns {void}
|
|
451
452
|
*/
|
|
452
|
-
resize: function(
|
|
453
|
-
|
|
453
|
+
resize: function(s) {
|
|
454
|
+
i([s]);
|
|
454
455
|
},
|
|
455
456
|
/**
|
|
456
457
|
* Whether the plugin can assume that the units font sizes and margins are not depended on the size of
|
|
@@ -464,72 +465,72 @@ Prism.languages.webmanifest = Prism.languages.json;
|
|
|
464
465
|
*/
|
|
465
466
|
assumeViewportIndependence: !0
|
|
466
467
|
};
|
|
467
|
-
function
|
|
468
|
-
if (
|
|
469
|
-
var
|
|
470
|
-
return
|
|
471
|
-
}),
|
|
472
|
-
var
|
|
473
|
-
var
|
|
474
|
-
if (!(!
|
|
475
|
-
var
|
|
476
|
-
|
|
477
|
-
var
|
|
478
|
-
return
|
|
468
|
+
function i(s) {
|
|
469
|
+
if (s = s.filter(function(o) {
|
|
470
|
+
var l = g(o), u = l["white-space"];
|
|
471
|
+
return u === "pre-wrap" || u === "pre-line";
|
|
472
|
+
}), s.length != 0) {
|
|
473
|
+
var d = s.map(function(o) {
|
|
474
|
+
var l = o.querySelector("code"), u = o.querySelector(".line-numbers-rows");
|
|
475
|
+
if (!(!l || !u)) {
|
|
476
|
+
var r = o.querySelector(".line-numbers-sizer"), p = l.textContent.split(t);
|
|
477
|
+
r || (r = document.createElement("span"), r.className = "line-numbers-sizer", l.appendChild(r)), r.innerHTML = "0", r.style.display = "block";
|
|
478
|
+
var n = r.getBoundingClientRect().height;
|
|
479
|
+
return r.innerHTML = "", {
|
|
479
480
|
element: o,
|
|
480
|
-
lines:
|
|
481
|
+
lines: p,
|
|
481
482
|
lineHeights: [],
|
|
482
|
-
oneLinerHeight:
|
|
483
|
-
sizer:
|
|
483
|
+
oneLinerHeight: n,
|
|
484
|
+
sizer: r
|
|
484
485
|
};
|
|
485
486
|
}
|
|
486
487
|
}).filter(Boolean);
|
|
487
|
-
|
|
488
|
-
var
|
|
489
|
-
|
|
490
|
-
if (
|
|
491
|
-
var
|
|
492
|
-
|
|
488
|
+
d.forEach(function(o) {
|
|
489
|
+
var l = o.sizer, u = o.lines, r = o.lineHeights, p = o.oneLinerHeight;
|
|
490
|
+
r[u.length - 1] = void 0, u.forEach(function(n, f) {
|
|
491
|
+
if (n && n.length > 1) {
|
|
492
|
+
var w = l.appendChild(document.createElement("span"));
|
|
493
|
+
w.style.display = "block", w.textContent = n;
|
|
493
494
|
} else
|
|
494
|
-
|
|
495
|
+
r[f] = p;
|
|
495
496
|
});
|
|
496
|
-
}),
|
|
497
|
-
for (var
|
|
498
|
-
p
|
|
499
|
-
}),
|
|
500
|
-
var
|
|
501
|
-
|
|
502
|
-
|
|
497
|
+
}), d.forEach(function(o) {
|
|
498
|
+
for (var l = o.sizer, u = o.lineHeights, r = 0, p = 0; p < u.length; p++)
|
|
499
|
+
u[p] === void 0 && (u[p] = l.children[r++].getBoundingClientRect().height);
|
|
500
|
+
}), d.forEach(function(o) {
|
|
501
|
+
var l = o.sizer, u = o.element.querySelector(".line-numbers-rows");
|
|
502
|
+
l.style.display = "none", l.innerHTML = "", o.lineHeights.forEach(function(r, p) {
|
|
503
|
+
u.children[p].style.height = r + "px";
|
|
503
504
|
});
|
|
504
505
|
});
|
|
505
506
|
}
|
|
506
507
|
}
|
|
507
|
-
function
|
|
508
|
-
return
|
|
508
|
+
function g(s) {
|
|
509
|
+
return s ? window.getComputedStyle ? getComputedStyle(s) : s.currentStyle || null : null;
|
|
509
510
|
}
|
|
510
|
-
var
|
|
511
|
+
var b = void 0;
|
|
511
512
|
window.addEventListener("resize", function() {
|
|
512
|
-
e.assumeViewportIndependence &&
|
|
513
|
-
}), Prism.hooks.add("complete", function(
|
|
514
|
-
if (
|
|
515
|
-
var
|
|
513
|
+
e.assumeViewportIndependence && b === window.innerWidth || (b = window.innerWidth, i(Array.prototype.slice.call(document.querySelectorAll("pre." + a))));
|
|
514
|
+
}), Prism.hooks.add("complete", function(s) {
|
|
515
|
+
if (s.code) {
|
|
516
|
+
var d = (
|
|
516
517
|
/** @type {Element} */
|
|
517
|
-
|
|
518
|
+
s.element
|
|
518
519
|
), o = (
|
|
519
520
|
/** @type {HTMLElement} */
|
|
520
|
-
|
|
521
|
+
d.parentNode
|
|
521
522
|
);
|
|
522
|
-
if (!(!o || !/pre/i.test(o.nodeName)) && !
|
|
523
|
-
|
|
524
|
-
var
|
|
525
|
-
|
|
523
|
+
if (!(!o || !/pre/i.test(o.nodeName)) && !d.querySelector(".line-numbers-rows") && Prism.util.isActive(d, a)) {
|
|
524
|
+
d.classList.remove(a), o.classList.add(a);
|
|
525
|
+
var l = s.code.match(t), u = l ? l.length + 1 : 1, r, p = new Array(u + 1).join("<span></span>");
|
|
526
|
+
r = document.createElement("span"), r.setAttribute("aria-hidden", "true"), r.className = "line-numbers-rows", r.innerHTML = p, o.hasAttribute("data-start") && (o.style.counterReset = "linenumber " + (parseInt(o.getAttribute("data-start"), 10) - 1)), s.element.appendChild(r), i([o]), Prism.hooks.run("line-numbers", s);
|
|
526
527
|
}
|
|
527
528
|
}
|
|
528
|
-
}), Prism.hooks.add("line-numbers", function(
|
|
529
|
-
|
|
529
|
+
}), Prism.hooks.add("line-numbers", function(s) {
|
|
530
|
+
s.plugins = s.plugins || {}, s.plugins.lineNumbers = !0;
|
|
530
531
|
});
|
|
531
532
|
})();
|
|
532
|
-
const
|
|
533
|
+
const we = ["innerHTML"], Ve = /* @__PURE__ */ y({
|
|
533
534
|
__name: "ScalarCodeBlock",
|
|
534
535
|
props: {
|
|
535
536
|
content: {},
|
|
@@ -537,79 +538,84 @@ const ve = ["innerHTML"], He = /* @__PURE__ */ k({
|
|
|
537
538
|
lineNumbers: { type: Boolean, default: !1 },
|
|
538
539
|
hideCredentials: {}
|
|
539
540
|
},
|
|
540
|
-
setup(
|
|
541
|
-
const t =
|
|
542
|
-
|
|
541
|
+
setup(a) {
|
|
542
|
+
const t = a, e = re(
|
|
543
|
+
typeof t.content == "object" ? JSON.stringify(t.content) : t.content
|
|
544
|
+
), i = `components-scalar-code-block${e}`, { plugins: g, highlightElement: b } = _;
|
|
545
|
+
t.hideCredentials && _.hooks.add("wrap", function(r) {
|
|
543
546
|
if (!t.hideCredentials)
|
|
544
547
|
return;
|
|
545
|
-
let
|
|
546
|
-
typeof t.hideCredentials == "string" ?
|
|
547
|
-
(
|
|
548
|
-
)),
|
|
548
|
+
let p = !1;
|
|
549
|
+
typeof t.hideCredentials == "string" ? r.content.includes(t.hideCredentials) && (p = !0) : Array.isArray(t.hideCredentials) && (p = t.hideCredentials.some(
|
|
550
|
+
(n) => r.content.includes(n)
|
|
551
|
+
)), p && (r.content = r.content.replace(
|
|
549
552
|
/<span class="credentials">.*?<\/span>/g,
|
|
550
|
-
(
|
|
551
|
-
),
|
|
553
|
+
(n) => n.replace(/<span class="credentials">|<\/span>/g, "")
|
|
554
|
+
), r.content = r.content.replace(
|
|
552
555
|
new RegExp(
|
|
553
556
|
typeof t.hideCredentials == "string" ? t.hideCredentials : t.hideCredentials.join("|"),
|
|
554
557
|
"g"
|
|
555
558
|
),
|
|
556
|
-
(
|
|
559
|
+
(n) => `<span class="credentials">${n}</span>`
|
|
557
560
|
));
|
|
558
561
|
});
|
|
559
|
-
const
|
|
560
|
-
|
|
561
|
-
() =>
|
|
562
|
+
const s = C(null), d = C(oe[i] ?? ""), o = $(() => t.lang === "node" ? "js" : t.lang), l = t.lang;
|
|
563
|
+
q(
|
|
564
|
+
[() => t.lang, () => t.content, s],
|
|
562
565
|
() => {
|
|
563
|
-
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
|
|
566
|
+
s.value && t.content && (!d.value || t.lang !== l) && (d.value = "", K(() => b(s.value)));
|
|
567
|
+
},
|
|
568
|
+
{ immediate: !0 }
|
|
569
|
+
);
|
|
570
|
+
const u = /\n(?!$)/g;
|
|
571
|
+
return Y(async () => {
|
|
572
|
+
let r = "";
|
|
573
|
+
t.lineNumbers && _.hooks.add("after-tokenize", (n) => {
|
|
574
|
+
const f = n.code.match(u), w = f ? f.length + 1 : 1;
|
|
575
|
+
r = `<span aria-hidden="true" class="line-numbers-rows">${new Array(w + 1).join("<span></span>")}</span>`;
|
|
576
|
+
});
|
|
577
|
+
const p = _.highlight(
|
|
567
578
|
typeof t.content == "object" ? JSON.stringify(t.content) : t.content,
|
|
568
|
-
|
|
569
|
-
|
|
579
|
+
_.languages[o.value],
|
|
580
|
+
o.value
|
|
570
581
|
);
|
|
571
|
-
|
|
582
|
+
if (d.value = p + r, e !== 0) {
|
|
583
|
+
const n = J();
|
|
584
|
+
n.payload.data[i] = p + r;
|
|
585
|
+
}
|
|
572
586
|
}), B(async () => {
|
|
573
|
-
|
|
574
|
-
}), (
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
`scalar-component scalar-codeblock-pre language-${a.value}`,
|
|
587
|
+
await import("./prism-autoloader-Dlh8Vzlw.js"), g.autoloader.languages_path = "https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/";
|
|
588
|
+
}), (r, p) => (m(), v("pre", {
|
|
589
|
+
class: h([
|
|
590
|
+
`scalar-component scalar-codeblock-pre language-${o.value}`,
|
|
578
591
|
{
|
|
579
|
-
"line-numbers":
|
|
592
|
+
"line-numbers": r.lineNumbers
|
|
580
593
|
}
|
|
581
594
|
])
|
|
582
595
|
}, [
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
], 2)) : (g(), v("pre", {
|
|
590
|
-
key: 1,
|
|
591
|
-
class: m(["scalar-component scalar-codeblock-pre", {
|
|
592
|
-
"line-numbers": n.lineNumbers
|
|
593
|
-
}])
|
|
594
|
-
}, [
|
|
595
|
-
w("code", {
|
|
596
|
+
d.value ? (m(), v("code", {
|
|
597
|
+
key: 0,
|
|
598
|
+
class: h(`scalar-codeblock-code language-${o.value}`),
|
|
599
|
+
innerHTML: d.value
|
|
600
|
+
}, null, 10, we)) : (m(), v("code", {
|
|
601
|
+
key: 1,
|
|
596
602
|
ref_key: "el",
|
|
597
|
-
ref:
|
|
598
|
-
class:
|
|
599
|
-
},
|
|
603
|
+
ref: s,
|
|
604
|
+
class: h(`scalar-codeblock-code language-${o.value}`)
|
|
605
|
+
}, N(r.content), 3))
|
|
600
606
|
], 2));
|
|
601
607
|
}
|
|
602
|
-
}), R = /* @__PURE__ */ Object.assign({ "./Add.svg": () => import("./Add-MwmVL5-v.js"), "./CheckMark.svg": () => import("./CheckMark-t0gl4N9U.js"), "./ChevronDown.svg": () => import("./ChevronDown-BfsntkAH.js"), "./ChevronLeft.svg": () => import("./ChevronLeft-gsLd5xOQ.js"), "./ChevronRight.svg": () => import("./ChevronRight-CI_7n_av.js"), "./ChevronUp.svg": () => import("./ChevronUp-CjHRmG59.js"), "./Clipboard.svg": () => import("./Clipboard-CU_KxGEv.js"), "./Close.svg": () => import("./Close-DFM1qMQH.js"), "./DarkMode.svg": () => import("./DarkMode-CBsV8Q_I.js"), "./Ellipses.svg": () => import("./Ellipses-Bo_X36Hx.js"), "./ExternalLink.svg": () => import("./ExternalLink-D5zCsWas.js"), "./GitHub.svg": () => import("./GitHub-NdE6Zs9k.js"), "./LightDarkModeToggle.svg": () => import("./LightDarkModeToggle-BkvMimDa.js"), "./LightMode.svg": () => import("./LightMode-Btz6vyT_.js"), "./Logo.svg": () => import("./Logo-mtzeKD8M.js"), "./LogoAPI.svg": () => import("./LogoAPI-CaU5E6FK.js"), "./LogoClient.svg": () => import("./LogoClient-DdC-t_7P.js"), "./LogoMarket.svg": () => import("./LogoMarket-DwlApcab.js"), "./LogoSwagger.svg": () => import("./LogoSwagger-CH60H5qW.js"), "./Menu.svg": () => import("./Menu-DFi9Laso.js"), "./PaperAirplane.svg": () => import("./PaperAirplane-BC-4mGEB.js"), "./Search.svg": () => import("./Search-DqtlswRG.js"), "./arrow-chevron-down.svg": () => import("./arrow-chevron-down-C8nXK33Q.js"), "./arrow-chevron-left.svg": () => import("./arrow-chevron-left-BXUhHSEc.js"), "./arrow-chevron-right.svg": () => import("./arrow-chevron-right-CSqjaNKG.js"), "./arrow-chevron-up.svg": () => import("./arrow-chevron-up-Dr-W1IfM.js"), "./arrow-down.svg": () => import("./arrow-down-rfW-r_qd.js"), "./arrow-left.svg": () => import("./arrow-left-DDkHt-xN.js"), "./arrow-right.svg": () => import("./arrow-right-17dZkGZR.js"), "./arrow-up.svg": () => import("./arrow-up-CexG2Ble.js"), "./brand-software-development-github.svg": () => import("./brand-software-development-github-ZQnPxpDg.js"), "./interface-add.svg": () => import("./interface-add-Bthe4y9O.js"), "./interface-close.svg": () => import("./interface-close-WpJOu-2h.js"), "./programming-framework-angular.svg": () => import("./programming-framework-angular-DD4Vjgbk.js"), "./programming-framework-astro.svg": () => import("./programming-framework-astro-CLfrRt19.js"), "./programming-framework-laravel.svg": () => import("./programming-framework-laravel-kAy2wVLy.js"), "./programming-framework-nextdotjs.svg": () => import("./programming-framework-nextdotjs-BKdd_DY_.js"), "./programming-framework-react.svg": () => import("./programming-framework-react-PDgmtZuN.js"), "./programming-framework-vuedotjs.svg": () => import("./programming-framework-vuedotjs-Cv46W2aB.js"), "./programming-language-c.svg": () => import("./programming-language-c-hPGu2Zvg.js"), "./programming-language-clojure.svg": () => import("./programming-language-clojure-Cvmzky8x.js"), "./programming-language-csharp.svg": () => import("./programming-language-csharp-lqX1oWgb.js"), "./programming-language-css3.svg": () => import("./programming-language-css3-Dpp4Cr6b.js"), "./programming-language-go.svg": () => import("./programming-language-go-DoJxWwT6.js"), "./programming-language-html5.svg": () => import("./programming-language-html5-DlqJK4EL.js"), "./programming-language-http.svg": () => import("./programming-language-http-wMYwFS1I.js"), "./programming-language-java.svg": () => import("./programming-language-java-BCxG2T_w.js"), "./programming-language-javascript.svg": () => import("./programming-language-javascript-VxLvi1QG.js"), "./programming-language-json.svg": () => import("./programming-language-json-vEX_g7Zi.js"), "./programming-language-kotlin.svg": () => import("./programming-language-kotlin-DKV8vP9h.js"), "./programming-language-node.svg": () => import("./programming-language-node-Xsgx38lm.js"), "./programming-language-objc.svg": () => import("./programming-language-objc-BQXSOBsX.js"), "./programming-language-ocaml.svg": () => import("./programming-language-ocaml-BEz7gGv7.js"), "./programming-language-php.svg": () => import("./programming-language-php-GY38f8r4.js"), "./programming-language-powershell.svg": () => import("./programming-language-powershell-C9DkSp36.js"), "./programming-language-python.svg": () => import("./programming-language-python-Ct-_kNjo.js"), "./programming-language-r.svg": () => import("./programming-language-r-BGoKwua9.js"), "./programming-language-ruby.svg": () => import("./programming-language-ruby-DhdM4d7g.js"), "./programming-language-scala.svg": () => import("./programming-language-scala-BVg0dToJ.js"), "./programming-language-shell.svg": () => import("./programming-language-shell-BsTa1xI7.js"), "./programming-language-swift.svg": () => import("./programming-language-swift-Dn72xPjg.js"), "./programming-language-typescript.svg": () => import("./programming-language-typescript-CdF-HuRi.js"), "./programming-script-code.svg": () => import("./programming-script-code-DQN1veb2.js"), "./programming-tool-git.svg": () => import("./programming-tool-git-DDnQ1zGD.js"), "./programming-tool-tailwindcss.svg": () => import("./programming-tool-tailwindcss-xjXi0E6g.js") }), P = (
|
|
603
|
-
const t = `./${
|
|
604
|
-
return R[t] ?
|
|
605
|
-
},
|
|
608
|
+
}), R = /* @__PURE__ */ Object.assign({ "./Add.svg": () => import("./Add-MwmVL5-v.js"), "./CheckMark.svg": () => import("./CheckMark-t0gl4N9U.js"), "./ChevronDown.svg": () => import("./ChevronDown-BfsntkAH.js"), "./ChevronLeft.svg": () => import("./ChevronLeft-gsLd5xOQ.js"), "./ChevronRight.svg": () => import("./ChevronRight-CI_7n_av.js"), "./ChevronUp.svg": () => import("./ChevronUp-CjHRmG59.js"), "./Clipboard.svg": () => import("./Clipboard-CU_KxGEv.js"), "./Close.svg": () => import("./Close-DFM1qMQH.js"), "./DarkMode.svg": () => import("./DarkMode-CBsV8Q_I.js"), "./Ellipses.svg": () => import("./Ellipses-Bo_X36Hx.js"), "./ExternalLink.svg": () => import("./ExternalLink-D5zCsWas.js"), "./GitHub.svg": () => import("./GitHub-NdE6Zs9k.js"), "./LightDarkModeToggle.svg": () => import("./LightDarkModeToggle-BkvMimDa.js"), "./LightMode.svg": () => import("./LightMode-Btz6vyT_.js"), "./Logo.svg": () => import("./Logo-mtzeKD8M.js"), "./LogoAPI.svg": () => import("./LogoAPI-CaU5E6FK.js"), "./LogoClient.svg": () => import("./LogoClient-DdC-t_7P.js"), "./LogoMarket.svg": () => import("./LogoMarket-DwlApcab.js"), "./LogoSwagger.svg": () => import("./LogoSwagger-CH60H5qW.js"), "./Menu.svg": () => import("./Menu-DFi9Laso.js"), "./PaperAirplane.svg": () => import("./PaperAirplane-BC-4mGEB.js"), "./Search.svg": () => import("./Search-DqtlswRG.js"), "./arrow-chevron-down.svg": () => import("./arrow-chevron-down-C8nXK33Q.js"), "./arrow-chevron-left.svg": () => import("./arrow-chevron-left-BXUhHSEc.js"), "./arrow-chevron-right.svg": () => import("./arrow-chevron-right-CSqjaNKG.js"), "./arrow-chevron-up.svg": () => import("./arrow-chevron-up-Dr-W1IfM.js"), "./arrow-down.svg": () => import("./arrow-down-rfW-r_qd.js"), "./arrow-left.svg": () => import("./arrow-left-DDkHt-xN.js"), "./arrow-right.svg": () => import("./arrow-right-17dZkGZR.js"), "./arrow-up.svg": () => import("./arrow-up-CexG2Ble.js"), "./brand-software-development-github.svg": () => import("./brand-software-development-github-ZQnPxpDg.js"), "./interface-add.svg": () => import("./interface-add-Bthe4y9O.js"), "./interface-close.svg": () => import("./interface-close-WpJOu-2h.js"), "./programming-framework-angular.svg": () => import("./programming-framework-angular-DD4Vjgbk.js"), "./programming-framework-astro.svg": () => import("./programming-framework-astro-CLfrRt19.js"), "./programming-framework-laravel.svg": () => import("./programming-framework-laravel-kAy2wVLy.js"), "./programming-framework-nextdotjs.svg": () => import("./programming-framework-nextdotjs-BKdd_DY_.js"), "./programming-framework-react.svg": () => import("./programming-framework-react-PDgmtZuN.js"), "./programming-framework-vuedotjs.svg": () => import("./programming-framework-vuedotjs-Cv46W2aB.js"), "./programming-language-c.svg": () => import("./programming-language-c-hPGu2Zvg.js"), "./programming-language-clojure.svg": () => import("./programming-language-clojure-Cvmzky8x.js"), "./programming-language-csharp.svg": () => import("./programming-language-csharp-lqX1oWgb.js"), "./programming-language-css3.svg": () => import("./programming-language-css3-Dpp4Cr6b.js"), "./programming-language-go.svg": () => import("./programming-language-go-DoJxWwT6.js"), "./programming-language-html5.svg": () => import("./programming-language-html5-DlqJK4EL.js"), "./programming-language-http.svg": () => import("./programming-language-http-wMYwFS1I.js"), "./programming-language-java.svg": () => import("./programming-language-java-BCxG2T_w.js"), "./programming-language-javascript.svg": () => import("./programming-language-javascript-VxLvi1QG.js"), "./programming-language-json.svg": () => import("./programming-language-json-vEX_g7Zi.js"), "./programming-language-kotlin.svg": () => import("./programming-language-kotlin-DKV8vP9h.js"), "./programming-language-node.svg": () => import("./programming-language-node-Xsgx38lm.js"), "./programming-language-objc.svg": () => import("./programming-language-objc-BQXSOBsX.js"), "./programming-language-ocaml.svg": () => import("./programming-language-ocaml-BEz7gGv7.js"), "./programming-language-php.svg": () => import("./programming-language-php-GY38f8r4.js"), "./programming-language-powershell.svg": () => import("./programming-language-powershell-C9DkSp36.js"), "./programming-language-python.svg": () => import("./programming-language-python-Ct-_kNjo.js"), "./programming-language-r.svg": () => import("./programming-language-r-BGoKwua9.js"), "./programming-language-ruby.svg": () => import("./programming-language-ruby-DhdM4d7g.js"), "./programming-language-scala.svg": () => import("./programming-language-scala-BVg0dToJ.js"), "./programming-language-shell.svg": () => import("./programming-language-shell-BsTa1xI7.js"), "./programming-language-swift.svg": () => import("./programming-language-swift-Dn72xPjg.js"), "./programming-language-typescript.svg": () => import("./programming-language-typescript-CdF-HuRi.js"), "./programming-script-code.svg": () => import("./programming-script-code-DQN1veb2.js"), "./programming-tool-git.svg": () => import("./programming-tool-git-DDnQ1zGD.js"), "./programming-tool-tailwindcss.svg": () => import("./programming-tool-tailwindcss-xjXi0E6g.js") }), P = (a) => {
|
|
609
|
+
const t = `./${a}.svg`;
|
|
610
|
+
return R[t] ? Z(R[t]) : (console.warn(`Could not find icon: ${a}`), null);
|
|
611
|
+
}, ye = ["src"], j = /* @__PURE__ */ y({
|
|
606
612
|
__name: "ScalarIcon",
|
|
607
613
|
props: {
|
|
608
614
|
icon: {},
|
|
609
615
|
size: {}
|
|
610
616
|
},
|
|
611
|
-
setup(
|
|
612
|
-
const t =
|
|
617
|
+
setup(a) {
|
|
618
|
+
const t = a, e = I({
|
|
613
619
|
variants: {
|
|
614
620
|
size: {
|
|
615
621
|
xs: "h-3 w-3",
|
|
@@ -623,16 +629,16 @@ const ve = ["innerHTML"], He = /* @__PURE__ */ k({
|
|
|
623
629
|
defaultVariants: {
|
|
624
630
|
size: "full"
|
|
625
631
|
}
|
|
626
|
-
}),
|
|
627
|
-
return (
|
|
632
|
+
}), i = P(t.icon);
|
|
633
|
+
return (g, b) => c(i) ? (m(), L(G(c(P)(g.icon)), {
|
|
628
634
|
key: 0,
|
|
629
|
-
class:
|
|
630
|
-
}, null, 8, ["class"])) : (
|
|
635
|
+
class: h(c(S)("scalar-icon", c(e)({ size: g.size })))
|
|
636
|
+
}, null, 8, ["class"])) : (m(), v("img", {
|
|
631
637
|
key: 1,
|
|
632
|
-
src:
|
|
633
|
-
}, null, 8,
|
|
638
|
+
src: g.icon
|
|
639
|
+
}, null, 8, ye));
|
|
634
640
|
}
|
|
635
|
-
}),
|
|
641
|
+
}), ke = ["ariaDisabled"], Ee = { class: "sr-only" }, _e = /* @__PURE__ */ y({
|
|
636
642
|
__name: "ScalarIconButton",
|
|
637
643
|
props: {
|
|
638
644
|
label: {},
|
|
@@ -641,7 +647,7 @@ const ve = ["innerHTML"], He = /* @__PURE__ */ k({
|
|
|
641
647
|
variant: { default: "ghost" },
|
|
642
648
|
size: { default: "md" }
|
|
643
649
|
},
|
|
644
|
-
setup(
|
|
650
|
+
setup(a) {
|
|
645
651
|
const t = I({
|
|
646
652
|
base: "scalar-icon-button grid aspect-square cursor-pointer rounded",
|
|
647
653
|
variants: {
|
|
@@ -657,16 +663,16 @@ const ve = ["innerHTML"], He = /* @__PURE__ */ k({
|
|
|
657
663
|
variant: V
|
|
658
664
|
}
|
|
659
665
|
});
|
|
660
|
-
return (e,
|
|
666
|
+
return (e, i) => (m(), v("button", {
|
|
661
667
|
ariaDisabled: e.disabled || void 0,
|
|
662
|
-
class:
|
|
668
|
+
class: h(c(S)(c(t)({ size: e.size, variant: e.variant, disabled: e.disabled }))),
|
|
663
669
|
type: "button"
|
|
664
670
|
}, [
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
], 10,
|
|
671
|
+
x(c(j), { icon: e.icon }, null, 8, ["icon"]),
|
|
672
|
+
k("span", Ee, N(e.label), 1)
|
|
673
|
+
], 10, ke));
|
|
668
674
|
}
|
|
669
|
-
}),
|
|
675
|
+
}), je = () => z({
|
|
670
676
|
open: !1,
|
|
671
677
|
show() {
|
|
672
678
|
this.open = !0;
|
|
@@ -674,7 +680,7 @@ const ve = ["innerHTML"], He = /* @__PURE__ */ k({
|
|
|
674
680
|
hide() {
|
|
675
681
|
this.open = !1;
|
|
676
682
|
}
|
|
677
|
-
}),
|
|
683
|
+
}), Ne = /* @__PURE__ */ y({
|
|
678
684
|
__name: "ScalarModal",
|
|
679
685
|
props: {
|
|
680
686
|
state: {},
|
|
@@ -684,7 +690,7 @@ const ve = ["innerHTML"], He = /* @__PURE__ */ k({
|
|
|
684
690
|
size: { default: "md" },
|
|
685
691
|
variant: {}
|
|
686
692
|
},
|
|
687
|
-
setup(
|
|
693
|
+
setup(a) {
|
|
688
694
|
const t = I({
|
|
689
695
|
base: [
|
|
690
696
|
"scalar-modal",
|
|
@@ -703,13 +709,13 @@ const ve = ["innerHTML"], He = /* @__PURE__ */ k({
|
|
|
703
709
|
}
|
|
704
710
|
}
|
|
705
711
|
});
|
|
706
|
-
return (e,
|
|
712
|
+
return (e, i) => (m(), L(c(ne), {
|
|
707
713
|
open: e.state.open,
|
|
708
|
-
onClose:
|
|
714
|
+
onClose: i[0] || (i[0] = (g) => e.state.hide())
|
|
709
715
|
}, {
|
|
710
|
-
default:
|
|
711
|
-
|
|
712
|
-
class:
|
|
716
|
+
default: A(() => [
|
|
717
|
+
k("div", {
|
|
718
|
+
class: h(
|
|
713
719
|
c(S)(
|
|
714
720
|
"scalar-modal-layout fixed left-0 top-0",
|
|
715
721
|
"z-[1001] h-[100dvh] w-[100dvw]",
|
|
@@ -717,22 +723,22 @@ const ve = ["innerHTML"], He = /* @__PURE__ */ k({
|
|
|
717
723
|
)
|
|
718
724
|
)
|
|
719
725
|
}, [
|
|
720
|
-
|
|
721
|
-
class:
|
|
726
|
+
x(c(se), {
|
|
727
|
+
class: h(c(t)({ size: e.size, variant: e.variant })),
|
|
722
728
|
style: F({ maxWidth: e.maxWidth })
|
|
723
729
|
}, {
|
|
724
|
-
default:
|
|
725
|
-
e.title ? (
|
|
730
|
+
default: A(() => [
|
|
731
|
+
e.title ? (m(), L(c(ie), {
|
|
726
732
|
key: 0,
|
|
727
|
-
class:
|
|
733
|
+
class: h(["scalar-modal-header font-semiBold m-0 rounded-lg px-6 py-3 text-left text-xs text-fore-1", { "pb-0 pt-6": e.variant === "history" }])
|
|
728
734
|
}, {
|
|
729
|
-
default:
|
|
730
|
-
|
|
735
|
+
default: A(() => [
|
|
736
|
+
Q(N(e.title), 1)
|
|
731
737
|
]),
|
|
732
738
|
_: 1
|
|
733
739
|
}, 8, ["class"])) : E("", !0),
|
|
734
|
-
|
|
735
|
-
class:
|
|
740
|
+
x(c(le), {
|
|
741
|
+
class: h([
|
|
736
742
|
"scalar-modal-body relative max-h-[calc(100dvh-240px)] overflow-y-auto rounded-lg bg-back-1 px-6 pb-4 pt-6",
|
|
737
743
|
c(S)(
|
|
738
744
|
e.bodyClass,
|
|
@@ -741,8 +747,8 @@ const ve = ["innerHTML"], He = /* @__PURE__ */ k({
|
|
|
741
747
|
)
|
|
742
748
|
])
|
|
743
749
|
}, {
|
|
744
|
-
default:
|
|
745
|
-
|
|
750
|
+
default: A(() => [
|
|
751
|
+
T(e.$slots, "default", {}, void 0, !0)
|
|
746
752
|
]),
|
|
747
753
|
_: 3
|
|
748
754
|
}, 8, ["class"])
|
|
@@ -754,7 +760,7 @@ const ve = ["innerHTML"], He = /* @__PURE__ */ k({
|
|
|
754
760
|
_: 3
|
|
755
761
|
}, 8, ["open"]));
|
|
756
762
|
}
|
|
757
|
-
}),
|
|
763
|
+
}), Ie = /* @__PURE__ */ D(Ne, [["__scopeId", "data-v-ff85ced0"]]), Ae = { class: "scalar-input-container relative" }, Te = ["for"], xe = { class: "icon-slot cursor-pointer text-ghost hover:text-fore-1 !empty:flex !empty:w-7 !empty:items-center !empty:pr-3" }, Ce = /* @__PURE__ */ y({
|
|
758
764
|
__name: "ScalarTextField",
|
|
759
765
|
props: {
|
|
760
766
|
modelValue: {},
|
|
@@ -770,8 +776,8 @@ const ve = ["innerHTML"], He = /* @__PURE__ */ k({
|
|
|
770
776
|
disableTrim: { type: Boolean, default: !1 }
|
|
771
777
|
},
|
|
772
778
|
emits: ["submit", "update:modelValue"],
|
|
773
|
-
setup(
|
|
774
|
-
const e =
|
|
779
|
+
setup(a, { emit: t }) {
|
|
780
|
+
const e = a, i = t, g = I({
|
|
775
781
|
base: "scalar-input-wrapper relative flex items-center rounded border border-solid border-border",
|
|
776
782
|
variants: {
|
|
777
783
|
focus: {
|
|
@@ -779,81 +785,81 @@ const ve = ["innerHTML"], He = /* @__PURE__ */ k({
|
|
|
779
785
|
},
|
|
780
786
|
error: { true: "scalar-input-wrapper-error border-error" }
|
|
781
787
|
}
|
|
782
|
-
}),
|
|
783
|
-
let
|
|
788
|
+
}), b = H(), s = b.id || `id-${ce()}`, d = C(), o = C(!1);
|
|
789
|
+
let l;
|
|
784
790
|
if (e.isMultiline) {
|
|
785
|
-
const { triggerResize:
|
|
786
|
-
element:
|
|
791
|
+
const { triggerResize: n } = de({
|
|
792
|
+
element: d,
|
|
787
793
|
input: e.modelValue
|
|
788
794
|
});
|
|
789
|
-
|
|
795
|
+
l = n;
|
|
790
796
|
}
|
|
791
|
-
function
|
|
792
|
-
const
|
|
793
|
-
e.isMultiline &&
|
|
797
|
+
function u(n) {
|
|
798
|
+
const f = n.target.value;
|
|
799
|
+
e.isMultiline && l(), e.handleFieldChange ? e.handleFieldChange(f) : i("update:modelValue", f);
|
|
794
800
|
}
|
|
795
|
-
function
|
|
796
|
-
const
|
|
797
|
-
e.handleFieldSubmit ? e.handleFieldSubmit(
|
|
801
|
+
function r(n) {
|
|
802
|
+
const f = n.target, w = e.disableTrim || e.isMultiline ? f.value : f.value.trim();
|
|
803
|
+
e.handleFieldSubmit ? e.handleFieldSubmit(w) : i("submit", w);
|
|
798
804
|
}
|
|
799
|
-
function
|
|
800
|
-
o.value = !1, e.emitOnBlur && e.modelValue &&
|
|
805
|
+
function p(n) {
|
|
806
|
+
o.value = !1, e.emitOnBlur && e.modelValue && r(n);
|
|
801
807
|
}
|
|
802
808
|
return B(() => {
|
|
803
|
-
var
|
|
804
|
-
Object.prototype.hasOwnProperty.call(
|
|
805
|
-
}), (
|
|
806
|
-
|
|
807
|
-
class:
|
|
809
|
+
var n;
|
|
810
|
+
Object.prototype.hasOwnProperty.call(b, "autofocus") && ((n = d.value) == null || n.focus());
|
|
811
|
+
}), (n, f) => (m(), v("div", Ae, [
|
|
812
|
+
k("div", {
|
|
813
|
+
class: h(c(g)({ error: n.error, focus: o.value }))
|
|
808
814
|
}, [
|
|
809
|
-
(
|
|
815
|
+
(m(), L(G(n.isMultiline ? "textarea" : "input"), M({ id: c(s) }, n.$attrs, {
|
|
810
816
|
ref_key: "input",
|
|
811
|
-
ref:
|
|
817
|
+
ref: d,
|
|
812
818
|
class: [
|
|
813
819
|
"scalar-input",
|
|
814
820
|
c(S)(
|
|
815
|
-
{ "min-h-[77px]":
|
|
821
|
+
{ "min-h-[77px]": n.isMultiline },
|
|
816
822
|
"z-10 w-full resize-none appearance-none border-0 bg-transparent p-3 text-sm text-fore-1",
|
|
817
823
|
"outline-none transition-opacity"
|
|
818
824
|
)
|
|
819
825
|
],
|
|
820
|
-
placeholder:
|
|
821
|
-
value:
|
|
822
|
-
onBlur:
|
|
823
|
-
onFocus:
|
|
824
|
-
onInput:
|
|
825
|
-
onKeyup:
|
|
826
|
+
placeholder: n.placeholder,
|
|
827
|
+
value: n.modelValue,
|
|
828
|
+
onBlur: p,
|
|
829
|
+
onFocus: f[0] || (f[0] = (w) => o.value = !0),
|
|
830
|
+
onInput: u,
|
|
831
|
+
onKeyup: ee(r, ["enter"])
|
|
826
832
|
}), null, 16, ["id", "class", "placeholder", "value"])),
|
|
827
|
-
|
|
833
|
+
n.label ? (m(), v("label", {
|
|
828
834
|
key: 0,
|
|
829
|
-
class:
|
|
835
|
+
class: h(
|
|
830
836
|
c(S)(
|
|
831
837
|
"scalar-input-label pointer-events-none absolute left-0 top-0 mx-2 my-3 px-1 text-xs",
|
|
832
838
|
"shadow-current z-10 origin-top-left rounded text-fore-3 transition-transform"
|
|
833
839
|
)
|
|
834
840
|
),
|
|
835
|
-
for: c(
|
|
841
|
+
for: c(s),
|
|
836
842
|
style: F({
|
|
837
|
-
"box-shadow": `0 0 4px 4px ${
|
|
838
|
-
"background-color":
|
|
843
|
+
"box-shadow": `0 0 4px 4px ${n.labelShadowColor}`,
|
|
844
|
+
"background-color": n.labelShadowColor
|
|
839
845
|
})
|
|
840
|
-
},
|
|
841
|
-
|
|
842
|
-
|
|
846
|
+
}, N(n.label), 15, Te)) : E("", !0),
|
|
847
|
+
k("div", xe, [
|
|
848
|
+
T(n.$slots, "default", {}, void 0, !0)
|
|
843
849
|
])
|
|
844
850
|
], 2),
|
|
845
|
-
|
|
846
|
-
class:
|
|
851
|
+
k("span", {
|
|
852
|
+
class: h(
|
|
847
853
|
c(S)(
|
|
848
854
|
"helper-text before:rounded-full mt-1.5 flex items-center text-xs text-error before:font-black",
|
|
849
855
|
"before:mr-1.5 before:block before:h-4 before:w-4 before:text-center before:text-xxs before:leading-4",
|
|
850
856
|
"before:bg-error before:text-white before:content-['!'] empty:hidden"
|
|
851
857
|
)
|
|
852
858
|
)
|
|
853
|
-
},
|
|
859
|
+
}, N(n.helperText), 3)
|
|
854
860
|
]));
|
|
855
861
|
}
|
|
856
|
-
}),
|
|
862
|
+
}), Le = /* @__PURE__ */ D(Ce, [["__scopeId", "data-v-4717ec50"]]), We = {
|
|
857
863
|
boxShadow: {
|
|
858
864
|
DEFAULT: "var(--theme-shadow-1, var(--default-theme-shadow-1))",
|
|
859
865
|
md: "var(--theme-shadow-2, var(--default-theme-shadow-2))",
|
|
@@ -885,7 +891,7 @@ const ve = ["innerHTML"], He = /* @__PURE__ */ k({
|
|
|
885
891
|
ghost: "var(--theme-color-ghost, var(--default-theme-color-ghost))",
|
|
886
892
|
transparent: "transparent"
|
|
887
893
|
}
|
|
888
|
-
},
|
|
894
|
+
}, Xe = {
|
|
889
895
|
borderRadius: {
|
|
890
896
|
DEFAULT: "var(--theme-radius, var(--default-theme-radius))",
|
|
891
897
|
md: "var(--theme-radius, var(--default-theme-radius))",
|
|
@@ -909,22 +915,22 @@ const ve = ["innerHTML"], He = /* @__PURE__ */ k({
|
|
|
909
915
|
"screen-md": "640px",
|
|
910
916
|
"screen-lg": "800px"
|
|
911
917
|
}
|
|
912
|
-
},
|
|
913
|
-
install: (
|
|
914
|
-
|
|
918
|
+
}, qe = {
|
|
919
|
+
install: (a) => {
|
|
920
|
+
a.component("ScalarButton", Se), a.component("ScalarIcon", j), a.component("ScalarIconButton", _e), a.component("ScalarLoading", U), a.component("ScalarModal", Ie), a.component("ScalarTextField", Le);
|
|
915
921
|
}
|
|
916
922
|
};
|
|
917
923
|
export {
|
|
918
|
-
|
|
919
|
-
|
|
924
|
+
Se as ScalarButton,
|
|
925
|
+
Ve as ScalarCodeBlock,
|
|
920
926
|
j as ScalarIcon,
|
|
921
|
-
|
|
927
|
+
_e as ScalarIconButton,
|
|
922
928
|
U as ScalarLoading,
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
929
|
+
Ie as ScalarModal,
|
|
930
|
+
Le as ScalarTextField,
|
|
931
|
+
qe as default,
|
|
932
|
+
Xe as extend,
|
|
933
|
+
We as theme,
|
|
934
|
+
Ue as useLoadingState,
|
|
935
|
+
je as useModal
|
|
930
936
|
};
|