artifactuse 0.1.8 → 0.1.10

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.
@@ -312,7 +312,7 @@ function Tr(e, t, r = {}) {
312
312
  const p = Wt(v).trim(), w = p.split(`
313
313
  `).length;
314
314
  let f = d.toLowerCase();
315
- (["xml", "markup", "html", "htm"].includes(f) || !f) && (p.trim().startsWith("<svg") || p.includes("<svg ") || p.includes("<svg>")) && (f = "svg");
315
+ (["xml", "markup", "html", "htm"].includes(f) || !f) && p.trim().startsWith("<svg") && (f = "svg");
316
316
  const m = Xt(f);
317
317
  let h = !1;
318
318
  if (i ? h = !0 : f === "diff" || f === "patch" ? h = w > 10 : m ? h = !0 : h = p.length >= s && w >= a, h) {
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { D as s, aH as r, ar as t, H as d, c, E as o, aY as i, ak as m, j as l, ap as b, an as E, ai as n, a4 as p, a5 as g, B as h, ac as M, aj as T, aE as u, V as A, ag as f, ah as S, ab as C, a3 as y, ao as P, _ as I, $ as G, L, M as V, o as D, ad as k, Q as F, R as z, a6 as v, T as B, A as w, aM as K, au as X, as as x, aq as H, N as O, a1 as R, Y as N, W as U, U as J, a8 as W, af as Y, F as j, G as q, a7 as Q, h as Z, aa as _, k as $, S as aa, P as ea, am as sa, w as ra, u as ta, x as da, z as ca, y as oa, J as ia, aX as ma, aG as la, e as ba, aJ as Ea, aZ as na, aR as pa, az as ga, aU as ha, aW as Ma, aV as Ta, I as ua, aN as Aa, av as fa, aK as Sa, d as Ca, aQ as ya, ay as Pa, i as Ia, s as Ga, aO as La, aw as Va, aT as Da, n as ka, p as Fa, ae as za, C as va, a2 as Ba, a9 as wa, Z as Ka, m as Xa, l as xa, al as Ha, K as Oa, aL as Ra, aS as Na, at as Ua, aA as Ja, a0 as Wa, X as Ya, O as ja, aD as qa, v as Qa, q as Za, r as _a, t as $a, aB as ae, aP as ee, ax as se, aI as re, aF as te, aC as de } from "./index-CNXX2Rp6.js";
1
+ import { D as s, aH as r, ar as t, H as d, c, E as o, aY as i, ak as m, j as l, ap as b, an as E, ai as n, a4 as p, a5 as g, B as h, ac as M, aj as T, aE as u, V as A, ag as f, ah as S, ab as C, a3 as y, ao as P, _ as I, $ as G, L, M as V, o as D, ad as k, Q as F, R as z, a6 as v, T as B, A as w, aM as K, au as X, as as x, aq as H, N as O, a1 as R, Y as N, W as U, U as J, a8 as W, af as Y, F as j, G as q, a7 as Q, h as Z, aa as _, k as $, S as aa, P as ea, am as sa, w as ra, u as ta, x as da, z as ca, y as oa, J as ia, aX as ma, aG as la, e as ba, aJ as Ea, aZ as na, aR as pa, az as ga, aU as ha, aW as Ma, aV as Ta, I as ua, aN as Aa, av as fa, aK as Sa, d as Ca, aQ as ya, ay as Pa, i as Ia, s as Ga, aO as La, aw as Va, aT as Da, n as ka, p as Fa, ae as za, C as va, a2 as Ba, a9 as wa, Z as Ka, m as Xa, l as xa, al as Ha, K as Oa, aL as Ra, aS as Na, at as Ua, aA as Ja, a0 as Wa, X as Ya, O as ja, aD as qa, v as Qa, q as Za, r as _a, t as $a, aB as ae, aP as ee, ax as se, aI as re, aF as te, aC as de } from "./index-a__K-7Ae.js";
2
2
  export {
3
3
  s as DEFAULT_PANELS,
4
4
  r as copyTableToClipboard,
@@ -1,5 +1,5 @@
1
1
  import e, { useState as C, useMemo as M, useCallback as d, useRef as W, useEffect as q, createContext as Ze, useContext as Ke } from "react";
2
- import { g as ke, f as je, a as ze, b as Re, n as Ye, i as Ge, D as Oe, c as Qe } from "../index-CNXX2Rp6.js";
2
+ import { g as ke, f as je, a as ze, b as Re, n as Ye, i as Ge, D as Oe, c as Qe } from "../index-a__K-7Ae.js";
3
3
  import { J as et } from "../jszip.min-CdmYyw5L.js";
4
4
  import { createPortal as tt } from "react-dom";
5
5
  function at({
@@ -1060,7 +1060,7 @@ function Pt({
1060
1060
  ref: E,
1061
1061
  src: pe,
1062
1062
  className: `artifactuse-panel__iframe ${K ? "artifactuse-panel__iframe--loading" : ""}`,
1063
- sandbox: "allow-scripts allow-same-origin allow-forms allow-popups allow-modals",
1063
+ sandbox: "allow-scripts allow-same-origin allow-forms allow-popups allow-modals allow-downloads",
1064
1064
  onLoad: Te,
1065
1065
  onError: $e
1066
1066
  }
@@ -1,6 +1,6 @@
1
1
  import { writable as Ct, derived as Rt } from "svelte/store";
2
2
  import { createEventDispatcher as $t, onMount as At, onDestroy as St, tick as Dt, setContext as Ea, getContext as Sa } from "svelte";
3
- import { g as mt, f as Yt, a as Vt, b as Gt, n as ua, i as Ha, D as Ba, c as za } from "../index-CNXX2Rp6.js";
3
+ import { g as mt, f as Yt, a as Vt, b as Gt, n as ua, i as Ha, D as Ba, c as za } from "../index-a__K-7Ae.js";
4
4
  import "svelte/internal/disclose-version";
5
5
  import "svelte/internal/flags/legacy";
6
6
  import * as e from "svelte/internal/client";
@@ -1845,7 +1845,7 @@ function vi(Be, _) {
1845
1845
  $$events: { close: ke }
1846
1846
  }), e.reset(te), e.bind_this(te, (o) => e.set(ye, o), () => e.get(ye)), e.append(Be, te), e.pop();
1847
1847
  }
1848
- var As = e.from_html('<button class="artifactuse-panel__resize-handle" aria-label="Resize panel"><div class="artifactuse-panel__resize-handle-line"></div></button>'), Ls = e.from_html('<a href="https://artifactuse.com" target="_blank" rel="noopener noreferrer" class="artifactuse-panel__branding"><svg width="16" height="16" viewBox="0 0 42 42" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16.6667 41.6673V10.4173C16.6667 9.86478 16.4472 9.33488 16.0565 8.94418C15.6658 8.55348 15.1359 8.33398 14.5833 8.33398H4.16667C3.0616 8.33398 2.00179 8.77297 1.22039 9.55437C0.438987 10.3358 0 11.3956 0 12.5007V37.5006C0 38.6057 0.438987 39.6655 1.22039 40.4469C2.00179 41.2283 3.0616 41.6673 4.16667 41.6673H29.1667C30.2717 41.6673 31.3315 41.2283 32.1129 40.4469C32.8943 39.6655 33.3333 38.6057 33.3333 37.5006V27.084C33.3333 26.5314 33.1138 26.0015 32.7231 25.6108C32.3324 25.2201 31.8025 25.0007 31.25 25.0007H0" fill="#5F51C8"></path><path d="M39.5833 0H27.0833C25.9327 0 25 0.93274 25 2.08333V14.5833C25 15.7339 25.9327 16.6667 27.0833 16.6667H39.5833C40.7339 16.6667 41.6667 15.7339 41.6667 14.5833V2.08333C41.6667 0.93274 40.7339 0 39.5833 0Z" fill="#695AE0"></path></svg> <span>Artifactuse</span></a>'), Ps = e.from_html('<div><!> <header class="artifactuse-panel__header artifactuse-panel__header--simple"><div class="artifactuse-panel__title"><span class="artifactuse-panel__icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="16 18 22 12 16 6"></polyline><polyline points="8 6 2 12 8 18"></polyline></svg></span> <div class="artifactuse-panel__title-content"><span class="artifactuse-panel__name">Artifacts</span></div></div> <div class="artifactuse-panel__actions"><button class="artifactuse-panel__action artifactuse-panel__action--close" title="Close panel"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></button></div></header> <div class="artifactuse-panel__empty"><div class="artifactuse-panel__empty-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"></path><polyline points="14 2 14 8 20 8"></polyline></svg></div> <h3 class="artifactuse-panel__empty-title">No artifacts yet</h3> <p class="artifactuse-panel__empty-text">Code blocks, forms, and other interactive content will appear here as the AI generates them.</p></div> <footer class="artifactuse-panel__footer artifactuse-panel__footer--simple"><!></footer></div>'), Ts = e.from_html('<button class="artifactuse-panel__resize-handle" aria-label="Resize panel"><div class="artifactuse-panel__resize-handle-line"></div></button>'), Es = e.from_svg('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg>'), Ss = e.from_svg('<svg class="artifactuse-panel__spinner-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10" stroke-dasharray="32" stroke-dashoffset="32"></circle></svg>'), Hs = e.from_html('<button class="artifactuse-panel__list-item"><span class="artifactuse-panel__list-item-icon"><!></span> <div class="artifactuse-panel__list-item-content"><span class="artifactuse-panel__list-item-title"> </span> <span class="artifactuse-panel__list-item-meta"> <!></span></div> <span class="artifactuse-panel__list-item-arrow"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="9 18 15 12 9 6"></polyline></svg></span></button>'), Bs = e.from_html('<a href="https://artifactuse.com" target="_blank" rel="noopener noreferrer" class="artifactuse-panel__branding"><svg width="16" height="16" viewBox="0 0 42 42" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16.6667 41.6673V10.4173C16.6667 9.86478 16.4472 9.33488 16.0565 8.94418C15.6658 8.55348 15.1359 8.33398 14.5833 8.33398H4.16667C3.0616 8.33398 2.00179 8.77297 1.22039 9.55437C0.438987 10.3358 0 11.3956 0 12.5007V37.5006C0 38.6057 0.438987 39.6655 1.22039 40.4469C2.00179 41.2283 3.0616 41.6673 4.16667 41.6673H29.1667C30.2717 41.6673 31.3315 41.2283 32.1129 40.4469C32.8943 39.6655 33.3333 38.6057 33.3333 37.5006V27.084C33.3333 26.5314 33.1138 26.0015 32.7231 25.6108C32.3324 25.2201 31.8025 25.0007 31.25 25.0007H0" fill="#5F51C8"></path><path d="M39.5833 0H27.0833C25.9327 0 25 0.93274 25 2.08333V14.5833C25 15.7339 25.9327 16.6667 27.0833 16.6667H39.5833C40.7339 16.6667 41.6667 15.7339 41.6667 14.5833V2.08333C41.6667 0.93274 40.7339 0 39.5833 0Z" fill="#695AE0"></path></svg> <span>Artifactuse</span></a>'), zs = e.from_html('<div><!> <header class="artifactuse-panel__header artifactuse-panel__header--simple"><div class="artifactuse-panel__title"><span class="artifactuse-panel__icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="16 18 22 12 16 6"></polyline><polyline points="8 6 2 12 8 18"></polyline></svg></span> <div class="artifactuse-panel__title-content"><span class="artifactuse-panel__name">Artifacts</span> <span class="artifactuse-panel__meta"> </span></div></div> <div class="artifactuse-panel__actions"><button title="Download all as ZIP"><!></button> <button class="artifactuse-panel__action artifactuse-panel__action--close" title="Close panel"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></button></div></header> <div class="artifactuse-panel__list"><div class="artifactuse-panel__list-items"></div></div> <footer class="artifactuse-panel__footer artifactuse-panel__footer--simple"><!></footer></div>'), Ms = e.from_html('<button class="artifactuse-panel__resize-handle" aria-label="Resize panel"><div class="artifactuse-panel__resize-handle-line"></div></button>'), qs = e.from_html('<button class="artifactuse-panel__back" title="Back to list"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="15 18 9 12 15 6"></polyline></svg></button>'), Is = e.from_svg('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" y1="3" x2="14" y2="10"></line><line x1="3" y1="21" x2="10" y2="14"></line></svg>'), Fs = e.from_svg('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="4 14 10 14 10 20"></polyline><polyline points="20 10 14 10 14 4"></polyline><line x1="14" y1="10" x2="21" y2="3"></line><line x1="3" y1="21" x2="10" y2="14"></line></svg>'), Rs = e.from_html('<div class="artifactuse-panel__loading"><div class="artifactuse-panel__spinner"></div></div>'), Ds = e.from_html('<iframe sandbox="allow-scripts allow-same-origin allow-forms allow-popups allow-modals" title="Artifact Preview"></iframe>'), Vs = e.from_html('<div class="artifactuse-panel__no-preview"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M9 17H7A5 5 0 0 1 7 7h2"></path><path d="M15 7h2a5 5 0 1 1 0 10h-2"></path><line x1="8" y1="12" x2="16" y2="12"></line></svg> <p> </p></div>'), Os = e.from_html('<div class="artifactuse-panel__preview"><!> <!></div>'), Us = e.from_html('<button class="artifactuse-panel__split-handle" aria-label="Split Resize"><div class="artifactuse-panel__split-handle-line"></div></button>'), Ns = e.from_html('<div class="artifactuse-panel__code"><!> <div class="artifactuse-panel__code-scroll"><div class="artifactuse-panel__line-numbers"></div> <pre class="artifactuse-panel__code-block"><code> </code></pre></div></div>'), js = e.from_html('<a href="https://artifactuse.com" target="_blank" rel="noopener noreferrer" class="artifactuse-panel__branding" title="Powered by Artifactuse"><svg width="16" height="16" viewBox="0 0 42 42" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16.6667 41.6673V10.4173C16.6667 9.86478 16.4472 9.33488 16.0565 8.94418C15.6658 8.55348 15.1359 8.33398 14.5833 8.33398H4.16667C3.0616 8.33398 2.00179 8.77297 1.22039 9.55437C0.438987 10.3358 0 11.3956 0 12.5007V37.5006C0 38.6057 0.438987 39.6655 1.22039 40.4469C2.00179 41.2283 3.0616 41.6673 4.16667 41.6673H29.1667C30.2717 41.6673 31.3315 41.2283 32.1129 40.4469C32.8943 39.6655 33.3333 38.6057 33.3333 37.5006V27.084C33.3333 26.5314 33.1138 26.0015 32.7231 25.6108C32.3324 25.2201 31.8025 25.0007 31.25 25.0007H0" fill="#5F51C8"></path><path d="M39.5833 0H27.0833C25.9327 0 25 0.93274 25 2.08333V14.5833C25 15.7339 25.9327 16.6667 27.0833 16.6667H39.5833C40.7339 16.6667 41.6667 15.7339 41.6667 14.5833V2.08333C41.6667 0.93274 40.7339 0 39.5833 0Z" fill="#695AE0"></path></svg> <span>Artifactuse</span></a>'), Js = e.from_html('<span class="artifactuse-panel__badge artifactuse-panel__badge--secondary"> </span>'), Xs = e.from_svg('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>'), Ws = e.from_svg('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="20 6 9 17 4 12"></polyline></svg>'), Zs = e.from_html('<button><span class="artifactuse-panel__artifact-item-icon"><!></span> <div class="artifactuse-panel__artifact-item-content"><span class="artifactuse-panel__artifact-item-title"> </span> <span class="artifactuse-panel__artifact-item-meta"> <!></span></div> <span class="artifactuse-panel__artifact-item-index"> </span></button>'), Ks = e.from_html('<div class="artifactuse-panel__artifact-list"><div class="artifactuse-panel__artifact-list-header"><span> </span> <button class="artifactuse-panel__artifact-list-close" aria-label="Close artifact list"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></button></div> <div class="artifactuse-panel__artifact-list-items"></div></div>'), Ys = e.from_html('<div class="artifactuse-panel__nav"><button class="artifactuse-panel__nav-btn" title="Previous artifact"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="15 18 9 12 15 6"></polyline></svg></button> <button class="artifactuse-panel__nav-trigger"><span> </span> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="6 9 12 15 18 9"></polyline></svg></button> <button class="artifactuse-panel__nav-btn" title="Next artifact"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="9 18 15 12 9 6"></polyline></svg></button> <!></div>'), Gs = e.from_html('<div><!> <header class="artifactuse-panel__header"><!> <div class="artifactuse-panel__title"><span class="artifactuse-panel__icon"><svg viewBox="0 0 24 24" fill="currentColor"><!></svg></span> <div class="artifactuse-panel__title-content"><span class="artifactuse-panel__name"> </span> <span class="artifactuse-panel__meta"> <!></span></div></div> <div class="artifactuse-panel__tabs"><button title="Preview"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path><circle cx="12" cy="12" r="3"></circle></svg></button> <button title="Code"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="16 18 22 12 16 6"></polyline><polyline points="8 6 2 12 8 18"></polyline></svg></button> <button title="Split view"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><line x1="12" y1="3" x2="12" y2="21"></line></svg></button></div> <div class="artifactuse-panel__actions"><button class="artifactuse-panel__action"><!></button> <button class="artifactuse-panel__action artifactuse-panel__action--close" title="Close"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></button></div></header> <div><!> <!></div> <footer class="artifactuse-panel__footer"><div class="artifactuse-panel__footer-left"><!> <!></div> <div class="artifactuse-panel__footer-right"><button><!></button> <button class="artifactuse-panel__footer-action" title="Download"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg></button> <!></div></footer></div>');
1848
+ var As = e.from_html('<button class="artifactuse-panel__resize-handle" aria-label="Resize panel"><div class="artifactuse-panel__resize-handle-line"></div></button>'), Ls = e.from_html('<a href="https://artifactuse.com" target="_blank" rel="noopener noreferrer" class="artifactuse-panel__branding"><svg width="16" height="16" viewBox="0 0 42 42" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16.6667 41.6673V10.4173C16.6667 9.86478 16.4472 9.33488 16.0565 8.94418C15.6658 8.55348 15.1359 8.33398 14.5833 8.33398H4.16667C3.0616 8.33398 2.00179 8.77297 1.22039 9.55437C0.438987 10.3358 0 11.3956 0 12.5007V37.5006C0 38.6057 0.438987 39.6655 1.22039 40.4469C2.00179 41.2283 3.0616 41.6673 4.16667 41.6673H29.1667C30.2717 41.6673 31.3315 41.2283 32.1129 40.4469C32.8943 39.6655 33.3333 38.6057 33.3333 37.5006V27.084C33.3333 26.5314 33.1138 26.0015 32.7231 25.6108C32.3324 25.2201 31.8025 25.0007 31.25 25.0007H0" fill="#5F51C8"></path><path d="M39.5833 0H27.0833C25.9327 0 25 0.93274 25 2.08333V14.5833C25 15.7339 25.9327 16.6667 27.0833 16.6667H39.5833C40.7339 16.6667 41.6667 15.7339 41.6667 14.5833V2.08333C41.6667 0.93274 40.7339 0 39.5833 0Z" fill="#695AE0"></path></svg> <span>Artifactuse</span></a>'), Ps = e.from_html('<div><!> <header class="artifactuse-panel__header artifactuse-panel__header--simple"><div class="artifactuse-panel__title"><span class="artifactuse-panel__icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="16 18 22 12 16 6"></polyline><polyline points="8 6 2 12 8 18"></polyline></svg></span> <div class="artifactuse-panel__title-content"><span class="artifactuse-panel__name">Artifacts</span></div></div> <div class="artifactuse-panel__actions"><button class="artifactuse-panel__action artifactuse-panel__action--close" title="Close panel"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></button></div></header> <div class="artifactuse-panel__empty"><div class="artifactuse-panel__empty-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"></path><polyline points="14 2 14 8 20 8"></polyline></svg></div> <h3 class="artifactuse-panel__empty-title">No artifacts yet</h3> <p class="artifactuse-panel__empty-text">Code blocks, forms, and other interactive content will appear here as the AI generates them.</p></div> <footer class="artifactuse-panel__footer artifactuse-panel__footer--simple"><!></footer></div>'), Ts = e.from_html('<button class="artifactuse-panel__resize-handle" aria-label="Resize panel"><div class="artifactuse-panel__resize-handle-line"></div></button>'), Es = e.from_svg('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg>'), Ss = e.from_svg('<svg class="artifactuse-panel__spinner-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10" stroke-dasharray="32" stroke-dashoffset="32"></circle></svg>'), Hs = e.from_html('<button class="artifactuse-panel__list-item"><span class="artifactuse-panel__list-item-icon"><!></span> <div class="artifactuse-panel__list-item-content"><span class="artifactuse-panel__list-item-title"> </span> <span class="artifactuse-panel__list-item-meta"> <!></span></div> <span class="artifactuse-panel__list-item-arrow"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="9 18 15 12 9 6"></polyline></svg></span></button>'), Bs = e.from_html('<a href="https://artifactuse.com" target="_blank" rel="noopener noreferrer" class="artifactuse-panel__branding"><svg width="16" height="16" viewBox="0 0 42 42" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16.6667 41.6673V10.4173C16.6667 9.86478 16.4472 9.33488 16.0565 8.94418C15.6658 8.55348 15.1359 8.33398 14.5833 8.33398H4.16667C3.0616 8.33398 2.00179 8.77297 1.22039 9.55437C0.438987 10.3358 0 11.3956 0 12.5007V37.5006C0 38.6057 0.438987 39.6655 1.22039 40.4469C2.00179 41.2283 3.0616 41.6673 4.16667 41.6673H29.1667C30.2717 41.6673 31.3315 41.2283 32.1129 40.4469C32.8943 39.6655 33.3333 38.6057 33.3333 37.5006V27.084C33.3333 26.5314 33.1138 26.0015 32.7231 25.6108C32.3324 25.2201 31.8025 25.0007 31.25 25.0007H0" fill="#5F51C8"></path><path d="M39.5833 0H27.0833C25.9327 0 25 0.93274 25 2.08333V14.5833C25 15.7339 25.9327 16.6667 27.0833 16.6667H39.5833C40.7339 16.6667 41.6667 15.7339 41.6667 14.5833V2.08333C41.6667 0.93274 40.7339 0 39.5833 0Z" fill="#695AE0"></path></svg> <span>Artifactuse</span></a>'), zs = e.from_html('<div><!> <header class="artifactuse-panel__header artifactuse-panel__header--simple"><div class="artifactuse-panel__title"><span class="artifactuse-panel__icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="16 18 22 12 16 6"></polyline><polyline points="8 6 2 12 8 18"></polyline></svg></span> <div class="artifactuse-panel__title-content"><span class="artifactuse-panel__name">Artifacts</span> <span class="artifactuse-panel__meta"> </span></div></div> <div class="artifactuse-panel__actions"><button title="Download all as ZIP"><!></button> <button class="artifactuse-panel__action artifactuse-panel__action--close" title="Close panel"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></button></div></header> <div class="artifactuse-panel__list"><div class="artifactuse-panel__list-items"></div></div> <footer class="artifactuse-panel__footer artifactuse-panel__footer--simple"><!></footer></div>'), Ms = e.from_html('<button class="artifactuse-panel__resize-handle" aria-label="Resize panel"><div class="artifactuse-panel__resize-handle-line"></div></button>'), qs = e.from_html('<button class="artifactuse-panel__back" title="Back to list"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="15 18 9 12 15 6"></polyline></svg></button>'), Is = e.from_svg('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" y1="3" x2="14" y2="10"></line><line x1="3" y1="21" x2="10" y2="14"></line></svg>'), Fs = e.from_svg('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="4 14 10 14 10 20"></polyline><polyline points="20 10 14 10 14 4"></polyline><line x1="14" y1="10" x2="21" y2="3"></line><line x1="3" y1="21" x2="10" y2="14"></line></svg>'), Rs = e.from_html('<div class="artifactuse-panel__loading"><div class="artifactuse-panel__spinner"></div></div>'), Ds = e.from_html('<iframe sandbox="allow-scripts allow-same-origin allow-forms allow-popups allow-modals allow-downloads" title="Artifact Preview"></iframe>'), Vs = e.from_html('<div class="artifactuse-panel__no-preview"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M9 17H7A5 5 0 0 1 7 7h2"></path><path d="M15 7h2a5 5 0 1 1 0 10h-2"></path><line x1="8" y1="12" x2="16" y2="12"></line></svg> <p> </p></div>'), Os = e.from_html('<div class="artifactuse-panel__preview"><!> <!></div>'), Us = e.from_html('<button class="artifactuse-panel__split-handle" aria-label="Split Resize"><div class="artifactuse-panel__split-handle-line"></div></button>'), Ns = e.from_html('<div class="artifactuse-panel__code"><!> <div class="artifactuse-panel__code-scroll"><div class="artifactuse-panel__line-numbers"></div> <pre class="artifactuse-panel__code-block"><code> </code></pre></div></div>'), js = e.from_html('<a href="https://artifactuse.com" target="_blank" rel="noopener noreferrer" class="artifactuse-panel__branding" title="Powered by Artifactuse"><svg width="16" height="16" viewBox="0 0 42 42" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16.6667 41.6673V10.4173C16.6667 9.86478 16.4472 9.33488 16.0565 8.94418C15.6658 8.55348 15.1359 8.33398 14.5833 8.33398H4.16667C3.0616 8.33398 2.00179 8.77297 1.22039 9.55437C0.438987 10.3358 0 11.3956 0 12.5007V37.5006C0 38.6057 0.438987 39.6655 1.22039 40.4469C2.00179 41.2283 3.0616 41.6673 4.16667 41.6673H29.1667C30.2717 41.6673 31.3315 41.2283 32.1129 40.4469C32.8943 39.6655 33.3333 38.6057 33.3333 37.5006V27.084C33.3333 26.5314 33.1138 26.0015 32.7231 25.6108C32.3324 25.2201 31.8025 25.0007 31.25 25.0007H0" fill="#5F51C8"></path><path d="M39.5833 0H27.0833C25.9327 0 25 0.93274 25 2.08333V14.5833C25 15.7339 25.9327 16.6667 27.0833 16.6667H39.5833C40.7339 16.6667 41.6667 15.7339 41.6667 14.5833V2.08333C41.6667 0.93274 40.7339 0 39.5833 0Z" fill="#695AE0"></path></svg> <span>Artifactuse</span></a>'), Js = e.from_html('<span class="artifactuse-panel__badge artifactuse-panel__badge--secondary"> </span>'), Xs = e.from_svg('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>'), Ws = e.from_svg('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="20 6 9 17 4 12"></polyline></svg>'), Zs = e.from_html('<button><span class="artifactuse-panel__artifact-item-icon"><!></span> <div class="artifactuse-panel__artifact-item-content"><span class="artifactuse-panel__artifact-item-title"> </span> <span class="artifactuse-panel__artifact-item-meta"> <!></span></div> <span class="artifactuse-panel__artifact-item-index"> </span></button>'), Ks = e.from_html('<div class="artifactuse-panel__artifact-list"><div class="artifactuse-panel__artifact-list-header"><span> </span> <button class="artifactuse-panel__artifact-list-close" aria-label="Close artifact list"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></button></div> <div class="artifactuse-panel__artifact-list-items"></div></div>'), Ys = e.from_html('<div class="artifactuse-panel__nav"><button class="artifactuse-panel__nav-btn" title="Previous artifact"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="15 18 9 12 15 6"></polyline></svg></button> <button class="artifactuse-panel__nav-trigger"><span> </span> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="6 9 12 15 18 9"></polyline></svg></button> <button class="artifactuse-panel__nav-btn" title="Next artifact"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="9 18 15 12 9 6"></polyline></svg></button> <!></div>'), Gs = e.from_html('<div><!> <header class="artifactuse-panel__header"><!> <div class="artifactuse-panel__title"><span class="artifactuse-panel__icon"><svg viewBox="0 0 24 24" fill="currentColor"><!></svg></span> <div class="artifactuse-panel__title-content"><span class="artifactuse-panel__name"> </span> <span class="artifactuse-panel__meta"> <!></span></div></div> <div class="artifactuse-panel__tabs"><button title="Preview"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path><circle cx="12" cy="12" r="3"></circle></svg></button> <button title="Code"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="16 18 22 12 16 6"></polyline><polyline points="8 6 2 12 8 18"></polyline></svg></button> <button title="Split view"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><line x1="12" y1="3" x2="12" y2="21"></line></svg></button></div> <div class="artifactuse-panel__actions"><button class="artifactuse-panel__action"><!></button> <button class="artifactuse-panel__action artifactuse-panel__action--close" title="Close"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></button></div></header> <div><!> <!></div> <footer class="artifactuse-panel__footer"><div class="artifactuse-panel__footer-left"><!> <!></div> <div class="artifactuse-panel__footer-right"><button><!></button> <button class="artifactuse-panel__footer-action" title="Download"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg></button> <!></div></footer></div>');
1849
1849
  function ui(Be, _) {
1850
1850
  e.push(_, !1);
1851
1851
  const ce = () => e.store_get(je, "$activeArtifact", a), B = () => e.store_get(Ie, "$state", a), b = () => e.store_get(Ze, "$artifactCount", a), r = () => e.store_get(be, "$hasArtifacts", a), [a, c] = e.setup_stores(), i = e.mutable_source(), h = e.mutable_source(), oe = e.mutable_source(), U = e.mutable_source(), ue = e.mutable_source(), xe = e.mutable_source(), de = e.mutable_source(), Te = e.mutable_source(), ye = e.mutable_source(), v = e.mutable_source(), f = e.mutable_source(), y = e.mutable_source(), Y = e.mutable_source(), $e = e.mutable_source(), Ue = e.mutable_source(), Z = e.mutable_source(), Ne = e.mutable_source(), ze = $t();
package/dist/vue/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ref as A, computed as C, createElementBlock as a, openBlock as t, normalizeClass as j, createElementVNode as e, toDisplayString as i, withModifiers as fe, onMounted as ge, watch as ue, Fragment as I, createCommentVNode as m, renderList as ce, createTextVNode as J, h as ae, normalizeStyle as xe, createStaticVNode as tt, createBlock as ye, resolveDynamicComponent as at, nextTick as he, onUnmounted as qe, Teleport as st, createVNode as Ve, Transition as Ee, withCtx as ze, withKeys as it, onBeforeUnmount as lt, unref as k, reactive as Ue, provide as nt, inject as ot } from "vue";
2
- import { g as $e, f as Ne, a as Se, b as Ie, n as rt, i as ct, D as ut, c as je } from "../index-CNXX2Rp6.js";
2
+ import { g as $e, f as Ne, a as Se, b as Ie, n as rt, i as ct, D as ut, c as je } from "../index-a__K-7Ae.js";
3
3
  import { J as dt } from "../jszip.min-CdmYyw5L.js";
4
4
  const vt = { class: "artifactuse-card__icon" }, ft = ["innerHTML"], pt = { class: "artifactuse-card__content" }, mt = { class: "artifactuse-card__title" }, _t = { class: "artifactuse-card__meta" }, ht = { class: "artifactuse-card__type" }, yt = { class: "artifactuse-card__size" }, gt = { class: "artifactuse-card__actions" }, kt = ["title"], wt = {
5
5
  key: 0,
@@ -2107,7 +2107,7 @@ const vt = { class: "artifactuse-card__icon" }, ft = ["innerHTML"], pt = { class
2107
2107
  ref: S,
2108
2108
  src: n.value,
2109
2109
  class: j(["artifactuse-panel__iframe", { "artifactuse-panel__iframe--loading": N.value }]),
2110
- sandbox: "allow-scripts allow-same-origin allow-forms allow-popups allow-modals",
2110
+ sandbox: "allow-scripts allow-same-origin allow-forms allow-popups allow-modals allow-downloads",
2111
2111
  onLoad: oe,
2112
2112
  onError: c
2113
2113
  }, null, 42, nl)) : (t(), a("div", ol, [
@@ -461,11 +461,11 @@ function extractCodeBlockArtifacts(html, messageId, options = {}) {
461
461
 
462
462
  // Detect SVG in XML/HTML
463
463
  if (['xml', 'markup', 'html', 'htm'].includes(langLower) || !langLower) {
464
- if (code.trim().startsWith('<svg') || code.includes('<svg ') || code.includes('<svg>')) {
464
+ if (code.trim().startsWith('<svg')) {
465
465
  langLower = 'svg';
466
466
  }
467
467
  }
468
-
468
+
469
469
  // Artifact extraction logic
470
470
  const isPreviewableLang = isPreviewable(langLower);
471
471
 
@@ -861,6 +861,7 @@ function createBridge(initialOrigins = []) {
861
861
  // Handle ready signal
862
862
  if (action === 'ready' || action === 'panel:ready') {
863
863
  isReady = true;
864
+
864
865
  // Send any pending messages
865
866
  pendingMessages.forEach(msg => sendRaw(msg));
866
867
  pendingMessages.length = 0;
@@ -27376,7 +27377,7 @@ var __vue_render__$1 = function () {
27376
27377
  attrs: {
27377
27378
  src: _vm.panelUrl,
27378
27379
  sandbox:
27379
- "allow-scripts allow-same-origin allow-forms allow-popups allow-modals",
27380
+ "allow-scripts allow-same-origin allow-forms allow-popups allow-modals allow-downloads",
27380
27381
  },
27381
27382
  on: {
27382
27383
  load: _vm.handleIframeLoad,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "artifactuse",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "type": "module",
5
5
  "description": "The Artifact SDK for AI Agents - Turn AI outputs into interactive experiences",
6
6
  "author": "Artifactuse",