artifactuse 0.2.4 → 0.2.6
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/README.md +5 -1
- package/dist/{index-C_15PkcN.js → index-W575iBkm.js} +5 -2
- package/dist/index.js +1 -1
- package/dist/react/ArtifactusePanel.d.ts +2 -1
- package/dist/react/index.js +817 -803
- package/dist/svelte/index.js +1751 -1730
- package/dist/vue/index.js +693 -667
- package/dist/vue2/index.js +80 -1
- package/package.json +1 -1
package/dist/vue/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { g as Se, f as
|
|
3
|
-
import { J as
|
|
4
|
-
const
|
|
1
|
+
import { ref as T, computed as C, createElementBlock as s, openBlock as a, normalizeClass as N, createElementVNode as e, toDisplayString as l, withModifiers as he, onMounted as $e, watch as de, Fragment as R, createCommentVNode as v, renderList as ve, createTextVNode as K, h as se, normalizeStyle as He, createStaticVNode as Ut, createBlock as xe, resolveDynamicComponent as Dt, nextTick as Ce, onUnmounted as We, Teleport as jt, createVNode as ze, Transition as Ee, withCtx as Be, withKeys as Nt, onBeforeUnmount as Wt, unref as y, withDirectives as ot, vShow as rt, reactive as ut, provide as Jt, inject as Xt } from "vue";
|
|
2
|
+
import { g as Se, f as dt, a as je, b as Ne, n as Zt, i as ct, c as Kt, D as Yt, d as vt } from "../index-W575iBkm.js";
|
|
3
|
+
import { J as Qt } from "../jszip.min-CdmYyw5L.js";
|
|
4
|
+
const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class: "artifactuse-card__content" }, aa = { class: "artifactuse-card__title" }, sa = { class: "artifactuse-card__meta" }, ia = { class: "artifactuse-card__type" }, la = { class: "artifactuse-card__size" }, na = { class: "artifactuse-card__actions" }, oa = ["title"], ra = {
|
|
5
5
|
key: 0,
|
|
6
6
|
viewBox: "0 0 24 24",
|
|
7
7
|
fill: "none",
|
|
8
8
|
stroke: "currentColor",
|
|
9
9
|
"stroke-width": "2"
|
|
10
|
-
},
|
|
10
|
+
}, ca = {
|
|
11
11
|
key: 1,
|
|
12
12
|
viewBox: "0 0 24 24",
|
|
13
13
|
fill: "none",
|
|
14
14
|
stroke: "currentColor",
|
|
15
15
|
"stroke-width": "2"
|
|
16
|
-
},
|
|
16
|
+
}, ua = {
|
|
17
17
|
__name: "ArtifactuseCard",
|
|
18
18
|
props: {
|
|
19
19
|
artifact: {
|
|
@@ -27,57 +27,57 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
27
27
|
},
|
|
28
28
|
emits: ["open", "copy", "download"],
|
|
29
29
|
setup(H, { emit: c }) {
|
|
30
|
-
const _ = H,
|
|
31
|
-
var
|
|
32
|
-
return
|
|
33
|
-
}), E = C(() =>
|
|
34
|
-
function g(
|
|
35
|
-
|
|
30
|
+
const _ = H, M = c, f = T(!1), o = C(() => Se(_.artifact.language)), q = C(() => {
|
|
31
|
+
var $;
|
|
32
|
+
return dt(_.artifact.size || (($ = _.artifact.code) == null ? void 0 : $.length) || 0);
|
|
33
|
+
}), E = C(() => je(_.artifact.language));
|
|
34
|
+
function g($) {
|
|
35
|
+
$.stopPropagation(), M("open", _.artifact);
|
|
36
36
|
}
|
|
37
37
|
async function n() {
|
|
38
38
|
try {
|
|
39
39
|
await navigator.clipboard.writeText(_.artifact.code), f.value = !0, setTimeout(() => {
|
|
40
40
|
f.value = !1;
|
|
41
|
-
}, 2e3),
|
|
42
|
-
} catch (
|
|
43
|
-
console.error("Failed to copy:",
|
|
41
|
+
}, 2e3), M("copy", _.artifact);
|
|
42
|
+
} catch ($) {
|
|
43
|
+
console.error("Failed to copy:", $);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
function h() {
|
|
47
47
|
var W;
|
|
48
|
-
const
|
|
49
|
-
|
|
48
|
+
const $ = new Blob([_.artifact.code], { type: "text/plain" }), I = URL.createObjectURL($), x = document.createElement("a"), j = Ne(_.artifact.language), O = ((W = _.artifact.title) == null ? void 0 : W.replace(/[^a-z0-9]/gi, "_").toLowerCase()) || "code";
|
|
49
|
+
x.href = I, x.download = `${O}.${j}`, document.body.appendChild(x), x.click(), document.body.removeChild(x), URL.revokeObjectURL(I), M("download", _.artifact);
|
|
50
50
|
}
|
|
51
|
-
return (
|
|
52
|
-
class:
|
|
51
|
+
return ($, I) => (a(), s("div", {
|
|
52
|
+
class: N(["artifactuse-card", { "artifactuse-card--active": H.isActive }]),
|
|
53
53
|
onClick: g
|
|
54
54
|
}, [
|
|
55
|
-
e("div",
|
|
55
|
+
e("div", Gt, [
|
|
56
56
|
(a(), s("svg", {
|
|
57
57
|
viewBox: "0 0 24 24",
|
|
58
58
|
fill: "none",
|
|
59
59
|
stroke: "currentColor",
|
|
60
60
|
"stroke-width": "1.5",
|
|
61
61
|
innerHTML: E.value
|
|
62
|
-
}, null, 8,
|
|
62
|
+
}, null, 8, ea))
|
|
63
63
|
]),
|
|
64
|
-
e("div",
|
|
65
|
-
e("div",
|
|
66
|
-
e("div",
|
|
67
|
-
e("span",
|
|
64
|
+
e("div", ta, [
|
|
65
|
+
e("div", aa, l(H.artifact.title), 1),
|
|
66
|
+
e("div", sa, [
|
|
67
|
+
e("span", ia, l(o.value), 1),
|
|
68
68
|
I[0] || (I[0] = e("span", { class: "artifactuse-card__separator" }, "•", -1)),
|
|
69
|
-
e("span",
|
|
69
|
+
e("span", la, l(q.value), 1)
|
|
70
70
|
])
|
|
71
71
|
]),
|
|
72
|
-
e("div",
|
|
72
|
+
e("div", na, [
|
|
73
73
|
e("button", {
|
|
74
74
|
class: "artifactuse-card__action",
|
|
75
75
|
onClick: he(n, ["stop"]),
|
|
76
76
|
title: f.value ? "Copied!" : "Copy code"
|
|
77
77
|
}, [
|
|
78
|
-
f.value ? (a(), s("svg",
|
|
78
|
+
f.value ? (a(), s("svg", ca, [...I[2] || (I[2] = [
|
|
79
79
|
e("polyline", { points: "20 6 9 17 4 12" }, null, -1)
|
|
80
|
-
])])) : (a(), s("svg",
|
|
80
|
+
])])) : (a(), s("svg", ra, [...I[1] || (I[1] = [
|
|
81
81
|
e("rect", {
|
|
82
82
|
x: "9",
|
|
83
83
|
y: "9",
|
|
@@ -88,7 +88,7 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
88
88
|
}, null, -1),
|
|
89
89
|
e("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" }, null, -1)
|
|
90
90
|
])]))
|
|
91
|
-
], 8,
|
|
91
|
+
], 8, oa),
|
|
92
92
|
e("button", {
|
|
93
93
|
class: "artifactuse-card__action",
|
|
94
94
|
onClick: he(h, ["stop"]),
|
|
@@ -123,10 +123,10 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
123
123
|
], -1))
|
|
124
124
|
], 2));
|
|
125
125
|
}
|
|
126
|
-
},
|
|
126
|
+
}, da = ["data-artifactuse-theme"], va = {
|
|
127
127
|
key: 0,
|
|
128
128
|
class: "artifactuse-form-collapsed"
|
|
129
|
-
},
|
|
129
|
+
}, fa = { class: "artifactuse-form-collapsed-icon" }, pa = {
|
|
130
130
|
key: 0,
|
|
131
131
|
viewBox: "0 0 24 24",
|
|
132
132
|
fill: "none",
|
|
@@ -134,7 +134,7 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
134
134
|
"stroke-width": "2.5",
|
|
135
135
|
"stroke-linecap": "round",
|
|
136
136
|
"stroke-linejoin": "round"
|
|
137
|
-
},
|
|
137
|
+
}, _a = {
|
|
138
138
|
key: 1,
|
|
139
139
|
viewBox: "0 0 24 24",
|
|
140
140
|
fill: "none",
|
|
@@ -142,7 +142,7 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
142
142
|
"stroke-width": "2.5",
|
|
143
143
|
"stroke-linecap": "round",
|
|
144
144
|
"stroke-linejoin": "round"
|
|
145
|
-
},
|
|
145
|
+
}, ha = {
|
|
146
146
|
key: 2,
|
|
147
147
|
viewBox: "0 0 24 24",
|
|
148
148
|
fill: "none",
|
|
@@ -150,64 +150,64 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
150
150
|
"stroke-width": "2.5",
|
|
151
151
|
"stroke-linecap": "round",
|
|
152
152
|
"stroke-linejoin": "round"
|
|
153
|
-
},
|
|
153
|
+
}, ma = { class: "artifactuse-form-collapsed-title" }, ya = {
|
|
154
154
|
key: 0,
|
|
155
155
|
class: "artifactuse-form-header"
|
|
156
|
-
},
|
|
156
|
+
}, ga = {
|
|
157
157
|
key: 0,
|
|
158
158
|
class: "artifactuse-form-title"
|
|
159
|
-
},
|
|
159
|
+
}, ka = {
|
|
160
160
|
key: 1,
|
|
161
161
|
class: "artifactuse-form-description"
|
|
162
|
-
},
|
|
162
|
+
}, wa = {
|
|
163
163
|
key: 1,
|
|
164
164
|
class: "artifactuse-form-buttons"
|
|
165
|
-
},
|
|
165
|
+
}, ba = ["disabled", "onClick"], Ca = ["innerHTML"], xa = { class: "artifactuse-form-fields" }, $a = {
|
|
166
166
|
key: 0,
|
|
167
167
|
class: "artifactuse-form-buttons"
|
|
168
|
-
},
|
|
168
|
+
}, Ma = ["type", "disabled", "onClick"], Ta = {
|
|
169
169
|
key: 0,
|
|
170
170
|
class: "artifactuse-form-btn-spinner"
|
|
171
|
-
},
|
|
171
|
+
}, La = ["innerHTML"], Pa = {
|
|
172
172
|
key: 1,
|
|
173
173
|
class: "artifactuse-form-divider"
|
|
174
|
-
},
|
|
174
|
+
}, Aa = {
|
|
175
175
|
key: 2,
|
|
176
176
|
class: "artifactuse-form-heading"
|
|
177
|
-
},
|
|
177
|
+
}, Ha = {
|
|
178
178
|
key: 3,
|
|
179
179
|
class: "artifactuse-form-field"
|
|
180
|
-
},
|
|
180
|
+
}, Ea = { class: "artifactuse-checkbox-label" }, Ba = ["checked", "disabled", "onChange"], Sa = { class: "artifactuse-checkbox-text" }, za = {
|
|
181
181
|
key: 0,
|
|
182
182
|
class: "artifactuse-required"
|
|
183
|
-
},
|
|
183
|
+
}, Va = {
|
|
184
184
|
key: 0,
|
|
185
185
|
class: "artifactuse-help-text"
|
|
186
|
-
},
|
|
186
|
+
}, Ia = {
|
|
187
187
|
key: 1,
|
|
188
188
|
class: "artifactuse-error-text"
|
|
189
|
-
},
|
|
189
|
+
}, Fa = {
|
|
190
190
|
key: 4,
|
|
191
191
|
class: "artifactuse-form-field"
|
|
192
|
-
},
|
|
192
|
+
}, Ra = ["for"], qa = {
|
|
193
193
|
key: 0,
|
|
194
194
|
class: "artifactuse-required"
|
|
195
|
-
},
|
|
195
|
+
}, Oa = ["id", "type", "value", "placeholder", "disabled", "required", "onInput"], Ua = ["id", "value", "placeholder", "disabled", "required", "rows", "onInput"], Da = ["id", "value", "disabled", "required", "onChange"], ja = { value: "" }, Na = ["value", "disabled"], Wa = {
|
|
196
196
|
key: 3,
|
|
197
197
|
class: "artifactuse-radio-group"
|
|
198
|
-
},
|
|
198
|
+
}, Ja = ["name", "value", "checked", "disabled", "onChange"], Xa = {
|
|
199
199
|
key: 4,
|
|
200
200
|
class: "artifactuse-help-text"
|
|
201
|
-
},
|
|
201
|
+
}, Za = {
|
|
202
202
|
key: 5,
|
|
203
203
|
class: "artifactuse-error-text"
|
|
204
|
-
},
|
|
204
|
+
}, Ka = {
|
|
205
205
|
key: 0,
|
|
206
206
|
class: "artifactuse-form-buttons artifactuse-form-buttons-default"
|
|
207
|
-
},
|
|
207
|
+
}, Ya = ["disabled"], Qa = {
|
|
208
208
|
key: 0,
|
|
209
209
|
class: "artifactuse-form-btn-spinner"
|
|
210
|
-
},
|
|
210
|
+
}, Ga = {
|
|
211
211
|
__name: "ArtifactuseInlineForm",
|
|
212
212
|
props: {
|
|
213
213
|
artifact: { type: Object, required: !0 },
|
|
@@ -221,7 +221,7 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
221
221
|
},
|
|
222
222
|
emits: ["submit", "cancel", "reset", "button-click"],
|
|
223
223
|
setup(H, { emit: c }) {
|
|
224
|
-
const _ = H,
|
|
224
|
+
const _ = H, M = c, f = T(_.initialState), o = C(() => f.value !== "active"), q = C(() => f.value === "active" ? "" : `artifactuse-form--${f.value}`);
|
|
225
225
|
function E(w) {
|
|
226
226
|
f.value = w;
|
|
227
227
|
}
|
|
@@ -231,7 +231,7 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
231
231
|
} catch {
|
|
232
232
|
return { title: "Invalid Form", variant: "fields", data: { fields: [] } };
|
|
233
233
|
}
|
|
234
|
-
}), n =
|
|
234
|
+
}), n = T(null), h = C(() => _.artifact.id || g.value.id || `form-${Date.now()}`), $ = C(() => `artifactuse-form-${g.value.variant || "fields"}`), I = C(() => g.value.title || "Form"), x = T({}), j = T({}), O = T(!1), W = C(() => {
|
|
235
235
|
var w;
|
|
236
236
|
return ((w = g.value.data) == null ? void 0 : w.fields) || [];
|
|
237
237
|
}), Y = C(() => {
|
|
@@ -259,7 +259,7 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
259
259
|
w && n.value.style.setProperty("--artifactuse-primary", w);
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
|
-
|
|
262
|
+
$e(() => {
|
|
263
263
|
Z(), f.value = _.initialState;
|
|
264
264
|
}), de(() => _.accent, Z), de(() => _.initialState, (w) => {
|
|
265
265
|
f.value = w;
|
|
@@ -269,7 +269,7 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
269
269
|
const w = {};
|
|
270
270
|
W.value.forEach((B) => {
|
|
271
271
|
["buttons", "divider", "heading"].includes(B.type) || (B.defaultValue !== void 0 ? w[B.name] = B.defaultValue : B.type === "checkbox" ? w[B.name] = !1 : w[B.name] = "");
|
|
272
|
-
}), (r = g.value.data) != null && r.defaults && Object.assign(w, g.value.data.defaults),
|
|
272
|
+
}), (r = g.value.data) != null && r.defaults && Object.assign(w, g.value.data.defaults), x.value = w;
|
|
273
273
|
}
|
|
274
274
|
X(), de(() => _.artifact.code, X);
|
|
275
275
|
function oe(w) {
|
|
@@ -279,14 +279,14 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
279
279
|
return w ? w.map((L) => typeof L == "string" ? { label: L, value: L } : L) : [];
|
|
280
280
|
}
|
|
281
281
|
function k(w, L) {
|
|
282
|
-
|
|
282
|
+
x.value[w] = L, j.value[w] && delete j.value[w];
|
|
283
283
|
}
|
|
284
284
|
function ee() {
|
|
285
285
|
var B;
|
|
286
286
|
const w = {};
|
|
287
287
|
W.value.forEach((u) => {
|
|
288
288
|
if (["buttons", "divider", "heading"].includes(u.type)) return;
|
|
289
|
-
const z =
|
|
289
|
+
const z = x.value[u.name];
|
|
290
290
|
if (u.required && !z && z !== 0 && z !== !1) {
|
|
291
291
|
w[u.name] = `${u.label || "This field"} is required`;
|
|
292
292
|
return;
|
|
@@ -311,18 +311,18 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
311
311
|
const r = (B = g.value.data) == null ? void 0 : B.validation;
|
|
312
312
|
return r && Object.entries(r).forEach(([u, z]) => {
|
|
313
313
|
if (w[u]) return;
|
|
314
|
-
const le =
|
|
314
|
+
const le = x.value[u];
|
|
315
315
|
z.pattern && le && (new RegExp(z.pattern).test(le) || (w[u] = z.message || `${u} is invalid`));
|
|
316
|
-
}),
|
|
316
|
+
}), j.value = w, Object.keys(w).length === 0;
|
|
317
317
|
}
|
|
318
318
|
function re() {
|
|
319
|
-
X(),
|
|
319
|
+
X(), j.value = {};
|
|
320
320
|
}
|
|
321
321
|
function P() {
|
|
322
|
-
ee() && (O.value = !0,
|
|
322
|
+
ee() && (O.value = !0, M("submit", {
|
|
323
323
|
formId: h.value,
|
|
324
324
|
action: "submit",
|
|
325
|
-
values: {
|
|
325
|
+
values: { ...x.value },
|
|
326
326
|
timestamp: Date.now()
|
|
327
327
|
}), setTimeout(() => {
|
|
328
328
|
O.value = !1, E("submitted");
|
|
@@ -335,7 +335,7 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
335
335
|
P();
|
|
336
336
|
break;
|
|
337
337
|
case "cancel":
|
|
338
|
-
|
|
338
|
+
M("cancel", {
|
|
339
339
|
formId: h.value,
|
|
340
340
|
action: "cancel",
|
|
341
341
|
buttonName: w.name || "cancel",
|
|
@@ -345,7 +345,7 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
345
345
|
}, 150);
|
|
346
346
|
break;
|
|
347
347
|
case "reset":
|
|
348
|
-
re(),
|
|
348
|
+
re(), M("reset", {
|
|
349
349
|
formId: h.value,
|
|
350
350
|
action: "reset",
|
|
351
351
|
buttonName: w.name || "reset",
|
|
@@ -354,12 +354,12 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
354
354
|
break;
|
|
355
355
|
case "custom":
|
|
356
356
|
default:
|
|
357
|
-
|
|
357
|
+
M("button-click", {
|
|
358
358
|
formId: h.value,
|
|
359
359
|
action: L,
|
|
360
360
|
buttonName: w.name || w.label,
|
|
361
361
|
buttonLabel: w.label,
|
|
362
|
-
values: {
|
|
362
|
+
values: { ...x.value },
|
|
363
363
|
timestamp: Date.now()
|
|
364
364
|
}), setTimeout(() => {
|
|
365
365
|
E("submitted");
|
|
@@ -370,18 +370,18 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
370
370
|
return (w, L) => (a(), s("div", {
|
|
371
371
|
ref_key: "containerRef",
|
|
372
372
|
ref: n,
|
|
373
|
-
class:
|
|
373
|
+
class: N([
|
|
374
374
|
"artifactuse-inline-form",
|
|
375
|
-
|
|
375
|
+
$.value,
|
|
376
376
|
q.value
|
|
377
377
|
]),
|
|
378
378
|
"data-artifactuse-theme": H.theme
|
|
379
379
|
}, [
|
|
380
|
-
o.value ? (a(), s("div",
|
|
381
|
-
e("div",
|
|
382
|
-
f.value === "submitted" ? (a(), s("svg",
|
|
380
|
+
o.value ? (a(), s("div", va, [
|
|
381
|
+
e("div", fa, [
|
|
382
|
+
f.value === "submitted" ? (a(), s("svg", pa, [...L[1] || (L[1] = [
|
|
383
383
|
e("polyline", { points: "20 6 9 17 4 12" }, null, -1)
|
|
384
|
-
])])) : f.value === "cancelled" ? (a(), s("svg",
|
|
384
|
+
])])) : f.value === "cancelled" ? (a(), s("svg", _a, [...L[2] || (L[2] = [
|
|
385
385
|
e("line", {
|
|
386
386
|
x1: "18",
|
|
387
387
|
y1: "6",
|
|
@@ -394,7 +394,7 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
394
394
|
x2: "18",
|
|
395
395
|
y2: "18"
|
|
396
396
|
}, null, -1)
|
|
397
|
-
])])) : (a(), s("svg",
|
|
397
|
+
])])) : (a(), s("svg", ha, [...L[3] || (L[3] = [
|
|
398
398
|
e("line", {
|
|
399
399
|
x1: "5",
|
|
400
400
|
y1: "12",
|
|
@@ -403,17 +403,17 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
403
403
|
}, null, -1)
|
|
404
404
|
])]))
|
|
405
405
|
]),
|
|
406
|
-
e("span",
|
|
406
|
+
e("span", ma, l(I.value), 1)
|
|
407
407
|
])) : (a(), s(R, { key: 1 }, [
|
|
408
|
-
g.value.title || g.value.description ? (a(), s("div",
|
|
409
|
-
g.value.title ? (a(), s("div",
|
|
410
|
-
g.value.description ? (a(), s("p",
|
|
408
|
+
g.value.title || g.value.description ? (a(), s("div", ya, [
|
|
409
|
+
g.value.title ? (a(), s("div", ga, l(g.value.title), 1)) : v("", !0),
|
|
410
|
+
g.value.description ? (a(), s("p", ka, l(g.value.description), 1)) : v("", !0)
|
|
411
411
|
])) : v("", !0),
|
|
412
|
-
g.value.variant === "buttons" ? (a(), s("div",
|
|
412
|
+
g.value.variant === "buttons" ? (a(), s("div", wa, [
|
|
413
413
|
(a(!0), s(R, null, ve(Y.value, (r) => (a(), s("button", {
|
|
414
414
|
key: r.name || r.label,
|
|
415
415
|
type: "button",
|
|
416
|
-
class:
|
|
416
|
+
class: N(["artifactuse-form-btn", `artifactuse-form-btn-${r.variant || "secondary"}`]),
|
|
417
417
|
disabled: r.disabled || O.value,
|
|
418
418
|
onClick: (B) => Q(r)
|
|
419
419
|
}, [
|
|
@@ -421,93 +421,93 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
421
421
|
key: 0,
|
|
422
422
|
class: "artifactuse-form-btn-icon",
|
|
423
423
|
innerHTML: r.icon
|
|
424
|
-
}, null, 8,
|
|
424
|
+
}, null, 8, Ca)) : v("", !0),
|
|
425
425
|
K(" " + l(r.label), 1)
|
|
426
|
-
], 10,
|
|
426
|
+
], 10, ba))), 128))
|
|
427
427
|
])) : (a(), s("form", {
|
|
428
428
|
key: 2,
|
|
429
429
|
class: "artifactuse-form",
|
|
430
430
|
onSubmit: he(P, ["prevent"])
|
|
431
431
|
}, [
|
|
432
|
-
e("div",
|
|
432
|
+
e("div", xa, [
|
|
433
433
|
(a(!0), s(R, null, ve(W.value, (r, B) => (a(), s(R, {
|
|
434
434
|
key: r.name || B
|
|
435
435
|
}, [
|
|
436
|
-
r.type === "buttons" ? (a(), s("div",
|
|
436
|
+
r.type === "buttons" ? (a(), s("div", $a, [
|
|
437
437
|
(a(!0), s(R, null, ve(r.fields || [], (u) => (a(), s("button", {
|
|
438
438
|
key: u.name || u.label,
|
|
439
439
|
type: u.action === "submit" ? "submit" : "button",
|
|
440
|
-
class:
|
|
440
|
+
class: N(["artifactuse-form-btn", `artifactuse-form-btn-${u.variant || "secondary"}`]),
|
|
441
441
|
disabled: u.disabled || u.action === "submit" && O.value,
|
|
442
442
|
onClick: (z) => u.action !== "submit" ? Q(u) : null
|
|
443
443
|
}, [
|
|
444
|
-
O.value && u.action === "submit" ? (a(), s("span",
|
|
444
|
+
O.value && u.action === "submit" ? (a(), s("span", Ta)) : u.icon ? (a(), s("span", {
|
|
445
445
|
key: 1,
|
|
446
446
|
class: "artifactuse-form-btn-icon",
|
|
447
447
|
innerHTML: u.icon
|
|
448
|
-
}, null, 8,
|
|
448
|
+
}, null, 8, La)) : v("", !0),
|
|
449
449
|
K(" " + l(O.value && u.action === "submit" ? "Submitting..." : u.label), 1)
|
|
450
|
-
], 10,
|
|
451
|
-
])) : r.type === "divider" ? (a(), s("div",
|
|
452
|
-
e("label",
|
|
450
|
+
], 10, Ma))), 128))
|
|
451
|
+
])) : r.type === "divider" ? (a(), s("div", Pa)) : r.type === "heading" ? (a(), s("div", Aa, l(r.label), 1)) : r.type === "checkbox" ? (a(), s("div", Ha, [
|
|
452
|
+
e("label", Ea, [
|
|
453
453
|
e("input", {
|
|
454
454
|
type: "checkbox",
|
|
455
|
-
checked:
|
|
455
|
+
checked: x.value[r.name],
|
|
456
456
|
disabled: r.disabled,
|
|
457
457
|
class: "artifactuse-checkbox",
|
|
458
458
|
onChange: (u) => k(r.name, u.target.checked)
|
|
459
|
-
}, null, 40,
|
|
460
|
-
e("span",
|
|
459
|
+
}, null, 40, Ba),
|
|
460
|
+
e("span", Sa, [
|
|
461
461
|
K(l(r.label) + " ", 1),
|
|
462
|
-
r.required ? (a(), s("span",
|
|
462
|
+
r.required ? (a(), s("span", za, "*")) : v("", !0)
|
|
463
463
|
])
|
|
464
464
|
]),
|
|
465
|
-
r.helpText ? (a(), s("span",
|
|
466
|
-
|
|
467
|
-
])) : (a(), s("div",
|
|
465
|
+
r.helpText ? (a(), s("span", Va, l(r.helpText), 1)) : v("", !0),
|
|
466
|
+
j.value[r.name] ? (a(), s("span", Ia, l(j.value[r.name]), 1)) : v("", !0)
|
|
467
|
+
])) : (a(), s("div", Fa, [
|
|
468
468
|
e("label", {
|
|
469
469
|
for: `${h.value}-${r.name}`,
|
|
470
470
|
class: "artifactuse-label"
|
|
471
471
|
}, [
|
|
472
472
|
K(l(r.label) + " ", 1),
|
|
473
|
-
r.required ? (a(), s("span",
|
|
474
|
-
], 8,
|
|
473
|
+
r.required ? (a(), s("span", qa, "*")) : v("", !0)
|
|
474
|
+
], 8, Ra),
|
|
475
475
|
oe(r.type) ? (a(), s("input", {
|
|
476
476
|
key: 0,
|
|
477
477
|
id: `${h.value}-${r.name}`,
|
|
478
478
|
type: r.type,
|
|
479
|
-
value:
|
|
479
|
+
value: x.value[r.name],
|
|
480
480
|
placeholder: r.placeholder,
|
|
481
481
|
disabled: r.disabled,
|
|
482
482
|
required: r.required,
|
|
483
483
|
class: "artifactuse-input",
|
|
484
484
|
onInput: (u) => k(r.name, u.target.value)
|
|
485
|
-
}, null, 40,
|
|
485
|
+
}, null, 40, Oa)) : r.type === "textarea" ? (a(), s("textarea", {
|
|
486
486
|
key: 1,
|
|
487
487
|
id: `${h.value}-${r.name}`,
|
|
488
|
-
value:
|
|
488
|
+
value: x.value[r.name],
|
|
489
489
|
placeholder: r.placeholder,
|
|
490
490
|
disabled: r.disabled,
|
|
491
491
|
required: r.required,
|
|
492
492
|
rows: r.rows || 3,
|
|
493
493
|
class: "artifactuse-textarea",
|
|
494
494
|
onInput: (u) => k(r.name, u.target.value)
|
|
495
|
-
}, null, 40,
|
|
495
|
+
}, null, 40, Ua)) : r.type === "select" ? (a(), s("select", {
|
|
496
496
|
key: 2,
|
|
497
497
|
id: `${h.value}-${r.name}`,
|
|
498
|
-
value:
|
|
498
|
+
value: x.value[r.name],
|
|
499
499
|
disabled: r.disabled,
|
|
500
500
|
required: r.required,
|
|
501
501
|
class: "artifactuse-select",
|
|
502
502
|
onChange: (u) => k(r.name, u.target.value)
|
|
503
503
|
}, [
|
|
504
|
-
e("option",
|
|
504
|
+
e("option", ja, l(r.placeholder || "Select..."), 1),
|
|
505
505
|
(a(!0), s(R, null, ve(m(r.options), (u) => (a(), s("option", {
|
|
506
506
|
key: u.value,
|
|
507
507
|
value: u.value,
|
|
508
508
|
disabled: u.disabled
|
|
509
509
|
}, l(u.label), 9, Na))), 128))
|
|
510
|
-
], 40,
|
|
510
|
+
], 40, Da)) : r.type === "radio" ? (a(), s("div", Wa, [
|
|
511
511
|
(a(!0), s(R, null, ve(m(r.options), (u) => (a(), s("label", {
|
|
512
512
|
key: u.value,
|
|
513
513
|
class: "artifactuse-radio-label"
|
|
@@ -516,20 +516,20 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
516
516
|
type: "radio",
|
|
517
517
|
name: r.name,
|
|
518
518
|
value: u.value,
|
|
519
|
-
checked:
|
|
519
|
+
checked: x.value[r.name] === u.value,
|
|
520
520
|
disabled: u.disabled || r.disabled,
|
|
521
521
|
class: "artifactuse-radio",
|
|
522
522
|
onChange: (z) => k(r.name, u.value)
|
|
523
|
-
}, null, 40,
|
|
523
|
+
}, null, 40, Ja),
|
|
524
524
|
e("span", null, l(u.label), 1)
|
|
525
525
|
]))), 128))
|
|
526
526
|
])) : v("", !0),
|
|
527
|
-
r.helpText ? (a(), s("span",
|
|
528
|
-
|
|
527
|
+
r.helpText ? (a(), s("span", Xa, l(r.helpText), 1)) : v("", !0),
|
|
528
|
+
j.value[r.name] ? (a(), s("span", Za, l(j.value[r.name]), 1)) : v("", !0)
|
|
529
529
|
]))
|
|
530
530
|
], 64))), 128))
|
|
531
531
|
]),
|
|
532
|
-
S.value ? v("", !0) : (a(), s("div",
|
|
532
|
+
S.value ? v("", !0) : (a(), s("div", Ka, [
|
|
533
533
|
e("button", {
|
|
534
534
|
type: "button",
|
|
535
535
|
class: "artifactuse-form-btn artifactuse-form-btn-ghost",
|
|
@@ -540,79 +540,79 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
540
540
|
class: "artifactuse-form-btn artifactuse-form-btn-primary",
|
|
541
541
|
disabled: O.value
|
|
542
542
|
}, [
|
|
543
|
-
O.value ? (a(), s("span",
|
|
543
|
+
O.value ? (a(), s("span", Qa)) : v("", !0),
|
|
544
544
|
K(" " + l(O.value ? "Submitting..." : "Submit"), 1)
|
|
545
|
-
], 8,
|
|
545
|
+
], 8, Ya)
|
|
546
546
|
]))
|
|
547
547
|
], 32))
|
|
548
548
|
], 64))
|
|
549
|
-
], 10,
|
|
549
|
+
], 10, da));
|
|
550
550
|
}
|
|
551
|
-
},
|
|
551
|
+
}, es = ["data-artifactuse-theme"], ts = { class: "artifactuse-social-header" }, as = ["src", "alt"], ss = { class: "artifactuse-social-author" }, is = { class: "artifactuse-social-author-name" }, ls = { class: "artifactuse-social-author-meta" }, ns = { class: "artifactuse-social-author-handle" }, os = { class: "artifactuse-social-timestamp" }, rs = { class: "artifactuse-social-content" }, cs = ["innerHTML"], us = {
|
|
552
552
|
key: 0,
|
|
553
553
|
class: "artifactuse-social-media"
|
|
554
|
-
},
|
|
554
|
+
}, ds = ["data-count"], vs = ["src", "alt"], fs = {
|
|
555
555
|
key: 1,
|
|
556
556
|
class: "artifactuse-social-link-card"
|
|
557
|
-
},
|
|
557
|
+
}, ps = ["src", "alt"], _s = { class: "artifactuse-social-link-info" }, hs = { class: "artifactuse-social-link-domain" }, ms = { class: "artifactuse-social-link-title" }, ys = {
|
|
558
558
|
key: 0,
|
|
559
559
|
class: "artifactuse-social-link-description"
|
|
560
|
-
},
|
|
560
|
+
}, gs = {
|
|
561
561
|
key: 2,
|
|
562
562
|
class: "artifactuse-social-poll"
|
|
563
|
-
},
|
|
563
|
+
}, ks = { class: "artifactuse-social-poll-label" }, ws = { class: "artifactuse-social-poll-label-percent" }, bs = { class: "artifactuse-social-poll-meta" }, Cs = {
|
|
564
564
|
key: 3,
|
|
565
565
|
class: "artifactuse-social-quote"
|
|
566
|
-
},
|
|
566
|
+
}, xs = { class: "artifactuse-social-quote-header" }, $s = ["src"], Ms = { class: "artifactuse-social-quote-author" }, Ts = { class: "artifactuse-social-quote-handle" }, Ls = { class: "artifactuse-social-quote-text" }, Ps = {
|
|
567
567
|
key: 0,
|
|
568
568
|
class: "artifactuse-social-engagement"
|
|
569
|
-
},
|
|
569
|
+
}, As = { class: "artifactuse-social-stat" }, Hs = { class: "artifactuse-social-stat" }, Es = { class: "artifactuse-social-stat" }, Bs = { class: "artifactuse-social-stat" }, Ss = { class: "artifactuse-social-header" }, zs = ["src", "alt"], Vs = { class: "artifactuse-social-author-info" }, Is = { class: "artifactuse-social-author-name" }, Fs = {
|
|
570
570
|
key: 0,
|
|
571
571
|
class: "artifactuse-social-author-connection"
|
|
572
|
-
},
|
|
572
|
+
}, Rs = { class: "artifactuse-social-author-headline" }, qs = { class: "artifactuse-social-timestamp" }, Os = { class: "artifactuse-social-content" }, Us = ["innerHTML"], Ds = {
|
|
573
573
|
key: 0,
|
|
574
574
|
class: "artifactuse-social-link-card"
|
|
575
|
-
},
|
|
575
|
+
}, js = ["src", "alt"], Ns = { class: "artifactuse-social-link-info" }, Ws = { class: "artifactuse-social-link-title" }, Js = { class: "artifactuse-social-link-domain" }, Xs = {
|
|
576
576
|
key: 0,
|
|
577
577
|
class: "artifactuse-social-engagement"
|
|
578
|
-
},
|
|
578
|
+
}, Zs = { class: "artifactuse-social-reactions" }, Ks = { class: "artifactuse-social-header" }, Ys = ["src", "alt"], Qs = { class: "artifactuse-social-author-name" }, Gs = {
|
|
579
579
|
key: 0,
|
|
580
580
|
class: "artifactuse-social-verified",
|
|
581
581
|
viewBox: "0 0 24 24",
|
|
582
582
|
fill: "currentColor"
|
|
583
|
-
},
|
|
583
|
+
}, ei = {
|
|
584
584
|
key: 0,
|
|
585
585
|
class: "artifactuse-social-media"
|
|
586
|
-
},
|
|
586
|
+
}, ti = ["src", "alt"], ai = { class: "artifactuse-social-likes" }, si = { class: "artifactuse-social-caption" }, ii = { class: "artifactuse-social-caption-author" }, li = ["innerHTML"], ni = { class: "artifactuse-social-timestamp" }, oi = { class: "artifactuse-social-header" }, ri = ["src", "alt"], ci = { class: "artifactuse-social-author-info" }, ui = { class: "artifactuse-social-author-name" }, di = { class: "artifactuse-social-timestamp" }, vi = { class: "artifactuse-social-content" }, fi = ["innerHTML"], pi = {
|
|
587
587
|
key: 0,
|
|
588
588
|
class: "artifactuse-social-link-card"
|
|
589
|
-
},
|
|
589
|
+
}, _i = ["src", "alt"], hi = { class: "artifactuse-social-link-info" }, mi = { class: "artifactuse-social-link-domain" }, yi = { class: "artifactuse-social-link-title" }, gi = {
|
|
590
590
|
key: 0,
|
|
591
591
|
class: "artifactuse-social-link-description"
|
|
592
|
-
},
|
|
592
|
+
}, ki = {
|
|
593
593
|
key: 0,
|
|
594
594
|
class: "artifactuse-social-engagement"
|
|
595
|
-
},
|
|
595
|
+
}, wi = { class: "artifactuse-social-reactions" }, bi = { class: "artifactuse-social-reaction-count" }, Ci = { class: "artifactuse-social-comments-shares" }, xi = { class: "artifactuse-social-header" }, $i = ["src", "alt"], Mi = { class: "artifactuse-social-author-info" }, Ti = { class: "artifactuse-social-author-name" }, Li = {
|
|
596
596
|
key: 0,
|
|
597
597
|
class: "artifactuse-social-verified",
|
|
598
598
|
viewBox: "0 0 24 24",
|
|
599
599
|
fill: "currentColor"
|
|
600
|
-
},
|
|
600
|
+
}, Pi = { class: "artifactuse-social-timestamp" }, Ai = { class: "artifactuse-social-content" }, Hi = ["innerHTML"], Ei = {
|
|
601
601
|
key: 0,
|
|
602
602
|
class: "artifactuse-social-engagement"
|
|
603
|
-
},
|
|
603
|
+
}, Bi = { class: "artifactuse-social-stat" }, Si = { class: "artifactuse-social-stat" }, zi = { class: "artifactuse-social-stat" }, Vi = { class: "artifactuse-social-thumbnail" }, Ii = ["src", "alt"], Fi = {
|
|
604
604
|
key: 1,
|
|
605
605
|
class: "artifactuse-social-duration"
|
|
606
|
-
},
|
|
606
|
+
}, Ri = { class: "artifactuse-social-info" }, qi = { class: "artifactuse-social-header" }, Oi = ["src", "alt"], Ui = { class: "artifactuse-social-author-name" }, Di = ["innerHTML"], ji = {
|
|
607
607
|
key: 0,
|
|
608
608
|
class: "artifactuse-social-sound"
|
|
609
609
|
}, Ni = {
|
|
610
610
|
key: 1,
|
|
611
611
|
class: "artifactuse-social-engagement"
|
|
612
|
-
},
|
|
612
|
+
}, Wi = { class: "artifactuse-social-thumbnail" }, Ji = ["src", "alt"], Xi = {
|
|
613
613
|
key: 1,
|
|
614
614
|
class: "artifactuse-social-duration"
|
|
615
|
-
},
|
|
615
|
+
}, Zi = { class: "artifactuse-social-info" }, Ki = ["src", "alt"], Yi = { class: "artifactuse-social-title" }, Qi = { class: "artifactuse-social-channel" }, Gi = { class: "artifactuse-social-meta" }, el = { class: "artifactuse-social-actions-bar" }, tl = { class: "artifactuse-social-platform-badge" }, _e = 'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23888"><circle cx="12" cy="8" r="4"/><path d="M12 14c-6 0-8 3-8 6v2h16v-2c0-3-2-6-8-6z"/></svg>', al = {
|
|
616
616
|
__name: "ArtifactuseSocialPreview",
|
|
617
617
|
props: {
|
|
618
618
|
artifact: {
|
|
@@ -626,7 +626,7 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
626
626
|
},
|
|
627
627
|
emits: ["copy", "edit"],
|
|
628
628
|
setup(H, { emit: c }) {
|
|
629
|
-
const _ = H,
|
|
629
|
+
const _ = H, M = c, f = T(null), o = T("Copy"), q = C(() => {
|
|
630
630
|
try {
|
|
631
631
|
return JSON.parse(_.artifact.code);
|
|
632
632
|
} catch {
|
|
@@ -649,13 +649,13 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
649
649
|
}), h = C(() => {
|
|
650
650
|
var m, k;
|
|
651
651
|
return ((k = (m = q.value) == null ? void 0 : m.data) == null ? void 0 : k.engagement) || {};
|
|
652
|
-
}),
|
|
652
|
+
}), $ = C(() => {
|
|
653
653
|
var m, k;
|
|
654
654
|
return ((k = (m = q.value) == null ? void 0 : m.data) == null ? void 0 : k.meta) || {};
|
|
655
655
|
}), I = C(() => {
|
|
656
656
|
const m = h.value;
|
|
657
657
|
return m.likes || m.comments || m.shares || m.retweets || m.replies || m.views;
|
|
658
|
-
}),
|
|
658
|
+
}), x = C(() => `artifactuse-social-verified-${g.value.verifiedType || "blue"}`), j = C(() => ({
|
|
659
659
|
twitter: "X",
|
|
660
660
|
linkedin: "LinkedIn",
|
|
661
661
|
instagram: "Instagram",
|
|
@@ -719,7 +719,7 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
719
719
|
navigator.clipboard.writeText(m).then(() => {
|
|
720
720
|
o.value = "Copied!", setTimeout(() => {
|
|
721
721
|
o.value = "Copy";
|
|
722
|
-
}, 2e3),
|
|
722
|
+
}, 2e3), M("copy", { platform: E.value, text: m });
|
|
723
723
|
});
|
|
724
724
|
}
|
|
725
725
|
return (m, k) => {
|
|
@@ -727,43 +727,43 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
727
727
|
return a(), s("div", {
|
|
728
728
|
ref_key: "containerRef",
|
|
729
729
|
ref: f,
|
|
730
|
-
class:
|
|
730
|
+
class: N(["artifactuse-social", [`artifactuse-social-${E.value}`]]),
|
|
731
731
|
"data-artifactuse-theme": H.theme
|
|
732
732
|
}, [
|
|
733
733
|
E.value === "twitter" ? (a(), s(R, { key: 0 }, [
|
|
734
|
-
e("div",
|
|
734
|
+
e("div", ts, [
|
|
735
735
|
e("img", {
|
|
736
736
|
src: g.value.avatar || _e,
|
|
737
737
|
alt: g.value.name,
|
|
738
738
|
class: "artifactuse-social-avatar",
|
|
739
739
|
onError: Z
|
|
740
|
-
}, null, 40,
|
|
741
|
-
e("div",
|
|
742
|
-
e("div",
|
|
740
|
+
}, null, 40, as),
|
|
741
|
+
e("div", ss, [
|
|
742
|
+
e("div", is, [
|
|
743
743
|
e("span", null, l(g.value.name), 1),
|
|
744
744
|
g.value.verified ? (a(), s("svg", {
|
|
745
745
|
key: 0,
|
|
746
|
-
class:
|
|
746
|
+
class: N(["artifactuse-social-verified", x.value]),
|
|
747
747
|
viewBox: "0 0 24 24",
|
|
748
748
|
fill: "currentColor"
|
|
749
749
|
}, [...k[0] || (k[0] = [
|
|
750
750
|
e("path", { d: "M22.25 12c0-1.43-.88-2.67-2.19-3.34.46-1.39.2-2.9-.81-3.91s-2.52-1.27-3.91-.81c-.66-1.31-1.91-2.19-3.34-2.19s-2.67.88-3.34 2.19c-1.39-.46-2.9-.2-3.91.81s-1.27 2.52-.81 3.91C2.63 9.33 1.75 10.57 1.75 12s.88 2.67 2.19 3.34c-.46 1.39-.2 2.9.81 3.91s2.52 1.27 3.91.81c.66 1.31 1.91 2.19 3.34 2.19s2.67-.88 3.34-2.19c1.39.46 2.9.2 3.91-.81s1.27-2.52.81-3.91c1.31-.67 2.19-1.91 2.19-3.34zm-11.71 4.2L6.8 12.46l1.41-1.42 2.26 2.26 4.8-5.23 1.47 1.36-6.2 6.77z" }, null, -1)
|
|
751
751
|
])], 2)) : v("", !0)
|
|
752
752
|
]),
|
|
753
|
-
e("div",
|
|
754
|
-
e("span",
|
|
755
|
-
e("span",
|
|
753
|
+
e("div", ls, [
|
|
754
|
+
e("span", ns, l(g.value.handle), 1),
|
|
755
|
+
e("span", os, "· " + l($.value.timestamp || "Just now"), 1)
|
|
756
756
|
])
|
|
757
757
|
])
|
|
758
758
|
]),
|
|
759
|
-
e("div",
|
|
759
|
+
e("div", rs, [
|
|
760
760
|
e("p", {
|
|
761
761
|
class: "artifactuse-social-text",
|
|
762
762
|
innerHTML: W.value
|
|
763
|
-
}, null, 8,
|
|
764
|
-
(ee = n.value.media) != null && ee.length ? (a(), s("div",
|
|
763
|
+
}, null, 8, cs),
|
|
764
|
+
(ee = n.value.media) != null && ee.length ? (a(), s("div", us, [
|
|
765
765
|
e("div", {
|
|
766
|
-
class:
|
|
766
|
+
class: N(["artifactuse-social-media-grid", { "artifactuse-social-media-single": n.value.media.length === 1 }]),
|
|
767
767
|
"data-count": n.value.media.length
|
|
768
768
|
}, [
|
|
769
769
|
(a(!0), s(R, null, ve(n.value.media.slice(0, 4), (r, B) => (a(), s("img", {
|
|
@@ -771,19 +771,19 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
771
771
|
src: r.url,
|
|
772
772
|
alt: r.alt || "",
|
|
773
773
|
onError: X
|
|
774
|
-
}, null, 40,
|
|
775
|
-
], 10,
|
|
774
|
+
}, null, 40, vs))), 128))
|
|
775
|
+
], 10, ds)
|
|
776
776
|
])) : v("", !0),
|
|
777
|
-
n.value.link && !((re = n.value.media) != null && re.length) ? (a(), s("div",
|
|
777
|
+
n.value.link && !((re = n.value.media) != null && re.length) ? (a(), s("div", fs, [
|
|
778
778
|
n.value.link.image ? (a(), s("img", {
|
|
779
779
|
key: 0,
|
|
780
780
|
src: n.value.link.image,
|
|
781
781
|
alt: n.value.link.title,
|
|
782
782
|
class: "artifactuse-social-link-image",
|
|
783
783
|
onError: X
|
|
784
|
-
}, null, 40,
|
|
785
|
-
e("div",
|
|
786
|
-
e("div",
|
|
784
|
+
}, null, 40, ps)) : v("", !0),
|
|
785
|
+
e("div", _s, [
|
|
786
|
+
e("div", hs, [
|
|
787
787
|
k[1] || (k[1] = e("svg", {
|
|
788
788
|
fill: "none",
|
|
789
789
|
viewBox: "0 0 24 24",
|
|
@@ -798,11 +798,11 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
798
798
|
], -1)),
|
|
799
799
|
K(" " + l(n.value.link.domain || ie(n.value.link.url)), 1)
|
|
800
800
|
]),
|
|
801
|
-
e("div",
|
|
802
|
-
n.value.link.description ? (a(), s("div",
|
|
801
|
+
e("div", ms, l(n.value.link.title), 1),
|
|
802
|
+
n.value.link.description ? (a(), s("div", ys, l(n.value.link.description), 1)) : v("", !0)
|
|
803
803
|
])
|
|
804
804
|
])) : v("", !0),
|
|
805
|
-
n.value.poll ? (a(), s("div",
|
|
805
|
+
n.value.poll ? (a(), s("div", gs, [
|
|
806
806
|
(a(!0), s(R, null, ve(n.value.poll.options, (r, B) => {
|
|
807
807
|
var u, z;
|
|
808
808
|
return a(), s("div", {
|
|
@@ -813,28 +813,28 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
813
813
|
class: "artifactuse-social-poll-bar",
|
|
814
814
|
style: He({ width: `${((u = n.value.poll.votes) == null ? void 0 : u[B]) || 0}%` })
|
|
815
815
|
}, null, 4),
|
|
816
|
-
e("div",
|
|
816
|
+
e("div", ks, [
|
|
817
817
|
e("span", null, l(r), 1),
|
|
818
|
-
e("span",
|
|
818
|
+
e("span", ws, l(((z = n.value.poll.votes) == null ? void 0 : z[B]) || 0) + "%", 1)
|
|
819
819
|
])
|
|
820
820
|
]);
|
|
821
821
|
}), 128)),
|
|
822
|
-
e("div",
|
|
822
|
+
e("div", bs, l(S(n.value.poll.totalVotes || 0)) + " votes · " + l(n.value.poll.duration || "Poll ended"), 1)
|
|
823
823
|
])) : v("", !0),
|
|
824
|
-
n.value.quote ? (a(), s("div",
|
|
825
|
-
e("div",
|
|
824
|
+
n.value.quote ? (a(), s("div", Cs, [
|
|
825
|
+
e("div", xs, [
|
|
826
826
|
e("img", {
|
|
827
827
|
src: ((P = n.value.quote.author) == null ? void 0 : P.avatar) || _e,
|
|
828
828
|
class: "artifactuse-social-quote-avatar"
|
|
829
|
-
}, null, 8,
|
|
830
|
-
e("span",
|
|
831
|
-
e("span",
|
|
829
|
+
}, null, 8, $s),
|
|
830
|
+
e("span", Ms, l((Q = n.value.quote.author) == null ? void 0 : Q.name), 1),
|
|
831
|
+
e("span", Ts, l((w = n.value.quote.author) == null ? void 0 : w.handle), 1)
|
|
832
832
|
]),
|
|
833
|
-
e("p",
|
|
833
|
+
e("p", Ls, l(n.value.quote.text), 1)
|
|
834
834
|
])) : v("", !0)
|
|
835
835
|
]),
|
|
836
|
-
I.value ? (a(), s("div",
|
|
837
|
-
e("div",
|
|
836
|
+
I.value ? (a(), s("div", Ps, [
|
|
837
|
+
e("div", As, [
|
|
838
838
|
k[2] || (k[2] = e("svg", {
|
|
839
839
|
viewBox: "0 0 24 24",
|
|
840
840
|
fill: "none",
|
|
@@ -845,7 +845,7 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
845
845
|
], -1)),
|
|
846
846
|
e("span", null, l(S(h.value.replies || 0)), 1)
|
|
847
847
|
]),
|
|
848
|
-
e("div",
|
|
848
|
+
e("div", Hs, [
|
|
849
849
|
k[3] || (k[3] = e("svg", {
|
|
850
850
|
viewBox: "0 0 24 24",
|
|
851
851
|
fill: "none",
|
|
@@ -856,7 +856,7 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
856
856
|
], -1)),
|
|
857
857
|
e("span", null, l(S(h.value.retweets || 0)), 1)
|
|
858
858
|
]),
|
|
859
|
-
e("div",
|
|
859
|
+
e("div", Es, [
|
|
860
860
|
k[4] || (k[4] = e("svg", {
|
|
861
861
|
viewBox: "0 0 24 24",
|
|
862
862
|
fill: "none",
|
|
@@ -867,7 +867,7 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
867
867
|
], -1)),
|
|
868
868
|
e("span", null, l(S(h.value.likes || 0)), 1)
|
|
869
869
|
]),
|
|
870
|
-
e("div",
|
|
870
|
+
e("div", Bs, [
|
|
871
871
|
k[5] || (k[5] = e("svg", {
|
|
872
872
|
viewBox: "0 0 24 24",
|
|
873
873
|
fill: "none",
|
|
@@ -880,21 +880,21 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
880
880
|
])
|
|
881
881
|
])) : v("", !0)
|
|
882
882
|
], 64)) : E.value === "linkedin" ? (a(), s(R, { key: 1 }, [
|
|
883
|
-
e("div",
|
|
883
|
+
e("div", Ss, [
|
|
884
884
|
e("img", {
|
|
885
885
|
src: g.value.avatar || _e,
|
|
886
886
|
alt: g.value.name,
|
|
887
887
|
class: "artifactuse-social-avatar",
|
|
888
888
|
onError: Z
|
|
889
|
-
}, null, 40,
|
|
890
|
-
e("div",
|
|
891
|
-
e("div",
|
|
889
|
+
}, null, 40, zs),
|
|
890
|
+
e("div", Vs, [
|
|
891
|
+
e("div", Is, [
|
|
892
892
|
K(l(g.value.name) + " ", 1),
|
|
893
|
-
g.value.connection ? (a(), s("span",
|
|
893
|
+
g.value.connection ? (a(), s("span", Fs, "· " + l(g.value.connection), 1)) : v("", !0)
|
|
894
894
|
]),
|
|
895
|
-
e("div",
|
|
896
|
-
e("div",
|
|
897
|
-
K(l(
|
|
895
|
+
e("div", Rs, l(g.value.headline), 1),
|
|
896
|
+
e("div", qs, [
|
|
897
|
+
K(l($.value.timestamp || "Just now") + " · ", 1),
|
|
898
898
|
k[6] || (k[6] = e("svg", {
|
|
899
899
|
viewBox: "0 0 24 24",
|
|
900
900
|
fill: "currentColor"
|
|
@@ -904,27 +904,27 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
904
904
|
])
|
|
905
905
|
])
|
|
906
906
|
]),
|
|
907
|
-
e("div",
|
|
907
|
+
e("div", Os, [
|
|
908
908
|
e("p", {
|
|
909
909
|
class: "artifactuse-social-text",
|
|
910
910
|
innerHTML: W.value
|
|
911
|
-
}, null, 8,
|
|
912
|
-
n.value.link ? (a(), s("div",
|
|
911
|
+
}, null, 8, Us),
|
|
912
|
+
n.value.link ? (a(), s("div", Ds, [
|
|
913
913
|
n.value.link.image ? (a(), s("img", {
|
|
914
914
|
key: 0,
|
|
915
915
|
src: n.value.link.image,
|
|
916
916
|
alt: n.value.link.title,
|
|
917
917
|
class: "artifactuse-social-link-image",
|
|
918
918
|
onError: X
|
|
919
|
-
}, null, 40,
|
|
919
|
+
}, null, 40, js)) : v("", !0),
|
|
920
920
|
e("div", Ns, [
|
|
921
|
-
e("div",
|
|
922
|
-
e("div",
|
|
921
|
+
e("div", Ws, l(n.value.link.title), 1),
|
|
922
|
+
e("div", Js, l(n.value.link.domain || ie(n.value.link.url)), 1)
|
|
923
923
|
])
|
|
924
924
|
])) : v("", !0)
|
|
925
925
|
]),
|
|
926
|
-
I.value ? (a(), s("div",
|
|
927
|
-
e("div",
|
|
926
|
+
I.value ? (a(), s("div", Xs, [
|
|
927
|
+
e("div", Zs, [
|
|
928
928
|
k[7] || (k[7] = e("div", { class: "artifactuse-social-reaction-icons" }, [
|
|
929
929
|
e("span", { class: "artifactuse-social-reaction-icon" }, "👍"),
|
|
930
930
|
e("span", { class: "artifactuse-social-reaction-icon" }, "❤️"),
|
|
@@ -935,49 +935,49 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
935
935
|
e("span", null, l(S(h.value.comments || 0)) + " comments · " + l(S(h.value.shares || 0)) + " shares", 1)
|
|
936
936
|
])) : v("", !0)
|
|
937
937
|
], 64)) : E.value === "instagram" ? (a(), s(R, { key: 2 }, [
|
|
938
|
-
e("div",
|
|
938
|
+
e("div", Ks, [
|
|
939
939
|
e("img", {
|
|
940
940
|
src: g.value.avatar || _e,
|
|
941
941
|
alt: g.value.name,
|
|
942
942
|
class: "artifactuse-social-avatar",
|
|
943
943
|
onError: Z
|
|
944
|
-
}, null, 40,
|
|
945
|
-
e("div",
|
|
944
|
+
}, null, 40, Ys),
|
|
945
|
+
e("div", Qs, [
|
|
946
946
|
K(l(g.value.name) + " ", 1),
|
|
947
|
-
g.value.verified ? (a(), s("svg",
|
|
947
|
+
g.value.verified ? (a(), s("svg", Gs, [...k[8] || (k[8] = [
|
|
948
948
|
e("path", { d: "M22.25 12c0-1.43-.88-2.67-2.19-3.34.46-1.39.2-2.9-.81-3.91s-2.52-1.27-3.91-.81c-.66-1.31-1.91-2.19-3.34-2.19s-2.67.88-3.34 2.19c-1.39-.46-2.9-.2-3.91.81s-1.27 2.52-.81 3.91C2.63 9.33 1.75 10.57 1.75 12s.88 2.67 2.19 3.34c-.46 1.39-.2 2.9.81 3.91s2.52 1.27 3.91.81c.66 1.31 1.91 2.19 3.34 2.19s2.67-.88 3.34-2.19c1.39.46 2.9.2 3.91-.81s1.27-2.52.81-3.91c1.31-.67 2.19-1.91 2.19-3.34zm-11.71 4.2L6.8 12.46l1.41-1.42 2.26 2.26 4.8-5.23 1.47 1.36-6.2 6.77z" }, null, -1)
|
|
949
949
|
])])) : v("", !0)
|
|
950
950
|
])
|
|
951
951
|
]),
|
|
952
|
-
(L = n.value.media) != null && L.length ? (a(), s("div",
|
|
952
|
+
(L = n.value.media) != null && L.length ? (a(), s("div", ei, [
|
|
953
953
|
e("img", {
|
|
954
954
|
src: n.value.media[0].url,
|
|
955
955
|
alt: n.value.media[0].alt || "",
|
|
956
956
|
onError: X
|
|
957
|
-
}, null, 40,
|
|
957
|
+
}, null, 40, ti)
|
|
958
958
|
])) : v("", !0),
|
|
959
|
-
k[9] || (k[9] =
|
|
960
|
-
e("div",
|
|
961
|
-
e("div",
|
|
962
|
-
e("span",
|
|
959
|
+
k[9] || (k[9] = Ut('<div class="artifactuse-social-actions"><div class="artifactuse-social-action"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"></path></svg></div><div class="artifactuse-social-action"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 11.5a8.38 8.38 0 01-.9 3.8 8.5 8.5 0 01-7.6 4.7 8.38 8.38 0 01-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 01-.9-3.8 8.5 8.5 0 014.7-7.6 8.38 8.38 0 013.8-.9h.5a8.48 8.48 0 018 8v.5z"></path></svg></div><div class="artifactuse-social-action"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"></path></svg></div></div>', 1)),
|
|
960
|
+
e("div", ai, l(S(h.value.likes || 0)) + " likes", 1),
|
|
961
|
+
e("div", si, [
|
|
962
|
+
e("span", ii, l(g.value.name), 1),
|
|
963
963
|
e("span", {
|
|
964
964
|
class: "artifactuse-social-caption-text",
|
|
965
965
|
innerHTML: W.value
|
|
966
|
-
}, null, 8,
|
|
966
|
+
}, null, 8, li)
|
|
967
967
|
]),
|
|
968
|
-
e("div",
|
|
968
|
+
e("div", ni, l($.value.timestamp || "Just now"), 1)
|
|
969
969
|
], 64)) : E.value === "facebook" ? (a(), s(R, { key: 3 }, [
|
|
970
|
-
e("div",
|
|
970
|
+
e("div", oi, [
|
|
971
971
|
e("img", {
|
|
972
972
|
src: g.value.avatar || _e,
|
|
973
973
|
alt: g.value.name,
|
|
974
974
|
class: "artifactuse-social-avatar",
|
|
975
975
|
onError: Z
|
|
976
|
-
}, null, 40,
|
|
977
|
-
e("div",
|
|
978
|
-
e("div",
|
|
979
|
-
e("div",
|
|
980
|
-
K(l(
|
|
976
|
+
}, null, 40, ri),
|
|
977
|
+
e("div", ci, [
|
|
978
|
+
e("div", ui, l(g.value.name), 1),
|
|
979
|
+
e("div", di, [
|
|
980
|
+
K(l($.value.timestamp || "Just now") + " · ", 1),
|
|
981
981
|
k[10] || (k[10] = e("svg", {
|
|
982
982
|
viewBox: "0 0 24 24",
|
|
983
983
|
fill: "currentColor"
|
|
@@ -987,63 +987,63 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
987
987
|
])
|
|
988
988
|
])
|
|
989
989
|
]),
|
|
990
|
-
e("div",
|
|
990
|
+
e("div", vi, [
|
|
991
991
|
e("p", {
|
|
992
992
|
class: "artifactuse-social-text",
|
|
993
993
|
innerHTML: W.value
|
|
994
|
-
}, null, 8,
|
|
995
|
-
n.value.link ? (a(), s("div",
|
|
994
|
+
}, null, 8, fi),
|
|
995
|
+
n.value.link ? (a(), s("div", pi, [
|
|
996
996
|
n.value.link.image ? (a(), s("img", {
|
|
997
997
|
key: 0,
|
|
998
998
|
src: n.value.link.image,
|
|
999
999
|
alt: n.value.link.title,
|
|
1000
1000
|
class: "artifactuse-social-link-image",
|
|
1001
1001
|
onError: X
|
|
1002
|
-
}, null, 40,
|
|
1003
|
-
e("div",
|
|
1004
|
-
e("div",
|
|
1005
|
-
e("div",
|
|
1006
|
-
n.value.link.description ? (a(), s("div",
|
|
1002
|
+
}, null, 40, _i)) : v("", !0),
|
|
1003
|
+
e("div", hi, [
|
|
1004
|
+
e("div", mi, l(n.value.link.domain || ie(n.value.link.url)), 1),
|
|
1005
|
+
e("div", yi, l(n.value.link.title), 1),
|
|
1006
|
+
n.value.link.description ? (a(), s("div", gi, l(n.value.link.description), 1)) : v("", !0)
|
|
1007
1007
|
])
|
|
1008
1008
|
])) : v("", !0)
|
|
1009
1009
|
]),
|
|
1010
|
-
I.value ? (a(), s("div",
|
|
1011
|
-
e("div",
|
|
1010
|
+
I.value ? (a(), s("div", ki, [
|
|
1011
|
+
e("div", wi, [
|
|
1012
1012
|
k[11] || (k[11] = e("div", { class: "artifactuse-social-reaction-emojis" }, [
|
|
1013
1013
|
e("span", { class: "artifactuse-social-reaction-emoji" }, "👍"),
|
|
1014
1014
|
e("span", { class: "artifactuse-social-reaction-emoji" }, "❤️"),
|
|
1015
1015
|
e("span", { class: "artifactuse-social-reaction-emoji" }, "😂")
|
|
1016
1016
|
], -1)),
|
|
1017
|
-
e("span",
|
|
1017
|
+
e("span", bi, l(S(Y.value)), 1)
|
|
1018
1018
|
]),
|
|
1019
|
-
e("span",
|
|
1019
|
+
e("span", Ci, l(S(h.value.comments || 0)) + " comments · " + l(S(h.value.shares || 0)) + " shares", 1)
|
|
1020
1020
|
])) : v("", !0)
|
|
1021
1021
|
], 64)) : E.value === "threads" ? (a(), s(R, { key: 4 }, [
|
|
1022
|
-
e("div",
|
|
1022
|
+
e("div", xi, [
|
|
1023
1023
|
e("img", {
|
|
1024
1024
|
src: g.value.avatar || _e,
|
|
1025
1025
|
alt: g.value.name,
|
|
1026
1026
|
class: "artifactuse-social-avatar",
|
|
1027
1027
|
onError: Z
|
|
1028
|
-
}, null, 40,
|
|
1029
|
-
e("div",
|
|
1030
|
-
e("div",
|
|
1028
|
+
}, null, 40, $i),
|
|
1029
|
+
e("div", Mi, [
|
|
1030
|
+
e("div", Ti, [
|
|
1031
1031
|
K(l(g.value.name) + " ", 1),
|
|
1032
|
-
g.value.verified ? (a(), s("svg",
|
|
1032
|
+
g.value.verified ? (a(), s("svg", Li, [...k[12] || (k[12] = [
|
|
1033
1033
|
e("path", { d: "M22.25 12c0-1.43-.88-2.67-2.19-3.34.46-1.39.2-2.9-.81-3.91s-2.52-1.27-3.91-.81c-.66-1.31-1.91-2.19-3.34-2.19s-2.67.88-3.34 2.19c-1.39-.46-2.9-.2-3.91.81s-1.27 2.52-.81 3.91C2.63 9.33 1.75 10.57 1.75 12s.88 2.67 2.19 3.34c-.46 1.39-.2 2.9.81 3.91s2.52 1.27 3.91.81c.66 1.31 1.91 2.19 3.34 2.19s2.67-.88 3.34-2.19c1.39.46 2.9.2 3.91-.81s1.27-2.52.81-3.91c1.31-.67 2.19-1.91 2.19-3.34zm-11.71 4.2L6.8 12.46l1.41-1.42 2.26 2.26 4.8-5.23 1.47 1.36-6.2 6.77z" }, null, -1)
|
|
1034
1034
|
])])) : v("", !0)
|
|
1035
1035
|
]),
|
|
1036
|
-
e("span",
|
|
1036
|
+
e("span", Pi, l($.value.timestamp || "Just now"), 1)
|
|
1037
1037
|
])
|
|
1038
1038
|
]),
|
|
1039
|
-
e("div",
|
|
1039
|
+
e("div", Ai, [
|
|
1040
1040
|
e("p", {
|
|
1041
1041
|
class: "artifactuse-social-text",
|
|
1042
1042
|
innerHTML: W.value
|
|
1043
|
-
}, null, 8,
|
|
1043
|
+
}, null, 8, Hi)
|
|
1044
1044
|
]),
|
|
1045
|
-
I.value ? (a(), s("div",
|
|
1046
|
-
e("div",
|
|
1045
|
+
I.value ? (a(), s("div", Ei, [
|
|
1046
|
+
e("div", Bi, [
|
|
1047
1047
|
k[13] || (k[13] = e("svg", {
|
|
1048
1048
|
viewBox: "0 0 24 24",
|
|
1049
1049
|
fill: "none",
|
|
@@ -1054,7 +1054,7 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
1054
1054
|
], -1)),
|
|
1055
1055
|
e("span", null, l(S(h.value.likes || 0)), 1)
|
|
1056
1056
|
]),
|
|
1057
|
-
e("div",
|
|
1057
|
+
e("div", Si, [
|
|
1058
1058
|
k[14] || (k[14] = e("svg", {
|
|
1059
1059
|
viewBox: "0 0 24 24",
|
|
1060
1060
|
fill: "none",
|
|
@@ -1065,7 +1065,7 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
1065
1065
|
], -1)),
|
|
1066
1066
|
e("span", null, l(S(h.value.comments || 0)), 1)
|
|
1067
1067
|
]),
|
|
1068
|
-
e("div",
|
|
1068
|
+
e("div", zi, [
|
|
1069
1069
|
k[15] || (k[15] = e("svg", {
|
|
1070
1070
|
viewBox: "0 0 24 24",
|
|
1071
1071
|
fill: "none",
|
|
@@ -1078,13 +1078,13 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
1078
1078
|
])
|
|
1079
1079
|
])) : v("", !0)
|
|
1080
1080
|
], 64)) : E.value === "tiktok" ? (a(), s(R, { key: 5 }, [
|
|
1081
|
-
e("div",
|
|
1081
|
+
e("div", Vi, [
|
|
1082
1082
|
n.value.thumbnail ? (a(), s("img", {
|
|
1083
1083
|
key: 0,
|
|
1084
1084
|
src: n.value.thumbnail,
|
|
1085
1085
|
alt: n.value.text,
|
|
1086
1086
|
onError: X
|
|
1087
|
-
}, null, 40,
|
|
1087
|
+
}, null, 40, Ii)) : v("", !0),
|
|
1088
1088
|
k[16] || (k[16] = e("div", { class: "artifactuse-social-play-button" }, [
|
|
1089
1089
|
e("div", { class: "artifactuse-social-play-icon" }, [
|
|
1090
1090
|
e("svg", {
|
|
@@ -1095,23 +1095,23 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
1095
1095
|
])
|
|
1096
1096
|
])
|
|
1097
1097
|
], -1)),
|
|
1098
|
-
n.value.duration ? (a(), s("div",
|
|
1098
|
+
n.value.duration ? (a(), s("div", Fi, l(n.value.duration), 1)) : v("", !0)
|
|
1099
1099
|
]),
|
|
1100
|
-
e("div",
|
|
1101
|
-
e("div",
|
|
1100
|
+
e("div", Ri, [
|
|
1101
|
+
e("div", qi, [
|
|
1102
1102
|
e("img", {
|
|
1103
1103
|
src: g.value.avatar || _e,
|
|
1104
1104
|
alt: g.value.name,
|
|
1105
1105
|
class: "artifactuse-social-avatar",
|
|
1106
1106
|
onError: Z
|
|
1107
|
-
}, null, 40,
|
|
1108
|
-
e("span",
|
|
1107
|
+
}, null, 40, Oi),
|
|
1108
|
+
e("span", Ui, l(g.value.name), 1)
|
|
1109
1109
|
]),
|
|
1110
1110
|
e("p", {
|
|
1111
1111
|
class: "artifactuse-social-text",
|
|
1112
1112
|
innerHTML: W.value
|
|
1113
|
-
}, null, 8,
|
|
1114
|
-
n.value.sound ? (a(), s("div",
|
|
1113
|
+
}, null, 8, Di),
|
|
1114
|
+
n.value.sound ? (a(), s("div", ji, [
|
|
1115
1115
|
k[17] || (k[17] = e("svg", {
|
|
1116
1116
|
viewBox: "0 0 24 24",
|
|
1117
1117
|
fill: "currentColor"
|
|
@@ -1127,33 +1127,33 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
1127
1127
|
])) : v("", !0)
|
|
1128
1128
|
])
|
|
1129
1129
|
], 64)) : E.value === "youtube" ? (a(), s(R, { key: 6 }, [
|
|
1130
|
-
e("div",
|
|
1130
|
+
e("div", Wi, [
|
|
1131
1131
|
n.value.thumbnail ? (a(), s("img", {
|
|
1132
1132
|
key: 0,
|
|
1133
1133
|
src: n.value.thumbnail,
|
|
1134
1134
|
alt: n.value.title,
|
|
1135
1135
|
onError: X
|
|
1136
|
-
}, null, 40,
|
|
1137
|
-
n.value.duration ? (a(), s("div",
|
|
1136
|
+
}, null, 40, Ji)) : v("", !0),
|
|
1137
|
+
n.value.duration ? (a(), s("div", Xi, l(n.value.duration), 1)) : v("", !0)
|
|
1138
1138
|
]),
|
|
1139
|
-
e("div",
|
|
1139
|
+
e("div", Zi, [
|
|
1140
1140
|
e("img", {
|
|
1141
1141
|
src: g.value.avatar || _e,
|
|
1142
1142
|
alt: g.value.name,
|
|
1143
1143
|
class: "artifactuse-social-avatar",
|
|
1144
1144
|
onError: Z
|
|
1145
|
-
}, null, 40,
|
|
1145
|
+
}, null, 40, Ki),
|
|
1146
1146
|
e("div", null, [
|
|
1147
|
-
e("div",
|
|
1148
|
-
e("div",
|
|
1149
|
-
e("div",
|
|
1147
|
+
e("div", Yi, l(n.value.title || n.value.text), 1),
|
|
1148
|
+
e("div", Qi, l(g.value.name), 1),
|
|
1149
|
+
e("div", Gi, l(S(h.value.views || 0)) + " views · " + l($.value.timestamp || "Just now"), 1)
|
|
1150
1150
|
])
|
|
1151
1151
|
])
|
|
1152
1152
|
], 64)) : v("", !0),
|
|
1153
|
-
e("div",
|
|
1154
|
-
e("div",
|
|
1155
|
-
(a(),
|
|
1156
|
-
e("span", null, l(
|
|
1153
|
+
e("div", el, [
|
|
1154
|
+
e("div", tl, [
|
|
1155
|
+
(a(), xe(Dt(O.value))),
|
|
1156
|
+
e("span", null, l(j.value), 1)
|
|
1157
1157
|
]),
|
|
1158
1158
|
e("button", {
|
|
1159
1159
|
class: "artifactuse-social-copy-btn",
|
|
@@ -1178,28 +1178,28 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
1178
1178
|
K(" " + l(o.value), 1)
|
|
1179
1179
|
])
|
|
1180
1180
|
])
|
|
1181
|
-
], 10,
|
|
1181
|
+
], 10, es);
|
|
1182
1182
|
};
|
|
1183
1183
|
}
|
|
1184
|
-
},
|
|
1184
|
+
}, sl = ["src", "alt"], il = ["src"], ll = {
|
|
1185
1185
|
key: 2,
|
|
1186
1186
|
class: "artifactuse-viewer-controls"
|
|
1187
|
-
},
|
|
1187
|
+
}, nl = ["title"], ol = {
|
|
1188
1188
|
key: 0,
|
|
1189
1189
|
viewBox: "0 0 24 24",
|
|
1190
1190
|
fill: "none",
|
|
1191
1191
|
stroke: "currentColor",
|
|
1192
1192
|
"stroke-width": "2"
|
|
1193
|
-
},
|
|
1193
|
+
}, rl = {
|
|
1194
1194
|
key: 1,
|
|
1195
1195
|
viewBox: "0 0 24 24",
|
|
1196
1196
|
fill: "none",
|
|
1197
1197
|
stroke: "currentColor",
|
|
1198
1198
|
"stroke-width": "2"
|
|
1199
|
-
},
|
|
1199
|
+
}, cl = {
|
|
1200
1200
|
key: 3,
|
|
1201
1201
|
class: "artifactuse-viewer-caption"
|
|
1202
|
-
},
|
|
1202
|
+
}, ul = {
|
|
1203
1203
|
__name: "ArtifactuseViewer",
|
|
1204
1204
|
props: {
|
|
1205
1205
|
// Whether the viewer is open
|
|
@@ -1230,9 +1230,9 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
1230
1230
|
},
|
|
1231
1231
|
emits: ["close"],
|
|
1232
1232
|
setup(H, { emit: c }) {
|
|
1233
|
-
const _ = H,
|
|
1233
|
+
const _ = H, M = c, f = T(null), o = T(!1);
|
|
1234
1234
|
function q() {
|
|
1235
|
-
o.value = !1,
|
|
1235
|
+
o.value = !1, M("close");
|
|
1236
1236
|
}
|
|
1237
1237
|
function E() {
|
|
1238
1238
|
_.type === "image" && (o.value = !o.value);
|
|
@@ -1245,15 +1245,15 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
1245
1245
|
h.key === "Escape" && _.isOpen && q();
|
|
1246
1246
|
}
|
|
1247
1247
|
return de(() => _.isOpen, (h) => {
|
|
1248
|
-
h ? (
|
|
1249
|
-
var
|
|
1250
|
-
(
|
|
1248
|
+
h ? (Ce(() => {
|
|
1249
|
+
var $;
|
|
1250
|
+
($ = f.value) == null || $.focus();
|
|
1251
1251
|
}), document.body.style.overflow = "hidden") : (document.body.style.overflow = "", o.value = !1);
|
|
1252
|
-
}),
|
|
1252
|
+
}), $e(() => {
|
|
1253
1253
|
document.addEventListener("keydown", n);
|
|
1254
1254
|
}), We(() => {
|
|
1255
1255
|
document.removeEventListener("keydown", n), document.body.style.overflow = "";
|
|
1256
|
-
}), (h,
|
|
1256
|
+
}), (h, $) => (a(), xe(jt, { to: "body" }, [
|
|
1257
1257
|
ze(Ee, { name: "artifactuse-viewer" }, {
|
|
1258
1258
|
default: Be(() => [
|
|
1259
1259
|
H.isOpen ? (a(), s("div", {
|
|
@@ -1267,25 +1267,25 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
1267
1267
|
}, [
|
|
1268
1268
|
e("div", {
|
|
1269
1269
|
class: "artifactuse-viewer-content",
|
|
1270
|
-
onClick:
|
|
1270
|
+
onClick: $[0] || ($[0] = he(() => {
|
|
1271
1271
|
}, ["stop"]))
|
|
1272
1272
|
}, [
|
|
1273
1273
|
H.type === "image" ? (a(), s("img", {
|
|
1274
1274
|
key: 0,
|
|
1275
1275
|
src: H.src,
|
|
1276
1276
|
alt: H.alt,
|
|
1277
|
-
class:
|
|
1277
|
+
class: N(["artifactuse-viewer-image", { "artifactuse-viewer-image--zoomed": o.value }]),
|
|
1278
1278
|
onClick: E
|
|
1279
|
-
}, null, 10,
|
|
1279
|
+
}, null, 10, sl)) : H.type === "pdf" ? (a(), s("iframe", {
|
|
1280
1280
|
key: 1,
|
|
1281
1281
|
src: H.src,
|
|
1282
1282
|
class: "artifactuse-viewer-pdf"
|
|
1283
|
-
}, null, 8,
|
|
1283
|
+
}, null, 8, il)) : v("", !0),
|
|
1284
1284
|
e("button", {
|
|
1285
1285
|
class: "artifactuse-viewer-close",
|
|
1286
1286
|
onClick: q,
|
|
1287
1287
|
title: "Close (Esc)"
|
|
1288
|
-
}, [
|
|
1288
|
+
}, [...$[1] || ($[1] = [
|
|
1289
1289
|
e("svg", {
|
|
1290
1290
|
viewBox: "0 0 24 24",
|
|
1291
1291
|
fill: "none",
|
|
@@ -1306,13 +1306,13 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
1306
1306
|
})
|
|
1307
1307
|
], -1)
|
|
1308
1308
|
])]),
|
|
1309
|
-
H.type === "image" ? (a(), s("div",
|
|
1309
|
+
H.type === "image" ? (a(), s("div", ll, [
|
|
1310
1310
|
e("button", {
|
|
1311
1311
|
class: "artifactuse-viewer-control",
|
|
1312
1312
|
onClick: he(E, ["stop"]),
|
|
1313
1313
|
title: o.value ? "Zoom out" : "Zoom in"
|
|
1314
1314
|
}, [
|
|
1315
|
-
o.value ? (a(), s("svg",
|
|
1315
|
+
o.value ? (a(), s("svg", rl, [...$[3] || ($[3] = [
|
|
1316
1316
|
e("circle", {
|
|
1317
1317
|
cx: "11",
|
|
1318
1318
|
cy: "11",
|
|
@@ -1330,7 +1330,7 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
1330
1330
|
x2: "14",
|
|
1331
1331
|
y2: "11"
|
|
1332
1332
|
}, null, -1)
|
|
1333
|
-
])])) : (a(), s("svg",
|
|
1333
|
+
])])) : (a(), s("svg", ol, [...$[2] || ($[2] = [
|
|
1334
1334
|
e("circle", {
|
|
1335
1335
|
cx: "11",
|
|
1336
1336
|
cy: "11",
|
|
@@ -1355,12 +1355,12 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
1355
1355
|
y2: "11"
|
|
1356
1356
|
}, null, -1)
|
|
1357
1357
|
])]))
|
|
1358
|
-
], 8,
|
|
1358
|
+
], 8, nl),
|
|
1359
1359
|
e("button", {
|
|
1360
1360
|
class: "artifactuse-viewer-control",
|
|
1361
1361
|
onClick: he(g, ["stop"]),
|
|
1362
1362
|
title: "Download"
|
|
1363
|
-
}, [
|
|
1363
|
+
}, [...$[4] || ($[4] = [
|
|
1364
1364
|
e("svg", {
|
|
1365
1365
|
viewBox: "0 0 24 24",
|
|
1366
1366
|
fill: "none",
|
|
@@ -1378,7 +1378,7 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
1378
1378
|
], -1)
|
|
1379
1379
|
])])
|
|
1380
1380
|
])) : v("", !0),
|
|
1381
|
-
H.caption ? (a(), s("div",
|
|
1381
|
+
H.caption ? (a(), s("div", cl, l(H.caption), 1)) : v("", !0)
|
|
1382
1382
|
])
|
|
1383
1383
|
], 544)) : v("", !0)
|
|
1384
1384
|
]),
|
|
@@ -1386,7 +1386,7 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
1386
1386
|
})
|
|
1387
1387
|
]));
|
|
1388
1388
|
}
|
|
1389
|
-
},
|
|
1389
|
+
}, dl = ["innerHTML"], uo = {
|
|
1390
1390
|
__name: "ArtifactuseAgentMessage",
|
|
1391
1391
|
props: {
|
|
1392
1392
|
// The raw message content (markdown/HTML from AI)
|
|
@@ -1448,24 +1448,24 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
1448
1448
|
"media-open"
|
|
1449
1449
|
],
|
|
1450
1450
|
setup(H, { expose: c, emit: _ }) {
|
|
1451
|
-
const
|
|
1451
|
+
const M = H, f = _, {
|
|
1452
1452
|
processMessage: o,
|
|
1453
1453
|
openArtifact: q,
|
|
1454
1454
|
state: E,
|
|
1455
1455
|
getTheme: g,
|
|
1456
1456
|
instance: n
|
|
1457
|
-
} = Ve(), h =
|
|
1458
|
-
let
|
|
1459
|
-
const O =
|
|
1457
|
+
} = Ve(), h = T(null), $ = T(null), I = T(""), x = T([]);
|
|
1458
|
+
let j = null;
|
|
1459
|
+
const O = T(!1), W = T("image"), Y = T(""), S = T(""), ie = T(""), Z = C(() => (g == null ? void 0 : g()) || "dark"), X = C(() => E.activeArtifactId), oe = C(() => {
|
|
1460
1460
|
var b;
|
|
1461
|
-
return
|
|
1462
|
-
}), m =
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
}), de(() =>
|
|
1461
|
+
return M.inlineCards ?? ((b = n == null ? void 0 : n.config) == null ? void 0 : b.inlineCards) ?? !0;
|
|
1462
|
+
}), m = T(!1);
|
|
1463
|
+
$e(() => {
|
|
1464
|
+
M.typing && (m.value = !0);
|
|
1465
|
+
}), de(() => M.typing, (b) => {
|
|
1466
1466
|
b && (m.value = !0);
|
|
1467
1467
|
});
|
|
1468
|
-
const k = C(() => m.value ||
|
|
1468
|
+
const k = C(() => m.value || M.isLastMessage ? "active" : "inactive");
|
|
1469
1469
|
function ee(b) {
|
|
1470
1470
|
if (!b) return null;
|
|
1471
1471
|
try {
|
|
@@ -1507,8 +1507,8 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
1507
1507
|
O.value = !1, Y.value = "", S.value = "", ie.value = "";
|
|
1508
1508
|
}
|
|
1509
1509
|
function w() {
|
|
1510
|
-
if (
|
|
1511
|
-
|
|
1510
|
+
if (!$.value) return;
|
|
1511
|
+
$.value.querySelectorAll('img[data-lightbox="true"]').forEach((d) => {
|
|
1512
1512
|
d._lightboxHandler && d.removeEventListener("click", d._lightboxHandler), d._lightboxHandler = (U) => {
|
|
1513
1513
|
U.preventDefault(), U.stopPropagation(), P({
|
|
1514
1514
|
type: "image",
|
|
@@ -1517,29 +1517,29 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
1517
1517
|
caption: d.dataset.caption || d.alt || ""
|
|
1518
1518
|
});
|
|
1519
1519
|
}, d.addEventListener("click", d._lightboxHandler), d.style.cursor = "zoom-in";
|
|
1520
|
-
}),
|
|
1520
|
+
}), $.value.querySelectorAll(".artifactuse-image-container img").forEach((d) => {
|
|
1521
1521
|
d._lightboxHandler || (d._lightboxHandler = (U) => {
|
|
1522
1522
|
U.preventDefault(), U.stopPropagation();
|
|
1523
|
-
const G = d.closest(".artifactuse-image-container"), ce = G == null ? void 0 : G.querySelector(".artifactuse-image-caption"),
|
|
1523
|
+
const G = d.closest(".artifactuse-image-container"), ce = G == null ? void 0 : G.querySelector(".artifactuse-image-caption"), Me = (ce == null ? void 0 : ce.textContent) || d.dataset.caption || d.alt || "";
|
|
1524
1524
|
P({
|
|
1525
1525
|
type: "image",
|
|
1526
1526
|
src: d.src,
|
|
1527
1527
|
alt: d.alt || "",
|
|
1528
|
-
caption:
|
|
1528
|
+
caption: Me
|
|
1529
1529
|
});
|
|
1530
1530
|
}, d.addEventListener("click", d._lightboxHandler), d.style.cursor = "zoom-in");
|
|
1531
|
-
}),
|
|
1531
|
+
}), $.value.querySelectorAll(".artifactuse-gallery-item img, .artifactuse-image-gallery img").forEach((d) => {
|
|
1532
1532
|
d._lightboxHandler || (d._lightboxHandler = (U) => {
|
|
1533
1533
|
U.preventDefault(), U.stopPropagation();
|
|
1534
|
-
const G = d.closest(".artifactuse-gallery-item"), ce = G == null ? void 0 : G.querySelector(".artifactuse-gallery-caption"),
|
|
1534
|
+
const G = d.closest(".artifactuse-gallery-item"), ce = G == null ? void 0 : G.querySelector(".artifactuse-gallery-caption"), Me = (ce == null ? void 0 : ce.textContent) || d.dataset.caption || d.alt || "";
|
|
1535
1535
|
P({
|
|
1536
1536
|
type: "image",
|
|
1537
1537
|
src: d.src,
|
|
1538
1538
|
alt: d.alt || "",
|
|
1539
|
-
caption:
|
|
1539
|
+
caption: Me
|
|
1540
1540
|
});
|
|
1541
1541
|
}, d.addEventListener("click", d._lightboxHandler), d.style.cursor = "zoom-in");
|
|
1542
|
-
}),
|
|
1542
|
+
}), $.value.querySelectorAll('a[href$=".pdf"], a[data-type="pdf"]').forEach((d) => {
|
|
1543
1543
|
d._pdfHandler && d.removeEventListener("click", d._pdfHandler), d._pdfHandler = (U) => {
|
|
1544
1544
|
U.preventDefault(), U.stopPropagation(), P({
|
|
1545
1545
|
type: "pdf",
|
|
@@ -1548,7 +1548,7 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
1548
1548
|
caption: d.title || d.textContent || ""
|
|
1549
1549
|
});
|
|
1550
1550
|
}, d.addEventListener("click", d._pdfHandler);
|
|
1551
|
-
}),
|
|
1551
|
+
}), $.value.querySelectorAll(".artifactuse-pdf-container, [data-pdf-viewer]").forEach((d) => {
|
|
1552
1552
|
var G;
|
|
1553
1553
|
d._pdfHandler && d.removeEventListener("click", d._pdfHandler);
|
|
1554
1554
|
const U = d.dataset.pdfSrc || ((G = d.querySelector("iframe")) == null ? void 0 : G.src) || "";
|
|
@@ -1560,7 +1560,7 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
1560
1560
|
caption: d.dataset.caption || ""
|
|
1561
1561
|
});
|
|
1562
1562
|
}, d.addEventListener("click", d._pdfHandler), d.style.cursor = "pointer");
|
|
1563
|
-
}),
|
|
1563
|
+
}), $.value.querySelectorAll(".artifactuse-video-preview-wrapper, .video-preview-wrapper").forEach((d) => {
|
|
1564
1564
|
d._clickHandler && d.removeEventListener("click", d._clickHandler), d._clickHandler = (U) => {
|
|
1565
1565
|
if (U.target.closest(".artifactuse-video-play-button")) return;
|
|
1566
1566
|
const G = d.dataset.videoUrl || d.dataset.url;
|
|
@@ -1569,22 +1569,22 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
1569
1569
|
});
|
|
1570
1570
|
}
|
|
1571
1571
|
function L() {
|
|
1572
|
-
if (
|
|
1573
|
-
|
|
1572
|
+
if (!$.value) return;
|
|
1573
|
+
$.value.querySelectorAll("img").forEach((A) => {
|
|
1574
1574
|
A._lightboxHandler && (A.removeEventListener("click", A._lightboxHandler), delete A._lightboxHandler);
|
|
1575
|
-
}),
|
|
1575
|
+
}), $.value.querySelectorAll('a[href$=".pdf"], a[data-type="pdf"]').forEach((A) => {
|
|
1576
1576
|
A._pdfHandler && (A.removeEventListener("click", A._pdfHandler), delete A._pdfHandler);
|
|
1577
|
-
}),
|
|
1577
|
+
}), $.value.querySelectorAll(".artifactuse-pdf-container, [data-pdf-viewer]").forEach((A) => {
|
|
1578
1578
|
A._pdfHandler && (A.removeEventListener("click", A._pdfHandler), delete A._pdfHandler);
|
|
1579
|
-
}),
|
|
1579
|
+
}), $.value.querySelectorAll(".artifactuse-video-preview-wrapper, .video-preview-wrapper").forEach((A) => {
|
|
1580
1580
|
A._clickHandler && (A.removeEventListener("click", A._clickHandler), delete A._clickHandler);
|
|
1581
1581
|
});
|
|
1582
1582
|
}
|
|
1583
1583
|
function r() {
|
|
1584
|
-
|
|
1585
|
-
if (await
|
|
1584
|
+
j && clearTimeout(j), j = setTimeout(async () => {
|
|
1585
|
+
if (await Ce(), n != null && n.initializeContent && $.value)
|
|
1586
1586
|
try {
|
|
1587
|
-
await n.initializeContent(
|
|
1587
|
+
await n.initializeContent($.value);
|
|
1588
1588
|
} catch (b) {
|
|
1589
1589
|
console.error("Failed to initialize content:", b);
|
|
1590
1590
|
}
|
|
@@ -1592,28 +1592,28 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
1592
1592
|
}, 100);
|
|
1593
1593
|
}
|
|
1594
1594
|
de(
|
|
1595
|
-
() =>
|
|
1595
|
+
() => M.content,
|
|
1596
1596
|
(b) => {
|
|
1597
1597
|
if (b) {
|
|
1598
|
-
const V = o(b,
|
|
1599
|
-
inlinePreview:
|
|
1600
|
-
inlineCode:
|
|
1601
|
-
tabs:
|
|
1602
|
-
viewMode:
|
|
1598
|
+
const V = o(b, M.messageId, {
|
|
1599
|
+
inlinePreview: M.inlinePreview,
|
|
1600
|
+
inlineCode: M.inlineCode,
|
|
1601
|
+
tabs: M.tabs,
|
|
1602
|
+
viewMode: M.viewMode
|
|
1603
1603
|
});
|
|
1604
|
-
I.value = V.html,
|
|
1604
|
+
I.value = V.html, x.value = V.artifacts, V.artifacts.length > 0 && f("artifact-detected", V.artifacts), M.typing || r();
|
|
1605
1605
|
}
|
|
1606
1606
|
},
|
|
1607
1607
|
{ immediate: !0 }
|
|
1608
1608
|
), de(
|
|
1609
|
-
() =>
|
|
1609
|
+
() => M.typing,
|
|
1610
1610
|
(b, V) => {
|
|
1611
1611
|
V === !0 && b === !1 && r();
|
|
1612
1612
|
}
|
|
1613
|
-
),
|
|
1614
|
-
|
|
1615
|
-
}),
|
|
1616
|
-
|
|
1613
|
+
), $e(() => {
|
|
1614
|
+
M.typing || r();
|
|
1615
|
+
}), Wt(() => {
|
|
1616
|
+
j && clearTimeout(j), L();
|
|
1617
1617
|
});
|
|
1618
1618
|
function B(b) {
|
|
1619
1619
|
const V = b.target.closest(".artifactuse-inline-preview");
|
|
@@ -1647,7 +1647,7 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
1647
1647
|
function Pe(b) {
|
|
1648
1648
|
f("social-copy", b);
|
|
1649
1649
|
}
|
|
1650
|
-
return C(() => E.artifacts.filter((b) => b.messageId ===
|
|
1650
|
+
return C(() => E.artifacts.filter((b) => b.messageId === M.messageId)), c({
|
|
1651
1651
|
openViewer: P,
|
|
1652
1652
|
closeViewer: Q,
|
|
1653
1653
|
attachMediaListeners: w
|
|
@@ -1659,14 +1659,14 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
1659
1659
|
e("div", {
|
|
1660
1660
|
class: "artifactuse-message-content",
|
|
1661
1661
|
ref_key: "contentRef",
|
|
1662
|
-
ref:
|
|
1662
|
+
ref: $,
|
|
1663
1663
|
onClick: B
|
|
1664
1664
|
}, [
|
|
1665
1665
|
(a(!0), s(R, null, ve(re.value, (D, te) => (a(), s(R, { key: te }, [
|
|
1666
1666
|
D.type === "html" ? (a(), s("div", {
|
|
1667
1667
|
key: 0,
|
|
1668
1668
|
innerHTML: D.content
|
|
1669
|
-
}, null, 8,
|
|
1669
|
+
}, null, 8, dl)) : D.type === "form" && D.artifact.isInline ? (a(), xe(Ga, {
|
|
1670
1670
|
key: 1,
|
|
1671
1671
|
artifact: D.artifact,
|
|
1672
1672
|
theme: Z.value,
|
|
@@ -1674,12 +1674,12 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
1674
1674
|
onSubmit: pe,
|
|
1675
1675
|
onCancel: ye,
|
|
1676
1676
|
onButtonClick: fe
|
|
1677
|
-
}, null, 8, ["artifact", "theme", "initial-state"])) : D.type === "social" ? (a(),
|
|
1677
|
+
}, null, 8, ["artifact", "theme", "initial-state"])) : D.type === "social" ? (a(), xe(al, {
|
|
1678
1678
|
key: 2,
|
|
1679
1679
|
artifact: D.artifact,
|
|
1680
1680
|
theme: Z.value,
|
|
1681
1681
|
onCopy: Pe
|
|
1682
|
-
}, null, 8, ["artifact", "theme"])) : D.type === "panel" && oe.value ? (a(),
|
|
1682
|
+
}, null, 8, ["artifact", "theme"])) : D.type === "panel" && oe.value ? (a(), xe(ua, {
|
|
1683
1683
|
key: 3,
|
|
1684
1684
|
artifact: D.artifact,
|
|
1685
1685
|
"is-active": X.value === D.artifact.id,
|
|
@@ -1689,7 +1689,7 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
1689
1689
|
}, null, 8, ["artifact", "is-active"])) : v("", !0)
|
|
1690
1690
|
], 64))), 128))
|
|
1691
1691
|
], 512),
|
|
1692
|
-
ze(
|
|
1692
|
+
ze(ul, {
|
|
1693
1693
|
"is-open": O.value,
|
|
1694
1694
|
type: W.value,
|
|
1695
1695
|
src: Y.value,
|
|
@@ -1699,134 +1699,135 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
1699
1699
|
}, null, 8, ["is-open", "type", "src", "alt", "caption"])
|
|
1700
1700
|
], 512));
|
|
1701
1701
|
}
|
|
1702
|
-
},
|
|
1702
|
+
}, vl = { class: "artifactuse-panel__header artifactuse-panel__header--simple" }, fl = { class: "artifactuse-panel__title" }, pl = { class: "artifactuse-panel__icon" }, _l = {
|
|
1703
1703
|
key: 0,
|
|
1704
1704
|
viewBox: "0 0 24 24",
|
|
1705
1705
|
fill: "none",
|
|
1706
1706
|
stroke: "currentColor",
|
|
1707
1707
|
"stroke-width": "2"
|
|
1708
|
-
},
|
|
1708
|
+
}, hl = {
|
|
1709
1709
|
key: 1,
|
|
1710
1710
|
viewBox: "0 0 24 24",
|
|
1711
1711
|
fill: "none",
|
|
1712
1712
|
stroke: "currentColor",
|
|
1713
1713
|
"stroke-width": "2"
|
|
1714
|
-
},
|
|
1714
|
+
}, ml = { class: "artifactuse-panel__title-content" }, yl = { class: "artifactuse-panel__name" }, gl = { class: "artifactuse-panel__actions" }, kl = { class: "artifactuse-panel__empty" }, wl = { class: "artifactuse-panel__empty-title" }, bl = { class: "artifactuse-panel__empty-text" }, Cl = { class: "artifactuse-panel__footer artifactuse-panel__footer--simple" }, xl = {
|
|
1715
1715
|
key: 0,
|
|
1716
1716
|
href: "https://artifactuse.com",
|
|
1717
1717
|
target: "_blank",
|
|
1718
1718
|
rel: "noopener noreferrer",
|
|
1719
1719
|
class: "artifactuse-panel__branding"
|
|
1720
|
-
},
|
|
1720
|
+
}, $l = { class: "artifactuse-panel__header artifactuse-panel__header--simple" }, Ml = { class: "artifactuse-panel__title" }, Tl = { class: "artifactuse-panel__title-content" }, Ll = { class: "artifactuse-panel__meta" }, Pl = { class: "artifactuse-panel__actions" }, Al = ["disabled"], Hl = {
|
|
1721
1721
|
key: 0,
|
|
1722
1722
|
viewBox: "0 0 24 24",
|
|
1723
1723
|
fill: "none",
|
|
1724
1724
|
stroke: "currentColor",
|
|
1725
1725
|
"stroke-width": "2"
|
|
1726
|
-
},
|
|
1726
|
+
}, El = {
|
|
1727
1727
|
key: 1,
|
|
1728
1728
|
class: "artifactuse-panel__spinner-icon",
|
|
1729
1729
|
viewBox: "0 0 24 24",
|
|
1730
1730
|
fill: "none",
|
|
1731
1731
|
stroke: "currentColor",
|
|
1732
1732
|
"stroke-width": "2"
|
|
1733
|
-
},
|
|
1733
|
+
}, Bl = { class: "artifactuse-panel__list" }, Sl = { class: "artifactuse-panel__list-items" }, zl = ["onClick"], Vl = ["innerHTML"], Il = { class: "artifactuse-panel__list-item-content" }, Fl = { class: "artifactuse-panel__list-item-title" }, Rl = { class: "artifactuse-panel__list-item-meta" }, ql = { class: "artifactuse-panel__footer artifactuse-panel__footer--simple" }, Ol = {
|
|
1734
1734
|
key: 0,
|
|
1735
1735
|
href: "https://artifactuse.com",
|
|
1736
1736
|
target: "_blank",
|
|
1737
1737
|
rel: "noopener noreferrer",
|
|
1738
1738
|
class: "artifactuse-panel__branding"
|
|
1739
|
-
},
|
|
1739
|
+
}, Ul = { class: "artifactuse-panel__header" }, Dl = ["title"], jl = { class: "artifactuse-panel__title" }, Nl = ["innerHTML"], Wl = { class: "artifactuse-panel__title-content" }, Jl = { class: "artifactuse-panel__name" }, Xl = { class: "artifactuse-panel__meta" }, Zl = { class: "artifactuse-panel__tabs" }, Kl = ["disabled"], Yl = ["disabled"], Ql = { class: "artifactuse-panel__actions" }, Gl = ["title"], en = {
|
|
1740
1740
|
key: 0,
|
|
1741
1741
|
viewBox: "0 0 24 24",
|
|
1742
1742
|
fill: "none",
|
|
1743
1743
|
stroke: "currentColor",
|
|
1744
1744
|
"stroke-width": "2"
|
|
1745
|
-
},
|
|
1745
|
+
}, tn = {
|
|
1746
1746
|
key: 1,
|
|
1747
1747
|
viewBox: "0 0 24 24",
|
|
1748
1748
|
fill: "none",
|
|
1749
1749
|
stroke: "currentColor",
|
|
1750
1750
|
"stroke-width": "2"
|
|
1751
|
-
},
|
|
1751
|
+
}, an = {
|
|
1752
1752
|
key: 0,
|
|
1753
1753
|
class: "artifactuse-panel__file-tabs"
|
|
1754
|
-
},
|
|
1754
|
+
}, sn = { class: "artifactuse-panel__file-tabs-scroll" }, ln = ["onClick"], nn = ["innerHTML"], on = { class: "artifactuse-panel__file-tab-title" }, rn = ["onClick"], cn = {
|
|
1755
1755
|
key: 0,
|
|
1756
1756
|
class: "artifactuse-panel__loading"
|
|
1757
|
-
},
|
|
1757
|
+
}, un = {
|
|
1758
1758
|
key: 0,
|
|
1759
1759
|
class: "artifactuse-panel__loading"
|
|
1760
|
-
},
|
|
1760
|
+
}, dn = ["src"], vn = {
|
|
1761
1761
|
key: 2,
|
|
1762
1762
|
class: "artifactuse-panel__no-preview"
|
|
1763
|
-
},
|
|
1763
|
+
}, fn = { class: "artifactuse-panel__edit" }, pn = { class: "artifactuse-panel__footer" }, _n = { class: "artifactuse-panel__footer-left" }, hn = {
|
|
1764
1764
|
key: 0,
|
|
1765
1765
|
href: "https://artifactuse.com",
|
|
1766
1766
|
target: "_blank",
|
|
1767
1767
|
rel: "noopener noreferrer",
|
|
1768
1768
|
class: "artifactuse-panel__branding"
|
|
1769
|
-
},
|
|
1769
|
+
}, mn = {
|
|
1770
1770
|
key: 1,
|
|
1771
1771
|
class: "artifactuse-panel__badge"
|
|
1772
|
-
},
|
|
1772
|
+
}, yn = { class: "artifactuse-panel__footer-right" }, gn = ["title"], kn = {
|
|
1773
1773
|
key: 0,
|
|
1774
1774
|
viewBox: "0 0 24 24",
|
|
1775
1775
|
fill: "none",
|
|
1776
1776
|
stroke: "currentColor",
|
|
1777
1777
|
"stroke-width": "2"
|
|
1778
|
-
},
|
|
1778
|
+
}, wn = {
|
|
1779
1779
|
key: 1,
|
|
1780
1780
|
viewBox: "0 0 24 24",
|
|
1781
1781
|
fill: "none",
|
|
1782
1782
|
stroke: "currentColor",
|
|
1783
1783
|
"stroke-width": "2"
|
|
1784
|
-
},
|
|
1784
|
+
}, bn = {
|
|
1785
1785
|
key: 0,
|
|
1786
1786
|
style: { position: "relative" }
|
|
1787
|
-
},
|
|
1787
|
+
}, Cn = {
|
|
1788
1788
|
key: 0,
|
|
1789
1789
|
class: "artifactuse-share-popup"
|
|
1790
|
-
},
|
|
1790
|
+
}, xn = { class: "artifactuse-share-popup__header" }, $n = { class: "artifactuse-share-popup__title" }, Mn = { class: "artifactuse-share-popup__body" }, Tn = {
|
|
1791
1791
|
key: 0,
|
|
1792
1792
|
class: "artifactuse-share-popup__loading"
|
|
1793
|
-
},
|
|
1793
|
+
}, Ln = { key: 1 }, Pn = { class: "artifactuse-share-popup__error" }, An = { class: "artifactuse-share-popup__error-text" }, Hn = { class: "artifactuse-share-popup__actions" }, En = {
|
|
1794
1794
|
key: 2,
|
|
1795
1795
|
class: "artifactuse-share-popup__options"
|
|
1796
|
-
},
|
|
1796
|
+
}, Bn = { key: 3 }, Sn = {
|
|
1797
1797
|
key: 0,
|
|
1798
1798
|
class: "artifactuse-share-popup__loading"
|
|
1799
|
-
},
|
|
1799
|
+
}, zn = {
|
|
1800
1800
|
key: 1,
|
|
1801
1801
|
class: "artifactuse-share-popup__empty"
|
|
1802
|
-
},
|
|
1802
|
+
}, Vn = {
|
|
1803
1803
|
key: 2,
|
|
1804
1804
|
class: "artifactuse-share-popup__artifact-list"
|
|
1805
|
-
},
|
|
1805
|
+
}, In = ["onClick"], Fn = { class: "artifactuse-share-popup__artifact-name" }, Rn = { class: "artifactuse-share-popup__artifact-date" }, qn = {
|
|
1806
1806
|
key: 4,
|
|
1807
1807
|
class: "artifactuse-share-popup__success"
|
|
1808
|
-
},
|
|
1808
|
+
}, On = { class: "artifactuse-share-popup__link-wrapper" }, Un = ["value"], Dn = {
|
|
1809
1809
|
key: 0,
|
|
1810
1810
|
class: "artifactuse-share-popup__expiry"
|
|
1811
|
-
},
|
|
1811
|
+
}, jn = { class: "artifactuse-share-popup__expiry-text" }, Nn = {
|
|
1812
1812
|
key: 1,
|
|
1813
1813
|
class: "artifactuse-share-popup__save-prompt"
|
|
1814
|
-
},
|
|
1814
|
+
}, Wn = {
|
|
1815
1815
|
key: 2,
|
|
1816
1816
|
class: "artifactuse-panel__nav"
|
|
1817
|
-
},
|
|
1817
|
+
}, Jn = ["disabled"], Xn = ["disabled"], Zn = {
|
|
1818
1818
|
key: 0,
|
|
1819
1819
|
class: "artifactuse-panel__artifact-list"
|
|
1820
|
-
},
|
|
1820
|
+
}, Kn = { class: "artifactuse-panel__artifact-list-header" }, Yn = { class: "artifactuse-panel__artifact-list-items" }, Qn = ["onClick"], Gn = ["innerHTML"], eo = { class: "artifactuse-panel__artifact-item-content" }, to = { class: "artifactuse-panel__artifact-item-title" }, ao = { class: "artifactuse-panel__artifact-item-meta" }, so = { class: "artifactuse-panel__artifact-item-index" }, vo = {
|
|
1821
1821
|
__name: "ArtifactusePanel",
|
|
1822
1822
|
props: {
|
|
1823
1823
|
panelWidth: { type: Number, default: void 0 },
|
|
1824
|
-
splitPosition: { type: Number, default: void 0 }
|
|
1824
|
+
splitPosition: { type: Number, default: void 0 },
|
|
1825
|
+
externalPreview: { type: Boolean, default: void 0 }
|
|
1825
1826
|
},
|
|
1826
1827
|
emits: ["close", "ai-request", "save", "export", "resize"],
|
|
1827
1828
|
setup(H, { emit: c }) {
|
|
1828
|
-
var
|
|
1829
|
-
const _ = c,
|
|
1829
|
+
var lt, nt;
|
|
1830
|
+
const _ = c, M = H, {
|
|
1830
1831
|
state: f,
|
|
1831
1832
|
activeArtifact: o,
|
|
1832
1833
|
artifactCount: q,
|
|
@@ -1834,58 +1835,61 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
1834
1835
|
closePanel: g,
|
|
1835
1836
|
toggleFullscreen: n,
|
|
1836
1837
|
setViewMode: h,
|
|
1837
|
-
getPanelUrl:
|
|
1838
|
+
getPanelUrl: $,
|
|
1838
1839
|
openArtifact: I,
|
|
1839
|
-
instance:
|
|
1840
|
-
} = Ve(),
|
|
1840
|
+
instance: x
|
|
1841
|
+
} = Ve(), j = T(null), O = T(null), W = T(null), Y = T(null), S = T(null), ie = T(null), Z = T(!1), X = T(!1), oe = T(!0), m = T(!1), k = T(!1), ee = T(!1), re = T(!1), P = T("options"), Q = T(""), w = T(null), L = T(""), r = T(!1), B = T(!1), u = T([]), z = T(!1), le = T("");
|
|
1841
1842
|
let pe = null, ye = null, fe = null;
|
|
1842
1843
|
const Pe = C(() => {
|
|
1843
1844
|
var i;
|
|
1844
|
-
return ((i =
|
|
1845
|
-
}), b =
|
|
1846
|
-
Math.min(Math.max(
|
|
1847
|
-
), V =
|
|
1848
|
-
Math.min(Math.max(
|
|
1849
|
-
), D = C(() => o.value ? Se(o.value.language) : ""), te = C(() => o.value ? `<svg viewBox="0 0 24 24" fill="currentColor">${
|
|
1845
|
+
return ((i = x.editor) == null ? void 0 : i.isAvailable()) || !1;
|
|
1846
|
+
}), b = T(
|
|
1847
|
+
Math.min(Math.max(M.panelWidth ?? ((lt = x.config) == null ? void 0 : lt.panelWidth) ?? 65, 25), 75)
|
|
1848
|
+
), V = T(
|
|
1849
|
+
Math.min(Math.max(M.splitPosition ?? ((nt = x.config) == null ? void 0 : nt.splitPosition) ?? 50, 20), 80)
|
|
1850
|
+
), D = C(() => o.value ? Se(o.value.language) : ""), te = C(() => o.value ? `<svg viewBox="0 0 24 24" fill="currentColor">${je(o.value.language)}</svg>` : ""), A = C(() => {
|
|
1850
1851
|
if (!o.value) return null;
|
|
1851
|
-
let i =
|
|
1852
|
+
let i = $(o.value);
|
|
1852
1853
|
return i && o.value._refreshToken && (i += (i.includes("?") ? "&" : "?") + "_t=" + o.value._refreshToken), i;
|
|
1853
1854
|
});
|
|
1854
1855
|
C(() => !o.value || !f.artifacts.length ? -1 : f.artifacts.findIndex((i) => i.id === o.value.id));
|
|
1855
|
-
const ae = C(() => o.value ?
|
|
1856
|
+
const ae = C(() => o.value ? Zt(o.value.language || "plaintext") : "plaintext"), d = C(() => f.artifacts.filter((i) => !i.isInline)), U = C(() => o.value ? d.value.findIndex((i) => i.id === o.value.id) : -1), G = C(() => {
|
|
1856
1857
|
var i;
|
|
1857
|
-
return ((i =
|
|
1858
|
+
return ((i = x.config) == null ? void 0 : i.branding) !== !1;
|
|
1858
1859
|
}), ce = C(() => {
|
|
1860
|
+
var i, t;
|
|
1861
|
+
return A.value ? ((i = o.value) == null ? void 0 : i.externalPreview) !== void 0 ? o.value.externalPreview : M.externalPreview !== void 0 ? M.externalPreview : ((t = x.config) == null ? void 0 : t.externalPreview) ?? !1 : !1;
|
|
1862
|
+
}), Me = C(() => {
|
|
1859
1863
|
var i;
|
|
1860
|
-
return ((i =
|
|
1861
|
-
}),
|
|
1864
|
+
return ((i = x.share) == null ? void 0 : i.enabled) !== !1;
|
|
1865
|
+
}), Je = C(() => {
|
|
1862
1866
|
var i;
|
|
1863
|
-
return ((i =
|
|
1864
|
-
}),
|
|
1867
|
+
return ((i = x.share) == null ? void 0 : i.isAuthenticated()) || !1;
|
|
1868
|
+
}), _t = C(() => !o.value && !f.forceEmptyView ? Math.min(b.value, 30) : b.value), Te = C(() => {
|
|
1865
1869
|
var i;
|
|
1866
|
-
return ((i =
|
|
1867
|
-
}),
|
|
1870
|
+
return ((i = x.config) == null ? void 0 : i.multiTab) === !0;
|
|
1871
|
+
}), ke = C(() => f.forceEmptyView), Xe = C(() => Te.value ? f.openTabs.map((i) => f.artifacts.find((t) => t.id === i)).filter(Boolean) : []);
|
|
1868
1872
|
function Ie(i) {
|
|
1869
|
-
return `<svg viewBox="0 0 24 24" fill="currentColor">${
|
|
1873
|
+
return `<svg viewBox="0 0 24 24" fill="currentColor">${je(i)}</svg>`;
|
|
1870
1874
|
}
|
|
1871
|
-
function
|
|
1875
|
+
function ht(i) {
|
|
1872
1876
|
I(i);
|
|
1873
1877
|
}
|
|
1874
|
-
function
|
|
1875
|
-
|
|
1878
|
+
function mt(i) {
|
|
1879
|
+
x.closeTab(i), f.openTabs.length === 0 && (k.value = !1);
|
|
1876
1880
|
}
|
|
1877
|
-
function
|
|
1878
|
-
k.value = !1,
|
|
1881
|
+
function yt() {
|
|
1882
|
+
k.value = !1, x.state.clearActiveArtifact();
|
|
1879
1883
|
}
|
|
1880
|
-
function
|
|
1884
|
+
function Ze(i) {
|
|
1881
1885
|
if (i.language !== "smartdiff") return null;
|
|
1882
1886
|
try {
|
|
1883
1887
|
const t = JSON.parse(i.code);
|
|
1884
1888
|
if (t.oldCode === void 0 || t.newCode === void 0) return null;
|
|
1885
|
-
const p = t.language || "plaintext", F =
|
|
1889
|
+
const p = t.language || "plaintext", F = ct() && window.Prism.languages[p], J = Kt(t.oldCode, t.newCode).split(`
|
|
1886
1890
|
`);
|
|
1887
1891
|
return { html: J.map((ue) => {
|
|
1888
|
-
const ne = ue[0],
|
|
1892
|
+
const ne = ue[0], be = ue.slice(1), ge = F ? window.Prism.highlight(be, F, p) : be;
|
|
1889
1893
|
return ne === "-" ? `<span class="token deleted">${ge}</span>` : ne === "+" ? `<span class="token inserted">${ge}</span>` : ge;
|
|
1890
1894
|
}).join(`
|
|
1891
1895
|
`), lineCount: J.length };
|
|
@@ -1893,18 +1897,18 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
1893
1897
|
return null;
|
|
1894
1898
|
}
|
|
1895
1899
|
}
|
|
1896
|
-
function
|
|
1900
|
+
function gt() {
|
|
1897
1901
|
var i;
|
|
1898
1902
|
if (Y.value && ((i = o.value) != null && i.code)) {
|
|
1899
|
-
const t =
|
|
1903
|
+
const t = Ze(o.value), p = t ? t.lineCount : o.value.code.split(`
|
|
1900
1904
|
`).length;
|
|
1901
1905
|
Y.value.innerHTML = Array.from({ length: p }, (F, J) => `<div>${J + 1}</div>`).join("");
|
|
1902
1906
|
}
|
|
1903
1907
|
}
|
|
1904
|
-
function
|
|
1908
|
+
function kt() {
|
|
1905
1909
|
var i;
|
|
1906
|
-
if (O.value &&
|
|
1907
|
-
const t =
|
|
1910
|
+
if (O.value && ct() && ((i = o.value) != null && i.code)) {
|
|
1911
|
+
const t = Ze(o.value);
|
|
1908
1912
|
if (t)
|
|
1909
1913
|
O.value.innerHTML = t.html;
|
|
1910
1914
|
else {
|
|
@@ -1915,12 +1919,12 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
1915
1919
|
ae.value
|
|
1916
1920
|
) : O.value.textContent = o.value.code;
|
|
1917
1921
|
}
|
|
1918
|
-
O.value.dataset.highlighted = "true",
|
|
1919
|
-
|
|
1922
|
+
O.value.dataset.highlighted = "true", Ce(() => {
|
|
1923
|
+
wt();
|
|
1920
1924
|
});
|
|
1921
1925
|
}
|
|
1922
1926
|
}
|
|
1923
|
-
function
|
|
1927
|
+
function wt() {
|
|
1924
1928
|
var t;
|
|
1925
1929
|
const i = (t = O.value) == null ? void 0 : t.closest("pre");
|
|
1926
1930
|
if (i && S.value && Y.value) {
|
|
@@ -1928,45 +1932,45 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
1928
1932
|
F && F !== "rgba(0, 0, 0, 0)" && F !== "transparent" && (S.value.style.backgroundColor = F, Y.value.style.backgroundColor = F);
|
|
1929
1933
|
}
|
|
1930
1934
|
}
|
|
1931
|
-
function
|
|
1935
|
+
function bt() {
|
|
1932
1936
|
S.value && (S.value.style.backgroundColor = ""), Y.value && (Y.value.style.backgroundColor = "");
|
|
1933
1937
|
}
|
|
1934
1938
|
function Ae() {
|
|
1935
|
-
|
|
1936
|
-
|
|
1939
|
+
Ce(() => {
|
|
1940
|
+
gt(), kt();
|
|
1937
1941
|
});
|
|
1938
1942
|
}
|
|
1939
|
-
function
|
|
1940
|
-
!Pe.value || !ie.value || !o.value || (Fe(), fe =
|
|
1943
|
+
function Ke() {
|
|
1944
|
+
!Pe.value || !ie.value || !o.value || (Fe(), fe = x.editor.create(ie.value, {
|
|
1941
1945
|
code: o.value.code || "",
|
|
1942
1946
|
language: o.value.editorLanguage || o.value.language || "plaintext",
|
|
1943
|
-
sdkTheme:
|
|
1947
|
+
sdkTheme: x.getTheme()
|
|
1944
1948
|
}));
|
|
1945
1949
|
}
|
|
1946
1950
|
function Fe() {
|
|
1947
1951
|
fe && (fe.destroy(), fe = null);
|
|
1948
1952
|
}
|
|
1949
|
-
function
|
|
1953
|
+
function Ct() {
|
|
1950
1954
|
if (!fe || !o.value) return;
|
|
1951
1955
|
const i = fe.getCode();
|
|
1952
|
-
|
|
1956
|
+
x.emit("edit:save", {
|
|
1953
1957
|
artifactId: o.value.id,
|
|
1954
1958
|
artifact: o.value,
|
|
1955
1959
|
code: i
|
|
1956
1960
|
});
|
|
1957
1961
|
}
|
|
1958
|
-
function
|
|
1959
|
-
clearTimeout(ye), oe.value = !1,
|
|
1962
|
+
function xt() {
|
|
1963
|
+
clearTimeout(ye), oe.value = !1, j.value && o.value && (x.bridge.setIframe(j.value), x.bridge.loadArtifact(o.value));
|
|
1960
1964
|
}
|
|
1961
|
-
function
|
|
1965
|
+
function $t() {
|
|
1962
1966
|
clearTimeout(ye), oe.value = !1;
|
|
1963
1967
|
}
|
|
1964
|
-
function
|
|
1968
|
+
function Mt() {
|
|
1965
1969
|
clearTimeout(ye), ye = setTimeout(() => {
|
|
1966
1970
|
oe.value = !1;
|
|
1967
1971
|
}, 1e3);
|
|
1968
1972
|
}
|
|
1969
|
-
async function
|
|
1973
|
+
async function Tt() {
|
|
1970
1974
|
if (o.value)
|
|
1971
1975
|
try {
|
|
1972
1976
|
await navigator.clipboard.writeText(o.value.code), Z.value = !0, setTimeout(() => {
|
|
@@ -1976,22 +1980,22 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
1976
1980
|
console.error("Failed to copy:", i);
|
|
1977
1981
|
}
|
|
1978
1982
|
}
|
|
1979
|
-
function
|
|
1983
|
+
function Lt() {
|
|
1980
1984
|
if (!o.value) return;
|
|
1981
|
-
const { code: i, language: t, title: p } = o.value, F =
|
|
1985
|
+
const { code: i, language: t, title: p } = o.value, F = Ne(t), J = `${p.toLowerCase().replace(/\s+/g, "-")}.${F}`, me = new Blob([i], { type: "text/plain" }), ue = URL.createObjectURL(me), ne = document.createElement("a");
|
|
1982
1986
|
ne.href = ue, ne.download = J, document.body.appendChild(ne), ne.click(), document.body.removeChild(ne), URL.revokeObjectURL(ue);
|
|
1983
1987
|
}
|
|
1984
|
-
async function
|
|
1988
|
+
async function Pt() {
|
|
1985
1989
|
if (!(ee.value || d.value.length === 0)) {
|
|
1986
1990
|
ee.value = !0;
|
|
1987
1991
|
try {
|
|
1988
|
-
const i = new
|
|
1992
|
+
const i = new Qt(), t = /* @__PURE__ */ new Map();
|
|
1989
1993
|
for (const ne of d.value) {
|
|
1990
1994
|
if (!ne.code) continue;
|
|
1991
|
-
const
|
|
1992
|
-
let ge = (ne.title || "untitled").toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-_]/g, ""), Ue = `${ge}.${
|
|
1995
|
+
const be = Ne(ne.language);
|
|
1996
|
+
let ge = (ne.title || "untitled").toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-_]/g, ""), Ue = `${ge}.${be}`;
|
|
1993
1997
|
const De = t.get(Ue) || 0;
|
|
1994
|
-
De > 0 && (Ue = `${ge}-${De}.${
|
|
1998
|
+
De > 0 && (Ue = `${ge}-${De}.${be}`), t.set(`${ge}.${be}`, De + 1), i.file(Ue, ne.code);
|
|
1995
1999
|
}
|
|
1996
2000
|
const p = await i.generateAsync({ type: "blob" }), J = `artifacts-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.zip`, me = URL.createObjectURL(p), ue = document.createElement("a");
|
|
1997
2001
|
ue.href = me, ue.download = J, document.body.appendChild(ue), ue.click(), document.body.removeChild(ue), URL.revokeObjectURL(me);
|
|
@@ -2002,63 +2006,63 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2002
2006
|
}
|
|
2003
2007
|
}
|
|
2004
2008
|
}
|
|
2005
|
-
function
|
|
2009
|
+
function At() {
|
|
2006
2010
|
if (re.value) {
|
|
2007
2011
|
re.value = !1;
|
|
2008
2012
|
return;
|
|
2009
2013
|
}
|
|
2010
2014
|
o.value && (P.value = "options", Q.value = "", w.value = null, L.value = "", r.value = !1, B.value = !1, u.value = [], z.value = !1, le.value = "", re.value = !0);
|
|
2011
2015
|
}
|
|
2012
|
-
function
|
|
2016
|
+
function Ht() {
|
|
2013
2017
|
re.value = !1;
|
|
2014
2018
|
}
|
|
2015
|
-
function
|
|
2019
|
+
function Ye(i) {
|
|
2016
2020
|
return i ? new Date(i).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" }) : "";
|
|
2017
2021
|
}
|
|
2018
|
-
async function
|
|
2019
|
-
if (!(!o.value ||
|
|
2022
|
+
async function Qe() {
|
|
2023
|
+
if (!(!o.value || !x.share)) {
|
|
2020
2024
|
P.value = "loading", L.value = "";
|
|
2021
2025
|
try {
|
|
2022
|
-
const i = await
|
|
2026
|
+
const i = await x.share.share(o.value);
|
|
2023
2027
|
Q.value = i.url, w.value = i.expiresAt, B.value = !1, P.value = "success";
|
|
2024
2028
|
} catch (i) {
|
|
2025
2029
|
L.value = i.message || "Failed to create share link", P.value = "error";
|
|
2026
2030
|
}
|
|
2027
2031
|
}
|
|
2028
2032
|
}
|
|
2029
|
-
async function
|
|
2030
|
-
if (
|
|
2033
|
+
async function Ge() {
|
|
2034
|
+
if (Je.value)
|
|
2031
2035
|
Re();
|
|
2032
2036
|
else {
|
|
2033
2037
|
P.value = "loading";
|
|
2034
2038
|
try {
|
|
2035
|
-
await
|
|
2039
|
+
await x.share.openAuthPopup(), Re();
|
|
2036
2040
|
} catch (i) {
|
|
2037
2041
|
i.message === "Authentication cancelled" ? P.value = "options" : (L.value = i.message || "Authentication failed", P.value = "error");
|
|
2038
2042
|
}
|
|
2039
2043
|
}
|
|
2040
2044
|
}
|
|
2041
2045
|
async function Re() {
|
|
2042
|
-
if (!(!o.value ||
|
|
2046
|
+
if (!(!o.value || !x.share)) {
|
|
2043
2047
|
P.value = "loading", L.value = "";
|
|
2044
2048
|
try {
|
|
2045
|
-
const i = await
|
|
2049
|
+
const i = await x.share.save(o.value);
|
|
2046
2050
|
Q.value = i.url, w.value = null, B.value = !0, P.value = "success";
|
|
2047
2051
|
} catch (i) {
|
|
2048
2052
|
L.value = i.message || "Failed to save artifact", P.value = "error";
|
|
2049
2053
|
}
|
|
2050
2054
|
}
|
|
2051
2055
|
}
|
|
2052
|
-
function
|
|
2053
|
-
B.value ? Re() :
|
|
2056
|
+
function Et() {
|
|
2057
|
+
B.value ? Re() : Qe();
|
|
2054
2058
|
}
|
|
2055
|
-
async function
|
|
2059
|
+
async function Bt() {
|
|
2056
2060
|
var i;
|
|
2057
|
-
if (
|
|
2058
|
-
if (!
|
|
2061
|
+
if (x.share) {
|
|
2062
|
+
if (!Je.value) {
|
|
2059
2063
|
P.value = "loading";
|
|
2060
2064
|
try {
|
|
2061
|
-
await
|
|
2065
|
+
await x.share.openAuthPopup();
|
|
2062
2066
|
} catch (t) {
|
|
2063
2067
|
t.message === "Authentication cancelled" ? P.value = "options" : (L.value = t.message || "Authentication failed", P.value = "error");
|
|
2064
2068
|
return;
|
|
@@ -2066,7 +2070,7 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2066
2070
|
}
|
|
2067
2071
|
P.value = "update-list", z.value = !0;
|
|
2068
2072
|
try {
|
|
2069
|
-
const t = ((i = o.value) == null ? void 0 : i.language) || null, p = await
|
|
2073
|
+
const t = ((i = o.value) == null ? void 0 : i.language) || null, p = await x.share.listArtifacts(t);
|
|
2070
2074
|
u.value = p.projects || [];
|
|
2071
2075
|
} catch (t) {
|
|
2072
2076
|
L.value = t.message || "Failed to load artifacts", P.value = "error";
|
|
@@ -2075,21 +2079,21 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2075
2079
|
}
|
|
2076
2080
|
}
|
|
2077
2081
|
}
|
|
2078
|
-
async function
|
|
2082
|
+
async function St(i) {
|
|
2079
2083
|
var p, F;
|
|
2080
|
-
if (!o.value ||
|
|
2084
|
+
if (!o.value || !x.share) return;
|
|
2081
2085
|
const t = (p = i.project) == null ? void 0 : p.uuid;
|
|
2082
2086
|
if (t) {
|
|
2083
2087
|
P.value = "loading", L.value = "";
|
|
2084
2088
|
try {
|
|
2085
|
-
const J = await
|
|
2089
|
+
const J = await x.share.updateArtifact(t, o.value);
|
|
2086
2090
|
Q.value = J.url || "", w.value = null, B.value = !0, le.value = ((F = i.project) == null ? void 0 : F.name) || "Untitled", P.value = "success";
|
|
2087
2091
|
} catch (J) {
|
|
2088
2092
|
L.value = J.message || "Failed to update artifact", P.value = "error";
|
|
2089
2093
|
}
|
|
2090
2094
|
}
|
|
2091
2095
|
}
|
|
2092
|
-
async function
|
|
2096
|
+
async function zt() {
|
|
2093
2097
|
if (Q.value)
|
|
2094
2098
|
try {
|
|
2095
2099
|
await navigator.clipboard.writeText(Q.value), r.value = !0, setTimeout(() => {
|
|
@@ -2099,48 +2103,48 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2099
2103
|
console.error("Failed to copy link:", i);
|
|
2100
2104
|
}
|
|
2101
2105
|
}
|
|
2102
|
-
function
|
|
2103
|
-
A.value && window.open(A.value, "_blank");
|
|
2106
|
+
function et() {
|
|
2107
|
+
A.value && window.open(A.value, "_blank", "noopener,noreferrer");
|
|
2104
2108
|
}
|
|
2105
|
-
function
|
|
2109
|
+
function Vt() {
|
|
2106
2110
|
Y.value && S.value && (Y.value.style.transform = `translateY(-${S.value.scrollTop}px)`);
|
|
2107
2111
|
}
|
|
2108
|
-
function
|
|
2112
|
+
function It() {
|
|
2109
2113
|
X.value = !X.value;
|
|
2110
2114
|
}
|
|
2111
|
-
function
|
|
2115
|
+
function tt(i) {
|
|
2112
2116
|
k.value = !0, I(i), X.value = !1;
|
|
2113
2117
|
}
|
|
2114
|
-
function
|
|
2118
|
+
function Ft() {
|
|
2115
2119
|
const i = U.value - 1;
|
|
2116
2120
|
i >= 0 && I(d.value[i]);
|
|
2117
2121
|
}
|
|
2118
|
-
function
|
|
2122
|
+
function Rt() {
|
|
2119
2123
|
const i = U.value + 1;
|
|
2120
2124
|
i < d.value.length && I(d.value[i]);
|
|
2121
2125
|
}
|
|
2122
|
-
function
|
|
2126
|
+
function at(i) {
|
|
2123
2127
|
const t = document.querySelector(".artifactuse-panel__nav");
|
|
2124
2128
|
t && !t.contains(i.target) && (X.value = !1);
|
|
2125
2129
|
}
|
|
2126
|
-
let
|
|
2127
|
-
function
|
|
2128
|
-
|
|
2130
|
+
let we = null;
|
|
2131
|
+
function qt(i) {
|
|
2132
|
+
we = {
|
|
2129
2133
|
startX: i.clientX,
|
|
2130
2134
|
startWidth: b.value
|
|
2131
|
-
}, document.addEventListener("mousemove",
|
|
2135
|
+
}, document.addEventListener("mousemove", st), document.addEventListener("mouseup", qe), document.body.style.cursor = "ew-resize", document.body.style.userSelect = "none", document.querySelectorAll("iframe").forEach((p) => p.style.pointerEvents = "none");
|
|
2132
2136
|
}
|
|
2133
|
-
function
|
|
2134
|
-
if (!
|
|
2135
|
-
const t = window.innerWidth, F = (
|
|
2137
|
+
function st(i) {
|
|
2138
|
+
if (!we) return;
|
|
2139
|
+
const t = window.innerWidth, F = (we.startX - i.clientX) / t * 100, J = we.startWidth + F;
|
|
2136
2140
|
b.value = Math.min(Math.max(J, 25), 75), _("resize", { width: b.value });
|
|
2137
2141
|
}
|
|
2138
2142
|
function qe() {
|
|
2139
|
-
const i =
|
|
2140
|
-
|
|
2143
|
+
const i = we !== null;
|
|
2144
|
+
we = null, document.removeEventListener("mousemove", st), document.removeEventListener("mouseup", qe), document.body.style.cursor = "", document.body.style.userSelect = "", document.querySelectorAll("iframe").forEach((p) => p.style.pointerEvents = ""), i && _("resize", { width: b.value });
|
|
2141
2145
|
}
|
|
2142
2146
|
let Le = null;
|
|
2143
|
-
function
|
|
2147
|
+
function Ot(i) {
|
|
2144
2148
|
if (!W.value) return;
|
|
2145
2149
|
const t = W.value.getBoundingClientRect();
|
|
2146
2150
|
Le = {
|
|
@@ -2148,69 +2152,69 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2148
2152
|
startPosition: V.value,
|
|
2149
2153
|
contentLeft: t.left,
|
|
2150
2154
|
contentWidth: t.width
|
|
2151
|
-
}, document.addEventListener("mousemove",
|
|
2155
|
+
}, document.addEventListener("mousemove", it), document.addEventListener("mouseup", Oe), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.querySelectorAll("iframe").forEach((F) => F.style.pointerEvents = "none");
|
|
2152
2156
|
}
|
|
2153
|
-
function
|
|
2157
|
+
function it(i) {
|
|
2154
2158
|
if (!Le) return;
|
|
2155
2159
|
const p = (i.clientX - Le.contentLeft) / Le.contentWidth * 100;
|
|
2156
2160
|
V.value = Math.min(Math.max(p, 20), 80);
|
|
2157
2161
|
}
|
|
2158
2162
|
function Oe() {
|
|
2159
|
-
Le = null, document.removeEventListener("mousemove",
|
|
2163
|
+
Le = null, document.removeEventListener("mousemove", it), document.removeEventListener("mouseup", Oe), document.body.style.cursor = "", document.body.style.userSelect = "", document.querySelectorAll("iframe").forEach((t) => t.style.pointerEvents = "");
|
|
2160
2164
|
}
|
|
2161
2165
|
return de(o, (i, t) => {
|
|
2162
2166
|
i && (t && t.isPreviewable !== i.isPreviewable && (m.value = !0, setTimeout(() => {
|
|
2163
2167
|
m.value = !1;
|
|
2164
|
-
}, 150)), (!t || i.id !== t.id) && (
|
|
2165
|
-
|
|
2168
|
+
}, 150)), (!t || i.id !== t.id) && (bt(), oe.value = !0, Mt()), (!t || i.id !== t.id || i.code !== t.code) && (Ae(), f.viewMode === "edit" && (!t || i.id !== t.id ? Ce(() => Ke()) : fe && fe.setCode(i.code || "")), clearTimeout(pe), pe = setTimeout(() => {
|
|
2169
|
+
j.value && i.isPreviewable && x.bridge.loadArtifact(i);
|
|
2166
2170
|
}, 500)));
|
|
2167
2171
|
}, { deep: !0 }), de(() => f.viewMode, (i) => {
|
|
2168
|
-
(i === "code" || i === "split") && Ae(), i === "edit" &&
|
|
2172
|
+
(i === "code" || i === "split") && Ae(), i === "edit" && Ce(() => Ke());
|
|
2169
2173
|
}), de(() => f.isPanelOpen, (i) => {
|
|
2170
2174
|
i && o.value && Ae(), i || Fe();
|
|
2171
|
-
}), de(() =>
|
|
2175
|
+
}), de(() => M.panelWidth, (i) => {
|
|
2172
2176
|
i !== void 0 && (b.value = Math.min(Math.max(i, 25), 75));
|
|
2173
|
-
}), de(() =>
|
|
2177
|
+
}), de(() => M.splitPosition, (i) => {
|
|
2174
2178
|
i !== void 0 && (V.value = Math.min(Math.max(i, 20), 80));
|
|
2175
|
-
}),
|
|
2176
|
-
|
|
2179
|
+
}), $e(() => {
|
|
2180
|
+
x.on("ai:request", (i) => _("ai-request", i)), x.on("save:request", (i) => _("save", i)), x.on("export:complete", (i) => _("export", i)), document.addEventListener("click", at), f.isPanelOpen && o.value && Ae();
|
|
2177
2181
|
}), We(() => {
|
|
2178
|
-
qe(), Oe(), Fe(), document.removeEventListener("click",
|
|
2179
|
-
}), (i, t) => (a(),
|
|
2182
|
+
qe(), Oe(), Fe(), document.removeEventListener("click", at), clearTimeout(pe), clearTimeout(ye);
|
|
2183
|
+
}), (i, t) => (a(), xe(Ee, { name: "artifactuse-panel" }, {
|
|
2180
2184
|
default: Be(() => [
|
|
2181
2185
|
y(f).isPanelOpen ? (a(), s("div", {
|
|
2182
2186
|
key: 0,
|
|
2183
|
-
class:
|
|
2187
|
+
class: N(["artifactuse-panel", {
|
|
2184
2188
|
"artifactuse-panel--fullscreen": y(f).isFullscreen,
|
|
2185
2189
|
"artifactuse-panel--list": !y(o) && y(E) && !y(f).forceEmptyView,
|
|
2186
2190
|
"artifactuse-panel--empty": !y(E) && !y(f).forceEmptyView
|
|
2187
2191
|
}]),
|
|
2188
|
-
style: He(y(f).isFullscreen ? void 0 : { width: `${
|
|
2192
|
+
style: He(y(f).isFullscreen ? void 0 : { width: `${_t.value}%` })
|
|
2189
2193
|
}, [
|
|
2190
2194
|
y(f).isFullscreen ? v("", !0) : (a(), s("div", {
|
|
2191
2195
|
key: 0,
|
|
2192
2196
|
class: "artifactuse-panel__resize-handle",
|
|
2193
|
-
onMousedown: he(
|
|
2197
|
+
onMousedown: he(qt, ["prevent"])
|
|
2194
2198
|
}, [...t[12] || (t[12] = [
|
|
2195
2199
|
e("div", { class: "artifactuse-panel__resize-handle-line" }, null, -1)
|
|
2196
2200
|
])], 32)),
|
|
2197
|
-
!y(E) ||
|
|
2198
|
-
e("header",
|
|
2199
|
-
e("div",
|
|
2200
|
-
e("span",
|
|
2201
|
-
|
|
2201
|
+
!y(E) || ke.value ? (a(), s(R, { key: 1 }, [
|
|
2202
|
+
e("header", vl, [
|
|
2203
|
+
e("div", fl, [
|
|
2204
|
+
e("span", pl, [
|
|
2205
|
+
ke.value ? (a(), s("svg", _l, [...t[13] || (t[13] = [
|
|
2202
2206
|
e("path", { d: "M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z" }, null, -1),
|
|
2203
2207
|
e("polyline", { points: "14 2 14 8 20 8" }, null, -1)
|
|
2204
|
-
])])) : (a(), s("svg",
|
|
2208
|
+
])])) : (a(), s("svg", hl, [...t[14] || (t[14] = [
|
|
2205
2209
|
e("polyline", { points: "16 18 22 12 16 6" }, null, -1),
|
|
2206
2210
|
e("polyline", { points: "8 6 2 12 8 18" }, null, -1)
|
|
2207
2211
|
])]))
|
|
2208
2212
|
]),
|
|
2209
|
-
e("div",
|
|
2210
|
-
e("span",
|
|
2213
|
+
e("div", ml, [
|
|
2214
|
+
e("span", yl, l(ke.value ? "Artifact Viewer" : "Artifacts"), 1)
|
|
2211
2215
|
])
|
|
2212
2216
|
]),
|
|
2213
|
-
e("div",
|
|
2217
|
+
e("div", gl, [
|
|
2214
2218
|
e("button", {
|
|
2215
2219
|
class: "artifactuse-panel__action artifactuse-panel__action--close",
|
|
2216
2220
|
title: "Close panel",
|
|
@@ -2238,7 +2242,7 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2238
2242
|
])])
|
|
2239
2243
|
])
|
|
2240
2244
|
]),
|
|
2241
|
-
e("div",
|
|
2245
|
+
e("div", kl, [
|
|
2242
2246
|
t[16] || (t[16] = e("div", { class: "artifactuse-panel__empty-icon" }, [
|
|
2243
2247
|
e("svg", {
|
|
2244
2248
|
viewBox: "0 0 24 24",
|
|
@@ -2250,11 +2254,11 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2250
2254
|
e("polyline", { points: "14 2 14 8 20 8" })
|
|
2251
2255
|
])
|
|
2252
2256
|
], -1)),
|
|
2253
|
-
e("h3",
|
|
2254
|
-
e("p",
|
|
2257
|
+
e("h3", wl, l(ke.value ? "No artifact selected" : "No artifacts yet"), 1),
|
|
2258
|
+
e("p", bl, l(ke.value ? "Open an artifact to have it appear here" : "Code blocks, forms, and other interactive content will appear here as the AI generates them."), 1)
|
|
2255
2259
|
]),
|
|
2256
|
-
e("footer",
|
|
2257
|
-
G.value ? (a(), s("a",
|
|
2260
|
+
e("footer", Cl, [
|
|
2261
|
+
G.value ? (a(), s("a", xl, [...t[17] || (t[17] = [
|
|
2258
2262
|
e("svg", {
|
|
2259
2263
|
width: "16",
|
|
2260
2264
|
height: "16",
|
|
@@ -2274,9 +2278,9 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2274
2278
|
e("span", null, "Artifactuse", -1)
|
|
2275
2279
|
])])) : v("", !0)
|
|
2276
2280
|
])
|
|
2277
|
-
], 64)) : !y(o) && !
|
|
2278
|
-
e("header",
|
|
2279
|
-
e("div",
|
|
2281
|
+
], 64)) : !y(o) && !ke.value ? (a(), s(R, { key: 2 }, [
|
|
2282
|
+
e("header", $l, [
|
|
2283
|
+
e("div", Ml, [
|
|
2280
2284
|
t[19] || (t[19] = e("span", { class: "artifactuse-panel__icon" }, [
|
|
2281
2285
|
e("svg", {
|
|
2282
2286
|
viewBox: "0 0 24 24",
|
|
@@ -2288,19 +2292,19 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2288
2292
|
e("polyline", { points: "8 6 2 12 8 18" })
|
|
2289
2293
|
])
|
|
2290
2294
|
], -1)),
|
|
2291
|
-
e("div",
|
|
2295
|
+
e("div", Tl, [
|
|
2292
2296
|
t[18] || (t[18] = e("span", { class: "artifactuse-panel__name" }, "Artifacts", -1)),
|
|
2293
|
-
e("span",
|
|
2297
|
+
e("span", Ll, l(d.value.length) + " available", 1)
|
|
2294
2298
|
])
|
|
2295
2299
|
]),
|
|
2296
|
-
e("div",
|
|
2300
|
+
e("div", Pl, [
|
|
2297
2301
|
e("button", {
|
|
2298
|
-
class:
|
|
2302
|
+
class: N(["artifactuse-panel__action", { "artifactuse-panel__action--loading": ee.value }]),
|
|
2299
2303
|
disabled: ee.value,
|
|
2300
2304
|
title: "Download all as ZIP",
|
|
2301
|
-
onClick:
|
|
2305
|
+
onClick: Pt
|
|
2302
2306
|
}, [
|
|
2303
|
-
ee.value ? (a(), s("svg",
|
|
2307
|
+
ee.value ? (a(), s("svg", El, [...t[21] || (t[21] = [
|
|
2304
2308
|
e("circle", {
|
|
2305
2309
|
cx: "12",
|
|
2306
2310
|
cy: "12",
|
|
@@ -2308,7 +2312,7 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2308
2312
|
"stroke-dasharray": "32",
|
|
2309
2313
|
"stroke-dashoffset": "32"
|
|
2310
2314
|
}, null, -1)
|
|
2311
|
-
])])) : (a(), s("svg",
|
|
2315
|
+
])])) : (a(), s("svg", Hl, [...t[20] || (t[20] = [
|
|
2312
2316
|
e("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }, null, -1),
|
|
2313
2317
|
e("polyline", { points: "7 10 12 15 17 10" }, null, -1),
|
|
2314
2318
|
e("line", {
|
|
@@ -2318,7 +2322,7 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2318
2322
|
y2: "3"
|
|
2319
2323
|
}, null, -1)
|
|
2320
2324
|
])]))
|
|
2321
|
-
], 10,
|
|
2325
|
+
], 10, Al),
|
|
2322
2326
|
e("button", {
|
|
2323
2327
|
class: "artifactuse-panel__action artifactuse-panel__action--close",
|
|
2324
2328
|
title: "Close panel",
|
|
@@ -2346,20 +2350,20 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2346
2350
|
])])
|
|
2347
2351
|
])
|
|
2348
2352
|
]),
|
|
2349
|
-
e("div",
|
|
2350
|
-
e("div",
|
|
2353
|
+
e("div", Bl, [
|
|
2354
|
+
e("div", Sl, [
|
|
2351
2355
|
(a(!0), s(R, null, ve(d.value, (p, F) => (a(), s("button", {
|
|
2352
2356
|
key: p.id,
|
|
2353
2357
|
class: "artifactuse-panel__list-item",
|
|
2354
|
-
onClick: (J) =>
|
|
2358
|
+
onClick: (J) => tt(p)
|
|
2355
2359
|
}, [
|
|
2356
2360
|
e("span", {
|
|
2357
2361
|
class: "artifactuse-panel__list-item-icon",
|
|
2358
2362
|
innerHTML: Ie(p.language)
|
|
2359
|
-
}, null, 8,
|
|
2360
|
-
e("div",
|
|
2361
|
-
e("span",
|
|
2362
|
-
e("span",
|
|
2363
|
+
}, null, 8, Vl),
|
|
2364
|
+
e("div", Il, [
|
|
2365
|
+
e("span", Fl, l(p.title || "Untitled"), 1),
|
|
2366
|
+
e("span", Rl, [
|
|
2363
2367
|
K(l(y(Se)(p.language)) + " ", 1),
|
|
2364
2368
|
p.lineCount ? (a(), s(R, { key: 0 }, [
|
|
2365
2369
|
K(" • " + l(p.lineCount) + " lines ", 1)
|
|
@@ -2376,11 +2380,11 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2376
2380
|
e("polyline", { points: "9 18 15 12 9 6" })
|
|
2377
2381
|
])
|
|
2378
2382
|
], -1))
|
|
2379
|
-
], 8,
|
|
2383
|
+
], 8, zl))), 128))
|
|
2380
2384
|
])
|
|
2381
2385
|
]),
|
|
2382
|
-
e("footer",
|
|
2383
|
-
G.value ? (a(), s("a",
|
|
2386
|
+
e("footer", ql, [
|
|
2387
|
+
G.value ? (a(), s("a", Ol, [...t[24] || (t[24] = [
|
|
2384
2388
|
e("svg", {
|
|
2385
2389
|
width: "16",
|
|
2386
2390
|
height: "16",
|
|
@@ -2401,12 +2405,12 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2401
2405
|
])])) : v("", !0)
|
|
2402
2406
|
])
|
|
2403
2407
|
], 64)) : (a(), s(R, { key: 3 }, [
|
|
2404
|
-
e("header",
|
|
2408
|
+
e("header", Ul, [
|
|
2405
2409
|
Te.value || k.value ? (a(), s("button", {
|
|
2406
2410
|
key: 0,
|
|
2407
2411
|
class: "artifactuse-panel__back",
|
|
2408
2412
|
title: Te.value ? "Browse artifacts" : "Back to list",
|
|
2409
|
-
onClick:
|
|
2413
|
+
onClick: yt
|
|
2410
2414
|
}, [...t[25] || (t[25] = [
|
|
2411
2415
|
e("svg", {
|
|
2412
2416
|
viewBox: "0 0 24 24",
|
|
@@ -2416,15 +2420,15 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2416
2420
|
}, [
|
|
2417
2421
|
e("polyline", { points: "15 18 9 12 15 6" })
|
|
2418
2422
|
], -1)
|
|
2419
|
-
])], 8,
|
|
2420
|
-
e("div",
|
|
2423
|
+
])], 8, Dl)) : v("", !0),
|
|
2424
|
+
e("div", jl, [
|
|
2421
2425
|
e("span", {
|
|
2422
2426
|
class: "artifactuse-panel__icon",
|
|
2423
2427
|
innerHTML: te.value
|
|
2424
2428
|
}, null, 8, Nl),
|
|
2425
|
-
e("div",
|
|
2426
|
-
e("span",
|
|
2427
|
-
e("span",
|
|
2429
|
+
e("div", Wl, [
|
|
2430
|
+
e("span", Jl, l(y(o).title || "Untitled"), 1),
|
|
2431
|
+
e("span", Xl, [
|
|
2428
2432
|
K(l(D.value) + " ", 1),
|
|
2429
2433
|
y(o).lineCount ? (a(), s(R, { key: 0 }, [
|
|
2430
2434
|
K(" • " + l(y(o).lineCount) + " lines ", 1)
|
|
@@ -2432,10 +2436,10 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2432
2436
|
])
|
|
2433
2437
|
])
|
|
2434
2438
|
]),
|
|
2435
|
-
e("div",
|
|
2439
|
+
e("div", Zl, [
|
|
2436
2440
|
!y(o).tabs || y(o).tabs.includes("preview") ? (a(), s("button", {
|
|
2437
2441
|
key: 0,
|
|
2438
|
-
class:
|
|
2442
|
+
class: N(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": y(f).viewMode === "preview" }]),
|
|
2439
2443
|
disabled: !y(o).isPreviewable,
|
|
2440
2444
|
title: "Preview",
|
|
2441
2445
|
onClick: t[2] || (t[2] = (p) => y(h)("preview"))
|
|
@@ -2453,10 +2457,10 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2453
2457
|
r: "3"
|
|
2454
2458
|
})
|
|
2455
2459
|
], -1)
|
|
2456
|
-
])], 10,
|
|
2460
|
+
])], 10, Kl)) : v("", !0),
|
|
2457
2461
|
!y(o).tabs || y(o).tabs.includes("code") ? (a(), s("button", {
|
|
2458
2462
|
key: 1,
|
|
2459
|
-
class:
|
|
2463
|
+
class: N(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": y(f).viewMode === "code" }]),
|
|
2460
2464
|
title: "Code",
|
|
2461
2465
|
onClick: t[3] || (t[3] = (p) => y(h)("code"))
|
|
2462
2466
|
}, [...t[27] || (t[27] = [
|
|
@@ -2472,7 +2476,7 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2472
2476
|
])], 2)) : v("", !0),
|
|
2473
2477
|
!y(o).tabs || y(o).tabs.includes("split") ? (a(), s("button", {
|
|
2474
2478
|
key: 2,
|
|
2475
|
-
class:
|
|
2479
|
+
class: N(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": y(f).viewMode === "split" }]),
|
|
2476
2480
|
disabled: !y(o).isPreviewable,
|
|
2477
2481
|
title: "Split view",
|
|
2478
2482
|
onClick: t[4] || (t[4] = (p) => y(h)("split"))
|
|
@@ -2498,10 +2502,10 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2498
2502
|
y2: "21"
|
|
2499
2503
|
})
|
|
2500
2504
|
], -1)
|
|
2501
|
-
])], 10,
|
|
2505
|
+
])], 10, Yl)) : v("", !0),
|
|
2502
2506
|
y(o).tabs && y(o).tabs.includes("edit") && Pe.value ? (a(), s("button", {
|
|
2503
2507
|
key: 3,
|
|
2504
|
-
class:
|
|
2508
|
+
class: N(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": y(f).viewMode === "edit" }]),
|
|
2505
2509
|
title: "Edit",
|
|
2506
2510
|
onClick: t[5] || (t[5] = (p) => y(h)("edit"))
|
|
2507
2511
|
}, [...t[29] || (t[29] = [
|
|
@@ -2516,12 +2520,12 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2516
2520
|
], -1)
|
|
2517
2521
|
])], 2)) : v("", !0)
|
|
2518
2522
|
]),
|
|
2519
|
-
e("div",
|
|
2523
|
+
e("div", Ql, [
|
|
2520
2524
|
y(f).viewMode === "edit" ? (a(), s("button", {
|
|
2521
2525
|
key: 0,
|
|
2522
2526
|
class: "artifactuse-panel__action artifactuse-panel__action--save",
|
|
2523
2527
|
title: "Save",
|
|
2524
|
-
onClick:
|
|
2528
|
+
onClick: Ct
|
|
2525
2529
|
}, [...t[30] || (t[30] = [
|
|
2526
2530
|
e("svg", {
|
|
2527
2531
|
viewBox: "0 0 24 24",
|
|
@@ -2534,12 +2538,34 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2534
2538
|
e("polyline", { points: "7 3 7 8 15 8" })
|
|
2535
2539
|
], -1)
|
|
2536
2540
|
])])) : v("", !0),
|
|
2541
|
+
ce.value ? (a(), s("button", {
|
|
2542
|
+
key: 1,
|
|
2543
|
+
class: "artifactuse-panel__action",
|
|
2544
|
+
title: "Open in new tab",
|
|
2545
|
+
onClick: et
|
|
2546
|
+
}, [...t[31] || (t[31] = [
|
|
2547
|
+
e("svg", {
|
|
2548
|
+
viewBox: "0 0 24 24",
|
|
2549
|
+
fill: "none",
|
|
2550
|
+
stroke: "currentColor",
|
|
2551
|
+
"stroke-width": "2"
|
|
2552
|
+
}, [
|
|
2553
|
+
e("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }),
|
|
2554
|
+
e("polyline", { points: "15 3 21 3 21 9" }),
|
|
2555
|
+
e("line", {
|
|
2556
|
+
x1: "10",
|
|
2557
|
+
y1: "14",
|
|
2558
|
+
x2: "21",
|
|
2559
|
+
y2: "3"
|
|
2560
|
+
})
|
|
2561
|
+
], -1)
|
|
2562
|
+
])])) : v("", !0),
|
|
2537
2563
|
e("button", {
|
|
2538
2564
|
class: "artifactuse-panel__action",
|
|
2539
2565
|
title: y(f).isFullscreen ? "Exit fullscreen" : "Fullscreen",
|
|
2540
2566
|
onClick: t[6] || (t[6] = (...p) => y(n) && y(n)(...p))
|
|
2541
2567
|
}, [
|
|
2542
|
-
y(f).isFullscreen ? (a(), s("svg",
|
|
2568
|
+
y(f).isFullscreen ? (a(), s("svg", tn, [...t[33] || (t[33] = [
|
|
2543
2569
|
e("polyline", { points: "4 14 10 14 10 20" }, null, -1),
|
|
2544
2570
|
e("polyline", { points: "20 10 14 10 14 4" }, null, -1),
|
|
2545
2571
|
e("line", {
|
|
@@ -2554,7 +2580,7 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2554
2580
|
x2: "10",
|
|
2555
2581
|
y2: "14"
|
|
2556
2582
|
}, null, -1)
|
|
2557
|
-
])])) : (a(), s("svg",
|
|
2583
|
+
])])) : (a(), s("svg", en, [...t[32] || (t[32] = [
|
|
2558
2584
|
e("polyline", { points: "15 3 21 3 21 9" }, null, -1),
|
|
2559
2585
|
e("polyline", { points: "9 21 3 21 3 15" }, null, -1),
|
|
2560
2586
|
e("line", {
|
|
@@ -2570,12 +2596,12 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2570
2596
|
y2: "14"
|
|
2571
2597
|
}, null, -1)
|
|
2572
2598
|
])]))
|
|
2573
|
-
], 8,
|
|
2599
|
+
], 8, Gl),
|
|
2574
2600
|
e("button", {
|
|
2575
2601
|
class: "artifactuse-panel__action artifactuse-panel__action--close",
|
|
2576
2602
|
title: "Close panel",
|
|
2577
2603
|
onClick: t[7] || (t[7] = (...p) => y(g) && y(g)(...p))
|
|
2578
|
-
}, [...t[
|
|
2604
|
+
}, [...t[34] || (t[34] = [
|
|
2579
2605
|
e("svg", {
|
|
2580
2606
|
viewBox: "0 0 24 24",
|
|
2581
2607
|
fill: "none",
|
|
@@ -2598,25 +2624,25 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2598
2624
|
])])
|
|
2599
2625
|
])
|
|
2600
2626
|
]),
|
|
2601
|
-
Te.value &&
|
|
2602
|
-
e("div",
|
|
2603
|
-
(a(!0), s(R, null, ve(
|
|
2627
|
+
Te.value && Xe.value.length > 0 ? (a(), s("div", an, [
|
|
2628
|
+
e("div", sn, [
|
|
2629
|
+
(a(!0), s(R, null, ve(Xe.value, (p) => {
|
|
2604
2630
|
var F;
|
|
2605
2631
|
return a(), s("button", {
|
|
2606
2632
|
key: p.id,
|
|
2607
|
-
class:
|
|
2608
|
-
onClick: (J) =>
|
|
2633
|
+
class: N(["artifactuse-panel__file-tab", { "artifactuse-panel__file-tab--active": p.id === ((F = y(o)) == null ? void 0 : F.id) }]),
|
|
2634
|
+
onClick: (J) => ht(p)
|
|
2609
2635
|
}, [
|
|
2610
2636
|
e("span", {
|
|
2611
2637
|
class: "artifactuse-panel__file-tab-icon",
|
|
2612
2638
|
innerHTML: Ie(p.language)
|
|
2613
|
-
}, null, 8,
|
|
2614
|
-
e("span",
|
|
2639
|
+
}, null, 8, nn),
|
|
2640
|
+
e("span", on, l(p.title || "Untitled"), 1),
|
|
2615
2641
|
e("button", {
|
|
2616
2642
|
class: "artifactuse-panel__file-tab-close",
|
|
2617
2643
|
title: "Close tab",
|
|
2618
|
-
onClick: he((J) =>
|
|
2619
|
-
}, [...t[
|
|
2644
|
+
onClick: he((J) => mt(p.id), ["stop"])
|
|
2645
|
+
}, [...t[35] || (t[35] = [
|
|
2620
2646
|
e("svg", {
|
|
2621
2647
|
viewBox: "0 0 24 24",
|
|
2622
2648
|
fill: "none",
|
|
@@ -2636,20 +2662,20 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2636
2662
|
y2: "18"
|
|
2637
2663
|
})
|
|
2638
2664
|
], -1)
|
|
2639
|
-
])], 8,
|
|
2640
|
-
], 10,
|
|
2665
|
+
])], 8, rn)
|
|
2666
|
+
], 10, ln);
|
|
2641
2667
|
}), 128))
|
|
2642
2668
|
])
|
|
2643
2669
|
])) : v("", !0),
|
|
2644
2670
|
e("div", {
|
|
2645
2671
|
ref_key: "contentRef",
|
|
2646
2672
|
ref: W,
|
|
2647
|
-
class:
|
|
2673
|
+
class: N(["artifactuse-panel__content", [
|
|
2648
2674
|
`artifactuse-panel__content--${y(f).viewMode}`,
|
|
2649
2675
|
{ "artifactuse-panel__content--transitioning": m.value }
|
|
2650
2676
|
]])
|
|
2651
2677
|
}, [
|
|
2652
|
-
m.value ? (a(), s("div",
|
|
2678
|
+
m.value ? (a(), s("div", cn, [...t[36] || (t[36] = [
|
|
2653
2679
|
e("div", { class: "artifactuse-panel__spinner" }, null, -1)
|
|
2654
2680
|
])])) : v("", !0),
|
|
2655
2681
|
y(f).viewMode === "preview" || y(f).viewMode === "split" ? (a(), s("div", {
|
|
@@ -2657,21 +2683,21 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2657
2683
|
class: "artifactuse-panel__preview",
|
|
2658
2684
|
style: He(y(f).viewMode === "split" ? { width: `${V.value}%` } : void 0)
|
|
2659
2685
|
}, [
|
|
2660
|
-
oe.value && A.value ? (a(), s("div",
|
|
2686
|
+
oe.value && A.value ? (a(), s("div", un, [...t[37] || (t[37] = [
|
|
2661
2687
|
e("div", { class: "artifactuse-panel__spinner" }, null, -1)
|
|
2662
2688
|
])])) : v("", !0),
|
|
2663
2689
|
A.value ? (a(), s("iframe", {
|
|
2664
2690
|
key: 1,
|
|
2665
2691
|
ref_key: "iframeRef",
|
|
2666
|
-
ref:
|
|
2692
|
+
ref: j,
|
|
2667
2693
|
src: A.value,
|
|
2668
|
-
class:
|
|
2694
|
+
class: N(["artifactuse-panel__iframe", { "artifactuse-panel__iframe--loading": oe.value }]),
|
|
2669
2695
|
sandbox: "allow-scripts allow-same-origin allow-forms allow-popups allow-modals allow-downloads allow-top-navigation-by-user-activation",
|
|
2670
|
-
allow: "camera; microphone; fullscreen; geolocation; display-capture; autoplay; clipboard-write",
|
|
2671
|
-
onLoad:
|
|
2672
|
-
onError:
|
|
2673
|
-
}, null, 42,
|
|
2674
|
-
t[
|
|
2696
|
+
allow: "camera; microphone; fullscreen; geolocation; display-capture; autoplay; clipboard-write; encrypted-media; gyroscope; accelerometer; picture-in-picture",
|
|
2697
|
+
onLoad: xt,
|
|
2698
|
+
onError: $t
|
|
2699
|
+
}, null, 42, dn)) : (a(), s("div", vn, [
|
|
2700
|
+
t[38] || (t[38] = e("svg", {
|
|
2675
2701
|
viewBox: "0 0 24 24",
|
|
2676
2702
|
fill: "none",
|
|
2677
2703
|
stroke: "currentColor",
|
|
@@ -2689,22 +2715,22 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2689
2715
|
e("p", null, "Preview not available for " + l(D.value), 1)
|
|
2690
2716
|
]))
|
|
2691
2717
|
], 4)) : v("", !0),
|
|
2692
|
-
|
|
2718
|
+
ot(e("div", {
|
|
2693
2719
|
class: "artifactuse-panel__code",
|
|
2694
2720
|
style: He(y(f).viewMode === "split" ? { width: `${100 - V.value}%` } : void 0)
|
|
2695
2721
|
}, [
|
|
2696
2722
|
y(f).viewMode === "split" ? (a(), s("div", {
|
|
2697
2723
|
key: 0,
|
|
2698
2724
|
class: "artifactuse-panel__split-handle",
|
|
2699
|
-
onMousedown: he(
|
|
2700
|
-
}, [...t[
|
|
2725
|
+
onMousedown: he(Ot, ["prevent"])
|
|
2726
|
+
}, [...t[39] || (t[39] = [
|
|
2701
2727
|
e("div", { class: "artifactuse-panel__split-handle-line" }, null, -1)
|
|
2702
2728
|
])], 32)) : v("", !0),
|
|
2703
2729
|
e("div", {
|
|
2704
2730
|
class: "artifactuse-panel__code-scroll",
|
|
2705
2731
|
ref_key: "codeScrollRef",
|
|
2706
2732
|
ref: S,
|
|
2707
|
-
onScroll:
|
|
2733
|
+
onScroll: Vt
|
|
2708
2734
|
}, [
|
|
2709
2735
|
e("div", {
|
|
2710
2736
|
class: "artifactuse-panel__line-numbers",
|
|
@@ -2712,32 +2738,32 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2712
2738
|
ref: Y
|
|
2713
2739
|
}, null, 512),
|
|
2714
2740
|
e("pre", {
|
|
2715
|
-
class:
|
|
2741
|
+
class: N(["artifactuse-panel__code-block", `language-${ae.value}`])
|
|
2716
2742
|
}, [
|
|
2717
2743
|
(a(), s("code", {
|
|
2718
2744
|
ref_key: "codeRef",
|
|
2719
2745
|
ref: O,
|
|
2720
2746
|
key: y(o).id,
|
|
2721
|
-
class:
|
|
2747
|
+
class: N(`language-${ae.value}`)
|
|
2722
2748
|
}, null, 2))
|
|
2723
2749
|
], 2)
|
|
2724
2750
|
], 544)
|
|
2725
2751
|
], 4), [
|
|
2726
|
-
[
|
|
2752
|
+
[rt, y(f).viewMode === "code" || y(f).viewMode === "split"]
|
|
2727
2753
|
]),
|
|
2728
|
-
|
|
2754
|
+
ot(e("div", fn, [
|
|
2729
2755
|
e("div", {
|
|
2730
2756
|
ref_key: "editorContainerRef",
|
|
2731
2757
|
ref: ie,
|
|
2732
2758
|
class: "artifactuse-panel__editor-container"
|
|
2733
2759
|
}, null, 512)
|
|
2734
2760
|
], 512), [
|
|
2735
|
-
[
|
|
2761
|
+
[rt, y(f).viewMode === "edit"]
|
|
2736
2762
|
])
|
|
2737
2763
|
], 2),
|
|
2738
|
-
e("footer",
|
|
2739
|
-
e("div",
|
|
2740
|
-
G.value ? (a(), s("a",
|
|
2764
|
+
e("footer", pn, [
|
|
2765
|
+
e("div", _n, [
|
|
2766
|
+
G.value ? (a(), s("a", hn, [...t[40] || (t[40] = [
|
|
2741
2767
|
e("svg", {
|
|
2742
2768
|
width: "16",
|
|
2743
2769
|
height: "16",
|
|
@@ -2756,17 +2782,17 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2756
2782
|
], -1),
|
|
2757
2783
|
e("span", null, "Artifactuse", -1)
|
|
2758
2784
|
])])) : v("", !0),
|
|
2759
|
-
y(o).size ? (a(), s("span",
|
|
2785
|
+
y(o).size ? (a(), s("span", mn, l(y(dt)(y(o).size)), 1)) : v("", !0)
|
|
2760
2786
|
]),
|
|
2761
|
-
e("div",
|
|
2787
|
+
e("div", yn, [
|
|
2762
2788
|
e("button", {
|
|
2763
|
-
class:
|
|
2789
|
+
class: N(["artifactuse-panel__footer-action", { "artifactuse-panel__footer-action--success": Z.value }]),
|
|
2764
2790
|
title: Z.value ? "Copied!" : "Copy code",
|
|
2765
|
-
onClick:
|
|
2791
|
+
onClick: Tt
|
|
2766
2792
|
}, [
|
|
2767
|
-
Z.value ? (a(), s("svg",
|
|
2793
|
+
Z.value ? (a(), s("svg", wn, [...t[42] || (t[42] = [
|
|
2768
2794
|
e("polyline", { points: "20 6 9 17 4 12" }, null, -1)
|
|
2769
|
-
])])) : (a(), s("svg",
|
|
2795
|
+
])])) : (a(), s("svg", kn, [...t[41] || (t[41] = [
|
|
2770
2796
|
e("rect", {
|
|
2771
2797
|
x: "9",
|
|
2772
2798
|
y: "9",
|
|
@@ -2777,12 +2803,12 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2777
2803
|
}, null, -1),
|
|
2778
2804
|
e("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" }, null, -1)
|
|
2779
2805
|
])]))
|
|
2780
|
-
], 10,
|
|
2806
|
+
], 10, gn),
|
|
2781
2807
|
e("button", {
|
|
2782
2808
|
class: "artifactuse-panel__footer-action",
|
|
2783
2809
|
title: "Download file",
|
|
2784
|
-
onClick:
|
|
2785
|
-
}, [...t[
|
|
2810
|
+
onClick: Lt
|
|
2811
|
+
}, [...t[43] || (t[43] = [
|
|
2786
2812
|
e("svg", {
|
|
2787
2813
|
viewBox: "0 0 24 24",
|
|
2788
2814
|
fill: "none",
|
|
@@ -2799,12 +2825,12 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2799
2825
|
})
|
|
2800
2826
|
], -1)
|
|
2801
2827
|
])]),
|
|
2802
|
-
|
|
2828
|
+
Me.value ? (a(), s("div", bn, [
|
|
2803
2829
|
e("button", {
|
|
2804
2830
|
class: "artifactuse-panel__footer-action",
|
|
2805
2831
|
title: "Share",
|
|
2806
|
-
onClick:
|
|
2807
|
-
}, [...t[
|
|
2832
|
+
onClick: At
|
|
2833
|
+
}, [...t[44] || (t[44] = [
|
|
2808
2834
|
e("svg", {
|
|
2809
2835
|
viewBox: "0 0 24 24",
|
|
2810
2836
|
fill: "none",
|
|
@@ -2842,13 +2868,13 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2842
2868
|
])]),
|
|
2843
2869
|
ze(Ee, { name: "artifactuse-popup" }, {
|
|
2844
2870
|
default: Be(() => [
|
|
2845
|
-
re.value ? (a(), s("div",
|
|
2846
|
-
e("div",
|
|
2847
|
-
e("span",
|
|
2871
|
+
re.value ? (a(), s("div", Cn, [
|
|
2872
|
+
e("div", xn, [
|
|
2873
|
+
e("span", $n, l(P.value === "success" ? le.value ? "Artifact updated!" : "Link created!" : P.value === "update-list" ? "Update saved artifact" : "Share Artifact"), 1),
|
|
2848
2874
|
e("button", {
|
|
2849
2875
|
class: "artifactuse-share-popup__close",
|
|
2850
|
-
onClick:
|
|
2851
|
-
}, [...t[
|
|
2876
|
+
onClick: Ht
|
|
2877
|
+
}, [...t[45] || (t[45] = [
|
|
2852
2878
|
e("svg", {
|
|
2853
2879
|
viewBox: "0 0 24 24",
|
|
2854
2880
|
fill: "none",
|
|
@@ -2870,29 +2896,29 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2870
2896
|
], -1)
|
|
2871
2897
|
])])
|
|
2872
2898
|
]),
|
|
2873
|
-
e("div",
|
|
2874
|
-
P.value === "loading" ? (a(), s("div",
|
|
2899
|
+
e("div", Mn, [
|
|
2900
|
+
P.value === "loading" ? (a(), s("div", Tn, [...t[46] || (t[46] = [
|
|
2875
2901
|
e("div", { class: "artifactuse-share-popup__spinner" }, null, -1),
|
|
2876
2902
|
e("p", { class: "artifactuse-share-popup__loading-text" }, "Creating link...", -1)
|
|
2877
|
-
])])) : P.value === "error" ? (a(), s("div",
|
|
2878
|
-
e("div",
|
|
2879
|
-
e("p",
|
|
2903
|
+
])])) : P.value === "error" ? (a(), s("div", Ln, [
|
|
2904
|
+
e("div", Pn, [
|
|
2905
|
+
e("p", An, l(L.value), 1)
|
|
2880
2906
|
]),
|
|
2881
|
-
e("div",
|
|
2907
|
+
e("div", Hn, [
|
|
2882
2908
|
e("button", {
|
|
2883
2909
|
class: "artifactuse-share-popup__btn artifactuse-share-popup__btn--secondary",
|
|
2884
2910
|
onClick: t[8] || (t[8] = (p) => P.value = "options")
|
|
2885
2911
|
}, " Back "),
|
|
2886
2912
|
e("button", {
|
|
2887
2913
|
class: "artifactuse-share-popup__btn artifactuse-share-popup__btn--primary",
|
|
2888
|
-
onClick:
|
|
2914
|
+
onClick: Et
|
|
2889
2915
|
}, " Retry ")
|
|
2890
2916
|
])
|
|
2891
|
-
])) : P.value === "options" ? (a(), s("div",
|
|
2917
|
+
])) : P.value === "options" ? (a(), s("div", En, [
|
|
2892
2918
|
e("button", {
|
|
2893
2919
|
class: "artifactuse-share-popup__option",
|
|
2894
|
-
onClick:
|
|
2895
|
-
}, [...t[
|
|
2920
|
+
onClick: Qe
|
|
2921
|
+
}, [...t[47] || (t[47] = [
|
|
2896
2922
|
e("div", { class: "artifactuse-share-popup__option-icon" }, [
|
|
2897
2923
|
e("svg", {
|
|
2898
2924
|
viewBox: "0 0 24 24",
|
|
@@ -2911,8 +2937,8 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2911
2937
|
])]),
|
|
2912
2938
|
e("button", {
|
|
2913
2939
|
class: "artifactuse-share-popup__option",
|
|
2914
|
-
onClick:
|
|
2915
|
-
}, [...t[
|
|
2940
|
+
onClick: Ge
|
|
2941
|
+
}, [...t[48] || (t[48] = [
|
|
2916
2942
|
e("div", { class: "artifactuse-share-popup__option-icon" }, [
|
|
2917
2943
|
e("svg", {
|
|
2918
2944
|
viewBox: "0 0 24 24",
|
|
@@ -2932,8 +2958,8 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2932
2958
|
])]),
|
|
2933
2959
|
e("button", {
|
|
2934
2960
|
class: "artifactuse-share-popup__option",
|
|
2935
|
-
onClick:
|
|
2936
|
-
}, [...t[
|
|
2961
|
+
onClick: Bt
|
|
2962
|
+
}, [...t[49] || (t[49] = [
|
|
2937
2963
|
e("div", { class: "artifactuse-share-popup__option-icon" }, [
|
|
2938
2964
|
e("svg", {
|
|
2939
2965
|
viewBox: "0 0 24 24",
|
|
@@ -2951,29 +2977,29 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2951
2977
|
e("p", { class: "artifactuse-share-popup__option-desc" }, "Replace an existing artifact")
|
|
2952
2978
|
], -1)
|
|
2953
2979
|
])])
|
|
2954
|
-
])) : P.value === "update-list" ? (a(), s("div",
|
|
2955
|
-
z.value ? (a(), s("div",
|
|
2980
|
+
])) : P.value === "update-list" ? (a(), s("div", Bn, [
|
|
2981
|
+
z.value ? (a(), s("div", Sn, [...t[50] || (t[50] = [
|
|
2956
2982
|
e("div", { class: "artifactuse-share-popup__spinner" }, null, -1),
|
|
2957
2983
|
e("p", { class: "artifactuse-share-popup__loading-text" }, "Loading artifacts...", -1)
|
|
2958
|
-
])])) : u.value.length === 0 ? (a(), s("div",
|
|
2984
|
+
])])) : u.value.length === 0 ? (a(), s("div", zn, " No saved artifacts of this type ")) : (a(), s("div", Vn, [
|
|
2959
2985
|
(a(!0), s(R, null, ve(u.value, (p) => {
|
|
2960
2986
|
var F, J, me;
|
|
2961
2987
|
return a(), s("button", {
|
|
2962
2988
|
key: ((F = p.project) == null ? void 0 : F.uuid) || p.id,
|
|
2963
2989
|
class: "artifactuse-share-popup__artifact-item",
|
|
2964
|
-
onClick: (ue) =>
|
|
2990
|
+
onClick: (ue) => St(p)
|
|
2965
2991
|
}, [
|
|
2966
|
-
e("span",
|
|
2967
|
-
e("span",
|
|
2968
|
-
], 8,
|
|
2992
|
+
e("span", Fn, l(((J = p.project) == null ? void 0 : J.name) || "Untitled"), 1),
|
|
2993
|
+
e("span", Rn, l(Ye((me = p.project) == null ? void 0 : me.created_at)), 1)
|
|
2994
|
+
], 8, In);
|
|
2969
2995
|
}), 128))
|
|
2970
2996
|
])),
|
|
2971
2997
|
e("button", {
|
|
2972
2998
|
class: "artifactuse-share-popup__back-btn",
|
|
2973
2999
|
onClick: t[9] || (t[9] = (p) => P.value = "options")
|
|
2974
3000
|
}, "Back")
|
|
2975
|
-
])) : P.value === "success" ? (a(), s("div",
|
|
2976
|
-
t[
|
|
3001
|
+
])) : P.value === "success" ? (a(), s("div", qn, [
|
|
3002
|
+
t[53] || (t[53] = e("div", { class: "artifactuse-share-popup__success-icon" }, [
|
|
2977
3003
|
e("svg", {
|
|
2978
3004
|
viewBox: "0 0 24 24",
|
|
2979
3005
|
fill: "none",
|
|
@@ -2983,21 +3009,21 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
2983
3009
|
e("polyline", { points: "20 6 9 17 4 12" })
|
|
2984
3010
|
])
|
|
2985
3011
|
], -1)),
|
|
2986
|
-
e("div",
|
|
3012
|
+
e("div", On, [
|
|
2987
3013
|
e("input", {
|
|
2988
3014
|
type: "text",
|
|
2989
3015
|
class: "artifactuse-share-popup__link",
|
|
2990
3016
|
value: Q.value,
|
|
2991
3017
|
readonly: "",
|
|
2992
3018
|
onClick: t[10] || (t[10] = (p) => p.target.select())
|
|
2993
|
-
}, null, 8,
|
|
3019
|
+
}, null, 8, Un),
|
|
2994
3020
|
e("button", {
|
|
2995
|
-
class:
|
|
2996
|
-
onClick:
|
|
3021
|
+
class: N(["artifactuse-share-popup__copy-btn", { "artifactuse-share-popup__copy-btn--copied": r.value }]),
|
|
3022
|
+
onClick: zt
|
|
2997
3023
|
}, l(r.value ? "Copied!" : "Copy"), 3)
|
|
2998
3024
|
]),
|
|
2999
|
-
w.value && !B.value ? (a(), s("div",
|
|
3000
|
-
t[
|
|
3025
|
+
w.value && !B.value ? (a(), s("div", Dn, [
|
|
3026
|
+
t[51] || (t[51] = e("span", { class: "artifactuse-share-popup__expiry-icon" }, [
|
|
3001
3027
|
e("svg", {
|
|
3002
3028
|
viewBox: "0 0 24 24",
|
|
3003
3029
|
fill: "none",
|
|
@@ -3023,18 +3049,18 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
3023
3049
|
})
|
|
3024
3050
|
])
|
|
3025
3051
|
], -1)),
|
|
3026
|
-
e("span",
|
|
3052
|
+
e("span", jn, " Expires " + l(Ye(w.value)), 1)
|
|
3027
3053
|
])) : v("", !0),
|
|
3028
3054
|
B.value ? v("", !0) : (a(), s("div", Nn, [
|
|
3029
|
-
t[
|
|
3055
|
+
t[52] || (t[52] = e("p", { class: "artifactuse-share-popup__save-prompt-text" }, "Keep it permanently?", -1)),
|
|
3030
3056
|
e("button", {
|
|
3031
3057
|
class: "artifactuse-share-popup__save-prompt-btn",
|
|
3032
|
-
onClick:
|
|
3058
|
+
onClick: Ge
|
|
3033
3059
|
}, " Save to account ")
|
|
3034
3060
|
]))
|
|
3035
3061
|
])) : v("", !0)
|
|
3036
3062
|
]),
|
|
3037
|
-
t[
|
|
3063
|
+
t[54] || (t[54] = e("div", { class: "artifactuse-share-popup__footer" }, [
|
|
3038
3064
|
e("a", {
|
|
3039
3065
|
href: "https://artifactuse.com",
|
|
3040
3066
|
target: "_blank",
|
|
@@ -3069,8 +3095,8 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
3069
3095
|
key: 1,
|
|
3070
3096
|
class: "artifactuse-panel__footer-action",
|
|
3071
3097
|
title: "Open in new tab",
|
|
3072
|
-
onClick:
|
|
3073
|
-
}, [...t[
|
|
3098
|
+
onClick: et
|
|
3099
|
+
}, [...t[55] || (t[55] = [
|
|
3074
3100
|
e("svg", {
|
|
3075
3101
|
viewBox: "0 0 24 24",
|
|
3076
3102
|
fill: "none",
|
|
@@ -3087,13 +3113,13 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
3087
3113
|
})
|
|
3088
3114
|
], -1)
|
|
3089
3115
|
])])) : v("", !0),
|
|
3090
|
-
!Te.value && d.value.length > 1 ? (a(), s("div",
|
|
3116
|
+
!Te.value && d.value.length > 1 ? (a(), s("div", Wn, [
|
|
3091
3117
|
e("button", {
|
|
3092
3118
|
class: "artifactuse-panel__nav-btn",
|
|
3093
3119
|
disabled: U.value <= 0,
|
|
3094
3120
|
title: "Previous artifact",
|
|
3095
|
-
onClick:
|
|
3096
|
-
}, [...t[
|
|
3121
|
+
onClick: Ft
|
|
3122
|
+
}, [...t[56] || (t[56] = [
|
|
3097
3123
|
e("svg", {
|
|
3098
3124
|
viewBox: "0 0 24 24",
|
|
3099
3125
|
fill: "none",
|
|
@@ -3102,14 +3128,14 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
3102
3128
|
}, [
|
|
3103
3129
|
e("polyline", { points: "15 18 9 12 15 6" })
|
|
3104
3130
|
], -1)
|
|
3105
|
-
])], 8,
|
|
3131
|
+
])], 8, Jn),
|
|
3106
3132
|
e("button", {
|
|
3107
3133
|
class: "artifactuse-panel__nav-trigger",
|
|
3108
3134
|
title: "View all artifacts",
|
|
3109
|
-
onClick:
|
|
3135
|
+
onClick: It
|
|
3110
3136
|
}, [
|
|
3111
3137
|
e("span", null, l(U.value + 1) + " / " + l(d.value.length), 1),
|
|
3112
|
-
t[
|
|
3138
|
+
t[57] || (t[57] = e("svg", {
|
|
3113
3139
|
viewBox: "0 0 24 24",
|
|
3114
3140
|
fill: "none",
|
|
3115
3141
|
stroke: "currentColor",
|
|
@@ -3122,8 +3148,8 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
3122
3148
|
class: "artifactuse-panel__nav-btn",
|
|
3123
3149
|
disabled: U.value >= d.value.length - 1,
|
|
3124
3150
|
title: "Next artifact",
|
|
3125
|
-
onClick:
|
|
3126
|
-
}, [...t[
|
|
3151
|
+
onClick: Rt
|
|
3152
|
+
}, [...t[58] || (t[58] = [
|
|
3127
3153
|
e("svg", {
|
|
3128
3154
|
viewBox: "0 0 24 24",
|
|
3129
3155
|
fill: "none",
|
|
@@ -3132,16 +3158,16 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
3132
3158
|
}, [
|
|
3133
3159
|
e("polyline", { points: "9 18 15 12 9 6" })
|
|
3134
3160
|
], -1)
|
|
3135
|
-
])], 8,
|
|
3161
|
+
])], 8, Xn),
|
|
3136
3162
|
ze(Ee, { name: "artifactuse-popup" }, {
|
|
3137
3163
|
default: Be(() => [
|
|
3138
|
-
X.value ? (a(), s("div",
|
|
3139
|
-
e("div",
|
|
3140
|
-
t[
|
|
3164
|
+
X.value ? (a(), s("div", Zn, [
|
|
3165
|
+
e("div", Kn, [
|
|
3166
|
+
t[60] || (t[60] = e("span", null, "Artifacts", -1)),
|
|
3141
3167
|
e("button", {
|
|
3142
3168
|
class: "artifactuse-panel__artifact-list-close",
|
|
3143
3169
|
onClick: t[11] || (t[11] = (p) => X.value = !1)
|
|
3144
|
-
}, [...t[
|
|
3170
|
+
}, [...t[59] || (t[59] = [
|
|
3145
3171
|
e("svg", {
|
|
3146
3172
|
viewBox: "0 0 24 24",
|
|
3147
3173
|
fill: "none",
|
|
@@ -3163,27 +3189,27 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
3163
3189
|
], -1)
|
|
3164
3190
|
])])
|
|
3165
3191
|
]),
|
|
3166
|
-
e("div",
|
|
3192
|
+
e("div", Yn, [
|
|
3167
3193
|
(a(!0), s(R, null, ve(d.value, (p, F) => (a(), s("button", {
|
|
3168
3194
|
key: p.id,
|
|
3169
|
-
class:
|
|
3170
|
-
onClick: (J) =>
|
|
3195
|
+
class: N(["artifactuse-panel__artifact-item", { "artifactuse-panel__artifact-item--active": p.id === y(o).id }]),
|
|
3196
|
+
onClick: (J) => tt(p)
|
|
3171
3197
|
}, [
|
|
3172
3198
|
e("span", {
|
|
3173
3199
|
class: "artifactuse-panel__artifact-item-icon",
|
|
3174
3200
|
innerHTML: Ie(p.language)
|
|
3175
|
-
}, null, 8,
|
|
3176
|
-
e("div",
|
|
3177
|
-
e("span",
|
|
3178
|
-
e("span",
|
|
3201
|
+
}, null, 8, Gn),
|
|
3202
|
+
e("div", eo, [
|
|
3203
|
+
e("span", to, l(p.title || "Untitled"), 1),
|
|
3204
|
+
e("span", ao, [
|
|
3179
3205
|
K(l(y(Se)(p.language)) + " ", 1),
|
|
3180
3206
|
p.lineCount ? (a(), s(R, { key: 0 }, [
|
|
3181
3207
|
K(" • " + l(p.lineCount) + " lines ", 1)
|
|
3182
3208
|
], 64)) : v("", !0)
|
|
3183
3209
|
])
|
|
3184
3210
|
]),
|
|
3185
|
-
e("span",
|
|
3186
|
-
], 10,
|
|
3211
|
+
e("span", so, l(F + 1), 1)
|
|
3212
|
+
], 10, Qn))), 128))
|
|
3187
3213
|
])
|
|
3188
3214
|
])) : v("", !0)
|
|
3189
3215
|
]),
|
|
@@ -3198,17 +3224,17 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
3198
3224
|
_: 1
|
|
3199
3225
|
}));
|
|
3200
3226
|
}
|
|
3201
|
-
},
|
|
3227
|
+
}, io = ["title"], lo = {
|
|
3202
3228
|
key: 0,
|
|
3203
3229
|
class: "artifactuse-panel-toggle-badge"
|
|
3204
|
-
},
|
|
3230
|
+
}, fo = {
|
|
3205
3231
|
__name: "ArtifactusePanelToggle",
|
|
3206
3232
|
setup(H) {
|
|
3207
|
-
const { state: c, artifactCount: _, hasArtifacts:
|
|
3233
|
+
const { state: c, artifactCount: _, hasArtifacts: M, togglePanel: f } = Ve();
|
|
3208
3234
|
return (o, q) => (a(), s("button", {
|
|
3209
|
-
class:
|
|
3235
|
+
class: N(["artifactuse-panel-toggle", {
|
|
3210
3236
|
"artifactuse-panel-toggle--active": y(c).isPanelOpen,
|
|
3211
|
-
"artifactuse-panel-toggle--has-artifacts": y(
|
|
3237
|
+
"artifactuse-panel-toggle--has-artifacts": y(M)
|
|
3212
3238
|
}]),
|
|
3213
3239
|
onClick: q[0] || (q[0] = (...E) => y(f) && y(f)(...E)),
|
|
3214
3240
|
title: y(c).isPanelOpen ? "Close artifacts panel" : "Open artifacts panel"
|
|
@@ -3224,13 +3250,13 @@ const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class
|
|
|
3224
3250
|
e("polyline", { points: "16 18 22 12 16 6" }),
|
|
3225
3251
|
e("polyline", { points: "8 6 2 12 8 18" })
|
|
3226
3252
|
], -1)),
|
|
3227
|
-
y(_) > 0 ? (a(), s("span",
|
|
3228
|
-
], 10,
|
|
3253
|
+
y(_) > 0 ? (a(), s("span", lo, l(y(_) > 99 ? "99+" : y(_)), 1)) : v("", !0)
|
|
3254
|
+
], 10, io));
|
|
3229
3255
|
}
|
|
3230
|
-
},
|
|
3231
|
-
function
|
|
3256
|
+
}, ft = Symbol("artifactuse");
|
|
3257
|
+
function pt(H = {}) {
|
|
3232
3258
|
var n;
|
|
3233
|
-
const c =
|
|
3259
|
+
const c = vt(H), _ = ut({
|
|
3234
3260
|
artifacts: [],
|
|
3235
3261
|
activeArtifactId: null,
|
|
3236
3262
|
isPanelOpen: !1,
|
|
@@ -3243,7 +3269,7 @@ function vt(H = {}) {
|
|
|
3243
3269
|
c.state.subscribe((h) => {
|
|
3244
3270
|
_.artifacts = h.artifacts, _.activeArtifactId = h.activeArtifactId, _.isPanelOpen = h.isPanelOpen, _.viewMode = h.viewMode, _.isFullscreen = h.isFullscreen, _.openTabs = h.openTabs, _.tabViewModes = h.tabViewModes, _.forceEmptyView = h.forceEmptyView;
|
|
3245
3271
|
});
|
|
3246
|
-
const
|
|
3272
|
+
const M = C(() => _.activeArtifactId && _.artifacts.find((h) => h.id === _.activeArtifactId) || null), f = C(() => _.artifacts.filter((h) => !h.isInline).length), o = C(() => _.artifacts.some((h) => !h.isInline)), q = C(() => c.getPanelTypes()), E = C(() => M.value ? c.getPanelUrl(M.value) : null);
|
|
3247
3273
|
if (c.applyTheme(), H.theme === "auto" || !H.theme) {
|
|
3248
3274
|
const h = ((n = c.bridge) == null ? void 0 : n.theme) || c.theme;
|
|
3249
3275
|
h != null && h.watchSystemTheme && h.watchSystemTheme(() => {
|
|
@@ -3253,7 +3279,7 @@ function vt(H = {}) {
|
|
|
3253
3279
|
const g = {
|
|
3254
3280
|
instance: c,
|
|
3255
3281
|
state: _,
|
|
3256
|
-
activeArtifact:
|
|
3282
|
+
activeArtifact: M,
|
|
3257
3283
|
artifactCount: f,
|
|
3258
3284
|
hasArtifacts: o,
|
|
3259
3285
|
// Panel computed
|
|
@@ -3294,14 +3320,14 @@ function vt(H = {}) {
|
|
|
3294
3320
|
},
|
|
3295
3321
|
getTheme: c.getTheme
|
|
3296
3322
|
};
|
|
3297
|
-
return
|
|
3323
|
+
return Jt(ft, g), g;
|
|
3298
3324
|
}
|
|
3299
3325
|
function Ve() {
|
|
3300
|
-
const H =
|
|
3301
|
-
return H || (console.warn("useArtifactuse() called without provideArtifactuse(). Creating standalone instance."),
|
|
3326
|
+
const H = Xt(ft);
|
|
3327
|
+
return H || (console.warn("useArtifactuse() called without provideArtifactuse(). Creating standalone instance."), pt());
|
|
3302
3328
|
}
|
|
3303
|
-
function
|
|
3304
|
-
const c =
|
|
3329
|
+
function no(H = {}) {
|
|
3330
|
+
const c = vt(H), _ = ut({
|
|
3305
3331
|
artifacts: [],
|
|
3306
3332
|
activeArtifactId: null,
|
|
3307
3333
|
isPanelOpen: !1,
|
|
@@ -3311,13 +3337,13 @@ function lo(H = {}) {
|
|
|
3311
3337
|
tabViewModes: {},
|
|
3312
3338
|
forceEmptyView: !1
|
|
3313
3339
|
});
|
|
3314
|
-
let
|
|
3315
|
-
|
|
3316
|
-
|
|
3340
|
+
let M;
|
|
3341
|
+
$e(() => {
|
|
3342
|
+
M = c.state.subscribe((n) => {
|
|
3317
3343
|
_.artifacts = n.artifacts, _.activeArtifactId = n.activeArtifactId, _.isPanelOpen = n.isPanelOpen, _.viewMode = n.viewMode, _.isFullscreen = n.isFullscreen, _.openTabs = n.openTabs, _.tabViewModes = n.tabViewModes, _.forceEmptyView = n.forceEmptyView;
|
|
3318
3344
|
}), c.applyTheme();
|
|
3319
3345
|
}), We(() => {
|
|
3320
|
-
|
|
3346
|
+
M && M(), c.destroy();
|
|
3321
3347
|
});
|
|
3322
3348
|
const f = C(() => _.activeArtifactId && _.artifacts.find((n) => n.id === _.activeArtifactId) || null), o = C(() => _.artifacts.filter((n) => !n.isInline).length), q = C(() => _.artifacts.some((n) => !n.isInline)), E = C(() => c.getPanelTypes()), g = C(() => f.value ? c.getPanelUrl(f.value) : null);
|
|
3323
3349
|
return {
|
|
@@ -3365,23 +3391,23 @@ function lo(H = {}) {
|
|
|
3365
3391
|
getTheme: c.getTheme
|
|
3366
3392
|
};
|
|
3367
3393
|
}
|
|
3368
|
-
const
|
|
3369
|
-
provideArtifactuse:
|
|
3394
|
+
const po = {
|
|
3395
|
+
provideArtifactuse: pt,
|
|
3370
3396
|
useArtifactuse: Ve,
|
|
3371
|
-
createArtifactuseComposable:
|
|
3372
|
-
DEFAULT_PANELS:
|
|
3397
|
+
createArtifactuseComposable: no,
|
|
3398
|
+
DEFAULT_PANELS: Yt
|
|
3373
3399
|
};
|
|
3374
3400
|
export {
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3401
|
+
uo as ArtifactuseAgentMessage,
|
|
3402
|
+
ua as ArtifactuseCard,
|
|
3403
|
+
Ga as ArtifactuseInlineForm,
|
|
3404
|
+
vo as ArtifactusePanel,
|
|
3405
|
+
fo as ArtifactusePanelToggle,
|
|
3406
|
+
al as ArtifactuseSocialPreview,
|
|
3407
|
+
ul as ArtifactuseViewer,
|
|
3408
|
+
Yt as DEFAULT_PANELS,
|
|
3409
|
+
no as createArtifactuseComposable,
|
|
3410
|
+
po as default,
|
|
3411
|
+
pt as provideArtifactuse,
|
|
3386
3412
|
Ve as useArtifactuse
|
|
3387
3413
|
};
|