@bagelink/vue 0.0.1232 → 0.0.1234
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/components/Image.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/Upload/UploadInput.vue.d.ts.map +1 -1
- package/dist/components/lightbox/Lightbox.vue.d.ts.map +1 -1
- package/dist/index.cjs +24 -23
- package/dist/index.mjs +24 -23
- package/dist/style.css +53 -53
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Image.vue +3 -8
- package/src/components/form/inputs/Upload/UploadInput.vue +7 -9
- package/src/components/lightbox/Lightbox.vue +1 -1
- package/src/components/lightbox/index.ts +3 -3
- package/src/utils/index.ts +10 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.vue.d.ts","sourceRoot":"","sources":["../../src/components/Image.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Image.vue.d.ts","sourceRoot":"","sources":["../../src/components/Image.vue"],"names":[],"mappings":"AA0JA,UAAU,UAAU;IACnB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACxB,OAAO,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,MAAM;QACf,QAAQ,EAAE,GAAG,CAAA;KACb;CACD;;AA6LD,wBAMG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UploadInput.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/inputs/Upload/UploadInput.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UploadInput.vue.d.ts","sourceRoot":"","sources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KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Lightbox.vue.d.ts","sourceRoot":"","sources":["../../../src/components/lightbox/Lightbox.vue"],"names":[],"mappings":"AAgRA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAUpD,iBAAS,IAAI,CAAC,IAAI,EAAE,YAAY,EAAE,UAAU,CAAC,EAAE,YAAY,EAAE,QAK5D;AAED,iBAAS,KAAK,SAGb;;;;;
|
|
1
|
+
{"version":3,"file":"Lightbox.vue.d.ts","sourceRoot":"","sources":["../../../src/components/lightbox/Lightbox.vue"],"names":[],"mappings":"AAgRA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAUpD,iBAAS,IAAI,CAAC,IAAI,EAAE,YAAY,EAAE,UAAU,CAAC,EAAE,YAAY,EAAE,QAK5D;AAED,iBAAS,KAAK,SAGb;;;;;AAojBD,wBAOG"}
|
package/dist/index.cjs
CHANGED
|
@@ -35949,8 +35949,6 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
|
35949
35949
|
const emit2 = __emit;
|
|
35950
35950
|
const bagel = useBagel();
|
|
35951
35951
|
files.setBaseUrl(bagel.host);
|
|
35952
|
-
const fileBaseUrl = vue.computed(() => (props2.baseURL || bagel.fileBaseUrl || "https://files.bagel.design").replace(/\/$/, ""));
|
|
35953
|
-
const pathToUrl = (path_key) => `${fileBaseUrl.value}/${path_key}`;
|
|
35954
35952
|
const fileQueue = vue.ref([]);
|
|
35955
35953
|
let storageFiles = vue.ref([]);
|
|
35956
35954
|
const pk = vue.ref([props2.modelValue].flat().filter(Boolean));
|
|
@@ -36079,7 +36077,7 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
|
36079
36077
|
icon: "download",
|
|
36080
36078
|
flat: "",
|
|
36081
36079
|
thin: "",
|
|
36082
|
-
href:
|
|
36080
|
+
href: vue.unref(pathKeyToURL)(path_key),
|
|
36083
36081
|
download: path_key.split("/").pop()
|
|
36084
36082
|
}, null, 8, ["href", "download"]),
|
|
36085
36083
|
vue.createElementVNode("div", _hoisted_5$4, [
|
|
@@ -36090,7 +36088,7 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
|
36090
36088
|
vue.withDirectives((vue.openBlock(), vue.createElementBlock("p", _hoisted_6$4, [
|
|
36091
36089
|
vue.createTextVNode(vue.toDisplayString(path_key.split("/").pop()), 1)
|
|
36092
36090
|
])), [
|
|
36093
|
-
[_directive_lightbox, { src:
|
|
36091
|
+
[_directive_lightbox, { src: vue.unref(pathKeyToURL)(path_key), download: true }]
|
|
36094
36092
|
])
|
|
36095
36093
|
])
|
|
36096
36094
|
])
|
|
@@ -36140,7 +36138,7 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
|
36140
36138
|
onClick: ($event) => removeFile(path_key)
|
|
36141
36139
|
}, null, 8, ["onClick"])
|
|
36142
36140
|
], 2)), [
|
|
36143
|
-
[_directive_lightbox, { src:
|
|
36141
|
+
[_directive_lightbox, { src: vue.unref(pathKeyToURL)(path_key), download: true }]
|
|
36144
36142
|
]);
|
|
36145
36143
|
}), 128)),
|
|
36146
36144
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(fileQueue.value, (file) => {
|
|
@@ -36198,7 +36196,7 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
|
36198
36196
|
color: "gray",
|
|
36199
36197
|
thin: "",
|
|
36200
36198
|
icon: "download",
|
|
36201
|
-
href:
|
|
36199
|
+
href: vue.unref(pathKeyToURL)(path_key),
|
|
36202
36200
|
download: path_key.split("/").pop()
|
|
36203
36201
|
}, null, 8, ["href", "download"]), [
|
|
36204
36202
|
[_directive_tooltip, "Download"]
|
|
@@ -36210,7 +36208,7 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
|
36210
36208
|
pathKey: path_key,
|
|
36211
36209
|
alt: ""
|
|
36212
36210
|
}, null, 8, ["pathKey"]), [
|
|
36213
|
-
[_directive_lightbox, { src:
|
|
36211
|
+
[_directive_lightbox, { src: vue.unref(pathKeyToURL)(path_key), download: true }]
|
|
36214
36212
|
])
|
|
36215
36213
|
])) : vue.withDirectives((vue.openBlock(), vue.createBlock(vue.unref(_sfc_main$r), {
|
|
36216
36214
|
key: 1,
|
|
@@ -36219,7 +36217,7 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
|
36219
36217
|
icon: "description",
|
|
36220
36218
|
class: "color-primary w-100"
|
|
36221
36219
|
}, null, 512)), [
|
|
36222
|
-
[_directive_lightbox, { src:
|
|
36220
|
+
[_directive_lightbox, { src: vue.unref(pathKeyToURL)(path_key), download: true }]
|
|
36223
36221
|
])
|
|
36224
36222
|
], 2);
|
|
36225
36223
|
}), 128)),
|
|
@@ -36266,7 +36264,7 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
|
36266
36264
|
};
|
|
36267
36265
|
}
|
|
36268
36266
|
});
|
|
36269
|
-
const UploadInput = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-
|
|
36267
|
+
const UploadInput = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-fcdea419"]]);
|
|
36270
36268
|
const FONT_AWESOME_ICONS = [
|
|
36271
36269
|
"trash-can",
|
|
36272
36270
|
"message",
|
|
@@ -40804,15 +40802,10 @@ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
|
|
|
40804
40802
|
const props2 = __props;
|
|
40805
40803
|
let imageSrc = vue.ref(null);
|
|
40806
40804
|
let loadingError = vue.ref(false);
|
|
40807
|
-
const fileBaseUrl = vue.computed(() => "https://files.bagel.design");
|
|
40808
40805
|
function getImageUrl() {
|
|
40809
|
-
var _a2;
|
|
40810
40806
|
if (!props2.src && !props2.pathKey) return null;
|
|
40811
40807
|
if (props2.src) return props2.src;
|
|
40812
|
-
|
|
40813
|
-
return `${void 0}/${props2.pathKey}`;
|
|
40814
|
-
}
|
|
40815
|
-
return `${fileBaseUrl.value}/${props2.pathKey}`;
|
|
40808
|
+
return pathKeyToURL(props2.pathKey);
|
|
40816
40809
|
}
|
|
40817
40810
|
async function getCachedImage(url) {
|
|
40818
40811
|
if (!("caches" in window)) return null;
|
|
@@ -40911,7 +40904,7 @@ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
|
|
|
40911
40904
|
};
|
|
40912
40905
|
}
|
|
40913
40906
|
});
|
|
40914
|
-
const Image$1 = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-
|
|
40907
|
+
const Image$1 = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-1cec7fb3"]]);
|
|
40915
40908
|
const _hoisted_1$i = { class: "m-0 pb-025 txt14 line-height-1 w60 menu-text" };
|
|
40916
40909
|
const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
|
|
40917
40910
|
__name: "BottomMenu",
|
|
@@ -43549,14 +43542,14 @@ class BagelAuth {
|
|
|
43549
43542
|
}
|
|
43550
43543
|
}
|
|
43551
43544
|
class Bagel {
|
|
43552
|
-
constructor({ host, fileBaseUrl, onError }) {
|
|
43545
|
+
constructor({ host, fileBaseUrl: fileBaseUrl2, onError }) {
|
|
43553
43546
|
__publicField(this, "host");
|
|
43554
43547
|
__publicField(this, "fileBaseUrl");
|
|
43555
43548
|
__publicField(this, "onError");
|
|
43556
43549
|
__publicField(this, "read_table");
|
|
43557
43550
|
__publicField(this, "auth", new BagelAuth(this));
|
|
43558
43551
|
this.host = host == null ? void 0 : host.replace(/\/$/, "");
|
|
43559
|
-
this.fileBaseUrl =
|
|
43552
|
+
this.fileBaseUrl = fileBaseUrl2 == null ? void 0 : fileBaseUrl2.replace(/\/$/, "");
|
|
43560
43553
|
if (!this.host) {
|
|
43561
43554
|
return this;
|
|
43562
43555
|
}
|
|
@@ -43835,10 +43828,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
43835
43828
|
vue.createVNode(vue.unref(Image$1), {
|
|
43836
43829
|
draggable: false,
|
|
43837
43830
|
src: item == null ? void 0 : item.src,
|
|
43838
|
-
pathKey: item == null ? void 0 : item.pathKey,
|
|
43839
43831
|
alt: "Preview",
|
|
43840
43832
|
class: "vw90 lightbox-image"
|
|
43841
|
-
}, null, 8, ["src"
|
|
43833
|
+
}, null, 8, ["src"])
|
|
43842
43834
|
]),
|
|
43843
43835
|
_: 2
|
|
43844
43836
|
}, 1032, ["zoom", "disabled"])) : (item == null ? void 0 : item.type) === "video" && (item == null ? void 0 : item.src) ? (vue.openBlock(), vue.createBlock(vue.unref(BglVideo), {
|
|
@@ -43919,7 +43911,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
43919
43911
|
};
|
|
43920
43912
|
}
|
|
43921
43913
|
});
|
|
43922
|
-
const Lightbox$1 = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
43914
|
+
const Lightbox$1 = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-a5e1d29b"]]);
|
|
43923
43915
|
const groups = {};
|
|
43924
43916
|
let clickHandler = (_e2) => void 0;
|
|
43925
43917
|
const lightboxDirective = {
|
|
@@ -43961,8 +43953,8 @@ function openClickHandler(e, el, binding) {
|
|
|
43961
43953
|
open(item, group);
|
|
43962
43954
|
}
|
|
43963
43955
|
function bindingToItem(binding, el) {
|
|
43964
|
-
let { group, src, type: type3, name, thumbnail, enableZoom, openFile, download } = binding.value || {};
|
|
43965
|
-
src = src || binding.value || el.getAttribute("src") || "";
|
|
43956
|
+
let { group, src, type: type3, name, thumbnail, enableZoom, openFile, download, pathKey } = binding.value || {};
|
|
43957
|
+
src = src || pathKeyToURL(pathKey) || binding.value || el.getAttribute("src") || "";
|
|
43966
43958
|
type3 = type3 || determineFileType(src);
|
|
43967
43959
|
name = name || urlToName(src) || el.getAttribute("alt") || "";
|
|
43968
43960
|
return { src, type: type3, name, thumbnail, group, enableZoom, openFile, download };
|
|
@@ -44509,6 +44501,14 @@ function normalizeDimension(value, defaultMetric = "px") {
|
|
|
44509
44501
|
if (typeof value === "number") return `${value}${defaultMetric}`;
|
|
44510
44502
|
return value;
|
|
44511
44503
|
}
|
|
44504
|
+
const fileBaseUrl = "https://files.bagel.design".replace(/\/$/, "");
|
|
44505
|
+
const bagelBaseUrl = void 0;
|
|
44506
|
+
function pathKeyToURL(pathKey) {
|
|
44507
|
+
if (pathKey.startsWith("static/")) {
|
|
44508
|
+
return `${bagelBaseUrl}/${pathKey}`;
|
|
44509
|
+
}
|
|
44510
|
+
return `${fileBaseUrl}/${pathKey}`;
|
|
44511
|
+
}
|
|
44512
44512
|
const clickOutside = {
|
|
44513
44513
|
beforeMount(el, binding) {
|
|
44514
44514
|
el.clickOutsideEvent = (event) => {
|
|
@@ -45135,6 +45135,7 @@ exports.keyToLabel = keyToLabel;
|
|
|
45135
45135
|
exports.localRef = localRef;
|
|
45136
45136
|
exports.normalizeDimension = normalizeDimension;
|
|
45137
45137
|
exports.normalizeURL = normalizeURL;
|
|
45138
|
+
exports.pathKeyToURL = pathKeyToURL;
|
|
45138
45139
|
exports.provideBagelFormState = provideBagelFormState;
|
|
45139
45140
|
exports.sleep = sleep;
|
|
45140
45141
|
exports.slugify = slugify;
|
package/dist/index.mjs
CHANGED
|
@@ -35947,8 +35947,6 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
35947
35947
|
const emit2 = __emit;
|
|
35948
35948
|
const bagel = useBagel();
|
|
35949
35949
|
files.setBaseUrl(bagel.host);
|
|
35950
|
-
const fileBaseUrl = computed(() => (props2.baseURL || bagel.fileBaseUrl || "https://files.bagel.design").replace(/\/$/, ""));
|
|
35951
|
-
const pathToUrl = (path_key) => `${fileBaseUrl.value}/${path_key}`;
|
|
35952
35950
|
const fileQueue = ref([]);
|
|
35953
35951
|
let storageFiles = ref([]);
|
|
35954
35952
|
const pk = ref([props2.modelValue].flat().filter(Boolean));
|
|
@@ -36077,7 +36075,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
36077
36075
|
icon: "download",
|
|
36078
36076
|
flat: "",
|
|
36079
36077
|
thin: "",
|
|
36080
|
-
href:
|
|
36078
|
+
href: unref(pathKeyToURL)(path_key),
|
|
36081
36079
|
download: path_key.split("/").pop()
|
|
36082
36080
|
}, null, 8, ["href", "download"]),
|
|
36083
36081
|
createElementVNode("div", _hoisted_5$4, [
|
|
@@ -36088,7 +36086,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
36088
36086
|
withDirectives((openBlock(), createElementBlock("p", _hoisted_6$4, [
|
|
36089
36087
|
createTextVNode(toDisplayString(path_key.split("/").pop()), 1)
|
|
36090
36088
|
])), [
|
|
36091
|
-
[_directive_lightbox, { src:
|
|
36089
|
+
[_directive_lightbox, { src: unref(pathKeyToURL)(path_key), download: true }]
|
|
36092
36090
|
])
|
|
36093
36091
|
])
|
|
36094
36092
|
])
|
|
@@ -36138,7 +36136,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
36138
36136
|
onClick: ($event) => removeFile(path_key)
|
|
36139
36137
|
}, null, 8, ["onClick"])
|
|
36140
36138
|
], 2)), [
|
|
36141
|
-
[_directive_lightbox, { src:
|
|
36139
|
+
[_directive_lightbox, { src: unref(pathKeyToURL)(path_key), download: true }]
|
|
36142
36140
|
]);
|
|
36143
36141
|
}), 128)),
|
|
36144
36142
|
(openBlock(true), createElementBlock(Fragment, null, renderList(fileQueue.value, (file) => {
|
|
@@ -36196,7 +36194,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
36196
36194
|
color: "gray",
|
|
36197
36195
|
thin: "",
|
|
36198
36196
|
icon: "download",
|
|
36199
|
-
href:
|
|
36197
|
+
href: unref(pathKeyToURL)(path_key),
|
|
36200
36198
|
download: path_key.split("/").pop()
|
|
36201
36199
|
}, null, 8, ["href", "download"]), [
|
|
36202
36200
|
[_directive_tooltip, "Download"]
|
|
@@ -36208,7 +36206,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
36208
36206
|
pathKey: path_key,
|
|
36209
36207
|
alt: ""
|
|
36210
36208
|
}, null, 8, ["pathKey"]), [
|
|
36211
|
-
[_directive_lightbox, { src:
|
|
36209
|
+
[_directive_lightbox, { src: unref(pathKeyToURL)(path_key), download: true }]
|
|
36212
36210
|
])
|
|
36213
36211
|
])) : withDirectives((openBlock(), createBlock(unref(_sfc_main$r), {
|
|
36214
36212
|
key: 1,
|
|
@@ -36217,7 +36215,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
36217
36215
|
icon: "description",
|
|
36218
36216
|
class: "color-primary w-100"
|
|
36219
36217
|
}, null, 512)), [
|
|
36220
|
-
[_directive_lightbox, { src:
|
|
36218
|
+
[_directive_lightbox, { src: unref(pathKeyToURL)(path_key), download: true }]
|
|
36221
36219
|
])
|
|
36222
36220
|
], 2);
|
|
36223
36221
|
}), 128)),
|
|
@@ -36264,7 +36262,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
36264
36262
|
};
|
|
36265
36263
|
}
|
|
36266
36264
|
});
|
|
36267
|
-
const UploadInput = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-
|
|
36265
|
+
const UploadInput = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-fcdea419"]]);
|
|
36268
36266
|
const FONT_AWESOME_ICONS = [
|
|
36269
36267
|
"trash-can",
|
|
36270
36268
|
"message",
|
|
@@ -40802,15 +40800,10 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
40802
40800
|
const props2 = __props;
|
|
40803
40801
|
let imageSrc = ref(null);
|
|
40804
40802
|
let loadingError = ref(false);
|
|
40805
|
-
const fileBaseUrl = computed(() => "https://files.bagel.design");
|
|
40806
40803
|
function getImageUrl() {
|
|
40807
|
-
var _a2;
|
|
40808
40804
|
if (!props2.src && !props2.pathKey) return null;
|
|
40809
40805
|
if (props2.src) return props2.src;
|
|
40810
|
-
|
|
40811
|
-
return `${void 0}/${props2.pathKey}`;
|
|
40812
|
-
}
|
|
40813
|
-
return `${fileBaseUrl.value}/${props2.pathKey}`;
|
|
40806
|
+
return pathKeyToURL(props2.pathKey);
|
|
40814
40807
|
}
|
|
40815
40808
|
async function getCachedImage(url) {
|
|
40816
40809
|
if (!("caches" in window)) return null;
|
|
@@ -40909,7 +40902,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
40909
40902
|
};
|
|
40910
40903
|
}
|
|
40911
40904
|
});
|
|
40912
|
-
const Image$1 = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-
|
|
40905
|
+
const Image$1 = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-1cec7fb3"]]);
|
|
40913
40906
|
const _hoisted_1$i = { class: "m-0 pb-025 txt14 line-height-1 w60 menu-text" };
|
|
40914
40907
|
const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
40915
40908
|
__name: "BottomMenu",
|
|
@@ -43547,14 +43540,14 @@ class BagelAuth {
|
|
|
43547
43540
|
}
|
|
43548
43541
|
}
|
|
43549
43542
|
class Bagel {
|
|
43550
|
-
constructor({ host, fileBaseUrl, onError }) {
|
|
43543
|
+
constructor({ host, fileBaseUrl: fileBaseUrl2, onError }) {
|
|
43551
43544
|
__publicField(this, "host");
|
|
43552
43545
|
__publicField(this, "fileBaseUrl");
|
|
43553
43546
|
__publicField(this, "onError");
|
|
43554
43547
|
__publicField(this, "read_table");
|
|
43555
43548
|
__publicField(this, "auth", new BagelAuth(this));
|
|
43556
43549
|
this.host = host == null ? void 0 : host.replace(/\/$/, "");
|
|
43557
|
-
this.fileBaseUrl =
|
|
43550
|
+
this.fileBaseUrl = fileBaseUrl2 == null ? void 0 : fileBaseUrl2.replace(/\/$/, "");
|
|
43558
43551
|
if (!this.host) {
|
|
43559
43552
|
return this;
|
|
43560
43553
|
}
|
|
@@ -43833,10 +43826,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
43833
43826
|
createVNode(unref(Image$1), {
|
|
43834
43827
|
draggable: false,
|
|
43835
43828
|
src: item == null ? void 0 : item.src,
|
|
43836
|
-
pathKey: item == null ? void 0 : item.pathKey,
|
|
43837
43829
|
alt: "Preview",
|
|
43838
43830
|
class: "vw90 lightbox-image"
|
|
43839
|
-
}, null, 8, ["src"
|
|
43831
|
+
}, null, 8, ["src"])
|
|
43840
43832
|
]),
|
|
43841
43833
|
_: 2
|
|
43842
43834
|
}, 1032, ["zoom", "disabled"])) : (item == null ? void 0 : item.type) === "video" && (item == null ? void 0 : item.src) ? (openBlock(), createBlock(unref(BglVideo), {
|
|
@@ -43917,7 +43909,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
43917
43909
|
};
|
|
43918
43910
|
}
|
|
43919
43911
|
});
|
|
43920
|
-
const Lightbox$1 = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
43912
|
+
const Lightbox$1 = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-a5e1d29b"]]);
|
|
43921
43913
|
const groups = {};
|
|
43922
43914
|
let clickHandler = (_e2) => void 0;
|
|
43923
43915
|
const lightboxDirective = {
|
|
@@ -43959,8 +43951,8 @@ function openClickHandler(e, el, binding) {
|
|
|
43959
43951
|
open(item, group);
|
|
43960
43952
|
}
|
|
43961
43953
|
function bindingToItem(binding, el) {
|
|
43962
|
-
let { group, src, type: type3, name, thumbnail, enableZoom, openFile, download } = binding.value || {};
|
|
43963
|
-
src = src || binding.value || el.getAttribute("src") || "";
|
|
43954
|
+
let { group, src, type: type3, name, thumbnail, enableZoom, openFile, download, pathKey } = binding.value || {};
|
|
43955
|
+
src = src || pathKeyToURL(pathKey) || binding.value || el.getAttribute("src") || "";
|
|
43964
43956
|
type3 = type3 || determineFileType(src);
|
|
43965
43957
|
name = name || urlToName(src) || el.getAttribute("alt") || "";
|
|
43966
43958
|
return { src, type: type3, name, thumbnail, group, enableZoom, openFile, download };
|
|
@@ -44507,6 +44499,14 @@ function normalizeDimension(value, defaultMetric = "px") {
|
|
|
44507
44499
|
if (typeof value === "number") return `${value}${defaultMetric}`;
|
|
44508
44500
|
return value;
|
|
44509
44501
|
}
|
|
44502
|
+
const fileBaseUrl = "https://files.bagel.design".replace(/\/$/, "");
|
|
44503
|
+
const bagelBaseUrl = void 0;
|
|
44504
|
+
function pathKeyToURL(pathKey) {
|
|
44505
|
+
if (pathKey.startsWith("static/")) {
|
|
44506
|
+
return `${bagelBaseUrl}/${pathKey}`;
|
|
44507
|
+
}
|
|
44508
|
+
return `${fileBaseUrl}/${pathKey}`;
|
|
44509
|
+
}
|
|
44510
44510
|
const clickOutside = {
|
|
44511
44511
|
beforeMount(el, binding) {
|
|
44512
44512
|
el.clickOutsideEvent = (event) => {
|
|
@@ -45134,6 +45134,7 @@ export {
|
|
|
45134
45134
|
localRef,
|
|
45135
45135
|
normalizeDimension,
|
|
45136
45136
|
normalizeURL,
|
|
45137
|
+
pathKeyToURL,
|
|
45137
45138
|
provideBagelFormState,
|
|
45138
45139
|
sleep,
|
|
45139
45140
|
slugify,
|
package/dist/style.css
CHANGED
|
@@ -2454,7 +2454,7 @@ line-height: 1.65;
|
|
|
2454
2454
|
.bgl-toggle input:checked + label[data-v-ebe691ee] {
|
|
2455
2455
|
color: var(--bgl-primary) !important;
|
|
2456
2456
|
}
|
|
2457
|
-
.fileUploadWrap[data-v-
|
|
2457
|
+
.fileUploadWrap[data-v-fcdea419] {
|
|
2458
2458
|
outline: 1px solid var(--border-color);
|
|
2459
2459
|
border-radius: var(--input-border-radius);
|
|
2460
2460
|
text-align: center;
|
|
@@ -2466,7 +2466,7 @@ line-height: 1.65;
|
|
|
2466
2466
|
background: var(--input-bg);
|
|
2467
2467
|
height: 215px;
|
|
2468
2468
|
}
|
|
2469
|
-
.bagel-input .fileUploadWrap.fileDropZone[data-v-
|
|
2469
|
+
.bagel-input .fileUploadWrap.fileDropZone[data-v-fcdea419] {
|
|
2470
2470
|
background: var(--input-bg);
|
|
2471
2471
|
display: flex;
|
|
2472
2472
|
align-items: center;
|
|
@@ -2474,14 +2474,14 @@ line-height: 1.65;
|
|
|
2474
2474
|
color: var(--bgl-gray);
|
|
2475
2475
|
flex-direction: column;
|
|
2476
2476
|
}
|
|
2477
|
-
.fileUploadWrap.dragover[data-v-
|
|
2478
|
-
.fileUploadWrap[data-v-
|
|
2477
|
+
.fileUploadWrap.dragover[data-v-fcdea419],
|
|
2478
|
+
.fileUploadWrap[data-v-fcdea419]:hover {
|
|
2479
2479
|
box-shadow: inset 0 0 10px #00000012;
|
|
2480
2480
|
}
|
|
2481
|
-
.fileUploadWrap[style*='height: auto;'][data-v-
|
|
2481
|
+
.fileUploadWrap[style*='height: auto;'][data-v-fcdea419] {
|
|
2482
2482
|
min-height: 215px;
|
|
2483
2483
|
}
|
|
2484
|
-
.multi-image-item-preview[data-v-
|
|
2484
|
+
.multi-image-item-preview[data-v-fcdea419] {
|
|
2485
2485
|
border: 1px solid var(--border-color) !important;
|
|
2486
2486
|
border-radius: var(--input-border-radius);
|
|
2487
2487
|
margin: 0.5rem !important;
|
|
@@ -2495,12 +2495,12 @@ line-height: 1.65;
|
|
|
2495
2495
|
gap: 1rem;
|
|
2496
2496
|
align-items: center;
|
|
2497
2497
|
}
|
|
2498
|
-
.multi-image-item-preview p[data-v-
|
|
2498
|
+
.multi-image-item-preview p[data-v-fcdea419] {
|
|
2499
2499
|
overflow: hidden;
|
|
2500
2500
|
text-overflow: ellipsis;
|
|
2501
2501
|
white-space: nowrap;
|
|
2502
2502
|
}
|
|
2503
|
-
.multi-preview[data-v-
|
|
2503
|
+
.multi-preview[data-v-fcdea419] {
|
|
2504
2504
|
width: 40px;
|
|
2505
2505
|
height: 40px;
|
|
2506
2506
|
border-radius: var(--input-border-radius);
|
|
@@ -2511,17 +2511,17 @@ line-height: 1.65;
|
|
|
2511
2511
|
align-items: center;
|
|
2512
2512
|
display: flex;
|
|
2513
2513
|
}
|
|
2514
|
-
.bgl-single-preview[data-v-
|
|
2514
|
+
.bgl-single-preview[data-v-fcdea419] {
|
|
2515
2515
|
height: 100%;
|
|
2516
2516
|
position: relative;
|
|
2517
2517
|
}
|
|
2518
|
-
.bgl-single-preview + .fileUploadPlaceHolder[data-v-
|
|
2518
|
+
.bgl-single-preview + .fileUploadPlaceHolder[data-v-fcdea419] {
|
|
2519
2519
|
position: absolute;
|
|
2520
2520
|
inset: 0;
|
|
2521
2521
|
margin: auto;
|
|
2522
2522
|
top: calc(50% - 2rem);
|
|
2523
2523
|
}
|
|
2524
|
-
.single-image-item-preview[data-v-
|
|
2524
|
+
.single-image-item-preview[data-v-fcdea419] {
|
|
2525
2525
|
height: 100%;
|
|
2526
2526
|
min-height: 100%;
|
|
2527
2527
|
position: relative;
|
|
@@ -2529,13 +2529,13 @@ line-height: 1.65;
|
|
|
2529
2529
|
align-items: center;
|
|
2530
2530
|
justify-content: center;
|
|
2531
2531
|
}
|
|
2532
|
-
.fileUploadWrap[style*='height: auto'] .single-image-item-preview[data-v-
|
|
2532
|
+
.fileUploadWrap[style*='height: auto'] .single-image-item-preview[data-v-fcdea419] {
|
|
2533
2533
|
min-height: 215px;
|
|
2534
2534
|
}
|
|
2535
|
-
.fileUploadWrap[style*='height: auto'] .single-preview[data-v-
|
|
2535
|
+
.fileUploadWrap[style*='height: auto'] .single-preview[data-v-fcdea419] {
|
|
2536
2536
|
margin: 0rem !important;
|
|
2537
2537
|
}
|
|
2538
|
-
.single-preview[data-v-
|
|
2538
|
+
.single-preview[data-v-fcdea419] {
|
|
2539
2539
|
border-radius: var(--input-border-radius);
|
|
2540
2540
|
margin: 1rem;
|
|
2541
2541
|
padding: 0px;
|
|
@@ -2545,7 +2545,7 @@ line-height: 1.65;
|
|
|
2545
2545
|
background: var(--bgl-gray-light);
|
|
2546
2546
|
width: 90%;
|
|
2547
2547
|
}
|
|
2548
|
-
.single-image-item-preview[data-v-
|
|
2548
|
+
.single-image-item-preview[data-v-fcdea419]:hover::after {
|
|
2549
2549
|
content: 'zoom_in';
|
|
2550
2550
|
font-size: 32px;
|
|
2551
2551
|
font-family: 'Material Symbols Outlined', serif;
|
|
@@ -2555,20 +2555,20 @@ line-height: 1.65;
|
|
|
2555
2555
|
z-index: 9;
|
|
2556
2556
|
pointer-events: none;
|
|
2557
2557
|
}
|
|
2558
|
-
.single-image-item-preview:hover img[data-v-
|
|
2558
|
+
.single-image-item-preview:hover img[data-v-fcdea419] {
|
|
2559
2559
|
filter: brightness(70%);
|
|
2560
2560
|
}
|
|
2561
|
-
.bgl_fill-image.single-image-item-preview[data-v-
|
|
2561
|
+
.bgl_fill-image.single-image-item-preview[data-v-fcdea419] {
|
|
2562
2562
|
height: 100%;
|
|
2563
2563
|
}
|
|
2564
|
-
.bgl_fill-image.single-image-item-preview .single-preview[data-v-
|
|
2564
|
+
.bgl_fill-image.single-image-item-preview .single-preview[data-v-fcdea419] {
|
|
2565
2565
|
border-radius: unset;
|
|
2566
2566
|
object-fit: cover;
|
|
2567
2567
|
box-shadow: unset;
|
|
2568
2568
|
width: 100%;
|
|
2569
2569
|
height: auto;
|
|
2570
2570
|
}
|
|
2571
|
-
.single-image-item-preview .pie[data-v-
|
|
2571
|
+
.single-image-item-preview .pie[data-v-fcdea419] {
|
|
2572
2572
|
transform-origin: top;
|
|
2573
2573
|
transform: scale(1.4);
|
|
2574
2574
|
position: absolute;
|
|
@@ -2582,31 +2582,31 @@ line-height: 1.65;
|
|
|
2582
2582
|
border: none !important;
|
|
2583
2583
|
padding: 0 !important;
|
|
2584
2584
|
}
|
|
2585
|
-
.bgl_oval-upload[data-v-
|
|
2585
|
+
.bgl_oval-upload[data-v-fcdea419] {
|
|
2586
2586
|
border-radius: 100% !important;
|
|
2587
2587
|
overflow: hidden;
|
|
2588
2588
|
}
|
|
2589
|
-
.bgl_oval-upload p[data-v-
|
|
2589
|
+
.bgl_oval-upload p[data-v-fcdea419] {
|
|
2590
2590
|
padding: 0.75rem !important;
|
|
2591
2591
|
font-size: 12px;
|
|
2592
2592
|
}
|
|
2593
|
-
.bgl_oval-upload .fileUploadPlaceHolder[data-v-
|
|
2593
|
+
.bgl_oval-upload .fileUploadPlaceHolder[data-v-fcdea419] {
|
|
2594
2594
|
top: 0;
|
|
2595
2595
|
}
|
|
2596
|
-
.bgl_oval-upload .pie[data-v-
|
|
2596
|
+
.bgl_oval-upload .pie[data-v-fcdea419] {
|
|
2597
2597
|
transform: scale(1);
|
|
2598
2598
|
}
|
|
2599
|
-
.bgl_oval-upload span.bgl_icon-font.color-primary[data-v-
|
|
2599
|
+
.bgl_oval-upload span.bgl_icon-font.color-primary[data-v-fcdea419] {
|
|
2600
2600
|
transform: scale(0.4) !important;
|
|
2601
2601
|
}
|
|
2602
|
-
.bgl_oval-upload .single-image-item-preview[data-v-
|
|
2602
|
+
.bgl_oval-upload .single-image-item-preview[data-v-fcdea419] {
|
|
2603
2603
|
height: 100%;
|
|
2604
2604
|
}
|
|
2605
|
-
.bgl_oval-upload .single-preview[data-v-
|
|
2605
|
+
.bgl_oval-upload .single-preview[data-v-fcdea419] {
|
|
2606
2606
|
margin: 0;
|
|
2607
2607
|
height: 100% !important;
|
|
2608
2608
|
}
|
|
2609
|
-
.pie[data-v-
|
|
2609
|
+
.pie[data-v-fcdea419] {
|
|
2610
2610
|
width: 30px;
|
|
2611
2611
|
height: 30px;
|
|
2612
2612
|
position: relative;
|
|
@@ -2614,7 +2614,7 @@ line-height: 1.65;
|
|
|
2614
2614
|
align-items: center;
|
|
2615
2615
|
justify-content: center;
|
|
2616
2616
|
}
|
|
2617
|
-
.pie[data-v-
|
|
2617
|
+
.pie[data-v-fcdea419]:before {
|
|
2618
2618
|
content: '';
|
|
2619
2619
|
position: absolute;
|
|
2620
2620
|
border-radius: 50%;
|
|
@@ -2632,26 +2632,26 @@ line-height: 1.65;
|
|
|
2632
2632
|
#000 calc(100% - var(--b))
|
|
2633
2633
|
);
|
|
2634
2634
|
}
|
|
2635
|
-
.pie .success[data-v-
|
|
2635
|
+
.pie .success[data-v-fcdea419] {
|
|
2636
2636
|
transform: scale(0);
|
|
2637
2637
|
opacity: 0;
|
|
2638
2638
|
transition: all 0.3s ease-in-out;
|
|
2639
2639
|
}
|
|
2640
|
-
.pie .progress[data-v-
|
|
2640
|
+
.pie .progress[data-v-fcdea419] {
|
|
2641
2641
|
position: absolute;
|
|
2642
2642
|
font-size: 10px;
|
|
2643
2643
|
}
|
|
2644
|
-
.pie.complete .progress[data-v-
|
|
2644
|
+
.pie.complete .progress[data-v-fcdea419] {
|
|
2645
2645
|
display: none;
|
|
2646
2646
|
}
|
|
2647
|
-
.pie.complete .success[data-v-
|
|
2647
|
+
.pie.complete .success[data-v-fcdea419] {
|
|
2648
2648
|
transform: scale(1.3);
|
|
2649
2649
|
opacity: 1;
|
|
2650
2650
|
}
|
|
2651
|
-
.pie.complete[data-v-
|
|
2651
|
+
.pie.complete[data-v-fcdea419]:before {
|
|
2652
2652
|
background: conic-gradient(var(--bgl-green) calc(var(--p) * 1%), #0000 0);
|
|
2653
2653
|
}
|
|
2654
|
-
.pie.complete[data-v-
|
|
2654
|
+
.pie.complete[data-v-fcdea419] {
|
|
2655
2655
|
color: var(--bgl-green);
|
|
2656
2656
|
}
|
|
2657
2657
|
|
|
@@ -2663,13 +2663,13 @@ line-height: 1.65;
|
|
|
2663
2663
|
transform: rotateY(180deg) !important;
|
|
2664
2664
|
}
|
|
2665
2665
|
|
|
2666
|
-
.img-web-kit[data-v-
|
|
2666
|
+
.img-web-kit[data-v-1cec7fb3] {
|
|
2667
2667
|
max-width: 100%;
|
|
2668
2668
|
vertical-align: middle;
|
|
2669
2669
|
border: 0;
|
|
2670
2670
|
width: 100%;
|
|
2671
2671
|
}
|
|
2672
|
-
.error-image[data-v-
|
|
2672
|
+
.error-image[data-v-1cec7fb3] {
|
|
2673
2673
|
background-color: var(--skeleton-bg);
|
|
2674
2674
|
}
|
|
2675
2675
|
|
|
@@ -4430,19 +4430,19 @@ body:has(.bg-dark.is-active) {
|
|
|
4430
4430
|
-moz-user-drag: none;
|
|
4431
4431
|
}
|
|
4432
4432
|
|
|
4433
|
-
.lightbox-image[data-v-
|
|
4433
|
+
.lightbox-image[data-v-a5e1d29b]{
|
|
4434
4434
|
object-fit: contain;
|
|
4435
4435
|
}
|
|
4436
|
-
.bgl-lightbox-overlay[data-v-
|
|
4436
|
+
.bgl-lightbox-overlay[data-v-a5e1d29b] {
|
|
4437
4437
|
background: rgba(0, 0, 0, 0.8);
|
|
4438
4438
|
}
|
|
4439
|
-
.bgl-lightbox[data-v-
|
|
4439
|
+
.bgl-lightbox[data-v-a5e1d29b] {
|
|
4440
4440
|
max-height: 90%;
|
|
4441
4441
|
}
|
|
4442
|
-
.bgl-lightbox-item[data-v-
|
|
4443
|
-
animation: 500ms ease bgl-lightbox-load-
|
|
4442
|
+
.bgl-lightbox-item[data-v-a5e1d29b]{
|
|
4443
|
+
animation: 500ms ease bgl-lightbox-load-a5e1d29b;
|
|
4444
4444
|
}
|
|
4445
|
-
@keyframes bgl-lightbox-load-
|
|
4445
|
+
@keyframes bgl-lightbox-load-a5e1d29b {
|
|
4446
4446
|
from {
|
|
4447
4447
|
scale:0.7;
|
|
4448
4448
|
}
|
|
@@ -4450,44 +4450,44 @@ to {
|
|
|
4450
4450
|
scale:1;
|
|
4451
4451
|
}
|
|
4452
4452
|
}
|
|
4453
|
-
.bgl-lightbox-item[data-v-
|
|
4453
|
+
.bgl-lightbox-item[data-v-a5e1d29b] * {
|
|
4454
4454
|
max-height: calc(80vh - 90px);
|
|
4455
4455
|
border-radius: 3px;
|
|
4456
4456
|
margin: auto;
|
|
4457
|
-
animation: 200ms ease bgl-lightbox-load-
|
|
4457
|
+
animation: 200ms ease bgl-lightbox-load-a5e1d29b;
|
|
4458
4458
|
transition: max-height 200ms ease;
|
|
4459
4459
|
}
|
|
4460
|
-
.bgl-lightbox-item.zoomed[data-v-
|
|
4460
|
+
.bgl-lightbox-item.zoomed[data-v-a5e1d29b] * {
|
|
4461
4461
|
max-height: calc(100vh - 90px);
|
|
4462
4462
|
height: calc(100vh - 90px);
|
|
4463
4463
|
}
|
|
4464
|
-
.navigation[data-v-
|
|
4464
|
+
.navigation[data-v-a5e1d29b] {
|
|
4465
4465
|
top: 50%;
|
|
4466
4466
|
transform: translateY(-50%);
|
|
4467
4467
|
}
|
|
4468
|
-
.thumbnail[data-v-
|
|
4468
|
+
.thumbnail[data-v-a5e1d29b] {
|
|
4469
4469
|
height: 50px;
|
|
4470
4470
|
width: 50px;
|
|
4471
4471
|
}
|
|
4472
|
-
.thumbnail[data-v-
|
|
4472
|
+
.thumbnail[data-v-a5e1d29b]:hover {
|
|
4473
4473
|
opacity: 1;
|
|
4474
4474
|
}
|
|
4475
|
-
.thumbnail[data-v-
|
|
4475
|
+
.thumbnail[data-v-a5e1d29b]:active {
|
|
4476
4476
|
opacity: 0.8;
|
|
4477
4477
|
}
|
|
4478
|
-
.thumbnail.active[data-v-
|
|
4478
|
+
.thumbnail.active[data-v-a5e1d29b] {
|
|
4479
4479
|
opacity: 1;
|
|
4480
4480
|
outline: 2px solid white;
|
|
4481
4481
|
}
|
|
4482
|
-
.file-info[data-v-
|
|
4482
|
+
.file-info[data-v-a5e1d29b]{
|
|
4483
4483
|
max-width: 420px
|
|
4484
4484
|
}
|
|
4485
4485
|
@media screen and (max-width: 910px) {
|
|
4486
|
-
.file-info[data-v-
|
|
4486
|
+
.file-info[data-v-a5e1d29b]{
|
|
4487
4487
|
max-width: 220px;
|
|
4488
4488
|
text-align: center !important;
|
|
4489
4489
|
}
|
|
4490
|
-
.file-info[data-v-
|
|
4490
|
+
.file-info[data-v-a5e1d29b] *{
|
|
4491
4491
|
text-align: center !important;
|
|
4492
4492
|
margin-inline: 0 !important;;
|
|
4493
4493
|
max-width: 100% !important;
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -26,4 +26,5 @@ export * as bagelFormUtils from './BagelFormUtils';
|
|
|
26
26
|
export { useLang } from './lang';
|
|
27
27
|
export { formatString } from './strings';
|
|
28
28
|
export { useDebounceFn } from '@vueuse/core';
|
|
29
|
+
export declare function pathKeyToURL(pathKey: string): string;
|
|
29
30
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAI/D,wBAAgB,QAAQ,CAAC,EAAE,EAAE,MAAM,IAAI,EAAE,IAAI,GAAE,MAAY,QAO1D;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,UAMlC;AAED,wBAAgB,UAAU,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAQ3D;AAED,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,iBAGtE;AAED,wBAAgB,QAAQ,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,UAG3C;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,IAAI,QAIrE;AAED,wBAAgB,QAAQ,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,OAAO,EAAE,GAAG,EAAE,UAOpE;AAED,wBAAgB,SAAS,CAAC,CAAC,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,EACnD,KAAK,CAAC,EAAE,UAAU,EAClB,QAAQ,CAAC,EAAE,GAAG,EACd,GAAG,CAAC,EAAE,CAAC,OAcP;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,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,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAoBlF;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAatD;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,UAIvC;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,EAAE,aAAa,SAAO,GAAG,MAAM,GAAG,SAAS,CAG/G;AAED,OAAO,KAAK,cAAc,MAAM,kBAAkB,CAAA;AAElD,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAEhC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAK5C,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,UAK3C"}
|
package/package.json
CHANGED
package/src/components/Image.vue
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Skeleton, normalizeDimension, appendScript, normalizeURL, Icon } from '@bagelink/vue'
|
|
3
|
-
import { watch
|
|
2
|
+
import { Skeleton, normalizeDimension, appendScript, normalizeURL, Icon, pathKeyToURL } from '@bagelink/vue'
|
|
3
|
+
import { watch } from 'vue'
|
|
4
4
|
|
|
5
5
|
interface ImageProps {
|
|
6
6
|
src?: string
|
|
@@ -22,15 +22,10 @@ const props = defineProps<ImageProps>()
|
|
|
22
22
|
let imageSrc = $ref<string | null>(null)
|
|
23
23
|
let loadingError = $ref(false)
|
|
24
24
|
|
|
25
|
-
const fileBaseUrl = computed(() => 'https://files.bagel.design')
|
|
26
|
-
|
|
27
25
|
function getImageUrl(): string | null {
|
|
28
26
|
if (!props.src && !props.pathKey) return null
|
|
29
27
|
if (props.src) return props.src
|
|
30
|
-
|
|
31
|
-
return `${import.meta.env.VITE_BAGEL_BASE_URL}/${props.pathKey}`
|
|
32
|
-
}
|
|
33
|
-
return `${fileBaseUrl.value}/${props.pathKey}`
|
|
28
|
+
return pathKeyToURL(props.pathKey)
|
|
34
29
|
}
|
|
35
30
|
|
|
36
31
|
async function getCachedImage(url: string): Promise<string | null> {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { BglFile, QueueFile } from './upload.types'
|
|
3
|
-
import { Btn, IMAGE_FORMATS_REGEXP, Icon, useBagel, Card, Image } from '@bagelink/vue'
|
|
3
|
+
import { Btn, IMAGE_FORMATS_REGEXP, Icon, useBagel, Card, Image, pathKeyToURL } from '@bagelink/vue'
|
|
4
4
|
import { watch } from 'vue'
|
|
5
5
|
import { files } from './upload'
|
|
6
6
|
|
|
@@ -33,8 +33,6 @@ const bagel = useBagel()
|
|
|
33
33
|
|
|
34
34
|
files.setBaseUrl(bagel.host)
|
|
35
35
|
|
|
36
|
-
const fileBaseUrl = $computed(() => (props.baseURL || bagel.fileBaseUrl || 'https://files.bagel.design').replace(/\/$/, ''))
|
|
37
|
-
const pathToUrl = (path_key: string) => `${fileBaseUrl}/${path_key}`
|
|
38
36
|
const fileQueue = $ref<QueueFile[]>([])
|
|
39
37
|
let storageFiles = $ref<BglFile[]>([])
|
|
40
38
|
const pk = $ref<string[]>([props.modelValue].flat().filter(Boolean) as string[])
|
|
@@ -184,13 +182,13 @@ watch(() => props.dirPath, () => {
|
|
|
184
182
|
icon="download"
|
|
185
183
|
flat
|
|
186
184
|
thin
|
|
187
|
-
:href="
|
|
185
|
+
:href="pathKeyToURL(path_key)"
|
|
188
186
|
:download="path_key.split('/').pop()"
|
|
189
187
|
/>
|
|
190
188
|
<div class="flex gap-025 rounded pe-1 ps-05 py-025 bg-gray-80 -my-1 ">
|
|
191
189
|
<Icon icon="draft" :size="1.5" />
|
|
192
190
|
<p
|
|
193
|
-
v-lightbox="{ src:
|
|
191
|
+
v-lightbox="{ src: pathKeyToURL(path_key), download: true }"
|
|
194
192
|
class="ellipsis-1 word-break-all h-20 m-0 color-black txt16"
|
|
195
193
|
>
|
|
196
194
|
{{ path_key.split('/').pop() }}
|
|
@@ -227,7 +225,7 @@ watch(() => props.dirPath, () => {
|
|
|
227
225
|
<div
|
|
228
226
|
v-for="path_key in pathKeys"
|
|
229
227
|
:key="path_key"
|
|
230
|
-
v-lightbox="{ src:
|
|
228
|
+
v-lightbox="{ src: pathKeyToURL(path_key), download: true }"
|
|
231
229
|
class="multi-image-item-preview"
|
|
232
230
|
:class="{ 'bgl_fill-image': fill }"
|
|
233
231
|
>
|
|
@@ -308,13 +306,13 @@ watch(() => props.dirPath, () => {
|
|
|
308
306
|
color="gray"
|
|
309
307
|
thin
|
|
310
308
|
icon="download"
|
|
311
|
-
:href="
|
|
309
|
+
:href="pathKeyToURL(path_key)"
|
|
312
310
|
:download="path_key.split('/').pop()"
|
|
313
311
|
/>
|
|
314
312
|
</div>
|
|
315
313
|
<div v-if="isImage(path_key)" class="h-100">
|
|
316
314
|
<Image
|
|
317
|
-
v-lightbox="{ src:
|
|
315
|
+
v-lightbox="{ src: pathKeyToURL(path_key), download: true }"
|
|
318
316
|
|
|
319
317
|
class="single-preview"
|
|
320
318
|
:pathKey="path_key"
|
|
@@ -323,7 +321,7 @@ watch(() => props.dirPath, () => {
|
|
|
323
321
|
</div>
|
|
324
322
|
<Icon
|
|
325
323
|
v-else
|
|
326
|
-
v-lightbox="{ src:
|
|
324
|
+
v-lightbox="{ src: pathKeyToURL(path_key), download: true }"
|
|
327
325
|
:size="4"
|
|
328
326
|
weight="2"
|
|
329
327
|
icon="description"
|
|
@@ -117,7 +117,7 @@ defineExpose({ open, close })
|
|
|
117
117
|
<Carousel v-model:index="currentIndex" :items="1" class="bgl-lightbox-item" :class="{ zoomed: zoom > 1 }" :freeDrag="zoom === 1">
|
|
118
118
|
<template v-for="item in group" :key="item.src">
|
|
119
119
|
<Zoomer v-if="item.type === 'image'" v-model:zoom="zoom" :disabled="!item?.enableZoom" :mouse-wheel-to-zoom="false">
|
|
120
|
-
<Image :draggable="false" :src="item?.src"
|
|
120
|
+
<Image :draggable="false" :src="item?.src" alt="Preview" class="vw90 lightbox-image" />
|
|
121
121
|
</Zoomer>
|
|
122
122
|
|
|
123
123
|
<BglVideo
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { App, Directive, DirectiveBinding } from 'vue'
|
|
2
2
|
import type { LightboxItem } from './lightbox.types'
|
|
3
|
-
import { IMAGE_FORMATS_REGEXP, VIDEO_FORMATS_REGEXP } from '@bagelink/vue'
|
|
3
|
+
import { IMAGE_FORMATS_REGEXP, pathKeyToURL, VIDEO_FORMATS_REGEXP } from '@bagelink/vue'
|
|
4
4
|
import { createApp } from 'vue'
|
|
5
5
|
import Lightbox from './Lightbox.vue'
|
|
6
6
|
|
|
@@ -48,8 +48,8 @@ function openClickHandler(e: MouseEvent, el: HTMLElement, binding: DirectiveBind
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
function bindingToItem(binding: DirectiveBinding, el: HTMLElement): LightboxItem {
|
|
51
|
-
let { group, src, type, name, thumbnail, enableZoom, openFile, download } = binding.value || {}
|
|
52
|
-
src = src || binding.value || el.getAttribute('src') || ''
|
|
51
|
+
let { group, src, type, name, thumbnail, enableZoom, openFile, download, pathKey } = binding.value || {}
|
|
52
|
+
src = src || pathKeyToURL(pathKey) || binding.value || el.getAttribute('src') || ''
|
|
53
53
|
type = type || determineFileType(src)
|
|
54
54
|
name = name || urlToName(src) || el.getAttribute('alt') || ''
|
|
55
55
|
return { src, type, name, thumbnail, group, enableZoom, openFile, download }
|
package/src/utils/index.ts
CHANGED
|
@@ -168,3 +168,13 @@ export { useLang } from './lang'
|
|
|
168
168
|
|
|
169
169
|
export { formatString } from './strings'
|
|
170
170
|
export { useDebounceFn } from '@vueuse/core'
|
|
171
|
+
|
|
172
|
+
const fileBaseUrl = (import.meta.env.VITE_FILE_BASE_URL || 'https://files.bagel.design').replace(/\/$/, '')
|
|
173
|
+
const bagelBaseUrl = import.meta.env.VITE_BAGEL_BASE_URL
|
|
174
|
+
|
|
175
|
+
export function pathKeyToURL(pathKey: string) {
|
|
176
|
+
if (pathKey.startsWith('static/')) {
|
|
177
|
+
return `${bagelBaseUrl}/${pathKey}`
|
|
178
|
+
}
|
|
179
|
+
return `${fileBaseUrl}/${pathKey}`
|
|
180
|
+
}
|