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