@8wave/ai-elements 0.125.0-beta.39 → 0.125.0-beta.40
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-Dt0ygdJM.js → PkChatbotFilePreview-o0zIuCgN.js} +2 -2
- package/dist/_chunks/{PkChatbotFilePreview-Dt0ygdJM.js.map → PkChatbotFilePreview-o0zIuCgN.js.map} +1 -1
- package/dist/_chunks/{PkFilePreview-CT3_vRcU.js → PkFilePreview-D_1ZgiiA.js} +438 -438
- package/dist/_chunks/{PkFilePreview-CT3_vRcU.js.map → PkFilePreview-D_1ZgiiA.js.map} +1 -1
- package/dist/_chunks/{PkFilePreviewDialog-BOKJCapN.js → PkFilePreviewDialog-CI22huzK.js} +2 -2
- package/dist/_chunks/{PkFilePreviewDialog-BOKJCapN.js.map → PkFilePreviewDialog-CI22huzK.js.map} +1 -1
- package/dist/_chunks/{PkImageEditorDialog-D-ikpGo8.js → PkImageEditorDialog-CAEninFi.js} +152 -130
- package/dist/_chunks/PkImageEditorDialog-CAEninFi.js.map +1 -0
- package/dist/_chunks/{PkSelectionActions-CXQTnSXQ.js → PkSelectionActions-BriGyWCi.js} +2 -2
- package/dist/_chunks/{PkSelectionActions-CXQTnSXQ.js.map → PkSelectionActions-BriGyWCi.js.map} +1 -1
- package/dist/_chunks/{PkStreamingMarkdown-5fgxYt_s.js → PkStreamingMarkdown--9i0feuM.js} +3 -3
- package/dist/_chunks/{PkStreamingMarkdown-5fgxYt_s.js.map → PkStreamingMarkdown--9i0feuM.js.map} +1 -1
- package/dist/_chunks/{PkToolChatFile-Cbmu6I0S.js → PkToolChatFile-BKGUnWrj.js} +3 -3
- package/dist/_chunks/{PkToolChatFile-Cbmu6I0S.js.map → PkToolChatFile-BKGUnWrj.js.map} +1 -1
- package/dist/_chunks/{PkToolShareDocument-Bxm1pSpj.js → PkToolShareDocument-BUg-uDTO.js} +2 -2
- package/dist/_chunks/{PkToolShareDocument-Bxm1pSpj.js.map → PkToolShareDocument-BUg-uDTO.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-CGUmoTfN.js → PkToolShowArtifact-BfLpz2-W.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-CGUmoTfN.js.map → PkToolShowArtifact-BfLpz2-W.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-DZ-kgXa6.js → PkToolShowContactForm-BsF6DFzV.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-DZ-kgXa6.js.map → PkToolShowContactForm-BsF6DFzV.js.map} +1 -1
- package/dist/_chunks/{PkToolShowDiagram-CwINVecL.js → PkToolShowDiagram-CcRJNDHo.js} +2 -2
- package/dist/_chunks/{PkToolShowDiagram-CwINVecL.js.map → PkToolShowDiagram-CcRJNDHo.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-BrxNGFCH.js → PkToolShowForm-w6RvbKEB.js} +3 -3
- package/dist/_chunks/{PkToolShowForm-BrxNGFCH.js.map → PkToolShowForm-w6RvbKEB.js.map} +1 -1
- package/dist/_chunks/{PkToolShowImageGallery-BGTncXxq.js → PkToolShowImageGallery-BEddh4He.js} +2 -2
- package/dist/_chunks/{PkToolShowImageGallery-BGTncXxq.js.map → PkToolShowImageGallery-BEddh4He.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-B3RSUWP7.js → PkToolShowSources-CGESvGrm.js} +2 -2
- package/dist/_chunks/{PkToolShowSources-B3RSUWP7.js.map → PkToolShowSources-CGESvGrm.js.map} +1 -1
- package/dist/_chunks/{useLightbox-C54BCSbU.js → useLightbox-TagJmiah.js} +38 -37
- package/dist/_chunks/useLightbox-TagJmiah.js.map +1 -0
- package/dist/_chunks/{utils-Do6urHUh.js → utils-zkq8kMz-.js} +7 -4
- package/{dist-vue/_chunks/utils-Do3JWPJe.js.map → dist/_chunks/utils-zkq8kMz-.js.map} +1 -1
- package/dist/ai-elements.es.js +2711 -2711
- 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/PkChatbotStepPayload.js +1 -1
- package/dist-vue/PkChatbotStepToolDetail.js +1 -1
- package/dist-vue/PkChatbotSteps.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/PkChatbotViewConversations.js +1 -1
- package/dist-vue/_chunks/{PkChart-BsF3OtnS.js → PkChart-DyyBXkd3.js} +2 -2
- package/dist-vue/_chunks/{PkChart-BsF3OtnS.js.map → PkChart-DyyBXkd3.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbot-BIQh81cA.js → PkChatbot-wsqj3EpU.js} +5 -5
- package/dist-vue/_chunks/{PkChatbot-BIQh81cA.js.map → PkChatbot-wsqj3EpU.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotEmptyState-pAeFPPQc.js → PkChatbotEmptyState-DcgIfNkX.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-pAeFPPQc.js.map → PkChatbotEmptyState-DcgIfNkX.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotFilePreview-BIta8Yg-.js → PkChatbotFilePreview-BDU2vY0F.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotFilePreview-BIta8Yg-.js.map → PkChatbotFilePreview-BDU2vY0F.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotInput-CN4rmNgu.js +520 -0
- package/dist-vue/_chunks/PkChatbotInput-CN4rmNgu.js.map +1 -0
- package/dist-vue/_chunks/PkChatbotMessages-BlF4Xp0_.js +1054 -0
- package/dist-vue/_chunks/{PkChatbotMessages-CZu8feEz.js.map → PkChatbotMessages-BlF4Xp0_.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepPayload-r25JHO7_.js → PkChatbotStepPayload-q9uXE5mr.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-r25JHO7_.js.map → PkChatbotStepPayload-q9uXE5mr.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-C897BpRX.js → PkChatbotStepToolDetail-BJz6Qwh3.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-C897BpRX.js.map → PkChatbotStepToolDetail-BJz6Qwh3.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotSteps-CRtIVwJV.js → PkChatbotSteps-DvJYNl_k.js} +5 -5
- package/dist-vue/_chunks/{PkChatbotSteps-CRtIVwJV.js.map → PkChatbotSteps-DvJYNl_k.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-BBCxj4Qz.js → PkChatbotViewChat-tmHyxxT3.js} +23 -23
- package/dist-vue/_chunks/{PkChatbotViewChat-BBCxj4Qz.js.map → PkChatbotViewChat-tmHyxxT3.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewConversations-rXGl7NKA.js → PkChatbotViewConversations-DOzUh_A7.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewConversations-rXGl7NKA.js.map → PkChatbotViewConversations-DOzUh_A7.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreview-1ZNyDAo5.js → PkFilePreview-Bp5-Pl54.js} +227 -227
- package/dist-vue/_chunks/{PkFilePreview-1ZNyDAo5.js.map → PkFilePreview-Bp5-Pl54.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreviewDialog-DnbUHGG2.js → PkFilePreviewDialog-CS885vBR.js} +2 -2
- package/dist-vue/_chunks/{PkFilePreviewDialog-DnbUHGG2.js.map → PkFilePreviewDialog-CS885vBR.js.map} +1 -1
- package/dist-vue/_chunks/{PkImageEditorDialog-Dn3HV_ny.js → PkImageEditorDialog-BhfdnsmX.js} +300 -278
- package/dist-vue/_chunks/PkImageEditorDialog-BhfdnsmX.js.map +1 -0
- package/dist-vue/_chunks/{PkStreamingMarkdown-COQLmP8b.js → PkStreamingMarkdown-NgrJUZPI.js} +3 -3
- package/dist-vue/_chunks/{PkStreamingMarkdown-COQLmP8b.js.map → PkStreamingMarkdown-NgrJUZPI.js.map} +1 -1
- package/dist-vue/_chunks/{PkSvgViewer-vkd5Dluw.js → PkSvgViewer-CRNwb6Yn.js} +2 -2
- package/dist-vue/_chunks/{PkSvgViewer-vkd5Dluw.js.map → PkSvgViewer-CRNwb6Yn.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolChatFile-e-7a0k7l.js → PkToolChatFile-DnmiNGF4.js} +3 -3
- package/dist-vue/_chunks/{PkToolChatFile-e-7a0k7l.js.map → PkToolChatFile-DnmiNGF4.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShareDocument-CspvFwRR.js → PkToolShareDocument-Bf7OE8XA.js} +2 -2
- package/dist-vue/_chunks/{PkToolShareDocument-CspvFwRR.js.map → PkToolShareDocument-Bf7OE8XA.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-CUP3VaC9.js → PkToolShowArtifact-C8ueuIGQ.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-CUP3VaC9.js.map → PkToolShowArtifact-C8ueuIGQ.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowChart-X6JZDAWD.js → PkToolShowChart-BWO6Hzlq.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowChart-X6JZDAWD.js.map → PkToolShowChart-BWO6Hzlq.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-BM8d9M5a.js → PkToolShowContactForm-BBcDsLEO.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-BM8d9M5a.js.map → PkToolShowContactForm-BBcDsLEO.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-DOdzpndK.js → PkToolShowDiagram-BzUcxOKy.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowDiagram-DOdzpndK.js.map → PkToolShowDiagram-BzUcxOKy.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-TYBf8q6g.js → PkToolShowForm-B6uhHzJ8.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowForm-TYBf8q6g.js.map → PkToolShowForm-B6uhHzJ8.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-BvwuoyF6.js → PkToolShowImageGallery-C39nlJrJ.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowImageGallery-BvwuoyF6.js.map → PkToolShowImageGallery-C39nlJrJ.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowLocation-WdRqG8Wi.js → PkToolShowLocation-Nhh_LwmN.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowLocation-WdRqG8Wi.js.map → PkToolShowLocation-Nhh_LwmN.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-_MHBAgNI.js → PkToolShowProductList-FLLkRCnm.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-_MHBAgNI.js.map → PkToolShowProductList-FLLkRCnm.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-CHw7qZtw.js → PkToolShowSources-Cb7r5jrX.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSources-CHw7qZtw.js.map → PkToolShowSources-Cb7r5jrX.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-D7oiBe4p.js → PkToolShowVideo-QDLhVlau.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowVideo-D7oiBe4p.js.map → PkToolShowVideo-QDLhVlau.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-CRq9Jhmw.js → PkToolShowWebPages-P6PdJTEE.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-CRq9Jhmw.js.map → PkToolShowWebPages-P6PdJTEE.js.map} +1 -1
- package/dist-vue/_chunks/{useLightbox-Ctl9zaMX.js → useLightbox-DmtNa8bJ.js} +38 -37
- package/dist-vue/_chunks/useLightbox-DmtNa8bJ.js.map +1 -0
- package/dist-vue/_chunks/{utils-Do3JWPJe.js → utils-D4B1FVGF.js} +6 -3
- package/dist-vue/_chunks/utils-D4B1FVGF.js.map +1 -0
- package/dist-vue/composables.js +1 -1
- package/dist-vue/index.js +61 -61
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/packages/components/src/chat/imageEdits.d.ts +3 -1
- package/dist-vue/packages/components/src/chat/utils.d.ts +6 -0
- package/dist-vue/packages/components/src/composables/useLightbox.d.ts +6 -0
- package/package.json +1 -1
- package/dist/_chunks/PkImageEditorDialog-D-ikpGo8.js.map +0 -1
- package/dist/_chunks/useLightbox-C54BCSbU.js.map +0 -1
- package/dist/_chunks/utils-Do6urHUh.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotInput-DSyIo0xB.js +0 -520
- package/dist-vue/_chunks/PkChatbotInput-DSyIo0xB.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotMessages-CZu8feEz.js +0 -1054
- package/dist-vue/_chunks/PkImageEditorDialog-Dn3HV_ny.js.map +0 -1
- package/dist-vue/_chunks/useLightbox-Ctl9zaMX.js.map +0 -1
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { r as e } from "./rolldown-runtime-9rEmUaIe.js";
|
|
2
|
-
import { A as t, B as n, Et as r, F as i, I as a, J as o, L as s, N as c, Ot as l, Q as u, S as d, Tt as f, V as p, X as m, _ as h, d as g, f as _, g as v, gt as y, h as b, j as ee, k as x, kt as S, ot as C, r as w, tt as te, v as T, vt as ne, w as E, wt as D, x as
|
|
3
|
-
import { r as
|
|
4
|
-
import { i as
|
|
5
|
-
import {
|
|
6
|
-
import { d as
|
|
7
|
-
import { r as
|
|
8
|
-
import { t as
|
|
9
|
-
import { a as
|
|
10
|
-
import { t as
|
|
11
|
-
import { t as
|
|
2
|
+
import { A as t, B as n, Et as r, F as i, I as a, J as o, L as s, N as c, Ot as l, Q as u, S as d, Tt as f, V as p, X as m, _ as h, d as g, f as _, g as v, gt as y, h as b, j as ee, k as x, kt as S, ot as C, r as w, tt as te, v as T, vt as ne, w as E, wt as D, x as O, y as k, z as A } from "./vue.runtime.esm-bundler-C2U5uTqB.js";
|
|
3
|
+
import { r as re } from "./vue-i18n-POtLvOl1.js";
|
|
4
|
+
import { i as j, n as M, r as N } from "./excelNumberFormat-BhQjife9.js";
|
|
5
|
+
import { G as P, H as ie, J as ae, K as oe, U as se, V as F, W as ce, o as I, q as L } from "./utils-zkq8kMz-.js";
|
|
6
|
+
import { d as R, l as le } from "./dist-D6oUr4J_.js";
|
|
7
|
+
import { r as ue } from "./index.es-DIHz5I8K.js";
|
|
8
|
+
import { t as de } from "./VvButtonLocalized-C8S7XJGv.js";
|
|
9
|
+
import { a as fe, i as z, r as pe, t as me } from "./PkSelectionActions-BriGyWCi.js";
|
|
10
|
+
import { t as B } from "./_plugin-vue_export-helper-Djzt4Yr7.js";
|
|
11
|
+
import { t as he } from "./PkEditorRadioButtons-Br4c42KS.js";
|
|
12
12
|
// ../../packages/components/src/chat/fileSelection.ts
|
|
13
|
-
var
|
|
14
|
-
let t = [...new Set(e)].sort((e, t) =>
|
|
13
|
+
var ge = 2e3, V = 1e3, _e = 60, ve = 1400, H = 20, U = 100, W = (e) => Number(e.slice(1)), ye = (e) => {
|
|
14
|
+
let t = [...new Set(e)].sort((e, t) => W(e) - W(t)), n = [];
|
|
15
15
|
for (let e of t) {
|
|
16
16
|
let t = n[n.length - 1];
|
|
17
|
-
t &&
|
|
17
|
+
t && W(e) === W(t.to) + 1 ? t.to = e : n.push({
|
|
18
18
|
from: e,
|
|
19
19
|
to: e
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
22
|
return n.slice(0, 100);
|
|
23
|
-
},
|
|
23
|
+
}, G = (e, t) => {
|
|
24
24
|
let n = [];
|
|
25
25
|
if (!t) return n;
|
|
26
26
|
for (let r = e.indexOf(t); r >= 0; r = e.indexOf(t, r + 1)) n.push(r);
|
|
27
27
|
return n;
|
|
28
|
-
},
|
|
29
|
-
let r =
|
|
28
|
+
}, be = (e, t, n) => {
|
|
29
|
+
let r = G(e, e.slice(t, t + n));
|
|
30
30
|
if (r.length < 2) return {};
|
|
31
31
|
let i = t, a = t + n;
|
|
32
|
-
for (let t = !0; a - i <=
|
|
33
|
-
if (
|
|
32
|
+
for (let t = !0; a - i <= ve; t = !t) {
|
|
33
|
+
if (G(e, e.slice(i, a)).length === 1) return { find: e.slice(i, a) };
|
|
34
34
|
if (t && i > 0) i = e.slice(0, i).replace(/\S*\s*$/, "").length;
|
|
35
35
|
else if (a < e.length) {
|
|
36
36
|
let t = e.slice(a).match(/^\s*\S*/)?.[0] ?? "";
|
|
@@ -41,23 +41,23 @@ var _e = 2e3, B = 1e3, V = 60, H = 1400, U = 20, W = 100, G = (e) => Number(e.sl
|
|
|
41
41
|
index: r.indexOf(t) + 1 || 1,
|
|
42
42
|
of: r.length
|
|
43
43
|
} };
|
|
44
|
-
},
|
|
44
|
+
}, K = (e) => (e.querySelectorAll("[data-quote-skip]").forEach((e) => e.remove()), e.querySelectorAll("[data-paragraph]").forEach((e) => e.append("\n")), e.textContent ?? ""), xe = (e) => e.length > V ? `${e.slice(0, V / 2)} […] ${e.slice(-500)}` : e, Se = (e) => {
|
|
45
45
|
let t = e.startContainer.getRootNode().getSelection?.() ?? document.getSelection();
|
|
46
46
|
try {
|
|
47
47
|
t?.setBaseAndExtent(e.startContainer, e.startOffset, e.endContainer, e.endOffset);
|
|
48
48
|
} catch {}
|
|
49
|
-
},
|
|
49
|
+
}, Ce = (e, t, n) => {
|
|
50
50
|
let r = t.commonAncestorContainer;
|
|
51
51
|
if (!e.contains(r) || (r instanceof Element ? r : r.parentElement)?.closest("[data-quote-skip]")) return;
|
|
52
52
|
let i = [...e.querySelectorAll("[data-paragraph]")].filter((e) => !e.closest(n) && t.intersectsNode(e));
|
|
53
53
|
if (!i.length) return;
|
|
54
|
-
let a = i.flatMap((e) => e.dataset.paragraph.split(" ")), o =
|
|
54
|
+
let a = i.flatMap((e) => e.dataset.paragraph.split(" ")), o = K(t.cloneContents()), s = o.trim();
|
|
55
55
|
if (s.length < 2) return;
|
|
56
56
|
let c = {
|
|
57
57
|
format: "docx",
|
|
58
|
-
runs:
|
|
58
|
+
runs: ye(a),
|
|
59
59
|
paragraphCount: new Set(a).size,
|
|
60
|
-
quote:
|
|
60
|
+
quote: xe(s),
|
|
61
61
|
measure: () => {
|
|
62
62
|
let e = t.getBoundingClientRect(), n = t.getClientRects()[0] ?? e;
|
|
63
63
|
return {
|
|
@@ -68,22 +68,22 @@ var _e = 2e3, B = 1e3, V = 60, H = 1400, U = 20, W = 100, G = (e) => Number(e.sl
|
|
|
68
68
|
bottom: e.bottom
|
|
69
69
|
};
|
|
70
70
|
},
|
|
71
|
-
restore: () =>
|
|
71
|
+
restore: () => Se(t)
|
|
72
72
|
};
|
|
73
73
|
if (i.length === 1) {
|
|
74
74
|
let e = i[0], n = document.createRange();
|
|
75
75
|
n.selectNodeContents(e);
|
|
76
|
-
let r =
|
|
76
|
+
let r = K(n.cloneContents()).replace(/\n$/, ""), a = document.createRange();
|
|
77
77
|
a.setStart(e, 0), a.setEnd(t.startContainer, t.startOffset);
|
|
78
|
-
let l =
|
|
79
|
-
c.before = r.slice(Math.max(0, l -
|
|
78
|
+
let l = K(a.cloneContents()).length + (o.length - o.trimStart().length);
|
|
79
|
+
c.before = r.slice(Math.max(0, l - _e), l), c.after = r.slice(l + s.length, l + s.length + _e), Object.assign(c, be(r, l, s.length));
|
|
80
80
|
}
|
|
81
81
|
return c;
|
|
82
|
-
},
|
|
82
|
+
}, we = (e) => {
|
|
83
83
|
let t = "";
|
|
84
84
|
for (let n = e; n > 0; n = Math.floor((n - 1) / 26)) t = String.fromCharCode(65 + (n - 1) % 26) + t;
|
|
85
85
|
return t;
|
|
86
|
-
},
|
|
86
|
+
}, Te = (e, t) => {
|
|
87
87
|
let n = { ...t }, r = e.rows.flatMap((e) => e.cells.filter((e) => e.span).map((t) => ({
|
|
88
88
|
r1: e.row,
|
|
89
89
|
r2: e.row + t.span.rows - 1,
|
|
@@ -94,7 +94,7 @@ var _e = 2e3, B = 1e3, V = 60, H = 1400, U = 20, W = 100, G = (e) => Number(e.sl
|
|
|
94
94
|
e = !1;
|
|
95
95
|
for (let t of r) t.r1 <= n.r2 && t.r2 >= n.r1 && t.c1 <= n.c2 && t.c2 >= n.c1 && (t.r1 < n.r1 || t.r2 > n.r2 || t.c1 < n.c1 || t.c2 > n.c2) && (n.r1 = Math.min(n.r1, t.r1), n.r2 = Math.max(n.r2, t.r2), n.c1 = Math.min(n.c1, t.c1), n.c2 = Math.max(n.c2, t.c2), e = !0);
|
|
96
96
|
}
|
|
97
|
-
let i = `${
|
|
97
|
+
let i = `${we(n.c1)}${n.r1}`, a = `${we(n.c2)}${n.r2}`, o = (e.hiddenRows ?? []).filter((e) => e >= n.r1 && e <= n.r2).slice(0, U), s = e.columns.filter((e) => e.hidden && e.col >= n.c1 && e.col <= n.c2).map((e) => we(e.col)).slice(0, U), c = e.rows.filter((e) => e.row >= n.r1 && e.row <= n.r2).flatMap((e) => e.cells.filter((e) => e.col >= n.c1 && e.col <= n.c2 && e.value !== void 0 && e.value !== "")).slice(0, H).map((e) => String(e.value)).join("; ").slice(0, 500);
|
|
98
98
|
return {
|
|
99
99
|
format: "xlsx",
|
|
100
100
|
sheet: e.name,
|
|
@@ -107,7 +107,7 @@ var _e = 2e3, B = 1e3, V = 60, H = 1400, U = 20, W = 100, G = (e) => Number(e.sl
|
|
|
107
107
|
};
|
|
108
108
|
// ../../packages/components/src/chat/PkSpreadsheetPreview.vue?vue&type=script&setup=true&lang.ts
|
|
109
109
|
x(), C(), f(), w();
|
|
110
|
-
var
|
|
110
|
+
var Ee = { class: "pk-spreadsheet-preview" }, De = { class: "pk-spreadsheet-preview__bar" }, Oe = ["aria-label"], ke = ["aria-label"], Ae = ["aria-label"], je = [
|
|
111
111
|
"rowspan",
|
|
112
112
|
"colspan",
|
|
113
113
|
"data-focus",
|
|
@@ -115,16 +115,16 @@ var Te = { class: "pk-spreadsheet-preview" }, Ee = { class: "pk-spreadsheet-prev
|
|
|
115
115
|
"title",
|
|
116
116
|
"onMousedown",
|
|
117
117
|
"onMouseenter"
|
|
118
|
-
],
|
|
118
|
+
], q = {
|
|
119
119
|
key: 1,
|
|
120
120
|
class: "pk-spreadsheet-preview__more"
|
|
121
|
-
},
|
|
121
|
+
}, Me = ["aria-label"], Ne = ["aria-current", "onClick"], Pe = { class: "pk-spreadsheet-preview__status" }, Fe = { class: "pk-spreadsheet-preview__info" }, Ie = ["title"], Le = ["title"], Re = {
|
|
122
122
|
key: 2,
|
|
123
123
|
class: "pk-spreadsheet-preview__stats"
|
|
124
|
-
},
|
|
124
|
+
}, ze = {
|
|
125
125
|
key: 0,
|
|
126
126
|
class: "pk-spreadsheet-preview__average"
|
|
127
|
-
},
|
|
127
|
+
}, Be = { key: 1 }, Ve = { class: "pk-spreadsheet-preview__zoom" }, He = { class: "pk-spreadsheet-preview__percent" }, Ue = 64, We = 20, Ge = 28, Ke = 44, qe = 400, Je = 10, Ye = /*#__PURE__*/ B(/* @__PURE__ */ E({
|
|
128
128
|
__name: "PkSpreadsheetPreview",
|
|
129
129
|
props: /*@__PURE__*/ c({
|
|
130
130
|
preview: { type: null },
|
|
@@ -137,28 +137,28 @@ var Te = { class: "pk-spreadsheet-preview" }, Ee = { class: "pk-spreadsheet-prev
|
|
|
137
137
|
}),
|
|
138
138
|
emits: /*@__PURE__*/ c(["select"], ["update:sheet", "update:zoom"]),
|
|
139
139
|
setup(e, { emit: t }) {
|
|
140
|
-
let n = e, c = t, { t: f, locale: h } =
|
|
140
|
+
let n = e, c = t, { t: f, locale: h } = re({ useScope: "global" }), x = o(e, "sheet"), C = o(e, "zoom"), w = m("scrollEl"), { width: te, height: ne } = le(w, {
|
|
141
141
|
width: 0,
|
|
142
142
|
height: 0
|
|
143
143
|
}, { box: "border-box" }), E = b(() => n.preview.sheets[x.value] ?? n.preview.sheets[0]);
|
|
144
144
|
u(() => n.preview, () => {
|
|
145
145
|
x.value = 0;
|
|
146
146
|
});
|
|
147
|
-
let
|
|
147
|
+
let P = b(() => n.marked?.get(E.value?.name ?? "")), ie = b(() => {
|
|
148
148
|
let e = /* @__PURE__ */ new Map();
|
|
149
|
-
for (let t of
|
|
149
|
+
for (let t of P.value ?? []) {
|
|
150
150
|
let [n, r] = t.split(":"), i = e.get(Number(n));
|
|
151
151
|
e.set(Number(n), i ? `${i},${r}` : r);
|
|
152
152
|
}
|
|
153
153
|
return e;
|
|
154
|
-
}),
|
|
154
|
+
}), ae = (e, t) => !!P.value?.has(`${e}:${t}`);
|
|
155
155
|
u(() => n.marked, (e) => {
|
|
156
|
-
if (!e ||
|
|
156
|
+
if (!e || P.value) return;
|
|
157
157
|
let t = n.preview.sheets.findIndex((t) => e.has(t.name));
|
|
158
158
|
t >= 0 && (x.value = t);
|
|
159
159
|
}, { immediate: !0 });
|
|
160
|
-
let
|
|
161
|
-
u(
|
|
160
|
+
let oe = () => pe(w.value, ".pk-spreadsheet-preview__cell--marked");
|
|
161
|
+
u(P, oe, { flush: "post" }), s(oe);
|
|
162
162
|
let se = (e) => {
|
|
163
163
|
let t = "";
|
|
164
164
|
for (let n = e; n > 0; n = Math.floor((n - 1) / 26)) t = String.fromCharCode(65 + (n - 1) % 26) + t;
|
|
@@ -166,55 +166,55 @@ var Te = { class: "pk-spreadsheet-preview" }, Ee = { class: "pk-spreadsheet-prev
|
|
|
166
166
|
}, F = b(() => {
|
|
167
167
|
let e = E.value;
|
|
168
168
|
if (!e) return [];
|
|
169
|
-
let t = new Set(e.columns.filter((e) => e.hidden).map((e) => e.col)), n = new Map(e.columns.map((e) => [e.col, e.width])), r = [], i =
|
|
169
|
+
let t = new Set(e.columns.filter((e) => e.hidden).map((e) => e.col)), n = new Map(e.columns.map((e) => [e.col, e.width])), r = [], i = Ke, a = te.value / C.value;
|
|
170
170
|
for (let o = 1; o <= e.lastColumn || !e.moreColumns && (o <= e.lastColumn + 2 || i < a); o++) {
|
|
171
171
|
if (t.has(o)) continue;
|
|
172
|
-
let e = n.get(o) ??
|
|
172
|
+
let e = n.get(o) ?? Ue;
|
|
173
173
|
r.push({
|
|
174
174
|
col: o,
|
|
175
175
|
width: e
|
|
176
176
|
}), i += e;
|
|
177
177
|
}
|
|
178
178
|
return r;
|
|
179
|
-
}), ce = b(() => F.value.reduce((e, t) => e + t.width,
|
|
179
|
+
}), ce = b(() => F.value.reduce((e, t) => e + t.width, Ke)), I = b(() => F.value.map((e) => `${e.col}:${e.width}`).join(",")), L = /* @__PURE__ */ new WeakMap(), R = b(() => {
|
|
180
180
|
let e = E.value;
|
|
181
181
|
if (!e) return [];
|
|
182
|
-
let t = new Set(e.hiddenRows ?? []), n = new Map(e.rows.map((e) => [e.row, e.height])), r = Math.ceil((ne.value / C.value -
|
|
183
|
-
a || (a = /* @__PURE__ */ new Map(),
|
|
182
|
+
let t = new Set(e.hiddenRows ?? []), n = new Map(e.rows.map((e) => [e.row, e.height])), r = Math.ceil((ne.value / C.value - Ge) / We), i = e.moreRows ? e.lastRow : Math.max(e.lastRow + 5, r + t.size), a = L.get(e);
|
|
183
|
+
a || (a = /* @__PURE__ */ new Map(), L.set(e, a));
|
|
184
184
|
let o = a;
|
|
185
185
|
return Array.from({ length: i }, (e, t) => t + 1).filter((e) => !t.has(e)).map((e) => {
|
|
186
186
|
let t = o.get(e);
|
|
187
187
|
return t || (t = {
|
|
188
188
|
row: e,
|
|
189
|
-
height: n.get(e) ??
|
|
189
|
+
height: n.get(e) ?? We
|
|
190
190
|
}, o.set(e, t)), t;
|
|
191
191
|
});
|
|
192
|
-
}),
|
|
192
|
+
}), ue = b(() => {
|
|
193
193
|
let e = /* @__PURE__ */ new Map();
|
|
194
194
|
for (let t of E.value?.rows ?? []) for (let n of t.cells) e.set(`${t.row},${n.col}`, n);
|
|
195
195
|
return e;
|
|
196
|
-
}),
|
|
196
|
+
}), fe = b(() => {
|
|
197
197
|
let e = /* @__PURE__ */ new Map();
|
|
198
198
|
for (let t of E.value?.rows ?? []) for (let n of t.cells) if (n.span) for (let r = 0; r < n.span.rows; r++) for (let i = 0; i < n.span.cols; i++) (r || i) && e.set(`${t.row + r},${n.col + i}`, {
|
|
199
199
|
row: t.row,
|
|
200
200
|
col: n.col
|
|
201
201
|
});
|
|
202
202
|
return e;
|
|
203
|
-
}),
|
|
204
|
-
let n =
|
|
203
|
+
}), z = (e, t) => ue.value.get(`${e},${t}`), me = (e, t) => {
|
|
204
|
+
let n = z(e, t)?.span;
|
|
205
205
|
if (n) return {
|
|
206
|
-
rows:
|
|
206
|
+
rows: R.value.filter((t) => t.row >= e && t.row < e + n.rows).length,
|
|
207
207
|
cols: F.value.filter((e) => e.col >= t && e.col < t + n.cols).length
|
|
208
208
|
};
|
|
209
|
-
},
|
|
209
|
+
}, B = (e) => e?.style === void 0 ? void 0 : n.preview.styles[e.style], he = (e) => {
|
|
210
210
|
let t = e.numFmt === void 0 ? void 0 : n.preview.numberFormats?.[e.numFmt], r = e.value;
|
|
211
211
|
if (t !== void 0) try {
|
|
212
|
-
return e.format === "date" ? e.serial === void 0 ? void 0 :
|
|
212
|
+
return e.format === "date" ? e.serial === void 0 ? void 0 : M(t, e.serial, h.value, n.preview.date1904) : typeof r == "number" ? j(t) ? M(t, r, h.value, n.preview.date1904) : N(t, r, h.value) : void 0;
|
|
213
213
|
} catch {
|
|
214
214
|
return;
|
|
215
215
|
}
|
|
216
|
-
},
|
|
217
|
-
let n =
|
|
216
|
+
}, ge = (e, t) => {
|
|
217
|
+
let n = he(e);
|
|
218
218
|
if (n) return n.text;
|
|
219
219
|
let r = e.decimals === void 0 ? { maximumFractionDigits: 10 } : {
|
|
220
220
|
minimumFractionDigits: e.decimals,
|
|
@@ -229,18 +229,18 @@ var Te = { class: "pk-spreadsheet-preview" }, Ee = { class: "pk-spreadsheet-prev
|
|
|
229
229
|
currency: e.currency
|
|
230
230
|
} : {}
|
|
231
231
|
}).format(t);
|
|
232
|
-
},
|
|
232
|
+
}, V = (e) => {
|
|
233
233
|
let t = /* @__PURE__ */ new Date(`${e}T00:00:00Z`);
|
|
234
234
|
return Number.isNaN(t.getTime()) ? e : new Intl.DateTimeFormat(h.value, {
|
|
235
235
|
dateStyle: "short",
|
|
236
236
|
timeZone: "UTC"
|
|
237
237
|
}).format(t);
|
|
238
|
-
},
|
|
238
|
+
}, _e = (e) => {
|
|
239
239
|
if (!e) return "";
|
|
240
240
|
if (e.missing) return "—";
|
|
241
241
|
let t = e.value;
|
|
242
|
-
return t === void 0 ? "" : typeof t == "boolean" ? f(t ? "chatFilePreview.true" : "chatFilePreview.false") : e.format === "date" && typeof t == "string" ?
|
|
243
|
-
},
|
|
242
|
+
return t === void 0 ? "" : typeof t == "boolean" ? f(t ? "chatFilePreview.true" : "chatFilePreview.false") : e.format === "date" && typeof t == "string" ? he(e)?.text ?? V(t) : typeof t == "number" ? ge(e, t) : t;
|
|
243
|
+
}, ve = (e) => {
|
|
244
244
|
if (!e) return "";
|
|
245
245
|
if (e.formula) return `=${e.formula}`;
|
|
246
246
|
let t = e.value;
|
|
@@ -248,9 +248,9 @@ var Te = { class: "pk-spreadsheet-preview" }, Ee = { class: "pk-spreadsheet-prev
|
|
|
248
248
|
useGrouping: !1,
|
|
249
249
|
maximumFractionDigits: 15,
|
|
250
250
|
...e.format === "percent" ? { style: "percent" } : {}
|
|
251
|
-
}).format(t) :
|
|
252
|
-
},
|
|
253
|
-
let r =
|
|
251
|
+
}).format(t) : _e(e);
|
|
252
|
+
}, H = (e) => e ? `${e.width}px solid ${e.color}` : void 0, U = (e, t, n) => {
|
|
253
|
+
let r = B(e), i = e?.value, a = typeof i == "number" || e?.format === "date" || !!e?.missing, o = {
|
|
254
254
|
textAlign: r?.align ?? (a ? "right" : typeof i == "boolean" || e?.format === "error" ? "center" : "left"),
|
|
255
255
|
verticalAlign: r?.valign === "top" ? "top" : r?.valign === "middle" ? "middle" : "bottom",
|
|
256
256
|
whiteSpace: r?.wrap ? "pre-wrap" : "nowrap"
|
|
@@ -258,33 +258,33 @@ var Te = { class: "pk-spreadsheet-preview" }, Ee = { class: "pk-spreadsheet-prev
|
|
|
258
258
|
r?.bold && (o.fontWeight = 700), r?.italic && (o.fontStyle = "italic");
|
|
259
259
|
let s = [r?.underline ? "underline" : "", r?.strike ? "line-through" : ""].filter(Boolean).join(" ");
|
|
260
260
|
s && (o.textDecoration = s), r?.size && (o.fontSize = `${r.size}pt`);
|
|
261
|
-
let c = e ?
|
|
261
|
+
let c = e ? he(e)?.color : void 0;
|
|
262
262
|
if ((c ?? r?.color) && (o.color = c ?? r?.color), r?.fill && (o.backgroundColor = r.fill), r?.indent) {
|
|
263
263
|
let e = `${4 + r.indent * 9}px`;
|
|
264
264
|
o.textAlign === "right" ? o.paddingRight = e : o.paddingLeft = e;
|
|
265
265
|
}
|
|
266
|
-
let l =
|
|
267
|
-
return
|
|
268
|
-
},
|
|
266
|
+
let l = it(t, n);
|
|
267
|
+
return W(t, n) ? (o.borderStyle = "hidden", o.boxShadow = [...l, Xe(e, t, n)].filter(Boolean).join(", ")) : (o.borderTop = H(r?.borders?.top), o.borderRight = H(r?.borders?.right), o.borderBottom = H(r?.borders?.bottom), o.borderLeft = H(r?.borders?.left), o.boxShadow = [...l, ...be(e, t, n)].join(", ")), Object.assign(o, et(t, n)), o;
|
|
268
|
+
}, W = (e, t) => {
|
|
269
269
|
let n = E.value?.frozen;
|
|
270
270
|
return !!n && (e <= n.rows || t <= n.cols);
|
|
271
|
-
},
|
|
271
|
+
}, ye = {
|
|
272
272
|
top: (e) => `inset 0 ${e.width}px 0 ${e.color}`,
|
|
273
273
|
right: (e) => `inset -${e.width}px 0 0 ${e.color}`,
|
|
274
274
|
bottom: (e) => `inset 0 -${e.width}px 0 ${e.color}`,
|
|
275
275
|
left: (e) => `inset ${e.width}px 0 0 ${e.color}`
|
|
276
|
-
},
|
|
277
|
-
let r =
|
|
278
|
-
return [t ===
|
|
279
|
-
},
|
|
276
|
+
}, G = (...e) => e.reduce((e, t) => t && (!e || t.width > e.width) ? t : e, void 0), be = (e, t, n) => {
|
|
277
|
+
let r = B(e)?.borders;
|
|
278
|
+
return [t === R.value[0]?.row && r?.top && ye.top(r.top), n === F.value[0]?.col && r?.left && ye.left(r.left)].filter((e) => !!e);
|
|
279
|
+
}, K = b(() => R.value.map((e) => e.row)), xe = b(() => F.value.map((e) => e.col)), Se = b(() => new Map(K.value.map((e, t) => [e, t]))), Ce = b(() => new Map(xe.value.map((e, t) => [e, t]))), we = (e, t, n, r) => {
|
|
280
280
|
let i = [], a = t.get(n) ?? e.length;
|
|
281
281
|
for (; a < e.length && e[a] < n + r; a++) i.push(e[a]);
|
|
282
282
|
return {
|
|
283
283
|
spanned: i,
|
|
284
284
|
next: e[a]
|
|
285
285
|
};
|
|
286
|
-
},
|
|
287
|
-
let { spanned: i, next: a } =
|
|
286
|
+
}, Ye = (e, t, n, r) => {
|
|
287
|
+
let { spanned: i, next: a } = we(K.value, Se.value, t, e?.span?.rows ?? 1), { spanned: o, next: s } = we(xe.value, Ce.value, n, e?.span?.cols ?? 1);
|
|
288
288
|
return (r === "right" ? s === void 0 ? [] : i.map((e) => ({
|
|
289
289
|
row: e,
|
|
290
290
|
col: s
|
|
@@ -292,72 +292,72 @@ var Te = { class: "pk-spreadsheet-preview" }, Ee = { class: "pk-spreadsheet-prev
|
|
|
292
292
|
row: a,
|
|
293
293
|
col: e
|
|
294
294
|
}))).map((e) => {
|
|
295
|
-
let t =
|
|
296
|
-
return
|
|
295
|
+
let t = fe.value.get(`${e.row},${e.col}`) ?? e;
|
|
296
|
+
return z(t.row, t.col);
|
|
297
297
|
});
|
|
298
|
-
},
|
|
299
|
-
let r =
|
|
298
|
+
}, Xe = (e, t, n) => {
|
|
299
|
+
let r = B(e)?.borders, i = G(r?.right, ...Ye(e, t, n, "right").map((e) => B(e)?.borders?.left)), a = G(r?.bottom, ...Ye(e, t, n, "bottom").map((e) => B(e)?.borders?.top)), o = E.value?.gridlines;
|
|
300
300
|
return [
|
|
301
|
-
i ?
|
|
302
|
-
a ?
|
|
303
|
-
...
|
|
301
|
+
i ? ye.right(i) : o && "inset calc(var(--border) * -1) 0 0 var(--pk-spreadsheet-gridline)",
|
|
302
|
+
a ? ye.bottom(a) : o && "inset 0 calc(var(--border) * -1) 0 var(--pk-spreadsheet-gridline)",
|
|
303
|
+
...be(e, t, n)
|
|
304
304
|
].filter(Boolean).join(", ");
|
|
305
|
-
},
|
|
305
|
+
}, Ze = (e) => Ge + R.value.filter((t) => t.row < e).reduce((e, t) => e + t.height, 0), Qe = (e) => Ke + F.value.filter((t) => t.col < e).reduce((e, t) => e + t.width, 0), $e = b(() => {
|
|
306
306
|
let e = E.value?.frozen;
|
|
307
307
|
return {
|
|
308
|
-
top:
|
|
309
|
-
left:
|
|
308
|
+
top: Ze((e?.rows ?? 0) + 1),
|
|
309
|
+
left: Qe((e?.cols ?? 0) + 1)
|
|
310
310
|
};
|
|
311
|
-
}),
|
|
311
|
+
}), et = (e, t) => {
|
|
312
312
|
let n = E.value?.frozen;
|
|
313
313
|
if (!n) return {};
|
|
314
314
|
let r = {};
|
|
315
|
-
return e <= n.rows && (r.position = "sticky", r.top = `${
|
|
316
|
-
},
|
|
315
|
+
return e <= n.rows && (r.position = "sticky", r.top = `${Ze(e)}px`, r.scrollMarginTop = r.top, r.zIndex = 0), t <= n.cols && (r.position = "sticky", r.left = `${Qe(t)}px`, r.scrollMarginLeft = r.left, r.zIndex = +(e <= n.rows)), r;
|
|
316
|
+
}, J = y({
|
|
317
317
|
row: 1,
|
|
318
318
|
col: 1
|
|
319
|
-
}),
|
|
319
|
+
}), Y = y({
|
|
320
320
|
row: 1,
|
|
321
321
|
col: 1
|
|
322
322
|
});
|
|
323
323
|
u(E, () => {
|
|
324
|
-
|
|
324
|
+
J.value = {
|
|
325
325
|
row: 1,
|
|
326
326
|
col: 1
|
|
327
|
-
},
|
|
327
|
+
}, Y.value = {
|
|
328
328
|
row: 1,
|
|
329
329
|
col: 1
|
|
330
330
|
};
|
|
331
331
|
});
|
|
332
|
-
let
|
|
333
|
-
r1: Math.min(
|
|
334
|
-
r2: Math.max(
|
|
335
|
-
c1: Math.min(
|
|
336
|
-
c2: Math.max(
|
|
337
|
-
})),
|
|
338
|
-
let { r1: n, r2: r, c1: i, c2: a } =
|
|
339
|
-
if (n === r && i === a || !
|
|
340
|
-
let o =
|
|
332
|
+
let X = b(() => ({
|
|
333
|
+
r1: Math.min(J.value.row, Y.value.row),
|
|
334
|
+
r2: Math.max(J.value.row, Y.value.row),
|
|
335
|
+
c1: Math.min(J.value.col, Y.value.col),
|
|
336
|
+
c2: Math.max(J.value.col, Y.value.col)
|
|
337
|
+
})), tt = (e, t) => e >= X.value.r1 && e <= X.value.r2 && t >= X.value.c1 && t <= X.value.c2, nt = (e, t) => Y.value.row === e && Y.value.col === t, rt = (e) => e >= X.value.r1 && e <= X.value.r2 ? `${X.value.c1}:${X.value.c2}:${Y.value.row === e ? Y.value.col : 0}:${e === X.value.r1 ? "t" : ""}${e === X.value.r2 ? "b" : ""}` : "", it = (e, t) => {
|
|
338
|
+
let { r1: n, r2: r, c1: i, c2: a } = X.value;
|
|
339
|
+
if (n === r && i === a || !tt(e, t)) return [];
|
|
340
|
+
let o = z(e, t)?.span, s = e + (o?.rows ?? 1) - 1, c = t + (o?.cols ?? 1) - 1, l = "var(--spacing-2)", u = "var(--pk-spreadsheet-green)";
|
|
341
341
|
return [
|
|
342
342
|
e === n && `inset 0 ${l} 0 ${u}`,
|
|
343
343
|
s >= r && `inset 0 calc(${l} * -1) 0 ${u}`,
|
|
344
344
|
t === i && `inset ${l} 0 0 ${u}`,
|
|
345
345
|
c >= a && `inset calc(${l} * -1) 0 0 ${u}`
|
|
346
346
|
].filter((e) => !!e);
|
|
347
|
-
},
|
|
348
|
-
w.value?.focus({ preventScroll: !0 }),
|
|
347
|
+
}, Z = y(!1), at = (e, t, n) => {
|
|
348
|
+
w.value?.focus({ preventScroll: !0 }), Y.value = {
|
|
349
349
|
row: e,
|
|
350
350
|
col: t
|
|
351
|
-
}, n.shiftKey || (
|
|
351
|
+
}, n.shiftKey || (J.value = {
|
|
352
352
|
row: e,
|
|
353
353
|
col: t
|
|
354
|
-
}),
|
|
355
|
-
},
|
|
356
|
-
|
|
354
|
+
}), Z.value = !0;
|
|
355
|
+
}, ot = (e, t) => {
|
|
356
|
+
Z.value && (Y.value = {
|
|
357
357
|
row: e,
|
|
358
358
|
col: t
|
|
359
359
|
});
|
|
360
|
-
},
|
|
360
|
+
}, st, ct = () => {
|
|
361
361
|
let e = [...w.value?.querySelectorAll(".pk-spreadsheet-preview__cell--range, [data-focus]") ?? []].map((e) => e.getBoundingClientRect());
|
|
362
362
|
if (e.length) return {
|
|
363
363
|
start: {
|
|
@@ -366,80 +366,80 @@ var Te = { class: "pk-spreadsheet-preview" }, Ee = { class: "pk-spreadsheet-prev
|
|
|
366
366
|
},
|
|
367
367
|
bottom: Math.max(...e.map((e) => e.bottom))
|
|
368
368
|
};
|
|
369
|
-
},
|
|
370
|
-
...
|
|
371
|
-
measure:
|
|
369
|
+
}, lt = () => E.value ? {
|
|
370
|
+
...Te(E.value, X.value),
|
|
371
|
+
measure: ct
|
|
372
372
|
} : void 0;
|
|
373
|
-
u([
|
|
374
|
-
clearTimeout(
|
|
375
|
-
let e =
|
|
376
|
-
c("select", t ?
|
|
373
|
+
u([X, Z], () => {
|
|
374
|
+
clearTimeout(st), !Z.value && (st = setTimeout(() => {
|
|
375
|
+
let e = X.value, t = e.r2 > e.r1 || e.c2 > e.c1;
|
|
376
|
+
c("select", t ? lt() : void 0);
|
|
377
377
|
}, 150));
|
|
378
378
|
});
|
|
379
|
-
let
|
|
380
|
-
clearTimeout(
|
|
381
|
-
},
|
|
379
|
+
let ut = () => {
|
|
380
|
+
clearTimeout(st), c("select", lt());
|
|
381
|
+
}, Q, dt;
|
|
382
382
|
u(E, () => {
|
|
383
|
-
|
|
383
|
+
dt = void 0;
|
|
384
384
|
});
|
|
385
|
-
let
|
|
385
|
+
let ft = (e) => {
|
|
386
386
|
let [t, n] = ((e?.closest?.("[data-cell]"))?.dataset.cell ?? "").split(":").map(Number);
|
|
387
387
|
return t && n ? {
|
|
388
388
|
row: t,
|
|
389
389
|
col: n
|
|
390
390
|
} : void 0;
|
|
391
|
-
},
|
|
392
|
-
clearTimeout(
|
|
391
|
+
}, pt = () => {
|
|
392
|
+
clearTimeout(Q?.timer), Q?.active && (Z.value = !1), Q = void 0;
|
|
393
393
|
};
|
|
394
394
|
a(() => {
|
|
395
|
-
|
|
395
|
+
pt(), clearTimeout(st);
|
|
396
396
|
});
|
|
397
|
-
let
|
|
398
|
-
|
|
399
|
-
let t = e.touches[0], n = e.touches.length === 1 ?
|
|
400
|
-
t && n && (
|
|
397
|
+
let mt = () => void i(ut), ht = (e) => {
|
|
398
|
+
pt();
|
|
399
|
+
let t = e.touches[0], n = e.touches.length === 1 ? ft(e.target) : void 0;
|
|
400
|
+
t && n && (Q = {
|
|
401
401
|
...n,
|
|
402
402
|
x: t.clientX,
|
|
403
403
|
y: t.clientY,
|
|
404
404
|
active: !1,
|
|
405
405
|
timer: setTimeout(() => {
|
|
406
|
-
|
|
407
|
-
row:
|
|
408
|
-
col:
|
|
409
|
-
},
|
|
410
|
-
row:
|
|
411
|
-
col:
|
|
412
|
-
},
|
|
413
|
-
},
|
|
406
|
+
Q && (Q.active = !0, w.value?.focus({ preventScroll: !0 }), J.value = {
|
|
407
|
+
row: Q.row,
|
|
408
|
+
col: Q.col
|
|
409
|
+
}, Y.value = {
|
|
410
|
+
row: Q.row,
|
|
411
|
+
col: Q.col
|
|
412
|
+
}, Z.value = !0);
|
|
413
|
+
}, qe)
|
|
414
414
|
});
|
|
415
|
-
},
|
|
415
|
+
}, gt = (e) => {
|
|
416
416
|
let t = e.touches[0];
|
|
417
|
-
if (
|
|
418
|
-
if (
|
|
419
|
-
(!e.cancelable || Math.hypot(t.clientX -
|
|
417
|
+
if (!Q || !t) return;
|
|
418
|
+
if (!Q.active) {
|
|
419
|
+
(!e.cancelable || Math.hypot(t.clientX - Q.x, t.clientY - Q.y) > Je) && pt();
|
|
420
420
|
return;
|
|
421
421
|
}
|
|
422
422
|
e.preventDefault();
|
|
423
|
-
let n = w.value?.getRootNode(), r =
|
|
424
|
-
r && (
|
|
425
|
-
},
|
|
426
|
-
if (
|
|
427
|
-
let { row: t, col: n, active: r } =
|
|
428
|
-
|
|
429
|
-
let i =
|
|
423
|
+
let n = w.value?.getRootNode(), r = ft(n?.elementFromPoint(t.clientX, t.clientY) ?? null);
|
|
424
|
+
r && (Y.value = r);
|
|
425
|
+
}, _t = (e) => {
|
|
426
|
+
if (!Q) return;
|
|
427
|
+
let { row: t, col: n, active: r } = Q;
|
|
428
|
+
pt(), e.preventDefault();
|
|
429
|
+
let i = X.value, a = i.r1 === i.r2 && i.c1 === i.c2;
|
|
430
430
|
if (r) {
|
|
431
|
-
a &&
|
|
431
|
+
a && mt();
|
|
432
432
|
return;
|
|
433
433
|
}
|
|
434
|
-
let o = a &&
|
|
435
|
-
|
|
434
|
+
let o = a && nt(t, n) && dt === `${t}:${n}`;
|
|
435
|
+
dt = `${t}:${n}`, w.value?.focus({ preventScroll: !0 }), J.value = {
|
|
436
436
|
row: t,
|
|
437
437
|
col: n
|
|
438
|
-
},
|
|
438
|
+
}, Y.value = {
|
|
439
439
|
row: t,
|
|
440
440
|
col: n
|
|
441
|
-
}, o &&
|
|
442
|
-
},
|
|
441
|
+
}, o && mt();
|
|
442
|
+
}, vt = (e) => {
|
|
443
443
|
let t = {
|
|
444
444
|
ArrowUp: [-1, 0],
|
|
445
445
|
ArrowDown: [1, 0],
|
|
@@ -450,7 +450,7 @@ var Te = { class: "pk-spreadsheet-preview" }, Ee = { class: "pk-spreadsheet-prev
|
|
|
450
450
|
}[e.key];
|
|
451
451
|
if (!t) return;
|
|
452
452
|
e.preventDefault();
|
|
453
|
-
let n =
|
|
453
|
+
let n = R.value.map((e) => e.row), r = F.value.map((e) => e.col), a = (e) => fe.value.get(`${e.row},${e.col}`) ?? e, o = a(Y.value), s = n.indexOf(Y.value.row), c = r.indexOf(Y.value.col), l = o;
|
|
454
454
|
for (;;) {
|
|
455
455
|
let e = Math.min(n.length - 1, Math.max(0, s + t[0])), i = Math.min(r.length - 1, Math.max(0, c + t[1]));
|
|
456
456
|
if (e === s && i === c || (s = e, c = i, l = a({
|
|
@@ -458,34 +458,34 @@ var Te = { class: "pk-spreadsheet-preview" }, Ee = { class: "pk-spreadsheet-prev
|
|
|
458
458
|
col: r[c]
|
|
459
459
|
}), l.row !== o.row || l.col !== o.col)) break;
|
|
460
460
|
}
|
|
461
|
-
|
|
461
|
+
Y.value = l, e.shiftKey || (J.value = l), i(() => w.value?.querySelector("[data-focus]")?.scrollIntoView({
|
|
462
462
|
block: "nearest",
|
|
463
463
|
inline: "nearest"
|
|
464
464
|
}));
|
|
465
|
-
},
|
|
466
|
-
let { r1: e, r2: t, c1: n, c2: r } =
|
|
465
|
+
}, yt = b(() => z(Y.value.row, Y.value.col)), $ = b(() => {
|
|
466
|
+
let { r1: e, r2: t, c1: n, c2: r } = X.value;
|
|
467
467
|
if (e === t && n === r) return;
|
|
468
468
|
let i = 0, a = 0, o = 0, s;
|
|
469
469
|
for (let c = e; c <= t; c++) for (let e = n; e <= r; e++) {
|
|
470
|
-
let t =
|
|
470
|
+
let t = z(c, e);
|
|
471
471
|
t && (t.value !== void 0 || t.missing) && (i++, typeof t.value == "number" && (a += t.value, o++, s ??= t));
|
|
472
472
|
}
|
|
473
473
|
if (i) return {
|
|
474
474
|
count: i,
|
|
475
|
-
sum: s ?
|
|
476
|
-
average: s ?
|
|
475
|
+
sum: s ? ge(s, a) : void 0,
|
|
476
|
+
average: s ? ge(s, a / o) : void 0
|
|
477
477
|
};
|
|
478
478
|
}), bt = (e) => {
|
|
479
479
|
C.value = Math.min(2, Math.max(.5, Math.round((C.value + e) * 10) / 10));
|
|
480
480
|
};
|
|
481
481
|
return (t, n) => {
|
|
482
|
-
let i =
|
|
483
|
-
return
|
|
484
|
-
v("div",
|
|
482
|
+
let i = de;
|
|
483
|
+
return A(), k("div", Ee, [
|
|
484
|
+
v("div", De, [
|
|
485
485
|
v("span", {
|
|
486
486
|
class: "pk-spreadsheet-preview__ref",
|
|
487
487
|
"aria-label": D(f)("chatFilePreview.cell")
|
|
488
|
-
}, S(se(
|
|
488
|
+
}, S(se(Y.value.col)) + S(Y.value.row), 9, Oe),
|
|
489
489
|
n[6] ||= v("span", {
|
|
490
490
|
class: "pk-spreadsheet-preview__fx",
|
|
491
491
|
"aria-hidden": "true"
|
|
@@ -493,7 +493,7 @@ var Te = { class: "pk-spreadsheet-preview" }, Ee = { class: "pk-spreadsheet-prev
|
|
|
493
493
|
v("output", {
|
|
494
494
|
class: "pk-spreadsheet-preview__formula",
|
|
495
495
|
"aria-label": D(f)("chatFilePreview.formulaBar")
|
|
496
|
-
}, S(
|
|
496
|
+
}, S(ve(yt.value)), 9, ke)
|
|
497
497
|
]),
|
|
498
498
|
v("div", {
|
|
499
499
|
ref_key: "scrollEl",
|
|
@@ -502,100 +502,100 @@ var Te = { class: "pk-spreadsheet-preview" }, Ee = { class: "pk-spreadsheet-prev
|
|
|
502
502
|
tabindex: "0",
|
|
503
503
|
role: "grid",
|
|
504
504
|
"aria-label": E.value?.name,
|
|
505
|
-
onKeydown:
|
|
506
|
-
onMouseup: n[2] ||= (e) =>
|
|
507
|
-
onMouseleave: n[3] ||= (e) =>
|
|
508
|
-
onTouchstart:
|
|
509
|
-
onTouchmove:
|
|
510
|
-
onTouchend:
|
|
511
|
-
onTouchcancel:
|
|
512
|
-
}, [E.value ? (
|
|
505
|
+
onKeydown: vt,
|
|
506
|
+
onMouseup: n[2] ||= (e) => Z.value = !1,
|
|
507
|
+
onMouseleave: n[3] ||= (e) => Z.value = !1,
|
|
508
|
+
onTouchstart: ht,
|
|
509
|
+
onTouchmove: gt,
|
|
510
|
+
onTouchend: _t,
|
|
511
|
+
onTouchcancel: pt
|
|
512
|
+
}, [E.value ? (A(), k("table", {
|
|
513
513
|
key: 0,
|
|
514
514
|
class: r(["pk-spreadsheet-preview__grid", { "pk-spreadsheet-preview__grid--lines": E.value.gridlines }]),
|
|
515
515
|
style: l({
|
|
516
516
|
zoom: C.value,
|
|
517
517
|
width: `${ce.value}px`,
|
|
518
|
-
"--pk-spreadsheet-stuck-top": `${
|
|
519
|
-
"--pk-spreadsheet-stuck-left": `${
|
|
518
|
+
"--pk-spreadsheet-stuck-top": `${$e.value.top}px`,
|
|
519
|
+
"--pk-spreadsheet-stuck-left": `${$e.value.left}px`
|
|
520
520
|
})
|
|
521
521
|
}, [
|
|
522
|
-
v("colgroup", null, [v("col", { style: l({ width: `${
|
|
522
|
+
v("colgroup", null, [v("col", { style: l({ width: `${Ke}px` }) }, null, 4), (A(!0), k(_, null, p(F.value, (e) => (A(), k("col", {
|
|
523
523
|
key: e.col,
|
|
524
524
|
style: l({ width: `${e.width}px` })
|
|
525
525
|
}, null, 4))), 128))]),
|
|
526
|
-
v("thead", null, [v("tr", { style: l({ height: `${
|
|
526
|
+
v("thead", null, [v("tr", { style: l({ height: `${Ge}px` }) }, [n[7] ||= v("th", { class: "pk-spreadsheet-preview__corner" }, null, -1), (A(!0), k(_, null, p(F.value, (e) => (A(), k("th", {
|
|
527
527
|
key: e.col,
|
|
528
528
|
scope: "col",
|
|
529
|
-
class: r(["pk-spreadsheet-preview__head", { "pk-spreadsheet-preview__head--current": e.col >=
|
|
529
|
+
class: r(["pk-spreadsheet-preview__head", { "pk-spreadsheet-preview__head--current": e.col >= X.value.c1 && e.col <= X.value.c2 }]),
|
|
530
530
|
style: l(E.value.frozen && e.col <= E.value.frozen.cols ? {
|
|
531
|
-
left: `${
|
|
531
|
+
left: `${Qe(e.col)}px`,
|
|
532
532
|
zIndex: 2
|
|
533
533
|
} : void 0)
|
|
534
534
|
}, S(se(e.col)), 7))), 128))], 4)]),
|
|
535
|
-
v("tbody", null, [(
|
|
535
|
+
v("tbody", null, [(A(!0), k(_, null, p(R.value, (e, t, n, i) => {
|
|
536
536
|
let a = [
|
|
537
537
|
e,
|
|
538
538
|
E.value,
|
|
539
539
|
I.value,
|
|
540
540
|
D(h),
|
|
541
|
-
|
|
542
|
-
|
|
541
|
+
rt(e.row),
|
|
542
|
+
ie.value.get(e.row)
|
|
543
543
|
];
|
|
544
544
|
if (i && i.el && i.key === e.row && ee(i, a)) return i;
|
|
545
|
-
let o = (
|
|
545
|
+
let o = (A(), k("tr", {
|
|
546
546
|
key: e.row,
|
|
547
547
|
style: l({ height: `${e.height}px` })
|
|
548
548
|
}, [v("th", {
|
|
549
549
|
scope: "row",
|
|
550
|
-
class: r(["pk-spreadsheet-preview__row", { "pk-spreadsheet-preview__row--current": e.row >=
|
|
550
|
+
class: r(["pk-spreadsheet-preview__row", { "pk-spreadsheet-preview__row--current": e.row >= X.value.r1 && e.row <= X.value.r2 }]),
|
|
551
551
|
style: l(E.value.frozen && e.row <= E.value.frozen.rows ? {
|
|
552
|
-
|
|
552
|
+
...et(e.row, 0),
|
|
553
553
|
left: 0,
|
|
554
554
|
zIndex: 4
|
|
555
555
|
} : void 0)
|
|
556
|
-
}, S(e.row), 7), (
|
|
556
|
+
}, S(e.row), 7), (A(!0), k(_, null, p(F.value, (t) => (A(), k(_, { key: t.col }, [fe.value.has(`${e.row},${t.col}`) ? T("", !0) : (A(), k("td", {
|
|
557
557
|
key: 0,
|
|
558
|
-
rowspan:
|
|
559
|
-
colspan:
|
|
558
|
+
rowspan: me(e.row, t.col)?.rows,
|
|
559
|
+
colspan: me(e.row, t.col)?.cols,
|
|
560
560
|
class: r(["pk-spreadsheet-preview__cell", {
|
|
561
|
-
"pk-spreadsheet-preview__cell--range":
|
|
562
|
-
"pk-spreadsheet-preview__cell--missing":
|
|
563
|
-
"pk-spreadsheet-preview__cell--marked":
|
|
561
|
+
"pk-spreadsheet-preview__cell--range": tt(e.row, t.col) && !nt(e.row, t.col),
|
|
562
|
+
"pk-spreadsheet-preview__cell--missing": z(e.row, t.col)?.missing,
|
|
563
|
+
"pk-spreadsheet-preview__cell--marked": ae(e.row, t.col)
|
|
564
564
|
}]),
|
|
565
|
-
style: l(
|
|
566
|
-
"data-focus":
|
|
565
|
+
style: l(U(z(e.row, t.col), e.row, t.col)),
|
|
566
|
+
"data-focus": nt(e.row, t.col) ? "" : void 0,
|
|
567
567
|
"data-cell": `${e.row}:${t.col}`,
|
|
568
|
-
title:
|
|
569
|
-
onMousedown: g((n) =>
|
|
570
|
-
onMouseenter: (n) =>
|
|
571
|
-
onDblclick:
|
|
572
|
-
}, S(
|
|
568
|
+
title: z(e.row, t.col)?.missing ? D(f)("chatFilePreview.missingValue") : void 0,
|
|
569
|
+
onMousedown: g((n) => at(e.row, t.col, n), ["prevent"]),
|
|
570
|
+
onMouseenter: (n) => ot(e.row, t.col),
|
|
571
|
+
onDblclick: ut
|
|
572
|
+
}, S(_e(z(e.row, t.col))), 47, je))], 64))), 128))], 4));
|
|
573
573
|
return o.memo = a, o;
|
|
574
574
|
}, n, 0), 128))])
|
|
575
|
-
], 6)) : T("", !0), E.value && (E.value.moreRows || E.value.moreColumns) ? (
|
|
575
|
+
], 6)) : T("", !0), E.value && (E.value.moreRows || E.value.moreColumns) ? (A(), k("p", q, [E.value.moreRows ? (A(), k(_, { key: 0 }, [O(S(D(f)("chatFilePreview.moreRows", E.value.moreRows)), 1)], 64)) : T("", !0), E.value.moreColumns ? (A(), k(_, { key: 1 }, [O(S(D(f)("chatFilePreview.moreColumns", E.value.moreColumns)), 1)], 64)) : T("", !0)])) : T("", !0)], 40, Ae),
|
|
576
576
|
v("nav", {
|
|
577
577
|
class: "pk-spreadsheet-preview__sheets",
|
|
578
578
|
"aria-label": D(f)("chatFilePreview.sheets")
|
|
579
|
-
}, [(
|
|
579
|
+
}, [(A(!0), k(_, null, p(e.preview.sheets, (e, t) => (A(), k("button", {
|
|
580
580
|
key: e.name,
|
|
581
581
|
type: "button",
|
|
582
582
|
class: "pk-spreadsheet-preview__sheet",
|
|
583
583
|
"aria-current": t === x.value ? "page" : void 0,
|
|
584
584
|
onClick: (e) => x.value = t
|
|
585
|
-
}, S(e.name), 9,
|
|
586
|
-
v("div",
|
|
585
|
+
}, S(e.name), 9, Ne))), 128))], 8, Me),
|
|
586
|
+
v("div", Pe, [v("p", Fe, [e.preview.staleFormulas ? (A(), k("span", {
|
|
587
587
|
key: 0,
|
|
588
588
|
class: "pk-spreadsheet-preview__note",
|
|
589
589
|
title: D(f)("chatFilePreview.staleFormulas")
|
|
590
|
-
}, S(D(f)("chatFilePreview.staleFormulas")), 9,
|
|
590
|
+
}, S(D(f)("chatFilePreview.staleFormulas")), 9, Ie)) : e.preview.computedFormulas ? (A(), k("span", {
|
|
591
591
|
key: 1,
|
|
592
592
|
class: "pk-spreadsheet-preview__note",
|
|
593
593
|
title: D(f)("chatFilePreview.computedFormulas")
|
|
594
|
-
}, S(D(f)("chatFilePreview.computedFormulas")), 9,
|
|
595
|
-
|
|
596
|
-
v("span", null, S(D(f)("chatFilePreview.count")) + " " + S(
|
|
597
|
-
|
|
598
|
-
])) : T("", !0)]), v("div",
|
|
594
|
+
}, S(D(f)("chatFilePreview.computedFormulas")), 9, Le)) : T("", !0), $.value ? (A(), k("span", Re, [
|
|
595
|
+
$.value.average ? (A(), k("span", ze, S(D(f)("chatFilePreview.average")) + " " + S($.value.average), 1)) : T("", !0),
|
|
596
|
+
v("span", null, S(D(f)("chatFilePreview.count")) + " " + S($.value.count), 1),
|
|
597
|
+
$.value.sum ? (A(), k("span", Be, S(D(f)("chatFilePreview.sum")) + " " + S($.value.sum), 1)) : T("", !0)
|
|
598
|
+
])) : T("", !0)]), v("div", Ve, [
|
|
599
599
|
d(i, {
|
|
600
600
|
modifiers: "action-quiet",
|
|
601
601
|
icon: "ri:subtract-line",
|
|
@@ -603,7 +603,7 @@ var Te = { class: "pk-spreadsheet-preview" }, Ee = { class: "pk-spreadsheet-prev
|
|
|
603
603
|
disabled: C.value <= .5,
|
|
604
604
|
onClick: n[4] ||= (e) => bt(-.1)
|
|
605
605
|
}, null, 8, ["aria-label", "disabled"]),
|
|
606
|
-
v("span",
|
|
606
|
+
v("span", He, S(Math.round(C.value * 100)) + "% ", 1),
|
|
607
607
|
d(i, {
|
|
608
608
|
modifiers: "action-quiet",
|
|
609
609
|
icon: "ri:add-line",
|
|
@@ -618,11 +618,11 @@ var Te = { class: "pk-spreadsheet-preview" }, Ee = { class: "pk-spreadsheet-prev
|
|
|
618
618
|
}), [["styles", [".pk-spreadsheet-preview{--pk-spreadsheet-green:#217346;--pk-spreadsheet-green-head:#217346;--pk-spreadsheet-gridline:#e1e1e1;flex-direction:column;flex:1;min-height:0;display:flex}.pk-spreadsheet-preview__bar{min-height:var(--spacing-40);border-bottom:var(--border) solid var(--color-surface-3);background-color:var(--color-surface);font-size:var(--text-14);align-items:stretch;display:flex}.pk-spreadsheet-preview__ref{width:var(--spacing-96);padding:0 var(--spacing-12);box-sizing:border-box;border-right:var(--border) solid var(--color-surface-3);font-variant-numeric:tabular-nums;flex-shrink:0;align-items:center;display:flex}.pk-spreadsheet-preview__fx{width:var(--spacing-40);border-right:var(--border) solid var(--color-surface-3);color:var(--color-word-3);flex-shrink:0;justify-content:center;align-items:center;font-family:Georgia,serif;font-style:italic;display:flex}.pk-spreadsheet-preview__formula{min-width:0;padding:0 var(--spacing-12);text-overflow:ellipsis;white-space:nowrap;flex:1;align-items:center;display:flex;overflow:hidden}.pk-spreadsheet-preview__scroll{cursor:cell;background-color:#fff;outline:none;flex:1;min-height:0;overflow:auto}.pk-spreadsheet-preview__scroll:focus-visible{box-shadow:inset 0 0 0 var(--spacing-2) var(--input-focus-color)}.pk-spreadsheet-preview__grid{border-collapse:collapse;table-layout:fixed;color:#000;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;font-family:Calibri,Carlito,Segoe UI,Arial,sans-serif;font-size:11pt}.pk-spreadsheet-preview__grid td{max-width:0;padding:0 var(--spacing-4);text-overflow:clip;background-color:#fff;line-height:1.2;overflow:hidden}.pk-spreadsheet-preview__grid--lines td{border:var(--border) solid var(--pk-spreadsheet-gridline)}.pk-spreadsheet-preview__corner,.pk-spreadsheet-preview__head,.pk-spreadsheet-preview__row{z-index:1;box-shadow:var(--pk-spreadsheet-lines);background-color:var(--color-surface-1);color:var(--color-word-3);font-family:var(--font-family-sans);font-size:var(--text-12);font-weight:var(--font-normal);text-align:center;border-style:hidden;position:sticky}.pk-spreadsheet-preview__corner,.pk-spreadsheet-preview__head{padding:var(--spacing-4) var(--spacing-4) var(--spacing-2);vertical-align:middle;line-height:1;top:0}.pk-spreadsheet-preview__row{vertical-align:middle}.pk-spreadsheet-preview__corner{--pk-spreadsheet-lines:inset 0 0 0 var(--border) var(--color-surface-3);z-index:5;left:0}.pk-spreadsheet-preview__head{--pk-spreadsheet-lines:inset 0 var(--border) 0 var(--color-surface-3), inset calc(var(--border) * -1) calc(var(--border) * -1) 0 var(--color-surface-3)}.pk-spreadsheet-preview__row{--pk-spreadsheet-lines:inset var(--border) 0 0 var(--color-surface-3), inset calc(var(--border) * -1) calc(var(--border) * -1) 0 var(--color-surface-3);padding:0 var(--spacing-4);font-variant-numeric:tabular-nums;left:0}.pk-spreadsheet-preview__head--current{background-color:var(--color-surface-2);box-shadow:var(--pk-spreadsheet-lines), inset 0 calc((var(--spacing-2) + var(--border)) * -1) 0 var(--pk-spreadsheet-green-head);color:var(--pk-spreadsheet-green-head);font-weight:var(--font-medium)}.pk-spreadsheet-preview__row--current{background-color:var(--color-surface-2);box-shadow:var(--pk-spreadsheet-lines), inset calc((var(--spacing-2) + var(--border)) * -1) 0 0 var(--pk-spreadsheet-green-head);color:var(--pk-spreadsheet-green-head);font-weight:var(--font-medium)}.pk-spreadsheet-preview__cell[data-focus]{scroll-margin-top:var(--pk-spreadsheet-stuck-top);scroll-margin-left:var(--pk-spreadsheet-stuck-left);outline:var(--spacing-2) solid var(--pk-spreadsheet-green);outline-offset:calc(var(--spacing-2) * -1)}.pk-spreadsheet-preview__cell--range{background-image:linear-gradient(#1f1d2b1f,#1f1d2b1f)}.pk-spreadsheet-preview__cell--missing{color:#6b6880}.pk-spreadsheet-preview__cell--marked{background-image:linear-gradient(var(--pk-spreadsheet-mark), var(--pk-spreadsheet-mark));animation:pk-spreadsheet-preview-marked 3.5s var(--ease-out) forwards}@media (prefers-reduced-motion:reduce){.pk-spreadsheet-preview__cell--marked{--pk-spreadsheet-mark:#facc1573;animation:none}}.pk-spreadsheet-preview__more{padding:var(--spacing-8) var(--spacing-12);color:#6b6880;font-size:var(--text-12);margin:0;position:sticky;left:0}.pk-spreadsheet-preview__sheets{min-height:var(--spacing-32);padding-left:var(--spacing-40);border-top:var(--border) solid var(--color-surface-3);background-color:var(--color-surface-1);flex-shrink:0;display:flex;overflow-x:auto}@media (pointer:coarse){.pk-spreadsheet-preview__sheets{min-height:var(--spacing-40)}}.pk-spreadsheet-preview__status{min-height:var(--spacing-40);border-top:var(--border) solid var(--color-surface-3);background-color:var(--color-surface-1);font-size:var(--text-12);flex-shrink:0;align-items:center;display:flex}.pk-spreadsheet-preview__sheet{padding:0 var(--spacing-16);border:0;border-right:var(--border) solid var(--color-surface-3);color:var(--color-word-2);font:inherit;font-size:var(--text-12);white-space:nowrap;cursor:pointer;background:0 0;flex-shrink:0}.pk-spreadsheet-preview__sheet:first-child{border-left:var(--border) solid var(--color-surface-3)}.pk-spreadsheet-preview__sheet:hover{background-color:var(--color-surface-2)}.pk-spreadsheet-preview__sheet[aria-current=page]{background-color:var(--color-surface);box-shadow:inset 0 calc(var(--spacing-2) * -1) 0 var(--pk-spreadsheet-green-head);color:var(--pk-spreadsheet-green-head);font-weight:var(--font-semibold)}.pk-spreadsheet-preview__info{align-items:center;gap:var(--spacing-16);min-width:0;padding:0 var(--spacing-12);color:var(--color-word-2);font-variant-numeric:tabular-nums;white-space:nowrap;flex:1;margin:0;display:flex;overflow:hidden}.pk-spreadsheet-preview__note{min-width:0;color:var(--color-word-3);text-overflow:ellipsis;overflow:hidden}.pk-spreadsheet-preview__stats{gap:var(--spacing-12);flex-shrink:0;margin-left:auto;display:flex}@container (width<26rem){.pk-spreadsheet-preview__average{display:none}}.pk-spreadsheet-preview__zoom{align-items:center;gap:var(--spacing-2);padding-right:var(--spacing-8);flex-shrink:0;display:flex}.pk-spreadsheet-preview__percent{min-width:var(--spacing-40);font-variant-numeric:tabular-nums;text-align:center}@media (prefers-color-scheme:dark){:where(:host,:root,.theme):not(.theme--light) .pk-spreadsheet-preview{--pk-spreadsheet-green-head:#5fbf8f}}:where(.theme.theme--dark) .pk-spreadsheet-preview{--pk-spreadsheet-green-head:#5fbf8f}@property --pk-spreadsheet-mark{syntax:\"<color>\";inherits:false;initial-value:#0000}@keyframes pk-spreadsheet-preview-marked{0%,30%{--pk-spreadsheet-mark:#facc1573}to{--pk-spreadsheet-mark:#facc1500}}"]]]);
|
|
619
619
|
// ../../packages/components/src/chat/PkWordPreviewRuns.vue?vue&type=script&setup=true&lang.ts
|
|
620
620
|
x(), f(), C();
|
|
621
|
-
var
|
|
621
|
+
var Xe = ["src"], Ze = {
|
|
622
622
|
key: 1,
|
|
623
623
|
class: "pk-word-preview__image",
|
|
624
624
|
"data-quote-skip": ""
|
|
625
|
-
},
|
|
625
|
+
}, Qe = ["title"], $e = ["title"], et = ["data-quote-skip"], J = /* @__PURE__ */ E({
|
|
626
626
|
__name: "PkWordPreviewRuns",
|
|
627
627
|
props: {
|
|
628
628
|
runs: { type: Array },
|
|
@@ -631,13 +631,13 @@ var Ye = ["src"], Xe = {
|
|
|
631
631
|
numbers: { type: Object }
|
|
632
632
|
},
|
|
633
633
|
setup(e) {
|
|
634
|
-
let n = e, { t: i } =
|
|
634
|
+
let n = e, { t: i } = re({ useScope: "global" }), a = t(I, void 0), o = (e) => e.picture ? ae(a?.value, e.picture.ref) : void 0, s = (e) => n.page ? L(e) : "inline", c = (e) => {
|
|
635
635
|
let t = {
|
|
636
636
|
width: `${e.width}pt`,
|
|
637
637
|
aspectRatio: `${e.width} / ${e.height}`
|
|
638
638
|
}, r = e.anchor, i = n.page;
|
|
639
639
|
if (!r || !i) return t;
|
|
640
|
-
let a = r.xFrom === "page" ? r.x - i.margins.left : r.x, o =
|
|
640
|
+
let a = r.xFrom === "page" ? r.x - i.margins.left : r.x, o = L(e);
|
|
641
641
|
if (o === "around") {
|
|
642
642
|
let n = i.width - i.margins.left - i.margins.right, o = a + e.width / 2 < n / 2;
|
|
643
643
|
return {
|
|
@@ -659,11 +659,11 @@ var Ye = ["src"], Xe = {
|
|
|
659
659
|
zIndex: r.wrap === "behind" ? -1 : 1
|
|
660
660
|
};
|
|
661
661
|
}, u = (e) => e.field && n.numbers ? String(n.numbers[e.field]) : e.text, d = b(() => {
|
|
662
|
-
let e =
|
|
662
|
+
let e = se(n.runs, n.mode ?? "markup"), t = (e) => !!e.picture && !!n.page && ["around", "block"].includes(L(e.picture));
|
|
663
663
|
return [...e.filter(t), ...e.filter((e) => !t(e))];
|
|
664
664
|
}), f = b(() => !n.mode || n.mode === "markup"), m = (e) => {
|
|
665
665
|
let t = {};
|
|
666
|
-
e.font && (t.fontFamily =
|
|
666
|
+
e.font && (t.fontFamily = ie(e.font)), t.fontSize = e.size ? `${e.size}pt` : "var(--pk-word-size)", e.color && (t.color = e.color), e.highlight && (t.backgroundColor = e.highlight), e.bold && (t.fontWeight = 700), e.italic && (t.fontStyle = "italic");
|
|
667
667
|
let n = [e.underline ? "underline" : "", e.strike ? "line-through" : ""].filter(Boolean).join(" ");
|
|
668
668
|
return n && (t.textDecoration = n), e.caps && (t.textTransform = "uppercase"), e.vertAlign && (t.verticalAlign = e.vertAlign, t.fontSize = `${(e.size ?? 11) * .65}pt`), t;
|
|
669
669
|
}, h = (e) => {
|
|
@@ -673,37 +673,37 @@ var Ye = ["src"], Xe = {
|
|
|
673
673
|
textDecoration: [...n].join(" ")
|
|
674
674
|
};
|
|
675
675
|
}, g = (e) => e.author ? i("chatFilePreview.revisionBy", { author: e.author }) : void 0;
|
|
676
|
-
return (e, t) => (
|
|
676
|
+
return (e, t) => (A(!0), k(_, null, p(d.value, (e, t) => (A(), k(_, { key: t }, [e.image ? (A(), k(_, { key: 0 }, [e.picture && o(e) ? (A(), k(_, { key: 0 }, [s(e.picture) === "page" ? T("", !0) : (A(), k("img", {
|
|
677
677
|
key: 0,
|
|
678
678
|
class: r(["pk-word-preview__picture", `pk-word-preview__picture--${s(e.picture)}`]),
|
|
679
679
|
style: l(c(e.picture)),
|
|
680
680
|
src: o(e),
|
|
681
681
|
alt: ""
|
|
682
|
-
}, null, 14,
|
|
682
|
+
}, null, 14, Xe))], 64)) : (A(), k("span", Ze, S(D(i)("chatFilePreview.image")), 1))], 64)) : f.value && e.change === "deleted" ? (A(), k("del", {
|
|
683
683
|
key: 1,
|
|
684
684
|
class: "pk-word-preview__removed",
|
|
685
685
|
"data-quote-skip": "",
|
|
686
686
|
style: l(h(e)),
|
|
687
687
|
title: g(e)
|
|
688
|
-
}, S(u(e)), 13,
|
|
688
|
+
}, S(u(e)), 13, Qe)) : f.value && e.change === "inserted" ? (A(), k("ins", {
|
|
689
689
|
key: 2,
|
|
690
690
|
class: "pk-word-preview__added",
|
|
691
691
|
style: l(h(e)),
|
|
692
692
|
title: g(e)
|
|
693
|
-
}, S(u(e)), 13,
|
|
693
|
+
}, S(u(e)), 13, $e)) : (A(), k("span", {
|
|
694
694
|
key: 3,
|
|
695
695
|
style: l(m(e)),
|
|
696
696
|
"data-quote-skip": e.label ? "" : void 0
|
|
697
|
-
}, S(u(e)), 13,
|
|
697
|
+
}, S(u(e)), 13, et))], 64))), 128));
|
|
698
698
|
}
|
|
699
699
|
});
|
|
700
700
|
// ../../packages/components/src/chat/PkWordPreviewBlock.vue?vue&type=script&setup=true&lang.ts
|
|
701
701
|
x(), f();
|
|
702
|
-
var
|
|
702
|
+
var Y = { key: 0 }, X = ["data-paragraph", "colspan"], tt = [
|
|
703
703
|
"data-paragraph",
|
|
704
704
|
"role",
|
|
705
705
|
"aria-level"
|
|
706
|
-
],
|
|
706
|
+
], nt = { key: 1 }, rt = /* @__PURE__ */ E({
|
|
707
707
|
__name: "PkWordPreviewBlock",
|
|
708
708
|
props: {
|
|
709
709
|
block: { type: null },
|
|
@@ -737,17 +737,17 @@ var X = { key: 0 }, Z = ["data-paragraph", "colspan"], et = [
|
|
|
737
737
|
let e = t.block.widths ?? [], n = e.reduce((e, t) => e + t, 0);
|
|
738
738
|
return n ? e.map((e) => `${e / n * 100}%`) : [];
|
|
739
739
|
}), c = b(() => t.block.kind !== "table" && !!t.block.id && !!t.marked?.has(t.block.id)), u = (e) => !!e?.some((e) => t.marked?.has(e)), f = b(() => t.mode === "markup" && !!o.value?.some((e) => e.runs.some((e) => e.change)));
|
|
740
|
-
return (t, m) => e.block.kind === "table" && o.value ? (
|
|
740
|
+
return (t, m) => e.block.kind === "table" && o.value ? (A(), k("table", {
|
|
741
741
|
key: 0,
|
|
742
742
|
class: r(["pk-word-preview__table", {
|
|
743
743
|
"pk-word-preview__table--lines": e.block.borders,
|
|
744
744
|
"pk-word-preview__table--next": e.row !== 0,
|
|
745
745
|
"pk-word-preview__changed": f.value
|
|
746
746
|
}])
|
|
747
|
-
}, [s.value.length ? (
|
|
747
|
+
}, [s.value.length ? (A(), k("colgroup", Y, [(A(!0), k(_, null, p(s.value, (e, t) => (A(), k("col", {
|
|
748
748
|
key: t,
|
|
749
749
|
style: l({ width: e })
|
|
750
|
-
}, null, 4))), 128))])) : T("", !0), v("tbody", null, [v("tr", null, [(
|
|
750
|
+
}, null, 4))), 128))])) : T("", !0), v("tbody", null, [v("tr", null, [(A(!0), k(_, null, p(o.value, (t, n) => (A(), k("td", {
|
|
751
751
|
key: n,
|
|
752
752
|
"data-paragraph": t.ids?.join(" "),
|
|
753
753
|
class: r({ "pk-word-preview__marked": u(t.ids) }),
|
|
@@ -757,7 +757,7 @@ var X = { key: 0 }, Z = ["data-paragraph", "colspan"], et = [
|
|
|
757
757
|
textAlign: t.align,
|
|
758
758
|
fontSize: t.size ? `${t.size}pt` : void 0
|
|
759
759
|
})
|
|
760
|
-
}, [d(
|
|
760
|
+
}, [d(J, {
|
|
761
761
|
runs: t.runs,
|
|
762
762
|
mode: e.mode,
|
|
763
763
|
numbers: e.numbers
|
|
@@ -765,7 +765,7 @@ var X = { key: 0 }, Z = ["data-paragraph", "colspan"], et = [
|
|
|
765
765
|
"runs",
|
|
766
766
|
"mode",
|
|
767
767
|
"numbers"
|
|
768
|
-
])], 14,
|
|
768
|
+
])], 14, X))), 128))])])], 2)) : e.block.kind === "table" ? T("", !0) : (A(), k("div", {
|
|
769
769
|
key: 1,
|
|
770
770
|
class: r(["pk-word-preview__block", {
|
|
771
771
|
"pk-word-preview__changed": a.value,
|
|
@@ -776,13 +776,13 @@ var X = { key: 0 }, Z = ["data-paragraph", "colspan"], et = [
|
|
|
776
776
|
"aria-level": e.block.kind === "heading" ? Math.max(1, e.block.level) : void 0,
|
|
777
777
|
style: l(n.value)
|
|
778
778
|
}, [
|
|
779
|
-
e.block.label ? (
|
|
779
|
+
e.block.label ? (A(), k("span", {
|
|
780
780
|
key: 0,
|
|
781
781
|
class: "pk-word-preview__label",
|
|
782
782
|
"data-quote-skip": "",
|
|
783
783
|
style: l(i.value)
|
|
784
784
|
}, S(e.block.label), 5)) : T("", !0),
|
|
785
|
-
d(
|
|
785
|
+
d(J, {
|
|
786
786
|
runs: e.block.runs,
|
|
787
787
|
mode: e.mode,
|
|
788
788
|
page: e.page,
|
|
@@ -793,13 +793,13 @@ var X = { key: 0 }, Z = ["data-paragraph", "colspan"], et = [
|
|
|
793
793
|
"page",
|
|
794
794
|
"numbers"
|
|
795
795
|
]),
|
|
796
|
-
!e.block.label && !e.block.runs.length ? (
|
|
797
|
-
], 14,
|
|
796
|
+
!e.block.label && !e.block.runs.length ? (A(), k("br", nt)) : T("", !0)
|
|
797
|
+
], 14, tt));
|
|
798
798
|
}
|
|
799
799
|
});
|
|
800
800
|
// ../../packages/components/src/chat/PkWordPreviewPart.vue?vue&type=script&setup=true&lang.ts
|
|
801
801
|
x(), f();
|
|
802
|
-
var
|
|
802
|
+
var it = { class: "pk-word-preview__part" }, Z = ["src"], at = /* @__PURE__ */ E({
|
|
803
803
|
__name: "PkWordPreviewPart",
|
|
804
804
|
props: {
|
|
805
805
|
blocks: { type: Array },
|
|
@@ -809,11 +809,11 @@ var rt = { class: "pk-word-preview__part" }, Q = ["src"], it = /* @__PURE__ */ E
|
|
|
809
809
|
numbers: { type: Object }
|
|
810
810
|
},
|
|
811
811
|
setup(e) {
|
|
812
|
-
let n = e, r = t(I, void 0), i = b(() =>
|
|
813
|
-
let t =
|
|
812
|
+
let n = e, r = t(I, void 0), i = b(() => F(n.blocks, n.mode)), a = b(() => oe(n.blocks, n.mode).flatMap((e) => {
|
|
813
|
+
let t = ae(r?.value, e.ref);
|
|
814
814
|
return t ? [{
|
|
815
815
|
src: t,
|
|
816
|
-
css:
|
|
816
|
+
css: P(e, n.section.page)
|
|
817
817
|
}] : [];
|
|
818
818
|
})), o = b(() => {
|
|
819
819
|
let { margins: e } = n.section.page;
|
|
@@ -823,10 +823,10 @@ var rt = { class: "pk-word-preview__part" }, Q = ["src"], it = /* @__PURE__ */ E
|
|
|
823
823
|
...n.where === "header" ? { top: `${n.section.headerDistance}pt` } : { bottom: `${n.section.footerDistance}pt` }
|
|
824
824
|
};
|
|
825
825
|
});
|
|
826
|
-
return (t, n) => (
|
|
826
|
+
return (t, n) => (A(), k("div", it, [v("div", {
|
|
827
827
|
class: "pk-word-preview__part-flow",
|
|
828
828
|
style: l(o.value)
|
|
829
|
-
}, [(
|
|
829
|
+
}, [(A(!0), k(_, null, p(i.value, (t) => (A(), h(rt, {
|
|
830
830
|
key: t.key,
|
|
831
831
|
block: e.blocks[t.block],
|
|
832
832
|
row: t.row,
|
|
@@ -839,39 +839,39 @@ var rt = { class: "pk-word-preview__part" }, Q = ["src"], it = /* @__PURE__ */ E
|
|
|
839
839
|
"mode",
|
|
840
840
|
"page",
|
|
841
841
|
"numbers"
|
|
842
|
-
]))), 128))], 4), (
|
|
842
|
+
]))), 128))], 4), (A(!0), k(_, null, p(a.value, (e, t) => (A(), k("img", {
|
|
843
843
|
key: t,
|
|
844
844
|
class: "pk-word-preview__float",
|
|
845
845
|
style: l(e.css),
|
|
846
846
|
src: e.src,
|
|
847
847
|
alt: ""
|
|
848
|
-
}, null, 12,
|
|
848
|
+
}, null, 12, Z))), 128))]));
|
|
849
849
|
}
|
|
850
850
|
});
|
|
851
851
|
// ../../packages/components/src/chat/PkWordPreview.vue?vue&type=script&setup=true&lang.ts
|
|
852
852
|
x(), C(), f();
|
|
853
|
-
var
|
|
853
|
+
var ot = ["aria-label"], st = {
|
|
854
854
|
class: "pk-word-preview__tabs",
|
|
855
855
|
role: "tablist"
|
|
856
|
-
},
|
|
856
|
+
}, ct = ["aria-selected"], lt = ["aria-selected"], ut = {
|
|
857
857
|
key: 0,
|
|
858
858
|
class: "pk-word-preview__list"
|
|
859
|
-
},
|
|
859
|
+
}, Q = ["aria-current", "onClick"], dt = { class: "pk-word-preview__entry-text" }, ft = {
|
|
860
860
|
key: 0,
|
|
861
861
|
class: "u-dot"
|
|
862
|
-
},
|
|
862
|
+
}, pt = {
|
|
863
863
|
key: 0,
|
|
864
864
|
class: "pk-word-preview__none"
|
|
865
|
-
},
|
|
865
|
+
}, mt = {
|
|
866
866
|
key: 1,
|
|
867
867
|
class: "pk-word-preview__list"
|
|
868
|
-
},
|
|
868
|
+
}, ht = ["onClick"], gt = {
|
|
869
869
|
key: 0,
|
|
870
870
|
class: "pk-word-preview__removed"
|
|
871
|
-
},
|
|
871
|
+
}, _t = {
|
|
872
872
|
key: 1,
|
|
873
873
|
class: "pk-word-preview__added"
|
|
874
|
-
},
|
|
874
|
+
}, vt = { class: "pk-word-preview__main" }, yt = ["aria-label"], $ = ["src"], bt = {
|
|
875
875
|
key: 2,
|
|
876
876
|
class: "pk-word-preview__truncated"
|
|
877
877
|
}, xt = { class: "pk-word-preview__status" }, St = {
|
|
@@ -880,7 +880,7 @@ var at = ["aria-label"], ot = {
|
|
|
880
880
|
}, Ct = { class: "pk-word-preview__count" }, wt = {
|
|
881
881
|
key: 1,
|
|
882
882
|
class: "pk-word-preview__legend"
|
|
883
|
-
}, Tt = ["title"], Et = { class: "pk-word-preview__removed" }, Dt = { class: "pk-word-preview__added" }, Ot = { class: "pk-word-preview__percent" }, kt = ["data-part"], At = 96 / 72, jt = .5, Mt = /*#__PURE__*/
|
|
883
|
+
}, Tt = ["title"], Et = { class: "pk-word-preview__removed" }, Dt = { class: "pk-word-preview__added" }, Ot = { class: "pk-word-preview__percent" }, kt = ["data-part"], At = 96 / 72, jt = .5, Mt = /*#__PURE__*/ B(/* @__PURE__ */ E({
|
|
884
884
|
__name: "PkWordPreview",
|
|
885
885
|
props: /*@__PURE__*/ c({
|
|
886
886
|
preview: { type: null },
|
|
@@ -897,24 +897,24 @@ var at = ["aria-label"], ot = {
|
|
|
897
897
|
}),
|
|
898
898
|
emits: /*@__PURE__*/ c(["select"], ["update:fit", "update:zoom"]),
|
|
899
899
|
setup(e, { emit: t }) {
|
|
900
|
-
let c = e, f = t, { t: g } =
|
|
900
|
+
let c = e, f = t, { t: g } = re({ useScope: "global" });
|
|
901
901
|
n(I, b(() => c.preview.images));
|
|
902
|
-
let ee = (e) =>
|
|
902
|
+
let ee = (e) => se(e, c.mode), x = b(() => F(c.preview.blocks, c.mode)), C = m("rootEl"), w = m("scrollEl"), te = m("measureEl"), { width: ne } = le(C), { width: E } = le(w), O = b(() => ne.value >= 1e3), j = b(() => c.preview.sections?.length ? c.preview.sections : [{
|
|
903
903
|
page: c.preview.page,
|
|
904
904
|
headerDistance: 0,
|
|
905
905
|
footerDistance: 0,
|
|
906
906
|
headers: {},
|
|
907
907
|
footers: {}
|
|
908
|
-
}]),
|
|
909
|
-
fontFamily:
|
|
908
|
+
}]), M = b(() => j.value[0].page), N = b(() => (E.value - 48) / (M.value.width * At)), L = b(() => ne.value === 0 || E.value === 0 || N.value >= jt), R = b(() => ({
|
|
909
|
+
fontFamily: ie(c.preview.defaults.font),
|
|
910
910
|
fontSize: `${c.preview.defaults.size}pt`,
|
|
911
911
|
color: c.preview.defaults.color ?? "#000000",
|
|
912
|
-
"--pk-word-line":
|
|
912
|
+
"--pk-word-line": ce(c.preview.defaults.font),
|
|
913
913
|
"--pk-word-size": `${c.preview.defaults.size}pt`
|
|
914
|
-
})),
|
|
915
|
-
...
|
|
916
|
-
width: `${
|
|
917
|
-
})),
|
|
914
|
+
})), ue = b(() => M.value.width - M.value.margins.left - M.value.margins.right), z = b(() => ({
|
|
915
|
+
...R.value,
|
|
916
|
+
width: `${ue.value}pt`
|
|
917
|
+
})), me = m("flowEl"), { width: B } = le(me), he = b(() => {
|
|
918
918
|
let e = /* @__PURE__ */ new Map(), t = 0;
|
|
919
919
|
for (let n of c.preview.blocks) {
|
|
920
920
|
if (n.kind === "table") continue;
|
|
@@ -927,37 +927,37 @@ var at = ["aria-label"], ot = {
|
|
|
927
927
|
let n = 0;
|
|
928
928
|
for (let [r, i] of [...e].sort((e, t) => e[0] - t[0])) if (n += i, n > t / 10) return r;
|
|
929
929
|
return 0;
|
|
930
|
-
}),
|
|
931
|
-
...
|
|
932
|
-
"--pk-word-indent-shared": `${
|
|
933
|
-
"--pk-word-indent-scale":
|
|
934
|
-
})),
|
|
930
|
+
}), ge = b(() => ({
|
|
931
|
+
...R.value,
|
|
932
|
+
"--pk-word-indent-shared": `${he.value}pt`,
|
|
933
|
+
"--pk-word-indent-scale": B.value ? Math.min(1, B.value / (ue.value * At)) : 1
|
|
934
|
+
})), V = y([]), _e = y({}), ve = async () => {
|
|
935
935
|
await i();
|
|
936
936
|
let e = te.value?.querySelectorAll("[data-item]");
|
|
937
|
-
|
|
937
|
+
V.value = [...e ?? []].map((e) => e.getBoundingClientRect().height);
|
|
938
938
|
let t = te.value?.querySelectorAll("[data-part]");
|
|
939
|
-
|
|
939
|
+
_e.value = Object.fromEntries([...t ?? []].map((e) => [e.dataset.part ?? "", e.getBoundingClientRect().height]));
|
|
940
940
|
};
|
|
941
941
|
u([
|
|
942
942
|
x,
|
|
943
|
-
|
|
943
|
+
L,
|
|
944
944
|
() => c.preview.parts
|
|
945
|
-
],
|
|
946
|
-
|
|
945
|
+
], ve, { flush: "post" }), s(() => {
|
|
946
|
+
ve(), document.fonts?.ready.then(ve);
|
|
947
947
|
});
|
|
948
|
-
let
|
|
949
|
-
if (!
|
|
948
|
+
let H = b(() => {
|
|
949
|
+
if (!L.value || V.value.length !== x.value.length) return [{
|
|
950
950
|
items: x.value.map((e, t) => t),
|
|
951
951
|
section: 0,
|
|
952
952
|
number: 1,
|
|
953
|
-
top:
|
|
954
|
-
bottom:
|
|
953
|
+
top: M.value.margins.top,
|
|
954
|
+
bottom: M.value.margins.bottom
|
|
955
955
|
}];
|
|
956
956
|
let e = [], t = 0, n = !0, r = 0, i, a = () => {
|
|
957
|
-
let r =
|
|
957
|
+
let r = j.value[t];
|
|
958
958
|
return n && r.pageStart !== void 0 ? r.pageStart : (i ?? e[e.length - 1]?.number ?? 0) + 1;
|
|
959
959
|
}, o = (e) => {
|
|
960
|
-
let r =
|
|
960
|
+
let r = j.value[t], i = (t) => n && r.titlePage ? t.first : c.preview.evenAndOddHeaders && e % 2 == 0 ? t.even : t.default, a = i(r.headers), o = i(r.footers), s = (e) => e ? (_e.value[e] ?? 0) / At : 0;
|
|
961
961
|
return {
|
|
962
962
|
header: a,
|
|
963
963
|
footer: o,
|
|
@@ -974,42 +974,42 @@ var at = ["aria-label"], ot = {
|
|
|
974
974
|
}), n = !1, r = 0;
|
|
975
975
|
};
|
|
976
976
|
return x.value.forEach((c, l) => {
|
|
977
|
-
c.section !== void 0 && c.section !== t &&
|
|
978
|
-
let u = e[e.length - 1], d = u &&
|
|
979
|
-
for (let e = l; x.value[e]?.keepNext && e + 1 < x.value.length && !x.value[e + 1].breakBefore; e++) p +=
|
|
980
|
-
(!u || u.items.length && (c.breakBefore || r +
|
|
977
|
+
c.section !== void 0 && c.section !== t && j.value[c.section] && (t = c.section, n = c.breakBefore || !e.length, n || (i = j.value[t].pageStart));
|
|
978
|
+
let u = e[e.length - 1], d = u && j.value[u.section].page, f = d ? (d.height - u.top - u.bottom) * At : 0, p = V.value[l];
|
|
979
|
+
for (let e = l; x.value[e]?.keepNext && e + 1 < x.value.length && !x.value[e + 1].breakBefore; e++) p += V.value[e + 1];
|
|
980
|
+
(!u || u.items.length && (c.breakBefore || r + V.value[l] > f || r + p > f && p <= (() => {
|
|
981
981
|
let e = o(a());
|
|
982
|
-
return (
|
|
983
|
-
})())) && s(), e[e.length - 1].items.push(l), r +=
|
|
982
|
+
return (j.value[t].page.height - e.top - e.bottom) * At;
|
|
983
|
+
})())) && s(), e[e.length - 1].items.push(l), r += V.value[l];
|
|
984
984
|
}), e.length || s(), e;
|
|
985
|
-
}),
|
|
985
|
+
}), U = b(() => {
|
|
986
986
|
let e = /* @__PURE__ */ new Map();
|
|
987
|
-
for (let t of
|
|
988
|
-
return
|
|
987
|
+
for (let t of H.value) e.set(t.section, (e.get(t.section) ?? 0) + 1);
|
|
988
|
+
return H.value.map((t) => ({
|
|
989
989
|
page: t.number,
|
|
990
|
-
pages:
|
|
990
|
+
pages: H.value.length,
|
|
991
991
|
sectionPages: e.get(t.section) ?? 1
|
|
992
992
|
}));
|
|
993
|
-
}),
|
|
994
|
-
let t =
|
|
993
|
+
}), W = (e) => {
|
|
994
|
+
let t = j.value[e.section].page;
|
|
995
995
|
return {
|
|
996
|
-
...
|
|
996
|
+
...R.value,
|
|
997
997
|
width: `${t.width}pt`,
|
|
998
998
|
minHeight: `${t.height}pt`,
|
|
999
999
|
padding: `${e.top}pt ${t.margins.right}pt ${e.bottom}pt ${t.margins.left}pt`
|
|
1000
1000
|
};
|
|
1001
|
-
},
|
|
1001
|
+
}, ye = (e) => {
|
|
1002
1002
|
let t = [...new Set(e.items.map((e) => x.value[e].block))];
|
|
1003
|
-
return
|
|
1004
|
-
let n =
|
|
1003
|
+
return oe(t.map((e) => c.preview.blocks[e]), c.mode).flatMap((t) => {
|
|
1004
|
+
let n = ae(c.preview.images, t.ref);
|
|
1005
1005
|
return n ? [{
|
|
1006
1006
|
src: n,
|
|
1007
|
-
css:
|
|
1007
|
+
css: P(t, j.value[e.section].page)
|
|
1008
1008
|
}] : [];
|
|
1009
1009
|
});
|
|
1010
|
-
},
|
|
1011
|
-
|
|
1012
|
-
},
|
|
1010
|
+
}, G = o(e, "fit"), be = o(e, "zoom"), K = b(() => G.value ? Math.min(1.25, Math.max(.3, N.value)) : be.value), xe = (e) => {
|
|
1011
|
+
be.value = Math.min(2, Math.max(.3, Math.round((K.value + e) * 10) / 10)), G.value = !1;
|
|
1012
|
+
}, Se = y(0), we = y(), Te = () => {
|
|
1013
1013
|
let e = w.value?.getBoundingClientRect();
|
|
1014
1014
|
if (!e) return;
|
|
1015
1015
|
let t = w.value?.querySelectorAll("[data-page]") ?? [], n = 0;
|
|
@@ -1017,133 +1017,133 @@ var at = ["aria-label"], ot = {
|
|
|
1017
1017
|
if (i.getBoundingClientRect().top - e.top > e.height / 3) break;
|
|
1018
1018
|
n = r;
|
|
1019
1019
|
}
|
|
1020
|
-
|
|
1020
|
+
Se.value = n;
|
|
1021
1021
|
let r;
|
|
1022
|
-
for (let t of
|
|
1022
|
+
for (let t of Ae.value) {
|
|
1023
1023
|
let n = w.value?.querySelector(`[data-key="${t.key}"]`);
|
|
1024
1024
|
if (n) {
|
|
1025
1025
|
if (n.getBoundingClientRect().top - e.top > 48) break;
|
|
1026
1026
|
r = t.key;
|
|
1027
1027
|
}
|
|
1028
1028
|
}
|
|
1029
|
-
|
|
1030
|
-
},
|
|
1031
|
-
|
|
1032
|
-
|
|
1029
|
+
we.value = r ?? Ae.value[0]?.key;
|
|
1030
|
+
}, Ee = 0, De = () => {
|
|
1031
|
+
Ee ||= requestAnimationFrame(() => {
|
|
1032
|
+
Ee = 0, Te();
|
|
1033
1033
|
});
|
|
1034
1034
|
};
|
|
1035
|
-
a(() => cancelAnimationFrame(
|
|
1036
|
-
let { selection:
|
|
1035
|
+
a(() => cancelAnimationFrame(Ee)), u(H, () => i(De));
|
|
1036
|
+
let { selection: Oe } = fe({
|
|
1037
1037
|
root: () => w.value?.getRootNode(),
|
|
1038
1038
|
touch: !0
|
|
1039
1039
|
});
|
|
1040
|
-
u(
|
|
1040
|
+
u(Oe, (e) => {
|
|
1041
1041
|
let t = w.value;
|
|
1042
|
-
f("select", e && t ?
|
|
1042
|
+
f("select", e && t ? Ce(t, e.range, ".pk-word-preview__measure, .pk-word-preview__part") : void 0);
|
|
1043
1043
|
});
|
|
1044
|
-
let
|
|
1045
|
-
let t = c.preview.blocks[e.block], n = t.kind === "heading" ? [t.label,
|
|
1044
|
+
let ke = (e) => ee(e).map((e) => e.text).join("").replace(/\s+/g, " ").trim(), Ae = b(() => x.value.flatMap((e) => {
|
|
1045
|
+
let t = c.preview.blocks[e.block], n = t.kind === "heading" ? [t.label, ke(t.runs)].filter(Boolean).join(" ") : "";
|
|
1046
1046
|
return t.kind === "heading" && t.level <= 3 && n ? [{
|
|
1047
1047
|
key: e.key,
|
|
1048
1048
|
level: t.level,
|
|
1049
1049
|
text: n
|
|
1050
1050
|
}] : [];
|
|
1051
|
-
})),
|
|
1051
|
+
})), je = (e) => e.length > 60 ? `${e.slice(0, 60)}…` : e, q = b(() => x.value.flatMap((e) => {
|
|
1052
1052
|
let t = c.preview.blocks[e.block], n = t.kind === "table" ? (t.rows[e.row ?? 0] ?? []).flatMap((e) => e.runs) : t.runs, r = n.filter((e) => e.change === "deleted").map((e) => e.text).join(" ").trim(), i = n.filter((e) => e.change === "inserted").map((e) => e.text).join(" ").trim();
|
|
1053
1053
|
return r || i ? [{
|
|
1054
1054
|
key: e.key,
|
|
1055
|
-
removed:
|
|
1056
|
-
added:
|
|
1055
|
+
removed: je(r),
|
|
1056
|
+
added: je(i)
|
|
1057
1057
|
}] : [];
|
|
1058
|
-
})),
|
|
1059
|
-
u([() => c.marked,
|
|
1060
|
-
!e || e ===
|
|
1058
|
+
})), Me;
|
|
1059
|
+
u([() => c.marked, H], ([e]) => {
|
|
1060
|
+
!e || e === Me || L.value && V.value.length !== x.value.length || pe(w.value, ".pk-word-preview__marked") && (Me = e);
|
|
1061
1061
|
}, {
|
|
1062
1062
|
flush: "post",
|
|
1063
1063
|
immediate: !0
|
|
1064
1064
|
});
|
|
1065
|
-
let
|
|
1065
|
+
let Ne = y("outline"), Pe = y(!1), Fe = (e) => {
|
|
1066
1066
|
w.value?.querySelector(`[data-key="${e}"]`)?.scrollIntoView({
|
|
1067
1067
|
block: "start",
|
|
1068
1068
|
behavior: "smooth"
|
|
1069
|
-
}),
|
|
1070
|
-
},
|
|
1069
|
+
}), O.value || (Pe.value = !1);
|
|
1070
|
+
}, Ie = b(() => c.preview.blocks.flatMap((e) => e.kind === "table" ? e.rows.flat().map((e) => ke(e.runs)) : [ke(e.runs)]).join(" ").split(/\s+/).filter(Boolean).length), Le = b(() => c.preview.revisionAuthors.join(", "));
|
|
1071
1071
|
return (t, n) => {
|
|
1072
|
-
let i =
|
|
1073
|
-
return
|
|
1072
|
+
let i = de;
|
|
1073
|
+
return A(), k("div", {
|
|
1074
1074
|
ref_key: "rootEl",
|
|
1075
1075
|
ref: C,
|
|
1076
|
-
class: r(["pk-word-preview", { "pk-word-preview--paged":
|
|
1076
|
+
class: r(["pk-word-preview", { "pk-word-preview--paged": L.value }])
|
|
1077
1077
|
}, [
|
|
1078
|
-
(
|
|
1078
|
+
(O.value || Pe.value) && (Ae.value.length || q.value.length) ? (A(), k("aside", {
|
|
1079
1079
|
key: 0,
|
|
1080
|
-
class: r(["pk-word-preview__side", { "pk-word-preview__side--over": !
|
|
1080
|
+
class: r(["pk-word-preview__side", { "pk-word-preview__side--over": !O.value }]),
|
|
1081
1081
|
"aria-label": D(g)("chatFilePreview.outline")
|
|
1082
|
-
}, [v("div",
|
|
1082
|
+
}, [v("div", st, [v("button", {
|
|
1083
1083
|
type: "button",
|
|
1084
1084
|
role: "tab",
|
|
1085
1085
|
class: "pk-word-preview__tab",
|
|
1086
|
-
"aria-selected":
|
|
1087
|
-
onClick: n[0] ||= (e) =>
|
|
1088
|
-
}, S(D(g)("chatFilePreview.outline")), 9,
|
|
1086
|
+
"aria-selected": Ne.value === "outline",
|
|
1087
|
+
onClick: n[0] ||= (e) => Ne.value = "outline"
|
|
1088
|
+
}, S(D(g)("chatFilePreview.outline")), 9, ct), q.value.length ? (A(), k("button", {
|
|
1089
1089
|
key: 0,
|
|
1090
1090
|
type: "button",
|
|
1091
1091
|
role: "tab",
|
|
1092
1092
|
class: "pk-word-preview__tab",
|
|
1093
|
-
"aria-selected":
|
|
1094
|
-
onClick: n[1] ||= (e) =>
|
|
1095
|
-
}, S(D(g)("chatFilePreview.changes", { count:
|
|
1093
|
+
"aria-selected": Ne.value === "changes",
|
|
1094
|
+
onClick: n[1] ||= (e) => Ne.value = "changes"
|
|
1095
|
+
}, S(D(g)("chatFilePreview.changes", { count: q.value.length })), 9, lt)) : T("", !0)]), Ne.value === "outline" || !q.value.length ? (A(), k("nav", ut, [(A(!0), k(_, null, p(Ae.value, (e) => (A(), k("button", {
|
|
1096
1096
|
key: e.key,
|
|
1097
1097
|
type: "button",
|
|
1098
1098
|
class: r(["pk-word-preview__entry", `pk-word-preview__entry--${Math.min(e.level, 3)}`]),
|
|
1099
|
-
"aria-current":
|
|
1100
|
-
onClick: (t) =>
|
|
1101
|
-
}, [v("span",
|
|
1099
|
+
"aria-current": we.value === e.key ? "location" : void 0,
|
|
1100
|
+
onClick: (t) => Fe(e.key)
|
|
1101
|
+
}, [v("span", dt, S(e.text), 1), q.value.some((t) => t.key === e.key) ? (A(), k("span", ft)) : T("", !0)], 10, Q))), 128)), Ae.value.length ? T("", !0) : (A(), k("p", pt, S(D(g)("chatFilePreview.noHeadings")), 1))])) : (A(), k("nav", mt, [(A(!0), k(_, null, p(q.value, (e) => (A(), k("button", {
|
|
1102
1102
|
key: e.key,
|
|
1103
1103
|
type: "button",
|
|
1104
1104
|
class: "pk-word-preview__entry pk-word-preview__entry--change",
|
|
1105
|
-
onClick: (t) =>
|
|
1106
|
-
}, [e.removed ? (
|
|
1107
|
-
v("div",
|
|
1105
|
+
onClick: (t) => Fe(e.key)
|
|
1106
|
+
}, [e.removed ? (A(), k("del", gt, S(e.removed), 1)) : T("", !0), e.added ? (A(), k("ins", _t, S(e.added), 1)) : T("", !0)], 8, ht))), 128))]))], 10, ot)) : T("", !0),
|
|
1107
|
+
v("div", vt, [v("div", {
|
|
1108
1108
|
ref_key: "scrollEl",
|
|
1109
1109
|
ref: w,
|
|
1110
1110
|
class: "pk-word-preview__scroll",
|
|
1111
|
-
onScroll:
|
|
1112
|
-
}, [
|
|
1111
|
+
onScroll: De
|
|
1112
|
+
}, [L.value ? (A(), k("div", {
|
|
1113
1113
|
key: 0,
|
|
1114
1114
|
class: "pk-word-preview__pages",
|
|
1115
|
-
style: l({ zoom:
|
|
1116
|
-
}, [(
|
|
1115
|
+
style: l({ zoom: K.value })
|
|
1116
|
+
}, [(A(!0), k(_, null, p(H.value, (t, n) => (A(), k("article", {
|
|
1117
1117
|
key: n,
|
|
1118
1118
|
"data-page": "",
|
|
1119
1119
|
class: "pk-word-preview__page",
|
|
1120
1120
|
"aria-label": D(g)("chatFilePreview.pageOf", {
|
|
1121
1121
|
page: n + 1,
|
|
1122
|
-
count:
|
|
1122
|
+
count: H.value.length
|
|
1123
1123
|
}),
|
|
1124
|
-
style: l(
|
|
1124
|
+
style: l(W(t))
|
|
1125
1125
|
}, [
|
|
1126
|
-
t.header && e.preview.parts?.[t.header] ? (
|
|
1126
|
+
t.header && e.preview.parts?.[t.header] ? (A(), h(at, {
|
|
1127
1127
|
key: 0,
|
|
1128
1128
|
blocks: e.preview.parts[t.header],
|
|
1129
1129
|
where: "header",
|
|
1130
|
-
section:
|
|
1130
|
+
section: j.value[t.section],
|
|
1131
1131
|
mode: e.mode,
|
|
1132
|
-
numbers:
|
|
1132
|
+
numbers: U.value[n]
|
|
1133
1133
|
}, null, 8, [
|
|
1134
1134
|
"blocks",
|
|
1135
1135
|
"section",
|
|
1136
1136
|
"mode",
|
|
1137
1137
|
"numbers"
|
|
1138
1138
|
])) : T("", !0),
|
|
1139
|
-
(
|
|
1139
|
+
(A(!0), k(_, null, p(t.items, (r) => (A(), h(rt, {
|
|
1140
1140
|
key: x.value[r].key,
|
|
1141
1141
|
"data-key": x.value[r].key,
|
|
1142
1142
|
block: e.preview.blocks[x.value[r].block],
|
|
1143
1143
|
row: x.value[r].row,
|
|
1144
1144
|
mode: e.mode,
|
|
1145
|
-
page:
|
|
1146
|
-
numbers:
|
|
1145
|
+
page: j.value[t.section].page,
|
|
1146
|
+
numbers: U.value[n],
|
|
1147
1147
|
marked: e.marked
|
|
1148
1148
|
}, null, 8, [
|
|
1149
1149
|
"data-key",
|
|
@@ -1154,33 +1154,33 @@ var at = ["aria-label"], ot = {
|
|
|
1154
1154
|
"numbers",
|
|
1155
1155
|
"marked"
|
|
1156
1156
|
]))), 128)),
|
|
1157
|
-
(
|
|
1157
|
+
(A(!0), k(_, null, p(ye(t), (e, t) => (A(), k("img", {
|
|
1158
1158
|
key: `image-${t}`,
|
|
1159
1159
|
class: "pk-word-preview__float",
|
|
1160
1160
|
style: l(e.css),
|
|
1161
1161
|
src: e.src,
|
|
1162
1162
|
alt: ""
|
|
1163
|
-
}, null, 12,
|
|
1164
|
-
t.footer && e.preview.parts?.[t.footer] ? (
|
|
1163
|
+
}, null, 12, $))), 128)),
|
|
1164
|
+
t.footer && e.preview.parts?.[t.footer] ? (A(), h(at, {
|
|
1165
1165
|
key: 1,
|
|
1166
1166
|
blocks: e.preview.parts[t.footer],
|
|
1167
1167
|
where: "footer",
|
|
1168
|
-
section:
|
|
1168
|
+
section: j.value[t.section],
|
|
1169
1169
|
mode: e.mode,
|
|
1170
|
-
numbers:
|
|
1170
|
+
numbers: U.value[n]
|
|
1171
1171
|
}, null, 8, [
|
|
1172
1172
|
"blocks",
|
|
1173
1173
|
"section",
|
|
1174
1174
|
"mode",
|
|
1175
1175
|
"numbers"
|
|
1176
1176
|
])) : T("", !0)
|
|
1177
|
-
], 12,
|
|
1177
|
+
], 12, yt))), 128))], 4)) : (A(), k("article", {
|
|
1178
1178
|
key: 1,
|
|
1179
1179
|
ref_key: "flowEl",
|
|
1180
|
-
ref:
|
|
1180
|
+
ref: me,
|
|
1181
1181
|
class: "pk-word-preview__page pk-word-preview__page--flow",
|
|
1182
|
-
style: l(
|
|
1183
|
-
}, [(
|
|
1182
|
+
style: l(ge.value)
|
|
1183
|
+
}, [(A(!0), k(_, null, p(x.value, (t) => (A(), h(rt, {
|
|
1184
1184
|
key: t.key,
|
|
1185
1185
|
"data-key": t.key,
|
|
1186
1186
|
block: e.preview.blocks[t.block],
|
|
@@ -1193,22 +1193,22 @@ var at = ["aria-label"], ot = {
|
|
|
1193
1193
|
"row",
|
|
1194
1194
|
"mode",
|
|
1195
1195
|
"marked"
|
|
1196
|
-
]))), 128))], 4)), e.preview.truncated ? (
|
|
1197
|
-
|
|
1198
|
-
page:
|
|
1199
|
-
count:
|
|
1196
|
+
]))), 128))], 4)), e.preview.truncated ? (A(), k("p", bt, S(D(g)("chatFilePreview.truncated")), 1)) : T("", !0)], 544), v("div", xt, [
|
|
1197
|
+
L.value ? (A(), k("span", St, S(D(g)("chatFilePreview.pageOf", {
|
|
1198
|
+
page: Se.value + 1,
|
|
1199
|
+
count: H.value.length
|
|
1200
1200
|
})), 1)) : T("", !0),
|
|
1201
|
-
v("span", Ct, S(D(g)("chatFilePreview.words",
|
|
1202
|
-
e.mode === "markup" && e.preview.revisionAuthors.length ? (
|
|
1201
|
+
v("span", Ct, S(D(g)("chatFilePreview.words", Ie.value)), 1),
|
|
1202
|
+
e.mode === "markup" && e.preview.revisionAuthors.length ? (A(), k("span", wt, [
|
|
1203
1203
|
v("span", {
|
|
1204
1204
|
class: "pk-word-preview__legend-text",
|
|
1205
|
-
title: D(g)("chatFilePreview.revisionsOf", { authors:
|
|
1206
|
-
}, S(D(g)("chatFilePreview.revisionsOf", { authors:
|
|
1205
|
+
title: D(g)("chatFilePreview.revisionsOf", { authors: Le.value })
|
|
1206
|
+
}, S(D(g)("chatFilePreview.revisionsOf", { authors: Le.value })), 9, Tt),
|
|
1207
1207
|
v("del", Et, S(D(g)("chatFilePreview.removed")), 1),
|
|
1208
1208
|
v("ins", Dt, S(D(g)("chatFilePreview.added")), 1)
|
|
1209
1209
|
])) : T("", !0),
|
|
1210
1210
|
n[6] ||= v("span", { class: "pk-word-preview__spacer" }, null, -1),
|
|
1211
|
-
!
|
|
1211
|
+
!O.value && (Ae.value.length || q.value.length) ? (A(), h(i, {
|
|
1212
1212
|
key: 2,
|
|
1213
1213
|
class: "pk-word-preview__outline-toggle",
|
|
1214
1214
|
modifiers: "action-quiet",
|
|
@@ -1216,15 +1216,15 @@ var at = ["aria-label"], ot = {
|
|
|
1216
1216
|
label: D(g)("chatFilePreview.outline"),
|
|
1217
1217
|
title: D(g)("chatFilePreview.outline"),
|
|
1218
1218
|
"aria-label": D(g)("chatFilePreview.outline"),
|
|
1219
|
-
"aria-expanded":
|
|
1220
|
-
onClick: n[2] ||= (e) =>
|
|
1219
|
+
"aria-expanded": Pe.value,
|
|
1220
|
+
onClick: n[2] ||= (e) => Pe.value = !Pe.value
|
|
1221
1221
|
}, null, 8, [
|
|
1222
1222
|
"label",
|
|
1223
1223
|
"title",
|
|
1224
1224
|
"aria-label",
|
|
1225
1225
|
"aria-expanded"
|
|
1226
1226
|
])) : T("", !0),
|
|
1227
|
-
|
|
1227
|
+
L.value ? (A(), k(_, { key: 3 }, [
|
|
1228
1228
|
d(i, {
|
|
1229
1229
|
class: "pk-word-preview__fit",
|
|
1230
1230
|
modifiers: "action-quiet",
|
|
@@ -1232,8 +1232,8 @@ var at = ["aria-label"], ot = {
|
|
|
1232
1232
|
label: D(g)("chatFilePreview.fitWidth"),
|
|
1233
1233
|
title: D(g)("chatFilePreview.fitWidth"),
|
|
1234
1234
|
"aria-label": D(g)("chatFilePreview.fitWidth"),
|
|
1235
|
-
disabled:
|
|
1236
|
-
onClick: n[3] ||= (e) =>
|
|
1235
|
+
disabled: G.value,
|
|
1236
|
+
onClick: n[3] ||= (e) => G.value = !0
|
|
1237
1237
|
}, null, 8, [
|
|
1238
1238
|
"label",
|
|
1239
1239
|
"title",
|
|
@@ -1244,48 +1244,48 @@ var at = ["aria-label"], ot = {
|
|
|
1244
1244
|
modifiers: "action-quiet",
|
|
1245
1245
|
icon: "ri:subtract-line",
|
|
1246
1246
|
"aria-label": D(g)("chatFilePreview.zoomOut"),
|
|
1247
|
-
disabled:
|
|
1248
|
-
onClick: n[4] ||= (e) =>
|
|
1247
|
+
disabled: K.value <= .3,
|
|
1248
|
+
onClick: n[4] ||= (e) => xe(-.1)
|
|
1249
1249
|
}, null, 8, ["aria-label", "disabled"]),
|
|
1250
|
-
v("span", Ot, S(Math.round(
|
|
1250
|
+
v("span", Ot, S(Math.round(K.value * 100)) + "% ", 1),
|
|
1251
1251
|
d(i, {
|
|
1252
1252
|
modifiers: "action-quiet",
|
|
1253
1253
|
icon: "ri:add-line",
|
|
1254
1254
|
"aria-label": D(g)("chatFilePreview.zoomIn"),
|
|
1255
|
-
disabled:
|
|
1256
|
-
onClick: n[5] ||= (e) =>
|
|
1255
|
+
disabled: K.value >= 2,
|
|
1256
|
+
onClick: n[5] ||= (e) => xe(.1)
|
|
1257
1257
|
}, null, 8, ["aria-label", "disabled"])
|
|
1258
1258
|
], 64)) : T("", !0)
|
|
1259
1259
|
])]),
|
|
1260
|
-
|
|
1260
|
+
L.value ? (A(), k("div", {
|
|
1261
1261
|
key: 1,
|
|
1262
1262
|
ref_key: "measureEl",
|
|
1263
1263
|
ref: te,
|
|
1264
1264
|
class: "pk-word-preview__measure",
|
|
1265
1265
|
"aria-hidden": "true",
|
|
1266
|
-
style: l(
|
|
1267
|
-
}, [(
|
|
1266
|
+
style: l(z.value)
|
|
1267
|
+
}, [(A(!0), k(_, null, p(x.value, (t) => (A(), k("div", {
|
|
1268
1268
|
key: t.key,
|
|
1269
1269
|
"data-item": ""
|
|
1270
|
-
}, [d(
|
|
1270
|
+
}, [d(rt, {
|
|
1271
1271
|
block: e.preview.blocks[t.block],
|
|
1272
1272
|
row: t.row,
|
|
1273
1273
|
mode: e.mode,
|
|
1274
|
-
page:
|
|
1274
|
+
page: M.value
|
|
1275
1275
|
}, null, 8, [
|
|
1276
1276
|
"block",
|
|
1277
1277
|
"row",
|
|
1278
1278
|
"mode",
|
|
1279
1279
|
"page"
|
|
1280
|
-
])]))), 128)), (
|
|
1280
|
+
])]))), 128)), (A(!0), k(_, null, p(e.preview.parts, (t, n) => (A(), k("div", {
|
|
1281
1281
|
key: n,
|
|
1282
1282
|
"data-part": n
|
|
1283
|
-
}, [(
|
|
1283
|
+
}, [(A(!0), k(_, null, p(D(F)(t, e.mode), (n) => (A(), h(rt, {
|
|
1284
1284
|
key: n.key,
|
|
1285
1285
|
block: t[n.block],
|
|
1286
1286
|
row: n.row,
|
|
1287
1287
|
mode: e.mode,
|
|
1288
|
-
page:
|
|
1288
|
+
page: M.value
|
|
1289
1289
|
}, null, 8, [
|
|
1290
1290
|
"block",
|
|
1291
1291
|
"row",
|
|
@@ -1353,7 +1353,7 @@ var Nt = ["aria-label"], Pt = { class: "pk-file-preview__head" }, Ft = { class:
|
|
|
1353
1353
|
"update:fit"
|
|
1354
1354
|
]),
|
|
1355
1355
|
setup(e, { emit: t }) {
|
|
1356
|
-
let n = e, a = t, { t: s, locale: c } =
|
|
1356
|
+
let n = e, a = t, { t: s, locale: c } = re({ useScope: "global" }), l = b(() => n.versions ?? []), f = b(() => n.version ? l.value.indexOf(n.version) : -1), g = b(() => f.value > 0 ? l.value[f.value - 1] : void 0), ee = b(() => f.value >= 0 && f.value < l.value.length - 1 ? l.value[f.value + 1] : void 0), x = o(e, "mode"), C = o(e, "sheet"), w = o(e, "zoom"), E = o(e, "fit"), O = b(() => [
|
|
1357
1357
|
{
|
|
1358
1358
|
value: "markup",
|
|
1359
1359
|
label: s("chatFilePreview.modeMarkup")
|
|
@@ -1366,47 +1366,47 @@ var Nt = ["aria-label"], Pt = { class: "pk-file-preview__head" }, Ft = { class:
|
|
|
1366
1366
|
value: "original",
|
|
1367
1367
|
label: s("chatFilePreview.modeOriginal")
|
|
1368
1368
|
}
|
|
1369
|
-
]),
|
|
1369
|
+
]), j = b(() => n.preview?.kind === "word" && n.preview.revisionAuthors.length > 0);
|
|
1370
1370
|
u(() => n.version, () => {
|
|
1371
1371
|
x.value = "markup";
|
|
1372
1372
|
});
|
|
1373
|
-
let
|
|
1374
|
-
|
|
1373
|
+
let M = m("rootEl"), N = ne(), P = y(!1), ie = () => {
|
|
1374
|
+
N.value = void 0, P.value = !1;
|
|
1375
1375
|
};
|
|
1376
1376
|
u(() => [
|
|
1377
1377
|
n.version,
|
|
1378
1378
|
n.preview,
|
|
1379
1379
|
x.value,
|
|
1380
1380
|
C.value
|
|
1381
|
-
],
|
|
1382
|
-
let
|
|
1383
|
-
|
|
1384
|
-
},
|
|
1385
|
-
u(
|
|
1386
|
-
let n =
|
|
1381
|
+
], ie);
|
|
1382
|
+
let ae = (e) => {
|
|
1383
|
+
P.value || (N.value = e);
|
|
1384
|
+
}, oe = b(() => N.value?.format === "docx" && z());
|
|
1385
|
+
u(P, async (e, t) => {
|
|
1386
|
+
let n = N.value;
|
|
1387
1387
|
t && !e && n?.format === "docx" && (await i(), n.restore());
|
|
1388
1388
|
});
|
|
1389
1389
|
let se = b(() => !n.version || n.version === l.value[l.value.length - 1]), F = () => {
|
|
1390
1390
|
let e = l.value[l.value.length - 1];
|
|
1391
1391
|
e && a("version", e);
|
|
1392
1392
|
}, ce = b(() => {
|
|
1393
|
-
let e =
|
|
1394
|
-
return e?.format === "docx" ? e.paragraphCount > 200 : (e?.cells ?? 0) >
|
|
1395
|
-
}), I = b(() =>
|
|
1396
|
-
let e =
|
|
1393
|
+
let e = N.value;
|
|
1394
|
+
return e?.format === "docx" ? e.paragraphCount > 200 : (e?.cells ?? 0) > ge;
|
|
1395
|
+
}), I = b(() => N.value?.format === "docx" && x.value === "original"), L = b(() => ce.value || I.value), le = b(() => I.value ? s("selectionActions.hintOriginal") : ce.value ? s(N.value?.format === "docx" ? "selectionActions.hintParagraphs" : "selectionActions.hintCells", { count: N.value?.format === "docx" ? 200 : ge }) : void 0), fe = (e) => e[c.value] ?? e[c.value.split("-")[0]] ?? Object.values(e)[0] ?? "", pe = ["explain", "summarize"], B = b(() => {
|
|
1396
|
+
let e = N.value, t = n.selectionActions;
|
|
1397
1397
|
if (!e || !t) return [];
|
|
1398
1398
|
let r = e.format;
|
|
1399
|
-
return [...(r === "docx" &&
|
|
1399
|
+
return [...(r === "docx" && L.value ? pe : t.builtIns).map((e) => ({
|
|
1400
1400
|
id: e,
|
|
1401
1401
|
label: s(`selectionActions.builtIn.${e}`),
|
|
1402
1402
|
...e === "translate" && { asks: s("selectionActions.translateAsks") },
|
|
1403
1403
|
prompt: (t) => s(`selectionActions.prompt.${r}.${e}`, { language: t ?? "" })
|
|
1404
|
-
})), ...(
|
|
1404
|
+
})), ...(L.value ? [] : t.actions).map((e) => ({
|
|
1405
1405
|
id: e.id,
|
|
1406
|
-
label:
|
|
1407
|
-
prompt: () =>
|
|
1406
|
+
label: fe(e.label),
|
|
1407
|
+
prompt: () => fe(e.prompt)
|
|
1408
1408
|
}))];
|
|
1409
|
-
}),
|
|
1409
|
+
}), V = (e) => {
|
|
1410
1410
|
if (e.format === "docx") return s("selectionActions.labelParagraphs", {
|
|
1411
1411
|
file: n.filename,
|
|
1412
1412
|
count: e.paragraphCount
|
|
@@ -1422,13 +1422,13 @@ var Nt = ["aria-label"], Pt = { class: "pk-file-preview__head" }, Ft = { class:
|
|
|
1422
1422
|
sheet: e.sheet,
|
|
1423
1423
|
cell: t
|
|
1424
1424
|
});
|
|
1425
|
-
},
|
|
1425
|
+
}, _e = (e) => {
|
|
1426
1426
|
if (!n.fileId || !n.storedFileName) return;
|
|
1427
1427
|
let t = {
|
|
1428
1428
|
fileId: n.fileId,
|
|
1429
1429
|
version: n.version ?? 1,
|
|
1430
1430
|
storedFileName: n.storedFileName,
|
|
1431
|
-
label:
|
|
1431
|
+
label: V(e).slice(0, 200)
|
|
1432
1432
|
};
|
|
1433
1433
|
if (e.format === "docx") {
|
|
1434
1434
|
let { measure: n, ...r } = e;
|
|
@@ -1443,23 +1443,23 @@ var Nt = ["aria-label"], Pt = { class: "pk-file-preview__head" }, Ft = { class:
|
|
|
1443
1443
|
...t,
|
|
1444
1444
|
...a
|
|
1445
1445
|
};
|
|
1446
|
-
},
|
|
1447
|
-
let n =
|
|
1446
|
+
}, ve = (e, t) => {
|
|
1447
|
+
let n = N.value, r = n && _e(n);
|
|
1448
1448
|
r && (a("selectionSend", e, r, {
|
|
1449
1449
|
id: t,
|
|
1450
1450
|
size: n.format === "docx" ? n.paragraphCount : n.cells
|
|
1451
|
-
}),
|
|
1452
|
-
},
|
|
1453
|
-
let n =
|
|
1454
|
-
n &&
|
|
1455
|
-
},
|
|
1456
|
-
|
|
1451
|
+
}), ie(), document.getSelection()?.removeAllRanges());
|
|
1452
|
+
}, H = (e, t) => {
|
|
1453
|
+
let n = B.value.find((t) => t.id === e);
|
|
1454
|
+
n && ve(n.prompt(t), e);
|
|
1455
|
+
}, U = y(0);
|
|
1456
|
+
R(M, "scroll", () => U.value++, {
|
|
1457
1457
|
capture: !0,
|
|
1458
1458
|
passive: !0
|
|
1459
|
-
}),
|
|
1460
|
-
let
|
|
1461
|
-
|
|
1462
|
-
let e =
|
|
1459
|
+
}), R(window, "resize", () => U.value++, { passive: !0 });
|
|
1460
|
+
let W = b(() => {
|
|
1461
|
+
U.value;
|
|
1462
|
+
let e = N.value?.measure(), t = M.value?.getBoundingClientRect();
|
|
1463
1463
|
if (e && t) return {
|
|
1464
1464
|
start: {
|
|
1465
1465
|
top: e.start.top - t.top,
|
|
@@ -1475,10 +1475,10 @@ var Nt = ["aria-label"], Pt = { class: "pk-file-preview__head" }, Ft = { class:
|
|
|
1475
1475
|
};
|
|
1476
1476
|
});
|
|
1477
1477
|
return (t, n) => {
|
|
1478
|
-
let i =
|
|
1479
|
-
return
|
|
1478
|
+
let i = ue, o = de;
|
|
1479
|
+
return A(), k("section", {
|
|
1480
1480
|
ref_key: "rootEl",
|
|
1481
|
-
ref:
|
|
1481
|
+
ref: M,
|
|
1482
1482
|
class: "pk-file-preview",
|
|
1483
1483
|
"aria-label": e.filename,
|
|
1484
1484
|
tabindex: "-1",
|
|
@@ -1489,7 +1489,7 @@ var Nt = ["aria-label"], Pt = { class: "pk-file-preview__head" }, Ft = { class:
|
|
|
1489
1489
|
name: e.kind === "word" ? "ri:file-word-2-line" : "ri:file-excel-2-line",
|
|
1490
1490
|
class: r(e.kind === "word" ? "pk-file-preview__icon--word" : "pk-file-preview__icon--sheet")
|
|
1491
1491
|
}, null, 8, ["name", "class"])]), v("div", Lt, [v("strong", Rt, S(e.filename), 1), v("span", zt, S(D(s)("chatFilePreview.readOnly")), 1)])]),
|
|
1492
|
-
e.version && l.value.length > 1 ||
|
|
1492
|
+
e.version && l.value.length > 1 || j.value ? (A(), k("div", Bt, [e.version && l.value.length > 1 ? (A(), k("nav", {
|
|
1493
1493
|
key: 0,
|
|
1494
1494
|
class: "pk-file-preview__versions",
|
|
1495
1495
|
"aria-label": D(s)("chatFilePreview.versions")
|
|
@@ -1512,7 +1512,7 @@ var Nt = ["aria-label"], Pt = { class: "pk-file-preview__head" }, Ft = { class:
|
|
|
1512
1512
|
disabled: !ee.value,
|
|
1513
1513
|
onClick: n[1] ||= (e) => ee.value && a("version", ee.value)
|
|
1514
1514
|
}, null, 8, ["aria-label", "disabled"])
|
|
1515
|
-
], 8, Vt)) : T("", !0),
|
|
1515
|
+
], 8, Vt)) : T("", !0), j.value ? (A(), h(he, {
|
|
1516
1516
|
key: 1,
|
|
1517
1517
|
modelValue: x.value,
|
|
1518
1518
|
"onUpdate:modelValue": n[2] ||= (e) => x.value = e,
|
|
@@ -1520,7 +1520,7 @@ var Nt = ["aria-label"], Pt = { class: "pk-file-preview__head" }, Ft = { class:
|
|
|
1520
1520
|
segmented: "",
|
|
1521
1521
|
class: "pk-file-preview__modes u-segmented-fit mb-0",
|
|
1522
1522
|
"aria-label": D(s)("chatFilePreview.modes"),
|
|
1523
|
-
options:
|
|
1523
|
+
options: O.value
|
|
1524
1524
|
}, {
|
|
1525
1525
|
markup: te(() => [v("span", Ut, S(D(s)("chatFilePreview.modeMarkup")), 1), v("span", Wt, S(D(s)("chatFilePreview.modeMarkupShort")), 1)]),
|
|
1526
1526
|
_: 1
|
|
@@ -1530,7 +1530,7 @@ var Nt = ["aria-label"], Pt = { class: "pk-file-preview__head" }, Ft = { class:
|
|
|
1530
1530
|
"options"
|
|
1531
1531
|
])) : T("", !0)])) : T("", !0),
|
|
1532
1532
|
v("div", Gt, [
|
|
1533
|
-
e.restorable ? (
|
|
1533
|
+
e.restorable ? (A(), h(o, {
|
|
1534
1534
|
key: 0,
|
|
1535
1535
|
modifiers: "action-quiet",
|
|
1536
1536
|
icon: "ri:arrow-go-back-line",
|
|
@@ -1549,14 +1549,14 @@ var Nt = ["aria-label"], Pt = { class: "pk-file-preview__head" }, Ft = { class:
|
|
|
1549
1549
|
"title",
|
|
1550
1550
|
"aria-label"
|
|
1551
1551
|
]),
|
|
1552
|
-
e.resize === "expand" ? (
|
|
1552
|
+
e.resize === "expand" ? (A(), h(o, {
|
|
1553
1553
|
key: 1,
|
|
1554
1554
|
modifiers: "action-quiet",
|
|
1555
1555
|
icon: "ri:fullscreen-line",
|
|
1556
1556
|
title: D(s)("chatFilePreview.expand"),
|
|
1557
1557
|
"aria-label": D(s)("chatFilePreview.expand"),
|
|
1558
1558
|
onClick: n[4] ||= (e) => a("resize")
|
|
1559
|
-
}, null, 8, ["title", "aria-label"])) : e.resize === "shrink" ? (
|
|
1559
|
+
}, null, 8, ["title", "aria-label"])) : e.resize === "shrink" ? (A(), h(o, {
|
|
1560
1560
|
key: 2,
|
|
1561
1561
|
modifiers: "action-quiet",
|
|
1562
1562
|
icon: "ri:fullscreen-exit-line",
|
|
@@ -1573,26 +1573,26 @@ var Nt = ["aria-label"], Pt = { class: "pk-file-preview__head" }, Ft = { class:
|
|
|
1573
1573
|
}, null, 8, ["title", "aria-label"])
|
|
1574
1574
|
])
|
|
1575
1575
|
]),
|
|
1576
|
-
v("div", Kt, [e.loading ? (
|
|
1576
|
+
v("div", Kt, [e.loading ? (A(), k("div", qt, [(A(), k(_, null, p(8, (e) => v("div", {
|
|
1577
1577
|
key: e,
|
|
1578
1578
|
class: r(["vv-skeleton__item pk-file-preview__skeleton-line", e % 3 ? "w-full" : "w-128"])
|
|
1579
|
-
}, null, 2)), 64))])) : e.error || !e.preview ? (
|
|
1579
|
+
}, null, 2)), 64))])) : e.error || !e.preview ? (A(), k("p", Jt, S(D(s)("chatFilePreview.unavailable")), 1)) : e.preview.kind === "word" ? (A(), h(Mt, {
|
|
1580
1580
|
key: 2,
|
|
1581
1581
|
zoom: w.value,
|
|
1582
1582
|
"onUpdate:zoom": n[7] ||= (e) => w.value = e,
|
|
1583
1583
|
fit: E.value,
|
|
1584
1584
|
"onUpdate:fit": n[8] ||= (e) => E.value = e,
|
|
1585
1585
|
preview: e.preview,
|
|
1586
|
-
mode:
|
|
1586
|
+
mode: j.value ? x.value : "markup",
|
|
1587
1587
|
marked: e.changes?.kind === "word" ? e.changes.paragraphs : void 0,
|
|
1588
|
-
onSelect:
|
|
1588
|
+
onSelect: ae
|
|
1589
1589
|
}, null, 8, [
|
|
1590
1590
|
"zoom",
|
|
1591
1591
|
"fit",
|
|
1592
1592
|
"preview",
|
|
1593
1593
|
"mode",
|
|
1594
1594
|
"marked"
|
|
1595
|
-
])) : (
|
|
1595
|
+
])) : (A(), h(Ye, {
|
|
1596
1596
|
key: 3,
|
|
1597
1597
|
sheet: C.value,
|
|
1598
1598
|
"onUpdate:sheet": n[9] ||= (e) => C.value = e,
|
|
@@ -1600,28 +1600,28 @@ var Nt = ["aria-label"], Pt = { class: "pk-file-preview__head" }, Ft = { class:
|
|
|
1600
1600
|
"onUpdate:zoom": n[10] ||= (e) => w.value = e,
|
|
1601
1601
|
preview: e.preview,
|
|
1602
1602
|
marked: e.changes?.kind === "spreadsheet" ? e.changes.cells : void 0,
|
|
1603
|
-
onSelect:
|
|
1603
|
+
onSelect: ae
|
|
1604
1604
|
}, null, 8, [
|
|
1605
1605
|
"sheet",
|
|
1606
1606
|
"zoom",
|
|
1607
1607
|
"preview",
|
|
1608
1608
|
"marked"
|
|
1609
1609
|
]))]),
|
|
1610
|
-
e.selectionActions &&
|
|
1610
|
+
e.selectionActions && N.value && W.value ? (A(), h(me, {
|
|
1611
1611
|
key: 0,
|
|
1612
|
-
asking:
|
|
1613
|
-
"onUpdate:asking": n[11] ||= (e) =>
|
|
1612
|
+
asking: P.value,
|
|
1613
|
+
"onUpdate:asking": n[11] ||= (e) => P.value = e,
|
|
1614
1614
|
strategy: "absolute",
|
|
1615
|
-
anchor:
|
|
1616
|
-
actions:
|
|
1617
|
-
hint:
|
|
1618
|
-
touch:
|
|
1615
|
+
anchor: W.value,
|
|
1616
|
+
actions: B.value,
|
|
1617
|
+
hint: le.value,
|
|
1618
|
+
touch: oe.value,
|
|
1619
1619
|
note: se.value ? void 0 : D(s)("selectionActions.notLatest", { version: e.version }),
|
|
1620
1620
|
"note-action": D(s)("selectionActions.openLatest"),
|
|
1621
|
-
onAction:
|
|
1622
|
-
onAsk: n[12] ||= (e) =>
|
|
1621
|
+
onAction: H,
|
|
1622
|
+
onAsk: n[12] ||= (e) => ve(e, "ask"),
|
|
1623
1623
|
onNote: F,
|
|
1624
|
-
onClose:
|
|
1624
|
+
onClose: ie
|
|
1625
1625
|
}, null, 8, [
|
|
1626
1626
|
"asking",
|
|
1627
1627
|
"anchor",
|
|
@@ -1634,7 +1634,7 @@ var Nt = ["aria-label"], Pt = { class: "pk-file-preview__head" }, Ft = { class:
|
|
|
1634
1634
|
], 8, Nt);
|
|
1635
1635
|
};
|
|
1636
1636
|
}
|
|
1637
|
-
}), Xt = ".pk-file-preview{background-color:var(--color-surface);height:100%;min-height:0;color:var(--color-word-1);outline:none;flex-direction:column;display:flex;position:relative;container-type:inline-size}.pk-file-preview__head{align-items:center;gap:var(--spacing-8) var(--spacing-12);padding:var(--spacing-12) var(--spacing-12) var(--spacing-12) var(--spacing-md);border-bottom:var(--border) solid var(--color-surface-3);flex-wrap:wrap;display:flex}.pk-file-preview__file{align-items:center;gap:var(--spacing-12);flex:12rem;min-width:0;display:flex}.pk-file-preview__tile{width:var(--spacing-32);height:var(--spacing-32);border:var(--border) solid var(--color-surface-3);border-radius:var(--rounded);flex-shrink:0;justify-content:center;align-items:center;display:flex}.pk-file-preview__tile .vv-icon{width:var(--spacing-18);height:var(--spacing-18)}.pk-file-preview__icon--word{color:#2b7de9}.pk-file-preview__icon--sheet{color:#1f9d57}.pk-file-preview__name{flex-direction:column;min-width:0;display:flex}.pk-file-preview__title{font-size:var(--text-14);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.pk-file-preview__note{color:var(--color-word-3);font-size:var(--text-12)}.pk-file-preview__tools{align-items:center;gap:var(--spacing-8) var(--spacing-12);flex-wrap:wrap;display:flex}.pk-file-preview__versions{align-items:center;gap:var(--spacing-2);display:flex}.pk-file-preview__version{font-size:var(--text-14);font-weight:var(--font-semibold);font-variant-numeric:tabular-nums;white-space:nowrap}.pk-file-preview__actions{align-items:center;gap:var(--spacing-8);margin-left:auto;display:flex}@container (width<52rem){.pk-file-preview__file{order:1}.pk-file-preview__actions{order:2}.pk-file-preview__tools{flex-basis:100%;order:3}.pk-file-preview__tools .pk-file-preview__modes{flex:auto}}.pk-file-preview__mode-short{display:none}@container (width<38rem){.pk-file-preview__mode-long{display:none}.pk-file-preview__mode-short{display:inline}}@container (width<30rem){.pk-file-preview__tools .pk-file-preview__modes{flex:100%}.pk-file-preview__tools .pk-file-preview__modes .vv-radio{padding-inline:var(--spacing-4)}}.pk-file-preview__body{background-color:var(--color-surface-1);flex-direction:column;flex:1;min-height:0;display:flex}.pk-file-preview__skeleton{width:min(42rem, 100% - 2 * var(--spacing-md));margin:var(--spacing-md) auto;padding:var(--spacing-lg);box-sizing:border-box;border:var(--border) solid var(--color-surface-3);border-radius:var(--rounded);background-color:var(--color-surface)}.pk-file-preview__skeleton-line{height:var(--spacing-12);margin-bottom:var(--spacing-12);border-radius:var(--rounded)}.pk-file-preview__empty{margin:var(--spacing-lg) var(--spacing-md);color:var(--color-word-3);font-size:var(--text-14);text-align:center}", Zt = /* @__PURE__ */ e({ default: () => Qt }), Qt = /*#__PURE__*/
|
|
1637
|
+
}), Xt = ".pk-file-preview{background-color:var(--color-surface);height:100%;min-height:0;color:var(--color-word-1);outline:none;flex-direction:column;display:flex;position:relative;container-type:inline-size}.pk-file-preview__head{align-items:center;gap:var(--spacing-8) var(--spacing-12);padding:var(--spacing-12) var(--spacing-12) var(--spacing-12) var(--spacing-md);border-bottom:var(--border) solid var(--color-surface-3);flex-wrap:wrap;display:flex}.pk-file-preview__file{align-items:center;gap:var(--spacing-12);flex:12rem;min-width:0;display:flex}.pk-file-preview__tile{width:var(--spacing-32);height:var(--spacing-32);border:var(--border) solid var(--color-surface-3);border-radius:var(--rounded);flex-shrink:0;justify-content:center;align-items:center;display:flex}.pk-file-preview__tile .vv-icon{width:var(--spacing-18);height:var(--spacing-18)}.pk-file-preview__icon--word{color:#2b7de9}.pk-file-preview__icon--sheet{color:#1f9d57}.pk-file-preview__name{flex-direction:column;min-width:0;display:flex}.pk-file-preview__title{font-size:var(--text-14);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.pk-file-preview__note{color:var(--color-word-3);font-size:var(--text-12)}.pk-file-preview__tools{align-items:center;gap:var(--spacing-8) var(--spacing-12);flex-wrap:wrap;display:flex}.pk-file-preview__versions{align-items:center;gap:var(--spacing-2);display:flex}.pk-file-preview__version{font-size:var(--text-14);font-weight:var(--font-semibold);font-variant-numeric:tabular-nums;white-space:nowrap}.pk-file-preview__actions{align-items:center;gap:var(--spacing-8);margin-left:auto;display:flex}@container (width<52rem){.pk-file-preview__file{order:1}.pk-file-preview__actions{order:2}.pk-file-preview__tools{flex-basis:100%;order:3}.pk-file-preview__tools .pk-file-preview__modes{flex:auto}}.pk-file-preview__mode-short{display:none}@container (width<38rem){.pk-file-preview__mode-long{display:none}.pk-file-preview__mode-short{display:inline}}@container (width<30rem){.pk-file-preview__tools .pk-file-preview__modes{flex:100%}.pk-file-preview__tools .pk-file-preview__modes .vv-radio{padding-inline:var(--spacing-4)}}.pk-file-preview__body{background-color:var(--color-surface-1);flex-direction:column;flex:1;min-height:0;display:flex}.pk-file-preview__skeleton{width:min(42rem, 100% - 2 * var(--spacing-md));margin:var(--spacing-md) auto;padding:var(--spacing-lg);box-sizing:border-box;border:var(--border) solid var(--color-surface-3);border-radius:var(--rounded);background-color:var(--color-surface)}.pk-file-preview__skeleton-line{height:var(--spacing-12);margin-bottom:var(--spacing-12);border-radius:var(--rounded)}.pk-file-preview__empty{margin:var(--spacing-lg) var(--spacing-md);color:var(--color-word-3);font-size:var(--text-14);text-align:center}", Zt = /* @__PURE__ */ e({ default: () => Qt }), Qt = /*#__PURE__*/ B(Yt, [["styles", [Xt]]]);
|
|
1638
1638
|
export { Zt as n, Qt as t };
|
|
1639
1639
|
|
|
1640
|
-
//# sourceMappingURL=PkFilePreview-
|
|
1640
|
+
//# sourceMappingURL=PkFilePreview-D_1ZgiiA.js.map
|