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