artifactuse 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react/index.js +2 -2
- package/dist/svelte/index.js +196 -196
- package/dist/vue/index.js +3 -3
- package/dist/vue2/index.js +3 -2
- package/package.json +1 -1
package/dist/vue/index.js
CHANGED
|
@@ -1878,8 +1878,8 @@ const Ca = { class: "artifactuse-card__icon" }, xa = ["innerHTML"], $a = { class
|
|
|
1878
1878
|
var a;
|
|
1879
1879
|
return ((a = x.config) == null ? void 0 : a.branding) !== !1;
|
|
1880
1880
|
}), lt = ["image", "audio", "video", "pdf", "font", "binary"], Be = k(() => {
|
|
1881
|
-
var a;
|
|
1882
|
-
return lt.includes((a = n.value) == null ? void 0 : a.language);
|
|
1881
|
+
var a, t;
|
|
1882
|
+
return lt.includes((a = n.value) == null ? void 0 : a.language) && !!((t = n.value) != null && t.fileExtension);
|
|
1883
1883
|
}), we = k(() => Be.value ? n.value.language : null), We = k(() => we.value !== "font" || !n.value ? "" : `apfont_${n.value.id.replace(/[^a-zA-Z0-9]/g, "_")}`), Ht = k(() => {
|
|
1884
1884
|
var a;
|
|
1885
1885
|
if (we.value !== "binary" || !((a = n.value) != null && a.code)) return "";
|
|
@@ -2223,7 +2223,7 @@ const Ca = { class: "artifactuse-card__icon" }, xa = ["innerHTML"], $a = { class
|
|
|
2223
2223
|
return ne(n, (a, t) => {
|
|
2224
2224
|
a && (t && t.isPreviewable !== a.isPreviewable && (m.value = !0, setTimeout(() => {
|
|
2225
2225
|
m.value = !1;
|
|
2226
|
-
}, 150)), (!t || a.id !== t.id) && (jt(), pe.value = !0, Xt(), lt.includes(a.language) && f.viewMode !== "preview" && h("preview")), (!t || a.id !== t.id || a.code !== t.code) && (Re(), f.viewMode === "edit" && (!t || a.id !== t.id ? xe(() => vt()) : Q && Q.setCode(a.code || "")), clearTimeout(le), le = setTimeout(() => {
|
|
2226
|
+
}, 150)), (!t || a.id !== t.id) && (jt(), pe.value = !0, Xt(), lt.includes(a.language) && a.fileExtension && f.viewMode !== "preview" && h("preview")), (!t || a.id !== t.id || a.code !== t.code) && (Re(), f.viewMode === "edit" && (!t || a.id !== t.id ? xe(() => vt()) : Q && Q.setCode(a.code || "")), clearTimeout(le), le = setTimeout(() => {
|
|
2227
2227
|
N.value && a.isPreviewable && x.bridge.loadArtifact(a);
|
|
2228
2228
|
}, 500)));
|
|
2229
2229
|
}, { deep: !0 }), ne(() => f.viewMode, (a) => {
|
package/dist/vue2/index.js
CHANGED
|
@@ -27955,7 +27955,8 @@ var script$1 = defineComponent({
|
|
|
27955
27955
|
});
|
|
27956
27956
|
|
|
27957
27957
|
const isBinaryArtifact = computed(() => {
|
|
27958
|
-
return BINARY_CATEGORIES.includes(activeArtifact.value && activeArtifact.value.language)
|
|
27958
|
+
return BINARY_CATEGORIES.includes(activeArtifact.value && activeArtifact.value.language)
|
|
27959
|
+
&& !!(activeArtifact.value && activeArtifact.value.fileExtension);
|
|
27959
27960
|
});
|
|
27960
27961
|
|
|
27961
27962
|
const binaryCategory = computed(() => {
|
|
@@ -28597,7 +28598,7 @@ var script$1 = defineComponent({
|
|
|
28597
28598
|
resetCodeContainerStyles();
|
|
28598
28599
|
iframeLoading.value = true;
|
|
28599
28600
|
startIframeLoadTimeout();
|
|
28600
|
-
if (BINARY_CATEGORIES.indexOf(newArtifact.language) !== -1 && state.viewMode !== 'preview') {
|
|
28601
|
+
if (BINARY_CATEGORIES.indexOf(newArtifact.language) !== -1 && newArtifact.fileExtension && state.viewMode !== 'preview') {
|
|
28601
28602
|
setViewMode('preview');
|
|
28602
28603
|
}
|
|
28603
28604
|
}
|