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