@ac-design/design-system 2.3.0 → 2.4.1
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 +211 -6
- package/dist/lib/components/AcAppSwitcher.vue.d.ts +1 -1
- package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +23 -23
- package/dist/lib/components/AcAreaChart.vue.d.ts +1 -1
- package/dist/lib/components/AcBarChart.vue.d.ts +1 -1
- package/dist/lib/components/AcButton.vue.d.ts +7 -1
- package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +90 -69
- package/dist/lib/components/AcCellValue.vue.d.ts +3 -3
- package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +20 -20
- package/dist/lib/components/AcCheckBox.vue.d.ts +4 -1
- package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +50 -50
- package/dist/lib/components/AcCircularProgress.vue.d.ts +1 -1
- package/dist/lib/components/AcCodeEditor.vue.d.ts +12 -0
- package/dist/lib/components/AcCodeEditor.vue_vue_type_script_setup_true_lang.js +240 -207
- package/dist/lib/components/AcColorInput.vue.d.ts +3 -3
- package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +72 -66
- package/dist/lib/components/AcCostSummary.vue.d.ts +1 -1
- package/dist/lib/components/AcDatePicker.vue.d.ts +14 -7
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +417 -372
- package/dist/lib/components/AcDeleteModal.vue.d.ts +1 -1
- package/dist/lib/components/AcDonutChart.vue.d.ts +2 -2
- package/dist/lib/components/AcDropdown.vue.d.ts +1 -1
- package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/lib/components/AcDropdownItem.vue_vue_type_script_setup_true_lang.js +27 -30
- package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/lib/components/AcGraphChart.vue.d.ts +2 -2
- package/dist/lib/components/AcInput.vue.d.ts +75 -54
- package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +253 -89
- package/dist/lib/components/AcKeyValueInput.vue.d.ts +34 -54
- package/dist/lib/components/AcKeyValueInput.vue_vue_type_script_setup_true_lang.js +134 -106
- package/dist/lib/components/AcLineChart.vue.d.ts +1 -1
- package/dist/lib/components/AcMapChart.vue.d.ts +2 -2
- package/dist/lib/components/AcModal.vue.d.ts +2 -2
- package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/lib/components/AcNotificationMenu.vue.d.ts +1 -1
- package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +24 -24
- package/dist/lib/components/AcNumberInput.vue.d.ts +55 -45
- package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +159 -99
- package/dist/lib/components/AcRadioCard.vue.d.ts +2 -2
- package/dist/lib/components/AcRadioCard.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcSelect.vue.d.ts +35 -6
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +272 -176
- package/dist/lib/components/AcSidePanel.vue.d.ts +1 -1
- package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcSlider.vue.d.ts +2 -2
- package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +23 -23
- package/dist/lib/components/AcTable.vue.d.ts +37 -4
- package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +239 -131
- package/dist/lib/components/AcTagInput.vue.d.ts +22 -3
- package/dist/lib/components/AcTagInput.vue_vue_type_script_setup_true_lang.js +126 -114
- package/dist/lib/components/AcTaintInput.js +5 -0
- package/dist/lib/components/AcTaintInput.vue.d.ts +44 -0
- package/dist/lib/components/AcTaintInput.vue_vue_type_script_setup_true_lang.js +208 -0
- package/dist/lib/components/AcTextarea.vue.d.ts +38 -4
- package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +113 -53
- package/dist/lib/components/AcTimePicker.vue.d.ts +15 -8
- package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +102 -70
- package/dist/lib/components/AcTooltip.vue.d.ts +3 -3
- package/dist/lib/components/index.d.ts +1 -0
- package/dist/lib/composables/useToast.d.ts +2 -2
- package/dist/lib/index.d.ts +2 -1
- package/dist/lib/index.js +31 -30
- package/package.json +1 -1
|
@@ -2,35 +2,39 @@ import e from "./AcTooltip.js";
|
|
|
2
2
|
import { copyText as t } from "../composables/copyText.js";
|
|
3
3
|
import n from "./AcSegmentedControl.js";
|
|
4
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
|
|
6
|
-
import { Check as
|
|
7
|
-
import { closeBrackets as
|
|
8
|
-
import { defaultKeymap as
|
|
9
|
-
import { json as
|
|
10
|
-
import { yaml as
|
|
11
|
-
import { StreamLanguage as
|
|
12
|
-
import { shell as
|
|
13
|
-
import { lintGutter as
|
|
14
|
-
import { highlightSelectionMatches as
|
|
15
|
-
import { Compartment as
|
|
16
|
-
import { EditorView as
|
|
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 m, onBeforeUnmount as ne, onMounted as re, openBlock as h, ref as g, renderList as ie, renderSlot as ae, resolveDynamicComponent as oe, shallowRef as se, toDisplayString as _, unref as v, useId as ce, useModel as y, useSlots as le, vShow as ue, watch as b, withCtx as de, withDirectives as fe } from "vue";
|
|
6
|
+
import { Check as pe, CircleAlert as me, Copy as he, TriangleAlert as ge } from "@lucide/vue";
|
|
7
|
+
import { closeBrackets as _e, closeBracketsKeymap as ve } from "@codemirror/autocomplete";
|
|
8
|
+
import { defaultKeymap as ye, history as be, historyKeymap as xe, indentWithTab as Se, simplifySelection as Ce, temporarilySetTabFocusMode as we } from "@codemirror/commands";
|
|
9
|
+
import { json as Te } from "@codemirror/lang-json";
|
|
10
|
+
import { yaml as Ee } from "@codemirror/lang-yaml";
|
|
11
|
+
import { StreamLanguage as De, bracketMatching as Oe, foldGutter as ke, foldKeymap as Ae, indentOnInput as je, indentUnit as Me } from "@codemirror/language";
|
|
12
|
+
import { shell as Ne } from "@codemirror/legacy-modes/mode/shell";
|
|
13
|
+
import { lintGutter as Pe, lintKeymap as Fe, linter as Ie } from "@codemirror/lint";
|
|
14
|
+
import { highlightSelectionMatches as Le, search as Re, searchKeymap as ze } from "@codemirror/search";
|
|
15
|
+
import { Compartment as x, EditorState as S, Text as C } from "@codemirror/state";
|
|
16
|
+
import { EditorView as w, drawSelection as Be, dropCursor as Ve, highlightActiveLine as He, highlightActiveLineGutter as Ue, keymap as We, lineNumbers as Ge, placeholder as Ke } from "@codemirror/view";
|
|
17
17
|
//#region src/lib/components/AcCodeEditor.vue?vue&type=script&setup=true&lang.ts
|
|
18
18
|
var qe = {
|
|
19
19
|
key: 0,
|
|
20
|
-
class: "
|
|
20
|
+
class: "text-danger",
|
|
21
|
+
"aria-hidden": "true"
|
|
21
22
|
}, Je = {
|
|
22
23
|
key: 0,
|
|
23
|
-
class: "min-
|
|
24
|
+
class: "flex min-h-12 flex-wrap items-center gap-x-3 gap-y-1.5 border-b border-border bg-surface-muted px-4 py-2"
|
|
24
25
|
}, Ye = {
|
|
26
|
+
key: 0,
|
|
27
|
+
class: "min-w-0 truncate font-mono text-xs font-medium text-heading"
|
|
28
|
+
}, Xe = {
|
|
25
29
|
key: 1,
|
|
26
30
|
class: "rounded-6 border border-border bg-surface px-1.5 text-xs leading-5 font-medium text-muted"
|
|
27
|
-
},
|
|
31
|
+
}, Ze = {
|
|
28
32
|
key: 2,
|
|
29
33
|
class: "text-xs text-muted"
|
|
30
|
-
},
|
|
34
|
+
}, Qe = { class: "ml-auto flex min-w-0 flex-wrap items-center justify-end gap-2" }, $e = ["aria-label"], et = ["id"], tt = {
|
|
31
35
|
class: "sr-only",
|
|
32
36
|
"aria-live": "polite"
|
|
33
|
-
},
|
|
37
|
+
}, nt = { class: "ac-scrollbar max-h-[calc(92px*var(--ac-scale))] py-1" }, rt = ["onClick"], it = { class: "shrink-0 font-mono text-muted" }, at = { class: "min-w-0 [overflow-wrap:anywhere]" }, ot = /*@__PURE__*/ d({
|
|
34
38
|
__name: "AcCodeEditor",
|
|
35
39
|
props: /*@__PURE__*/ f({
|
|
36
40
|
language: { default: "yaml" },
|
|
@@ -65,6 +69,19 @@ var qe = {
|
|
|
65
69
|
bordered: {
|
|
66
70
|
type: Boolean,
|
|
67
71
|
default: !0
|
|
72
|
+
},
|
|
73
|
+
showLabel: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
default: !1
|
|
76
|
+
},
|
|
77
|
+
required: {
|
|
78
|
+
type: Boolean,
|
|
79
|
+
default: !1
|
|
80
|
+
},
|
|
81
|
+
errorMsg: { default: "" },
|
|
82
|
+
showProblems: {
|
|
83
|
+
type: Boolean,
|
|
84
|
+
default: !0
|
|
68
85
|
}
|
|
69
86
|
}, {
|
|
70
87
|
modelValue: { default: "" },
|
|
@@ -77,188 +94,188 @@ var qe = {
|
|
|
77
94
|
"focus",
|
|
78
95
|
"blur"
|
|
79
96
|
], ["update:modelValue", "update:view"]),
|
|
80
|
-
setup(d, { expose: f, emit:
|
|
81
|
-
let
|
|
97
|
+
setup(d, { expose: f, emit: ot }) {
|
|
98
|
+
let T = d, E = y(d, "modelValue"), D = y(d, "view"), O = ot, st = le(), ct, k = () => ct ??= import("@codemirror/merge"), lt, ut = () => lt ??= import("../editor/validate.js"), dt = {
|
|
82
99
|
yaml: "YAML",
|
|
83
100
|
json: "JSON",
|
|
84
101
|
shell: "Shell",
|
|
85
102
|
text: "Text"
|
|
86
|
-
},
|
|
103
|
+
}, ft = {
|
|
87
104
|
margin: 3,
|
|
88
105
|
minSize: 6
|
|
89
|
-
},
|
|
106
|
+
}, pt = g(), A = g(), j = se(), M, N = g([]), P = g(0), F = g(!1), I = ce(), mt = `${I}-label`, ht = `${I}-msg`, L = o(() => T.original !== void 0 && !T.readonly), R = o(() => T.original !== void 0 && T.readonly), z = o(() => R.value || L.value && D.value === "changes"), gt = o(() => !!T.title || T.copyable || L.value || R.value || !!st.actions), _t = o(() => T.validate && (T.language === "yaml" || T.language === "json")), B = o(() => T.label || T.title || `${dt[T.language]} editor`), V = o(() => T.showLabel && !!T.label || !!T.errorMsg), H = o(() => ["flex min-w-0 flex-col overflow-hidden bg-background", T.bordered && "rounded-10 border border-border transition-[border-color,box-shadow] duration-200 has-[.cm-editor.cm-focused]:focus-ring"]), U = o(() => N.value.filter((e) => e.severity === "error").length), vt = o(() => [{
|
|
90
107
|
value: "edit",
|
|
91
108
|
label: "Edit"
|
|
92
109
|
}, {
|
|
93
110
|
value: "changes",
|
|
94
|
-
label:
|
|
95
|
-
}]),
|
|
96
|
-
height:
|
|
97
|
-
maxHeight:
|
|
111
|
+
label: P.value ? `Changes · ${P.value}` : "Changes"
|
|
112
|
+
}]), yt = o(() => ({
|
|
113
|
+
height: T.height === "auto" ? void 0 : T.height,
|
|
114
|
+
maxHeight: T.maxHeight
|
|
98
115
|
})), W = {
|
|
99
|
-
language: new
|
|
100
|
-
readonly: new
|
|
101
|
-
wrap: new
|
|
102
|
-
gutters: new
|
|
103
|
-
lint: new
|
|
104
|
-
placeholder: new
|
|
105
|
-
attributes: new
|
|
116
|
+
language: new x(),
|
|
117
|
+
readonly: new x(),
|
|
118
|
+
wrap: new x(),
|
|
119
|
+
gutters: new x(),
|
|
120
|
+
lint: new x(),
|
|
121
|
+
placeholder: new x(),
|
|
122
|
+
attributes: new x()
|
|
106
123
|
};
|
|
107
124
|
function G() {
|
|
108
|
-
return
|
|
125
|
+
return T.language === "yaml" ? Ee() : T.language === "json" ? Te() : T.language === "shell" ? De.define(Ne) : [];
|
|
109
126
|
}
|
|
110
|
-
function
|
|
111
|
-
return
|
|
112
|
-
|
|
113
|
-
|
|
127
|
+
function bt() {
|
|
128
|
+
return T.lineNumbers ? [
|
|
129
|
+
Ge(),
|
|
130
|
+
ke({
|
|
114
131
|
openText: "▾",
|
|
115
132
|
closedText: "▸"
|
|
116
133
|
}),
|
|
117
|
-
|
|
134
|
+
Ue()
|
|
118
135
|
] : [];
|
|
119
136
|
}
|
|
120
|
-
function
|
|
121
|
-
JSON.stringify(e) !== JSON.stringify(
|
|
137
|
+
function xt(e) {
|
|
138
|
+
JSON.stringify(e) !== JSON.stringify(N.value) && (N.value = e, O("validate", e));
|
|
122
139
|
}
|
|
123
|
-
function
|
|
124
|
-
return
|
|
125
|
-
let t = e.state.doc.toString(), { checkDocument: n, toProblems: r } = await
|
|
126
|
-
return
|
|
127
|
-
}, { delay: 300 })] : (
|
|
140
|
+
function St() {
|
|
141
|
+
return _t.value ? [Pe(), Ie(async (e) => {
|
|
142
|
+
let t = e.state.doc.toString(), { checkDocument: n, toProblems: r } = await ut(), i = await n(t, T.language, T.schema);
|
|
143
|
+
return j.value?.state.doc.toString() === t && xt(r(i, e.state.doc)), i;
|
|
144
|
+
}, { delay: 300 })] : (xt([]), []);
|
|
128
145
|
}
|
|
129
|
-
function
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
...
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
} : {}
|
|
146
|
+
function Ct() {
|
|
147
|
+
let e = [T.showProblems && U.value && I, T.errorMsg && ht].filter(Boolean).join(" ");
|
|
148
|
+
return w.contentAttributes.of({
|
|
149
|
+
"aria-label": B.value,
|
|
150
|
+
...T.readonly ? { "aria-readonly": "true" } : {},
|
|
151
|
+
...T.required ? { "aria-required": "true" } : {},
|
|
152
|
+
...U.value || T.errorMsg ? { "aria-invalid": "true" } : {},
|
|
153
|
+
...e ? { "aria-describedby": e } : {}
|
|
137
154
|
});
|
|
138
155
|
}
|
|
139
|
-
let K = 0,
|
|
156
|
+
let K = 0, wt = {
|
|
140
157
|
key: "Escape",
|
|
141
158
|
run: (e) => {
|
|
142
159
|
let t = Date.now();
|
|
143
|
-
return t - K < 2e3 ? !1 : (K = t,
|
|
160
|
+
return t - K < 2e3 ? !1 : (K = t, Ce(e), we(e));
|
|
144
161
|
}
|
|
145
162
|
};
|
|
146
|
-
function
|
|
147
|
-
|
|
148
|
-
parent:
|
|
149
|
-
state:
|
|
150
|
-
doc:
|
|
163
|
+
function Tt() {
|
|
164
|
+
j.value = new w({
|
|
165
|
+
parent: pt.value,
|
|
166
|
+
state: S.create({
|
|
167
|
+
doc: E.value,
|
|
151
168
|
extensions: [
|
|
152
169
|
a,
|
|
153
170
|
r,
|
|
154
171
|
i,
|
|
155
|
-
|
|
172
|
+
be(),
|
|
173
|
+
Be(),
|
|
174
|
+
Ve(),
|
|
175
|
+
je(),
|
|
176
|
+
Me.of(" "),
|
|
177
|
+
S.tabSize.of(2),
|
|
178
|
+
Oe(),
|
|
179
|
+
_e(),
|
|
156
180
|
He(),
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
...
|
|
168
|
-
...Ve,
|
|
169
|
-
...Me,
|
|
170
|
-
...Le,
|
|
171
|
-
yt,
|
|
172
|
-
we,
|
|
173
|
-
...Ce,
|
|
174
|
-
...xe
|
|
181
|
+
Le(),
|
|
182
|
+
Re({ top: !0 }),
|
|
183
|
+
We.of([
|
|
184
|
+
...ve,
|
|
185
|
+
...ze,
|
|
186
|
+
...Ae,
|
|
187
|
+
...Fe,
|
|
188
|
+
wt,
|
|
189
|
+
Se,
|
|
190
|
+
...xe,
|
|
191
|
+
...ye
|
|
175
192
|
]),
|
|
176
193
|
W.language.of(G()),
|
|
177
|
-
W.readonly.of(
|
|
178
|
-
W.wrap.of(
|
|
179
|
-
W.gutters.of(
|
|
180
|
-
W.lint.of(
|
|
181
|
-
W.placeholder.of(
|
|
182
|
-
W.attributes.of(
|
|
183
|
-
|
|
184
|
-
e.docChanged && (
|
|
194
|
+
W.readonly.of(S.readOnly.of(T.readonly)),
|
|
195
|
+
W.wrap.of(T.wrap ? w.lineWrapping : []),
|
|
196
|
+
W.gutters.of(bt()),
|
|
197
|
+
W.lint.of(St()),
|
|
198
|
+
W.placeholder.of(T.placeholder ? Ke(T.placeholder) : []),
|
|
199
|
+
W.attributes.of(Ct()),
|
|
200
|
+
w.updateListener.of((e) => {
|
|
201
|
+
e.docChanged && (E.value = e.state.doc.toString()), e.focusChanged && e.view.hasFocus ? O("focus") : e.focusChanged && O("blur");
|
|
185
202
|
})
|
|
186
203
|
]
|
|
187
204
|
})
|
|
188
205
|
});
|
|
189
206
|
}
|
|
190
207
|
function q(e, t) {
|
|
191
|
-
|
|
208
|
+
j.value?.dispatch({ effects: e.reconfigure(t) });
|
|
192
209
|
}
|
|
193
210
|
function J(e) {
|
|
194
211
|
return [
|
|
195
212
|
a,
|
|
196
213
|
r,
|
|
197
214
|
G(),
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
215
|
+
S.readOnly.of(!0),
|
|
216
|
+
S.tabSize.of(2),
|
|
217
|
+
T.wrap ? w.lineWrapping : [],
|
|
218
|
+
T.lineNumbers ? Ge() : [],
|
|
219
|
+
w.contentAttributes.of({
|
|
203
220
|
"aria-label": e,
|
|
204
221
|
"aria-readonly": "true"
|
|
205
222
|
})
|
|
206
223
|
];
|
|
207
224
|
}
|
|
208
225
|
function Y() {
|
|
209
|
-
X++,
|
|
226
|
+
X++, M?.destroy(), M = void 0;
|
|
210
227
|
}
|
|
211
228
|
let X = 0;
|
|
212
229
|
async function Z() {
|
|
213
|
-
let e = ++X, { MergeView: t, unifiedMergeView: n } = await
|
|
214
|
-
if (e !== X || !
|
|
215
|
-
let r =
|
|
216
|
-
if (
|
|
217
|
-
|
|
218
|
-
parent:
|
|
230
|
+
let e = ++X, { MergeView: t, unifiedMergeView: n } = await k();
|
|
231
|
+
if (e !== X || !z.value || (Y(), !A.value)) return;
|
|
232
|
+
let r = T.original ?? "";
|
|
233
|
+
if (T.diffLayout === "split") {
|
|
234
|
+
M = new t({
|
|
235
|
+
parent: A.value,
|
|
219
236
|
a: {
|
|
220
237
|
doc: r,
|
|
221
|
-
extensions: J(`Saved version of ${
|
|
238
|
+
extensions: J(`Saved version of ${B.value}`)
|
|
222
239
|
},
|
|
223
240
|
b: {
|
|
224
|
-
doc:
|
|
225
|
-
extensions: J(`Changed version of ${
|
|
241
|
+
doc: E.value,
|
|
242
|
+
extensions: J(`Changed version of ${B.value}`)
|
|
226
243
|
},
|
|
227
244
|
gutter: !0,
|
|
228
245
|
highlightChanges: !0,
|
|
229
|
-
collapseUnchanged:
|
|
246
|
+
collapseUnchanged: ft
|
|
230
247
|
});
|
|
231
248
|
return;
|
|
232
249
|
}
|
|
233
|
-
|
|
234
|
-
parent:
|
|
235
|
-
doc:
|
|
236
|
-
extensions: [J(`Changes to ${
|
|
250
|
+
M = new w({
|
|
251
|
+
parent: A.value,
|
|
252
|
+
doc: E.value,
|
|
253
|
+
extensions: [J(`Changes to ${B.value}`), n({
|
|
237
254
|
original: r,
|
|
238
255
|
mergeControls: !1,
|
|
239
256
|
gutter: !0,
|
|
240
257
|
highlightChanges: !0,
|
|
241
258
|
syntaxHighlightDeletions: !0,
|
|
242
|
-
collapseUnchanged:
|
|
259
|
+
collapseUnchanged: ft
|
|
243
260
|
})]
|
|
244
261
|
});
|
|
245
262
|
}
|
|
246
263
|
let Q;
|
|
247
|
-
function
|
|
248
|
-
if (clearTimeout(Q),
|
|
249
|
-
|
|
264
|
+
function Et() {
|
|
265
|
+
if (clearTimeout(Q), T.original === void 0) {
|
|
266
|
+
P.value = 0;
|
|
250
267
|
return;
|
|
251
268
|
}
|
|
252
269
|
Q = setTimeout(async () => {
|
|
253
|
-
let { Chunk: e } = await
|
|
254
|
-
|
|
270
|
+
let { Chunk: e } = await k();
|
|
271
|
+
T.original !== void 0 && (P.value = e.build(C.of(T.original.split("\n")), C.of(E.value.split("\n"))).length);
|
|
255
272
|
}, 250);
|
|
256
273
|
}
|
|
257
|
-
function
|
|
258
|
-
|
|
274
|
+
function Dt() {
|
|
275
|
+
j.value?.focus();
|
|
259
276
|
}
|
|
260
|
-
function
|
|
261
|
-
let t =
|
|
277
|
+
function Ot(e) {
|
|
278
|
+
let t = j.value;
|
|
262
279
|
t && (t.dispatch({
|
|
263
280
|
selection: {
|
|
264
281
|
anchor: e.from,
|
|
@@ -268,114 +285,130 @@ var qe = {
|
|
|
268
285
|
}), t.focus());
|
|
269
286
|
}
|
|
270
287
|
let $;
|
|
271
|
-
async function
|
|
288
|
+
async function kt() {
|
|
272
289
|
try {
|
|
273
|
-
await t(
|
|
290
|
+
await t(E.value), F.value = !0, clearTimeout($), $ = setTimeout(() => F.value = !1, 1500);
|
|
274
291
|
} catch {}
|
|
275
292
|
}
|
|
276
|
-
return
|
|
277
|
-
let t =
|
|
293
|
+
return b(E, (e) => {
|
|
294
|
+
let t = j.value;
|
|
278
295
|
t && e !== t.state.doc.toString() && t.dispatch({ changes: {
|
|
279
296
|
from: 0,
|
|
280
297
|
to: t.state.doc.length,
|
|
281
298
|
insert: e
|
|
282
299
|
} });
|
|
283
|
-
}),
|
|
284
|
-
() =>
|
|
285
|
-
() =>
|
|
286
|
-
() =>
|
|
287
|
-
], () => q(W.lint,
|
|
288
|
-
|
|
289
|
-
() =>
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
() =>
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
() =>
|
|
300
|
+
}), b(() => T.language, () => q(W.language, G())), b(() => T.readonly, (e) => q(W.readonly, S.readOnly.of(e))), b(() => T.wrap, (e) => q(W.wrap, e ? w.lineWrapping : [])), b(() => T.lineNumbers, () => q(W.gutters, bt())), b(() => T.placeholder, (e) => q(W.placeholder, e ? Ke(e) : [])), b([
|
|
301
|
+
() => T.language,
|
|
302
|
+
() => T.schema,
|
|
303
|
+
() => T.validate
|
|
304
|
+
], () => q(W.lint, St())), b([
|
|
305
|
+
B,
|
|
306
|
+
() => T.readonly,
|
|
307
|
+
U,
|
|
308
|
+
() => T.required,
|
|
309
|
+
() => T.errorMsg,
|
|
310
|
+
() => T.showProblems
|
|
311
|
+
], () => q(W.attributes, Ct())), b([() => T.original, E], Et, { immediate: !0 }), b([
|
|
312
|
+
z,
|
|
313
|
+
() => T.diffLayout,
|
|
314
|
+
() => T.original,
|
|
315
|
+
() => T.language,
|
|
316
|
+
() => T.wrap
|
|
297
317
|
], async ([e]) => {
|
|
298
318
|
if (!e) return Y();
|
|
299
319
|
await te(), Z();
|
|
300
|
-
}),
|
|
301
|
-
|
|
302
|
-
}),
|
|
303
|
-
clearTimeout(Q), clearTimeout($), Y(),
|
|
320
|
+
}), b(E, () => z.value && Z()), re(() => {
|
|
321
|
+
Tt(), z.value && Z();
|
|
322
|
+
}), ne(() => {
|
|
323
|
+
clearTimeout(Q), clearTimeout($), Y(), j.value?.destroy();
|
|
304
324
|
}), f({
|
|
305
|
-
focus:
|
|
306
|
-
editor:
|
|
307
|
-
}), (t, r) => (
|
|
308
|
-
class: p(
|
|
325
|
+
focus: Dt,
|
|
326
|
+
editor: j
|
|
327
|
+
}), (t, r) => (h(), l("div", {
|
|
328
|
+
class: p(V.value ? "flex min-w-0 flex-col" : H.value),
|
|
309
329
|
"data-ac-ds": "",
|
|
310
330
|
"data-testid": "ac-code-editor"
|
|
311
331
|
}, [
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
}, null, 8, ["modelValue", "options"])) : c("", !0),
|
|
326
|
-
d.copyable ? (m(), s(e, {
|
|
327
|
-
key: 1,
|
|
328
|
-
content: R.value ? "Copied" : "Copy"
|
|
329
|
-
}, {
|
|
330
|
-
default: pe(() => [u("button", {
|
|
331
|
-
type: "button",
|
|
332
|
-
class: "inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-8 text-muted transition-colors duration-200 hover:bg-surface-sunken hover:text-heading focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
333
|
-
"aria-label": R.value ? "Copied" : "Copy to clipboard",
|
|
334
|
-
onClick: wt
|
|
335
|
-
}, [R.value ? (m(), s(_(he), {
|
|
332
|
+
V.value && d.showLabel && d.label ? (h(), l("div", {
|
|
333
|
+
key: 0,
|
|
334
|
+
id: mt,
|
|
335
|
+
class: "mb-2 flex items-center gap-1 text-base font-medium text-heading"
|
|
336
|
+
}, [u("span", null, _(d.label), 1), d.required ? (h(), l("span", qe, "*")) : c("", !0)])) : c("", !0),
|
|
337
|
+
u("div", { class: p(V.value ? H.value : "contents") }, [
|
|
338
|
+
gt.value ? (h(), l("div", Je, [
|
|
339
|
+
d.title ? (h(), l("span", Ye, _(d.title), 1)) : c("", !0),
|
|
340
|
+
d.language === "text" ? c("", !0) : (h(), l("span", Xe, _(dt[d.language]), 1)),
|
|
341
|
+
R.value ? (h(), l("span", Ze, _(P.value ? `${P.value} ${P.value === 1 ? "change" : "changes"}` : "No changes"), 1)) : c("", !0),
|
|
342
|
+
u("div", Qe, [
|
|
343
|
+
ae(t.$slots, "actions"),
|
|
344
|
+
L.value ? (h(), s(n, {
|
|
336
345
|
key: 0,
|
|
337
|
-
|
|
338
|
-
"
|
|
339
|
-
|
|
346
|
+
modelValue: D.value,
|
|
347
|
+
"onUpdate:modelValue": r[0] ||= (e) => D.value = e,
|
|
348
|
+
options: vt.value,
|
|
349
|
+
size: "small",
|
|
350
|
+
label: "Editor view"
|
|
351
|
+
}, null, 8, ["modelValue", "options"])) : c("", !0),
|
|
352
|
+
d.copyable ? (h(), s(e, {
|
|
340
353
|
key: 1,
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
354
|
+
content: F.value ? "Copied" : "Copy"
|
|
355
|
+
}, {
|
|
356
|
+
default: de(() => [u("button", {
|
|
357
|
+
type: "button",
|
|
358
|
+
class: "inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-8 text-muted transition-colors duration-200 hover:bg-surface-sunken hover:text-heading focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
359
|
+
"aria-label": F.value ? "Copied" : "Copy to clipboard",
|
|
360
|
+
onClick: kt
|
|
361
|
+
}, [F.value ? (h(), s(v(pe), {
|
|
362
|
+
key: 0,
|
|
363
|
+
class: "size-4 text-success-strong",
|
|
364
|
+
"aria-hidden": "true"
|
|
365
|
+
})) : (h(), s(v(he), {
|
|
366
|
+
key: 1,
|
|
367
|
+
class: "size-4",
|
|
368
|
+
"aria-hidden": "true"
|
|
369
|
+
}))], 8, $e)]),
|
|
370
|
+
_: 1
|
|
371
|
+
}, 8, ["content"])) : c("", !0)
|
|
372
|
+
])
|
|
373
|
+
])) : c("", !0),
|
|
374
|
+
fe(u("div", {
|
|
375
|
+
ref_key: "host",
|
|
376
|
+
ref: pt,
|
|
377
|
+
class: p(["min-h-0 flex-auto [&>.cm-editor]:max-h-[inherit]", d.height === "auto" && "min-h-20"]),
|
|
378
|
+
style: m(yt.value)
|
|
379
|
+
}, null, 6), [[ue, !z.value]]),
|
|
380
|
+
z.value ? (h(), l("div", {
|
|
381
|
+
key: 1,
|
|
382
|
+
ref_key: "diffHost",
|
|
383
|
+
ref: A,
|
|
384
|
+
class: "min-h-0 flex-auto overflow-auto [&_.cm-mergeView]:h-full [&>.cm-editor]:max-h-[inherit]",
|
|
385
|
+
style: m(yt.value)
|
|
386
|
+
}, null, 4)) : c("", !0),
|
|
387
|
+
d.showProblems && N.value.length && !z.value ? (h(), l("div", {
|
|
388
|
+
key: 2,
|
|
389
|
+
id: v(I),
|
|
390
|
+
class: "border-t border-border bg-surface-muted"
|
|
391
|
+
}, [u("p", tt, _(N.value.length) + " " + _(N.value.length === 1 ? "problem" : "problems"), 1), u("ul", nt, [(h(!0), l(ee, null, ie(N.value, (e, t) => (h(), l("li", { key: t }, [u("button", {
|
|
392
|
+
type: "button",
|
|
393
|
+
class: "flex w-full cursor-pointer items-start gap-2 px-4 py-1 text-left text-xs leading-5 text-body transition-colors duration-200 hover:bg-accent-hover focus-visible:bg-accent-hover focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none focus-visible:ring-inset",
|
|
394
|
+
onClick: (t) => Ot(e)
|
|
395
|
+
}, [
|
|
396
|
+
(h(), s(oe(e.severity === "error" ? v(me) : v(ge)), {
|
|
397
|
+
class: p(["mt-0.75 size-3.5 shrink-0", e.severity === "error" ? "text-danger" : "text-warning"]),
|
|
398
|
+
"aria-hidden": "true"
|
|
399
|
+
}, null, 8, ["class"])),
|
|
400
|
+
u("span", it, "Ln " + _(e.line) + ", Col " + _(e.column), 1),
|
|
401
|
+
u("span", at, _(e.message), 1)
|
|
402
|
+
], 8, rt)]))), 128))])], 8, et)) : c("", !0)
|
|
403
|
+
], 2),
|
|
404
|
+
d.errorMsg ? (h(), l("p", {
|
|
355
405
|
key: 1,
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
}, null, 4)) : c("", !0),
|
|
361
|
-
I.value.length && !V.value ? (m(), l("div", {
|
|
362
|
-
key: 2,
|
|
363
|
-
id: _(ut),
|
|
364
|
-
class: "border-t border-border bg-surface-muted"
|
|
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", {
|
|
366
|
-
type: "button",
|
|
367
|
-
class: "flex w-full cursor-pointer items-start gap-2 px-4 py-1 text-left text-xs leading-5 text-body transition-colors duration-200 hover:bg-accent-hover focus-visible:bg-accent-hover focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none focus-visible:ring-inset",
|
|
368
|
-
onClick: (t) => Ct(e)
|
|
369
|
-
}, [
|
|
370
|
-
(m(), s(se(e.severity === "error" ? _(ge) : _(ve)), {
|
|
371
|
-
class: p(["mt-0.75 size-3.5 shrink-0", e.severity === "error" ? "text-danger" : "text-warning"]),
|
|
372
|
-
"aria-hidden": "true"
|
|
373
|
-
}, null, 8, ["class"])),
|
|
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)
|
|
406
|
+
id: ht,
|
|
407
|
+
class: "mt-2 text-xs text-danger-strong",
|
|
408
|
+
role: "alert"
|
|
409
|
+
}, _(d.errorMsg), 1)) : c("", !0)
|
|
377
410
|
], 2));
|
|
378
411
|
}
|
|
379
412
|
});
|
|
380
413
|
//#endregion
|
|
381
|
-
export {
|
|
414
|
+
export { ot as default };
|
|
@@ -21,8 +21,8 @@ export interface Props {
|
|
|
21
21
|
errorMsg?: string;
|
|
22
22
|
/** Help text between the label and the field. */
|
|
23
23
|
hint?: string;
|
|
24
|
-
/** `small` 36px or `normal` 42px tall. With `swatch-only`,
|
|
25
|
-
size?: "small" | "normal";
|
|
24
|
+
/** `small` 36px or `normal` 42px tall. With `swatch-only`, the swatch is `xs` 16px, `xsmall` 32px, `small` 40px, `normal` 48px or `large` 80px; without it, `xs` and `xsmall` look like `small` and `large` like `normal`. */
|
|
25
|
+
size?: "xs" | "xsmall" | "small" | "normal" | "large";
|
|
26
26
|
/** Shows only the native colour swatch, with no hex field: cloud-ui's AcColorInput look. */
|
|
27
27
|
swatchOnly?: boolean;
|
|
28
28
|
}
|
|
@@ -46,7 +46,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
46
46
|
label: string;
|
|
47
47
|
disabled: boolean;
|
|
48
48
|
name: string;
|
|
49
|
-
size: "small" | "normal";
|
|
49
|
+
size: "xs" | "xsmall" | "small" | "normal" | "large";
|
|
50
50
|
hint: string;
|
|
51
51
|
readonly: boolean;
|
|
52
52
|
errorMsg: string;
|