tsv2-library 1.0.61-alpha.33 → 1.0.61-alpha.34
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/tsv2-library.es.js +20 -6
- package/dist/tsv2-library.umd.js +1 -1
- package/package.json +1 -1
package/dist/tsv2-library.es.js
CHANGED
|
@@ -55371,23 +55371,37 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
|
|
|
55371
55371
|
const timeOutId = shallowRef();
|
|
55372
55372
|
const errorLoadImage = shallowRef(false);
|
|
55373
55373
|
const resolvedGallerySrcs = ref([]);
|
|
55374
|
+
const thumbnailString = computed(() => {
|
|
55375
|
+
var _a;
|
|
55376
|
+
if (typeof props.thumbnail === "string") {
|
|
55377
|
+
return ((_a = props.thumbnail) == null ? void 0 : _a.length) ? props.thumbnail : void 0;
|
|
55378
|
+
}
|
|
55379
|
+
return props.thumbnail;
|
|
55380
|
+
});
|
|
55381
|
+
const previewString = computed(() => {
|
|
55382
|
+
var _a;
|
|
55383
|
+
if (typeof props.preview === "string") {
|
|
55384
|
+
return ((_a = props.preview) == null ? void 0 : _a.length) ? props.preview : void 0;
|
|
55385
|
+
}
|
|
55386
|
+
return props.preview;
|
|
55387
|
+
});
|
|
55374
55388
|
const usePreview = computed(() => {
|
|
55375
55389
|
var _a, _b;
|
|
55376
|
-
return !errorLoadImage.value && (!!
|
|
55390
|
+
return !errorLoadImage.value && (!!previewString.value || !((_a = imageThumbnail.value) == null ? void 0 : _a.toString().includes("data:image/svg+xml"))) && !((_b = imageThumbnail.value) == null ? void 0 : _b.toString().toLowerCase().includes("placeholder"));
|
|
55377
55391
|
});
|
|
55378
55392
|
const imageThumbnail = computedAsync(
|
|
55379
55393
|
async () => {
|
|
55380
|
-
if (!
|
|
55394
|
+
if (!thumbnailString.value || errorLoadImage.value) {
|
|
55381
55395
|
return Placeholder;
|
|
55382
55396
|
}
|
|
55383
|
-
if (typeof
|
|
55384
|
-
return
|
|
55397
|
+
if (typeof thumbnailString.value === "string") {
|
|
55398
|
+
return thumbnailString.value.includes("http") || thumbnailString.value.includes("data:image/svg+xml") ? thumbnailString.value : await getImageURL(thumbnailString.value);
|
|
55385
55399
|
}
|
|
55386
|
-
return
|
|
55400
|
+
return thumbnailString.value;
|
|
55387
55401
|
}
|
|
55388
55402
|
);
|
|
55389
55403
|
const imagePreview = computedAsync(async () => {
|
|
55390
|
-
const preview =
|
|
55404
|
+
const preview = previewString.value || imageThumbnail.value;
|
|
55391
55405
|
if (typeof preview === "string") {
|
|
55392
55406
|
return preview.includes("http") || preview.includes("data:image/svg+xml") ? preview : await getImageURL(preview);
|
|
55393
55407
|
}
|