@ac-design/design-system 1.0.0 → 1.0.2
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/lib/compat.css +14 -7
- package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcCodeEditor.vue.d.ts +1 -1
- package/dist/lib/components/AcCodeEditor.vue_vue_type_script_setup_true_lang.js +138 -132
- package/dist/lib/components/AcContentLayout.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcInfoTable.vue_vue_type_script_setup_true_lang.js +68 -66
- package/dist/lib/components/AcInput.vue.d.ts +1 -1
- package/dist/lib/components/AcSelect.vue.d.ts +1 -1
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcTextarea.vue.d.ts +1 -1
- package/dist/lib/composables/copyText.d.ts +6 -0
- package/dist/lib/composables/copyText.js +16 -0
- package/package.json +1 -1
package/dist/lib/compat.css
CHANGED
|
@@ -61,7 +61,6 @@ code:is([data-ac-ds], [data-ac-ds] *), kbd:is([data-ac-ds], [data-ac-ds] *), sam
|
|
|
61
61
|
--color-primary-20: hsl(var(--primary-hue) var(--primary-saturation) 20%);
|
|
62
62
|
--color-primary-30: hsl(var(--primary-hue) var(--primary-saturation) 30%);
|
|
63
63
|
--color-primary-40: hsl(var(--primary-hue) var(--primary-saturation) 40%);
|
|
64
|
-
--color-primary-60: hsl(var(--primary-hue) var(--primary-saturation) 60%);
|
|
65
64
|
--color-primary-70: hsl(var(--primary-hue) var(--primary-saturation) 70%);
|
|
66
65
|
--color-primary-80: hsl(var(--primary-hue) var(--primary-saturation) 80%);
|
|
67
66
|
--color-primary-90: hsl(var(--primary-hue) var(--primary-saturation) 90%);
|
|
@@ -1476,6 +1475,12 @@ button:is([data-ac-ds], [data-ac-ds] *), input:where([type="button"], [type="res
|
|
|
1476
1475
|
border-color: var(--color-primary) !important;
|
|
1477
1476
|
box-shadow: 0 0 0 3px var(--color-ring) !important;
|
|
1478
1477
|
}
|
|
1478
|
+
.border-\[color-mix\(in_srgb\,var\(--color-primary\)_38\%\,var\(--color-border\)\)\]:where([data-ac-ds], [data-ac-ds] *) {
|
|
1479
|
+
border-color: color-mix(in srgb,hsl(var(--primary-hue) var(--primary-saturation) var(--primary-light)) 38%,#e2e8f0) !important;
|
|
1480
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
1481
|
+
border-color: color-mix(in srgb,var(--color-primary) 38%,var(--color-border)) !important;
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1479
1484
|
.border-black\/10:where([data-ac-ds], [data-ac-ds] *) {
|
|
1480
1485
|
border-color: color-mix(in srgb, hsl(0 0% 0%) 10%, transparent) !important;
|
|
1481
1486
|
@supports (color: color-mix(in lab, red, red)) {
|
|
@@ -1530,9 +1535,6 @@ button:is([data-ac-ds], [data-ac-ds] *), input:where([type="button"], [type="res
|
|
|
1530
1535
|
.border-primary:where([data-ac-ds], [data-ac-ds] *) {
|
|
1531
1536
|
border-color: var(--color-primary) !important;
|
|
1532
1537
|
}
|
|
1533
|
-
.border-primary-70:where([data-ac-ds], [data-ac-ds] *) {
|
|
1534
|
-
border-color: var(--color-primary-70) !important;
|
|
1535
|
-
}
|
|
1536
1538
|
.border-primary-80:where([data-ac-ds], [data-ac-ds] *) {
|
|
1537
1539
|
border-color: var(--color-primary-80) !important;
|
|
1538
1540
|
}
|
|
@@ -2934,12 +2936,17 @@ button:is([data-ac-ds], [data-ac-ds] *), input:where([type="button"], [type="res
|
|
|
2934
2936
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;
|
|
2935
2937
|
}
|
|
2936
2938
|
@media (hover: hover) {
|
|
2939
|
+
.hover\:border-\[color-mix\(in_srgb\,var\(--color-primary\)_60\%\,var\(--color-border\)\)\]:hover:where([data-ac-ds], [data-ac-ds] *) {
|
|
2940
|
+
border-color: color-mix(in srgb,hsl(var(--primary-hue) var(--primary-saturation) var(--primary-light)) 60%,#e2e8f0) !important;
|
|
2941
|
+
}
|
|
2942
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
2943
|
+
.hover\:border-\[color-mix\(in_srgb\,var\(--color-primary\)_60\%\,var\(--color-border\)\)\]:hover:where([data-ac-ds], [data-ac-ds] *) {
|
|
2944
|
+
border-color: color-mix(in srgb,var(--color-primary) 60%,var(--color-border)) !important;
|
|
2945
|
+
}
|
|
2946
|
+
}
|
|
2937
2947
|
.hover\:border-border-dark:hover:where([data-ac-ds], [data-ac-ds] *) {
|
|
2938
2948
|
border-color: var(--color-border-dark) !important;
|
|
2939
2949
|
}
|
|
2940
|
-
.hover\:border-primary-60:hover:where([data-ac-ds], [data-ac-ds] *) {
|
|
2941
|
-
border-color: var(--color-primary-60) !important;
|
|
2942
|
-
}
|
|
2943
2950
|
.hover\:border-slate-60:hover:where([data-ac-ds], [data-ac-ds] *) {
|
|
2944
2951
|
border-color: var(--color-slate-60) !important;
|
|
2945
2952
|
}
|
|
@@ -33,7 +33,7 @@ var f = {
|
|
|
33
33
|
primary: {
|
|
34
34
|
solid: "bg-primary text-white border-black/15 shadow-button hover:bg-primary-hover",
|
|
35
35
|
light: "bg-primary-95 text-primary-20 border-transparent hover:bg-primary-93",
|
|
36
|
-
outlined: "bg-surface text-primary-20 border-primary-
|
|
36
|
+
outlined: "bg-surface text-primary-20 border-[color-mix(in_srgb,var(--color-primary)_38%,var(--color-border))] shadow-xs hover:bg-primary-97 hover:border-[color-mix(in_srgb,var(--color-primary)_60%,var(--color-border))]"
|
|
37
37
|
},
|
|
38
38
|
info: {
|
|
39
39
|
solid: "bg-info text-white border-black/15 shadow-button hover:bg-info-hover",
|
|
@@ -67,11 +67,11 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
67
67
|
title: string;
|
|
68
68
|
height: string;
|
|
69
69
|
maxHeight: string;
|
|
70
|
+
readonly: boolean;
|
|
70
71
|
wrap: boolean;
|
|
71
72
|
schema: object;
|
|
72
73
|
language: EditorLanguage;
|
|
73
74
|
original: string;
|
|
74
|
-
readonly: boolean;
|
|
75
75
|
validate: boolean;
|
|
76
76
|
lineNumbers: boolean;
|
|
77
77
|
placeholder: string;
|
|
@@ -1,36 +1,38 @@
|
|
|
1
|
-
import e from "./
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
1
|
+
import e from "./AcTooltip.js";
|
|
2
|
+
import { copyText as t } from "../composables/copyText.js";
|
|
3
|
+
import n from "./AcSegmentedControl.js";
|
|
4
|
+
import { editorHighlight as r, editorPhrases as i, editorTheme as a } from "../editor/theme.js";
|
|
5
|
+
import { Fragment as ee, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, defineComponent as d, mergeModels as f, nextTick as te, normalizeClass as p, normalizeStyle as ne, onBeforeUnmount as re, onMounted as ie, openBlock as m, ref as h, renderList as ae, renderSlot as oe, resolveDynamicComponent as se, shallowRef as ce, toDisplayString as g, unref as _, useId as le, useModel as ue, useSlots as de, vShow as fe, watch as v, withCtx as pe, withDirectives as me } from "vue";
|
|
6
|
+
import { Check as he, CircleAlert as ge, Copy as _e, TriangleAlert as ve } from "@lucide/vue";
|
|
7
|
+
import { closeBrackets as ye, closeBracketsKeymap as be } from "@codemirror/autocomplete";
|
|
8
|
+
import { defaultKeymap as xe, history as Se, historyKeymap as Ce, indentWithTab as we, simplifySelection as Te, temporarilySetTabFocusMode as Ee } from "@codemirror/commands";
|
|
9
|
+
import { json as De } from "@codemirror/lang-json";
|
|
10
|
+
import { yaml as Oe } from "@codemirror/lang-yaml";
|
|
11
|
+
import { StreamLanguage as ke, bracketMatching as Ae, foldGutter as je, foldKeymap as Me, indentOnInput as Ne, indentUnit as Pe } from "@codemirror/language";
|
|
12
|
+
import { shell as Fe } from "@codemirror/legacy-modes/mode/shell";
|
|
13
|
+
import { lintGutter as Ie, lintKeymap as Le, linter as Re } from "@codemirror/lint";
|
|
14
|
+
import { highlightSelectionMatches as ze, search as Be, searchKeymap as Ve } from "@codemirror/search";
|
|
13
15
|
import { Compartment as y, EditorState as b, Text as x } from "@codemirror/state";
|
|
14
|
-
import { EditorView as S, drawSelection as
|
|
16
|
+
import { EditorView as S, drawSelection as He, dropCursor as Ue, highlightActiveLine as We, highlightActiveLineGutter as Ge, keymap as Ke, lineNumbers as C, placeholder as w } from "@codemirror/view";
|
|
15
17
|
//#region src/lib/components/AcCodeEditor.vue?vue&type=script&setup=true&lang.ts
|
|
16
|
-
var
|
|
18
|
+
var qe = {
|
|
17
19
|
key: 0,
|
|
18
20
|
class: "flex min-h-11 flex-wrap items-center gap-x-3 gap-y-1.5 border-b border-border-light px-3 py-2"
|
|
19
|
-
},
|
|
21
|
+
}, Je = {
|
|
20
22
|
key: 0,
|
|
21
23
|
class: "min-w-0 truncate font-mono text-xs font-medium text-heading"
|
|
22
|
-
},
|
|
24
|
+
}, Ye = {
|
|
23
25
|
key: 1,
|
|
24
26
|
class: "rounded-4 bg-surface-sunken px-1.5 text-sm leading-5 font-medium text-muted"
|
|
25
|
-
},
|
|
27
|
+
}, Xe = {
|
|
26
28
|
key: 2,
|
|
27
29
|
class: "text-xs text-muted"
|
|
28
|
-
},
|
|
30
|
+
}, Ze = { class: "ml-auto flex min-w-0 flex-wrap items-center justify-end gap-2" }, Qe = ["aria-label"], $e = ["id"], et = {
|
|
29
31
|
class: "sr-only",
|
|
30
32
|
"aria-live": "polite"
|
|
31
|
-
},
|
|
33
|
+
}, tt = { class: "ac-scrollbar max-h-[calc(92px*var(--ac-scale))] py-1" }, nt = ["onClick"], rt = { class: "shrink-0 font-mono text-muted" }, it = { class: "min-w-0 [overflow-wrap:anywhere]" }, T = /*@__PURE__*/ d({
|
|
32
34
|
__name: "AcCodeEditor",
|
|
33
|
-
props: /*@__PURE__*/
|
|
35
|
+
props: /*@__PURE__*/ f({
|
|
34
36
|
language: { default: "yaml" },
|
|
35
37
|
original: { default: void 0 },
|
|
36
38
|
readonly: {
|
|
@@ -70,13 +72,13 @@ var We = {
|
|
|
70
72
|
view: { default: "edit" },
|
|
71
73
|
viewModifiers: {}
|
|
72
74
|
}),
|
|
73
|
-
emits: /*@__PURE__*/
|
|
75
|
+
emits: /*@__PURE__*/ f([
|
|
74
76
|
"validate",
|
|
75
77
|
"focus",
|
|
76
78
|
"blur"
|
|
77
79
|
], ["update:modelValue", "update:view"]),
|
|
78
|
-
setup(
|
|
79
|
-
let E =
|
|
80
|
+
setup(d, { expose: f, emit: T }) {
|
|
81
|
+
let E = d, D = ue(d, "modelValue"), O = ue(d, "view"), k = T, at = de(), ot, A = () => ot ??= import("@codemirror/merge"), st, ct = () => st ??= import("../editor/validate.js"), j = {
|
|
80
82
|
yaml: "YAML",
|
|
81
83
|
json: "JSON",
|
|
82
84
|
shell: "Shell",
|
|
@@ -84,16 +86,16 @@ var We = {
|
|
|
84
86
|
}, M = {
|
|
85
87
|
margin: 3,
|
|
86
88
|
minSize: 6
|
|
87
|
-
},
|
|
89
|
+
}, lt = h(), N = h(), P = ce(), F, I = h([]), L = h(0), R = h(!1), ut = le(), z = o(() => E.original !== void 0 && !E.readonly), B = o(() => E.original !== void 0 && E.readonly), V = o(() => B.value || z.value && O.value === "changes"), dt = o(() => !!E.title || E.copyable || z.value || B.value || !!at.actions), ft = o(() => E.validate && (E.language === "yaml" || E.language === "json")), H = o(() => E.label || E.title || `${j[E.language]} editor`), pt = o(() => I.value.filter((e) => e.severity === "error").length), mt = o(() => [{
|
|
88
90
|
value: "edit",
|
|
89
91
|
label: "Edit"
|
|
90
92
|
}, {
|
|
91
93
|
value: "changes",
|
|
92
94
|
label: L.value ? `Changes · ${L.value}` : "Changes"
|
|
93
|
-
}]),
|
|
95
|
+
}]), U = o(() => ({
|
|
94
96
|
height: E.height === "auto" ? void 0 : E.height,
|
|
95
97
|
maxHeight: E.maxHeight
|
|
96
|
-
})),
|
|
98
|
+
})), W = {
|
|
97
99
|
language: new y(),
|
|
98
100
|
readonly: new y(),
|
|
99
101
|
wrap: new y(),
|
|
@@ -102,82 +104,82 @@ var We = {
|
|
|
102
104
|
placeholder: new y(),
|
|
103
105
|
attributes: new y()
|
|
104
106
|
};
|
|
105
|
-
function W() {
|
|
106
|
-
return E.language === "yaml" ? Te() : E.language === "json" ? we() : E.language === "shell" ? Ee.define(Me) : [];
|
|
107
|
-
}
|
|
108
107
|
function G() {
|
|
108
|
+
return E.language === "yaml" ? Oe() : E.language === "json" ? De() : E.language === "shell" ? ke.define(Fe) : [];
|
|
109
|
+
}
|
|
110
|
+
function ht() {
|
|
109
111
|
return E.lineNumbers ? [
|
|
110
112
|
C(),
|
|
111
|
-
|
|
113
|
+
je({
|
|
112
114
|
openText: "▾",
|
|
113
115
|
closedText: "▸"
|
|
114
116
|
}),
|
|
115
|
-
|
|
117
|
+
Ge()
|
|
116
118
|
] : [];
|
|
117
119
|
}
|
|
118
|
-
function
|
|
120
|
+
function gt(e) {
|
|
119
121
|
JSON.stringify(e) !== JSON.stringify(I.value) && (I.value = e, k("validate", e));
|
|
120
122
|
}
|
|
121
|
-
function
|
|
122
|
-
return
|
|
123
|
-
let t = e.state.doc.toString(), { checkDocument: n, toProblems: r } = await
|
|
124
|
-
return P.value?.state.doc.toString() === t &&
|
|
125
|
-
}, { delay: 300 })] : (
|
|
123
|
+
function _t() {
|
|
124
|
+
return ft.value ? [Ie(), Re(async (e) => {
|
|
125
|
+
let t = e.state.doc.toString(), { checkDocument: n, toProblems: r } = await ct(), i = await n(t, E.language, E.schema);
|
|
126
|
+
return P.value?.state.doc.toString() === t && gt(r(i, e.state.doc)), i;
|
|
127
|
+
}, { delay: 300 })] : (gt([]), []);
|
|
126
128
|
}
|
|
127
|
-
function
|
|
129
|
+
function vt() {
|
|
128
130
|
return S.contentAttributes.of({
|
|
129
131
|
"aria-label": H.value,
|
|
130
132
|
...E.readonly ? { "aria-readonly": "true" } : {},
|
|
131
|
-
...
|
|
133
|
+
...pt.value ? {
|
|
132
134
|
"aria-invalid": "true",
|
|
133
|
-
"aria-describedby":
|
|
135
|
+
"aria-describedby": ut
|
|
134
136
|
} : {}
|
|
135
137
|
});
|
|
136
138
|
}
|
|
137
|
-
let K = 0,
|
|
139
|
+
let K = 0, yt = {
|
|
138
140
|
key: "Escape",
|
|
139
141
|
run: (e) => {
|
|
140
142
|
let t = Date.now();
|
|
141
|
-
return t - K < 2e3 ? !1 : (K = t,
|
|
143
|
+
return t - K < 2e3 ? !1 : (K = t, Te(e), Ee(e));
|
|
142
144
|
}
|
|
143
145
|
};
|
|
144
|
-
function
|
|
146
|
+
function bt() {
|
|
145
147
|
P.value = new S({
|
|
146
|
-
parent:
|
|
148
|
+
parent: lt.value,
|
|
147
149
|
state: b.create({
|
|
148
150
|
doc: D.value,
|
|
149
151
|
extensions: [
|
|
152
|
+
a,
|
|
150
153
|
r,
|
|
151
|
-
|
|
152
|
-
|
|
154
|
+
i,
|
|
155
|
+
Se(),
|
|
156
|
+
He(),
|
|
157
|
+
Ue(),
|
|
158
|
+
Ne(),
|
|
159
|
+
Pe.of(" "),
|
|
160
|
+
b.tabSize.of(2),
|
|
161
|
+
Ae(),
|
|
153
162
|
ye(),
|
|
163
|
+
We(),
|
|
154
164
|
ze(),
|
|
155
|
-
Be(),
|
|
156
|
-
|
|
157
|
-
je.of(" "),
|
|
158
|
-
b.tabSize.of(2),
|
|
159
|
-
De(),
|
|
160
|
-
ge(),
|
|
161
|
-
Ve(),
|
|
162
|
-
Ie(),
|
|
163
|
-
Le({ top: !0 }),
|
|
164
|
-
Ue.of([
|
|
165
|
-
..._e,
|
|
166
|
-
...Re,
|
|
167
|
-
...ke,
|
|
168
|
-
...Pe,
|
|
169
|
-
gt,
|
|
170
|
-
xe,
|
|
165
|
+
Be({ top: !0 }),
|
|
166
|
+
Ke.of([
|
|
171
167
|
...be,
|
|
172
|
-
...
|
|
168
|
+
...Ve,
|
|
169
|
+
...Me,
|
|
170
|
+
...Le,
|
|
171
|
+
yt,
|
|
172
|
+
we,
|
|
173
|
+
...Ce,
|
|
174
|
+
...xe
|
|
173
175
|
]),
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
176
|
+
W.language.of(G()),
|
|
177
|
+
W.readonly.of(b.readOnly.of(E.readonly)),
|
|
178
|
+
W.wrap.of(E.wrap ? S.lineWrapping : []),
|
|
179
|
+
W.gutters.of(ht()),
|
|
180
|
+
W.lint.of(_t()),
|
|
181
|
+
W.placeholder.of(E.placeholder ? w(E.placeholder) : []),
|
|
182
|
+
W.attributes.of(vt()),
|
|
181
183
|
S.updateListener.of((e) => {
|
|
182
184
|
e.docChanged && (D.value = e.state.doc.toString()), e.focusChanged && e.view.hasFocus ? k("focus") : e.focusChanged && k("blur");
|
|
183
185
|
})
|
|
@@ -190,9 +192,9 @@ var We = {
|
|
|
190
192
|
}
|
|
191
193
|
function J(e) {
|
|
192
194
|
return [
|
|
195
|
+
a,
|
|
193
196
|
r,
|
|
194
|
-
|
|
195
|
-
W(),
|
|
197
|
+
G(),
|
|
196
198
|
b.readOnly.of(!0),
|
|
197
199
|
b.tabSize.of(2),
|
|
198
200
|
E.wrap ? S.lineWrapping : [],
|
|
@@ -242,7 +244,7 @@ var We = {
|
|
|
242
244
|
});
|
|
243
245
|
}
|
|
244
246
|
let Q;
|
|
245
|
-
function
|
|
247
|
+
function xt() {
|
|
246
248
|
if (clearTimeout(Q), E.original === void 0) {
|
|
247
249
|
L.value = 0;
|
|
248
250
|
return;
|
|
@@ -252,10 +254,10 @@ var We = {
|
|
|
252
254
|
E.original !== void 0 && (L.value = e.build(x.of(E.original.split("\n")), x.of(D.value.split("\n"))).length);
|
|
253
255
|
}, 250);
|
|
254
256
|
}
|
|
255
|
-
function
|
|
257
|
+
function St() {
|
|
256
258
|
P.value?.focus();
|
|
257
259
|
}
|
|
258
|
-
function
|
|
260
|
+
function Ct(e) {
|
|
259
261
|
let t = P.value;
|
|
260
262
|
t && (t.dispatch({
|
|
261
263
|
selection: {
|
|
@@ -266,9 +268,9 @@ var We = {
|
|
|
266
268
|
}), t.focus());
|
|
267
269
|
}
|
|
268
270
|
let $;
|
|
269
|
-
async function
|
|
271
|
+
async function wt() {
|
|
270
272
|
try {
|
|
271
|
-
await
|
|
273
|
+
await t(D.value), R.value = !0, clearTimeout($), $ = setTimeout(() => R.value = !1, 1500);
|
|
272
274
|
} catch {}
|
|
273
275
|
}
|
|
274
276
|
return v(D, (e) => {
|
|
@@ -278,15 +280,15 @@ var We = {
|
|
|
278
280
|
to: t.state.doc.length,
|
|
279
281
|
insert: e
|
|
280
282
|
} });
|
|
281
|
-
}), v(() => E.language, () => q(
|
|
283
|
+
}), v(() => E.language, () => q(W.language, G())), v(() => E.readonly, (e) => q(W.readonly, b.readOnly.of(e))), v(() => E.wrap, (e) => q(W.wrap, e ? S.lineWrapping : [])), v(() => E.lineNumbers, () => q(W.gutters, ht())), v(() => E.placeholder, (e) => q(W.placeholder, e ? w(e) : [])), v([
|
|
282
284
|
() => E.language,
|
|
283
285
|
() => E.schema,
|
|
284
286
|
() => E.validate
|
|
285
|
-
], () => q(
|
|
287
|
+
], () => q(W.lint, _t())), v([
|
|
286
288
|
H,
|
|
287
289
|
() => E.readonly,
|
|
288
|
-
|
|
289
|
-
], () => q(
|
|
290
|
+
pt
|
|
291
|
+
], () => q(W.attributes, vt())), v([() => E.original, D], xt, { immediate: !0 }), v([
|
|
290
292
|
V,
|
|
291
293
|
() => E.diffLayout,
|
|
292
294
|
() => E.original,
|
|
@@ -294,80 +296,84 @@ var We = {
|
|
|
294
296
|
() => E.wrap
|
|
295
297
|
], async ([e]) => {
|
|
296
298
|
if (!e) return Y();
|
|
297
|
-
await
|
|
298
|
-
}), v(D, () => V.value && Z()),
|
|
299
|
-
|
|
300
|
-
}),
|
|
299
|
+
await te(), Z();
|
|
300
|
+
}), v(D, () => V.value && Z()), ie(() => {
|
|
301
|
+
bt(), V.value && Z();
|
|
302
|
+
}), re(() => {
|
|
301
303
|
clearTimeout(Q), clearTimeout($), Y(), P.value?.destroy();
|
|
302
|
-
}),
|
|
303
|
-
focus:
|
|
304
|
+
}), f({
|
|
305
|
+
focus: St,
|
|
304
306
|
editor: P
|
|
305
|
-
}), (t,
|
|
306
|
-
class:
|
|
307
|
+
}), (t, r) => (m(), l("div", {
|
|
308
|
+
class: p(["flex min-w-0 flex-col overflow-hidden bg-surface", d.bordered && "rounded-10 border border-border shadow-xs transition-[border-color,box-shadow] has-[.cm-editor.cm-focused]:focus-ring"]),
|
|
307
309
|
"data-ac-ds": "",
|
|
308
310
|
"data-testid": "ac-code-editor"
|
|
309
311
|
}, [
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
B.value ? (m(),
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
z.value ? (m(),
|
|
312
|
+
dt.value ? (m(), l("div", qe, [
|
|
313
|
+
d.title ? (m(), l("span", Je, g(d.title), 1)) : c("", !0),
|
|
314
|
+
d.language === "text" ? c("", !0) : (m(), l("span", Ye, g(j[d.language]), 1)),
|
|
315
|
+
B.value ? (m(), l("span", Xe, g(L.value ? `${L.value} ${L.value === 1 ? "change" : "changes"}` : "No changes"), 1)) : c("", !0),
|
|
316
|
+
u("div", Ze, [
|
|
317
|
+
oe(t.$slots, "actions"),
|
|
318
|
+
z.value ? (m(), s(n, {
|
|
317
319
|
key: 0,
|
|
318
320
|
modelValue: O.value,
|
|
319
|
-
"onUpdate:modelValue":
|
|
320
|
-
options:
|
|
321
|
+
"onUpdate:modelValue": r[0] ||= (e) => O.value = e,
|
|
322
|
+
options: mt.value,
|
|
321
323
|
size: "small",
|
|
322
324
|
label: "Editor view"
|
|
323
|
-
}, null, 8, ["modelValue", "options"])) :
|
|
324
|
-
|
|
325
|
-
key: 1,
|
|
326
|
-
type: "button",
|
|
327
|
-
class: "inline-flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-6 text-muted transition hover:bg-surface-sunken hover:text-heading focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring",
|
|
328
|
-
"aria-label": R.value ? "Copied" : "Copy to clipboard",
|
|
329
|
-
title: R.value ? "Copied" : "Copy",
|
|
330
|
-
onClick: xt
|
|
331
|
-
}, [R.value ? (m(), o(_(fe), {
|
|
332
|
-
key: 0,
|
|
333
|
-
class: "size-3.5 text-success",
|
|
334
|
-
"aria-hidden": "true"
|
|
335
|
-
})) : (m(), o(_(me), {
|
|
325
|
+
}, null, 8, ["modelValue", "options"])) : c("", !0),
|
|
326
|
+
d.copyable ? (m(), s(e, {
|
|
336
327
|
key: 1,
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
328
|
+
content: R.value ? "Copied" : "Copy"
|
|
329
|
+
}, {
|
|
330
|
+
default: pe(() => [u("button", {
|
|
331
|
+
type: "button",
|
|
332
|
+
class: "inline-flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-6 text-muted transition hover:bg-surface-sunken hover:text-heading focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring",
|
|
333
|
+
"aria-label": R.value ? "Copied" : "Copy to clipboard",
|
|
334
|
+
onClick: wt
|
|
335
|
+
}, [R.value ? (m(), s(_(he), {
|
|
336
|
+
key: 0,
|
|
337
|
+
class: "size-3.5 text-success",
|
|
338
|
+
"aria-hidden": "true"
|
|
339
|
+
})) : (m(), s(_(_e), {
|
|
340
|
+
key: 1,
|
|
341
|
+
class: "size-3.5",
|
|
342
|
+
"aria-hidden": "true"
|
|
343
|
+
}))], 8, Qe)]),
|
|
344
|
+
_: 1
|
|
345
|
+
}, 8, ["content"])) : c("", !0)
|
|
340
346
|
])
|
|
341
|
-
])) :
|
|
342
|
-
|
|
347
|
+
])) : c("", !0),
|
|
348
|
+
me(u("div", {
|
|
343
349
|
ref_key: "host",
|
|
344
|
-
ref:
|
|
345
|
-
class:
|
|
346
|
-
style:
|
|
347
|
-
}, null, 6), [[
|
|
348
|
-
V.value ? (m(),
|
|
350
|
+
ref: lt,
|
|
351
|
+
class: p(["min-h-0 flex-auto [&>.cm-editor]:max-h-[inherit]", d.height === "auto" && "min-h-20"]),
|
|
352
|
+
style: ne(U.value)
|
|
353
|
+
}, null, 6), [[fe, !V.value]]),
|
|
354
|
+
V.value ? (m(), l("div", {
|
|
349
355
|
key: 1,
|
|
350
356
|
ref_key: "diffHost",
|
|
351
357
|
ref: N,
|
|
352
358
|
class: "min-h-0 flex-auto overflow-auto [&_.cm-mergeView]:h-full [&>.cm-editor]:max-h-[inherit]",
|
|
353
|
-
style:
|
|
354
|
-
}, null, 4)) :
|
|
355
|
-
I.value.length && !V.value ? (m(),
|
|
359
|
+
style: ne(U.value)
|
|
360
|
+
}, null, 4)) : c("", !0),
|
|
361
|
+
I.value.length && !V.value ? (m(), l("div", {
|
|
356
362
|
key: 2,
|
|
357
|
-
id: _(
|
|
363
|
+
id: _(ut),
|
|
358
364
|
class: "border-t border-border-light bg-surface-muted"
|
|
359
|
-
}, [
|
|
365
|
+
}, [u("p", et, g(I.value.length) + " " + g(I.value.length === 1 ? "problem" : "problems"), 1), u("ul", tt, [(m(!0), l(ee, null, ae(I.value, (e, t) => (m(), l("li", { key: t }, [u("button", {
|
|
360
366
|
type: "button",
|
|
361
367
|
class: "flex w-full cursor-pointer items-start gap-2 px-3 py-1 text-left text-xs leading-5 text-body hover:bg-surface-sunken focus-visible:bg-surface-sunken focus-visible:outline-none",
|
|
362
|
-
onClick: (t) =>
|
|
368
|
+
onClick: (t) => Ct(e)
|
|
363
369
|
}, [
|
|
364
|
-
(m(),
|
|
365
|
-
class:
|
|
370
|
+
(m(), s(se(e.severity === "error" ? _(ge) : _(ve)), {
|
|
371
|
+
class: p(["mt-0.75 size-3.5 shrink-0", e.severity === "error" ? "text-red-50" : "text-yellow-50"]),
|
|
366
372
|
"aria-hidden": "true"
|
|
367
373
|
}, null, 8, ["class"])),
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
], 8,
|
|
374
|
+
u("span", rt, "Ln " + g(e.line) + ", Col " + g(e.column), 1),
|
|
375
|
+
u("span", it, g(e.message), 1)
|
|
376
|
+
], 8, nt)]))), 128))])], 8, $e)) : c("", !0)
|
|
371
377
|
], 2));
|
|
372
378
|
}
|
|
373
379
|
});
|
|
@@ -11,7 +11,7 @@ var o = /*@__PURE__*/ n({
|
|
|
11
11
|
class: r(n.surface && "rounded-10 border border-border bg-surface shadow-xs"),
|
|
12
12
|
"data-ac-ds": "",
|
|
13
13
|
"data-testid": "ac-content-layout"
|
|
14
|
-
}, [a(o.$slots, "header"), t("div",
|
|
14
|
+
}, [a(o.$slots, "header"), t("div", { class: r(n.surface && ["overflow-hidden rounded-b-10", !o.$slots.header && "rounded-t-10"]) }, [a(o.$slots, "default")], 2)], 2));
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
//#endregion
|
|
@@ -1,27 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import e from "./AcTooltip.js";
|
|
2
|
+
import { copyText as t } from "../composables/copyText.js";
|
|
3
|
+
import { Fragment as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, defineComponent as l, normalizeClass as u, onBeforeUnmount as d, openBlock as f, ref as p, renderList as m, renderSlot as h, resolveDynamicComponent as g, toDisplayString as _, unref as v, withCtx as y } from "vue";
|
|
4
|
+
import { Check as b, Copy as x, Eye as S, EyeOff as C } from "@lucide/vue";
|
|
3
5
|
//#region src/lib/components/AcInfoTable.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var
|
|
6
|
+
var w = {
|
|
5
7
|
key: 0,
|
|
6
8
|
class: "text-lg leading-6 font-semibold tracking-[-0.01em] text-heading"
|
|
7
|
-
},
|
|
9
|
+
}, T = {
|
|
8
10
|
key: 1,
|
|
9
11
|
class: "ml-auto flex shrink-0 items-center gap-2"
|
|
10
|
-
},
|
|
12
|
+
}, E = ["aria-busy"], D = { class: "flex h-5 items-center" }, O = { class: "flex min-w-0 flex-1 flex-wrap items-center gap-x-2 gap-y-1 text-base text-heading" }, k = {
|
|
11
13
|
key: 0,
|
|
12
14
|
class: "text-muted"
|
|
13
|
-
},
|
|
15
|
+
}, A = {
|
|
14
16
|
key: 1,
|
|
15
17
|
class: "flex min-w-0 items-start gap-1.5"
|
|
16
|
-
},
|
|
18
|
+
}, j = [
|
|
17
19
|
"aria-label",
|
|
18
20
|
"aria-pressed",
|
|
19
21
|
"onClick"
|
|
20
|
-
],
|
|
21
|
-
"aria-label",
|
|
22
|
-
"title",
|
|
23
|
-
"onClick"
|
|
24
|
-
], A = /*@__PURE__*/ s({
|
|
22
|
+
], M = ["aria-label", "onClick"], N = /*@__PURE__*/ l({
|
|
25
23
|
__name: "AcInfoTable",
|
|
26
24
|
props: {
|
|
27
25
|
items: { default: () => [] },
|
|
@@ -38,88 +36,92 @@ var x = {
|
|
|
38
36
|
},
|
|
39
37
|
emptyText: { default: "No details available" }
|
|
40
38
|
},
|
|
41
|
-
setup(
|
|
42
|
-
let
|
|
39
|
+
setup(l) {
|
|
40
|
+
let N = l, P = [
|
|
43
41
|
"w-40",
|
|
44
42
|
"w-28",
|
|
45
43
|
"w-52",
|
|
46
44
|
"w-32",
|
|
47
45
|
"w-44",
|
|
48
46
|
"w-24"
|
|
49
|
-
],
|
|
47
|
+
], F = p(null), I = p(/* @__PURE__ */ new Set()), L, R = r(() => N.items.map((e) => ({
|
|
50
48
|
item: e,
|
|
51
49
|
key: e.key ?? e.label
|
|
52
|
-
}))),
|
|
50
|
+
}))), z = r(() => [
|
|
53
51
|
"min-w-0 border-t border-border-light py-2.5 first:border-t-0",
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
]),
|
|
57
|
-
function
|
|
52
|
+
N.columns === 2 && "md:[&:nth-child(2)]:border-t-0",
|
|
53
|
+
N.layout === "horizontal" ? "flex flex-col gap-0.5 sm:flex-row sm:items-baseline sm:gap-4" : "flex flex-col gap-1"
|
|
54
|
+
]), B = r(() => ["flex items-center gap-1.5 text-base text-muted", N.layout === "horizontal" && (N.columns === 2 ? "sm:w-36 sm:shrink-0" : "sm:w-48 sm:shrink-0")]);
|
|
55
|
+
function V(e) {
|
|
58
56
|
return e == null || e === "";
|
|
59
57
|
}
|
|
60
|
-
function
|
|
61
|
-
let t = new Set(
|
|
62
|
-
t.delete(e) || t.add(e),
|
|
58
|
+
function H(e) {
|
|
59
|
+
let t = new Set(I.value);
|
|
60
|
+
t.delete(e) || t.add(e), I.value = t;
|
|
63
61
|
}
|
|
64
|
-
async function
|
|
62
|
+
async function U(e, n) {
|
|
65
63
|
try {
|
|
66
|
-
await
|
|
64
|
+
await t(String(n ?? "")), F.value = e, clearTimeout(L), L = setTimeout(() => F.value = null, 1500);
|
|
67
65
|
} catch {}
|
|
68
66
|
}
|
|
69
|
-
return
|
|
70
|
-
class:
|
|
67
|
+
return d(() => clearTimeout(L)), (t, r) => (f(), o("div", {
|
|
68
|
+
class: u(l.bordered && "rounded-10 border border-border bg-surface shadow-xs"),
|
|
71
69
|
"data-ac-ds": "",
|
|
72
70
|
"data-testid": "ac-info-table"
|
|
73
|
-
}, [
|
|
71
|
+
}, [l.title || t.$slots.actions ? (f(), o("div", {
|
|
74
72
|
key: 0,
|
|
75
|
-
class:
|
|
76
|
-
}, [
|
|
73
|
+
class: u(["flex items-center justify-between gap-4", l.bordered ? "border-b border-border-light px-5 py-3.5" : "mb-2"])
|
|
74
|
+
}, [l.title ? (f(), o("h3", w, _(l.title), 1)) : a("", !0), t.$slots.actions ? (f(), o("div", T, [h(t.$slots, "actions")])) : a("", !0)], 2)) : a("", !0), !l.loading && !l.items.length ? (f(), o("p", {
|
|
77
75
|
key: 1,
|
|
78
|
-
class:
|
|
79
|
-
},
|
|
76
|
+
class: u(["py-6 text-center text-base text-muted", l.bordered && "px-5"])
|
|
77
|
+
}, _(l.emptyText), 3)) : (f(), o("dl", {
|
|
80
78
|
key: 2,
|
|
81
|
-
class:
|
|
82
|
-
"aria-busy":
|
|
83
|
-
}, [
|
|
79
|
+
class: u(["grid", [l.columns === 2 && "md:grid-cols-2 md:gap-x-10", l.bordered ? "px-5 py-2" : ""]]),
|
|
80
|
+
"aria-busy": l.loading || void 0
|
|
81
|
+
}, [l.loading && !l.items.length ? (f(), o(n, { key: 0 }, m(P, (e, t) => s("div", {
|
|
84
82
|
key: t,
|
|
85
|
-
class:
|
|
86
|
-
}, [
|
|
87
|
-
key:
|
|
88
|
-
class:
|
|
89
|
-
}, [
|
|
83
|
+
class: u(z.value)
|
|
84
|
+
}, [s("dt", { class: u(B.value) }, [...r[0] ||= [s("span", { class: "h-3 w-20 animate-pulse rounded-4 bg-surface-sunken" }, null, -1)]], 2), s("dd", D, [s("span", { class: u(["h-3 animate-pulse rounded-4 bg-surface-sunken", e]) }, null, 2)])], 2)), 64)) : a("", !0), (f(!0), o(n, null, m(R.value, ({ item: n, key: r }, d) => (f(), o("div", {
|
|
85
|
+
key: r,
|
|
86
|
+
class: u(z.value)
|
|
87
|
+
}, [s("dt", { class: u(B.value) }, [h(t.$slots, `label-${r}`, { item: n }, () => [c(_(n.label), 1)])], 2), s("dd", O, [l.loading ? (f(), o("span", {
|
|
90
88
|
key: 0,
|
|
91
|
-
class:
|
|
92
|
-
}, null, 2)) :
|
|
93
|
-
|
|
94
|
-
|
|
89
|
+
class: u(["h-3 animate-pulse rounded-4 bg-surface-sunken", P[d % P.length]])
|
|
90
|
+
}, null, 2)) : h(t.$slots, `value-${r}`, { item: n }, () => [V(n.value) ? (f(), o("span", k, "—")) : (f(), o("span", A, [
|
|
91
|
+
s("span", { class: u(["min-w-0 [overflow-wrap:anywhere]", (n.mono || n.secret) && "font-mono text-xs leading-5"]) }, _(n.secret && !I.value.has(r) ? "••••••••••••" : n.value), 3),
|
|
92
|
+
n.secret ? (f(), o("button", {
|
|
95
93
|
key: 0,
|
|
96
94
|
type: "button",
|
|
97
95
|
class: "-my-0.5 inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-4 text-muted transition hover:bg-surface-sunken hover:text-heading focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring",
|
|
98
|
-
"aria-label":
|
|
99
|
-
"aria-pressed":
|
|
100
|
-
onClick: (e) =>
|
|
101
|
-
}, [(
|
|
96
|
+
"aria-label": I.value.has(r) ? `Hide ${n.label}` : `Show ${n.label}`,
|
|
97
|
+
"aria-pressed": I.value.has(r),
|
|
98
|
+
onClick: (e) => H(r)
|
|
99
|
+
}, [(f(), i(g(I.value.has(r) ? v(C) : v(S)), {
|
|
102
100
|
class: "size-3.5",
|
|
103
101
|
"aria-hidden": "true"
|
|
104
|
-
}))], 8,
|
|
105
|
-
|
|
102
|
+
}))], 8, j)) : a("", !0),
|
|
103
|
+
n.copyable ? (f(), i(e, {
|
|
106
104
|
key: 1,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
105
|
+
content: F.value === r ? "Copied" : "Copy"
|
|
106
|
+
}, {
|
|
107
|
+
default: y(() => [s("button", {
|
|
108
|
+
type: "button",
|
|
109
|
+
class: "-my-0.5 inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-4 text-muted transition hover:bg-surface-sunken hover:text-heading focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring",
|
|
110
|
+
"aria-label": F.value === r ? `${n.label} copied` : `Copy ${n.label}`,
|
|
111
|
+
onClick: (e) => U(r, n.value)
|
|
112
|
+
}, [F.value === r ? (f(), i(v(b), {
|
|
113
|
+
key: 0,
|
|
114
|
+
class: "size-3.5 text-success",
|
|
115
|
+
"aria-hidden": "true"
|
|
116
|
+
})) : (f(), i(v(x), {
|
|
117
|
+
key: 1,
|
|
118
|
+
class: "size-3.5",
|
|
119
|
+
"aria-hidden": "true"
|
|
120
|
+
}))], 8, M)]),
|
|
121
|
+
_: 2
|
|
122
|
+
}, 1032, ["content"])) : a("", !0)
|
|
123
|
+
]))], void 0, 1)])], 2))), 128))], 10, E))], 2));
|
|
122
124
|
}
|
|
123
125
|
});
|
|
124
126
|
//#endregion
|
|
125
|
-
export {
|
|
127
|
+
export { N as default };
|
|
@@ -51,8 +51,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
51
51
|
disabled: boolean;
|
|
52
52
|
name: string;
|
|
53
53
|
size: "small" | "normal";
|
|
54
|
-
hint: string;
|
|
55
54
|
readonly: boolean;
|
|
55
|
+
hint: string;
|
|
56
56
|
errorMsg: string;
|
|
57
57
|
addonLabel: string;
|
|
58
58
|
addonIcon: Component;
|
|
@@ -3,7 +3,7 @@ export interface Props<T> {
|
|
|
3
3
|
/** The choices: `{ value, label, description?, disabled?, group? }`. */
|
|
4
4
|
options: SelectOption<T>[];
|
|
5
5
|
/** How to tell whether two values are the same, for option values that are objects. A property name (`"id"`) or a function `(a, b) => boolean`. Without it values are compared with `===`, which is right for strings and numbers. */
|
|
6
|
-
by?:
|
|
6
|
+
by?: string | ((a: T, b: T) => boolean);
|
|
7
7
|
/** Floating label. It rests inside the field and rises when a value is chosen or the list opens. */
|
|
8
8
|
label?: string;
|
|
9
9
|
/** Text shown in the field when there's no label and nothing is selected. */
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copies text to the clipboard. Uses the async Clipboard API, which browsers only expose on
|
|
3
|
+
* HTTPS and localhost, and falls back to a hidden textarea + `execCommand("copy")` so copying
|
|
4
|
+
* still works on plain-HTTP hosts such as `http://bb.test`. Throws when both are blocked.
|
|
5
|
+
*/
|
|
6
|
+
export declare function copyText(text: string): Promise<void>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/lib/composables/copyText.ts
|
|
2
|
+
async function e(e) {
|
|
3
|
+
if (navigator.clipboard?.writeText) {
|
|
4
|
+
await navigator.clipboard.writeText(e);
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
let t = document.createElement("textarea");
|
|
8
|
+
t.value = e, t.setAttribute("readonly", ""), t.style.cssText = "position:fixed;top:0;left:0;opacity:0", document.body.appendChild(t), t.select();
|
|
9
|
+
try {
|
|
10
|
+
if (!document.execCommand("copy")) throw Error("copy command was rejected");
|
|
11
|
+
} finally {
|
|
12
|
+
t.remove();
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { e as copyText };
|