artifactuse 0.3.2 → 0.4.0

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.
@@ -196,8 +196,24 @@ const PANEL_LANGUAGES = [
196
196
  'jsx', 'vue', 'html', 'htm',
197
197
  // Structured artifacts (form can be panel based on complexity)
198
198
  'form',
199
+ // Binary workspace files
200
+ 'image', 'audio', 'pdf', 'font', 'binary',
199
201
  ];
200
202
 
203
+ /**
204
+ * Maps each binary extension to its panel language group.
205
+ * Note: mp4/m4a/webm map to 'video'; svg maps to 'image' (not 'svg') for binary preview.
206
+ */
207
+ const BINARY_EXT_LANGUAGE = {
208
+ png: 'image', jpg: 'image', jpeg: 'image', gif: 'image', webp: 'image',
209
+ ico: 'image', bmp: 'image', tiff: 'image', tif: 'image', svg: 'image',
210
+ mp3: 'audio', wav: 'audio', ogg: 'audio', flac: 'audio', aac: 'audio',
211
+ mp4: 'video', m4a: 'video', webm: 'video',
212
+ pdf: 'pdf',
213
+ woff: 'font', woff2: 'font', ttf: 'font', eot: 'font', otf: 'font',
214
+ bin: 'binary',
215
+ };
216
+
201
217
  /**
202
218
  * Generate unique artifact ID
203
219
  */
@@ -281,6 +297,12 @@ function getLanguageDisplayName(language) {
281
297
  // Structured artifacts
282
298
  form: 'Form',
283
299
  social: 'Social Preview',
300
+ // Binary workspace file types
301
+ image: 'Image',
302
+ audio: 'Audio',
303
+ pdf: 'PDF',
304
+ font: 'Font',
305
+ binary: 'Binary',
284
306
  txt: 'Plain Text',
285
307
  plaintext: 'Plain Text',
286
308
  text: 'Plain Text',
@@ -463,7 +485,8 @@ function getLanguageFromExtension(ext) {
463
485
  nim: 'nim',
464
486
  v: 'v',
465
487
  };
466
- return map[ext?.toLowerCase()] || null;
488
+ const lower = ext?.toLowerCase();
489
+ return map[lower] || BINARY_EXT_LANGUAGE[lower] || null;
467
490
  }
468
491
 
469
492
  /**
@@ -561,6 +584,12 @@ function getLanguageIcon(language) {
561
584
  zig: '<path d="M2 6h7l-5 12h7l5-12h7l-5 12h7" fill="none" stroke="currentColor" stroke-width="1.5"/>',
562
585
  nim: '<path d="M12 2l3 5h5l-3 5 3 5h-5l-3 5-3-5H4l3-5-3-5h5l3-5z" fill="none" stroke="currentColor" stroke-width="1.2"/>',
563
586
  v: '<path d="M4 4l8 16 8-16" fill="none" stroke="currentColor" stroke-width="2"/>',
587
+ // Binary workspace file types
588
+ image: '<rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/>',
589
+ audio: '<path d="M9 18V5l12-2v13"/><circle cx="6" cy="18" r="3"/><circle cx="18" cy="16" r="3"/>',
590
+ pdf: '<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><path d="M10 11h4M10 14h4M10 17h2"/>',
591
+ font: '<path d="M4 7V4h16v3M9 20h6M12 4v16"/>',
592
+ binary: '<path d="M4 4h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z"/><path d="M7 8v8M10 8v8M14 8h2v3h-2v2h2v3h-2M7.5 12h3"/>',
564
593
  // Text/document icon
565
594
  txt: '<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="8" y1="13" x2="16" y2="13"/><line x1="8" y1="17" x2="13" y2="17"/>',
566
595
  plaintext: '<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="8" y1="13" x2="16" y2="13"/><line x1="8" y1="17" x2="13" y2="17"/>',
@@ -6705,6 +6734,9 @@ function loadKaTeX() {
6705
6734
  // Main entry point for Artifactuse SDK
6706
6735
 
6707
6736
 
6737
+ // Binary categories render inside the panel component — no CDN panel URL needed.
6738
+ const BINARY_PANEL_LANGS = new Set(Object.values(BINARY_EXT_LANGUAGE));
6739
+
6708
6740
  /**
6709
6741
  * Escape HTML for safe embedding in attributes/content
6710
6742
  */
@@ -7398,7 +7430,7 @@ function createArtifactuse(userConfig = {}) {
7398
7430
  * Open a file by name — auto-detects language from extension
7399
7431
  */
7400
7432
  function openFile(filename, code, options = {}) {
7401
- const ext = filename.split('.').pop();
7433
+ const ext = filename.split('.').pop().toLowerCase();
7402
7434
  const language = options.language || getLanguageFromExtension(ext) || ext;
7403
7435
  const title = options.title || filename;
7404
7436
 
@@ -7412,7 +7444,7 @@ function createArtifactuse(userConfig = {}) {
7412
7444
  return state.getArtifact(existing.id);
7413
7445
  }
7414
7446
 
7415
- return openCode(code, language, { ...options, title });
7447
+ return openCode(code, language, { ...options, title, fileExtension: ext });
7416
7448
  }
7417
7449
 
7418
7450
  /**
@@ -7420,11 +7452,12 @@ function createArtifactuse(userConfig = {}) {
7420
7452
  */
7421
7453
  function openCode(code, language, options = {}) {
7422
7454
  const msgId = options.messageId || generateArtifactId('open');
7423
- const resolvedLang = hasPanel({ type: language, language }) ? language : 'txt';
7455
+ const resolvedLang = (hasPanel({ type: language, language }) || BINARY_PANEL_LANGS.has(language)) ? language : 'txt';
7424
7456
  const artifact = createArtifact(code, resolvedLang, msgId, 0);
7425
7457
  artifact.title = options.title || artifact.title;
7426
7458
  artifact.isInline = false;
7427
7459
  artifact.editorLanguage = language;
7460
+ if (options.fileExtension) artifact.fileExtension = options.fileExtension;
7428
7461
  if (options.tabs) artifact.tabs = options.tabs;
7429
7462
  if (options.panelUrl) artifact.panelUrl = options.panelUrl;
7430
7463
  if (options.externalPreview !== undefined) artifact.externalPreview = options.externalPreview;
@@ -12209,6 +12242,50 @@ __vue_render__$2._withStripped = true;
12209
12242
  __vue_inject_styles__$2,
12210
12243
  __vue_script__$2);
12211
12244
 
12245
+ const MIME_MAP = {
12246
+ png: 'image/png',
12247
+ jpg: 'image/jpeg',
12248
+ jpeg: 'image/jpeg',
12249
+ gif: 'image/gif',
12250
+ webp: 'image/webp',
12251
+ ico: 'image/x-icon',
12252
+ bmp: 'image/bmp',
12253
+ tiff: 'image/tiff',
12254
+ tif: 'image/tiff',
12255
+ svg: 'image/svg+xml',
12256
+ mp3: 'audio/mpeg',
12257
+ wav: 'audio/wav',
12258
+ ogg: 'audio/ogg',
12259
+ flac: 'audio/flac',
12260
+ aac: 'audio/aac',
12261
+ mp4: 'video/mp4',
12262
+ m4a: 'video/mp4',
12263
+ webm: 'video/webm',
12264
+ pdf: 'application/pdf',
12265
+ woff: 'font/woff',
12266
+ woff2: 'font/woff2',
12267
+ ttf: 'font/ttf',
12268
+ eot: 'application/vnd.ms-fontobject',
12269
+ otf: 'font/otf',
12270
+ bin: 'application/octet-stream',
12271
+ };
12272
+
12273
+ function getMimeType(ext) {
12274
+ return MIME_MAP[ext?.toLowerCase()] ?? 'application/octet-stream';
12275
+ }
12276
+
12277
+ function base64ToObjectUrl(base64, mimeType) {
12278
+ const bytes = atob(base64);
12279
+ const arr = new Uint8Array(bytes.length);
12280
+ for (let i = 0; i < bytes.length; i++) arr[i] = bytes.charCodeAt(i);
12281
+ const blob = new Blob([arr], { type: mimeType });
12282
+ return URL.createObjectURL(blob);
12283
+ }
12284
+
12285
+ function revokeBlobUrl(url) {
12286
+ if (url?.startsWith('blob:')) URL.revokeObjectURL(url);
12287
+ }
12288
+
12212
12289
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
12213
12290
 
12214
12291
  function getDefaultExportFromCjs (x) {
@@ -27690,6 +27767,36 @@ var JSZip = /*@__PURE__*/getDefaultExportFromCjs(libExports);
27690
27767
  //
27691
27768
  //
27692
27769
  //
27770
+ //
27771
+ //
27772
+ //
27773
+ //
27774
+ //
27775
+ //
27776
+ //
27777
+ //
27778
+ //
27779
+ //
27780
+ //
27781
+ //
27782
+ //
27783
+ //
27784
+ //
27785
+ //
27786
+ //
27787
+ //
27788
+ //
27789
+ //
27790
+ //
27791
+ //
27792
+ //
27793
+ //
27794
+ //
27795
+ //
27796
+ //
27797
+ //
27798
+ //
27799
+ //
27693
27800
 
27694
27801
 
27695
27802
  var script$1 = defineComponent({
@@ -27748,6 +27855,9 @@ var script$1 = defineComponent({
27748
27855
  const isTransitioning = ref(false);
27749
27856
  const cameFromList = ref(false);
27750
27857
  const isDownloadingAll = ref(false);
27858
+ const BINARY_CATEGORIES = ['image', 'audio', 'video', 'pdf', 'font', 'binary'];
27859
+ let blobUrlCache = {};
27860
+ let fontStyleEl = null;
27751
27861
 
27752
27862
  // Share modal state
27753
27863
  const showShareModal = ref(false);
@@ -27829,6 +27939,54 @@ var script$1 = defineComponent({
27829
27939
  return instance.config?.branding !== false;
27830
27940
  });
27831
27941
 
27942
+ const isBinaryArtifact = computed(() => {
27943
+ return BINARY_CATEGORIES.includes(activeArtifact.value && activeArtifact.value.language);
27944
+ });
27945
+
27946
+ const binaryCategory = computed(() => {
27947
+ return isBinaryArtifact.value ? activeArtifact.value.language : null;
27948
+ });
27949
+
27950
+ const fontPreviewName = computed(() => {
27951
+ if (binaryCategory.value !== 'font' || !activeArtifact.value) return '';
27952
+ return 'apfont_' + activeArtifact.value.id.replace(/[^a-zA-Z0-9]/g, '_');
27953
+ });
27954
+
27955
+ const hexDump = computed(() => {
27956
+ if (binaryCategory.value !== 'binary' || !(activeArtifact.value && activeArtifact.value.code)) return '';
27957
+ try {
27958
+ const raw = atob(activeArtifact.value.code.slice(0, 684));
27959
+ const bytes = Math.min(raw.length, 512);
27960
+ const lines = [];
27961
+ for (let i = 0; i < bytes; i += 16) {
27962
+ const chunk = raw.slice(i, i + 16);
27963
+ const hex = Array.from(chunk).map(function(c) { return c.charCodeAt(0).toString(16).padStart(2, '0'); }).join(' ');
27964
+ const ascii = Array.from(chunk).map(function(c) { const code = c.charCodeAt(0); return code >= 32 && code < 127 ? c : '.'; }).join('');
27965
+ lines.push(i.toString(16).padStart(8, '0') + ' ' + hex.padEnd(47, ' ') + ' ' + ascii);
27966
+ }
27967
+ if (bytes < raw.length || activeArtifact.value.code.length > 684) lines.push('...');
27968
+ return lines.join('\n');
27969
+ } catch (e) {
27970
+ return '(unable to decode)';
27971
+ }
27972
+ });
27973
+
27974
+ function getBlobUrl(artifact) {
27975
+ if (!artifact || !artifact.code) return null;
27976
+ if (blobUrlCache[artifact.id]) return blobUrlCache[artifact.id];
27977
+ const ext = artifact.fileExtension || artifact.language;
27978
+ const url = base64ToObjectUrl(artifact.code, getMimeType(ext));
27979
+ blobUrlCache[artifact.id] = url;
27980
+ return url;
27981
+ }
27982
+
27983
+ function releaseBlobUrl(artifactId) {
27984
+ if (blobUrlCache[artifactId]) {
27985
+ revokeBlobUrl(blobUrlCache[artifactId]);
27986
+ delete blobUrlCache[artifactId];
27987
+ }
27988
+ }
27989
+
27832
27990
  const showExternalPreview = computed(() => {
27833
27991
  if (!panelUrl.value) return false;
27834
27992
  if (activeArtifact.value?.externalPreview !== undefined) return activeArtifact.value.externalPreview;
@@ -28283,6 +28441,7 @@ var script$1 = defineComponent({
28283
28441
  }
28284
28442
 
28285
28443
  function handleCloseTab(artifactId) {
28444
+ releaseBlobUrl(artifactId);
28286
28445
  instance.closeTab(artifactId);
28287
28446
  if (state.openTabs.length === 0) {
28288
28447
  cameFromList.value = false;
@@ -28423,6 +28582,9 @@ var script$1 = defineComponent({
28423
28582
  resetCodeContainerStyles();
28424
28583
  iframeLoading.value = true;
28425
28584
  startIframeLoadTimeout();
28585
+ if (BINARY_CATEGORIES.indexOf(newArtifact.language) !== -1 && state.viewMode !== 'preview') {
28586
+ setViewMode('preview');
28587
+ }
28426
28588
  }
28427
28589
 
28428
28590
  // Check if code changed
@@ -28511,6 +28673,18 @@ var script$1 = defineComponent({
28511
28673
  });
28512
28674
  });
28513
28675
 
28676
+ watch([binaryCategory, fontPreviewName], function(vals) {
28677
+ var cat = vals[0]; var name = vals[1];
28678
+ if (fontStyleEl) { fontStyleEl.remove(); fontStyleEl = null; }
28679
+ if (cat === 'font' && name && activeArtifact.value && activeArtifact.value.code) {
28680
+ var ext = activeArtifact.value.fileExtension || 'ttf';
28681
+ var mime = getMimeType(ext);
28682
+ fontStyleEl = document.createElement('style');
28683
+ fontStyleEl.textContent = '@font-face { font-family: "' + name + '"; src: url("data:' + mime + ';base64,' + activeArtifact.value.code + '"); }';
28684
+ document.head.appendChild(fontStyleEl);
28685
+ }
28686
+ });
28687
+
28514
28688
  onUnmounted(() => {
28515
28689
  stopPanelResize();
28516
28690
  stopSplitResize();
@@ -28519,6 +28693,8 @@ var script$1 = defineComponent({
28519
28693
  clearTimeout(streamEndTimer);
28520
28694
  clearTimeout(iframeLoadTimer);
28521
28695
  if (unsubConsole) unsubConsole();
28696
+ if (fontStyleEl) { fontStyleEl.remove(); fontStyleEl = null; }
28697
+ Object.keys(blobUrlCache).forEach(function(id) { releaseBlobUrl(id); });
28522
28698
  });
28523
28699
 
28524
28700
  return {
@@ -28626,6 +28802,11 @@ var script$1 = defineComponent({
28626
28802
  formatExpiryDate,
28627
28803
 
28628
28804
  // Utils
28805
+ isBinaryArtifact,
28806
+ binaryCategory,
28807
+ fontPreviewName,
28808
+ hexDump,
28809
+ getBlobUrl,
28629
28810
  getLanguageDisplayName,
28630
28811
  formatBytes,
28631
28812
  };
@@ -29446,8 +29627,9 @@ var __vue_render__$1 = function () {
29446
29627
  )
29447
29628
  : _vm._e(),
29448
29629
  _vm._v(" "),
29449
- !_vm.activeArtifact.tabs ||
29450
- _vm.activeArtifact.tabs.includes("code")
29630
+ (!_vm.activeArtifact.tabs ||
29631
+ _vm.activeArtifact.tabs.includes("code")) &&
29632
+ !_vm.isBinaryArtifact
29451
29633
  ? _c(
29452
29634
  "button",
29453
29635
  {
@@ -29490,8 +29672,9 @@ var __vue_render__$1 = function () {
29490
29672
  )
29491
29673
  : _vm._e(),
29492
29674
  _vm._v(" "),
29493
- !_vm.activeArtifact.tabs ||
29494
- _vm.activeArtifact.tabs.includes("split")
29675
+ (!_vm.activeArtifact.tabs ||
29676
+ _vm.activeArtifact.tabs.includes("split")) &&
29677
+ !_vm.isBinaryArtifact
29495
29678
  ? _c(
29496
29679
  "button",
29497
29680
  {
@@ -29974,7 +30157,9 @@ var __vue_render__$1 = function () {
29974
30157
  : null,
29975
30158
  },
29976
30159
  [
29977
- _vm.iframeLoading && _vm.panelUrl
30160
+ _vm.iframeLoading &&
30161
+ _vm.panelUrl &&
30162
+ !_vm.isBinaryArtifact
29978
30163
  ? _c(
29979
30164
  "div",
29980
30165
  {
@@ -29990,77 +30175,219 @@ var __vue_render__$1 = function () {
29990
30175
  )
29991
30176
  : _vm._e(),
29992
30177
  _vm._v(" "),
29993
- _vm.panelUrl
29994
- ? _c("iframe", {
29995
- ref: "iframeRef",
29996
- staticClass:
29997
- "artifactuse-panel__iframe",
29998
- class: {
29999
- "artifactuse-panel__iframe--loading":
30000
- _vm.iframeLoading,
30001
- },
30002
- attrs: {
30003
- src: _vm.panelUrl,
30004
- sandbox:
30005
- "allow-scripts allow-same-origin allow-forms allow-popups allow-modals allow-downloads allow-top-navigation-by-user-activation",
30006
- allow:
30007
- "camera; microphone; fullscreen; geolocation; display-capture; autoplay; clipboard-write; encrypted-media; gyroscope; accelerometer; picture-in-picture",
30008
- },
30009
- on: {
30010
- load: _vm.handleIframeLoad,
30011
- error: _vm.handleIframeError,
30012
- },
30013
- })
30014
- : _c(
30015
- "div",
30016
- {
30017
- staticClass:
30018
- "artifactuse-panel__no-preview",
30019
- },
30020
- [
30021
- _c(
30022
- "svg",
30023
- {
30178
+ _vm.isBinaryArtifact
30179
+ ? [
30180
+ _vm.binaryCategory === "image"
30181
+ ? _c(
30182
+ "div",
30183
+ {
30184
+ staticClass:
30185
+ "artifactuse-panel__binary artifactuse-panel__binary--image",
30186
+ },
30187
+ [
30188
+ _c("img", {
30189
+ attrs: {
30190
+ src: _vm.getBlobUrl(
30191
+ _vm.activeArtifact
30192
+ ),
30193
+ alt: _vm.activeArtifact
30194
+ .title,
30195
+ },
30196
+ }),
30197
+ ]
30198
+ )
30199
+ : _vm.binaryCategory === "audio"
30200
+ ? _c(
30201
+ "div",
30202
+ {
30203
+ staticClass:
30204
+ "artifactuse-panel__binary artifactuse-panel__binary--audio",
30205
+ },
30206
+ [
30207
+ _c("audio", {
30208
+ attrs: {
30209
+ controls: "",
30210
+ src: _vm.getBlobUrl(
30211
+ _vm.activeArtifact
30212
+ ),
30213
+ },
30214
+ }),
30215
+ ]
30216
+ )
30217
+ : _vm.binaryCategory === "video"
30218
+ ? _c(
30219
+ "div",
30220
+ {
30221
+ staticClass:
30222
+ "artifactuse-panel__binary artifactuse-panel__binary--video",
30223
+ },
30224
+ [
30225
+ _c("video", {
30226
+ attrs: {
30227
+ controls: "",
30228
+ src: _vm.getBlobUrl(
30229
+ _vm.activeArtifact
30230
+ ),
30231
+ },
30232
+ }),
30233
+ ]
30234
+ )
30235
+ : _vm.binaryCategory === "pdf"
30236
+ ? _c(
30237
+ "div",
30238
+ {
30239
+ staticClass:
30240
+ "artifactuse-panel__binary artifactuse-panel__binary--pdf",
30241
+ },
30242
+ [
30243
+ _c("iframe", {
30244
+ attrs: {
30245
+ src:
30246
+ _vm.getBlobUrl(
30247
+ _vm.activeArtifact
30248
+ ) + "#toolbar=1",
30249
+ frameborder: "0",
30250
+ },
30251
+ }),
30252
+ ]
30253
+ )
30254
+ : _vm.binaryCategory === "font"
30255
+ ? _c(
30256
+ "div",
30257
+ {
30258
+ staticClass:
30259
+ "artifactuse-panel__binary artifactuse-panel__binary--font",
30260
+ },
30261
+ [
30262
+ _c(
30263
+ "div",
30264
+ {
30265
+ staticClass:
30266
+ "artifactuse-panel__font-sample",
30267
+ style: {
30268
+ fontFamily:
30269
+ _vm.fontPreviewName,
30270
+ },
30271
+ },
30272
+ [
30273
+ _vm._v(
30274
+ "\n AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz\n "
30275
+ ),
30276
+ ]
30277
+ ),
30278
+ _vm._v(" "),
30279
+ _c(
30280
+ "div",
30281
+ {
30282
+ staticClass:
30283
+ "artifactuse-panel__font-sample artifactuse-panel__font-sample--sm",
30284
+ style: {
30285
+ fontFamily:
30286
+ _vm.fontPreviewName,
30287
+ },
30288
+ },
30289
+ [
30290
+ _vm._v(
30291
+ "\n 0123456789 !@#$%^&*()\n "
30292
+ ),
30293
+ ]
30294
+ ),
30295
+ ]
30296
+ )
30297
+ : _c(
30298
+ "div",
30299
+ {
30300
+ staticClass:
30301
+ "artifactuse-panel__binary artifactuse-panel__binary--hex",
30302
+ },
30303
+ [
30304
+ _c(
30305
+ "pre",
30306
+ {
30307
+ staticClass:
30308
+ "artifactuse-panel__hex-dump",
30309
+ },
30310
+ [_vm._v(_vm._s(_vm.hexDump))]
30311
+ ),
30312
+ ]
30313
+ ),
30314
+ ]
30315
+ : [
30316
+ _vm.panelUrl
30317
+ ? _c("iframe", {
30318
+ ref: "iframeRef",
30319
+ staticClass:
30320
+ "artifactuse-panel__iframe",
30321
+ class: {
30322
+ "artifactuse-panel__iframe--loading":
30323
+ _vm.iframeLoading,
30324
+ },
30024
30325
  attrs: {
30025
- viewBox: "0 0 24 24",
30026
- fill: "none",
30027
- stroke: "currentColor",
30028
- "stroke-width": "1.5",
30326
+ src: _vm.panelUrl,
30327
+ sandbox:
30328
+ "allow-scripts allow-same-origin allow-forms allow-popups allow-modals allow-downloads allow-top-navigation-by-user-activation",
30329
+ allow:
30330
+ "camera; microphone; fullscreen; geolocation; display-capture; autoplay; clipboard-write; encrypted-media; gyroscope; accelerometer; picture-in-picture",
30029
30331
  },
30030
- },
30031
- [
30032
- _c("path", {
30033
- attrs: {
30034
- d: "M9 17H7A5 5 0 0 1 7 7h2",
30035
- },
30036
- }),
30037
- _vm._v(" "),
30038
- _c("path", {
30039
- attrs: {
30040
- d: "M15 7h2a5 5 0 1 1 0 10h-2",
30041
- },
30042
- }),
30043
- _vm._v(" "),
30044
- _c("line", {
30045
- attrs: {
30046
- x1: "8",
30047
- y1: "12",
30048
- x2: "16",
30049
- y2: "12",
30050
- },
30051
- }),
30052
- ]
30053
- ),
30054
- _vm._v(" "),
30055
- _c("p", [
30056
- _vm._v(
30057
- "Preview not available for " +
30058
- _vm._s(_vm.languageDisplay)
30332
+ on: {
30333
+ load: _vm.handleIframeLoad,
30334
+ error: _vm.handleIframeError,
30335
+ },
30336
+ })
30337
+ : _c(
30338
+ "div",
30339
+ {
30340
+ staticClass:
30341
+ "artifactuse-panel__no-preview",
30342
+ },
30343
+ [
30344
+ _c(
30345
+ "svg",
30346
+ {
30347
+ attrs: {
30348
+ viewBox: "0 0 24 24",
30349
+ fill: "none",
30350
+ stroke: "currentColor",
30351
+ "stroke-width": "1.5",
30352
+ },
30353
+ },
30354
+ [
30355
+ _c("path", {
30356
+ attrs: {
30357
+ d: "M9 17H7A5 5 0 0 1 7 7h2",
30358
+ },
30359
+ }),
30360
+ _vm._v(" "),
30361
+ _c("path", {
30362
+ attrs: {
30363
+ d: "M15 7h2a5 5 0 1 1 0 10h-2",
30364
+ },
30365
+ }),
30366
+ _vm._v(" "),
30367
+ _c("line", {
30368
+ attrs: {
30369
+ x1: "8",
30370
+ y1: "12",
30371
+ x2: "16",
30372
+ y2: "12",
30373
+ },
30374
+ }),
30375
+ ]
30376
+ ),
30377
+ _vm._v(" "),
30378
+ _c("p", [
30379
+ _vm._v(
30380
+ "Preview not available for " +
30381
+ _vm._s(
30382
+ _vm.languageDisplay
30383
+ )
30384
+ ),
30385
+ ]),
30386
+ ]
30059
30387
  ),
30060
- ]),
30061
- ]
30062
- ),
30063
- ]
30388
+ ],
30389
+ ],
30390
+ 2
30064
30391
  )
30065
30392
  : _vm._e(),
30066
30393
  _vm._v(" "),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "artifactuse",
3
- "version": "0.3.2",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "description": "The Artifact SDK for AI Agents - Turn AI outputs into interactive experiences",
6
6
  "author": "Artifactuse",