@8wave/ai-elements 0.125.0-beta.31 → 0.125.0-beta.33
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/_chunks/{PkChatbotFilePreview-CqxtVySb.js → PkChatbotFilePreview-DsRAk1js.js} +2 -2
- package/dist/_chunks/{PkChatbotFilePreview-CqxtVySb.js.map → PkChatbotFilePreview-DsRAk1js.js.map} +1 -1
- package/dist/_chunks/PkImageEditorDialog-BQwM06kT.js +939 -0
- package/dist/_chunks/PkImageEditorDialog-BQwM06kT.js.map +1 -0
- package/dist/_chunks/{PkStreamingMarkdown-BqDooeUU.js → PkStreamingMarkdown-CjL7l_3E.js} +2 -2
- package/dist/_chunks/{PkStreamingMarkdown-BqDooeUU.js.map → PkStreamingMarkdown-CjL7l_3E.js.map} +1 -1
- package/dist/_chunks/{PkToolChatFile-DpStX3wS.js → PkToolChatFile-weptM8iA.js} +2 -2
- package/dist/_chunks/{PkToolChatFile-DpStX3wS.js.map → PkToolChatFile-weptM8iA.js.map} +1 -1
- package/dist/_chunks/{PkToolShareDocument-BvHklbzb.js → PkToolShareDocument-D5K3uJ2x.js} +2 -2
- package/dist/_chunks/{PkToolShareDocument-BvHklbzb.js.map → PkToolShareDocument-D5K3uJ2x.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-YPwJLLlW.js → PkToolShowArtifact-Bm2zS5YS.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-YPwJLLlW.js.map → PkToolShowArtifact-Bm2zS5YS.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-CTc1mbA8.js → PkToolShowContactForm-BKJCv5To.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-CTc1mbA8.js.map → PkToolShowContactForm-BKJCv5To.js.map} +1 -1
- package/dist/_chunks/{PkToolShowDiagram-COt1Z3q9.js → PkToolShowDiagram-jpaEAi2X.js} +2 -2
- package/dist/_chunks/{PkToolShowDiagram-COt1Z3q9.js.map → PkToolShowDiagram-jpaEAi2X.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-DT5EyYVY.js → PkToolShowForm-DvAcJgDP.js} +2 -2
- package/dist/_chunks/{PkToolShowForm-DT5EyYVY.js.map → PkToolShowForm-DvAcJgDP.js.map} +1 -1
- package/dist/_chunks/{PkToolShowImageGallery-DKrCrrB5.js → PkToolShowImageGallery-D0htuXNL.js} +4 -4
- package/dist/_chunks/{PkToolShowImageGallery-DKrCrrB5.js.map → PkToolShowImageGallery-D0htuXNL.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-CzSknPo6.js → PkToolShowSources-Cfj6iRGj.js} +2 -2
- package/dist/_chunks/{PkToolShowSources-CzSknPo6.js.map → PkToolShowSources-Cfj6iRGj.js.map} +1 -1
- package/dist/_chunks/{useLightbox-D2Zi-Fpe.js → useLightbox-C54BCSbU.js} +130 -89
- package/dist/_chunks/useLightbox-C54BCSbU.js.map +1 -0
- package/dist/ai-elements.es.js +2774 -2721
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotEmptyState.js +1 -1
- package/dist-vue/PkChatbotFilePreview.js +1 -1
- package/dist-vue/PkChatbotInput.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotSteps.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/_chunks/{PkChatbot-DLgPqMWd.js → PkChatbot-Bc2hlwFO.js} +3 -3
- package/dist-vue/_chunks/{PkChatbot-DLgPqMWd.js.map → PkChatbot-Bc2hlwFO.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotEmptyState-DMPEj1Qa.js → PkChatbotEmptyState-NHarCaDm.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-DMPEj1Qa.js.map → PkChatbotEmptyState-NHarCaDm.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotFilePreview-j_8sDZUE.js → PkChatbotFilePreview-BIta8Yg-.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotFilePreview-j_8sDZUE.js.map → PkChatbotFilePreview-BIta8Yg-.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotInput-TamSYiA7.js → PkChatbotInput-BSzDRoDD.js} +192 -181
- package/dist-vue/_chunks/PkChatbotInput-BSzDRoDD.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotMessages-bPBOSAv7.js → PkChatbotMessages-DEMKZDCb.js} +17 -17
- package/dist-vue/_chunks/{PkChatbotMessages-bPBOSAv7.js.map → PkChatbotMessages-DEMKZDCb.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotSteps-pibgqxus.js → PkChatbotSteps-DGQoYxJ9.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotSteps-pibgqxus.js.map → PkChatbotSteps-DGQoYxJ9.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-y60IA9aQ.js → PkChatbotViewChat-aKi08vCz.js} +440 -431
- package/dist-vue/_chunks/PkChatbotViewChat-aKi08vCz.js.map +1 -0
- package/dist-vue/_chunks/{PkFilePreview-CPSYaOV7.js → PkFilePreview-D2HInDoA.js} +2 -2
- package/dist-vue/_chunks/{PkFilePreview-CPSYaOV7.js.map → PkFilePreview-D2HInDoA.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreviewDialog-D6zFO_H_.js → PkFilePreviewDialog-jxcUSzPx.js} +2 -2
- package/dist-vue/_chunks/{PkFilePreviewDialog-D6zFO_H_.js.map → PkFilePreviewDialog-jxcUSzPx.js.map} +1 -1
- package/dist-vue/_chunks/PkImageEditorDialog-Dn3HV_ny.js +934 -0
- package/dist-vue/_chunks/PkImageEditorDialog-Dn3HV_ny.js.map +1 -0
- package/dist-vue/_chunks/{PkStreamingMarkdown-B3VWOaWb.js → PkStreamingMarkdown-DdOv86Eb.js} +11 -11
- package/dist-vue/_chunks/{PkStreamingMarkdown-B3VWOaWb.js.map → PkStreamingMarkdown-DdOv86Eb.js.map} +1 -1
- package/dist-vue/_chunks/{PkSvgViewer-BsdSOBpH.js → PkSvgViewer-vkd5Dluw.js} +2 -2
- package/dist-vue/_chunks/{PkSvgViewer-BsdSOBpH.js.map → PkSvgViewer-vkd5Dluw.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolChatFile-PXpiJLZ6.js → PkToolChatFile-8nx166iM.js} +2 -2
- package/dist-vue/_chunks/{PkToolChatFile-PXpiJLZ6.js.map → PkToolChatFile-8nx166iM.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShareDocument-cMUqik6v.js → PkToolShareDocument-CspvFwRR.js} +2 -2
- package/dist-vue/_chunks/{PkToolShareDocument-cMUqik6v.js.map → PkToolShareDocument-CspvFwRR.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-DouCz_dZ.js → PkToolShowArtifact-BppP_xSN.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-DouCz_dZ.js.map → PkToolShowArtifact-BppP_xSN.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-BmiNlFfx.js → PkToolShowContactForm-Bm0icz24.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-BmiNlFfx.js.map → PkToolShowContactForm-Bm0icz24.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-D6mYTDU-.js → PkToolShowDiagram-CgukB1Ss.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-D6mYTDU-.js.map → PkToolShowDiagram-CgukB1Ss.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-CksTiimD.js → PkToolShowForm-CyyN7GQP.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowForm-CksTiimD.js.map → PkToolShowForm-CyyN7GQP.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-B-lVY0xH.js → PkToolShowImageGallery-zQF_lsxI.js} +5 -5
- package/dist-vue/_chunks/{PkToolShowImageGallery-B-lVY0xH.js.map → PkToolShowImageGallery-zQF_lsxI.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowLocation-B8FE_Sqd.js → PkToolShowLocation-WdRqG8Wi.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowLocation-B8FE_Sqd.js.map → PkToolShowLocation-WdRqG8Wi.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-Dcq3Kdse.js → PkToolShowProductList-DW_P0gC2.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-Dcq3Kdse.js.map → PkToolShowProductList-DW_P0gC2.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-DApWmwvk.js → PkToolShowSources-BugMybUx.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSources-DApWmwvk.js.map → PkToolShowSources-BugMybUx.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-CjrYh9-q.js → PkToolShowVideo-BW7aRKs_.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowVideo-CjrYh9-q.js.map → PkToolShowVideo-BW7aRKs_.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-DSIAizw-.js → PkToolShowWebPages-DxKimT-2.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-DSIAizw-.js.map → PkToolShowWebPages-DxKimT-2.js.map} +1 -1
- package/dist-vue/_chunks/{useLightbox-FDyQrPWe.js → useLightbox-Ctl9zaMX.js} +132 -91
- package/dist-vue/_chunks/useLightbox-Ctl9zaMX.js.map +1 -0
- package/dist-vue/composables.js +36 -2
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +22 -22
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +34 -0
- package/dist-vue/packages/components/src/chat/PkChatbotInput.d.ts +5 -0
- package/dist-vue/packages/components/src/chat/PkImageEditor.d.ts +11 -9
- package/dist-vue/packages/components/src/chat/PkImageEditorDialog.d.ts +12 -5
- package/dist-vue/packages/components/src/chat/imageEdits.d.ts +77 -1
- package/dist-vue/packages/components/src/composables/useLightbox.d.ts +26 -0
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/PkImageEditorDialog-Cq8y_PtC.js +0 -555
- package/dist/_chunks/PkImageEditorDialog-Cq8y_PtC.js.map +0 -1
- package/dist/_chunks/useLightbox-D2Zi-Fpe.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotInput-TamSYiA7.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotViewChat-y60IA9aQ.js.map +0 -1
- package/dist-vue/_chunks/PkImageEditorDialog-BLUyILVi.js +0 -550
- package/dist-vue/_chunks/PkImageEditorDialog-BLUyILVi.js.map +0 -1
- package/dist-vue/_chunks/useLightbox-FDyQrPWe.js.map +0 -1
|
@@ -1,59 +1,63 @@
|
|
|
1
1
|
import "./src-nb8MU1sh.js";
|
|
2
|
-
import { inject as e, onBeforeUnmount as t, onMounted as n, provide as r, ref as i, shallowRef as a } from "vue";
|
|
3
|
-
import { useI18n as
|
|
2
|
+
import { inject as e, onBeforeUnmount as t, onMounted as n, provide as r, ref as i, shallowRef as a, watch as o } from "vue";
|
|
3
|
+
import { useI18n as s } from "vue-i18n";
|
|
4
4
|
// ../../packages/utils/src/cdn-css.ts
|
|
5
|
-
var
|
|
6
|
-
function
|
|
7
|
-
let n = t ?? document.head, r =
|
|
8
|
-
if (r || (r = /* @__PURE__ */ new Set(),
|
|
5
|
+
var c = /* @__PURE__ */ new WeakMap();
|
|
6
|
+
function l(e, t) {
|
|
7
|
+
let n = t ?? document.head, r = c.get(n);
|
|
8
|
+
if (r || (r = /* @__PURE__ */ new Set(), c.set(n, r)), r.has(e)) return;
|
|
9
9
|
let i = document.createElement("link");
|
|
10
10
|
i.rel = "stylesheet", i.href = e, n.appendChild(i), r.add(e);
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function u(e) {
|
|
13
13
|
let t = e?.getRootNode?.();
|
|
14
14
|
return t instanceof ShadowRoot ? t : void 0;
|
|
15
15
|
}
|
|
16
16
|
// ../../packages/components/src/composables/useLightbox.ts
|
|
17
|
-
var
|
|
17
|
+
var d = "https://cdn.jsdelivr.net/npm/photoswipe@5/dist/photoswipe.css", f = {
|
|
18
18
|
width: 1200,
|
|
19
19
|
height: 800
|
|
20
|
-
},
|
|
20
|
+
}, p = 4e3, m = {
|
|
21
21
|
"+": 1.25,
|
|
22
22
|
"=": 1.25,
|
|
23
23
|
"-": .8,
|
|
24
24
|
_: .8
|
|
25
|
-
},
|
|
26
|
-
function
|
|
27
|
-
|
|
25
|
+
}, h = Symbol("sharedLightbox"), g = Symbol("imageAnnotation");
|
|
26
|
+
function _(e) {
|
|
27
|
+
r(g, e);
|
|
28
|
+
}
|
|
29
|
+
var v = "a[data-pswp-src][data-pswp-shared], [data-pswp-images] img:not(a img)";
|
|
30
|
+
function y(n) {
|
|
31
|
+
let { gallery: r, children: i = "a[data-pswp-src]", loop: c = !0, downloadable: u = !0, openInNewTab: h = !0, shared: _ = !1 } = n, v = a(null), y = _ ? b() : void 0, x = e(g, void 0), { t: S } = s({ useScope: "global" }), E = !1;
|
|
28
32
|
return t(() => {
|
|
29
|
-
|
|
33
|
+
E = !0, v.value?.destroy(), v.value = null;
|
|
30
34
|
}), {
|
|
31
|
-
lightbox:
|
|
35
|
+
lightbox: v,
|
|
32
36
|
init: async () => {
|
|
33
|
-
if (
|
|
34
|
-
|
|
37
|
+
if (y) {
|
|
38
|
+
y.join();
|
|
35
39
|
return;
|
|
36
40
|
}
|
|
37
|
-
if (!
|
|
38
|
-
|
|
41
|
+
if (!r.value) return;
|
|
42
|
+
l(d), H();
|
|
39
43
|
let { default: e } = await import("photoswipe/lightbox");
|
|
40
|
-
|
|
41
|
-
gallery:
|
|
42
|
-
children:
|
|
44
|
+
E || (v.value = new e({
|
|
45
|
+
gallery: r.value,
|
|
46
|
+
children: i,
|
|
43
47
|
pswpModule: () => import("photoswipe"),
|
|
44
|
-
loop:
|
|
48
|
+
loop: c,
|
|
45
49
|
wheelToZoom: !0,
|
|
46
|
-
secondaryZoomLevel: (e) => Math.min(1,
|
|
47
|
-
closeTitle:
|
|
48
|
-
zoomTitle:
|
|
49
|
-
arrowPrevTitle:
|
|
50
|
-
arrowNextTitle:
|
|
51
|
-
errorMsg:
|
|
50
|
+
secondaryZoomLevel: (e) => Math.min(1, p / (e.elementSize?.x || p)),
|
|
51
|
+
closeTitle: S("action.close"),
|
|
52
|
+
zoomTitle: S("lightbox.zoom"),
|
|
53
|
+
arrowPrevTitle: S("action.previous"),
|
|
54
|
+
arrowNextTitle: S("action.next"),
|
|
55
|
+
errorMsg: S("label.imageLoadError"),
|
|
52
56
|
arrowPrevSVG: "<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"m10.828 12l4.95 4.95l-1.414 1.415L8 12l6.364-6.364l1.414 1.414z\"/></svg>",
|
|
53
57
|
arrowNextSVG: "<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z\"/></svg>",
|
|
54
58
|
closeSVG: "<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z\"/></svg>",
|
|
55
59
|
zoomSVG: "<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><g class=\"pswp__icn--zoom-in\"><path fill=\"#ffffff\" d=\"m18.031 16.617l4.283 4.282l-1.415 1.415l-4.282-4.283A8.96 8.96 0 0 1 11 20c-4.968 0-9-4.032-9-9s4.032-9 9-9s9 4.032 9 9a8.96 8.96 0 0 1-1.969 5.617m-2.006-.742A6.98 6.98 0 0 0 18 11c0-3.867-3.133-7-7-7s-7 3.133-7 7s3.133 7 7 7a6.98 6.98 0 0 0 4.875-1.975zM10 10V7h2v3h3v2h-3v3h-2v-3H7v-2z\"/></g><g class=\"pswp__icn--zoom-out\"><path fill=\"#ffffff\" d=\"m18.031 16.617l4.283 4.282l-1.415 1.415l-4.282-4.283A8.96 8.96 0 0 1 11 20c-4.968 0-9-4.032-9-9s4.032-9 9-9s9 4.032 9 9a8.96 8.96 0 0 1-1.969 5.617m-2.006-.742A6.98 6.98 0 0 0 18 11c0-3.867-3.133-7-7-7s-7 3.133-7 7s3.133 7 7 7a6.98 6.98 0 0 0 4.875-1.975zM7 10h8v2H7z\"/></g></svg>"
|
|
56
|
-
}),
|
|
60
|
+
}), v.value.addFilter("domItemData", (e, t, n) => {
|
|
57
61
|
if (n) return {
|
|
58
62
|
...e,
|
|
59
63
|
caption: n.dataset.pswpCaption
|
|
@@ -64,13 +68,13 @@ function g(e) {
|
|
|
64
68
|
...e,
|
|
65
69
|
src: r,
|
|
66
70
|
msrc: r,
|
|
67
|
-
width: t.naturalWidth ||
|
|
68
|
-
height: t.naturalHeight ||
|
|
71
|
+
width: t.naturalWidth || f.width,
|
|
72
|
+
height: t.naturalHeight || f.height,
|
|
69
73
|
alt: t.alt,
|
|
70
74
|
caption: t.alt
|
|
71
75
|
};
|
|
72
|
-
}),
|
|
73
|
-
|
|
76
|
+
}), v.value.on("uiRegister", () => {
|
|
77
|
+
v.value?.pswp?.ui?.registerElement({
|
|
74
78
|
name: "caption",
|
|
75
79
|
className: "pswp__caption pswp__hide-on-close",
|
|
76
80
|
appendTo: "root",
|
|
@@ -81,66 +85,87 @@ function g(e) {
|
|
|
81
85
|
});
|
|
82
86
|
}
|
|
83
87
|
});
|
|
84
|
-
}),
|
|
85
|
-
|
|
88
|
+
}), x && v.value.on("uiRegister", () => {
|
|
89
|
+
v.value?.pswp?.ui?.registerElement({
|
|
90
|
+
name: "annotate-button",
|
|
91
|
+
order: 6,
|
|
92
|
+
isButton: !0,
|
|
93
|
+
html: w,
|
|
94
|
+
title: S("lightbox.annotate"),
|
|
95
|
+
onInit: (e, t) => {
|
|
96
|
+
let n = () => {
|
|
97
|
+
let n = C(t);
|
|
98
|
+
e.hidden = !n || !M(n) || !x.available();
|
|
99
|
+
};
|
|
100
|
+
t.on("change", n), t.on("destroy", o(x.available, n));
|
|
101
|
+
},
|
|
102
|
+
onClick: (e, t, n) => {
|
|
103
|
+
let r = C(n), i = r && M(r);
|
|
104
|
+
if (!i || !x.available()) return;
|
|
105
|
+
let a = F(i, n.currSlide?.data.caption);
|
|
106
|
+
a.catch(() => void 0), n.opener.isOpen ? n.close() : n.on("openingAnimationEnd", () => n.close()), x.annotate(a);
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
}), A() && v.value.on("uiRegister", () => {
|
|
110
|
+
v.value?.pswp?.ui?.registerElement({
|
|
86
111
|
name: "copy-button",
|
|
87
112
|
order: 7,
|
|
88
113
|
isButton: !0,
|
|
89
|
-
html:
|
|
90
|
-
title:
|
|
114
|
+
html: T,
|
|
115
|
+
title: S("lightbox.copy"),
|
|
91
116
|
onInit: (e, t) => {
|
|
92
117
|
t.on("change", () => {
|
|
93
|
-
let n =
|
|
94
|
-
e.hidden = !n || !
|
|
118
|
+
let n = C(t);
|
|
119
|
+
e.hidden = !n || !j(n);
|
|
95
120
|
});
|
|
96
121
|
},
|
|
97
122
|
onClick: (e, t, n) => {
|
|
98
|
-
let r =
|
|
99
|
-
i &&
|
|
100
|
-
copy:
|
|
101
|
-
copied:
|
|
102
|
-
failed:
|
|
123
|
+
let r = C(n), i = r && j(r);
|
|
124
|
+
i && L(i, t, {
|
|
125
|
+
copy: S("lightbox.copy"),
|
|
126
|
+
copied: S("lightbox.copied"),
|
|
127
|
+
failed: S("lightbox.copyFailed")
|
|
103
128
|
});
|
|
104
129
|
}
|
|
105
130
|
});
|
|
106
|
-
}), (
|
|
107
|
-
let e =
|
|
108
|
-
e && (
|
|
131
|
+
}), (h || u) && v.value.on("uiRegister", () => {
|
|
132
|
+
let e = v.value.pswp?.ui;
|
|
133
|
+
e && (h && e.registerElement({
|
|
109
134
|
name: "open-in-new-tab-button",
|
|
110
135
|
order: 8,
|
|
111
136
|
isButton: !0,
|
|
112
137
|
html: "<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3z\"/></svg>",
|
|
113
|
-
title:
|
|
138
|
+
title: S("lightbox.openInNewTab"),
|
|
114
139
|
onClick: (e, t, n) => {
|
|
115
|
-
let r =
|
|
140
|
+
let r = C(n);
|
|
116
141
|
r && window.open(r, "_blank", "noopener,noreferrer");
|
|
117
142
|
}
|
|
118
|
-
}),
|
|
143
|
+
}), u && e.registerElement({
|
|
119
144
|
name: "download-button",
|
|
120
145
|
order: 9,
|
|
121
146
|
isButton: !0,
|
|
122
147
|
html: "<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"M3 19h18v2H3zm10-5.828L19.071 7.1l1.414 1.414L12 17L3.515 8.515L4.929 7.1L11 13.173V2h2z\"/></svg>",
|
|
123
|
-
title:
|
|
148
|
+
title: S("action.download"),
|
|
124
149
|
onClick: (e, t, n) => {
|
|
125
|
-
let r =
|
|
126
|
-
r &&
|
|
150
|
+
let r = C(n);
|
|
151
|
+
r && R(r);
|
|
127
152
|
}
|
|
128
153
|
}));
|
|
129
|
-
}),
|
|
130
|
-
let { key: t, ctrlKey: n, metaKey: r, altKey: i } = e.originalEvent, a =
|
|
154
|
+
}), v.value.on("keydown", (e) => {
|
|
155
|
+
let { key: t, ctrlKey: n, metaKey: r, altKey: i } = e.originalEvent, a = m[t], o = v.value?.pswp, s = o?.currSlide;
|
|
131
156
|
!a || n || r || i || !s?.isZoomable() || (e.preventDefault(), e.originalEvent.preventDefault(), s.zoomTo(s.currZoomLevel * a, void 0, o?.options.zoomAnimationDuration));
|
|
132
|
-
}),
|
|
157
|
+
}), v.value.init());
|
|
133
158
|
},
|
|
134
|
-
shared: !!
|
|
159
|
+
shared: !!y
|
|
135
160
|
};
|
|
136
161
|
}
|
|
137
|
-
function
|
|
138
|
-
return e(
|
|
162
|
+
function b() {
|
|
163
|
+
return e(h, void 0);
|
|
139
164
|
}
|
|
140
|
-
function
|
|
141
|
-
let { init: t } =
|
|
165
|
+
function x(e) {
|
|
166
|
+
let { init: t } = y({
|
|
142
167
|
gallery: e,
|
|
143
|
-
children:
|
|
168
|
+
children: v,
|
|
144
169
|
loop: !1
|
|
145
170
|
}), i = !1, a = !1, o = async () => {
|
|
146
171
|
if (i && !a && e.value) {
|
|
@@ -152,11 +177,11 @@ function v(e) {
|
|
|
152
177
|
}
|
|
153
178
|
}
|
|
154
179
|
};
|
|
155
|
-
r(
|
|
180
|
+
r(h, { join: () => {
|
|
156
181
|
i = !0, o();
|
|
157
182
|
} }), n(o);
|
|
158
183
|
}
|
|
159
|
-
function
|
|
184
|
+
function S() {
|
|
160
185
|
let e = i(/* @__PURE__ */ new Map());
|
|
161
186
|
return {
|
|
162
187
|
preload: (t) => {
|
|
@@ -177,57 +202,73 @@ function y() {
|
|
|
177
202
|
}, t.src = n.url;
|
|
178
203
|
}
|
|
179
204
|
},
|
|
180
|
-
getSize: (t) => e.value.get(t) ??
|
|
205
|
+
getSize: (t) => e.value.get(t) ?? f
|
|
181
206
|
};
|
|
182
207
|
}
|
|
183
|
-
function
|
|
208
|
+
function C(e) {
|
|
184
209
|
return e.currSlide?.data?.src ?? e.currSlide?.data?.element?.querySelector("img")?.getAttribute("src") ?? e.currSlide?.data?.element?.querySelector("source")?.getAttribute("srcset") ?? e.currSlide?.data?.element?.getAttribute("src") ?? void 0;
|
|
185
210
|
}
|
|
186
|
-
var
|
|
187
|
-
function
|
|
211
|
+
var w = "<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"m15.243 4.512l-6.738 6.737l-.707 2.121l-1.04 1.041l2.828 2.828l1.04-1.04l2.122-.708l6.737-6.737zm6.364 3.535a1 1 0 0 1 0 1.414l-7.778 7.778l-2.122.707l-1.414 1.415a1 1 0 0 1-1.414 0l-4.243-4.243a1 1 0 0 1 0-1.414L6.05 12.29l.707-2.122l7.779-7.778a1 1 0 0 1 1.414 0zm-6.364-.707l1.414 1.414l-4.95 4.95l-1.414-1.414zm-10.96 9.546l2.828 2.828l-1.414 1.415l-4.243-1.415z\"/></svg>", T = "<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1 1 0 0 1 3 21l.003-14c0-.552.45-1 1.006-1zM5.002 8L5 20h10V8zM9 6h8v10h2V4H9z\"/></svg>", E = "<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"m10 15.172l9.192-9.193l1.415 1.414L10 18l-6.364-6.364l1.414-1.414z\"/></svg>", D = "<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m-1-5h2v2h-2zm0-8h2v6h-2z\"/></svg>", O = 1500, k = /* @__PURE__ */ new WeakMap();
|
|
212
|
+
function A() {
|
|
188
213
|
return typeof ClipboardItem < "u" && typeof navigator.clipboard?.write == "function";
|
|
189
214
|
}
|
|
190
|
-
function
|
|
215
|
+
function j(e) {
|
|
191
216
|
if (e.startsWith("blob:") || e.startsWith("data:image/")) return e;
|
|
192
217
|
if (/\/chats\/[^/]+\/media\/[^/]+\/view(\?|$)/.test(e)) return e.replace(/\/view(\?|$)/, "/content$1");
|
|
193
218
|
}
|
|
194
|
-
|
|
219
|
+
function M(e) {
|
|
220
|
+
if (!e.startsWith("data:") || /^data:image\/(png|jpeg|webp|gif)[;,]/.test(e)) return j(e);
|
|
221
|
+
}
|
|
222
|
+
function N(e, t) {
|
|
223
|
+
let n = e?.trim();
|
|
224
|
+
if (n && /\.(png|jpe?g|webp|gif)$/i.test(n)) return n;
|
|
225
|
+
let r = /^image\/(png|jpeg|webp|gif)$/.exec(t)?.[1];
|
|
226
|
+
return `image.${r === "jpeg" ? "jpg" : r ?? "png"}`;
|
|
227
|
+
}
|
|
228
|
+
async function P(e) {
|
|
195
229
|
let t = await fetch(e, { credentials: "include" });
|
|
196
230
|
if (!t.ok) throw Error(`The image answered ${t.status}`);
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
231
|
+
return t.blob();
|
|
232
|
+
}
|
|
233
|
+
async function F(e, t) {
|
|
234
|
+
let n = await P(e);
|
|
235
|
+
return new File([n], N(t, n.type), { type: n.type });
|
|
236
|
+
}
|
|
237
|
+
async function I(e) {
|
|
238
|
+
let t = await P(e);
|
|
239
|
+
if (t.type === "image/png") return t;
|
|
240
|
+
let n = URL.createObjectURL(t);
|
|
200
241
|
try {
|
|
201
242
|
let e = new Image();
|
|
202
|
-
e.src =
|
|
243
|
+
e.src = n, await e.decode();
|
|
203
244
|
let t = document.createElement("canvas");
|
|
204
245
|
return t.width = e.naturalWidth, t.height = e.naturalHeight, t.getContext("2d")?.drawImage(e, 0, 0), await new Promise((e, n) => {
|
|
205
246
|
t.toBlob((t) => t ? e(t) : n(/* @__PURE__ */ Error("No PNG was drawn")), "image/png");
|
|
206
247
|
});
|
|
207
248
|
} finally {
|
|
208
|
-
URL.revokeObjectURL(
|
|
249
|
+
URL.revokeObjectURL(n);
|
|
209
250
|
}
|
|
210
251
|
}
|
|
211
|
-
async function
|
|
252
|
+
async function L(e, t, n) {
|
|
212
253
|
let r = (e, n) => {
|
|
213
254
|
t.innerHTML = e, t.title = n, t.setAttribute("aria-label", n);
|
|
214
|
-
}, i =
|
|
255
|
+
}, i = I(e);
|
|
215
256
|
i.catch(() => void 0);
|
|
216
257
|
try {
|
|
217
|
-
await navigator.clipboard.write([new ClipboardItem({ "image/png": i })]), r(
|
|
258
|
+
await navigator.clipboard.write([new ClipboardItem({ "image/png": i })]), r(E, n.copied);
|
|
218
259
|
} catch {
|
|
219
|
-
r(
|
|
260
|
+
r(D, n.failed);
|
|
220
261
|
}
|
|
221
|
-
clearTimeout(
|
|
262
|
+
clearTimeout(k.get(t)), k.set(t, setTimeout(() => r(T, n.copy), O));
|
|
222
263
|
}
|
|
223
|
-
function
|
|
224
|
-
let t =
|
|
225
|
-
n.href = t, n.target = "_blank", n.rel = "noopener noreferrer", n.download =
|
|
264
|
+
function R(e) {
|
|
265
|
+
let t = z(e), n = document.createElement("a");
|
|
266
|
+
n.href = t, n.target = "_blank", n.rel = "noopener noreferrer", n.download = B(e), document.body.appendChild(n), n.click(), document.body.removeChild(n);
|
|
226
267
|
}
|
|
227
|
-
function
|
|
268
|
+
function z(e) {
|
|
228
269
|
return e.replace(/\/view(\?|$)/, "/download$1");
|
|
229
270
|
}
|
|
230
|
-
function
|
|
271
|
+
function B(e) {
|
|
231
272
|
if (e.startsWith("data:image/svg+xml")) return "diagram.svg";
|
|
232
273
|
if (e.startsWith("data:")) return `image.${e.split(":")[1].split(";")[0].split("/")[1] || "bin"}`;
|
|
233
274
|
try {
|
|
@@ -237,13 +278,13 @@ function M(e) {
|
|
|
237
278
|
return "image";
|
|
238
279
|
}
|
|
239
280
|
}
|
|
240
|
-
var
|
|
241
|
-
function
|
|
242
|
-
if (
|
|
243
|
-
|
|
281
|
+
var V = !1;
|
|
282
|
+
function H() {
|
|
283
|
+
if (V) return;
|
|
284
|
+
V = !0;
|
|
244
285
|
let e = document.createElement("style");
|
|
245
286
|
e.textContent = ".pswp__counter { font-family: sans-serif; } .pswp { z-index: 2147483647 !important; } .pswp__icn { width: 20px; height: 20px; } .pswp__button { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; } .pswp__button[hidden] { display: none; } .pswp__icn--zoom-out { display: none; } .pswp--zoomed-in .pswp__icn--zoom-in { display: none; } .pswp--zoomed-in .pswp__icn--zoom-out { display: block; } .pswp__button--arrow .pswp__icn {left: auto; right: auto; width: 40px; height: 40px; transform: none; margin-top: -20px; } .pswp__img { background: repeating-conic-gradient(#e6e6e6 0% 25%, #ffffff 0% 50%) 50% / 16px 16px; } .pswp__caption { position: absolute; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: min(720px, calc(100% - 32px)); padding: 6px 12px; border-radius: 6px; background: rgba(0, 0, 0, 0.6); color: #ffffff; font: 14px/1.4 sans-serif; text-align: center; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; } .pswp__caption[hidden] { display: none; }", document.head.appendChild(e);
|
|
246
287
|
}
|
|
247
|
-
export {
|
|
288
|
+
export { b as a, y as i, x as n, u as o, S as r, l as s, _ as t };
|
|
248
289
|
|
|
249
|
-
//# sourceMappingURL=useLightbox-
|
|
290
|
+
//# sourceMappingURL=useLightbox-Ctl9zaMX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLightbox-Ctl9zaMX.js","names":["loaded","loadCdnCss","target","root","set","href","link","getShadowRoot","el","PHOTOSWIPE_CSS","DEFAULT_IMAGE_SIZE","MAX_ZOOM_LAYER_WIDTH","ZOOM_KEYS","SHARED_LIGHTBOX","IMAGE_ANNOTATION","provideImageAnnotation","annotation","SHARED_ITEMS","useLightbox","options","lightbox","shallowRef","sharedLightbox","shared","useSharedLightbox","inject","$t","useI18n","unmounted","onBeforeUnmount","gallery","injectPhotoSwipeOverrides","PhotoSwipeLightbox","zoomLevel","linkEl","itemData","element","src","caption","pswp","ANNOTATE_ICON","update","url","getCurrentSlideUrl","annotatableImageUrl","watch","readable","file","readImageFile","canCopyImages","COPY_ICON","readableImageUrl","copyImage","openInNewTab","downloadable","ui","downloadImage","event","factor","key","slide","ctrlKey","metaKey","altKey","provideSharedLightbox","container","joined","started","start","init","provide","onMounted","useImageSizes","sizes","ref","image","images","img","COPIED_ICON","COPY_FAILED_ICON","COPY_FEEDBACK_MS","copyFeedbackTimers","imageFileName","name","subtype","type","fetchImage","response","blob","readAsPng","objectUrl","canvas","png","resolve","reject","show","icon","label","button","labels","downloadUrl","toDownloadUrl","anchor","getFilenameFromUrl","overridesInjected","style"],"sources":["../../../../packages/utils/src/cdn-css.ts","../../../../packages/components/src/composables/useLightbox.ts"],"sourcesContent":["const loaded = new WeakMap<Node, Set<string>>()\n\n/**\n * Injects a CDN stylesheet `<link>` once per URL per root.\n * When a `ShadowRoot` is passed, the link is appended there so that\n * custom-element (Shadow DOM) encapsulation is respected.\n * Falls back to `document.head` for regular DOM usage.\n */\nexport function loadCdnCss(href: string, root?: ShadowRoot) {\n const target: Node = root ?? document.head\n let set = loaded.get(target)\n if (!set) {\n set = new Set()\n loaded.set(target, set)\n }\n if (set.has(href)) {\n return\n }\n const link = document.createElement('link')\n link.rel = 'stylesheet'\n link.href = href\n target.appendChild(link)\n set.add(href)\n}\n\n/** Returns the `ShadowRoot` ancestor of `el`, or `undefined` in regular DOM. */\nexport function getShadowRoot(el?: Element | null): ShadowRoot | undefined {\n const root = el?.getRootNode?.()\n return root instanceof ShadowRoot ? root : undefined\n}\n","import {\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n ref,\n shallowRef,\n watch,\n type InjectionKey,\n type Ref,\n type ShallowRef,\n} from 'vue'\nimport { useI18n } from 'vue-i18n'\nimport type PhotoSwipeLightbox from 'photoswipe/lightbox'\nimport type PhotoSwipe from 'photoswipe'\nimport { loadCdnCss } from 'utils'\n\nconst PHOTOSWIPE_CSS =\n 'https://cdn.jsdelivr.net/npm/photoswipe@5/dist/photoswipe.css'\n\nconst DEFAULT_IMAGE_SIZE = { width: 1200, height: 800 }\n\n// The widest layer a zoom may draw, PhotoSwipe's own cap for its default\n// secondary zoom level: past it a very large image stops short of 100%.\nconst MAX_ZOOM_LAYER_WIDTH = 4000\n\n// The zoom factor of one press of `+` or `-`, with or without Shift.\nconst ZOOM_KEYS: Record<string, number | undefined> = {\n '+': 1.25,\n '=': 1.25,\n '-': 0.8,\n _: 0.8,\n}\n\n/** The shared lightbox of a container, as the components inside see it. */\nexport interface SharedLightbox {\n /** An item joined: the first one starts the lightbox. */\n join: () => void\n}\n\n/** Lets the components inside a container join its shared lightbox. */\nconst SHARED_LIGHTBOX: InjectionKey<SharedLightbox> = Symbol('sharedLightbox')\n\n/**\n * \"Annota e chiedi\" (spec `chat-image-editor.md`, F3): a conversation with a\n * composer takes an annotated copy of one of its images as an attachment.\n */\nexport interface ImageAnnotation {\n /** The composer takes an image now: it is shown, uploads on, not full. */\n available: () => boolean\n /** Opens the editor on the image, whose bytes arrive in `file`. */\n annotate: (file: Promise<File>) => void\n}\n\n/** Offers \"Annota e chiedi\" to the lightboxes of the components inside. */\nconst IMAGE_ANNOTATION: InjectionKey<ImageAnnotation> =\n Symbol('imageAnnotation')\n\n/**\n * Gives the lightboxes inside the \"Annota e chiedi\" button: only the chat\n * with a composer calls it, so a log of conversations shows none.\n */\nexport function provideImageAnnotation(annotation: ImageAnnotation): void {\n provide(IMAGE_ANNOTATION, annotation)\n}\n\n/**\n * The items of a shared lightbox: the anchors of the components that joined\n * it, and the images of a markdown that joined it, except an image inside a\n * link, which opens the link.\n */\nconst SHARED_ITEMS =\n 'a[data-pswp-src][data-pswp-shared], [data-pswp-images] img:not(a img)'\n\nexport interface LightboxImage {\n url: string\n caption?: string\n alt?: string\n /** Natural width in px, used by PhotoSwipe for proper sizing. */\n width?: number\n /** Natural height in px, used by PhotoSwipe for proper sizing. */\n height?: number\n}\n\nexport interface LightboxOptions {\n /** Container element whose child anchors are the gallery items */\n gallery: Readonly<Ref<HTMLElement | null | undefined>>\n /** CSS selector for gallery items inside the container (default: `'a[data-pswp-src]'`) */\n children?: string\n loop?: boolean\n /** Show a download button in the lightbox toolbar */\n downloadable?: boolean\n /** Show an open-in-new-tab button in the lightbox toolbar */\n openInNewTab?: boolean\n /**\n * Hands the items to the shared lightbox of a container above\n * (`provideSharedLightbox`), when there is one.\n */\n shared?: boolean\n}\n\nexport interface UseLightboxReturn {\n lightbox: ShallowRef<PhotoSwipeLightbox | null>\n /** Initialises PhotoSwipe. Call this inside `onMounted`. */\n init: () => Promise<void>\n /**\n * The items went to a shared lightbox: their anchors carry\n * `data-pswp-shared`, and `init` starts that lightbox instead.\n */\n shared: boolean\n}\n\n/**\n * Encapsulates PhotoSwipe 5 initialisation, toolbar customisation, and lifecycle cleanup.\n * CSS is injected into `document.head` so the overlay works in both regular DOM and Shadow DOM.\n *\n * Usage:\n * ```ts\n * const { init } = useLightbox({ gallery: galleryRef, downloadable: true })\n * onMounted(init)\n * ```\n */\nexport function useLightbox(options: LightboxOptions): UseLightboxReturn {\n const {\n gallery,\n children = 'a[data-pswp-src]',\n loop = true,\n downloadable = true,\n openInNewTab = true,\n shared = false,\n } = options\n\n const lightbox = shallowRef<PhotoSwipeLightbox | null>(null)\n const sharedLightbox = shared ? useSharedLightbox() : undefined\n const annotation = inject(IMAGE_ANNOTATION, undefined)\n const { t: $t } = useI18n({ useScope: 'global' })\n let unmounted = false\n\n const init = async () => {\n if (sharedLightbox) {\n sharedLightbox.join()\n return\n }\n if (!gallery.value) {\n return\n }\n\n // PhotoSwipe renders its overlay into document.body, so CSS must be in\n // document.head, not inside a shadow root.\n loadCdnCss(PHOTOSWIPE_CSS)\n injectPhotoSwipeOverrides()\n\n const { default: PhotoSwipeLightbox } =\n await import('photoswipe/lightbox')\n // Unmounted while PhotoSwipe loaded: nothing left to destroy it\n if (unmounted) {\n return\n }\n\n lightbox.value = new PhotoSwipeLightbox({\n gallery: gallery.value,\n children,\n pswpModule: () => import('photoswipe'),\n loop,\n // The wheel zooms around the pointer, as an image viewer does;\n // a drag pans\n wheelToZoom: true,\n // A click, a double tap, the zoom button and Z go from fit to the\n // real pixels, where PhotoSwipe stops at three times fit\n secondaryZoomLevel: (zoomLevel) =>\n Math.min(\n 1,\n MAX_ZOOM_LAYER_WIDTH /\n (zoomLevel.elementSize?.x || MAX_ZOOM_LAYER_WIDTH),\n ),\n closeTitle: $t('action.close'),\n zoomTitle: $t('lightbox.zoom'),\n arrowPrevTitle: $t('action.previous'),\n arrowNextTitle: $t('action.next'),\n errorMsg: $t('label.imageLoadError'),\n arrowPrevSVG:\n '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"m10.828 12l4.95 4.95l-1.414 1.415L8 12l6.364-6.364l1.414 1.414z\"/></svg>',\n arrowNextSVG:\n '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z\"/></svg>',\n closeSVG:\n '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z\"/></svg>',\n zoomSVG:\n '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><g class=\"pswp__icn--zoom-in\"><path fill=\"#ffffff\" d=\"m18.031 16.617l4.283 4.282l-1.415 1.415l-4.282-4.283A8.96 8.96 0 0 1 11 20c-4.968 0-9-4.032-9-9s4.032-9 9-9s9 4.032 9 9a8.96 8.96 0 0 1-1.969 5.617m-2.006-.742A6.98 6.98 0 0 0 18 11c0-3.867-3.133-7-7-7s-7 3.133-7 7s3.133 7 7 7a6.98 6.98 0 0 0 4.875-1.975zM10 10V7h2v3h3v2h-3v3h-2v-3H7v-2z\"/></g><g class=\"pswp__icn--zoom-out\"><path fill=\"#ffffff\" d=\"m18.031 16.617l4.283 4.282l-1.415 1.415l-4.282-4.283A8.96 8.96 0 0 1 11 20c-4.968 0-9-4.032-9-9s4.032-9 9-9s9 4.032 9 9a8.96 8.96 0 0 1-1.969 5.617m-2.006-.742A6.98 6.98 0 0 0 18 11c0-3.867-3.133-7-7-7s-7 3.133-7 7s3.133 7 7 7a6.98 6.98 0 0 0 4.875-1.975zM7 10h8v2H7z\"/></g></svg>',\n })\n\n // A markdown image is the `<img>` itself, already loaded: its source\n // and natural size stand in for the data attributes of an anchor\n lightbox.value.addFilter('domItemData', (itemData, element, linkEl) => {\n if (linkEl) {\n return { ...itemData, caption: linkEl.dataset.pswpCaption }\n }\n if (!(element instanceof HTMLImageElement)) {\n return itemData\n }\n const src = element.currentSrc || element.src\n return {\n ...itemData,\n src,\n msrc: src,\n width: element.naturalWidth || DEFAULT_IMAGE_SIZE.width,\n height: element.naturalHeight || DEFAULT_IMAGE_SIZE.height,\n alt: element.alt,\n caption: element.alt,\n }\n })\n\n // The caption under the image, as text: the agent or a page it read\n // may have written it\n lightbox.value.on('uiRegister', () => {\n lightbox.value?.pswp?.ui?.registerElement({\n name: 'caption',\n className: 'pswp__caption pswp__hide-on-close',\n appendTo: 'root',\n onInit: (element, pswp) => {\n pswp.on('change', () => {\n const caption = pswp.currSlide?.data.caption ?? ''\n element.textContent = caption\n element.hidden = !caption\n })\n },\n })\n })\n\n // Annotate the image and ask about it: the lightbox closes, the\n // editor opens while the bytes arrive, and the copy joins the\n // attachments of the composer\n if (annotation) {\n lightbox.value.on('uiRegister', () => {\n lightbox.value?.pswp?.ui?.registerElement({\n name: 'annotate-button',\n order: 6,\n isButton: true,\n html: ANNOTATE_ICON,\n title: $t('lightbox.annotate'),\n onInit: (element, pswp) => {\n const update = () => {\n const url = getCurrentSlideUrl(pswp)\n element.hidden =\n !url ||\n !annotatableImageUrl(url) ||\n !annotation.available()\n }\n pswp.on('change', update)\n // The composer fills up, or comes back as a call\n // ends, while the lightbox stays on one slide\n pswp.on('destroy', watch(annotation.available, update))\n },\n onClick: (_, __, pswp) => {\n const url = getCurrentSlideUrl(pswp)\n const readable = url && annotatableImageUrl(url)\n if (!readable || !annotation.available()) {\n return\n }\n const file = readImageFile(\n readable,\n pswp.currSlide?.data.caption,\n )\n // The editor reads it; one that never opens must not\n // leave its failure unhandled\n void file.catch(() => undefined)\n // PhotoSwipe ignores a close while it opens: a quick\n // click left it over the page, trapping the focus\n if (pswp.opener.isOpen) {\n pswp.close()\n } else {\n pswp.on('openingAnimationEnd', () => pswp.close())\n }\n annotation.annotate(file)\n },\n })\n })\n }\n\n // Copy the image, on the slides whose bytes a page may read\n if (canCopyImages()) {\n lightbox.value.on('uiRegister', () => {\n lightbox.value?.pswp?.ui?.registerElement({\n name: 'copy-button',\n order: 7,\n isButton: true,\n html: COPY_ICON,\n title: $t('lightbox.copy'),\n onInit: (element, pswp) => {\n pswp.on('change', () => {\n const url = getCurrentSlideUrl(pswp)\n element.hidden = !url || !readableImageUrl(url)\n })\n },\n onClick: (_, element, pswp) => {\n const url = getCurrentSlideUrl(pswp)\n const readable = url && readableImageUrl(url)\n if (!readable) {\n return\n }\n void copyImage(readable, element, {\n copy: $t('lightbox.copy'),\n copied: $t('lightbox.copied'),\n failed: $t('lightbox.copyFailed'),\n })\n },\n })\n })\n }\n\n if (openInNewTab || downloadable) {\n lightbox.value.on('uiRegister', () => {\n const ui = lightbox.value!.pswp?.ui\n if (!ui) {\n return\n }\n\n if (openInNewTab) {\n ui.registerElement({\n name: 'open-in-new-tab-button',\n order: 8,\n isButton: true,\n html: '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3z\"/></svg>',\n title: $t('lightbox.openInNewTab'),\n onClick: (_, __, pswp) => {\n const url = getCurrentSlideUrl(pswp)\n if (url) {\n window.open(\n url,\n '_blank',\n 'noopener,noreferrer',\n )\n }\n },\n })\n }\n\n if (downloadable) {\n ui.registerElement({\n name: 'download-button',\n order: 9,\n isButton: true,\n html: '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"M3 19h18v2H3zm10-5.828L19.071 7.1l1.414 1.414L12 17L3.515 8.515L4.929 7.1L11 13.173V2h2z\"/></svg>',\n title: $t('action.download'),\n onClick: (_, __, pswp) => {\n const url = getCurrentSlideUrl(pswp)\n if (url) {\n downloadImage(url)\n }\n },\n })\n }\n })\n }\n\n // `+` and `-` zoom by a step around the center of the screen\n lightbox.value.on('keydown', (event) => {\n const { key, ctrlKey, metaKey, altKey } = event.originalEvent\n const factor = ZOOM_KEYS[key]\n const pswp = lightbox.value?.pswp\n const slide = pswp?.currSlide\n if (\n !factor ||\n ctrlKey ||\n metaKey ||\n altKey ||\n !slide?.isZoomable()\n ) {\n return\n }\n // The first stops PhotoSwipe's own handling, the second the browser's\n event.preventDefault()\n event.originalEvent.preventDefault()\n slide.zoomTo(\n slide.currZoomLevel * factor,\n undefined,\n pswp?.options.zoomAnimationDuration,\n )\n })\n\n lightbox.value.init()\n }\n\n onBeforeUnmount(() => {\n unmounted = true\n lightbox.value?.destroy()\n lightbox.value = null\n })\n\n return { lightbox, init, shared: Boolean(sharedLightbox) }\n}\n\n/**\n * The shared lightbox above that takes this component's images, if any: a\n * markdown marks its container with `data-pswp-images` and joins when it\n * shows an image.\n */\nexport function useSharedLightbox(): SharedLightbox | undefined {\n return inject(SHARED_LIGHTBOX, undefined)\n}\n\n/**\n * One lightbox over the images of a container, a conversation: the arrows go\n * through all of them in page order instead of stopping at the card that was\n * clicked. The components inside that pass `shared` to `useLightbox` skip a\n * lightbox of their own and mark their anchors with `data-pswp-shared`; the\n * others, such as a diagram's, keep theirs. It starts when the first image\n * joins, so a conversation without images loads no PhotoSwipe.\n */\nexport function provideSharedLightbox(\n container: Readonly<Ref<HTMLElement | null | undefined>>,\n): void {\n const { init } = useLightbox({\n gallery: container,\n children: SHARED_ITEMS,\n loop: false,\n })\n let joined = false\n let started = false\n const start = async () => {\n if (!joined || started || !container.value) {\n return\n }\n started = true\n try {\n await init()\n } catch {\n // PhotoSwipe did not load: the next image that joins tries again\n started = false\n }\n }\n provide(SHARED_LIGHTBOX, {\n join: () => {\n joined = true\n void start()\n },\n })\n // An image may join before the container is in place\n onMounted(start)\n}\n\n// ---------------------------------------------------------------------------\n// Image size preloading\n// ---------------------------------------------------------------------------\n\nexport interface UseImageSizesReturn {\n preload: (\n images: Array<{ url: string; width?: number; height?: number }>,\n ) => void\n getSize: (url: string) => { width: number; height: number }\n}\n\n/**\n * Preloads natural image dimensions so PhotoSwipe can size its slides correctly.\n * When `width`/`height` are already provided they are used as-is;\n * otherwise the image is loaded in the background to read `naturalWidth`/`naturalHeight`.\n */\nexport function useImageSizes(): UseImageSizesReturn {\n const sizes = ref(new Map<string, { width: number; height: number }>())\n\n const preload = (\n images: Array<{ url: string; width?: number; height?: number }>,\n ) => {\n for (const image of images) {\n if (image.width && image.height) {\n sizes.value.set(image.url, {\n width: image.width,\n height: image.height,\n })\n continue\n }\n const img = new Image()\n img.onload = () => {\n sizes.value.set(image.url, {\n width: img.naturalWidth,\n height: img.naturalHeight,\n })\n }\n img.src = image.url\n }\n }\n\n const getSize = (url: string) => sizes.value.get(url) ?? DEFAULT_IMAGE_SIZE\n\n return { preload, getSize }\n}\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nfunction getCurrentSlideUrl(pswp: PhotoSwipe): string | undefined {\n return (\n pswp.currSlide?.data?.src ??\n pswp.currSlide?.data?.element\n ?.querySelector('img')\n ?.getAttribute('src') ??\n pswp.currSlide?.data?.element\n ?.querySelector('source')\n ?.getAttribute('srcset') ??\n pswp.currSlide?.data?.element?.getAttribute('src') ??\n undefined\n )\n}\n\nconst ANNOTATE_ICON =\n '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"m15.243 4.512l-6.738 6.737l-.707 2.121l-1.04 1.041l2.828 2.828l1.04-1.04l2.122-.708l6.737-6.737zm6.364 3.535a1 1 0 0 1 0 1.414l-7.778 7.778l-2.122.707l-1.414 1.415a1 1 0 0 1-1.414 0l-4.243-4.243a1 1 0 0 1 0-1.414L6.05 12.29l.707-2.122l7.779-7.778a1 1 0 0 1 1.414 0zm-6.364-.707l1.414 1.414l-4.95 4.95l-1.414-1.414zm-10.96 9.546l2.828 2.828l-1.414 1.415l-4.243-1.415z\"/></svg>'\nconst COPY_ICON =\n '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1 1 0 0 1 3 21l.003-14c0-.552.45-1 1.006-1zM5.002 8L5 20h10V8zM9 6h8v10h2V4H9z\"/></svg>'\nconst COPIED_ICON =\n '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"m10 15.172l9.192-9.193l1.415 1.414L10 18l-6.364-6.364l1.414-1.414z\"/></svg>'\nconst COPY_FAILED_ICON =\n '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m-1-5h2v2h-2zm0-8h2v6h-2z\"/></svg>'\n\n// How long the button shows the outcome of a copy before it is a copy again.\nconst COPY_FEEDBACK_MS = 1500\nconst copyFeedbackTimers = new WeakMap<\n HTMLElement,\n ReturnType<typeof setTimeout>\n>()\n\n/** The browser can put an image on the clipboard. */\nfunction canCopyImages(): boolean {\n return (\n typeof ClipboardItem !== 'undefined' &&\n typeof navigator.clipboard?.write === 'function'\n )\n}\n\n/**\n * Where a page may read the bytes of a slide: a chat file through its\n * `/content` route, since its `/view` link redirects to the storage host,\n * which answers no page's CORS; an upload of this session or an inline image\n * as they are. Any other host would refuse the read, so that slide offers no\n * copy.\n */\nfunction readableImageUrl(url: string): string | undefined {\n if (url.startsWith('blob:') || url.startsWith('data:image/')) {\n return url\n }\n if (/\\/chats\\/[^/]+\\/media\\/[^/]+\\/view(\\?|$)/.test(url)) {\n return url.replace(/\\/view(\\?|$)/, '/content$1')\n }\n return undefined\n}\n\n/**\n * Where the editor may read the bytes of a slide: one a page may read\n * (`readableImageUrl`) that the canvas decodes, so not an inline drawing,\n * such as the SVG of a diagram.\n */\nexport function annotatableImageUrl(url: string): string | undefined {\n if (\n url.startsWith('data:') &&\n !/^data:image\\/(png|jpeg|webp|gif)[;,]/.test(url)\n ) {\n return undefined\n }\n return readableImageUrl(url)\n}\n\n/**\n * The name of the copy of an image: its caption when that is a file name,\n * as an attachment's is, else `image` with the extension of its type.\n */\nexport function imageFileName(\n caption: string | undefined,\n type: string,\n): string {\n const name = caption?.trim()\n if (name && /\\.(png|jpe?g|webp|gif)$/i.test(name)) {\n return name\n }\n const subtype = /^image\\/(png|jpeg|webp|gif)$/.exec(type)?.[1]\n return `image.${subtype === 'jpeg' ? 'jpg' : (subtype ?? 'png')}`\n}\n\n/** The bytes of the image at `url`, a readable one. */\nasync function fetchImage(url: string): Promise<Blob> {\n const response = await fetch(url, { credentials: 'include' })\n if (!response.ok) {\n throw new Error(`The image answered ${response.status}`)\n }\n return response.blob()\n}\n\n/** The image at `url` as a file, for the editor. */\nasync function readImageFile(url: string, caption?: string): Promise<File> {\n const blob = await fetchImage(url)\n return new File([blob], imageFileName(caption, blob.type), {\n type: blob.type,\n })\n}\n\n/**\n * The image at `url` as a PNG, the one type every browser puts on the\n * clipboard: another type is drawn on a canvas first.\n */\nasync function readAsPng(url: string): Promise<Blob> {\n const blob = await fetchImage(url)\n if (blob.type === 'image/png') {\n return blob\n }\n // An `<img>` and not `createImageBitmap`, which refuses an SVG\n const objectUrl = URL.createObjectURL(blob)\n try {\n const image = new Image()\n image.src = objectUrl\n await image.decode()\n const canvas = document.createElement('canvas')\n canvas.width = image.naturalWidth\n canvas.height = image.naturalHeight\n canvas.getContext('2d')?.drawImage(image, 0, 0)\n return await new Promise<Blob>((resolve, reject) => {\n canvas.toBlob(\n (png) =>\n png ? resolve(png) : reject(new Error('No PNG was drawn')),\n 'image/png',\n )\n })\n } finally {\n URL.revokeObjectURL(objectUrl)\n }\n}\n\n/**\n * Copies the image and shows on the button how it went. The PNG goes to the\n * clipboard as a promise, so Safari still counts the click as the gesture\n * while the bytes arrive.\n */\nasync function copyImage(\n url: string,\n button: HTMLElement,\n labels: { copy: string; copied: string; failed: string },\n): Promise<void> {\n const show = (icon: string, label: string) => {\n button.innerHTML = icon\n button.title = label\n button.setAttribute('aria-label', label)\n }\n const png = readAsPng(url)\n // The clipboard reads it below; a browser that refuses a promise in\n // `ClipboardItem` never does, and its failure must not go unhandled\n void png.catch(() => undefined)\n try {\n await navigator.clipboard.write([\n new ClipboardItem({ 'image/png': png }),\n ])\n show(COPIED_ICON, labels.copied)\n } catch {\n show(COPY_FAILED_ICON, labels.failed)\n }\n // A second copy restarts the wait instead of being cut short by the first\n clearTimeout(copyFeedbackTimers.get(button))\n copyFeedbackTimers.set(\n button,\n setTimeout(() => show(COPY_ICON, labels.copy), COPY_FEEDBACK_MS),\n )\n}\n\n/**\n * Triggers a client-side download for an image URL.\n *\n * For backend media URLs (.../media/:file/view), navigates to the\n * corresponding /download endpoint which redirects to an Azure SAS URL\n * with `Content-Disposition: attachment`, so no CORS issues.\n *\n * For blob: URLs (in-session uploads), uses the fetch → blob approach.\n *\n * For data: URLs (inline SVGs, etc.), use the download attribute.\n *\n * Falls back to opening in a new tab for all other cases.\n */\nfunction downloadImage(url: string): void {\n const downloadUrl = toDownloadUrl(url)\n\n const anchor = document.createElement('a')\n anchor.href = downloadUrl\n anchor.target = '_blank'\n anchor.rel = 'noopener noreferrer'\n // `download` attribute works for same-origin, data: and blob: URLs; for\n // cross-origin it is ignored but the browser still follows Content-Disposition.\n anchor.download = getFilenameFromUrl(url)\n document.body.appendChild(anchor)\n anchor.click()\n document.body.removeChild(anchor)\n}\n\n/**\n * Converts a `/view` media URL to its `/download` counterpart.\n * Leaves blob:, data: and all other URLs untouched.\n */\nfunction toDownloadUrl(url: string): string {\n return url.replace(/\\/view(\\?|$)/, '/download$1')\n}\n\nfunction getFilenameFromUrl(url: string): string {\n if (url.startsWith('data:image/svg+xml')) {\n return 'diagram.svg'\n }\n if (url.startsWith('data:')) {\n const mime = url.split(':')[1].split(';')[0]\n const ext = mime.split('/')[1] || 'bin'\n return `image.${ext}`\n }\n try {\n const pathname = new URL(url).pathname\n const name = pathname.split('/').pop()\n return name && name.includes('.') ? name : 'image'\n } catch {\n return 'image'\n }\n}\n\nlet overridesInjected = false\n\n/**\n * Injects a one-time `<style>` into `document.head` that raises\n * PhotoSwipe's z-index above any host UI (e.g. floating chat widgets\n * that use `z-index: 2147483647`), sizes its icons, lays a checkerboard\n * under transparent images and places the caption.\n */\nfunction injectPhotoSwipeOverrides(): void {\n if (overridesInjected) {\n return\n }\n overridesInjected = true\n const style = document.createElement('style')\n style.textContent = [\n '.pswp__counter { font-family: sans-serif; }',\n '.pswp { z-index: 2147483647 !important; }',\n '.pswp__icn { width: 20px; height: 20px; }',\n '.pswp__button { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }',\n '.pswp__button[hidden] { display: none; }',\n '.pswp__icn--zoom-out { display: none; }',\n '.pswp--zoomed-in .pswp__icn--zoom-in { display: none; }',\n '.pswp--zoomed-in .pswp__icn--zoom-out { display: block; }',\n '.pswp__button--arrow .pswp__icn {left: auto; right: auto; width: 40px; height: 40px; transform: none; margin-top: -20px; }',\n // A checkerboard under the transparent parts of an image, where a\n // dark logo would vanish into the dark backdrop\n '.pswp__img { background: repeating-conic-gradient(#e6e6e6 0% 25%, #ffffff 0% 50%) 50% / 16px 16px; }',\n '.pswp__caption { position: absolute; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: min(720px, calc(100% - 32px)); padding: 6px 12px; border-radius: 6px; background: rgba(0, 0, 0, 0.6); color: #ffffff; font: 14px/1.4 sans-serif; text-align: center; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }',\n '.pswp__caption[hidden] { display: none; }',\n ].join(' ')\n document.head.appendChild(style)\n}\n"],"mappings":";;;;AAAA,IAAMA,oBAAS,IAAI,QAA2B;AAQ9C,SAAgBC,EAAW,GAAc,GAAmB;CACxD,IAAMC,IAAeC,KAAQ,SAAS,MAClCC,IAAMJ,EAAO,IAAIE,CAAM;CAK3B,IAJKE,MACD,oBAAM,IAAI,IAAI,GACdJ,EAAO,I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,CAAC,EAC9B,CAAK,MAAM,GAAG,CAAC,CAAC,MAAM;CAGtC,IAAI;EAEA,IAAMyC,IADW,IAAI,IAAIzC,CAAG,CAAC,CAAC,SACR,MAAM,GAAG,CAAC,CAAC,IAAI;EACrC,OAAOyC,KAAQA,EAAK,SAAS,GAAG,IAAIA,IAAO;CAC/C,QAAQ;EACJ,OAAO;CACX;AACJ;AAEA,IAAIqB,IAAoB;AAQxB,SAASzE,IAAkC;CACvC,IAAIyE,GACA;CAEJ,IAAoB;CACpB,IAAMC,IAAQ,SAAS,cAAc,OAAO;CAiB5C,AAhBA,EAAM,cAAc,+lCAgBpB,SAAS,KAAK,YAAYA,CAAK;AACnC"}
|
package/dist-vue/composables.js
CHANGED
|
@@ -1303,7 +1303,8 @@ var R = {
|
|
|
1303
1303
|
copied: "Immagine copiata",
|
|
1304
1304
|
copyFailed: "Non è stato possibile copiare l'immagine",
|
|
1305
1305
|
openInNewTab: "Apri in una nuova scheda",
|
|
1306
|
-
zoom: "Ingrandisci o riduci"
|
|
1306
|
+
zoom: "Ingrandisci o riduci",
|
|
1307
|
+
annotate: "Annota e chiedi"
|
|
1307
1308
|
},
|
|
1308
1309
|
imageEditor: {
|
|
1309
1310
|
edit: "Modifica immagine",
|
|
@@ -1311,6 +1312,10 @@ var R = {
|
|
|
1311
1312
|
tool: "Strumento",
|
|
1312
1313
|
crop: "Ritaglia",
|
|
1313
1314
|
cover: "Copri",
|
|
1315
|
+
arrow: "Freccia",
|
|
1316
|
+
rect: "Rettangolo",
|
|
1317
|
+
path: "Mano libera",
|
|
1318
|
+
text: "Testo",
|
|
1314
1319
|
rotateLeft: "Ruota a sinistra",
|
|
1315
1320
|
rotateRight: "Ruota a destra",
|
|
1316
1321
|
undo: "Annulla l'ultima modifica",
|
|
@@ -1322,6 +1327,18 @@ var R = {
|
|
|
1322
1327
|
coverSolid: "Riquadro pieno",
|
|
1323
1328
|
coverPixelate: "Pixel",
|
|
1324
1329
|
coverHint: "Trascina sull'immagine. Per un testo il riquadro pieno è l'unica copertura sicura; i pixel vanno bene per un volto.",
|
|
1330
|
+
color: "Colore",
|
|
1331
|
+
colorRed: "Rosso",
|
|
1332
|
+
colorYellow: "Giallo",
|
|
1333
|
+
colorGreen: "Verde",
|
|
1334
|
+
colorBlue: "Blu",
|
|
1335
|
+
colorWhite: "Bianco",
|
|
1336
|
+
colorBlack: "Nero",
|
|
1337
|
+
arrowHint: "Trascina dalla coda alla punta.",
|
|
1338
|
+
rectHint: "Trascina intorno a quello che vuoi indicare.",
|
|
1339
|
+
pathHint: "Disegna tenendo premuto.",
|
|
1340
|
+
textHint: "Fai clic dove scrivere, poi premi Invio.",
|
|
1341
|
+
textLabel: "Testo sull'immagine",
|
|
1325
1342
|
canvasLabel: "Immagine in modifica",
|
|
1326
1343
|
use: "Usa l'immagine",
|
|
1327
1344
|
loading: "Apertura dell'immagine",
|
|
@@ -3482,7 +3499,8 @@ var R = {
|
|
|
3482
3499
|
copied: "Image copied",
|
|
3483
3500
|
copyFailed: "The image could not be copied",
|
|
3484
3501
|
openInNewTab: "Open in a new tab",
|
|
3485
|
-
zoom: "Zoom in or out"
|
|
3502
|
+
zoom: "Zoom in or out",
|
|
3503
|
+
annotate: "Annotate and ask"
|
|
3486
3504
|
},
|
|
3487
3505
|
imageEditor: {
|
|
3488
3506
|
edit: "Edit image",
|
|
@@ -3490,6 +3508,10 @@ var R = {
|
|
|
3490
3508
|
tool: "Tool",
|
|
3491
3509
|
crop: "Crop",
|
|
3492
3510
|
cover: "Cover",
|
|
3511
|
+
arrow: "Arrow",
|
|
3512
|
+
rect: "Rectangle",
|
|
3513
|
+
path: "Freehand",
|
|
3514
|
+
text: "Text",
|
|
3493
3515
|
rotateLeft: "Rotate left",
|
|
3494
3516
|
rotateRight: "Rotate right",
|
|
3495
3517
|
undo: "Undo the last change",
|
|
@@ -3501,6 +3523,18 @@ var R = {
|
|
|
3501
3523
|
coverSolid: "Solid box",
|
|
3502
3524
|
coverPixelate: "Pixels",
|
|
3503
3525
|
coverHint: "Drag on the image. On a text a solid box is the only safe cover; pixels are fine for a face.",
|
|
3526
|
+
color: "Color",
|
|
3527
|
+
colorRed: "Red",
|
|
3528
|
+
colorYellow: "Yellow",
|
|
3529
|
+
colorGreen: "Green",
|
|
3530
|
+
colorBlue: "Blue",
|
|
3531
|
+
colorWhite: "White",
|
|
3532
|
+
colorBlack: "Black",
|
|
3533
|
+
arrowHint: "Drag from the tail to the tip.",
|
|
3534
|
+
rectHint: "Drag around what you want to point out.",
|
|
3535
|
+
pathHint: "Hold down and draw.",
|
|
3536
|
+
textHint: "Click where to write, then press Enter.",
|
|
3537
|
+
textLabel: "Text on the image",
|
|
3504
3538
|
canvasLabel: "Image being edited",
|
|
3505
3539
|
use: "Use the image",
|
|
3506
3540
|
loading: "Opening the image",
|