artifactuse 0.3.1 → 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.
- package/dist/core/binaryPreview.d.ts +3 -0
- package/dist/core/detector.d.ts +32 -0
- package/dist/{index-vmcpJRYe.js → index-N70SEeFL.js} +356 -310
- package/dist/index.js +1 -1
- package/dist/{jszip.min-CdmYyw5L.js → jszip.min-BdBnWAEK.js} +896 -854
- package/dist/react/index.js +810 -782
- package/dist/styles/components/panel.css +75 -0
- package/dist/svelte/index.js +2284 -2119
- package/dist/vue/index.js +1509 -1419
- package/dist/vue2/index.js +410 -82
- package/package.json +1 -1
package/dist/vue2/index.js
CHANGED
|
@@ -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',
|
|
@@ -401,7 +423,8 @@ function getFileExtension$1(language) {
|
|
|
401
423
|
nim: 'nim',
|
|
402
424
|
v: 'v',
|
|
403
425
|
};
|
|
404
|
-
|
|
426
|
+
const lang = language?.toLowerCase();
|
|
427
|
+
return extensions[lang] || lang || 'txt';
|
|
405
428
|
}
|
|
406
429
|
|
|
407
430
|
/**
|
|
@@ -462,7 +485,8 @@ function getLanguageFromExtension(ext) {
|
|
|
462
485
|
nim: 'nim',
|
|
463
486
|
v: 'v',
|
|
464
487
|
};
|
|
465
|
-
|
|
488
|
+
const lower = ext?.toLowerCase();
|
|
489
|
+
return map[lower] || BINARY_EXT_LANGUAGE[lower] || null;
|
|
466
490
|
}
|
|
467
491
|
|
|
468
492
|
/**
|
|
@@ -560,6 +584,12 @@ function getLanguageIcon(language) {
|
|
|
560
584
|
zig: '<path d="M2 6h7l-5 12h7l5-12h7l-5 12h7" fill="none" stroke="currentColor" stroke-width="1.5"/>',
|
|
561
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"/>',
|
|
562
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"/>',
|
|
563
593
|
// Text/document icon
|
|
564
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"/>',
|
|
565
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"/>',
|
|
@@ -6704,6 +6734,9 @@ function loadKaTeX() {
|
|
|
6704
6734
|
// Main entry point for Artifactuse SDK
|
|
6705
6735
|
|
|
6706
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
|
+
|
|
6707
6740
|
/**
|
|
6708
6741
|
* Escape HTML for safe embedding in attributes/content
|
|
6709
6742
|
*/
|
|
@@ -7397,7 +7430,7 @@ function createArtifactuse(userConfig = {}) {
|
|
|
7397
7430
|
* Open a file by name — auto-detects language from extension
|
|
7398
7431
|
*/
|
|
7399
7432
|
function openFile(filename, code, options = {}) {
|
|
7400
|
-
const ext = filename.split('.').pop();
|
|
7433
|
+
const ext = filename.split('.').pop().toLowerCase();
|
|
7401
7434
|
const language = options.language || getLanguageFromExtension(ext) || ext;
|
|
7402
7435
|
const title = options.title || filename;
|
|
7403
7436
|
|
|
@@ -7411,7 +7444,7 @@ function createArtifactuse(userConfig = {}) {
|
|
|
7411
7444
|
return state.getArtifact(existing.id);
|
|
7412
7445
|
}
|
|
7413
7446
|
|
|
7414
|
-
return openCode(code, language, { ...options, title });
|
|
7447
|
+
return openCode(code, language, { ...options, title, fileExtension: ext });
|
|
7415
7448
|
}
|
|
7416
7449
|
|
|
7417
7450
|
/**
|
|
@@ -7419,11 +7452,12 @@ function createArtifactuse(userConfig = {}) {
|
|
|
7419
7452
|
*/
|
|
7420
7453
|
function openCode(code, language, options = {}) {
|
|
7421
7454
|
const msgId = options.messageId || generateArtifactId('open');
|
|
7422
|
-
const resolvedLang = hasPanel({ type: language, language }) ? language : 'txt';
|
|
7455
|
+
const resolvedLang = (hasPanel({ type: language, language }) || BINARY_PANEL_LANGS.has(language)) ? language : 'txt';
|
|
7423
7456
|
const artifact = createArtifact(code, resolvedLang, msgId, 0);
|
|
7424
7457
|
artifact.title = options.title || artifact.title;
|
|
7425
7458
|
artifact.isInline = false;
|
|
7426
7459
|
artifact.editorLanguage = language;
|
|
7460
|
+
if (options.fileExtension) artifact.fileExtension = options.fileExtension;
|
|
7427
7461
|
if (options.tabs) artifact.tabs = options.tabs;
|
|
7428
7462
|
if (options.panelUrl) artifact.panelUrl = options.panelUrl;
|
|
7429
7463
|
if (options.externalPreview !== undefined) artifact.externalPreview = options.externalPreview;
|
|
@@ -8203,7 +8237,7 @@ var script$6 = {
|
|
|
8203
8237
|
const blob = new Blob([this.artifact.code], { type: 'text/plain' });
|
|
8204
8238
|
const url = URL.createObjectURL(blob);
|
|
8205
8239
|
const a = document.createElement('a');
|
|
8206
|
-
const extension = getFileExtension$1(this.artifact.language);
|
|
8240
|
+
const extension = getFileExtension$1(this.artifact.editorLanguage || this.artifact.language);
|
|
8207
8241
|
const filename = this.artifact.title?.replace(/[^a-z0-9]/gi, '_').toLowerCase() || 'code';
|
|
8208
8242
|
a.href = url;
|
|
8209
8243
|
a.download = `${filename}.${extension}`;
|
|
@@ -12208,6 +12242,50 @@ __vue_render__$2._withStripped = true;
|
|
|
12208
12242
|
__vue_inject_styles__$2,
|
|
12209
12243
|
__vue_script__$2);
|
|
12210
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
|
+
|
|
12211
12289
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
12212
12290
|
|
|
12213
12291
|
function getDefaultExportFromCjs (x) {
|
|
@@ -27689,6 +27767,36 @@ var JSZip = /*@__PURE__*/getDefaultExportFromCjs(libExports);
|
|
|
27689
27767
|
//
|
|
27690
27768
|
//
|
|
27691
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
|
+
//
|
|
27692
27800
|
|
|
27693
27801
|
|
|
27694
27802
|
var script$1 = defineComponent({
|
|
@@ -27747,6 +27855,9 @@ var script$1 = defineComponent({
|
|
|
27747
27855
|
const isTransitioning = ref(false);
|
|
27748
27856
|
const cameFromList = ref(false);
|
|
27749
27857
|
const isDownloadingAll = ref(false);
|
|
27858
|
+
const BINARY_CATEGORIES = ['image', 'audio', 'video', 'pdf', 'font', 'binary'];
|
|
27859
|
+
let blobUrlCache = {};
|
|
27860
|
+
let fontStyleEl = null;
|
|
27750
27861
|
|
|
27751
27862
|
// Share modal state
|
|
27752
27863
|
const showShareModal = ref(false);
|
|
@@ -27828,6 +27939,54 @@ var script$1 = defineComponent({
|
|
|
27828
27939
|
return instance.config?.branding !== false;
|
|
27829
27940
|
});
|
|
27830
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
|
+
|
|
27831
27990
|
const showExternalPreview = computed(() => {
|
|
27832
27991
|
if (!panelUrl.value) return false;
|
|
27833
27992
|
if (activeArtifact.value?.externalPreview !== undefined) return activeArtifact.value.externalPreview;
|
|
@@ -28045,8 +28204,8 @@ var script$1 = defineComponent({
|
|
|
28045
28204
|
function handleDownload() {
|
|
28046
28205
|
if (!activeArtifact.value) return;
|
|
28047
28206
|
|
|
28048
|
-
const { code, language, title } = activeArtifact.value;
|
|
28049
|
-
const extension = getFileExtension$1(language);
|
|
28207
|
+
const { code, language, editorLanguage, title } = activeArtifact.value;
|
|
28208
|
+
const extension = getFileExtension$1(editorLanguage || language);
|
|
28050
28209
|
const filename = `${title.toLowerCase().replace(/\s+/g, '-')}.${extension}`;
|
|
28051
28210
|
|
|
28052
28211
|
const blob = new Blob([code], { type: 'text/plain' });
|
|
@@ -28074,7 +28233,7 @@ var script$1 = defineComponent({
|
|
|
28074
28233
|
for (const artifact of nonInlineArtifacts.value) {
|
|
28075
28234
|
if (!artifact.code) continue;
|
|
28076
28235
|
|
|
28077
|
-
const extension = getFileExtension$1(artifact.language);
|
|
28236
|
+
const extension = getFileExtension$1(artifact.editorLanguage || artifact.language);
|
|
28078
28237
|
let baseFilename = (artifact.title || 'untitled')
|
|
28079
28238
|
.toLowerCase()
|
|
28080
28239
|
.replace(/\s+/g, '-')
|
|
@@ -28282,6 +28441,7 @@ var script$1 = defineComponent({
|
|
|
28282
28441
|
}
|
|
28283
28442
|
|
|
28284
28443
|
function handleCloseTab(artifactId) {
|
|
28444
|
+
releaseBlobUrl(artifactId);
|
|
28285
28445
|
instance.closeTab(artifactId);
|
|
28286
28446
|
if (state.openTabs.length === 0) {
|
|
28287
28447
|
cameFromList.value = false;
|
|
@@ -28422,6 +28582,9 @@ var script$1 = defineComponent({
|
|
|
28422
28582
|
resetCodeContainerStyles();
|
|
28423
28583
|
iframeLoading.value = true;
|
|
28424
28584
|
startIframeLoadTimeout();
|
|
28585
|
+
if (BINARY_CATEGORIES.indexOf(newArtifact.language) !== -1 && state.viewMode !== 'preview') {
|
|
28586
|
+
setViewMode('preview');
|
|
28587
|
+
}
|
|
28425
28588
|
}
|
|
28426
28589
|
|
|
28427
28590
|
// Check if code changed
|
|
@@ -28510,6 +28673,18 @@ var script$1 = defineComponent({
|
|
|
28510
28673
|
});
|
|
28511
28674
|
});
|
|
28512
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
|
+
|
|
28513
28688
|
onUnmounted(() => {
|
|
28514
28689
|
stopPanelResize();
|
|
28515
28690
|
stopSplitResize();
|
|
@@ -28518,6 +28693,8 @@ var script$1 = defineComponent({
|
|
|
28518
28693
|
clearTimeout(streamEndTimer);
|
|
28519
28694
|
clearTimeout(iframeLoadTimer);
|
|
28520
28695
|
if (unsubConsole) unsubConsole();
|
|
28696
|
+
if (fontStyleEl) { fontStyleEl.remove(); fontStyleEl = null; }
|
|
28697
|
+
Object.keys(blobUrlCache).forEach(function(id) { releaseBlobUrl(id); });
|
|
28521
28698
|
});
|
|
28522
28699
|
|
|
28523
28700
|
return {
|
|
@@ -28625,6 +28802,11 @@ var script$1 = defineComponent({
|
|
|
28625
28802
|
formatExpiryDate,
|
|
28626
28803
|
|
|
28627
28804
|
// Utils
|
|
28805
|
+
isBinaryArtifact,
|
|
28806
|
+
binaryCategory,
|
|
28807
|
+
fontPreviewName,
|
|
28808
|
+
hexDump,
|
|
28809
|
+
getBlobUrl,
|
|
28628
28810
|
getLanguageDisplayName,
|
|
28629
28811
|
formatBytes,
|
|
28630
28812
|
};
|
|
@@ -29445,8 +29627,9 @@ var __vue_render__$1 = function () {
|
|
|
29445
29627
|
)
|
|
29446
29628
|
: _vm._e(),
|
|
29447
29629
|
_vm._v(" "),
|
|
29448
|
-
!_vm.activeArtifact.tabs ||
|
|
29449
|
-
|
|
29630
|
+
(!_vm.activeArtifact.tabs ||
|
|
29631
|
+
_vm.activeArtifact.tabs.includes("code")) &&
|
|
29632
|
+
!_vm.isBinaryArtifact
|
|
29450
29633
|
? _c(
|
|
29451
29634
|
"button",
|
|
29452
29635
|
{
|
|
@@ -29489,8 +29672,9 @@ var __vue_render__$1 = function () {
|
|
|
29489
29672
|
)
|
|
29490
29673
|
: _vm._e(),
|
|
29491
29674
|
_vm._v(" "),
|
|
29492
|
-
!_vm.activeArtifact.tabs ||
|
|
29493
|
-
|
|
29675
|
+
(!_vm.activeArtifact.tabs ||
|
|
29676
|
+
_vm.activeArtifact.tabs.includes("split")) &&
|
|
29677
|
+
!_vm.isBinaryArtifact
|
|
29494
29678
|
? _c(
|
|
29495
29679
|
"button",
|
|
29496
29680
|
{
|
|
@@ -29973,7 +30157,9 @@ var __vue_render__$1 = function () {
|
|
|
29973
30157
|
: null,
|
|
29974
30158
|
},
|
|
29975
30159
|
[
|
|
29976
|
-
_vm.iframeLoading &&
|
|
30160
|
+
_vm.iframeLoading &&
|
|
30161
|
+
_vm.panelUrl &&
|
|
30162
|
+
!_vm.isBinaryArtifact
|
|
29977
30163
|
? _c(
|
|
29978
30164
|
"div",
|
|
29979
30165
|
{
|
|
@@ -29989,77 +30175,219 @@ var __vue_render__$1 = function () {
|
|
|
29989
30175
|
)
|
|
29990
30176
|
: _vm._e(),
|
|
29991
30177
|
_vm._v(" "),
|
|
29992
|
-
_vm.
|
|
29993
|
-
?
|
|
29994
|
-
|
|
29995
|
-
|
|
29996
|
-
|
|
29997
|
-
|
|
29998
|
-
|
|
29999
|
-
|
|
30000
|
-
|
|
30001
|
-
|
|
30002
|
-
|
|
30003
|
-
|
|
30004
|
-
|
|
30005
|
-
|
|
30006
|
-
|
|
30007
|
-
|
|
30008
|
-
|
|
30009
|
-
|
|
30010
|
-
|
|
30011
|
-
|
|
30012
|
-
|
|
30013
|
-
|
|
30014
|
-
|
|
30015
|
-
|
|
30016
|
-
|
|
30017
|
-
|
|
30018
|
-
|
|
30019
|
-
|
|
30020
|
-
|
|
30021
|
-
|
|
30022
|
-
|
|
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
|
+
},
|
|
30023
30325
|
attrs: {
|
|
30024
|
-
|
|
30025
|
-
|
|
30026
|
-
|
|
30027
|
-
|
|
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",
|
|
30028
30331
|
},
|
|
30029
|
-
|
|
30030
|
-
|
|
30031
|
-
|
|
30032
|
-
|
|
30033
|
-
|
|
30034
|
-
|
|
30035
|
-
|
|
30036
|
-
|
|
30037
|
-
|
|
30038
|
-
|
|
30039
|
-
|
|
30040
|
-
|
|
30041
|
-
|
|
30042
|
-
|
|
30043
|
-
|
|
30044
|
-
|
|
30045
|
-
|
|
30046
|
-
|
|
30047
|
-
|
|
30048
|
-
|
|
30049
|
-
|
|
30050
|
-
|
|
30051
|
-
|
|
30052
|
-
|
|
30053
|
-
|
|
30054
|
-
|
|
30055
|
-
|
|
30056
|
-
|
|
30057
|
-
|
|
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
|
+
]
|
|
30058
30387
|
),
|
|
30059
|
-
|
|
30060
|
-
|
|
30061
|
-
|
|
30062
|
-
]
|
|
30388
|
+
],
|
|
30389
|
+
],
|
|
30390
|
+
2
|
|
30063
30391
|
)
|
|
30064
30392
|
: _vm._e(),
|
|
30065
30393
|
_vm._v(" "),
|