artifactuse 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/index.d.ts +11 -0
- package/dist/core/state.d.ts +6 -0
- package/dist/{index-llShix6s.js → index-INYOxlcg.js} +1134 -910
- package/dist/index.js +1 -1
- package/dist/react/index.js +408 -389
- package/dist/styles/components/panel.css +106 -0
- package/dist/svelte/index.d.ts +42 -0
- package/dist/svelte/index.js +1915 -1875
- package/dist/vue/index.d.ts +32 -0
- package/dist/vue/index.js +1258 -1191
- package/dist/vue2/composables.d.ts +32 -0
- package/dist/vue2/index.js +535 -57
- 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
|
|
3
|
-
import { J as
|
|
4
|
-
const
|
|
1
|
+
import { ref as M, computed as C, createElementBlock as s, openBlock as a, normalizeClass as N, createElementVNode as e, toDisplayString as n, withModifiers as he, onMounted as $e, watch as de, Fragment as R, createCommentVNode as v, renderList as ve, createTextVNode as K, h as se, normalizeStyle as Pe, createStaticVNode as qt, createBlock as xe, resolveDynamicComponent as Ot, nextTick as Ce, onUnmounted as Ne, Teleport as Ut, createVNode as Se, Transition as He, withCtx as Be, withKeys as Dt, onBeforeUnmount as jt, unref as g, withDirectives as it, vShow as lt, reactive as ot, provide as Nt, inject as Wt } from "vue";
|
|
2
|
+
import { g as Ee, f as rt, a as De, b as je, n as Jt, i as nt, c as Xt, D as Zt, d as ct } from "../index-INYOxlcg.js";
|
|
3
|
+
import { J as Kt } from "../jszip.min-CdmYyw5L.js";
|
|
4
|
+
const Yt = { class: "artifactuse-card__icon" }, Qt = ["innerHTML"], Gt = { class: "artifactuse-card__content" }, ea = { class: "artifactuse-card__title" }, ta = { class: "artifactuse-card__meta" }, aa = { class: "artifactuse-card__type" }, sa = { class: "artifactuse-card__size" }, ia = { class: "artifactuse-card__actions" }, la = ["title"], na = {
|
|
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
|
+
}, oa = {
|
|
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
|
+
}, ra = {
|
|
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
|
|
29
|
+
setup(H, { emit: c }) {
|
|
30
|
+
const h = H, T = c, m = M(!1), o = C(() => Ee(h.artifact.language)), q = C(() => {
|
|
31
31
|
var x;
|
|
32
|
-
return
|
|
33
|
-
}),
|
|
34
|
-
function
|
|
35
|
-
x.stopPropagation(),
|
|
32
|
+
return rt(h.artifact.size || ((x = h.artifact.code) == null ? void 0 : x.length) || 0);
|
|
33
|
+
}), B = C(() => De(h.artifact.language));
|
|
34
|
+
function y(x) {
|
|
35
|
+
x.stopPropagation(), T("open", h.artifact);
|
|
36
36
|
}
|
|
37
|
-
async function
|
|
37
|
+
async function l() {
|
|
38
38
|
try {
|
|
39
|
-
await navigator.clipboard.writeText(
|
|
39
|
+
await navigator.clipboard.writeText(h.artifact.code), m.value = !0, setTimeout(() => {
|
|
40
40
|
m.value = !1;
|
|
41
|
-
}, 2e3),
|
|
41
|
+
}, 2e3), T("copy", h.artifact);
|
|
42
42
|
} catch (x) {
|
|
43
43
|
console.error("Failed to copy:", x);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function _() {
|
|
47
47
|
var W;
|
|
48
|
-
const x = new Blob([
|
|
49
|
-
$.href = F, $.download = `${
|
|
48
|
+
const x = new Blob([h.artifact.code], { type: "text/plain" }), F = URL.createObjectURL(x), $ = document.createElement("a"), j = je(h.artifact.language), O = ((W = h.artifact.title) == null ? void 0 : W.replace(/[^a-z0-9]/gi, "_").toLowerCase()) || "code";
|
|
49
|
+
$.href = F, $.download = `${O}.${j}`, document.body.appendChild($), $.click(), document.body.removeChild($), URL.revokeObjectURL(F), T("download", h.artifact);
|
|
50
50
|
}
|
|
51
51
|
return (x, F) => (a(), s("div", {
|
|
52
52
|
class: N(["artifactuse-card", { "artifactuse-card--active": H.isActive }]),
|
|
53
|
-
onClick:
|
|
53
|
+
onClick: y
|
|
54
54
|
}, [
|
|
55
|
-
e("div",
|
|
55
|
+
e("div", Yt, [
|
|
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: B.value
|
|
62
|
+
}, null, 8, Qt))
|
|
63
63
|
]),
|
|
64
|
-
e("div",
|
|
65
|
-
e("div",
|
|
66
|
-
e("div",
|
|
67
|
-
e("span",
|
|
64
|
+
e("div", Gt, [
|
|
65
|
+
e("div", ea, n(H.artifact.title), 1),
|
|
66
|
+
e("div", ta, [
|
|
67
|
+
e("span", aa, n(o.value), 1),
|
|
68
68
|
F[0] || (F[0] = e("span", { class: "artifactuse-card__separator" }, "•", -1)),
|
|
69
|
-
e("span",
|
|
69
|
+
e("span", sa, n(q.value), 1)
|
|
70
70
|
])
|
|
71
71
|
]),
|
|
72
|
-
e("div",
|
|
72
|
+
e("div", ia, [
|
|
73
73
|
e("button", {
|
|
74
74
|
class: "artifactuse-card__action",
|
|
75
|
-
onClick:
|
|
75
|
+
onClick: he(l, ["stop"]),
|
|
76
76
|
title: m.value ? "Copied!" : "Copy code"
|
|
77
77
|
}, [
|
|
78
|
-
m.value ? (a(), s("svg",
|
|
78
|
+
m.value ? (a(), s("svg", oa, [...F[2] || (F[2] = [
|
|
79
79
|
e("polyline", { points: "20 6 9 17 4 12" }, null, -1)
|
|
80
|
-
])])) : (a(), s("svg",
|
|
80
|
+
])])) : (a(), s("svg", na, [...F[1] || (F[1] = [
|
|
81
81
|
e("rect", {
|
|
82
82
|
x: "9",
|
|
83
83
|
y: "9",
|
|
@@ -88,10 +88,10 @@ 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, la),
|
|
92
92
|
e("button", {
|
|
93
93
|
class: "artifactuse-card__action",
|
|
94
|
-
onClick:
|
|
94
|
+
onClick: he(_, ["stop"]),
|
|
95
95
|
title: "Download file"
|
|
96
96
|
}, [...F[3] || (F[3] = [
|
|
97
97
|
e("svg", {
|
|
@@ -123,10 +123,10 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
123
123
|
], -1))
|
|
124
124
|
], 2));
|
|
125
125
|
}
|
|
126
|
-
},
|
|
126
|
+
}, ca = ["data-artifactuse-theme"], ua = {
|
|
127
127
|
key: 0,
|
|
128
128
|
class: "artifactuse-form-collapsed"
|
|
129
|
-
},
|
|
129
|
+
}, da = { class: "artifactuse-form-collapsed-icon" }, va = {
|
|
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
|
+
}, fa = {
|
|
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
|
+
}, pa = {
|
|
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
|
+
}, _a = { class: "artifactuse-form-collapsed-title" }, ha = {
|
|
154
154
|
key: 0,
|
|
155
155
|
class: "artifactuse-form-header"
|
|
156
|
-
},
|
|
156
|
+
}, ma = {
|
|
157
157
|
key: 0,
|
|
158
158
|
class: "artifactuse-form-title"
|
|
159
|
-
},
|
|
159
|
+
}, ya = {
|
|
160
160
|
key: 1,
|
|
161
161
|
class: "artifactuse-form-description"
|
|
162
|
-
},
|
|
162
|
+
}, ga = {
|
|
163
163
|
key: 1,
|
|
164
164
|
class: "artifactuse-form-buttons"
|
|
165
|
-
},
|
|
165
|
+
}, ka = ["disabled", "onClick"], wa = ["innerHTML"], ba = { class: "artifactuse-form-fields" }, Ca = {
|
|
166
166
|
key: 0,
|
|
167
167
|
class: "artifactuse-form-buttons"
|
|
168
|
-
},
|
|
168
|
+
}, xa = ["type", "disabled", "onClick"], $a = {
|
|
169
169
|
key: 0,
|
|
170
170
|
class: "artifactuse-form-btn-spinner"
|
|
171
|
-
},
|
|
171
|
+
}, Ma = ["innerHTML"], Ta = {
|
|
172
172
|
key: 1,
|
|
173
173
|
class: "artifactuse-form-divider"
|
|
174
|
-
},
|
|
174
|
+
}, La = {
|
|
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
|
+
}, Pa = { class: "artifactuse-checkbox-label" }, Ha = ["checked", "disabled", "onChange"], Ba = { class: "artifactuse-checkbox-text" }, Ea = {
|
|
181
181
|
key: 0,
|
|
182
182
|
class: "artifactuse-required"
|
|
183
|
-
},
|
|
183
|
+
}, Sa = {
|
|
184
184
|
key: 0,
|
|
185
185
|
class: "artifactuse-help-text"
|
|
186
|
-
},
|
|
186
|
+
}, za = {
|
|
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"], Va = {
|
|
193
193
|
key: 0,
|
|
194
194
|
class: "artifactuse-required"
|
|
195
|
-
},
|
|
195
|
+
}, Ra = ["id", "type", "value", "placeholder", "disabled", "required", "onInput"], qa = ["id", "value", "placeholder", "disabled", "required", "rows", "onInput"], Oa = ["id", "value", "disabled", "required", "onChange"], Ua = { value: "" }, Da = ["value", "disabled"], ja = {
|
|
196
196
|
key: 3,
|
|
197
197
|
class: "artifactuse-radio-group"
|
|
198
|
-
},
|
|
198
|
+
}, Na = ["name", "value", "checked", "disabled", "onChange"], Wa = {
|
|
199
199
|
key: 4,
|
|
200
200
|
class: "artifactuse-help-text"
|
|
201
|
-
},
|
|
201
|
+
}, Ja = {
|
|
202
202
|
key: 5,
|
|
203
203
|
class: "artifactuse-error-text"
|
|
204
|
-
},
|
|
204
|
+
}, Xa = {
|
|
205
205
|
key: 0,
|
|
206
206
|
class: "artifactuse-form-buttons artifactuse-form-buttons-default"
|
|
207
|
-
},
|
|
207
|
+
}, Za = ["disabled"], Ka = {
|
|
208
208
|
key: 0,
|
|
209
209
|
class: "artifactuse-form-btn-spinner"
|
|
210
|
-
},
|
|
210
|
+
}, Ya = {
|
|
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
|
|
225
|
-
function
|
|
223
|
+
setup(H, { emit: c }) {
|
|
224
|
+
const h = H, T = c, m = M(h.initialState), o = C(() => m.value !== "active"), q = C(() => m.value === "active" ? "" : `artifactuse-form--${m.value}`);
|
|
225
|
+
function B(w) {
|
|
226
226
|
m.value = w;
|
|
227
227
|
}
|
|
228
|
-
const
|
|
228
|
+
const y = C(() => {
|
|
229
229
|
try {
|
|
230
|
-
return JSON.parse(
|
|
230
|
+
return JSON.parse(h.artifact.code);
|
|
231
231
|
} catch {
|
|
232
232
|
return { title: "Invalid Form", variant: "fields", data: { fields: [] } };
|
|
233
233
|
}
|
|
234
|
-
}),
|
|
234
|
+
}), l = M(null), _ = C(() => h.artifact.id || y.value.id || `form-${Date.now()}`), x = C(() => `artifactuse-form-${y.value.variant || "fields"}`), F = C(() => y.value.title || "Form"), $ = M({}), j = M({}), O = M(!1), W = C(() => {
|
|
235
235
|
var w;
|
|
236
|
-
return ((w =
|
|
237
|
-
}), Y =
|
|
236
|
+
return ((w = y.value.data) == null ? void 0 : w.fields) || [];
|
|
237
|
+
}), Y = C(() => {
|
|
238
238
|
var w;
|
|
239
|
-
return
|
|
240
|
-
}),
|
|
239
|
+
return y.value.variant === "buttons" ? ((w = y.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
|
|
254
|
-
return
|
|
255
|
-
}
|
|
256
|
-
function
|
|
257
|
-
if (
|
|
258
|
-
const w = ie(
|
|
259
|
-
w &&
|
|
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 E = L.split(/[\s,]+/).map(Number).filter((u) => !isNaN(u));
|
|
254
|
+
return E.length >= 3 ? `${E[0]}, ${E[1]}, ${E[2]}` : null;
|
|
255
|
+
}
|
|
256
|
+
function Z() {
|
|
257
|
+
if (l.value && h.accent) {
|
|
258
|
+
const w = ie(h.accent);
|
|
259
|
+
w && l.value.style.setProperty("--artifactuse-primary", w);
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
$e(() => {
|
|
263
|
-
|
|
264
|
-
}), de(() =>
|
|
263
|
+
Z(), m.value = h.initialState;
|
|
264
|
+
}), de(() => h.accent, Z), de(() => h.initialState, (w) => {
|
|
265
265
|
m.value = w;
|
|
266
266
|
});
|
|
267
|
-
function
|
|
268
|
-
var
|
|
267
|
+
function X() {
|
|
268
|
+
var r;
|
|
269
269
|
const w = {};
|
|
270
|
-
W.value.forEach((
|
|
271
|
-
["buttons", "divider", "heading"].includes(
|
|
272
|
-
}), (
|
|
270
|
+
W.value.forEach((E) => {
|
|
271
|
+
["buttons", "divider", "heading"].includes(E.type) || (E.defaultValue !== void 0 ? w[E.name] = E.defaultValue : E.type === "checkbox" ? w[E.name] = !1 : w[E.name] = "");
|
|
272
|
+
}), (r = y.value.data) != null && r.defaults && Object.assign(w, y.value.data.defaults), $.value = w;
|
|
273
273
|
}
|
|
274
|
-
|
|
274
|
+
X(), de(() => h.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 p(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, j.value[w] && delete j.value[w];
|
|
283
283
|
}
|
|
284
284
|
function ee() {
|
|
285
|
-
var
|
|
285
|
+
var E;
|
|
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[
|
|
311
|
+
const r = (E = y.value.data) == null ? void 0 : E.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
316
|
}), j.value = w, Object.keys(w).length === 0;
|
|
317
317
|
}
|
|
318
318
|
function re() {
|
|
319
|
-
|
|
319
|
+
X(), j.value = {};
|
|
320
320
|
}
|
|
321
|
-
function
|
|
322
|
-
ee() && (
|
|
323
|
-
formId:
|
|
321
|
+
function A() {
|
|
322
|
+
ee() && (O.value = !0, T("submit", {
|
|
323
|
+
formId: _.value,
|
|
324
324
|
action: "submit",
|
|
325
325
|
values: { ...$.value },
|
|
326
326
|
timestamp: Date.now()
|
|
327
327
|
}), setTimeout(() => {
|
|
328
|
-
|
|
328
|
+
O.value = !1, B("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
|
+
A();
|
|
336
336
|
break;
|
|
337
337
|
case "cancel":
|
|
338
|
-
|
|
339
|
-
formId:
|
|
338
|
+
T("cancel", {
|
|
339
|
+
formId: _.value,
|
|
340
340
|
action: "cancel",
|
|
341
341
|
buttonName: w.name || "cancel",
|
|
342
342
|
timestamp: Date.now()
|
|
343
343
|
}), setTimeout(() => {
|
|
344
|
-
|
|
344
|
+
B("cancelled");
|
|
345
345
|
}, 150);
|
|
346
346
|
break;
|
|
347
347
|
case "reset":
|
|
348
|
-
re(),
|
|
349
|
-
formId:
|
|
348
|
+
re(), T("reset", {
|
|
349
|
+
formId: _.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: _.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
|
+
B("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
|
-
ref:
|
|
372
|
+
ref: l,
|
|
373
373
|
class: N([
|
|
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
|
-
m.value === "submitted" ? (a(), s("svg",
|
|
380
|
+
o.value ? (a(), s("div", ua, [
|
|
381
|
+
e("div", da, [
|
|
382
|
+
m.value === "submitted" ? (a(), s("svg", va, [...L[1] || (L[1] = [
|
|
383
383
|
e("polyline", { points: "20 6 9 17 4 12" }, null, -1)
|
|
384
|
-
])])) : m.value === "cancelled" ? (a(), s("svg",
|
|
384
|
+
])])) : m.value === "cancelled" ? (a(), s("svg", fa, [...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", pa, [...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", _a, n(F.value), 1)
|
|
407
407
|
])) : (a(), s(R, { key: 1 }, [
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
408
|
+
y.value.title || y.value.description ? (a(), s("div", ha, [
|
|
409
|
+
y.value.title ? (a(), s("div", ma, n(y.value.title), 1)) : v("", !0),
|
|
410
|
+
y.value.description ? (a(), s("p", ya, n(y.value.description), 1)) : v("", !0)
|
|
411
411
|
])) : v("", !0),
|
|
412
|
-
|
|
413
|
-
(a(!0), s(R, null, ve(Y.value, (
|
|
414
|
-
key:
|
|
412
|
+
y.value.variant === "buttons" ? (a(), s("div", ga, [
|
|
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: N(["artifactuse-form-btn", `artifactuse-form-btn-${
|
|
417
|
-
disabled:
|
|
418
|
-
onClick: (
|
|
416
|
+
class: N(["artifactuse-form-btn", `artifactuse-form-btn-${r.variant || "secondary"}`]),
|
|
417
|
+
disabled: r.disabled || O.value,
|
|
418
|
+
onClick: (E) => 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(" " +
|
|
426
|
-
], 10,
|
|
423
|
+
innerHTML: r.icon
|
|
424
|
+
}, null, 8, wa)) : v("", !0),
|
|
425
|
+
K(" " + n(r.label), 1)
|
|
426
|
+
], 10, ka))), 128))
|
|
427
427
|
])) : (a(), s("form", {
|
|
428
428
|
key: 2,
|
|
429
429
|
class: "artifactuse-form",
|
|
430
|
-
onSubmit:
|
|
430
|
+
onSubmit: he(A, ["prevent"])
|
|
431
431
|
}, [
|
|
432
|
-
e("div",
|
|
433
|
-
(a(!0), s(R, null, ve(W.value, (
|
|
434
|
-
key:
|
|
432
|
+
e("div", ba, [
|
|
433
|
+
(a(!0), s(R, null, ve(W.value, (r, E) => (a(), s(R, {
|
|
434
|
+
key: r.name || E
|
|
435
435
|
}, [
|
|
436
|
-
|
|
437
|
-
(a(!0), s(R, null, ve(
|
|
438
|
-
key:
|
|
439
|
-
type:
|
|
440
|
-
class: N(["artifactuse-form-btn", `artifactuse-form-btn-${
|
|
441
|
-
disabled:
|
|
442
|
-
onClick: (z) =>
|
|
436
|
+
r.type === "buttons" ? (a(), s("div", Ca, [
|
|
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: N(["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", $a)) : u.icon ? (a(), s("span", {
|
|
445
445
|
key: 1,
|
|
446
446
|
class: "artifactuse-form-btn-icon",
|
|
447
|
-
innerHTML:
|
|
448
|
-
}, null, 8,
|
|
449
|
-
K(" " +
|
|
450
|
-
], 10,
|
|
451
|
-
])) :
|
|
452
|
-
e("label",
|
|
447
|
+
innerHTML: u.icon
|
|
448
|
+
}, null, 8, Ma)) : v("", !0),
|
|
449
|
+
K(" " + n(O.value && u.action === "submit" ? "Submitting..." : u.label), 1)
|
|
450
|
+
], 10, xa))), 128))
|
|
451
|
+
])) : r.type === "divider" ? (a(), s("div", Ta)) : r.type === "heading" ? (a(), s("div", La, n(r.label), 1)) : r.type === "checkbox" ? (a(), s("div", Aa, [
|
|
452
|
+
e("label", Pa, [
|
|
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(
|
|
462
|
-
|
|
458
|
+
onChange: (u) => k(r.name, u.target.checked)
|
|
459
|
+
}, null, 40, Ha),
|
|
460
|
+
e("span", Ba, [
|
|
461
|
+
K(n(r.label) + " ", 1),
|
|
462
|
+
r.required ? (a(), s("span", Ea, "*")) : v("", !0)
|
|
463
463
|
])
|
|
464
464
|
]),
|
|
465
|
-
|
|
466
|
-
j.value[
|
|
467
|
-
])) : (a(), s("div",
|
|
465
|
+
r.helpText ? (a(), s("span", Sa, n(r.helpText), 1)) : v("", !0),
|
|
466
|
+
j.value[r.name] ? (a(), s("span", za, n(j.value[r.name]), 1)) : v("", !0)
|
|
467
|
+
])) : (a(), s("div", Ia, [
|
|
468
468
|
e("label", {
|
|
469
|
-
for: `${
|
|
469
|
+
for: `${_.value}-${r.name}`,
|
|
470
470
|
class: "artifactuse-label"
|
|
471
471
|
}, [
|
|
472
|
-
K(
|
|
473
|
-
|
|
474
|
-
], 8,
|
|
475
|
-
oe(
|
|
472
|
+
K(n(r.label) + " ", 1),
|
|
473
|
+
r.required ? (a(), s("span", Va, "*")) : 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: `${_.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, Ra)) : 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: `${_.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, qa)) : r.type === "select" ? (a(), s("select", {
|
|
496
496
|
key: 2,
|
|
497
|
-
id: `${
|
|
498
|
-
value: $.value[
|
|
499
|
-
disabled:
|
|
500
|
-
required:
|
|
497
|
+
id: `${_.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
|
-
},
|
|
510
|
-
], 40,
|
|
511
|
-
(a(!0), s(R, null, ve(
|
|
512
|
-
key:
|
|
504
|
+
e("option", Ua, n(r.placeholder || "Select..."), 1),
|
|
505
|
+
(a(!0), s(R, null, ve(p(r.options), (u) => (a(), s("option", {
|
|
506
|
+
key: u.value,
|
|
507
|
+
value: u.value,
|
|
508
|
+
disabled: u.disabled
|
|
509
|
+
}, n(u.label), 9, Da))), 128))
|
|
510
|
+
], 40, Oa)) : r.type === "radio" ? (a(), s("div", ja, [
|
|
511
|
+
(a(!0), s(R, null, ve(p(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,
|
|
522
|
+
onChange: (z) => k(r.name, u.value)
|
|
523
|
+
}, null, 40, Na),
|
|
524
|
+
e("span", null, n(u.label), 1)
|
|
525
525
|
]))), 128))
|
|
526
526
|
])) : v("", !0),
|
|
527
|
-
|
|
528
|
-
j.value[
|
|
527
|
+
r.helpText ? (a(), s("span", Wa, n(r.helpText), 1)) : v("", !0),
|
|
528
|
+
j.value[r.name] ? (a(), s("span", Ja, n(j.value[r.name]), 1)) : v("", !0)
|
|
529
529
|
]))
|
|
530
530
|
], 64))), 128))
|
|
531
531
|
]),
|
|
532
|
-
|
|
532
|
+
S.value ? v("", !0) : (a(), s("div", Xa, [
|
|
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(" " +
|
|
545
|
-
], 8,
|
|
543
|
+
O.value ? (a(), s("span", Ka)) : v("", !0),
|
|
544
|
+
K(" " + n(O.value ? "Submitting..." : "Submit"), 1)
|
|
545
|
+
], 8, Za)
|
|
546
546
|
]))
|
|
547
547
|
], 32))
|
|
548
548
|
], 64))
|
|
549
|
-
], 10,
|
|
549
|
+
], 10, ca));
|
|
550
550
|
}
|
|
551
|
-
},
|
|
551
|
+
}, Qa = ["data-artifactuse-theme"], Ga = { class: "artifactuse-social-header" }, es = ["src", "alt"], ts = { class: "artifactuse-social-author" }, as = { class: "artifactuse-social-author-name" }, ss = { class: "artifactuse-social-author-meta" }, is = { class: "artifactuse-social-author-handle" }, ls = { class: "artifactuse-social-timestamp" }, ns = { class: "artifactuse-social-content" }, os = ["innerHTML"], rs = {
|
|
552
552
|
key: 0,
|
|
553
553
|
class: "artifactuse-social-media"
|
|
554
|
-
},
|
|
554
|
+
}, cs = ["data-count"], us = ["src", "alt"], ds = {
|
|
555
555
|
key: 1,
|
|
556
556
|
class: "artifactuse-social-link-card"
|
|
557
|
-
},
|
|
557
|
+
}, vs = ["src", "alt"], fs = { class: "artifactuse-social-link-info" }, ps = { class: "artifactuse-social-link-domain" }, _s = { class: "artifactuse-social-link-title" }, hs = {
|
|
558
558
|
key: 0,
|
|
559
559
|
class: "artifactuse-social-link-description"
|
|
560
|
-
},
|
|
560
|
+
}, ms = {
|
|
561
561
|
key: 2,
|
|
562
562
|
class: "artifactuse-social-poll"
|
|
563
|
-
},
|
|
563
|
+
}, ys = { class: "artifactuse-social-poll-label" }, gs = { class: "artifactuse-social-poll-label-percent" }, ks = { class: "artifactuse-social-poll-meta" }, ws = {
|
|
564
564
|
key: 3,
|
|
565
565
|
class: "artifactuse-social-quote"
|
|
566
|
-
},
|
|
566
|
+
}, bs = { class: "artifactuse-social-quote-header" }, Cs = ["src"], xs = { class: "artifactuse-social-quote-author" }, $s = { class: "artifactuse-social-quote-handle" }, Ms = { class: "artifactuse-social-quote-text" }, Ts = {
|
|
567
567
|
key: 0,
|
|
568
568
|
class: "artifactuse-social-engagement"
|
|
569
|
-
},
|
|
569
|
+
}, Ls = { class: "artifactuse-social-stat" }, As = { class: "artifactuse-social-stat" }, Ps = { class: "artifactuse-social-stat" }, Hs = { class: "artifactuse-social-stat" }, Bs = { class: "artifactuse-social-header" }, Es = ["src", "alt"], Ss = { class: "artifactuse-social-author-info" }, zs = { 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" }, Vs = { class: "artifactuse-social-timestamp" }, Rs = { class: "artifactuse-social-content" }, qs = ["innerHTML"], Os = {
|
|
573
573
|
key: 0,
|
|
574
574
|
class: "artifactuse-social-link-card"
|
|
575
|
-
},
|
|
575
|
+
}, Us = ["src", "alt"], Ds = { class: "artifactuse-social-link-info" }, js = { class: "artifactuse-social-link-title" }, Ns = { class: "artifactuse-social-link-domain" }, Ws = {
|
|
576
576
|
key: 0,
|
|
577
577
|
class: "artifactuse-social-engagement"
|
|
578
|
-
},
|
|
578
|
+
}, Js = { class: "artifactuse-social-reactions" }, Xs = { class: "artifactuse-social-header" }, Zs = ["src", "alt"], Ks = { class: "artifactuse-social-author-name" }, Ys = {
|
|
579
579
|
key: 0,
|
|
580
580
|
class: "artifactuse-social-verified",
|
|
581
581
|
viewBox: "0 0 24 24",
|
|
582
582
|
fill: "currentColor"
|
|
583
|
-
},
|
|
583
|
+
}, Qs = {
|
|
584
584
|
key: 0,
|
|
585
585
|
class: "artifactuse-social-media"
|
|
586
|
-
},
|
|
586
|
+
}, Gs = ["src", "alt"], ei = { class: "artifactuse-social-likes" }, ti = { class: "artifactuse-social-caption" }, ai = { class: "artifactuse-social-caption-author" }, si = ["innerHTML"], ii = { class: "artifactuse-social-timestamp" }, li = { class: "artifactuse-social-header" }, ni = ["src", "alt"], oi = { class: "artifactuse-social-author-info" }, ri = { class: "artifactuse-social-author-name" }, ci = { class: "artifactuse-social-timestamp" }, ui = { class: "artifactuse-social-content" }, di = ["innerHTML"], vi = {
|
|
587
587
|
key: 0,
|
|
588
588
|
class: "artifactuse-social-link-card"
|
|
589
|
-
},
|
|
589
|
+
}, fi = ["src", "alt"], pi = { class: "artifactuse-social-link-info" }, _i = { class: "artifactuse-social-link-domain" }, hi = { class: "artifactuse-social-link-title" }, mi = {
|
|
590
590
|
key: 0,
|
|
591
591
|
class: "artifactuse-social-link-description"
|
|
592
|
-
},
|
|
592
|
+
}, yi = {
|
|
593
593
|
key: 0,
|
|
594
594
|
class: "artifactuse-social-engagement"
|
|
595
|
-
},
|
|
595
|
+
}, gi = { class: "artifactuse-social-reactions" }, ki = { class: "artifactuse-social-reaction-count" }, wi = { class: "artifactuse-social-comments-shares" }, bi = { class: "artifactuse-social-header" }, Ci = ["src", "alt"], xi = { class: "artifactuse-social-author-info" }, $i = { class: "artifactuse-social-author-name" }, Mi = {
|
|
596
596
|
key: 0,
|
|
597
597
|
class: "artifactuse-social-verified",
|
|
598
598
|
viewBox: "0 0 24 24",
|
|
599
599
|
fill: "currentColor"
|
|
600
|
-
},
|
|
600
|
+
}, Ti = { class: "artifactuse-social-timestamp" }, Li = { class: "artifactuse-social-content" }, Ai = ["innerHTML"], Pi = {
|
|
601
601
|
key: 0,
|
|
602
602
|
class: "artifactuse-social-engagement"
|
|
603
|
-
},
|
|
603
|
+
}, Hi = { class: "artifactuse-social-stat" }, Bi = { class: "artifactuse-social-stat" }, Ei = { class: "artifactuse-social-stat" }, Si = { class: "artifactuse-social-thumbnail" }, zi = ["src", "alt"], Ii = {
|
|
604
604
|
key: 1,
|
|
605
605
|
class: "artifactuse-social-duration"
|
|
606
|
-
},
|
|
606
|
+
}, Fi = { class: "artifactuse-social-info" }, Vi = { class: "artifactuse-social-header" }, Ri = ["src", "alt"], qi = { class: "artifactuse-social-author-name" }, Oi = ["innerHTML"], Ui = {
|
|
607
607
|
key: 0,
|
|
608
608
|
class: "artifactuse-social-sound"
|
|
609
|
-
},
|
|
609
|
+
}, Di = {
|
|
610
610
|
key: 1,
|
|
611
611
|
class: "artifactuse-social-engagement"
|
|
612
|
-
},
|
|
612
|
+
}, ji = { class: "artifactuse-social-thumbnail" }, Ni = ["src", "alt"], Wi = {
|
|
613
613
|
key: 1,
|
|
614
614
|
class: "artifactuse-social-duration"
|
|
615
|
-
},
|
|
615
|
+
}, Ji = { class: "artifactuse-social-info" }, Xi = ["src", "alt"], Zi = { class: "artifactuse-social-title" }, Ki = { class: "artifactuse-social-channel" }, Yi = { class: "artifactuse-social-meta" }, Qi = { class: "artifactuse-social-actions-bar" }, Gi = { 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>', el = {
|
|
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
|
|
628
|
+
setup(H, { emit: c }) {
|
|
629
|
+
const h = H, T = c, m = M(null), o = M("Copy"), q = C(() => {
|
|
630
630
|
try {
|
|
631
|
-
return JSON.parse(
|
|
631
|
+
return JSON.parse(h.artifact.code);
|
|
632
632
|
} catch {
|
|
633
633
|
return { platform: "twitter", data: {} };
|
|
634
634
|
}
|
|
635
|
-
}),
|
|
636
|
-
var
|
|
637
|
-
return ((
|
|
635
|
+
}), B = C(() => {
|
|
636
|
+
var p;
|
|
637
|
+
return ((p = q.value) == null ? void 0 : p.platform) || "twitter";
|
|
638
638
|
});
|
|
639
|
-
|
|
640
|
-
var
|
|
641
|
-
return ((
|
|
639
|
+
C(() => {
|
|
640
|
+
var p;
|
|
641
|
+
return ((p = q.value) == null ? void 0 : p.variant) || "post";
|
|
642
642
|
});
|
|
643
|
-
const
|
|
644
|
-
var
|
|
645
|
-
return ((k = (
|
|
646
|
-
}),
|
|
647
|
-
var
|
|
648
|
-
return ((k = (
|
|
649
|
-
}),
|
|
650
|
-
var
|
|
651
|
-
return ((k = (
|
|
652
|
-
}), x =
|
|
653
|
-
var
|
|
654
|
-
return ((k = (
|
|
655
|
-
}), F =
|
|
656
|
-
const
|
|
657
|
-
return
|
|
658
|
-
}), $ =
|
|
643
|
+
const y = C(() => {
|
|
644
|
+
var p, k;
|
|
645
|
+
return ((k = (p = q.value) == null ? void 0 : p.data) == null ? void 0 : k.author) || {};
|
|
646
|
+
}), l = C(() => {
|
|
647
|
+
var p, k;
|
|
648
|
+
return ((k = (p = q.value) == null ? void 0 : p.data) == null ? void 0 : k.content) || {};
|
|
649
|
+
}), _ = C(() => {
|
|
650
|
+
var p, k;
|
|
651
|
+
return ((k = (p = q.value) == null ? void 0 : p.data) == null ? void 0 : k.engagement) || {};
|
|
652
|
+
}), x = C(() => {
|
|
653
|
+
var p, k;
|
|
654
|
+
return ((k = (p = q.value) == null ? void 0 : p.data) == null ? void 0 : k.meta) || {};
|
|
655
|
+
}), F = C(() => {
|
|
656
|
+
const p = _.value;
|
|
657
|
+
return p.likes || p.comments || p.shares || p.retweets || p.replies || p.views;
|
|
658
|
+
}), $ = C(() => `artifactuse-social-verified-${y.value.verifiedType || "blue"}`), j = 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
|
+
})[B.value] || B.value), O = C(() => {
|
|
667
|
+
const p = {
|
|
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,61 +687,61 @@ 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 p[B.value] || p.twitter;
|
|
691
|
+
}), W = C(() => {
|
|
692
|
+
let p = l.value.text || "";
|
|
693
|
+
return p = p.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"), p = p.replace(/#(\w+)/g, '<span class="artifactuse-social-hashtag">#$1</span>'), p = p.replace(/@(\w+)/g, '<span class="artifactuse-social-mention">@$1</span>'), p = p.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
|
+
), p;
|
|
697
|
+
}), Y = C(() => {
|
|
698
|
+
const p = _.value.reactions || {};
|
|
699
|
+
return Object.values(p).reduce((k, ee) => k + (ee || 0), 0) || _.value.likes || 0;
|
|
700
700
|
});
|
|
701
|
-
function
|
|
702
|
-
return
|
|
701
|
+
function S(p) {
|
|
702
|
+
return p ? p >= 1e6 ? `${(p / 1e6).toFixed(1)}M` : p >= 1e3 ? `${(p / 1e3).toFixed(1)}K` : p.toString() : "0";
|
|
703
703
|
}
|
|
704
|
-
function ie(
|
|
704
|
+
function ie(p) {
|
|
705
705
|
try {
|
|
706
|
-
return new URL(
|
|
706
|
+
return new URL(p).hostname.replace("www.", "");
|
|
707
707
|
} catch {
|
|
708
|
-
return
|
|
708
|
+
return p;
|
|
709
709
|
}
|
|
710
710
|
}
|
|
711
|
-
function
|
|
712
|
-
|
|
711
|
+
function Z(p) {
|
|
712
|
+
p.target.src = _e;
|
|
713
713
|
}
|
|
714
|
-
function
|
|
715
|
-
|
|
714
|
+
function X(p) {
|
|
715
|
+
p.target.style.display = "none";
|
|
716
716
|
}
|
|
717
717
|
function oe() {
|
|
718
|
-
const
|
|
719
|
-
navigator.clipboard.writeText(
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
}, 2e3),
|
|
718
|
+
const p = l.value.text || "";
|
|
719
|
+
navigator.clipboard.writeText(p).then(() => {
|
|
720
|
+
o.value = "Copied!", setTimeout(() => {
|
|
721
|
+
o.value = "Copy";
|
|
722
|
+
}, 2e3), T("copy", { platform: B.value, text: p });
|
|
723
723
|
});
|
|
724
724
|
}
|
|
725
|
-
return (
|
|
726
|
-
var ee, re,
|
|
725
|
+
return (p, k) => {
|
|
726
|
+
var ee, re, A, Q, w, L;
|
|
727
727
|
return a(), s("div", {
|
|
728
728
|
ref_key: "containerRef",
|
|
729
729
|
ref: m,
|
|
730
|
-
class: N(["artifactuse-social", [`artifactuse-social-${
|
|
730
|
+
class: N(["artifactuse-social", [`artifactuse-social-${B.value}`]]),
|
|
731
731
|
"data-artifactuse-theme": H.theme
|
|
732
732
|
}, [
|
|
733
|
-
|
|
734
|
-
e("div",
|
|
733
|
+
B.value === "twitter" ? (a(), s(R, { key: 0 }, [
|
|
734
|
+
e("div", Ga, [
|
|
735
735
|
e("img", {
|
|
736
|
-
src:
|
|
737
|
-
alt:
|
|
736
|
+
src: y.value.avatar || _e,
|
|
737
|
+
alt: y.value.name,
|
|
738
738
|
class: "artifactuse-social-avatar",
|
|
739
|
-
onError:
|
|
740
|
-
}, null, 40,
|
|
741
|
-
e("div",
|
|
742
|
-
e("div",
|
|
743
|
-
e("span", null,
|
|
744
|
-
|
|
739
|
+
onError: Z
|
|
740
|
+
}, null, 40, es),
|
|
741
|
+
e("div", ts, [
|
|
742
|
+
e("div", as, [
|
|
743
|
+
e("span", null, n(y.value.name), 1),
|
|
744
|
+
y.value.verified ? (a(), s("svg", {
|
|
745
745
|
key: 0,
|
|
746
746
|
class: N(["artifactuse-social-verified", $.value]),
|
|
747
747
|
viewBox: "0 0 24 24",
|
|
@@ -750,40 +750,40 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
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", ss, [
|
|
754
|
+
e("span", is, n(y.value.handle), 1),
|
|
755
|
+
e("span", ls, "· " + n(x.value.timestamp || "Just now"), 1)
|
|
756
756
|
])
|
|
757
757
|
])
|
|
758
758
|
]),
|
|
759
|
-
e("div",
|
|
759
|
+
e("div", ns, [
|
|
760
760
|
e("p", {
|
|
761
761
|
class: "artifactuse-social-text",
|
|
762
762
|
innerHTML: W.value
|
|
763
|
-
}, null, 8,
|
|
764
|
-
(ee =
|
|
763
|
+
}, null, 8, os),
|
|
764
|
+
(ee = l.value.media) != null && ee.length ? (a(), s("div", rs, [
|
|
765
765
|
e("div", {
|
|
766
|
-
class: N(["artifactuse-social-media-grid", { "artifactuse-social-media-single":
|
|
767
|
-
"data-count":
|
|
766
|
+
class: N(["artifactuse-social-media-grid", { "artifactuse-social-media-single": l.value.media.length === 1 }]),
|
|
767
|
+
"data-count": l.value.media.length
|
|
768
768
|
}, [
|
|
769
|
-
(a(!0), s(R, null, ve(
|
|
770
|
-
key:
|
|
771
|
-
src:
|
|
772
|
-
alt:
|
|
773
|
-
onError:
|
|
774
|
-
}, null, 40,
|
|
775
|
-
], 10,
|
|
769
|
+
(a(!0), s(R, null, ve(l.value.media.slice(0, 4), (r, E) => (a(), s("img", {
|
|
770
|
+
key: E,
|
|
771
|
+
src: r.url,
|
|
772
|
+
alt: r.alt || "",
|
|
773
|
+
onError: X
|
|
774
|
+
}, null, 40, us))), 128))
|
|
775
|
+
], 10, cs)
|
|
776
776
|
])) : v("", !0),
|
|
777
|
-
|
|
778
|
-
|
|
777
|
+
l.value.link && !((re = l.value.media) != null && re.length) ? (a(), s("div", ds, [
|
|
778
|
+
l.value.link.image ? (a(), s("img", {
|
|
779
779
|
key: 0,
|
|
780
|
-
src:
|
|
781
|
-
alt:
|
|
780
|
+
src: l.value.link.image,
|
|
781
|
+
alt: l.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, vs)) : v("", !0),
|
|
785
|
+
e("div", fs, [
|
|
786
|
+
e("div", ps, [
|
|
787
787
|
k[1] || (k[1] = e("svg", {
|
|
788
788
|
fill: "none",
|
|
789
789
|
viewBox: "0 0 24 24",
|
|
@@ -796,45 +796,45 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
796
796
|
d: "M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"
|
|
797
797
|
})
|
|
798
798
|
], -1)),
|
|
799
|
-
K(" " + l
|
|
799
|
+
K(" " + n(l.value.link.domain || ie(l.value.link.url)), 1)
|
|
800
800
|
]),
|
|
801
|
-
e("div",
|
|
802
|
-
|
|
801
|
+
e("div", _s, n(l.value.link.title), 1),
|
|
802
|
+
l.value.link.description ? (a(), s("div", hs, n(l.value.link.description), 1)) : v("", !0)
|
|
803
803
|
])
|
|
804
804
|
])) : v("", !0),
|
|
805
|
-
|
|
806
|
-
(a(!0), s(R, null, ve(
|
|
807
|
-
var
|
|
805
|
+
l.value.poll ? (a(), s("div", ms, [
|
|
806
|
+
(a(!0), s(R, null, ve(l.value.poll.options, (r, E) => {
|
|
807
|
+
var u, z;
|
|
808
808
|
return a(), s("div", {
|
|
809
|
-
key:
|
|
809
|
+
key: E,
|
|
810
810
|
class: "artifactuse-social-poll-option"
|
|
811
811
|
}, [
|
|
812
812
|
e("div", {
|
|
813
813
|
class: "artifactuse-social-poll-bar",
|
|
814
|
-
style: Pe({ width: `${((
|
|
814
|
+
style: Pe({ width: `${((u = l.value.poll.votes) == null ? void 0 : u[E]) || 0}%` })
|
|
815
815
|
}, null, 4),
|
|
816
|
-
e("div",
|
|
817
|
-
e("span", null,
|
|
818
|
-
e("span",
|
|
816
|
+
e("div", ys, [
|
|
817
|
+
e("span", null, n(r), 1),
|
|
818
|
+
e("span", gs, n(((z = l.value.poll.votes) == null ? void 0 : z[E]) || 0) + "%", 1)
|
|
819
819
|
])
|
|
820
820
|
]);
|
|
821
821
|
}), 128)),
|
|
822
|
-
e("div",
|
|
822
|
+
e("div", ks, n(S(l.value.poll.totalVotes || 0)) + " votes · " + n(l.value.poll.duration || "Poll ended"), 1)
|
|
823
823
|
])) : v("", !0),
|
|
824
|
-
|
|
825
|
-
e("div",
|
|
824
|
+
l.value.quote ? (a(), s("div", ws, [
|
|
825
|
+
e("div", bs, [
|
|
826
826
|
e("img", {
|
|
827
|
-
src: ((
|
|
827
|
+
src: ((A = l.value.quote.author) == null ? void 0 : A.avatar) || _e,
|
|
828
828
|
class: "artifactuse-social-quote-avatar"
|
|
829
|
-
}, null, 8,
|
|
830
|
-
e("span",
|
|
831
|
-
e("span",
|
|
829
|
+
}, null, 8, Cs),
|
|
830
|
+
e("span", xs, n((Q = l.value.quote.author) == null ? void 0 : Q.name), 1),
|
|
831
|
+
e("span", $s, n((w = l.value.quote.author) == null ? void 0 : w.handle), 1)
|
|
832
832
|
]),
|
|
833
|
-
e("p",
|
|
833
|
+
e("p", Ms, n(l.value.quote.text), 1)
|
|
834
834
|
])) : v("", !0)
|
|
835
835
|
]),
|
|
836
|
-
F.value ? (a(), s("div",
|
|
837
|
-
e("div",
|
|
836
|
+
F.value ? (a(), s("div", Ts, [
|
|
837
|
+
e("div", Ls, [
|
|
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,
|
|
846
|
+
e("span", null, n(S(_.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,
|
|
857
|
+
e("span", null, n(S(_.value.retweets || 0)), 1)
|
|
858
858
|
]),
|
|
859
|
-
e("div",
|
|
859
|
+
e("div", Ps, [
|
|
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,
|
|
868
|
+
e("span", null, n(S(_.value.likes || 0)), 1)
|
|
869
869
|
]),
|
|
870
|
-
e("div",
|
|
870
|
+
e("div", Hs, [
|
|
871
871
|
k[5] || (k[5] = e("svg", {
|
|
872
872
|
viewBox: "0 0 24 24",
|
|
873
873
|
fill: "none",
|
|
@@ -876,25 +876,25 @@ 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,
|
|
879
|
+
e("span", null, n(S(_.value.views || 0)), 1)
|
|
880
880
|
])
|
|
881
881
|
])) : v("", !0)
|
|
882
|
-
], 64)) :
|
|
883
|
-
e("div",
|
|
882
|
+
], 64)) : B.value === "linkedin" ? (a(), s(R, { key: 1 }, [
|
|
883
|
+
e("div", Bs, [
|
|
884
884
|
e("img", {
|
|
885
|
-
src:
|
|
886
|
-
alt:
|
|
885
|
+
src: y.value.avatar || _e,
|
|
886
|
+
alt: y.value.name,
|
|
887
887
|
class: "artifactuse-social-avatar",
|
|
888
|
-
onError:
|
|
889
|
-
}, null, 40,
|
|
890
|
-
e("div",
|
|
891
|
-
e("div",
|
|
892
|
-
K(
|
|
893
|
-
|
|
888
|
+
onError: Z
|
|
889
|
+
}, null, 40, Es),
|
|
890
|
+
e("div", Ss, [
|
|
891
|
+
e("div", zs, [
|
|
892
|
+
K(n(y.value.name) + " ", 1),
|
|
893
|
+
y.value.connection ? (a(), s("span", Is, "· " + n(y.value.connection), 1)) : v("", !0)
|
|
894
894
|
]),
|
|
895
|
-
e("div",
|
|
896
|
-
e("div",
|
|
897
|
-
K(
|
|
895
|
+
e("div", Fs, n(y.value.headline), 1),
|
|
896
|
+
e("div", Vs, [
|
|
897
|
+
K(n(x.value.timestamp || "Just now") + " · ", 1),
|
|
898
898
|
k[6] || (k[6] = e("svg", {
|
|
899
899
|
viewBox: "0 0 24 24",
|
|
900
900
|
fill: "currentColor"
|
|
@@ -904,80 +904,80 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
904
904
|
])
|
|
905
905
|
])
|
|
906
906
|
]),
|
|
907
|
-
e("div",
|
|
907
|
+
e("div", Rs, [
|
|
908
908
|
e("p", {
|
|
909
909
|
class: "artifactuse-social-text",
|
|
910
910
|
innerHTML: W.value
|
|
911
|
-
}, null, 8,
|
|
912
|
-
|
|
913
|
-
|
|
911
|
+
}, null, 8, qs),
|
|
912
|
+
l.value.link ? (a(), s("div", Os, [
|
|
913
|
+
l.value.link.image ? (a(), s("img", {
|
|
914
914
|
key: 0,
|
|
915
|
-
src:
|
|
916
|
-
alt:
|
|
915
|
+
src: l.value.link.image,
|
|
916
|
+
alt: l.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, Us)) : v("", !0),
|
|
920
|
+
e("div", Ds, [
|
|
921
|
+
e("div", js, n(l.value.link.title), 1),
|
|
922
|
+
e("div", Ns, n(l.value.link.domain || ie(l.value.link.url)), 1)
|
|
923
923
|
])
|
|
924
924
|
])) : v("", !0)
|
|
925
925
|
]),
|
|
926
|
-
F.value ? (a(), s("div",
|
|
927
|
-
e("div",
|
|
926
|
+
F.value ? (a(), s("div", Ws, [
|
|
927
|
+
e("div", Js, [
|
|
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,
|
|
933
|
+
e("span", null, n(S(_.value.likes || 0)), 1)
|
|
934
934
|
]),
|
|
935
|
-
e("span", null,
|
|
935
|
+
e("span", null, n(S(_.value.comments || 0)) + " comments · " + n(S(_.value.shares || 0)) + " shares", 1)
|
|
936
936
|
])) : v("", !0)
|
|
937
|
-
], 64)) :
|
|
938
|
-
e("div",
|
|
937
|
+
], 64)) : B.value === "instagram" ? (a(), s(R, { key: 2 }, [
|
|
938
|
+
e("div", Xs, [
|
|
939
939
|
e("img", {
|
|
940
|
-
src:
|
|
941
|
-
alt:
|
|
940
|
+
src: y.value.avatar || _e,
|
|
941
|
+
alt: y.value.name,
|
|
942
942
|
class: "artifactuse-social-avatar",
|
|
943
|
-
onError:
|
|
944
|
-
}, null, 40,
|
|
945
|
-
e("div",
|
|
946
|
-
K(
|
|
947
|
-
|
|
943
|
+
onError: Z
|
|
944
|
+
}, null, 40, Zs),
|
|
945
|
+
e("div", Ks, [
|
|
946
|
+
K(n(y.value.name) + " ", 1),
|
|
947
|
+
y.value.verified ? (a(), s("svg", Ys, [...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 = l.value.media) != null && L.length ? (a(), s("div", Qs, [
|
|
953
953
|
e("img", {
|
|
954
|
-
src:
|
|
955
|
-
alt:
|
|
956
|
-
onError:
|
|
957
|
-
}, null, 40,
|
|
954
|
+
src: l.value.media[0].url,
|
|
955
|
+
alt: l.value.media[0].alt || "",
|
|
956
|
+
onError: X
|
|
957
|
+
}, null, 40, Gs)
|
|
958
958
|
])) : v("", !0),
|
|
959
|
-
k[9] || (k[9] =
|
|
960
|
-
e("div",
|
|
961
|
-
e("div",
|
|
962
|
-
e("span",
|
|
959
|
+
k[9] || (k[9] = qt('<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", ei, n(S(_.value.likes || 0)) + " likes", 1),
|
|
961
|
+
e("div", ti, [
|
|
962
|
+
e("span", ai, n(y.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, si)
|
|
967
967
|
]),
|
|
968
|
-
e("div",
|
|
969
|
-
], 64)) :
|
|
970
|
-
e("div",
|
|
968
|
+
e("div", ii, n(x.value.timestamp || "Just now"), 1)
|
|
969
|
+
], 64)) : B.value === "facebook" ? (a(), s(R, { key: 3 }, [
|
|
970
|
+
e("div", li, [
|
|
971
971
|
e("img", {
|
|
972
|
-
src:
|
|
973
|
-
alt:
|
|
972
|
+
src: y.value.avatar || _e,
|
|
973
|
+
alt: y.value.name,
|
|
974
974
|
class: "artifactuse-social-avatar",
|
|
975
|
-
onError:
|
|
976
|
-
}, null, 40,
|
|
977
|
-
e("div",
|
|
978
|
-
e("div",
|
|
979
|
-
e("div",
|
|
980
|
-
K(
|
|
975
|
+
onError: Z
|
|
976
|
+
}, null, 40, ni),
|
|
977
|
+
e("div", oi, [
|
|
978
|
+
e("div", ri, n(y.value.name), 1),
|
|
979
|
+
e("div", ci, [
|
|
980
|
+
K(n(x.value.timestamp || "Just now") + " · ", 1),
|
|
981
981
|
k[10] || (k[10] = e("svg", {
|
|
982
982
|
viewBox: "0 0 24 24",
|
|
983
983
|
fill: "currentColor"
|
|
@@ -987,63 +987,63 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
987
987
|
])
|
|
988
988
|
])
|
|
989
989
|
]),
|
|
990
|
-
e("div",
|
|
990
|
+
e("div", ui, [
|
|
991
991
|
e("p", {
|
|
992
992
|
class: "artifactuse-social-text",
|
|
993
993
|
innerHTML: W.value
|
|
994
|
-
}, null, 8,
|
|
995
|
-
|
|
996
|
-
|
|
994
|
+
}, null, 8, di),
|
|
995
|
+
l.value.link ? (a(), s("div", vi, [
|
|
996
|
+
l.value.link.image ? (a(), s("img", {
|
|
997
997
|
key: 0,
|
|
998
|
-
src:
|
|
999
|
-
alt:
|
|
998
|
+
src: l.value.link.image,
|
|
999
|
+
alt: l.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
|
-
|
|
1001
|
+
onError: X
|
|
1002
|
+
}, null, 40, fi)) : v("", !0),
|
|
1003
|
+
e("div", pi, [
|
|
1004
|
+
e("div", _i, n(l.value.link.domain || ie(l.value.link.url)), 1),
|
|
1005
|
+
e("div", hi, n(l.value.link.title), 1),
|
|
1006
|
+
l.value.link.description ? (a(), s("div", mi, n(l.value.link.description), 1)) : v("", !0)
|
|
1007
1007
|
])
|
|
1008
1008
|
])) : v("", !0)
|
|
1009
1009
|
]),
|
|
1010
|
-
F.value ? (a(), s("div",
|
|
1011
|
-
e("div",
|
|
1010
|
+
F.value ? (a(), s("div", yi, [
|
|
1011
|
+
e("div", gi, [
|
|
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", ki, n(S(Y.value)), 1)
|
|
1018
1018
|
]),
|
|
1019
|
-
e("span",
|
|
1019
|
+
e("span", wi, n(S(_.value.comments || 0)) + " comments · " + n(S(_.value.shares || 0)) + " shares", 1)
|
|
1020
1020
|
])) : v("", !0)
|
|
1021
|
-
], 64)) :
|
|
1022
|
-
e("div",
|
|
1021
|
+
], 64)) : B.value === "threads" ? (a(), s(R, { key: 4 }, [
|
|
1022
|
+
e("div", bi, [
|
|
1023
1023
|
e("img", {
|
|
1024
|
-
src:
|
|
1025
|
-
alt:
|
|
1024
|
+
src: y.value.avatar || _e,
|
|
1025
|
+
alt: y.value.name,
|
|
1026
1026
|
class: "artifactuse-social-avatar",
|
|
1027
|
-
onError:
|
|
1028
|
-
}, null, 40,
|
|
1029
|
-
e("div",
|
|
1030
|
-
e("div",
|
|
1031
|
-
K(
|
|
1032
|
-
|
|
1027
|
+
onError: Z
|
|
1028
|
+
}, null, 40, Ci),
|
|
1029
|
+
e("div", xi, [
|
|
1030
|
+
e("div", $i, [
|
|
1031
|
+
K(n(y.value.name) + " ", 1),
|
|
1032
|
+
y.value.verified ? (a(), s("svg", Mi, [...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", Ti, n(x.value.timestamp || "Just now"), 1)
|
|
1037
1037
|
])
|
|
1038
1038
|
]),
|
|
1039
|
-
e("div",
|
|
1039
|
+
e("div", Li, [
|
|
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
|
-
F.value ? (a(), s("div",
|
|
1046
|
-
e("div",
|
|
1045
|
+
F.value ? (a(), s("div", Pi, [
|
|
1046
|
+
e("div", Hi, [
|
|
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,
|
|
1055
|
+
e("span", null, n(S(_.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,
|
|
1066
|
+
e("span", null, n(S(_.value.comments || 0)), 1)
|
|
1067
1067
|
]),
|
|
1068
|
-
e("div",
|
|
1068
|
+
e("div", Ei, [
|
|
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,
|
|
1077
|
+
e("span", null, n(S(_.value.shares || 0)), 1)
|
|
1078
1078
|
])
|
|
1079
1079
|
])) : v("", !0)
|
|
1080
|
-
], 64)) :
|
|
1081
|
-
e("div",
|
|
1082
|
-
|
|
1080
|
+
], 64)) : B.value === "tiktok" ? (a(), s(R, { key: 5 }, [
|
|
1081
|
+
e("div", Si, [
|
|
1082
|
+
l.value.thumbnail ? (a(), s("img", {
|
|
1083
1083
|
key: 0,
|
|
1084
|
-
src:
|
|
1085
|
-
alt:
|
|
1086
|
-
onError:
|
|
1087
|
-
}, null, 40,
|
|
1084
|
+
src: l.value.thumbnail,
|
|
1085
|
+
alt: l.value.text,
|
|
1086
|
+
onError: X
|
|
1087
|
+
}, null, 40, zi)) : 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,65 +1095,65 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
1095
1095
|
])
|
|
1096
1096
|
])
|
|
1097
1097
|
], -1)),
|
|
1098
|
-
|
|
1098
|
+
l.value.duration ? (a(), s("div", Ii, n(l.value.duration), 1)) : v("", !0)
|
|
1099
1099
|
]),
|
|
1100
|
-
e("div",
|
|
1101
|
-
e("div",
|
|
1100
|
+
e("div", Fi, [
|
|
1101
|
+
e("div", Vi, [
|
|
1102
1102
|
e("img", {
|
|
1103
|
-
src:
|
|
1104
|
-
alt:
|
|
1103
|
+
src: y.value.avatar || _e,
|
|
1104
|
+
alt: y.value.name,
|
|
1105
1105
|
class: "artifactuse-social-avatar",
|
|
1106
|
-
onError:
|
|
1107
|
-
}, null, 40,
|
|
1108
|
-
e("span",
|
|
1106
|
+
onError: Z
|
|
1107
|
+
}, null, 40, Ri),
|
|
1108
|
+
e("span", qi, n(y.value.name), 1)
|
|
1109
1109
|
]),
|
|
1110
1110
|
e("p", {
|
|
1111
1111
|
class: "artifactuse-social-text",
|
|
1112
1112
|
innerHTML: W.value
|
|
1113
|
-
}, null, 8,
|
|
1114
|
-
|
|
1113
|
+
}, null, 8, Oi),
|
|
1114
|
+
l.value.sound ? (a(), s("div", Ui, [
|
|
1115
1115
|
k[17] || (k[17] = e("svg", {
|
|
1116
1116
|
viewBox: "0 0 24 24",
|
|
1117
1117
|
fill: "currentColor"
|
|
1118
1118
|
}, [
|
|
1119
1119
|
e("path", { d: "M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z" })
|
|
1120
1120
|
], -1)),
|
|
1121
|
-
K(" " + l
|
|
1121
|
+
K(" " + n(l.value.sound), 1)
|
|
1122
1122
|
])) : v("", !0),
|
|
1123
|
-
F.value ? (a(), s("div",
|
|
1124
|
-
e("span", null,
|
|
1125
|
-
e("span", null,
|
|
1126
|
-
e("span", null,
|
|
1123
|
+
F.value ? (a(), s("div", Di, [
|
|
1124
|
+
e("span", null, n(S(_.value.likes || 0)) + " likes", 1),
|
|
1125
|
+
e("span", null, n(S(_.value.comments || 0)) + " comments", 1),
|
|
1126
|
+
e("span", null, n(S(_.value.shares || 0)) + " shares", 1)
|
|
1127
1127
|
])) : v("", !0)
|
|
1128
1128
|
])
|
|
1129
|
-
], 64)) :
|
|
1130
|
-
e("div",
|
|
1131
|
-
|
|
1129
|
+
], 64)) : B.value === "youtube" ? (a(), s(R, { key: 6 }, [
|
|
1130
|
+
e("div", ji, [
|
|
1131
|
+
l.value.thumbnail ? (a(), s("img", {
|
|
1132
1132
|
key: 0,
|
|
1133
|
-
src:
|
|
1134
|
-
alt:
|
|
1135
|
-
onError:
|
|
1136
|
-
}, null, 40,
|
|
1137
|
-
|
|
1133
|
+
src: l.value.thumbnail,
|
|
1134
|
+
alt: l.value.title,
|
|
1135
|
+
onError: X
|
|
1136
|
+
}, null, 40, Ni)) : v("", !0),
|
|
1137
|
+
l.value.duration ? (a(), s("div", Wi, n(l.value.duration), 1)) : v("", !0)
|
|
1138
1138
|
]),
|
|
1139
|
-
e("div",
|
|
1139
|
+
e("div", Ji, [
|
|
1140
1140
|
e("img", {
|
|
1141
|
-
src:
|
|
1142
|
-
alt:
|
|
1141
|
+
src: y.value.avatar || _e,
|
|
1142
|
+
alt: y.value.name,
|
|
1143
1143
|
class: "artifactuse-social-avatar",
|
|
1144
|
-
onError:
|
|
1145
|
-
}, null, 40,
|
|
1144
|
+
onError: Z
|
|
1145
|
+
}, null, 40, Xi),
|
|
1146
1146
|
e("div", null, [
|
|
1147
|
-
e("div",
|
|
1148
|
-
e("div",
|
|
1149
|
-
e("div",
|
|
1147
|
+
e("div", Zi, n(l.value.title || l.value.text), 1),
|
|
1148
|
+
e("div", Ki, n(y.value.name), 1),
|
|
1149
|
+
e("div", Yi, n(S(_.value.views || 0)) + " views · " + n(x.value.timestamp || "Just now"), 1)
|
|
1150
1150
|
])
|
|
1151
1151
|
])
|
|
1152
1152
|
], 64)) : v("", !0),
|
|
1153
|
-
e("div",
|
|
1154
|
-
e("div",
|
|
1155
|
-
(a(), xe(
|
|
1156
|
-
e("span", null,
|
|
1153
|
+
e("div", Qi, [
|
|
1154
|
+
e("div", Gi, [
|
|
1155
|
+
(a(), xe(Ot(O.value))),
|
|
1156
|
+
e("span", null, n(j.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(" " +
|
|
1178
|
+
K(" " + n(o.value), 1)
|
|
1179
1179
|
])
|
|
1180
1180
|
])
|
|
1181
|
-
], 10,
|
|
1181
|
+
], 10, Qa);
|
|
1182
1182
|
};
|
|
1183
1183
|
}
|
|
1184
|
-
},
|
|
1184
|
+
}, tl = ["src", "alt"], al = ["src"], sl = {
|
|
1185
1185
|
key: 2,
|
|
1186
1186
|
class: "artifactuse-viewer-controls"
|
|
1187
|
-
},
|
|
1187
|
+
}, il = ["title"], ll = {
|
|
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
|
+
}, nl = {
|
|
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
|
+
}, ol = {
|
|
1200
1200
|
key: 3,
|
|
1201
1201
|
class: "artifactuse-viewer-caption"
|
|
1202
|
-
},
|
|
1202
|
+
}, rl = {
|
|
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
|
|
1234
|
-
function
|
|
1235
|
-
|
|
1232
|
+
setup(H, { emit: c }) {
|
|
1233
|
+
const h = H, T = c, m = M(null), o = M(!1);
|
|
1234
|
+
function q() {
|
|
1235
|
+
o.value = !1, T("close");
|
|
1236
1236
|
}
|
|
1237
|
-
function
|
|
1238
|
-
|
|
1237
|
+
function B() {
|
|
1238
|
+
h.type === "image" && (o.value = !o.value);
|
|
1239
1239
|
}
|
|
1240
|
-
function
|
|
1241
|
-
const
|
|
1242
|
-
|
|
1240
|
+
function y() {
|
|
1241
|
+
const _ = document.createElement("a");
|
|
1242
|
+
_.href = h.src, _.download = h.alt || "download", document.body.appendChild(_), _.click(), document.body.removeChild(_);
|
|
1243
1243
|
}
|
|
1244
|
-
function
|
|
1245
|
-
|
|
1244
|
+
function l(_) {
|
|
1245
|
+
_.key === "Escape" && h.isOpen && q();
|
|
1246
1246
|
}
|
|
1247
|
-
return de(() =>
|
|
1248
|
-
|
|
1247
|
+
return de(() => h.isOpen, (_) => {
|
|
1248
|
+
_ ? (Ce(() => {
|
|
1249
1249
|
var x;
|
|
1250
1250
|
(x = m.value) == null || x.focus();
|
|
1251
|
-
}), document.body.style.overflow = "hidden") : (document.body.style.overflow = "",
|
|
1251
|
+
}), document.body.style.overflow = "hidden") : (document.body.style.overflow = "", o.value = !1);
|
|
1252
1252
|
}), $e(() => {
|
|
1253
|
-
document.addEventListener("keydown",
|
|
1254
|
-
}),
|
|
1255
|
-
document.removeEventListener("keydown",
|
|
1256
|
-
}), (
|
|
1257
|
-
|
|
1258
|
-
default:
|
|
1253
|
+
document.addEventListener("keydown", l);
|
|
1254
|
+
}), Ne(() => {
|
|
1255
|
+
document.removeEventListener("keydown", l), document.body.style.overflow = "";
|
|
1256
|
+
}), (_, x) => (a(), xe(Ut, { to: "body" }, [
|
|
1257
|
+
Se(He, { 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: Dt(q, ["escape"]),
|
|
1264
1264
|
tabindex: "-1",
|
|
1265
1265
|
ref_key: "overlayRef",
|
|
1266
1266
|
ref: m
|
|
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: N(["artifactuse-viewer-image", { "artifactuse-viewer-image--zoomed":
|
|
1278
|
-
onClick:
|
|
1279
|
-
}, null, 10,
|
|
1277
|
+
class: N(["artifactuse-viewer-image", { "artifactuse-viewer-image--zoomed": o.value }]),
|
|
1278
|
+
onClick: B
|
|
1279
|
+
}, null, 10, tl)) : 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, al)) : 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", sl, [
|
|
1310
1310
|
e("button", {
|
|
1311
1311
|
class: "artifactuse-viewer-control",
|
|
1312
|
-
onClick:
|
|
1313
|
-
title:
|
|
1312
|
+
onClick: he(B, ["stop"]),
|
|
1313
|
+
title: o.value ? "Zoom out" : "Zoom in"
|
|
1314
1314
|
}, [
|
|
1315
|
-
|
|
1315
|
+
o.value ? (a(), s("svg", nl, [...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", ll, [...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, il),
|
|
1359
1359
|
e("button", {
|
|
1360
1360
|
class: "artifactuse-viewer-control",
|
|
1361
|
-
onClick:
|
|
1361
|
+
onClick: he(y, ["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", ol, n(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
|
+
}, cl = ["innerHTML"], Gn = {
|
|
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:
|
|
1456
|
-
instance:
|
|
1457
|
-
} =
|
|
1450
|
+
setup(H, { expose: c, emit: h }) {
|
|
1451
|
+
const T = H, m = h, {
|
|
1452
|
+
processMessage: o,
|
|
1453
|
+
openArtifact: q,
|
|
1454
|
+
state: B,
|
|
1455
|
+
getTheme: y,
|
|
1456
|
+
instance: l
|
|
1457
|
+
} = ze(), _ = M(null), x = M(null), F = M(""), $ = M([]);
|
|
1458
1458
|
let j = null;
|
|
1459
|
-
const
|
|
1460
|
-
var
|
|
1461
|
-
return
|
|
1462
|
-
}),
|
|
1459
|
+
const O = M(!1), W = M("image"), Y = M(""), S = M(""), ie = M(""), Z = C(() => (y == null ? void 0 : y()) || "dark"), X = C(() => B.activeArtifactId), oe = C(() => {
|
|
1460
|
+
var b;
|
|
1461
|
+
return T.inlineCards ?? ((b = l == null ? void 0 : l.config) == null ? void 0 : b.inlineCards) ?? !0;
|
|
1462
|
+
}), p = M(!1);
|
|
1463
1463
|
$e(() => {
|
|
1464
|
-
|
|
1465
|
-
}), de(() =>
|
|
1466
|
-
|
|
1464
|
+
T.typing && (p.value = !0);
|
|
1465
|
+
}), de(() => T.typing, (b) => {
|
|
1466
|
+
b && (p.value = !0);
|
|
1467
1467
|
});
|
|
1468
|
-
const k =
|
|
1469
|
-
function ee(
|
|
1470
|
-
if (!
|
|
1468
|
+
const k = C(() => p.value || T.isLastMessage ? "active" : "inactive");
|
|
1469
|
+
function ee(b) {
|
|
1470
|
+
if (!b) return null;
|
|
1471
1471
|
try {
|
|
1472
|
-
const I = decodeURIComponent(escape(atob(
|
|
1472
|
+
const I = decodeURIComponent(escape(atob(b)));
|
|
1473
1473
|
return JSON.parse(I);
|
|
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,496 +1481,508 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
1481
1481
|
}
|
|
1482
1482
|
}
|
|
1483
1483
|
}
|
|
1484
|
-
const re =
|
|
1485
|
-
const
|
|
1486
|
-
if (!I) return
|
|
1484
|
+
const re = C(() => {
|
|
1485
|
+
const b = [], I = F.value;
|
|
1486
|
+
if (!I) return b;
|
|
1487
1487
|
const D = /<div\s+class="artifactuse-placeholder[^"]*"[^>]*data-artifact-id="([^"]+)"[^>]*data-artifact-type="([^"]+)"[^>]*data-artifact=["']([^"']*)["'][^>]*><\/div>/gi;
|
|
1488
|
-
let te = 0,
|
|
1489
|
-
for (; (
|
|
1490
|
-
if (
|
|
1491
|
-
const
|
|
1492
|
-
|
|
1488
|
+
let te = 0, P;
|
|
1489
|
+
for (; (P = D.exec(I)) !== null; ) {
|
|
1490
|
+
if (P.index > te) {
|
|
1491
|
+
const U = I.slice(te, P.index);
|
|
1492
|
+
U.trim() && b.push({ type: "html", content: U });
|
|
1493
1493
|
}
|
|
1494
|
-
const ae = ee(
|
|
1495
|
-
ae && (
|
|
1494
|
+
const ae = ee(P[3]), d = P[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 = P.index + P[0].length;
|
|
1496
1496
|
}
|
|
1497
1497
|
if (te < I.length) {
|
|
1498
1498
|
const ae = I.slice(te);
|
|
1499
|
-
ae.trim() &&
|
|
1499
|
+
ae.trim() && b.push({ type: "html", content: ae });
|
|
1500
1500
|
}
|
|
1501
|
-
return
|
|
1501
|
+
return b.length === 0 && I.trim() && b.push({ type: "html", content: I }), b;
|
|
1502
1502
|
});
|
|
1503
|
-
function
|
|
1504
|
-
W.value =
|
|
1503
|
+
function A(b) {
|
|
1504
|
+
W.value = b.type || "image", Y.value = b.src || "", S.value = b.alt || "", ie.value = b.caption || "", O.value = !0, m("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(), A({
|
|
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 =
|
|
1524
|
-
|
|
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
|
+
A({
|
|
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 =
|
|
1535
|
-
|
|
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
|
+
A({
|
|
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(), A({
|
|
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
|
-
|
|
1556
|
-
ce.preventDefault(), ce.stopPropagation(),
|
|
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
|
+
ce.preventDefault(), ce.stopPropagation(), A({
|
|
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
|
-
x.value.querySelectorAll("img").forEach((
|
|
1574
|
-
|
|
1575
|
-
}), x.value.querySelectorAll('a[href$=".pdf"], a[data-type="pdf"]').forEach((
|
|
1576
|
-
|
|
1577
|
-
}), x.value.querySelectorAll(".artifactuse-pdf-container, [data-pdf-viewer]").forEach((
|
|
1578
|
-
|
|
1579
|
-
}), x.value.querySelectorAll(".artifactuse-video-preview-wrapper, .video-preview-wrapper").forEach((
|
|
1580
|
-
|
|
1573
|
+
x.value.querySelectorAll("img").forEach((P) => {
|
|
1574
|
+
P._lightboxHandler && (P.removeEventListener("click", P._lightboxHandler), delete P._lightboxHandler);
|
|
1575
|
+
}), x.value.querySelectorAll('a[href$=".pdf"], a[data-type="pdf"]').forEach((P) => {
|
|
1576
|
+
P._pdfHandler && (P.removeEventListener("click", P._pdfHandler), delete P._pdfHandler);
|
|
1577
|
+
}), x.value.querySelectorAll(".artifactuse-pdf-container, [data-pdf-viewer]").forEach((P) => {
|
|
1578
|
+
P._pdfHandler && (P.removeEventListener("click", P._pdfHandler), delete P._pdfHandler);
|
|
1579
|
+
}), x.value.querySelectorAll(".artifactuse-video-preview-wrapper, .video-preview-wrapper").forEach((P) => {
|
|
1580
|
+
P._clickHandler && (P.removeEventListener("click", P._clickHandler), delete P._clickHandler);
|
|
1581
1581
|
});
|
|
1582
1582
|
}
|
|
1583
|
-
function
|
|
1583
|
+
function r() {
|
|
1584
1584
|
j && clearTimeout(j), j = setTimeout(async () => {
|
|
1585
|
-
if (await
|
|
1585
|
+
if (await Ce(), l != null && l.initializeContent && x.value)
|
|
1586
1586
|
try {
|
|
1587
|
-
await
|
|
1588
|
-
} catch (
|
|
1589
|
-
console.error("Failed to initialize content:",
|
|
1587
|
+
await l.initializeContent(x.value);
|
|
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 I =
|
|
1599
|
-
inlinePreview:
|
|
1600
|
-
inlineCode:
|
|
1601
|
-
tabs:
|
|
1602
|
-
viewMode:
|
|
1595
|
+
() => T.content,
|
|
1596
|
+
(b) => {
|
|
1597
|
+
if (b) {
|
|
1598
|
+
const I = o(b, T.messageId, {
|
|
1599
|
+
inlinePreview: T.inlinePreview,
|
|
1600
|
+
inlineCode: T.inlineCode,
|
|
1601
|
+
tabs: T.tabs,
|
|
1602
|
+
viewMode: T.viewMode
|
|
1603
1603
|
});
|
|
1604
|
-
F.value = I.html, $.value = I.artifacts, I.artifacts.length > 0 && m("artifact-detected", I.artifacts),
|
|
1604
|
+
F.value = I.html, $.value = I.artifacts, I.artifacts.length > 0 && m("artifact-detected", I.artifacts), T.typing || r();
|
|
1605
1605
|
}
|
|
1606
1606
|
},
|
|
1607
1607
|
{ immediate: !0 }
|
|
1608
1608
|
), de(
|
|
1609
|
-
() =>
|
|
1610
|
-
(
|
|
1611
|
-
I === !0 &&
|
|
1609
|
+
() => T.typing,
|
|
1610
|
+
(b, I) => {
|
|
1611
|
+
I === !0 && b === !1 && r();
|
|
1612
1612
|
}
|
|
1613
1613
|
), $e(() => {
|
|
1614
|
-
|
|
1615
|
-
}),
|
|
1616
|
-
j && clearTimeout(j),
|
|
1614
|
+
T.typing || r();
|
|
1615
|
+
}), jt(() => {
|
|
1616
|
+
j && clearTimeout(j), L();
|
|
1617
1617
|
});
|
|
1618
|
-
function
|
|
1619
|
-
const I =
|
|
1618
|
+
function E(b) {
|
|
1619
|
+
const I = b.target.closest(".artifactuse-inline-preview");
|
|
1620
1620
|
if (I) {
|
|
1621
1621
|
if (I.dataset.nonClickable) return;
|
|
1622
1622
|
const D = I.dataset.artifactId;
|
|
1623
1623
|
if (D) {
|
|
1624
|
-
const te =
|
|
1625
|
-
te &&
|
|
1624
|
+
const te = B.artifacts.find((P) => P.id === D);
|
|
1625
|
+
te && u(te);
|
|
1626
1626
|
}
|
|
1627
1627
|
}
|
|
1628
1628
|
}
|
|
1629
|
-
function
|
|
1630
|
-
|
|
1629
|
+
function u(b) {
|
|
1630
|
+
q(b), m("artifact-open", b);
|
|
1631
1631
|
}
|
|
1632
|
-
function z(
|
|
1633
|
-
m("artifact-copy",
|
|
1632
|
+
function z(b) {
|
|
1633
|
+
m("artifact-copy", b);
|
|
1634
1634
|
}
|
|
1635
|
-
function le(
|
|
1636
|
-
m("artifact-download",
|
|
1635
|
+
function le(b) {
|
|
1636
|
+
m("artifact-download", b);
|
|
1637
1637
|
}
|
|
1638
|
-
function pe(
|
|
1639
|
-
m("form-submit",
|
|
1638
|
+
function pe(b) {
|
|
1639
|
+
m("form-submit", b);
|
|
1640
1640
|
}
|
|
1641
|
-
function ye(
|
|
1642
|
-
m("form-cancel",
|
|
1641
|
+
function ye(b) {
|
|
1642
|
+
m("form-cancel", b);
|
|
1643
1643
|
}
|
|
1644
|
-
function fe(
|
|
1645
|
-
m("form-button-click",
|
|
1644
|
+
function fe(b) {
|
|
1645
|
+
m("form-button-click", b);
|
|
1646
1646
|
}
|
|
1647
|
-
function Le(
|
|
1648
|
-
m("social-copy",
|
|
1647
|
+
function Le(b) {
|
|
1648
|
+
m("social-copy", b);
|
|
1649
1649
|
}
|
|
1650
|
-
return
|
|
1651
|
-
openViewer:
|
|
1650
|
+
return C(() => B.artifacts.filter((b) => b.messageId === T.messageId)), c({
|
|
1651
|
+
openViewer: A,
|
|
1652
1652
|
closeViewer: Q,
|
|
1653
1653
|
attachMediaListeners: w
|
|
1654
|
-
}), (
|
|
1654
|
+
}), (b, I) => (a(), s("div", {
|
|
1655
1655
|
class: "artifactuse-agent-message",
|
|
1656
1656
|
ref_key: "messageRef",
|
|
1657
|
-
ref:
|
|
1657
|
+
ref: _
|
|
1658
1658
|
}, [
|
|
1659
1659
|
e("div", {
|
|
1660
1660
|
class: "artifactuse-message-content",
|
|
1661
1661
|
ref_key: "contentRef",
|
|
1662
1662
|
ref: x,
|
|
1663
|
-
onClick:
|
|
1663
|
+
onClick: E
|
|
1664
1664
|
}, [
|
|
1665
1665
|
(a(!0), s(R, null, ve(re.value, (D, te) => (a(), s(R, { key: te }, [
|
|
1666
1666
|
D.type === "html" ? (a(), s("div", {
|
|
1667
1667
|
key: 0,
|
|
1668
1668
|
innerHTML: D.content
|
|
1669
|
-
}, null, 8,
|
|
1669
|
+
}, null, 8, cl)) : D.type === "form" && D.artifact.isInline ? (a(), xe(Ya, {
|
|
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(), xe(
|
|
1677
|
+
}, null, 8, ["artifact", "theme", "initial-state"])) : D.type === "social" ? (a(), xe(el, {
|
|
1678
1678
|
key: 2,
|
|
1679
1679
|
artifact: D.artifact,
|
|
1680
|
-
theme:
|
|
1680
|
+
theme: Z.value,
|
|
1681
1681
|
onCopy: Le
|
|
1682
|
-
}, null, 8, ["artifact", "theme"])) : D.type === "panel" && oe.value ? (a(), xe(
|
|
1682
|
+
}, null, 8, ["artifact", "theme"])) : D.type === "panel" && oe.value ? (a(), xe(ra, {
|
|
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
|
+
Se(rl, {
|
|
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
|
+
}, ul = { class: "artifactuse-panel__header artifactuse-panel__header--simple" }, dl = { class: "artifactuse-panel__actions" }, vl = { class: "artifactuse-panel__footer artifactuse-panel__footer--simple" }, fl = {
|
|
1703
1703
|
key: 0,
|
|
1704
1704
|
href: "https://artifactuse.com",
|
|
1705
1705
|
target: "_blank",
|
|
1706
1706
|
rel: "noopener noreferrer",
|
|
1707
1707
|
class: "artifactuse-panel__branding"
|
|
1708
|
-
},
|
|
1708
|
+
}, pl = { class: "artifactuse-panel__header artifactuse-panel__header--simple" }, _l = { class: "artifactuse-panel__title" }, hl = { class: "artifactuse-panel__title-content" }, ml = { class: "artifactuse-panel__meta" }, yl = { class: "artifactuse-panel__actions" }, gl = ["disabled"], kl = {
|
|
1709
1709
|
key: 0,
|
|
1710
1710
|
viewBox: "0 0 24 24",
|
|
1711
1711
|
fill: "none",
|
|
1712
1712
|
stroke: "currentColor",
|
|
1713
1713
|
"stroke-width": "2"
|
|
1714
|
-
},
|
|
1714
|
+
}, wl = {
|
|
1715
1715
|
key: 1,
|
|
1716
1716
|
class: "artifactuse-panel__spinner-icon",
|
|
1717
1717
|
viewBox: "0 0 24 24",
|
|
1718
1718
|
fill: "none",
|
|
1719
1719
|
stroke: "currentColor",
|
|
1720
1720
|
"stroke-width": "2"
|
|
1721
|
-
},
|
|
1721
|
+
}, bl = { class: "artifactuse-panel__list" }, Cl = { class: "artifactuse-panel__list-items" }, xl = ["onClick"], $l = ["innerHTML"], Ml = { class: "artifactuse-panel__list-item-content" }, Tl = { class: "artifactuse-panel__list-item-title" }, Ll = { class: "artifactuse-panel__list-item-meta" }, Al = { class: "artifactuse-panel__footer artifactuse-panel__footer--simple" }, Pl = {
|
|
1722
1722
|
key: 0,
|
|
1723
1723
|
href: "https://artifactuse.com",
|
|
1724
1724
|
target: "_blank",
|
|
1725
1725
|
rel: "noopener noreferrer",
|
|
1726
1726
|
class: "artifactuse-panel__branding"
|
|
1727
|
-
},
|
|
1727
|
+
}, Hl = { class: "artifactuse-panel__header" }, Bl = ["title"], El = { class: "artifactuse-panel__title" }, Sl = ["innerHTML"], zl = { class: "artifactuse-panel__title-content" }, Il = { class: "artifactuse-panel__name" }, Fl = { class: "artifactuse-panel__meta" }, Vl = { class: "artifactuse-panel__tabs" }, Rl = ["disabled"], ql = ["disabled"], Ol = { class: "artifactuse-panel__actions" }, Ul = ["title"], Dl = {
|
|
1728
1728
|
key: 0,
|
|
1729
1729
|
viewBox: "0 0 24 24",
|
|
1730
1730
|
fill: "none",
|
|
1731
1731
|
stroke: "currentColor",
|
|
1732
1732
|
"stroke-width": "2"
|
|
1733
|
-
},
|
|
1733
|
+
}, jl = {
|
|
1734
1734
|
key: 1,
|
|
1735
1735
|
viewBox: "0 0 24 24",
|
|
1736
1736
|
fill: "none",
|
|
1737
1737
|
stroke: "currentColor",
|
|
1738
1738
|
"stroke-width": "2"
|
|
1739
|
-
},
|
|
1739
|
+
}, Nl = {
|
|
1740
|
+
key: 0,
|
|
1741
|
+
class: "artifactuse-panel__file-tabs"
|
|
1742
|
+
}, Wl = { class: "artifactuse-panel__file-tabs-scroll" }, Jl = ["onClick"], Xl = ["innerHTML"], Zl = { class: "artifactuse-panel__file-tab-title" }, Kl = ["onClick"], Yl = {
|
|
1740
1743
|
key: 0,
|
|
1741
1744
|
class: "artifactuse-panel__loading"
|
|
1742
|
-
},
|
|
1745
|
+
}, Ql = {
|
|
1743
1746
|
key: 0,
|
|
1744
1747
|
class: "artifactuse-panel__loading"
|
|
1745
|
-
},
|
|
1748
|
+
}, Gl = ["src"], en = {
|
|
1746
1749
|
key: 2,
|
|
1747
1750
|
class: "artifactuse-panel__no-preview"
|
|
1748
|
-
},
|
|
1751
|
+
}, tn = { class: "artifactuse-panel__edit" }, an = { class: "artifactuse-panel__footer" }, sn = { class: "artifactuse-panel__footer-left" }, ln = {
|
|
1749
1752
|
key: 0,
|
|
1750
1753
|
href: "https://artifactuse.com",
|
|
1751
1754
|
target: "_blank",
|
|
1752
1755
|
rel: "noopener noreferrer",
|
|
1753
1756
|
class: "artifactuse-panel__branding"
|
|
1754
|
-
},
|
|
1757
|
+
}, nn = {
|
|
1755
1758
|
key: 1,
|
|
1756
1759
|
class: "artifactuse-panel__badge"
|
|
1757
|
-
},
|
|
1760
|
+
}, on = { class: "artifactuse-panel__footer-right" }, rn = ["title"], cn = {
|
|
1758
1761
|
key: 0,
|
|
1759
1762
|
viewBox: "0 0 24 24",
|
|
1760
1763
|
fill: "none",
|
|
1761
1764
|
stroke: "currentColor",
|
|
1762
1765
|
"stroke-width": "2"
|
|
1763
|
-
},
|
|
1766
|
+
}, un = {
|
|
1764
1767
|
key: 1,
|
|
1765
1768
|
viewBox: "0 0 24 24",
|
|
1766
1769
|
fill: "none",
|
|
1767
1770
|
stroke: "currentColor",
|
|
1768
1771
|
"stroke-width": "2"
|
|
1769
|
-
},
|
|
1772
|
+
}, dn = {
|
|
1770
1773
|
key: 0,
|
|
1771
1774
|
style: { position: "relative" }
|
|
1772
|
-
},
|
|
1775
|
+
}, vn = {
|
|
1773
1776
|
key: 0,
|
|
1774
1777
|
class: "artifactuse-share-popup"
|
|
1775
|
-
},
|
|
1778
|
+
}, fn = { class: "artifactuse-share-popup__header" }, pn = { class: "artifactuse-share-popup__title" }, _n = { class: "artifactuse-share-popup__body" }, hn = {
|
|
1776
1779
|
key: 0,
|
|
1777
1780
|
class: "artifactuse-share-popup__loading"
|
|
1778
|
-
},
|
|
1781
|
+
}, mn = { key: 1 }, yn = { class: "artifactuse-share-popup__error" }, gn = { class: "artifactuse-share-popup__error-text" }, kn = { class: "artifactuse-share-popup__actions" }, wn = {
|
|
1779
1782
|
key: 2,
|
|
1780
1783
|
class: "artifactuse-share-popup__options"
|
|
1781
|
-
},
|
|
1784
|
+
}, bn = { key: 3 }, Cn = {
|
|
1782
1785
|
key: 0,
|
|
1783
1786
|
class: "artifactuse-share-popup__loading"
|
|
1784
|
-
},
|
|
1787
|
+
}, xn = {
|
|
1785
1788
|
key: 1,
|
|
1786
1789
|
class: "artifactuse-share-popup__empty"
|
|
1787
|
-
},
|
|
1790
|
+
}, $n = {
|
|
1788
1791
|
key: 2,
|
|
1789
1792
|
class: "artifactuse-share-popup__artifact-list"
|
|
1790
|
-
},
|
|
1793
|
+
}, Mn = ["onClick"], Tn = { class: "artifactuse-share-popup__artifact-name" }, Ln = { class: "artifactuse-share-popup__artifact-date" }, An = {
|
|
1791
1794
|
key: 4,
|
|
1792
1795
|
class: "artifactuse-share-popup__success"
|
|
1793
|
-
},
|
|
1796
|
+
}, Pn = { class: "artifactuse-share-popup__link-wrapper" }, Hn = ["value"], Bn = {
|
|
1794
1797
|
key: 0,
|
|
1795
1798
|
class: "artifactuse-share-popup__expiry"
|
|
1796
|
-
},
|
|
1799
|
+
}, En = { class: "artifactuse-share-popup__expiry-text" }, Sn = {
|
|
1797
1800
|
key: 1,
|
|
1798
1801
|
class: "artifactuse-share-popup__save-prompt"
|
|
1799
|
-
},
|
|
1802
|
+
}, zn = {
|
|
1800
1803
|
key: 2,
|
|
1801
1804
|
class: "artifactuse-panel__nav"
|
|
1802
|
-
},
|
|
1805
|
+
}, In = ["disabled"], Fn = ["disabled"], Vn = {
|
|
1803
1806
|
key: 0,
|
|
1804
1807
|
class: "artifactuse-panel__artifact-list"
|
|
1805
|
-
},
|
|
1808
|
+
}, Rn = { class: "artifactuse-panel__artifact-list-header" }, qn = { class: "artifactuse-panel__artifact-list-items" }, On = ["onClick"], Un = ["innerHTML"], Dn = { class: "artifactuse-panel__artifact-item-content" }, jn = { class: "artifactuse-panel__artifact-item-title" }, Nn = { class: "artifactuse-panel__artifact-item-meta" }, Wn = { class: "artifactuse-panel__artifact-item-index" }, eo = {
|
|
1806
1809
|
__name: "ArtifactusePanel",
|
|
1807
1810
|
props: {
|
|
1808
1811
|
panelWidth: { type: Number, default: void 0 },
|
|
1809
1812
|
splitPosition: { type: Number, default: void 0 }
|
|
1810
1813
|
},
|
|
1811
1814
|
emits: ["close", "ai-request", "save", "export", "resize"],
|
|
1812
|
-
setup(H, { emit:
|
|
1813
|
-
var
|
|
1814
|
-
const
|
|
1815
|
+
setup(H, { emit: c }) {
|
|
1816
|
+
var at, st;
|
|
1817
|
+
const h = c, T = H, {
|
|
1815
1818
|
state: m,
|
|
1816
|
-
activeArtifact:
|
|
1817
|
-
artifactCount:
|
|
1818
|
-
hasArtifacts:
|
|
1819
|
-
closePanel:
|
|
1820
|
-
toggleFullscreen:
|
|
1821
|
-
setViewMode:
|
|
1819
|
+
activeArtifact: o,
|
|
1820
|
+
artifactCount: q,
|
|
1821
|
+
hasArtifacts: B,
|
|
1822
|
+
closePanel: y,
|
|
1823
|
+
toggleFullscreen: l,
|
|
1824
|
+
setViewMode: _,
|
|
1822
1825
|
getPanelUrl: x,
|
|
1823
1826
|
openArtifact: F,
|
|
1824
1827
|
instance: $
|
|
1825
|
-
} =
|
|
1828
|
+
} = ze(), j = 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), p = M(!1), k = M(!1), ee = M(!1), re = M(!1), A = M("options"), Q = M(""), w = M(null), L = M(""), r = M(!1), E = M(!1), u = M([]), z = M(!1), le = M("");
|
|
1826
1829
|
let pe = null, ye = null, fe = null;
|
|
1827
|
-
const Le =
|
|
1830
|
+
const Le = C(() => {
|
|
1828
1831
|
var i;
|
|
1829
1832
|
return ((i = $.editor) == null ? void 0 : i.isAvailable()) || !1;
|
|
1830
|
-
}),
|
|
1831
|
-
Math.min(Math.max(
|
|
1833
|
+
}), b = M(
|
|
1834
|
+
Math.min(Math.max(T.panelWidth ?? ((at = $.config) == null ? void 0 : at.panelWidth) ?? 65, 25), 75)
|
|
1832
1835
|
), I = M(
|
|
1833
|
-
Math.min(Math.max(
|
|
1834
|
-
), D =
|
|
1835
|
-
if (!
|
|
1836
|
-
let i = x(
|
|
1837
|
-
return i &&
|
|
1836
|
+
Math.min(Math.max(T.splitPosition ?? ((st = $.config) == null ? void 0 : st.splitPosition) ?? 50, 20), 80)
|
|
1837
|
+
), D = C(() => o.value ? Ee(o.value.language) : ""), te = C(() => o.value ? `<svg viewBox="0 0 24 24" fill="currentColor">${De(o.value.language)}</svg>` : ""), P = C(() => {
|
|
1838
|
+
if (!o.value) return null;
|
|
1839
|
+
let i = x(o.value);
|
|
1840
|
+
return i && o.value._refreshToken && (i += (i.includes("?") ? "&" : "?") + "_t=" + o.value._refreshToken), i;
|
|
1838
1841
|
});
|
|
1839
|
-
|
|
1840
|
-
const ae =
|
|
1842
|
+
C(() => !o.value || !m.artifacts.length ? -1 : m.artifacts.findIndex((i) => i.id === o.value.id));
|
|
1843
|
+
const ae = C(() => o.value ? Jt(o.value.language || "plaintext") : "plaintext"), d = C(() => m.artifacts.filter((i) => !i.isInline)), U = C(() => o.value ? d.value.findIndex((i) => i.id === o.value.id) : -1), G = C(() => {
|
|
1841
1844
|
var i;
|
|
1842
1845
|
return ((i = $.config) == null ? void 0 : i.branding) !== !1;
|
|
1843
|
-
}), ce =
|
|
1846
|
+
}), ce = C(() => {
|
|
1844
1847
|
var i;
|
|
1845
1848
|
return ((i = $.share) == null ? void 0 : i.enabled) !== !1;
|
|
1846
|
-
}), ke =
|
|
1849
|
+
}), ke = C(() => {
|
|
1847
1850
|
var i;
|
|
1848
1851
|
return ((i = $.share) == null ? void 0 : i.isAuthenticated()) || !1;
|
|
1849
|
-
}),
|
|
1850
|
-
|
|
1851
|
-
return
|
|
1852
|
+
}), vt = C(() => o.value ? b.value : Math.min(b.value, 30)), Me = C(() => {
|
|
1853
|
+
var i;
|
|
1854
|
+
return ((i = $.config) == null ? void 0 : i.multiTab) === !0;
|
|
1855
|
+
}), We = C(() => Me.value ? m.openTabs.map((i) => m.artifacts.find((t) => t.id === i)).filter(Boolean) : []);
|
|
1856
|
+
function Ie(i) {
|
|
1857
|
+
return `<svg viewBox="0 0 24 24" fill="currentColor">${De(i)}</svg>`;
|
|
1858
|
+
}
|
|
1859
|
+
function ft(i) {
|
|
1860
|
+
F(i);
|
|
1861
|
+
}
|
|
1862
|
+
function pt(i) {
|
|
1863
|
+
$.closeTab(i), m.openTabs.length === 0 && (k.value = !1);
|
|
1852
1864
|
}
|
|
1853
|
-
function
|
|
1865
|
+
function _t() {
|
|
1854
1866
|
k.value = !1, $.state.clearActiveArtifact();
|
|
1855
1867
|
}
|
|
1856
|
-
function
|
|
1868
|
+
function Je(i) {
|
|
1857
1869
|
if (i.language !== "smartdiff") return null;
|
|
1858
1870
|
try {
|
|
1859
1871
|
const t = JSON.parse(i.code);
|
|
1860
1872
|
if (t.oldCode === void 0 || t.newCode === void 0) return null;
|
|
1861
|
-
const
|
|
1873
|
+
const f = t.language || "plaintext", V = nt() && window.Prism.languages[f], J = Xt(t.oldCode, t.newCode).split(`
|
|
1862
1874
|
`);
|
|
1863
|
-
return { html:
|
|
1864
|
-
const ne = ue[0],
|
|
1875
|
+
return { html: J.map((ue) => {
|
|
1876
|
+
const ne = ue[0], be = ue.slice(1), ge = V ? window.Prism.highlight(be, V, f) : be;
|
|
1865
1877
|
return ne === "-" ? `<span class="token deleted">${ge}</span>` : ne === "+" ? `<span class="token inserted">${ge}</span>` : ge;
|
|
1866
1878
|
}).join(`
|
|
1867
|
-
`), lineCount:
|
|
1879
|
+
`), lineCount: J.length };
|
|
1868
1880
|
} catch {
|
|
1869
1881
|
return null;
|
|
1870
1882
|
}
|
|
1871
1883
|
}
|
|
1872
|
-
function
|
|
1884
|
+
function ht() {
|
|
1873
1885
|
var i;
|
|
1874
|
-
if (Y.value && ((i =
|
|
1875
|
-
const t =
|
|
1886
|
+
if (Y.value && ((i = o.value) != null && i.code)) {
|
|
1887
|
+
const t = Je(o.value), f = t ? t.lineCount : o.value.code.split(`
|
|
1876
1888
|
`).length;
|
|
1877
|
-
Y.value.innerHTML = Array.from({ length:
|
|
1889
|
+
Y.value.innerHTML = Array.from({ length: f }, (V, J) => `<div>${J + 1}</div>`).join("");
|
|
1878
1890
|
}
|
|
1879
1891
|
}
|
|
1880
|
-
function
|
|
1892
|
+
function mt() {
|
|
1881
1893
|
var i;
|
|
1882
|
-
if (
|
|
1883
|
-
const t =
|
|
1894
|
+
if (O.value && nt() && ((i = o.value) != null && i.code)) {
|
|
1895
|
+
const t = Je(o.value);
|
|
1884
1896
|
if (t)
|
|
1885
|
-
|
|
1897
|
+
O.value.innerHTML = t.html;
|
|
1886
1898
|
else {
|
|
1887
|
-
const
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1899
|
+
const f = window.Prism.languages[ae.value];
|
|
1900
|
+
f ? O.value.innerHTML = window.Prism.highlight(
|
|
1901
|
+
o.value.code,
|
|
1902
|
+
f,
|
|
1891
1903
|
ae.value
|
|
1892
|
-
) :
|
|
1904
|
+
) : O.value.textContent = o.value.code;
|
|
1893
1905
|
}
|
|
1894
|
-
|
|
1895
|
-
|
|
1906
|
+
O.value.dataset.highlighted = "true", Ce(() => {
|
|
1907
|
+
yt();
|
|
1896
1908
|
});
|
|
1897
1909
|
}
|
|
1898
1910
|
}
|
|
1899
|
-
function
|
|
1911
|
+
function yt() {
|
|
1900
1912
|
var t;
|
|
1901
|
-
const i = (t =
|
|
1902
|
-
if (i &&
|
|
1903
|
-
const
|
|
1904
|
-
|
|
1913
|
+
const i = (t = O.value) == null ? void 0 : t.closest("pre");
|
|
1914
|
+
if (i && S.value && Y.value) {
|
|
1915
|
+
const V = window.getComputedStyle(i).backgroundColor;
|
|
1916
|
+
V && V !== "rgba(0, 0, 0, 0)" && V !== "transparent" && (S.value.style.backgroundColor = V, Y.value.style.backgroundColor = V);
|
|
1905
1917
|
}
|
|
1906
1918
|
}
|
|
1907
|
-
function
|
|
1908
|
-
|
|
1919
|
+
function gt() {
|
|
1920
|
+
S.value && (S.value.style.backgroundColor = ""), Y.value && (Y.value.style.backgroundColor = "");
|
|
1909
1921
|
}
|
|
1910
|
-
function
|
|
1911
|
-
|
|
1912
|
-
|
|
1922
|
+
function Ae() {
|
|
1923
|
+
Ce(() => {
|
|
1924
|
+
ht(), mt();
|
|
1913
1925
|
});
|
|
1914
1926
|
}
|
|
1915
|
-
function
|
|
1916
|
-
!Le.value || !ie.value || !
|
|
1917
|
-
code:
|
|
1918
|
-
language:
|
|
1927
|
+
function Xe() {
|
|
1928
|
+
!Le.value || !ie.value || !o.value || (Fe(), fe = $.editor.create(ie.value, {
|
|
1929
|
+
code: o.value.code || "",
|
|
1930
|
+
language: o.value.editorLanguage || o.value.language || "plaintext",
|
|
1919
1931
|
sdkTheme: $.getTheme()
|
|
1920
1932
|
}));
|
|
1921
1933
|
}
|
|
1922
|
-
function
|
|
1934
|
+
function Fe() {
|
|
1923
1935
|
fe && (fe.destroy(), fe = null);
|
|
1924
1936
|
}
|
|
1925
|
-
function
|
|
1926
|
-
if (!fe || !
|
|
1937
|
+
function kt() {
|
|
1938
|
+
if (!fe || !o.value) return;
|
|
1927
1939
|
const i = fe.getCode();
|
|
1928
1940
|
$.emit("edit:save", {
|
|
1929
|
-
artifactId:
|
|
1930
|
-
artifact:
|
|
1941
|
+
artifactId: o.value.id,
|
|
1942
|
+
artifact: o.value,
|
|
1931
1943
|
code: i
|
|
1932
1944
|
});
|
|
1933
1945
|
}
|
|
1934
|
-
function
|
|
1935
|
-
clearTimeout(ye), oe.value = !1, j.value &&
|
|
1946
|
+
function wt() {
|
|
1947
|
+
clearTimeout(ye), oe.value = !1, j.value && o.value && ($.bridge.setIframe(j.value), $.bridge.loadArtifact(o.value));
|
|
1936
1948
|
}
|
|
1937
|
-
function
|
|
1949
|
+
function bt() {
|
|
1938
1950
|
clearTimeout(ye), oe.value = !1;
|
|
1939
1951
|
}
|
|
1940
|
-
function
|
|
1952
|
+
function Ct() {
|
|
1941
1953
|
clearTimeout(ye), ye = setTimeout(() => {
|
|
1942
1954
|
oe.value = !1;
|
|
1943
1955
|
}, 1e3);
|
|
1944
1956
|
}
|
|
1945
|
-
async function
|
|
1946
|
-
if (
|
|
1957
|
+
async function xt() {
|
|
1958
|
+
if (o.value)
|
|
1947
1959
|
try {
|
|
1948
|
-
await navigator.clipboard.writeText(
|
|
1949
|
-
|
|
1960
|
+
await navigator.clipboard.writeText(o.value.code), Z.value = !0, setTimeout(() => {
|
|
1961
|
+
Z.value = !1;
|
|
1950
1962
|
}, 2e3);
|
|
1951
1963
|
} catch (i) {
|
|
1952
1964
|
console.error("Failed to copy:", i);
|
|
1953
1965
|
}
|
|
1954
1966
|
}
|
|
1955
|
-
function
|
|
1956
|
-
if (!
|
|
1957
|
-
const { code: i, language: t, title:
|
|
1958
|
-
ne.href = ue, ne.download =
|
|
1967
|
+
function $t() {
|
|
1968
|
+
if (!o.value) return;
|
|
1969
|
+
const { code: i, language: t, title: f } = o.value, V = je(t), J = `${f.toLowerCase().replace(/\s+/g, "-")}.${V}`, me = new Blob([i], { type: "text/plain" }), ue = URL.createObjectURL(me), ne = document.createElement("a");
|
|
1970
|
+
ne.href = ue, ne.download = J, document.body.appendChild(ne), ne.click(), document.body.removeChild(ne), URL.revokeObjectURL(ue);
|
|
1959
1971
|
}
|
|
1960
|
-
async function
|
|
1961
|
-
if (!(ee.value ||
|
|
1972
|
+
async function Mt() {
|
|
1973
|
+
if (!(ee.value || d.value.length === 0)) {
|
|
1962
1974
|
ee.value = !0;
|
|
1963
1975
|
try {
|
|
1964
|
-
const i = new
|
|
1965
|
-
for (const ne of
|
|
1976
|
+
const i = new Kt(), t = /* @__PURE__ */ new Map();
|
|
1977
|
+
for (const ne of d.value) {
|
|
1966
1978
|
if (!ne.code) continue;
|
|
1967
|
-
const
|
|
1968
|
-
let ge = (ne.title || "untitled").toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-_]/g, ""),
|
|
1969
|
-
const
|
|
1970
|
-
|
|
1979
|
+
const be = je(ne.language);
|
|
1980
|
+
let ge = (ne.title || "untitled").toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-_]/g, ""), Oe = `${ge}.${be}`;
|
|
1981
|
+
const Ue = t.get(Oe) || 0;
|
|
1982
|
+
Ue > 0 && (Oe = `${ge}-${Ue}.${be}`), t.set(`${ge}.${be}`, Ue + 1), i.file(Oe, ne.code);
|
|
1971
1983
|
}
|
|
1972
|
-
const
|
|
1973
|
-
ue.href =
|
|
1984
|
+
const f = await i.generateAsync({ type: "blob" }), J = `artifacts-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.zip`, me = URL.createObjectURL(f), ue = document.createElement("a");
|
|
1985
|
+
ue.href = me, ue.download = J, document.body.appendChild(ue), ue.click(), document.body.removeChild(ue), URL.revokeObjectURL(me);
|
|
1974
1986
|
} catch (i) {
|
|
1975
1987
|
console.error("Failed to create ZIP:", i);
|
|
1976
1988
|
} finally {
|
|
@@ -1978,205 +1990,205 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
1978
1990
|
}
|
|
1979
1991
|
}
|
|
1980
1992
|
}
|
|
1981
|
-
function
|
|
1993
|
+
function Tt() {
|
|
1982
1994
|
if (re.value) {
|
|
1983
1995
|
re.value = !1;
|
|
1984
1996
|
return;
|
|
1985
1997
|
}
|
|
1986
|
-
|
|
1998
|
+
o.value && (A.value = "options", Q.value = "", w.value = null, L.value = "", r.value = !1, E.value = !1, u.value = [], z.value = !1, le.value = "", re.value = !0);
|
|
1987
1999
|
}
|
|
1988
|
-
function
|
|
2000
|
+
function Lt() {
|
|
1989
2001
|
re.value = !1;
|
|
1990
2002
|
}
|
|
1991
|
-
function
|
|
2003
|
+
function Ze(i) {
|
|
1992
2004
|
return i ? new Date(i).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" }) : "";
|
|
1993
2005
|
}
|
|
1994
|
-
async function
|
|
1995
|
-
if (!(!
|
|
1996
|
-
|
|
2006
|
+
async function Ke() {
|
|
2007
|
+
if (!(!o.value || !$.share)) {
|
|
2008
|
+
A.value = "loading", L.value = "";
|
|
1997
2009
|
try {
|
|
1998
|
-
const i = await $.share.share(
|
|
1999
|
-
Q.value = i.url, w.value = i.expiresAt,
|
|
2010
|
+
const i = await $.share.share(o.value);
|
|
2011
|
+
Q.value = i.url, w.value = i.expiresAt, E.value = !1, A.value = "success";
|
|
2000
2012
|
} catch (i) {
|
|
2001
|
-
|
|
2013
|
+
L.value = i.message || "Failed to create share link", A.value = "error";
|
|
2002
2014
|
}
|
|
2003
2015
|
}
|
|
2004
2016
|
}
|
|
2005
|
-
async function
|
|
2017
|
+
async function Ye() {
|
|
2006
2018
|
if (ke.value)
|
|
2007
|
-
|
|
2019
|
+
Ve();
|
|
2008
2020
|
else {
|
|
2009
|
-
|
|
2021
|
+
A.value = "loading";
|
|
2010
2022
|
try {
|
|
2011
|
-
await $.share.openAuthPopup(),
|
|
2023
|
+
await $.share.openAuthPopup(), Ve();
|
|
2012
2024
|
} catch (i) {
|
|
2013
|
-
i.message === "Authentication cancelled" ?
|
|
2025
|
+
i.message === "Authentication cancelled" ? A.value = "options" : (L.value = i.message || "Authentication failed", A.value = "error");
|
|
2014
2026
|
}
|
|
2015
2027
|
}
|
|
2016
2028
|
}
|
|
2017
|
-
async function
|
|
2018
|
-
if (!(!
|
|
2019
|
-
|
|
2029
|
+
async function Ve() {
|
|
2030
|
+
if (!(!o.value || !$.share)) {
|
|
2031
|
+
A.value = "loading", L.value = "";
|
|
2020
2032
|
try {
|
|
2021
|
-
const i = await $.share.save(
|
|
2022
|
-
Q.value = i.url, w.value = null,
|
|
2033
|
+
const i = await $.share.save(o.value);
|
|
2034
|
+
Q.value = i.url, w.value = null, E.value = !0, A.value = "success";
|
|
2023
2035
|
} catch (i) {
|
|
2024
|
-
|
|
2036
|
+
L.value = i.message || "Failed to save artifact", A.value = "error";
|
|
2025
2037
|
}
|
|
2026
2038
|
}
|
|
2027
2039
|
}
|
|
2028
|
-
function
|
|
2029
|
-
|
|
2040
|
+
function At() {
|
|
2041
|
+
E.value ? Ve() : Ke();
|
|
2030
2042
|
}
|
|
2031
|
-
async function
|
|
2043
|
+
async function Pt() {
|
|
2032
2044
|
var i;
|
|
2033
2045
|
if ($.share) {
|
|
2034
2046
|
if (!ke.value) {
|
|
2035
|
-
|
|
2047
|
+
A.value = "loading";
|
|
2036
2048
|
try {
|
|
2037
2049
|
await $.share.openAuthPopup();
|
|
2038
2050
|
} catch (t) {
|
|
2039
|
-
t.message === "Authentication cancelled" ?
|
|
2051
|
+
t.message === "Authentication cancelled" ? A.value = "options" : (L.value = t.message || "Authentication failed", A.value = "error");
|
|
2040
2052
|
return;
|
|
2041
2053
|
}
|
|
2042
2054
|
}
|
|
2043
|
-
|
|
2055
|
+
A.value = "update-list", z.value = !0;
|
|
2044
2056
|
try {
|
|
2045
|
-
const t = ((i =
|
|
2046
|
-
|
|
2057
|
+
const t = ((i = o.value) == null ? void 0 : i.language) || null, f = await $.share.listArtifacts(t);
|
|
2058
|
+
u.value = f.projects || [];
|
|
2047
2059
|
} catch (t) {
|
|
2048
|
-
|
|
2060
|
+
L.value = t.message || "Failed to load artifacts", A.value = "error";
|
|
2049
2061
|
} finally {
|
|
2050
2062
|
z.value = !1;
|
|
2051
2063
|
}
|
|
2052
2064
|
}
|
|
2053
2065
|
}
|
|
2054
|
-
async function
|
|
2055
|
-
var
|
|
2056
|
-
if (!
|
|
2057
|
-
const t = (
|
|
2066
|
+
async function Ht(i) {
|
|
2067
|
+
var f, V;
|
|
2068
|
+
if (!o.value || !$.share) return;
|
|
2069
|
+
const t = (f = i.project) == null ? void 0 : f.uuid;
|
|
2058
2070
|
if (t) {
|
|
2059
|
-
|
|
2071
|
+
A.value = "loading", L.value = "";
|
|
2060
2072
|
try {
|
|
2061
|
-
const
|
|
2062
|
-
Q.value =
|
|
2063
|
-
} catch (
|
|
2064
|
-
|
|
2073
|
+
const J = await $.share.updateArtifact(t, o.value);
|
|
2074
|
+
Q.value = J.url || "", w.value = null, E.value = !0, le.value = ((V = i.project) == null ? void 0 : V.name) || "Untitled", A.value = "success";
|
|
2075
|
+
} catch (J) {
|
|
2076
|
+
L.value = J.message || "Failed to update artifact", A.value = "error";
|
|
2065
2077
|
}
|
|
2066
2078
|
}
|
|
2067
2079
|
}
|
|
2068
|
-
async function
|
|
2080
|
+
async function Bt() {
|
|
2069
2081
|
if (Q.value)
|
|
2070
2082
|
try {
|
|
2071
|
-
await navigator.clipboard.writeText(Q.value),
|
|
2072
|
-
|
|
2083
|
+
await navigator.clipboard.writeText(Q.value), r.value = !0, setTimeout(() => {
|
|
2084
|
+
r.value = !1;
|
|
2073
2085
|
}, 2e3);
|
|
2074
2086
|
} catch (i) {
|
|
2075
2087
|
console.error("Failed to copy link:", i);
|
|
2076
2088
|
}
|
|
2077
2089
|
}
|
|
2078
|
-
function
|
|
2079
|
-
|
|
2090
|
+
function Et() {
|
|
2091
|
+
P.value && window.open(P.value, "_blank");
|
|
2080
2092
|
}
|
|
2081
|
-
function
|
|
2082
|
-
Y.value &&
|
|
2093
|
+
function St() {
|
|
2094
|
+
Y.value && S.value && (Y.value.style.transform = `translateY(-${S.value.scrollTop}px)`);
|
|
2083
2095
|
}
|
|
2084
|
-
function
|
|
2085
|
-
|
|
2096
|
+
function zt() {
|
|
2097
|
+
X.value = !X.value;
|
|
2086
2098
|
}
|
|
2087
|
-
function
|
|
2088
|
-
k.value = !0, F(i),
|
|
2099
|
+
function Qe(i) {
|
|
2100
|
+
k.value = !0, F(i), X.value = !1;
|
|
2089
2101
|
}
|
|
2090
|
-
function
|
|
2091
|
-
const i =
|
|
2092
|
-
i >= 0 && F(
|
|
2102
|
+
function It() {
|
|
2103
|
+
const i = U.value - 1;
|
|
2104
|
+
i >= 0 && F(d.value[i]);
|
|
2093
2105
|
}
|
|
2094
|
-
function
|
|
2095
|
-
const i =
|
|
2096
|
-
i <
|
|
2106
|
+
function Ft() {
|
|
2107
|
+
const i = U.value + 1;
|
|
2108
|
+
i < d.value.length && F(d.value[i]);
|
|
2097
2109
|
}
|
|
2098
|
-
function
|
|
2110
|
+
function Ge(i) {
|
|
2099
2111
|
const t = document.querySelector(".artifactuse-panel__nav");
|
|
2100
|
-
t && !t.contains(i.target) && (
|
|
2112
|
+
t && !t.contains(i.target) && (X.value = !1);
|
|
2101
2113
|
}
|
|
2102
2114
|
let we = null;
|
|
2103
|
-
function
|
|
2115
|
+
function Vt(i) {
|
|
2104
2116
|
we = {
|
|
2105
2117
|
startX: i.clientX,
|
|
2106
|
-
startWidth:
|
|
2107
|
-
}, document.addEventListener("mousemove",
|
|
2118
|
+
startWidth: b.value
|
|
2119
|
+
}, document.addEventListener("mousemove", et), document.addEventListener("mouseup", Re), document.body.style.cursor = "ew-resize", document.body.style.userSelect = "none", document.querySelectorAll("iframe").forEach((f) => f.style.pointerEvents = "none");
|
|
2108
2120
|
}
|
|
2109
|
-
function
|
|
2121
|
+
function et(i) {
|
|
2110
2122
|
if (!we) return;
|
|
2111
|
-
const t = window.innerWidth,
|
|
2112
|
-
|
|
2123
|
+
const t = window.innerWidth, V = (we.startX - i.clientX) / t * 100, J = we.startWidth + V;
|
|
2124
|
+
b.value = Math.min(Math.max(J, 25), 75), h("resize", { width: b.value });
|
|
2113
2125
|
}
|
|
2114
|
-
function
|
|
2126
|
+
function Re() {
|
|
2115
2127
|
const i = we !== null;
|
|
2116
|
-
we = null, document.removeEventListener("mousemove",
|
|
2128
|
+
we = null, document.removeEventListener("mousemove", et), document.removeEventListener("mouseup", Re), document.body.style.cursor = "", document.body.style.userSelect = "", document.querySelectorAll("iframe").forEach((f) => f.style.pointerEvents = ""), i && h("resize", { width: b.value });
|
|
2117
2129
|
}
|
|
2118
|
-
let
|
|
2119
|
-
function
|
|
2130
|
+
let Te = null;
|
|
2131
|
+
function Rt(i) {
|
|
2120
2132
|
if (!W.value) return;
|
|
2121
2133
|
const t = W.value.getBoundingClientRect();
|
|
2122
|
-
|
|
2134
|
+
Te = {
|
|
2123
2135
|
startX: i.clientX,
|
|
2124
2136
|
startPosition: I.value,
|
|
2125
2137
|
contentLeft: t.left,
|
|
2126
2138
|
contentWidth: t.width
|
|
2127
|
-
}, document.addEventListener("mousemove",
|
|
2139
|
+
}, document.addEventListener("mousemove", tt), document.addEventListener("mouseup", qe), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.querySelectorAll("iframe").forEach((V) => V.style.pointerEvents = "none");
|
|
2128
2140
|
}
|
|
2129
|
-
function
|
|
2130
|
-
if (!
|
|
2131
|
-
const
|
|
2132
|
-
I.value = Math.min(Math.max(
|
|
2141
|
+
function tt(i) {
|
|
2142
|
+
if (!Te) return;
|
|
2143
|
+
const f = (i.clientX - Te.contentLeft) / Te.contentWidth * 100;
|
|
2144
|
+
I.value = Math.min(Math.max(f, 20), 80);
|
|
2133
2145
|
}
|
|
2134
|
-
function
|
|
2135
|
-
|
|
2146
|
+
function qe() {
|
|
2147
|
+
Te = null, document.removeEventListener("mousemove", tt), document.removeEventListener("mouseup", qe), document.body.style.cursor = "", document.body.style.userSelect = "", document.querySelectorAll("iframe").forEach((t) => t.style.pointerEvents = "");
|
|
2136
2148
|
}
|
|
2137
|
-
return de(
|
|
2138
|
-
i && (t && t.isPreviewable !== i.isPreviewable && (
|
|
2139
|
-
|
|
2140
|
-
}, 150)), (!t || i.id !== t.id) && (
|
|
2149
|
+
return de(o, (i, t) => {
|
|
2150
|
+
i && (t && t.isPreviewable !== i.isPreviewable && (p.value = !0, setTimeout(() => {
|
|
2151
|
+
p.value = !1;
|
|
2152
|
+
}, 150)), (!t || i.id !== t.id) && (gt(), oe.value = !0, Ct()), (!t || i.id !== t.id || i.code !== t.code) && (Ae(), m.viewMode === "edit" && (!t || i.id !== t.id ? Ce(() => Xe()) : fe && fe.setCode(i.code || "")), clearTimeout(pe), pe = setTimeout(() => {
|
|
2141
2153
|
j.value && i.isPreviewable && $.bridge.loadArtifact(i);
|
|
2142
2154
|
}, 500)));
|
|
2143
2155
|
}, { deep: !0 }), de(() => m.viewMode, (i) => {
|
|
2144
|
-
(i === "code" || i === "split") &&
|
|
2156
|
+
(i === "code" || i === "split") && Ae(), i === "edit" && Ce(() => Xe());
|
|
2145
2157
|
}), de(() => m.isPanelOpen, (i) => {
|
|
2146
|
-
i &&
|
|
2147
|
-
}), de(() =>
|
|
2148
|
-
i !== void 0 && (
|
|
2149
|
-
}), de(() =>
|
|
2158
|
+
i && o.value && Ae(), i || Fe();
|
|
2159
|
+
}), de(() => T.panelWidth, (i) => {
|
|
2160
|
+
i !== void 0 && (b.value = Math.min(Math.max(i, 25), 75));
|
|
2161
|
+
}), de(() => T.splitPosition, (i) => {
|
|
2150
2162
|
i !== void 0 && (I.value = Math.min(Math.max(i, 20), 80));
|
|
2151
2163
|
}), $e(() => {
|
|
2152
|
-
$.on("ai:request", (i) =>
|
|
2153
|
-
}),
|
|
2154
|
-
|
|
2155
|
-
}), (i, t) => (a(), xe(
|
|
2156
|
-
default:
|
|
2164
|
+
$.on("ai:request", (i) => h("ai-request", i)), $.on("save:request", (i) => h("save", i)), $.on("export:complete", (i) => h("export", i)), document.addEventListener("click", Ge), m.isPanelOpen && o.value && Ae();
|
|
2165
|
+
}), Ne(() => {
|
|
2166
|
+
Re(), qe(), Fe(), document.removeEventListener("click", Ge), clearTimeout(pe), clearTimeout(ye);
|
|
2167
|
+
}), (i, t) => (a(), xe(He, { name: "artifactuse-panel" }, {
|
|
2168
|
+
default: Be(() => [
|
|
2157
2169
|
g(m).isPanelOpen ? (a(), s("div", {
|
|
2158
2170
|
key: 0,
|
|
2159
2171
|
class: N(["artifactuse-panel", {
|
|
2160
2172
|
"artifactuse-panel--fullscreen": g(m).isFullscreen,
|
|
2161
|
-
"artifactuse-panel--list": !g(
|
|
2162
|
-
"artifactuse-panel--empty": !g(
|
|
2173
|
+
"artifactuse-panel--list": !g(o) && g(B),
|
|
2174
|
+
"artifactuse-panel--empty": !g(B)
|
|
2163
2175
|
}]),
|
|
2164
|
-
style: Pe(g(m).isFullscreen ? void 0 : { width: `${
|
|
2176
|
+
style: Pe(g(m).isFullscreen ? void 0 : { width: `${vt.value}%` })
|
|
2165
2177
|
}, [
|
|
2166
2178
|
g(m).isFullscreen ? v("", !0) : (a(), s("div", {
|
|
2167
2179
|
key: 0,
|
|
2168
2180
|
class: "artifactuse-panel__resize-handle",
|
|
2169
|
-
onMousedown:
|
|
2181
|
+
onMousedown: he(Vt, ["prevent"])
|
|
2170
2182
|
}, [...t[12] || (t[12] = [
|
|
2171
2183
|
e("div", { class: "artifactuse-panel__resize-handle-line" }, null, -1)
|
|
2172
2184
|
])], 32)),
|
|
2173
|
-
g(
|
|
2174
|
-
e("header",
|
|
2175
|
-
k.value ? (a(), s("button", {
|
|
2185
|
+
g(B) ? g(o) ? (a(), s(R, { key: 3 }, [
|
|
2186
|
+
e("header", Hl, [
|
|
2187
|
+
Me.value || k.value ? (a(), s("button", {
|
|
2176
2188
|
key: 0,
|
|
2177
2189
|
class: "artifactuse-panel__back",
|
|
2178
|
-
title: "Back to list",
|
|
2179
|
-
onClick:
|
|
2190
|
+
title: Me.value ? "Browse artifacts" : "Back to list",
|
|
2191
|
+
onClick: _t
|
|
2180
2192
|
}, [...t[24] || (t[24] = [
|
|
2181
2193
|
e("svg", {
|
|
2182
2194
|
viewBox: "0 0 24 24",
|
|
@@ -2186,29 +2198,29 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2186
2198
|
}, [
|
|
2187
2199
|
e("polyline", { points: "15 18 9 12 15 6" })
|
|
2188
2200
|
], -1)
|
|
2189
|
-
])])) : v("", !0),
|
|
2190
|
-
e("div",
|
|
2201
|
+
])], 8, Bl)) : v("", !0),
|
|
2202
|
+
e("div", El, [
|
|
2191
2203
|
e("span", {
|
|
2192
2204
|
class: "artifactuse-panel__icon",
|
|
2193
2205
|
innerHTML: te.value
|
|
2194
|
-
}, null, 8,
|
|
2195
|
-
e("div",
|
|
2196
|
-
e("span",
|
|
2197
|
-
e("span",
|
|
2198
|
-
K(
|
|
2199
|
-
g(
|
|
2200
|
-
K(" • " +
|
|
2206
|
+
}, null, 8, Sl),
|
|
2207
|
+
e("div", zl, [
|
|
2208
|
+
e("span", Il, n(g(o).title || "Untitled"), 1),
|
|
2209
|
+
e("span", Fl, [
|
|
2210
|
+
K(n(D.value) + " ", 1),
|
|
2211
|
+
g(o).lineCount ? (a(), s(R, { key: 0 }, [
|
|
2212
|
+
K(" • " + n(g(o).lineCount) + " lines ", 1)
|
|
2201
2213
|
], 64)) : v("", !0)
|
|
2202
2214
|
])
|
|
2203
2215
|
])
|
|
2204
2216
|
]),
|
|
2205
|
-
e("div",
|
|
2206
|
-
!g(
|
|
2217
|
+
e("div", Vl, [
|
|
2218
|
+
!g(o).tabs || g(o).tabs.includes("preview") ? (a(), s("button", {
|
|
2207
2219
|
key: 0,
|
|
2208
2220
|
class: N(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": g(m).viewMode === "preview" }]),
|
|
2209
|
-
disabled: !g(
|
|
2221
|
+
disabled: !g(o).isPreviewable,
|
|
2210
2222
|
title: "Preview",
|
|
2211
|
-
onClick: t[2] || (t[2] = (
|
|
2223
|
+
onClick: t[2] || (t[2] = (f) => g(_)("preview"))
|
|
2212
2224
|
}, [...t[25] || (t[25] = [
|
|
2213
2225
|
e("svg", {
|
|
2214
2226
|
viewBox: "0 0 24 24",
|
|
@@ -2223,12 +2235,12 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2223
2235
|
r: "3"
|
|
2224
2236
|
})
|
|
2225
2237
|
], -1)
|
|
2226
|
-
])], 10,
|
|
2227
|
-
!g(
|
|
2238
|
+
])], 10, Rl)) : v("", !0),
|
|
2239
|
+
!g(o).tabs || g(o).tabs.includes("code") ? (a(), s("button", {
|
|
2228
2240
|
key: 1,
|
|
2229
2241
|
class: N(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": g(m).viewMode === "code" }]),
|
|
2230
2242
|
title: "Code",
|
|
2231
|
-
onClick: t[3] || (t[3] = (
|
|
2243
|
+
onClick: t[3] || (t[3] = (f) => g(_)("code"))
|
|
2232
2244
|
}, [...t[26] || (t[26] = [
|
|
2233
2245
|
e("svg", {
|
|
2234
2246
|
viewBox: "0 0 24 24",
|
|
@@ -2240,12 +2252,12 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2240
2252
|
e("polyline", { points: "8 6 2 12 8 18" })
|
|
2241
2253
|
], -1)
|
|
2242
2254
|
])], 2)) : v("", !0),
|
|
2243
|
-
!g(
|
|
2255
|
+
!g(o).tabs || g(o).tabs.includes("split") ? (a(), s("button", {
|
|
2244
2256
|
key: 2,
|
|
2245
2257
|
class: N(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": g(m).viewMode === "split" }]),
|
|
2246
|
-
disabled: !g(
|
|
2258
|
+
disabled: !g(o).isPreviewable,
|
|
2247
2259
|
title: "Split view",
|
|
2248
|
-
onClick: t[4] || (t[4] = (
|
|
2260
|
+
onClick: t[4] || (t[4] = (f) => g(_)("split"))
|
|
2249
2261
|
}, [...t[27] || (t[27] = [
|
|
2250
2262
|
e("svg", {
|
|
2251
2263
|
viewBox: "0 0 24 24",
|
|
@@ -2268,12 +2280,12 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2268
2280
|
y2: "21"
|
|
2269
2281
|
})
|
|
2270
2282
|
], -1)
|
|
2271
|
-
])], 10,
|
|
2272
|
-
g(
|
|
2283
|
+
])], 10, ql)) : v("", !0),
|
|
2284
|
+
g(o).tabs && g(o).tabs.includes("edit") && Le.value ? (a(), s("button", {
|
|
2273
2285
|
key: 3,
|
|
2274
2286
|
class: N(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": g(m).viewMode === "edit" }]),
|
|
2275
2287
|
title: "Edit",
|
|
2276
|
-
onClick: t[5] || (t[5] = (
|
|
2288
|
+
onClick: t[5] || (t[5] = (f) => g(_)("edit"))
|
|
2277
2289
|
}, [...t[28] || (t[28] = [
|
|
2278
2290
|
e("svg", {
|
|
2279
2291
|
viewBox: "0 0 24 24",
|
|
@@ -2286,12 +2298,12 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2286
2298
|
], -1)
|
|
2287
2299
|
])], 2)) : v("", !0)
|
|
2288
2300
|
]),
|
|
2289
|
-
e("div",
|
|
2301
|
+
e("div", Ol, [
|
|
2290
2302
|
g(m).viewMode === "edit" ? (a(), s("button", {
|
|
2291
2303
|
key: 0,
|
|
2292
2304
|
class: "artifactuse-panel__action artifactuse-panel__action--save",
|
|
2293
2305
|
title: "Save",
|
|
2294
|
-
onClick:
|
|
2306
|
+
onClick: kt
|
|
2295
2307
|
}, [...t[29] || (t[29] = [
|
|
2296
2308
|
e("svg", {
|
|
2297
2309
|
viewBox: "0 0 24 24",
|
|
@@ -2307,9 +2319,9 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2307
2319
|
e("button", {
|
|
2308
2320
|
class: "artifactuse-panel__action",
|
|
2309
2321
|
title: g(m).isFullscreen ? "Exit fullscreen" : "Fullscreen",
|
|
2310
|
-
onClick: t[6] || (t[6] = (...
|
|
2322
|
+
onClick: t[6] || (t[6] = (...f) => g(l) && g(l)(...f))
|
|
2311
2323
|
}, [
|
|
2312
|
-
g(m).isFullscreen ? (a(), s("svg",
|
|
2324
|
+
g(m).isFullscreen ? (a(), s("svg", jl, [...t[31] || (t[31] = [
|
|
2313
2325
|
e("polyline", { points: "4 14 10 14 10 20" }, null, -1),
|
|
2314
2326
|
e("polyline", { points: "20 10 14 10 14 4" }, null, -1),
|
|
2315
2327
|
e("line", {
|
|
@@ -2324,7 +2336,7 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2324
2336
|
x2: "10",
|
|
2325
2337
|
y2: "14"
|
|
2326
2338
|
}, null, -1)
|
|
2327
|
-
])])) : (a(), s("svg",
|
|
2339
|
+
])])) : (a(), s("svg", Dl, [...t[30] || (t[30] = [
|
|
2328
2340
|
e("polyline", { points: "15 3 21 3 21 9" }, null, -1),
|
|
2329
2341
|
e("polyline", { points: "9 21 3 21 3 15" }, null, -1),
|
|
2330
2342
|
e("line", {
|
|
@@ -2340,11 +2352,11 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2340
2352
|
y2: "14"
|
|
2341
2353
|
}, null, -1)
|
|
2342
2354
|
])]))
|
|
2343
|
-
], 8,
|
|
2355
|
+
], 8, Ul),
|
|
2344
2356
|
e("button", {
|
|
2345
2357
|
class: "artifactuse-panel__action artifactuse-panel__action--close",
|
|
2346
2358
|
title: "Close panel",
|
|
2347
|
-
onClick: t[7] || (t[7] = (...
|
|
2359
|
+
onClick: t[7] || (t[7] = (...f) => g(y) && g(y)(...f))
|
|
2348
2360
|
}, [...t[32] || (t[32] = [
|
|
2349
2361
|
e("svg", {
|
|
2350
2362
|
viewBox: "0 0 24 24",
|
|
@@ -2368,15 +2380,58 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2368
2380
|
])])
|
|
2369
2381
|
])
|
|
2370
2382
|
]),
|
|
2383
|
+
Me.value && We.value.length > 0 ? (a(), s("div", Nl, [
|
|
2384
|
+
e("div", Wl, [
|
|
2385
|
+
(a(!0), s(R, null, ve(We.value, (f) => {
|
|
2386
|
+
var V;
|
|
2387
|
+
return a(), s("button", {
|
|
2388
|
+
key: f.id,
|
|
2389
|
+
class: N(["artifactuse-panel__file-tab", { "artifactuse-panel__file-tab--active": f.id === ((V = g(o)) == null ? void 0 : V.id) }]),
|
|
2390
|
+
onClick: (J) => ft(f)
|
|
2391
|
+
}, [
|
|
2392
|
+
e("span", {
|
|
2393
|
+
class: "artifactuse-panel__file-tab-icon",
|
|
2394
|
+
innerHTML: Ie(f.language)
|
|
2395
|
+
}, null, 8, Xl),
|
|
2396
|
+
e("span", Zl, n(f.title || "Untitled"), 1),
|
|
2397
|
+
e("button", {
|
|
2398
|
+
class: "artifactuse-panel__file-tab-close",
|
|
2399
|
+
title: "Close tab",
|
|
2400
|
+
onClick: he((J) => pt(f.id), ["stop"])
|
|
2401
|
+
}, [...t[33] || (t[33] = [
|
|
2402
|
+
e("svg", {
|
|
2403
|
+
viewBox: "0 0 24 24",
|
|
2404
|
+
fill: "none",
|
|
2405
|
+
stroke: "currentColor",
|
|
2406
|
+
"stroke-width": "2"
|
|
2407
|
+
}, [
|
|
2408
|
+
e("line", {
|
|
2409
|
+
x1: "18",
|
|
2410
|
+
y1: "6",
|
|
2411
|
+
x2: "6",
|
|
2412
|
+
y2: "18"
|
|
2413
|
+
}),
|
|
2414
|
+
e("line", {
|
|
2415
|
+
x1: "6",
|
|
2416
|
+
y1: "6",
|
|
2417
|
+
x2: "18",
|
|
2418
|
+
y2: "18"
|
|
2419
|
+
})
|
|
2420
|
+
], -1)
|
|
2421
|
+
])], 8, Kl)
|
|
2422
|
+
], 10, Jl);
|
|
2423
|
+
}), 128))
|
|
2424
|
+
])
|
|
2425
|
+
])) : v("", !0),
|
|
2371
2426
|
e("div", {
|
|
2372
2427
|
ref_key: "contentRef",
|
|
2373
2428
|
ref: W,
|
|
2374
2429
|
class: N(["artifactuse-panel__content", [
|
|
2375
2430
|
`artifactuse-panel__content--${g(m).viewMode}`,
|
|
2376
|
-
{ "artifactuse-panel__content--transitioning":
|
|
2431
|
+
{ "artifactuse-panel__content--transitioning": p.value }
|
|
2377
2432
|
]])
|
|
2378
2433
|
}, [
|
|
2379
|
-
|
|
2434
|
+
p.value ? (a(), s("div", Yl, [...t[34] || (t[34] = [
|
|
2380
2435
|
e("div", { class: "artifactuse-panel__spinner" }, null, -1)
|
|
2381
2436
|
])])) : v("", !0),
|
|
2382
2437
|
g(m).viewMode === "preview" || g(m).viewMode === "split" ? (a(), s("div", {
|
|
@@ -2384,21 +2439,21 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2384
2439
|
class: "artifactuse-panel__preview",
|
|
2385
2440
|
style: Pe(g(m).viewMode === "split" ? { width: `${I.value}%` } : void 0)
|
|
2386
2441
|
}, [
|
|
2387
|
-
oe.value &&
|
|
2442
|
+
oe.value && P.value ? (a(), s("div", Ql, [...t[35] || (t[35] = [
|
|
2388
2443
|
e("div", { class: "artifactuse-panel__spinner" }, null, -1)
|
|
2389
2444
|
])])) : v("", !0),
|
|
2390
|
-
|
|
2445
|
+
P.value ? (a(), s("iframe", {
|
|
2391
2446
|
key: 1,
|
|
2392
2447
|
ref_key: "iframeRef",
|
|
2393
2448
|
ref: j,
|
|
2394
|
-
src:
|
|
2449
|
+
src: P.value,
|
|
2395
2450
|
class: N(["artifactuse-panel__iframe", { "artifactuse-panel__iframe--loading": oe.value }]),
|
|
2396
2451
|
sandbox: "allow-scripts allow-same-origin allow-forms allow-popups allow-modals allow-downloads allow-top-navigation-by-user-activation",
|
|
2397
2452
|
allow: "camera; microphone; fullscreen; geolocation; display-capture; autoplay; clipboard-write",
|
|
2398
|
-
onLoad:
|
|
2399
|
-
onError:
|
|
2400
|
-
}, null, 42,
|
|
2401
|
-
t[
|
|
2453
|
+
onLoad: wt,
|
|
2454
|
+
onError: bt
|
|
2455
|
+
}, null, 42, Gl)) : (a(), s("div", en, [
|
|
2456
|
+
t[36] || (t[36] = e("svg", {
|
|
2402
2457
|
viewBox: "0 0 24 24",
|
|
2403
2458
|
fill: "none",
|
|
2404
2459
|
stroke: "currentColor",
|
|
@@ -2413,25 +2468,25 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2413
2468
|
y2: "12"
|
|
2414
2469
|
})
|
|
2415
2470
|
], -1)),
|
|
2416
|
-
e("p", null, "Preview not available for " +
|
|
2471
|
+
e("p", null, "Preview not available for " + n(D.value), 1)
|
|
2417
2472
|
]))
|
|
2418
2473
|
], 4)) : v("", !0),
|
|
2419
|
-
|
|
2474
|
+
it(e("div", {
|
|
2420
2475
|
class: "artifactuse-panel__code",
|
|
2421
2476
|
style: Pe(g(m).viewMode === "split" ? { width: `${100 - I.value}%` } : void 0)
|
|
2422
2477
|
}, [
|
|
2423
2478
|
g(m).viewMode === "split" ? (a(), s("div", {
|
|
2424
2479
|
key: 0,
|
|
2425
2480
|
class: "artifactuse-panel__split-handle",
|
|
2426
|
-
onMousedown:
|
|
2427
|
-
}, [...t[
|
|
2481
|
+
onMousedown: he(Rt, ["prevent"])
|
|
2482
|
+
}, [...t[37] || (t[37] = [
|
|
2428
2483
|
e("div", { class: "artifactuse-panel__split-handle-line" }, null, -1)
|
|
2429
2484
|
])], 32)) : v("", !0),
|
|
2430
2485
|
e("div", {
|
|
2431
2486
|
class: "artifactuse-panel__code-scroll",
|
|
2432
2487
|
ref_key: "codeScrollRef",
|
|
2433
|
-
ref:
|
|
2434
|
-
onScroll:
|
|
2488
|
+
ref: S,
|
|
2489
|
+
onScroll: St
|
|
2435
2490
|
}, [
|
|
2436
2491
|
e("div", {
|
|
2437
2492
|
class: "artifactuse-panel__line-numbers",
|
|
@@ -2443,28 +2498,28 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2443
2498
|
}, [
|
|
2444
2499
|
(a(), s("code", {
|
|
2445
2500
|
ref_key: "codeRef",
|
|
2446
|
-
ref:
|
|
2447
|
-
key: g(
|
|
2501
|
+
ref: O,
|
|
2502
|
+
key: g(o).id,
|
|
2448
2503
|
class: N(`language-${ae.value}`)
|
|
2449
2504
|
}, null, 2))
|
|
2450
2505
|
], 2)
|
|
2451
2506
|
], 544)
|
|
2452
2507
|
], 4), [
|
|
2453
|
-
[
|
|
2508
|
+
[lt, g(m).viewMode === "code" || g(m).viewMode === "split"]
|
|
2454
2509
|
]),
|
|
2455
|
-
|
|
2510
|
+
it(e("div", tn, [
|
|
2456
2511
|
e("div", {
|
|
2457
2512
|
ref_key: "editorContainerRef",
|
|
2458
2513
|
ref: ie,
|
|
2459
2514
|
class: "artifactuse-panel__editor-container"
|
|
2460
2515
|
}, null, 512)
|
|
2461
2516
|
], 512), [
|
|
2462
|
-
[
|
|
2517
|
+
[lt, g(m).viewMode === "edit"]
|
|
2463
2518
|
])
|
|
2464
2519
|
], 2),
|
|
2465
|
-
e("footer",
|
|
2466
|
-
e("div",
|
|
2467
|
-
G.value ? (a(), s("a",
|
|
2520
|
+
e("footer", an, [
|
|
2521
|
+
e("div", sn, [
|
|
2522
|
+
G.value ? (a(), s("a", ln, [...t[38] || (t[38] = [
|
|
2468
2523
|
e("svg", {
|
|
2469
2524
|
width: "16",
|
|
2470
2525
|
height: "16",
|
|
@@ -2483,17 +2538,17 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2483
2538
|
], -1),
|
|
2484
2539
|
e("span", null, "Artifactuse", -1)
|
|
2485
2540
|
])])) : v("", !0),
|
|
2486
|
-
g(
|
|
2541
|
+
g(o).size ? (a(), s("span", nn, n(g(rt)(g(o).size)), 1)) : v("", !0)
|
|
2487
2542
|
]),
|
|
2488
|
-
e("div",
|
|
2543
|
+
e("div", on, [
|
|
2489
2544
|
e("button", {
|
|
2490
|
-
class: N(["artifactuse-panel__footer-action", { "artifactuse-panel__footer-action--success":
|
|
2491
|
-
title:
|
|
2492
|
-
onClick:
|
|
2545
|
+
class: N(["artifactuse-panel__footer-action", { "artifactuse-panel__footer-action--success": Z.value }]),
|
|
2546
|
+
title: Z.value ? "Copied!" : "Copy code",
|
|
2547
|
+
onClick: xt
|
|
2493
2548
|
}, [
|
|
2494
|
-
|
|
2549
|
+
Z.value ? (a(), s("svg", un, [...t[40] || (t[40] = [
|
|
2495
2550
|
e("polyline", { points: "20 6 9 17 4 12" }, null, -1)
|
|
2496
|
-
])])) : (a(), s("svg",
|
|
2551
|
+
])])) : (a(), s("svg", cn, [...t[39] || (t[39] = [
|
|
2497
2552
|
e("rect", {
|
|
2498
2553
|
x: "9",
|
|
2499
2554
|
y: "9",
|
|
@@ -2504,12 +2559,12 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2504
2559
|
}, null, -1),
|
|
2505
2560
|
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
2561
|
])]))
|
|
2507
|
-
], 10,
|
|
2562
|
+
], 10, rn),
|
|
2508
2563
|
e("button", {
|
|
2509
2564
|
class: "artifactuse-panel__footer-action",
|
|
2510
2565
|
title: "Download file",
|
|
2511
|
-
onClick:
|
|
2512
|
-
}, [...t[
|
|
2566
|
+
onClick: $t
|
|
2567
|
+
}, [...t[41] || (t[41] = [
|
|
2513
2568
|
e("svg", {
|
|
2514
2569
|
viewBox: "0 0 24 24",
|
|
2515
2570
|
fill: "none",
|
|
@@ -2526,12 +2581,12 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2526
2581
|
})
|
|
2527
2582
|
], -1)
|
|
2528
2583
|
])]),
|
|
2529
|
-
ce.value ? (a(), s("div",
|
|
2584
|
+
ce.value ? (a(), s("div", dn, [
|
|
2530
2585
|
e("button", {
|
|
2531
2586
|
class: "artifactuse-panel__footer-action",
|
|
2532
2587
|
title: "Share",
|
|
2533
|
-
onClick:
|
|
2534
|
-
}, [...t[
|
|
2588
|
+
onClick: Tt
|
|
2589
|
+
}, [...t[42] || (t[42] = [
|
|
2535
2590
|
e("svg", {
|
|
2536
2591
|
viewBox: "0 0 24 24",
|
|
2537
2592
|
fill: "none",
|
|
@@ -2567,15 +2622,15 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2567
2622
|
})
|
|
2568
2623
|
], -1)
|
|
2569
2624
|
])]),
|
|
2570
|
-
|
|
2571
|
-
default:
|
|
2572
|
-
re.value ? (a(), s("div",
|
|
2573
|
-
e("div",
|
|
2574
|
-
e("span",
|
|
2625
|
+
Se(He, { name: "artifactuse-popup" }, {
|
|
2626
|
+
default: Be(() => [
|
|
2627
|
+
re.value ? (a(), s("div", vn, [
|
|
2628
|
+
e("div", fn, [
|
|
2629
|
+
e("span", pn, n(A.value === "success" ? le.value ? "Artifact updated!" : "Link created!" : A.value === "update-list" ? "Update saved artifact" : "Share Artifact"), 1),
|
|
2575
2630
|
e("button", {
|
|
2576
2631
|
class: "artifactuse-share-popup__close",
|
|
2577
|
-
onClick:
|
|
2578
|
-
}, [...t[
|
|
2632
|
+
onClick: Lt
|
|
2633
|
+
}, [...t[43] || (t[43] = [
|
|
2579
2634
|
e("svg", {
|
|
2580
2635
|
viewBox: "0 0 24 24",
|
|
2581
2636
|
fill: "none",
|
|
@@ -2597,29 +2652,29 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2597
2652
|
], -1)
|
|
2598
2653
|
])])
|
|
2599
2654
|
]),
|
|
2600
|
-
e("div",
|
|
2601
|
-
|
|
2655
|
+
e("div", _n, [
|
|
2656
|
+
A.value === "loading" ? (a(), s("div", hn, [...t[44] || (t[44] = [
|
|
2602
2657
|
e("div", { class: "artifactuse-share-popup__spinner" }, null, -1),
|
|
2603
2658
|
e("p", { class: "artifactuse-share-popup__loading-text" }, "Creating link...", -1)
|
|
2604
|
-
])])) :
|
|
2605
|
-
e("div",
|
|
2606
|
-
e("p",
|
|
2659
|
+
])])) : A.value === "error" ? (a(), s("div", mn, [
|
|
2660
|
+
e("div", yn, [
|
|
2661
|
+
e("p", gn, n(L.value), 1)
|
|
2607
2662
|
]),
|
|
2608
|
-
e("div",
|
|
2663
|
+
e("div", kn, [
|
|
2609
2664
|
e("button", {
|
|
2610
2665
|
class: "artifactuse-share-popup__btn artifactuse-share-popup__btn--secondary",
|
|
2611
|
-
onClick: t[8] || (t[8] = (
|
|
2666
|
+
onClick: t[8] || (t[8] = (f) => A.value = "options")
|
|
2612
2667
|
}, " Back "),
|
|
2613
2668
|
e("button", {
|
|
2614
2669
|
class: "artifactuse-share-popup__btn artifactuse-share-popup__btn--primary",
|
|
2615
|
-
onClick:
|
|
2670
|
+
onClick: At
|
|
2616
2671
|
}, " Retry ")
|
|
2617
2672
|
])
|
|
2618
|
-
])) :
|
|
2673
|
+
])) : A.value === "options" ? (a(), s("div", wn, [
|
|
2619
2674
|
e("button", {
|
|
2620
2675
|
class: "artifactuse-share-popup__option",
|
|
2621
|
-
onClick:
|
|
2622
|
-
}, [...t[
|
|
2676
|
+
onClick: Ke
|
|
2677
|
+
}, [...t[45] || (t[45] = [
|
|
2623
2678
|
e("div", { class: "artifactuse-share-popup__option-icon" }, [
|
|
2624
2679
|
e("svg", {
|
|
2625
2680
|
viewBox: "0 0 24 24",
|
|
@@ -2638,8 +2693,8 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2638
2693
|
])]),
|
|
2639
2694
|
e("button", {
|
|
2640
2695
|
class: "artifactuse-share-popup__option",
|
|
2641
|
-
onClick:
|
|
2642
|
-
}, [...t[
|
|
2696
|
+
onClick: Ye
|
|
2697
|
+
}, [...t[46] || (t[46] = [
|
|
2643
2698
|
e("div", { class: "artifactuse-share-popup__option-icon" }, [
|
|
2644
2699
|
e("svg", {
|
|
2645
2700
|
viewBox: "0 0 24 24",
|
|
@@ -2659,8 +2714,8 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2659
2714
|
])]),
|
|
2660
2715
|
e("button", {
|
|
2661
2716
|
class: "artifactuse-share-popup__option",
|
|
2662
|
-
onClick:
|
|
2663
|
-
}, [...t[
|
|
2717
|
+
onClick: Pt
|
|
2718
|
+
}, [...t[47] || (t[47] = [
|
|
2664
2719
|
e("div", { class: "artifactuse-share-popup__option-icon" }, [
|
|
2665
2720
|
e("svg", {
|
|
2666
2721
|
viewBox: "0 0 24 24",
|
|
@@ -2678,29 +2733,29 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2678
2733
|
e("p", { class: "artifactuse-share-popup__option-desc" }, "Replace an existing artifact")
|
|
2679
2734
|
], -1)
|
|
2680
2735
|
])])
|
|
2681
|
-
])) :
|
|
2682
|
-
z.value ? (a(), s("div",
|
|
2736
|
+
])) : A.value === "update-list" ? (a(), s("div", bn, [
|
|
2737
|
+
z.value ? (a(), s("div", Cn, [...t[48] || (t[48] = [
|
|
2683
2738
|
e("div", { class: "artifactuse-share-popup__spinner" }, null, -1),
|
|
2684
2739
|
e("p", { class: "artifactuse-share-popup__loading-text" }, "Loading artifacts...", -1)
|
|
2685
|
-
])])) :
|
|
2686
|
-
(a(!0), s(R, null, ve(
|
|
2687
|
-
var
|
|
2740
|
+
])])) : u.value.length === 0 ? (a(), s("div", xn, " No saved artifacts of this type ")) : (a(), s("div", $n, [
|
|
2741
|
+
(a(!0), s(R, null, ve(u.value, (f) => {
|
|
2742
|
+
var V, J, me;
|
|
2688
2743
|
return a(), s("button", {
|
|
2689
|
-
key: ((
|
|
2744
|
+
key: ((V = f.project) == null ? void 0 : V.uuid) || f.id,
|
|
2690
2745
|
class: "artifactuse-share-popup__artifact-item",
|
|
2691
|
-
onClick: (ue) =>
|
|
2746
|
+
onClick: (ue) => Ht(f)
|
|
2692
2747
|
}, [
|
|
2693
|
-
e("span",
|
|
2694
|
-
e("span",
|
|
2695
|
-
], 8,
|
|
2748
|
+
e("span", Tn, n(((J = f.project) == null ? void 0 : J.name) || "Untitled"), 1),
|
|
2749
|
+
e("span", Ln, n(Ze((me = f.project) == null ? void 0 : me.created_at)), 1)
|
|
2750
|
+
], 8, Mn);
|
|
2696
2751
|
}), 128))
|
|
2697
2752
|
])),
|
|
2698
2753
|
e("button", {
|
|
2699
2754
|
class: "artifactuse-share-popup__back-btn",
|
|
2700
|
-
onClick: t[9] || (t[9] = (
|
|
2755
|
+
onClick: t[9] || (t[9] = (f) => A.value = "options")
|
|
2701
2756
|
}, "Back")
|
|
2702
|
-
])) :
|
|
2703
|
-
t[
|
|
2757
|
+
])) : A.value === "success" ? (a(), s("div", An, [
|
|
2758
|
+
t[51] || (t[51] = e("div", { class: "artifactuse-share-popup__success-icon" }, [
|
|
2704
2759
|
e("svg", {
|
|
2705
2760
|
viewBox: "0 0 24 24",
|
|
2706
2761
|
fill: "none",
|
|
@@ -2710,21 +2765,21 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2710
2765
|
e("polyline", { points: "20 6 9 17 4 12" })
|
|
2711
2766
|
])
|
|
2712
2767
|
], -1)),
|
|
2713
|
-
e("div",
|
|
2768
|
+
e("div", Pn, [
|
|
2714
2769
|
e("input", {
|
|
2715
2770
|
type: "text",
|
|
2716
2771
|
class: "artifactuse-share-popup__link",
|
|
2717
2772
|
value: Q.value,
|
|
2718
2773
|
readonly: "",
|
|
2719
|
-
onClick: t[10] || (t[10] = (
|
|
2720
|
-
}, null, 8,
|
|
2774
|
+
onClick: t[10] || (t[10] = (f) => f.target.select())
|
|
2775
|
+
}, null, 8, Hn),
|
|
2721
2776
|
e("button", {
|
|
2722
|
-
class: N(["artifactuse-share-popup__copy-btn", { "artifactuse-share-popup__copy-btn--copied":
|
|
2723
|
-
onClick:
|
|
2724
|
-
},
|
|
2777
|
+
class: N(["artifactuse-share-popup__copy-btn", { "artifactuse-share-popup__copy-btn--copied": r.value }]),
|
|
2778
|
+
onClick: Bt
|
|
2779
|
+
}, n(r.value ? "Copied!" : "Copy"), 3)
|
|
2725
2780
|
]),
|
|
2726
|
-
w.value && !
|
|
2727
|
-
t[
|
|
2781
|
+
w.value && !E.value ? (a(), s("div", Bn, [
|
|
2782
|
+
t[49] || (t[49] = e("span", { class: "artifactuse-share-popup__expiry-icon" }, [
|
|
2728
2783
|
e("svg", {
|
|
2729
2784
|
viewBox: "0 0 24 24",
|
|
2730
2785
|
fill: "none",
|
|
@@ -2750,18 +2805,18 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2750
2805
|
})
|
|
2751
2806
|
])
|
|
2752
2807
|
], -1)),
|
|
2753
|
-
e("span",
|
|
2808
|
+
e("span", En, " Expires " + n(Ze(w.value)), 1)
|
|
2754
2809
|
])) : v("", !0),
|
|
2755
|
-
|
|
2756
|
-
t[
|
|
2810
|
+
E.value ? v("", !0) : (a(), s("div", Sn, [
|
|
2811
|
+
t[50] || (t[50] = e("p", { class: "artifactuse-share-popup__save-prompt-text" }, "Keep it permanently?", -1)),
|
|
2757
2812
|
e("button", {
|
|
2758
2813
|
class: "artifactuse-share-popup__save-prompt-btn",
|
|
2759
|
-
onClick:
|
|
2814
|
+
onClick: Ye
|
|
2760
2815
|
}, " Save to account ")
|
|
2761
2816
|
]))
|
|
2762
2817
|
])) : v("", !0)
|
|
2763
2818
|
]),
|
|
2764
|
-
t[
|
|
2819
|
+
t[52] || (t[52] = e("div", { class: "artifactuse-share-popup__footer" }, [
|
|
2765
2820
|
e("a", {
|
|
2766
2821
|
href: "https://artifactuse.com",
|
|
2767
2822
|
target: "_blank",
|
|
@@ -2792,12 +2847,12 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2792
2847
|
_: 1
|
|
2793
2848
|
})
|
|
2794
2849
|
])) : v("", !0),
|
|
2795
|
-
|
|
2850
|
+
P.value ? (a(), s("button", {
|
|
2796
2851
|
key: 1,
|
|
2797
2852
|
class: "artifactuse-panel__footer-action",
|
|
2798
2853
|
title: "Open in new tab",
|
|
2799
|
-
onClick:
|
|
2800
|
-
}, [...t[
|
|
2854
|
+
onClick: Et
|
|
2855
|
+
}, [...t[53] || (t[53] = [
|
|
2801
2856
|
e("svg", {
|
|
2802
2857
|
viewBox: "0 0 24 24",
|
|
2803
2858
|
fill: "none",
|
|
@@ -2814,13 +2869,13 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2814
2869
|
})
|
|
2815
2870
|
], -1)
|
|
2816
2871
|
])])) : v("", !0),
|
|
2817
|
-
|
|
2872
|
+
!Me.value && d.value.length > 1 ? (a(), s("div", zn, [
|
|
2818
2873
|
e("button", {
|
|
2819
2874
|
class: "artifactuse-panel__nav-btn",
|
|
2820
|
-
disabled:
|
|
2875
|
+
disabled: U.value <= 0,
|
|
2821
2876
|
title: "Previous artifact",
|
|
2822
|
-
onClick:
|
|
2823
|
-
}, [...t[
|
|
2877
|
+
onClick: It
|
|
2878
|
+
}, [...t[54] || (t[54] = [
|
|
2824
2879
|
e("svg", {
|
|
2825
2880
|
viewBox: "0 0 24 24",
|
|
2826
2881
|
fill: "none",
|
|
@@ -2829,14 +2884,14 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2829
2884
|
}, [
|
|
2830
2885
|
e("polyline", { points: "15 18 9 12 15 6" })
|
|
2831
2886
|
], -1)
|
|
2832
|
-
])], 8,
|
|
2887
|
+
])], 8, In),
|
|
2833
2888
|
e("button", {
|
|
2834
2889
|
class: "artifactuse-panel__nav-trigger",
|
|
2835
2890
|
title: "View all artifacts",
|
|
2836
|
-
onClick:
|
|
2891
|
+
onClick: zt
|
|
2837
2892
|
}, [
|
|
2838
|
-
e("span", null,
|
|
2839
|
-
t[
|
|
2893
|
+
e("span", null, n(U.value + 1) + " / " + n(d.value.length), 1),
|
|
2894
|
+
t[55] || (t[55] = e("svg", {
|
|
2840
2895
|
viewBox: "0 0 24 24",
|
|
2841
2896
|
fill: "none",
|
|
2842
2897
|
stroke: "currentColor",
|
|
@@ -2847,10 +2902,10 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2847
2902
|
]),
|
|
2848
2903
|
e("button", {
|
|
2849
2904
|
class: "artifactuse-panel__nav-btn",
|
|
2850
|
-
disabled:
|
|
2905
|
+
disabled: U.value >= d.value.length - 1,
|
|
2851
2906
|
title: "Next artifact",
|
|
2852
|
-
onClick:
|
|
2853
|
-
}, [...t[
|
|
2907
|
+
onClick: Ft
|
|
2908
|
+
}, [...t[56] || (t[56] = [
|
|
2854
2909
|
e("svg", {
|
|
2855
2910
|
viewBox: "0 0 24 24",
|
|
2856
2911
|
fill: "none",
|
|
@@ -2859,16 +2914,16 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2859
2914
|
}, [
|
|
2860
2915
|
e("polyline", { points: "9 18 15 12 9 6" })
|
|
2861
2916
|
], -1)
|
|
2862
|
-
])], 8,
|
|
2863
|
-
|
|
2864
|
-
default:
|
|
2865
|
-
|
|
2866
|
-
e("div",
|
|
2867
|
-
t[
|
|
2917
|
+
])], 8, Fn),
|
|
2918
|
+
Se(He, { name: "artifactuse-popup" }, {
|
|
2919
|
+
default: Be(() => [
|
|
2920
|
+
X.value ? (a(), s("div", Vn, [
|
|
2921
|
+
e("div", Rn, [
|
|
2922
|
+
t[58] || (t[58] = e("span", null, "Artifacts", -1)),
|
|
2868
2923
|
e("button", {
|
|
2869
2924
|
class: "artifactuse-panel__artifact-list-close",
|
|
2870
|
-
onClick: t[11] || (t[11] = (
|
|
2871
|
-
}, [...t[
|
|
2925
|
+
onClick: t[11] || (t[11] = (f) => X.value = !1)
|
|
2926
|
+
}, [...t[57] || (t[57] = [
|
|
2872
2927
|
e("svg", {
|
|
2873
2928
|
viewBox: "0 0 24 24",
|
|
2874
2929
|
fill: "none",
|
|
@@ -2890,27 +2945,27 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2890
2945
|
], -1)
|
|
2891
2946
|
])])
|
|
2892
2947
|
]),
|
|
2893
|
-
e("div",
|
|
2894
|
-
(a(!0), s(R, null, ve(
|
|
2895
|
-
key:
|
|
2896
|
-
class: N(["artifactuse-panel__artifact-item", { "artifactuse-panel__artifact-item--active":
|
|
2897
|
-
onClick: (
|
|
2948
|
+
e("div", qn, [
|
|
2949
|
+
(a(!0), s(R, null, ve(d.value, (f, V) => (a(), s("button", {
|
|
2950
|
+
key: f.id,
|
|
2951
|
+
class: N(["artifactuse-panel__artifact-item", { "artifactuse-panel__artifact-item--active": f.id === g(o).id }]),
|
|
2952
|
+
onClick: (J) => Qe(f)
|
|
2898
2953
|
}, [
|
|
2899
2954
|
e("span", {
|
|
2900
2955
|
class: "artifactuse-panel__artifact-item-icon",
|
|
2901
|
-
innerHTML:
|
|
2902
|
-
}, null, 8,
|
|
2903
|
-
e("div",
|
|
2904
|
-
e("span",
|
|
2905
|
-
e("span",
|
|
2906
|
-
K(
|
|
2907
|
-
|
|
2908
|
-
K(" • " +
|
|
2956
|
+
innerHTML: Ie(f.language)
|
|
2957
|
+
}, null, 8, Un),
|
|
2958
|
+
e("div", Dn, [
|
|
2959
|
+
e("span", jn, n(f.title || "Untitled"), 1),
|
|
2960
|
+
e("span", Nn, [
|
|
2961
|
+
K(n(g(Ee)(f.language)) + " ", 1),
|
|
2962
|
+
f.lineCount ? (a(), s(R, { key: 0 }, [
|
|
2963
|
+
K(" • " + n(f.lineCount) + " lines ", 1)
|
|
2909
2964
|
], 64)) : v("", !0)
|
|
2910
2965
|
])
|
|
2911
2966
|
]),
|
|
2912
|
-
e("span",
|
|
2913
|
-
], 10,
|
|
2967
|
+
e("span", Wn, n(V + 1), 1)
|
|
2968
|
+
], 10, On))), 128))
|
|
2914
2969
|
])
|
|
2915
2970
|
])) : v("", !0)
|
|
2916
2971
|
]),
|
|
@@ -2920,8 +2975,8 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2920
2975
|
])
|
|
2921
2976
|
])
|
|
2922
2977
|
], 64)) : (a(), s(R, { key: 2 }, [
|
|
2923
|
-
e("header",
|
|
2924
|
-
e("div",
|
|
2978
|
+
e("header", pl, [
|
|
2979
|
+
e("div", _l, [
|
|
2925
2980
|
t[18] || (t[18] = e("span", { class: "artifactuse-panel__icon" }, [
|
|
2926
2981
|
e("svg", {
|
|
2927
2982
|
viewBox: "0 0 24 24",
|
|
@@ -2933,19 +2988,19 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2933
2988
|
e("polyline", { points: "8 6 2 12 8 18" })
|
|
2934
2989
|
])
|
|
2935
2990
|
], -1)),
|
|
2936
|
-
e("div",
|
|
2991
|
+
e("div", hl, [
|
|
2937
2992
|
t[17] || (t[17] = e("span", { class: "artifactuse-panel__name" }, "Artifacts", -1)),
|
|
2938
|
-
e("span",
|
|
2993
|
+
e("span", ml, n(d.value.length) + " available", 1)
|
|
2939
2994
|
])
|
|
2940
2995
|
]),
|
|
2941
|
-
e("div",
|
|
2996
|
+
e("div", yl, [
|
|
2942
2997
|
e("button", {
|
|
2943
2998
|
class: N(["artifactuse-panel__action", { "artifactuse-panel__action--loading": ee.value }]),
|
|
2944
2999
|
disabled: ee.value,
|
|
2945
3000
|
title: "Download all as ZIP",
|
|
2946
|
-
onClick:
|
|
3001
|
+
onClick: Mt
|
|
2947
3002
|
}, [
|
|
2948
|
-
ee.value ? (a(), s("svg",
|
|
3003
|
+
ee.value ? (a(), s("svg", wl, [...t[20] || (t[20] = [
|
|
2949
3004
|
e("circle", {
|
|
2950
3005
|
cx: "12",
|
|
2951
3006
|
cy: "12",
|
|
@@ -2953,7 +3008,7 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2953
3008
|
"stroke-dasharray": "32",
|
|
2954
3009
|
"stroke-dashoffset": "32"
|
|
2955
3010
|
}, null, -1)
|
|
2956
|
-
])])) : (a(), s("svg",
|
|
3011
|
+
])])) : (a(), s("svg", kl, [...t[19] || (t[19] = [
|
|
2957
3012
|
e("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }, null, -1),
|
|
2958
3013
|
e("polyline", { points: "7 10 12 15 17 10" }, null, -1),
|
|
2959
3014
|
e("line", {
|
|
@@ -2963,11 +3018,11 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2963
3018
|
y2: "3"
|
|
2964
3019
|
}, null, -1)
|
|
2965
3020
|
])]))
|
|
2966
|
-
], 10,
|
|
3021
|
+
], 10, gl),
|
|
2967
3022
|
e("button", {
|
|
2968
3023
|
class: "artifactuse-panel__action artifactuse-panel__action--close",
|
|
2969
3024
|
title: "Close panel",
|
|
2970
|
-
onClick: t[1] || (t[1] = (...
|
|
3025
|
+
onClick: t[1] || (t[1] = (...f) => g(y) && g(y)(...f))
|
|
2971
3026
|
}, [...t[21] || (t[21] = [
|
|
2972
3027
|
e("svg", {
|
|
2973
3028
|
viewBox: "0 0 24 24",
|
|
@@ -2991,23 +3046,23 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
2991
3046
|
])])
|
|
2992
3047
|
])
|
|
2993
3048
|
]),
|
|
2994
|
-
e("div",
|
|
2995
|
-
e("div",
|
|
2996
|
-
(a(!0), s(R, null, ve(
|
|
2997
|
-
key:
|
|
3049
|
+
e("div", bl, [
|
|
3050
|
+
e("div", Cl, [
|
|
3051
|
+
(a(!0), s(R, null, ve(d.value, (f, V) => (a(), s("button", {
|
|
3052
|
+
key: f.id,
|
|
2998
3053
|
class: "artifactuse-panel__list-item",
|
|
2999
|
-
onClick: (
|
|
3054
|
+
onClick: (J) => Qe(f)
|
|
3000
3055
|
}, [
|
|
3001
3056
|
e("span", {
|
|
3002
3057
|
class: "artifactuse-panel__list-item-icon",
|
|
3003
|
-
innerHTML:
|
|
3004
|
-
}, null, 8,
|
|
3005
|
-
e("div",
|
|
3006
|
-
e("span",
|
|
3007
|
-
e("span",
|
|
3008
|
-
K(
|
|
3009
|
-
|
|
3010
|
-
K(" • " +
|
|
3058
|
+
innerHTML: Ie(f.language)
|
|
3059
|
+
}, null, 8, $l),
|
|
3060
|
+
e("div", Ml, [
|
|
3061
|
+
e("span", Tl, n(f.title || "Untitled"), 1),
|
|
3062
|
+
e("span", Ll, [
|
|
3063
|
+
K(n(g(Ee)(f.language)) + " ", 1),
|
|
3064
|
+
f.lineCount ? (a(), s(R, { key: 0 }, [
|
|
3065
|
+
K(" • " + n(f.lineCount) + " lines ", 1)
|
|
3011
3066
|
], 64)) : v("", !0)
|
|
3012
3067
|
])
|
|
3013
3068
|
]),
|
|
@@ -3021,11 +3076,11 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
3021
3076
|
e("polyline", { points: "9 18 15 12 9 6" })
|
|
3022
3077
|
])
|
|
3023
3078
|
], -1))
|
|
3024
|
-
], 8,
|
|
3079
|
+
], 8, xl))), 128))
|
|
3025
3080
|
])
|
|
3026
3081
|
]),
|
|
3027
|
-
e("footer",
|
|
3028
|
-
G.value ? (a(), s("a",
|
|
3082
|
+
e("footer", Al, [
|
|
3083
|
+
G.value ? (a(), s("a", Pl, [...t[23] || (t[23] = [
|
|
3029
3084
|
e("svg", {
|
|
3030
3085
|
width: "16",
|
|
3031
3086
|
height: "16",
|
|
@@ -3046,7 +3101,7 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
3046
3101
|
])])) : v("", !0)
|
|
3047
3102
|
])
|
|
3048
3103
|
], 64)) : (a(), s(R, { key: 1 }, [
|
|
3049
|
-
e("header",
|
|
3104
|
+
e("header", ul, [
|
|
3050
3105
|
t[14] || (t[14] = e("div", { class: "artifactuse-panel__title" }, [
|
|
3051
3106
|
e("span", { class: "artifactuse-panel__icon" }, [
|
|
3052
3107
|
e("svg", {
|
|
@@ -3063,11 +3118,11 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
3063
3118
|
e("span", { class: "artifactuse-panel__name" }, "Artifacts")
|
|
3064
3119
|
])
|
|
3065
3120
|
], -1)),
|
|
3066
|
-
e("div",
|
|
3121
|
+
e("div", dl, [
|
|
3067
3122
|
e("button", {
|
|
3068
3123
|
class: "artifactuse-panel__action artifactuse-panel__action--close",
|
|
3069
3124
|
title: "Close panel",
|
|
3070
|
-
onClick: t[0] || (t[0] = (...
|
|
3125
|
+
onClick: t[0] || (t[0] = (...f) => g(y) && g(y)(...f))
|
|
3071
3126
|
}, [...t[13] || (t[13] = [
|
|
3072
3127
|
e("svg", {
|
|
3073
3128
|
viewBox: "0 0 24 24",
|
|
@@ -3106,8 +3161,8 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
3106
3161
|
e("h3", { class: "artifactuse-panel__empty-title" }, "No artifacts yet"),
|
|
3107
3162
|
e("p", { class: "artifactuse-panel__empty-text" }, " Code blocks, forms, and other interactive content will appear here as the AI generates them. ")
|
|
3108
3163
|
], -1)),
|
|
3109
|
-
e("footer",
|
|
3110
|
-
G.value ? (a(), s("a",
|
|
3164
|
+
e("footer", vl, [
|
|
3165
|
+
G.value ? (a(), s("a", fl, [...t[15] || (t[15] = [
|
|
3111
3166
|
e("svg", {
|
|
3112
3167
|
width: "16",
|
|
3113
3168
|
height: "16",
|
|
@@ -3133,22 +3188,22 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
3133
3188
|
_: 1
|
|
3134
3189
|
}));
|
|
3135
3190
|
}
|
|
3136
|
-
},
|
|
3191
|
+
}, Jn = ["title"], Xn = {
|
|
3137
3192
|
key: 0,
|
|
3138
3193
|
class: "artifactuse-panel-toggle-badge"
|
|
3139
|
-
},
|
|
3194
|
+
}, to = {
|
|
3140
3195
|
__name: "ArtifactusePanelToggle",
|
|
3141
3196
|
setup(H) {
|
|
3142
|
-
const { state:
|
|
3143
|
-
return (
|
|
3197
|
+
const { state: c, artifactCount: h, hasArtifacts: T, togglePanel: m } = ze();
|
|
3198
|
+
return (o, q) => (a(), s("button", {
|
|
3144
3199
|
class: N(["artifactuse-panel-toggle", {
|
|
3145
|
-
"artifactuse-panel-toggle--active": g(
|
|
3146
|
-
"artifactuse-panel-toggle--has-artifacts": g(
|
|
3200
|
+
"artifactuse-panel-toggle--active": g(c).isPanelOpen,
|
|
3201
|
+
"artifactuse-panel-toggle--has-artifacts": g(T)
|
|
3147
3202
|
}]),
|
|
3148
|
-
onClick:
|
|
3149
|
-
title: g(
|
|
3203
|
+
onClick: q[0] || (q[0] = (...B) => g(m) && g(m)(...B)),
|
|
3204
|
+
title: g(c).isPanelOpen ? "Close artifacts panel" : "Open artifacts panel"
|
|
3150
3205
|
}, [
|
|
3151
|
-
|
|
3206
|
+
q[1] || (q[1] = e("svg", {
|
|
3152
3207
|
viewBox: "0 0 24 24",
|
|
3153
3208
|
fill: "none",
|
|
3154
3209
|
stroke: "currentColor",
|
|
@@ -3159,148 +3214,160 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
|
|
|
3159
3214
|
e("polyline", { points: "16 18 22 12 16 6" }),
|
|
3160
3215
|
e("polyline", { points: "8 6 2 12 8 18" })
|
|
3161
3216
|
], -1)),
|
|
3162
|
-
g(
|
|
3163
|
-
], 10,
|
|
3217
|
+
g(h) > 0 ? (a(), s("span", Xn, n(g(h) > 99 ? "99+" : g(h)), 1)) : v("", !0)
|
|
3218
|
+
], 10, Jn));
|
|
3164
3219
|
}
|
|
3165
|
-
},
|
|
3166
|
-
function
|
|
3167
|
-
var
|
|
3168
|
-
const
|
|
3220
|
+
}, ut = Symbol("artifactuse");
|
|
3221
|
+
function dt(H = {}) {
|
|
3222
|
+
var l;
|
|
3223
|
+
const c = ct(H), h = ot({
|
|
3169
3224
|
artifacts: [],
|
|
3170
3225
|
activeArtifactId: null,
|
|
3171
3226
|
isPanelOpen: !1,
|
|
3172
3227
|
viewMode: "preview",
|
|
3173
|
-
isFullscreen: !1
|
|
3228
|
+
isFullscreen: !1,
|
|
3229
|
+
openTabs: [],
|
|
3230
|
+
tabViewModes: {}
|
|
3174
3231
|
});
|
|
3175
|
-
|
|
3176
|
-
|
|
3232
|
+
c.state.subscribe((_) => {
|
|
3233
|
+
h.artifacts = _.artifacts, h.activeArtifactId = _.activeArtifactId, h.isPanelOpen = _.isPanelOpen, h.viewMode = _.viewMode, h.isFullscreen = _.isFullscreen, h.openTabs = _.openTabs, h.tabViewModes = _.tabViewModes;
|
|
3177
3234
|
});
|
|
3178
|
-
const
|
|
3179
|
-
if (
|
|
3180
|
-
const
|
|
3181
|
-
|
|
3182
|
-
|
|
3235
|
+
const T = C(() => h.activeArtifactId && h.artifacts.find((_) => _.id === h.activeArtifactId) || null), m = C(() => h.artifacts.filter((_) => !_.isInline).length), o = C(() => h.artifacts.some((_) => !_.isInline)), q = C(() => c.getPanelTypes()), B = C(() => T.value ? c.getPanelUrl(T.value) : null);
|
|
3236
|
+
if (c.applyTheme(), H.theme === "auto" || !H.theme) {
|
|
3237
|
+
const _ = ((l = c.bridge) == null ? void 0 : l.theme) || c.theme;
|
|
3238
|
+
_ != null && _.watchSystemTheme && _.watchSystemTheme(() => {
|
|
3239
|
+
c.applyTheme();
|
|
3183
3240
|
});
|
|
3184
3241
|
}
|
|
3185
|
-
const
|
|
3186
|
-
instance:
|
|
3187
|
-
state:
|
|
3188
|
-
activeArtifact:
|
|
3242
|
+
const y = {
|
|
3243
|
+
instance: c,
|
|
3244
|
+
state: h,
|
|
3245
|
+
activeArtifact: T,
|
|
3189
3246
|
artifactCount: m,
|
|
3190
|
-
hasArtifacts:
|
|
3247
|
+
hasArtifacts: o,
|
|
3191
3248
|
// Panel computed
|
|
3192
|
-
panelTypes:
|
|
3193
|
-
activePanelUrl:
|
|
3249
|
+
panelTypes: q,
|
|
3250
|
+
activePanelUrl: B,
|
|
3194
3251
|
// Methods
|
|
3195
|
-
processMessage:
|
|
3196
|
-
initializeContent:
|
|
3197
|
-
openArtifact:
|
|
3198
|
-
openFile:
|
|
3199
|
-
openCode:
|
|
3200
|
-
updateFile:
|
|
3201
|
-
closePanel:
|
|
3202
|
-
togglePanel:
|
|
3203
|
-
toggleFullscreen:
|
|
3204
|
-
setViewMode:
|
|
3205
|
-
getPanelUrl:
|
|
3206
|
-
sendToPanel:
|
|
3252
|
+
processMessage: c.processMessage,
|
|
3253
|
+
initializeContent: c.initializeContent,
|
|
3254
|
+
openArtifact: c.openArtifact,
|
|
3255
|
+
openFile: c.openFile,
|
|
3256
|
+
openCode: c.openCode,
|
|
3257
|
+
updateFile: c.updateFile,
|
|
3258
|
+
closePanel: c.closePanel,
|
|
3259
|
+
togglePanel: c.togglePanel,
|
|
3260
|
+
toggleFullscreen: c.toggleFullscreen,
|
|
3261
|
+
setViewMode: c.setViewMode,
|
|
3262
|
+
getPanelUrl: c.getPanelUrl,
|
|
3263
|
+
sendToPanel: c.sendToPanel,
|
|
3207
3264
|
// Panel management
|
|
3208
|
-
hasPanel:
|
|
3209
|
-
registerPanel:
|
|
3210
|
-
unregisterPanel:
|
|
3211
|
-
getPanelTypes:
|
|
3265
|
+
hasPanel: c.hasPanel,
|
|
3266
|
+
registerPanel: c.registerPanel,
|
|
3267
|
+
unregisterPanel: c.unregisterPanel,
|
|
3268
|
+
getPanelTypes: c.getPanelTypes,
|
|
3269
|
+
// Multi-tab
|
|
3270
|
+
closeTab: c.closeTab,
|
|
3271
|
+
closeOtherTabs: c.closeOtherTabs,
|
|
3272
|
+
closeAllTabs: c.closeAllTabs,
|
|
3212
3273
|
// Events
|
|
3213
|
-
on:
|
|
3214
|
-
off:
|
|
3274
|
+
on: c.on,
|
|
3275
|
+
off: c.off,
|
|
3215
3276
|
// State management
|
|
3216
|
-
clearArtifacts: () =>
|
|
3277
|
+
clearArtifacts: () => c.state.clear(),
|
|
3217
3278
|
// Theme - wrap setTheme to also apply
|
|
3218
|
-
applyTheme:
|
|
3219
|
-
setTheme: (
|
|
3220
|
-
|
|
3279
|
+
applyTheme: c.applyTheme,
|
|
3280
|
+
setTheme: (_) => {
|
|
3281
|
+
c.setTheme(_), c.applyTheme();
|
|
3221
3282
|
},
|
|
3222
|
-
getTheme:
|
|
3283
|
+
getTheme: c.getTheme
|
|
3223
3284
|
};
|
|
3224
|
-
return
|
|
3285
|
+
return Nt(ut, y), y;
|
|
3225
3286
|
}
|
|
3226
|
-
function
|
|
3227
|
-
const H =
|
|
3228
|
-
return H || (console.warn("useArtifactuse() called without provideArtifactuse(). Creating standalone instance."),
|
|
3287
|
+
function ze() {
|
|
3288
|
+
const H = Wt(ut);
|
|
3289
|
+
return H || (console.warn("useArtifactuse() called without provideArtifactuse(). Creating standalone instance."), dt());
|
|
3229
3290
|
}
|
|
3230
|
-
function
|
|
3231
|
-
const
|
|
3291
|
+
function Zn(H = {}) {
|
|
3292
|
+
const c = ct(H), h = ot({
|
|
3232
3293
|
artifacts: [],
|
|
3233
3294
|
activeArtifactId: null,
|
|
3234
3295
|
isPanelOpen: !1,
|
|
3235
3296
|
viewMode: "preview",
|
|
3236
|
-
isFullscreen: !1
|
|
3297
|
+
isFullscreen: !1,
|
|
3298
|
+
openTabs: [],
|
|
3299
|
+
tabViewModes: {}
|
|
3237
3300
|
});
|
|
3238
|
-
let
|
|
3301
|
+
let T;
|
|
3239
3302
|
$e(() => {
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
}),
|
|
3243
|
-
}),
|
|
3244
|
-
|
|
3303
|
+
T = c.state.subscribe((l) => {
|
|
3304
|
+
h.artifacts = l.artifacts, h.activeArtifactId = l.activeArtifactId, h.isPanelOpen = l.isPanelOpen, h.viewMode = l.viewMode, h.isFullscreen = l.isFullscreen, h.openTabs = l.openTabs, h.tabViewModes = l.tabViewModes;
|
|
3305
|
+
}), c.applyTheme();
|
|
3306
|
+
}), Ne(() => {
|
|
3307
|
+
T && T(), c.destroy();
|
|
3245
3308
|
});
|
|
3246
|
-
const m =
|
|
3309
|
+
const m = C(() => h.activeArtifactId && h.artifacts.find((l) => l.id === h.activeArtifactId) || null), o = C(() => h.artifacts.filter((l) => !l.isInline).length), q = C(() => h.artifacts.some((l) => !l.isInline)), B = C(() => c.getPanelTypes()), y = C(() => m.value ? c.getPanelUrl(m.value) : null);
|
|
3247
3310
|
return {
|
|
3248
|
-
instance:
|
|
3249
|
-
state:
|
|
3311
|
+
instance: c,
|
|
3312
|
+
state: h,
|
|
3250
3313
|
activeArtifact: m,
|
|
3251
|
-
artifactCount:
|
|
3252
|
-
hasArtifacts:
|
|
3314
|
+
artifactCount: o,
|
|
3315
|
+
hasArtifacts: q,
|
|
3253
3316
|
// Panel computed
|
|
3254
|
-
panelTypes:
|
|
3255
|
-
activePanelUrl:
|
|
3317
|
+
panelTypes: B,
|
|
3318
|
+
activePanelUrl: y,
|
|
3256
3319
|
// Methods
|
|
3257
|
-
processMessage:
|
|
3258
|
-
initializeContent:
|
|
3259
|
-
openArtifact:
|
|
3260
|
-
openFile:
|
|
3261
|
-
openCode:
|
|
3262
|
-
updateFile:
|
|
3263
|
-
closePanel:
|
|
3264
|
-
togglePanel:
|
|
3265
|
-
toggleFullscreen:
|
|
3266
|
-
setViewMode:
|
|
3267
|
-
getPanelUrl:
|
|
3268
|
-
sendToPanel:
|
|
3320
|
+
processMessage: c.processMessage,
|
|
3321
|
+
initializeContent: c.initializeContent,
|
|
3322
|
+
openArtifact: c.openArtifact,
|
|
3323
|
+
openFile: c.openFile,
|
|
3324
|
+
openCode: c.openCode,
|
|
3325
|
+
updateFile: c.updateFile,
|
|
3326
|
+
closePanel: c.closePanel,
|
|
3327
|
+
togglePanel: c.togglePanel,
|
|
3328
|
+
toggleFullscreen: c.toggleFullscreen,
|
|
3329
|
+
setViewMode: c.setViewMode,
|
|
3330
|
+
getPanelUrl: c.getPanelUrl,
|
|
3331
|
+
sendToPanel: c.sendToPanel,
|
|
3269
3332
|
// Panel management
|
|
3270
|
-
hasPanel:
|
|
3271
|
-
registerPanel:
|
|
3272
|
-
unregisterPanel:
|
|
3273
|
-
getPanelTypes:
|
|
3333
|
+
hasPanel: c.hasPanel,
|
|
3334
|
+
registerPanel: c.registerPanel,
|
|
3335
|
+
unregisterPanel: c.unregisterPanel,
|
|
3336
|
+
getPanelTypes: c.getPanelTypes,
|
|
3337
|
+
// Multi-tab
|
|
3338
|
+
closeTab: c.closeTab,
|
|
3339
|
+
closeOtherTabs: c.closeOtherTabs,
|
|
3340
|
+
closeAllTabs: c.closeAllTabs,
|
|
3274
3341
|
// Events
|
|
3275
|
-
on:
|
|
3276
|
-
off:
|
|
3342
|
+
on: c.on,
|
|
3343
|
+
off: c.off,
|
|
3277
3344
|
// State management
|
|
3278
|
-
clearArtifacts: () =>
|
|
3345
|
+
clearArtifacts: () => c.state.clear(),
|
|
3279
3346
|
// Theme - wrap setTheme to also apply
|
|
3280
|
-
applyTheme:
|
|
3281
|
-
setTheme: (
|
|
3282
|
-
|
|
3347
|
+
applyTheme: c.applyTheme,
|
|
3348
|
+
setTheme: (l) => {
|
|
3349
|
+
c.setTheme(l), c.applyTheme();
|
|
3283
3350
|
},
|
|
3284
|
-
getTheme:
|
|
3351
|
+
getTheme: c.getTheme
|
|
3285
3352
|
};
|
|
3286
3353
|
}
|
|
3287
|
-
const
|
|
3288
|
-
provideArtifactuse:
|
|
3289
|
-
useArtifactuse:
|
|
3290
|
-
createArtifactuseComposable:
|
|
3291
|
-
DEFAULT_PANELS:
|
|
3354
|
+
const ao = {
|
|
3355
|
+
provideArtifactuse: dt,
|
|
3356
|
+
useArtifactuse: ze,
|
|
3357
|
+
createArtifactuseComposable: Zn,
|
|
3358
|
+
DEFAULT_PANELS: Zt
|
|
3292
3359
|
};
|
|
3293
3360
|
export {
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3361
|
+
Gn as ArtifactuseAgentMessage,
|
|
3362
|
+
ra as ArtifactuseCard,
|
|
3363
|
+
Ya as ArtifactuseInlineForm,
|
|
3364
|
+
eo as ArtifactusePanel,
|
|
3365
|
+
to as ArtifactusePanelToggle,
|
|
3366
|
+
el as ArtifactuseSocialPreview,
|
|
3367
|
+
rl as ArtifactuseViewer,
|
|
3368
|
+
Zt as DEFAULT_PANELS,
|
|
3369
|
+
Zn as createArtifactuseComposable,
|
|
3370
|
+
ao as default,
|
|
3371
|
+
dt as provideArtifactuse,
|
|
3372
|
+
ze as useArtifactuse
|
|
3306
3373
|
};
|