@8wave/ai-elements 0.125.0-beta.16 → 0.125.0-beta.18
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/README.md +24 -0
- package/dist/_chunks/{PkChatbotFilePreview-xDlDvl5m.js → PkChatbotFilePreview-CFGqa-tX.js} +2 -2
- package/dist/_chunks/{PkChatbotFilePreview-xDlDvl5m.js.map → PkChatbotFilePreview-CFGqa-tX.js.map} +1 -1
- package/dist/_chunks/{PkFilePreview-8nVPKv8k.js → PkFilePreview-BIFkMsAC.js} +559 -718
- package/dist/_chunks/PkFilePreview-BIFkMsAC.js.map +1 -0
- package/dist/_chunks/{PkFilePreviewDialog-BHPcGlnF.js → PkFilePreviewDialog-NLk4gZMd.js} +8 -8
- package/dist/_chunks/{PkFilePreviewDialog-BHPcGlnF.js.map → PkFilePreviewDialog-NLk4gZMd.js.map} +1 -1
- package/dist/_chunks/PkSelectionActions-CUymhwsG.js +168 -0
- package/dist/_chunks/PkSelectionActions-CUymhwsG.js.map +1 -0
- package/dist/_chunks/{PkStreamingMarkdown-BFTTLuPc.js → PkStreamingMarkdown-CqLpNWQv.js} +2 -2
- package/dist/_chunks/{PkStreamingMarkdown-BFTTLuPc.js.map → PkStreamingMarkdown-CqLpNWQv.js.map} +1 -1
- package/dist/_chunks/{PkToolChatFile-Buv7Qkes.js → PkToolChatFile-iE4ZokYD.js} +2 -2
- package/dist/_chunks/{PkToolChatFile-Buv7Qkes.js.map → PkToolChatFile-iE4ZokYD.js.map} +1 -1
- package/dist/_chunks/{PkToolShareDocument-kB0qoQda.js → PkToolShareDocument-lTHNZodf.js} +2 -2
- package/dist/_chunks/{PkToolShareDocument-kB0qoQda.js.map → PkToolShareDocument-lTHNZodf.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-ClYqvIqB.js → PkToolShowArtifact-BNQrM5fY.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-ClYqvIqB.js.map → PkToolShowArtifact-BNQrM5fY.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-C0ABjvtZ.js → PkToolShowContactForm-CvQoLumn.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-C0ABjvtZ.js.map → PkToolShowContactForm-CvQoLumn.js.map} +1 -1
- package/dist/_chunks/{PkToolShowDiagram-BZbHtEs5.js → PkToolShowDiagram-COt1Z3q9.js} +2 -2
- package/dist/_chunks/{PkToolShowDiagram-BZbHtEs5.js.map → PkToolShowDiagram-COt1Z3q9.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-DUjR-9o1.js → PkToolShowForm-DcPccCEU.js} +2 -2
- package/dist/_chunks/{PkToolShowForm-DUjR-9o1.js.map → PkToolShowForm-DcPccCEU.js.map} +1 -1
- package/dist/_chunks/{PkToolShowImageGallery-CNU2Zvso.js → PkToolShowImageGallery-DefXra8-.js} +2 -2
- package/dist/_chunks/{PkToolShowImageGallery-CNU2Zvso.js.map → PkToolShowImageGallery-DefXra8-.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-DhDjNIFa.js → PkToolShowSources-BE3Zv_uz.js} +2 -2
- package/dist/_chunks/{PkToolShowSources-DhDjNIFa.js.map → PkToolShowSources-BE3Zv_uz.js.map} +1 -1
- package/dist/_chunks/{useLightbox-BEEzZ0qT.js → useLightbox-D2Zi-Fpe.js} +72 -13
- package/dist/_chunks/useLightbox-D2Zi-Fpe.js.map +1 -0
- package/dist/ai-elements.es.js +4692 -4268
- 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/PkChatbotViewFiles.js +1 -1
- package/dist-vue/PkChatbotViewProfile.js +1 -1
- package/dist-vue/_chunks/{Agent-DmxsItHG.js → Agent-Cm1LrkYm.js} +162 -162
- package/dist-vue/_chunks/{Agent-DmxsItHG.js.map → Agent-Cm1LrkYm.js.map} +1 -1
- package/dist-vue/_chunks/{Document-CXfJxfu6.js → Document-DHBTrCuO.js} +10 -10
- package/dist-vue/_chunks/{Document-CXfJxfu6.js.map → Document-DHBTrCuO.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbot-Bpo22_yE.js → PkChatbot-DCGQnndK.js} +10 -9
- package/dist-vue/_chunks/PkChatbot-DCGQnndK.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotEmptyState-CQ_Qdkge.js → PkChatbotEmptyState-COya3H3C.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-CQ_Qdkge.js.map → PkChatbotEmptyState-COya3H3C.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotFilePreview-BpVM850N.js → PkChatbotFilePreview-BsvT6orx.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotFilePreview-BpVM850N.js.map → PkChatbotFilePreview-BsvT6orx.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotInput-BVu1b2Te.js → PkChatbotInput-D0KUEkAs.js} +5 -4
- package/dist-vue/_chunks/PkChatbotInput-D0KUEkAs.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotMessages-DftNL5ZQ.js → PkChatbotMessages-l-IzEWsN.js} +21 -21
- package/dist-vue/_chunks/{PkChatbotMessages-DftNL5ZQ.js.map → PkChatbotMessages-l-IzEWsN.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepPayload-AiDZPbds.js → PkChatbotStepPayload-cuYclK_2.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-AiDZPbds.js.map → PkChatbotStepPayload-cuYclK_2.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-CALZDpfQ.js → PkChatbotStepToolDetail-Yd8cUQJP.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-CALZDpfQ.js.map → PkChatbotStepToolDetail-Yd8cUQJP.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotSteps-CY7pN2Gl.js → PkChatbotSteps-_Aqft0em.js} +5 -5
- package/dist-vue/_chunks/{PkChatbotSteps-CY7pN2Gl.js.map → PkChatbotSteps-_Aqft0em.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-Drp0At_n.js → PkChatbotViewChat-CHvtUHuO.js} +180 -178
- package/dist-vue/_chunks/PkChatbotViewChat-CHvtUHuO.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewConversations-C0KqM_Wq.js → PkChatbotViewConversations-7JU_5-F2.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewConversations-C0KqM_Wq.js.map → PkChatbotViewConversations-7JU_5-F2.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-B9mYRoNK.js → PkChatbotViewFiles-D53wtRPS.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewFiles-B9mYRoNK.js.map → PkChatbotViewFiles-D53wtRPS.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-BfNE3d7F.js → PkChatbotViewProfile-BRlLIofM.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-BfNE3d7F.js.map → PkChatbotViewProfile-BRlLIofM.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreview-z7JcRtjP.js → PkFilePreview-DLo9nI2g.js} +426 -426
- package/dist-vue/_chunks/PkFilePreview-DLo9nI2g.js.map +1 -0
- package/dist-vue/_chunks/{PkFilePreviewDialog-zVon3aPY.js → PkFilePreviewDialog-CgDJQgIJ.js} +2 -2
- package/dist-vue/_chunks/{PkFilePreviewDialog-zVon3aPY.js.map → PkFilePreviewDialog-CgDJQgIJ.js.map} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-bJEDk-kM.js → PkStreamingMarkdown-2FN4WMQD.js} +4 -4
- package/dist-vue/_chunks/{PkStreamingMarkdown-bJEDk-kM.js.map → PkStreamingMarkdown-2FN4WMQD.js.map} +1 -1
- package/dist-vue/_chunks/{PkSvgViewer-DmkElalq.js → PkSvgViewer-BsdSOBpH.js} +2 -2
- package/dist-vue/_chunks/{PkSvgViewer-DmkElalq.js.map → PkSvgViewer-BsdSOBpH.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolChatFile-DqLGwJxp.js → PkToolChatFile-DAT1tv52.js} +4 -4
- package/dist-vue/_chunks/{PkToolChatFile-DqLGwJxp.js.map → PkToolChatFile-DAT1tv52.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestGeolocation-BnV7A6SW.js → PkToolRequestGeolocation-p7Ip17F7.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestGeolocation-BnV7A6SW.js.map → PkToolRequestGeolocation-p7Ip17F7.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-QCbQ7bnl.js → PkToolRequestOAuthConnection-CtXSzKzM.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-QCbQ7bnl.js.map → PkToolRequestOAuthConnection-CtXSzKzM.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShareDocument-BIZkgcJ3.js → PkToolShareDocument-Qb2Lu5vh.js} +2 -2
- package/dist-vue/_chunks/{PkToolShareDocument-BIZkgcJ3.js.map → PkToolShareDocument-Qb2Lu5vh.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-DanzULWt.js → PkToolShowArtifact-Bskomw05.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-DanzULWt.js.map → PkToolShowArtifact-Bskomw05.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-DzttQBG6.js → PkToolShowContactForm-iQrlqv7j.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-DzttQBG6.js.map → PkToolShowContactForm-iQrlqv7j.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-BNa89wcw.js → PkToolShowDiagram-C-43uUoh.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowDiagram-BNa89wcw.js.map → PkToolShowDiagram-C-43uUoh.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-BXol1WE3.js → PkToolShowForm-CKXpqQxy.js} +4 -4
- package/dist-vue/_chunks/{PkToolShowForm-BXol1WE3.js.map → PkToolShowForm-CKXpqQxy.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-Dmr5zXTj.js → PkToolShowImageGallery-DLTn6JmU.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowImageGallery-Dmr5zXTj.js.map → PkToolShowImageGallery-DLTn6JmU.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowLocation-DCPaDtBI.js → PkToolShowLocation-B8FE_Sqd.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowLocation-DCPaDtBI.js.map → PkToolShowLocation-B8FE_Sqd.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-C_uIUG_G.js → PkToolShowProductList-hhSBAQVC.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-C_uIUG_G.js.map → PkToolShowProductList-hhSBAQVC.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-BHRNGn4s.js → PkToolShowSources-BiP9fVV2.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowSources-BHRNGn4s.js.map → PkToolShowSources-BiP9fVV2.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-DHCqxA1P.js → PkToolShowSuggestedReply-BRIzGNwx.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-DHCqxA1P.js.map → PkToolShowSuggestedReply-BRIzGNwx.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-P4H5A7ke.js → PkToolShowVideo-DJhsbDuX.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowVideo-P4H5A7ke.js.map → PkToolShowVideo-DJhsbDuX.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-BzNZHR7Q.js → PkToolShowWebPages-BAv66f5H.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-BzNZHR7Q.js.map → PkToolShowWebPages-BAv66f5H.js.map} +1 -1
- package/dist-vue/_chunks/{createChatbotApiClient-CQjxHqLr.js → createChatbotApiClient-DO4_I5hT.js} +21 -14
- package/dist-vue/_chunks/createChatbotApiClient-DO4_I5hT.js.map +1 -0
- package/dist-vue/_chunks/{useChatbotStore-CyZha9pf.js → useChatbotStore-Bj00X4yT.js} +1255 -1242
- package/dist-vue/_chunks/useChatbotStore-Bj00X4yT.js.map +1 -0
- package/dist-vue/_chunks/{useLightbox-gSzoBgNv.js → useLightbox-FDyQrPWe.js} +72 -13
- package/dist-vue/_chunks/useLightbox-FDyQrPWe.js.map +1 -0
- package/dist-vue/_chunks/{utils-8lO2Gj-m.js → utils-RwaXl9-x.js} +4 -4
- package/dist-vue/_chunks/{utils-8lO2Gj-m.js.map → utils-RwaXl9-x.js.map} +1 -1
- package/dist-vue/api.js +1 -1
- package/dist-vue/apps/web-component/src/components/EmbeddedChatWidget.ce.d.ts +4 -4
- package/dist-vue/apps/web-component/src/composables/usePagePointer.d.ts +14 -9
- package/dist-vue/apps/web-component/src/composables/usePendingMessage.d.ts +29 -15
- package/dist-vue/apps/web-component/src/composables/useSelectionActions.d.ts +77 -0
- package/dist-vue/composables.js +40 -8
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +5401 -5321
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +28 -2
- package/dist-vue/packages/components/src/chat/PkAgentSelectionActionsSettings.d.ts +25 -0
- package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +23 -3
- package/dist-vue/packages/components/src/chat/PkChatbot.d.ts +2 -1
- package/dist-vue/packages/components/src/chat/PkChatbotInput.d.ts +2 -0
- package/dist-vue/packages/components/src/chat/PkSelectionActions.d.ts +2 -12
- package/dist-vue/packages/components/src/chat/PkSelectionAnswerCard.d.ts +41 -0
- package/dist-vue/packages/composable/src/chatbot/api/createChatbotApiClient.d.ts +6 -0
- package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +4 -1
- package/package.json +1 -1
- package/dist/_chunks/PkFilePreview-8nVPKv8k.js.map +0 -1
- package/dist/_chunks/useLightbox-BEEzZ0qT.js.map +0 -1
- package/dist-vue/_chunks/PkChatbot-Bpo22_yE.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotInput-BVu1b2Te.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotViewChat-Drp0At_n.js.map +0 -1
- package/dist-vue/_chunks/PkFilePreview-z7JcRtjP.js.map +0 -1
- package/dist-vue/_chunks/createChatbotApiClient-CQjxHqLr.js.map +0 -1
- package/dist-vue/_chunks/useChatbotStore-CyZha9pf.js.map +0 -1
- package/dist-vue/_chunks/useLightbox-gSzoBgNv.js.map +0 -1
|
@@ -1,83 +1,35 @@
|
|
|
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,
|
|
3
|
-
import { r as
|
|
4
|
-
import { i as
|
|
5
|
-
import { B as
|
|
6
|
-
import { d as
|
|
7
|
-
import { t as
|
|
8
|
-
import { t as
|
|
9
|
-
import { t as
|
|
10
|
-
import { t as
|
|
11
|
-
|
|
12
|
-
E();
|
|
13
|
-
var G = "(hover: hover) and (pointer: fine)";
|
|
14
|
-
function me(e) {
|
|
15
|
-
let t = document.getSelection();
|
|
16
|
-
if (!t || t.rangeCount === 0) return;
|
|
17
|
-
if (e.nodeType === Node.DOCUMENT_NODE) return t.getRangeAt(0).cloneRange();
|
|
18
|
-
let n = e;
|
|
19
|
-
if (t.getComposedRanges) {
|
|
20
|
-
let e;
|
|
21
|
-
try {
|
|
22
|
-
e = t.getComposedRanges({ shadowRoots: [n] });
|
|
23
|
-
} catch {
|
|
24
|
-
e = t.getComposedRanges(n);
|
|
25
|
-
}
|
|
26
|
-
let [r] = e;
|
|
27
|
-
if (!r) return;
|
|
28
|
-
let i = document.createRange();
|
|
29
|
-
return i.setStart(r.startContainer, r.startOffset), i.setEnd(r.endContainer, r.endOffset), i;
|
|
30
|
-
}
|
|
31
|
-
let r = n.getSelection?.();
|
|
32
|
-
return r && r.rangeCount > 0 ? r.getRangeAt(0).cloneRange() : void 0;
|
|
33
|
-
}
|
|
34
|
-
function he({ root: e, enabled: t = () => !0, delay: n = 150, minChars: r = 2 }) {
|
|
35
|
-
let i = M(), a, o = () => {
|
|
36
|
-
clearTimeout(a), i.value = void 0;
|
|
37
|
-
}, s = () => {
|
|
38
|
-
let n = e();
|
|
39
|
-
if (!n || !t()) return;
|
|
40
|
-
let i = me(n);
|
|
41
|
-
if (!i || i.collapsed || i.toString().trim().length < r) return;
|
|
42
|
-
let a = i.getBoundingClientRect();
|
|
43
|
-
return {
|
|
44
|
-
range: i,
|
|
45
|
-
start: i.getClientRects()[0] ?? a,
|
|
46
|
-
box: a
|
|
47
|
-
};
|
|
48
|
-
}, c = () => {
|
|
49
|
-
o(), a = setTimeout(() => {
|
|
50
|
-
i.value = s();
|
|
51
|
-
}, n);
|
|
52
|
-
};
|
|
53
|
-
return typeof document < "u" && typeof matchMedia == "function" && matchMedia(G).matches && (document.addEventListener("selectionchange", c), D(() => {
|
|
54
|
-
clearTimeout(a), document.removeEventListener("selectionchange", c);
|
|
55
|
-
})), {
|
|
56
|
-
selection: i,
|
|
57
|
-
clear: o
|
|
58
|
-
};
|
|
59
|
-
}
|
|
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 T, v as E, vt as te, w as D, wt as O, x as ne, 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 { B as P, G as F, H as ie, K as I, U as ae, V as L, W as R, o as z, z as B } from "./utils-BZuri2jT.js";
|
|
6
|
+
import { d as V, l as oe } from "./dist-D6oUr4J_.js";
|
|
7
|
+
import { t as se } from "./index.es-D-aOuzzp.js";
|
|
8
|
+
import { t as ce } from "./VvButtonLocalized-B32dBwWJ.js";
|
|
9
|
+
import { n as le, t as ue } from "./PkSelectionActions-CUymhwsG.js";
|
|
10
|
+
import { t as H } from "./_plugin-vue_export-helper-Djzt4Yr7.js";
|
|
11
|
+
import { t as U } from "./PkEditorRadioButtons-ClUWPayk.js";
|
|
60
12
|
// ../../packages/components/src/chat/fileSelection.ts
|
|
61
|
-
var
|
|
62
|
-
let t = [...new Set(e)].sort((e, t) =>
|
|
13
|
+
var de = 2e3, fe = 1e3, W = 60, G = 1400, pe = 20, K = (e) => Number(e.slice(1)), q = (e) => {
|
|
14
|
+
let t = [...new Set(e)].sort((e, t) => K(e) - K(t)), n = [];
|
|
63
15
|
for (let e of t) {
|
|
64
16
|
let t = n[n.length - 1];
|
|
65
|
-
t &&
|
|
17
|
+
t && K(e) === K(t.to) + 1 ? t.to = e : n.push({
|
|
66
18
|
from: e,
|
|
67
19
|
to: e
|
|
68
20
|
});
|
|
69
21
|
}
|
|
70
22
|
return n.slice(0, 100);
|
|
71
|
-
},
|
|
23
|
+
}, me = (e, t) => {
|
|
72
24
|
let n = [];
|
|
73
25
|
for (let r = e.indexOf(t); r >= 0;) n.push(r), r = e.indexOf(t, r + t.length);
|
|
74
26
|
return n;
|
|
75
|
-
},
|
|
76
|
-
let r =
|
|
27
|
+
}, he = (e, t, n) => {
|
|
28
|
+
let r = me(e, e.slice(t, t + n));
|
|
77
29
|
if (r.length < 2) return {};
|
|
78
30
|
let i = t, a = t + n;
|
|
79
|
-
for (let t = !0; a - i <=
|
|
80
|
-
if (
|
|
31
|
+
for (let t = !0; a - i <= G; t = !t) {
|
|
32
|
+
if (me(e, e.slice(i, a)).length === 1) return { find: e.slice(i, a) };
|
|
81
33
|
if (t && i > 0) i = e.slice(0, i).replace(/\S*\s*$/, "").length;
|
|
82
34
|
else if (a < e.length) {
|
|
83
35
|
let t = e.slice(a).match(/^\s*\S*/)?.[0] ?? "";
|
|
@@ -88,17 +40,17 @@ var ge = 2e3, _e = 1e3, K = 60, ve = 1400, q = 20, J = (e) => Number(e.slice(1))
|
|
|
88
40
|
index: r.indexOf(t) + 1 || 1,
|
|
89
41
|
of: r.length
|
|
90
42
|
} };
|
|
91
|
-
},
|
|
43
|
+
}, J = (e) => (e.querySelectorAll("[data-quote-skip]").forEach((e) => e.remove()), e.querySelectorAll("[data-paragraph]").forEach((e) => e.append("\n")), e.textContent ?? ""), ge = (e) => e.length > fe ? `${e.slice(0, fe / 2)} […] ${e.slice(-500)}` : e, _e = (e, t, n) => {
|
|
92
44
|
if (!e.contains(t.commonAncestorContainer)) return;
|
|
93
45
|
let r = [...e.querySelectorAll("[data-paragraph]")].filter((e) => !e.closest(n) && t.intersectsNode(e));
|
|
94
46
|
if (!r.length) return;
|
|
95
|
-
let i = r.flatMap((e) => e.dataset.paragraph.split(" ")), a =
|
|
47
|
+
let i = r.flatMap((e) => e.dataset.paragraph.split(" ")), a = J(t.cloneContents()), o = a.trim();
|
|
96
48
|
if (o.length < 2) return;
|
|
97
49
|
let s = {
|
|
98
50
|
format: "docx",
|
|
99
|
-
runs:
|
|
51
|
+
runs: q(i),
|
|
100
52
|
paragraphCount: new Set(i).size,
|
|
101
|
-
quote:
|
|
53
|
+
quote: ge(o),
|
|
102
54
|
measure: () => {
|
|
103
55
|
let e = t.getBoundingClientRect(), n = t.getClientRects()[0] ?? e;
|
|
104
56
|
return {
|
|
@@ -117,17 +69,17 @@ var ge = 2e3, _e = 1e3, K = 60, ve = 1400, q = 20, J = (e) => Number(e.slice(1))
|
|
|
117
69
|
if (r.length === 1) {
|
|
118
70
|
let e = r[0], n = document.createRange();
|
|
119
71
|
n.selectNodeContents(e);
|
|
120
|
-
let i =
|
|
72
|
+
let i = J(n.cloneContents()).replace(/\n$/, ""), c = document.createRange();
|
|
121
73
|
c.setStart(e, 0), c.setEnd(t.startContainer, t.startOffset);
|
|
122
|
-
let l =
|
|
123
|
-
s.before = i.slice(Math.max(0, l -
|
|
74
|
+
let l = J(c.cloneContents()).length + (a.length - a.trimStart().length);
|
|
75
|
+
s.before = i.slice(Math.max(0, l - W), l), s.after = i.slice(l + o.length, l + o.length + W), Object.assign(s, he(i, l, o.length));
|
|
124
76
|
}
|
|
125
77
|
return s;
|
|
126
|
-
},
|
|
78
|
+
}, Y = (e) => {
|
|
127
79
|
let t = "";
|
|
128
80
|
for (let n = e; n > 0; n = Math.floor((n - 1) / 26)) t = String.fromCharCode(65 + (n - 1) % 26) + t;
|
|
129
81
|
return t;
|
|
130
|
-
},
|
|
82
|
+
}, ve = (e, t) => {
|
|
131
83
|
let n = { ...t }, r = e.rows.flatMap((e) => e.cells.filter((e) => e.span).map((t) => ({
|
|
132
84
|
r1: e.row,
|
|
133
85
|
r2: e.row + t.span.rows - 1,
|
|
@@ -138,7 +90,7 @@ var ge = 2e3, _e = 1e3, K = 60, ve = 1400, q = 20, J = (e) => Number(e.slice(1))
|
|
|
138
90
|
e = !1;
|
|
139
91
|
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);
|
|
140
92
|
}
|
|
141
|
-
let i = `${
|
|
93
|
+
let i = `${Y(n.c1)}${n.r1}`, a = `${Y(n.c2)}${n.r2}`, o = (e.hiddenRows ?? []).filter((e) => e >= n.r1 && e <= n.r2), s = e.columns.filter((e) => e.hidden && e.col >= n.c1 && e.col <= n.c2).map((e) => Y(e.col)), 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, pe).map((e) => String(e.value)).join("; ").slice(0, 500);
|
|
142
94
|
return {
|
|
143
95
|
format: "xlsx",
|
|
144
96
|
sheet: e.name,
|
|
@@ -149,207 +101,96 @@ var ge = 2e3, _e = 1e3, K = 60, ve = 1400, q = 20, J = (e) => Number(e.slice(1))
|
|
|
149
101
|
...c ? { sample: c } : {}
|
|
150
102
|
};
|
|
151
103
|
};
|
|
152
|
-
// ../../packages/components/src/chat/PkSelectionActions.vue?vue&type=script&setup=true&lang.ts
|
|
153
|
-
C(), O(), E(), p();
|
|
154
|
-
var Q = ["onKeydown"], we = ["placeholder", "aria-label"], $ = ["disabled"], Te = ["aria-label"], Ee = { class: "pk-selection-actions__text" }, De = {
|
|
155
|
-
key: 0,
|
|
156
|
-
class: "pk-selection-actions__text"
|
|
157
|
-
}, Oe = ["onClick"], ke = /*#__PURE__*/ W(/* @__PURE__ */ N({
|
|
158
|
-
__name: "PkSelectionActions",
|
|
159
|
-
props: /*@__PURE__*/ l({
|
|
160
|
-
actions: { type: Array },
|
|
161
|
-
anchor: { type: Object },
|
|
162
|
-
strategy: { type: String },
|
|
163
|
-
hint: { type: String },
|
|
164
|
-
note: { type: String },
|
|
165
|
-
noteAction: { type: String },
|
|
166
|
-
touch: { type: Boolean }
|
|
167
|
-
}, {
|
|
168
|
-
asking: {
|
|
169
|
-
type: Boolean,
|
|
170
|
-
default: !1
|
|
171
|
-
},
|
|
172
|
-
askingModifiers: {}
|
|
173
|
-
}),
|
|
174
|
-
emits: /*@__PURE__*/ l([
|
|
175
|
-
"action",
|
|
176
|
-
"ask",
|
|
177
|
-
"note",
|
|
178
|
-
"close"
|
|
179
|
-
], ["update:asking"]),
|
|
180
|
-
setup(e, { emit: t }) {
|
|
181
|
-
let n = e, o = t, c = s(e, "asking"), { t: l } = te({ useScope: "global" }), d = h("barEl"), f = h("inputEl"), { width: p, height: g } = de(d, void 0, { box: "border-box" }), S = x(() => B({
|
|
182
|
-
...n.anchor,
|
|
183
|
-
bar: {
|
|
184
|
-
width: p.value,
|
|
185
|
-
height: g.value
|
|
186
|
-
},
|
|
187
|
-
touch: n.touch
|
|
188
|
-
})), C = b(), E = b(""), D = async (e, t) => {
|
|
189
|
-
C.value = {
|
|
190
|
-
id: e,
|
|
191
|
-
placeholder: t
|
|
192
|
-
}, E.value = "", c.value = !0, await i(), f.value?.focus();
|
|
193
|
-
}, O = () => {
|
|
194
|
-
C.value = void 0, c.value = !1;
|
|
195
|
-
}, k = (e) => {
|
|
196
|
-
e.asks ? D(e.id, e.asks) : o("action", e.id);
|
|
197
|
-
}, M = () => {
|
|
198
|
-
let e = E.value.trim();
|
|
199
|
-
e && C.value && (C.value.id ? o("action", C.value.id, e) : o("ask", e), O());
|
|
200
|
-
}, N = () => {
|
|
201
|
-
C.value ? O() : o("close");
|
|
202
|
-
};
|
|
203
|
-
return (t, n) => (L(), I("div", {
|
|
204
|
-
class: r(["pk-selection-actions", {
|
|
205
|
-
"pk-selection-actions--fixed": e.strategy === "fixed",
|
|
206
|
-
"pk-selection-actions--asking": !!C.value
|
|
207
|
-
}]),
|
|
208
|
-
style: u({
|
|
209
|
-
top: `${S.value.top}px`,
|
|
210
|
-
left: `${S.value.left}px`
|
|
211
|
-
}),
|
|
212
|
-
onKeydown: A(_(N, ["stop"]), ["esc"])
|
|
213
|
-
}, [C.value ? (L(), I("form", {
|
|
214
|
-
key: 0,
|
|
215
|
-
ref_key: "barEl",
|
|
216
|
-
ref: d,
|
|
217
|
-
class: "pk-selection-actions__bar pk-selection-actions__bar--field",
|
|
218
|
-
onSubmit: _(M, ["prevent"])
|
|
219
|
-
}, [T(y("input", {
|
|
220
|
-
ref_key: "inputEl",
|
|
221
|
-
ref: f,
|
|
222
|
-
"onUpdate:modelValue": n[0] ||= (e) => E.value = e,
|
|
223
|
-
class: "pk-selection-actions__input",
|
|
224
|
-
type: "text",
|
|
225
|
-
maxlength: "500",
|
|
226
|
-
placeholder: C.value.placeholder,
|
|
227
|
-
"aria-label": C.value.placeholder
|
|
228
|
-
}, null, 8, we), [[ee, E.value]]), y("button", {
|
|
229
|
-
type: "submit",
|
|
230
|
-
class: "pk-selection-actions__button pk-selection-actions__button--send",
|
|
231
|
-
disabled: !E.value.trim()
|
|
232
|
-
}, w(P(l)("action.send")), 9, $)], 544)) : (L(), I("div", {
|
|
233
|
-
key: 1,
|
|
234
|
-
ref_key: "barEl",
|
|
235
|
-
ref: d,
|
|
236
|
-
class: "pk-selection-actions__bar",
|
|
237
|
-
role: "toolbar",
|
|
238
|
-
"aria-label": P(l)("selectionActions.label")
|
|
239
|
-
}, [e.note ? (L(), I(v, { key: 0 }, [y("span", Ee, w(e.note), 1), e.noteAction ? (L(), I("button", {
|
|
240
|
-
key: 0,
|
|
241
|
-
type: "button",
|
|
242
|
-
class: "pk-selection-actions__button",
|
|
243
|
-
onMousedown: n[1] ||= _(() => {}, ["prevent"]),
|
|
244
|
-
onClick: n[2] ||= (e) => o("note")
|
|
245
|
-
}, w(e.noteAction), 33)) : j("", !0)], 64)) : (L(), I(v, { key: 1 }, [
|
|
246
|
-
e.hint ? (L(), I("span", De, w(e.hint), 1)) : j("", !0),
|
|
247
|
-
(L(!0), I(v, null, m(e.actions, (e) => (L(), I("button", {
|
|
248
|
-
key: e.id,
|
|
249
|
-
type: "button",
|
|
250
|
-
class: "pk-selection-actions__button",
|
|
251
|
-
onMousedown: n[3] ||= _(() => {}, ["prevent"]),
|
|
252
|
-
onClick: (t) => k(e)
|
|
253
|
-
}, w(e.label), 41, Oe))), 128)),
|
|
254
|
-
y("button", {
|
|
255
|
-
type: "button",
|
|
256
|
-
class: "pk-selection-actions__button",
|
|
257
|
-
onMousedown: n[4] ||= _(() => {}, ["prevent"]),
|
|
258
|
-
onClick: n[5] ||= (e) => D(void 0, P(l)("selectionActions.askPlaceholder"))
|
|
259
|
-
}, w(P(l)("selectionActions.ask")), 33)
|
|
260
|
-
], 64))], 8, Te)), a(t.$slots, "card")], 46, Q));
|
|
261
|
-
}
|
|
262
|
-
}), [["styles", [".pk-selection-actions{z-index:10;max-width:min(32rem, 100% - var(--spacing-16));position:absolute}.pk-selection-actions--fixed{z-index:2147483647;position:fixed}.pk-selection-actions--asking{width:min(var(--spacing-384), 100% - var(--spacing-16))}.pk-selection-actions__bar{align-items:center;gap:var(--spacing-4);width:max-content;max-width:100%;padding:var(--spacing-4);border-radius:var(--rounded-lg);background-color:var(--color-word-1);color:var(--color-surface);font-family:var(--font-sans);font-size:var(--text-14);font-weight:var(--font-medium);box-shadow:var(--shadow-lg);flex-wrap:wrap;display:flex}.pk-selection-actions__bar--field{flex-wrap:nowrap;width:100%}.pk-selection-actions__text{padding:0 var(--spacing-8);opacity:.75;font-size:var(--text-12);font-weight:var(--font-normal)}.pk-selection-actions__button{border-radius:var(--rounded);padding:var(--spacing-6) var(--spacing-10);color:inherit;font:inherit;cursor:pointer;background-color:#0000;border:0;flex-shrink:0}.pk-selection-actions__button:hover{background-color:color-mix(in srgb, var(--color-surface) 16%, transparent)}.pk-selection-actions__button:focus-visible{outline:var(--spacing-2) solid var(--color-surface);outline-offset:calc(-1 * var(--spacing-2))}.pk-selection-actions__button--send{background-color:var(--color-surface);color:var(--color-word-1)}.pk-selection-actions__button--send:hover{background-color:var(--color-surface)}.pk-selection-actions__button--send:disabled{opacity:.5;cursor:default}.pk-selection-actions__input{border-radius:var(--rounded);min-width:0;padding:var(--spacing-6) var(--spacing-8);background-color:color-mix(in srgb, var(--color-surface) 12%, transparent);color:inherit;font:inherit;font-weight:var(--font-normal);border:0;flex:1}.pk-selection-actions__input::placeholder{color:inherit;opacity:.6}.pk-selection-actions__input:focus-visible{outline:var(--spacing-2) solid var(--color-surface);outline-offset:calc(-1 * var(--spacing-2))}"]]]);
|
|
263
104
|
// ../../packages/components/src/chat/PkSpreadsheetPreview.vue?vue&type=script&setup=true&lang.ts
|
|
264
|
-
|
|
265
|
-
var
|
|
105
|
+
x(), C(), f(), w();
|
|
106
|
+
var ye = { class: "pk-spreadsheet-preview" }, be = { class: "pk-spreadsheet-preview__bar" }, xe = ["aria-label"], Se = ["aria-label"], Ce = ["aria-label"], we = [
|
|
266
107
|
"rowspan",
|
|
267
108
|
"colspan",
|
|
268
109
|
"data-focus",
|
|
269
110
|
"title",
|
|
270
111
|
"onMousedown",
|
|
271
112
|
"onMouseenter"
|
|
272
|
-
],
|
|
113
|
+
], Te = {
|
|
273
114
|
key: 1,
|
|
274
115
|
class: "pk-spreadsheet-preview__more"
|
|
275
|
-
},
|
|
116
|
+
}, Ee = ["aria-label"], De = ["aria-current", "onClick"], X = { class: "pk-spreadsheet-preview__status" }, Oe = { class: "pk-spreadsheet-preview__info" }, ke = ["title"], Ae = ["title"], je = {
|
|
276
117
|
key: 2,
|
|
277
118
|
class: "pk-spreadsheet-preview__stats"
|
|
278
|
-
},
|
|
119
|
+
}, Me = {
|
|
279
120
|
key: 0,
|
|
280
121
|
class: "pk-spreadsheet-preview__average"
|
|
281
|
-
},
|
|
122
|
+
}, Ne = { key: 1 }, Pe = { class: "pk-spreadsheet-preview__zoom" }, Fe = { class: "pk-spreadsheet-preview__percent" }, Ie = 64, Le = 20, Re = 28, ze = 44, Be = /*#__PURE__*/ H(/* @__PURE__ */ D({
|
|
282
123
|
__name: "PkSpreadsheetPreview",
|
|
283
|
-
props: /*@__PURE__*/
|
|
124
|
+
props: /*@__PURE__*/ c({ preview: { type: null } }, {
|
|
284
125
|
sheet: { default: 0 },
|
|
285
126
|
sheetModifiers: {},
|
|
286
127
|
zoom: { default: 1 },
|
|
287
128
|
zoomModifiers: {}
|
|
288
129
|
}),
|
|
289
|
-
emits: /*@__PURE__*/
|
|
130
|
+
emits: /*@__PURE__*/ c(["select"], ["update:sheet", "update:zoom"]),
|
|
290
131
|
setup(e, { emit: t }) {
|
|
291
|
-
let n = e, a = t, { t:
|
|
132
|
+
let n = e, a = t, { t: s, locale: c } = re({ useScope: "global" }), f = o(e, "sheet"), h = o(e, "zoom"), x = m("scrollEl"), { width: C, height: w } = oe(x, {
|
|
292
133
|
width: 0,
|
|
293
134
|
height: 0
|
|
294
|
-
}, { box: "border-box" }), T =
|
|
295
|
-
|
|
296
|
-
|
|
135
|
+
}, { box: "border-box" }), T = b(() => n.preview.sheets[f.value] ?? n.preview.sheets[0]);
|
|
136
|
+
u(() => n.preview, () => {
|
|
137
|
+
f.value = 0;
|
|
297
138
|
});
|
|
298
|
-
let
|
|
139
|
+
let te = (e) => {
|
|
299
140
|
let t = "";
|
|
300
141
|
for (let n = e; n > 0; n = Math.floor((n - 1) / 26)) t = String.fromCharCode(65 + (n - 1) % 26) + t;
|
|
301
142
|
return t;
|
|
302
|
-
}, D =
|
|
143
|
+
}, D = b(() => {
|
|
303
144
|
let e = T.value;
|
|
304
145
|
if (!e) return [];
|
|
305
|
-
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 =
|
|
146
|
+
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 = ze, a = C.value / h.value;
|
|
306
147
|
for (let o = 1; o <= e.lastColumn || !e.moreColumns && (o <= e.lastColumn + 2 || i < a); o++) {
|
|
307
148
|
if (t.has(o)) continue;
|
|
308
|
-
let e = n.get(o) ??
|
|
149
|
+
let e = n.get(o) ?? Ie;
|
|
309
150
|
r.push({
|
|
310
151
|
col: o,
|
|
311
152
|
width: e
|
|
312
153
|
}), i += e;
|
|
313
154
|
}
|
|
314
155
|
return r;
|
|
315
|
-
}),
|
|
156
|
+
}), P = b(() => D.value.reduce((e, t) => e + t.width, ze)), F = b(() => D.value.map((e) => `${e.col}:${e.width}`).join(",")), ie = /* @__PURE__ */ new WeakMap(), I = b(() => {
|
|
316
157
|
let e = T.value;
|
|
317
158
|
if (!e) return [];
|
|
318
|
-
let t = new Set(e.hiddenRows ?? []), n = new Map(e.rows.map((e) => [e.row, e.height])), r = Math.ceil((
|
|
319
|
-
a || (a = /* @__PURE__ */ new Map(),
|
|
159
|
+
let t = new Set(e.hiddenRows ?? []), n = new Map(e.rows.map((e) => [e.row, e.height])), r = Math.ceil((w.value / h.value - Re) / Le), i = e.moreRows ? e.lastRow : Math.max(e.lastRow + 5, r + t.size), a = ie.get(e);
|
|
160
|
+
a || (a = /* @__PURE__ */ new Map(), ie.set(e, a));
|
|
320
161
|
let o = a;
|
|
321
162
|
return Array.from({ length: i }, (e, t) => t + 1).filter((e) => !t.has(e)).map((e) => {
|
|
322
163
|
let t = o.get(e);
|
|
323
164
|
return t || (t = {
|
|
324
165
|
row: e,
|
|
325
|
-
height: n.get(e) ??
|
|
166
|
+
height: n.get(e) ?? Le
|
|
326
167
|
}, o.set(e, t)), t;
|
|
327
168
|
});
|
|
328
|
-
}),
|
|
169
|
+
}), ae = b(() => {
|
|
329
170
|
let e = /* @__PURE__ */ new Map();
|
|
330
171
|
for (let t of T.value?.rows ?? []) for (let n of t.cells) e.set(`${t.row},${n.col}`, n);
|
|
331
172
|
return e;
|
|
332
|
-
}),
|
|
173
|
+
}), L = b(() => {
|
|
333
174
|
let e = /* @__PURE__ */ new Map();
|
|
334
175
|
for (let t of T.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}`, {
|
|
335
176
|
row: t.row,
|
|
336
177
|
col: n.col
|
|
337
178
|
});
|
|
338
179
|
return e;
|
|
339
|
-
}),
|
|
340
|
-
let n =
|
|
180
|
+
}), R = (e, t) => ae.value.get(`${e},${t}`), z = (e, t) => {
|
|
181
|
+
let n = R(e, t)?.span;
|
|
341
182
|
if (n) return {
|
|
342
|
-
rows:
|
|
183
|
+
rows: I.value.filter((t) => t.row >= e && t.row < e + n.rows).length,
|
|
343
184
|
cols: D.value.filter((e) => e.col >= t && e.col < t + n.cols).length
|
|
344
185
|
};
|
|
345
186
|
}, B = (e) => e?.style === void 0 ? void 0 : n.preview.styles[e.style], V = (e) => {
|
|
346
187
|
let t = e.numFmt === void 0 ? void 0 : n.preview.numberFormats?.[e.numFmt], r = e.value;
|
|
347
188
|
if (t !== void 0) try {
|
|
348
|
-
return e.format === "date" ? e.serial === void 0 ? void 0 :
|
|
189
|
+
return e.format === "date" ? e.serial === void 0 ? void 0 : M(t, e.serial, c.value, n.preview.date1904) : typeof r == "number" ? j(t) ? M(t, r, c.value, n.preview.date1904) : N(t, r, c.value) : void 0;
|
|
349
190
|
} catch {
|
|
350
191
|
return;
|
|
351
192
|
}
|
|
352
|
-
},
|
|
193
|
+
}, se = (e, t) => {
|
|
353
194
|
let n = V(e);
|
|
354
195
|
if (n) return n.text;
|
|
355
196
|
let r = e.decimals === void 0 ? { maximumFractionDigits: 10 } : {
|
|
@@ -365,18 +206,18 @@ var Ae = { class: "pk-spreadsheet-preview" }, je = { class: "pk-spreadsheet-prev
|
|
|
365
206
|
currency: e.currency
|
|
366
207
|
} : {}
|
|
367
208
|
}).format(t);
|
|
368
|
-
},
|
|
209
|
+
}, le = (e) => {
|
|
369
210
|
let t = /* @__PURE__ */ new Date(`${e}T00:00:00Z`);
|
|
370
211
|
return Number.isNaN(t.getTime()) ? e : new Intl.DateTimeFormat(c.value, {
|
|
371
212
|
dateStyle: "short",
|
|
372
213
|
timeZone: "UTC"
|
|
373
214
|
}).format(t);
|
|
374
|
-
},
|
|
215
|
+
}, ue = (e) => {
|
|
375
216
|
if (!e) return "";
|
|
376
217
|
if (e.missing) return "—";
|
|
377
218
|
let t = e.value;
|
|
378
|
-
return t === void 0 ? "" : typeof t == "boolean" ?
|
|
379
|
-
},
|
|
219
|
+
return t === void 0 ? "" : typeof t == "boolean" ? s(t ? "chatFilePreview.true" : "chatFilePreview.false") : e.format === "date" && typeof t == "string" ? V(e)?.text ?? le(t) : typeof t == "number" ? se(e, t) : t;
|
|
220
|
+
}, H = (e) => {
|
|
380
221
|
if (!e) return "";
|
|
381
222
|
if (e.formula) return `=${e.formula}`;
|
|
382
223
|
let t = e.value;
|
|
@@ -384,8 +225,8 @@ var Ae = { class: "pk-spreadsheet-preview" }, je = { class: "pk-spreadsheet-prev
|
|
|
384
225
|
useGrouping: !1,
|
|
385
226
|
maximumFractionDigits: 15,
|
|
386
227
|
...e.format === "percent" ? { style: "percent" } : {}
|
|
387
|
-
}).format(t) :
|
|
388
|
-
},
|
|
228
|
+
}).format(t) : ue(e);
|
|
229
|
+
}, U = (e) => e ? `${e.width}px solid ${e.color}` : void 0, de = (e, t, n) => {
|
|
389
230
|
let r = B(e), i = e?.value, a = typeof i == "number" || e?.format === "date" || !!e?.missing, o = {
|
|
390
231
|
textAlign: r?.align ?? (a ? "right" : typeof i == "boolean" || e?.format === "error" ? "center" : "left"),
|
|
391
232
|
verticalAlign: r?.valign === "top" ? "top" : r?.valign === "middle" ? "middle" : "bottom",
|
|
@@ -399,8 +240,8 @@ var Ae = { class: "pk-spreadsheet-preview" }, je = { class: "pk-spreadsheet-prev
|
|
|
399
240
|
let e = `${4 + r.indent * 9}px`;
|
|
400
241
|
o.textAlign === "right" ? o.paddingRight = e : o.paddingLeft = e;
|
|
401
242
|
}
|
|
402
|
-
return
|
|
403
|
-
},
|
|
243
|
+
return fe(t, n) ? (o.borderStyle = "hidden", o.boxShadow = _e(e, t, n)) : (o.borderTop = U(r?.borders?.top), o.borderRight = U(r?.borders?.right), o.borderBottom = U(r?.borders?.bottom), o.borderLeft = U(r?.borders?.left), o.boxShadow = pe(e, t, n).join(", ")), Object.assign(o, He(t, n)), o;
|
|
244
|
+
}, fe = (e, t) => {
|
|
404
245
|
let n = T.value?.frozen;
|
|
405
246
|
return !!n && (e <= n.rows || t <= n.cols);
|
|
406
247
|
}, W = {
|
|
@@ -408,18 +249,18 @@ var Ae = { class: "pk-spreadsheet-preview" }, je = { class: "pk-spreadsheet-prev
|
|
|
408
249
|
right: (e) => `inset -${e.width}px 0 0 ${e.color}`,
|
|
409
250
|
bottom: (e) => `inset 0 -${e.width}px 0 ${e.color}`,
|
|
410
251
|
left: (e) => `inset ${e.width}px 0 0 ${e.color}`
|
|
411
|
-
},
|
|
252
|
+
}, G = (...e) => e.reduce((e, t) => t && (!e || t.width > e.width) ? t : e, void 0), pe = (e, t, n) => {
|
|
412
253
|
let r = B(e)?.borders;
|
|
413
|
-
return [t ===
|
|
414
|
-
},
|
|
254
|
+
return [t === I.value[0]?.row && r?.top && W.top(r.top), n === D.value[0]?.col && r?.left && W.left(r.left)].filter((e) => !!e);
|
|
255
|
+
}, K = b(() => I.value.map((e) => e.row)), q = b(() => D.value.map((e) => e.col)), me = b(() => new Map(K.value.map((e, t) => [e, t]))), he = b(() => new Map(q.value.map((e, t) => [e, t]))), J = (e, t, n, r) => {
|
|
415
256
|
let i = [], a = t.get(n) ?? e.length;
|
|
416
257
|
for (; a < e.length && e[a] < n + r; a++) i.push(e[a]);
|
|
417
258
|
return {
|
|
418
259
|
spanned: i,
|
|
419
260
|
next: e[a]
|
|
420
261
|
};
|
|
421
|
-
},
|
|
422
|
-
let { spanned: i, next: a } = K
|
|
262
|
+
}, ge = (e, t, n, r) => {
|
|
263
|
+
let { spanned: i, next: a } = J(K.value, me.value, t, e?.span?.rows ?? 1), { spanned: o, next: s } = J(q.value, he.value, n, e?.span?.cols ?? 1);
|
|
423
264
|
return (r === "right" ? s === void 0 ? [] : i.map((e) => ({
|
|
424
265
|
row: e,
|
|
425
266
|
col: s
|
|
@@ -427,63 +268,63 @@ var Ae = { class: "pk-spreadsheet-preview" }, je = { class: "pk-spreadsheet-prev
|
|
|
427
268
|
row: a,
|
|
428
269
|
col: e
|
|
429
270
|
}))).map((e) => {
|
|
430
|
-
let t =
|
|
431
|
-
return
|
|
271
|
+
let t = L.value.get(`${e.row},${e.col}`) ?? e;
|
|
272
|
+
return R(t.row, t.col);
|
|
432
273
|
});
|
|
433
|
-
},
|
|
434
|
-
let r = B(e)?.borders, i =
|
|
274
|
+
}, _e = (e, t, n) => {
|
|
275
|
+
let r = B(e)?.borders, i = G(r?.right, ...ge(e, t, n, "right").map((e) => B(e)?.borders?.left)), a = G(r?.bottom, ...ge(e, t, n, "bottom").map((e) => B(e)?.borders?.top)), o = T.value?.gridlines;
|
|
435
276
|
return [
|
|
436
277
|
i ? W.right(i) : o && "inset calc(var(--border) * -1) 0 0 var(--pk-spreadsheet-gridline)",
|
|
437
278
|
a ? W.bottom(a) : o && "inset 0 calc(var(--border) * -1) 0 var(--pk-spreadsheet-gridline)",
|
|
438
|
-
...
|
|
279
|
+
...pe(e, t, n)
|
|
439
280
|
].filter(Boolean).join(", ");
|
|
440
|
-
},
|
|
281
|
+
}, Y = (e) => Re + I.value.filter((t) => t.row < e).reduce((e, t) => e + t.height, 0), Be = (e) => ze + D.value.filter((t) => t.col < e).reduce((e, t) => e + t.width, 0), Ve = b(() => {
|
|
441
282
|
let e = T.value?.frozen;
|
|
442
283
|
return {
|
|
443
|
-
top:
|
|
444
|
-
left:
|
|
284
|
+
top: Y((e?.rows ?? 0) + 1),
|
|
285
|
+
left: Be((e?.cols ?? 0) + 1)
|
|
445
286
|
};
|
|
446
|
-
}),
|
|
287
|
+
}), He = (e, t) => {
|
|
447
288
|
let n = T.value?.frozen;
|
|
448
289
|
if (!n) return {};
|
|
449
290
|
let r = {};
|
|
450
|
-
return e <= n.rows && (r.position = "sticky", r.top = `${
|
|
451
|
-
},
|
|
291
|
+
return e <= n.rows && (r.position = "sticky", r.top = `${Y(e)}px`, r.scrollMarginTop = r.top, r.zIndex = 0), t <= n.cols && (r.position = "sticky", r.left = `${Be(t)}px`, r.scrollMarginLeft = r.left, r.zIndex = +(e <= n.rows)), r;
|
|
292
|
+
}, Z = y({
|
|
452
293
|
row: 1,
|
|
453
294
|
col: 1
|
|
454
|
-
}),
|
|
295
|
+
}), Q = y({
|
|
455
296
|
row: 1,
|
|
456
297
|
col: 1
|
|
457
298
|
});
|
|
458
|
-
|
|
459
|
-
|
|
299
|
+
u(T, () => {
|
|
300
|
+
Z.value = {
|
|
460
301
|
row: 1,
|
|
461
302
|
col: 1
|
|
462
|
-
},
|
|
303
|
+
}, Q.value = {
|
|
463
304
|
row: 1,
|
|
464
305
|
col: 1
|
|
465
306
|
};
|
|
466
307
|
});
|
|
467
|
-
let
|
|
468
|
-
r1: Math.min(
|
|
469
|
-
r2: Math.max(
|
|
470
|
-
c1: Math.min(
|
|
471
|
-
c2: Math.max(
|
|
472
|
-
})),
|
|
473
|
-
|
|
308
|
+
let $ = b(() => ({
|
|
309
|
+
r1: Math.min(Z.value.row, Q.value.row),
|
|
310
|
+
r2: Math.max(Z.value.row, Q.value.row),
|
|
311
|
+
c1: Math.min(Z.value.col, Q.value.col),
|
|
312
|
+
c2: Math.max(Z.value.col, Q.value.col)
|
|
313
|
+
})), Ue = (e, t) => e >= $.value.r1 && e <= $.value.r2 && t >= $.value.c1 && t <= $.value.c2, We = (e, t) => Q.value.row === e && Q.value.col === t, Ge = (e) => e >= $.value.r1 && e <= $.value.r2 ? `${$.value.c1}:${$.value.c2}:${Q.value.row === e ? Q.value.col : 0}` : "", Ke = y(!1), qe = (e, t, n) => {
|
|
314
|
+
x.value?.focus({ preventScroll: !0 }), Q.value = {
|
|
474
315
|
row: e,
|
|
475
316
|
col: t
|
|
476
|
-
}, n.shiftKey || (
|
|
317
|
+
}, n.shiftKey || (Z.value = {
|
|
477
318
|
row: e,
|
|
478
319
|
col: t
|
|
479
|
-
}),
|
|
480
|
-
},
|
|
481
|
-
|
|
320
|
+
}), Ke.value = !0;
|
|
321
|
+
}, Je = (e, t) => {
|
|
322
|
+
Ke.value && (Q.value = {
|
|
482
323
|
row: e,
|
|
483
324
|
col: t
|
|
484
325
|
});
|
|
485
|
-
},
|
|
486
|
-
let e = [...
|
|
326
|
+
}, Ye, Xe = () => {
|
|
327
|
+
let e = [...x.value?.querySelectorAll(".pk-spreadsheet-preview__cell--range, [data-focus]") ?? []].map((e) => e.getBoundingClientRect());
|
|
487
328
|
if (e.length) return {
|
|
488
329
|
start: {
|
|
489
330
|
top: Math.min(...e.map((e) => e.top)),
|
|
@@ -491,18 +332,18 @@ var Ae = { class: "pk-spreadsheet-preview" }, je = { class: "pk-spreadsheet-prev
|
|
|
491
332
|
},
|
|
492
333
|
bottom: Math.max(...e.map((e) => e.bottom))
|
|
493
334
|
};
|
|
494
|
-
},
|
|
495
|
-
...
|
|
496
|
-
measure:
|
|
335
|
+
}, Ze = () => T.value ? {
|
|
336
|
+
...ve(T.value, $.value),
|
|
337
|
+
measure: Xe
|
|
497
338
|
} : void 0;
|
|
498
|
-
|
|
499
|
-
clearTimeout(
|
|
500
|
-
let e =
|
|
501
|
-
a("select", t ?
|
|
339
|
+
u([$, Ke], () => {
|
|
340
|
+
clearTimeout(Ye), !Ke.value && (Ye = setTimeout(() => {
|
|
341
|
+
let e = $.value, t = e.r2 > e.r1 || e.c2 > e.c1;
|
|
342
|
+
a("select", t ? Ze() : void 0);
|
|
502
343
|
}, 150));
|
|
503
344
|
});
|
|
504
345
|
let Qe = () => {
|
|
505
|
-
clearTimeout(
|
|
346
|
+
clearTimeout(Ye), a("select", Ze());
|
|
506
347
|
}, $e = (e) => {
|
|
507
348
|
let t = {
|
|
508
349
|
ArrowUp: [-1, 0],
|
|
@@ -514,7 +355,7 @@ var Ae = { class: "pk-spreadsheet-preview" }, je = { class: "pk-spreadsheet-prev
|
|
|
514
355
|
}[e.key];
|
|
515
356
|
if (!t) return;
|
|
516
357
|
e.preventDefault();
|
|
517
|
-
let n =
|
|
358
|
+
let n = I.value.map((e) => e.row), r = D.value.map((e) => e.col), a = (e) => L.value.get(`${e.row},${e.col}`) ?? e, o = a(Q.value), s = n.indexOf(Q.value.row), c = r.indexOf(Q.value.col), l = o;
|
|
518
359
|
for (;;) {
|
|
519
360
|
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]));
|
|
520
361
|
if (e === s && i === c || (s = e, c = i, l = a({
|
|
@@ -522,150 +363,150 @@ var Ae = { class: "pk-spreadsheet-preview" }, je = { class: "pk-spreadsheet-prev
|
|
|
522
363
|
col: r[c]
|
|
523
364
|
}), l.row !== o.row || l.col !== o.col)) break;
|
|
524
365
|
}
|
|
525
|
-
|
|
366
|
+
Q.value = l, e.shiftKey || (Z.value = l), i(() => x.value?.querySelector("[data-focus]")?.scrollIntoView({
|
|
526
367
|
block: "nearest",
|
|
527
368
|
inline: "nearest"
|
|
528
369
|
}));
|
|
529
|
-
}, et =
|
|
530
|
-
let { r1: e, r2: t, c1: n, c2: r } =
|
|
370
|
+
}, et = b(() => R(Q.value.row, Q.value.col)), tt = b(() => {
|
|
371
|
+
let { r1: e, r2: t, c1: n, c2: r } = $.value;
|
|
531
372
|
if (e === t && n === r) return;
|
|
532
373
|
let i = 0, a = 0, o = 0, s;
|
|
533
374
|
for (let c = e; c <= t; c++) for (let e = n; e <= r; e++) {
|
|
534
|
-
let t =
|
|
375
|
+
let t = R(c, e);
|
|
535
376
|
t && (t.value !== void 0 || t.missing) && (i++, typeof t.value == "number" && (a += t.value, o++, s ??= t));
|
|
536
377
|
}
|
|
537
378
|
if (i) return {
|
|
538
379
|
count: i,
|
|
539
|
-
sum: s ?
|
|
540
|
-
average: s ?
|
|
380
|
+
sum: s ? se(s, a) : void 0,
|
|
381
|
+
average: s ? se(s, a / o) : void 0
|
|
541
382
|
};
|
|
542
383
|
}), nt = (e) => {
|
|
543
|
-
|
|
384
|
+
h.value = Math.min(2, Math.max(.5, Math.round((h.value + e) * 10) / 10));
|
|
544
385
|
};
|
|
545
386
|
return (t, n) => {
|
|
546
|
-
let i =
|
|
547
|
-
return
|
|
548
|
-
|
|
549
|
-
|
|
387
|
+
let i = ce;
|
|
388
|
+
return A(), k("div", ye, [
|
|
389
|
+
v("div", be, [
|
|
390
|
+
v("span", {
|
|
550
391
|
class: "pk-spreadsheet-preview__ref",
|
|
551
|
-
"aria-label":
|
|
552
|
-
},
|
|
553
|
-
n[6] ||=
|
|
392
|
+
"aria-label": O(s)("chatFilePreview.cell")
|
|
393
|
+
}, S(te(Q.value.col)) + S(Q.value.row), 9, xe),
|
|
394
|
+
n[6] ||= v("span", {
|
|
554
395
|
class: "pk-spreadsheet-preview__fx",
|
|
555
396
|
"aria-hidden": "true"
|
|
556
397
|
}, "fx", -1),
|
|
557
|
-
|
|
398
|
+
v("output", {
|
|
558
399
|
class: "pk-spreadsheet-preview__formula",
|
|
559
|
-
"aria-label":
|
|
560
|
-
},
|
|
400
|
+
"aria-label": O(s)("chatFilePreview.formulaBar")
|
|
401
|
+
}, S(H(et.value)), 9, Se)
|
|
561
402
|
]),
|
|
562
|
-
|
|
403
|
+
v("div", {
|
|
563
404
|
ref_key: "scrollEl",
|
|
564
|
-
ref:
|
|
405
|
+
ref: x,
|
|
565
406
|
class: "pk-spreadsheet-preview__scroll",
|
|
566
407
|
tabindex: "0",
|
|
567
408
|
role: "grid",
|
|
568
409
|
"aria-label": T.value?.name,
|
|
569
410
|
onKeydown: $e,
|
|
570
|
-
onMouseup: n[2] ||= (e) =>
|
|
571
|
-
onMouseleave: n[3] ||= (e) =>
|
|
572
|
-
}, [T.value ? (
|
|
411
|
+
onMouseup: n[2] ||= (e) => Ke.value = !1,
|
|
412
|
+
onMouseleave: n[3] ||= (e) => Ke.value = !1
|
|
413
|
+
}, [T.value ? (A(), k("table", {
|
|
573
414
|
key: 0,
|
|
574
415
|
class: r(["pk-spreadsheet-preview__grid", { "pk-spreadsheet-preview__grid--lines": T.value.gridlines }]),
|
|
575
|
-
style:
|
|
576
|
-
zoom:
|
|
577
|
-
width: `${
|
|
578
|
-
"--pk-spreadsheet-stuck-top": `${
|
|
579
|
-
"--pk-spreadsheet-stuck-left": `${
|
|
416
|
+
style: l({
|
|
417
|
+
zoom: h.value,
|
|
418
|
+
width: `${P.value}px`,
|
|
419
|
+
"--pk-spreadsheet-stuck-top": `${Ve.value.top}px`,
|
|
420
|
+
"--pk-spreadsheet-stuck-left": `${Ve.value.left}px`
|
|
580
421
|
})
|
|
581
422
|
}, [
|
|
582
|
-
|
|
423
|
+
v("colgroup", null, [v("col", { style: l({ width: `${ze}px` }) }, null, 4), (A(!0), k(_, null, p(D.value, (e) => (A(), k("col", {
|
|
583
424
|
key: e.col,
|
|
584
|
-
style:
|
|
425
|
+
style: l({ width: `${e.width}px` })
|
|
585
426
|
}, null, 4))), 128))]),
|
|
586
|
-
|
|
427
|
+
v("thead", null, [v("tr", { style: l({ height: `${Re}px` }) }, [n[7] ||= v("th", { class: "pk-spreadsheet-preview__corner" }, null, -1), (A(!0), k(_, null, p(D.value, (e) => (A(), k("th", {
|
|
587
428
|
key: e.col,
|
|
588
429
|
scope: "col",
|
|
589
|
-
class: r(["pk-spreadsheet-preview__head", { "pk-spreadsheet-preview__head--current": e.col >=
|
|
590
|
-
style:
|
|
591
|
-
left: `${
|
|
430
|
+
class: r(["pk-spreadsheet-preview__head", { "pk-spreadsheet-preview__head--current": e.col >= $.value.c1 && e.col <= $.value.c2 }]),
|
|
431
|
+
style: l(T.value.frozen && e.col <= T.value.frozen.cols ? {
|
|
432
|
+
left: `${Be(e.col)}px`,
|
|
592
433
|
zIndex: 2
|
|
593
434
|
} : void 0)
|
|
594
|
-
},
|
|
595
|
-
|
|
435
|
+
}, S(te(e.col)), 7))), 128))], 4)]),
|
|
436
|
+
v("tbody", null, [(A(!0), k(_, null, p(I.value, (e, t, n, i) => {
|
|
596
437
|
let a = [
|
|
597
438
|
e,
|
|
598
439
|
T.value,
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
440
|
+
F.value,
|
|
441
|
+
O(c),
|
|
442
|
+
Ge(e.row)
|
|
602
443
|
];
|
|
603
|
-
if (i && i.el && i.key === e.row &&
|
|
604
|
-
let
|
|
444
|
+
if (i && i.el && i.key === e.row && ee(i, a)) return i;
|
|
445
|
+
let o = (A(), k("tr", {
|
|
605
446
|
key: e.row,
|
|
606
|
-
style:
|
|
607
|
-
}, [
|
|
447
|
+
style: l({ height: `${e.height}px` })
|
|
448
|
+
}, [v("th", {
|
|
608
449
|
scope: "row",
|
|
609
|
-
class: r(["pk-spreadsheet-preview__row", { "pk-spreadsheet-preview__row--current": e.row >=
|
|
610
|
-
style:
|
|
611
|
-
...
|
|
450
|
+
class: r(["pk-spreadsheet-preview__row", { "pk-spreadsheet-preview__row--current": e.row >= $.value.r1 && e.row <= $.value.r2 }]),
|
|
451
|
+
style: l(T.value.frozen && e.row <= T.value.frozen.rows ? {
|
|
452
|
+
...He(e.row, 0),
|
|
612
453
|
left: 0,
|
|
613
454
|
zIndex: 4
|
|
614
455
|
} : void 0)
|
|
615
|
-
},
|
|
456
|
+
}, S(e.row), 7), (A(!0), k(_, null, p(D.value, (t) => (A(), k(_, { key: t.col }, [L.value.has(`${e.row},${t.col}`) ? E("", !0) : (A(), k("td", {
|
|
616
457
|
key: 0,
|
|
617
|
-
rowspan:
|
|
618
|
-
colspan:
|
|
458
|
+
rowspan: z(e.row, t.col)?.rows,
|
|
459
|
+
colspan: z(e.row, t.col)?.cols,
|
|
619
460
|
class: r(["pk-spreadsheet-preview__cell", {
|
|
620
|
-
"pk-spreadsheet-preview__cell--range":
|
|
621
|
-
"pk-spreadsheet-preview__cell--missing":
|
|
461
|
+
"pk-spreadsheet-preview__cell--range": Ue(e.row, t.col) && !We(e.row, t.col),
|
|
462
|
+
"pk-spreadsheet-preview__cell--missing": R(e.row, t.col)?.missing
|
|
622
463
|
}]),
|
|
623
|
-
style:
|
|
624
|
-
"data-focus":
|
|
625
|
-
title:
|
|
626
|
-
onMousedown:
|
|
627
|
-
onMouseenter: (n) =>
|
|
464
|
+
style: l(de(R(e.row, t.col), e.row, t.col)),
|
|
465
|
+
"data-focus": We(e.row, t.col) ? "" : void 0,
|
|
466
|
+
title: R(e.row, t.col)?.missing ? O(s)("chatFilePreview.missingValue") : void 0,
|
|
467
|
+
onMousedown: g((n) => qe(e.row, t.col, n), ["prevent"]),
|
|
468
|
+
onMouseenter: (n) => Je(e.row, t.col),
|
|
628
469
|
onDblclick: Qe
|
|
629
|
-
},
|
|
630
|
-
return
|
|
470
|
+
}, S(ue(R(e.row, t.col))), 47, we))], 64))), 128))], 4));
|
|
471
|
+
return o.memo = a, o;
|
|
631
472
|
}, n, 0), 128))])
|
|
632
|
-
], 6)) :
|
|
633
|
-
|
|
473
|
+
], 6)) : E("", !0), T.value && (T.value.moreRows || T.value.moreColumns) ? (A(), k("p", Te, [T.value.moreRows ? (A(), k(_, { key: 0 }, [ne(S(O(s)("chatFilePreview.moreRows", T.value.moreRows)), 1)], 64)) : E("", !0), T.value.moreColumns ? (A(), k(_, { key: 1 }, [ne(S(O(s)("chatFilePreview.moreColumns", T.value.moreColumns)), 1)], 64)) : E("", !0)])) : E("", !0)], 40, Ce),
|
|
474
|
+
v("nav", {
|
|
634
475
|
class: "pk-spreadsheet-preview__sheets",
|
|
635
|
-
"aria-label":
|
|
636
|
-
}, [(
|
|
476
|
+
"aria-label": O(s)("chatFilePreview.sheets")
|
|
477
|
+
}, [(A(!0), k(_, null, p(e.preview.sheets, (e, t) => (A(), k("button", {
|
|
637
478
|
key: e.name,
|
|
638
479
|
type: "button",
|
|
639
480
|
class: "pk-spreadsheet-preview__sheet",
|
|
640
|
-
"aria-current": t ===
|
|
641
|
-
onClick: (e) =>
|
|
642
|
-
},
|
|
643
|
-
|
|
481
|
+
"aria-current": t === f.value ? "page" : void 0,
|
|
482
|
+
onClick: (e) => f.value = t
|
|
483
|
+
}, S(e.name), 9, De))), 128))], 8, Ee),
|
|
484
|
+
v("div", X, [v("p", Oe, [e.preview.staleFormulas ? (A(), k("span", {
|
|
644
485
|
key: 0,
|
|
645
486
|
class: "pk-spreadsheet-preview__note",
|
|
646
|
-
title:
|
|
647
|
-
},
|
|
487
|
+
title: O(s)("chatFilePreview.staleFormulas")
|
|
488
|
+
}, S(O(s)("chatFilePreview.staleFormulas")), 9, ke)) : e.preview.computedFormulas ? (A(), k("span", {
|
|
648
489
|
key: 1,
|
|
649
490
|
class: "pk-spreadsheet-preview__note",
|
|
650
|
-
title:
|
|
651
|
-
},
|
|
652
|
-
tt.value.average ? (
|
|
653
|
-
|
|
654
|
-
tt.value.sum ? (
|
|
655
|
-
])) :
|
|
656
|
-
|
|
491
|
+
title: O(s)("chatFilePreview.computedFormulas")
|
|
492
|
+
}, S(O(s)("chatFilePreview.computedFormulas")), 9, Ae)) : E("", !0), tt.value ? (A(), k("span", je, [
|
|
493
|
+
tt.value.average ? (A(), k("span", Me, S(O(s)("chatFilePreview.average")) + " " + S(tt.value.average), 1)) : E("", !0),
|
|
494
|
+
v("span", null, S(O(s)("chatFilePreview.count")) + " " + S(tt.value.count), 1),
|
|
495
|
+
tt.value.sum ? (A(), k("span", Ne, S(O(s)("chatFilePreview.sum")) + " " + S(tt.value.sum), 1)) : E("", !0)
|
|
496
|
+
])) : E("", !0)]), v("div", Pe, [
|
|
497
|
+
d(i, {
|
|
657
498
|
modifiers: "action-quiet",
|
|
658
499
|
icon: "ri:subtract-line",
|
|
659
|
-
"aria-label":
|
|
660
|
-
disabled:
|
|
500
|
+
"aria-label": O(s)("chatFilePreview.zoomOut"),
|
|
501
|
+
disabled: h.value <= .5,
|
|
661
502
|
onClick: n[4] ||= (e) => nt(-.1)
|
|
662
503
|
}, null, 8, ["aria-label", "disabled"]),
|
|
663
|
-
|
|
664
|
-
|
|
504
|
+
v("span", Fe, S(Math.round(h.value * 100)) + "% ", 1),
|
|
505
|
+
d(i, {
|
|
665
506
|
modifiers: "action-quiet",
|
|
666
507
|
icon: "ri:add-line",
|
|
667
|
-
"aria-label":
|
|
668
|
-
disabled:
|
|
508
|
+
"aria-label": O(s)("chatFilePreview.zoomIn"),
|
|
509
|
+
disabled: h.value >= 2,
|
|
669
510
|
onClick: n[5] ||= (e) => nt(.1)
|
|
670
511
|
}, null, 8, ["aria-label", "disabled"])
|
|
671
512
|
])])
|
|
@@ -674,12 +515,12 @@ var Ae = { class: "pk-spreadsheet-preview" }, je = { class: "pk-spreadsheet-prev
|
|
|
674
515
|
}
|
|
675
516
|
}), [["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;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(#1f1d2b14,#1f1d2b14)}.pk-spreadsheet-preview__cell--missing{color:#6b6880}.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}"]]]);
|
|
676
517
|
// ../../packages/components/src/chat/PkWordPreviewRuns.vue?vue&type=script&setup=true&lang.ts
|
|
677
|
-
|
|
678
|
-
var
|
|
518
|
+
x(), f(), C();
|
|
519
|
+
var Ve = ["src"], He = {
|
|
679
520
|
key: 1,
|
|
680
521
|
class: "pk-word-preview__image",
|
|
681
522
|
"data-quote-skip": ""
|
|
682
|
-
},
|
|
523
|
+
}, Z = ["title"], Q = ["title"], $ = ["data-quote-skip"], Ue = /* @__PURE__ */ D({
|
|
683
524
|
__name: "PkWordPreviewRuns",
|
|
684
525
|
props: {
|
|
685
526
|
runs: { type: Array },
|
|
@@ -688,13 +529,13 @@ var $e = ["src"], et = {
|
|
|
688
529
|
numbers: { type: Object }
|
|
689
530
|
},
|
|
690
531
|
setup(e) {
|
|
691
|
-
let n = e, { t: i } =
|
|
532
|
+
let n = e, { t: i } = re({ useScope: "global" }), a = t(z, void 0), o = (e) => e.picture ? I(a?.value, e.picture.ref) : void 0, s = (e) => n.page ? F(e) : "inline", c = (e) => {
|
|
692
533
|
let t = {
|
|
693
534
|
width: `${e.width}pt`,
|
|
694
535
|
aspectRatio: `${e.width} / ${e.height}`
|
|
695
536
|
}, r = e.anchor, i = n.page;
|
|
696
537
|
if (!r || !i) return t;
|
|
697
|
-
let a = r.xFrom === "page" ? r.x - i.margins.left : r.x, o =
|
|
538
|
+
let a = r.xFrom === "page" ? r.x - i.margins.left : r.x, o = F(e);
|
|
698
539
|
if (o === "around") {
|
|
699
540
|
let n = i.width - i.margins.left - i.margins.right, o = a + e.width / 2 < n / 2;
|
|
700
541
|
return {
|
|
@@ -715,52 +556,52 @@ var $e = ["src"], et = {
|
|
|
715
556
|
top: `${r.y}pt`,
|
|
716
557
|
zIndex: r.wrap === "behind" ? -1 : 1
|
|
717
558
|
};
|
|
718
|
-
},
|
|
719
|
-
let e =
|
|
559
|
+
}, u = (e) => e.field && n.numbers ? String(n.numbers[e.field]) : e.text, d = b(() => {
|
|
560
|
+
let e = L(n.runs, n.mode ?? "markup"), t = (e) => !!e.picture && !!n.page && ["around", "block"].includes(F(e.picture));
|
|
720
561
|
return [...e.filter(t), ...e.filter((e) => !t(e))];
|
|
721
|
-
}), f =
|
|
562
|
+
}), f = b(() => !n.mode || n.mode === "markup"), m = (e) => {
|
|
722
563
|
let t = {};
|
|
723
|
-
e.font && (t.fontFamily =
|
|
564
|
+
e.font && (t.fontFamily = P(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");
|
|
724
565
|
let n = [e.underline ? "underline" : "", e.strike ? "line-through" : ""].filter(Boolean).join(" ");
|
|
725
566
|
return n && (t.textDecoration = n), e.caps && (t.textTransform = "uppercase"), e.vertAlign && (t.verticalAlign = e.vertAlign, t.fontSize = `${(e.size ?? 11) * .65}pt`), t;
|
|
726
567
|
}, h = (e) => {
|
|
727
|
-
let t =
|
|
568
|
+
let t = m(e), n = new Set(String(t.textDecoration ?? "").split(" ").filter(Boolean));
|
|
728
569
|
return n.add(e.change === "deleted" ? "line-through" : "underline"), {
|
|
729
570
|
...t,
|
|
730
571
|
textDecoration: [...n].join(" ")
|
|
731
572
|
};
|
|
732
573
|
}, g = (e) => e.author ? i("chatFilePreview.revisionBy", { author: e.author }) : void 0;
|
|
733
|
-
return (e, t) => (
|
|
574
|
+
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" ? E("", !0) : (A(), k("img", {
|
|
734
575
|
key: 0,
|
|
735
576
|
class: r(["pk-word-preview__picture", `pk-word-preview__picture--${s(e.picture)}`]),
|
|
736
|
-
style:
|
|
577
|
+
style: l(c(e.picture)),
|
|
737
578
|
src: o(e),
|
|
738
579
|
alt: ""
|
|
739
|
-
}, null, 14,
|
|
580
|
+
}, null, 14, Ve))], 64)) : (A(), k("span", He, S(O(i)("chatFilePreview.image")), 1))], 64)) : f.value && e.change === "deleted" ? (A(), k("del", {
|
|
740
581
|
key: 1,
|
|
741
582
|
class: "pk-word-preview__removed",
|
|
742
583
|
"data-quote-skip": "",
|
|
743
|
-
style:
|
|
584
|
+
style: l(h(e)),
|
|
744
585
|
title: g(e)
|
|
745
|
-
},
|
|
586
|
+
}, S(u(e)), 13, Z)) : f.value && e.change === "inserted" ? (A(), k("ins", {
|
|
746
587
|
key: 2,
|
|
747
588
|
class: "pk-word-preview__added",
|
|
748
|
-
style:
|
|
589
|
+
style: l(h(e)),
|
|
749
590
|
title: g(e)
|
|
750
|
-
},
|
|
591
|
+
}, S(u(e)), 13, Q)) : (A(), k("span", {
|
|
751
592
|
key: 3,
|
|
752
|
-
style:
|
|
593
|
+
style: l(m(e)),
|
|
753
594
|
"data-quote-skip": e.label ? "" : void 0
|
|
754
|
-
},
|
|
595
|
+
}, S(u(e)), 13, $))], 64))), 128));
|
|
755
596
|
}
|
|
756
597
|
});
|
|
757
598
|
// ../../packages/components/src/chat/PkWordPreviewBlock.vue?vue&type=script&setup=true&lang.ts
|
|
758
|
-
|
|
759
|
-
var
|
|
599
|
+
x(), f();
|
|
600
|
+
var We = { key: 0 }, Ge = ["data-paragraph", "colspan"], Ke = [
|
|
760
601
|
"data-paragraph",
|
|
761
602
|
"role",
|
|
762
603
|
"aria-level"
|
|
763
|
-
],
|
|
604
|
+
], qe = { key: 1 }, Je = /* @__PURE__ */ D({
|
|
764
605
|
__name: "PkWordPreviewBlock",
|
|
765
606
|
props: {
|
|
766
607
|
block: { type: null },
|
|
@@ -770,7 +611,7 @@ var at = { key: 0 }, ot = ["data-paragraph", "colspan"], st = [
|
|
|
770
611
|
numbers: { type: Object }
|
|
771
612
|
},
|
|
772
613
|
setup(e) {
|
|
773
|
-
let t = e, n =
|
|
614
|
+
let t = e, n = b(() => {
|
|
774
615
|
if (t.block.kind === "table") return {};
|
|
775
616
|
let e = t.block.style ?? {};
|
|
776
617
|
return {
|
|
@@ -784,35 +625,35 @@ var at = { key: 0 }, ot = ["data-paragraph", "colspan"], st = [
|
|
|
784
625
|
backgroundColor: e.shading,
|
|
785
626
|
fontSize: e.size ? `${e.size}pt` : void 0
|
|
786
627
|
};
|
|
787
|
-
}), i =
|
|
628
|
+
}), i = b(() => {
|
|
788
629
|
if (t.block.kind === "table") return {};
|
|
789
630
|
let e = -(t.block.style?.firstLine ?? 0);
|
|
790
631
|
return e > 0 ? { minWidth: `calc(${e}pt * var(--pk-word-indent-scale, 1))` } : { paddingRight: "6pt" };
|
|
791
|
-
}), a =
|
|
632
|
+
}), a = b(() => t.mode === "markup" && t.block.kind !== "table" && t.block.runs.some((e) => e.change)), o = b(() => t.block.kind === "table" && t.row !== void 0 ? t.block.rows[t.row] : void 0), s = b(() => {
|
|
792
633
|
if (t.block.kind !== "table") return [];
|
|
793
634
|
let e = t.block.widths ?? [], n = e.reduce((e, t) => e + t, 0);
|
|
794
635
|
return n ? e.map((e) => `${e / n * 100}%`) : [];
|
|
795
|
-
}), c =
|
|
796
|
-
return (t,
|
|
636
|
+
}), c = b(() => t.mode === "markup" && !!o.value?.some((e) => e.runs.some((e) => e.change)));
|
|
637
|
+
return (t, u) => e.block.kind === "table" && o.value ? (A(), k("table", {
|
|
797
638
|
key: 0,
|
|
798
639
|
class: r(["pk-word-preview__table", {
|
|
799
640
|
"pk-word-preview__table--lines": e.block.borders,
|
|
800
641
|
"pk-word-preview__table--next": e.row !== 0,
|
|
801
642
|
"pk-word-preview__changed": c.value
|
|
802
643
|
}])
|
|
803
|
-
}, [s.value.length ? (
|
|
644
|
+
}, [s.value.length ? (A(), k("colgroup", We, [(A(!0), k(_, null, p(s.value, (e, t) => (A(), k("col", {
|
|
804
645
|
key: t,
|
|
805
|
-
style:
|
|
806
|
-
}, null, 4))), 128))])) :
|
|
646
|
+
style: l({ width: e })
|
|
647
|
+
}, null, 4))), 128))])) : E("", !0), v("tbody", null, [v("tr", null, [(A(!0), k(_, null, p(o.value, (t, n) => (A(), k("td", {
|
|
807
648
|
key: n,
|
|
808
649
|
"data-paragraph": t.ids?.join(" "),
|
|
809
650
|
colspan: t.span,
|
|
810
|
-
style:
|
|
651
|
+
style: l({
|
|
811
652
|
backgroundColor: t.fill,
|
|
812
653
|
textAlign: t.align,
|
|
813
654
|
fontSize: t.size ? `${t.size}pt` : void 0
|
|
814
655
|
})
|
|
815
|
-
}, [
|
|
656
|
+
}, [d(Ue, {
|
|
816
657
|
runs: t.runs,
|
|
817
658
|
mode: e.mode,
|
|
818
659
|
numbers: e.numbers
|
|
@@ -820,21 +661,21 @@ var at = { key: 0 }, ot = ["data-paragraph", "colspan"], st = [
|
|
|
820
661
|
"runs",
|
|
821
662
|
"mode",
|
|
822
663
|
"numbers"
|
|
823
|
-
])], 12,
|
|
664
|
+
])], 12, Ge))), 128))])])], 2)) : e.block.kind === "table" ? E("", !0) : (A(), k("div", {
|
|
824
665
|
key: 1,
|
|
825
666
|
class: r(["pk-word-preview__block", { "pk-word-preview__changed": a.value }]),
|
|
826
667
|
"data-paragraph": e.block.id,
|
|
827
668
|
role: e.block.kind === "heading" ? "heading" : void 0,
|
|
828
669
|
"aria-level": e.block.kind === "heading" ? Math.max(1, e.block.level) : void 0,
|
|
829
|
-
style:
|
|
670
|
+
style: l(n.value)
|
|
830
671
|
}, [
|
|
831
|
-
e.block.label ? (
|
|
672
|
+
e.block.label ? (A(), k("span", {
|
|
832
673
|
key: 0,
|
|
833
674
|
class: "pk-word-preview__label",
|
|
834
675
|
"data-quote-skip": "",
|
|
835
|
-
style:
|
|
836
|
-
},
|
|
837
|
-
|
|
676
|
+
style: l(i.value)
|
|
677
|
+
}, S(e.block.label), 5)) : E("", !0),
|
|
678
|
+
d(Ue, {
|
|
838
679
|
runs: e.block.runs,
|
|
839
680
|
mode: e.mode,
|
|
840
681
|
page: e.page,
|
|
@@ -845,13 +686,13 @@ var at = { key: 0 }, ot = ["data-paragraph", "colspan"], st = [
|
|
|
845
686
|
"page",
|
|
846
687
|
"numbers"
|
|
847
688
|
]),
|
|
848
|
-
!e.block.label && !e.block.runs.length ? (
|
|
849
|
-
], 14,
|
|
689
|
+
!e.block.label && !e.block.runs.length ? (A(), k("br", qe)) : E("", !0)
|
|
690
|
+
], 14, Ke));
|
|
850
691
|
}
|
|
851
692
|
});
|
|
852
693
|
// ../../packages/components/src/chat/PkWordPreviewPart.vue?vue&type=script&setup=true&lang.ts
|
|
853
|
-
|
|
854
|
-
var
|
|
694
|
+
x(), f();
|
|
695
|
+
var Ye = { class: "pk-word-preview__part" }, Xe = ["src"], Ze = /* @__PURE__ */ D({
|
|
855
696
|
__name: "PkWordPreviewPart",
|
|
856
697
|
props: {
|
|
857
698
|
blocks: { type: Array },
|
|
@@ -861,13 +702,13 @@ var ut = { class: "pk-word-preview__part" }, dt = ["src"], ft = /* @__PURE__ */
|
|
|
861
702
|
numbers: { type: Object }
|
|
862
703
|
},
|
|
863
704
|
setup(e) {
|
|
864
|
-
let n = e, r = t(
|
|
865
|
-
let t =
|
|
705
|
+
let n = e, r = t(z, void 0), i = b(() => B(n.blocks, n.mode)), a = b(() => R(n.blocks, n.mode).flatMap((e) => {
|
|
706
|
+
let t = I(r?.value, e.ref);
|
|
866
707
|
return t ? [{
|
|
867
708
|
src: t,
|
|
868
|
-
css:
|
|
709
|
+
css: ae(e, n.section.page)
|
|
869
710
|
}] : [];
|
|
870
|
-
})), o =
|
|
711
|
+
})), o = b(() => {
|
|
871
712
|
let { margins: e } = n.section.page;
|
|
872
713
|
return {
|
|
873
714
|
left: `${e.left}pt`,
|
|
@@ -875,10 +716,10 @@ var ut = { class: "pk-word-preview__part" }, dt = ["src"], ft = /* @__PURE__ */
|
|
|
875
716
|
...n.where === "header" ? { top: `${n.section.headerDistance}pt` } : { bottom: `${n.section.footerDistance}pt` }
|
|
876
717
|
};
|
|
877
718
|
});
|
|
878
|
-
return (t, n) => (
|
|
719
|
+
return (t, n) => (A(), k("div", Ye, [v("div", {
|
|
879
720
|
class: "pk-word-preview__part-flow",
|
|
880
|
-
style:
|
|
881
|
-
}, [(
|
|
721
|
+
style: l(o.value)
|
|
722
|
+
}, [(A(!0), k(_, null, p(i.value, (t) => (A(), h(Je, {
|
|
882
723
|
key: t.key,
|
|
883
724
|
block: e.blocks[t.block],
|
|
884
725
|
row: t.row,
|
|
@@ -891,50 +732,50 @@ var ut = { class: "pk-word-preview__part" }, dt = ["src"], ft = /* @__PURE__ */
|
|
|
891
732
|
"mode",
|
|
892
733
|
"page",
|
|
893
734
|
"numbers"
|
|
894
|
-
]))), 128))], 4), (
|
|
735
|
+
]))), 128))], 4), (A(!0), k(_, null, p(a.value, (e, t) => (A(), k("img", {
|
|
895
736
|
key: t,
|
|
896
737
|
class: "pk-word-preview__float",
|
|
897
|
-
style:
|
|
738
|
+
style: l(e.css),
|
|
898
739
|
src: e.src,
|
|
899
740
|
alt: ""
|
|
900
|
-
}, null, 12,
|
|
741
|
+
}, null, 12, Xe))), 128))]));
|
|
901
742
|
}
|
|
902
743
|
});
|
|
903
744
|
// ../../packages/components/src/chat/PkWordPreview.vue?vue&type=script&setup=true&lang.ts
|
|
904
|
-
|
|
905
|
-
var
|
|
745
|
+
x(), C(), f();
|
|
746
|
+
var Qe = ["aria-label"], $e = {
|
|
906
747
|
class: "pk-word-preview__tabs",
|
|
907
748
|
role: "tablist"
|
|
908
|
-
},
|
|
749
|
+
}, et = ["aria-selected"], tt = ["aria-selected"], nt = {
|
|
909
750
|
key: 0,
|
|
910
751
|
class: "pk-word-preview__list"
|
|
911
|
-
},
|
|
752
|
+
}, rt = ["aria-current", "onClick"], it = { class: "pk-word-preview__entry-text" }, at = {
|
|
912
753
|
key: 0,
|
|
913
754
|
class: "u-dot"
|
|
914
|
-
},
|
|
755
|
+
}, ot = {
|
|
915
756
|
key: 0,
|
|
916
757
|
class: "pk-word-preview__none"
|
|
917
|
-
},
|
|
758
|
+
}, st = {
|
|
918
759
|
key: 1,
|
|
919
760
|
class: "pk-word-preview__list"
|
|
920
|
-
},
|
|
761
|
+
}, ct = ["onClick"], lt = {
|
|
921
762
|
key: 0,
|
|
922
763
|
class: "pk-word-preview__removed"
|
|
923
|
-
},
|
|
764
|
+
}, ut = {
|
|
924
765
|
key: 1,
|
|
925
766
|
class: "pk-word-preview__added"
|
|
926
|
-
},
|
|
767
|
+
}, dt = { class: "pk-word-preview__main" }, ft = ["aria-label"], pt = ["src"], mt = {
|
|
927
768
|
key: 2,
|
|
928
769
|
class: "pk-word-preview__truncated"
|
|
929
|
-
},
|
|
770
|
+
}, ht = { class: "pk-word-preview__status" }, gt = {
|
|
930
771
|
key: 0,
|
|
931
772
|
class: "pk-word-preview__count"
|
|
932
|
-
},
|
|
773
|
+
}, _t = { class: "pk-word-preview__count" }, vt = {
|
|
933
774
|
key: 1,
|
|
934
775
|
class: "pk-word-preview__legend"
|
|
935
|
-
},
|
|
776
|
+
}, yt = ["title"], bt = { class: "pk-word-preview__removed" }, xt = { class: "pk-word-preview__added" }, St = { class: "pk-word-preview__percent" }, Ct = ["data-part"], wt = 96 / 72, Tt = .5, Et = /*#__PURE__*/ H(/* @__PURE__ */ D({
|
|
936
777
|
__name: "PkWordPreview",
|
|
937
|
-
props: /*@__PURE__*/
|
|
778
|
+
props: /*@__PURE__*/ c({
|
|
938
779
|
preview: { type: null },
|
|
939
780
|
mode: { type: String }
|
|
940
781
|
}, {
|
|
@@ -946,28 +787,28 @@ var pt = ["aria-label"], mt = {
|
|
|
946
787
|
zoom: { default: 1 },
|
|
947
788
|
zoomModifiers: {}
|
|
948
789
|
}),
|
|
949
|
-
emits: /*@__PURE__*/
|
|
790
|
+
emits: /*@__PURE__*/ c(["select"], ["update:fit", "update:zoom"]),
|
|
950
791
|
setup(e, { emit: t }) {
|
|
951
|
-
let
|
|
952
|
-
n(
|
|
953
|
-
let ee = (e) =>
|
|
954
|
-
page:
|
|
792
|
+
let c = e, f = t, { t: g } = re({ useScope: "global" });
|
|
793
|
+
n(z, b(() => c.preview.images));
|
|
794
|
+
let ee = (e) => L(e, c.mode), x = b(() => B(c.preview.blocks, c.mode)), C = m("rootEl"), w = m("scrollEl"), T = m("measureEl"), { width: te } = oe(C), { width: D } = oe(w), ne = b(() => te.value >= 1e3), j = b(() => c.preview.sections?.length ? c.preview.sections : [{
|
|
795
|
+
page: c.preview.page,
|
|
955
796
|
headerDistance: 0,
|
|
956
797
|
footerDistance: 0,
|
|
957
798
|
headers: {},
|
|
958
799
|
footers: {}
|
|
959
|
-
}]),
|
|
960
|
-
fontFamily:
|
|
961
|
-
fontSize: `${
|
|
962
|
-
color:
|
|
963
|
-
"--pk-word-line":
|
|
964
|
-
"--pk-word-size": `${
|
|
965
|
-
})),
|
|
966
|
-
...
|
|
967
|
-
width: `${
|
|
968
|
-
})),
|
|
800
|
+
}]), M = b(() => j.value[0].page), N = b(() => (D.value - 48) / (M.value.width * wt)), F = b(() => te.value === 0 || D.value === 0 || N.value >= Tt), V = b(() => ({
|
|
801
|
+
fontFamily: P(c.preview.defaults.font),
|
|
802
|
+
fontSize: `${c.preview.defaults.size}pt`,
|
|
803
|
+
color: c.preview.defaults.color ?? "#000000",
|
|
804
|
+
"--pk-word-line": ie(c.preview.defaults.font),
|
|
805
|
+
"--pk-word-size": `${c.preview.defaults.size}pt`
|
|
806
|
+
})), se = b(() => M.value.width - M.value.margins.left - M.value.margins.right), ue = b(() => ({
|
|
807
|
+
...V.value,
|
|
808
|
+
width: `${se.value}pt`
|
|
809
|
+
})), H = m("flowEl"), { width: U } = oe(H), de = b(() => {
|
|
969
810
|
let e = /* @__PURE__ */ new Map(), t = 0;
|
|
970
|
-
for (let n of
|
|
811
|
+
for (let n of c.preview.blocks) {
|
|
971
812
|
if (n.kind === "table") continue;
|
|
972
813
|
let r = n.runs.reduce((e, t) => e + t.text.trim().length, 0);
|
|
973
814
|
if (r) {
|
|
@@ -978,213 +819,213 @@ var pt = ["aria-label"], mt = {
|
|
|
978
819
|
let n = 0;
|
|
979
820
|
for (let [r, i] of [...e].sort((e, t) => e[0] - t[0])) if (n += i, n > t / 10) return r;
|
|
980
821
|
return 0;
|
|
981
|
-
}),
|
|
982
|
-
...
|
|
983
|
-
"--pk-word-indent-shared": `${
|
|
984
|
-
"--pk-word-indent-scale":
|
|
985
|
-
})),
|
|
822
|
+
}), fe = b(() => ({
|
|
823
|
+
...V.value,
|
|
824
|
+
"--pk-word-indent-shared": `${de.value}pt`,
|
|
825
|
+
"--pk-word-indent-scale": U.value ? Math.min(1, U.value / (se.value * wt)) : 1
|
|
826
|
+
})), W = y([]), G = y({}), pe = async () => {
|
|
986
827
|
await i();
|
|
987
828
|
let e = T.value?.querySelectorAll("[data-item]");
|
|
988
|
-
|
|
829
|
+
W.value = [...e ?? []].map((e) => e.getBoundingClientRect().height);
|
|
989
830
|
let t = T.value?.querySelectorAll("[data-part]");
|
|
990
|
-
|
|
831
|
+
G.value = Object.fromEntries([...t ?? []].map((e) => [e.dataset.part ?? "", e.getBoundingClientRect().height]));
|
|
991
832
|
};
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
() =>
|
|
996
|
-
], pe, { flush: "post" }),
|
|
833
|
+
u([
|
|
834
|
+
x,
|
|
835
|
+
F,
|
|
836
|
+
() => c.preview.parts
|
|
837
|
+
], pe, { flush: "post" }), s(() => {
|
|
997
838
|
pe(), document.fonts?.ready.then(pe);
|
|
998
839
|
});
|
|
999
|
-
let
|
|
1000
|
-
if (!
|
|
1001
|
-
items:
|
|
840
|
+
let K = b(() => {
|
|
841
|
+
if (!F.value || W.value.length !== x.value.length) return [{
|
|
842
|
+
items: x.value.map((e, t) => t),
|
|
1002
843
|
section: 0,
|
|
1003
844
|
number: 1,
|
|
1004
|
-
top:
|
|
1005
|
-
bottom:
|
|
845
|
+
top: M.value.margins.top,
|
|
846
|
+
bottom: M.value.margins.bottom
|
|
1006
847
|
}];
|
|
1007
|
-
let e = [], t = 0, n = !0, r = 0, i,
|
|
1008
|
-
let r =
|
|
848
|
+
let e = [], t = 0, n = !0, r = 0, i, a = () => {
|
|
849
|
+
let r = j.value[t];
|
|
1009
850
|
return n && r.pageStart !== void 0 ? r.pageStart : (i ?? e[e.length - 1]?.number ?? 0) + 1;
|
|
1010
|
-
},
|
|
1011
|
-
let r =
|
|
851
|
+
}, o = (e) => {
|
|
852
|
+
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 ? (G.value[e] ?? 0) / wt : 0;
|
|
1012
853
|
return {
|
|
1013
|
-
header:
|
|
1014
|
-
footer:
|
|
1015
|
-
top: Math.max(r.page.margins.top,
|
|
1016
|
-
bottom: Math.max(r.page.margins.bottom,
|
|
854
|
+
header: a,
|
|
855
|
+
footer: o,
|
|
856
|
+
top: Math.max(r.page.margins.top, a ? r.headerDistance + s(a) : 0),
|
|
857
|
+
bottom: Math.max(r.page.margins.bottom, o ? r.footerDistance + s(o) : 0)
|
|
1017
858
|
};
|
|
1018
|
-
},
|
|
1019
|
-
let
|
|
859
|
+
}, s = () => {
|
|
860
|
+
let s = a();
|
|
1020
861
|
i = void 0, e.push({
|
|
1021
862
|
items: [],
|
|
1022
863
|
section: t,
|
|
1023
|
-
number:
|
|
1024
|
-
...s
|
|
864
|
+
number: s,
|
|
865
|
+
...o(s)
|
|
1025
866
|
}), n = !1, r = 0;
|
|
1026
867
|
};
|
|
1027
|
-
return
|
|
1028
|
-
|
|
1029
|
-
let u = e[e.length - 1], d = u &&
|
|
1030
|
-
for (let e = l;
|
|
1031
|
-
(!u || u.items.length && (
|
|
1032
|
-
let e =
|
|
1033
|
-
return (
|
|
1034
|
-
})())) &&
|
|
1035
|
-
}), e.length ||
|
|
1036
|
-
}),
|
|
868
|
+
return x.value.forEach((c, l) => {
|
|
869
|
+
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));
|
|
870
|
+
let u = e[e.length - 1], d = u && j.value[u.section].page, f = d ? (d.height - u.top - u.bottom) * wt : 0, p = W.value[l];
|
|
871
|
+
for (let e = l; x.value[e]?.keepNext && e + 1 < x.value.length && !x.value[e + 1].breakBefore; e++) p += W.value[e + 1];
|
|
872
|
+
(!u || u.items.length && (c.breakBefore || r + W.value[l] > f || r + p > f && p <= (() => {
|
|
873
|
+
let e = o(a());
|
|
874
|
+
return (j.value[t].page.height - e.top - e.bottom) * wt;
|
|
875
|
+
})())) && s(), e[e.length - 1].items.push(l), r += W.value[l];
|
|
876
|
+
}), e.length || s(), e;
|
|
877
|
+
}), q = b(() => {
|
|
1037
878
|
let e = /* @__PURE__ */ new Map();
|
|
1038
|
-
for (let t of
|
|
1039
|
-
return
|
|
879
|
+
for (let t of K.value) e.set(t.section, (e.get(t.section) ?? 0) + 1);
|
|
880
|
+
return K.value.map((t) => ({
|
|
1040
881
|
page: t.number,
|
|
1041
|
-
pages:
|
|
882
|
+
pages: K.value.length,
|
|
1042
883
|
sectionPages: e.get(t.section) ?? 1
|
|
1043
884
|
}));
|
|
1044
|
-
}),
|
|
1045
|
-
let t =
|
|
885
|
+
}), me = (e) => {
|
|
886
|
+
let t = j.value[e.section].page;
|
|
1046
887
|
return {
|
|
1047
|
-
...
|
|
888
|
+
...V.value,
|
|
1048
889
|
width: `${t.width}pt`,
|
|
1049
890
|
minHeight: `${t.height}pt`,
|
|
1050
891
|
padding: `${e.top}pt ${t.margins.right}pt ${e.bottom}pt ${t.margins.left}pt`
|
|
1051
892
|
};
|
|
1052
|
-
},
|
|
1053
|
-
let t = [...new Set(e.items.map((e) =>
|
|
1054
|
-
return
|
|
1055
|
-
let n =
|
|
893
|
+
}, he = (e) => {
|
|
894
|
+
let t = [...new Set(e.items.map((e) => x.value[e].block))];
|
|
895
|
+
return R(t.map((e) => c.preview.blocks[e]), c.mode).flatMap((t) => {
|
|
896
|
+
let n = I(c.preview.images, t.ref);
|
|
1056
897
|
return n ? [{
|
|
1057
898
|
src: n,
|
|
1058
|
-
css:
|
|
899
|
+
css: ae(t, j.value[e.section].page)
|
|
1059
900
|
}] : [];
|
|
1060
901
|
});
|
|
1061
|
-
},
|
|
1062
|
-
|
|
1063
|
-
}, ye =
|
|
1064
|
-
let e =
|
|
902
|
+
}, J = o(e, "fit"), ge = o(e, "zoom"), Y = b(() => J.value ? Math.min(1.25, Math.max(.3, N.value)) : ge.value), ve = (e) => {
|
|
903
|
+
ge.value = Math.min(2, Math.max(.3, Math.round((Y.value + e) * 10) / 10)), J.value = !1;
|
|
904
|
+
}, ye = y(0), be = y(), xe = () => {
|
|
905
|
+
let e = w.value?.getBoundingClientRect();
|
|
1065
906
|
if (!e) return;
|
|
1066
|
-
let t =
|
|
907
|
+
let t = w.value?.querySelectorAll("[data-page]") ?? [], n = 0;
|
|
1067
908
|
for (let [r, i] of [...t].entries()) {
|
|
1068
909
|
if (i.getBoundingClientRect().top - e.top > e.height / 3) break;
|
|
1069
910
|
n = r;
|
|
1070
911
|
}
|
|
1071
912
|
ye.value = n;
|
|
1072
913
|
let r;
|
|
1073
|
-
for (let t of
|
|
1074
|
-
let n =
|
|
914
|
+
for (let t of Ee.value) {
|
|
915
|
+
let n = w.value?.querySelector(`[data-key="${t.key}"]`);
|
|
1075
916
|
if (n) {
|
|
1076
917
|
if (n.getBoundingClientRect().top - e.top > 48) break;
|
|
1077
918
|
r = t.key;
|
|
1078
919
|
}
|
|
1079
920
|
}
|
|
1080
|
-
be.value = r ??
|
|
1081
|
-
},
|
|
1082
|
-
|
|
1083
|
-
|
|
921
|
+
be.value = r ?? Ee.value[0]?.key;
|
|
922
|
+
}, Se = 0, Ce = () => {
|
|
923
|
+
Se ||= requestAnimationFrame(() => {
|
|
924
|
+
Se = 0, xe();
|
|
1084
925
|
});
|
|
1085
926
|
};
|
|
1086
|
-
|
|
1087
|
-
let { selection:
|
|
1088
|
-
|
|
1089
|
-
let t =
|
|
1090
|
-
|
|
927
|
+
a(() => cancelAnimationFrame(Se)), u(K, () => i(Ce));
|
|
928
|
+
let { selection: we } = le({ root: () => w.value?.getRootNode() });
|
|
929
|
+
u(we, (e) => {
|
|
930
|
+
let t = w.value;
|
|
931
|
+
f("select", e && t ? _e(t, e.range, ".pk-word-preview__measure, .pk-word-preview__part") : void 0);
|
|
1091
932
|
});
|
|
1092
|
-
let
|
|
1093
|
-
let t =
|
|
933
|
+
let Te = (e) => ee(e).map((e) => e.text).join("").replace(/\s+/g, " ").trim(), Ee = b(() => x.value.flatMap((e) => {
|
|
934
|
+
let t = c.preview.blocks[e.block], n = t.kind === "heading" ? [t.label, Te(t.runs)].filter(Boolean).join(" ") : "";
|
|
1094
935
|
return t.kind === "heading" && t.level <= 3 && n ? [{
|
|
1095
936
|
key: e.key,
|
|
1096
937
|
level: t.level,
|
|
1097
938
|
text: n
|
|
1098
939
|
}] : [];
|
|
1099
|
-
})),
|
|
1100
|
-
let t =
|
|
940
|
+
})), De = (e) => e.length > 60 ? `${e.slice(0, 60)}…` : e, X = b(() => x.value.flatMap((e) => {
|
|
941
|
+
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();
|
|
1101
942
|
return r || i ? [{
|
|
1102
943
|
key: e.key,
|
|
1103
|
-
removed:
|
|
1104
|
-
added:
|
|
944
|
+
removed: De(r),
|
|
945
|
+
added: De(i)
|
|
1105
946
|
}] : [];
|
|
1106
|
-
})),
|
|
1107
|
-
|
|
947
|
+
})), Oe = y("outline"), ke = y(!1), Ae = (e) => {
|
|
948
|
+
w.value?.querySelector(`[data-key="${e}"]`)?.scrollIntoView({
|
|
1108
949
|
block: "start",
|
|
1109
950
|
behavior: "smooth"
|
|
1110
|
-
}),
|
|
1111
|
-
},
|
|
951
|
+
}), ne.value || (ke.value = !1);
|
|
952
|
+
}, je = b(() => c.preview.blocks.flatMap((e) => e.kind === "table" ? e.rows.flat().map((e) => Te(e.runs)) : [Te(e.runs)]).join(" ").split(/\s+/).filter(Boolean).length), Me = b(() => c.preview.revisionAuthors.join(", "));
|
|
1112
953
|
return (t, n) => {
|
|
1113
|
-
let i =
|
|
1114
|
-
return
|
|
954
|
+
let i = ce;
|
|
955
|
+
return A(), k("div", {
|
|
1115
956
|
ref_key: "rootEl",
|
|
1116
|
-
ref:
|
|
1117
|
-
class: r(["pk-word-preview", { "pk-word-preview--paged":
|
|
957
|
+
ref: C,
|
|
958
|
+
class: r(["pk-word-preview", { "pk-word-preview--paged": F.value }])
|
|
1118
959
|
}, [
|
|
1119
|
-
(
|
|
960
|
+
(ne.value || ke.value) && (Ee.value.length || X.value.length) ? (A(), k("aside", {
|
|
1120
961
|
key: 0,
|
|
1121
|
-
class: r(["pk-word-preview__side", { "pk-word-preview__side--over": !
|
|
1122
|
-
"aria-label":
|
|
1123
|
-
}, [
|
|
962
|
+
class: r(["pk-word-preview__side", { "pk-word-preview__side--over": !ne.value }]),
|
|
963
|
+
"aria-label": O(g)("chatFilePreview.outline")
|
|
964
|
+
}, [v("div", $e, [v("button", {
|
|
1124
965
|
type: "button",
|
|
1125
966
|
role: "tab",
|
|
1126
967
|
class: "pk-word-preview__tab",
|
|
1127
|
-
"aria-selected":
|
|
1128
|
-
onClick: n[0] ||= (e) =>
|
|
1129
|
-
},
|
|
968
|
+
"aria-selected": Oe.value === "outline",
|
|
969
|
+
onClick: n[0] ||= (e) => Oe.value = "outline"
|
|
970
|
+
}, S(O(g)("chatFilePreview.outline")), 9, et), X.value.length ? (A(), k("button", {
|
|
1130
971
|
key: 0,
|
|
1131
972
|
type: "button",
|
|
1132
973
|
role: "tab",
|
|
1133
974
|
class: "pk-word-preview__tab",
|
|
1134
|
-
"aria-selected":
|
|
1135
|
-
onClick: n[1] ||= (e) =>
|
|
1136
|
-
},
|
|
975
|
+
"aria-selected": Oe.value === "changes",
|
|
976
|
+
onClick: n[1] ||= (e) => Oe.value = "changes"
|
|
977
|
+
}, S(O(g)("chatFilePreview.changes", { count: X.value.length })), 9, tt)) : E("", !0)]), Oe.value === "outline" || !X.value.length ? (A(), k("nav", nt, [(A(!0), k(_, null, p(Ee.value, (e) => (A(), k("button", {
|
|
1137
978
|
key: e.key,
|
|
1138
979
|
type: "button",
|
|
1139
980
|
class: r(["pk-word-preview__entry", `pk-word-preview__entry--${Math.min(e.level, 3)}`]),
|
|
1140
981
|
"aria-current": be.value === e.key ? "location" : void 0,
|
|
1141
|
-
onClick: (t) =>
|
|
1142
|
-
}, [
|
|
982
|
+
onClick: (t) => Ae(e.key)
|
|
983
|
+
}, [v("span", it, S(e.text), 1), X.value.some((t) => t.key === e.key) ? (A(), k("span", at)) : E("", !0)], 10, rt))), 128)), Ee.value.length ? E("", !0) : (A(), k("p", ot, S(O(g)("chatFilePreview.noHeadings")), 1))])) : (A(), k("nav", st, [(A(!0), k(_, null, p(X.value, (e) => (A(), k("button", {
|
|
1143
984
|
key: e.key,
|
|
1144
985
|
type: "button",
|
|
1145
986
|
class: "pk-word-preview__entry pk-word-preview__entry--change",
|
|
1146
|
-
onClick: (t) =>
|
|
1147
|
-
}, [e.removed ? (
|
|
1148
|
-
|
|
987
|
+
onClick: (t) => Ae(e.key)
|
|
988
|
+
}, [e.removed ? (A(), k("del", lt, S(e.removed), 1)) : E("", !0), e.added ? (A(), k("ins", ut, S(e.added), 1)) : E("", !0)], 8, ct))), 128))]))], 10, Qe)) : E("", !0),
|
|
989
|
+
v("div", dt, [v("div", {
|
|
1149
990
|
ref_key: "scrollEl",
|
|
1150
|
-
ref:
|
|
991
|
+
ref: w,
|
|
1151
992
|
class: "pk-word-preview__scroll",
|
|
1152
|
-
onScroll:
|
|
1153
|
-
}, [
|
|
993
|
+
onScroll: Ce
|
|
994
|
+
}, [F.value ? (A(), k("div", {
|
|
1154
995
|
key: 0,
|
|
1155
996
|
class: "pk-word-preview__pages",
|
|
1156
|
-
style:
|
|
1157
|
-
}, [(
|
|
997
|
+
style: l({ zoom: Y.value })
|
|
998
|
+
}, [(A(!0), k(_, null, p(K.value, (t, n) => (A(), k("article", {
|
|
1158
999
|
key: n,
|
|
1159
1000
|
"data-page": "",
|
|
1160
1001
|
class: "pk-word-preview__page",
|
|
1161
|
-
"aria-label":
|
|
1002
|
+
"aria-label": O(g)("chatFilePreview.pageOf", {
|
|
1162
1003
|
page: n + 1,
|
|
1163
|
-
count:
|
|
1004
|
+
count: K.value.length
|
|
1164
1005
|
}),
|
|
1165
|
-
style:
|
|
1006
|
+
style: l(me(t))
|
|
1166
1007
|
}, [
|
|
1167
|
-
t.header && e.preview.parts?.[t.header] ? (
|
|
1008
|
+
t.header && e.preview.parts?.[t.header] ? (A(), h(Ze, {
|
|
1168
1009
|
key: 0,
|
|
1169
1010
|
blocks: e.preview.parts[t.header],
|
|
1170
1011
|
where: "header",
|
|
1171
|
-
section:
|
|
1012
|
+
section: j.value[t.section],
|
|
1172
1013
|
mode: e.mode,
|
|
1173
|
-
numbers:
|
|
1014
|
+
numbers: q.value[n]
|
|
1174
1015
|
}, null, 8, [
|
|
1175
1016
|
"blocks",
|
|
1176
1017
|
"section",
|
|
1177
1018
|
"mode",
|
|
1178
1019
|
"numbers"
|
|
1179
|
-
])) :
|
|
1180
|
-
(
|
|
1181
|
-
key:
|
|
1182
|
-
"data-key":
|
|
1183
|
-
block: e.preview.blocks[
|
|
1184
|
-
row:
|
|
1020
|
+
])) : E("", !0),
|
|
1021
|
+
(A(!0), k(_, null, p(t.items, (r) => (A(), h(Je, {
|
|
1022
|
+
key: x.value[r].key,
|
|
1023
|
+
"data-key": x.value[r].key,
|
|
1024
|
+
block: e.preview.blocks[x.value[r].block],
|
|
1025
|
+
row: x.value[r].row,
|
|
1185
1026
|
mode: e.mode,
|
|
1186
|
-
page:
|
|
1187
|
-
numbers:
|
|
1027
|
+
page: j.value[t.section].page,
|
|
1028
|
+
numbers: q.value[n]
|
|
1188
1029
|
}, null, 8, [
|
|
1189
1030
|
"data-key",
|
|
1190
1031
|
"block",
|
|
@@ -1193,33 +1034,33 @@ var pt = ["aria-label"], mt = {
|
|
|
1193
1034
|
"page",
|
|
1194
1035
|
"numbers"
|
|
1195
1036
|
]))), 128)),
|
|
1196
|
-
(
|
|
1037
|
+
(A(!0), k(_, null, p(he(t), (e, t) => (A(), k("img", {
|
|
1197
1038
|
key: `image-${t}`,
|
|
1198
1039
|
class: "pk-word-preview__float",
|
|
1199
|
-
style:
|
|
1040
|
+
style: l(e.css),
|
|
1200
1041
|
src: e.src,
|
|
1201
1042
|
alt: ""
|
|
1202
|
-
}, null, 12,
|
|
1203
|
-
t.footer && e.preview.parts?.[t.footer] ? (
|
|
1043
|
+
}, null, 12, pt))), 128)),
|
|
1044
|
+
t.footer && e.preview.parts?.[t.footer] ? (A(), h(Ze, {
|
|
1204
1045
|
key: 1,
|
|
1205
1046
|
blocks: e.preview.parts[t.footer],
|
|
1206
1047
|
where: "footer",
|
|
1207
|
-
section:
|
|
1048
|
+
section: j.value[t.section],
|
|
1208
1049
|
mode: e.mode,
|
|
1209
|
-
numbers:
|
|
1050
|
+
numbers: q.value[n]
|
|
1210
1051
|
}, null, 8, [
|
|
1211
1052
|
"blocks",
|
|
1212
1053
|
"section",
|
|
1213
1054
|
"mode",
|
|
1214
1055
|
"numbers"
|
|
1215
|
-
])) :
|
|
1216
|
-
], 12,
|
|
1056
|
+
])) : E("", !0)
|
|
1057
|
+
], 12, ft))), 128))], 4)) : (A(), k("article", {
|
|
1217
1058
|
key: 1,
|
|
1218
1059
|
ref_key: "flowEl",
|
|
1219
|
-
ref:
|
|
1060
|
+
ref: H,
|
|
1220
1061
|
class: "pk-word-preview__page pk-word-preview__page--flow",
|
|
1221
|
-
style:
|
|
1222
|
-
}, [(
|
|
1062
|
+
style: l(fe.value)
|
|
1063
|
+
}, [(A(!0), k(_, null, p(x.value, (t) => (A(), h(Je, {
|
|
1223
1064
|
key: t.key,
|
|
1224
1065
|
"data-key": t.key,
|
|
1225
1066
|
block: e.preview.blocks[t.block],
|
|
@@ -1230,126 +1071,126 @@ var pt = ["aria-label"], mt = {
|
|
|
1230
1071
|
"block",
|
|
1231
1072
|
"row",
|
|
1232
1073
|
"mode"
|
|
1233
|
-
]))), 128))], 4)), e.preview.truncated ? (
|
|
1234
|
-
|
|
1074
|
+
]))), 128))], 4)), e.preview.truncated ? (A(), k("p", mt, S(O(g)("chatFilePreview.truncated")), 1)) : E("", !0)], 544), v("div", ht, [
|
|
1075
|
+
F.value ? (A(), k("span", gt, S(O(g)("chatFilePreview.pageOf", {
|
|
1235
1076
|
page: ye.value + 1,
|
|
1236
|
-
count:
|
|
1237
|
-
})), 1)) :
|
|
1238
|
-
|
|
1239
|
-
e.mode === "markup" && e.preview.revisionAuthors.length ? (
|
|
1240
|
-
|
|
1077
|
+
count: K.value.length
|
|
1078
|
+
})), 1)) : E("", !0),
|
|
1079
|
+
v("span", _t, S(O(g)("chatFilePreview.words", je.value)), 1),
|
|
1080
|
+
e.mode === "markup" && e.preview.revisionAuthors.length ? (A(), k("span", vt, [
|
|
1081
|
+
v("span", {
|
|
1241
1082
|
class: "pk-word-preview__legend-text",
|
|
1242
|
-
title:
|
|
1243
|
-
},
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
])) :
|
|
1247
|
-
n[6] ||=
|
|
1248
|
-
!
|
|
1083
|
+
title: O(g)("chatFilePreview.revisionsOf", { authors: Me.value })
|
|
1084
|
+
}, S(O(g)("chatFilePreview.revisionsOf", { authors: Me.value })), 9, yt),
|
|
1085
|
+
v("del", bt, S(O(g)("chatFilePreview.removed")), 1),
|
|
1086
|
+
v("ins", xt, S(O(g)("chatFilePreview.added")), 1)
|
|
1087
|
+
])) : E("", !0),
|
|
1088
|
+
n[6] ||= v("span", { class: "pk-word-preview__spacer" }, null, -1),
|
|
1089
|
+
!ne.value && (Ee.value.length || X.value.length) ? (A(), h(i, {
|
|
1249
1090
|
key: 2,
|
|
1250
1091
|
class: "pk-word-preview__outline-toggle",
|
|
1251
1092
|
modifiers: "action-quiet",
|
|
1252
1093
|
icon: "ri:list-unordered",
|
|
1253
|
-
label:
|
|
1254
|
-
title:
|
|
1255
|
-
"aria-label":
|
|
1256
|
-
"aria-expanded":
|
|
1257
|
-
onClick: n[2] ||= (e) =>
|
|
1094
|
+
label: O(g)("chatFilePreview.outline"),
|
|
1095
|
+
title: O(g)("chatFilePreview.outline"),
|
|
1096
|
+
"aria-label": O(g)("chatFilePreview.outline"),
|
|
1097
|
+
"aria-expanded": ke.value,
|
|
1098
|
+
onClick: n[2] ||= (e) => ke.value = !ke.value
|
|
1258
1099
|
}, null, 8, [
|
|
1259
1100
|
"label",
|
|
1260
1101
|
"title",
|
|
1261
1102
|
"aria-label",
|
|
1262
1103
|
"aria-expanded"
|
|
1263
|
-
])) :
|
|
1264
|
-
|
|
1265
|
-
|
|
1104
|
+
])) : E("", !0),
|
|
1105
|
+
F.value ? (A(), k(_, { key: 3 }, [
|
|
1106
|
+
d(i, {
|
|
1266
1107
|
class: "pk-word-preview__fit",
|
|
1267
1108
|
modifiers: "action-quiet",
|
|
1268
1109
|
icon: "ri:expand-width-line",
|
|
1269
|
-
label:
|
|
1270
|
-
title:
|
|
1271
|
-
"aria-label":
|
|
1272
|
-
disabled:
|
|
1273
|
-
onClick: n[3] ||= (e) =>
|
|
1110
|
+
label: O(g)("chatFilePreview.fitWidth"),
|
|
1111
|
+
title: O(g)("chatFilePreview.fitWidth"),
|
|
1112
|
+
"aria-label": O(g)("chatFilePreview.fitWidth"),
|
|
1113
|
+
disabled: J.value,
|
|
1114
|
+
onClick: n[3] ||= (e) => J.value = !0
|
|
1274
1115
|
}, null, 8, [
|
|
1275
1116
|
"label",
|
|
1276
1117
|
"title",
|
|
1277
1118
|
"aria-label",
|
|
1278
1119
|
"disabled"
|
|
1279
1120
|
]),
|
|
1280
|
-
|
|
1121
|
+
d(i, {
|
|
1281
1122
|
modifiers: "action-quiet",
|
|
1282
1123
|
icon: "ri:subtract-line",
|
|
1283
|
-
"aria-label":
|
|
1284
|
-
disabled:
|
|
1285
|
-
onClick: n[4] ||= (e) =>
|
|
1124
|
+
"aria-label": O(g)("chatFilePreview.zoomOut"),
|
|
1125
|
+
disabled: Y.value <= .3,
|
|
1126
|
+
onClick: n[4] ||= (e) => ve(-.1)
|
|
1286
1127
|
}, null, 8, ["aria-label", "disabled"]),
|
|
1287
|
-
|
|
1288
|
-
|
|
1128
|
+
v("span", St, S(Math.round(Y.value * 100)) + "% ", 1),
|
|
1129
|
+
d(i, {
|
|
1289
1130
|
modifiers: "action-quiet",
|
|
1290
1131
|
icon: "ri:add-line",
|
|
1291
|
-
"aria-label":
|
|
1292
|
-
disabled:
|
|
1293
|
-
onClick: n[5] ||= (e) =>
|
|
1132
|
+
"aria-label": O(g)("chatFilePreview.zoomIn"),
|
|
1133
|
+
disabled: Y.value >= 2,
|
|
1134
|
+
onClick: n[5] ||= (e) => ve(.1)
|
|
1294
1135
|
}, null, 8, ["aria-label", "disabled"])
|
|
1295
|
-
], 64)) :
|
|
1136
|
+
], 64)) : E("", !0)
|
|
1296
1137
|
])]),
|
|
1297
|
-
|
|
1138
|
+
F.value ? (A(), k("div", {
|
|
1298
1139
|
key: 1,
|
|
1299
1140
|
ref_key: "measureEl",
|
|
1300
1141
|
ref: T,
|
|
1301
1142
|
class: "pk-word-preview__measure",
|
|
1302
1143
|
"aria-hidden": "true",
|
|
1303
|
-
style:
|
|
1304
|
-
}, [(
|
|
1144
|
+
style: l(ue.value)
|
|
1145
|
+
}, [(A(!0), k(_, null, p(x.value, (t) => (A(), k("div", {
|
|
1305
1146
|
key: t.key,
|
|
1306
1147
|
"data-item": ""
|
|
1307
|
-
}, [
|
|
1148
|
+
}, [d(Je, {
|
|
1308
1149
|
block: e.preview.blocks[t.block],
|
|
1309
1150
|
row: t.row,
|
|
1310
1151
|
mode: e.mode,
|
|
1311
|
-
page:
|
|
1152
|
+
page: M.value
|
|
1312
1153
|
}, null, 8, [
|
|
1313
1154
|
"block",
|
|
1314
1155
|
"row",
|
|
1315
1156
|
"mode",
|
|
1316
1157
|
"page"
|
|
1317
|
-
])]))), 128)), (
|
|
1158
|
+
])]))), 128)), (A(!0), k(_, null, p(e.preview.parts, (t, n) => (A(), k("div", {
|
|
1318
1159
|
key: n,
|
|
1319
1160
|
"data-part": n
|
|
1320
|
-
}, [(
|
|
1161
|
+
}, [(A(!0), k(_, null, p(O(B)(t, e.mode), (n) => (A(), h(Je, {
|
|
1321
1162
|
key: n.key,
|
|
1322
1163
|
block: t[n.block],
|
|
1323
1164
|
row: n.row,
|
|
1324
1165
|
mode: e.mode,
|
|
1325
|
-
page:
|
|
1166
|
+
page: M.value
|
|
1326
1167
|
}, null, 8, [
|
|
1327
1168
|
"block",
|
|
1328
1169
|
"row",
|
|
1329
1170
|
"mode",
|
|
1330
1171
|
"page"
|
|
1331
|
-
]))), 128))], 8,
|
|
1172
|
+
]))), 128))], 8, Ct))), 128))], 4)) : E("", !0)
|
|
1332
1173
|
], 2);
|
|
1333
1174
|
};
|
|
1334
1175
|
}
|
|
1335
1176
|
}), [["styles", [".pk-word-preview{flex:1;min-height:0;display:flex;position:relative}.pk-word-preview__side{gap:var(--spacing-12);width:16.5rem;padding:var(--spacing-12);box-sizing:border-box;border-right:var(--border) solid var(--color-surface-3);background-color:var(--color-surface);flex-direction:column;flex-shrink:0;display:flex;overflow-y:auto}.pk-word-preview__side--over{inset:0 auto var(--spacing-40) 0;z-index:3;box-shadow:var(--shadow-lg);position:absolute}.pk-word-preview__tabs{border-bottom:var(--border) solid var(--color-surface-3);display:flex}.pk-word-preview__tab{min-height:var(--spacing-40);color:var(--color-word-3);font:inherit;font-size:var(--text-14);cursor:pointer;background:0 0;border:0;flex:1}.pk-word-preview__tab[aria-selected=true]{box-shadow:inset 0 calc(var(--spacing-2) * -1) 0 var(--color-word-1);color:var(--color-word-1);font-weight:var(--font-semibold)}.pk-word-preview__list{border:var(--border) solid var(--color-surface-3);border-radius:var(--rounded-lg);flex-direction:column;flex-shrink:0;display:flex;overflow:hidden}.pk-word-preview__entry{align-items:center;gap:var(--spacing-8);min-height:var(--spacing-40);padding:var(--spacing-8) var(--spacing-12);border:0;border-bottom:var(--border) solid var(--color-surface-2);color:var(--color-word-2);font:inherit;font-size:var(--text-14);text-align:start;cursor:pointer;transition:background-color var(--duration-150) var(--ease-out);background:0 0;display:flex}.pk-word-preview__entry:last-child{border-bottom:0}.pk-word-preview__entry:hover{background-color:var(--color-surface-1)}.pk-word-preview__entry[aria-current=location]{background-color:var(--color-surface-2);box-shadow:inset var(--spacing-3) 0 0 var(--color-word-2);color:var(--color-word-1);font-weight:var(--font-medium)}.pk-word-preview__entry--0{font-weight:var(--font-semibold)}.pk-word-preview__entry--2{padding-left:var(--spacing-24)}.pk-word-preview__entry--3{padding-left:var(--spacing-36)}.pk-word-preview__entry--change{gap:var(--spacing-4) var(--spacing-8);font-size:var(--text-12);flex-wrap:wrap}.pk-word-preview__entry-text{flex:1;min-width:0}.pk-word-preview__none{padding:var(--spacing-md);color:var(--color-word-3);font-size:var(--text-12);text-align:center;margin:0}.pk-word-preview__main{flex-direction:column;flex:1;min-width:0;display:flex}.pk-word-preview__scroll{min-height:0;padding:var(--spacing-md);background-color:var(--color-surface-2);flex:1;overflow:auto}.pk-word-preview__pages{align-items:center;gap:var(--spacing-24);flex-direction:column;width:max-content;min-width:100%;display:flex}.pk-word-preview__page{isolation:isolate;box-sizing:border-box;line-height:var(--pk-word-line,1.17);overflow-wrap:break-word;background-color:#fff;position:relative;overflow:hidden;box-shadow:0 1px 3px #140e3329,0 10px 28px #140e3314}.pk-word-preview__page--flow{width:100%;padding:var(--spacing-24) var(--spacing-20)}.pk-word-preview__measure{visibility:hidden;pointer-events:none;height:0;line-height:var(--pk-word-line,1.17);overflow-wrap:break-word;position:absolute;top:0;left:-100000px;overflow:hidden}.pk-word-preview__block{white-space:pre-wrap;margin:0;display:flow-root;position:relative}.pk-word-preview__picture{vertical-align:baseline;max-width:100%;height:auto}.pk-word-preview__picture--paragraph{max-width:none}.pk-word-preview__float{max-width:none;position:absolute}.pk-word-preview__part{pointer-events:none;position:absolute;inset:0}.pk-word-preview__part-flow{pointer-events:auto;position:absolute}.pk-word-preview__label{text-indent:0;display:inline-block}.pk-word-preview__changed:before{content:\"\";background-color:#3f3c51;width:1.5pt;position:absolute;top:0;bottom:0;left:-14pt}.pk-word-preview__table{border-collapse:collapse;table-layout:fixed;width:100%;margin:0;position:relative}.pk-word-preview__table td{vertical-align:top;white-space:pre-wrap;overflow-wrap:anywhere;padding:0 5.4pt}.pk-word-preview__table--lines td{border:.5pt solid #000}.pk-word-preview__table--lines.pk-word-preview__table--next td{border-top:0}.pk-word-preview__removed{color:var(--u-danger-text,#c42b3c);text-decoration:line-through}.pk-word-preview__added{color:var(--u-success-text,#178230);text-underline-offset:.2em;text-decoration:underline}.pk-word-preview__page .pk-word-preview__removed{color:#c42b3c}.pk-word-preview__page .pk-word-preview__added{color:#178230}.pk-word-preview__removed+.pk-word-preview__added{margin-inline-start:.15em}.pk-word-preview__image{padding:var(--spacing-2) var(--spacing-8);border:var(--border) dashed #c9c8d2;border-radius:var(--rounded);color:#6b6880;text-indent:0;font-size:9pt;display:inline-block}.pk-word-preview__truncated{margin:var(--spacing-md) 0 0;color:var(--color-word-3);font-size:var(--text-12);text-align:center}.pk-word-preview__status{align-items:center;gap:var(--spacing-16);min-height:var(--spacing-40);padding:0 var(--spacing-8) 0 var(--spacing-12);border-top:var(--border) solid var(--color-surface-3);background-color:var(--color-surface-1);color:var(--color-word-2);font-size:var(--text-12);white-space:nowrap;display:flex}.pk-word-preview__status>*{flex-shrink:0}.pk-word-preview__count{font-variant-numeric:tabular-nums}.pk-word-preview__status>.pk-word-preview__legend{gap:var(--spacing-8);flex-shrink:1;min-width:0;display:flex}.pk-word-preview__legend-text{text-overflow:ellipsis;min-width:0;overflow:hidden}.pk-word-preview__legend>.pk-word-preview__removed,.pk-word-preview__legend>.pk-word-preview__added{flex-shrink:0}.pk-word-preview__spacer{flex:1}@container (width<46rem){.pk-word-preview__status{gap:var(--spacing-12)}.pk-word-preview__outline-toggle .vv-button__label,.pk-word-preview__fit .vv-button__label{display:none}}.pk-word-preview__percent{min-width:var(--spacing-40);font-variant-numeric:tabular-nums;text-align:center}"]]]);
|
|
1336
1177
|
// ../../packages/components/src/chat/PkFilePreview.vue?vue&type=script&setup=true&lang.ts
|
|
1337
|
-
|
|
1338
|
-
var
|
|
1178
|
+
x(), f(), C();
|
|
1179
|
+
var Dt = ["aria-label"], Ot = { class: "pk-file-preview__head" }, kt = { class: "pk-file-preview__file" }, At = {
|
|
1339
1180
|
class: "pk-file-preview__tile",
|
|
1340
1181
|
"aria-hidden": "true"
|
|
1341
|
-
},
|
|
1182
|
+
}, jt = { class: "pk-file-preview__name" }, Mt = { class: "pk-file-preview__title" }, Nt = { class: "pk-file-preview__note" }, Pt = {
|
|
1342
1183
|
key: 0,
|
|
1343
1184
|
class: "pk-file-preview__tools"
|
|
1344
|
-
},
|
|
1185
|
+
}, Ft = ["aria-label"], It = { class: "pk-file-preview__version" }, Lt = { class: "pk-file-preview__mode-long" }, Rt = { class: "pk-file-preview__mode-short" }, zt = { class: "pk-file-preview__actions" }, Bt = { class: "pk-file-preview__body" }, Vt = {
|
|
1345
1186
|
key: 0,
|
|
1346
1187
|
class: "pk-file-preview__skeleton vv-skeleton"
|
|
1347
|
-
},
|
|
1188
|
+
}, Ht = {
|
|
1348
1189
|
key: 1,
|
|
1349
1190
|
class: "pk-file-preview__empty"
|
|
1350
|
-
},
|
|
1191
|
+
}, Ut = /*@__PURE__*/ D({
|
|
1351
1192
|
__name: "PkFilePreview",
|
|
1352
|
-
props: /*@__PURE__*/
|
|
1193
|
+
props: /*@__PURE__*/ c({
|
|
1353
1194
|
kind: { type: String },
|
|
1354
1195
|
filename: { type: String },
|
|
1355
1196
|
version: { type: Number },
|
|
@@ -1376,7 +1217,7 @@ var Ht = ["aria-label"], Ut = { class: "pk-file-preview__head" }, Wt = { class:
|
|
|
1376
1217
|
},
|
|
1377
1218
|
fitModifiers: {}
|
|
1378
1219
|
}),
|
|
1379
|
-
emits: /*@__PURE__*/
|
|
1220
|
+
emits: /*@__PURE__*/ c([
|
|
1380
1221
|
"close",
|
|
1381
1222
|
"version",
|
|
1382
1223
|
"restore",
|
|
@@ -1389,88 +1230,88 @@ var Ht = ["aria-label"], Ut = { class: "pk-file-preview__head" }, Wt = { class:
|
|
|
1389
1230
|
"update:fit"
|
|
1390
1231
|
]),
|
|
1391
1232
|
setup(e, { emit: t }) {
|
|
1392
|
-
let n = e, a = t, { t:
|
|
1233
|
+
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"), D = o(e, "fit"), ne = b(() => [
|
|
1393
1234
|
{
|
|
1394
1235
|
value: "markup",
|
|
1395
|
-
label:
|
|
1236
|
+
label: s("chatFilePreview.modeMarkup")
|
|
1396
1237
|
},
|
|
1397
1238
|
{
|
|
1398
1239
|
value: "accepted",
|
|
1399
|
-
label:
|
|
1240
|
+
label: s("chatFilePreview.modeAccepted")
|
|
1400
1241
|
},
|
|
1401
1242
|
{
|
|
1402
1243
|
value: "original",
|
|
1403
|
-
label:
|
|
1244
|
+
label: s("chatFilePreview.modeOriginal")
|
|
1404
1245
|
}
|
|
1405
|
-
]),
|
|
1406
|
-
|
|
1407
|
-
|
|
1246
|
+
]), j = b(() => n.preview?.kind === "word" && n.preview.revisionAuthors.length > 0);
|
|
1247
|
+
u(() => n.version, () => {
|
|
1248
|
+
x.value = "markup";
|
|
1408
1249
|
});
|
|
1409
|
-
let
|
|
1410
|
-
|
|
1250
|
+
let M = m("rootEl"), N = te(), P = y(!1), F = () => {
|
|
1251
|
+
N.value = void 0, P.value = !1;
|
|
1411
1252
|
};
|
|
1412
|
-
|
|
1253
|
+
u(() => [
|
|
1413
1254
|
n.version,
|
|
1414
1255
|
n.preview,
|
|
1415
|
-
|
|
1256
|
+
x.value
|
|
1416
1257
|
], F);
|
|
1417
|
-
let
|
|
1418
|
-
|
|
1258
|
+
let ie = (e) => {
|
|
1259
|
+
P.value || (N.value = e);
|
|
1419
1260
|
};
|
|
1420
|
-
|
|
1421
|
-
let n =
|
|
1261
|
+
u(P, async (e, t) => {
|
|
1262
|
+
let n = N.value;
|
|
1422
1263
|
t && !e && n?.format === "docx" && (await i(), n.restore());
|
|
1423
1264
|
});
|
|
1424
|
-
let
|
|
1265
|
+
let I = b(() => !n.version || n.version === l.value[l.value.length - 1]), ae = () => {
|
|
1425
1266
|
let e = l.value[l.value.length - 1];
|
|
1426
1267
|
e && a("version", e);
|
|
1427
|
-
},
|
|
1428
|
-
let e =
|
|
1429
|
-
return e?.format === "docx" ? e.paragraphCount > 200 : (e?.cells ?? 0) >
|
|
1430
|
-
}),
|
|
1431
|
-
let e =
|
|
1268
|
+
}, L = b(() => {
|
|
1269
|
+
let e = N.value;
|
|
1270
|
+
return e?.format === "docx" ? e.paragraphCount > 200 : (e?.cells ?? 0) > de;
|
|
1271
|
+
}), R = b(() => N.value?.format === "docx" && x.value === "original"), z = b(() => L.value || R.value), B = b(() => R.value ? s("selectionActions.hintOriginal") : L.value ? s(N.value?.format === "docx" ? "selectionActions.hintParagraphs" : "selectionActions.hintCells", { count: N.value?.format === "docx" ? 200 : de }) : void 0), oe = (e) => e[c.value] ?? e[c.value.split("-")[0]] ?? Object.values(e)[0] ?? "", le = ["explain", "summarize"], H = b(() => {
|
|
1272
|
+
let e = N.value, t = n.selectionActions;
|
|
1432
1273
|
if (!e || !t) return [];
|
|
1433
1274
|
let r = e.format;
|
|
1434
|
-
return [...(r === "docx" &&
|
|
1275
|
+
return [...(r === "docx" && z.value ? le : t.builtIns).map((e) => ({
|
|
1435
1276
|
id: e,
|
|
1436
|
-
label:
|
|
1437
|
-
...e === "translate" && { asks:
|
|
1438
|
-
prompt: (t) =>
|
|
1439
|
-
})), ...(
|
|
1277
|
+
label: s(`selectionActions.builtIn.${e}`),
|
|
1278
|
+
...e === "translate" && { asks: s("selectionActions.translateAsks") },
|
|
1279
|
+
prompt: (t) => s(`selectionActions.prompt.${r}.${e}`, { language: t ?? "" })
|
|
1280
|
+
})), ...(z.value ? [] : t.actions).map((e) => ({
|
|
1440
1281
|
id: e.id,
|
|
1441
|
-
label:
|
|
1442
|
-
prompt: () =>
|
|
1282
|
+
label: oe(e.label),
|
|
1283
|
+
prompt: () => oe(e.prompt)
|
|
1443
1284
|
}))];
|
|
1444
|
-
}),
|
|
1445
|
-
if (e.format === "docx") return
|
|
1285
|
+
}), fe = (e) => {
|
|
1286
|
+
if (e.format === "docx") return s("selectionActions.labelParagraphs", {
|
|
1446
1287
|
file: n.filename,
|
|
1447
1288
|
count: e.paragraphCount
|
|
1448
1289
|
}, e.paragraphCount);
|
|
1449
1290
|
let [t, r] = e.range.split(":");
|
|
1450
|
-
return r ?
|
|
1291
|
+
return r ? s("selectionActions.labelCells", {
|
|
1451
1292
|
file: n.filename,
|
|
1452
1293
|
sheet: e.sheet,
|
|
1453
1294
|
from: t,
|
|
1454
1295
|
to: r
|
|
1455
|
-
}) :
|
|
1296
|
+
}) : s("selectionActions.labelCell", {
|
|
1456
1297
|
file: n.filename,
|
|
1457
1298
|
sheet: e.sheet,
|
|
1458
1299
|
cell: t
|
|
1459
1300
|
});
|
|
1460
|
-
},
|
|
1301
|
+
}, W = (e) => {
|
|
1461
1302
|
if (!n.fileId || !n.storedFileName) return;
|
|
1462
1303
|
let t = {
|
|
1463
1304
|
fileId: n.fileId,
|
|
1464
1305
|
version: n.version ?? 1,
|
|
1465
1306
|
storedFileName: n.storedFileName,
|
|
1466
|
-
label:
|
|
1307
|
+
label: fe(e)
|
|
1467
1308
|
};
|
|
1468
1309
|
if (e.format === "docx") {
|
|
1469
1310
|
let { measure: n, ...r } = e;
|
|
1470
1311
|
return {
|
|
1471
1312
|
...t,
|
|
1472
1313
|
...r,
|
|
1473
|
-
...
|
|
1314
|
+
...R.value && { original: !0 }
|
|
1474
1315
|
};
|
|
1475
1316
|
}
|
|
1476
1317
|
let { measure: r, cells: i, ...a } = e;
|
|
@@ -1478,23 +1319,23 @@ var Ht = ["aria-label"], Ut = { class: "pk-file-preview__head" }, Wt = { class:
|
|
|
1478
1319
|
...t,
|
|
1479
1320
|
...a
|
|
1480
1321
|
};
|
|
1481
|
-
},
|
|
1482
|
-
let n =
|
|
1322
|
+
}, G = (e, t) => {
|
|
1323
|
+
let n = N.value, r = n && W(n);
|
|
1483
1324
|
r && (a("selectionSend", e, r, {
|
|
1484
1325
|
id: t,
|
|
1485
1326
|
size: n.format === "docx" ? n.paragraphCount : n.cells
|
|
1486
1327
|
}), F(), document.getSelection()?.removeAllRanges());
|
|
1487
|
-
},
|
|
1488
|
-
let n =
|
|
1489
|
-
n &&
|
|
1490
|
-
},
|
|
1491
|
-
|
|
1328
|
+
}, pe = (e, t) => {
|
|
1329
|
+
let n = H.value.find((t) => t.id === e);
|
|
1330
|
+
n && G(n.prompt(t), e);
|
|
1331
|
+
}, K = y(0);
|
|
1332
|
+
V(M, "scroll", () => K.value++, {
|
|
1492
1333
|
capture: !0,
|
|
1493
1334
|
passive: !0
|
|
1494
|
-
}),
|
|
1495
|
-
let
|
|
1496
|
-
|
|
1497
|
-
let e =
|
|
1335
|
+
}), V(window, "resize", () => K.value++, { passive: !0 });
|
|
1336
|
+
let q = b(() => {
|
|
1337
|
+
K.value;
|
|
1338
|
+
let e = N.value?.measure(), t = M.value?.getBoundingClientRect();
|
|
1498
1339
|
if (e && t) return {
|
|
1499
1340
|
start: {
|
|
1500
1341
|
top: e.start.top - t.top,
|
|
@@ -1510,147 +1351,147 @@ var Ht = ["aria-label"], Ut = { class: "pk-file-preview__head" }, Wt = { class:
|
|
|
1510
1351
|
};
|
|
1511
1352
|
});
|
|
1512
1353
|
return (t, n) => {
|
|
1513
|
-
let i =
|
|
1514
|
-
return
|
|
1354
|
+
let i = se, o = ce;
|
|
1355
|
+
return A(), k("section", {
|
|
1515
1356
|
ref_key: "rootEl",
|
|
1516
|
-
ref:
|
|
1357
|
+
ref: M,
|
|
1517
1358
|
class: "pk-file-preview",
|
|
1518
1359
|
"aria-label": e.filename,
|
|
1519
1360
|
tabindex: "-1",
|
|
1520
1361
|
autofocus: ""
|
|
1521
1362
|
}, [
|
|
1522
|
-
|
|
1523
|
-
|
|
1363
|
+
v("header", Ot, [
|
|
1364
|
+
v("div", kt, [v("span", At, [d(i, {
|
|
1524
1365
|
name: e.kind === "word" ? "ri:file-word-2-line" : "ri:file-excel-2-line",
|
|
1525
1366
|
class: r(e.kind === "word" ? "pk-file-preview__icon--word" : "pk-file-preview__icon--sheet")
|
|
1526
|
-
}, null, 8, ["name", "class"])]),
|
|
1527
|
-
e.version && l.value.length > 1 ||
|
|
1367
|
+
}, null, 8, ["name", "class"])]), v("div", jt, [v("strong", Mt, S(e.filename), 1), v("span", Nt, S(O(s)("chatFilePreview.readOnly")), 1)])]),
|
|
1368
|
+
e.version && l.value.length > 1 || j.value ? (A(), k("div", Pt, [e.version && l.value.length > 1 ? (A(), k("nav", {
|
|
1528
1369
|
key: 0,
|
|
1529
1370
|
class: "pk-file-preview__versions",
|
|
1530
|
-
"aria-label":
|
|
1371
|
+
"aria-label": O(s)("chatFilePreview.versions")
|
|
1531
1372
|
}, [
|
|
1532
|
-
|
|
1373
|
+
d(o, {
|
|
1533
1374
|
modifiers: "action-quiet",
|
|
1534
1375
|
icon: "ri:arrow-left-s-line",
|
|
1535
|
-
"aria-label":
|
|
1536
|
-
disabled: !
|
|
1537
|
-
onClick: n[0] ||= (e) =>
|
|
1376
|
+
"aria-label": O(s)("chatFilePreview.previousVersion"),
|
|
1377
|
+
disabled: !g.value,
|
|
1378
|
+
onClick: n[0] ||= (e) => g.value && a("version", g.value)
|
|
1538
1379
|
}, null, 8, ["aria-label", "disabled"]),
|
|
1539
|
-
|
|
1380
|
+
v("span", It, S(O(s)("chatFilePreview.versionOf", {
|
|
1540
1381
|
version: e.version,
|
|
1541
1382
|
count: l.value.length
|
|
1542
1383
|
})), 1),
|
|
1543
|
-
|
|
1384
|
+
d(o, {
|
|
1544
1385
|
modifiers: "action-quiet",
|
|
1545
1386
|
icon: "ri:arrow-right-s-line",
|
|
1546
|
-
"aria-label":
|
|
1387
|
+
"aria-label": O(s)("chatFilePreview.nextVersion"),
|
|
1547
1388
|
disabled: !ee.value,
|
|
1548
1389
|
onClick: n[1] ||= (e) => ee.value && a("version", ee.value)
|
|
1549
1390
|
}, null, 8, ["aria-label", "disabled"])
|
|
1550
|
-
], 8,
|
|
1391
|
+
], 8, Ft)) : E("", !0), j.value ? (A(), h(U, {
|
|
1551
1392
|
key: 1,
|
|
1552
|
-
modelValue:
|
|
1553
|
-
"onUpdate:modelValue": n[2] ||= (e) =>
|
|
1393
|
+
modelValue: x.value,
|
|
1394
|
+
"onUpdate:modelValue": n[2] ||= (e) => x.value = e,
|
|
1554
1395
|
name: "revisions",
|
|
1555
1396
|
segmented: "",
|
|
1556
1397
|
class: "pk-file-preview__modes u-segmented-fit mb-0",
|
|
1557
|
-
"aria-label":
|
|
1558
|
-
options:
|
|
1398
|
+
"aria-label": O(s)("chatFilePreview.modes"),
|
|
1399
|
+
options: ne.value
|
|
1559
1400
|
}, {
|
|
1560
|
-
markup:
|
|
1401
|
+
markup: T(() => [v("span", Lt, S(O(s)("chatFilePreview.modeMarkup")), 1), v("span", Rt, S(O(s)("chatFilePreview.modeMarkupShort")), 1)]),
|
|
1561
1402
|
_: 1
|
|
1562
1403
|
}, 8, [
|
|
1563
1404
|
"modelValue",
|
|
1564
1405
|
"aria-label",
|
|
1565
1406
|
"options"
|
|
1566
|
-
])) :
|
|
1567
|
-
|
|
1568
|
-
e.restorable ? (
|
|
1407
|
+
])) : E("", !0)])) : E("", !0),
|
|
1408
|
+
v("div", zt, [
|
|
1409
|
+
e.restorable ? (A(), h(o, {
|
|
1569
1410
|
key: 0,
|
|
1570
1411
|
modifiers: "action-quiet",
|
|
1571
1412
|
icon: "ri:arrow-go-back-line",
|
|
1572
|
-
label:
|
|
1413
|
+
label: O(s)("chatFilePreview.restore"),
|
|
1573
1414
|
onClick: n[3] ||= (e) => a("restore")
|
|
1574
|
-
}, null, 8, ["label"])) :
|
|
1575
|
-
|
|
1415
|
+
}, null, 8, ["label"])) : E("", !0),
|
|
1416
|
+
d(o, {
|
|
1576
1417
|
href: e.downloadUrl,
|
|
1577
1418
|
download: "",
|
|
1578
1419
|
modifiers: "action-quiet",
|
|
1579
1420
|
icon: "ri:download-line",
|
|
1580
|
-
title:
|
|
1581
|
-
"aria-label":
|
|
1421
|
+
title: O(s)("chatFilePreview.download"),
|
|
1422
|
+
"aria-label": O(s)("chatFilePreview.download")
|
|
1582
1423
|
}, null, 8, [
|
|
1583
1424
|
"href",
|
|
1584
1425
|
"title",
|
|
1585
1426
|
"aria-label"
|
|
1586
1427
|
]),
|
|
1587
|
-
e.resize === "expand" ? (
|
|
1428
|
+
e.resize === "expand" ? (A(), h(o, {
|
|
1588
1429
|
key: 1,
|
|
1589
1430
|
modifiers: "action-quiet",
|
|
1590
1431
|
icon: "ri:fullscreen-line",
|
|
1591
|
-
title:
|
|
1592
|
-
"aria-label":
|
|
1432
|
+
title: O(s)("chatFilePreview.expand"),
|
|
1433
|
+
"aria-label": O(s)("chatFilePreview.expand"),
|
|
1593
1434
|
onClick: n[4] ||= (e) => a("resize")
|
|
1594
|
-
}, null, 8, ["title", "aria-label"])) : e.resize === "shrink" ? (
|
|
1435
|
+
}, null, 8, ["title", "aria-label"])) : e.resize === "shrink" ? (A(), h(o, {
|
|
1595
1436
|
key: 2,
|
|
1596
1437
|
modifiers: "action-quiet",
|
|
1597
1438
|
icon: "ri:fullscreen-exit-line",
|
|
1598
|
-
title:
|
|
1599
|
-
"aria-label":
|
|
1439
|
+
title: O(s)("chatFilePreview.shrink"),
|
|
1440
|
+
"aria-label": O(s)("chatFilePreview.shrink"),
|
|
1600
1441
|
onClick: n[5] ||= (e) => a("resize")
|
|
1601
|
-
}, null, 8, ["title", "aria-label"])) :
|
|
1602
|
-
|
|
1442
|
+
}, null, 8, ["title", "aria-label"])) : E("", !0),
|
|
1443
|
+
d(o, {
|
|
1603
1444
|
modifiers: "action-quiet",
|
|
1604
1445
|
icon: "ri:close-line",
|
|
1605
|
-
title:
|
|
1606
|
-
"aria-label":
|
|
1446
|
+
title: O(s)("chatFilePreview.close"),
|
|
1447
|
+
"aria-label": O(s)("chatFilePreview.close"),
|
|
1607
1448
|
onClick: n[6] ||= (e) => a("close")
|
|
1608
1449
|
}, null, 8, ["title", "aria-label"])
|
|
1609
1450
|
])
|
|
1610
1451
|
]),
|
|
1611
|
-
|
|
1452
|
+
v("div", Bt, [e.loading ? (A(), k("div", Vt, [(A(), k(_, null, p(8, (e) => v("div", {
|
|
1612
1453
|
key: e,
|
|
1613
1454
|
class: r(["vv-skeleton__item pk-file-preview__skeleton-line", e % 3 ? "w-full" : "w-128"])
|
|
1614
|
-
}, null, 2)), 64))])) : e.error || !e.preview ? (
|
|
1455
|
+
}, null, 2)), 64))])) : e.error || !e.preview ? (A(), k("p", Ht, S(O(s)("chatFilePreview.unavailable")), 1)) : e.preview.kind === "word" ? (A(), h(Et, {
|
|
1615
1456
|
key: 2,
|
|
1616
|
-
zoom:
|
|
1617
|
-
"onUpdate:zoom": n[7] ||= (e) =>
|
|
1618
|
-
fit:
|
|
1619
|
-
"onUpdate:fit": n[8] ||= (e) =>
|
|
1457
|
+
zoom: w.value,
|
|
1458
|
+
"onUpdate:zoom": n[7] ||= (e) => w.value = e,
|
|
1459
|
+
fit: D.value,
|
|
1460
|
+
"onUpdate:fit": n[8] ||= (e) => D.value = e,
|
|
1620
1461
|
preview: e.preview,
|
|
1621
|
-
mode:
|
|
1622
|
-
onSelect:
|
|
1462
|
+
mode: j.value ? x.value : "markup",
|
|
1463
|
+
onSelect: ie
|
|
1623
1464
|
}, null, 8, [
|
|
1624
1465
|
"zoom",
|
|
1625
1466
|
"fit",
|
|
1626
1467
|
"preview",
|
|
1627
1468
|
"mode"
|
|
1628
|
-
])) : (
|
|
1469
|
+
])) : (A(), h(Be, {
|
|
1629
1470
|
key: 3,
|
|
1630
|
-
sheet:
|
|
1631
|
-
"onUpdate:sheet": n[9] ||= (e) =>
|
|
1632
|
-
zoom:
|
|
1633
|
-
"onUpdate:zoom": n[10] ||= (e) =>
|
|
1471
|
+
sheet: C.value,
|
|
1472
|
+
"onUpdate:sheet": n[9] ||= (e) => C.value = e,
|
|
1473
|
+
zoom: w.value,
|
|
1474
|
+
"onUpdate:zoom": n[10] ||= (e) => w.value = e,
|
|
1634
1475
|
preview: e.preview,
|
|
1635
|
-
onSelect:
|
|
1476
|
+
onSelect: ie
|
|
1636
1477
|
}, null, 8, [
|
|
1637
1478
|
"sheet",
|
|
1638
1479
|
"zoom",
|
|
1639
1480
|
"preview"
|
|
1640
1481
|
]))]),
|
|
1641
|
-
e.selectionActions &&
|
|
1482
|
+
e.selectionActions && N.value && q.value ? (A(), h(ue, {
|
|
1642
1483
|
key: 0,
|
|
1643
|
-
asking:
|
|
1644
|
-
"onUpdate:asking": n[11] ||= (e) =>
|
|
1484
|
+
asking: P.value,
|
|
1485
|
+
"onUpdate:asking": n[11] ||= (e) => P.value = e,
|
|
1645
1486
|
strategy: "absolute",
|
|
1646
|
-
anchor:
|
|
1647
|
-
actions:
|
|
1487
|
+
anchor: q.value,
|
|
1488
|
+
actions: H.value,
|
|
1648
1489
|
hint: B.value,
|
|
1649
|
-
note:
|
|
1650
|
-
"note-action":
|
|
1651
|
-
onAction:
|
|
1652
|
-
onAsk: n[12] ||= (e) =>
|
|
1653
|
-
onNote:
|
|
1490
|
+
note: I.value ? void 0 : O(s)("selectionActions.notLatest", { version: e.version }),
|
|
1491
|
+
"note-action": O(s)("selectionActions.openLatest"),
|
|
1492
|
+
onAction: pe,
|
|
1493
|
+
onAsk: n[12] ||= (e) => G(e, "ask"),
|
|
1494
|
+
onNote: ae,
|
|
1654
1495
|
onClose: F
|
|
1655
1496
|
}, null, 8, [
|
|
1656
1497
|
"asking",
|
|
@@ -1659,11 +1500,11 @@ var Ht = ["aria-label"], Ut = { class: "pk-file-preview__head" }, Wt = { class:
|
|
|
1659
1500
|
"hint",
|
|
1660
1501
|
"note",
|
|
1661
1502
|
"note-action"
|
|
1662
|
-
])) :
|
|
1663
|
-
], 8,
|
|
1503
|
+
])) : E("", !0)
|
|
1504
|
+
], 8, Dt);
|
|
1664
1505
|
};
|
|
1665
1506
|
}
|
|
1666
|
-
}),
|
|
1667
|
-
export {
|
|
1507
|
+
}), Wt = ".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}", Gt = /* @__PURE__ */ e({ default: () => Kt }), Kt = /*#__PURE__*/ H(Ut, [["styles", [Wt]]]);
|
|
1508
|
+
export { Gt as n, Kt as t };
|
|
1668
1509
|
|
|
1669
|
-
//# sourceMappingURL=PkFilePreview-
|
|
1510
|
+
//# sourceMappingURL=PkFilePreview-BIFkMsAC.js.map
|