@8wave/ai-elements 0.125.0-beta.16 → 0.125.0-beta.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -0
- package/dist/_chunks/{PkFilePreview-8nVPKv8k.js → PkFilePreview-BIFkMsAC.js} +559 -718
- package/dist/_chunks/PkFilePreview-BIFkMsAC.js.map +1 -0
- package/dist/_chunks/{PkFilePreviewDialog-BHPcGlnF.js → PkFilePreviewDialog-NLk4gZMd.js} +8 -8
- package/dist/_chunks/{PkFilePreviewDialog-BHPcGlnF.js.map → PkFilePreviewDialog-NLk4gZMd.js.map} +1 -1
- package/dist/_chunks/PkSelectionActions-CUymhwsG.js +168 -0
- package/dist/_chunks/PkSelectionActions-CUymhwsG.js.map +1 -0
- package/dist/ai-elements.es.js +4548 -4153
- 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-DmxsItHG.js → Agent-Cm1LrkYm.js} +162 -162
- package/dist-vue/_chunks/{Agent-DmxsItHG.js.map → Agent-Cm1LrkYm.js.map} +1 -1
- package/dist-vue/_chunks/{Document-CXfJxfu6.js → Document-DHBTrCuO.js} +10 -10
- package/dist-vue/_chunks/{Document-CXfJxfu6.js.map → Document-DHBTrCuO.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbot-Bpo22_yE.js → PkChatbot-BtUaZ-LR.js} +10 -9
- package/dist-vue/_chunks/PkChatbot-BtUaZ-LR.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotEmptyState-CQ_Qdkge.js → PkChatbotEmptyState-DJIkAskP.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-CQ_Qdkge.js.map → PkChatbotEmptyState-DJIkAskP.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotInput-BVu1b2Te.js → PkChatbotInput-DzqaW3EE.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotInput-BVu1b2Te.js.map → PkChatbotInput-DzqaW3EE.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotMessages-DftNL5ZQ.js → PkChatbotMessages-vkbq5p1X.js} +17 -17
- package/dist-vue/_chunks/{PkChatbotMessages-DftNL5ZQ.js.map → PkChatbotMessages-vkbq5p1X.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepPayload-AiDZPbds.js → PkChatbotStepPayload-cuYclK_2.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-AiDZPbds.js.map → PkChatbotStepPayload-cuYclK_2.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-CALZDpfQ.js → PkChatbotStepToolDetail-Yd8cUQJP.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-CALZDpfQ.js.map → PkChatbotStepToolDetail-Yd8cUQJP.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotSteps-CY7pN2Gl.js → PkChatbotSteps-D5yz8lut.js} +5 -5
- package/dist-vue/_chunks/{PkChatbotSteps-CY7pN2Gl.js.map → PkChatbotSteps-D5yz8lut.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-Drp0At_n.js → PkChatbotViewChat-DCPRePrE.js} +7 -7
- package/dist-vue/_chunks/{PkChatbotViewChat-Drp0At_n.js.map → PkChatbotViewChat-DCPRePrE.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewConversations-C0KqM_Wq.js → PkChatbotViewConversations-BBd3XMmM.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewConversations-C0KqM_Wq.js.map → PkChatbotViewConversations-BBd3XMmM.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-B9mYRoNK.js → PkChatbotViewFiles-BiQzDqJg.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewFiles-B9mYRoNK.js.map → PkChatbotViewFiles-BiQzDqJg.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-BfNE3d7F.js → PkChatbotViewProfile-7266UiRM.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-BfNE3d7F.js.map → PkChatbotViewProfile-7266UiRM.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreview-z7JcRtjP.js → PkFilePreview-DLo9nI2g.js} +426 -426
- package/dist-vue/_chunks/PkFilePreview-DLo9nI2g.js.map +1 -0
- package/dist-vue/_chunks/{PkFilePreviewDialog-zVon3aPY.js → PkFilePreviewDialog-CgDJQgIJ.js} +2 -2
- package/dist-vue/_chunks/{PkFilePreviewDialog-zVon3aPY.js.map → PkFilePreviewDialog-CgDJQgIJ.js.map} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-bJEDk-kM.js → PkStreamingMarkdown-C3UGCEXm.js} +3 -3
- package/dist-vue/_chunks/{PkStreamingMarkdown-bJEDk-kM.js.map → PkStreamingMarkdown-C3UGCEXm.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolChatFile-DqLGwJxp.js → PkToolChatFile-Dy0rGC29.js} +3 -3
- package/dist-vue/_chunks/{PkToolChatFile-DqLGwJxp.js.map → PkToolChatFile-Dy0rGC29.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestGeolocation-BnV7A6SW.js → PkToolRequestGeolocation-p7Ip17F7.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestGeolocation-BnV7A6SW.js.map → PkToolRequestGeolocation-p7Ip17F7.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-QCbQ7bnl.js → PkToolRequestOAuthConnection-CtXSzKzM.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-QCbQ7bnl.js.map → PkToolRequestOAuthConnection-CtXSzKzM.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-DanzULWt.js → PkToolShowArtifact-B7udnhpb.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-DanzULWt.js.map → PkToolShowArtifact-B7udnhpb.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-DzttQBG6.js → PkToolShowContactForm-0SEgxn2S.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-DzttQBG6.js.map → PkToolShowContactForm-0SEgxn2S.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-BNa89wcw.js → PkToolShowDiagram-BqHBhZgd.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-BNa89wcw.js.map → PkToolShowDiagram-BqHBhZgd.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-BXol1WE3.js → PkToolShowForm-C4n_3mFL.js} +4 -4
- package/dist-vue/_chunks/{PkToolShowForm-BXol1WE3.js.map → PkToolShowForm-C4n_3mFL.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-Dmr5zXTj.js → PkToolShowImageGallery-DEpdtLns.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowImageGallery-Dmr5zXTj.js.map → PkToolShowImageGallery-DEpdtLns.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-C_uIUG_G.js → PkToolShowProductList-Bm2NLUGS.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-C_uIUG_G.js.map → PkToolShowProductList-Bm2NLUGS.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-BHRNGn4s.js → PkToolShowSources-DwFqlit2.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowSources-BHRNGn4s.js.map → PkToolShowSources-DwFqlit2.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-DHCqxA1P.js → PkToolShowSuggestedReply-BRIzGNwx.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-DHCqxA1P.js.map → PkToolShowSuggestedReply-BRIzGNwx.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-P4H5A7ke.js → PkToolShowVideo-BLEJ8tng.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowVideo-P4H5A7ke.js.map → PkToolShowVideo-BLEJ8tng.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-BzNZHR7Q.js → PkToolShowWebPages-CeAXllAF.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-BzNZHR7Q.js.map → PkToolShowWebPages-CeAXllAF.js.map} +1 -1
- package/dist-vue/_chunks/{createChatbotApiClient-CQjxHqLr.js → createChatbotApiClient-BPN6cLGF.js} +14 -14
- package/dist-vue/_chunks/{createChatbotApiClient-CQjxHqLr.js.map → createChatbotApiClient-BPN6cLGF.js.map} +1 -1
- package/dist-vue/_chunks/{useChatbotStore-CyZha9pf.js → useChatbotStore-C4xhJtrb.js} +1242 -1242
- package/dist-vue/_chunks/{useChatbotStore-CyZha9pf.js.map → useChatbotStore-C4xhJtrb.js.map} +1 -1
- package/dist-vue/_chunks/{utils-8lO2Gj-m.js → utils-RwaXl9-x.js} +4 -4
- package/dist-vue/_chunks/{utils-8lO2Gj-m.js.map → utils-RwaXl9-x.js.map} +1 -1
- package/dist-vue/api.js +1 -1
- package/dist-vue/apps/web-component/src/components/EmbeddedChatWidget.ce.d.ts +4 -4
- package/dist-vue/apps/web-component/src/composables/usePagePointer.d.ts +14 -9
- package/dist-vue/apps/web-component/src/composables/usePendingMessage.d.ts +29 -15
- package/dist-vue/apps/web-component/src/composables/useSelectionActions.d.ts +77 -0
- package/dist-vue/composables.js +34 -8
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +5401 -5321
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +22 -2
- package/dist-vue/packages/components/src/chat/PkAgentSelectionActionsSettings.d.ts +25 -0
- package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +23 -3
- package/dist-vue/packages/components/src/chat/PkChatbot.d.ts +2 -1
- package/dist-vue/packages/components/src/chat/PkSelectionActions.d.ts +2 -12
- package/dist-vue/packages/components/src/chat/PkSelectionAnswerCard.d.ts +41 -0
- package/package.json +1 -1
- package/dist/_chunks/PkFilePreview-8nVPKv8k.js.map +0 -1
- package/dist-vue/_chunks/PkChatbot-Bpo22_yE.js.map +0 -1
- package/dist-vue/_chunks/PkFilePreview-z7JcRtjP.js.map +0 -1
|
@@ -2,14 +2,14 @@ import { t as e } from "./rolldown-runtime-CGnMp29N.js";
|
|
|
2
2
|
import { t } from "./PkEditorRadioButtons-Bw576DPQ.js";
|
|
3
3
|
import { i as n, n as r, r as i } from "./excelNumberFormat-C1sCQrOz.js";
|
|
4
4
|
import { t as a } from "./VvButtonLocalized-C-vx25u4.js";
|
|
5
|
-
import { G as o, H as s, J as c, K as l, R as u, U as d, V as f, W as p, o as m, q as h } from "./utils-
|
|
5
|
+
import { G as o, H as s, J as c, K as l, R as u, U as d, V as f, W as p, o as m, q as h } from "./utils-RwaXl9-x.js";
|
|
6
6
|
import { VvIcon as g } from "@volverjs/ui-vue/components";
|
|
7
|
-
import { Fragment as _, computed as v, createBlock as y, createCommentVNode as b, createElementBlock as x, createElementVNode as S, createTextVNode as C, createVNode as w, defineComponent as T, inject as
|
|
8
|
-
import { useI18n as
|
|
9
|
-
import { useElementSize as
|
|
7
|
+
import { Fragment as _, computed as v, createBlock as y, createCommentVNode as b, createElementBlock as x, createElementVNode as S, createTextVNode as C, createVNode as w, defineComponent as T, inject as ee, isMemoSame as E, mergeModels as D, nextTick as te, normalizeClass as O, normalizeStyle as k, onBeforeUnmount as A, onMounted as ne, onScopeDispose as j, openBlock as M, provide as N, ref as P, renderList as F, shallowRef as I, toDisplayString as L, unref as R, useModel as z, useTemplateRef as re, vModelText as B, watch as V, withCtx as H, withDirectives as U, withKeys as ie, withModifiers as W } from "vue";
|
|
8
|
+
import { useI18n as ae } from "vue-i18n";
|
|
9
|
+
import { useElementSize as oe, useEventListener as se } from "@vueuse/core";
|
|
10
10
|
// ../../packages/composable/src/useSettledSelection.ts
|
|
11
|
-
var
|
|
12
|
-
function
|
|
11
|
+
var ce = "(hover: hover) and (pointer: fine)";
|
|
12
|
+
function le(e) {
|
|
13
13
|
let t = document.getSelection();
|
|
14
14
|
if (!t || t.rangeCount === 0) return;
|
|
15
15
|
if (e.nodeType === Node.DOCUMENT_NODE) return t.getRangeAt(0).cloneRange();
|
|
@@ -29,13 +29,13 @@ function ue(e) {
|
|
|
29
29
|
let r = n.getSelection?.();
|
|
30
30
|
return r && r.rangeCount > 0 ? r.getRangeAt(0).cloneRange() : void 0;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
let i =
|
|
32
|
+
function ue({ root: e, enabled: t = () => !0, delay: n = 150, minChars: r = 2 }) {
|
|
33
|
+
let i = I(), a, o = () => {
|
|
34
34
|
clearTimeout(a), i.value = void 0;
|
|
35
35
|
}, s = () => {
|
|
36
36
|
let n = e();
|
|
37
37
|
if (!n || !t()) return;
|
|
38
|
-
let i =
|
|
38
|
+
let i = le(n);
|
|
39
39
|
if (!i || i.collapsed || i.toString().trim().length < r) return;
|
|
40
40
|
let a = i.getBoundingClientRect();
|
|
41
41
|
return {
|
|
@@ -48,7 +48,7 @@ function de({ root: e, enabled: t = () => !0, delay: n = 150, minChars: r = 2 })
|
|
|
48
48
|
i.value = s();
|
|
49
49
|
}, n);
|
|
50
50
|
};
|
|
51
|
-
return typeof document < "u" && typeof matchMedia == "function" && matchMedia(
|
|
51
|
+
return typeof document < "u" && typeof matchMedia == "function" && matchMedia(ce).matches && (document.addEventListener("selectionchange", c), j(() => {
|
|
52
52
|
clearTimeout(a), document.removeEventListener("selectionchange", c);
|
|
53
53
|
})), {
|
|
54
54
|
selection: i,
|
|
@@ -56,26 +56,26 @@ function de({ root: e, enabled: t = () => !0, delay: n = 150, minChars: r = 2 })
|
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
58
|
// ../../packages/components/src/chat/fileSelection.ts
|
|
59
|
-
var
|
|
60
|
-
let t = [...new Set(e)].sort((e, t) =>
|
|
59
|
+
var de = 2e3, G = 1e3, fe = 60, K = 1400, q = 20, J = (e) => Number(e.slice(1)), pe = (e) => {
|
|
60
|
+
let t = [...new Set(e)].sort((e, t) => J(e) - J(t)), n = [];
|
|
61
61
|
for (let e of t) {
|
|
62
62
|
let t = n[n.length - 1];
|
|
63
|
-
t &&
|
|
63
|
+
t && J(e) === J(t.to) + 1 ? t.to = e : n.push({
|
|
64
64
|
from: e,
|
|
65
65
|
to: e
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
68
|
return n.slice(0, 100);
|
|
69
|
-
},
|
|
69
|
+
}, me = (e, t) => {
|
|
70
70
|
let n = [];
|
|
71
71
|
for (let r = e.indexOf(t); r >= 0;) n.push(r), r = e.indexOf(t, r + t.length);
|
|
72
72
|
return n;
|
|
73
|
-
},
|
|
74
|
-
let r =
|
|
73
|
+
}, he = (e, t, n) => {
|
|
74
|
+
let r = me(e, e.slice(t, t + n));
|
|
75
75
|
if (r.length < 2) return {};
|
|
76
76
|
let i = t, a = t + n;
|
|
77
|
-
for (let t = !0; a - i <=
|
|
78
|
-
if (
|
|
77
|
+
for (let t = !0; a - i <= K; t = !t) {
|
|
78
|
+
if (me(e, e.slice(i, a)).length === 1) return { find: e.slice(i, a) };
|
|
79
79
|
if (t && i > 0) i = e.slice(0, i).replace(/\S*\s*$/, "").length;
|
|
80
80
|
else if (a < e.length) {
|
|
81
81
|
let t = e.slice(a).match(/^\s*\S*/)?.[0] ?? "";
|
|
@@ -86,17 +86,17 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
86
86
|
index: r.indexOf(t) + 1 || 1,
|
|
87
87
|
of: r.length
|
|
88
88
|
} };
|
|
89
|
-
},
|
|
89
|
+
}, ge = (e) => (e.querySelectorAll("[data-quote-skip]").forEach((e) => e.remove()), e.querySelectorAll("[data-paragraph]").forEach((e) => e.append("\n")), e.textContent ?? ""), _e = (e) => e.length > G ? `${e.slice(0, G / 2)} […] ${e.slice(-500)}` : e, ve = (e, t, n) => {
|
|
90
90
|
if (!e.contains(t.commonAncestorContainer)) return;
|
|
91
91
|
let r = [...e.querySelectorAll("[data-paragraph]")].filter((e) => !e.closest(n) && t.intersectsNode(e));
|
|
92
92
|
if (!r.length) return;
|
|
93
|
-
let i = r.flatMap((e) => e.dataset.paragraph.split(" ")), a =
|
|
93
|
+
let i = r.flatMap((e) => e.dataset.paragraph.split(" ")), a = ge(t.cloneContents()), o = a.trim();
|
|
94
94
|
if (o.length < 2) return;
|
|
95
95
|
let s = {
|
|
96
96
|
format: "docx",
|
|
97
|
-
runs:
|
|
97
|
+
runs: pe(i),
|
|
98
98
|
paragraphCount: new Set(i).size,
|
|
99
|
-
quote:
|
|
99
|
+
quote: _e(o),
|
|
100
100
|
measure: () => {
|
|
101
101
|
let e = t.getBoundingClientRect(), n = t.getClientRects()[0] ?? e;
|
|
102
102
|
return {
|
|
@@ -115,17 +115,17 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
115
115
|
if (r.length === 1) {
|
|
116
116
|
let e = r[0], n = document.createRange();
|
|
117
117
|
n.selectNodeContents(e);
|
|
118
|
-
let i =
|
|
118
|
+
let i = ge(n.cloneContents()).replace(/\n$/, ""), c = document.createRange();
|
|
119
119
|
c.setStart(e, 0), c.setEnd(t.startContainer, t.startOffset);
|
|
120
|
-
let l =
|
|
121
|
-
s.before = i.slice(Math.max(0, l -
|
|
120
|
+
let l = ge(c.cloneContents()).length + (a.length - a.trimStart().length);
|
|
121
|
+
s.before = i.slice(Math.max(0, l - fe), l), s.after = i.slice(l + o.length, l + o.length + fe), Object.assign(s, he(i, l, o.length));
|
|
122
122
|
}
|
|
123
123
|
return s;
|
|
124
|
-
},
|
|
124
|
+
}, Y = (e) => {
|
|
125
125
|
let t = "";
|
|
126
126
|
for (let n = e; n > 0; n = Math.floor((n - 1) / 26)) t = String.fromCharCode(65 + (n - 1) % 26) + t;
|
|
127
127
|
return t;
|
|
128
|
-
},
|
|
128
|
+
}, ye = (e, t) => {
|
|
129
129
|
let n = { ...t }, r = e.rows.flatMap((e) => e.cells.filter((e) => e.span).map((t) => ({
|
|
130
130
|
r1: e.row,
|
|
131
131
|
r2: e.row + t.span.rows - 1,
|
|
@@ -136,7 +136,7 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
136
136
|
e = !1;
|
|
137
137
|
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);
|
|
138
138
|
}
|
|
139
|
-
let i = `${
|
|
139
|
+
let i = `${Y(n.c1)}${n.r1}`, a = `${Y(n.c2)}${n.r2}`, o = (e.hiddenRows ?? []).filter((e) => e >= n.r1 && e <= n.r2), s = e.columns.filter((e) => e.hidden && e.col >= n.c1 && e.col <= n.c2).map((e) => Y(e.col)), c = e.rows.filter((e) => e.row >= n.r1 && e.row <= n.r2).flatMap((e) => e.cells.filter((e) => e.col >= n.c1 && e.col <= n.c2 && e.value !== void 0 && e.value !== "")).slice(0, q).map((e) => String(e.value)).join("; ").slice(0, 500);
|
|
140
140
|
return {
|
|
141
141
|
format: "xlsx",
|
|
142
142
|
sheet: e.name,
|
|
@@ -146,12 +146,12 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
146
146
|
...s.length ? { hiddenColumns: s } : {},
|
|
147
147
|
...c ? { sample: c } : {}
|
|
148
148
|
};
|
|
149
|
-
},
|
|
149
|
+
}, be = ["onKeydown"], xe = ["placeholder", "aria-label"], X = ["disabled"], Z = ["aria-label"], Q = { class: "pk-selection-actions__text" }, Se = {
|
|
150
150
|
key: 0,
|
|
151
151
|
class: "pk-selection-actions__text"
|
|
152
|
-
},
|
|
152
|
+
}, $ = ["onClick"], Ce = /* @__PURE__ */ T({
|
|
153
153
|
__name: "PkSelectionActions",
|
|
154
|
-
props: /*@__PURE__*/
|
|
154
|
+
props: /*@__PURE__*/ D({
|
|
155
155
|
actions: {},
|
|
156
156
|
anchor: {},
|
|
157
157
|
strategy: {},
|
|
@@ -166,25 +166,25 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
166
166
|
},
|
|
167
167
|
askingModifiers: {}
|
|
168
168
|
}),
|
|
169
|
-
emits: /*@__PURE__*/
|
|
169
|
+
emits: /*@__PURE__*/ D([
|
|
170
170
|
"action",
|
|
171
171
|
"ask",
|
|
172
172
|
"note",
|
|
173
173
|
"close"
|
|
174
174
|
], ["update:asking"]),
|
|
175
175
|
setup(e, { emit: t }) {
|
|
176
|
-
let n = e, r = t, i =
|
|
176
|
+
let n = e, r = t, i = z(e, "asking"), { t: a } = ae({ useScope: "global" }), o = re("barEl"), s = re("inputEl"), { width: c, height: l } = oe(o, void 0, { box: "border-box" }), d = v(() => u({
|
|
177
177
|
...n.anchor,
|
|
178
178
|
bar: {
|
|
179
179
|
width: c.value,
|
|
180
180
|
height: l.value
|
|
181
181
|
},
|
|
182
182
|
touch: n.touch
|
|
183
|
-
})), f =
|
|
183
|
+
})), f = P(), p = P(""), m = async (e, t) => {
|
|
184
184
|
f.value = {
|
|
185
185
|
id: e,
|
|
186
186
|
placeholder: t
|
|
187
|
-
}, p.value = "", i.value = !0, await
|
|
187
|
+
}, p.value = "", i.value = !0, await te(), s.value?.focus();
|
|
188
188
|
}, h = () => {
|
|
189
189
|
f.value = void 0, i.value = !1;
|
|
190
190
|
}, g = (e) => {
|
|
@@ -195,23 +195,23 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
195
195
|
}, C = () => {
|
|
196
196
|
f.value ? h() : r("close");
|
|
197
197
|
};
|
|
198
|
-
return (t, n) => (
|
|
199
|
-
class:
|
|
198
|
+
return (t, n) => (M(), x("div", {
|
|
199
|
+
class: O(["pk-selection-actions", {
|
|
200
200
|
"pk-selection-actions--fixed": e.strategy === "fixed",
|
|
201
201
|
"pk-selection-actions--asking": !!f.value
|
|
202
202
|
}]),
|
|
203
|
-
style:
|
|
203
|
+
style: k({
|
|
204
204
|
top: `${d.value.top}px`,
|
|
205
205
|
left: `${d.value.left}px`
|
|
206
206
|
}),
|
|
207
|
-
onKeydown:
|
|
208
|
-
}, [f.value ? (
|
|
207
|
+
onKeydown: ie(W(C, ["stop"]), ["esc"])
|
|
208
|
+
}, [f.value ? (M(), x("form", {
|
|
209
209
|
key: 0,
|
|
210
210
|
ref_key: "barEl",
|
|
211
211
|
ref: o,
|
|
212
212
|
class: "pk-selection-actions__bar pk-selection-actions__bar--field",
|
|
213
213
|
onSubmit: W(y, ["prevent"])
|
|
214
|
-
}, [
|
|
214
|
+
}, [U(S("input", {
|
|
215
215
|
ref_key: "inputEl",
|
|
216
216
|
ref: s,
|
|
217
217
|
"onUpdate:modelValue": n[0] ||= (e) => p.value = e,
|
|
@@ -220,71 +220,71 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
220
220
|
maxlength: "500",
|
|
221
221
|
placeholder: f.value.placeholder,
|
|
222
222
|
"aria-label": f.value.placeholder
|
|
223
|
-
}, null, 8,
|
|
223
|
+
}, null, 8, xe), [[B, p.value]]), S("button", {
|
|
224
224
|
type: "submit",
|
|
225
225
|
class: "pk-selection-actions__button pk-selection-actions__button--send",
|
|
226
226
|
disabled: !p.value.trim()
|
|
227
|
-
},
|
|
227
|
+
}, L(R(a)("action.send")), 9, X)], 544)) : (M(), x("div", {
|
|
228
228
|
key: 1,
|
|
229
229
|
ref_key: "barEl",
|
|
230
230
|
ref: o,
|
|
231
231
|
class: "pk-selection-actions__bar",
|
|
232
232
|
role: "toolbar",
|
|
233
|
-
"aria-label":
|
|
234
|
-
}, [e.note ? (
|
|
233
|
+
"aria-label": R(a)("selectionActions.label")
|
|
234
|
+
}, [e.note ? (M(), x(_, { key: 0 }, [S("span", Q, L(e.note), 1), e.noteAction ? (M(), x("button", {
|
|
235
235
|
key: 0,
|
|
236
236
|
type: "button",
|
|
237
237
|
class: "pk-selection-actions__button",
|
|
238
238
|
onMousedown: n[1] ||= W(() => {}, ["prevent"]),
|
|
239
239
|
onClick: n[2] ||= (e) => r("note")
|
|
240
|
-
},
|
|
241
|
-
e.hint ? (
|
|
242
|
-
(
|
|
240
|
+
}, L(e.noteAction), 33)) : b("", !0)], 64)) : (M(), x(_, { key: 1 }, [
|
|
241
|
+
e.hint ? (M(), x("span", Se, L(e.hint), 1)) : b("", !0),
|
|
242
|
+
(M(!0), x(_, null, F(e.actions, (e) => (M(), x("button", {
|
|
243
243
|
key: e.id,
|
|
244
244
|
type: "button",
|
|
245
245
|
class: "pk-selection-actions__button",
|
|
246
246
|
onMousedown: n[3] ||= W(() => {}, ["prevent"]),
|
|
247
247
|
onClick: (t) => g(e)
|
|
248
|
-
},
|
|
248
|
+
}, L(e.label), 41, $))), 128)),
|
|
249
249
|
S("button", {
|
|
250
250
|
type: "button",
|
|
251
251
|
class: "pk-selection-actions__button",
|
|
252
252
|
onMousedown: n[4] ||= W(() => {}, ["prevent"]),
|
|
253
|
-
onClick: n[5] ||= (e) => m(void 0,
|
|
254
|
-
},
|
|
255
|
-
], 64))], 8, Z))
|
|
253
|
+
onClick: n[5] ||= (e) => m(void 0, R(a)("selectionActions.askPlaceholder"))
|
|
254
|
+
}, L(R(a)("selectionActions.ask")), 33)
|
|
255
|
+
], 64))], 8, Z))], 46, be));
|
|
256
256
|
}
|
|
257
|
-
}),
|
|
257
|
+
}), we = { class: "pk-spreadsheet-preview" }, Te = { class: "pk-spreadsheet-preview__bar" }, Ee = ["aria-label"], De = ["aria-label"], Oe = ["aria-label"], ke = [
|
|
258
258
|
"rowspan",
|
|
259
259
|
"colspan",
|
|
260
260
|
"data-focus",
|
|
261
261
|
"title",
|
|
262
262
|
"onMousedown",
|
|
263
263
|
"onMouseenter"
|
|
264
|
-
],
|
|
264
|
+
], Ae = {
|
|
265
265
|
key: 1,
|
|
266
266
|
class: "pk-spreadsheet-preview__more"
|
|
267
|
-
},
|
|
267
|
+
}, je = ["aria-label"], Me = ["aria-current", "onClick"], Ne = { class: "pk-spreadsheet-preview__status" }, Pe = { class: "pk-spreadsheet-preview__info" }, Fe = ["title"], Ie = ["title"], Le = {
|
|
268
268
|
key: 2,
|
|
269
269
|
class: "pk-spreadsheet-preview__stats"
|
|
270
|
-
},
|
|
270
|
+
}, Re = {
|
|
271
271
|
key: 0,
|
|
272
272
|
class: "pk-spreadsheet-preview__average"
|
|
273
|
-
},
|
|
273
|
+
}, ze = { key: 1 }, Be = { class: "pk-spreadsheet-preview__zoom" }, Ve = { class: "pk-spreadsheet-preview__percent" }, He = 64, Ue = 20, We = 28, Ge = 44, Ke = /* @__PURE__ */ T({
|
|
274
274
|
__name: "PkSpreadsheetPreview",
|
|
275
|
-
props: /*@__PURE__*/
|
|
275
|
+
props: /*@__PURE__*/ D({ preview: {} }, {
|
|
276
276
|
sheet: { default: 0 },
|
|
277
277
|
sheetModifiers: {},
|
|
278
278
|
zoom: { default: 1 },
|
|
279
279
|
zoomModifiers: {}
|
|
280
280
|
}),
|
|
281
|
-
emits: /*@__PURE__*/
|
|
281
|
+
emits: /*@__PURE__*/ D(["select"], ["update:sheet", "update:zoom"]),
|
|
282
282
|
setup(e, { emit: t }) {
|
|
283
|
-
let o = e, s = t, { t: c, locale: l } =
|
|
283
|
+
let o = e, s = t, { t: c, locale: l } = ae({ useScope: "global" }), u = z(e, "sheet"), d = z(e, "zoom"), f = re("scrollEl"), { width: p, height: m } = oe(f, {
|
|
284
284
|
width: 0,
|
|
285
285
|
height: 0
|
|
286
286
|
}, { box: "border-box" }), h = v(() => o.preview.sheets[u.value] ?? o.preview.sheets[0]);
|
|
287
|
-
|
|
287
|
+
V(() => o.preview, () => {
|
|
288
288
|
u.value = 0;
|
|
289
289
|
});
|
|
290
290
|
let g = (e) => {
|
|
@@ -294,54 +294,54 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
294
294
|
}, y = v(() => {
|
|
295
295
|
let e = h.value;
|
|
296
296
|
if (!e) return [];
|
|
297
|
-
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 =
|
|
297
|
+
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 = p.value / d.value;
|
|
298
298
|
for (let o = 1; o <= e.lastColumn || !e.moreColumns && (o <= e.lastColumn + 2 || i < a); o++) {
|
|
299
299
|
if (t.has(o)) continue;
|
|
300
|
-
let e = n.get(o) ??
|
|
300
|
+
let e = n.get(o) ?? He;
|
|
301
301
|
r.push({
|
|
302
302
|
col: o,
|
|
303
303
|
width: e
|
|
304
304
|
}), i += e;
|
|
305
305
|
}
|
|
306
306
|
return r;
|
|
307
|
-
}), T = v(() => y.value.reduce((e, t) => e + t.width,
|
|
307
|
+
}), T = v(() => y.value.reduce((e, t) => e + t.width, Ge)), ee = v(() => y.value.map((e) => `${e.col}:${e.width}`).join(",")), D = /* @__PURE__ */ new WeakMap(), A = v(() => {
|
|
308
308
|
let e = h.value;
|
|
309
309
|
if (!e) return [];
|
|
310
|
-
let t = new Set(e.hiddenRows ?? []), n = new Map(e.rows.map((e) => [e.row, e.height])), r = Math.ceil((m.value / d.value -
|
|
311
|
-
a || (a = /* @__PURE__ */ new Map(),
|
|
310
|
+
let t = new Set(e.hiddenRows ?? []), n = new Map(e.rows.map((e) => [e.row, e.height])), r = Math.ceil((m.value / d.value - We) / Ue), i = e.moreRows ? e.lastRow : Math.max(e.lastRow + 5, r + t.size), a = D.get(e);
|
|
311
|
+
a || (a = /* @__PURE__ */ new Map(), D.set(e, a));
|
|
312
312
|
let o = a;
|
|
313
313
|
return Array.from({ length: i }, (e, t) => t + 1).filter((e) => !t.has(e)).map((e) => {
|
|
314
314
|
let t = o.get(e);
|
|
315
315
|
return t || (t = {
|
|
316
316
|
row: e,
|
|
317
|
-
height: n.get(e) ??
|
|
317
|
+
height: n.get(e) ?? Ue
|
|
318
318
|
}, o.set(e, t)), t;
|
|
319
319
|
});
|
|
320
|
-
}),
|
|
320
|
+
}), ne = v(() => {
|
|
321
321
|
let e = /* @__PURE__ */ new Map();
|
|
322
322
|
for (let t of h.value?.rows ?? []) for (let n of t.cells) e.set(`${t.row},${n.col}`, n);
|
|
323
323
|
return e;
|
|
324
|
-
}),
|
|
324
|
+
}), j = v(() => {
|
|
325
325
|
let e = /* @__PURE__ */ new Map();
|
|
326
326
|
for (let t of h.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}`, {
|
|
327
327
|
row: t.row,
|
|
328
328
|
col: n.col
|
|
329
329
|
});
|
|
330
330
|
return e;
|
|
331
|
-
}),
|
|
332
|
-
let n =
|
|
331
|
+
}), N = (e, t) => ne.value.get(`${e},${t}`), I = (e, t) => {
|
|
332
|
+
let n = N(e, t)?.span;
|
|
333
333
|
if (n) return {
|
|
334
|
-
rows:
|
|
334
|
+
rows: A.value.filter((t) => t.row >= e && t.row < e + n.rows).length,
|
|
335
335
|
cols: y.value.filter((e) => e.col >= t && e.col < t + n.cols).length
|
|
336
336
|
};
|
|
337
|
-
},
|
|
337
|
+
}, B = (e) => e?.style === void 0 ? void 0 : o.preview.styles[e.style], H = (e) => {
|
|
338
338
|
let t = e.numFmt === void 0 ? void 0 : o.preview.numberFormats?.[e.numFmt], a = e.value;
|
|
339
339
|
if (t !== void 0) try {
|
|
340
340
|
return e.format === "date" ? e.serial === void 0 ? void 0 : r(t, e.serial, l.value, o.preview.date1904) : typeof a == "number" ? n(t) ? r(t, a, l.value, o.preview.date1904) : i(t, a, l.value) : void 0;
|
|
341
341
|
} catch {
|
|
342
342
|
return;
|
|
343
343
|
}
|
|
344
|
-
},
|
|
344
|
+
}, U = (e, t) => {
|
|
345
345
|
let n = H(e);
|
|
346
346
|
if (n) return n.text;
|
|
347
347
|
let r = e.decimals === void 0 ? { maximumFractionDigits: 10 } : {
|
|
@@ -363,11 +363,11 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
363
363
|
dateStyle: "short",
|
|
364
364
|
timeZone: "UTC"
|
|
365
365
|
}).format(t);
|
|
366
|
-
},
|
|
366
|
+
}, se = (e) => {
|
|
367
367
|
if (!e) return "";
|
|
368
368
|
if (e.missing) return "—";
|
|
369
369
|
let t = e.value;
|
|
370
|
-
return t === void 0 ? "" : typeof t == "boolean" ? c(t ? "chatFilePreview.true" : "chatFilePreview.false") : e.format === "date" && typeof t == "string" ? H(e)?.text ?? ie(t) : typeof t == "number" ?
|
|
370
|
+
return t === void 0 ? "" : typeof t == "boolean" ? c(t ? "chatFilePreview.true" : "chatFilePreview.false") : e.format === "date" && typeof t == "string" ? H(e)?.text ?? ie(t) : typeof t == "number" ? U(e, t) : t;
|
|
371
371
|
}, ce = (e) => {
|
|
372
372
|
if (!e) return "";
|
|
373
373
|
if (e.formula) return `=${e.formula}`;
|
|
@@ -376,9 +376,9 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
376
376
|
useGrouping: !1,
|
|
377
377
|
maximumFractionDigits: 15,
|
|
378
378
|
...e.format === "percent" ? { style: "percent" } : {}
|
|
379
|
-
}).format(t) :
|
|
379
|
+
}).format(t) : se(e);
|
|
380
380
|
}, le = (e) => e ? `${e.width}px solid ${e.color}` : void 0, ue = (e, t, n) => {
|
|
381
|
-
let r =
|
|
381
|
+
let r = B(e), i = e?.value, a = typeof i == "number" || e?.format === "date" || !!e?.missing, o = {
|
|
382
382
|
textAlign: r?.align ?? (a ? "right" : typeof i == "boolean" || e?.format === "error" ? "center" : "left"),
|
|
383
383
|
verticalAlign: r?.valign === "top" ? "top" : r?.valign === "middle" ? "middle" : "bottom",
|
|
384
384
|
whiteSpace: r?.wrap ? "pre-wrap" : "nowrap"
|
|
@@ -391,7 +391,7 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
391
391
|
let e = `${4 + r.indent * 9}px`;
|
|
392
392
|
o.textAlign === "right" ? o.paddingRight = e : o.paddingLeft = e;
|
|
393
393
|
}
|
|
394
|
-
return de(t, n) ? (o.borderStyle = "hidden", o.boxShadow =
|
|
394
|
+
return de(t, n) ? (o.borderStyle = "hidden", o.boxShadow = _e(e, t, n)) : (o.borderTop = le(r?.borders?.top), o.borderRight = le(r?.borders?.right), o.borderBottom = le(r?.borders?.bottom), o.borderLeft = le(r?.borders?.left), o.boxShadow = K(e, t, n).join(", ")), Object.assign(o, xe(t, n)), o;
|
|
395
395
|
}, de = (e, t) => {
|
|
396
396
|
let n = h.value?.frozen;
|
|
397
397
|
return !!n && (e <= n.rows || t <= n.cols);
|
|
@@ -401,17 +401,17 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
401
401
|
bottom: (e) => `inset 0 -${e.width}px 0 ${e.color}`,
|
|
402
402
|
left: (e) => `inset ${e.width}px 0 0 ${e.color}`
|
|
403
403
|
}, fe = (...e) => e.reduce((e, t) => t && (!e || t.width > e.width) ? t : e, void 0), K = (e, t, n) => {
|
|
404
|
-
let r =
|
|
405
|
-
return [t ===
|
|
406
|
-
}, q = v(() =>
|
|
404
|
+
let r = B(e)?.borders;
|
|
405
|
+
return [t === A.value[0]?.row && r?.top && G.top(r.top), n === y.value[0]?.col && r?.left && G.left(r.left)].filter((e) => !!e);
|
|
406
|
+
}, q = v(() => A.value.map((e) => e.row)), J = v(() => y.value.map((e) => e.col)), pe = v(() => new Map(q.value.map((e, t) => [e, t]))), me = v(() => new Map(J.value.map((e, t) => [e, t]))), he = (e, t, n, r) => {
|
|
407
407
|
let i = [], a = t.get(n) ?? e.length;
|
|
408
408
|
for (; a < e.length && e[a] < n + r; a++) i.push(e[a]);
|
|
409
409
|
return {
|
|
410
410
|
spanned: i,
|
|
411
411
|
next: e[a]
|
|
412
412
|
};
|
|
413
|
-
},
|
|
414
|
-
let { spanned: i, next: a } =
|
|
413
|
+
}, ge = (e, t, n, r) => {
|
|
414
|
+
let { spanned: i, next: a } = he(q.value, pe.value, t, e?.span?.rows ?? 1), { spanned: o, next: s } = he(J.value, me.value, n, e?.span?.cols ?? 1);
|
|
415
415
|
return (r === "right" ? s === void 0 ? [] : i.map((e) => ({
|
|
416
416
|
row: e,
|
|
417
417
|
col: s
|
|
@@ -419,58 +419,58 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
419
419
|
row: a,
|
|
420
420
|
col: e
|
|
421
421
|
}))).map((e) => {
|
|
422
|
-
let t =
|
|
423
|
-
return
|
|
422
|
+
let t = j.value.get(`${e.row},${e.col}`) ?? e;
|
|
423
|
+
return N(t.row, t.col);
|
|
424
424
|
});
|
|
425
|
-
},
|
|
426
|
-
let r =
|
|
425
|
+
}, _e = (e, t, n) => {
|
|
426
|
+
let r = B(e)?.borders, i = fe(r?.right, ...ge(e, t, n, "right").map((e) => B(e)?.borders?.left)), a = fe(r?.bottom, ...ge(e, t, n, "bottom").map((e) => B(e)?.borders?.top)), o = h.value?.gridlines;
|
|
427
427
|
return [
|
|
428
428
|
i ? G.right(i) : o && "inset calc(var(--border) * -1) 0 0 var(--pk-spreadsheet-gridline)",
|
|
429
429
|
a ? G.bottom(a) : o && "inset 0 calc(var(--border) * -1) 0 var(--pk-spreadsheet-gridline)",
|
|
430
430
|
...K(e, t, n)
|
|
431
431
|
].filter(Boolean).join(", ");
|
|
432
|
-
}, ve = (e) =>
|
|
432
|
+
}, ve = (e) => We + A.value.filter((t) => t.row < e).reduce((e, t) => e + t.height, 0), Y = (e) => Ge + y.value.filter((t) => t.col < e).reduce((e, t) => e + t.width, 0), be = v(() => {
|
|
433
433
|
let e = h.value?.frozen;
|
|
434
434
|
return {
|
|
435
435
|
top: ve((e?.rows ?? 0) + 1),
|
|
436
|
-
left:
|
|
436
|
+
left: Y((e?.cols ?? 0) + 1)
|
|
437
437
|
};
|
|
438
|
-
}),
|
|
438
|
+
}), xe = (e, t) => {
|
|
439
439
|
let n = h.value?.frozen;
|
|
440
440
|
if (!n) return {};
|
|
441
441
|
let r = {};
|
|
442
|
-
return e <= n.rows && (r.position = "sticky", r.top = `${ve(e)}px`, r.scrollMarginTop = r.top, r.zIndex = 0), t <= n.cols && (r.position = "sticky", r.left = `${
|
|
443
|
-
},
|
|
442
|
+
return e <= n.rows && (r.position = "sticky", r.top = `${ve(e)}px`, r.scrollMarginTop = r.top, r.zIndex = 0), t <= n.cols && (r.position = "sticky", r.left = `${Y(t)}px`, r.scrollMarginLeft = r.left, r.zIndex = +(e <= n.rows)), r;
|
|
443
|
+
}, X = P({
|
|
444
444
|
row: 1,
|
|
445
445
|
col: 1
|
|
446
|
-
}),
|
|
446
|
+
}), Z = P({
|
|
447
447
|
row: 1,
|
|
448
448
|
col: 1
|
|
449
449
|
});
|
|
450
|
-
|
|
451
|
-
|
|
450
|
+
V(h, () => {
|
|
451
|
+
X.value = {
|
|
452
452
|
row: 1,
|
|
453
453
|
col: 1
|
|
454
|
-
},
|
|
454
|
+
}, Z.value = {
|
|
455
455
|
row: 1,
|
|
456
456
|
col: 1
|
|
457
457
|
};
|
|
458
458
|
});
|
|
459
|
-
let
|
|
460
|
-
r1: Math.min(
|
|
461
|
-
r2: Math.max(
|
|
462
|
-
c1: Math.min(
|
|
463
|
-
c2: Math.max(
|
|
464
|
-
})),
|
|
465
|
-
f.value?.focus({ preventScroll: !0 }),
|
|
459
|
+
let Q = v(() => ({
|
|
460
|
+
r1: Math.min(X.value.row, Z.value.row),
|
|
461
|
+
r2: Math.max(X.value.row, Z.value.row),
|
|
462
|
+
c1: Math.min(X.value.col, Z.value.col),
|
|
463
|
+
c2: Math.max(X.value.col, Z.value.col)
|
|
464
|
+
})), Se = (e, t) => e >= Q.value.r1 && e <= Q.value.r2 && t >= Q.value.c1 && t <= Q.value.c2, $ = (e, t) => Z.value.row === e && Z.value.col === t, Ce = (e) => e >= Q.value.r1 && e <= Q.value.r2 ? `${Q.value.c1}:${Q.value.c2}:${Z.value.row === e ? Z.value.col : 0}` : "", Ke = P(!1), qe = (e, t, n) => {
|
|
465
|
+
f.value?.focus({ preventScroll: !0 }), Z.value = {
|
|
466
466
|
row: e,
|
|
467
467
|
col: t
|
|
468
|
-
}, n.shiftKey || (
|
|
468
|
+
}, n.shiftKey || (X.value = {
|
|
469
469
|
row: e,
|
|
470
470
|
col: t
|
|
471
|
-
}),
|
|
471
|
+
}), Ke.value = !0;
|
|
472
472
|
}, Je = (e, t) => {
|
|
473
|
-
|
|
473
|
+
Ke.value && (Z.value = {
|
|
474
474
|
row: e,
|
|
475
475
|
col: t
|
|
476
476
|
});
|
|
@@ -484,12 +484,12 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
484
484
|
bottom: Math.max(...e.map((e) => e.bottom))
|
|
485
485
|
};
|
|
486
486
|
}, Ze = () => h.value ? {
|
|
487
|
-
...
|
|
487
|
+
...ye(h.value, Q.value),
|
|
488
488
|
measure: Xe
|
|
489
489
|
} : void 0;
|
|
490
|
-
|
|
491
|
-
clearTimeout(Ye),
|
|
492
|
-
let e =
|
|
490
|
+
V([Q, Ke], () => {
|
|
491
|
+
clearTimeout(Ye), !Ke.value && (Ye = setTimeout(() => {
|
|
492
|
+
let e = Q.value, t = e.r2 > e.r1 || e.c2 > e.c1;
|
|
493
493
|
s("select", t ? Ze() : void 0);
|
|
494
494
|
}, 150));
|
|
495
495
|
});
|
|
@@ -506,7 +506,7 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
506
506
|
}[e.key];
|
|
507
507
|
if (!t) return;
|
|
508
508
|
e.preventDefault();
|
|
509
|
-
let n =
|
|
509
|
+
let n = A.value.map((e) => e.row), r = y.value.map((e) => e.col), i = (e) => j.value.get(`${e.row},${e.col}`) ?? e, a = i(Z.value), o = n.indexOf(Z.value.row), s = r.indexOf(Z.value.col), c = a;
|
|
510
510
|
for (;;) {
|
|
511
511
|
let e = Math.min(n.length - 1, Math.max(0, o + t[0])), l = Math.min(r.length - 1, Math.max(0, s + t[1]));
|
|
512
512
|
if (e === o && l === s || (o = e, s = l, c = i({
|
|
@@ -514,42 +514,42 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
514
514
|
col: r[s]
|
|
515
515
|
}), c.row !== a.row || c.col !== a.col)) break;
|
|
516
516
|
}
|
|
517
|
-
|
|
517
|
+
Z.value = c, e.shiftKey || (X.value = c), te(() => f.value?.querySelector("[data-focus]")?.scrollIntoView({
|
|
518
518
|
block: "nearest",
|
|
519
519
|
inline: "nearest"
|
|
520
520
|
}));
|
|
521
|
-
}, et = v(() =>
|
|
522
|
-
let { r1: e, r2: t, c1: n, c2: r } =
|
|
521
|
+
}, et = v(() => N(Z.value.row, Z.value.col)), tt = v(() => {
|
|
522
|
+
let { r1: e, r2: t, c1: n, c2: r } = Q.value;
|
|
523
523
|
if (e === t && n === r) return;
|
|
524
524
|
let i = 0, a = 0, o = 0, s;
|
|
525
525
|
for (let c = e; c <= t; c++) for (let e = n; e <= r; e++) {
|
|
526
|
-
let t =
|
|
526
|
+
let t = N(c, e);
|
|
527
527
|
t && (t.value !== void 0 || t.missing) && (i++, typeof t.value == "number" && (a += t.value, o++, s ??= t));
|
|
528
528
|
}
|
|
529
529
|
if (i) return {
|
|
530
530
|
count: i,
|
|
531
|
-
sum: s ?
|
|
532
|
-
average: s ?
|
|
531
|
+
sum: s ? U(s, a) : void 0,
|
|
532
|
+
average: s ? U(s, a / o) : void 0
|
|
533
533
|
};
|
|
534
534
|
}), nt = (e) => {
|
|
535
535
|
d.value = Math.min(2, Math.max(.5, Math.round((d.value + e) * 10) / 10));
|
|
536
536
|
};
|
|
537
537
|
return (t, n) => {
|
|
538
538
|
let r = a;
|
|
539
|
-
return
|
|
540
|
-
S("div",
|
|
539
|
+
return M(), x("div", we, [
|
|
540
|
+
S("div", Te, [
|
|
541
541
|
S("span", {
|
|
542
542
|
class: "pk-spreadsheet-preview__ref",
|
|
543
|
-
"aria-label":
|
|
544
|
-
},
|
|
543
|
+
"aria-label": R(c)("chatFilePreview.cell")
|
|
544
|
+
}, L(g(Z.value.col)) + L(Z.value.row), 9, Ee),
|
|
545
545
|
n[6] ||= S("span", {
|
|
546
546
|
class: "pk-spreadsheet-preview__fx",
|
|
547
547
|
"aria-hidden": "true"
|
|
548
548
|
}, "fx", -1),
|
|
549
549
|
S("output", {
|
|
550
550
|
class: "pk-spreadsheet-preview__formula",
|
|
551
|
-
"aria-label":
|
|
552
|
-
},
|
|
551
|
+
"aria-label": R(c)("chatFilePreview.formulaBar")
|
|
552
|
+
}, L(ce(et.value)), 9, De)
|
|
553
553
|
]),
|
|
554
554
|
S("div", {
|
|
555
555
|
ref_key: "scrollEl",
|
|
@@ -559,104 +559,104 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
559
559
|
role: "grid",
|
|
560
560
|
"aria-label": h.value?.name,
|
|
561
561
|
onKeydown: $e,
|
|
562
|
-
onMouseup: n[2] ||= (e) =>
|
|
563
|
-
onMouseleave: n[3] ||= (e) =>
|
|
564
|
-
}, [h.value ? (
|
|
562
|
+
onMouseup: n[2] ||= (e) => Ke.value = !1,
|
|
563
|
+
onMouseleave: n[3] ||= (e) => Ke.value = !1
|
|
564
|
+
}, [h.value ? (M(), x("table", {
|
|
565
565
|
key: 0,
|
|
566
|
-
class:
|
|
567
|
-
style:
|
|
566
|
+
class: O(["pk-spreadsheet-preview__grid", { "pk-spreadsheet-preview__grid--lines": h.value.gridlines }]),
|
|
567
|
+
style: k({
|
|
568
568
|
zoom: d.value,
|
|
569
569
|
width: `${T.value}px`,
|
|
570
570
|
"--pk-spreadsheet-stuck-top": `${be.value.top}px`,
|
|
571
571
|
"--pk-spreadsheet-stuck-left": `${be.value.left}px`
|
|
572
572
|
})
|
|
573
573
|
}, [
|
|
574
|
-
S("colgroup", null, [S("col", { style:
|
|
574
|
+
S("colgroup", null, [S("col", { style: k({ width: `${Ge}px` }) }, null, 4), (M(!0), x(_, null, F(y.value, (e) => (M(), x("col", {
|
|
575
575
|
key: e.col,
|
|
576
|
-
style:
|
|
576
|
+
style: k({ width: `${e.width}px` })
|
|
577
577
|
}, null, 4))), 128))]),
|
|
578
|
-
S("thead", null, [S("tr", { style:
|
|
578
|
+
S("thead", null, [S("tr", { style: k({ height: `${We}px` }) }, [n[7] ||= S("th", { class: "pk-spreadsheet-preview__corner" }, null, -1), (M(!0), x(_, null, F(y.value, (e) => (M(), x("th", {
|
|
579
579
|
key: e.col,
|
|
580
580
|
scope: "col",
|
|
581
|
-
class:
|
|
582
|
-
style:
|
|
583
|
-
left: `${
|
|
581
|
+
class: O(["pk-spreadsheet-preview__head", { "pk-spreadsheet-preview__head--current": e.col >= Q.value.c1 && e.col <= Q.value.c2 }]),
|
|
582
|
+
style: k(h.value.frozen && e.col <= h.value.frozen.cols ? {
|
|
583
|
+
left: `${Y(e.col)}px`,
|
|
584
584
|
zIndex: 2
|
|
585
585
|
} : void 0)
|
|
586
|
-
},
|
|
587
|
-
S("tbody", null, [(
|
|
586
|
+
}, L(g(e.col)), 7))), 128))], 4)]),
|
|
587
|
+
S("tbody", null, [(M(!0), x(_, null, F(A.value, (e, t, n, r) => {
|
|
588
588
|
let i = [
|
|
589
589
|
e,
|
|
590
590
|
h.value,
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
591
|
+
ee.value,
|
|
592
|
+
R(l),
|
|
593
|
+
Ce(e.row)
|
|
594
594
|
];
|
|
595
|
-
if (r && r.el && r.key === e.row &&
|
|
596
|
-
let a = (
|
|
595
|
+
if (r && r.el && r.key === e.row && E(r, i)) return r;
|
|
596
|
+
let a = (M(), x("tr", {
|
|
597
597
|
key: e.row,
|
|
598
|
-
style:
|
|
598
|
+
style: k({ height: `${e.height}px` })
|
|
599
599
|
}, [S("th", {
|
|
600
600
|
scope: "row",
|
|
601
|
-
class:
|
|
602
|
-
style:
|
|
603
|
-
...
|
|
601
|
+
class: O(["pk-spreadsheet-preview__row", { "pk-spreadsheet-preview__row--current": e.row >= Q.value.r1 && e.row <= Q.value.r2 }]),
|
|
602
|
+
style: k(h.value.frozen && e.row <= h.value.frozen.rows ? {
|
|
603
|
+
...xe(e.row, 0),
|
|
604
604
|
left: 0,
|
|
605
605
|
zIndex: 4
|
|
606
606
|
} : void 0)
|
|
607
|
-
},
|
|
607
|
+
}, L(e.row), 7), (M(!0), x(_, null, F(y.value, (t) => (M(), x(_, { key: t.col }, [j.value.has(`${e.row},${t.col}`) ? b("", !0) : (M(), x("td", {
|
|
608
608
|
key: 0,
|
|
609
|
-
rowspan:
|
|
610
|
-
colspan:
|
|
611
|
-
class:
|
|
612
|
-
"pk-spreadsheet-preview__cell--range":
|
|
613
|
-
"pk-spreadsheet-preview__cell--missing":
|
|
609
|
+
rowspan: I(e.row, t.col)?.rows,
|
|
610
|
+
colspan: I(e.row, t.col)?.cols,
|
|
611
|
+
class: O(["pk-spreadsheet-preview__cell", {
|
|
612
|
+
"pk-spreadsheet-preview__cell--range": Se(e.row, t.col) && !$(e.row, t.col),
|
|
613
|
+
"pk-spreadsheet-preview__cell--missing": N(e.row, t.col)?.missing
|
|
614
614
|
}]),
|
|
615
|
-
style:
|
|
616
|
-
"data-focus":
|
|
617
|
-
title:
|
|
615
|
+
style: k(ue(N(e.row, t.col), e.row, t.col)),
|
|
616
|
+
"data-focus": $(e.row, t.col) ? "" : void 0,
|
|
617
|
+
title: N(e.row, t.col)?.missing ? R(c)("chatFilePreview.missingValue") : void 0,
|
|
618
618
|
onMousedown: W((n) => qe(e.row, t.col, n), ["prevent"]),
|
|
619
619
|
onMouseenter: (n) => Je(e.row, t.col),
|
|
620
620
|
onDblclick: Qe
|
|
621
|
-
},
|
|
621
|
+
}, L(se(N(e.row, t.col))), 47, ke))], 64))), 128))], 4));
|
|
622
622
|
return a.memo = i, a;
|
|
623
623
|
}, n, 0), 128))])
|
|
624
|
-
], 6)) : b("", !0), h.value && (h.value.moreRows || h.value.moreColumns) ? (
|
|
624
|
+
], 6)) : b("", !0), h.value && (h.value.moreRows || h.value.moreColumns) ? (M(), x("p", Ae, [h.value.moreRows ? (M(), x(_, { key: 0 }, [C(L(R(c)("chatFilePreview.moreRows", h.value.moreRows)), 1)], 64)) : b("", !0), h.value.moreColumns ? (M(), x(_, { key: 1 }, [C(L(R(c)("chatFilePreview.moreColumns", h.value.moreColumns)), 1)], 64)) : b("", !0)])) : b("", !0)], 40, Oe),
|
|
625
625
|
S("nav", {
|
|
626
626
|
class: "pk-spreadsheet-preview__sheets",
|
|
627
|
-
"aria-label":
|
|
628
|
-
}, [(
|
|
627
|
+
"aria-label": R(c)("chatFilePreview.sheets")
|
|
628
|
+
}, [(M(!0), x(_, null, F(e.preview.sheets, (e, t) => (M(), x("button", {
|
|
629
629
|
key: e.name,
|
|
630
630
|
type: "button",
|
|
631
631
|
class: "pk-spreadsheet-preview__sheet",
|
|
632
632
|
"aria-current": t === u.value ? "page" : void 0,
|
|
633
633
|
onClick: (e) => u.value = t
|
|
634
|
-
},
|
|
635
|
-
S("div",
|
|
634
|
+
}, L(e.name), 9, Me))), 128))], 8, je),
|
|
635
|
+
S("div", Ne, [S("p", Pe, [e.preview.staleFormulas ? (M(), x("span", {
|
|
636
636
|
key: 0,
|
|
637
637
|
class: "pk-spreadsheet-preview__note",
|
|
638
|
-
title:
|
|
639
|
-
},
|
|
638
|
+
title: R(c)("chatFilePreview.staleFormulas")
|
|
639
|
+
}, L(R(c)("chatFilePreview.staleFormulas")), 9, Fe)) : e.preview.computedFormulas ? (M(), x("span", {
|
|
640
640
|
key: 1,
|
|
641
641
|
class: "pk-spreadsheet-preview__note",
|
|
642
|
-
title:
|
|
643
|
-
},
|
|
644
|
-
tt.value.average ? (
|
|
645
|
-
S("span", null,
|
|
646
|
-
tt.value.sum ? (
|
|
647
|
-
])) : b("", !0)]), S("div",
|
|
642
|
+
title: R(c)("chatFilePreview.computedFormulas")
|
|
643
|
+
}, L(R(c)("chatFilePreview.computedFormulas")), 9, Ie)) : b("", !0), tt.value ? (M(), x("span", Le, [
|
|
644
|
+
tt.value.average ? (M(), x("span", Re, L(R(c)("chatFilePreview.average")) + " " + L(tt.value.average), 1)) : b("", !0),
|
|
645
|
+
S("span", null, L(R(c)("chatFilePreview.count")) + " " + L(tt.value.count), 1),
|
|
646
|
+
tt.value.sum ? (M(), x("span", ze, L(R(c)("chatFilePreview.sum")) + " " + L(tt.value.sum), 1)) : b("", !0)
|
|
647
|
+
])) : b("", !0)]), S("div", Be, [
|
|
648
648
|
w(r, {
|
|
649
649
|
modifiers: "action-quiet",
|
|
650
650
|
icon: "ri:subtract-line",
|
|
651
|
-
"aria-label":
|
|
651
|
+
"aria-label": R(c)("chatFilePreview.zoomOut"),
|
|
652
652
|
disabled: d.value <= .5,
|
|
653
653
|
onClick: n[4] ||= (e) => nt(-.1)
|
|
654
654
|
}, null, 8, ["aria-label", "disabled"]),
|
|
655
|
-
S("span",
|
|
655
|
+
S("span", Ve, L(Math.round(d.value * 100)) + "% ", 1),
|
|
656
656
|
w(r, {
|
|
657
657
|
modifiers: "action-quiet",
|
|
658
658
|
icon: "ri:add-line",
|
|
659
|
-
"aria-label":
|
|
659
|
+
"aria-label": R(c)("chatFilePreview.zoomIn"),
|
|
660
660
|
disabled: d.value >= 2,
|
|
661
661
|
onClick: n[5] ||= (e) => nt(.1)
|
|
662
662
|
}, null, 8, ["aria-label", "disabled"])
|
|
@@ -664,11 +664,11 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
664
664
|
]);
|
|
665
665
|
};
|
|
666
666
|
}
|
|
667
|
-
}),
|
|
667
|
+
}), qe = ["src"], Je = {
|
|
668
668
|
key: 1,
|
|
669
669
|
class: "pk-word-preview__image",
|
|
670
670
|
"data-quote-skip": ""
|
|
671
|
-
},
|
|
671
|
+
}, Ye = ["title"], Xe = ["title"], Ze = ["data-quote-skip"], Qe = /* @__PURE__ */ T({
|
|
672
672
|
__name: "PkWordPreviewRuns",
|
|
673
673
|
props: {
|
|
674
674
|
runs: {},
|
|
@@ -677,7 +677,7 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
677
677
|
numbers: {}
|
|
678
678
|
},
|
|
679
679
|
setup(e) {
|
|
680
|
-
let t = e, { t: n } =
|
|
680
|
+
let t = e, { t: n } = ae({ useScope: "global" }), r = ee(m, void 0), i = (e) => e.picture ? c(r?.value, e.picture.ref) : void 0, a = (e) => t.page ? h(e) : "inline", o = (e) => {
|
|
681
681
|
let n = {
|
|
682
682
|
width: `${e.width}pt`,
|
|
683
683
|
aspectRatio: `${e.width} / ${e.height}`
|
|
@@ -719,34 +719,34 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
719
719
|
textDecoration: [...n].join(" ")
|
|
720
720
|
};
|
|
721
721
|
}, y = (e) => e.author ? n("chatFilePreview.revisionBy", { author: e.author }) : void 0;
|
|
722
|
-
return (e, t) => (
|
|
722
|
+
return (e, t) => (M(!0), x(_, null, F(u.value, (e, t) => (M(), x(_, { key: t }, [e.image ? (M(), x(_, { key: 0 }, [e.picture && i(e) ? (M(), x(_, { key: 0 }, [a(e.picture) === "page" ? b("", !0) : (M(), x("img", {
|
|
723
723
|
key: 0,
|
|
724
|
-
class:
|
|
725
|
-
style:
|
|
724
|
+
class: O(["pk-word-preview__picture", `pk-word-preview__picture--${a(e.picture)}`]),
|
|
725
|
+
style: k(o(e.picture)),
|
|
726
726
|
src: i(e),
|
|
727
727
|
alt: ""
|
|
728
|
-
}, null, 14,
|
|
728
|
+
}, null, 14, qe))], 64)) : (M(), x("span", Je, L(R(n)("chatFilePreview.image")), 1))], 64)) : f.value && e.change === "deleted" ? (M(), x("del", {
|
|
729
729
|
key: 1,
|
|
730
730
|
class: "pk-word-preview__removed",
|
|
731
731
|
"data-quote-skip": "",
|
|
732
|
-
style:
|
|
732
|
+
style: k(g(e)),
|
|
733
733
|
title: y(e)
|
|
734
|
-
},
|
|
734
|
+
}, L(l(e)), 13, Ye)) : f.value && e.change === "inserted" ? (M(), x("ins", {
|
|
735
735
|
key: 2,
|
|
736
736
|
class: "pk-word-preview__added",
|
|
737
|
-
style:
|
|
737
|
+
style: k(g(e)),
|
|
738
738
|
title: y(e)
|
|
739
|
-
},
|
|
739
|
+
}, L(l(e)), 13, Xe)) : (M(), x("span", {
|
|
740
740
|
key: 3,
|
|
741
|
-
style:
|
|
741
|
+
style: k(p(e)),
|
|
742
742
|
"data-quote-skip": e.label ? "" : void 0
|
|
743
|
-
},
|
|
743
|
+
}, L(l(e)), 13, Ze))], 64))), 128));
|
|
744
744
|
}
|
|
745
|
-
}),
|
|
745
|
+
}), $e = { key: 0 }, et = ["data-paragraph", "colspan"], tt = [
|
|
746
746
|
"data-paragraph",
|
|
747
747
|
"role",
|
|
748
748
|
"aria-level"
|
|
749
|
-
],
|
|
749
|
+
], nt = { key: 1 }, rt = /* @__PURE__ */ T({
|
|
750
750
|
__name: "PkWordPreviewBlock",
|
|
751
751
|
props: {
|
|
752
752
|
block: {},
|
|
@@ -779,26 +779,26 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
779
779
|
let e = t.block.widths ?? [], n = e.reduce((e, t) => e + t, 0);
|
|
780
780
|
return n ? e.map((e) => `${e / n * 100}%`) : [];
|
|
781
781
|
}), s = v(() => t.mode === "markup" && !!a.value?.some((e) => e.runs.some((e) => e.change)));
|
|
782
|
-
return (t, c) => e.block.kind === "table" && a.value ? (
|
|
782
|
+
return (t, c) => e.block.kind === "table" && a.value ? (M(), x("table", {
|
|
783
783
|
key: 0,
|
|
784
|
-
class:
|
|
784
|
+
class: O(["pk-word-preview__table", {
|
|
785
785
|
"pk-word-preview__table--lines": e.block.borders,
|
|
786
786
|
"pk-word-preview__table--next": e.row !== 0,
|
|
787
787
|
"pk-word-preview__changed": s.value
|
|
788
788
|
}])
|
|
789
|
-
}, [o.value.length ? (
|
|
789
|
+
}, [o.value.length ? (M(), x("colgroup", $e, [(M(!0), x(_, null, F(o.value, (e, t) => (M(), x("col", {
|
|
790
790
|
key: t,
|
|
791
|
-
style:
|
|
792
|
-
}, null, 4))), 128))])) : b("", !0), S("tbody", null, [S("tr", null, [(
|
|
791
|
+
style: k({ width: e })
|
|
792
|
+
}, null, 4))), 128))])) : b("", !0), S("tbody", null, [S("tr", null, [(M(!0), x(_, null, F(a.value, (t, n) => (M(), x("td", {
|
|
793
793
|
key: n,
|
|
794
794
|
"data-paragraph": t.ids?.join(" "),
|
|
795
795
|
colspan: t.span,
|
|
796
|
-
style:
|
|
796
|
+
style: k({
|
|
797
797
|
backgroundColor: t.fill,
|
|
798
798
|
textAlign: t.align,
|
|
799
799
|
fontSize: t.size ? `${t.size}pt` : void 0
|
|
800
800
|
})
|
|
801
|
-
}, [w(
|
|
801
|
+
}, [w(Qe, {
|
|
802
802
|
runs: t.runs,
|
|
803
803
|
mode: e.mode,
|
|
804
804
|
numbers: e.numbers
|
|
@@ -806,21 +806,21 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
806
806
|
"runs",
|
|
807
807
|
"mode",
|
|
808
808
|
"numbers"
|
|
809
|
-
])], 12,
|
|
809
|
+
])], 12, et))), 128))])])], 2)) : e.block.kind === "table" ? b("", !0) : (M(), x("div", {
|
|
810
810
|
key: 1,
|
|
811
|
-
class:
|
|
811
|
+
class: O(["pk-word-preview__block", { "pk-word-preview__changed": i.value }]),
|
|
812
812
|
"data-paragraph": e.block.id,
|
|
813
813
|
role: e.block.kind === "heading" ? "heading" : void 0,
|
|
814
814
|
"aria-level": e.block.kind === "heading" ? Math.max(1, e.block.level) : void 0,
|
|
815
|
-
style:
|
|
815
|
+
style: k(n.value)
|
|
816
816
|
}, [
|
|
817
|
-
e.block.label ? (
|
|
817
|
+
e.block.label ? (M(), x("span", {
|
|
818
818
|
key: 0,
|
|
819
819
|
class: "pk-word-preview__label",
|
|
820
820
|
"data-quote-skip": "",
|
|
821
|
-
style:
|
|
822
|
-
},
|
|
823
|
-
w(
|
|
821
|
+
style: k(r.value)
|
|
822
|
+
}, L(e.block.label), 5)) : b("", !0),
|
|
823
|
+
w(Qe, {
|
|
824
824
|
runs: e.block.runs,
|
|
825
825
|
mode: e.mode,
|
|
826
826
|
page: e.page,
|
|
@@ -831,10 +831,10 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
831
831
|
"page",
|
|
832
832
|
"numbers"
|
|
833
833
|
]),
|
|
834
|
-
!e.block.label && !e.block.runs.length ? (
|
|
835
|
-
], 14,
|
|
834
|
+
!e.block.label && !e.block.runs.length ? (M(), x("br", nt)) : b("", !0)
|
|
835
|
+
], 14, tt));
|
|
836
836
|
}
|
|
837
|
-
}),
|
|
837
|
+
}), it = { class: "pk-word-preview__part" }, at = ["src"], ot = /* @__PURE__ */ T({
|
|
838
838
|
__name: "PkWordPreviewPart",
|
|
839
839
|
props: {
|
|
840
840
|
blocks: {},
|
|
@@ -844,7 +844,7 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
844
844
|
numbers: {}
|
|
845
845
|
},
|
|
846
846
|
setup(e) {
|
|
847
|
-
let t = e, n =
|
|
847
|
+
let t = e, n = ee(m, void 0), r = v(() => f(t.blocks, t.mode)), i = v(() => l(t.blocks, t.mode).flatMap((e) => {
|
|
848
848
|
let r = c(n?.value, e.ref);
|
|
849
849
|
return r ? [{
|
|
850
850
|
src: r,
|
|
@@ -858,10 +858,10 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
858
858
|
...t.where === "header" ? { top: `${t.section.headerDistance}pt` } : { bottom: `${t.section.footerDistance}pt` }
|
|
859
859
|
};
|
|
860
860
|
});
|
|
861
|
-
return (t, n) => (
|
|
861
|
+
return (t, n) => (M(), x("div", it, [S("div", {
|
|
862
862
|
class: "pk-word-preview__part-flow",
|
|
863
|
-
style:
|
|
864
|
-
}, [(
|
|
863
|
+
style: k(a.value)
|
|
864
|
+
}, [(M(!0), x(_, null, F(r.value, (t) => (M(), y(rt, {
|
|
865
865
|
key: t.key,
|
|
866
866
|
block: e.blocks[t.block],
|
|
867
867
|
row: t.row,
|
|
@@ -874,47 +874,47 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
874
874
|
"mode",
|
|
875
875
|
"page",
|
|
876
876
|
"numbers"
|
|
877
|
-
]))), 128))], 4), (
|
|
877
|
+
]))), 128))], 4), (M(!0), x(_, null, F(i.value, (e, t) => (M(), x("img", {
|
|
878
878
|
key: t,
|
|
879
879
|
class: "pk-word-preview__float",
|
|
880
|
-
style:
|
|
880
|
+
style: k(e.css),
|
|
881
881
|
src: e.src,
|
|
882
882
|
alt: ""
|
|
883
|
-
}, null, 12,
|
|
883
|
+
}, null, 12, at))), 128))]));
|
|
884
884
|
}
|
|
885
|
-
}),
|
|
885
|
+
}), st = ["aria-label"], ct = {
|
|
886
886
|
class: "pk-word-preview__tabs",
|
|
887
887
|
role: "tablist"
|
|
888
|
-
},
|
|
888
|
+
}, lt = ["aria-selected"], ut = ["aria-selected"], dt = {
|
|
889
889
|
key: 0,
|
|
890
890
|
class: "pk-word-preview__list"
|
|
891
|
-
},
|
|
891
|
+
}, ft = ["aria-current", "onClick"], pt = { class: "pk-word-preview__entry-text" }, mt = {
|
|
892
892
|
key: 0,
|
|
893
893
|
class: "u-dot"
|
|
894
|
-
},
|
|
894
|
+
}, ht = {
|
|
895
895
|
key: 0,
|
|
896
896
|
class: "pk-word-preview__none"
|
|
897
|
-
},
|
|
897
|
+
}, gt = {
|
|
898
898
|
key: 1,
|
|
899
899
|
class: "pk-word-preview__list"
|
|
900
|
-
},
|
|
900
|
+
}, _t = ["onClick"], vt = {
|
|
901
901
|
key: 0,
|
|
902
902
|
class: "pk-word-preview__removed"
|
|
903
|
-
},
|
|
903
|
+
}, yt = {
|
|
904
904
|
key: 1,
|
|
905
905
|
class: "pk-word-preview__added"
|
|
906
|
-
},
|
|
906
|
+
}, bt = { class: "pk-word-preview__main" }, xt = ["aria-label"], St = ["src"], Ct = {
|
|
907
907
|
key: 2,
|
|
908
908
|
class: "pk-word-preview__truncated"
|
|
909
|
-
},
|
|
909
|
+
}, wt = { class: "pk-word-preview__status" }, Tt = {
|
|
910
910
|
key: 0,
|
|
911
911
|
class: "pk-word-preview__count"
|
|
912
|
-
},
|
|
912
|
+
}, Et = { class: "pk-word-preview__count" }, Dt = {
|
|
913
913
|
key: 1,
|
|
914
914
|
class: "pk-word-preview__legend"
|
|
915
|
-
},
|
|
915
|
+
}, Ot = ["title"], kt = { class: "pk-word-preview__removed" }, At = { class: "pk-word-preview__added" }, jt = { class: "pk-word-preview__percent" }, Mt = ["data-part"], Nt = 96 / 72, Pt = .5, Ft = /* @__PURE__ */ T({
|
|
916
916
|
__name: "PkWordPreview",
|
|
917
|
-
props: /*@__PURE__*/
|
|
917
|
+
props: /*@__PURE__*/ D({
|
|
918
918
|
preview: {},
|
|
919
919
|
mode: {}
|
|
920
920
|
}, {
|
|
@@ -926,26 +926,26 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
926
926
|
zoom: { default: 1 },
|
|
927
927
|
zoomModifiers: {}
|
|
928
928
|
}),
|
|
929
|
-
emits: /*@__PURE__*/
|
|
929
|
+
emits: /*@__PURE__*/ D(["select"], ["update:fit", "update:zoom"]),
|
|
930
930
|
setup(e, { emit: t }) {
|
|
931
|
-
let n = e, r = t, { t: i } =
|
|
932
|
-
|
|
933
|
-
let u = (e) => d(e, n.mode), h = v(() => f(n.preview.blocks, n.mode)), g =
|
|
931
|
+
let n = e, r = t, { t: i } = ae({ useScope: "global" });
|
|
932
|
+
N(m, v(() => n.preview.images));
|
|
933
|
+
let u = (e) => d(e, n.mode), h = v(() => f(n.preview.blocks, n.mode)), g = re("rootEl"), C = re("scrollEl"), T = re("measureEl"), { width: ee } = oe(g), { width: E } = oe(C), D = v(() => ee.value >= 1e3), j = v(() => n.preview.sections?.length ? n.preview.sections : [{
|
|
934
934
|
page: n.preview.page,
|
|
935
935
|
headerDistance: 0,
|
|
936
936
|
footerDistance: 0,
|
|
937
937
|
headers: {},
|
|
938
938
|
footers: {}
|
|
939
|
-
}]),
|
|
939
|
+
}]), I = v(() => j.value[0].page), B = v(() => (E.value - 48) / (I.value.width * Nt)), H = v(() => ee.value === 0 || E.value === 0 || B.value >= Pt), U = v(() => ({
|
|
940
940
|
fontFamily: s(n.preview.defaults.font),
|
|
941
941
|
fontSize: `${n.preview.defaults.size}pt`,
|
|
942
942
|
color: n.preview.defaults.color ?? "#000000",
|
|
943
943
|
"--pk-word-line": p(n.preview.defaults.font),
|
|
944
944
|
"--pk-word-size": `${n.preview.defaults.size}pt`
|
|
945
|
-
})), ie = v(() =>
|
|
946
|
-
...
|
|
945
|
+
})), ie = v(() => I.value.width - I.value.margins.left - I.value.margins.right), W = v(() => ({
|
|
946
|
+
...U.value,
|
|
947
947
|
width: `${ie.value}pt`
|
|
948
|
-
})),
|
|
948
|
+
})), se = re("flowEl"), { width: ce } = oe(se), le = v(() => {
|
|
949
949
|
let e = /* @__PURE__ */ new Map(), t = 0;
|
|
950
950
|
for (let r of n.preview.blocks) {
|
|
951
951
|
if (r.kind === "table") continue;
|
|
@@ -958,22 +958,22 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
958
958
|
let r = 0;
|
|
959
959
|
for (let [n, i] of [...e].sort((e, t) => e[0] - t[0])) if (r += i, r > t / 10) return n;
|
|
960
960
|
return 0;
|
|
961
|
-
}),
|
|
962
|
-
...
|
|
961
|
+
}), de = v(() => ({
|
|
962
|
+
...U.value,
|
|
963
963
|
"--pk-word-indent-shared": `${le.value}pt`,
|
|
964
|
-
"--pk-word-indent-scale": ce.value ? Math.min(1, ce.value / (ie.value *
|
|
965
|
-
})), G =
|
|
966
|
-
await
|
|
964
|
+
"--pk-word-indent-scale": ce.value ? Math.min(1, ce.value / (ie.value * Nt)) : 1
|
|
965
|
+
})), G = P([]), fe = P({}), K = async () => {
|
|
966
|
+
await te();
|
|
967
967
|
let e = T.value?.querySelectorAll("[data-item]");
|
|
968
968
|
G.value = [...e ?? []].map((e) => e.getBoundingClientRect().height);
|
|
969
969
|
let t = T.value?.querySelectorAll("[data-part]");
|
|
970
970
|
fe.value = Object.fromEntries([...t ?? []].map((e) => [e.dataset.part ?? "", e.getBoundingClientRect().height]));
|
|
971
971
|
};
|
|
972
|
-
|
|
972
|
+
V([
|
|
973
973
|
h,
|
|
974
974
|
H,
|
|
975
975
|
() => n.preview.parts
|
|
976
|
-
], K, { flush: "post" }),
|
|
976
|
+
], K, { flush: "post" }), ne(() => {
|
|
977
977
|
K(), document.fonts?.ready.then(K);
|
|
978
978
|
});
|
|
979
979
|
let q = v(() => {
|
|
@@ -981,14 +981,14 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
981
981
|
items: h.value.map((e, t) => t),
|
|
982
982
|
section: 0,
|
|
983
983
|
number: 1,
|
|
984
|
-
top:
|
|
985
|
-
bottom:
|
|
984
|
+
top: I.value.margins.top,
|
|
985
|
+
bottom: I.value.margins.bottom
|
|
986
986
|
}];
|
|
987
987
|
let e = [], t = 0, r = !0, i = 0, a, o = () => {
|
|
988
|
-
let n =
|
|
988
|
+
let n = j.value[t];
|
|
989
989
|
return r && n.pageStart !== void 0 ? n.pageStart : (a ?? e[e.length - 1]?.number ?? 0) + 1;
|
|
990
990
|
}, s = (e) => {
|
|
991
|
-
let i =
|
|
991
|
+
let i = j.value[t], a = (t) => r && i.titlePage ? t.first : n.preview.evenAndOddHeaders && e % 2 == 0 ? t.even : t.default, o = a(i.headers), s = a(i.footers), c = (e) => e ? (fe.value[e] ?? 0) / Nt : 0;
|
|
992
992
|
return {
|
|
993
993
|
header: o,
|
|
994
994
|
footer: s,
|
|
@@ -1005,15 +1005,15 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
1005
1005
|
}), r = !1, i = 0;
|
|
1006
1006
|
};
|
|
1007
1007
|
return h.value.forEach((n, l) => {
|
|
1008
|
-
n.section !== void 0 && n.section !== t &&
|
|
1009
|
-
let u = e[e.length - 1], d = u &&
|
|
1008
|
+
n.section !== void 0 && n.section !== t && j.value[n.section] && (t = n.section, r = n.breakBefore || !e.length, r || (a = j.value[t].pageStart));
|
|
1009
|
+
let u = e[e.length - 1], d = u && j.value[u.section].page, f = d ? (d.height - u.top - u.bottom) * Nt : 0, p = G.value[l];
|
|
1010
1010
|
for (let e = l; h.value[e]?.keepNext && e + 1 < h.value.length && !h.value[e + 1].breakBefore; e++) p += G.value[e + 1];
|
|
1011
1011
|
(!u || u.items.length && (n.breakBefore || i + G.value[l] > f || i + p > f && p <= (() => {
|
|
1012
1012
|
let e = s(o());
|
|
1013
|
-
return (
|
|
1013
|
+
return (j.value[t].page.height - e.top - e.bottom) * Nt;
|
|
1014
1014
|
})())) && c(), e[e.length - 1].items.push(l), i += G.value[l];
|
|
1015
1015
|
}), e.length || c(), e;
|
|
1016
|
-
}),
|
|
1016
|
+
}), J = v(() => {
|
|
1017
1017
|
let e = /* @__PURE__ */ new Map();
|
|
1018
1018
|
for (let t of q.value) e.set(t.section, (e.get(t.section) ?? 0) + 1);
|
|
1019
1019
|
return q.value.map((t) => ({
|
|
@@ -1021,26 +1021,26 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
1021
1021
|
pages: q.value.length,
|
|
1022
1022
|
sectionPages: e.get(t.section) ?? 1
|
|
1023
1023
|
}));
|
|
1024
|
-
}),
|
|
1025
|
-
let t =
|
|
1024
|
+
}), pe = (e) => {
|
|
1025
|
+
let t = j.value[e.section].page;
|
|
1026
1026
|
return {
|
|
1027
|
-
...
|
|
1027
|
+
...U.value,
|
|
1028
1028
|
width: `${t.width}pt`,
|
|
1029
1029
|
minHeight: `${t.height}pt`,
|
|
1030
1030
|
padding: `${e.top}pt ${t.margins.right}pt ${e.bottom}pt ${t.margins.left}pt`
|
|
1031
1031
|
};
|
|
1032
|
-
},
|
|
1032
|
+
}, me = (e) => {
|
|
1033
1033
|
let t = [...new Set(e.items.map((e) => h.value[e].block))];
|
|
1034
1034
|
return l(t.map((e) => n.preview.blocks[e]), n.mode).flatMap((t) => {
|
|
1035
1035
|
let r = c(n.preview.images, t.ref);
|
|
1036
1036
|
return r ? [{
|
|
1037
1037
|
src: r,
|
|
1038
|
-
css: o(t,
|
|
1038
|
+
css: o(t, j.value[e.section].page)
|
|
1039
1039
|
}] : [];
|
|
1040
1040
|
});
|
|
1041
|
-
},
|
|
1042
|
-
|
|
1043
|
-
},
|
|
1041
|
+
}, he = z(e, "fit"), ge = z(e, "zoom"), _e = v(() => he.value ? Math.min(1.25, Math.max(.3, B.value)) : ge.value), Y = (e) => {
|
|
1042
|
+
ge.value = Math.min(2, Math.max(.3, Math.round((_e.value + e) * 10) / 10)), he.value = !1;
|
|
1043
|
+
}, ye = P(0), be = P(), xe = () => {
|
|
1044
1044
|
let e = C.value?.getBoundingClientRect();
|
|
1045
1045
|
if (!e) return;
|
|
1046
1046
|
let t = C.value?.querySelectorAll("[data-page]") ?? [], n = 0;
|
|
@@ -1048,123 +1048,123 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
1048
1048
|
if (i.getBoundingClientRect().top - e.top > e.height / 3) break;
|
|
1049
1049
|
n = r;
|
|
1050
1050
|
}
|
|
1051
|
-
|
|
1051
|
+
ye.value = n;
|
|
1052
1052
|
let r;
|
|
1053
|
-
for (let t of
|
|
1053
|
+
for (let t of $.value) {
|
|
1054
1054
|
let n = C.value?.querySelector(`[data-key="${t.key}"]`);
|
|
1055
1055
|
if (n) {
|
|
1056
1056
|
if (n.getBoundingClientRect().top - e.top > 48) break;
|
|
1057
1057
|
r = t.key;
|
|
1058
1058
|
}
|
|
1059
1059
|
}
|
|
1060
|
-
|
|
1061
|
-
},
|
|
1062
|
-
|
|
1063
|
-
|
|
1060
|
+
be.value = r ?? $.value[0]?.key;
|
|
1061
|
+
}, X = 0, Z = () => {
|
|
1062
|
+
X ||= requestAnimationFrame(() => {
|
|
1063
|
+
X = 0, xe();
|
|
1064
1064
|
});
|
|
1065
1065
|
};
|
|
1066
|
-
|
|
1067
|
-
let { selection:
|
|
1068
|
-
|
|
1066
|
+
A(() => cancelAnimationFrame(X)), V(q, () => te(Z));
|
|
1067
|
+
let { selection: Q } = ue({ root: () => C.value?.getRootNode() });
|
|
1068
|
+
V(Q, (e) => {
|
|
1069
1069
|
let t = C.value;
|
|
1070
|
-
r("select", e && t ?
|
|
1070
|
+
r("select", e && t ? ve(t, e.range, ".pk-word-preview__measure, .pk-word-preview__part") : void 0);
|
|
1071
1071
|
});
|
|
1072
|
-
let
|
|
1073
|
-
let t = n.preview.blocks[e.block], r = t.kind === "heading" ? [t.label,
|
|
1072
|
+
let Se = (e) => u(e).map((e) => e.text).join("").replace(/\s+/g, " ").trim(), $ = v(() => h.value.flatMap((e) => {
|
|
1073
|
+
let t = n.preview.blocks[e.block], r = t.kind === "heading" ? [t.label, Se(t.runs)].filter(Boolean).join(" ") : "";
|
|
1074
1074
|
return t.kind === "heading" && t.level <= 3 && r ? [{
|
|
1075
1075
|
key: e.key,
|
|
1076
1076
|
level: t.level,
|
|
1077
1077
|
text: r
|
|
1078
1078
|
}] : [];
|
|
1079
|
-
})),
|
|
1079
|
+
})), Ce = (e) => e.length > 60 ? `${e.slice(0, 60)}…` : e, we = v(() => h.value.flatMap((e) => {
|
|
1080
1080
|
let t = n.preview.blocks[e.block], r = t.kind === "table" ? (t.rows[e.row ?? 0] ?? []).flatMap((e) => e.runs) : t.runs, i = r.filter((e) => e.change === "deleted").map((e) => e.text).join(" ").trim(), a = r.filter((e) => e.change === "inserted").map((e) => e.text).join(" ").trim();
|
|
1081
1081
|
return i || a ? [{
|
|
1082
1082
|
key: e.key,
|
|
1083
|
-
removed:
|
|
1084
|
-
added:
|
|
1083
|
+
removed: Ce(i),
|
|
1084
|
+
added: Ce(a)
|
|
1085
1085
|
}] : [];
|
|
1086
|
-
})), Te =
|
|
1086
|
+
})), Te = P("outline"), Ee = P(!1), De = (e) => {
|
|
1087
1087
|
C.value?.querySelector(`[data-key="${e}"]`)?.scrollIntoView({
|
|
1088
1088
|
block: "start",
|
|
1089
1089
|
behavior: "smooth"
|
|
1090
|
-
}),
|
|
1091
|
-
}, Oe = v(() => n.preview.blocks.flatMap((e) => e.kind === "table" ? e.rows.flat().map((e) =>
|
|
1090
|
+
}), D.value || (Ee.value = !1);
|
|
1091
|
+
}, Oe = v(() => n.preview.blocks.flatMap((e) => e.kind === "table" ? e.rows.flat().map((e) => Se(e.runs)) : [Se(e.runs)]).join(" ").split(/\s+/).filter(Boolean).length), ke = v(() => n.preview.revisionAuthors.join(", "));
|
|
1092
1092
|
return (t, n) => {
|
|
1093
1093
|
let r = a;
|
|
1094
|
-
return
|
|
1094
|
+
return M(), x("div", {
|
|
1095
1095
|
ref_key: "rootEl",
|
|
1096
1096
|
ref: g,
|
|
1097
|
-
class:
|
|
1097
|
+
class: O(["pk-word-preview", { "pk-word-preview--paged": H.value }])
|
|
1098
1098
|
}, [
|
|
1099
|
-
(
|
|
1099
|
+
(D.value || Ee.value) && ($.value.length || we.value.length) ? (M(), x("aside", {
|
|
1100
1100
|
key: 0,
|
|
1101
|
-
class:
|
|
1102
|
-
"aria-label":
|
|
1103
|
-
}, [S("div",
|
|
1101
|
+
class: O(["pk-word-preview__side", { "pk-word-preview__side--over": !D.value }]),
|
|
1102
|
+
"aria-label": R(i)("chatFilePreview.outline")
|
|
1103
|
+
}, [S("div", ct, [S("button", {
|
|
1104
1104
|
type: "button",
|
|
1105
1105
|
role: "tab",
|
|
1106
1106
|
class: "pk-word-preview__tab",
|
|
1107
1107
|
"aria-selected": Te.value === "outline",
|
|
1108
1108
|
onClick: n[0] ||= (e) => Te.value = "outline"
|
|
1109
|
-
},
|
|
1109
|
+
}, L(R(i)("chatFilePreview.outline")), 9, lt), we.value.length ? (M(), x("button", {
|
|
1110
1110
|
key: 0,
|
|
1111
1111
|
type: "button",
|
|
1112
1112
|
role: "tab",
|
|
1113
1113
|
class: "pk-word-preview__tab",
|
|
1114
1114
|
"aria-selected": Te.value === "changes",
|
|
1115
1115
|
onClick: n[1] ||= (e) => Te.value = "changes"
|
|
1116
|
-
},
|
|
1116
|
+
}, L(R(i)("chatFilePreview.changes", { count: we.value.length })), 9, ut)) : b("", !0)]), Te.value === "outline" || !we.value.length ? (M(), x("nav", dt, [(M(!0), x(_, null, F($.value, (e) => (M(), x("button", {
|
|
1117
1117
|
key: e.key,
|
|
1118
1118
|
type: "button",
|
|
1119
|
-
class:
|
|
1120
|
-
"aria-current":
|
|
1119
|
+
class: O(["pk-word-preview__entry", `pk-word-preview__entry--${Math.min(e.level, 3)}`]),
|
|
1120
|
+
"aria-current": be.value === e.key ? "location" : void 0,
|
|
1121
1121
|
onClick: (t) => De(e.key)
|
|
1122
|
-
}, [S("span",
|
|
1122
|
+
}, [S("span", pt, L(e.text), 1), we.value.some((t) => t.key === e.key) ? (M(), x("span", mt)) : b("", !0)], 10, ft))), 128)), $.value.length ? b("", !0) : (M(), x("p", ht, L(R(i)("chatFilePreview.noHeadings")), 1))])) : (M(), x("nav", gt, [(M(!0), x(_, null, F(we.value, (e) => (M(), x("button", {
|
|
1123
1123
|
key: e.key,
|
|
1124
1124
|
type: "button",
|
|
1125
1125
|
class: "pk-word-preview__entry pk-word-preview__entry--change",
|
|
1126
1126
|
onClick: (t) => De(e.key)
|
|
1127
|
-
}, [e.removed ? (
|
|
1128
|
-
S("div",
|
|
1127
|
+
}, [e.removed ? (M(), x("del", vt, L(e.removed), 1)) : b("", !0), e.added ? (M(), x("ins", yt, L(e.added), 1)) : b("", !0)], 8, _t))), 128))]))], 10, st)) : b("", !0),
|
|
1128
|
+
S("div", bt, [S("div", {
|
|
1129
1129
|
ref_key: "scrollEl",
|
|
1130
1130
|
ref: C,
|
|
1131
1131
|
class: "pk-word-preview__scroll",
|
|
1132
|
-
onScroll:
|
|
1133
|
-
}, [H.value ? (
|
|
1132
|
+
onScroll: Z
|
|
1133
|
+
}, [H.value ? (M(), x("div", {
|
|
1134
1134
|
key: 0,
|
|
1135
1135
|
class: "pk-word-preview__pages",
|
|
1136
|
-
style:
|
|
1137
|
-
}, [(
|
|
1136
|
+
style: k({ zoom: _e.value })
|
|
1137
|
+
}, [(M(!0), x(_, null, F(q.value, (t, n) => (M(), x("article", {
|
|
1138
1138
|
key: n,
|
|
1139
1139
|
"data-page": "",
|
|
1140
1140
|
class: "pk-word-preview__page",
|
|
1141
|
-
"aria-label":
|
|
1141
|
+
"aria-label": R(i)("chatFilePreview.pageOf", {
|
|
1142
1142
|
page: n + 1,
|
|
1143
1143
|
count: q.value.length
|
|
1144
1144
|
}),
|
|
1145
|
-
style:
|
|
1145
|
+
style: k(pe(t))
|
|
1146
1146
|
}, [
|
|
1147
|
-
t.header && e.preview.parts?.[t.header] ? (
|
|
1147
|
+
t.header && e.preview.parts?.[t.header] ? (M(), y(ot, {
|
|
1148
1148
|
key: 0,
|
|
1149
1149
|
blocks: e.preview.parts[t.header],
|
|
1150
1150
|
where: "header",
|
|
1151
|
-
section:
|
|
1151
|
+
section: j.value[t.section],
|
|
1152
1152
|
mode: e.mode,
|
|
1153
|
-
numbers:
|
|
1153
|
+
numbers: J.value[n]
|
|
1154
1154
|
}, null, 8, [
|
|
1155
1155
|
"blocks",
|
|
1156
1156
|
"section",
|
|
1157
1157
|
"mode",
|
|
1158
1158
|
"numbers"
|
|
1159
1159
|
])) : b("", !0),
|
|
1160
|
-
(
|
|
1160
|
+
(M(!0), x(_, null, F(t.items, (r) => (M(), y(rt, {
|
|
1161
1161
|
key: h.value[r].key,
|
|
1162
1162
|
"data-key": h.value[r].key,
|
|
1163
1163
|
block: e.preview.blocks[h.value[r].block],
|
|
1164
1164
|
row: h.value[r].row,
|
|
1165
1165
|
mode: e.mode,
|
|
1166
|
-
page:
|
|
1167
|
-
numbers:
|
|
1166
|
+
page: j.value[t.section].page,
|
|
1167
|
+
numbers: J.value[n]
|
|
1168
1168
|
}, null, 8, [
|
|
1169
1169
|
"data-key",
|
|
1170
1170
|
"block",
|
|
@@ -1173,33 +1173,33 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
1173
1173
|
"page",
|
|
1174
1174
|
"numbers"
|
|
1175
1175
|
]))), 128)),
|
|
1176
|
-
(
|
|
1176
|
+
(M(!0), x(_, null, F(me(t), (e, t) => (M(), x("img", {
|
|
1177
1177
|
key: `image-${t}`,
|
|
1178
1178
|
class: "pk-word-preview__float",
|
|
1179
|
-
style:
|
|
1179
|
+
style: k(e.css),
|
|
1180
1180
|
src: e.src,
|
|
1181
1181
|
alt: ""
|
|
1182
|
-
}, null, 12,
|
|
1183
|
-
t.footer && e.preview.parts?.[t.footer] ? (
|
|
1182
|
+
}, null, 12, St))), 128)),
|
|
1183
|
+
t.footer && e.preview.parts?.[t.footer] ? (M(), y(ot, {
|
|
1184
1184
|
key: 1,
|
|
1185
1185
|
blocks: e.preview.parts[t.footer],
|
|
1186
1186
|
where: "footer",
|
|
1187
|
-
section:
|
|
1187
|
+
section: j.value[t.section],
|
|
1188
1188
|
mode: e.mode,
|
|
1189
|
-
numbers:
|
|
1189
|
+
numbers: J.value[n]
|
|
1190
1190
|
}, null, 8, [
|
|
1191
1191
|
"blocks",
|
|
1192
1192
|
"section",
|
|
1193
1193
|
"mode",
|
|
1194
1194
|
"numbers"
|
|
1195
1195
|
])) : b("", !0)
|
|
1196
|
-
], 12,
|
|
1196
|
+
], 12, xt))), 128))], 4)) : (M(), x("article", {
|
|
1197
1197
|
key: 1,
|
|
1198
1198
|
ref_key: "flowEl",
|
|
1199
|
-
ref:
|
|
1199
|
+
ref: se,
|
|
1200
1200
|
class: "pk-word-preview__page pk-word-preview__page--flow",
|
|
1201
|
-
style:
|
|
1202
|
-
}, [(
|
|
1201
|
+
style: k(de.value)
|
|
1202
|
+
}, [(M(!0), x(_, null, F(h.value, (t) => (M(), y(rt, {
|
|
1203
1203
|
key: t.key,
|
|
1204
1204
|
"data-key": t.key,
|
|
1205
1205
|
block: e.preview.blocks[t.block],
|
|
@@ -1210,29 +1210,29 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
1210
1210
|
"block",
|
|
1211
1211
|
"row",
|
|
1212
1212
|
"mode"
|
|
1213
|
-
]))), 128))], 4)), e.preview.truncated ? (
|
|
1214
|
-
H.value ? (
|
|
1215
|
-
page:
|
|
1213
|
+
]))), 128))], 4)), e.preview.truncated ? (M(), x("p", Ct, L(R(i)("chatFilePreview.truncated")), 1)) : b("", !0)], 544), S("div", wt, [
|
|
1214
|
+
H.value ? (M(), x("span", Tt, L(R(i)("chatFilePreview.pageOf", {
|
|
1215
|
+
page: ye.value + 1,
|
|
1216
1216
|
count: q.value.length
|
|
1217
1217
|
})), 1)) : b("", !0),
|
|
1218
|
-
S("span",
|
|
1219
|
-
e.mode === "markup" && e.preview.revisionAuthors.length ? (
|
|
1218
|
+
S("span", Et, L(R(i)("chatFilePreview.words", Oe.value)), 1),
|
|
1219
|
+
e.mode === "markup" && e.preview.revisionAuthors.length ? (M(), x("span", Dt, [
|
|
1220
1220
|
S("span", {
|
|
1221
1221
|
class: "pk-word-preview__legend-text",
|
|
1222
|
-
title:
|
|
1223
|
-
},
|
|
1224
|
-
S("del",
|
|
1225
|
-
S("ins",
|
|
1222
|
+
title: R(i)("chatFilePreview.revisionsOf", { authors: ke.value })
|
|
1223
|
+
}, L(R(i)("chatFilePreview.revisionsOf", { authors: ke.value })), 9, Ot),
|
|
1224
|
+
S("del", kt, L(R(i)("chatFilePreview.removed")), 1),
|
|
1225
|
+
S("ins", At, L(R(i)("chatFilePreview.added")), 1)
|
|
1226
1226
|
])) : b("", !0),
|
|
1227
1227
|
n[6] ||= S("span", { class: "pk-word-preview__spacer" }, null, -1),
|
|
1228
|
-
!
|
|
1228
|
+
!D.value && ($.value.length || we.value.length) ? (M(), y(r, {
|
|
1229
1229
|
key: 2,
|
|
1230
1230
|
class: "pk-word-preview__outline-toggle",
|
|
1231
1231
|
modifiers: "action-quiet",
|
|
1232
1232
|
icon: "ri:list-unordered",
|
|
1233
|
-
label:
|
|
1234
|
-
title:
|
|
1235
|
-
"aria-label":
|
|
1233
|
+
label: R(i)("chatFilePreview.outline"),
|
|
1234
|
+
title: R(i)("chatFilePreview.outline"),
|
|
1235
|
+
"aria-label": R(i)("chatFilePreview.outline"),
|
|
1236
1236
|
"aria-expanded": Ee.value,
|
|
1237
1237
|
onClick: n[2] ||= (e) => Ee.value = !Ee.value
|
|
1238
1238
|
}, null, 8, [
|
|
@@ -1241,16 +1241,16 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
1241
1241
|
"aria-label",
|
|
1242
1242
|
"aria-expanded"
|
|
1243
1243
|
])) : b("", !0),
|
|
1244
|
-
H.value ? (
|
|
1244
|
+
H.value ? (M(), x(_, { key: 3 }, [
|
|
1245
1245
|
w(r, {
|
|
1246
1246
|
class: "pk-word-preview__fit",
|
|
1247
1247
|
modifiers: "action-quiet",
|
|
1248
1248
|
icon: "ri:expand-width-line",
|
|
1249
|
-
label:
|
|
1250
|
-
title:
|
|
1251
|
-
"aria-label":
|
|
1252
|
-
disabled:
|
|
1253
|
-
onClick: n[3] ||= (e) =>
|
|
1249
|
+
label: R(i)("chatFilePreview.fitWidth"),
|
|
1250
|
+
title: R(i)("chatFilePreview.fitWidth"),
|
|
1251
|
+
"aria-label": R(i)("chatFilePreview.fitWidth"),
|
|
1252
|
+
disabled: he.value,
|
|
1253
|
+
onClick: n[3] ||= (e) => he.value = !0
|
|
1254
1254
|
}, null, 8, [
|
|
1255
1255
|
"label",
|
|
1256
1256
|
"title",
|
|
@@ -1260,73 +1260,73 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
1260
1260
|
w(r, {
|
|
1261
1261
|
modifiers: "action-quiet",
|
|
1262
1262
|
icon: "ri:subtract-line",
|
|
1263
|
-
"aria-label":
|
|
1264
|
-
disabled:
|
|
1265
|
-
onClick: n[4] ||= (e) =>
|
|
1263
|
+
"aria-label": R(i)("chatFilePreview.zoomOut"),
|
|
1264
|
+
disabled: _e.value <= .3,
|
|
1265
|
+
onClick: n[4] ||= (e) => Y(-.1)
|
|
1266
1266
|
}, null, 8, ["aria-label", "disabled"]),
|
|
1267
|
-
S("span",
|
|
1267
|
+
S("span", jt, L(Math.round(_e.value * 100)) + "% ", 1),
|
|
1268
1268
|
w(r, {
|
|
1269
1269
|
modifiers: "action-quiet",
|
|
1270
1270
|
icon: "ri:add-line",
|
|
1271
|
-
"aria-label":
|
|
1272
|
-
disabled:
|
|
1273
|
-
onClick: n[5] ||= (e) =>
|
|
1271
|
+
"aria-label": R(i)("chatFilePreview.zoomIn"),
|
|
1272
|
+
disabled: _e.value >= 2,
|
|
1273
|
+
onClick: n[5] ||= (e) => Y(.1)
|
|
1274
1274
|
}, null, 8, ["aria-label", "disabled"])
|
|
1275
1275
|
], 64)) : b("", !0)
|
|
1276
1276
|
])]),
|
|
1277
|
-
H.value ? (
|
|
1277
|
+
H.value ? (M(), x("div", {
|
|
1278
1278
|
key: 1,
|
|
1279
1279
|
ref_key: "measureEl",
|
|
1280
1280
|
ref: T,
|
|
1281
1281
|
class: "pk-word-preview__measure",
|
|
1282
1282
|
"aria-hidden": "true",
|
|
1283
|
-
style:
|
|
1284
|
-
}, [(
|
|
1283
|
+
style: k(W.value)
|
|
1284
|
+
}, [(M(!0), x(_, null, F(h.value, (t) => (M(), x("div", {
|
|
1285
1285
|
key: t.key,
|
|
1286
1286
|
"data-item": ""
|
|
1287
|
-
}, [w(
|
|
1287
|
+
}, [w(rt, {
|
|
1288
1288
|
block: e.preview.blocks[t.block],
|
|
1289
1289
|
row: t.row,
|
|
1290
1290
|
mode: e.mode,
|
|
1291
|
-
page:
|
|
1291
|
+
page: I.value
|
|
1292
1292
|
}, null, 8, [
|
|
1293
1293
|
"block",
|
|
1294
1294
|
"row",
|
|
1295
1295
|
"mode",
|
|
1296
1296
|
"page"
|
|
1297
|
-
])]))), 128)), (
|
|
1297
|
+
])]))), 128)), (M(!0), x(_, null, F(e.preview.parts, (t, n) => (M(), x("div", {
|
|
1298
1298
|
key: n,
|
|
1299
1299
|
"data-part": n
|
|
1300
|
-
}, [(
|
|
1300
|
+
}, [(M(!0), x(_, null, F(R(f)(t, e.mode), (n) => (M(), y(rt, {
|
|
1301
1301
|
key: n.key,
|
|
1302
1302
|
block: t[n.block],
|
|
1303
1303
|
row: n.row,
|
|
1304
1304
|
mode: e.mode,
|
|
1305
|
-
page:
|
|
1305
|
+
page: I.value
|
|
1306
1306
|
}, null, 8, [
|
|
1307
1307
|
"block",
|
|
1308
1308
|
"row",
|
|
1309
1309
|
"mode",
|
|
1310
1310
|
"page"
|
|
1311
|
-
]))), 128))], 8,
|
|
1311
|
+
]))), 128))], 8, Mt))), 128))], 4)) : b("", !0)
|
|
1312
1312
|
], 2);
|
|
1313
1313
|
};
|
|
1314
1314
|
}
|
|
1315
|
-
}),
|
|
1315
|
+
}), It = ["aria-label"], Lt = { class: "pk-file-preview__head" }, Rt = { class: "pk-file-preview__file" }, zt = {
|
|
1316
1316
|
class: "pk-file-preview__tile",
|
|
1317
1317
|
"aria-hidden": "true"
|
|
1318
|
-
},
|
|
1318
|
+
}, Bt = { class: "pk-file-preview__name" }, Vt = { class: "pk-file-preview__title" }, Ht = { class: "pk-file-preview__note" }, Ut = {
|
|
1319
1319
|
key: 0,
|
|
1320
1320
|
class: "pk-file-preview__tools"
|
|
1321
|
-
},
|
|
1321
|
+
}, Wt = ["aria-label"], Gt = { class: "pk-file-preview__version" }, Kt = { class: "pk-file-preview__mode-long" }, qt = { class: "pk-file-preview__mode-short" }, Jt = { class: "pk-file-preview__actions" }, Yt = { class: "pk-file-preview__body" }, Xt = {
|
|
1322
1322
|
key: 0,
|
|
1323
1323
|
class: "pk-file-preview__skeleton vv-skeleton"
|
|
1324
|
-
},
|
|
1324
|
+
}, Zt = {
|
|
1325
1325
|
key: 1,
|
|
1326
1326
|
class: "pk-file-preview__empty"
|
|
1327
|
-
},
|
|
1327
|
+
}, Qt = /*@__PURE__*/ T({
|
|
1328
1328
|
__name: "PkFilePreview",
|
|
1329
|
-
props: /*@__PURE__*/
|
|
1329
|
+
props: /*@__PURE__*/ D({
|
|
1330
1330
|
kind: {},
|
|
1331
1331
|
filename: {},
|
|
1332
1332
|
version: {},
|
|
@@ -1353,7 +1353,7 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
1353
1353
|
},
|
|
1354
1354
|
fitModifiers: {}
|
|
1355
1355
|
}),
|
|
1356
|
-
emits: /*@__PURE__*/
|
|
1356
|
+
emits: /*@__PURE__*/ D([
|
|
1357
1357
|
"close",
|
|
1358
1358
|
"version",
|
|
1359
1359
|
"restore",
|
|
@@ -1366,7 +1366,7 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
1366
1366
|
"update:fit"
|
|
1367
1367
|
]),
|
|
1368
1368
|
setup(e, { emit: n }) {
|
|
1369
|
-
let r = e, i = n, { t: o, locale: s } =
|
|
1369
|
+
let r = e, i = n, { t: o, locale: s } = ae({ useScope: "global" }), c = v(() => r.versions ?? []), l = v(() => r.version ? c.value.indexOf(r.version) : -1), u = v(() => l.value > 0 ? c.value[l.value - 1] : void 0), d = v(() => l.value >= 0 && l.value < c.value.length - 1 ? c.value[l.value + 1] : void 0), f = z(e, "mode"), p = z(e, "sheet"), m = z(e, "zoom"), h = z(e, "fit"), C = v(() => [
|
|
1370
1370
|
{
|
|
1371
1371
|
value: "markup",
|
|
1372
1372
|
label: o("chatFilePreview.modeMarkup")
|
|
@@ -1380,43 +1380,43 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
1380
1380
|
label: o("chatFilePreview.modeOriginal")
|
|
1381
1381
|
}
|
|
1382
1382
|
]), T = v(() => r.preview?.kind === "word" && r.preview.revisionAuthors.length > 0);
|
|
1383
|
-
|
|
1383
|
+
V(() => r.version, () => {
|
|
1384
1384
|
f.value = "markup";
|
|
1385
1385
|
});
|
|
1386
|
-
let
|
|
1387
|
-
|
|
1386
|
+
let ee = re("rootEl"), E = I(), D = P(!1), k = () => {
|
|
1387
|
+
E.value = void 0, D.value = !1;
|
|
1388
1388
|
};
|
|
1389
|
-
|
|
1389
|
+
V(() => [
|
|
1390
1390
|
r.version,
|
|
1391
1391
|
r.preview,
|
|
1392
1392
|
f.value
|
|
1393
|
-
],
|
|
1394
|
-
let
|
|
1395
|
-
|
|
1393
|
+
], k);
|
|
1394
|
+
let A = (e) => {
|
|
1395
|
+
D.value || (E.value = e);
|
|
1396
1396
|
};
|
|
1397
|
-
|
|
1398
|
-
let n =
|
|
1399
|
-
t && !e && n?.format === "docx" && (await
|
|
1397
|
+
V(D, async (e, t) => {
|
|
1398
|
+
let n = E.value;
|
|
1399
|
+
t && !e && n?.format === "docx" && (await te(), n.restore());
|
|
1400
1400
|
});
|
|
1401
|
-
let
|
|
1401
|
+
let ne = v(() => !r.version || r.version === c.value[c.value.length - 1]), j = () => {
|
|
1402
1402
|
let e = c.value[c.value.length - 1];
|
|
1403
1403
|
e && i("version", e);
|
|
1404
|
-
},
|
|
1405
|
-
let e =
|
|
1406
|
-
return e?.format === "docx" ? e.paragraphCount > 200 : (e?.cells ?? 0) >
|
|
1407
|
-
}),
|
|
1408
|
-
let e =
|
|
1404
|
+
}, N = v(() => {
|
|
1405
|
+
let e = E.value;
|
|
1406
|
+
return e?.format === "docx" ? e.paragraphCount > 200 : (e?.cells ?? 0) > de;
|
|
1407
|
+
}), B = v(() => E.value?.format === "docx" && f.value === "original"), U = v(() => N.value || B.value), ie = v(() => B.value ? o("selectionActions.hintOriginal") : N.value ? o(E.value?.format === "docx" ? "selectionActions.hintParagraphs" : "selectionActions.hintCells", { count: E.value?.format === "docx" ? 200 : de }) : void 0), W = (e) => e[s.value] ?? e[s.value.split("-")[0]] ?? Object.values(e)[0] ?? "", oe = ["explain", "summarize"], ce = v(() => {
|
|
1408
|
+
let e = E.value, t = r.selectionActions;
|
|
1409
1409
|
if (!e || !t) return [];
|
|
1410
1410
|
let n = e.format;
|
|
1411
|
-
return [...(n === "docx" &&
|
|
1411
|
+
return [...(n === "docx" && U.value ? oe : t.builtIns).map((e) => ({
|
|
1412
1412
|
id: e,
|
|
1413
1413
|
label: o(`selectionActions.builtIn.${e}`),
|
|
1414
1414
|
...e === "translate" && { asks: o("selectionActions.translateAsks") },
|
|
1415
1415
|
prompt: (t) => o(`selectionActions.prompt.${n}.${e}`, { language: t ?? "" })
|
|
1416
|
-
})), ...(
|
|
1416
|
+
})), ...(U.value ? [] : t.actions).map((e) => ({
|
|
1417
1417
|
id: e.id,
|
|
1418
|
-
label:
|
|
1419
|
-
prompt: () =>
|
|
1418
|
+
label: W(e.label),
|
|
1419
|
+
prompt: () => W(e.prompt)
|
|
1420
1420
|
}))];
|
|
1421
1421
|
}), le = (e) => {
|
|
1422
1422
|
if (e.format === "docx") return o("selectionActions.labelParagraphs", {
|
|
@@ -1447,7 +1447,7 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
1447
1447
|
return {
|
|
1448
1448
|
...t,
|
|
1449
1449
|
...r,
|
|
1450
|
-
...
|
|
1450
|
+
...B.value && { original: !0 }
|
|
1451
1451
|
};
|
|
1452
1452
|
}
|
|
1453
1453
|
let { measure: n, cells: i, ...a } = e;
|
|
@@ -1455,23 +1455,23 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
1455
1455
|
...t,
|
|
1456
1456
|
...a
|
|
1457
1457
|
};
|
|
1458
|
-
},
|
|
1459
|
-
let n =
|
|
1458
|
+
}, G = (e, t) => {
|
|
1459
|
+
let n = E.value, r = n && ue(n);
|
|
1460
1460
|
r && (i("selectionSend", e, r, {
|
|
1461
1461
|
id: t,
|
|
1462
1462
|
size: n.format === "docx" ? n.paragraphCount : n.cells
|
|
1463
|
-
}),
|
|
1463
|
+
}), k(), document.getSelection()?.removeAllRanges());
|
|
1464
1464
|
}, fe = (e, t) => {
|
|
1465
|
-
let n =
|
|
1466
|
-
n &&
|
|
1467
|
-
}, K =
|
|
1468
|
-
|
|
1465
|
+
let n = ce.value.find((t) => t.id === e);
|
|
1466
|
+
n && G(n.prompt(t), e);
|
|
1467
|
+
}, K = P(0);
|
|
1468
|
+
se(ee, "scroll", () => K.value++, {
|
|
1469
1469
|
capture: !0,
|
|
1470
1470
|
passive: !0
|
|
1471
|
-
}),
|
|
1471
|
+
}), se(window, "resize", () => K.value++, { passive: !0 });
|
|
1472
1472
|
let q = v(() => {
|
|
1473
1473
|
K.value;
|
|
1474
|
-
let e =
|
|
1474
|
+
let e = E.value?.measure(), t = ee.value?.getBoundingClientRect();
|
|
1475
1475
|
if (e && t) return {
|
|
1476
1476
|
start: {
|
|
1477
1477
|
top: e.start.top - t.top,
|
|
@@ -1488,65 +1488,65 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
1488
1488
|
});
|
|
1489
1489
|
return (n, r) => {
|
|
1490
1490
|
let s = g, l = a;
|
|
1491
|
-
return
|
|
1491
|
+
return M(), x("section", {
|
|
1492
1492
|
ref_key: "rootEl",
|
|
1493
|
-
ref:
|
|
1493
|
+
ref: ee,
|
|
1494
1494
|
class: "pk-file-preview",
|
|
1495
1495
|
"aria-label": e.filename,
|
|
1496
1496
|
tabindex: "-1",
|
|
1497
1497
|
autofocus: ""
|
|
1498
1498
|
}, [
|
|
1499
|
-
S("header",
|
|
1500
|
-
S("div",
|
|
1499
|
+
S("header", Lt, [
|
|
1500
|
+
S("div", Rt, [S("span", zt, [w(s, {
|
|
1501
1501
|
name: e.kind === "word" ? "ri:file-word-2-line" : "ri:file-excel-2-line",
|
|
1502
|
-
class:
|
|
1503
|
-
}, null, 8, ["name", "class"])]), S("div",
|
|
1504
|
-
e.version && c.value.length > 1 || T.value ? (
|
|
1502
|
+
class: O(e.kind === "word" ? "pk-file-preview__icon--word" : "pk-file-preview__icon--sheet")
|
|
1503
|
+
}, null, 8, ["name", "class"])]), S("div", Bt, [S("strong", Vt, L(e.filename), 1), S("span", Ht, L(R(o)("chatFilePreview.readOnly")), 1)])]),
|
|
1504
|
+
e.version && c.value.length > 1 || T.value ? (M(), x("div", Ut, [e.version && c.value.length > 1 ? (M(), x("nav", {
|
|
1505
1505
|
key: 0,
|
|
1506
1506
|
class: "pk-file-preview__versions",
|
|
1507
|
-
"aria-label":
|
|
1507
|
+
"aria-label": R(o)("chatFilePreview.versions")
|
|
1508
1508
|
}, [
|
|
1509
1509
|
w(l, {
|
|
1510
1510
|
modifiers: "action-quiet",
|
|
1511
1511
|
icon: "ri:arrow-left-s-line",
|
|
1512
|
-
"aria-label":
|
|
1512
|
+
"aria-label": R(o)("chatFilePreview.previousVersion"),
|
|
1513
1513
|
disabled: !u.value,
|
|
1514
1514
|
onClick: r[0] ||= (e) => u.value && i("version", u.value)
|
|
1515
1515
|
}, null, 8, ["aria-label", "disabled"]),
|
|
1516
|
-
S("span",
|
|
1516
|
+
S("span", Gt, L(R(o)("chatFilePreview.versionOf", {
|
|
1517
1517
|
version: e.version,
|
|
1518
1518
|
count: c.value.length
|
|
1519
1519
|
})), 1),
|
|
1520
1520
|
w(l, {
|
|
1521
1521
|
modifiers: "action-quiet",
|
|
1522
1522
|
icon: "ri:arrow-right-s-line",
|
|
1523
|
-
"aria-label":
|
|
1523
|
+
"aria-label": R(o)("chatFilePreview.nextVersion"),
|
|
1524
1524
|
disabled: !d.value,
|
|
1525
1525
|
onClick: r[1] ||= (e) => d.value && i("version", d.value)
|
|
1526
1526
|
}, null, 8, ["aria-label", "disabled"])
|
|
1527
|
-
], 8,
|
|
1527
|
+
], 8, Wt)) : b("", !0), T.value ? (M(), y(t, {
|
|
1528
1528
|
key: 1,
|
|
1529
1529
|
modelValue: f.value,
|
|
1530
1530
|
"onUpdate:modelValue": r[2] ||= (e) => f.value = e,
|
|
1531
1531
|
name: "revisions",
|
|
1532
1532
|
segmented: "",
|
|
1533
1533
|
class: "pk-file-preview__modes u-segmented-fit mb-0",
|
|
1534
|
-
"aria-label":
|
|
1534
|
+
"aria-label": R(o)("chatFilePreview.modes"),
|
|
1535
1535
|
options: C.value
|
|
1536
1536
|
}, {
|
|
1537
|
-
markup:
|
|
1537
|
+
markup: H(() => [S("span", Kt, L(R(o)("chatFilePreview.modeMarkup")), 1), S("span", qt, L(R(o)("chatFilePreview.modeMarkupShort")), 1)]),
|
|
1538
1538
|
_: 1
|
|
1539
1539
|
}, 8, [
|
|
1540
1540
|
"modelValue",
|
|
1541
1541
|
"aria-label",
|
|
1542
1542
|
"options"
|
|
1543
1543
|
])) : b("", !0)])) : b("", !0),
|
|
1544
|
-
S("div",
|
|
1545
|
-
e.restorable ? (
|
|
1544
|
+
S("div", Jt, [
|
|
1545
|
+
e.restorable ? (M(), y(l, {
|
|
1546
1546
|
key: 0,
|
|
1547
1547
|
modifiers: "action-quiet",
|
|
1548
1548
|
icon: "ri:arrow-go-back-line",
|
|
1549
|
-
label:
|
|
1549
|
+
label: R(o)("chatFilePreview.restore"),
|
|
1550
1550
|
onClick: r[3] ||= (e) => i("restore")
|
|
1551
1551
|
}, null, 8, ["label"])) : b("", !0),
|
|
1552
1552
|
w(l, {
|
|
@@ -1554,41 +1554,41 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
1554
1554
|
download: "",
|
|
1555
1555
|
modifiers: "action-quiet",
|
|
1556
1556
|
icon: "ri:download-line",
|
|
1557
|
-
title:
|
|
1558
|
-
"aria-label":
|
|
1557
|
+
title: R(o)("chatFilePreview.download"),
|
|
1558
|
+
"aria-label": R(o)("chatFilePreview.download")
|
|
1559
1559
|
}, null, 8, [
|
|
1560
1560
|
"href",
|
|
1561
1561
|
"title",
|
|
1562
1562
|
"aria-label"
|
|
1563
1563
|
]),
|
|
1564
|
-
e.resize === "expand" ? (
|
|
1564
|
+
e.resize === "expand" ? (M(), y(l, {
|
|
1565
1565
|
key: 1,
|
|
1566
1566
|
modifiers: "action-quiet",
|
|
1567
1567
|
icon: "ri:fullscreen-line",
|
|
1568
|
-
title:
|
|
1569
|
-
"aria-label":
|
|
1568
|
+
title: R(o)("chatFilePreview.expand"),
|
|
1569
|
+
"aria-label": R(o)("chatFilePreview.expand"),
|
|
1570
1570
|
onClick: r[4] ||= (e) => i("resize")
|
|
1571
|
-
}, null, 8, ["title", "aria-label"])) : e.resize === "shrink" ? (
|
|
1571
|
+
}, null, 8, ["title", "aria-label"])) : e.resize === "shrink" ? (M(), y(l, {
|
|
1572
1572
|
key: 2,
|
|
1573
1573
|
modifiers: "action-quiet",
|
|
1574
1574
|
icon: "ri:fullscreen-exit-line",
|
|
1575
|
-
title:
|
|
1576
|
-
"aria-label":
|
|
1575
|
+
title: R(o)("chatFilePreview.shrink"),
|
|
1576
|
+
"aria-label": R(o)("chatFilePreview.shrink"),
|
|
1577
1577
|
onClick: r[5] ||= (e) => i("resize")
|
|
1578
1578
|
}, null, 8, ["title", "aria-label"])) : b("", !0),
|
|
1579
1579
|
w(l, {
|
|
1580
1580
|
modifiers: "action-quiet",
|
|
1581
1581
|
icon: "ri:close-line",
|
|
1582
|
-
title:
|
|
1583
|
-
"aria-label":
|
|
1582
|
+
title: R(o)("chatFilePreview.close"),
|
|
1583
|
+
"aria-label": R(o)("chatFilePreview.close"),
|
|
1584
1584
|
onClick: r[6] ||= (e) => i("close")
|
|
1585
1585
|
}, null, 8, ["title", "aria-label"])
|
|
1586
1586
|
])
|
|
1587
1587
|
]),
|
|
1588
|
-
S("div",
|
|
1588
|
+
S("div", Yt, [e.loading ? (M(), x("div", Xt, [(M(), x(_, null, F(8, (e) => S("div", {
|
|
1589
1589
|
key: e,
|
|
1590
|
-
class:
|
|
1591
|
-
}, null, 2)), 64))])) : e.error || !e.preview ? (
|
|
1590
|
+
class: O(["vv-skeleton__item pk-file-preview__skeleton-line", e % 3 ? "w-full" : "w-128"])
|
|
1591
|
+
}, null, 2)), 64))])) : e.error || !e.preview ? (M(), x("p", Zt, L(R(o)("chatFilePreview.unavailable")), 1)) : e.preview.kind === "word" ? (M(), y(Ft, {
|
|
1592
1592
|
key: 2,
|
|
1593
1593
|
zoom: m.value,
|
|
1594
1594
|
"onUpdate:zoom": r[7] ||= (e) => m.value = e,
|
|
@@ -1596,39 +1596,39 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
1596
1596
|
"onUpdate:fit": r[8] ||= (e) => h.value = e,
|
|
1597
1597
|
preview: e.preview,
|
|
1598
1598
|
mode: T.value ? f.value : "markup",
|
|
1599
|
-
onSelect:
|
|
1599
|
+
onSelect: A
|
|
1600
1600
|
}, null, 8, [
|
|
1601
1601
|
"zoom",
|
|
1602
1602
|
"fit",
|
|
1603
1603
|
"preview",
|
|
1604
1604
|
"mode"
|
|
1605
|
-
])) : (
|
|
1605
|
+
])) : (M(), y(Ke, {
|
|
1606
1606
|
key: 3,
|
|
1607
1607
|
sheet: p.value,
|
|
1608
1608
|
"onUpdate:sheet": r[9] ||= (e) => p.value = e,
|
|
1609
1609
|
zoom: m.value,
|
|
1610
1610
|
"onUpdate:zoom": r[10] ||= (e) => m.value = e,
|
|
1611
1611
|
preview: e.preview,
|
|
1612
|
-
onSelect:
|
|
1612
|
+
onSelect: A
|
|
1613
1613
|
}, null, 8, [
|
|
1614
1614
|
"sheet",
|
|
1615
1615
|
"zoom",
|
|
1616
1616
|
"preview"
|
|
1617
1617
|
]))]),
|
|
1618
|
-
e.selectionActions &&
|
|
1618
|
+
e.selectionActions && E.value && q.value ? (M(), y(Ce, {
|
|
1619
1619
|
key: 0,
|
|
1620
|
-
asking:
|
|
1621
|
-
"onUpdate:asking": r[11] ||= (e) =>
|
|
1620
|
+
asking: D.value,
|
|
1621
|
+
"onUpdate:asking": r[11] ||= (e) => D.value = e,
|
|
1622
1622
|
strategy: "absolute",
|
|
1623
1623
|
anchor: q.value,
|
|
1624
|
-
actions:
|
|
1624
|
+
actions: ce.value,
|
|
1625
1625
|
hint: ie.value,
|
|
1626
|
-
note:
|
|
1627
|
-
"note-action":
|
|
1626
|
+
note: ne.value ? void 0 : R(o)("selectionActions.notLatest", { version: e.version }),
|
|
1627
|
+
"note-action": R(o)("selectionActions.openLatest"),
|
|
1628
1628
|
onAction: fe,
|
|
1629
|
-
onAsk: r[12] ||= (e) =>
|
|
1630
|
-
onNote:
|
|
1631
|
-
onClose:
|
|
1629
|
+
onAsk: r[12] ||= (e) => G(e, "ask"),
|
|
1630
|
+
onNote: j,
|
|
1631
|
+
onClose: k
|
|
1632
1632
|
}, null, 8, [
|
|
1633
1633
|
"asking",
|
|
1634
1634
|
"anchor",
|
|
@@ -1637,10 +1637,10 @@ var G = 2e3, fe = 1e3, K = 60, q = 1400, pe = 20, me = (e) => Number(e.slice(1))
|
|
|
1637
1637
|
"note",
|
|
1638
1638
|
"note-action"
|
|
1639
1639
|
])) : b("", !0)
|
|
1640
|
-
], 8,
|
|
1640
|
+
], 8, It);
|
|
1641
1641
|
};
|
|
1642
1642
|
}
|
|
1643
|
-
}),
|
|
1644
|
-
export {
|
|
1643
|
+
}), $t = /* @__PURE__ */ e({ default: () => en }), en = Qt;
|
|
1644
|
+
export { $t as n, en as t };
|
|
1645
1645
|
|
|
1646
|
-
//# sourceMappingURL=PkFilePreview-
|
|
1646
|
+
//# sourceMappingURL=PkFilePreview-DLo9nI2g.js.map
|