artifactuse 0.2.0 → 0.2.3
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 +1 -0
- package/dist/core/index.d.ts +15 -0
- package/dist/core/state.d.ts +8 -0
- package/dist/{index-llShix6s.js → index-B4BEvWtI.js} +1202 -962
- package/dist/index.js +1 -1
- package/dist/react/index.js +533 -511
- package/dist/styles/components/panel.css +106 -0
- package/dist/svelte/index.d.ts +57 -0
- package/dist/svelte/index.js +1897 -1836
- package/dist/vue/index.d.ts +44 -0
- package/dist/vue/index.js +1450 -1369
- package/dist/vue2/composables.d.ts +44 -0
- package/dist/vue2/index.js +653 -86
- package/package.json +1 -1
package/dist/vue/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { ref as M, computed as
|
|
2
|
-
import { g as Se, f as
|
|
3
|
-
import { J as
|
|
4
|
-
const
|
|
1
|
+
import { ref as M, computed as C, createElementBlock as s, openBlock as a, normalizeClass as j, createElementVNode as e, toDisplayString as l, withModifiers as he, onMounted as Me, watch as de, Fragment as R, createCommentVNode as v, renderList as ve, createTextVNode as K, h as se, normalizeStyle as He, createStaticVNode as Ot, createBlock as $e, resolveDynamicComponent as Ut, nextTick as xe, onUnmounted as We, Teleport as Dt, createVNode as ze, Transition as Ee, withCtx as Be, withKeys as Nt, onBeforeUnmount as jt, unref as y, withDirectives as lt, vShow as nt, reactive as rt, provide as Wt, inject as Jt } from "vue";
|
|
2
|
+
import { g as Se, f as ct, a as Ne, b as je, n as Xt, i as ot, c as Zt, D as Kt, d as ut } from "../index-B4BEvWtI.js";
|
|
3
|
+
import { J as Yt } from "../jszip.min-CdmYyw5L.js";
|
|
4
|
+
const Qt = { class: "artifactuse-card__icon" }, Gt = ["innerHTML"], ea = { class: "artifactuse-card__content" }, ta = { class: "artifactuse-card__title" }, aa = { class: "artifactuse-card__meta" }, sa = { class: "artifactuse-card__type" }, ia = { class: "artifactuse-card__size" }, la = { class: "artifactuse-card__actions" }, na = ["title"], oa = {
|
|
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
|
+
}, ra = {
|
|
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
|
+
}, ca = {
|
|
17
17
|
__name: "ArtifactuseCard",
|
|
18
18
|
props: {
|
|
19
19
|
artifact: {
|
|
@@ -26,58 +26,58 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
emits: ["open", "copy", "download"],
|
|
29
|
-
setup(H, { emit:
|
|
30
|
-
const _ = H,
|
|
29
|
+
setup(H, { emit: c }) {
|
|
30
|
+
const _ = H, T = c, f = M(!1), o = C(() => Se(_.artifact.language)), q = C(() => {
|
|
31
31
|
var x;
|
|
32
|
-
return
|
|
33
|
-
}),
|
|
34
|
-
function
|
|
35
|
-
x.stopPropagation(),
|
|
32
|
+
return ct(_.artifact.size || ((x = _.artifact.code) == null ? void 0 : x.length) || 0);
|
|
33
|
+
}), E = C(() => Ne(_.artifact.language));
|
|
34
|
+
function g(x) {
|
|
35
|
+
x.stopPropagation(), T("open", _.artifact);
|
|
36
36
|
}
|
|
37
37
|
async function n() {
|
|
38
38
|
try {
|
|
39
|
-
await navigator.clipboard.writeText(_.artifact.code),
|
|
40
|
-
|
|
41
|
-
}, 2e3),
|
|
39
|
+
await navigator.clipboard.writeText(_.artifact.code), f.value = !0, setTimeout(() => {
|
|
40
|
+
f.value = !1;
|
|
41
|
+
}, 2e3), T("copy", _.artifact);
|
|
42
42
|
} catch (x) {
|
|
43
43
|
console.error("Failed to copy:", x);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function h() {
|
|
47
47
|
var W;
|
|
48
|
-
const x = new Blob([_.artifact.code], { type: "text/plain" }),
|
|
49
|
-
$.href =
|
|
48
|
+
const x = new Blob([_.artifact.code], { type: "text/plain" }), I = URL.createObjectURL(x), $ = document.createElement("a"), N = je(_.artifact.language), O = ((W = _.artifact.title) == null ? void 0 : W.replace(/[^a-z0-9]/gi, "_").toLowerCase()) || "code";
|
|
49
|
+
$.href = I, $.download = `${O}.${N}`, document.body.appendChild($), $.click(), document.body.removeChild($), URL.revokeObjectURL(I), T("download", _.artifact);
|
|
50
50
|
}
|
|
51
|
-
return (x,
|
|
52
|
-
class:
|
|
53
|
-
onClick:
|
|
51
|
+
return (x, I) => (a(), s("div", {
|
|
52
|
+
class: j(["artifactuse-card", { "artifactuse-card--active": H.isActive }]),
|
|
53
|
+
onClick: g
|
|
54
54
|
}, [
|
|
55
|
-
e("div",
|
|
55
|
+
e("div", Qt, [
|
|
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
|
-
innerHTML:
|
|
62
|
-
}, null, 8,
|
|
61
|
+
innerHTML: E.value
|
|
62
|
+
}, null, 8, Gt))
|
|
63
63
|
]),
|
|
64
|
-
e("div",
|
|
65
|
-
e("div",
|
|
66
|
-
e("div",
|
|
67
|
-
e("span",
|
|
68
|
-
|
|
69
|
-
e("span",
|
|
64
|
+
e("div", ea, [
|
|
65
|
+
e("div", ta, l(H.artifact.title), 1),
|
|
66
|
+
e("div", aa, [
|
|
67
|
+
e("span", sa, l(o.value), 1),
|
|
68
|
+
I[0] || (I[0] = e("span", { class: "artifactuse-card__separator" }, "•", -1)),
|
|
69
|
+
e("span", ia, l(q.value), 1)
|
|
70
70
|
])
|
|
71
71
|
]),
|
|
72
|
-
e("div",
|
|
72
|
+
e("div", la, [
|
|
73
73
|
e("button", {
|
|
74
74
|
class: "artifactuse-card__action",
|
|
75
|
-
onClick:
|
|
76
|
-
title:
|
|
75
|
+
onClick: he(n, ["stop"]),
|
|
76
|
+
title: f.value ? "Copied!" : "Copy code"
|
|
77
77
|
}, [
|
|
78
|
-
|
|
78
|
+
f.value ? (a(), s("svg", ra, [...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", oa, [...I[1] || (I[1] = [
|
|
81
81
|
e("rect", {
|
|
82
82
|
x: "9",
|
|
83
83
|
y: "9",
|
|
@@ -88,12 +88,12 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { 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, na),
|
|
92
92
|
e("button", {
|
|
93
93
|
class: "artifactuse-card__action",
|
|
94
|
-
onClick:
|
|
94
|
+
onClick: he(h, ["stop"]),
|
|
95
95
|
title: "Download file"
|
|
96
|
-
}, [...
|
|
96
|
+
}, [...I[3] || (I[3] = [
|
|
97
97
|
e("svg", {
|
|
98
98
|
viewBox: "0 0 24 24",
|
|
99
99
|
fill: "none",
|
|
@@ -111,7 +111,7 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
111
111
|
], -1)
|
|
112
112
|
])])
|
|
113
113
|
]),
|
|
114
|
-
|
|
114
|
+
I[4] || (I[4] = e("div", { class: "artifactuse-card__arrow" }, [
|
|
115
115
|
e("svg", {
|
|
116
116
|
viewBox: "0 0 24 24",
|
|
117
117
|
fill: "none",
|
|
@@ -123,10 +123,10 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
123
123
|
], -1))
|
|
124
124
|
], 2));
|
|
125
125
|
}
|
|
126
|
-
},
|
|
126
|
+
}, ua = ["data-artifactuse-theme"], da = {
|
|
127
127
|
key: 0,
|
|
128
128
|
class: "artifactuse-form-collapsed"
|
|
129
|
-
},
|
|
129
|
+
}, va = { class: "artifactuse-form-collapsed-icon" }, fa = {
|
|
130
130
|
key: 0,
|
|
131
131
|
viewBox: "0 0 24 24",
|
|
132
132
|
fill: "none",
|
|
@@ -134,7 +134,7 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
134
134
|
"stroke-width": "2.5",
|
|
135
135
|
"stroke-linecap": "round",
|
|
136
136
|
"stroke-linejoin": "round"
|
|
137
|
-
},
|
|
137
|
+
}, pa = {
|
|
138
138
|
key: 1,
|
|
139
139
|
viewBox: "0 0 24 24",
|
|
140
140
|
fill: "none",
|
|
@@ -142,7 +142,7 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
142
142
|
"stroke-width": "2.5",
|
|
143
143
|
"stroke-linecap": "round",
|
|
144
144
|
"stroke-linejoin": "round"
|
|
145
|
-
},
|
|
145
|
+
}, _a = {
|
|
146
146
|
key: 2,
|
|
147
147
|
viewBox: "0 0 24 24",
|
|
148
148
|
fill: "none",
|
|
@@ -150,64 +150,64 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
150
150
|
"stroke-width": "2.5",
|
|
151
151
|
"stroke-linecap": "round",
|
|
152
152
|
"stroke-linejoin": "round"
|
|
153
|
-
},
|
|
153
|
+
}, ha = { class: "artifactuse-form-collapsed-title" }, ma = {
|
|
154
154
|
key: 0,
|
|
155
155
|
class: "artifactuse-form-header"
|
|
156
|
-
},
|
|
156
|
+
}, ya = {
|
|
157
157
|
key: 0,
|
|
158
158
|
class: "artifactuse-form-title"
|
|
159
|
-
},
|
|
159
|
+
}, ga = {
|
|
160
160
|
key: 1,
|
|
161
161
|
class: "artifactuse-form-description"
|
|
162
|
-
},
|
|
162
|
+
}, ka = {
|
|
163
163
|
key: 1,
|
|
164
164
|
class: "artifactuse-form-buttons"
|
|
165
|
-
},
|
|
165
|
+
}, wa = ["disabled", "onClick"], ba = ["innerHTML"], Ca = { class: "artifactuse-form-fields" }, xa = {
|
|
166
166
|
key: 0,
|
|
167
167
|
class: "artifactuse-form-buttons"
|
|
168
|
-
},
|
|
168
|
+
}, $a = ["type", "disabled", "onClick"], Ma = {
|
|
169
169
|
key: 0,
|
|
170
170
|
class: "artifactuse-form-btn-spinner"
|
|
171
|
-
},
|
|
171
|
+
}, Ta = ["innerHTML"], La = {
|
|
172
172
|
key: 1,
|
|
173
173
|
class: "artifactuse-form-divider"
|
|
174
|
-
},
|
|
174
|
+
}, Pa = {
|
|
175
175
|
key: 2,
|
|
176
176
|
class: "artifactuse-form-heading"
|
|
177
|
-
},
|
|
177
|
+
}, Aa = {
|
|
178
178
|
key: 3,
|
|
179
179
|
class: "artifactuse-form-field"
|
|
180
|
-
},
|
|
180
|
+
}, Ha = { class: "artifactuse-checkbox-label" }, Ea = ["checked", "disabled", "onChange"], Ba = { class: "artifactuse-checkbox-text" }, Sa = {
|
|
181
181
|
key: 0,
|
|
182
182
|
class: "artifactuse-required"
|
|
183
|
-
},
|
|
183
|
+
}, za = {
|
|
184
184
|
key: 0,
|
|
185
185
|
class: "artifactuse-help-text"
|
|
186
|
-
},
|
|
186
|
+
}, Va = {
|
|
187
187
|
key: 1,
|
|
188
188
|
class: "artifactuse-error-text"
|
|
189
|
-
},
|
|
189
|
+
}, Ia = {
|
|
190
190
|
key: 4,
|
|
191
191
|
class: "artifactuse-form-field"
|
|
192
|
-
},
|
|
192
|
+
}, Fa = ["for"], Ra = {
|
|
193
193
|
key: 0,
|
|
194
194
|
class: "artifactuse-required"
|
|
195
|
-
},
|
|
195
|
+
}, qa = ["id", "type", "value", "placeholder", "disabled", "required", "onInput"], Oa = ["id", "value", "placeholder", "disabled", "required", "rows", "onInput"], Ua = ["id", "value", "disabled", "required", "onChange"], Da = { value: "" }, Na = ["value", "disabled"], ja = {
|
|
196
196
|
key: 3,
|
|
197
197
|
class: "artifactuse-radio-group"
|
|
198
|
-
},
|
|
198
|
+
}, Wa = ["name", "value", "checked", "disabled", "onChange"], Ja = {
|
|
199
199
|
key: 4,
|
|
200
200
|
class: "artifactuse-help-text"
|
|
201
|
-
},
|
|
201
|
+
}, Xa = {
|
|
202
202
|
key: 5,
|
|
203
203
|
class: "artifactuse-error-text"
|
|
204
|
-
},
|
|
204
|
+
}, Za = {
|
|
205
205
|
key: 0,
|
|
206
206
|
class: "artifactuse-form-buttons artifactuse-form-buttons-default"
|
|
207
|
-
},
|
|
207
|
+
}, Ka = ["disabled"], Ya = {
|
|
208
208
|
key: 0,
|
|
209
209
|
class: "artifactuse-form-btn-spinner"
|
|
210
|
-
},
|
|
210
|
+
}, Qa = {
|
|
211
211
|
__name: "ArtifactuseInlineForm",
|
|
212
212
|
props: {
|
|
213
213
|
artifact: { type: Object, required: !0 },
|
|
@@ -220,133 +220,133 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
220
220
|
}
|
|
221
221
|
},
|
|
222
222
|
emits: ["submit", "cancel", "reset", "button-click"],
|
|
223
|
-
setup(H, { emit:
|
|
224
|
-
const _ = H,
|
|
225
|
-
function
|
|
226
|
-
|
|
223
|
+
setup(H, { emit: c }) {
|
|
224
|
+
const _ = H, T = c, f = M(_.initialState), o = C(() => f.value !== "active"), q = C(() => f.value === "active" ? "" : `artifactuse-form--${f.value}`);
|
|
225
|
+
function E(w) {
|
|
226
|
+
f.value = w;
|
|
227
227
|
}
|
|
228
|
-
const
|
|
228
|
+
const g = C(() => {
|
|
229
229
|
try {
|
|
230
230
|
return JSON.parse(_.artifact.code);
|
|
231
231
|
} catch {
|
|
232
232
|
return { title: "Invalid Form", variant: "fields", data: { fields: [] } };
|
|
233
233
|
}
|
|
234
|
-
}), n = M(null),
|
|
234
|
+
}), n = M(null), h = C(() => _.artifact.id || g.value.id || `form-${Date.now()}`), x = C(() => `artifactuse-form-${g.value.variant || "fields"}`), I = C(() => g.value.title || "Form"), $ = M({}), N = M({}), O = M(!1), W = C(() => {
|
|
235
235
|
var w;
|
|
236
|
-
return ((w =
|
|
237
|
-
}), Y =
|
|
236
|
+
return ((w = g.value.data) == null ? void 0 : w.fields) || [];
|
|
237
|
+
}), Y = C(() => {
|
|
238
238
|
var w;
|
|
239
|
-
return
|
|
240
|
-
}),
|
|
239
|
+
return g.value.variant === "buttons" ? ((w = g.value.data) == null ? void 0 : w.fields) || [] : [];
|
|
240
|
+
}), S = C(() => W.value.some((w) => w.type === "buttons"));
|
|
241
241
|
function ie(w) {
|
|
242
242
|
if (!w) return null;
|
|
243
|
-
const
|
|
244
|
-
if (
|
|
245
|
-
let
|
|
246
|
-
if (
|
|
247
|
-
const z = parseInt(
|
|
243
|
+
const L = w.trim();
|
|
244
|
+
if (L.startsWith("#")) {
|
|
245
|
+
let u = L.slice(1);
|
|
246
|
+
if (u.length === 3 && (u = u.split("").map((z) => z + z).join("")), u.length === 6) {
|
|
247
|
+
const z = parseInt(u.slice(0, 2), 16), le = parseInt(u.slice(2, 4), 16), pe = parseInt(u.slice(4, 6), 16);
|
|
248
248
|
if (!isNaN(z) && !isNaN(le) && !isNaN(pe)) return `${z}, ${le}, ${pe}`;
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
|
-
const
|
|
252
|
-
if (
|
|
253
|
-
const B =
|
|
251
|
+
const r = L.match(/^rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);
|
|
252
|
+
if (r) return `${r[1]}, ${r[2]}, ${r[3]}`;
|
|
253
|
+
const B = L.split(/[\s,]+/).map(Number).filter((u) => !isNaN(u));
|
|
254
254
|
return B.length >= 3 ? `${B[0]}, ${B[1]}, ${B[2]}` : null;
|
|
255
255
|
}
|
|
256
|
-
function
|
|
256
|
+
function Z() {
|
|
257
257
|
if (n.value && _.accent) {
|
|
258
258
|
const w = ie(_.accent);
|
|
259
259
|
w && n.value.style.setProperty("--artifactuse-primary", w);
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
}), de(() => _.accent,
|
|
265
|
-
|
|
262
|
+
Me(() => {
|
|
263
|
+
Z(), f.value = _.initialState;
|
|
264
|
+
}), de(() => _.accent, Z), de(() => _.initialState, (w) => {
|
|
265
|
+
f.value = w;
|
|
266
266
|
});
|
|
267
|
-
function
|
|
268
|
-
var
|
|
267
|
+
function X() {
|
|
268
|
+
var r;
|
|
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
|
-
}), (
|
|
272
|
+
}), (r = g.value.data) != null && r.defaults && Object.assign(w, g.value.data.defaults), $.value = w;
|
|
273
273
|
}
|
|
274
|
-
|
|
274
|
+
X(), de(() => _.artifact.code, X);
|
|
275
275
|
function oe(w) {
|
|
276
276
|
return ["text", "email", "password", "tel", "url", "number", "date", "time", "datetime-local"].includes(w);
|
|
277
277
|
}
|
|
278
|
-
function
|
|
279
|
-
return w ? w.map((
|
|
278
|
+
function m(w) {
|
|
279
|
+
return w ? w.map((L) => typeof L == "string" ? { label: L, value: L } : L) : [];
|
|
280
280
|
}
|
|
281
|
-
function k(w,
|
|
282
|
-
$.value[w] =
|
|
281
|
+
function k(w, L) {
|
|
282
|
+
$.value[w] = L, N.value[w] && delete N.value[w];
|
|
283
283
|
}
|
|
284
284
|
function ee() {
|
|
285
285
|
var B;
|
|
286
286
|
const w = {};
|
|
287
|
-
W.value.forEach((
|
|
288
|
-
if (["buttons", "divider", "heading"].includes(
|
|
289
|
-
const z = $.value[
|
|
290
|
-
if (
|
|
291
|
-
w[
|
|
287
|
+
W.value.forEach((u) => {
|
|
288
|
+
if (["buttons", "divider", "heading"].includes(u.type)) return;
|
|
289
|
+
const z = $.value[u.name];
|
|
290
|
+
if (u.required && !z && z !== 0 && z !== !1) {
|
|
291
|
+
w[u.name] = `${u.label || "This field"} is required`;
|
|
292
292
|
return;
|
|
293
293
|
}
|
|
294
|
-
if (
|
|
295
|
-
w[
|
|
294
|
+
if (u.pattern && z && !new RegExp(u.pattern).test(z)) {
|
|
295
|
+
w[u.name] = u.patternMessage || `${u.label || "This field"} is invalid`;
|
|
296
296
|
return;
|
|
297
297
|
}
|
|
298
|
-
if (
|
|
299
|
-
w[
|
|
298
|
+
if (u.type === "email" && z && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(z)) {
|
|
299
|
+
w[u.name] = "Please enter a valid email address";
|
|
300
300
|
return;
|
|
301
301
|
}
|
|
302
|
-
if (
|
|
303
|
-
w[
|
|
302
|
+
if (u.minLength && z && z.length < u.minLength) {
|
|
303
|
+
w[u.name] = `Minimum ${u.minLength} characters required`;
|
|
304
304
|
return;
|
|
305
305
|
}
|
|
306
|
-
if (
|
|
307
|
-
w[
|
|
306
|
+
if (u.maxLength && z && z.length > u.maxLength) {
|
|
307
|
+
w[u.name] = `Maximum ${u.maxLength} characters allowed`;
|
|
308
308
|
return;
|
|
309
309
|
}
|
|
310
310
|
});
|
|
311
|
-
const
|
|
312
|
-
return
|
|
313
|
-
if (w[
|
|
314
|
-
const le = $.value[
|
|
315
|
-
z.pattern && le && (new RegExp(z.pattern).test(le) || (w[
|
|
316
|
-
}),
|
|
311
|
+
const r = (B = g.value.data) == null ? void 0 : B.validation;
|
|
312
|
+
return r && Object.entries(r).forEach(([u, z]) => {
|
|
313
|
+
if (w[u]) return;
|
|
314
|
+
const le = $.value[u];
|
|
315
|
+
z.pattern && le && (new RegExp(z.pattern).test(le) || (w[u] = z.message || `${u} is invalid`));
|
|
316
|
+
}), N.value = w, Object.keys(w).length === 0;
|
|
317
317
|
}
|
|
318
318
|
function re() {
|
|
319
|
-
|
|
319
|
+
X(), N.value = {};
|
|
320
320
|
}
|
|
321
321
|
function P() {
|
|
322
|
-
ee() && (
|
|
323
|
-
formId:
|
|
322
|
+
ee() && (O.value = !0, T("submit", {
|
|
323
|
+
formId: h.value,
|
|
324
324
|
action: "submit",
|
|
325
325
|
values: { ...$.value },
|
|
326
326
|
timestamp: Date.now()
|
|
327
327
|
}), setTimeout(() => {
|
|
328
|
-
|
|
328
|
+
O.value = !1, E("submitted");
|
|
329
329
|
}, 300));
|
|
330
330
|
}
|
|
331
331
|
function Q(w) {
|
|
332
|
-
const
|
|
333
|
-
switch (
|
|
332
|
+
const L = w.action || "custom";
|
|
333
|
+
switch (L) {
|
|
334
334
|
case "submit":
|
|
335
335
|
P();
|
|
336
336
|
break;
|
|
337
337
|
case "cancel":
|
|
338
|
-
|
|
339
|
-
formId:
|
|
338
|
+
T("cancel", {
|
|
339
|
+
formId: h.value,
|
|
340
340
|
action: "cancel",
|
|
341
341
|
buttonName: w.name || "cancel",
|
|
342
342
|
timestamp: Date.now()
|
|
343
343
|
}), setTimeout(() => {
|
|
344
|
-
|
|
344
|
+
E("cancelled");
|
|
345
345
|
}, 150);
|
|
346
346
|
break;
|
|
347
347
|
case "reset":
|
|
348
|
-
re(),
|
|
349
|
-
formId:
|
|
348
|
+
re(), T("reset", {
|
|
349
|
+
formId: h.value,
|
|
350
350
|
action: "reset",
|
|
351
351
|
buttonName: w.name || "reset",
|
|
352
352
|
timestamp: Date.now()
|
|
@@ -354,34 +354,34 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
354
354
|
break;
|
|
355
355
|
case "custom":
|
|
356
356
|
default:
|
|
357
|
-
|
|
358
|
-
formId:
|
|
359
|
-
action:
|
|
357
|
+
T("button-click", {
|
|
358
|
+
formId: h.value,
|
|
359
|
+
action: L,
|
|
360
360
|
buttonName: w.name || w.label,
|
|
361
361
|
buttonLabel: w.label,
|
|
362
362
|
values: { ...$.value },
|
|
363
363
|
timestamp: Date.now()
|
|
364
364
|
}), setTimeout(() => {
|
|
365
|
-
|
|
365
|
+
E("submitted");
|
|
366
366
|
}, 150);
|
|
367
367
|
break;
|
|
368
368
|
}
|
|
369
369
|
}
|
|
370
|
-
return (w,
|
|
370
|
+
return (w, L) => (a(), s("div", {
|
|
371
371
|
ref_key: "containerRef",
|
|
372
372
|
ref: n,
|
|
373
|
-
class:
|
|
373
|
+
class: j([
|
|
374
374
|
"artifactuse-inline-form",
|
|
375
375
|
x.value,
|
|
376
|
-
|
|
376
|
+
q.value
|
|
377
377
|
]),
|
|
378
378
|
"data-artifactuse-theme": H.theme
|
|
379
379
|
}, [
|
|
380
|
-
|
|
381
|
-
e("div",
|
|
382
|
-
|
|
380
|
+
o.value ? (a(), s("div", da, [
|
|
381
|
+
e("div", va, [
|
|
382
|
+
f.value === "submitted" ? (a(), s("svg", fa, [...L[1] || (L[1] = [
|
|
383
383
|
e("polyline", { points: "20 6 9 17 4 12" }, null, -1)
|
|
384
|
-
])])) :
|
|
384
|
+
])])) : f.value === "cancelled" ? (a(), s("svg", pa, [...L[2] || (L[2] = [
|
|
385
385
|
e("line", {
|
|
386
386
|
x1: "18",
|
|
387
387
|
y1: "6",
|
|
@@ -394,7 +394,7 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
394
394
|
x2: "18",
|
|
395
395
|
y2: "18"
|
|
396
396
|
}, null, -1)
|
|
397
|
-
])])) : (a(), s("svg",
|
|
397
|
+
])])) : (a(), s("svg", _a, [...L[3] || (L[3] = [
|
|
398
398
|
e("line", {
|
|
399
399
|
x1: "5",
|
|
400
400
|
y1: "12",
|
|
@@ -403,216 +403,216 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
403
403
|
}, null, -1)
|
|
404
404
|
])]))
|
|
405
405
|
]),
|
|
406
|
-
e("span",
|
|
406
|
+
e("span", ha, l(I.value), 1)
|
|
407
407
|
])) : (a(), s(R, { key: 1 }, [
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
408
|
+
g.value.title || g.value.description ? (a(), s("div", ma, [
|
|
409
|
+
g.value.title ? (a(), s("div", ya, l(g.value.title), 1)) : v("", !0),
|
|
410
|
+
g.value.description ? (a(), s("p", ga, l(g.value.description), 1)) : v("", !0)
|
|
411
411
|
])) : v("", !0),
|
|
412
|
-
|
|
413
|
-
(a(!0), s(R, null, ve(Y.value, (
|
|
414
|
-
key:
|
|
412
|
+
g.value.variant === "buttons" ? (a(), s("div", ka, [
|
|
413
|
+
(a(!0), s(R, null, ve(Y.value, (r) => (a(), s("button", {
|
|
414
|
+
key: r.name || r.label,
|
|
415
415
|
type: "button",
|
|
416
|
-
class:
|
|
417
|
-
disabled:
|
|
418
|
-
onClick: (B) => Q(
|
|
416
|
+
class: j(["artifactuse-form-btn", `artifactuse-form-btn-${r.variant || "secondary"}`]),
|
|
417
|
+
disabled: r.disabled || O.value,
|
|
418
|
+
onClick: (B) => Q(r)
|
|
419
419
|
}, [
|
|
420
|
-
|
|
420
|
+
r.icon ? (a(), s("span", {
|
|
421
421
|
key: 0,
|
|
422
422
|
class: "artifactuse-form-btn-icon",
|
|
423
|
-
innerHTML:
|
|
424
|
-
}, null, 8,
|
|
425
|
-
K(" " + l(
|
|
426
|
-
], 10,
|
|
423
|
+
innerHTML: r.icon
|
|
424
|
+
}, null, 8, ba)) : v("", !0),
|
|
425
|
+
K(" " + l(r.label), 1)
|
|
426
|
+
], 10, wa))), 128))
|
|
427
427
|
])) : (a(), s("form", {
|
|
428
428
|
key: 2,
|
|
429
429
|
class: "artifactuse-form",
|
|
430
|
-
onSubmit:
|
|
430
|
+
onSubmit: he(P, ["prevent"])
|
|
431
431
|
}, [
|
|
432
|
-
e("div",
|
|
433
|
-
(a(!0), s(R, null, ve(W.value, (
|
|
434
|
-
key:
|
|
432
|
+
e("div", Ca, [
|
|
433
|
+
(a(!0), s(R, null, ve(W.value, (r, B) => (a(), s(R, {
|
|
434
|
+
key: r.name || B
|
|
435
435
|
}, [
|
|
436
|
-
|
|
437
|
-
(a(!0), s(R, null, ve(
|
|
438
|
-
key:
|
|
439
|
-
type:
|
|
440
|
-
class:
|
|
441
|
-
disabled:
|
|
442
|
-
onClick: (z) =>
|
|
436
|
+
r.type === "buttons" ? (a(), s("div", xa, [
|
|
437
|
+
(a(!0), s(R, null, ve(r.fields || [], (u) => (a(), s("button", {
|
|
438
|
+
key: u.name || u.label,
|
|
439
|
+
type: u.action === "submit" ? "submit" : "button",
|
|
440
|
+
class: j(["artifactuse-form-btn", `artifactuse-form-btn-${u.variant || "secondary"}`]),
|
|
441
|
+
disabled: u.disabled || u.action === "submit" && O.value,
|
|
442
|
+
onClick: (z) => u.action !== "submit" ? Q(u) : null
|
|
443
443
|
}, [
|
|
444
|
-
|
|
444
|
+
O.value && u.action === "submit" ? (a(), s("span", Ma)) : u.icon ? (a(), s("span", {
|
|
445
445
|
key: 1,
|
|
446
446
|
class: "artifactuse-form-btn-icon",
|
|
447
|
-
innerHTML:
|
|
448
|
-
}, null, 8,
|
|
449
|
-
K(" " + l(
|
|
450
|
-
], 10,
|
|
451
|
-
])) :
|
|
452
|
-
e("label",
|
|
447
|
+
innerHTML: u.icon
|
|
448
|
+
}, null, 8, Ta)) : v("", !0),
|
|
449
|
+
K(" " + l(O.value && u.action === "submit" ? "Submitting..." : u.label), 1)
|
|
450
|
+
], 10, $a))), 128))
|
|
451
|
+
])) : r.type === "divider" ? (a(), s("div", La)) : r.type === "heading" ? (a(), s("div", Pa, l(r.label), 1)) : r.type === "checkbox" ? (a(), s("div", Aa, [
|
|
452
|
+
e("label", Ha, [
|
|
453
453
|
e("input", {
|
|
454
454
|
type: "checkbox",
|
|
455
|
-
checked: $.value[
|
|
456
|
-
disabled:
|
|
455
|
+
checked: $.value[r.name],
|
|
456
|
+
disabled: r.disabled,
|
|
457
457
|
class: "artifactuse-checkbox",
|
|
458
|
-
onChange: (
|
|
459
|
-
}, null, 40,
|
|
460
|
-
e("span",
|
|
461
|
-
K(l(
|
|
462
|
-
|
|
458
|
+
onChange: (u) => k(r.name, u.target.checked)
|
|
459
|
+
}, null, 40, Ea),
|
|
460
|
+
e("span", Ba, [
|
|
461
|
+
K(l(r.label) + " ", 1),
|
|
462
|
+
r.required ? (a(), s("span", Sa, "*")) : v("", !0)
|
|
463
463
|
])
|
|
464
464
|
]),
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
])) : (a(), s("div",
|
|
465
|
+
r.helpText ? (a(), s("span", za, l(r.helpText), 1)) : v("", !0),
|
|
466
|
+
N.value[r.name] ? (a(), s("span", Va, l(N.value[r.name]), 1)) : v("", !0)
|
|
467
|
+
])) : (a(), s("div", Ia, [
|
|
468
468
|
e("label", {
|
|
469
|
-
for: `${
|
|
469
|
+
for: `${h.value}-${r.name}`,
|
|
470
470
|
class: "artifactuse-label"
|
|
471
471
|
}, [
|
|
472
|
-
K(l(
|
|
473
|
-
|
|
474
|
-
], 8,
|
|
475
|
-
oe(
|
|
472
|
+
K(l(r.label) + " ", 1),
|
|
473
|
+
r.required ? (a(), s("span", Ra, "*")) : v("", !0)
|
|
474
|
+
], 8, Fa),
|
|
475
|
+
oe(r.type) ? (a(), s("input", {
|
|
476
476
|
key: 0,
|
|
477
|
-
id: `${
|
|
478
|
-
type:
|
|
479
|
-
value: $.value[
|
|
480
|
-
placeholder:
|
|
481
|
-
disabled:
|
|
482
|
-
required:
|
|
477
|
+
id: `${h.value}-${r.name}`,
|
|
478
|
+
type: r.type,
|
|
479
|
+
value: $.value[r.name],
|
|
480
|
+
placeholder: r.placeholder,
|
|
481
|
+
disabled: r.disabled,
|
|
482
|
+
required: r.required,
|
|
483
483
|
class: "artifactuse-input",
|
|
484
|
-
onInput: (
|
|
485
|
-
}, null, 40,
|
|
484
|
+
onInput: (u) => k(r.name, u.target.value)
|
|
485
|
+
}, null, 40, qa)) : r.type === "textarea" ? (a(), s("textarea", {
|
|
486
486
|
key: 1,
|
|
487
|
-
id: `${
|
|
488
|
-
value: $.value[
|
|
489
|
-
placeholder:
|
|
490
|
-
disabled:
|
|
491
|
-
required:
|
|
492
|
-
rows:
|
|
487
|
+
id: `${h.value}-${r.name}`,
|
|
488
|
+
value: $.value[r.name],
|
|
489
|
+
placeholder: r.placeholder,
|
|
490
|
+
disabled: r.disabled,
|
|
491
|
+
required: r.required,
|
|
492
|
+
rows: r.rows || 3,
|
|
493
493
|
class: "artifactuse-textarea",
|
|
494
|
-
onInput: (
|
|
495
|
-
}, null, 40,
|
|
494
|
+
onInput: (u) => k(r.name, u.target.value)
|
|
495
|
+
}, null, 40, Oa)) : r.type === "select" ? (a(), s("select", {
|
|
496
496
|
key: 2,
|
|
497
|
-
id: `${
|
|
498
|
-
value: $.value[
|
|
499
|
-
disabled:
|
|
500
|
-
required:
|
|
497
|
+
id: `${h.value}-${r.name}`,
|
|
498
|
+
value: $.value[r.name],
|
|
499
|
+
disabled: r.disabled,
|
|
500
|
+
required: r.required,
|
|
501
501
|
class: "artifactuse-select",
|
|
502
|
-
onChange: (
|
|
502
|
+
onChange: (u) => k(r.name, u.target.value)
|
|
503
503
|
}, [
|
|
504
|
-
e("option",
|
|
505
|
-
(a(!0), s(R, null, ve(
|
|
506
|
-
key:
|
|
507
|
-
value:
|
|
508
|
-
disabled:
|
|
509
|
-
}, l(
|
|
510
|
-
], 40,
|
|
511
|
-
(a(!0), s(R, null, ve(
|
|
512
|
-
key:
|
|
504
|
+
e("option", Da, l(r.placeholder || "Select..."), 1),
|
|
505
|
+
(a(!0), s(R, null, ve(m(r.options), (u) => (a(), s("option", {
|
|
506
|
+
key: u.value,
|
|
507
|
+
value: u.value,
|
|
508
|
+
disabled: u.disabled
|
|
509
|
+
}, l(u.label), 9, Na))), 128))
|
|
510
|
+
], 40, Ua)) : r.type === "radio" ? (a(), s("div", ja, [
|
|
511
|
+
(a(!0), s(R, null, ve(m(r.options), (u) => (a(), s("label", {
|
|
512
|
+
key: u.value,
|
|
513
513
|
class: "artifactuse-radio-label"
|
|
514
514
|
}, [
|
|
515
515
|
e("input", {
|
|
516
516
|
type: "radio",
|
|
517
|
-
name:
|
|
518
|
-
value:
|
|
519
|
-
checked: $.value[
|
|
520
|
-
disabled:
|
|
517
|
+
name: r.name,
|
|
518
|
+
value: u.value,
|
|
519
|
+
checked: $.value[r.name] === u.value,
|
|
520
|
+
disabled: u.disabled || r.disabled,
|
|
521
521
|
class: "artifactuse-radio",
|
|
522
|
-
onChange: (z) => k(
|
|
523
|
-
}, null, 40,
|
|
524
|
-
e("span", null, l(
|
|
522
|
+
onChange: (z) => k(r.name, u.value)
|
|
523
|
+
}, null, 40, Wa),
|
|
524
|
+
e("span", null, l(u.label), 1)
|
|
525
525
|
]))), 128))
|
|
526
526
|
])) : v("", !0),
|
|
527
|
-
|
|
528
|
-
|
|
527
|
+
r.helpText ? (a(), s("span", Ja, l(r.helpText), 1)) : v("", !0),
|
|
528
|
+
N.value[r.name] ? (a(), s("span", Xa, l(N.value[r.name]), 1)) : v("", !0)
|
|
529
529
|
]))
|
|
530
530
|
], 64))), 128))
|
|
531
531
|
]),
|
|
532
|
-
|
|
532
|
+
S.value ? v("", !0) : (a(), s("div", Za, [
|
|
533
533
|
e("button", {
|
|
534
534
|
type: "button",
|
|
535
535
|
class: "artifactuse-form-btn artifactuse-form-btn-ghost",
|
|
536
|
-
onClick:
|
|
536
|
+
onClick: L[0] || (L[0] = (r) => Q({ action: "cancel", label: "Cancel" }))
|
|
537
537
|
}, " Cancel "),
|
|
538
538
|
e("button", {
|
|
539
539
|
type: "submit",
|
|
540
540
|
class: "artifactuse-form-btn artifactuse-form-btn-primary",
|
|
541
|
-
disabled:
|
|
541
|
+
disabled: O.value
|
|
542
542
|
}, [
|
|
543
|
-
|
|
544
|
-
K(" " + l(
|
|
545
|
-
], 8,
|
|
543
|
+
O.value ? (a(), s("span", Ya)) : v("", !0),
|
|
544
|
+
K(" " + l(O.value ? "Submitting..." : "Submit"), 1)
|
|
545
|
+
], 8, Ka)
|
|
546
546
|
]))
|
|
547
547
|
], 32))
|
|
548
548
|
], 64))
|
|
549
|
-
], 10,
|
|
549
|
+
], 10, ua));
|
|
550
550
|
}
|
|
551
|
-
},
|
|
551
|
+
}, Ga = ["data-artifactuse-theme"], es = { class: "artifactuse-social-header" }, ts = ["src", "alt"], as = { class: "artifactuse-social-author" }, ss = { class: "artifactuse-social-author-name" }, is = { class: "artifactuse-social-author-meta" }, ls = { class: "artifactuse-social-author-handle" }, ns = { class: "artifactuse-social-timestamp" }, os = { class: "artifactuse-social-content" }, rs = ["innerHTML"], cs = {
|
|
552
552
|
key: 0,
|
|
553
553
|
class: "artifactuse-social-media"
|
|
554
|
-
},
|
|
554
|
+
}, us = ["data-count"], ds = ["src", "alt"], vs = {
|
|
555
555
|
key: 1,
|
|
556
556
|
class: "artifactuse-social-link-card"
|
|
557
|
-
},
|
|
557
|
+
}, fs = ["src", "alt"], ps = { class: "artifactuse-social-link-info" }, _s = { class: "artifactuse-social-link-domain" }, hs = { class: "artifactuse-social-link-title" }, ms = {
|
|
558
558
|
key: 0,
|
|
559
559
|
class: "artifactuse-social-link-description"
|
|
560
|
-
},
|
|
560
|
+
}, ys = {
|
|
561
561
|
key: 2,
|
|
562
562
|
class: "artifactuse-social-poll"
|
|
563
|
-
},
|
|
563
|
+
}, gs = { class: "artifactuse-social-poll-label" }, ks = { class: "artifactuse-social-poll-label-percent" }, ws = { class: "artifactuse-social-poll-meta" }, bs = {
|
|
564
564
|
key: 3,
|
|
565
565
|
class: "artifactuse-social-quote"
|
|
566
|
-
},
|
|
566
|
+
}, Cs = { class: "artifactuse-social-quote-header" }, xs = ["src"], $s = { class: "artifactuse-social-quote-author" }, Ms = { class: "artifactuse-social-quote-handle" }, Ts = { class: "artifactuse-social-quote-text" }, Ls = {
|
|
567
567
|
key: 0,
|
|
568
568
|
class: "artifactuse-social-engagement"
|
|
569
|
-
},
|
|
569
|
+
}, Ps = { class: "artifactuse-social-stat" }, As = { class: "artifactuse-social-stat" }, Hs = { class: "artifactuse-social-stat" }, Es = { class: "artifactuse-social-stat" }, Bs = { class: "artifactuse-social-header" }, Ss = ["src", "alt"], zs = { class: "artifactuse-social-author-info" }, Vs = { class: "artifactuse-social-author-name" }, Is = {
|
|
570
570
|
key: 0,
|
|
571
571
|
class: "artifactuse-social-author-connection"
|
|
572
|
-
},
|
|
572
|
+
}, Fs = { class: "artifactuse-social-author-headline" }, Rs = { class: "artifactuse-social-timestamp" }, qs = { class: "artifactuse-social-content" }, Os = ["innerHTML"], Us = {
|
|
573
573
|
key: 0,
|
|
574
574
|
class: "artifactuse-social-link-card"
|
|
575
|
-
},
|
|
575
|
+
}, Ds = ["src", "alt"], Ns = { class: "artifactuse-social-link-info" }, js = { class: "artifactuse-social-link-title" }, Ws = { class: "artifactuse-social-link-domain" }, Js = {
|
|
576
576
|
key: 0,
|
|
577
577
|
class: "artifactuse-social-engagement"
|
|
578
|
-
},
|
|
578
|
+
}, Xs = { class: "artifactuse-social-reactions" }, Zs = { class: "artifactuse-social-header" }, Ks = ["src", "alt"], Ys = { class: "artifactuse-social-author-name" }, Qs = {
|
|
579
579
|
key: 0,
|
|
580
580
|
class: "artifactuse-social-verified",
|
|
581
581
|
viewBox: "0 0 24 24",
|
|
582
582
|
fill: "currentColor"
|
|
583
|
-
},
|
|
583
|
+
}, Gs = {
|
|
584
584
|
key: 0,
|
|
585
585
|
class: "artifactuse-social-media"
|
|
586
|
-
},
|
|
586
|
+
}, ei = ["src", "alt"], ti = { class: "artifactuse-social-likes" }, ai = { class: "artifactuse-social-caption" }, si = { class: "artifactuse-social-caption-author" }, ii = ["innerHTML"], li = { class: "artifactuse-social-timestamp" }, ni = { class: "artifactuse-social-header" }, oi = ["src", "alt"], ri = { class: "artifactuse-social-author-info" }, ci = { class: "artifactuse-social-author-name" }, ui = { class: "artifactuse-social-timestamp" }, di = { class: "artifactuse-social-content" }, vi = ["innerHTML"], fi = {
|
|
587
587
|
key: 0,
|
|
588
588
|
class: "artifactuse-social-link-card"
|
|
589
|
-
},
|
|
589
|
+
}, pi = ["src", "alt"], _i = { class: "artifactuse-social-link-info" }, hi = { class: "artifactuse-social-link-domain" }, mi = { class: "artifactuse-social-link-title" }, yi = {
|
|
590
590
|
key: 0,
|
|
591
591
|
class: "artifactuse-social-link-description"
|
|
592
|
-
},
|
|
592
|
+
}, gi = {
|
|
593
593
|
key: 0,
|
|
594
594
|
class: "artifactuse-social-engagement"
|
|
595
|
-
},
|
|
595
|
+
}, ki = { class: "artifactuse-social-reactions" }, wi = { class: "artifactuse-social-reaction-count" }, bi = { class: "artifactuse-social-comments-shares" }, Ci = { class: "artifactuse-social-header" }, xi = ["src", "alt"], $i = { class: "artifactuse-social-author-info" }, Mi = { class: "artifactuse-social-author-name" }, Ti = {
|
|
596
596
|
key: 0,
|
|
597
597
|
class: "artifactuse-social-verified",
|
|
598
598
|
viewBox: "0 0 24 24",
|
|
599
599
|
fill: "currentColor"
|
|
600
|
-
},
|
|
600
|
+
}, Li = { class: "artifactuse-social-timestamp" }, Pi = { class: "artifactuse-social-content" }, Ai = ["innerHTML"], Hi = {
|
|
601
601
|
key: 0,
|
|
602
602
|
class: "artifactuse-social-engagement"
|
|
603
|
-
},
|
|
603
|
+
}, Ei = { class: "artifactuse-social-stat" }, Bi = { class: "artifactuse-social-stat" }, Si = { class: "artifactuse-social-stat" }, zi = { class: "artifactuse-social-thumbnail" }, Vi = ["src", "alt"], Ii = {
|
|
604
604
|
key: 1,
|
|
605
605
|
class: "artifactuse-social-duration"
|
|
606
|
-
},
|
|
606
|
+
}, Fi = { class: "artifactuse-social-info" }, Ri = { class: "artifactuse-social-header" }, qi = ["src", "alt"], Oi = { class: "artifactuse-social-author-name" }, Ui = ["innerHTML"], Di = {
|
|
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
|
+
}, ji = { class: "artifactuse-social-thumbnail" }, Wi = ["src", "alt"], Ji = {
|
|
613
613
|
key: 1,
|
|
614
614
|
class: "artifactuse-social-duration"
|
|
615
|
-
},
|
|
615
|
+
}, Xi = { class: "artifactuse-social-info" }, Zi = ["src", "alt"], Ki = { class: "artifactuse-social-title" }, Yi = { class: "artifactuse-social-channel" }, Qi = { class: "artifactuse-social-meta" }, Gi = { class: "artifactuse-social-actions-bar" }, el = { 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>', tl = {
|
|
616
616
|
__name: "ArtifactuseSocialPreview",
|
|
617
617
|
props: {
|
|
618
618
|
artifact: {
|
|
@@ -625,37 +625,37 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
625
625
|
}
|
|
626
626
|
},
|
|
627
627
|
emits: ["copy", "edit"],
|
|
628
|
-
setup(H, { emit:
|
|
629
|
-
const _ = H,
|
|
628
|
+
setup(H, { emit: c }) {
|
|
629
|
+
const _ = H, T = c, f = M(null), o = M("Copy"), q = C(() => {
|
|
630
630
|
try {
|
|
631
631
|
return JSON.parse(_.artifact.code);
|
|
632
632
|
} catch {
|
|
633
633
|
return { platform: "twitter", data: {} };
|
|
634
634
|
}
|
|
635
|
-
}),
|
|
636
|
-
var
|
|
637
|
-
return ((
|
|
635
|
+
}), E = C(() => {
|
|
636
|
+
var m;
|
|
637
|
+
return ((m = q.value) == null ? void 0 : m.platform) || "twitter";
|
|
638
638
|
});
|
|
639
|
-
|
|
640
|
-
var
|
|
641
|
-
return ((
|
|
639
|
+
C(() => {
|
|
640
|
+
var m;
|
|
641
|
+
return ((m = q.value) == null ? void 0 : m.variant) || "post";
|
|
642
642
|
});
|
|
643
|
-
const
|
|
644
|
-
var
|
|
645
|
-
return ((k = (
|
|
646
|
-
}), n =
|
|
647
|
-
var
|
|
648
|
-
return ((k = (
|
|
649
|
-
}),
|
|
650
|
-
var
|
|
651
|
-
return ((k = (
|
|
652
|
-
}), x =
|
|
653
|
-
var
|
|
654
|
-
return ((k = (
|
|
655
|
-
}),
|
|
656
|
-
const
|
|
657
|
-
return
|
|
658
|
-
}), $ =
|
|
643
|
+
const g = C(() => {
|
|
644
|
+
var m, k;
|
|
645
|
+
return ((k = (m = q.value) == null ? void 0 : m.data) == null ? void 0 : k.author) || {};
|
|
646
|
+
}), n = C(() => {
|
|
647
|
+
var m, k;
|
|
648
|
+
return ((k = (m = q.value) == null ? void 0 : m.data) == null ? void 0 : k.content) || {};
|
|
649
|
+
}), h = C(() => {
|
|
650
|
+
var m, k;
|
|
651
|
+
return ((k = (m = q.value) == null ? void 0 : m.data) == null ? void 0 : k.engagement) || {};
|
|
652
|
+
}), x = C(() => {
|
|
653
|
+
var m, k;
|
|
654
|
+
return ((k = (m = q.value) == null ? void 0 : m.data) == null ? void 0 : k.meta) || {};
|
|
655
|
+
}), I = C(() => {
|
|
656
|
+
const m = h.value;
|
|
657
|
+
return m.likes || m.comments || m.shares || m.retweets || m.replies || m.views;
|
|
658
|
+
}), $ = C(() => `artifactuse-social-verified-${g.value.verifiedType || "blue"}`), N = C(() => ({
|
|
659
659
|
twitter: "X",
|
|
660
660
|
linkedin: "LinkedIn",
|
|
661
661
|
instagram: "Instagram",
|
|
@@ -663,8 +663,8 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
663
663
|
threads: "Threads",
|
|
664
664
|
tiktok: "TikTok",
|
|
665
665
|
youtube: "YouTube"
|
|
666
|
-
})[
|
|
667
|
-
const
|
|
666
|
+
})[E.value] || E.value), O = C(() => {
|
|
667
|
+
const m = {
|
|
668
668
|
twitter: () => se("svg", { viewBox: "0 0 24 24", fill: "currentColor" }, [
|
|
669
669
|
se("path", { d: "M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" })
|
|
670
670
|
]),
|
|
@@ -687,103 +687,103 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
687
687
|
se("path", { d: "M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z" })
|
|
688
688
|
])
|
|
689
689
|
};
|
|
690
|
-
return
|
|
691
|
-
}), W =
|
|
692
|
-
let
|
|
693
|
-
return
|
|
690
|
+
return m[E.value] || m.twitter;
|
|
691
|
+
}), W = C(() => {
|
|
692
|
+
let m = n.value.text || "";
|
|
693
|
+
return m = m.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"), m = m.replace(/#(\w+)/g, '<span class="artifactuse-social-hashtag">#$1</span>'), m = m.replace(/@(\w+)/g, '<span class="artifactuse-social-mention">@$1</span>'), m = m.replace(
|
|
694
694
|
/(https?:\/\/[^\s]+)/g,
|
|
695
695
|
'<a href="$1" target="_blank" rel="noopener">$1</a>'
|
|
696
|
-
),
|
|
697
|
-
}), Y =
|
|
698
|
-
const
|
|
699
|
-
return Object.values(
|
|
696
|
+
), m;
|
|
697
|
+
}), Y = C(() => {
|
|
698
|
+
const m = h.value.reactions || {};
|
|
699
|
+
return Object.values(m).reduce((k, ee) => k + (ee || 0), 0) || h.value.likes || 0;
|
|
700
700
|
});
|
|
701
|
-
function
|
|
702
|
-
return
|
|
701
|
+
function S(m) {
|
|
702
|
+
return m ? m >= 1e6 ? `${(m / 1e6).toFixed(1)}M` : m >= 1e3 ? `${(m / 1e3).toFixed(1)}K` : m.toString() : "0";
|
|
703
703
|
}
|
|
704
|
-
function ie(
|
|
704
|
+
function ie(m) {
|
|
705
705
|
try {
|
|
706
|
-
return new URL(
|
|
706
|
+
return new URL(m).hostname.replace("www.", "");
|
|
707
707
|
} catch {
|
|
708
|
-
return
|
|
708
|
+
return m;
|
|
709
709
|
}
|
|
710
710
|
}
|
|
711
|
-
function
|
|
712
|
-
|
|
711
|
+
function Z(m) {
|
|
712
|
+
m.target.src = _e;
|
|
713
713
|
}
|
|
714
|
-
function
|
|
715
|
-
|
|
714
|
+
function X(m) {
|
|
715
|
+
m.target.style.display = "none";
|
|
716
716
|
}
|
|
717
717
|
function oe() {
|
|
718
|
-
const
|
|
719
|
-
navigator.clipboard.writeText(
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
}, 2e3),
|
|
718
|
+
const m = n.value.text || "";
|
|
719
|
+
navigator.clipboard.writeText(m).then(() => {
|
|
720
|
+
o.value = "Copied!", setTimeout(() => {
|
|
721
|
+
o.value = "Copy";
|
|
722
|
+
}, 2e3), T("copy", { platform: E.value, text: m });
|
|
723
723
|
});
|
|
724
724
|
}
|
|
725
|
-
return (
|
|
726
|
-
var ee, re, P, Q, w,
|
|
725
|
+
return (m, k) => {
|
|
726
|
+
var ee, re, P, Q, w, L;
|
|
727
727
|
return a(), s("div", {
|
|
728
728
|
ref_key: "containerRef",
|
|
729
|
-
ref:
|
|
730
|
-
class:
|
|
729
|
+
ref: f,
|
|
730
|
+
class: j(["artifactuse-social", [`artifactuse-social-${E.value}`]]),
|
|
731
731
|
"data-artifactuse-theme": H.theme
|
|
732
732
|
}, [
|
|
733
|
-
|
|
734
|
-
e("div",
|
|
733
|
+
E.value === "twitter" ? (a(), s(R, { key: 0 }, [
|
|
734
|
+
e("div", es, [
|
|
735
735
|
e("img", {
|
|
736
|
-
src:
|
|
737
|
-
alt:
|
|
736
|
+
src: g.value.avatar || _e,
|
|
737
|
+
alt: g.value.name,
|
|
738
738
|
class: "artifactuse-social-avatar",
|
|
739
|
-
onError:
|
|
740
|
-
}, null, 40,
|
|
741
|
-
e("div",
|
|
742
|
-
e("div",
|
|
743
|
-
e("span", null, l(
|
|
744
|
-
|
|
739
|
+
onError: Z
|
|
740
|
+
}, null, 40, ts),
|
|
741
|
+
e("div", as, [
|
|
742
|
+
e("div", ss, [
|
|
743
|
+
e("span", null, l(g.value.name), 1),
|
|
744
|
+
g.value.verified ? (a(), s("svg", {
|
|
745
745
|
key: 0,
|
|
746
|
-
class:
|
|
746
|
+
class: j(["artifactuse-social-verified", $.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", is, [
|
|
754
|
+
e("span", ls, l(g.value.handle), 1),
|
|
755
|
+
e("span", ns, "· " + l(x.value.timestamp || "Just now"), 1)
|
|
756
756
|
])
|
|
757
757
|
])
|
|
758
758
|
]),
|
|
759
|
-
e("div",
|
|
759
|
+
e("div", os, [
|
|
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, rs),
|
|
764
|
+
(ee = n.value.media) != null && ee.length ? (a(), s("div", cs, [
|
|
765
765
|
e("div", {
|
|
766
|
-
class:
|
|
766
|
+
class: j(["artifactuse-social-media-grid", { "artifactuse-social-media-single": n.value.media.length === 1 }]),
|
|
767
767
|
"data-count": n.value.media.length
|
|
768
768
|
}, [
|
|
769
|
-
(a(!0), s(R, null, ve(n.value.media.slice(0, 4), (
|
|
769
|
+
(a(!0), s(R, null, ve(n.value.media.slice(0, 4), (r, B) => (a(), s("img", {
|
|
770
770
|
key: B,
|
|
771
|
-
src:
|
|
772
|
-
alt:
|
|
773
|
-
onError:
|
|
774
|
-
}, null, 40,
|
|
775
|
-
], 10,
|
|
771
|
+
src: r.url,
|
|
772
|
+
alt: r.alt || "",
|
|
773
|
+
onError: X
|
|
774
|
+
}, null, 40, ds))), 128))
|
|
775
|
+
], 10, us)
|
|
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", vs, [
|
|
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
|
-
onError:
|
|
784
|
-
}, null, 40,
|
|
785
|
-
e("div",
|
|
786
|
-
e("div",
|
|
783
|
+
onError: X
|
|
784
|
+
}, null, 40, fs)) : v("", !0),
|
|
785
|
+
e("div", ps, [
|
|
786
|
+
e("div", _s, [
|
|
787
787
|
k[1] || (k[1] = e("svg", {
|
|
788
788
|
fill: "none",
|
|
789
789
|
viewBox: "0 0 24 24",
|
|
@@ -798,43 +798,43 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { 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", hs, l(n.value.link.title), 1),
|
|
802
|
+
n.value.link.description ? (a(), s("div", ms, l(n.value.link.description), 1)) : v("", !0)
|
|
803
803
|
])
|
|
804
804
|
])) : v("", !0),
|
|
805
|
-
n.value.poll ? (a(), s("div",
|
|
806
|
-
(a(!0), s(R, null, ve(n.value.poll.options, (
|
|
807
|
-
var
|
|
805
|
+
n.value.poll ? (a(), s("div", ys, [
|
|
806
|
+
(a(!0), s(R, null, ve(n.value.poll.options, (r, B) => {
|
|
807
|
+
var u, z;
|
|
808
808
|
return a(), s("div", {
|
|
809
809
|
key: B,
|
|
810
810
|
class: "artifactuse-social-poll-option"
|
|
811
811
|
}, [
|
|
812
812
|
e("div", {
|
|
813
813
|
class: "artifactuse-social-poll-bar",
|
|
814
|
-
style:
|
|
814
|
+
style: He({ width: `${((u = n.value.poll.votes) == null ? void 0 : u[B]) || 0}%` })
|
|
815
815
|
}, null, 4),
|
|
816
|
-
e("div",
|
|
817
|
-
e("span", null, l(
|
|
818
|
-
e("span",
|
|
816
|
+
e("div", gs, [
|
|
817
|
+
e("span", null, l(r), 1),
|
|
818
|
+
e("span", ks, 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", ws, 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", bs, [
|
|
825
|
+
e("div", Cs, [
|
|
826
826
|
e("img", {
|
|
827
|
-
src: ((P = n.value.quote.author) == null ? void 0 : P.avatar) ||
|
|
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, xs),
|
|
830
|
+
e("span", $s, l((Q = n.value.quote.author) == null ? void 0 : Q.name), 1),
|
|
831
|
+
e("span", Ms, l((w = n.value.quote.author) == null ? void 0 : w.handle), 1)
|
|
832
832
|
]),
|
|
833
|
-
e("p",
|
|
833
|
+
e("p", Ts, l(n.value.quote.text), 1)
|
|
834
834
|
])) : v("", !0)
|
|
835
835
|
]),
|
|
836
|
-
|
|
837
|
-
e("div",
|
|
836
|
+
I.value ? (a(), s("div", Ls, [
|
|
837
|
+
e("div", Ps, [
|
|
838
838
|
k[2] || (k[2] = e("svg", {
|
|
839
839
|
viewBox: "0 0 24 24",
|
|
840
840
|
fill: "none",
|
|
@@ -843,9 +843,9 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
843
843
|
}, [
|
|
844
844
|
e("path", { d: "M12 21C6.5 21 2 16.5 2 11V3l7 3 3-3 3 3 7-3v8c0 5.5-4.5 10-10 10z" })
|
|
845
845
|
], -1)),
|
|
846
|
-
e("span", null, l(
|
|
846
|
+
e("span", null, l(S(h.value.replies || 0)), 1)
|
|
847
847
|
]),
|
|
848
|
-
e("div",
|
|
848
|
+
e("div", As, [
|
|
849
849
|
k[3] || (k[3] = e("svg", {
|
|
850
850
|
viewBox: "0 0 24 24",
|
|
851
851
|
fill: "none",
|
|
@@ -854,9 +854,9 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
854
854
|
}, [
|
|
855
855
|
e("path", { d: "M7 17L17 7M17 7H8M17 7V16" })
|
|
856
856
|
], -1)),
|
|
857
|
-
e("span", null, l(
|
|
857
|
+
e("span", null, l(S(h.value.retweets || 0)), 1)
|
|
858
858
|
]),
|
|
859
|
-
e("div",
|
|
859
|
+
e("div", Hs, [
|
|
860
860
|
k[4] || (k[4] = e("svg", {
|
|
861
861
|
viewBox: "0 0 24 24",
|
|
862
862
|
fill: "none",
|
|
@@ -865,9 +865,9 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
865
865
|
}, [
|
|
866
866
|
e("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" })
|
|
867
867
|
], -1)),
|
|
868
|
-
e("span", null, l(
|
|
868
|
+
e("span", null, l(S(h.value.likes || 0)), 1)
|
|
869
869
|
]),
|
|
870
|
-
e("div",
|
|
870
|
+
e("div", Es, [
|
|
871
871
|
k[5] || (k[5] = e("svg", {
|
|
872
872
|
viewBox: "0 0 24 24",
|
|
873
873
|
fill: "none",
|
|
@@ -876,24 +876,24 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
876
876
|
}, [
|
|
877
877
|
e("path", { d: "M15 3h4a2 2 0 012 2v14a2 2 0 01-2 2h-4M10 17l5-5-5-5M13.8 12H3" })
|
|
878
878
|
], -1)),
|
|
879
|
-
e("span", null, l(
|
|
879
|
+
e("span", null, l(S(h.value.views || 0)), 1)
|
|
880
880
|
])
|
|
881
881
|
])) : v("", !0)
|
|
882
|
-
], 64)) :
|
|
883
|
-
e("div",
|
|
882
|
+
], 64)) : E.value === "linkedin" ? (a(), s(R, { key: 1 }, [
|
|
883
|
+
e("div", Bs, [
|
|
884
884
|
e("img", {
|
|
885
|
-
src:
|
|
886
|
-
alt:
|
|
885
|
+
src: g.value.avatar || _e,
|
|
886
|
+
alt: g.value.name,
|
|
887
887
|
class: "artifactuse-social-avatar",
|
|
888
|
-
onError:
|
|
889
|
-
}, null, 40,
|
|
890
|
-
e("div",
|
|
891
|
-
e("div",
|
|
892
|
-
K(l(
|
|
893
|
-
|
|
888
|
+
onError: Z
|
|
889
|
+
}, null, 40, Ss),
|
|
890
|
+
e("div", zs, [
|
|
891
|
+
e("div", Vs, [
|
|
892
|
+
K(l(g.value.name) + " ", 1),
|
|
893
|
+
g.value.connection ? (a(), s("span", Is, "· " + l(g.value.connection), 1)) : v("", !0)
|
|
894
894
|
]),
|
|
895
|
-
e("div",
|
|
896
|
-
e("div",
|
|
895
|
+
e("div", Fs, l(g.value.headline), 1),
|
|
896
|
+
e("div", Rs, [
|
|
897
897
|
K(l(x.value.timestamp || "Just now") + " · ", 1),
|
|
898
898
|
k[6] || (k[6] = e("svg", {
|
|
899
899
|
viewBox: "0 0 24 24",
|
|
@@ -904,79 +904,79 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
904
904
|
])
|
|
905
905
|
])
|
|
906
906
|
]),
|
|
907
|
-
e("div",
|
|
907
|
+
e("div", qs, [
|
|
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, Os),
|
|
912
|
+
n.value.link ? (a(), s("div", Us, [
|
|
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
|
-
onError:
|
|
919
|
-
}, null, 40,
|
|
920
|
-
e("div",
|
|
921
|
-
e("div",
|
|
922
|
-
e("div",
|
|
918
|
+
onError: X
|
|
919
|
+
}, null, 40, Ds)) : v("", !0),
|
|
920
|
+
e("div", Ns, [
|
|
921
|
+
e("div", js, l(n.value.link.title), 1),
|
|
922
|
+
e("div", Ws, l(n.value.link.domain || ie(n.value.link.url)), 1)
|
|
923
923
|
])
|
|
924
924
|
])) : v("", !0)
|
|
925
925
|
]),
|
|
926
|
-
|
|
927
|
-
e("div",
|
|
926
|
+
I.value ? (a(), s("div", Js, [
|
|
927
|
+
e("div", Xs, [
|
|
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" }, "❤️"),
|
|
931
931
|
e("span", { class: "artifactuse-social-reaction-icon" }, "👏")
|
|
932
932
|
], -1)),
|
|
933
|
-
e("span", null, l(
|
|
933
|
+
e("span", null, l(S(h.value.likes || 0)), 1)
|
|
934
934
|
]),
|
|
935
|
-
e("span", null, l(
|
|
935
|
+
e("span", null, l(S(h.value.comments || 0)) + " comments · " + l(S(h.value.shares || 0)) + " shares", 1)
|
|
936
936
|
])) : v("", !0)
|
|
937
|
-
], 64)) :
|
|
938
|
-
e("div",
|
|
937
|
+
], 64)) : E.value === "instagram" ? (a(), s(R, { key: 2 }, [
|
|
938
|
+
e("div", Zs, [
|
|
939
939
|
e("img", {
|
|
940
|
-
src:
|
|
941
|
-
alt:
|
|
940
|
+
src: g.value.avatar || _e,
|
|
941
|
+
alt: g.value.name,
|
|
942
942
|
class: "artifactuse-social-avatar",
|
|
943
|
-
onError:
|
|
944
|
-
}, null, 40,
|
|
945
|
-
e("div",
|
|
946
|
-
K(l(
|
|
947
|
-
|
|
943
|
+
onError: Z
|
|
944
|
+
}, null, 40, Ks),
|
|
945
|
+
e("div", Ys, [
|
|
946
|
+
K(l(g.value.name) + " ", 1),
|
|
947
|
+
g.value.verified ? (a(), s("svg", Qs, [...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
|
-
(
|
|
952
|
+
(L = n.value.media) != null && L.length ? (a(), s("div", Gs, [
|
|
953
953
|
e("img", {
|
|
954
954
|
src: n.value.media[0].url,
|
|
955
955
|
alt: n.value.media[0].alt || "",
|
|
956
|
-
onError:
|
|
957
|
-
}, null, 40,
|
|
956
|
+
onError: X
|
|
957
|
+
}, null, 40, ei)
|
|
958
958
|
])) : v("", !0),
|
|
959
|
-
k[9] || (k[9] =
|
|
960
|
-
e("div",
|
|
961
|
-
e("div",
|
|
962
|
-
e("span",
|
|
959
|
+
k[9] || (k[9] = Ot('<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", ti, l(S(h.value.likes || 0)) + " likes", 1),
|
|
961
|
+
e("div", ai, [
|
|
962
|
+
e("span", si, 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, ii)
|
|
967
967
|
]),
|
|
968
|
-
e("div",
|
|
969
|
-
], 64)) :
|
|
970
|
-
e("div",
|
|
968
|
+
e("div", li, l(x.value.timestamp || "Just now"), 1)
|
|
969
|
+
], 64)) : E.value === "facebook" ? (a(), s(R, { key: 3 }, [
|
|
970
|
+
e("div", ni, [
|
|
971
971
|
e("img", {
|
|
972
|
-
src:
|
|
973
|
-
alt:
|
|
972
|
+
src: g.value.avatar || _e,
|
|
973
|
+
alt: g.value.name,
|
|
974
974
|
class: "artifactuse-social-avatar",
|
|
975
|
-
onError:
|
|
976
|
-
}, null, 40,
|
|
977
|
-
e("div",
|
|
978
|
-
e("div",
|
|
979
|
-
e("div",
|
|
975
|
+
onError: Z
|
|
976
|
+
}, null, 40, oi),
|
|
977
|
+
e("div", ri, [
|
|
978
|
+
e("div", ci, l(g.value.name), 1),
|
|
979
|
+
e("div", ui, [
|
|
980
980
|
K(l(x.value.timestamp || "Just now") + " · ", 1),
|
|
981
981
|
k[10] || (k[10] = e("svg", {
|
|
982
982
|
viewBox: "0 0 24 24",
|
|
@@ -987,63 +987,63 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
987
987
|
])
|
|
988
988
|
])
|
|
989
989
|
]),
|
|
990
|
-
e("div",
|
|
990
|
+
e("div", di, [
|
|
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, vi),
|
|
995
|
+
n.value.link ? (a(), s("div", fi, [
|
|
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
|
-
onError:
|
|
1002
|
-
}, null, 40,
|
|
1003
|
-
e("div",
|
|
1004
|
-
e("div",
|
|
1005
|
-
e("div",
|
|
1006
|
-
n.value.link.description ? (a(), s("div",
|
|
1001
|
+
onError: X
|
|
1002
|
+
}, null, 40, pi)) : v("", !0),
|
|
1003
|
+
e("div", _i, [
|
|
1004
|
+
e("div", hi, l(n.value.link.domain || ie(n.value.link.url)), 1),
|
|
1005
|
+
e("div", mi, l(n.value.link.title), 1),
|
|
1006
|
+
n.value.link.description ? (a(), s("div", yi, l(n.value.link.description), 1)) : v("", !0)
|
|
1007
1007
|
])
|
|
1008
1008
|
])) : v("", !0)
|
|
1009
1009
|
]),
|
|
1010
|
-
|
|
1011
|
-
e("div",
|
|
1010
|
+
I.value ? (a(), s("div", gi, [
|
|
1011
|
+
e("div", ki, [
|
|
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", wi, l(S(Y.value)), 1)
|
|
1018
1018
|
]),
|
|
1019
|
-
e("span",
|
|
1019
|
+
e("span", bi, l(S(h.value.comments || 0)) + " comments · " + l(S(h.value.shares || 0)) + " shares", 1)
|
|
1020
1020
|
])) : v("", !0)
|
|
1021
|
-
], 64)) :
|
|
1022
|
-
e("div",
|
|
1021
|
+
], 64)) : E.value === "threads" ? (a(), s(R, { key: 4 }, [
|
|
1022
|
+
e("div", Ci, [
|
|
1023
1023
|
e("img", {
|
|
1024
|
-
src:
|
|
1025
|
-
alt:
|
|
1024
|
+
src: g.value.avatar || _e,
|
|
1025
|
+
alt: g.value.name,
|
|
1026
1026
|
class: "artifactuse-social-avatar",
|
|
1027
|
-
onError:
|
|
1028
|
-
}, null, 40,
|
|
1029
|
-
e("div",
|
|
1030
|
-
e("div",
|
|
1031
|
-
K(l(
|
|
1032
|
-
|
|
1027
|
+
onError: Z
|
|
1028
|
+
}, null, 40, xi),
|
|
1029
|
+
e("div", $i, [
|
|
1030
|
+
e("div", Mi, [
|
|
1031
|
+
K(l(g.value.name) + " ", 1),
|
|
1032
|
+
g.value.verified ? (a(), s("svg", Ti, [...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", Li, l(x.value.timestamp || "Just now"), 1)
|
|
1037
1037
|
])
|
|
1038
1038
|
]),
|
|
1039
|
-
e("div",
|
|
1039
|
+
e("div", Pi, [
|
|
1040
1040
|
e("p", {
|
|
1041
1041
|
class: "artifactuse-social-text",
|
|
1042
1042
|
innerHTML: W.value
|
|
1043
|
-
}, null, 8,
|
|
1043
|
+
}, null, 8, Ai)
|
|
1044
1044
|
]),
|
|
1045
|
-
|
|
1046
|
-
e("div",
|
|
1045
|
+
I.value ? (a(), s("div", Hi, [
|
|
1046
|
+
e("div", Ei, [
|
|
1047
1047
|
k[13] || (k[13] = e("svg", {
|
|
1048
1048
|
viewBox: "0 0 24 24",
|
|
1049
1049
|
fill: "none",
|
|
@@ -1052,9 +1052,9 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
1052
1052
|
}, [
|
|
1053
1053
|
e("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" })
|
|
1054
1054
|
], -1)),
|
|
1055
|
-
e("span", null, l(
|
|
1055
|
+
e("span", null, l(S(h.value.likes || 0)), 1)
|
|
1056
1056
|
]),
|
|
1057
|
-
e("div",
|
|
1057
|
+
e("div", Bi, [
|
|
1058
1058
|
k[14] || (k[14] = e("svg", {
|
|
1059
1059
|
viewBox: "0 0 24 24",
|
|
1060
1060
|
fill: "none",
|
|
@@ -1063,9 +1063,9 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
1063
1063
|
}, [
|
|
1064
1064
|
e("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" })
|
|
1065
1065
|
], -1)),
|
|
1066
|
-
e("span", null, l(
|
|
1066
|
+
e("span", null, l(S(h.value.comments || 0)), 1)
|
|
1067
1067
|
]),
|
|
1068
|
-
e("div",
|
|
1068
|
+
e("div", Si, [
|
|
1069
1069
|
k[15] || (k[15] = e("svg", {
|
|
1070
1070
|
viewBox: "0 0 24 24",
|
|
1071
1071
|
fill: "none",
|
|
@@ -1074,17 +1074,17 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
1074
1074
|
}, [
|
|
1075
1075
|
e("path", { d: "M7 17L17 7M17 7H8M17 7V16" })
|
|
1076
1076
|
], -1)),
|
|
1077
|
-
e("span", null, l(
|
|
1077
|
+
e("span", null, l(S(h.value.shares || 0)), 1)
|
|
1078
1078
|
])
|
|
1079
1079
|
])) : v("", !0)
|
|
1080
|
-
], 64)) :
|
|
1081
|
-
e("div",
|
|
1080
|
+
], 64)) : E.value === "tiktok" ? (a(), s(R, { key: 5 }, [
|
|
1081
|
+
e("div", zi, [
|
|
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
|
-
onError:
|
|
1087
|
-
}, null, 40,
|
|
1086
|
+
onError: X
|
|
1087
|
+
}, null, 40, Vi)) : 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 Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
1095
1095
|
])
|
|
1096
1096
|
])
|
|
1097
1097
|
], -1)),
|
|
1098
|
-
n.value.duration ? (a(), s("div",
|
|
1098
|
+
n.value.duration ? (a(), s("div", Ii, l(n.value.duration), 1)) : v("", !0)
|
|
1099
1099
|
]),
|
|
1100
|
-
e("div",
|
|
1101
|
-
e("div",
|
|
1100
|
+
e("div", Fi, [
|
|
1101
|
+
e("div", Ri, [
|
|
1102
1102
|
e("img", {
|
|
1103
|
-
src:
|
|
1104
|
-
alt:
|
|
1103
|
+
src: g.value.avatar || _e,
|
|
1104
|
+
alt: g.value.name,
|
|
1105
1105
|
class: "artifactuse-social-avatar",
|
|
1106
|
-
onError:
|
|
1107
|
-
}, null, 40,
|
|
1108
|
-
e("span",
|
|
1106
|
+
onError: Z
|
|
1107
|
+
}, null, 40, qi),
|
|
1108
|
+
e("span", Oi, 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, Ui),
|
|
1114
|
+
n.value.sound ? (a(), s("div", Di, [
|
|
1115
1115
|
k[17] || (k[17] = e("svg", {
|
|
1116
1116
|
viewBox: "0 0 24 24",
|
|
1117
1117
|
fill: "currentColor"
|
|
@@ -1120,40 +1120,40 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
1120
1120
|
], -1)),
|
|
1121
1121
|
K(" " + l(n.value.sound), 1)
|
|
1122
1122
|
])) : v("", !0),
|
|
1123
|
-
|
|
1124
|
-
e("span", null, l(
|
|
1125
|
-
e("span", null, l(
|
|
1126
|
-
e("span", null, l(
|
|
1123
|
+
I.value ? (a(), s("div", Ni, [
|
|
1124
|
+
e("span", null, l(S(h.value.likes || 0)) + " likes", 1),
|
|
1125
|
+
e("span", null, l(S(h.value.comments || 0)) + " comments", 1),
|
|
1126
|
+
e("span", null, l(S(h.value.shares || 0)) + " shares", 1)
|
|
1127
1127
|
])) : v("", !0)
|
|
1128
1128
|
])
|
|
1129
|
-
], 64)) :
|
|
1130
|
-
e("div",
|
|
1129
|
+
], 64)) : E.value === "youtube" ? (a(), s(R, { key: 6 }, [
|
|
1130
|
+
e("div", ji, [
|
|
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
|
-
onError:
|
|
1136
|
-
}, null, 40,
|
|
1137
|
-
n.value.duration ? (a(), s("div",
|
|
1135
|
+
onError: X
|
|
1136
|
+
}, null, 40, Wi)) : v("", !0),
|
|
1137
|
+
n.value.duration ? (a(), s("div", Ji, l(n.value.duration), 1)) : v("", !0)
|
|
1138
1138
|
]),
|
|
1139
|
-
e("div",
|
|
1139
|
+
e("div", Xi, [
|
|
1140
1140
|
e("img", {
|
|
1141
|
-
src:
|
|
1142
|
-
alt:
|
|
1141
|
+
src: g.value.avatar || _e,
|
|
1142
|
+
alt: g.value.name,
|
|
1143
1143
|
class: "artifactuse-social-avatar",
|
|
1144
|
-
onError:
|
|
1145
|
-
}, null, 40,
|
|
1144
|
+
onError: Z
|
|
1145
|
+
}, null, 40, Zi),
|
|
1146
1146
|
e("div", null, [
|
|
1147
|
-
e("div",
|
|
1148
|
-
e("div",
|
|
1149
|
-
e("div",
|
|
1147
|
+
e("div", Ki, l(n.value.title || n.value.text), 1),
|
|
1148
|
+
e("div", Yi, l(g.value.name), 1),
|
|
1149
|
+
e("div", Qi, l(S(h.value.views || 0)) + " views · " + l(x.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", Gi, [
|
|
1154
|
+
e("div", el, [
|
|
1155
|
+
(a(), $e(Ut(O.value))),
|
|
1156
|
+
e("span", null, l(N.value), 1)
|
|
1157
1157
|
]),
|
|
1158
1158
|
e("button", {
|
|
1159
1159
|
class: "artifactuse-social-copy-btn",
|
|
@@ -1175,31 +1175,31 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
1175
1175
|
}),
|
|
1176
1176
|
e("path", { d: "M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1" })
|
|
1177
1177
|
], -1)),
|
|
1178
|
-
K(" " + l(
|
|
1178
|
+
K(" " + l(o.value), 1)
|
|
1179
1179
|
])
|
|
1180
1180
|
])
|
|
1181
|
-
], 10,
|
|
1181
|
+
], 10, Ga);
|
|
1182
1182
|
};
|
|
1183
1183
|
}
|
|
1184
|
-
},
|
|
1184
|
+
}, al = ["src", "alt"], sl = ["src"], il = {
|
|
1185
1185
|
key: 2,
|
|
1186
1186
|
class: "artifactuse-viewer-controls"
|
|
1187
|
-
},
|
|
1187
|
+
}, ll = ["title"], nl = {
|
|
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
|
+
}, ol = {
|
|
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
|
+
}, rl = {
|
|
1200
1200
|
key: 3,
|
|
1201
1201
|
class: "artifactuse-viewer-caption"
|
|
1202
|
-
},
|
|
1202
|
+
}, cl = {
|
|
1203
1203
|
__name: "ArtifactuseViewer",
|
|
1204
1204
|
props: {
|
|
1205
1205
|
// Whether the viewer is open
|
|
@@ -1229,61 +1229,61 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
1229
1229
|
}
|
|
1230
1230
|
},
|
|
1231
1231
|
emits: ["close"],
|
|
1232
|
-
setup(H, { emit:
|
|
1233
|
-
const _ = H,
|
|
1234
|
-
function
|
|
1235
|
-
|
|
1232
|
+
setup(H, { emit: c }) {
|
|
1233
|
+
const _ = H, T = c, f = M(null), o = M(!1);
|
|
1234
|
+
function q() {
|
|
1235
|
+
o.value = !1, T("close");
|
|
1236
1236
|
}
|
|
1237
|
-
function
|
|
1238
|
-
_.type === "image" && (
|
|
1237
|
+
function E() {
|
|
1238
|
+
_.type === "image" && (o.value = !o.value);
|
|
1239
1239
|
}
|
|
1240
|
-
function
|
|
1241
|
-
const
|
|
1242
|
-
|
|
1240
|
+
function g() {
|
|
1241
|
+
const h = document.createElement("a");
|
|
1242
|
+
h.href = _.src, h.download = _.alt || "download", document.body.appendChild(h), h.click(), document.body.removeChild(h);
|
|
1243
1243
|
}
|
|
1244
|
-
function n(
|
|
1245
|
-
|
|
1244
|
+
function n(h) {
|
|
1245
|
+
h.key === "Escape" && _.isOpen && q();
|
|
1246
1246
|
}
|
|
1247
|
-
return de(() => _.isOpen, (
|
|
1248
|
-
|
|
1247
|
+
return de(() => _.isOpen, (h) => {
|
|
1248
|
+
h ? (xe(() => {
|
|
1249
1249
|
var x;
|
|
1250
|
-
(x =
|
|
1251
|
-
}), document.body.style.overflow = "hidden") : (document.body.style.overflow = "",
|
|
1252
|
-
}),
|
|
1250
|
+
(x = f.value) == null || x.focus();
|
|
1251
|
+
}), document.body.style.overflow = "hidden") : (document.body.style.overflow = "", o.value = !1);
|
|
1252
|
+
}), Me(() => {
|
|
1253
1253
|
document.addEventListener("keydown", n);
|
|
1254
|
-
}),
|
|
1254
|
+
}), We(() => {
|
|
1255
1255
|
document.removeEventListener("keydown", n), document.body.style.overflow = "";
|
|
1256
|
-
}), (
|
|
1257
|
-
|
|
1258
|
-
default:
|
|
1256
|
+
}), (h, x) => (a(), $e(Dt, { to: "body" }, [
|
|
1257
|
+
ze(Ee, { name: "artifactuse-viewer" }, {
|
|
1258
|
+
default: Be(() => [
|
|
1259
1259
|
H.isOpen ? (a(), s("div", {
|
|
1260
1260
|
key: 0,
|
|
1261
1261
|
class: "artifactuse-viewer-overlay",
|
|
1262
|
-
onClick:
|
|
1263
|
-
onKeydown:
|
|
1262
|
+
onClick: q,
|
|
1263
|
+
onKeydown: Nt(q, ["escape"]),
|
|
1264
1264
|
tabindex: "-1",
|
|
1265
1265
|
ref_key: "overlayRef",
|
|
1266
|
-
ref:
|
|
1266
|
+
ref: f
|
|
1267
1267
|
}, [
|
|
1268
1268
|
e("div", {
|
|
1269
1269
|
class: "artifactuse-viewer-content",
|
|
1270
|
-
onClick: x[0] || (x[0] =
|
|
1270
|
+
onClick: x[0] || (x[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:
|
|
1278
|
-
onClick:
|
|
1279
|
-
}, null, 10,
|
|
1277
|
+
class: j(["artifactuse-viewer-image", { "artifactuse-viewer-image--zoomed": o.value }]),
|
|
1278
|
+
onClick: E
|
|
1279
|
+
}, null, 10, al)) : 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, sl)) : v("", !0),
|
|
1284
1284
|
e("button", {
|
|
1285
1285
|
class: "artifactuse-viewer-close",
|
|
1286
|
-
onClick:
|
|
1286
|
+
onClick: q,
|
|
1287
1287
|
title: "Close (Esc)"
|
|
1288
1288
|
}, [...x[1] || (x[1] = [
|
|
1289
1289
|
e("svg", {
|
|
@@ -1306,13 +1306,13 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
1306
1306
|
})
|
|
1307
1307
|
], -1)
|
|
1308
1308
|
])]),
|
|
1309
|
-
H.type === "image" ? (a(), s("div",
|
|
1309
|
+
H.type === "image" ? (a(), s("div", il, [
|
|
1310
1310
|
e("button", {
|
|
1311
1311
|
class: "artifactuse-viewer-control",
|
|
1312
|
-
onClick:
|
|
1313
|
-
title:
|
|
1312
|
+
onClick: he(E, ["stop"]),
|
|
1313
|
+
title: o.value ? "Zoom out" : "Zoom in"
|
|
1314
1314
|
}, [
|
|
1315
|
-
|
|
1315
|
+
o.value ? (a(), s("svg", ol, [...x[3] || (x[3] = [
|
|
1316
1316
|
e("circle", {
|
|
1317
1317
|
cx: "11",
|
|
1318
1318
|
cy: "11",
|
|
@@ -1330,7 +1330,7 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
1330
1330
|
x2: "14",
|
|
1331
1331
|
y2: "11"
|
|
1332
1332
|
}, null, -1)
|
|
1333
|
-
])])) : (a(), s("svg",
|
|
1333
|
+
])])) : (a(), s("svg", nl, [...x[2] || (x[2] = [
|
|
1334
1334
|
e("circle", {
|
|
1335
1335
|
cx: "11",
|
|
1336
1336
|
cy: "11",
|
|
@@ -1355,10 +1355,10 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
1355
1355
|
y2: "11"
|
|
1356
1356
|
}, null, -1)
|
|
1357
1357
|
])]))
|
|
1358
|
-
], 8,
|
|
1358
|
+
], 8, ll),
|
|
1359
1359
|
e("button", {
|
|
1360
1360
|
class: "artifactuse-viewer-control",
|
|
1361
|
-
onClick:
|
|
1361
|
+
onClick: he(g, ["stop"]),
|
|
1362
1362
|
title: "Download"
|
|
1363
1363
|
}, [...x[4] || (x[4] = [
|
|
1364
1364
|
e("svg", {
|
|
@@ -1378,7 +1378,7 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
1378
1378
|
], -1)
|
|
1379
1379
|
])])
|
|
1380
1380
|
])) : v("", !0),
|
|
1381
|
-
H.caption ? (a(), s("div",
|
|
1381
|
+
H.caption ? (a(), s("div", rl, l(H.caption), 1)) : v("", !0)
|
|
1382
1382
|
])
|
|
1383
1383
|
], 544)) : v("", !0)
|
|
1384
1384
|
]),
|
|
@@ -1386,7 +1386,7 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
1386
1386
|
})
|
|
1387
1387
|
]));
|
|
1388
1388
|
}
|
|
1389
|
-
},
|
|
1389
|
+
}, ul = ["innerHTML"], co = {
|
|
1390
1390
|
__name: "ArtifactuseAgentMessage",
|
|
1391
1391
|
props: {
|
|
1392
1392
|
// The raw message content (markdown/HTML from AI)
|
|
@@ -1447,33 +1447,33 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
1447
1447
|
"social-copy",
|
|
1448
1448
|
"media-open"
|
|
1449
1449
|
],
|
|
1450
|
-
setup(H, { expose:
|
|
1451
|
-
const
|
|
1452
|
-
processMessage:
|
|
1453
|
-
openArtifact:
|
|
1454
|
-
state:
|
|
1455
|
-
getTheme:
|
|
1450
|
+
setup(H, { expose: c, emit: _ }) {
|
|
1451
|
+
const T = H, f = _, {
|
|
1452
|
+
processMessage: o,
|
|
1453
|
+
openArtifact: q,
|
|
1454
|
+
state: E,
|
|
1455
|
+
getTheme: g,
|
|
1456
1456
|
instance: n
|
|
1457
|
-
} =
|
|
1458
|
-
let
|
|
1459
|
-
const
|
|
1460
|
-
var
|
|
1461
|
-
return
|
|
1462
|
-
}),
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
}), de(() =>
|
|
1466
|
-
|
|
1457
|
+
} = Ve(), h = M(null), x = M(null), I = M(""), $ = M([]);
|
|
1458
|
+
let N = null;
|
|
1459
|
+
const O = M(!1), W = M("image"), Y = M(""), S = M(""), ie = M(""), Z = C(() => (g == null ? void 0 : g()) || "dark"), X = C(() => E.activeArtifactId), oe = C(() => {
|
|
1460
|
+
var b;
|
|
1461
|
+
return T.inlineCards ?? ((b = n == null ? void 0 : n.config) == null ? void 0 : b.inlineCards) ?? !0;
|
|
1462
|
+
}), m = M(!1);
|
|
1463
|
+
Me(() => {
|
|
1464
|
+
T.typing && (m.value = !0);
|
|
1465
|
+
}), de(() => T.typing, (b) => {
|
|
1466
|
+
b && (m.value = !0);
|
|
1467
1467
|
});
|
|
1468
|
-
const k =
|
|
1469
|
-
function ee(
|
|
1470
|
-
if (!
|
|
1468
|
+
const k = C(() => m.value || T.isLastMessage ? "active" : "inactive");
|
|
1469
|
+
function ee(b) {
|
|
1470
|
+
if (!b) return null;
|
|
1471
1471
|
try {
|
|
1472
|
-
const
|
|
1473
|
-
return JSON.parse(
|
|
1472
|
+
const V = decodeURIComponent(escape(atob(b)));
|
|
1473
|
+
return JSON.parse(V);
|
|
1474
1474
|
} catch {
|
|
1475
1475
|
try {
|
|
1476
|
-
const D =
|
|
1476
|
+
const D = b.replace(/ /g, `
|
|
1477
1477
|
`).replace(/ /g, "\r").replace(/	/g, " ").replace(/"/g, '"').replace(/'/g, "'").replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&");
|
|
1478
1478
|
return JSON.parse(D);
|
|
1479
1479
|
} catch (D) {
|
|
@@ -1481,94 +1481,94 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
1481
1481
|
}
|
|
1482
1482
|
}
|
|
1483
1483
|
}
|
|
1484
|
-
const re =
|
|
1485
|
-
const
|
|
1486
|
-
if (!
|
|
1484
|
+
const re = C(() => {
|
|
1485
|
+
const b = [], V = I.value;
|
|
1486
|
+
if (!V) return b;
|
|
1487
1487
|
const D = /<div\s+class="artifactuse-placeholder[^"]*"[^>]*data-artifact-id="([^"]+)"[^>]*data-artifact-type="([^"]+)"[^>]*data-artifact=["']([^"']*)["'][^>]*><\/div>/gi;
|
|
1488
1488
|
let te = 0, A;
|
|
1489
|
-
for (; (A = D.exec(
|
|
1489
|
+
for (; (A = D.exec(V)) !== null; ) {
|
|
1490
1490
|
if (A.index > te) {
|
|
1491
|
-
const
|
|
1492
|
-
|
|
1491
|
+
const U = V.slice(te, A.index);
|
|
1492
|
+
U.trim() && b.push({ type: "html", content: U });
|
|
1493
1493
|
}
|
|
1494
|
-
const ae = ee(A[3]),
|
|
1495
|
-
ae && (
|
|
1494
|
+
const ae = ee(A[3]), d = A[2];
|
|
1495
|
+
ae && (d === "form" && ae.isInline ? b.push({ type: "form", artifact: ae }) : d === "social" ? b.push({ type: "social", artifact: ae }) : b.push({ type: "panel", artifact: ae })), te = A.index + A[0].length;
|
|
1496
1496
|
}
|
|
1497
|
-
if (te <
|
|
1498
|
-
const ae =
|
|
1499
|
-
ae.trim() &&
|
|
1497
|
+
if (te < V.length) {
|
|
1498
|
+
const ae = V.slice(te);
|
|
1499
|
+
ae.trim() && b.push({ type: "html", content: ae });
|
|
1500
1500
|
}
|
|
1501
|
-
return
|
|
1501
|
+
return b.length === 0 && V.trim() && b.push({ type: "html", content: V }), b;
|
|
1502
1502
|
});
|
|
1503
|
-
function P(
|
|
1504
|
-
W.value =
|
|
1503
|
+
function P(b) {
|
|
1504
|
+
W.value = b.type || "image", Y.value = b.src || "", S.value = b.alt || "", ie.value = b.caption || "", O.value = !0, f("media-open", b);
|
|
1505
1505
|
}
|
|
1506
1506
|
function Q() {
|
|
1507
|
-
|
|
1507
|
+
O.value = !1, Y.value = "", S.value = "", ie.value = "";
|
|
1508
1508
|
}
|
|
1509
1509
|
function w() {
|
|
1510
1510
|
if (!x.value) return;
|
|
1511
|
-
x.value.querySelectorAll('img[data-lightbox="true"]').forEach((
|
|
1512
|
-
|
|
1513
|
-
|
|
1511
|
+
x.value.querySelectorAll('img[data-lightbox="true"]').forEach((d) => {
|
|
1512
|
+
d._lightboxHandler && d.removeEventListener("click", d._lightboxHandler), d._lightboxHandler = (U) => {
|
|
1513
|
+
U.preventDefault(), U.stopPropagation(), P({
|
|
1514
1514
|
type: "image",
|
|
1515
|
-
src:
|
|
1516
|
-
alt:
|
|
1517
|
-
caption:
|
|
1515
|
+
src: d.src,
|
|
1516
|
+
alt: d.alt || "",
|
|
1517
|
+
caption: d.dataset.caption || d.alt || ""
|
|
1518
1518
|
});
|
|
1519
|
-
},
|
|
1520
|
-
}), x.value.querySelectorAll(".artifactuse-image-container img").forEach((
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
const G =
|
|
1519
|
+
}, d.addEventListener("click", d._lightboxHandler), d.style.cursor = "zoom-in";
|
|
1520
|
+
}), x.value.querySelectorAll(".artifactuse-image-container img").forEach((d) => {
|
|
1521
|
+
d._lightboxHandler || (d._lightboxHandler = (U) => {
|
|
1522
|
+
U.preventDefault(), U.stopPropagation();
|
|
1523
|
+
const G = d.closest(".artifactuse-image-container"), ce = G == null ? void 0 : G.querySelector(".artifactuse-image-caption"), ke = (ce == null ? void 0 : ce.textContent) || d.dataset.caption || d.alt || "";
|
|
1524
1524
|
P({
|
|
1525
1525
|
type: "image",
|
|
1526
|
-
src:
|
|
1527
|
-
alt:
|
|
1526
|
+
src: d.src,
|
|
1527
|
+
alt: d.alt || "",
|
|
1528
1528
|
caption: ke
|
|
1529
1529
|
});
|
|
1530
|
-
},
|
|
1531
|
-
}), x.value.querySelectorAll(".artifactuse-gallery-item img, .artifactuse-image-gallery img").forEach((
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
const G =
|
|
1530
|
+
}, d.addEventListener("click", d._lightboxHandler), d.style.cursor = "zoom-in");
|
|
1531
|
+
}), x.value.querySelectorAll(".artifactuse-gallery-item img, .artifactuse-image-gallery img").forEach((d) => {
|
|
1532
|
+
d._lightboxHandler || (d._lightboxHandler = (U) => {
|
|
1533
|
+
U.preventDefault(), U.stopPropagation();
|
|
1534
|
+
const G = d.closest(".artifactuse-gallery-item"), ce = G == null ? void 0 : G.querySelector(".artifactuse-gallery-caption"), ke = (ce == null ? void 0 : ce.textContent) || d.dataset.caption || d.alt || "";
|
|
1535
1535
|
P({
|
|
1536
1536
|
type: "image",
|
|
1537
|
-
src:
|
|
1538
|
-
alt:
|
|
1537
|
+
src: d.src,
|
|
1538
|
+
alt: d.alt || "",
|
|
1539
1539
|
caption: ke
|
|
1540
1540
|
});
|
|
1541
|
-
},
|
|
1542
|
-
}), x.value.querySelectorAll('a[href$=".pdf"], a[data-type="pdf"]').forEach((
|
|
1543
|
-
|
|
1544
|
-
|
|
1541
|
+
}, d.addEventListener("click", d._lightboxHandler), d.style.cursor = "zoom-in");
|
|
1542
|
+
}), x.value.querySelectorAll('a[href$=".pdf"], a[data-type="pdf"]').forEach((d) => {
|
|
1543
|
+
d._pdfHandler && d.removeEventListener("click", d._pdfHandler), d._pdfHandler = (U) => {
|
|
1544
|
+
U.preventDefault(), U.stopPropagation(), P({
|
|
1545
1545
|
type: "pdf",
|
|
1546
|
-
src:
|
|
1547
|
-
alt:
|
|
1548
|
-
caption:
|
|
1546
|
+
src: d.href,
|
|
1547
|
+
alt: d.textContent || "PDF Document",
|
|
1548
|
+
caption: d.title || d.textContent || ""
|
|
1549
1549
|
});
|
|
1550
|
-
},
|
|
1551
|
-
}), x.value.querySelectorAll(".artifactuse-pdf-container, [data-pdf-viewer]").forEach((
|
|
1550
|
+
}, d.addEventListener("click", d._pdfHandler);
|
|
1551
|
+
}), x.value.querySelectorAll(".artifactuse-pdf-container, [data-pdf-viewer]").forEach((d) => {
|
|
1552
1552
|
var G;
|
|
1553
|
-
|
|
1554
|
-
const
|
|
1555
|
-
|
|
1553
|
+
d._pdfHandler && d.removeEventListener("click", d._pdfHandler);
|
|
1554
|
+
const U = d.dataset.pdfSrc || ((G = d.querySelector("iframe")) == null ? void 0 : G.src) || "";
|
|
1555
|
+
U && (d._pdfHandler = (ce) => {
|
|
1556
1556
|
ce.preventDefault(), ce.stopPropagation(), P({
|
|
1557
1557
|
type: "pdf",
|
|
1558
|
-
src:
|
|
1558
|
+
src: U,
|
|
1559
1559
|
alt: "PDF Document",
|
|
1560
|
-
caption:
|
|
1560
|
+
caption: d.dataset.caption || ""
|
|
1561
1561
|
});
|
|
1562
|
-
},
|
|
1563
|
-
}), x.value.querySelectorAll(".artifactuse-video-preview-wrapper, .video-preview-wrapper").forEach((
|
|
1564
|
-
|
|
1565
|
-
if (
|
|
1566
|
-
const G =
|
|
1562
|
+
}, d.addEventListener("click", d._pdfHandler), d.style.cursor = "pointer");
|
|
1563
|
+
}), x.value.querySelectorAll(".artifactuse-video-preview-wrapper, .video-preview-wrapper").forEach((d) => {
|
|
1564
|
+
d._clickHandler && d.removeEventListener("click", d._clickHandler), d._clickHandler = (U) => {
|
|
1565
|
+
if (U.target.closest(".artifactuse-video-play-button")) return;
|
|
1566
|
+
const G = d.dataset.videoUrl || d.dataset.url;
|
|
1567
1567
|
G && window.open(G, "_blank", "noopener,noreferrer");
|
|
1568
|
-
},
|
|
1568
|
+
}, d.addEventListener("click", d._clickHandler);
|
|
1569
1569
|
});
|
|
1570
1570
|
}
|
|
1571
|
-
function
|
|
1571
|
+
function L() {
|
|
1572
1572
|
if (!x.value) return;
|
|
1573
1573
|
x.value.querySelectorAll("img").forEach((A) => {
|
|
1574
1574
|
A._lightboxHandler && (A.removeEventListener("click", A._lightboxHandler), delete A._lightboxHandler);
|
|
@@ -1580,81 +1580,81 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
1580
1580
|
A._clickHandler && (A.removeEventListener("click", A._clickHandler), delete A._clickHandler);
|
|
1581
1581
|
});
|
|
1582
1582
|
}
|
|
1583
|
-
function
|
|
1584
|
-
|
|
1585
|
-
if (await
|
|
1583
|
+
function r() {
|
|
1584
|
+
N && clearTimeout(N), N = setTimeout(async () => {
|
|
1585
|
+
if (await xe(), n != null && n.initializeContent && x.value)
|
|
1586
1586
|
try {
|
|
1587
1587
|
await n.initializeContent(x.value);
|
|
1588
|
-
} catch (
|
|
1589
|
-
console.error("Failed to initialize content:",
|
|
1588
|
+
} catch (b) {
|
|
1589
|
+
console.error("Failed to initialize content:", b);
|
|
1590
1590
|
}
|
|
1591
1591
|
w();
|
|
1592
1592
|
}, 100);
|
|
1593
1593
|
}
|
|
1594
1594
|
de(
|
|
1595
|
-
() =>
|
|
1596
|
-
(
|
|
1597
|
-
if (
|
|
1598
|
-
const
|
|
1599
|
-
inlinePreview:
|
|
1600
|
-
inlineCode:
|
|
1601
|
-
tabs:
|
|
1602
|
-
viewMode:
|
|
1595
|
+
() => T.content,
|
|
1596
|
+
(b) => {
|
|
1597
|
+
if (b) {
|
|
1598
|
+
const V = o(b, T.messageId, {
|
|
1599
|
+
inlinePreview: T.inlinePreview,
|
|
1600
|
+
inlineCode: T.inlineCode,
|
|
1601
|
+
tabs: T.tabs,
|
|
1602
|
+
viewMode: T.viewMode
|
|
1603
1603
|
});
|
|
1604
|
-
|
|
1604
|
+
I.value = V.html, $.value = V.artifacts, V.artifacts.length > 0 && f("artifact-detected", V.artifacts), T.typing || r();
|
|
1605
1605
|
}
|
|
1606
1606
|
},
|
|
1607
1607
|
{ immediate: !0 }
|
|
1608
1608
|
), de(
|
|
1609
|
-
() =>
|
|
1610
|
-
(
|
|
1611
|
-
|
|
1609
|
+
() => T.typing,
|
|
1610
|
+
(b, V) => {
|
|
1611
|
+
V === !0 && b === !1 && r();
|
|
1612
1612
|
}
|
|
1613
|
-
),
|
|
1614
|
-
|
|
1615
|
-
}),
|
|
1616
|
-
|
|
1613
|
+
), Me(() => {
|
|
1614
|
+
T.typing || r();
|
|
1615
|
+
}), jt(() => {
|
|
1616
|
+
N && clearTimeout(N), L();
|
|
1617
1617
|
});
|
|
1618
|
-
function B(
|
|
1619
|
-
const
|
|
1620
|
-
if (
|
|
1621
|
-
if (
|
|
1622
|
-
const D =
|
|
1618
|
+
function B(b) {
|
|
1619
|
+
const V = b.target.closest(".artifactuse-inline-preview");
|
|
1620
|
+
if (V) {
|
|
1621
|
+
if (V.dataset.nonClickable) return;
|
|
1622
|
+
const D = V.dataset.artifactId;
|
|
1623
1623
|
if (D) {
|
|
1624
|
-
const te =
|
|
1625
|
-
te &&
|
|
1624
|
+
const te = E.artifacts.find((A) => A.id === D);
|
|
1625
|
+
te && u(te);
|
|
1626
1626
|
}
|
|
1627
1627
|
}
|
|
1628
1628
|
}
|
|
1629
|
-
function
|
|
1630
|
-
|
|
1629
|
+
function u(b) {
|
|
1630
|
+
q(b), f("artifact-open", b);
|
|
1631
1631
|
}
|
|
1632
|
-
function z(
|
|
1633
|
-
|
|
1632
|
+
function z(b) {
|
|
1633
|
+
f("artifact-copy", b);
|
|
1634
1634
|
}
|
|
1635
|
-
function le(
|
|
1636
|
-
|
|
1635
|
+
function le(b) {
|
|
1636
|
+
f("artifact-download", b);
|
|
1637
1637
|
}
|
|
1638
|
-
function pe(
|
|
1639
|
-
|
|
1638
|
+
function pe(b) {
|
|
1639
|
+
f("form-submit", b);
|
|
1640
1640
|
}
|
|
1641
|
-
function ye(
|
|
1642
|
-
|
|
1641
|
+
function ye(b) {
|
|
1642
|
+
f("form-cancel", b);
|
|
1643
1643
|
}
|
|
1644
|
-
function fe(
|
|
1645
|
-
|
|
1644
|
+
function fe(b) {
|
|
1645
|
+
f("form-button-click", b);
|
|
1646
1646
|
}
|
|
1647
|
-
function
|
|
1648
|
-
|
|
1647
|
+
function Pe(b) {
|
|
1648
|
+
f("social-copy", b);
|
|
1649
1649
|
}
|
|
1650
|
-
return
|
|
1650
|
+
return C(() => E.artifacts.filter((b) => b.messageId === T.messageId)), c({
|
|
1651
1651
|
openViewer: P,
|
|
1652
1652
|
closeViewer: Q,
|
|
1653
1653
|
attachMediaListeners: w
|
|
1654
|
-
}), (
|
|
1654
|
+
}), (b, V) => (a(), s("div", {
|
|
1655
1655
|
class: "artifactuse-agent-message",
|
|
1656
1656
|
ref_key: "messageRef",
|
|
1657
|
-
ref:
|
|
1657
|
+
ref: h
|
|
1658
1658
|
}, [
|
|
1659
1659
|
e("div", {
|
|
1660
1660
|
class: "artifactuse-message-content",
|
|
@@ -1666,311 +1666,335 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
1666
1666
|
D.type === "html" ? (a(), s("div", {
|
|
1667
1667
|
key: 0,
|
|
1668
1668
|
innerHTML: D.content
|
|
1669
|
-
}, null, 8,
|
|
1669
|
+
}, null, 8, ul)) : D.type === "form" && D.artifact.isInline ? (a(), $e(Qa, {
|
|
1670
1670
|
key: 1,
|
|
1671
1671
|
artifact: D.artifact,
|
|
1672
|
-
theme:
|
|
1672
|
+
theme: Z.value,
|
|
1673
1673
|
"initial-state": k.value,
|
|
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(), $e(tl, {
|
|
1678
1678
|
key: 2,
|
|
1679
1679
|
artifact: D.artifact,
|
|
1680
|
-
theme:
|
|
1681
|
-
onCopy:
|
|
1682
|
-
}, null, 8, ["artifact", "theme"])) : D.type === "panel" && oe.value ? (a(),
|
|
1680
|
+
theme: Z.value,
|
|
1681
|
+
onCopy: Pe
|
|
1682
|
+
}, null, 8, ["artifact", "theme"])) : D.type === "panel" && oe.value ? (a(), $e(ca, {
|
|
1683
1683
|
key: 3,
|
|
1684
1684
|
artifact: D.artifact,
|
|
1685
|
-
"is-active":
|
|
1686
|
-
onOpen:
|
|
1685
|
+
"is-active": X.value === D.artifact.id,
|
|
1686
|
+
onOpen: u,
|
|
1687
1687
|
onCopy: z,
|
|
1688
1688
|
onDownload: le
|
|
1689
1689
|
}, null, 8, ["artifact", "is-active"])) : v("", !0)
|
|
1690
1690
|
], 64))), 128))
|
|
1691
1691
|
], 512),
|
|
1692
|
-
|
|
1693
|
-
"is-open":
|
|
1692
|
+
ze(cl, {
|
|
1693
|
+
"is-open": O.value,
|
|
1694
1694
|
type: W.value,
|
|
1695
1695
|
src: Y.value,
|
|
1696
|
-
alt:
|
|
1696
|
+
alt: S.value,
|
|
1697
1697
|
caption: ie.value,
|
|
1698
1698
|
onClose: Q
|
|
1699
1699
|
}, null, 8, ["is-open", "type", "src", "alt", "caption"])
|
|
1700
1700
|
], 512));
|
|
1701
1701
|
}
|
|
1702
|
-
},
|
|
1702
|
+
}, dl = { class: "artifactuse-panel__header artifactuse-panel__header--simple" }, vl = { class: "artifactuse-panel__title" }, fl = { class: "artifactuse-panel__icon" }, pl = {
|
|
1703
|
+
key: 0,
|
|
1704
|
+
viewBox: "0 0 24 24",
|
|
1705
|
+
fill: "none",
|
|
1706
|
+
stroke: "currentColor",
|
|
1707
|
+
"stroke-width": "2"
|
|
1708
|
+
}, _l = {
|
|
1709
|
+
key: 1,
|
|
1710
|
+
viewBox: "0 0 24 24",
|
|
1711
|
+
fill: "none",
|
|
1712
|
+
stroke: "currentColor",
|
|
1713
|
+
"stroke-width": "2"
|
|
1714
|
+
}, hl = { class: "artifactuse-panel__title-content" }, ml = { class: "artifactuse-panel__name" }, yl = { class: "artifactuse-panel__actions" }, gl = { class: "artifactuse-panel__empty" }, kl = { class: "artifactuse-panel__empty-title" }, wl = { class: "artifactuse-panel__empty-text" }, bl = { class: "artifactuse-panel__footer artifactuse-panel__footer--simple" }, Cl = {
|
|
1703
1715
|
key: 0,
|
|
1704
1716
|
href: "https://artifactuse.com",
|
|
1705
1717
|
target: "_blank",
|
|
1706
1718
|
rel: "noopener noreferrer",
|
|
1707
1719
|
class: "artifactuse-panel__branding"
|
|
1708
|
-
},
|
|
1720
|
+
}, xl = { class: "artifactuse-panel__header artifactuse-panel__header--simple" }, $l = { class: "artifactuse-panel__title" }, Ml = { class: "artifactuse-panel__title-content" }, Tl = { class: "artifactuse-panel__meta" }, Ll = { class: "artifactuse-panel__actions" }, Pl = ["disabled"], Al = {
|
|
1709
1721
|
key: 0,
|
|
1710
1722
|
viewBox: "0 0 24 24",
|
|
1711
1723
|
fill: "none",
|
|
1712
1724
|
stroke: "currentColor",
|
|
1713
1725
|
"stroke-width": "2"
|
|
1714
|
-
},
|
|
1726
|
+
}, Hl = {
|
|
1715
1727
|
key: 1,
|
|
1716
1728
|
class: "artifactuse-panel__spinner-icon",
|
|
1717
1729
|
viewBox: "0 0 24 24",
|
|
1718
1730
|
fill: "none",
|
|
1719
1731
|
stroke: "currentColor",
|
|
1720
1732
|
"stroke-width": "2"
|
|
1721
|
-
},
|
|
1733
|
+
}, El = { class: "artifactuse-panel__list" }, Bl = { class: "artifactuse-panel__list-items" }, Sl = ["onClick"], zl = ["innerHTML"], Vl = { class: "artifactuse-panel__list-item-content" }, Il = { class: "artifactuse-panel__list-item-title" }, Fl = { class: "artifactuse-panel__list-item-meta" }, Rl = { class: "artifactuse-panel__footer artifactuse-panel__footer--simple" }, ql = {
|
|
1722
1734
|
key: 0,
|
|
1723
1735
|
href: "https://artifactuse.com",
|
|
1724
1736
|
target: "_blank",
|
|
1725
1737
|
rel: "noopener noreferrer",
|
|
1726
1738
|
class: "artifactuse-panel__branding"
|
|
1727
|
-
},
|
|
1739
|
+
}, Ol = { class: "artifactuse-panel__header" }, Ul = ["title"], Dl = { class: "artifactuse-panel__title" }, Nl = ["innerHTML"], jl = { class: "artifactuse-panel__title-content" }, Wl = { class: "artifactuse-panel__name" }, Jl = { class: "artifactuse-panel__meta" }, Xl = { class: "artifactuse-panel__tabs" }, Zl = ["disabled"], Kl = ["disabled"], Yl = { class: "artifactuse-panel__actions" }, Ql = ["title"], Gl = {
|
|
1728
1740
|
key: 0,
|
|
1729
1741
|
viewBox: "0 0 24 24",
|
|
1730
1742
|
fill: "none",
|
|
1731
1743
|
stroke: "currentColor",
|
|
1732
1744
|
"stroke-width": "2"
|
|
1733
|
-
},
|
|
1745
|
+
}, en = {
|
|
1734
1746
|
key: 1,
|
|
1735
1747
|
viewBox: "0 0 24 24",
|
|
1736
1748
|
fill: "none",
|
|
1737
1749
|
stroke: "currentColor",
|
|
1738
1750
|
"stroke-width": "2"
|
|
1739
|
-
},
|
|
1751
|
+
}, tn = {
|
|
1752
|
+
key: 0,
|
|
1753
|
+
class: "artifactuse-panel__file-tabs"
|
|
1754
|
+
}, an = { class: "artifactuse-panel__file-tabs-scroll" }, sn = ["onClick"], ln = ["innerHTML"], nn = { class: "artifactuse-panel__file-tab-title" }, on = ["onClick"], rn = {
|
|
1740
1755
|
key: 0,
|
|
1741
1756
|
class: "artifactuse-panel__loading"
|
|
1742
|
-
},
|
|
1757
|
+
}, cn = {
|
|
1743
1758
|
key: 0,
|
|
1744
1759
|
class: "artifactuse-panel__loading"
|
|
1745
|
-
},
|
|
1760
|
+
}, un = ["src"], dn = {
|
|
1746
1761
|
key: 2,
|
|
1747
1762
|
class: "artifactuse-panel__no-preview"
|
|
1748
|
-
},
|
|
1763
|
+
}, vn = { class: "artifactuse-panel__edit" }, fn = { class: "artifactuse-panel__footer" }, pn = { class: "artifactuse-panel__footer-left" }, _n = {
|
|
1749
1764
|
key: 0,
|
|
1750
1765
|
href: "https://artifactuse.com",
|
|
1751
1766
|
target: "_blank",
|
|
1752
1767
|
rel: "noopener noreferrer",
|
|
1753
1768
|
class: "artifactuse-panel__branding"
|
|
1754
|
-
},
|
|
1769
|
+
}, hn = {
|
|
1755
1770
|
key: 1,
|
|
1756
1771
|
class: "artifactuse-panel__badge"
|
|
1757
|
-
},
|
|
1772
|
+
}, mn = { class: "artifactuse-panel__footer-right" }, yn = ["title"], gn = {
|
|
1758
1773
|
key: 0,
|
|
1759
1774
|
viewBox: "0 0 24 24",
|
|
1760
1775
|
fill: "none",
|
|
1761
1776
|
stroke: "currentColor",
|
|
1762
1777
|
"stroke-width": "2"
|
|
1763
|
-
},
|
|
1778
|
+
}, kn = {
|
|
1764
1779
|
key: 1,
|
|
1765
1780
|
viewBox: "0 0 24 24",
|
|
1766
1781
|
fill: "none",
|
|
1767
1782
|
stroke: "currentColor",
|
|
1768
1783
|
"stroke-width": "2"
|
|
1769
|
-
},
|
|
1784
|
+
}, wn = {
|
|
1770
1785
|
key: 0,
|
|
1771
1786
|
style: { position: "relative" }
|
|
1772
|
-
},
|
|
1787
|
+
}, bn = {
|
|
1773
1788
|
key: 0,
|
|
1774
1789
|
class: "artifactuse-share-popup"
|
|
1775
|
-
},
|
|
1790
|
+
}, Cn = { class: "artifactuse-share-popup__header" }, xn = { class: "artifactuse-share-popup__title" }, $n = { class: "artifactuse-share-popup__body" }, Mn = {
|
|
1776
1791
|
key: 0,
|
|
1777
1792
|
class: "artifactuse-share-popup__loading"
|
|
1778
|
-
},
|
|
1793
|
+
}, Tn = { key: 1 }, Ln = { class: "artifactuse-share-popup__error" }, Pn = { class: "artifactuse-share-popup__error-text" }, An = { class: "artifactuse-share-popup__actions" }, Hn = {
|
|
1779
1794
|
key: 2,
|
|
1780
1795
|
class: "artifactuse-share-popup__options"
|
|
1781
|
-
},
|
|
1796
|
+
}, En = { key: 3 }, Bn = {
|
|
1782
1797
|
key: 0,
|
|
1783
1798
|
class: "artifactuse-share-popup__loading"
|
|
1784
|
-
},
|
|
1799
|
+
}, Sn = {
|
|
1785
1800
|
key: 1,
|
|
1786
1801
|
class: "artifactuse-share-popup__empty"
|
|
1787
|
-
},
|
|
1802
|
+
}, zn = {
|
|
1788
1803
|
key: 2,
|
|
1789
1804
|
class: "artifactuse-share-popup__artifact-list"
|
|
1790
|
-
},
|
|
1805
|
+
}, Vn = ["onClick"], In = { class: "artifactuse-share-popup__artifact-name" }, Fn = { class: "artifactuse-share-popup__artifact-date" }, Rn = {
|
|
1791
1806
|
key: 4,
|
|
1792
1807
|
class: "artifactuse-share-popup__success"
|
|
1793
|
-
},
|
|
1808
|
+
}, qn = { class: "artifactuse-share-popup__link-wrapper" }, On = ["value"], Un = {
|
|
1794
1809
|
key: 0,
|
|
1795
1810
|
class: "artifactuse-share-popup__expiry"
|
|
1796
|
-
},
|
|
1811
|
+
}, Dn = { class: "artifactuse-share-popup__expiry-text" }, Nn = {
|
|
1797
1812
|
key: 1,
|
|
1798
1813
|
class: "artifactuse-share-popup__save-prompt"
|
|
1799
|
-
},
|
|
1814
|
+
}, jn = {
|
|
1800
1815
|
key: 2,
|
|
1801
1816
|
class: "artifactuse-panel__nav"
|
|
1802
|
-
},
|
|
1817
|
+
}, Wn = ["disabled"], Jn = ["disabled"], Xn = {
|
|
1803
1818
|
key: 0,
|
|
1804
1819
|
class: "artifactuse-panel__artifact-list"
|
|
1805
|
-
},
|
|
1820
|
+
}, Zn = { class: "artifactuse-panel__artifact-list-header" }, Kn = { class: "artifactuse-panel__artifact-list-items" }, Yn = ["onClick"], Qn = ["innerHTML"], Gn = { class: "artifactuse-panel__artifact-item-content" }, eo = { class: "artifactuse-panel__artifact-item-title" }, to = { class: "artifactuse-panel__artifact-item-meta" }, ao = { class: "artifactuse-panel__artifact-item-index" }, uo = {
|
|
1806
1821
|
__name: "ArtifactusePanel",
|
|
1807
1822
|
props: {
|
|
1808
1823
|
panelWidth: { type: Number, default: void 0 },
|
|
1809
1824
|
splitPosition: { type: Number, default: void 0 }
|
|
1810
1825
|
},
|
|
1811
1826
|
emits: ["close", "ai-request", "save", "export", "resize"],
|
|
1812
|
-
setup(H, { emit:
|
|
1813
|
-
var
|
|
1814
|
-
const _ =
|
|
1815
|
-
state:
|
|
1816
|
-
activeArtifact:
|
|
1817
|
-
artifactCount:
|
|
1818
|
-
hasArtifacts:
|
|
1819
|
-
closePanel:
|
|
1827
|
+
setup(H, { emit: c }) {
|
|
1828
|
+
var st, it;
|
|
1829
|
+
const _ = c, T = H, {
|
|
1830
|
+
state: f,
|
|
1831
|
+
activeArtifact: o,
|
|
1832
|
+
artifactCount: q,
|
|
1833
|
+
hasArtifacts: E,
|
|
1834
|
+
closePanel: g,
|
|
1820
1835
|
toggleFullscreen: n,
|
|
1821
|
-
setViewMode:
|
|
1836
|
+
setViewMode: h,
|
|
1822
1837
|
getPanelUrl: x,
|
|
1823
|
-
openArtifact:
|
|
1838
|
+
openArtifact: I,
|
|
1824
1839
|
instance: $
|
|
1825
|
-
} =
|
|
1840
|
+
} = Ve(), N = M(null), O = M(null), W = M(null), Y = M(null), S = M(null), ie = M(null), Z = M(!1), X = M(!1), oe = M(!0), m = M(!1), k = M(!1), ee = M(!1), re = M(!1), P = M("options"), Q = M(""), w = M(null), L = M(""), r = M(!1), B = M(!1), u = M([]), z = M(!1), le = M("");
|
|
1826
1841
|
let pe = null, ye = null, fe = null;
|
|
1827
|
-
const
|
|
1842
|
+
const Pe = C(() => {
|
|
1828
1843
|
var i;
|
|
1829
1844
|
return ((i = $.editor) == null ? void 0 : i.isAvailable()) || !1;
|
|
1830
|
-
}),
|
|
1831
|
-
Math.min(Math.max(
|
|
1832
|
-
),
|
|
1833
|
-
Math.min(Math.max(
|
|
1834
|
-
), D =
|
|
1835
|
-
if (!
|
|
1836
|
-
let i = x(
|
|
1837
|
-
return i &&
|
|
1845
|
+
}), b = M(
|
|
1846
|
+
Math.min(Math.max(T.panelWidth ?? ((st = $.config) == null ? void 0 : st.panelWidth) ?? 65, 25), 75)
|
|
1847
|
+
), V = M(
|
|
1848
|
+
Math.min(Math.max(T.splitPosition ?? ((it = $.config) == null ? void 0 : it.splitPosition) ?? 50, 20), 80)
|
|
1849
|
+
), D = C(() => o.value ? Se(o.value.language) : ""), te = C(() => o.value ? `<svg viewBox="0 0 24 24" fill="currentColor">${Ne(o.value.language)}</svg>` : ""), A = C(() => {
|
|
1850
|
+
if (!o.value) return null;
|
|
1851
|
+
let i = x(o.value);
|
|
1852
|
+
return i && o.value._refreshToken && (i += (i.includes("?") ? "&" : "?") + "_t=" + o.value._refreshToken), i;
|
|
1838
1853
|
});
|
|
1839
|
-
|
|
1840
|
-
const ae =
|
|
1854
|
+
C(() => !o.value || !f.artifacts.length ? -1 : f.artifacts.findIndex((i) => i.id === o.value.id));
|
|
1855
|
+
const ae = C(() => o.value ? Xt(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(() => {
|
|
1841
1856
|
var i;
|
|
1842
1857
|
return ((i = $.config) == null ? void 0 : i.branding) !== !1;
|
|
1843
|
-
}), ce =
|
|
1858
|
+
}), ce = C(() => {
|
|
1844
1859
|
var i;
|
|
1845
1860
|
return ((i = $.share) == null ? void 0 : i.enabled) !== !1;
|
|
1846
|
-
}), ke =
|
|
1861
|
+
}), ke = C(() => {
|
|
1847
1862
|
var i;
|
|
1848
1863
|
return ((i = $.share) == null ? void 0 : i.isAuthenticated()) || !1;
|
|
1849
|
-
}),
|
|
1850
|
-
|
|
1851
|
-
return
|
|
1864
|
+
}), ft = C(() => !o.value && !f.forceEmptyView ? Math.min(b.value, 30) : b.value), Te = C(() => {
|
|
1865
|
+
var i;
|
|
1866
|
+
return ((i = $.config) == null ? void 0 : i.multiTab) === !0;
|
|
1867
|
+
}), we = C(() => f.forceEmptyView), Je = C(() => Te.value ? f.openTabs.map((i) => f.artifacts.find((t) => t.id === i)).filter(Boolean) : []);
|
|
1868
|
+
function Ie(i) {
|
|
1869
|
+
return `<svg viewBox="0 0 24 24" fill="currentColor">${Ne(i)}</svg>`;
|
|
1870
|
+
}
|
|
1871
|
+
function pt(i) {
|
|
1872
|
+
I(i);
|
|
1852
1873
|
}
|
|
1853
|
-
function
|
|
1874
|
+
function _t(i) {
|
|
1875
|
+
$.closeTab(i), f.openTabs.length === 0 && (k.value = !1);
|
|
1876
|
+
}
|
|
1877
|
+
function ht() {
|
|
1854
1878
|
k.value = !1, $.state.clearActiveArtifact();
|
|
1855
1879
|
}
|
|
1856
|
-
function
|
|
1880
|
+
function Xe(i) {
|
|
1857
1881
|
if (i.language !== "smartdiff") return null;
|
|
1858
1882
|
try {
|
|
1859
1883
|
const t = JSON.parse(i.code);
|
|
1860
1884
|
if (t.oldCode === void 0 || t.newCode === void 0) return null;
|
|
1861
|
-
const
|
|
1885
|
+
const p = t.language || "plaintext", F = ot() && window.Prism.languages[p], J = Zt(t.oldCode, t.newCode).split(`
|
|
1862
1886
|
`);
|
|
1863
|
-
return { html:
|
|
1864
|
-
const ne = ue[0], Ce = ue.slice(1), ge =
|
|
1887
|
+
return { html: J.map((ue) => {
|
|
1888
|
+
const ne = ue[0], Ce = ue.slice(1), ge = F ? window.Prism.highlight(Ce, F, p) : Ce;
|
|
1865
1889
|
return ne === "-" ? `<span class="token deleted">${ge}</span>` : ne === "+" ? `<span class="token inserted">${ge}</span>` : ge;
|
|
1866
1890
|
}).join(`
|
|
1867
|
-
`), lineCount:
|
|
1891
|
+
`), lineCount: J.length };
|
|
1868
1892
|
} catch {
|
|
1869
1893
|
return null;
|
|
1870
1894
|
}
|
|
1871
1895
|
}
|
|
1872
|
-
function
|
|
1896
|
+
function mt() {
|
|
1873
1897
|
var i;
|
|
1874
|
-
if (Y.value && ((i =
|
|
1875
|
-
const t =
|
|
1898
|
+
if (Y.value && ((i = o.value) != null && i.code)) {
|
|
1899
|
+
const t = Xe(o.value), p = t ? t.lineCount : o.value.code.split(`
|
|
1876
1900
|
`).length;
|
|
1877
|
-
Y.value.innerHTML = Array.from({ length:
|
|
1901
|
+
Y.value.innerHTML = Array.from({ length: p }, (F, J) => `<div>${J + 1}</div>`).join("");
|
|
1878
1902
|
}
|
|
1879
1903
|
}
|
|
1880
|
-
function
|
|
1904
|
+
function yt() {
|
|
1881
1905
|
var i;
|
|
1882
|
-
if (
|
|
1883
|
-
const t =
|
|
1906
|
+
if (O.value && ot() && ((i = o.value) != null && i.code)) {
|
|
1907
|
+
const t = Xe(o.value);
|
|
1884
1908
|
if (t)
|
|
1885
|
-
|
|
1909
|
+
O.value.innerHTML = t.html;
|
|
1886
1910
|
else {
|
|
1887
|
-
const
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1911
|
+
const p = window.Prism.languages[ae.value];
|
|
1912
|
+
p ? O.value.innerHTML = window.Prism.highlight(
|
|
1913
|
+
o.value.code,
|
|
1914
|
+
p,
|
|
1891
1915
|
ae.value
|
|
1892
|
-
) :
|
|
1916
|
+
) : O.value.textContent = o.value.code;
|
|
1893
1917
|
}
|
|
1894
|
-
|
|
1895
|
-
|
|
1918
|
+
O.value.dataset.highlighted = "true", xe(() => {
|
|
1919
|
+
gt();
|
|
1896
1920
|
});
|
|
1897
1921
|
}
|
|
1898
1922
|
}
|
|
1899
|
-
function
|
|
1923
|
+
function gt() {
|
|
1900
1924
|
var t;
|
|
1901
|
-
const i = (t =
|
|
1902
|
-
if (i &&
|
|
1903
|
-
const
|
|
1904
|
-
|
|
1925
|
+
const i = (t = O.value) == null ? void 0 : t.closest("pre");
|
|
1926
|
+
if (i && S.value && Y.value) {
|
|
1927
|
+
const F = window.getComputedStyle(i).backgroundColor;
|
|
1928
|
+
F && F !== "rgba(0, 0, 0, 0)" && F !== "transparent" && (S.value.style.backgroundColor = F, Y.value.style.backgroundColor = F);
|
|
1905
1929
|
}
|
|
1906
1930
|
}
|
|
1907
|
-
function
|
|
1908
|
-
|
|
1931
|
+
function kt() {
|
|
1932
|
+
S.value && (S.value.style.backgroundColor = ""), Y.value && (Y.value.style.backgroundColor = "");
|
|
1909
1933
|
}
|
|
1910
|
-
function
|
|
1911
|
-
|
|
1912
|
-
|
|
1934
|
+
function Ae() {
|
|
1935
|
+
xe(() => {
|
|
1936
|
+
mt(), yt();
|
|
1913
1937
|
});
|
|
1914
1938
|
}
|
|
1915
|
-
function
|
|
1916
|
-
!
|
|
1917
|
-
code:
|
|
1918
|
-
language:
|
|
1939
|
+
function Ze() {
|
|
1940
|
+
!Pe.value || !ie.value || !o.value || (Fe(), fe = $.editor.create(ie.value, {
|
|
1941
|
+
code: o.value.code || "",
|
|
1942
|
+
language: o.value.editorLanguage || o.value.language || "plaintext",
|
|
1919
1943
|
sdkTheme: $.getTheme()
|
|
1920
1944
|
}));
|
|
1921
1945
|
}
|
|
1922
|
-
function
|
|
1946
|
+
function Fe() {
|
|
1923
1947
|
fe && (fe.destroy(), fe = null);
|
|
1924
1948
|
}
|
|
1925
|
-
function
|
|
1926
|
-
if (!fe || !
|
|
1949
|
+
function wt() {
|
|
1950
|
+
if (!fe || !o.value) return;
|
|
1927
1951
|
const i = fe.getCode();
|
|
1928
1952
|
$.emit("edit:save", {
|
|
1929
|
-
artifactId:
|
|
1930
|
-
artifact:
|
|
1953
|
+
artifactId: o.value.id,
|
|
1954
|
+
artifact: o.value,
|
|
1931
1955
|
code: i
|
|
1932
1956
|
});
|
|
1933
1957
|
}
|
|
1934
|
-
function
|
|
1935
|
-
clearTimeout(ye), oe.value = !1,
|
|
1958
|
+
function bt() {
|
|
1959
|
+
clearTimeout(ye), oe.value = !1, N.value && o.value && ($.bridge.setIframe(N.value), $.bridge.loadArtifact(o.value));
|
|
1936
1960
|
}
|
|
1937
|
-
function
|
|
1961
|
+
function Ct() {
|
|
1938
1962
|
clearTimeout(ye), oe.value = !1;
|
|
1939
1963
|
}
|
|
1940
|
-
function
|
|
1964
|
+
function xt() {
|
|
1941
1965
|
clearTimeout(ye), ye = setTimeout(() => {
|
|
1942
1966
|
oe.value = !1;
|
|
1943
1967
|
}, 1e3);
|
|
1944
1968
|
}
|
|
1945
|
-
async function
|
|
1946
|
-
if (
|
|
1969
|
+
async function $t() {
|
|
1970
|
+
if (o.value)
|
|
1947
1971
|
try {
|
|
1948
|
-
await navigator.clipboard.writeText(
|
|
1949
|
-
|
|
1972
|
+
await navigator.clipboard.writeText(o.value.code), Z.value = !0, setTimeout(() => {
|
|
1973
|
+
Z.value = !1;
|
|
1950
1974
|
}, 2e3);
|
|
1951
1975
|
} catch (i) {
|
|
1952
1976
|
console.error("Failed to copy:", i);
|
|
1953
1977
|
}
|
|
1954
1978
|
}
|
|
1955
|
-
function
|
|
1956
|
-
if (!
|
|
1957
|
-
const { code: i, language: t, title:
|
|
1958
|
-
ne.href = ue, ne.download =
|
|
1979
|
+
function Mt() {
|
|
1980
|
+
if (!o.value) return;
|
|
1981
|
+
const { code: i, language: t, title: p } = o.value, F = je(t), J = `${p.toLowerCase().replace(/\s+/g, "-")}.${F}`, me = new Blob([i], { type: "text/plain" }), ue = URL.createObjectURL(me), ne = document.createElement("a");
|
|
1982
|
+
ne.href = ue, ne.download = J, document.body.appendChild(ne), ne.click(), document.body.removeChild(ne), URL.revokeObjectURL(ue);
|
|
1959
1983
|
}
|
|
1960
|
-
async function
|
|
1961
|
-
if (!(ee.value ||
|
|
1984
|
+
async function Tt() {
|
|
1985
|
+
if (!(ee.value || d.value.length === 0)) {
|
|
1962
1986
|
ee.value = !0;
|
|
1963
1987
|
try {
|
|
1964
|
-
const i = new
|
|
1965
|
-
for (const ne of
|
|
1988
|
+
const i = new Yt(), t = /* @__PURE__ */ new Map();
|
|
1989
|
+
for (const ne of d.value) {
|
|
1966
1990
|
if (!ne.code) continue;
|
|
1967
|
-
const Ce =
|
|
1968
|
-
let ge = (ne.title || "untitled").toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-_]/g, ""),
|
|
1969
|
-
const
|
|
1970
|
-
|
|
1991
|
+
const Ce = je(ne.language);
|
|
1992
|
+
let ge = (ne.title || "untitled").toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-_]/g, ""), Ue = `${ge}.${Ce}`;
|
|
1993
|
+
const De = t.get(Ue) || 0;
|
|
1994
|
+
De > 0 && (Ue = `${ge}-${De}.${Ce}`), t.set(`${ge}.${Ce}`, De + 1), i.file(Ue, ne.code);
|
|
1971
1995
|
}
|
|
1972
|
-
const
|
|
1973
|
-
ue.href =
|
|
1996
|
+
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
|
+
ue.href = me, ue.download = J, document.body.appendChild(ue), ue.click(), document.body.removeChild(ue), URL.revokeObjectURL(me);
|
|
1974
1998
|
} catch (i) {
|
|
1975
1999
|
console.error("Failed to create ZIP:", i);
|
|
1976
2000
|
} finally {
|
|
@@ -1978,57 +2002,57 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
1978
2002
|
}
|
|
1979
2003
|
}
|
|
1980
2004
|
}
|
|
1981
|
-
function
|
|
2005
|
+
function Lt() {
|
|
1982
2006
|
if (re.value) {
|
|
1983
2007
|
re.value = !1;
|
|
1984
2008
|
return;
|
|
1985
2009
|
}
|
|
1986
|
-
|
|
2010
|
+
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);
|
|
1987
2011
|
}
|
|
1988
|
-
function
|
|
2012
|
+
function Pt() {
|
|
1989
2013
|
re.value = !1;
|
|
1990
2014
|
}
|
|
1991
|
-
function
|
|
2015
|
+
function Ke(i) {
|
|
1992
2016
|
return i ? new Date(i).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" }) : "";
|
|
1993
2017
|
}
|
|
1994
|
-
async function
|
|
1995
|
-
if (!(!
|
|
1996
|
-
P.value = "loading",
|
|
2018
|
+
async function Ye() {
|
|
2019
|
+
if (!(!o.value || !$.share)) {
|
|
2020
|
+
P.value = "loading", L.value = "";
|
|
1997
2021
|
try {
|
|
1998
|
-
const i = await $.share.share(
|
|
2022
|
+
const i = await $.share.share(o.value);
|
|
1999
2023
|
Q.value = i.url, w.value = i.expiresAt, B.value = !1, P.value = "success";
|
|
2000
2024
|
} catch (i) {
|
|
2001
|
-
|
|
2025
|
+
L.value = i.message || "Failed to create share link", P.value = "error";
|
|
2002
2026
|
}
|
|
2003
2027
|
}
|
|
2004
2028
|
}
|
|
2005
|
-
async function
|
|
2029
|
+
async function Qe() {
|
|
2006
2030
|
if (ke.value)
|
|
2007
|
-
|
|
2031
|
+
Re();
|
|
2008
2032
|
else {
|
|
2009
2033
|
P.value = "loading";
|
|
2010
2034
|
try {
|
|
2011
|
-
await $.share.openAuthPopup(),
|
|
2035
|
+
await $.share.openAuthPopup(), Re();
|
|
2012
2036
|
} catch (i) {
|
|
2013
|
-
i.message === "Authentication cancelled" ? P.value = "options" : (
|
|
2037
|
+
i.message === "Authentication cancelled" ? P.value = "options" : (L.value = i.message || "Authentication failed", P.value = "error");
|
|
2014
2038
|
}
|
|
2015
2039
|
}
|
|
2016
2040
|
}
|
|
2017
|
-
async function
|
|
2018
|
-
if (!(!
|
|
2019
|
-
P.value = "loading",
|
|
2041
|
+
async function Re() {
|
|
2042
|
+
if (!(!o.value || !$.share)) {
|
|
2043
|
+
P.value = "loading", L.value = "";
|
|
2020
2044
|
try {
|
|
2021
|
-
const i = await $.share.save(
|
|
2045
|
+
const i = await $.share.save(o.value);
|
|
2022
2046
|
Q.value = i.url, w.value = null, B.value = !0, P.value = "success";
|
|
2023
2047
|
} catch (i) {
|
|
2024
|
-
|
|
2048
|
+
L.value = i.message || "Failed to save artifact", P.value = "error";
|
|
2025
2049
|
}
|
|
2026
2050
|
}
|
|
2027
2051
|
}
|
|
2028
|
-
function
|
|
2029
|
-
B.value ?
|
|
2052
|
+
function At() {
|
|
2053
|
+
B.value ? Re() : Ye();
|
|
2030
2054
|
}
|
|
2031
|
-
async function
|
|
2055
|
+
async function Ht() {
|
|
2032
2056
|
var i;
|
|
2033
2057
|
if ($.share) {
|
|
2034
2058
|
if (!ke.value) {
|
|
@@ -2036,148 +2060,354 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2036
2060
|
try {
|
|
2037
2061
|
await $.share.openAuthPopup();
|
|
2038
2062
|
} catch (t) {
|
|
2039
|
-
t.message === "Authentication cancelled" ? P.value = "options" : (
|
|
2063
|
+
t.message === "Authentication cancelled" ? P.value = "options" : (L.value = t.message || "Authentication failed", P.value = "error");
|
|
2040
2064
|
return;
|
|
2041
2065
|
}
|
|
2042
2066
|
}
|
|
2043
2067
|
P.value = "update-list", z.value = !0;
|
|
2044
2068
|
try {
|
|
2045
|
-
const t = ((i =
|
|
2046
|
-
|
|
2069
|
+
const t = ((i = o.value) == null ? void 0 : i.language) || null, p = await $.share.listArtifacts(t);
|
|
2070
|
+
u.value = p.projects || [];
|
|
2047
2071
|
} catch (t) {
|
|
2048
|
-
|
|
2072
|
+
L.value = t.message || "Failed to load artifacts", P.value = "error";
|
|
2049
2073
|
} finally {
|
|
2050
2074
|
z.value = !1;
|
|
2051
2075
|
}
|
|
2052
2076
|
}
|
|
2053
2077
|
}
|
|
2054
|
-
async function
|
|
2055
|
-
var
|
|
2056
|
-
if (!
|
|
2057
|
-
const t = (
|
|
2078
|
+
async function Et(i) {
|
|
2079
|
+
var p, F;
|
|
2080
|
+
if (!o.value || !$.share) return;
|
|
2081
|
+
const t = (p = i.project) == null ? void 0 : p.uuid;
|
|
2058
2082
|
if (t) {
|
|
2059
|
-
P.value = "loading",
|
|
2083
|
+
P.value = "loading", L.value = "";
|
|
2060
2084
|
try {
|
|
2061
|
-
const
|
|
2062
|
-
Q.value =
|
|
2063
|
-
} catch (
|
|
2064
|
-
|
|
2085
|
+
const J = await $.share.updateArtifact(t, o.value);
|
|
2086
|
+
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
|
+
} catch (J) {
|
|
2088
|
+
L.value = J.message || "Failed to update artifact", P.value = "error";
|
|
2065
2089
|
}
|
|
2066
2090
|
}
|
|
2067
2091
|
}
|
|
2068
|
-
async function
|
|
2092
|
+
async function Bt() {
|
|
2069
2093
|
if (Q.value)
|
|
2070
2094
|
try {
|
|
2071
|
-
await navigator.clipboard.writeText(Q.value),
|
|
2072
|
-
|
|
2095
|
+
await navigator.clipboard.writeText(Q.value), r.value = !0, setTimeout(() => {
|
|
2096
|
+
r.value = !1;
|
|
2073
2097
|
}, 2e3);
|
|
2074
2098
|
} catch (i) {
|
|
2075
2099
|
console.error("Failed to copy link:", i);
|
|
2076
2100
|
}
|
|
2077
2101
|
}
|
|
2078
|
-
function
|
|
2102
|
+
function St() {
|
|
2079
2103
|
A.value && window.open(A.value, "_blank");
|
|
2080
2104
|
}
|
|
2081
|
-
function
|
|
2082
|
-
Y.value &&
|
|
2105
|
+
function zt() {
|
|
2106
|
+
Y.value && S.value && (Y.value.style.transform = `translateY(-${S.value.scrollTop}px)`);
|
|
2083
2107
|
}
|
|
2084
|
-
function
|
|
2085
|
-
|
|
2108
|
+
function Vt() {
|
|
2109
|
+
X.value = !X.value;
|
|
2086
2110
|
}
|
|
2087
|
-
function
|
|
2088
|
-
k.value = !0,
|
|
2111
|
+
function Ge(i) {
|
|
2112
|
+
k.value = !0, I(i), X.value = !1;
|
|
2089
2113
|
}
|
|
2090
|
-
function
|
|
2091
|
-
const i =
|
|
2092
|
-
i >= 0 &&
|
|
2114
|
+
function It() {
|
|
2115
|
+
const i = U.value - 1;
|
|
2116
|
+
i >= 0 && I(d.value[i]);
|
|
2093
2117
|
}
|
|
2094
|
-
function
|
|
2095
|
-
const i =
|
|
2096
|
-
i <
|
|
2118
|
+
function Ft() {
|
|
2119
|
+
const i = U.value + 1;
|
|
2120
|
+
i < d.value.length && I(d.value[i]);
|
|
2097
2121
|
}
|
|
2098
|
-
function
|
|
2122
|
+
function et(i) {
|
|
2099
2123
|
const t = document.querySelector(".artifactuse-panel__nav");
|
|
2100
|
-
t && !t.contains(i.target) && (
|
|
2124
|
+
t && !t.contains(i.target) && (X.value = !1);
|
|
2101
2125
|
}
|
|
2102
|
-
let
|
|
2103
|
-
function
|
|
2104
|
-
|
|
2126
|
+
let be = null;
|
|
2127
|
+
function Rt(i) {
|
|
2128
|
+
be = {
|
|
2105
2129
|
startX: i.clientX,
|
|
2106
|
-
startWidth:
|
|
2107
|
-
}, document.addEventListener("mousemove",
|
|
2130
|
+
startWidth: b.value
|
|
2131
|
+
}, document.addEventListener("mousemove", tt), document.addEventListener("mouseup", qe), document.body.style.cursor = "ew-resize", document.body.style.userSelect = "none", document.querySelectorAll("iframe").forEach((p) => p.style.pointerEvents = "none");
|
|
2108
2132
|
}
|
|
2109
|
-
function
|
|
2110
|
-
if (!
|
|
2111
|
-
const t = window.innerWidth,
|
|
2112
|
-
|
|
2133
|
+
function tt(i) {
|
|
2134
|
+
if (!be) return;
|
|
2135
|
+
const t = window.innerWidth, F = (be.startX - i.clientX) / t * 100, J = be.startWidth + F;
|
|
2136
|
+
b.value = Math.min(Math.max(J, 25), 75), _("resize", { width: b.value });
|
|
2113
2137
|
}
|
|
2114
|
-
function
|
|
2115
|
-
const i =
|
|
2116
|
-
|
|
2138
|
+
function qe() {
|
|
2139
|
+
const i = be !== null;
|
|
2140
|
+
be = null, document.removeEventListener("mousemove", tt), 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 });
|
|
2117
2141
|
}
|
|
2118
|
-
let
|
|
2119
|
-
function
|
|
2142
|
+
let Le = null;
|
|
2143
|
+
function qt(i) {
|
|
2120
2144
|
if (!W.value) return;
|
|
2121
2145
|
const t = W.value.getBoundingClientRect();
|
|
2122
|
-
|
|
2146
|
+
Le = {
|
|
2123
2147
|
startX: i.clientX,
|
|
2124
|
-
startPosition:
|
|
2148
|
+
startPosition: V.value,
|
|
2125
2149
|
contentLeft: t.left,
|
|
2126
2150
|
contentWidth: t.width
|
|
2127
|
-
}, document.addEventListener("mousemove",
|
|
2151
|
+
}, document.addEventListener("mousemove", at), document.addEventListener("mouseup", Oe), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.querySelectorAll("iframe").forEach((F) => F.style.pointerEvents = "none");
|
|
2128
2152
|
}
|
|
2129
|
-
function
|
|
2130
|
-
if (!
|
|
2131
|
-
const
|
|
2132
|
-
|
|
2133
|
-
}
|
|
2134
|
-
function
|
|
2135
|
-
|
|
2136
|
-
}
|
|
2137
|
-
return de(
|
|
2138
|
-
i && (t && t.isPreviewable !== i.isPreviewable && (
|
|
2139
|
-
|
|
2140
|
-
}, 150)), (!t || i.id !== t.id) && (
|
|
2141
|
-
|
|
2153
|
+
function at(i) {
|
|
2154
|
+
if (!Le) return;
|
|
2155
|
+
const p = (i.clientX - Le.contentLeft) / Le.contentWidth * 100;
|
|
2156
|
+
V.value = Math.min(Math.max(p, 20), 80);
|
|
2157
|
+
}
|
|
2158
|
+
function Oe() {
|
|
2159
|
+
Le = null, document.removeEventListener("mousemove", at), document.removeEventListener("mouseup", Oe), document.body.style.cursor = "", document.body.style.userSelect = "", document.querySelectorAll("iframe").forEach((t) => t.style.pointerEvents = "");
|
|
2160
|
+
}
|
|
2161
|
+
return de(o, (i, t) => {
|
|
2162
|
+
i && (t && t.isPreviewable !== i.isPreviewable && (m.value = !0, setTimeout(() => {
|
|
2163
|
+
m.value = !1;
|
|
2164
|
+
}, 150)), (!t || i.id !== t.id) && (kt(), oe.value = !0, xt()), (!t || i.id !== t.id || i.code !== t.code) && (Ae(), f.viewMode === "edit" && (!t || i.id !== t.id ? xe(() => Ze()) : fe && fe.setCode(i.code || "")), clearTimeout(pe), pe = setTimeout(() => {
|
|
2165
|
+
N.value && i.isPreviewable && $.bridge.loadArtifact(i);
|
|
2142
2166
|
}, 500)));
|
|
2143
|
-
}, { deep: !0 }), de(() =>
|
|
2144
|
-
(i === "code" || i === "split") &&
|
|
2145
|
-
}), de(() =>
|
|
2146
|
-
i &&
|
|
2147
|
-
}), de(() =>
|
|
2148
|
-
i !== void 0 && (
|
|
2149
|
-
}), de(() =>
|
|
2150
|
-
i !== void 0 && (
|
|
2151
|
-
}),
|
|
2152
|
-
$.on("ai:request", (i) => _("ai-request", i)), $.on("save:request", (i) => _("save", i)), $.on("export:complete", (i) => _("export", i)), document.addEventListener("click",
|
|
2153
|
-
}),
|
|
2154
|
-
|
|
2155
|
-
}), (i, t) => (a(),
|
|
2156
|
-
default:
|
|
2157
|
-
|
|
2167
|
+
}, { deep: !0 }), de(() => f.viewMode, (i) => {
|
|
2168
|
+
(i === "code" || i === "split") && Ae(), i === "edit" && xe(() => Ze());
|
|
2169
|
+
}), de(() => f.isPanelOpen, (i) => {
|
|
2170
|
+
i && o.value && Ae(), i || Fe();
|
|
2171
|
+
}), de(() => T.panelWidth, (i) => {
|
|
2172
|
+
i !== void 0 && (b.value = Math.min(Math.max(i, 25), 75));
|
|
2173
|
+
}), de(() => T.splitPosition, (i) => {
|
|
2174
|
+
i !== void 0 && (V.value = Math.min(Math.max(i, 20), 80));
|
|
2175
|
+
}), Me(() => {
|
|
2176
|
+
$.on("ai:request", (i) => _("ai-request", i)), $.on("save:request", (i) => _("save", i)), $.on("export:complete", (i) => _("export", i)), document.addEventListener("click", et), f.isPanelOpen && o.value && Ae();
|
|
2177
|
+
}), We(() => {
|
|
2178
|
+
qe(), Oe(), Fe(), document.removeEventListener("click", et), clearTimeout(pe), clearTimeout(ye);
|
|
2179
|
+
}), (i, t) => (a(), $e(Ee, { name: "artifactuse-panel" }, {
|
|
2180
|
+
default: Be(() => [
|
|
2181
|
+
y(f).isPanelOpen ? (a(), s("div", {
|
|
2158
2182
|
key: 0,
|
|
2159
|
-
class:
|
|
2160
|
-
"artifactuse-panel--fullscreen":
|
|
2161
|
-
"artifactuse-panel--list": !
|
|
2162
|
-
"artifactuse-panel--empty": !
|
|
2183
|
+
class: j(["artifactuse-panel", {
|
|
2184
|
+
"artifactuse-panel--fullscreen": y(f).isFullscreen,
|
|
2185
|
+
"artifactuse-panel--list": !y(o) && y(E) && !y(f).forceEmptyView,
|
|
2186
|
+
"artifactuse-panel--empty": !y(E) && !y(f).forceEmptyView
|
|
2163
2187
|
}]),
|
|
2164
|
-
style:
|
|
2188
|
+
style: He(y(f).isFullscreen ? void 0 : { width: `${ft.value}%` })
|
|
2165
2189
|
}, [
|
|
2166
|
-
|
|
2190
|
+
y(f).isFullscreen ? v("", !0) : (a(), s("div", {
|
|
2167
2191
|
key: 0,
|
|
2168
2192
|
class: "artifactuse-panel__resize-handle",
|
|
2169
|
-
onMousedown:
|
|
2193
|
+
onMousedown: he(Rt, ["prevent"])
|
|
2170
2194
|
}, [...t[12] || (t[12] = [
|
|
2171
2195
|
e("div", { class: "artifactuse-panel__resize-handle-line" }, null, -1)
|
|
2172
2196
|
])], 32)),
|
|
2173
|
-
|
|
2174
|
-
e("header",
|
|
2175
|
-
|
|
2197
|
+
!y(E) || we.value ? (a(), s(R, { key: 1 }, [
|
|
2198
|
+
e("header", dl, [
|
|
2199
|
+
e("div", vl, [
|
|
2200
|
+
e("span", fl, [
|
|
2201
|
+
we.value ? (a(), s("svg", pl, [...t[13] || (t[13] = [
|
|
2202
|
+
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
|
+
e("polyline", { points: "14 2 14 8 20 8" }, null, -1)
|
|
2204
|
+
])])) : (a(), s("svg", _l, [...t[14] || (t[14] = [
|
|
2205
|
+
e("polyline", { points: "16 18 22 12 16 6" }, null, -1),
|
|
2206
|
+
e("polyline", { points: "8 6 2 12 8 18" }, null, -1)
|
|
2207
|
+
])]))
|
|
2208
|
+
]),
|
|
2209
|
+
e("div", hl, [
|
|
2210
|
+
e("span", ml, l(we.value ? "Artifact Viewer" : "Artifacts"), 1)
|
|
2211
|
+
])
|
|
2212
|
+
]),
|
|
2213
|
+
e("div", yl, [
|
|
2214
|
+
e("button", {
|
|
2215
|
+
class: "artifactuse-panel__action artifactuse-panel__action--close",
|
|
2216
|
+
title: "Close panel",
|
|
2217
|
+
onClick: t[0] || (t[0] = (...p) => y(g) && y(g)(...p))
|
|
2218
|
+
}, [...t[15] || (t[15] = [
|
|
2219
|
+
e("svg", {
|
|
2220
|
+
viewBox: "0 0 24 24",
|
|
2221
|
+
fill: "none",
|
|
2222
|
+
stroke: "currentColor",
|
|
2223
|
+
"stroke-width": "2"
|
|
2224
|
+
}, [
|
|
2225
|
+
e("line", {
|
|
2226
|
+
x1: "18",
|
|
2227
|
+
y1: "6",
|
|
2228
|
+
x2: "6",
|
|
2229
|
+
y2: "18"
|
|
2230
|
+
}),
|
|
2231
|
+
e("line", {
|
|
2232
|
+
x1: "6",
|
|
2233
|
+
y1: "6",
|
|
2234
|
+
x2: "18",
|
|
2235
|
+
y2: "18"
|
|
2236
|
+
})
|
|
2237
|
+
], -1)
|
|
2238
|
+
])])
|
|
2239
|
+
])
|
|
2240
|
+
]),
|
|
2241
|
+
e("div", gl, [
|
|
2242
|
+
t[16] || (t[16] = e("div", { class: "artifactuse-panel__empty-icon" }, [
|
|
2243
|
+
e("svg", {
|
|
2244
|
+
viewBox: "0 0 24 24",
|
|
2245
|
+
fill: "none",
|
|
2246
|
+
stroke: "currentColor",
|
|
2247
|
+
"stroke-width": "1.5"
|
|
2248
|
+
}, [
|
|
2249
|
+
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" }),
|
|
2250
|
+
e("polyline", { points: "14 2 14 8 20 8" })
|
|
2251
|
+
])
|
|
2252
|
+
], -1)),
|
|
2253
|
+
e("h3", kl, l(we.value ? "No artifact selected" : "No artifacts yet"), 1),
|
|
2254
|
+
e("p", wl, l(we.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
|
+
]),
|
|
2256
|
+
e("footer", bl, [
|
|
2257
|
+
G.value ? (a(), s("a", Cl, [...t[17] || (t[17] = [
|
|
2258
|
+
e("svg", {
|
|
2259
|
+
width: "16",
|
|
2260
|
+
height: "16",
|
|
2261
|
+
viewBox: "0 0 42 42",
|
|
2262
|
+
fill: "none",
|
|
2263
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
2264
|
+
}, [
|
|
2265
|
+
e("path", {
|
|
2266
|
+
d: "M16.6667 41.6673V10.4173C16.6667 9.86478 16.4472 9.33488 16.0565 8.94418C15.6658 8.55348 15.1359 8.33398 14.5833 8.33398H4.16667C3.0616 8.33398 2.00179 8.77297 1.22039 9.55437C0.438987 10.3358 0 11.3956 0 12.5007V37.5006C0 38.6057 0.438987 39.6655 1.22039 40.4469C2.00179 41.2283 3.0616 41.6673 4.16667 41.6673H29.1667C30.2717 41.6673 31.3315 41.2283 32.1129 40.4469C32.8943 39.6655 33.3333 38.6057 33.3333 37.5006V27.084C33.3333 26.5314 33.1138 26.0015 32.7231 25.6108C32.3324 25.2201 31.8025 25.0007 31.25 25.0007H0",
|
|
2267
|
+
fill: "#5F51C8"
|
|
2268
|
+
}),
|
|
2269
|
+
e("path", {
|
|
2270
|
+
d: "M39.5833 0H27.0833C25.9327 0 25 0.93274 25 2.08333V14.5833C25 15.7339 25.9327 16.6667 27.0833 16.6667H39.5833C40.7339 16.6667 41.6667 15.7339 41.6667 14.5833V2.08333C41.6667 0.93274 40.7339 0 39.5833 0Z",
|
|
2271
|
+
fill: "#695AE0"
|
|
2272
|
+
})
|
|
2273
|
+
], -1),
|
|
2274
|
+
e("span", null, "Artifactuse", -1)
|
|
2275
|
+
])])) : v("", !0)
|
|
2276
|
+
])
|
|
2277
|
+
], 64)) : !y(o) && !we.value ? (a(), s(R, { key: 2 }, [
|
|
2278
|
+
e("header", xl, [
|
|
2279
|
+
e("div", $l, [
|
|
2280
|
+
t[19] || (t[19] = e("span", { class: "artifactuse-panel__icon" }, [
|
|
2281
|
+
e("svg", {
|
|
2282
|
+
viewBox: "0 0 24 24",
|
|
2283
|
+
fill: "none",
|
|
2284
|
+
stroke: "currentColor",
|
|
2285
|
+
"stroke-width": "2"
|
|
2286
|
+
}, [
|
|
2287
|
+
e("polyline", { points: "16 18 22 12 16 6" }),
|
|
2288
|
+
e("polyline", { points: "8 6 2 12 8 18" })
|
|
2289
|
+
])
|
|
2290
|
+
], -1)),
|
|
2291
|
+
e("div", Ml, [
|
|
2292
|
+
t[18] || (t[18] = e("span", { class: "artifactuse-panel__name" }, "Artifacts", -1)),
|
|
2293
|
+
e("span", Tl, l(d.value.length) + " available", 1)
|
|
2294
|
+
])
|
|
2295
|
+
]),
|
|
2296
|
+
e("div", Ll, [
|
|
2297
|
+
e("button", {
|
|
2298
|
+
class: j(["artifactuse-panel__action", { "artifactuse-panel__action--loading": ee.value }]),
|
|
2299
|
+
disabled: ee.value,
|
|
2300
|
+
title: "Download all as ZIP",
|
|
2301
|
+
onClick: Tt
|
|
2302
|
+
}, [
|
|
2303
|
+
ee.value ? (a(), s("svg", Hl, [...t[21] || (t[21] = [
|
|
2304
|
+
e("circle", {
|
|
2305
|
+
cx: "12",
|
|
2306
|
+
cy: "12",
|
|
2307
|
+
r: "10",
|
|
2308
|
+
"stroke-dasharray": "32",
|
|
2309
|
+
"stroke-dashoffset": "32"
|
|
2310
|
+
}, null, -1)
|
|
2311
|
+
])])) : (a(), s("svg", Al, [...t[20] || (t[20] = [
|
|
2312
|
+
e("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }, null, -1),
|
|
2313
|
+
e("polyline", { points: "7 10 12 15 17 10" }, null, -1),
|
|
2314
|
+
e("line", {
|
|
2315
|
+
x1: "12",
|
|
2316
|
+
y1: "15",
|
|
2317
|
+
x2: "12",
|
|
2318
|
+
y2: "3"
|
|
2319
|
+
}, null, -1)
|
|
2320
|
+
])]))
|
|
2321
|
+
], 10, Pl),
|
|
2322
|
+
e("button", {
|
|
2323
|
+
class: "artifactuse-panel__action artifactuse-panel__action--close",
|
|
2324
|
+
title: "Close panel",
|
|
2325
|
+
onClick: t[1] || (t[1] = (...p) => y(g) && y(g)(...p))
|
|
2326
|
+
}, [...t[22] || (t[22] = [
|
|
2327
|
+
e("svg", {
|
|
2328
|
+
viewBox: "0 0 24 24",
|
|
2329
|
+
fill: "none",
|
|
2330
|
+
stroke: "currentColor",
|
|
2331
|
+
"stroke-width": "2"
|
|
2332
|
+
}, [
|
|
2333
|
+
e("line", {
|
|
2334
|
+
x1: "18",
|
|
2335
|
+
y1: "6",
|
|
2336
|
+
x2: "6",
|
|
2337
|
+
y2: "18"
|
|
2338
|
+
}),
|
|
2339
|
+
e("line", {
|
|
2340
|
+
x1: "6",
|
|
2341
|
+
y1: "6",
|
|
2342
|
+
x2: "18",
|
|
2343
|
+
y2: "18"
|
|
2344
|
+
})
|
|
2345
|
+
], -1)
|
|
2346
|
+
])])
|
|
2347
|
+
])
|
|
2348
|
+
]),
|
|
2349
|
+
e("div", El, [
|
|
2350
|
+
e("div", Bl, [
|
|
2351
|
+
(a(!0), s(R, null, ve(d.value, (p, F) => (a(), s("button", {
|
|
2352
|
+
key: p.id,
|
|
2353
|
+
class: "artifactuse-panel__list-item",
|
|
2354
|
+
onClick: (J) => Ge(p)
|
|
2355
|
+
}, [
|
|
2356
|
+
e("span", {
|
|
2357
|
+
class: "artifactuse-panel__list-item-icon",
|
|
2358
|
+
innerHTML: Ie(p.language)
|
|
2359
|
+
}, null, 8, zl),
|
|
2360
|
+
e("div", Vl, [
|
|
2361
|
+
e("span", Il, l(p.title || "Untitled"), 1),
|
|
2362
|
+
e("span", Fl, [
|
|
2363
|
+
K(l(y(Se)(p.language)) + " ", 1),
|
|
2364
|
+
p.lineCount ? (a(), s(R, { key: 0 }, [
|
|
2365
|
+
K(" • " + l(p.lineCount) + " lines ", 1)
|
|
2366
|
+
], 64)) : v("", !0)
|
|
2367
|
+
])
|
|
2368
|
+
]),
|
|
2369
|
+
t[23] || (t[23] = e("span", { class: "artifactuse-panel__list-item-arrow" }, [
|
|
2370
|
+
e("svg", {
|
|
2371
|
+
viewBox: "0 0 24 24",
|
|
2372
|
+
fill: "none",
|
|
2373
|
+
stroke: "currentColor",
|
|
2374
|
+
"stroke-width": "2"
|
|
2375
|
+
}, [
|
|
2376
|
+
e("polyline", { points: "9 18 15 12 9 6" })
|
|
2377
|
+
])
|
|
2378
|
+
], -1))
|
|
2379
|
+
], 8, Sl))), 128))
|
|
2380
|
+
])
|
|
2381
|
+
]),
|
|
2382
|
+
e("footer", Rl, [
|
|
2383
|
+
G.value ? (a(), s("a", ql, [...t[24] || (t[24] = [
|
|
2384
|
+
e("svg", {
|
|
2385
|
+
width: "16",
|
|
2386
|
+
height: "16",
|
|
2387
|
+
viewBox: "0 0 42 42",
|
|
2388
|
+
fill: "none",
|
|
2389
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
2390
|
+
}, [
|
|
2391
|
+
e("path", {
|
|
2392
|
+
d: "M16.6667 41.6673V10.4173C16.6667 9.86478 16.4472 9.33488 16.0565 8.94418C15.6658 8.55348 15.1359 8.33398 14.5833 8.33398H4.16667C3.0616 8.33398 2.00179 8.77297 1.22039 9.55437C0.438987 10.3358 0 11.3956 0 12.5007V37.5006C0 38.6057 0.438987 39.6655 1.22039 40.4469C2.00179 41.2283 3.0616 41.6673 4.16667 41.6673H29.1667C30.2717 41.6673 31.3315 41.2283 32.1129 40.4469C32.8943 39.6655 33.3333 38.6057 33.3333 37.5006V27.084C33.3333 26.5314 33.1138 26.0015 32.7231 25.6108C32.3324 25.2201 31.8025 25.0007 31.25 25.0007H0",
|
|
2393
|
+
fill: "#5F51C8"
|
|
2394
|
+
}),
|
|
2395
|
+
e("path", {
|
|
2396
|
+
d: "M39.5833 0H27.0833C25.9327 0 25 0.93274 25 2.08333V14.5833C25 15.7339 25.9327 16.6667 27.0833 16.6667H39.5833C40.7339 16.6667 41.6667 15.7339 41.6667 14.5833V2.08333C41.6667 0.93274 40.7339 0 39.5833 0Z",
|
|
2397
|
+
fill: "#695AE0"
|
|
2398
|
+
})
|
|
2399
|
+
], -1),
|
|
2400
|
+
e("span", null, "Artifactuse", -1)
|
|
2401
|
+
])])) : v("", !0)
|
|
2402
|
+
])
|
|
2403
|
+
], 64)) : (a(), s(R, { key: 3 }, [
|
|
2404
|
+
e("header", Ol, [
|
|
2405
|
+
Te.value || k.value ? (a(), s("button", {
|
|
2176
2406
|
key: 0,
|
|
2177
2407
|
class: "artifactuse-panel__back",
|
|
2178
|
-
title: "Back to list",
|
|
2179
|
-
onClick:
|
|
2180
|
-
}, [...t[
|
|
2408
|
+
title: Te.value ? "Browse artifacts" : "Back to list",
|
|
2409
|
+
onClick: ht
|
|
2410
|
+
}, [...t[25] || (t[25] = [
|
|
2181
2411
|
e("svg", {
|
|
2182
2412
|
viewBox: "0 0 24 24",
|
|
2183
2413
|
fill: "none",
|
|
@@ -2186,30 +2416,30 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2186
2416
|
}, [
|
|
2187
2417
|
e("polyline", { points: "15 18 9 12 15 6" })
|
|
2188
2418
|
], -1)
|
|
2189
|
-
])])) : v("", !0),
|
|
2190
|
-
e("div",
|
|
2419
|
+
])], 8, Ul)) : v("", !0),
|
|
2420
|
+
e("div", Dl, [
|
|
2191
2421
|
e("span", {
|
|
2192
2422
|
class: "artifactuse-panel__icon",
|
|
2193
2423
|
innerHTML: te.value
|
|
2194
|
-
}, null, 8,
|
|
2195
|
-
e("div",
|
|
2196
|
-
e("span",
|
|
2197
|
-
e("span",
|
|
2424
|
+
}, null, 8, Nl),
|
|
2425
|
+
e("div", jl, [
|
|
2426
|
+
e("span", Wl, l(y(o).title || "Untitled"), 1),
|
|
2427
|
+
e("span", Jl, [
|
|
2198
2428
|
K(l(D.value) + " ", 1),
|
|
2199
|
-
|
|
2200
|
-
K(" • " + l(
|
|
2429
|
+
y(o).lineCount ? (a(), s(R, { key: 0 }, [
|
|
2430
|
+
K(" • " + l(y(o).lineCount) + " lines ", 1)
|
|
2201
2431
|
], 64)) : v("", !0)
|
|
2202
2432
|
])
|
|
2203
2433
|
])
|
|
2204
2434
|
]),
|
|
2205
|
-
e("div",
|
|
2206
|
-
!
|
|
2435
|
+
e("div", Xl, [
|
|
2436
|
+
!y(o).tabs || y(o).tabs.includes("preview") ? (a(), s("button", {
|
|
2207
2437
|
key: 0,
|
|
2208
|
-
class:
|
|
2209
|
-
disabled: !
|
|
2438
|
+
class: j(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": y(f).viewMode === "preview" }]),
|
|
2439
|
+
disabled: !y(o).isPreviewable,
|
|
2210
2440
|
title: "Preview",
|
|
2211
|
-
onClick: t[2] || (t[2] = (
|
|
2212
|
-
}, [...t[
|
|
2441
|
+
onClick: t[2] || (t[2] = (p) => y(h)("preview"))
|
|
2442
|
+
}, [...t[26] || (t[26] = [
|
|
2213
2443
|
e("svg", {
|
|
2214
2444
|
viewBox: "0 0 24 24",
|
|
2215
2445
|
fill: "none",
|
|
@@ -2223,13 +2453,13 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2223
2453
|
r: "3"
|
|
2224
2454
|
})
|
|
2225
2455
|
], -1)
|
|
2226
|
-
])], 10,
|
|
2227
|
-
!
|
|
2456
|
+
])], 10, Zl)) : v("", !0),
|
|
2457
|
+
!y(o).tabs || y(o).tabs.includes("code") ? (a(), s("button", {
|
|
2228
2458
|
key: 1,
|
|
2229
|
-
class:
|
|
2459
|
+
class: j(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": y(f).viewMode === "code" }]),
|
|
2230
2460
|
title: "Code",
|
|
2231
|
-
onClick: t[3] || (t[3] = (
|
|
2232
|
-
}, [...t[
|
|
2461
|
+
onClick: t[3] || (t[3] = (p) => y(h)("code"))
|
|
2462
|
+
}, [...t[27] || (t[27] = [
|
|
2233
2463
|
e("svg", {
|
|
2234
2464
|
viewBox: "0 0 24 24",
|
|
2235
2465
|
fill: "none",
|
|
@@ -2240,13 +2470,13 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2240
2470
|
e("polyline", { points: "8 6 2 12 8 18" })
|
|
2241
2471
|
], -1)
|
|
2242
2472
|
])], 2)) : v("", !0),
|
|
2243
|
-
!
|
|
2473
|
+
!y(o).tabs || y(o).tabs.includes("split") ? (a(), s("button", {
|
|
2244
2474
|
key: 2,
|
|
2245
|
-
class:
|
|
2246
|
-
disabled: !
|
|
2475
|
+
class: j(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": y(f).viewMode === "split" }]),
|
|
2476
|
+
disabled: !y(o).isPreviewable,
|
|
2247
2477
|
title: "Split view",
|
|
2248
|
-
onClick: t[4] || (t[4] = (
|
|
2249
|
-
}, [...t[
|
|
2478
|
+
onClick: t[4] || (t[4] = (p) => y(h)("split"))
|
|
2479
|
+
}, [...t[28] || (t[28] = [
|
|
2250
2480
|
e("svg", {
|
|
2251
2481
|
viewBox: "0 0 24 24",
|
|
2252
2482
|
fill: "none",
|
|
@@ -2268,13 +2498,13 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2268
2498
|
y2: "21"
|
|
2269
2499
|
})
|
|
2270
2500
|
], -1)
|
|
2271
|
-
])], 10,
|
|
2272
|
-
|
|
2501
|
+
])], 10, Kl)) : v("", !0),
|
|
2502
|
+
y(o).tabs && y(o).tabs.includes("edit") && Pe.value ? (a(), s("button", {
|
|
2273
2503
|
key: 3,
|
|
2274
|
-
class:
|
|
2504
|
+
class: j(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": y(f).viewMode === "edit" }]),
|
|
2275
2505
|
title: "Edit",
|
|
2276
|
-
onClick: t[5] || (t[5] = (
|
|
2277
|
-
}, [...t[
|
|
2506
|
+
onClick: t[5] || (t[5] = (p) => y(h)("edit"))
|
|
2507
|
+
}, [...t[29] || (t[29] = [
|
|
2278
2508
|
e("svg", {
|
|
2279
2509
|
viewBox: "0 0 24 24",
|
|
2280
2510
|
fill: "none",
|
|
@@ -2286,13 +2516,13 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2286
2516
|
], -1)
|
|
2287
2517
|
])], 2)) : v("", !0)
|
|
2288
2518
|
]),
|
|
2289
|
-
e("div",
|
|
2290
|
-
|
|
2519
|
+
e("div", Yl, [
|
|
2520
|
+
y(f).viewMode === "edit" ? (a(), s("button", {
|
|
2291
2521
|
key: 0,
|
|
2292
2522
|
class: "artifactuse-panel__action artifactuse-panel__action--save",
|
|
2293
2523
|
title: "Save",
|
|
2294
|
-
onClick:
|
|
2295
|
-
}, [...t[
|
|
2524
|
+
onClick: wt
|
|
2525
|
+
}, [...t[30] || (t[30] = [
|
|
2296
2526
|
e("svg", {
|
|
2297
2527
|
viewBox: "0 0 24 24",
|
|
2298
2528
|
fill: "none",
|
|
@@ -2306,10 +2536,10 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2306
2536
|
])])) : v("", !0),
|
|
2307
2537
|
e("button", {
|
|
2308
2538
|
class: "artifactuse-panel__action",
|
|
2309
|
-
title:
|
|
2310
|
-
onClick: t[6] || (t[6] = (...
|
|
2539
|
+
title: y(f).isFullscreen ? "Exit fullscreen" : "Fullscreen",
|
|
2540
|
+
onClick: t[6] || (t[6] = (...p) => y(n) && y(n)(...p))
|
|
2311
2541
|
}, [
|
|
2312
|
-
|
|
2542
|
+
y(f).isFullscreen ? (a(), s("svg", en, [...t[32] || (t[32] = [
|
|
2313
2543
|
e("polyline", { points: "4 14 10 14 10 20" }, null, -1),
|
|
2314
2544
|
e("polyline", { points: "20 10 14 10 14 4" }, null, -1),
|
|
2315
2545
|
e("line", {
|
|
@@ -2324,7 +2554,7 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2324
2554
|
x2: "10",
|
|
2325
2555
|
y2: "14"
|
|
2326
2556
|
}, null, -1)
|
|
2327
|
-
])])) : (a(), s("svg",
|
|
2557
|
+
])])) : (a(), s("svg", Gl, [...t[31] || (t[31] = [
|
|
2328
2558
|
e("polyline", { points: "15 3 21 3 21 9" }, null, -1),
|
|
2329
2559
|
e("polyline", { points: "9 21 3 21 3 15" }, null, -1),
|
|
2330
2560
|
e("line", {
|
|
@@ -2340,12 +2570,12 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2340
2570
|
y2: "14"
|
|
2341
2571
|
}, null, -1)
|
|
2342
2572
|
])]))
|
|
2343
|
-
], 8,
|
|
2573
|
+
], 8, Ql),
|
|
2344
2574
|
e("button", {
|
|
2345
2575
|
class: "artifactuse-panel__action artifactuse-panel__action--close",
|
|
2346
2576
|
title: "Close panel",
|
|
2347
|
-
onClick: t[7] || (t[7] = (...
|
|
2348
|
-
}, [...t[
|
|
2577
|
+
onClick: t[7] || (t[7] = (...p) => y(g) && y(g)(...p))
|
|
2578
|
+
}, [...t[33] || (t[33] = [
|
|
2349
2579
|
e("svg", {
|
|
2350
2580
|
viewBox: "0 0 24 24",
|
|
2351
2581
|
fill: "none",
|
|
@@ -2368,37 +2598,80 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2368
2598
|
])])
|
|
2369
2599
|
])
|
|
2370
2600
|
]),
|
|
2601
|
+
Te.value && Je.value.length > 0 ? (a(), s("div", tn, [
|
|
2602
|
+
e("div", an, [
|
|
2603
|
+
(a(!0), s(R, null, ve(Je.value, (p) => {
|
|
2604
|
+
var F;
|
|
2605
|
+
return a(), s("button", {
|
|
2606
|
+
key: p.id,
|
|
2607
|
+
class: j(["artifactuse-panel__file-tab", { "artifactuse-panel__file-tab--active": p.id === ((F = y(o)) == null ? void 0 : F.id) }]),
|
|
2608
|
+
onClick: (J) => pt(p)
|
|
2609
|
+
}, [
|
|
2610
|
+
e("span", {
|
|
2611
|
+
class: "artifactuse-panel__file-tab-icon",
|
|
2612
|
+
innerHTML: Ie(p.language)
|
|
2613
|
+
}, null, 8, ln),
|
|
2614
|
+
e("span", nn, l(p.title || "Untitled"), 1),
|
|
2615
|
+
e("button", {
|
|
2616
|
+
class: "artifactuse-panel__file-tab-close",
|
|
2617
|
+
title: "Close tab",
|
|
2618
|
+
onClick: he((J) => _t(p.id), ["stop"])
|
|
2619
|
+
}, [...t[34] || (t[34] = [
|
|
2620
|
+
e("svg", {
|
|
2621
|
+
viewBox: "0 0 24 24",
|
|
2622
|
+
fill: "none",
|
|
2623
|
+
stroke: "currentColor",
|
|
2624
|
+
"stroke-width": "2"
|
|
2625
|
+
}, [
|
|
2626
|
+
e("line", {
|
|
2627
|
+
x1: "18",
|
|
2628
|
+
y1: "6",
|
|
2629
|
+
x2: "6",
|
|
2630
|
+
y2: "18"
|
|
2631
|
+
}),
|
|
2632
|
+
e("line", {
|
|
2633
|
+
x1: "6",
|
|
2634
|
+
y1: "6",
|
|
2635
|
+
x2: "18",
|
|
2636
|
+
y2: "18"
|
|
2637
|
+
})
|
|
2638
|
+
], -1)
|
|
2639
|
+
])], 8, on)
|
|
2640
|
+
], 10, sn);
|
|
2641
|
+
}), 128))
|
|
2642
|
+
])
|
|
2643
|
+
])) : v("", !0),
|
|
2371
2644
|
e("div", {
|
|
2372
2645
|
ref_key: "contentRef",
|
|
2373
2646
|
ref: W,
|
|
2374
|
-
class:
|
|
2375
|
-
`artifactuse-panel__content--${
|
|
2376
|
-
{ "artifactuse-panel__content--transitioning":
|
|
2647
|
+
class: j(["artifactuse-panel__content", [
|
|
2648
|
+
`artifactuse-panel__content--${y(f).viewMode}`,
|
|
2649
|
+
{ "artifactuse-panel__content--transitioning": m.value }
|
|
2377
2650
|
]])
|
|
2378
2651
|
}, [
|
|
2379
|
-
|
|
2652
|
+
m.value ? (a(), s("div", rn, [...t[35] || (t[35] = [
|
|
2380
2653
|
e("div", { class: "artifactuse-panel__spinner" }, null, -1)
|
|
2381
2654
|
])])) : v("", !0),
|
|
2382
|
-
|
|
2655
|
+
y(f).viewMode === "preview" || y(f).viewMode === "split" ? (a(), s("div", {
|
|
2383
2656
|
key: 1,
|
|
2384
2657
|
class: "artifactuse-panel__preview",
|
|
2385
|
-
style:
|
|
2658
|
+
style: He(y(f).viewMode === "split" ? { width: `${V.value}%` } : void 0)
|
|
2386
2659
|
}, [
|
|
2387
|
-
oe.value && A.value ? (a(), s("div",
|
|
2660
|
+
oe.value && A.value ? (a(), s("div", cn, [...t[36] || (t[36] = [
|
|
2388
2661
|
e("div", { class: "artifactuse-panel__spinner" }, null, -1)
|
|
2389
2662
|
])])) : v("", !0),
|
|
2390
2663
|
A.value ? (a(), s("iframe", {
|
|
2391
2664
|
key: 1,
|
|
2392
2665
|
ref_key: "iframeRef",
|
|
2393
|
-
ref:
|
|
2666
|
+
ref: N,
|
|
2394
2667
|
src: A.value,
|
|
2395
|
-
class:
|
|
2668
|
+
class: j(["artifactuse-panel__iframe", { "artifactuse-panel__iframe--loading": oe.value }]),
|
|
2396
2669
|
sandbox: "allow-scripts allow-same-origin allow-forms allow-popups allow-modals allow-downloads allow-top-navigation-by-user-activation",
|
|
2397
2670
|
allow: "camera; microphone; fullscreen; geolocation; display-capture; autoplay; clipboard-write",
|
|
2398
|
-
onLoad:
|
|
2399
|
-
onError:
|
|
2400
|
-
}, null, 42,
|
|
2401
|
-
t[
|
|
2671
|
+
onLoad: bt,
|
|
2672
|
+
onError: Ct
|
|
2673
|
+
}, null, 42, un)) : (a(), s("div", dn, [
|
|
2674
|
+
t[37] || (t[37] = e("svg", {
|
|
2402
2675
|
viewBox: "0 0 24 24",
|
|
2403
2676
|
fill: "none",
|
|
2404
2677
|
stroke: "currentColor",
|
|
@@ -2416,22 +2689,22 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2416
2689
|
e("p", null, "Preview not available for " + l(D.value), 1)
|
|
2417
2690
|
]))
|
|
2418
2691
|
], 4)) : v("", !0),
|
|
2419
|
-
|
|
2692
|
+
lt(e("div", {
|
|
2420
2693
|
class: "artifactuse-panel__code",
|
|
2421
|
-
style:
|
|
2694
|
+
style: He(y(f).viewMode === "split" ? { width: `${100 - V.value}%` } : void 0)
|
|
2422
2695
|
}, [
|
|
2423
|
-
|
|
2696
|
+
y(f).viewMode === "split" ? (a(), s("div", {
|
|
2424
2697
|
key: 0,
|
|
2425
2698
|
class: "artifactuse-panel__split-handle",
|
|
2426
|
-
onMousedown:
|
|
2427
|
-
}, [...t[
|
|
2699
|
+
onMousedown: he(qt, ["prevent"])
|
|
2700
|
+
}, [...t[38] || (t[38] = [
|
|
2428
2701
|
e("div", { class: "artifactuse-panel__split-handle-line" }, null, -1)
|
|
2429
2702
|
])], 32)) : v("", !0),
|
|
2430
2703
|
e("div", {
|
|
2431
2704
|
class: "artifactuse-panel__code-scroll",
|
|
2432
2705
|
ref_key: "codeScrollRef",
|
|
2433
|
-
ref:
|
|
2434
|
-
onScroll:
|
|
2706
|
+
ref: S,
|
|
2707
|
+
onScroll: zt
|
|
2435
2708
|
}, [
|
|
2436
2709
|
e("div", {
|
|
2437
2710
|
class: "artifactuse-panel__line-numbers",
|
|
@@ -2439,32 +2712,32 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2439
2712
|
ref: Y
|
|
2440
2713
|
}, null, 512),
|
|
2441
2714
|
e("pre", {
|
|
2442
|
-
class:
|
|
2715
|
+
class: j(["artifactuse-panel__code-block", `language-${ae.value}`])
|
|
2443
2716
|
}, [
|
|
2444
2717
|
(a(), s("code", {
|
|
2445
2718
|
ref_key: "codeRef",
|
|
2446
|
-
ref:
|
|
2447
|
-
key:
|
|
2448
|
-
class:
|
|
2719
|
+
ref: O,
|
|
2720
|
+
key: y(o).id,
|
|
2721
|
+
class: j(`language-${ae.value}`)
|
|
2449
2722
|
}, null, 2))
|
|
2450
2723
|
], 2)
|
|
2451
2724
|
], 544)
|
|
2452
2725
|
], 4), [
|
|
2453
|
-
[
|
|
2726
|
+
[nt, y(f).viewMode === "code" || y(f).viewMode === "split"]
|
|
2454
2727
|
]),
|
|
2455
|
-
|
|
2728
|
+
lt(e("div", vn, [
|
|
2456
2729
|
e("div", {
|
|
2457
2730
|
ref_key: "editorContainerRef",
|
|
2458
2731
|
ref: ie,
|
|
2459
2732
|
class: "artifactuse-panel__editor-container"
|
|
2460
2733
|
}, null, 512)
|
|
2461
2734
|
], 512), [
|
|
2462
|
-
[
|
|
2735
|
+
[nt, y(f).viewMode === "edit"]
|
|
2463
2736
|
])
|
|
2464
2737
|
], 2),
|
|
2465
|
-
e("footer",
|
|
2466
|
-
e("div",
|
|
2467
|
-
G.value ? (a(), s("a",
|
|
2738
|
+
e("footer", fn, [
|
|
2739
|
+
e("div", pn, [
|
|
2740
|
+
G.value ? (a(), s("a", _n, [...t[39] || (t[39] = [
|
|
2468
2741
|
e("svg", {
|
|
2469
2742
|
width: "16",
|
|
2470
2743
|
height: "16",
|
|
@@ -2483,17 +2756,17 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2483
2756
|
], -1),
|
|
2484
2757
|
e("span", null, "Artifactuse", -1)
|
|
2485
2758
|
])])) : v("", !0),
|
|
2486
|
-
|
|
2759
|
+
y(o).size ? (a(), s("span", hn, l(y(ct)(y(o).size)), 1)) : v("", !0)
|
|
2487
2760
|
]),
|
|
2488
|
-
e("div",
|
|
2761
|
+
e("div", mn, [
|
|
2489
2762
|
e("button", {
|
|
2490
|
-
class:
|
|
2491
|
-
title:
|
|
2492
|
-
onClick:
|
|
2763
|
+
class: j(["artifactuse-panel__footer-action", { "artifactuse-panel__footer-action--success": Z.value }]),
|
|
2764
|
+
title: Z.value ? "Copied!" : "Copy code",
|
|
2765
|
+
onClick: $t
|
|
2493
2766
|
}, [
|
|
2494
|
-
|
|
2767
|
+
Z.value ? (a(), s("svg", kn, [...t[41] || (t[41] = [
|
|
2495
2768
|
e("polyline", { points: "20 6 9 17 4 12" }, null, -1)
|
|
2496
|
-
])])) : (a(), s("svg",
|
|
2769
|
+
])])) : (a(), s("svg", gn, [...t[40] || (t[40] = [
|
|
2497
2770
|
e("rect", {
|
|
2498
2771
|
x: "9",
|
|
2499
2772
|
y: "9",
|
|
@@ -2504,12 +2777,12 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2504
2777
|
}, null, -1),
|
|
2505
2778
|
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)
|
|
2506
2779
|
])]))
|
|
2507
|
-
], 10,
|
|
2780
|
+
], 10, yn),
|
|
2508
2781
|
e("button", {
|
|
2509
2782
|
class: "artifactuse-panel__footer-action",
|
|
2510
2783
|
title: "Download file",
|
|
2511
|
-
onClick:
|
|
2512
|
-
}, [...t[
|
|
2784
|
+
onClick: Mt
|
|
2785
|
+
}, [...t[42] || (t[42] = [
|
|
2513
2786
|
e("svg", {
|
|
2514
2787
|
viewBox: "0 0 24 24",
|
|
2515
2788
|
fill: "none",
|
|
@@ -2526,12 +2799,12 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2526
2799
|
})
|
|
2527
2800
|
], -1)
|
|
2528
2801
|
])]),
|
|
2529
|
-
ce.value ? (a(), s("div",
|
|
2802
|
+
ce.value ? (a(), s("div", wn, [
|
|
2530
2803
|
e("button", {
|
|
2531
2804
|
class: "artifactuse-panel__footer-action",
|
|
2532
2805
|
title: "Share",
|
|
2533
|
-
onClick:
|
|
2534
|
-
}, [...t[
|
|
2806
|
+
onClick: Lt
|
|
2807
|
+
}, [...t[43] || (t[43] = [
|
|
2535
2808
|
e("svg", {
|
|
2536
2809
|
viewBox: "0 0 24 24",
|
|
2537
2810
|
fill: "none",
|
|
@@ -2567,15 +2840,15 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2567
2840
|
})
|
|
2568
2841
|
], -1)
|
|
2569
2842
|
])]),
|
|
2570
|
-
|
|
2571
|
-
default:
|
|
2572
|
-
re.value ? (a(), s("div",
|
|
2573
|
-
e("div",
|
|
2574
|
-
e("span",
|
|
2843
|
+
ze(Ee, { name: "artifactuse-popup" }, {
|
|
2844
|
+
default: Be(() => [
|
|
2845
|
+
re.value ? (a(), s("div", bn, [
|
|
2846
|
+
e("div", Cn, [
|
|
2847
|
+
e("span", xn, l(P.value === "success" ? le.value ? "Artifact updated!" : "Link created!" : P.value === "update-list" ? "Update saved artifact" : "Share Artifact"), 1),
|
|
2575
2848
|
e("button", {
|
|
2576
2849
|
class: "artifactuse-share-popup__close",
|
|
2577
|
-
onClick:
|
|
2578
|
-
}, [...t[
|
|
2850
|
+
onClick: Pt
|
|
2851
|
+
}, [...t[44] || (t[44] = [
|
|
2579
2852
|
e("svg", {
|
|
2580
2853
|
viewBox: "0 0 24 24",
|
|
2581
2854
|
fill: "none",
|
|
@@ -2597,29 +2870,29 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2597
2870
|
], -1)
|
|
2598
2871
|
])])
|
|
2599
2872
|
]),
|
|
2600
|
-
e("div",
|
|
2601
|
-
P.value === "loading" ? (a(), s("div",
|
|
2873
|
+
e("div", $n, [
|
|
2874
|
+
P.value === "loading" ? (a(), s("div", Mn, [...t[45] || (t[45] = [
|
|
2602
2875
|
e("div", { class: "artifactuse-share-popup__spinner" }, null, -1),
|
|
2603
2876
|
e("p", { class: "artifactuse-share-popup__loading-text" }, "Creating link...", -1)
|
|
2604
|
-
])])) : P.value === "error" ? (a(), s("div",
|
|
2605
|
-
e("div",
|
|
2606
|
-
e("p",
|
|
2877
|
+
])])) : P.value === "error" ? (a(), s("div", Tn, [
|
|
2878
|
+
e("div", Ln, [
|
|
2879
|
+
e("p", Pn, l(L.value), 1)
|
|
2607
2880
|
]),
|
|
2608
|
-
e("div",
|
|
2881
|
+
e("div", An, [
|
|
2609
2882
|
e("button", {
|
|
2610
2883
|
class: "artifactuse-share-popup__btn artifactuse-share-popup__btn--secondary",
|
|
2611
|
-
onClick: t[8] || (t[8] = (
|
|
2884
|
+
onClick: t[8] || (t[8] = (p) => P.value = "options")
|
|
2612
2885
|
}, " Back "),
|
|
2613
2886
|
e("button", {
|
|
2614
2887
|
class: "artifactuse-share-popup__btn artifactuse-share-popup__btn--primary",
|
|
2615
|
-
onClick:
|
|
2888
|
+
onClick: At
|
|
2616
2889
|
}, " Retry ")
|
|
2617
2890
|
])
|
|
2618
|
-
])) : P.value === "options" ? (a(), s("div",
|
|
2891
|
+
])) : P.value === "options" ? (a(), s("div", Hn, [
|
|
2619
2892
|
e("button", {
|
|
2620
2893
|
class: "artifactuse-share-popup__option",
|
|
2621
|
-
onClick:
|
|
2622
|
-
}, [...t[
|
|
2894
|
+
onClick: Ye
|
|
2895
|
+
}, [...t[46] || (t[46] = [
|
|
2623
2896
|
e("div", { class: "artifactuse-share-popup__option-icon" }, [
|
|
2624
2897
|
e("svg", {
|
|
2625
2898
|
viewBox: "0 0 24 24",
|
|
@@ -2638,8 +2911,8 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2638
2911
|
])]),
|
|
2639
2912
|
e("button", {
|
|
2640
2913
|
class: "artifactuse-share-popup__option",
|
|
2641
|
-
onClick:
|
|
2642
|
-
}, [...t[
|
|
2914
|
+
onClick: Qe
|
|
2915
|
+
}, [...t[47] || (t[47] = [
|
|
2643
2916
|
e("div", { class: "artifactuse-share-popup__option-icon" }, [
|
|
2644
2917
|
e("svg", {
|
|
2645
2918
|
viewBox: "0 0 24 24",
|
|
@@ -2659,8 +2932,8 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2659
2932
|
])]),
|
|
2660
2933
|
e("button", {
|
|
2661
2934
|
class: "artifactuse-share-popup__option",
|
|
2662
|
-
onClick:
|
|
2663
|
-
}, [...t[
|
|
2935
|
+
onClick: Ht
|
|
2936
|
+
}, [...t[48] || (t[48] = [
|
|
2664
2937
|
e("div", { class: "artifactuse-share-popup__option-icon" }, [
|
|
2665
2938
|
e("svg", {
|
|
2666
2939
|
viewBox: "0 0 24 24",
|
|
@@ -2678,29 +2951,29 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2678
2951
|
e("p", { class: "artifactuse-share-popup__option-desc" }, "Replace an existing artifact")
|
|
2679
2952
|
], -1)
|
|
2680
2953
|
])])
|
|
2681
|
-
])) : P.value === "update-list" ? (a(), s("div",
|
|
2682
|
-
z.value ? (a(), s("div",
|
|
2954
|
+
])) : P.value === "update-list" ? (a(), s("div", En, [
|
|
2955
|
+
z.value ? (a(), s("div", Bn, [...t[49] || (t[49] = [
|
|
2683
2956
|
e("div", { class: "artifactuse-share-popup__spinner" }, null, -1),
|
|
2684
2957
|
e("p", { class: "artifactuse-share-popup__loading-text" }, "Loading artifacts...", -1)
|
|
2685
|
-
])])) :
|
|
2686
|
-
(a(!0), s(R, null, ve(
|
|
2687
|
-
var
|
|
2958
|
+
])])) : u.value.length === 0 ? (a(), s("div", Sn, " No saved artifacts of this type ")) : (a(), s("div", zn, [
|
|
2959
|
+
(a(!0), s(R, null, ve(u.value, (p) => {
|
|
2960
|
+
var F, J, me;
|
|
2688
2961
|
return a(), s("button", {
|
|
2689
|
-
key: ((
|
|
2962
|
+
key: ((F = p.project) == null ? void 0 : F.uuid) || p.id,
|
|
2690
2963
|
class: "artifactuse-share-popup__artifact-item",
|
|
2691
|
-
onClick: (ue) =>
|
|
2964
|
+
onClick: (ue) => Et(p)
|
|
2692
2965
|
}, [
|
|
2693
|
-
e("span",
|
|
2694
|
-
e("span",
|
|
2695
|
-
], 8,
|
|
2966
|
+
e("span", In, l(((J = p.project) == null ? void 0 : J.name) || "Untitled"), 1),
|
|
2967
|
+
e("span", Fn, l(Ke((me = p.project) == null ? void 0 : me.created_at)), 1)
|
|
2968
|
+
], 8, Vn);
|
|
2696
2969
|
}), 128))
|
|
2697
2970
|
])),
|
|
2698
2971
|
e("button", {
|
|
2699
2972
|
class: "artifactuse-share-popup__back-btn",
|
|
2700
|
-
onClick: t[9] || (t[9] = (
|
|
2973
|
+
onClick: t[9] || (t[9] = (p) => P.value = "options")
|
|
2701
2974
|
}, "Back")
|
|
2702
|
-
])) : P.value === "success" ? (a(), s("div",
|
|
2703
|
-
t[
|
|
2975
|
+
])) : P.value === "success" ? (a(), s("div", Rn, [
|
|
2976
|
+
t[52] || (t[52] = e("div", { class: "artifactuse-share-popup__success-icon" }, [
|
|
2704
2977
|
e("svg", {
|
|
2705
2978
|
viewBox: "0 0 24 24",
|
|
2706
2979
|
fill: "none",
|
|
@@ -2710,21 +2983,21 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2710
2983
|
e("polyline", { points: "20 6 9 17 4 12" })
|
|
2711
2984
|
])
|
|
2712
2985
|
], -1)),
|
|
2713
|
-
e("div",
|
|
2986
|
+
e("div", qn, [
|
|
2714
2987
|
e("input", {
|
|
2715
2988
|
type: "text",
|
|
2716
2989
|
class: "artifactuse-share-popup__link",
|
|
2717
2990
|
value: Q.value,
|
|
2718
2991
|
readonly: "",
|
|
2719
|
-
onClick: t[10] || (t[10] = (
|
|
2720
|
-
}, null, 8,
|
|
2992
|
+
onClick: t[10] || (t[10] = (p) => p.target.select())
|
|
2993
|
+
}, null, 8, On),
|
|
2721
2994
|
e("button", {
|
|
2722
|
-
class:
|
|
2723
|
-
onClick:
|
|
2724
|
-
}, l(
|
|
2995
|
+
class: j(["artifactuse-share-popup__copy-btn", { "artifactuse-share-popup__copy-btn--copied": r.value }]),
|
|
2996
|
+
onClick: Bt
|
|
2997
|
+
}, l(r.value ? "Copied!" : "Copy"), 3)
|
|
2725
2998
|
]),
|
|
2726
|
-
w.value && !B.value ? (a(), s("div",
|
|
2727
|
-
t[
|
|
2999
|
+
w.value && !B.value ? (a(), s("div", Un, [
|
|
3000
|
+
t[50] || (t[50] = e("span", { class: "artifactuse-share-popup__expiry-icon" }, [
|
|
2728
3001
|
e("svg", {
|
|
2729
3002
|
viewBox: "0 0 24 24",
|
|
2730
3003
|
fill: "none",
|
|
@@ -2750,18 +3023,18 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2750
3023
|
})
|
|
2751
3024
|
])
|
|
2752
3025
|
], -1)),
|
|
2753
|
-
e("span",
|
|
3026
|
+
e("span", Dn, " Expires " + l(Ke(w.value)), 1)
|
|
2754
3027
|
])) : v("", !0),
|
|
2755
|
-
B.value ? v("", !0) : (a(), s("div",
|
|
2756
|
-
t[
|
|
3028
|
+
B.value ? v("", !0) : (a(), s("div", Nn, [
|
|
3029
|
+
t[51] || (t[51] = e("p", { class: "artifactuse-share-popup__save-prompt-text" }, "Keep it permanently?", -1)),
|
|
2757
3030
|
e("button", {
|
|
2758
3031
|
class: "artifactuse-share-popup__save-prompt-btn",
|
|
2759
|
-
onClick:
|
|
3032
|
+
onClick: Qe
|
|
2760
3033
|
}, " Save to account ")
|
|
2761
3034
|
]))
|
|
2762
3035
|
])) : v("", !0)
|
|
2763
3036
|
]),
|
|
2764
|
-
t[
|
|
3037
|
+
t[53] || (t[53] = e("div", { class: "artifactuse-share-popup__footer" }, [
|
|
2765
3038
|
e("a", {
|
|
2766
3039
|
href: "https://artifactuse.com",
|
|
2767
3040
|
target: "_blank",
|
|
@@ -2796,8 +3069,8 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2796
3069
|
key: 1,
|
|
2797
3070
|
class: "artifactuse-panel__footer-action",
|
|
2798
3071
|
title: "Open in new tab",
|
|
2799
|
-
onClick:
|
|
2800
|
-
}, [...t[
|
|
3072
|
+
onClick: St
|
|
3073
|
+
}, [...t[54] || (t[54] = [
|
|
2801
3074
|
e("svg", {
|
|
2802
3075
|
viewBox: "0 0 24 24",
|
|
2803
3076
|
fill: "none",
|
|
@@ -2814,13 +3087,13 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2814
3087
|
})
|
|
2815
3088
|
], -1)
|
|
2816
3089
|
])])) : v("", !0),
|
|
2817
|
-
|
|
3090
|
+
!Te.value && d.value.length > 1 ? (a(), s("div", jn, [
|
|
2818
3091
|
e("button", {
|
|
2819
3092
|
class: "artifactuse-panel__nav-btn",
|
|
2820
|
-
disabled:
|
|
3093
|
+
disabled: U.value <= 0,
|
|
2821
3094
|
title: "Previous artifact",
|
|
2822
|
-
onClick:
|
|
2823
|
-
}, [...t[
|
|
3095
|
+
onClick: It
|
|
3096
|
+
}, [...t[55] || (t[55] = [
|
|
2824
3097
|
e("svg", {
|
|
2825
3098
|
viewBox: "0 0 24 24",
|
|
2826
3099
|
fill: "none",
|
|
@@ -2829,14 +3102,14 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2829
3102
|
}, [
|
|
2830
3103
|
e("polyline", { points: "15 18 9 12 15 6" })
|
|
2831
3104
|
], -1)
|
|
2832
|
-
])], 8,
|
|
3105
|
+
])], 8, Wn),
|
|
2833
3106
|
e("button", {
|
|
2834
3107
|
class: "artifactuse-panel__nav-trigger",
|
|
2835
3108
|
title: "View all artifacts",
|
|
2836
|
-
onClick:
|
|
3109
|
+
onClick: Vt
|
|
2837
3110
|
}, [
|
|
2838
|
-
e("span", null, l(
|
|
2839
|
-
t[
|
|
3111
|
+
e("span", null, l(U.value + 1) + " / " + l(d.value.length), 1),
|
|
3112
|
+
t[56] || (t[56] = e("svg", {
|
|
2840
3113
|
viewBox: "0 0 24 24",
|
|
2841
3114
|
fill: "none",
|
|
2842
3115
|
stroke: "currentColor",
|
|
@@ -2847,10 +3120,10 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2847
3120
|
]),
|
|
2848
3121
|
e("button", {
|
|
2849
3122
|
class: "artifactuse-panel__nav-btn",
|
|
2850
|
-
disabled:
|
|
3123
|
+
disabled: U.value >= d.value.length - 1,
|
|
2851
3124
|
title: "Next artifact",
|
|
2852
|
-
onClick:
|
|
2853
|
-
}, [...t[
|
|
3125
|
+
onClick: Ft
|
|
3126
|
+
}, [...t[57] || (t[57] = [
|
|
2854
3127
|
e("svg", {
|
|
2855
3128
|
viewBox: "0 0 24 24",
|
|
2856
3129
|
fill: "none",
|
|
@@ -2859,16 +3132,16 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2859
3132
|
}, [
|
|
2860
3133
|
e("polyline", { points: "9 18 15 12 9 6" })
|
|
2861
3134
|
], -1)
|
|
2862
|
-
])], 8,
|
|
2863
|
-
|
|
2864
|
-
default:
|
|
2865
|
-
|
|
2866
|
-
e("div",
|
|
2867
|
-
t[
|
|
3135
|
+
])], 8, Jn),
|
|
3136
|
+
ze(Ee, { name: "artifactuse-popup" }, {
|
|
3137
|
+
default: Be(() => [
|
|
3138
|
+
X.value ? (a(), s("div", Xn, [
|
|
3139
|
+
e("div", Zn, [
|
|
3140
|
+
t[59] || (t[59] = e("span", null, "Artifacts", -1)),
|
|
2868
3141
|
e("button", {
|
|
2869
3142
|
class: "artifactuse-panel__artifact-list-close",
|
|
2870
|
-
onClick: t[11] || (t[11] = (
|
|
2871
|
-
}, [...t[
|
|
3143
|
+
onClick: t[11] || (t[11] = (p) => X.value = !1)
|
|
3144
|
+
}, [...t[58] || (t[58] = [
|
|
2872
3145
|
e("svg", {
|
|
2873
3146
|
viewBox: "0 0 24 24",
|
|
2874
3147
|
fill: "none",
|
|
@@ -2890,27 +3163,27 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2890
3163
|
], -1)
|
|
2891
3164
|
])])
|
|
2892
3165
|
]),
|
|
2893
|
-
e("div",
|
|
2894
|
-
(a(!0), s(R, null, ve(
|
|
2895
|
-
key:
|
|
2896
|
-
class:
|
|
2897
|
-
onClick: (
|
|
3166
|
+
e("div", Kn, [
|
|
3167
|
+
(a(!0), s(R, null, ve(d.value, (p, F) => (a(), s("button", {
|
|
3168
|
+
key: p.id,
|
|
3169
|
+
class: j(["artifactuse-panel__artifact-item", { "artifactuse-panel__artifact-item--active": p.id === y(o).id }]),
|
|
3170
|
+
onClick: (J) => Ge(p)
|
|
2898
3171
|
}, [
|
|
2899
3172
|
e("span", {
|
|
2900
3173
|
class: "artifactuse-panel__artifact-item-icon",
|
|
2901
|
-
innerHTML:
|
|
2902
|
-
}, null, 8,
|
|
2903
|
-
e("div",
|
|
2904
|
-
e("span",
|
|
2905
|
-
e("span",
|
|
2906
|
-
K(l(
|
|
2907
|
-
|
|
2908
|
-
K(" • " + l(
|
|
3174
|
+
innerHTML: Ie(p.language)
|
|
3175
|
+
}, null, 8, Qn),
|
|
3176
|
+
e("div", Gn, [
|
|
3177
|
+
e("span", eo, l(p.title || "Untitled"), 1),
|
|
3178
|
+
e("span", to, [
|
|
3179
|
+
K(l(y(Se)(p.language)) + " ", 1),
|
|
3180
|
+
p.lineCount ? (a(), s(R, { key: 0 }, [
|
|
3181
|
+
K(" • " + l(p.lineCount) + " lines ", 1)
|
|
2909
3182
|
], 64)) : v("", !0)
|
|
2910
3183
|
])
|
|
2911
3184
|
]),
|
|
2912
|
-
e("span",
|
|
2913
|
-
], 10,
|
|
3185
|
+
e("span", ao, l(F + 1), 1)
|
|
3186
|
+
], 10, Yn))), 128))
|
|
2914
3187
|
])
|
|
2915
3188
|
])) : v("", !0)
|
|
2916
3189
|
]),
|
|
@@ -2919,236 +3192,28 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2919
3192
|
])) : v("", !0)
|
|
2920
3193
|
])
|
|
2921
3194
|
])
|
|
2922
|
-
], 64)) : (a(), s(R, { key: 2 }, [
|
|
2923
|
-
e("header", ul, [
|
|
2924
|
-
e("div", dl, [
|
|
2925
|
-
t[18] || (t[18] = e("span", { class: "artifactuse-panel__icon" }, [
|
|
2926
|
-
e("svg", {
|
|
2927
|
-
viewBox: "0 0 24 24",
|
|
2928
|
-
fill: "none",
|
|
2929
|
-
stroke: "currentColor",
|
|
2930
|
-
"stroke-width": "2"
|
|
2931
|
-
}, [
|
|
2932
|
-
e("polyline", { points: "16 18 22 12 16 6" }),
|
|
2933
|
-
e("polyline", { points: "8 6 2 12 8 18" })
|
|
2934
|
-
])
|
|
2935
|
-
], -1)),
|
|
2936
|
-
e("div", vl, [
|
|
2937
|
-
t[17] || (t[17] = e("span", { class: "artifactuse-panel__name" }, "Artifacts", -1)),
|
|
2938
|
-
e("span", fl, l(u.value.length) + " available", 1)
|
|
2939
|
-
])
|
|
2940
|
-
]),
|
|
2941
|
-
e("div", pl, [
|
|
2942
|
-
e("button", {
|
|
2943
|
-
class: N(["artifactuse-panel__action", { "artifactuse-panel__action--loading": ee.value }]),
|
|
2944
|
-
disabled: ee.value,
|
|
2945
|
-
title: "Download all as ZIP",
|
|
2946
|
-
onClick: Ct
|
|
2947
|
-
}, [
|
|
2948
|
-
ee.value ? (a(), s("svg", ml, [...t[20] || (t[20] = [
|
|
2949
|
-
e("circle", {
|
|
2950
|
-
cx: "12",
|
|
2951
|
-
cy: "12",
|
|
2952
|
-
r: "10",
|
|
2953
|
-
"stroke-dasharray": "32",
|
|
2954
|
-
"stroke-dashoffset": "32"
|
|
2955
|
-
}, null, -1)
|
|
2956
|
-
])])) : (a(), s("svg", _l, [...t[19] || (t[19] = [
|
|
2957
|
-
e("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }, null, -1),
|
|
2958
|
-
e("polyline", { points: "7 10 12 15 17 10" }, null, -1),
|
|
2959
|
-
e("line", {
|
|
2960
|
-
x1: "12",
|
|
2961
|
-
y1: "15",
|
|
2962
|
-
x2: "12",
|
|
2963
|
-
y2: "3"
|
|
2964
|
-
}, null, -1)
|
|
2965
|
-
])]))
|
|
2966
|
-
], 10, hl),
|
|
2967
|
-
e("button", {
|
|
2968
|
-
class: "artifactuse-panel__action artifactuse-panel__action--close",
|
|
2969
|
-
title: "Close panel",
|
|
2970
|
-
onClick: t[1] || (t[1] = (...y) => g(h) && g(h)(...y))
|
|
2971
|
-
}, [...t[21] || (t[21] = [
|
|
2972
|
-
e("svg", {
|
|
2973
|
-
viewBox: "0 0 24 24",
|
|
2974
|
-
fill: "none",
|
|
2975
|
-
stroke: "currentColor",
|
|
2976
|
-
"stroke-width": "2"
|
|
2977
|
-
}, [
|
|
2978
|
-
e("line", {
|
|
2979
|
-
x1: "18",
|
|
2980
|
-
y1: "6",
|
|
2981
|
-
x2: "6",
|
|
2982
|
-
y2: "18"
|
|
2983
|
-
}),
|
|
2984
|
-
e("line", {
|
|
2985
|
-
x1: "6",
|
|
2986
|
-
y1: "6",
|
|
2987
|
-
x2: "18",
|
|
2988
|
-
y2: "18"
|
|
2989
|
-
})
|
|
2990
|
-
], -1)
|
|
2991
|
-
])])
|
|
2992
|
-
])
|
|
2993
|
-
]),
|
|
2994
|
-
e("div", yl, [
|
|
2995
|
-
e("div", gl, [
|
|
2996
|
-
(a(!0), s(R, null, ve(u.value, (y, U) => (a(), s("button", {
|
|
2997
|
-
key: y.id,
|
|
2998
|
-
class: "artifactuse-panel__list-item",
|
|
2999
|
-
onClick: (Z) => Ke(y)
|
|
3000
|
-
}, [
|
|
3001
|
-
e("span", {
|
|
3002
|
-
class: "artifactuse-panel__list-item-icon",
|
|
3003
|
-
innerHTML: je(y.language)
|
|
3004
|
-
}, null, 8, wl),
|
|
3005
|
-
e("div", Cl, [
|
|
3006
|
-
e("span", bl, l(y.title || "Untitled"), 1),
|
|
3007
|
-
e("span", xl, [
|
|
3008
|
-
K(l(g(Se)(y.language)) + " ", 1),
|
|
3009
|
-
y.lineCount ? (a(), s(R, { key: 0 }, [
|
|
3010
|
-
K(" • " + l(y.lineCount) + " lines ", 1)
|
|
3011
|
-
], 64)) : v("", !0)
|
|
3012
|
-
])
|
|
3013
|
-
]),
|
|
3014
|
-
t[22] || (t[22] = e("span", { class: "artifactuse-panel__list-item-arrow" }, [
|
|
3015
|
-
e("svg", {
|
|
3016
|
-
viewBox: "0 0 24 24",
|
|
3017
|
-
fill: "none",
|
|
3018
|
-
stroke: "currentColor",
|
|
3019
|
-
"stroke-width": "2"
|
|
3020
|
-
}, [
|
|
3021
|
-
e("polyline", { points: "9 18 15 12 9 6" })
|
|
3022
|
-
])
|
|
3023
|
-
], -1))
|
|
3024
|
-
], 8, kl))), 128))
|
|
3025
|
-
])
|
|
3026
|
-
]),
|
|
3027
|
-
e("footer", $l, [
|
|
3028
|
-
G.value ? (a(), s("a", Ml, [...t[23] || (t[23] = [
|
|
3029
|
-
e("svg", {
|
|
3030
|
-
width: "16",
|
|
3031
|
-
height: "16",
|
|
3032
|
-
viewBox: "0 0 42 42",
|
|
3033
|
-
fill: "none",
|
|
3034
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
3035
|
-
}, [
|
|
3036
|
-
e("path", {
|
|
3037
|
-
d: "M16.6667 41.6673V10.4173C16.6667 9.86478 16.4472 9.33488 16.0565 8.94418C15.6658 8.55348 15.1359 8.33398 14.5833 8.33398H4.16667C3.0616 8.33398 2.00179 8.77297 1.22039 9.55437C0.438987 10.3358 0 11.3956 0 12.5007V37.5006C0 38.6057 0.438987 39.6655 1.22039 40.4469C2.00179 41.2283 3.0616 41.6673 4.16667 41.6673H29.1667C30.2717 41.6673 31.3315 41.2283 32.1129 40.4469C32.8943 39.6655 33.3333 38.6057 33.3333 37.5006V27.084C33.3333 26.5314 33.1138 26.0015 32.7231 25.6108C32.3324 25.2201 31.8025 25.0007 31.25 25.0007H0",
|
|
3038
|
-
fill: "#5F51C8"
|
|
3039
|
-
}),
|
|
3040
|
-
e("path", {
|
|
3041
|
-
d: "M39.5833 0H27.0833C25.9327 0 25 0.93274 25 2.08333V14.5833C25 15.7339 25.9327 16.6667 27.0833 16.6667H39.5833C40.7339 16.6667 41.6667 15.7339 41.6667 14.5833V2.08333C41.6667 0.93274 40.7339 0 39.5833 0Z",
|
|
3042
|
-
fill: "#695AE0"
|
|
3043
|
-
})
|
|
3044
|
-
], -1),
|
|
3045
|
-
e("span", null, "Artifactuse", -1)
|
|
3046
|
-
])])) : v("", !0)
|
|
3047
|
-
])
|
|
3048
|
-
], 64)) : (a(), s(R, { key: 1 }, [
|
|
3049
|
-
e("header", nl, [
|
|
3050
|
-
t[14] || (t[14] = e("div", { class: "artifactuse-panel__title" }, [
|
|
3051
|
-
e("span", { class: "artifactuse-panel__icon" }, [
|
|
3052
|
-
e("svg", {
|
|
3053
|
-
viewBox: "0 0 24 24",
|
|
3054
|
-
fill: "none",
|
|
3055
|
-
stroke: "currentColor",
|
|
3056
|
-
"stroke-width": "2"
|
|
3057
|
-
}, [
|
|
3058
|
-
e("polyline", { points: "16 18 22 12 16 6" }),
|
|
3059
|
-
e("polyline", { points: "8 6 2 12 8 18" })
|
|
3060
|
-
])
|
|
3061
|
-
]),
|
|
3062
|
-
e("div", { class: "artifactuse-panel__title-content" }, [
|
|
3063
|
-
e("span", { class: "artifactuse-panel__name" }, "Artifacts")
|
|
3064
|
-
])
|
|
3065
|
-
], -1)),
|
|
3066
|
-
e("div", ol, [
|
|
3067
|
-
e("button", {
|
|
3068
|
-
class: "artifactuse-panel__action artifactuse-panel__action--close",
|
|
3069
|
-
title: "Close panel",
|
|
3070
|
-
onClick: t[0] || (t[0] = (...y) => g(h) && g(h)(...y))
|
|
3071
|
-
}, [...t[13] || (t[13] = [
|
|
3072
|
-
e("svg", {
|
|
3073
|
-
viewBox: "0 0 24 24",
|
|
3074
|
-
fill: "none",
|
|
3075
|
-
stroke: "currentColor",
|
|
3076
|
-
"stroke-width": "2"
|
|
3077
|
-
}, [
|
|
3078
|
-
e("line", {
|
|
3079
|
-
x1: "18",
|
|
3080
|
-
y1: "6",
|
|
3081
|
-
x2: "6",
|
|
3082
|
-
y2: "18"
|
|
3083
|
-
}),
|
|
3084
|
-
e("line", {
|
|
3085
|
-
x1: "6",
|
|
3086
|
-
y1: "6",
|
|
3087
|
-
x2: "18",
|
|
3088
|
-
y2: "18"
|
|
3089
|
-
})
|
|
3090
|
-
], -1)
|
|
3091
|
-
])])
|
|
3092
|
-
])
|
|
3093
|
-
]),
|
|
3094
|
-
t[16] || (t[16] = e("div", { class: "artifactuse-panel__empty" }, [
|
|
3095
|
-
e("div", { class: "artifactuse-panel__empty-icon" }, [
|
|
3096
|
-
e("svg", {
|
|
3097
|
-
viewBox: "0 0 24 24",
|
|
3098
|
-
fill: "none",
|
|
3099
|
-
stroke: "currentColor",
|
|
3100
|
-
"stroke-width": "1.5"
|
|
3101
|
-
}, [
|
|
3102
|
-
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" }),
|
|
3103
|
-
e("polyline", { points: "14 2 14 8 20 8" })
|
|
3104
|
-
])
|
|
3105
|
-
]),
|
|
3106
|
-
e("h3", { class: "artifactuse-panel__empty-title" }, "No artifacts yet"),
|
|
3107
|
-
e("p", { class: "artifactuse-panel__empty-text" }, " Code blocks, forms, and other interactive content will appear here as the AI generates them. ")
|
|
3108
|
-
], -1)),
|
|
3109
|
-
e("footer", rl, [
|
|
3110
|
-
G.value ? (a(), s("a", cl, [...t[15] || (t[15] = [
|
|
3111
|
-
e("svg", {
|
|
3112
|
-
width: "16",
|
|
3113
|
-
height: "16",
|
|
3114
|
-
viewBox: "0 0 42 42",
|
|
3115
|
-
fill: "none",
|
|
3116
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
3117
|
-
}, [
|
|
3118
|
-
e("path", {
|
|
3119
|
-
d: "M16.6667 41.6673V10.4173C16.6667 9.86478 16.4472 9.33488 16.0565 8.94418C15.6658 8.55348 15.1359 8.33398 14.5833 8.33398H4.16667C3.0616 8.33398 2.00179 8.77297 1.22039 9.55437C0.438987 10.3358 0 11.3956 0 12.5007V37.5006C0 38.6057 0.438987 39.6655 1.22039 40.4469C2.00179 41.2283 3.0616 41.6673 4.16667 41.6673H29.1667C30.2717 41.6673 31.3315 41.2283 32.1129 40.4469C32.8943 39.6655 33.3333 38.6057 33.3333 37.5006V27.084C33.3333 26.5314 33.1138 26.0015 32.7231 25.6108C32.3324 25.2201 31.8025 25.0007 31.25 25.0007H0",
|
|
3120
|
-
fill: "#5F51C8"
|
|
3121
|
-
}),
|
|
3122
|
-
e("path", {
|
|
3123
|
-
d: "M39.5833 0H27.0833C25.9327 0 25 0.93274 25 2.08333V14.5833C25 15.7339 25.9327 16.6667 27.0833 16.6667H39.5833C40.7339 16.6667 41.6667 15.7339 41.6667 14.5833V2.08333C41.6667 0.93274 40.7339 0 39.5833 0Z",
|
|
3124
|
-
fill: "#695AE0"
|
|
3125
|
-
})
|
|
3126
|
-
], -1),
|
|
3127
|
-
e("span", null, "Artifactuse", -1)
|
|
3128
|
-
])])) : v("", !0)
|
|
3129
|
-
])
|
|
3130
3195
|
], 64))
|
|
3131
3196
|
], 6)) : v("", !0)
|
|
3132
3197
|
]),
|
|
3133
3198
|
_: 1
|
|
3134
3199
|
}));
|
|
3135
3200
|
}
|
|
3136
|
-
},
|
|
3201
|
+
}, so = ["title"], io = {
|
|
3137
3202
|
key: 0,
|
|
3138
3203
|
class: "artifactuse-panel-toggle-badge"
|
|
3139
|
-
},
|
|
3204
|
+
}, vo = {
|
|
3140
3205
|
__name: "ArtifactusePanelToggle",
|
|
3141
3206
|
setup(H) {
|
|
3142
|
-
const { state:
|
|
3143
|
-
return (
|
|
3144
|
-
class:
|
|
3145
|
-
"artifactuse-panel-toggle--active":
|
|
3146
|
-
"artifactuse-panel-toggle--has-artifacts":
|
|
3207
|
+
const { state: c, artifactCount: _, hasArtifacts: T, togglePanel: f } = Ve();
|
|
3208
|
+
return (o, q) => (a(), s("button", {
|
|
3209
|
+
class: j(["artifactuse-panel-toggle", {
|
|
3210
|
+
"artifactuse-panel-toggle--active": y(c).isPanelOpen,
|
|
3211
|
+
"artifactuse-panel-toggle--has-artifacts": y(T)
|
|
3147
3212
|
}]),
|
|
3148
|
-
onClick:
|
|
3149
|
-
title:
|
|
3213
|
+
onClick: q[0] || (q[0] = (...E) => y(f) && y(f)(...E)),
|
|
3214
|
+
title: y(c).isPanelOpen ? "Close artifacts panel" : "Open artifacts panel"
|
|
3150
3215
|
}, [
|
|
3151
|
-
|
|
3216
|
+
q[1] || (q[1] = e("svg", {
|
|
3152
3217
|
viewBox: "0 0 24 24",
|
|
3153
3218
|
fill: "none",
|
|
3154
3219
|
stroke: "currentColor",
|
|
@@ -3159,148 +3224,164 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
3159
3224
|
e("polyline", { points: "16 18 22 12 16 6" }),
|
|
3160
3225
|
e("polyline", { points: "8 6 2 12 8 18" })
|
|
3161
3226
|
], -1)),
|
|
3162
|
-
|
|
3163
|
-
], 10,
|
|
3227
|
+
y(_) > 0 ? (a(), s("span", io, l(y(_) > 99 ? "99+" : y(_)), 1)) : v("", !0)
|
|
3228
|
+
], 10, so));
|
|
3164
3229
|
}
|
|
3165
|
-
},
|
|
3166
|
-
function
|
|
3230
|
+
}, dt = Symbol("artifactuse");
|
|
3231
|
+
function vt(H = {}) {
|
|
3167
3232
|
var n;
|
|
3168
|
-
const
|
|
3233
|
+
const c = ut(H), _ = rt({
|
|
3169
3234
|
artifacts: [],
|
|
3170
3235
|
activeArtifactId: null,
|
|
3171
3236
|
isPanelOpen: !1,
|
|
3172
3237
|
viewMode: "preview",
|
|
3173
|
-
isFullscreen: !1
|
|
3238
|
+
isFullscreen: !1,
|
|
3239
|
+
openTabs: [],
|
|
3240
|
+
tabViewModes: {},
|
|
3241
|
+
forceEmptyView: !1
|
|
3174
3242
|
});
|
|
3175
|
-
|
|
3176
|
-
_.artifacts =
|
|
3243
|
+
c.state.subscribe((h) => {
|
|
3244
|
+
_.artifacts = h.artifacts, _.activeArtifactId = h.activeArtifactId, _.isPanelOpen = h.isPanelOpen, _.viewMode = h.viewMode, _.isFullscreen = h.isFullscreen, _.openTabs = h.openTabs, _.tabViewModes = h.tabViewModes, _.forceEmptyView = h.forceEmptyView;
|
|
3177
3245
|
});
|
|
3178
|
-
const
|
|
3179
|
-
if (
|
|
3180
|
-
const
|
|
3181
|
-
|
|
3182
|
-
|
|
3246
|
+
const T = 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(() => T.value ? c.getPanelUrl(T.value) : null);
|
|
3247
|
+
if (c.applyTheme(), H.theme === "auto" || !H.theme) {
|
|
3248
|
+
const h = ((n = c.bridge) == null ? void 0 : n.theme) || c.theme;
|
|
3249
|
+
h != null && h.watchSystemTheme && h.watchSystemTheme(() => {
|
|
3250
|
+
c.applyTheme();
|
|
3183
3251
|
});
|
|
3184
3252
|
}
|
|
3185
|
-
const
|
|
3186
|
-
instance:
|
|
3253
|
+
const g = {
|
|
3254
|
+
instance: c,
|
|
3187
3255
|
state: _,
|
|
3188
|
-
activeArtifact:
|
|
3189
|
-
artifactCount:
|
|
3190
|
-
hasArtifacts:
|
|
3256
|
+
activeArtifact: T,
|
|
3257
|
+
artifactCount: f,
|
|
3258
|
+
hasArtifacts: o,
|
|
3191
3259
|
// Panel computed
|
|
3192
|
-
panelTypes:
|
|
3193
|
-
activePanelUrl:
|
|
3260
|
+
panelTypes: q,
|
|
3261
|
+
activePanelUrl: E,
|
|
3194
3262
|
// Methods
|
|
3195
|
-
processMessage:
|
|
3196
|
-
initializeContent:
|
|
3197
|
-
openArtifact:
|
|
3198
|
-
openFile:
|
|
3199
|
-
openCode:
|
|
3200
|
-
updateFile:
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3263
|
+
processMessage: c.processMessage,
|
|
3264
|
+
initializeContent: c.initializeContent,
|
|
3265
|
+
openArtifact: c.openArtifact,
|
|
3266
|
+
openFile: c.openFile,
|
|
3267
|
+
openCode: c.openCode,
|
|
3268
|
+
updateFile: c.updateFile,
|
|
3269
|
+
openPanel: c.openPanel,
|
|
3270
|
+
closePanel: c.closePanel,
|
|
3271
|
+
togglePanel: c.togglePanel,
|
|
3272
|
+
toggleFullscreen: c.toggleFullscreen,
|
|
3273
|
+
setViewMode: c.setViewMode,
|
|
3274
|
+
getPanelUrl: c.getPanelUrl,
|
|
3275
|
+
sendToPanel: c.sendToPanel,
|
|
3207
3276
|
// Panel management
|
|
3208
|
-
hasPanel:
|
|
3209
|
-
registerPanel:
|
|
3210
|
-
unregisterPanel:
|
|
3211
|
-
getPanelTypes:
|
|
3277
|
+
hasPanel: c.hasPanel,
|
|
3278
|
+
registerPanel: c.registerPanel,
|
|
3279
|
+
unregisterPanel: c.unregisterPanel,
|
|
3280
|
+
getPanelTypes: c.getPanelTypes,
|
|
3281
|
+
// Multi-tab
|
|
3282
|
+
closeTab: c.closeTab,
|
|
3283
|
+
closeOtherTabs: c.closeOtherTabs,
|
|
3284
|
+
closeAllTabs: c.closeAllTabs,
|
|
3212
3285
|
// Events
|
|
3213
|
-
on:
|
|
3214
|
-
off:
|
|
3286
|
+
on: c.on,
|
|
3287
|
+
off: c.off,
|
|
3215
3288
|
// State management
|
|
3216
|
-
clearArtifacts: () =>
|
|
3289
|
+
clearArtifacts: () => c.state.clear(),
|
|
3217
3290
|
// Theme - wrap setTheme to also apply
|
|
3218
|
-
applyTheme:
|
|
3219
|
-
setTheme: (
|
|
3220
|
-
|
|
3291
|
+
applyTheme: c.applyTheme,
|
|
3292
|
+
setTheme: (h) => {
|
|
3293
|
+
c.setTheme(h), c.applyTheme();
|
|
3221
3294
|
},
|
|
3222
|
-
getTheme:
|
|
3295
|
+
getTheme: c.getTheme
|
|
3223
3296
|
};
|
|
3224
|
-
return
|
|
3297
|
+
return Wt(dt, g), g;
|
|
3225
3298
|
}
|
|
3226
|
-
function
|
|
3227
|
-
const H =
|
|
3228
|
-
return H || (console.warn("useArtifactuse() called without provideArtifactuse(). Creating standalone instance."),
|
|
3299
|
+
function Ve() {
|
|
3300
|
+
const H = Jt(dt);
|
|
3301
|
+
return H || (console.warn("useArtifactuse() called without provideArtifactuse(). Creating standalone instance."), vt());
|
|
3229
3302
|
}
|
|
3230
|
-
function
|
|
3231
|
-
const
|
|
3303
|
+
function lo(H = {}) {
|
|
3304
|
+
const c = ut(H), _ = rt({
|
|
3232
3305
|
artifacts: [],
|
|
3233
3306
|
activeArtifactId: null,
|
|
3234
3307
|
isPanelOpen: !1,
|
|
3235
3308
|
viewMode: "preview",
|
|
3236
|
-
isFullscreen: !1
|
|
3309
|
+
isFullscreen: !1,
|
|
3310
|
+
openTabs: [],
|
|
3311
|
+
tabViewModes: {},
|
|
3312
|
+
forceEmptyView: !1
|
|
3237
3313
|
});
|
|
3238
|
-
let
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
_.artifacts = n.artifacts, _.activeArtifactId = n.activeArtifactId, _.isPanelOpen = n.isPanelOpen, _.viewMode = n.viewMode, _.isFullscreen = n.isFullscreen;
|
|
3242
|
-
}),
|
|
3243
|
-
}),
|
|
3244
|
-
|
|
3314
|
+
let T;
|
|
3315
|
+
Me(() => {
|
|
3316
|
+
T = c.state.subscribe((n) => {
|
|
3317
|
+
_.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
|
+
}), c.applyTheme();
|
|
3319
|
+
}), We(() => {
|
|
3320
|
+
T && T(), c.destroy();
|
|
3245
3321
|
});
|
|
3246
|
-
const
|
|
3322
|
+
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);
|
|
3247
3323
|
return {
|
|
3248
|
-
instance:
|
|
3324
|
+
instance: c,
|
|
3249
3325
|
state: _,
|
|
3250
|
-
activeArtifact:
|
|
3251
|
-
artifactCount:
|
|
3252
|
-
hasArtifacts:
|
|
3326
|
+
activeArtifact: f,
|
|
3327
|
+
artifactCount: o,
|
|
3328
|
+
hasArtifacts: q,
|
|
3253
3329
|
// Panel computed
|
|
3254
|
-
panelTypes:
|
|
3255
|
-
activePanelUrl:
|
|
3330
|
+
panelTypes: E,
|
|
3331
|
+
activePanelUrl: g,
|
|
3256
3332
|
// Methods
|
|
3257
|
-
processMessage:
|
|
3258
|
-
initializeContent:
|
|
3259
|
-
openArtifact:
|
|
3260
|
-
openFile:
|
|
3261
|
-
openCode:
|
|
3262
|
-
updateFile:
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3333
|
+
processMessage: c.processMessage,
|
|
3334
|
+
initializeContent: c.initializeContent,
|
|
3335
|
+
openArtifact: c.openArtifact,
|
|
3336
|
+
openFile: c.openFile,
|
|
3337
|
+
openCode: c.openCode,
|
|
3338
|
+
updateFile: c.updateFile,
|
|
3339
|
+
openPanel: c.openPanel,
|
|
3340
|
+
closePanel: c.closePanel,
|
|
3341
|
+
togglePanel: c.togglePanel,
|
|
3342
|
+
toggleFullscreen: c.toggleFullscreen,
|
|
3343
|
+
setViewMode: c.setViewMode,
|
|
3344
|
+
getPanelUrl: c.getPanelUrl,
|
|
3345
|
+
sendToPanel: c.sendToPanel,
|
|
3269
3346
|
// Panel management
|
|
3270
|
-
hasPanel:
|
|
3271
|
-
registerPanel:
|
|
3272
|
-
unregisterPanel:
|
|
3273
|
-
getPanelTypes:
|
|
3347
|
+
hasPanel: c.hasPanel,
|
|
3348
|
+
registerPanel: c.registerPanel,
|
|
3349
|
+
unregisterPanel: c.unregisterPanel,
|
|
3350
|
+
getPanelTypes: c.getPanelTypes,
|
|
3351
|
+
// Multi-tab
|
|
3352
|
+
closeTab: c.closeTab,
|
|
3353
|
+
closeOtherTabs: c.closeOtherTabs,
|
|
3354
|
+
closeAllTabs: c.closeAllTabs,
|
|
3274
3355
|
// Events
|
|
3275
|
-
on:
|
|
3276
|
-
off:
|
|
3356
|
+
on: c.on,
|
|
3357
|
+
off: c.off,
|
|
3277
3358
|
// State management
|
|
3278
|
-
clearArtifacts: () =>
|
|
3359
|
+
clearArtifacts: () => c.state.clear(),
|
|
3279
3360
|
// Theme - wrap setTheme to also apply
|
|
3280
|
-
applyTheme:
|
|
3361
|
+
applyTheme: c.applyTheme,
|
|
3281
3362
|
setTheme: (n) => {
|
|
3282
|
-
|
|
3363
|
+
c.setTheme(n), c.applyTheme();
|
|
3283
3364
|
},
|
|
3284
|
-
getTheme:
|
|
3365
|
+
getTheme: c.getTheme
|
|
3285
3366
|
};
|
|
3286
3367
|
}
|
|
3287
|
-
const
|
|
3288
|
-
provideArtifactuse:
|
|
3289
|
-
useArtifactuse:
|
|
3290
|
-
createArtifactuseComposable:
|
|
3291
|
-
DEFAULT_PANELS:
|
|
3368
|
+
const fo = {
|
|
3369
|
+
provideArtifactuse: vt,
|
|
3370
|
+
useArtifactuse: Ve,
|
|
3371
|
+
createArtifactuseComposable: lo,
|
|
3372
|
+
DEFAULT_PANELS: Kt
|
|
3292
3373
|
};
|
|
3293
3374
|
export {
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3375
|
+
co as ArtifactuseAgentMessage,
|
|
3376
|
+
ca as ArtifactuseCard,
|
|
3377
|
+
Qa as ArtifactuseInlineForm,
|
|
3378
|
+
uo as ArtifactusePanel,
|
|
3379
|
+
vo as ArtifactusePanelToggle,
|
|
3380
|
+
tl as ArtifactuseSocialPreview,
|
|
3381
|
+
cl as ArtifactuseViewer,
|
|
3382
|
+
Kt as DEFAULT_PANELS,
|
|
3383
|
+
lo as createArtifactuseComposable,
|
|
3384
|
+
fo as default,
|
|
3385
|
+
vt as provideArtifactuse,
|
|
3386
|
+
Ve as useArtifactuse
|
|
3306
3387
|
};
|