@8wave/ai-elements 0.126.0-beta.13 → 0.126.0-beta.15
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-CW04wd9z.js → PkFilePreview-SBGa95Ca.js} +604 -600
- package/dist/_chunks/PkFilePreview-SBGa95Ca.js.map +1 -0
- package/dist/_chunks/{PkFilePreviewDialog-0vC6vbNa.js → PkFilePreviewDialog-Cc7iZWCl.js} +2 -2
- package/dist/_chunks/{PkFilePreviewDialog-0vC6vbNa.js.map → PkFilePreviewDialog-Cc7iZWCl.js.map} +1 -1
- package/dist/ai-elements.es.js +5 -5
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/_chunks/{PkChatbot-BNcXCHJv.js → PkChatbot-ewxoWtEU.js} +2 -2
- package/dist-vue/_chunks/{PkChatbot-BNcXCHJv.js.map → PkChatbot-ewxoWtEU.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-8itM8FhY.js → PkChatbotViewChat-CT5N0zvF.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewChat-8itM8FhY.js.map → PkChatbotViewChat-CT5N0zvF.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreview-DLrXC8uc.js → PkFilePreview-O8iOSD7k.js} +690 -686
- package/dist-vue/_chunks/PkFilePreview-O8iOSD7k.js.map +1 -0
- package/dist-vue/_chunks/{PkFilePreviewDialog-xcglY0iR.js → PkFilePreviewDialog-Chp8KLNP.js} +2 -2
- package/dist-vue/_chunks/{PkFilePreviewDialog-xcglY0iR.js.map → PkFilePreviewDialog-Chp8KLNP.js.map} +1 -1
- package/dist-vue/composables.js +4 -4
- package/dist-vue/index.js +4 -4
- package/dist-vue/packages/components/src/chat/spreadsheetNumbers.d.ts +25 -0
- package/package.json +1 -1
- package/dist/_chunks/PkFilePreview-CW04wd9z.js.map +0 -1
- package/dist-vue/_chunks/PkFilePreview-DLrXC8uc.js.map +0 -1
|
@@ -2,18 +2,18 @@ import { t as e } from "./rolldown-runtime-CGnMp29N.js";
|
|
|
2
2
|
import { t } from "./VvButtonLocalized-C-vx25u4.js";
|
|
3
3
|
import { t as n } from "./PkEditorRadioButtons-Bw576DPQ.js";
|
|
4
4
|
import { G as r, J as i, K as a, V as o, W as s, X as c, Y as l, Z as u, o as d, q as f, s as p } from "./utils-Bdk5kFfi.js";
|
|
5
|
-
import {
|
|
6
|
-
import { r as
|
|
7
|
-
import { VvIcon as
|
|
8
|
-
import { Fragment as
|
|
9
|
-
import { useI18n as
|
|
10
|
-
import { useElementSize as
|
|
5
|
+
import { r as m } from "./PkChatbotViewChat-CT5N0zvF.js";
|
|
6
|
+
import { i as h, n as g, r as _ } from "./excelNumberFormat-CJwdxpPX.js";
|
|
7
|
+
import { VvIcon as v } from "@volverjs/ui-vue/components";
|
|
8
|
+
import { Fragment as y, computed as b, createBlock as x, createCommentVNode as S, createElementBlock as C, createElementVNode as w, createTextVNode as T, createVNode as E, defineAsyncComponent as D, defineComponent as O, inject as k, isMemoSame as A, mergeModels as j, nextTick as ee, normalizeClass as M, normalizeStyle as N, onBeforeUnmount as te, onMounted as ne, onScopeDispose as P, openBlock as F, provide as re, ref as I, renderList as L, shallowRef as ie, toDisplayString as R, unref as z, useModel as B, useTemplateRef as ae, vModelText as V, watch as H, withCtx as U, withDirectives as oe, withKeys as W, withModifiers as se } from "vue";
|
|
9
|
+
import { useI18n as ce } from "vue-i18n";
|
|
10
|
+
import { useElementSize as le, useEventListener as ue } from "@vueuse/core";
|
|
11
11
|
// ../../packages/composable/src/useSettledSelection.ts
|
|
12
|
-
var
|
|
13
|
-
function
|
|
14
|
-
return typeof matchMedia == "function" && matchMedia(
|
|
12
|
+
var de = "(hover: hover) and (pointer: fine)", fe = "(hover: none) and (pointer: coarse)", G = 400;
|
|
13
|
+
function pe() {
|
|
14
|
+
return typeof matchMedia == "function" && matchMedia(fe).matches;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function me(e) {
|
|
17
17
|
let t = document.getSelection();
|
|
18
18
|
if (!t || t.rangeCount === 0) return;
|
|
19
19
|
if (e.nodeType === Node.DOCUMENT_NODE) return t.getRangeAt(0).cloneRange();
|
|
@@ -33,13 +33,13 @@ function ge(e) {
|
|
|
33
33
|
let r = n.getSelection?.();
|
|
34
34
|
return r && r.rangeCount > 0 ? r.getRangeAt(0).cloneRange() : void 0;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
let a =
|
|
36
|
+
function he({ root: e, enabled: t = () => !0, delay: n = 150, minChars: r = 2, touch: i = !1 }) {
|
|
37
|
+
let a = ie(), o, s = () => {
|
|
38
38
|
clearTimeout(o), a.value = void 0;
|
|
39
39
|
}, c = () => {
|
|
40
40
|
let n = e();
|
|
41
41
|
if (!n || !t()) return;
|
|
42
|
-
let i =
|
|
42
|
+
let i = me(n);
|
|
43
43
|
if (!i || i.collapsed || i.toString().trim().length < r) return;
|
|
44
44
|
let a = i.getBoundingClientRect();
|
|
45
45
|
return {
|
|
@@ -47,12 +47,12 @@ function _e({ root: e, enabled: t = () => !0, delay: n = 150, minChars: r = 2, t
|
|
|
47
47
|
start: i.getClientRects()[0] ?? a,
|
|
48
48
|
box: a
|
|
49
49
|
};
|
|
50
|
-
}, l = typeof document < "u" && typeof matchMedia == "function" && matchMedia(
|
|
50
|
+
}, l = typeof document < "u" && typeof matchMedia == "function" && matchMedia(de).matches, u = i && typeof document < "u" && pe(), d = u ? Math.max(n, G) : n, f = () => {
|
|
51
51
|
s(), o = setTimeout(() => {
|
|
52
52
|
a.value = c();
|
|
53
53
|
}, d);
|
|
54
54
|
};
|
|
55
|
-
return (l || u) && (document.addEventListener("selectionchange", f),
|
|
55
|
+
return (l || u) && (document.addEventListener("selectionchange", f), P(() => {
|
|
56
56
|
clearTimeout(o), document.removeEventListener("selectionchange", f);
|
|
57
57
|
})), {
|
|
58
58
|
selection: a,
|
|
@@ -60,7 +60,7 @@ function _e({ root: e, enabled: t = () => !0, delay: n = 150, minChars: r = 2, t
|
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
62
|
// ../../packages/components/src/chat/selectionActionIcons.ts
|
|
63
|
-
var
|
|
63
|
+
var K = {
|
|
64
64
|
sparkles: "ri:sparkling-line",
|
|
65
65
|
magic: "ri:magic-line",
|
|
66
66
|
idea: "ri:lightbulb-line",
|
|
@@ -187,27 +187,27 @@ var W = {
|
|
|
187
187
|
music: "ri:music-2-line",
|
|
188
188
|
video: "ri:video-line",
|
|
189
189
|
microphone: "ri:mic-line"
|
|
190
|
-
},
|
|
191
|
-
let t = [...new Set(e)].sort((e, t) =>
|
|
190
|
+
}, q = (e) => K[e ?? "sparkles"], ge = 2e3, _e = 1e3, ve = 60, ye = 1400, be = 20, xe = 100, Se = (e) => Number(e.slice(1)), Ce = (e) => {
|
|
191
|
+
let t = [...new Set(e)].sort((e, t) => Se(e) - Se(t)), n = [];
|
|
192
192
|
for (let e of t) {
|
|
193
193
|
let t = n[n.length - 1];
|
|
194
|
-
t &&
|
|
194
|
+
t && Se(e) === Se(t.to) + 1 ? t.to = e : n.push({
|
|
195
195
|
from: e,
|
|
196
196
|
to: e
|
|
197
197
|
});
|
|
198
198
|
}
|
|
199
199
|
return n.slice(0, 100);
|
|
200
|
-
},
|
|
200
|
+
}, we = (e, t) => {
|
|
201
201
|
let n = [];
|
|
202
202
|
if (!t) return n;
|
|
203
203
|
for (let r = e.indexOf(t); r >= 0; r = e.indexOf(t, r + 1)) n.push(r);
|
|
204
204
|
return n;
|
|
205
|
-
},
|
|
206
|
-
let r =
|
|
205
|
+
}, Te = (e, t, n) => {
|
|
206
|
+
let r = we(e, e.slice(t, t + n));
|
|
207
207
|
if (r.length < 2) return {};
|
|
208
208
|
let i = t, a = t + n;
|
|
209
|
-
for (let t = !0; a - i <=
|
|
210
|
-
if (
|
|
209
|
+
for (let t = !0; a - i <= ye; t = !t) {
|
|
210
|
+
if (we(e, e.slice(i, a)).length === 1) return { find: e.slice(i, a) };
|
|
211
211
|
if (t && i > 0) i = e.slice(0, i).replace(/\S*\s*$/, "").length;
|
|
212
212
|
else if (a < e.length) {
|
|
213
213
|
let t = e.slice(a).match(/^\s*\S*/)?.[0] ?? "";
|
|
@@ -218,23 +218,23 @@ var W = {
|
|
|
218
218
|
index: r.indexOf(t) + 1 || 1,
|
|
219
219
|
of: r.length
|
|
220
220
|
} };
|
|
221
|
-
},
|
|
221
|
+
}, Ee = (e) => (e.querySelectorAll("[data-quote-skip]").forEach((e) => e.remove()), e.querySelectorAll("[data-paragraph]").forEach((e) => e.append("\n")), e.textContent ?? ""), De = (e) => e.length > _e ? `${e.slice(0, _e / 2)} […] ${e.slice(-500)}` : e, J = (e) => {
|
|
222
222
|
let t = e.startContainer.getRootNode().getSelection?.() ?? document.getSelection();
|
|
223
223
|
try {
|
|
224
224
|
t?.setBaseAndExtent(e.startContainer, e.startOffset, e.endContainer, e.endOffset);
|
|
225
225
|
} catch {}
|
|
226
|
-
},
|
|
226
|
+
}, Y = (e, t, n) => {
|
|
227
227
|
let r = t.commonAncestorContainer;
|
|
228
228
|
if (!e.contains(r) || (r instanceof Element ? r : r.parentElement)?.closest("[data-quote-skip]")) return;
|
|
229
229
|
let i = [...e.querySelectorAll("[data-paragraph]")].filter((e) => !e.closest(n) && t.intersectsNode(e));
|
|
230
230
|
if (!i.length) return;
|
|
231
|
-
let a = i.flatMap((e) => e.dataset.paragraph.split(" ")), o =
|
|
231
|
+
let a = i.flatMap((e) => e.dataset.paragraph.split(" ")), o = Ee(t.cloneContents()), s = o.trim();
|
|
232
232
|
if (s.length < 2) return;
|
|
233
233
|
let c = {
|
|
234
234
|
format: "docx",
|
|
235
|
-
runs:
|
|
235
|
+
runs: Ce(a),
|
|
236
236
|
paragraphCount: new Set(a).size,
|
|
237
|
-
quote:
|
|
237
|
+
quote: De(s),
|
|
238
238
|
measure: () => {
|
|
239
239
|
let e = t.getBoundingClientRect(), n = t.getClientRects()[0] ?? e;
|
|
240
240
|
return {
|
|
@@ -245,22 +245,22 @@ var W = {
|
|
|
245
245
|
bottom: e.bottom
|
|
246
246
|
};
|
|
247
247
|
},
|
|
248
|
-
restore: () =>
|
|
248
|
+
restore: () => J(t)
|
|
249
249
|
};
|
|
250
250
|
if (i.length === 1) {
|
|
251
251
|
let e = i[0], n = document.createRange();
|
|
252
252
|
n.selectNodeContents(e);
|
|
253
|
-
let r =
|
|
253
|
+
let r = Ee(n.cloneContents()).replace(/\n$/, ""), a = document.createRange();
|
|
254
254
|
a.setStart(e, 0), a.setEnd(t.startContainer, t.startOffset);
|
|
255
|
-
let l =
|
|
256
|
-
c.before = r.slice(Math.max(0, l -
|
|
255
|
+
let l = Ee(a.cloneContents()).length + (o.length - o.trimStart().length);
|
|
256
|
+
c.before = r.slice(Math.max(0, l - ve), l), c.after = r.slice(l + s.length, l + s.length + ve), Object.assign(c, Te(r, l, s.length));
|
|
257
257
|
}
|
|
258
258
|
return c;
|
|
259
|
-
},
|
|
259
|
+
}, X = (e) => {
|
|
260
260
|
let t = "";
|
|
261
261
|
for (let n = e; n > 0; n = Math.floor((n - 1) / 26)) t = String.fromCharCode(65 + (n - 1) % 26) + t;
|
|
262
262
|
return t;
|
|
263
|
-
},
|
|
263
|
+
}, Oe = (e, t) => {
|
|
264
264
|
let n = { ...t }, r = e.rows.flatMap((e) => e.cells.filter((e) => e.span).map((t) => ({
|
|
265
265
|
r1: e.row,
|
|
266
266
|
r2: e.row + t.span.rows - 1,
|
|
@@ -271,7 +271,7 @@ var W = {
|
|
|
271
271
|
e = !1;
|
|
272
272
|
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);
|
|
273
273
|
}
|
|
274
|
-
let i = `${
|
|
274
|
+
let i = `${X(n.c1)}${n.r1}`, a = `${X(n.c2)}${n.r2}`, o = (e.hiddenRows ?? []).filter((e) => e >= n.r1 && e <= n.r2).slice(0, xe), s = e.columns.filter((e) => e.hidden && e.col >= n.c1 && e.col <= n.c2).map((e) => X(e.col)).slice(0, xe), 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, be).map((e) => String(e.value)).join("; ").slice(0, 500);
|
|
275
275
|
return {
|
|
276
276
|
format: "xlsx",
|
|
277
277
|
sheet: e.name,
|
|
@@ -281,12 +281,12 @@ var W = {
|
|
|
281
281
|
...s.length ? { hiddenColumns: s } : {},
|
|
282
282
|
...c ? { sample: c } : {}
|
|
283
283
|
};
|
|
284
|
-
},
|
|
284
|
+
}, Z = ["placeholder", "aria-label"], ke = ["disabled"], Ae = ["aria-label"], je = { class: "pk-selection-actions__text" }, Q = {
|
|
285
285
|
key: 0,
|
|
286
286
|
class: "pk-selection-actions__text"
|
|
287
|
-
},
|
|
287
|
+
}, Me = ["onClick", "onTouchend"], Ne = /* @__PURE__ */ O({
|
|
288
288
|
__name: "PkSelectionActions",
|
|
289
|
-
props: /*@__PURE__*/
|
|
289
|
+
props: /*@__PURE__*/ j({
|
|
290
290
|
actions: {},
|
|
291
291
|
anchor: {},
|
|
292
292
|
strategy: {},
|
|
@@ -301,7 +301,7 @@ var W = {
|
|
|
301
301
|
},
|
|
302
302
|
askingModifiers: {}
|
|
303
303
|
}),
|
|
304
|
-
emits: /*@__PURE__*/
|
|
304
|
+
emits: /*@__PURE__*/ j([
|
|
305
305
|
"action",
|
|
306
306
|
"ask",
|
|
307
307
|
"note",
|
|
@@ -316,50 +316,50 @@ var W = {
|
|
|
316
316
|
proofread: "ri:check-double-line",
|
|
317
317
|
translate: "ri:translate-2",
|
|
318
318
|
chart: "ri:bar-chart-2-line"
|
|
319
|
-
}, r = e, i = t, a =
|
|
319
|
+
}, r = e, i = t, a = B(e, "asking"), { t: s } = ce({ useScope: "global" }), c = ae("barEl"), l = ae("inputEl"), { width: u, height: d } = le(c, void 0, { box: "border-box" }), f = b(() => o({
|
|
320
320
|
...r.anchor,
|
|
321
321
|
bar: {
|
|
322
322
|
width: u.value,
|
|
323
323
|
height: d.value
|
|
324
324
|
},
|
|
325
325
|
touch: r.touch
|
|
326
|
-
})), p =
|
|
326
|
+
})), p = I(), m = I(""), h = async (e, t) => {
|
|
327
327
|
p.value = {
|
|
328
328
|
id: e,
|
|
329
329
|
placeholder: t
|
|
330
|
-
}, m.value = "", a.value = !0, await
|
|
330
|
+
}, m.value = "", a.value = !0, await ee(), l.value?.focus();
|
|
331
331
|
}, g = () => {
|
|
332
332
|
p.value = void 0, a.value = !1;
|
|
333
|
-
},
|
|
333
|
+
}, _ = () => h(void 0, s("selectionActions.askPlaceholder")), x = (e) => n[e.id] ?? q(e.icon), D = (e) => {
|
|
334
334
|
e.asks ? h(e.id, e.asks) : i("action", e.id);
|
|
335
|
-
},
|
|
335
|
+
}, O = (e, t) => {
|
|
336
336
|
let n = e.currentTarget, r = e.changedTouches[0], i = n.getRootNode(), a = r && i.elementFromPoint(r.clientX, r.clientY);
|
|
337
337
|
a && n.contains(a) && t();
|
|
338
|
-
},
|
|
338
|
+
}, k = () => {
|
|
339
339
|
let e = m.value.trim();
|
|
340
340
|
e && p.value && (p.value.id ? i("action", p.value.id, e) : i("ask", e), g());
|
|
341
|
-
},
|
|
341
|
+
}, A = (e) => {
|
|
342
342
|
e.isComposing || (e.stopPropagation(), e.preventDefault(), p.value ? g() : i("close"));
|
|
343
343
|
};
|
|
344
344
|
return (t, n) => {
|
|
345
|
-
let r =
|
|
346
|
-
return
|
|
347
|
-
class:
|
|
345
|
+
let r = v;
|
|
346
|
+
return F(), C("div", {
|
|
347
|
+
class: M(["pk-selection-actions", {
|
|
348
348
|
"pk-selection-actions--fixed": e.strategy === "fixed",
|
|
349
349
|
"pk-selection-actions--asking": !!p.value
|
|
350
350
|
}]),
|
|
351
|
-
style:
|
|
351
|
+
style: N({
|
|
352
352
|
top: `${f.value.top}px`,
|
|
353
353
|
left: `${f.value.left}px`
|
|
354
354
|
}),
|
|
355
|
-
onKeydown:
|
|
356
|
-
}, [p.value ? (
|
|
355
|
+
onKeydown: W(A, ["esc"])
|
|
356
|
+
}, [p.value ? (F(), C("form", {
|
|
357
357
|
key: 0,
|
|
358
358
|
ref_key: "barEl",
|
|
359
359
|
ref: c,
|
|
360
360
|
class: "pk-selection-actions__menu pk-selection-actions__menu--field",
|
|
361
|
-
onSubmit:
|
|
362
|
-
}, [
|
|
361
|
+
onSubmit: se(k, ["prevent"])
|
|
362
|
+
}, [oe(w("input", {
|
|
363
363
|
ref_key: "inputEl",
|
|
364
364
|
ref: l,
|
|
365
365
|
"onUpdate:modelValue": n[0] ||= (e) => m.value = e,
|
|
@@ -368,70 +368,70 @@ var W = {
|
|
|
368
368
|
maxlength: "500",
|
|
369
369
|
placeholder: p.value.placeholder,
|
|
370
370
|
"aria-label": p.value.placeholder
|
|
371
|
-
}, null, 8,
|
|
371
|
+
}, null, 8, Z), [[V, m.value]]), w("button", {
|
|
372
372
|
type: "submit",
|
|
373
373
|
class: "pk-selection-actions__button pk-selection-actions__button--send",
|
|
374
374
|
disabled: !m.value.trim()
|
|
375
|
-
},
|
|
375
|
+
}, R(z(s)("action.send")), 9, ke)], 544)) : (F(), C("div", {
|
|
376
376
|
key: 1,
|
|
377
377
|
ref_key: "barEl",
|
|
378
378
|
ref: c,
|
|
379
379
|
class: "pk-selection-actions__menu",
|
|
380
380
|
role: "toolbar",
|
|
381
381
|
"aria-orientation": "vertical",
|
|
382
|
-
"aria-label":
|
|
383
|
-
onTouchstart: n[7] ||=
|
|
384
|
-
}, [e.note ? (
|
|
382
|
+
"aria-label": z(s)("selectionActions.label"),
|
|
383
|
+
onTouchstart: n[7] ||= se(() => {}, ["prevent"])
|
|
384
|
+
}, [e.note ? (F(), C(y, { key: 0 }, [w("p", je, R(e.note), 1), e.noteAction ? (F(), C("button", {
|
|
385
385
|
key: 0,
|
|
386
386
|
type: "button",
|
|
387
387
|
class: "pk-selection-actions__button",
|
|
388
|
-
onMousedown: n[1] ||=
|
|
388
|
+
onMousedown: n[1] ||= se(() => {}, ["prevent"]),
|
|
389
389
|
onClick: n[2] ||= (e) => i("note"),
|
|
390
|
-
onTouchend: n[3] ||= (e) =>
|
|
391
|
-
}, [
|
|
390
|
+
onTouchend: n[3] ||= (e) => O(e, () => i("note"))
|
|
391
|
+
}, [E(r, {
|
|
392
392
|
name: "ri:arrow-right-line",
|
|
393
393
|
class: "pk-selection-actions__icon"
|
|
394
|
-
}),
|
|
395
|
-
e.hint ? (
|
|
396
|
-
(
|
|
394
|
+
}), T(" " + R(e.noteAction), 1)], 32)) : S("", !0)], 64)) : (F(), C(y, { key: 1 }, [
|
|
395
|
+
e.hint ? (F(), C("p", Q, R(e.hint), 1)) : S("", !0),
|
|
396
|
+
(F(!0), C(y, null, L(e.actions, (e) => (F(), C("button", {
|
|
397
397
|
key: e.id,
|
|
398
398
|
type: "button",
|
|
399
399
|
class: "pk-selection-actions__button",
|
|
400
|
-
onMousedown: n[4] ||=
|
|
401
|
-
onClick: (t) =>
|
|
402
|
-
onTouchend: (t) =>
|
|
403
|
-
}, [
|
|
404
|
-
name:
|
|
400
|
+
onMousedown: n[4] ||= se(() => {}, ["prevent"]),
|
|
401
|
+
onClick: (t) => D(e),
|
|
402
|
+
onTouchend: (t) => O(t, () => D(e))
|
|
403
|
+
}, [E(r, {
|
|
404
|
+
name: x(e),
|
|
405
405
|
class: "pk-selection-actions__icon"
|
|
406
|
-
}, null, 8, ["name"]),
|
|
407
|
-
n[8] ||=
|
|
408
|
-
|
|
406
|
+
}, null, 8, ["name"]), T(" " + R(e.label), 1)], 40, Me))), 128)),
|
|
407
|
+
n[8] ||= w("hr", { class: "pk-selection-actions__rule" }, null, -1),
|
|
408
|
+
w("button", {
|
|
409
409
|
type: "button",
|
|
410
410
|
class: "pk-selection-actions__button",
|
|
411
|
-
onMousedown: n[5] ||=
|
|
412
|
-
onClick:
|
|
413
|
-
onTouchend: n[6] ||= (e) =>
|
|
414
|
-
}, [
|
|
411
|
+
onMousedown: n[5] ||= se(() => {}, ["prevent"]),
|
|
412
|
+
onClick: _,
|
|
413
|
+
onTouchend: n[6] ||= (e) => O(e, _)
|
|
414
|
+
}, [E(r, {
|
|
415
415
|
name: "ri:chat-1-line",
|
|
416
416
|
class: "pk-selection-actions__icon"
|
|
417
|
-
}),
|
|
418
|
-
], 64))], 40,
|
|
417
|
+
}), T(" " + R(z(s)("selectionActions.ask")), 1)], 32)
|
|
418
|
+
], 64))], 40, Ae))], 38);
|
|
419
419
|
};
|
|
420
420
|
}
|
|
421
|
-
}),
|
|
421
|
+
}), Pe = {
|
|
422
422
|
class: "pk-file-chart",
|
|
423
423
|
"data-quote-skip": ""
|
|
424
|
-
},
|
|
424
|
+
}, Fe = {
|
|
425
425
|
key: 1,
|
|
426
426
|
class: "pk-file-chart__placeholder"
|
|
427
|
-
}, Ie = { class: "pk-file-chart__title" }, Le = /* @__PURE__ */
|
|
427
|
+
}, Ie = { class: "pk-file-chart__title" }, Le = /* @__PURE__ */ O({
|
|
428
428
|
__name: "PkFileChart",
|
|
429
429
|
props: { preview: {} },
|
|
430
430
|
setup(e) {
|
|
431
|
-
let t =
|
|
431
|
+
let t = D(() => import("./PkChart-CmrpyYAS.js")), { t: n } = ce({ useScope: "global" });
|
|
432
432
|
return (r, i) => {
|
|
433
|
-
let a =
|
|
434
|
-
return
|
|
433
|
+
let a = v;
|
|
434
|
+
return F(), C("div", Pe, [e.preview.chart ? (F(), x(z(t), {
|
|
435
435
|
key: 0,
|
|
436
436
|
chart: e.preview.chart,
|
|
437
437
|
colors: e.preview.colors,
|
|
@@ -441,17 +441,51 @@ var W = {
|
|
|
441
441
|
"chart",
|
|
442
442
|
"colors",
|
|
443
443
|
"legend"
|
|
444
|
-
])) : (
|
|
445
|
-
|
|
444
|
+
])) : (F(), C("div", Fe, [
|
|
445
|
+
E(a, {
|
|
446
446
|
name: "ri:bar-chart-2-line",
|
|
447
447
|
class: "text-16"
|
|
448
448
|
}),
|
|
449
|
-
|
|
450
|
-
|
|
449
|
+
w("span", Ie, R(e.preview.title || z(n)("chatFilePreview.chart")), 1),
|
|
450
|
+
w("span", null, R(z(n)("chatFilePreview.chartNotDrawn")), 1)
|
|
451
451
|
]))]);
|
|
452
452
|
};
|
|
453
453
|
}
|
|
454
|
-
}), Re =
|
|
454
|
+
}), Re = (e, t, n, r) => {
|
|
455
|
+
let i = e.numFmt === void 0 ? void 0 : n.numberFormats?.[e.numFmt];
|
|
456
|
+
if (i !== void 0) try {
|
|
457
|
+
return e.format === "date" || h(i) ? g(i, t, r, n.date1904) : _(i, t, r);
|
|
458
|
+
} catch {
|
|
459
|
+
return;
|
|
460
|
+
}
|
|
461
|
+
}, ze = (e, t, n) => {
|
|
462
|
+
let r = e.format === "date" ? e.serial : e.value;
|
|
463
|
+
return typeof r == "number" ? Re(e, r, t, n) : void 0;
|
|
464
|
+
}, Be = (e, t, n, r) => {
|
|
465
|
+
let i = Re(e, t, n, r);
|
|
466
|
+
if (i) return i.text;
|
|
467
|
+
let a = e.decimals === void 0 ? { maximumFractionDigits: 10 } : {
|
|
468
|
+
minimumFractionDigits: e.decimals,
|
|
469
|
+
maximumFractionDigits: e.maxDecimals ?? e.decimals
|
|
470
|
+
};
|
|
471
|
+
return new Intl.NumberFormat(r, {
|
|
472
|
+
...a,
|
|
473
|
+
useGrouping: e.grouped === !0,
|
|
474
|
+
...e.format === "percent" ? { style: "percent" } : {},
|
|
475
|
+
...e.format === "currency" && e.currency ? {
|
|
476
|
+
style: "currency",
|
|
477
|
+
currency: e.currency
|
|
478
|
+
} : {}
|
|
479
|
+
}).format(t);
|
|
480
|
+
}, Ve = (e, t, n) => {
|
|
481
|
+
let r = 0, i = 0, a = 0, o;
|
|
482
|
+
for (let t of e) t && (t.value !== void 0 || t.missing) && (r++, typeof t.value == "number" && (i += t.value, a++, o ??= t));
|
|
483
|
+
if (r) return {
|
|
484
|
+
count: r,
|
|
485
|
+
sum: o ? Be(o, i, t, n) : void 0,
|
|
486
|
+
average: o ? Be(o, i / a, t, n) : void 0
|
|
487
|
+
};
|
|
488
|
+
}, He = { class: "pk-spreadsheet-preview" }, Ue = { class: "pk-spreadsheet-preview__bar" }, We = ["aria-label"], Ge = ["aria-label"], Ke = ["aria-label"], qe = [
|
|
455
489
|
"rowspan",
|
|
456
490
|
"colspan",
|
|
457
491
|
"data-focus",
|
|
@@ -459,21 +493,21 @@ var W = {
|
|
|
459
493
|
"title",
|
|
460
494
|
"onMousedown",
|
|
461
495
|
"onMouseenter"
|
|
462
|
-
],
|
|
496
|
+
], Je = {
|
|
463
497
|
key: 1,
|
|
464
498
|
class: "pk-spreadsheet-preview__charts"
|
|
465
|
-
},
|
|
499
|
+
}, Ye = {
|
|
466
500
|
key: 2,
|
|
467
501
|
class: "pk-spreadsheet-preview__more"
|
|
468
|
-
},
|
|
502
|
+
}, Xe = ["aria-label"], Ze = ["aria-current", "onClick"], Qe = { class: "pk-spreadsheet-preview__status" }, $e = { class: "pk-spreadsheet-preview__info" }, et = ["title"], tt = ["title"], nt = {
|
|
469
503
|
key: 2,
|
|
470
504
|
class: "pk-spreadsheet-preview__stats"
|
|
471
|
-
},
|
|
505
|
+
}, rt = {
|
|
472
506
|
key: 0,
|
|
473
507
|
class: "pk-spreadsheet-preview__average"
|
|
474
|
-
},
|
|
508
|
+
}, it = { key: 1 }, at = { class: "pk-spreadsheet-preview__zoom" }, ot = { class: "pk-spreadsheet-preview__percent" }, st = 64, ct = 20, lt = 28, ut = 44, dt = 400, ft = 10, $ = /* @__PURE__ */ O({
|
|
475
509
|
__name: "PkSpreadsheetPreview",
|
|
476
|
-
props: /*@__PURE__*/
|
|
510
|
+
props: /*@__PURE__*/ j({
|
|
477
511
|
preview: {},
|
|
478
512
|
marked: {}
|
|
479
513
|
}, {
|
|
@@ -482,72 +516,72 @@ var W = {
|
|
|
482
516
|
zoom: { default: 1 },
|
|
483
517
|
zoomModifiers: {}
|
|
484
518
|
}),
|
|
485
|
-
emits: /*@__PURE__*/
|
|
519
|
+
emits: /*@__PURE__*/ j(["select"], ["update:sheet", "update:zoom"]),
|
|
486
520
|
setup(e, { emit: n }) {
|
|
487
|
-
let r = e, i = n, { t: a, locale: o } =
|
|
521
|
+
let r = e, i = n, { t: a, locale: o } = ce({ useScope: "global" }), s = B(e, "sheet"), c = B(e, "zoom"), l = ae("scrollEl"), { width: u, height: d } = le(l, {
|
|
488
522
|
width: 0,
|
|
489
523
|
height: 0
|
|
490
|
-
}, { box: "border-box" }), f =
|
|
491
|
-
|
|
524
|
+
}, { box: "border-box" }), f = b(() => r.preview.sheets[s.value] ?? r.preview.sheets[0]);
|
|
525
|
+
H(() => r.preview, () => {
|
|
492
526
|
s.value = 0;
|
|
493
527
|
});
|
|
494
|
-
let p =
|
|
528
|
+
let p = b(() => r.marked?.get(f.value?.name ?? "")), h = b(() => {
|
|
495
529
|
let e = /* @__PURE__ */ new Map();
|
|
496
530
|
for (let t of p.value ?? []) {
|
|
497
531
|
let [n, r] = t.split(":"), i = e.get(Number(n));
|
|
498
532
|
e.set(Number(n), i ? `${i},${r}` : r);
|
|
499
533
|
}
|
|
500
534
|
return e;
|
|
501
|
-
}),
|
|
502
|
-
|
|
535
|
+
}), g = (e, t) => !!p.value?.has(`${e}:${t}`);
|
|
536
|
+
H(() => r.marked, (e) => {
|
|
503
537
|
if (!e || p.value) return;
|
|
504
538
|
let t = r.preview.sheets.findIndex((t) => e.has(t.name));
|
|
505
539
|
t >= 0 && (s.value = t);
|
|
506
540
|
}, { immediate: !0 });
|
|
507
|
-
let
|
|
508
|
-
|
|
509
|
-
let
|
|
541
|
+
let _ = () => m(l.value, ".pk-spreadsheet-preview__cell--marked");
|
|
542
|
+
H(p, _, { flush: "post" }), ne(_);
|
|
543
|
+
let v = (e) => {
|
|
510
544
|
let t = "";
|
|
511
545
|
for (let n = e; n > 0; n = Math.floor((n - 1) / 26)) t = String.fromCharCode(65 + (n - 1) % 26) + t;
|
|
512
546
|
return t;
|
|
513
|
-
},
|
|
547
|
+
}, x = b(() => (f.value?.charts ?? []).reduce((e, t) => ({
|
|
514
548
|
col: Math.max(e.col, t.lastCol),
|
|
515
549
|
row: Math.max(e.row, t.lastRow)
|
|
516
550
|
}), {
|
|
517
551
|
col: 0,
|
|
518
552
|
row: 0
|
|
519
|
-
})),
|
|
553
|
+
})), D = b(() => {
|
|
520
554
|
let e = f.value;
|
|
521
555
|
if (!e) return [];
|
|
522
|
-
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 =
|
|
523
|
-
for (let o = 1; o <= e.lastColumn || o <=
|
|
556
|
+
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 = ut, a = u.value / c.value;
|
|
557
|
+
for (let o = 1; o <= e.lastColumn || o <= x.value.col || !e.moreColumns && (o <= e.lastColumn + 2 || i < a); o++) {
|
|
524
558
|
if (t.has(o)) continue;
|
|
525
|
-
let e = n.get(o) ??
|
|
559
|
+
let e = n.get(o) ?? st;
|
|
526
560
|
r.push({
|
|
527
561
|
col: o,
|
|
528
562
|
width: e
|
|
529
563
|
}), i += e;
|
|
530
564
|
}
|
|
531
565
|
return r;
|
|
532
|
-
}),
|
|
566
|
+
}), O = b(() => D.value.reduce((e, t) => e + t.width, ut)), k = b(() => D.value.map((e) => `${e.col}:${e.width}`).join(",")), j = /* @__PURE__ */ new WeakMap(), P = b(() => {
|
|
533
567
|
let e = f.value;
|
|
534
568
|
if (!e) return [];
|
|
535
|
-
let t = new Set(e.hiddenRows ?? []), n = new Map(e.rows.map((e) => [e.row, e.height])), r = Math.ceil((d.value / c.value -
|
|
536
|
-
a || (a = /* @__PURE__ */ new Map(),
|
|
569
|
+
let t = new Set(e.hiddenRows ?? []), n = new Map(e.rows.map((e) => [e.row, e.height])), r = Math.ceil((d.value / c.value - lt) / ct), i = e.moreRows ? e.lastRow : Math.max(e.lastRow + 5, r + t.size, x.value.row), a = j.get(e);
|
|
570
|
+
a || (a = /* @__PURE__ */ new Map(), j.set(e, a));
|
|
537
571
|
let o = a;
|
|
538
572
|
return Array.from({ length: i }, (e, t) => t + 1).filter((e) => !t.has(e)).map((e) => {
|
|
539
573
|
let t = o.get(e);
|
|
540
574
|
return t || (t = {
|
|
541
575
|
row: e,
|
|
542
|
-
height: n.get(e) ??
|
|
576
|
+
height: n.get(e) ?? ct
|
|
543
577
|
}, o.set(e, t)), t;
|
|
544
578
|
});
|
|
545
|
-
}),
|
|
579
|
+
}), re = b(() => {
|
|
546
580
|
let e = f.value?.charts ?? [];
|
|
547
581
|
if (!e.length) return [];
|
|
548
582
|
let t = c.value;
|
|
549
583
|
return e.map((e, n) => {
|
|
550
|
-
let r =
|
|
584
|
+
let r = D.value.reduce((t, n) => n.col < e.col ? t + n.width : t, ut + e.x), i = P.value.reduce((t, n) => n.row < e.row ? t + n.height : t, lt + e.y);
|
|
551
585
|
return {
|
|
552
586
|
key: `${f.value?.name}:${n}`,
|
|
553
587
|
chart: e,
|
|
@@ -559,58 +593,35 @@ var W = {
|
|
|
559
593
|
}
|
|
560
594
|
};
|
|
561
595
|
});
|
|
562
|
-
}),
|
|
596
|
+
}), ie = b(() => {
|
|
563
597
|
let e = /* @__PURE__ */ new Map();
|
|
564
598
|
for (let t of f.value?.rows ?? []) for (let n of t.cells) e.set(`${t.row},${n.col}`, n);
|
|
565
599
|
return e;
|
|
566
|
-
}),
|
|
600
|
+
}), V = b(() => {
|
|
567
601
|
let e = /* @__PURE__ */ new Map();
|
|
568
602
|
for (let t of f.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}`, {
|
|
569
603
|
row: t.row,
|
|
570
604
|
col: n.col
|
|
571
605
|
});
|
|
572
606
|
return e;
|
|
573
|
-
}),
|
|
574
|
-
let n =
|
|
607
|
+
}), U = (e, t) => ie.value.get(`${e},${t}`), oe = (e, t) => {
|
|
608
|
+
let n = U(e, t)?.span;
|
|
575
609
|
if (n) return {
|
|
576
|
-
rows:
|
|
577
|
-
cols:
|
|
578
|
-
};
|
|
579
|
-
}, H = (e) => e?.style === void 0 ? void 0 : r.preview.styles[e.style], U = (e) => {
|
|
580
|
-
let t = e.numFmt === void 0 ? void 0 : r.preview.numberFormats?.[e.numFmt], n = e.value;
|
|
581
|
-
if (t !== void 0) try {
|
|
582
|
-
return e.format === "date" ? e.serial === void 0 ? void 0 : h(t, e.serial, o.value, r.preview.date1904) : typeof n == "number" ? m(t) ? h(t, n, o.value, r.preview.date1904) : g(t, n, o.value) : void 0;
|
|
583
|
-
} catch {
|
|
584
|
-
return;
|
|
585
|
-
}
|
|
586
|
-
}, he = (e, t) => {
|
|
587
|
-
let n = U(e);
|
|
588
|
-
if (n) return n.text;
|
|
589
|
-
let r = e.decimals === void 0 ? { maximumFractionDigits: 10 } : {
|
|
590
|
-
minimumFractionDigits: e.decimals,
|
|
591
|
-
maximumFractionDigits: e.maxDecimals ?? e.decimals
|
|
610
|
+
rows: P.value.filter((t) => t.row >= e && t.row < e + n.rows).length,
|
|
611
|
+
cols: D.value.filter((e) => e.col >= t && e.col < t + n.cols).length
|
|
592
612
|
};
|
|
593
|
-
|
|
594
|
-
...r,
|
|
595
|
-
useGrouping: e.grouped === !0,
|
|
596
|
-
...e.format === "percent" ? { style: "percent" } : {},
|
|
597
|
-
...e.format === "currency" && e.currency ? {
|
|
598
|
-
style: "currency",
|
|
599
|
-
currency: e.currency
|
|
600
|
-
} : {}
|
|
601
|
-
}).format(t);
|
|
602
|
-
}, ge = (e) => {
|
|
613
|
+
}, W = (e) => e?.style === void 0 ? void 0 : r.preview.styles[e.style], ue = (e) => ze(e, r.preview, o.value), de = (e) => {
|
|
603
614
|
let t = /* @__PURE__ */ new Date(`${e}T00:00:00Z`);
|
|
604
615
|
return Number.isNaN(t.getTime()) ? e : new Intl.DateTimeFormat(o.value, {
|
|
605
616
|
dateStyle: "short",
|
|
606
617
|
timeZone: "UTC"
|
|
607
618
|
}).format(t);
|
|
608
|
-
},
|
|
619
|
+
}, fe = (e) => {
|
|
609
620
|
if (!e) return "";
|
|
610
621
|
if (e.missing) return "—";
|
|
611
622
|
let t = e.value;
|
|
612
|
-
return t === void 0 ? "" : typeof t == "boolean" ? a(t ? "chatFilePreview.true" : "chatFilePreview.false") : e.format === "date" && typeof t == "string" ?
|
|
613
|
-
},
|
|
623
|
+
return t === void 0 ? "" : typeof t == "boolean" ? a(t ? "chatFilePreview.true" : "chatFilePreview.false") : e.format === "date" && typeof t == "string" ? ue(e)?.text ?? de(t) : typeof t == "number" ? Be(e, t, r.preview, o.value) : t;
|
|
624
|
+
}, G = (e) => {
|
|
614
625
|
if (!e) return "";
|
|
615
626
|
if (e.formula) return `=${e.formula}`;
|
|
616
627
|
let t = e.value;
|
|
@@ -618,9 +629,9 @@ var W = {
|
|
|
618
629
|
useGrouping: !1,
|
|
619
630
|
maximumFractionDigits: 15,
|
|
620
631
|
...e.format === "percent" ? { style: "percent" } : {}
|
|
621
|
-
}).format(t) :
|
|
622
|
-
},
|
|
623
|
-
let r =
|
|
632
|
+
}).format(t) : fe(e);
|
|
633
|
+
}, pe = (e) => e ? `${e.width}px solid ${e.color}` : void 0, me = (e, t, n) => {
|
|
634
|
+
let r = W(e), i = e?.value, a = typeof i == "number" || e?.format === "date" || !!e?.missing, o = {
|
|
624
635
|
textAlign: r?.align ?? (a ? "right" : typeof i == "boolean" || e?.format === "error" ? "center" : "left"),
|
|
625
636
|
verticalAlign: r?.valign === "top" ? "top" : r?.valign === "middle" ? "middle" : "bottom",
|
|
626
637
|
whiteSpace: r?.wrap ? "pre-wrap" : "nowrap"
|
|
@@ -628,14 +639,14 @@ var W = {
|
|
|
628
639
|
r?.bold && (o.fontWeight = 700), r?.italic && (o.fontStyle = "italic");
|
|
629
640
|
let s = [r?.underline ? "underline" : "", r?.strike ? "line-through" : ""].filter(Boolean).join(" ");
|
|
630
641
|
s && (o.textDecoration = s), r?.size && (o.fontSize = `${r.size}pt`);
|
|
631
|
-
let c = e ?
|
|
642
|
+
let c = e ? ue(e)?.color : void 0;
|
|
632
643
|
if ((c ?? r?.color) && (o.color = c ?? r?.color), r?.fill && (o.backgroundColor = r.fill), r?.indent) {
|
|
633
644
|
let e = `${4 + r.indent * 9}px`;
|
|
634
645
|
o.textAlign === "right" ? o.paddingRight = e : o.paddingLeft = e;
|
|
635
646
|
}
|
|
636
|
-
let l =
|
|
637
|
-
return
|
|
638
|
-
},
|
|
647
|
+
let l = je(t, n);
|
|
648
|
+
return he(t, n) ? (o.borderStyle = "hidden", o.boxShadow = [...l, Ce(e, t, n)].filter(Boolean).join(", ")) : (o.borderTop = pe(r?.borders?.top), o.borderRight = pe(r?.borders?.right), o.borderBottom = pe(r?.borders?.bottom), o.borderLeft = pe(r?.borders?.left), o.boxShadow = [...l, ...ge(e, t, n)].join(", ")), Object.assign(o, De(t, n)), o;
|
|
649
|
+
}, he = (e, t) => {
|
|
639
650
|
let n = f.value?.frozen;
|
|
640
651
|
return !!n && (e <= n.rows || t <= n.cols);
|
|
641
652
|
}, K = {
|
|
@@ -643,18 +654,18 @@ var W = {
|
|
|
643
654
|
right: (e) => `inset -${e.width}px 0 0 ${e.color}`,
|
|
644
655
|
bottom: (e) => `inset 0 -${e.width}px 0 ${e.color}`,
|
|
645
656
|
left: (e) => `inset ${e.width}px 0 0 ${e.color}`
|
|
646
|
-
},
|
|
647
|
-
let r =
|
|
648
|
-
return [t ===
|
|
649
|
-
},
|
|
657
|
+
}, q = (...e) => e.reduce((e, t) => t && (!e || t.width > e.width) ? t : e, void 0), ge = (e, t, n) => {
|
|
658
|
+
let r = W(e)?.borders;
|
|
659
|
+
return [t === P.value[0]?.row && r?.top && K.top(r.top), n === D.value[0]?.col && r?.left && K.left(r.left)].filter((e) => !!e);
|
|
660
|
+
}, _e = b(() => P.value.map((e) => e.row)), ve = b(() => D.value.map((e) => e.col)), ye = b(() => new Map(_e.value.map((e, t) => [e, t]))), be = b(() => new Map(ve.value.map((e, t) => [e, t]))), xe = (e, t, n, r) => {
|
|
650
661
|
let i = [], a = t.get(n) ?? e.length;
|
|
651
662
|
for (; a < e.length && e[a] < n + r; a++) i.push(e[a]);
|
|
652
663
|
return {
|
|
653
664
|
spanned: i,
|
|
654
665
|
next: e[a]
|
|
655
666
|
};
|
|
656
|
-
},
|
|
657
|
-
let { spanned: i, next: a } =
|
|
667
|
+
}, Se = (e, t, n, r) => {
|
|
668
|
+
let { spanned: i, next: a } = xe(_e.value, ye.value, t, e?.span?.rows ?? 1), { spanned: o, next: s } = xe(ve.value, be.value, n, e?.span?.cols ?? 1);
|
|
658
669
|
return (r === "right" ? s === void 0 ? [] : i.map((e) => ({
|
|
659
670
|
row: e,
|
|
660
671
|
col: s
|
|
@@ -662,72 +673,72 @@ var W = {
|
|
|
662
673
|
row: a,
|
|
663
674
|
col: e
|
|
664
675
|
}))).map((e) => {
|
|
665
|
-
let t =
|
|
666
|
-
return
|
|
676
|
+
let t = V.value.get(`${e.row},${e.col}`) ?? e;
|
|
677
|
+
return U(t.row, t.col);
|
|
667
678
|
});
|
|
668
|
-
},
|
|
669
|
-
let r =
|
|
679
|
+
}, Ce = (e, t, n) => {
|
|
680
|
+
let r = W(e)?.borders, i = q(r?.right, ...Se(e, t, n, "right").map((e) => W(e)?.borders?.left)), a = q(r?.bottom, ...Se(e, t, n, "bottom").map((e) => W(e)?.borders?.top)), o = f.value?.gridlines;
|
|
670
681
|
return [
|
|
671
682
|
i ? K.right(i) : o && "inset calc(var(--border) * -1) 0 0 var(--pk-spreadsheet-gridline)",
|
|
672
683
|
a ? K.bottom(a) : o && "inset 0 calc(var(--border) * -1) 0 var(--pk-spreadsheet-gridline)",
|
|
673
|
-
...
|
|
684
|
+
...ge(e, t, n)
|
|
674
685
|
].filter(Boolean).join(", ");
|
|
675
|
-
},
|
|
686
|
+
}, we = (e) => lt + P.value.filter((t) => t.row < e).reduce((e, t) => e + t.height, 0), Te = (e) => ut + D.value.filter((t) => t.col < e).reduce((e, t) => e + t.width, 0), Ee = b(() => {
|
|
676
687
|
let e = f.value?.frozen;
|
|
677
688
|
return {
|
|
678
|
-
top:
|
|
679
|
-
left:
|
|
689
|
+
top: we((e?.rows ?? 0) + 1),
|
|
690
|
+
left: Te((e?.cols ?? 0) + 1)
|
|
680
691
|
};
|
|
681
|
-
}),
|
|
692
|
+
}), De = (e, t) => {
|
|
682
693
|
let n = f.value?.frozen;
|
|
683
694
|
if (!n) return {};
|
|
684
695
|
let r = {};
|
|
685
|
-
return e <= n.rows && (r.position = "sticky", r.top = `${
|
|
686
|
-
},
|
|
696
|
+
return e <= n.rows && (r.position = "sticky", r.top = `${we(e)}px`, r.scrollMarginTop = r.top, r.zIndex = 0), t <= n.cols && (r.position = "sticky", r.left = `${Te(t)}px`, r.scrollMarginLeft = r.left, r.zIndex = +(e <= n.rows)), r;
|
|
697
|
+
}, J = I({
|
|
687
698
|
row: 1,
|
|
688
699
|
col: 1
|
|
689
|
-
}),
|
|
700
|
+
}), Y = I({
|
|
690
701
|
row: 1,
|
|
691
702
|
col: 1
|
|
692
703
|
});
|
|
693
|
-
|
|
694
|
-
|
|
704
|
+
H(f, () => {
|
|
705
|
+
J.value = {
|
|
695
706
|
row: 1,
|
|
696
707
|
col: 1
|
|
697
|
-
},
|
|
708
|
+
}, Y.value = {
|
|
698
709
|
row: 1,
|
|
699
710
|
col: 1
|
|
700
711
|
};
|
|
701
712
|
});
|
|
702
|
-
let
|
|
703
|
-
r1: Math.min(
|
|
704
|
-
r2: Math.max(
|
|
705
|
-
c1: Math.min(
|
|
706
|
-
c2: Math.max(
|
|
707
|
-
})),
|
|
708
|
-
let { r1: n, r2: r, c1: i, c2: a } =
|
|
709
|
-
if (n === r && i === a || !
|
|
710
|
-
let o =
|
|
713
|
+
let X = b(() => ({
|
|
714
|
+
r1: Math.min(J.value.row, Y.value.row),
|
|
715
|
+
r2: Math.max(J.value.row, Y.value.row),
|
|
716
|
+
c1: Math.min(J.value.col, Y.value.col),
|
|
717
|
+
c2: Math.max(J.value.col, Y.value.col)
|
|
718
|
+
})), Z = (e, t) => e >= X.value.r1 && e <= X.value.r2 && t >= X.value.c1 && t <= X.value.c2, ke = (e, t) => Y.value.row === e && Y.value.col === t, Ae = (e) => e >= X.value.r1 && e <= X.value.r2 ? `${X.value.c1}:${X.value.c2}:${Y.value.row === e ? Y.value.col : 0}:${e === X.value.r1 ? "t" : ""}${e === X.value.r2 ? "b" : ""}` : "", je = (e, t) => {
|
|
719
|
+
let { r1: n, r2: r, c1: i, c2: a } = X.value;
|
|
720
|
+
if (n === r && i === a || !Z(e, t)) return [];
|
|
721
|
+
let o = U(e, t)?.span, s = e + (o?.rows ?? 1) - 1, c = t + (o?.cols ?? 1) - 1, l = "var(--spacing-2)", u = "var(--pk-spreadsheet-green)";
|
|
711
722
|
return [
|
|
712
723
|
e === n && `inset 0 ${l} 0 ${u}`,
|
|
713
724
|
s >= r && `inset 0 calc(${l} * -1) 0 ${u}`,
|
|
714
725
|
t === i && `inset ${l} 0 0 ${u}`,
|
|
715
726
|
c >= a && `inset calc(${l} * -1) 0 0 ${u}`
|
|
716
727
|
].filter((e) => !!e);
|
|
717
|
-
}, Q =
|
|
718
|
-
l.value?.focus({ preventScroll: !0 }),
|
|
728
|
+
}, Q = I(!1), Me = (e, t, n) => {
|
|
729
|
+
l.value?.focus({ preventScroll: !0 }), Y.value = {
|
|
719
730
|
row: e,
|
|
720
731
|
col: t
|
|
721
|
-
}, n.shiftKey || (
|
|
732
|
+
}, n.shiftKey || (J.value = {
|
|
722
733
|
row: e,
|
|
723
734
|
col: t
|
|
724
735
|
}), Q.value = !0;
|
|
725
|
-
},
|
|
726
|
-
Q.value && (
|
|
736
|
+
}, Ne = (e, t) => {
|
|
737
|
+
Q.value && (Y.value = {
|
|
727
738
|
row: e,
|
|
728
739
|
col: t
|
|
729
740
|
});
|
|
730
|
-
},
|
|
741
|
+
}, Pe, Fe = () => {
|
|
731
742
|
let e = [...l.value?.querySelectorAll(".pk-spreadsheet-preview__cell--range, [data-focus]") ?? []].map((e) => e.getBoundingClientRect());
|
|
732
743
|
if (e.length) return {
|
|
733
744
|
start: {
|
|
@@ -736,80 +747,80 @@ var W = {
|
|
|
736
747
|
},
|
|
737
748
|
bottom: Math.max(...e.map((e) => e.bottom))
|
|
738
749
|
};
|
|
739
|
-
},
|
|
740
|
-
...
|
|
741
|
-
measure:
|
|
750
|
+
}, Ie = () => f.value ? {
|
|
751
|
+
...Oe(f.value, X.value),
|
|
752
|
+
measure: Fe
|
|
742
753
|
} : void 0;
|
|
743
|
-
|
|
744
|
-
clearTimeout(
|
|
745
|
-
let e =
|
|
746
|
-
i("select", t ?
|
|
754
|
+
H([X, Q], () => {
|
|
755
|
+
clearTimeout(Pe), Q.value || (Pe = setTimeout(() => {
|
|
756
|
+
let e = X.value, t = e.r2 > e.r1 || e.c2 > e.c1;
|
|
757
|
+
i("select", t ? Ie() : void 0);
|
|
747
758
|
}, 150));
|
|
748
759
|
});
|
|
749
|
-
let
|
|
750
|
-
clearTimeout(
|
|
751
|
-
}, $,
|
|
752
|
-
|
|
753
|
-
|
|
760
|
+
let Re = () => {
|
|
761
|
+
clearTimeout(Pe), i("select", Ie());
|
|
762
|
+
}, $, pt;
|
|
763
|
+
H(f, () => {
|
|
764
|
+
pt = void 0;
|
|
754
765
|
});
|
|
755
|
-
let
|
|
766
|
+
let mt = (e) => {
|
|
756
767
|
let [t, n] = ((e?.closest?.("[data-cell]"))?.dataset.cell ?? "").split(":").map(Number);
|
|
757
768
|
return t && n ? {
|
|
758
769
|
row: t,
|
|
759
770
|
col: n
|
|
760
771
|
} : void 0;
|
|
761
|
-
},
|
|
772
|
+
}, ht = () => {
|
|
762
773
|
clearTimeout($?.timer), $?.active && (Q.value = !1), $ = void 0;
|
|
763
774
|
};
|
|
764
|
-
|
|
765
|
-
|
|
775
|
+
te(() => {
|
|
776
|
+
ht(), clearTimeout(Pe);
|
|
766
777
|
});
|
|
767
|
-
let
|
|
768
|
-
|
|
769
|
-
let t = e.touches[0], n = e.touches.length === 1 ?
|
|
778
|
+
let gt = () => void ee(Re), _t = (e) => {
|
|
779
|
+
ht();
|
|
780
|
+
let t = e.touches[0], n = e.touches.length === 1 ? mt(e.target) : void 0;
|
|
770
781
|
t && n && ($ = {
|
|
771
782
|
...n,
|
|
772
783
|
x: t.clientX,
|
|
773
784
|
y: t.clientY,
|
|
774
785
|
active: !1,
|
|
775
786
|
timer: setTimeout(() => {
|
|
776
|
-
$ && ($.active = !0, l.value?.focus({ preventScroll: !0 }),
|
|
787
|
+
$ && ($.active = !0, l.value?.focus({ preventScroll: !0 }), J.value = {
|
|
777
788
|
row: $.row,
|
|
778
789
|
col: $.col
|
|
779
|
-
},
|
|
790
|
+
}, Y.value = {
|
|
780
791
|
row: $.row,
|
|
781
792
|
col: $.col
|
|
782
793
|
}, Q.value = !0);
|
|
783
|
-
},
|
|
794
|
+
}, dt)
|
|
784
795
|
});
|
|
785
|
-
},
|
|
796
|
+
}, vt = (e) => {
|
|
786
797
|
let t = e.touches[0];
|
|
787
798
|
if (!$ || !t) return;
|
|
788
799
|
if (!$.active) {
|
|
789
|
-
(!e.cancelable || Math.hypot(t.clientX - $.x, t.clientY - $.y) >
|
|
800
|
+
(!e.cancelable || Math.hypot(t.clientX - $.x, t.clientY - $.y) > ft) && ht();
|
|
790
801
|
return;
|
|
791
802
|
}
|
|
792
803
|
e.preventDefault();
|
|
793
|
-
let n = l.value?.getRootNode(), r =
|
|
794
|
-
r && (
|
|
795
|
-
},
|
|
804
|
+
let n = l.value?.getRootNode(), r = mt(n?.elementFromPoint(t.clientX, t.clientY) ?? null);
|
|
805
|
+
r && (Y.value = r);
|
|
806
|
+
}, yt = (e) => {
|
|
796
807
|
if (!$) return;
|
|
797
808
|
let { row: t, col: n, active: r } = $;
|
|
798
|
-
|
|
799
|
-
let i =
|
|
809
|
+
ht(), e.preventDefault();
|
|
810
|
+
let i = X.value, a = i.r1 === i.r2 && i.c1 === i.c2;
|
|
800
811
|
if (r) {
|
|
801
|
-
a &&
|
|
812
|
+
a && gt();
|
|
802
813
|
return;
|
|
803
814
|
}
|
|
804
|
-
let o = a &&
|
|
805
|
-
|
|
815
|
+
let o = a && ke(t, n) && pt === `${t}:${n}`;
|
|
816
|
+
pt = `${t}:${n}`, l.value?.focus({ preventScroll: !0 }), J.value = {
|
|
806
817
|
row: t,
|
|
807
818
|
col: n
|
|
808
|
-
},
|
|
819
|
+
}, Y.value = {
|
|
809
820
|
row: t,
|
|
810
821
|
col: n
|
|
811
|
-
}, o &&
|
|
812
|
-
},
|
|
822
|
+
}, o && gt();
|
|
823
|
+
}, bt = (e) => {
|
|
813
824
|
let t = {
|
|
814
825
|
ArrowUp: [-1, 0],
|
|
815
826
|
ArrowDown: [1, 0],
|
|
@@ -820,7 +831,7 @@ var W = {
|
|
|
820
831
|
}[e.key];
|
|
821
832
|
if (!t) return;
|
|
822
833
|
e.preventDefault();
|
|
823
|
-
let n =
|
|
834
|
+
let n = P.value.map((e) => e.row), r = D.value.map((e) => e.col), i = (e) => V.value.get(`${e.row},${e.col}`) ?? e, a = i(Y.value), o = n.indexOf(Y.value.row), s = r.indexOf(Y.value.col), c = a;
|
|
824
835
|
for (;;) {
|
|
825
836
|
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]));
|
|
826
837
|
if (e === o && l === s || (o = e, s = l, c = i({
|
|
@@ -828,176 +839,169 @@ var W = {
|
|
|
828
839
|
col: r[s]
|
|
829
840
|
}), c.row !== a.row || c.col !== a.col)) break;
|
|
830
841
|
}
|
|
831
|
-
|
|
842
|
+
Y.value = c, e.shiftKey || (J.value = c), ee(() => l.value?.querySelector("[data-focus]")?.scrollIntoView({
|
|
832
843
|
block: "nearest",
|
|
833
844
|
inline: "nearest"
|
|
834
845
|
}));
|
|
835
|
-
},
|
|
836
|
-
let { r1: e, r2: t, c1: n, c2:
|
|
837
|
-
if (e === t && n ===
|
|
838
|
-
let
|
|
839
|
-
for (let
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
}
|
|
843
|
-
if (i) return {
|
|
844
|
-
count: i,
|
|
845
|
-
sum: s ? he(s, a) : void 0,
|
|
846
|
-
average: s ? he(s, a / o) : void 0
|
|
847
|
-
};
|
|
848
|
-
}), wt = (e) => {
|
|
846
|
+
}, xt = b(() => U(Y.value.row, Y.value.col)), St = b(() => {
|
|
847
|
+
let { r1: e, r2: t, c1: n, c2: i } = X.value;
|
|
848
|
+
if (e === t && n === i) return;
|
|
849
|
+
let a = [];
|
|
850
|
+
for (let r = e; r <= t; r++) for (let e = n; e <= i; e++) a.push(U(r, e));
|
|
851
|
+
return Ve(a, r.preview, o.value);
|
|
852
|
+
}), Ct = (e) => {
|
|
849
853
|
c.value = Math.min(2, Math.max(.5, Math.round((c.value + e) * 10) / 10));
|
|
850
854
|
};
|
|
851
855
|
return (n, r) => {
|
|
852
856
|
let i = t;
|
|
853
|
-
return
|
|
854
|
-
|
|
855
|
-
|
|
857
|
+
return F(), C("div", He, [
|
|
858
|
+
w("div", Ue, [
|
|
859
|
+
w("span", {
|
|
856
860
|
class: "pk-spreadsheet-preview__ref",
|
|
857
|
-
"aria-label":
|
|
858
|
-
},
|
|
859
|
-
r[6] ||=
|
|
861
|
+
"aria-label": z(a)("chatFilePreview.cell")
|
|
862
|
+
}, R(v(Y.value.col)) + R(Y.value.row), 9, We),
|
|
863
|
+
r[6] ||= w("span", {
|
|
860
864
|
class: "pk-spreadsheet-preview__fx",
|
|
861
865
|
"aria-hidden": "true"
|
|
862
866
|
}, "fx", -1),
|
|
863
|
-
|
|
867
|
+
w("output", {
|
|
864
868
|
class: "pk-spreadsheet-preview__formula",
|
|
865
|
-
"aria-label":
|
|
866
|
-
},
|
|
869
|
+
"aria-label": z(a)("chatFilePreview.formulaBar")
|
|
870
|
+
}, R(G(xt.value)), 9, Ge)
|
|
867
871
|
]),
|
|
868
|
-
|
|
872
|
+
w("div", {
|
|
869
873
|
ref_key: "scrollEl",
|
|
870
874
|
ref: l,
|
|
871
875
|
class: "pk-spreadsheet-preview__scroll",
|
|
872
876
|
tabindex: "0",
|
|
873
877
|
role: "grid",
|
|
874
878
|
"aria-label": f.value?.name,
|
|
875
|
-
onKeydown:
|
|
879
|
+
onKeydown: bt,
|
|
876
880
|
onMouseup: r[2] ||= (e) => Q.value = !1,
|
|
877
881
|
onMouseleave: r[3] ||= (e) => Q.value = !1,
|
|
878
|
-
onTouchstart:
|
|
879
|
-
onTouchmove:
|
|
880
|
-
onTouchend:
|
|
881
|
-
onTouchcancel:
|
|
882
|
+
onTouchstart: _t,
|
|
883
|
+
onTouchmove: vt,
|
|
884
|
+
onTouchend: yt,
|
|
885
|
+
onTouchcancel: ht
|
|
882
886
|
}, [
|
|
883
|
-
f.value ? (
|
|
887
|
+
f.value ? (F(), C("table", {
|
|
884
888
|
key: 0,
|
|
885
|
-
class:
|
|
886
|
-
style:
|
|
889
|
+
class: M(["pk-spreadsheet-preview__grid", { "pk-spreadsheet-preview__grid--lines": f.value.gridlines }]),
|
|
890
|
+
style: N({
|
|
887
891
|
zoom: c.value,
|
|
888
|
-
width: `${
|
|
889
|
-
"--pk-spreadsheet-stuck-top": `${
|
|
890
|
-
"--pk-spreadsheet-stuck-left": `${
|
|
892
|
+
width: `${O.value}px`,
|
|
893
|
+
"--pk-spreadsheet-stuck-top": `${Ee.value.top}px`,
|
|
894
|
+
"--pk-spreadsheet-stuck-left": `${Ee.value.left}px`
|
|
891
895
|
})
|
|
892
896
|
}, [
|
|
893
|
-
|
|
897
|
+
w("colgroup", null, [w("col", { style: N({ width: `${ut}px` }) }, null, 4), (F(!0), C(y, null, L(D.value, (e) => (F(), C("col", {
|
|
894
898
|
key: e.col,
|
|
895
|
-
style:
|
|
899
|
+
style: N({ width: `${e.width}px` })
|
|
896
900
|
}, null, 4))), 128))]),
|
|
897
|
-
|
|
901
|
+
w("thead", null, [w("tr", { style: N({ height: `${lt}px` }) }, [r[7] ||= w("th", { class: "pk-spreadsheet-preview__corner" }, null, -1), (F(!0), C(y, null, L(D.value, (e) => (F(), C("th", {
|
|
898
902
|
key: e.col,
|
|
899
903
|
scope: "col",
|
|
900
|
-
class:
|
|
901
|
-
style:
|
|
902
|
-
left: `${
|
|
904
|
+
class: M(["pk-spreadsheet-preview__head", { "pk-spreadsheet-preview__head--current": e.col >= X.value.c1 && e.col <= X.value.c2 }]),
|
|
905
|
+
style: N(f.value.frozen && e.col <= f.value.frozen.cols ? {
|
|
906
|
+
left: `${Te(e.col)}px`,
|
|
903
907
|
zIndex: 2
|
|
904
908
|
} : void 0)
|
|
905
|
-
},
|
|
906
|
-
|
|
909
|
+
}, R(v(e.col)), 7))), 128))], 4)]),
|
|
910
|
+
w("tbody", null, [(F(!0), C(y, null, L(P.value, (e, t, n, r) => {
|
|
907
911
|
let i = [
|
|
908
912
|
e,
|
|
909
913
|
f.value,
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
+
k.value,
|
|
915
|
+
z(o),
|
|
916
|
+
Ae(e.row),
|
|
917
|
+
h.value.get(e.row)
|
|
914
918
|
];
|
|
915
|
-
if (r && r.el && r.key === e.row &&
|
|
916
|
-
let s = (
|
|
919
|
+
if (r && r.el && r.key === e.row && A(r, i)) return r;
|
|
920
|
+
let s = (F(), C("tr", {
|
|
917
921
|
key: e.row,
|
|
918
|
-
style:
|
|
919
|
-
}, [
|
|
922
|
+
style: N({ height: `${e.height}px` })
|
|
923
|
+
}, [w("th", {
|
|
920
924
|
scope: "row",
|
|
921
|
-
class:
|
|
922
|
-
style:
|
|
923
|
-
...
|
|
925
|
+
class: M(["pk-spreadsheet-preview__row", { "pk-spreadsheet-preview__row--current": e.row >= X.value.r1 && e.row <= X.value.r2 }]),
|
|
926
|
+
style: N(f.value.frozen && e.row <= f.value.frozen.rows ? {
|
|
927
|
+
...De(e.row, 0),
|
|
924
928
|
left: 0,
|
|
925
929
|
zIndex: 4
|
|
926
930
|
} : void 0)
|
|
927
|
-
},
|
|
931
|
+
}, R(e.row), 7), (F(!0), C(y, null, L(D.value, (t) => (F(), C(y, { key: t.col }, [V.value.has(`${e.row},${t.col}`) ? S("", !0) : (F(), C("td", {
|
|
928
932
|
key: 0,
|
|
929
|
-
rowspan:
|
|
930
|
-
colspan:
|
|
931
|
-
class:
|
|
932
|
-
"pk-spreadsheet-preview__cell--range":
|
|
933
|
-
"pk-spreadsheet-preview__cell--missing":
|
|
934
|
-
"pk-spreadsheet-preview__cell--marked":
|
|
933
|
+
rowspan: oe(e.row, t.col)?.rows,
|
|
934
|
+
colspan: oe(e.row, t.col)?.cols,
|
|
935
|
+
class: M(["pk-spreadsheet-preview__cell", {
|
|
936
|
+
"pk-spreadsheet-preview__cell--range": Z(e.row, t.col) && !ke(e.row, t.col),
|
|
937
|
+
"pk-spreadsheet-preview__cell--missing": U(e.row, t.col)?.missing,
|
|
938
|
+
"pk-spreadsheet-preview__cell--marked": g(e.row, t.col)
|
|
935
939
|
}]),
|
|
936
|
-
style:
|
|
937
|
-
"data-focus":
|
|
940
|
+
style: N(me(U(e.row, t.col), e.row, t.col)),
|
|
941
|
+
"data-focus": ke(e.row, t.col) ? "" : void 0,
|
|
938
942
|
"data-cell": `${e.row}:${t.col}`,
|
|
939
|
-
title:
|
|
940
|
-
onMousedown:
|
|
941
|
-
onMouseenter: (n) =>
|
|
942
|
-
onDblclick:
|
|
943
|
-
},
|
|
943
|
+
title: U(e.row, t.col)?.missing ? z(a)("chatFilePreview.missingValue") : void 0,
|
|
944
|
+
onMousedown: se((n) => Me(e.row, t.col, n), ["prevent"]),
|
|
945
|
+
onMouseenter: (n) => Ne(e.row, t.col),
|
|
946
|
+
onDblclick: Re
|
|
947
|
+
}, R(fe(U(e.row, t.col))), 47, qe))], 64))), 128))], 4));
|
|
944
948
|
return s.memo = i, s;
|
|
945
949
|
}, r, 0), 128))])
|
|
946
|
-
], 6)) :
|
|
947
|
-
|
|
950
|
+
], 6)) : S("", !0),
|
|
951
|
+
re.value.length ? (F(), C("div", Je, [(F(!0), C(y, null, L(re.value, (e) => (F(), C("div", {
|
|
948
952
|
key: e.key,
|
|
949
953
|
class: "pk-spreadsheet-preview__chart",
|
|
950
|
-
style:
|
|
951
|
-
}, [
|
|
952
|
-
f.value && (f.value.moreRows || f.value.moreColumns) ? (
|
|
953
|
-
], 40,
|
|
954
|
-
|
|
954
|
+
style: N(e.css)
|
|
955
|
+
}, [E(Le, { preview: e.chart }, null, 8, ["preview"])], 4))), 128))])) : S("", !0),
|
|
956
|
+
f.value && (f.value.moreRows || f.value.moreColumns) ? (F(), C("p", Ye, [f.value.moreRows ? (F(), C(y, { key: 0 }, [T(R(z(a)("chatFilePreview.moreRows", f.value.moreRows)), 1)], 64)) : S("", !0), f.value.moreColumns ? (F(), C(y, { key: 1 }, [T(R(z(a)("chatFilePreview.moreColumns", f.value.moreColumns)), 1)], 64)) : S("", !0)])) : S("", !0)
|
|
957
|
+
], 40, Ke),
|
|
958
|
+
w("nav", {
|
|
955
959
|
class: "pk-spreadsheet-preview__sheets",
|
|
956
|
-
"aria-label":
|
|
957
|
-
}, [(
|
|
960
|
+
"aria-label": z(a)("chatFilePreview.sheets")
|
|
961
|
+
}, [(F(!0), C(y, null, L(e.preview.sheets, (e, t) => (F(), C("button", {
|
|
958
962
|
key: e.name,
|
|
959
963
|
type: "button",
|
|
960
964
|
class: "pk-spreadsheet-preview__sheet",
|
|
961
965
|
"aria-current": t === s.value ? "page" : void 0,
|
|
962
966
|
onClick: (e) => s.value = t
|
|
963
|
-
},
|
|
964
|
-
|
|
967
|
+
}, R(e.name), 9, Ze))), 128))], 8, Xe),
|
|
968
|
+
w("div", Qe, [w("p", $e, [e.preview.staleFormulas ? (F(), C("span", {
|
|
965
969
|
key: 0,
|
|
966
970
|
class: "pk-spreadsheet-preview__note",
|
|
967
|
-
title:
|
|
968
|
-
},
|
|
971
|
+
title: z(a)("chatFilePreview.staleFormulas")
|
|
972
|
+
}, R(z(a)("chatFilePreview.staleFormulas")), 9, et)) : e.preview.computedFormulas ? (F(), C("span", {
|
|
969
973
|
key: 1,
|
|
970
974
|
class: "pk-spreadsheet-preview__note",
|
|
971
|
-
title:
|
|
972
|
-
},
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
])) :
|
|
977
|
-
|
|
975
|
+
title: z(a)("chatFilePreview.computedFormulas")
|
|
976
|
+
}, R(z(a)("chatFilePreview.computedFormulas")), 9, tt)) : S("", !0), St.value ? (F(), C("span", nt, [
|
|
977
|
+
St.value.average ? (F(), C("span", rt, R(z(a)("chatFilePreview.average")) + " " + R(St.value.average), 1)) : S("", !0),
|
|
978
|
+
w("span", null, R(z(a)("chatFilePreview.count")) + " " + R(St.value.count), 1),
|
|
979
|
+
St.value.sum ? (F(), C("span", it, R(z(a)("chatFilePreview.sum")) + " " + R(St.value.sum), 1)) : S("", !0)
|
|
980
|
+
])) : S("", !0)]), w("div", at, [
|
|
981
|
+
E(i, {
|
|
978
982
|
modifiers: "action-quiet",
|
|
979
983
|
icon: "ri:subtract-line",
|
|
980
|
-
"aria-label":
|
|
984
|
+
"aria-label": z(a)("chatFilePreview.zoomOut"),
|
|
981
985
|
disabled: c.value <= .5,
|
|
982
|
-
onClick: r[4] ||= (e) =>
|
|
986
|
+
onClick: r[4] ||= (e) => Ct(-.1)
|
|
983
987
|
}, null, 8, ["aria-label", "disabled"]),
|
|
984
|
-
|
|
985
|
-
|
|
988
|
+
w("span", ot, R(Math.round(c.value * 100)) + "% ", 1),
|
|
989
|
+
E(i, {
|
|
986
990
|
modifiers: "action-quiet",
|
|
987
991
|
icon: "ri:add-line",
|
|
988
|
-
"aria-label":
|
|
992
|
+
"aria-label": z(a)("chatFilePreview.zoomIn"),
|
|
989
993
|
disabled: c.value >= 2,
|
|
990
|
-
onClick: r[5] ||= (e) =>
|
|
994
|
+
onClick: r[5] ||= (e) => Ct(.1)
|
|
991
995
|
}, null, 8, ["aria-label", "disabled"])
|
|
992
996
|
])])
|
|
993
997
|
]);
|
|
994
998
|
};
|
|
995
999
|
}
|
|
996
|
-
}),
|
|
1000
|
+
}), pt = ["src"], mt = {
|
|
997
1001
|
key: 2,
|
|
998
1002
|
class: "pk-word-preview__image",
|
|
999
1003
|
"data-quote-skip": ""
|
|
1000
|
-
},
|
|
1004
|
+
}, ht = ["title"], gt = ["title"], _t = ["data-quote-skip"], vt = /* @__PURE__ */ O({
|
|
1001
1005
|
__name: "PkWordPreviewRuns",
|
|
1002
1006
|
props: {
|
|
1003
1007
|
runs: {},
|
|
@@ -1006,7 +1010,7 @@ var W = {
|
|
|
1006
1010
|
numbers: {}
|
|
1007
1011
|
},
|
|
1008
1012
|
setup(e) {
|
|
1009
|
-
let t = e, { t: n } =
|
|
1013
|
+
let t = e, { t: n } = ce({ useScope: "global" }), i = k(p, void 0), o = k(d, void 0), s = (e) => e.picture ? u(i?.value, e.picture.ref) : void 0, l = (e) => e.chart ? o?.value?.[e.chart.ref] : void 0, f = (e) => t.page ? c(e) : "inline", m = (e) => f(e) === "page" ? {
|
|
1010
1014
|
...e,
|
|
1011
1015
|
anchor: void 0
|
|
1012
1016
|
} : e, h = (e) => {
|
|
@@ -1036,56 +1040,56 @@ var W = {
|
|
|
1036
1040
|
top: `${r.y}pt`,
|
|
1037
1041
|
zIndex: r.wrap === "behind" ? -1 : 1
|
|
1038
1042
|
};
|
|
1039
|
-
}, g = (e) => e.field && t.numbers ? String(t.numbers[e.field]) : e.text,
|
|
1043
|
+
}, g = (e) => e.field && t.numbers ? String(t.numbers[e.field]) : e.text, _ = b(() => {
|
|
1040
1044
|
let e = a(t.runs, t.mode ?? "markup"), n = (e) => {
|
|
1041
1045
|
let n = e.picture ?? (e.chart && m(e.chart));
|
|
1042
1046
|
return !!n && !!t.page && ["around", "block"].includes(c(n));
|
|
1043
1047
|
};
|
|
1044
1048
|
return [...e.filter(n), ...e.filter((e) => !n(e))];
|
|
1045
|
-
}),
|
|
1049
|
+
}), v = b(() => !t.mode || t.mode === "markup"), x = (e) => {
|
|
1046
1050
|
let t = {};
|
|
1047
1051
|
e.font && (t.fontFamily = r(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");
|
|
1048
1052
|
let n = [e.underline ? "underline" : "", e.strike ? "line-through" : ""].filter(Boolean).join(" ");
|
|
1049
1053
|
return n && (t.textDecoration = n), e.caps && (t.textTransform = "uppercase"), e.vertAlign && (t.verticalAlign = e.vertAlign, t.fontSize = `${(e.size ?? 11) * .65}pt`), t;
|
|
1050
|
-
},
|
|
1051
|
-
let t =
|
|
1054
|
+
}, w = (e) => {
|
|
1055
|
+
let t = x(e), n = new Set(String(t.textDecoration ?? "").split(" ").filter(Boolean));
|
|
1052
1056
|
return n.add(e.change === "deleted" ? "line-through" : "underline"), {
|
|
1053
1057
|
...t,
|
|
1054
1058
|
textDecoration: [...n].join(" ")
|
|
1055
1059
|
};
|
|
1056
|
-
},
|
|
1057
|
-
return (e, t) => (
|
|
1060
|
+
}, T = (e) => e.author ? n("chatFilePreview.revisionBy", { author: e.author }) : void 0;
|
|
1061
|
+
return (e, t) => (F(!0), C(y, null, L(_.value, (e, t) => (F(), C(y, { key: t }, [e.image ? (F(), C(y, { key: 0 }, [e.chart && l(e) ? (F(), C("span", {
|
|
1058
1062
|
key: 0,
|
|
1059
|
-
class:
|
|
1060
|
-
style:
|
|
1061
|
-
}, [
|
|
1063
|
+
class: M(["pk-word-preview__chart", `pk-word-preview__chart--${f(m(e.chart))}`]),
|
|
1064
|
+
style: N(h(m(e.chart)))
|
|
1065
|
+
}, [E(Le, { preview: l(e) }, null, 8, ["preview"])], 6)) : e.picture && s(e) ? (F(), C(y, { key: 1 }, [f(e.picture) === "page" ? S("", !0) : (F(), C("img", {
|
|
1062
1066
|
key: 0,
|
|
1063
|
-
class:
|
|
1064
|
-
style:
|
|
1067
|
+
class: M(["pk-word-preview__picture", `pk-word-preview__picture--${f(e.picture)}`]),
|
|
1068
|
+
style: N(h(e.picture)),
|
|
1065
1069
|
src: s(e),
|
|
1066
1070
|
alt: ""
|
|
1067
|
-
}, null, 14,
|
|
1071
|
+
}, null, 14, pt))], 64)) : (F(), C("span", mt, R(z(n)("chatFilePreview.image")), 1))], 64)) : v.value && e.change === "deleted" ? (F(), C("del", {
|
|
1068
1072
|
key: 1,
|
|
1069
1073
|
class: "pk-word-preview__removed",
|
|
1070
1074
|
"data-quote-skip": "",
|
|
1071
|
-
style:
|
|
1072
|
-
title:
|
|
1073
|
-
},
|
|
1075
|
+
style: N(w(e)),
|
|
1076
|
+
title: T(e)
|
|
1077
|
+
}, R(g(e)), 13, ht)) : v.value && e.change === "inserted" ? (F(), C("ins", {
|
|
1074
1078
|
key: 2,
|
|
1075
1079
|
class: "pk-word-preview__added",
|
|
1076
|
-
style:
|
|
1077
|
-
title:
|
|
1078
|
-
},
|
|
1080
|
+
style: N(w(e)),
|
|
1081
|
+
title: T(e)
|
|
1082
|
+
}, R(g(e)), 13, gt)) : (F(), C("span", {
|
|
1079
1083
|
key: 3,
|
|
1080
|
-
style:
|
|
1084
|
+
style: N(x(e)),
|
|
1081
1085
|
"data-quote-skip": e.label ? "" : void 0
|
|
1082
|
-
},
|
|
1086
|
+
}, R(g(e)), 13, _t))], 64))), 128));
|
|
1083
1087
|
}
|
|
1084
|
-
}),
|
|
1088
|
+
}), yt = { key: 0 }, bt = ["data-paragraph", "colspan"], xt = [
|
|
1085
1089
|
"data-paragraph",
|
|
1086
1090
|
"role",
|
|
1087
1091
|
"aria-level"
|
|
1088
|
-
],
|
|
1092
|
+
], St = { key: 1 }, Ct = /* @__PURE__ */ O({
|
|
1089
1093
|
__name: "PkWordPreviewBlock",
|
|
1090
1094
|
props: {
|
|
1091
1095
|
block: {},
|
|
@@ -1096,7 +1100,7 @@ var W = {
|
|
|
1096
1100
|
marked: {}
|
|
1097
1101
|
},
|
|
1098
1102
|
setup(e) {
|
|
1099
|
-
let t = e, n =
|
|
1103
|
+
let t = e, n = b(() => {
|
|
1100
1104
|
if (t.block.kind === "table") return {};
|
|
1101
1105
|
let e = t.block.style ?? {};
|
|
1102
1106
|
return {
|
|
@@ -1110,36 +1114,36 @@ var W = {
|
|
|
1110
1114
|
backgroundColor: e.shading,
|
|
1111
1115
|
fontSize: e.size ? `${e.size}pt` : void 0
|
|
1112
1116
|
};
|
|
1113
|
-
}), r =
|
|
1117
|
+
}), r = b(() => {
|
|
1114
1118
|
if (t.block.kind === "table") return {};
|
|
1115
1119
|
let e = -(t.block.style?.firstLine ?? 0);
|
|
1116
1120
|
return e > 0 ? { minWidth: `calc(${e}pt * var(--pk-word-indent-scale, 1))` } : { paddingRight: "6pt" };
|
|
1117
|
-
}), i =
|
|
1121
|
+
}), i = b(() => t.mode === "markup" && t.block.kind !== "table" && t.block.runs.some((e) => e.change)), a = b(() => t.block.kind === "table" && t.row !== void 0 ? t.block.rows[t.row] : void 0), o = b(() => {
|
|
1118
1122
|
if (t.block.kind !== "table") return [];
|
|
1119
1123
|
let e = t.block.widths ?? [], n = e.reduce((e, t) => e + t, 0);
|
|
1120
1124
|
return n ? e.map((e) => `${e / n * 100}%`) : [];
|
|
1121
|
-
}), s =
|
|
1122
|
-
return (t, u) => e.block.kind === "table" && a.value ? (
|
|
1125
|
+
}), s = b(() => t.block.kind !== "table" && !!t.block.id && !!t.marked?.has(t.block.id)), c = (e) => !!e?.some((e) => t.marked?.has(e)), l = b(() => t.mode === "markup" && !!a.value?.some((e) => e.runs.some((e) => e.change)));
|
|
1126
|
+
return (t, u) => e.block.kind === "table" && a.value ? (F(), C("table", {
|
|
1123
1127
|
key: 0,
|
|
1124
|
-
class:
|
|
1128
|
+
class: M(["pk-word-preview__table", {
|
|
1125
1129
|
"pk-word-preview__table--lines": e.block.borders,
|
|
1126
1130
|
"pk-word-preview__table--next": e.row !== 0,
|
|
1127
1131
|
"pk-word-preview__changed": l.value
|
|
1128
1132
|
}])
|
|
1129
|
-
}, [o.value.length ? (
|
|
1133
|
+
}, [o.value.length ? (F(), C("colgroup", yt, [(F(!0), C(y, null, L(o.value, (e, t) => (F(), C("col", {
|
|
1130
1134
|
key: t,
|
|
1131
|
-
style:
|
|
1132
|
-
}, null, 4))), 128))])) :
|
|
1135
|
+
style: N({ width: e })
|
|
1136
|
+
}, null, 4))), 128))])) : S("", !0), w("tbody", null, [w("tr", null, [(F(!0), C(y, null, L(a.value, (t, n) => (F(), C("td", {
|
|
1133
1137
|
key: n,
|
|
1134
1138
|
"data-paragraph": t.ids?.join(" "),
|
|
1135
|
-
class:
|
|
1139
|
+
class: M({ "pk-word-preview__marked": c(t.ids) }),
|
|
1136
1140
|
colspan: t.span,
|
|
1137
|
-
style:
|
|
1141
|
+
style: N({
|
|
1138
1142
|
backgroundColor: t.fill,
|
|
1139
1143
|
textAlign: t.align,
|
|
1140
1144
|
fontSize: t.size ? `${t.size}pt` : void 0
|
|
1141
1145
|
})
|
|
1142
|
-
}, [
|
|
1146
|
+
}, [E(vt, {
|
|
1143
1147
|
runs: t.runs,
|
|
1144
1148
|
mode: e.mode,
|
|
1145
1149
|
numbers: e.numbers
|
|
@@ -1147,24 +1151,24 @@ var W = {
|
|
|
1147
1151
|
"runs",
|
|
1148
1152
|
"mode",
|
|
1149
1153
|
"numbers"
|
|
1150
|
-
])], 14,
|
|
1154
|
+
])], 14, bt))), 128))])])], 2)) : e.block.kind === "table" ? S("", !0) : (F(), C("div", {
|
|
1151
1155
|
key: 1,
|
|
1152
|
-
class:
|
|
1156
|
+
class: M(["pk-word-preview__block", {
|
|
1153
1157
|
"pk-word-preview__changed": i.value,
|
|
1154
1158
|
"pk-word-preview__marked": s.value
|
|
1155
1159
|
}]),
|
|
1156
1160
|
"data-paragraph": e.block.id,
|
|
1157
1161
|
role: e.block.kind === "heading" ? "heading" : void 0,
|
|
1158
1162
|
"aria-level": e.block.kind === "heading" ? Math.max(1, e.block.level) : void 0,
|
|
1159
|
-
style:
|
|
1163
|
+
style: N(n.value)
|
|
1160
1164
|
}, [
|
|
1161
|
-
e.block.label ? (
|
|
1165
|
+
e.block.label ? (F(), C("span", {
|
|
1162
1166
|
key: 0,
|
|
1163
1167
|
class: "pk-word-preview__label",
|
|
1164
1168
|
"data-quote-skip": "",
|
|
1165
|
-
style:
|
|
1166
|
-
},
|
|
1167
|
-
|
|
1169
|
+
style: N(r.value)
|
|
1170
|
+
}, R(e.block.label), 5)) : S("", !0),
|
|
1171
|
+
E(vt, {
|
|
1168
1172
|
runs: e.block.runs,
|
|
1169
1173
|
mode: e.mode,
|
|
1170
1174
|
page: e.page,
|
|
@@ -1175,10 +1179,10 @@ var W = {
|
|
|
1175
1179
|
"page",
|
|
1176
1180
|
"numbers"
|
|
1177
1181
|
]),
|
|
1178
|
-
!e.block.label && !e.block.runs.length ? (
|
|
1179
|
-
], 14,
|
|
1182
|
+
!e.block.label && !e.block.runs.length ? (F(), C("br", St)) : S("", !0)
|
|
1183
|
+
], 14, xt));
|
|
1180
1184
|
}
|
|
1181
|
-
}),
|
|
1185
|
+
}), wt = { class: "pk-word-preview__part" }, Tt = ["src"], Et = /* @__PURE__ */ O({
|
|
1182
1186
|
__name: "PkWordPreviewPart",
|
|
1183
1187
|
props: {
|
|
1184
1188
|
blocks: {},
|
|
@@ -1188,13 +1192,13 @@ var W = {
|
|
|
1188
1192
|
numbers: {}
|
|
1189
1193
|
},
|
|
1190
1194
|
setup(e) {
|
|
1191
|
-
let t = e, n =
|
|
1195
|
+
let t = e, n = k(p, void 0), r = b(() => s(t.blocks, t.mode)), a = b(() => l(t.blocks, t.mode).flatMap((e) => {
|
|
1192
1196
|
let r = u(n?.value, e.ref);
|
|
1193
1197
|
return r ? [{
|
|
1194
1198
|
src: r,
|
|
1195
1199
|
css: i(e, t.section.page)
|
|
1196
1200
|
}] : [];
|
|
1197
|
-
})), o =
|
|
1201
|
+
})), o = b(() => {
|
|
1198
1202
|
let { margins: e } = t.section.page;
|
|
1199
1203
|
return {
|
|
1200
1204
|
left: `${e.left}pt`,
|
|
@@ -1202,10 +1206,10 @@ var W = {
|
|
|
1202
1206
|
...t.where === "header" ? { top: `${t.section.headerDistance}pt` } : { bottom: `${t.section.footerDistance}pt` }
|
|
1203
1207
|
};
|
|
1204
1208
|
});
|
|
1205
|
-
return (t, n) => (
|
|
1209
|
+
return (t, n) => (F(), C("div", wt, [w("div", {
|
|
1206
1210
|
class: "pk-word-preview__part-flow",
|
|
1207
|
-
style:
|
|
1208
|
-
}, [(
|
|
1211
|
+
style: N(o.value)
|
|
1212
|
+
}, [(F(!0), C(y, null, L(r.value, (t) => (F(), x(Ct, {
|
|
1209
1213
|
key: t.key,
|
|
1210
1214
|
block: e.blocks[t.block],
|
|
1211
1215
|
row: t.row,
|
|
@@ -1218,47 +1222,47 @@ var W = {
|
|
|
1218
1222
|
"mode",
|
|
1219
1223
|
"page",
|
|
1220
1224
|
"numbers"
|
|
1221
|
-
]))), 128))], 4), (
|
|
1225
|
+
]))), 128))], 4), (F(!0), C(y, null, L(a.value, (e, t) => (F(), C("img", {
|
|
1222
1226
|
key: t,
|
|
1223
1227
|
class: "pk-word-preview__float",
|
|
1224
|
-
style:
|
|
1228
|
+
style: N(e.css),
|
|
1225
1229
|
src: e.src,
|
|
1226
1230
|
alt: ""
|
|
1227
|
-
}, null, 12,
|
|
1231
|
+
}, null, 12, Tt))), 128))]));
|
|
1228
1232
|
}
|
|
1229
|
-
}),
|
|
1233
|
+
}), Dt = ["aria-label"], Ot = {
|
|
1230
1234
|
class: "pk-word-preview__tabs",
|
|
1231
1235
|
role: "tablist"
|
|
1232
|
-
},
|
|
1236
|
+
}, kt = ["aria-selected"], At = ["aria-selected"], jt = {
|
|
1233
1237
|
key: 0,
|
|
1234
1238
|
class: "pk-word-preview__list"
|
|
1235
|
-
},
|
|
1239
|
+
}, Mt = ["aria-current", "onClick"], Nt = { class: "pk-word-preview__entry-text" }, Pt = {
|
|
1236
1240
|
key: 0,
|
|
1237
1241
|
class: "u-dot"
|
|
1238
|
-
},
|
|
1242
|
+
}, Ft = {
|
|
1239
1243
|
key: 0,
|
|
1240
1244
|
class: "pk-word-preview__none"
|
|
1241
|
-
},
|
|
1245
|
+
}, It = {
|
|
1242
1246
|
key: 1,
|
|
1243
1247
|
class: "pk-word-preview__list"
|
|
1244
|
-
},
|
|
1248
|
+
}, Lt = ["onClick"], Rt = {
|
|
1245
1249
|
key: 0,
|
|
1246
1250
|
class: "pk-word-preview__removed"
|
|
1247
|
-
},
|
|
1251
|
+
}, zt = {
|
|
1248
1252
|
key: 1,
|
|
1249
1253
|
class: "pk-word-preview__added"
|
|
1250
|
-
},
|
|
1254
|
+
}, Bt = { class: "pk-word-preview__main" }, Vt = ["aria-label"], Ht = ["src"], Ut = {
|
|
1251
1255
|
key: 2,
|
|
1252
1256
|
class: "pk-word-preview__truncated"
|
|
1253
|
-
},
|
|
1257
|
+
}, Wt = { class: "pk-word-preview__status" }, Gt = {
|
|
1254
1258
|
key: 0,
|
|
1255
1259
|
class: "pk-word-preview__count"
|
|
1256
|
-
},
|
|
1260
|
+
}, Kt = { class: "pk-word-preview__count" }, qt = {
|
|
1257
1261
|
key: 1,
|
|
1258
1262
|
class: "pk-word-preview__legend"
|
|
1259
|
-
},
|
|
1263
|
+
}, Jt = ["title"], Yt = { class: "pk-word-preview__removed" }, Xt = { class: "pk-word-preview__added" }, Zt = { class: "pk-word-preview__percent" }, Qt = ["data-part"], $t = 96 / 72, en = .5, tn = /* @__PURE__ */ O({
|
|
1260
1264
|
__name: "PkWordPreview",
|
|
1261
|
-
props: /*@__PURE__*/
|
|
1265
|
+
props: /*@__PURE__*/ j({
|
|
1262
1266
|
preview: {},
|
|
1263
1267
|
mode: {},
|
|
1264
1268
|
marked: {}
|
|
@@ -1271,26 +1275,26 @@ var W = {
|
|
|
1271
1275
|
zoom: { default: 1 },
|
|
1272
1276
|
zoomModifiers: {}
|
|
1273
1277
|
}),
|
|
1274
|
-
emits: /*@__PURE__*/
|
|
1278
|
+
emits: /*@__PURE__*/ j(["select"], ["update:fit", "update:zoom"]),
|
|
1275
1279
|
setup(e, { emit: n }) {
|
|
1276
|
-
let o = e, c = n, { t:
|
|
1277
|
-
|
|
1278
|
-
let
|
|
1280
|
+
let o = e, c = n, { t: h } = ce({ useScope: "global" });
|
|
1281
|
+
re(p, b(() => o.preview.images)), re(d, b(() => o.preview.charts));
|
|
1282
|
+
let g = (e) => a(e, o.mode), _ = b(() => s(o.preview.blocks, o.mode)), v = ae("rootEl"), T = ae("scrollEl"), D = ae("measureEl"), { width: O } = le(v), { width: k } = le(T), A = b(() => O.value >= 1e3), j = b(() => o.preview.sections?.length ? o.preview.sections : [{
|
|
1279
1283
|
page: o.preview.page,
|
|
1280
1284
|
headerDistance: 0,
|
|
1281
1285
|
footerDistance: 0,
|
|
1282
1286
|
headers: {},
|
|
1283
1287
|
footers: {}
|
|
1284
|
-
}]),
|
|
1288
|
+
}]), P = b(() => j.value[0].page), ie = b(() => (k.value - 48) / (P.value.width * $t)), V = b(() => O.value === 0 || k.value === 0 || ie.value >= en), U = b(() => ({
|
|
1285
1289
|
fontFamily: r(o.preview.defaults.font),
|
|
1286
1290
|
fontSize: `${o.preview.defaults.size}pt`,
|
|
1287
1291
|
color: o.preview.defaults.color ?? "#000000",
|
|
1288
1292
|
"--pk-word-line": f(o.preview.defaults.font),
|
|
1289
1293
|
"--pk-word-size": `${o.preview.defaults.size}pt`
|
|
1290
|
-
})),
|
|
1291
|
-
...
|
|
1292
|
-
width: `${
|
|
1293
|
-
})),
|
|
1294
|
+
})), oe = b(() => P.value.width - P.value.margins.left - P.value.margins.right), W = b(() => ({
|
|
1295
|
+
...U.value,
|
|
1296
|
+
width: `${oe.value}pt`
|
|
1297
|
+
})), se = ae("flowEl"), { width: ue } = le(se), de = b(() => {
|
|
1294
1298
|
let e = /* @__PURE__ */ new Map(), t = 0;
|
|
1295
1299
|
for (let n of o.preview.blocks) {
|
|
1296
1300
|
if (n.kind === "table") continue;
|
|
@@ -1303,37 +1307,37 @@ var W = {
|
|
|
1303
1307
|
let n = 0;
|
|
1304
1308
|
for (let [r, i] of [...e].sort((e, t) => e[0] - t[0])) if (n += i, n > t / 10) return r;
|
|
1305
1309
|
return 0;
|
|
1306
|
-
}),
|
|
1307
|
-
...
|
|
1308
|
-
"--pk-word-indent-shared": `${
|
|
1309
|
-
"--pk-word-indent-scale":
|
|
1310
|
-
})),
|
|
1311
|
-
await
|
|
1312
|
-
let e =
|
|
1313
|
-
|
|
1314
|
-
let t =
|
|
1315
|
-
|
|
1310
|
+
}), fe = b(() => ({
|
|
1311
|
+
...U.value,
|
|
1312
|
+
"--pk-word-indent-shared": `${de.value}pt`,
|
|
1313
|
+
"--pk-word-indent-scale": ue.value ? Math.min(1, ue.value / (oe.value * $t)) : 1
|
|
1314
|
+
})), G = I([]), pe = I({}), me = async () => {
|
|
1315
|
+
await ee();
|
|
1316
|
+
let e = D.value?.querySelectorAll("[data-item]");
|
|
1317
|
+
G.value = [...e ?? []].map((e) => e.getBoundingClientRect().height);
|
|
1318
|
+
let t = D.value?.querySelectorAll("[data-part]");
|
|
1319
|
+
pe.value = Object.fromEntries([...t ?? []].map((e) => [e.dataset.part ?? "", e.getBoundingClientRect().height]));
|
|
1316
1320
|
};
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1321
|
+
H([
|
|
1322
|
+
_,
|
|
1323
|
+
V,
|
|
1320
1324
|
() => o.preview.parts
|
|
1321
|
-
],
|
|
1322
|
-
|
|
1325
|
+
], me, { flush: "post" }), ne(() => {
|
|
1326
|
+
me(), document.fonts?.ready.then(me);
|
|
1323
1327
|
});
|
|
1324
|
-
let
|
|
1325
|
-
if (!
|
|
1326
|
-
items:
|
|
1328
|
+
let K = b(() => {
|
|
1329
|
+
if (!V.value || G.value.length !== _.value.length) return [{
|
|
1330
|
+
items: _.value.map((e, t) => t),
|
|
1327
1331
|
section: 0,
|
|
1328
1332
|
number: 1,
|
|
1329
|
-
top:
|
|
1330
|
-
bottom:
|
|
1333
|
+
top: P.value.margins.top,
|
|
1334
|
+
bottom: P.value.margins.bottom
|
|
1331
1335
|
}];
|
|
1332
1336
|
let e = [], t = 0, n = !0, r = 0, i, a = () => {
|
|
1333
|
-
let r =
|
|
1337
|
+
let r = j.value[t];
|
|
1334
1338
|
return n && r.pageStart !== void 0 ? r.pageStart : (i ?? e[e.length - 1]?.number ?? 0) + 1;
|
|
1335
1339
|
}, s = (e) => {
|
|
1336
|
-
let r =
|
|
1340
|
+
let r = j.value[t], i = (t) => n && r.titlePage ? t.first : o.preview.evenAndOddHeaders && e % 2 == 0 ? t.even : t.default, a = i(r.headers), s = i(r.footers), c = (e) => e ? (pe.value[e] ?? 0) / $t : 0;
|
|
1337
1341
|
return {
|
|
1338
1342
|
header: a,
|
|
1339
1343
|
footer: s,
|
|
@@ -1349,177 +1353,177 @@ var W = {
|
|
|
1349
1353
|
...s(o)
|
|
1350
1354
|
}), n = !1, r = 0;
|
|
1351
1355
|
};
|
|
1352
|
-
return
|
|
1353
|
-
o.section !== void 0 && o.section !== t &&
|
|
1354
|
-
let u = e[e.length - 1], d = u &&
|
|
1355
|
-
for (let e = l;
|
|
1356
|
-
(!u || u.items.length && (o.breakBefore || r +
|
|
1356
|
+
return _.value.forEach((o, l) => {
|
|
1357
|
+
o.section !== void 0 && o.section !== t && j.value[o.section] && (t = o.section, n = o.breakBefore || !e.length, n || (i = j.value[t].pageStart));
|
|
1358
|
+
let u = e[e.length - 1], d = u && j.value[u.section].page, f = d ? (d.height - u.top - u.bottom) * $t : 0, p = G.value[l];
|
|
1359
|
+
for (let e = l; _.value[e]?.keepNext && e + 1 < _.value.length && !_.value[e + 1].breakBefore; e++) p += G.value[e + 1];
|
|
1360
|
+
(!u || u.items.length && (o.breakBefore || r + G.value[l] > f || r + p > f && p <= (() => {
|
|
1357
1361
|
let e = s(a());
|
|
1358
|
-
return (
|
|
1359
|
-
})())) && c(), e[e.length - 1].items.push(l), r +=
|
|
1362
|
+
return (j.value[t].page.height - e.top - e.bottom) * $t;
|
|
1363
|
+
})())) && c(), e[e.length - 1].items.push(l), r += G.value[l];
|
|
1360
1364
|
}), e.length || c(), e;
|
|
1361
|
-
}),
|
|
1365
|
+
}), q = b(() => {
|
|
1362
1366
|
let e = /* @__PURE__ */ new Map();
|
|
1363
|
-
for (let t of
|
|
1364
|
-
return
|
|
1367
|
+
for (let t of K.value) e.set(t.section, (e.get(t.section) ?? 0) + 1);
|
|
1368
|
+
return K.value.map((t) => ({
|
|
1365
1369
|
page: t.number,
|
|
1366
|
-
pages:
|
|
1370
|
+
pages: K.value.length,
|
|
1367
1371
|
sectionPages: e.get(t.section) ?? 1
|
|
1368
1372
|
}));
|
|
1369
|
-
}),
|
|
1370
|
-
let t =
|
|
1373
|
+
}), ge = (e) => {
|
|
1374
|
+
let t = j.value[e.section].page;
|
|
1371
1375
|
return {
|
|
1372
|
-
...
|
|
1376
|
+
...U.value,
|
|
1373
1377
|
width: `${t.width}pt`,
|
|
1374
1378
|
minHeight: `${t.height}pt`,
|
|
1375
1379
|
padding: `${e.top}pt ${t.margins.right}pt ${e.bottom}pt ${t.margins.left}pt`
|
|
1376
1380
|
};
|
|
1377
|
-
},
|
|
1378
|
-
let t = [...new Set(e.items.map((e) =>
|
|
1381
|
+
}, _e = (e) => {
|
|
1382
|
+
let t = [...new Set(e.items.map((e) => _.value[e].block))];
|
|
1379
1383
|
return l(t.map((e) => o.preview.blocks[e]), o.mode).flatMap((t) => {
|
|
1380
1384
|
let n = u(o.preview.images, t.ref);
|
|
1381
1385
|
return n ? [{
|
|
1382
1386
|
src: n,
|
|
1383
|
-
css: i(t,
|
|
1387
|
+
css: i(t, j.value[e.section].page)
|
|
1384
1388
|
}] : [];
|
|
1385
1389
|
});
|
|
1386
|
-
},
|
|
1387
|
-
|
|
1388
|
-
},
|
|
1389
|
-
let e =
|
|
1390
|
+
}, ve = B(e, "fit"), ye = B(e, "zoom"), be = b(() => ve.value ? Math.min(1.25, Math.max(.3, ie.value)) : ye.value), xe = (e) => {
|
|
1391
|
+
ye.value = Math.min(2, Math.max(.3, Math.round((be.value + e) * 10) / 10)), ve.value = !1;
|
|
1392
|
+
}, Se = I(0), Ce = I(), we = () => {
|
|
1393
|
+
let e = T.value?.getBoundingClientRect();
|
|
1390
1394
|
if (!e) return;
|
|
1391
|
-
let t =
|
|
1395
|
+
let t = T.value?.querySelectorAll("[data-page]") ?? [], n = 0;
|
|
1392
1396
|
for (let [r, i] of [...t].entries()) {
|
|
1393
1397
|
if (i.getBoundingClientRect().top - e.top > e.height / 3) break;
|
|
1394
1398
|
n = r;
|
|
1395
1399
|
}
|
|
1396
|
-
|
|
1400
|
+
Se.value = n;
|
|
1397
1401
|
let r;
|
|
1398
|
-
for (let t of
|
|
1399
|
-
let n =
|
|
1402
|
+
for (let t of X.value) {
|
|
1403
|
+
let n = T.value?.querySelector(`[data-key="${t.key}"]`);
|
|
1400
1404
|
if (n) {
|
|
1401
1405
|
if (n.getBoundingClientRect().top - e.top > 48) break;
|
|
1402
1406
|
r = t.key;
|
|
1403
1407
|
}
|
|
1404
1408
|
}
|
|
1405
|
-
|
|
1406
|
-
},
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
+
Ce.value = r ?? X.value[0]?.key;
|
|
1410
|
+
}, Te = 0, Ee = () => {
|
|
1411
|
+
Te ||= requestAnimationFrame(() => {
|
|
1412
|
+
Te = 0, we();
|
|
1409
1413
|
});
|
|
1410
1414
|
};
|
|
1411
|
-
|
|
1412
|
-
let { selection:
|
|
1413
|
-
root: () =>
|
|
1415
|
+
te(() => cancelAnimationFrame(Te)), H(K, () => ee(Ee));
|
|
1416
|
+
let { selection: De } = he({
|
|
1417
|
+
root: () => T.value?.getRootNode(),
|
|
1414
1418
|
touch: !0
|
|
1415
1419
|
});
|
|
1416
|
-
|
|
1417
|
-
let t =
|
|
1418
|
-
c("select", e && t ?
|
|
1420
|
+
H(De, (e) => {
|
|
1421
|
+
let t = T.value;
|
|
1422
|
+
c("select", e && t ? Y(t, e.range, ".pk-word-preview__measure, .pk-word-preview__part") : void 0);
|
|
1419
1423
|
});
|
|
1420
|
-
let
|
|
1421
|
-
let t = o.preview.blocks[e.block], n = t.kind === "heading" ? [t.label,
|
|
1424
|
+
let J = (e) => g(e).map((e) => e.text).join("").replace(/\s+/g, " ").trim(), X = b(() => _.value.flatMap((e) => {
|
|
1425
|
+
let t = o.preview.blocks[e.block], n = t.kind === "heading" ? [t.label, J(t.runs)].filter(Boolean).join(" ") : "";
|
|
1422
1426
|
return t.kind === "heading" && t.level <= 3 && n ? [{
|
|
1423
1427
|
key: e.key,
|
|
1424
1428
|
level: t.level,
|
|
1425
1429
|
text: n
|
|
1426
1430
|
}] : [];
|
|
1427
|
-
})),
|
|
1431
|
+
})), Oe = (e) => e.length > 60 ? `${e.slice(0, 60)}…` : e, Z = b(() => _.value.flatMap((e) => {
|
|
1428
1432
|
let t = o.preview.blocks[e.block], n = t.kind === "table" ? (t.rows[e.row ?? 0] ?? []).flatMap((e) => e.runs) : t.runs, r = n.filter((e) => e.change === "deleted").map((e) => e.text).join(" ").trim(), i = n.filter((e) => e.change === "inserted").map((e) => e.text).join(" ").trim();
|
|
1429
1433
|
return r || i ? [{
|
|
1430
1434
|
key: e.key,
|
|
1431
|
-
removed:
|
|
1432
|
-
added:
|
|
1435
|
+
removed: Oe(r),
|
|
1436
|
+
added: Oe(i)
|
|
1433
1437
|
}] : [];
|
|
1434
|
-
})),
|
|
1435
|
-
|
|
1436
|
-
!e || e ===
|
|
1438
|
+
})), ke;
|
|
1439
|
+
H([() => o.marked, K], ([e]) => {
|
|
1440
|
+
!e || e === ke || V.value && G.value.length !== _.value.length || m(T.value, ".pk-word-preview__marked") && (ke = e);
|
|
1437
1441
|
}, {
|
|
1438
1442
|
flush: "post",
|
|
1439
1443
|
immediate: !0
|
|
1440
1444
|
});
|
|
1441
|
-
let
|
|
1442
|
-
|
|
1445
|
+
let Ae = I("outline"), je = I(!1), Q = (e) => {
|
|
1446
|
+
T.value?.querySelector(`[data-key="${e}"]`)?.scrollIntoView({
|
|
1443
1447
|
block: "start",
|
|
1444
1448
|
behavior: "smooth"
|
|
1445
|
-
}),
|
|
1446
|
-
},
|
|
1449
|
+
}), A.value || (je.value = !1);
|
|
1450
|
+
}, Me = b(() => o.preview.blocks.flatMap((e) => e.kind === "table" ? e.rows.flat().map((e) => J(e.runs)) : [J(e.runs)]).join(" ").split(/\s+/).filter(Boolean).length), Ne = b(() => o.preview.revisionAuthors.join(", "));
|
|
1447
1451
|
return (n, r) => {
|
|
1448
1452
|
let i = t;
|
|
1449
|
-
return
|
|
1453
|
+
return F(), C("div", {
|
|
1450
1454
|
ref_key: "rootEl",
|
|
1451
|
-
ref:
|
|
1452
|
-
class:
|
|
1455
|
+
ref: v,
|
|
1456
|
+
class: M(["pk-word-preview", { "pk-word-preview--paged": V.value }])
|
|
1453
1457
|
}, [
|
|
1454
|
-
(
|
|
1458
|
+
(A.value || je.value) && (X.value.length || Z.value.length) ? (F(), C("aside", {
|
|
1455
1459
|
key: 0,
|
|
1456
|
-
class:
|
|
1457
|
-
"aria-label":
|
|
1458
|
-
}, [
|
|
1460
|
+
class: M(["pk-word-preview__side", { "pk-word-preview__side--over": !A.value }]),
|
|
1461
|
+
"aria-label": z(h)("chatFilePreview.outline")
|
|
1462
|
+
}, [w("div", Ot, [w("button", {
|
|
1459
1463
|
type: "button",
|
|
1460
1464
|
role: "tab",
|
|
1461
1465
|
class: "pk-word-preview__tab",
|
|
1462
|
-
"aria-selected":
|
|
1463
|
-
onClick: r[0] ||= (e) =>
|
|
1464
|
-
},
|
|
1466
|
+
"aria-selected": Ae.value === "outline",
|
|
1467
|
+
onClick: r[0] ||= (e) => Ae.value = "outline"
|
|
1468
|
+
}, R(z(h)("chatFilePreview.outline")), 9, kt), Z.value.length ? (F(), C("button", {
|
|
1465
1469
|
key: 0,
|
|
1466
1470
|
type: "button",
|
|
1467
1471
|
role: "tab",
|
|
1468
1472
|
class: "pk-word-preview__tab",
|
|
1469
|
-
"aria-selected":
|
|
1470
|
-
onClick: r[1] ||= (e) =>
|
|
1471
|
-
},
|
|
1473
|
+
"aria-selected": Ae.value === "changes",
|
|
1474
|
+
onClick: r[1] ||= (e) => Ae.value = "changes"
|
|
1475
|
+
}, R(z(h)("chatFilePreview.changes", { count: Z.value.length })), 9, At)) : S("", !0)]), Ae.value === "outline" || !Z.value.length ? (F(), C("nav", jt, [(F(!0), C(y, null, L(X.value, (e) => (F(), C("button", {
|
|
1472
1476
|
key: e.key,
|
|
1473
1477
|
type: "button",
|
|
1474
|
-
class:
|
|
1475
|
-
"aria-current":
|
|
1476
|
-
onClick: (t) =>
|
|
1477
|
-
}, [
|
|
1478
|
+
class: M(["pk-word-preview__entry", `pk-word-preview__entry--${Math.min(e.level, 3)}`]),
|
|
1479
|
+
"aria-current": Ce.value === e.key ? "location" : void 0,
|
|
1480
|
+
onClick: (t) => Q(e.key)
|
|
1481
|
+
}, [w("span", Nt, R(e.text), 1), Z.value.some((t) => t.key === e.key) ? (F(), C("span", Pt)) : S("", !0)], 10, Mt))), 128)), X.value.length ? S("", !0) : (F(), C("p", Ft, R(z(h)("chatFilePreview.noHeadings")), 1))])) : (F(), C("nav", It, [(F(!0), C(y, null, L(Z.value, (e) => (F(), C("button", {
|
|
1478
1482
|
key: e.key,
|
|
1479
1483
|
type: "button",
|
|
1480
1484
|
class: "pk-word-preview__entry pk-word-preview__entry--change",
|
|
1481
|
-
onClick: (t) =>
|
|
1482
|
-
}, [e.removed ? (
|
|
1483
|
-
|
|
1485
|
+
onClick: (t) => Q(e.key)
|
|
1486
|
+
}, [e.removed ? (F(), C("del", Rt, R(e.removed), 1)) : S("", !0), e.added ? (F(), C("ins", zt, R(e.added), 1)) : S("", !0)], 8, Lt))), 128))]))], 10, Dt)) : S("", !0),
|
|
1487
|
+
w("div", Bt, [w("div", {
|
|
1484
1488
|
ref_key: "scrollEl",
|
|
1485
|
-
ref:
|
|
1489
|
+
ref: T,
|
|
1486
1490
|
class: "pk-word-preview__scroll",
|
|
1487
|
-
onScroll:
|
|
1488
|
-
}, [
|
|
1491
|
+
onScroll: Ee
|
|
1492
|
+
}, [V.value ? (F(), C("div", {
|
|
1489
1493
|
key: 0,
|
|
1490
1494
|
class: "pk-word-preview__pages",
|
|
1491
|
-
style:
|
|
1492
|
-
}, [(
|
|
1495
|
+
style: N({ zoom: be.value })
|
|
1496
|
+
}, [(F(!0), C(y, null, L(K.value, (t, n) => (F(), C("article", {
|
|
1493
1497
|
key: n,
|
|
1494
1498
|
"data-page": "",
|
|
1495
1499
|
class: "pk-word-preview__page",
|
|
1496
|
-
"aria-label":
|
|
1500
|
+
"aria-label": z(h)("chatFilePreview.pageOf", {
|
|
1497
1501
|
page: n + 1,
|
|
1498
|
-
count:
|
|
1502
|
+
count: K.value.length
|
|
1499
1503
|
}),
|
|
1500
|
-
style:
|
|
1504
|
+
style: N(ge(t))
|
|
1501
1505
|
}, [
|
|
1502
|
-
t.header && e.preview.parts?.[t.header] ? (
|
|
1506
|
+
t.header && e.preview.parts?.[t.header] ? (F(), x(Et, {
|
|
1503
1507
|
key: 0,
|
|
1504
1508
|
blocks: e.preview.parts[t.header],
|
|
1505
1509
|
where: "header",
|
|
1506
|
-
section:
|
|
1510
|
+
section: j.value[t.section],
|
|
1507
1511
|
mode: e.mode,
|
|
1508
|
-
numbers:
|
|
1512
|
+
numbers: q.value[n]
|
|
1509
1513
|
}, null, 8, [
|
|
1510
1514
|
"blocks",
|
|
1511
1515
|
"section",
|
|
1512
1516
|
"mode",
|
|
1513
1517
|
"numbers"
|
|
1514
|
-
])) :
|
|
1515
|
-
(
|
|
1516
|
-
key:
|
|
1517
|
-
"data-key":
|
|
1518
|
-
block: e.preview.blocks[
|
|
1519
|
-
row:
|
|
1518
|
+
])) : S("", !0),
|
|
1519
|
+
(F(!0), C(y, null, L(t.items, (r) => (F(), x(Ct, {
|
|
1520
|
+
key: _.value[r].key,
|
|
1521
|
+
"data-key": _.value[r].key,
|
|
1522
|
+
block: e.preview.blocks[_.value[r].block],
|
|
1523
|
+
row: _.value[r].row,
|
|
1520
1524
|
mode: e.mode,
|
|
1521
|
-
page:
|
|
1522
|
-
numbers:
|
|
1525
|
+
page: j.value[t.section].page,
|
|
1526
|
+
numbers: q.value[n],
|
|
1523
1527
|
marked: e.marked
|
|
1524
1528
|
}, null, 8, [
|
|
1525
1529
|
"data-key",
|
|
@@ -1530,33 +1534,33 @@ var W = {
|
|
|
1530
1534
|
"numbers",
|
|
1531
1535
|
"marked"
|
|
1532
1536
|
]))), 128)),
|
|
1533
|
-
(
|
|
1537
|
+
(F(!0), C(y, null, L(_e(t), (e, t) => (F(), C("img", {
|
|
1534
1538
|
key: `image-${t}`,
|
|
1535
1539
|
class: "pk-word-preview__float",
|
|
1536
|
-
style:
|
|
1540
|
+
style: N(e.css),
|
|
1537
1541
|
src: e.src,
|
|
1538
1542
|
alt: ""
|
|
1539
|
-
}, null, 12,
|
|
1540
|
-
t.footer && e.preview.parts?.[t.footer] ? (
|
|
1543
|
+
}, null, 12, Ht))), 128)),
|
|
1544
|
+
t.footer && e.preview.parts?.[t.footer] ? (F(), x(Et, {
|
|
1541
1545
|
key: 1,
|
|
1542
1546
|
blocks: e.preview.parts[t.footer],
|
|
1543
1547
|
where: "footer",
|
|
1544
|
-
section:
|
|
1548
|
+
section: j.value[t.section],
|
|
1545
1549
|
mode: e.mode,
|
|
1546
|
-
numbers:
|
|
1550
|
+
numbers: q.value[n]
|
|
1547
1551
|
}, null, 8, [
|
|
1548
1552
|
"blocks",
|
|
1549
1553
|
"section",
|
|
1550
1554
|
"mode",
|
|
1551
1555
|
"numbers"
|
|
1552
|
-
])) :
|
|
1553
|
-
], 12,
|
|
1556
|
+
])) : S("", !0)
|
|
1557
|
+
], 12, Vt))), 128))], 4)) : (F(), C("article", {
|
|
1554
1558
|
key: 1,
|
|
1555
1559
|
ref_key: "flowEl",
|
|
1556
|
-
ref:
|
|
1560
|
+
ref: se,
|
|
1557
1561
|
class: "pk-word-preview__page pk-word-preview__page--flow",
|
|
1558
|
-
style:
|
|
1559
|
-
}, [(
|
|
1562
|
+
style: N(fe.value)
|
|
1563
|
+
}, [(F(!0), C(y, null, L(_.value, (t) => (F(), x(Ct, {
|
|
1560
1564
|
key: t.key,
|
|
1561
1565
|
"data-key": t.key,
|
|
1562
1566
|
block: e.preview.blocks[t.block],
|
|
@@ -1569,130 +1573,130 @@ var W = {
|
|
|
1569
1573
|
"row",
|
|
1570
1574
|
"mode",
|
|
1571
1575
|
"marked"
|
|
1572
|
-
]))), 128))], 4)), e.preview.truncated ? (
|
|
1573
|
-
|
|
1574
|
-
page:
|
|
1575
|
-
count:
|
|
1576
|
-
})), 1)) :
|
|
1577
|
-
|
|
1578
|
-
e.mode === "markup" && e.preview.revisionAuthors.length ? (
|
|
1579
|
-
|
|
1576
|
+
]))), 128))], 4)), e.preview.truncated ? (F(), C("p", Ut, R(z(h)("chatFilePreview.truncated")), 1)) : S("", !0)], 544), w("div", Wt, [
|
|
1577
|
+
V.value ? (F(), C("span", Gt, R(z(h)("chatFilePreview.pageOf", {
|
|
1578
|
+
page: Se.value + 1,
|
|
1579
|
+
count: K.value.length
|
|
1580
|
+
})), 1)) : S("", !0),
|
|
1581
|
+
w("span", Kt, R(z(h)("chatFilePreview.words", Me.value)), 1),
|
|
1582
|
+
e.mode === "markup" && e.preview.revisionAuthors.length ? (F(), C("span", qt, [
|
|
1583
|
+
w("span", {
|
|
1580
1584
|
class: "pk-word-preview__legend-text",
|
|
1581
|
-
title:
|
|
1582
|
-
},
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
])) :
|
|
1586
|
-
r[6] ||=
|
|
1587
|
-
!
|
|
1585
|
+
title: z(h)("chatFilePreview.revisionsOf", { authors: Ne.value })
|
|
1586
|
+
}, R(z(h)("chatFilePreview.revisionsOf", { authors: Ne.value })), 9, Jt),
|
|
1587
|
+
w("del", Yt, R(z(h)("chatFilePreview.removed")), 1),
|
|
1588
|
+
w("ins", Xt, R(z(h)("chatFilePreview.added")), 1)
|
|
1589
|
+
])) : S("", !0),
|
|
1590
|
+
r[6] ||= w("span", { class: "pk-word-preview__spacer" }, null, -1),
|
|
1591
|
+
!A.value && (X.value.length || Z.value.length) ? (F(), x(i, {
|
|
1588
1592
|
key: 2,
|
|
1589
1593
|
class: "pk-word-preview__outline-toggle",
|
|
1590
1594
|
modifiers: "action-quiet",
|
|
1591
1595
|
icon: "ri:list-unordered",
|
|
1592
|
-
label:
|
|
1593
|
-
title:
|
|
1594
|
-
"aria-label":
|
|
1595
|
-
"aria-expanded":
|
|
1596
|
-
onClick: r[2] ||= (e) =>
|
|
1596
|
+
label: z(h)("chatFilePreview.outline"),
|
|
1597
|
+
title: z(h)("chatFilePreview.outline"),
|
|
1598
|
+
"aria-label": z(h)("chatFilePreview.outline"),
|
|
1599
|
+
"aria-expanded": je.value,
|
|
1600
|
+
onClick: r[2] ||= (e) => je.value = !je.value
|
|
1597
1601
|
}, null, 8, [
|
|
1598
1602
|
"label",
|
|
1599
1603
|
"title",
|
|
1600
1604
|
"aria-label",
|
|
1601
1605
|
"aria-expanded"
|
|
1602
|
-
])) :
|
|
1603
|
-
|
|
1604
|
-
|
|
1606
|
+
])) : S("", !0),
|
|
1607
|
+
V.value ? (F(), C(y, { key: 3 }, [
|
|
1608
|
+
E(i, {
|
|
1605
1609
|
class: "pk-word-preview__fit",
|
|
1606
1610
|
modifiers: "action-quiet",
|
|
1607
1611
|
icon: "ri:expand-width-line",
|
|
1608
|
-
label:
|
|
1609
|
-
title:
|
|
1610
|
-
"aria-label":
|
|
1611
|
-
disabled:
|
|
1612
|
-
onClick: r[3] ||= (e) =>
|
|
1612
|
+
label: z(h)("chatFilePreview.fitWidth"),
|
|
1613
|
+
title: z(h)("chatFilePreview.fitWidth"),
|
|
1614
|
+
"aria-label": z(h)("chatFilePreview.fitWidth"),
|
|
1615
|
+
disabled: ve.value,
|
|
1616
|
+
onClick: r[3] ||= (e) => ve.value = !0
|
|
1613
1617
|
}, null, 8, [
|
|
1614
1618
|
"label",
|
|
1615
1619
|
"title",
|
|
1616
1620
|
"aria-label",
|
|
1617
1621
|
"disabled"
|
|
1618
1622
|
]),
|
|
1619
|
-
|
|
1623
|
+
E(i, {
|
|
1620
1624
|
modifiers: "action-quiet",
|
|
1621
1625
|
icon: "ri:subtract-line",
|
|
1622
|
-
"aria-label":
|
|
1623
|
-
disabled:
|
|
1624
|
-
onClick: r[4] ||= (e) =>
|
|
1626
|
+
"aria-label": z(h)("chatFilePreview.zoomOut"),
|
|
1627
|
+
disabled: be.value <= .3,
|
|
1628
|
+
onClick: r[4] ||= (e) => xe(-.1)
|
|
1625
1629
|
}, null, 8, ["aria-label", "disabled"]),
|
|
1626
|
-
|
|
1627
|
-
|
|
1630
|
+
w("span", Zt, R(Math.round(be.value * 100)) + "% ", 1),
|
|
1631
|
+
E(i, {
|
|
1628
1632
|
modifiers: "action-quiet",
|
|
1629
1633
|
icon: "ri:add-line",
|
|
1630
|
-
"aria-label":
|
|
1631
|
-
disabled:
|
|
1632
|
-
onClick: r[5] ||= (e) =>
|
|
1634
|
+
"aria-label": z(h)("chatFilePreview.zoomIn"),
|
|
1635
|
+
disabled: be.value >= 2,
|
|
1636
|
+
onClick: r[5] ||= (e) => xe(.1)
|
|
1633
1637
|
}, null, 8, ["aria-label", "disabled"])
|
|
1634
|
-
], 64)) :
|
|
1638
|
+
], 64)) : S("", !0)
|
|
1635
1639
|
])]),
|
|
1636
|
-
|
|
1640
|
+
V.value ? (F(), C("div", {
|
|
1637
1641
|
key: 1,
|
|
1638
1642
|
ref_key: "measureEl",
|
|
1639
|
-
ref:
|
|
1643
|
+
ref: D,
|
|
1640
1644
|
class: "pk-word-preview__measure",
|
|
1641
1645
|
"aria-hidden": "true",
|
|
1642
|
-
style:
|
|
1643
|
-
}, [(
|
|
1646
|
+
style: N(W.value)
|
|
1647
|
+
}, [(F(!0), C(y, null, L(_.value, (t) => (F(), C("div", {
|
|
1644
1648
|
key: t.key,
|
|
1645
1649
|
"data-item": ""
|
|
1646
|
-
}, [
|
|
1650
|
+
}, [E(Ct, {
|
|
1647
1651
|
block: e.preview.blocks[t.block],
|
|
1648
1652
|
row: t.row,
|
|
1649
1653
|
mode: e.mode,
|
|
1650
|
-
page:
|
|
1654
|
+
page: P.value
|
|
1651
1655
|
}, null, 8, [
|
|
1652
1656
|
"block",
|
|
1653
1657
|
"row",
|
|
1654
1658
|
"mode",
|
|
1655
1659
|
"page"
|
|
1656
|
-
])]))), 128)), (
|
|
1660
|
+
])]))), 128)), (F(!0), C(y, null, L(e.preview.parts, (t, n) => (F(), C("div", {
|
|
1657
1661
|
key: n,
|
|
1658
1662
|
"data-part": n
|
|
1659
|
-
}, [(
|
|
1663
|
+
}, [(F(!0), C(y, null, L(z(s)(t, e.mode), (n) => (F(), x(Ct, {
|
|
1660
1664
|
key: n.key,
|
|
1661
1665
|
block: t[n.block],
|
|
1662
1666
|
row: n.row,
|
|
1663
1667
|
mode: e.mode,
|
|
1664
|
-
page:
|
|
1668
|
+
page: P.value
|
|
1665
1669
|
}, null, 8, [
|
|
1666
1670
|
"block",
|
|
1667
1671
|
"row",
|
|
1668
1672
|
"mode",
|
|
1669
1673
|
"page"
|
|
1670
|
-
]))), 128))], 8,
|
|
1674
|
+
]))), 128))], 8, Qt))), 128))], 4)) : S("", !0)
|
|
1671
1675
|
], 2);
|
|
1672
1676
|
};
|
|
1673
1677
|
}
|
|
1674
|
-
}),
|
|
1678
|
+
}), nn = ["aria-label"], rn = { class: "pk-file-preview__head" }, an = { class: "pk-file-preview__file" }, on = {
|
|
1675
1679
|
class: "pk-file-preview__tile",
|
|
1676
1680
|
"aria-hidden": "true"
|
|
1677
|
-
},
|
|
1681
|
+
}, sn = { class: "pk-file-preview__name" }, cn = { class: "pk-file-preview__title" }, ln = {
|
|
1678
1682
|
class: "pk-file-preview__note",
|
|
1679
1683
|
role: "status"
|
|
1680
|
-
},
|
|
1684
|
+
}, un = {
|
|
1681
1685
|
key: 0,
|
|
1682
1686
|
class: "pk-file-preview__progress",
|
|
1683
1687
|
"aria-hidden": "true"
|
|
1684
|
-
},
|
|
1688
|
+
}, dn = {
|
|
1685
1689
|
key: 1,
|
|
1686
1690
|
class: "pk-file-preview__tools"
|
|
1687
|
-
},
|
|
1691
|
+
}, fn = ["aria-label"], pn = { class: "pk-file-preview__version" }, mn = { class: "pk-file-preview__mode-long" }, hn = { class: "pk-file-preview__mode-short" }, gn = { class: "pk-file-preview__actions" }, _n = { class: "pk-file-preview__body" }, vn = {
|
|
1688
1692
|
key: 0,
|
|
1689
1693
|
class: "pk-file-preview__skeleton vv-skeleton"
|
|
1690
|
-
},
|
|
1694
|
+
}, yn = {
|
|
1691
1695
|
key: 1,
|
|
1692
1696
|
class: "pk-file-preview__empty"
|
|
1693
|
-
},
|
|
1697
|
+
}, bn = /*@__PURE__*/ O({
|
|
1694
1698
|
__name: "PkFilePreview",
|
|
1695
|
-
props: /*@__PURE__*/
|
|
1699
|
+
props: /*@__PURE__*/ j({
|
|
1696
1700
|
kind: {},
|
|
1697
1701
|
filename: {},
|
|
1698
1702
|
version: {},
|
|
@@ -1721,7 +1725,7 @@ var W = {
|
|
|
1721
1725
|
},
|
|
1722
1726
|
fitModifiers: {}
|
|
1723
1727
|
}),
|
|
1724
|
-
emits: /*@__PURE__*/
|
|
1728
|
+
emits: /*@__PURE__*/ j([
|
|
1725
1729
|
"close",
|
|
1726
1730
|
"version",
|
|
1727
1731
|
"restore",
|
|
@@ -1735,13 +1739,13 @@ var W = {
|
|
|
1735
1739
|
"update:fit"
|
|
1736
1740
|
]),
|
|
1737
1741
|
setup(e, { emit: r }) {
|
|
1738
|
-
let i = e, a = r, { t: o, locale: s } =
|
|
1739
|
-
|
|
1742
|
+
let i = e, a = r, { t: o, locale: s } = ce({ useScope: "global" }), c = I(!1), l;
|
|
1743
|
+
H(() => i.working, (e, t) => {
|
|
1740
1744
|
e ? (l = t === void 0 ? void 0 : i.version, c.value = !1) : l !== void 0 && (c.value = i.version === l, l = void 0);
|
|
1741
|
-
}, { immediate: !0 }),
|
|
1745
|
+
}, { immediate: !0 }), H(() => [i.version, i.fileId], () => {
|
|
1742
1746
|
i.working || (c.value = !1);
|
|
1743
1747
|
});
|
|
1744
|
-
let u =
|
|
1748
|
+
let u = b(() => i.versions ?? []), d = b(() => i.version ? u.value.indexOf(i.version) : -1), f = b(() => d.value > 0 ? u.value[d.value - 1] : void 0), p = b(() => d.value >= 0 && d.value < u.value.length - 1 ? u.value[d.value + 1] : void 0), m = B(e, "mode"), h = B(e, "sheet"), g = B(e, "zoom"), _ = B(e, "fit"), D = b(() => [
|
|
1745
1749
|
{
|
|
1746
1750
|
value: "markup",
|
|
1747
1751
|
label: o("chatFilePreview.modeMarkup")
|
|
@@ -1754,48 +1758,48 @@ var W = {
|
|
|
1754
1758
|
value: "original",
|
|
1755
1759
|
label: o("chatFilePreview.modeOriginal")
|
|
1756
1760
|
}
|
|
1757
|
-
]),
|
|
1758
|
-
|
|
1761
|
+
]), O = b(() => i.preview?.kind === "word" && i.preview.revisionAuthors.length > 0);
|
|
1762
|
+
H(() => i.version, () => {
|
|
1759
1763
|
m.value = "markup";
|
|
1760
1764
|
});
|
|
1761
|
-
let
|
|
1762
|
-
|
|
1765
|
+
let k = ae("rootEl"), A = ie(), j = I(!1), N = () => {
|
|
1766
|
+
A.value = void 0, j.value = !1;
|
|
1763
1767
|
};
|
|
1764
|
-
|
|
1768
|
+
H(() => [
|
|
1765
1769
|
i.version,
|
|
1766
1770
|
i.preview,
|
|
1767
1771
|
m.value,
|
|
1768
1772
|
h.value
|
|
1769
|
-
],
|
|
1770
|
-
let
|
|
1771
|
-
|
|
1772
|
-
},
|
|
1773
|
-
|
|
1774
|
-
let n =
|
|
1775
|
-
t && !e && n?.format === "docx" && (await
|
|
1773
|
+
], N);
|
|
1774
|
+
let te = (e) => {
|
|
1775
|
+
j.value || (A.value = e);
|
|
1776
|
+
}, ne = b(() => A.value?.format === "docx" && pe());
|
|
1777
|
+
H(j, async (e, t) => {
|
|
1778
|
+
let n = A.value;
|
|
1779
|
+
t && !e && n?.format === "docx" && (await ee(), n.restore());
|
|
1776
1780
|
});
|
|
1777
|
-
let
|
|
1781
|
+
let P = b(() => !i.version || i.version === u.value[u.value.length - 1]), re = () => {
|
|
1778
1782
|
let e = u.value[u.value.length - 1];
|
|
1779
1783
|
e && a("version", e);
|
|
1780
|
-
},
|
|
1781
|
-
let e =
|
|
1782
|
-
return e?.format === "docx" ? e.paragraphCount > 200 : (e?.cells ?? 0) >
|
|
1783
|
-
}),
|
|
1784
|
-
let e =
|
|
1784
|
+
}, V = b(() => {
|
|
1785
|
+
let e = A.value;
|
|
1786
|
+
return e?.format === "docx" ? e.paragraphCount > 200 : (e?.cells ?? 0) > ge;
|
|
1787
|
+
}), oe = b(() => A.value?.format === "docx" && m.value === "original"), W = b(() => V.value || oe.value), se = b(() => oe.value ? o("selectionActions.hintOriginal") : V.value ? o(A.value?.format === "docx" ? "selectionActions.hintParagraphs" : "selectionActions.hintCells", { count: A.value?.format === "docx" ? 200 : ge }) : void 0), le = (e) => e[s.value] ?? e[s.value.split("-")[0]] ?? Object.values(e)[0] ?? "", de = ["explain", "summarize"], fe = b(() => {
|
|
1788
|
+
let e = A.value, t = i.selectionActions;
|
|
1785
1789
|
if (!e || !t) return [];
|
|
1786
1790
|
let n = e.format;
|
|
1787
|
-
return [...(n === "docx" &&
|
|
1791
|
+
return [...(n === "docx" && W.value ? de : t.builtIns).map((e) => ({
|
|
1788
1792
|
id: e,
|
|
1789
1793
|
label: o(`selectionActions.builtIn.${e}`),
|
|
1790
1794
|
...e === "translate" && { asks: o("selectionActions.translateAsks") },
|
|
1791
1795
|
prompt: (t) => o(`selectionActions.prompt.${n}.${e}`, { language: t ?? "" })
|
|
1792
|
-
})), ...(
|
|
1796
|
+
})), ...(W.value ? [] : t.actions).map((e) => ({
|
|
1793
1797
|
id: e.id,
|
|
1794
|
-
label:
|
|
1798
|
+
label: le(e.label),
|
|
1795
1799
|
icon: e.icon,
|
|
1796
|
-
prompt: () =>
|
|
1800
|
+
prompt: () => le(e.prompt)
|
|
1797
1801
|
}))];
|
|
1798
|
-
}),
|
|
1802
|
+
}), G = (e) => {
|
|
1799
1803
|
if (e.format === "docx") return o("selectionActions.labelParagraphs", {
|
|
1800
1804
|
file: i.filename,
|
|
1801
1805
|
count: e.paragraphCount
|
|
@@ -1811,20 +1815,20 @@ var W = {
|
|
|
1811
1815
|
sheet: e.sheet,
|
|
1812
1816
|
cell: t
|
|
1813
1817
|
});
|
|
1814
|
-
},
|
|
1818
|
+
}, me = (e) => {
|
|
1815
1819
|
if (!i.fileId || !i.storedFileName) return;
|
|
1816
1820
|
let t = {
|
|
1817
1821
|
fileId: i.fileId,
|
|
1818
1822
|
version: i.version ?? 1,
|
|
1819
1823
|
storedFileName: i.storedFileName,
|
|
1820
|
-
label:
|
|
1824
|
+
label: G(e).slice(0, 200)
|
|
1821
1825
|
};
|
|
1822
1826
|
if (e.format === "docx") {
|
|
1823
1827
|
let { measure: n, ...r } = e;
|
|
1824
1828
|
return {
|
|
1825
1829
|
...t,
|
|
1826
1830
|
...r,
|
|
1827
|
-
...
|
|
1831
|
+
...oe.value && { original: !0 }
|
|
1828
1832
|
};
|
|
1829
1833
|
}
|
|
1830
1834
|
let { measure: n, cells: r, ...a } = e;
|
|
@@ -1832,23 +1836,23 @@ var W = {
|
|
|
1832
1836
|
...t,
|
|
1833
1837
|
...a
|
|
1834
1838
|
};
|
|
1835
|
-
},
|
|
1836
|
-
let n =
|
|
1839
|
+
}, he = (e, t) => {
|
|
1840
|
+
let n = A.value, r = n && me(n);
|
|
1837
1841
|
r && (a("selectionSend", e, r, {
|
|
1838
1842
|
id: t,
|
|
1839
1843
|
size: n.format === "docx" ? n.paragraphCount : n.cells
|
|
1840
|
-
}),
|
|
1841
|
-
},
|
|
1842
|
-
let n =
|
|
1843
|
-
n &&
|
|
1844
|
-
},
|
|
1845
|
-
|
|
1844
|
+
}), N(), document.getSelection()?.removeAllRanges());
|
|
1845
|
+
}, K = (e, t) => {
|
|
1846
|
+
let n = fe.value.find((t) => t.id === e);
|
|
1847
|
+
n && he(n.prompt(t), e);
|
|
1848
|
+
}, q = I(0);
|
|
1849
|
+
ue(k, "scroll", () => q.value++, {
|
|
1846
1850
|
capture: !0,
|
|
1847
1851
|
passive: !0
|
|
1848
|
-
}),
|
|
1849
|
-
let
|
|
1850
|
-
|
|
1851
|
-
let e =
|
|
1852
|
+
}), ue(window, "resize", () => q.value++, { passive: !0 });
|
|
1853
|
+
let _e = b(() => {
|
|
1854
|
+
q.value;
|
|
1855
|
+
let e = A.value?.measure(), t = k.value?.getBoundingClientRect();
|
|
1852
1856
|
if (e && t) return {
|
|
1853
1857
|
start: {
|
|
1854
1858
|
top: e.start.top - t.top,
|
|
@@ -1864,133 +1868,133 @@ var W = {
|
|
|
1864
1868
|
};
|
|
1865
1869
|
});
|
|
1866
1870
|
return (r, i) => {
|
|
1867
|
-
let s =
|
|
1868
|
-
return
|
|
1871
|
+
let s = v, l = t;
|
|
1872
|
+
return F(), C("section", {
|
|
1869
1873
|
ref_key: "rootEl",
|
|
1870
|
-
ref:
|
|
1874
|
+
ref: k,
|
|
1871
1875
|
class: "pk-file-preview",
|
|
1872
1876
|
"aria-label": e.filename,
|
|
1873
1877
|
tabindex: "-1",
|
|
1874
1878
|
autofocus: ""
|
|
1875
1879
|
}, [
|
|
1876
|
-
|
|
1877
|
-
|
|
1880
|
+
w("header", rn, [
|
|
1881
|
+
w("div", an, [w("span", on, [E(s, {
|
|
1878
1882
|
name: e.kind === "word" ? "ri:file-word-2-line" : "ri:file-excel-2-line",
|
|
1879
|
-
class:
|
|
1880
|
-
}, null, 8, ["name", "class"])]),
|
|
1883
|
+
class: M(e.kind === "word" ? "pk-file-preview__icon--word" : "pk-file-preview__icon--sheet")
|
|
1884
|
+
}, null, 8, ["name", "class"])]), w("div", sn, [w("strong", cn, R(e.filename), 1), w("span", ln, [e.working ? (F(), C(y, { key: 0 }, [i[14] ||= w("span", {
|
|
1881
1885
|
class: "pk-file-preview__spinner",
|
|
1882
1886
|
"aria-hidden": "true"
|
|
1883
|
-
}, null, -1),
|
|
1887
|
+
}, null, -1), T(" " + R(z(o)("chatFilePreview.working")), 1)], 64)) : c.value ? (F(), C(y, { key: 1 }, [T(R(z(o)("chatFilePreview.answeredInChat")) + " ", 1), E(l, {
|
|
1884
1888
|
modifiers: "link",
|
|
1885
1889
|
class: "pk-file-preview__show-chat",
|
|
1886
|
-
label:
|
|
1890
|
+
label: z(o)("chatFilePreview.showChat"),
|
|
1887
1891
|
onClick: i[0] ||= (e) => a("showChat")
|
|
1888
|
-
}, null, 8, ["label"])], 64)) : (
|
|
1889
|
-
e.working ? (
|
|
1890
|
-
e.version && u.value.length > 1 ||
|
|
1892
|
+
}, null, 8, ["label"])], 64)) : (F(), C(y, { key: 2 }, [T(R(z(o)("chatFilePreview.readOnly")), 1)], 64))])])]),
|
|
1893
|
+
e.working ? (F(), C("div", un)) : S("", !0),
|
|
1894
|
+
e.version && u.value.length > 1 || O.value ? (F(), C("div", dn, [e.version && u.value.length > 1 ? (F(), C("nav", {
|
|
1891
1895
|
key: 0,
|
|
1892
1896
|
class: "pk-file-preview__versions",
|
|
1893
|
-
"aria-label":
|
|
1897
|
+
"aria-label": z(o)("chatFilePreview.versions")
|
|
1894
1898
|
}, [
|
|
1895
|
-
|
|
1899
|
+
E(l, {
|
|
1896
1900
|
modifiers: "action-quiet",
|
|
1897
1901
|
icon: "ri:arrow-left-s-line",
|
|
1898
|
-
"aria-label":
|
|
1902
|
+
"aria-label": z(o)("chatFilePreview.previousVersion"),
|
|
1899
1903
|
disabled: !f.value,
|
|
1900
1904
|
onClick: i[1] ||= (e) => f.value && a("version", f.value)
|
|
1901
1905
|
}, null, 8, ["aria-label", "disabled"]),
|
|
1902
|
-
|
|
1906
|
+
w("span", pn, R(z(o)("chatFilePreview.versionOf", {
|
|
1903
1907
|
version: e.version,
|
|
1904
1908
|
count: u.value.length
|
|
1905
1909
|
})), 1),
|
|
1906
|
-
|
|
1910
|
+
E(l, {
|
|
1907
1911
|
modifiers: "action-quiet",
|
|
1908
1912
|
icon: "ri:arrow-right-s-line",
|
|
1909
|
-
"aria-label":
|
|
1913
|
+
"aria-label": z(o)("chatFilePreview.nextVersion"),
|
|
1910
1914
|
disabled: !p.value,
|
|
1911
1915
|
onClick: i[2] ||= (e) => p.value && a("version", p.value)
|
|
1912
1916
|
}, null, 8, ["aria-label", "disabled"])
|
|
1913
|
-
], 8,
|
|
1917
|
+
], 8, fn)) : S("", !0), O.value ? (F(), x(n, {
|
|
1914
1918
|
key: 1,
|
|
1915
1919
|
modelValue: m.value,
|
|
1916
1920
|
"onUpdate:modelValue": i[3] ||= (e) => m.value = e,
|
|
1917
1921
|
name: "revisions",
|
|
1918
1922
|
segmented: "",
|
|
1919
1923
|
class: "pk-file-preview__modes u-segmented-fit mb-0",
|
|
1920
|
-
"aria-label":
|
|
1921
|
-
options:
|
|
1924
|
+
"aria-label": z(o)("chatFilePreview.modes"),
|
|
1925
|
+
options: D.value
|
|
1922
1926
|
}, {
|
|
1923
|
-
markup:
|
|
1927
|
+
markup: U(() => [w("span", mn, R(z(o)("chatFilePreview.modeMarkup")), 1), w("span", hn, R(z(o)("chatFilePreview.modeMarkupShort")), 1)]),
|
|
1924
1928
|
_: 1
|
|
1925
1929
|
}, 8, [
|
|
1926
1930
|
"modelValue",
|
|
1927
1931
|
"aria-label",
|
|
1928
1932
|
"options"
|
|
1929
|
-
])) :
|
|
1930
|
-
|
|
1931
|
-
e.restorable ? (
|
|
1933
|
+
])) : S("", !0)])) : S("", !0),
|
|
1934
|
+
w("div", gn, [
|
|
1935
|
+
e.restorable ? (F(), x(l, {
|
|
1932
1936
|
key: 0,
|
|
1933
1937
|
modifiers: "action-quiet",
|
|
1934
1938
|
icon: "ri:arrow-go-back-line",
|
|
1935
|
-
label:
|
|
1939
|
+
label: z(o)("chatFilePreview.restore"),
|
|
1936
1940
|
onClick: i[4] ||= (e) => a("restore")
|
|
1937
|
-
}, null, 8, ["label"])) :
|
|
1938
|
-
|
|
1941
|
+
}, null, 8, ["label"])) : S("", !0),
|
|
1942
|
+
E(l, {
|
|
1939
1943
|
href: e.downloadUrl,
|
|
1940
1944
|
download: "",
|
|
1941
1945
|
modifiers: "action-quiet",
|
|
1942
1946
|
icon: "ri:download-line",
|
|
1943
|
-
title:
|
|
1944
|
-
"aria-label":
|
|
1947
|
+
title: z(o)("chatFilePreview.download"),
|
|
1948
|
+
"aria-label": z(o)("chatFilePreview.download")
|
|
1945
1949
|
}, null, 8, [
|
|
1946
1950
|
"href",
|
|
1947
1951
|
"title",
|
|
1948
1952
|
"aria-label"
|
|
1949
1953
|
]),
|
|
1950
|
-
e.resize === "expand" ? (
|
|
1954
|
+
e.resize === "expand" ? (F(), x(l, {
|
|
1951
1955
|
key: 1,
|
|
1952
1956
|
modifiers: "action-quiet",
|
|
1953
1957
|
icon: "ri:fullscreen-line",
|
|
1954
|
-
title:
|
|
1955
|
-
"aria-label":
|
|
1958
|
+
title: z(o)("chatFilePreview.expand"),
|
|
1959
|
+
"aria-label": z(o)("chatFilePreview.expand"),
|
|
1956
1960
|
onClick: i[5] ||= (e) => a("resize")
|
|
1957
|
-
}, null, 8, ["title", "aria-label"])) : e.resize === "shrink" ? (
|
|
1961
|
+
}, null, 8, ["title", "aria-label"])) : e.resize === "shrink" ? (F(), x(l, {
|
|
1958
1962
|
key: 2,
|
|
1959
1963
|
modifiers: "action-quiet",
|
|
1960
1964
|
icon: "ri:fullscreen-exit-line",
|
|
1961
|
-
title:
|
|
1962
|
-
"aria-label":
|
|
1965
|
+
title: z(o)("chatFilePreview.shrink"),
|
|
1966
|
+
"aria-label": z(o)("chatFilePreview.shrink"),
|
|
1963
1967
|
onClick: i[6] ||= (e) => a("resize")
|
|
1964
|
-
}, null, 8, ["title", "aria-label"])) :
|
|
1965
|
-
|
|
1968
|
+
}, null, 8, ["title", "aria-label"])) : S("", !0),
|
|
1969
|
+
E(l, {
|
|
1966
1970
|
modifiers: "action-quiet",
|
|
1967
1971
|
icon: "ri:close-line",
|
|
1968
|
-
title:
|
|
1969
|
-
"aria-label":
|
|
1972
|
+
title: z(o)("chatFilePreview.close"),
|
|
1973
|
+
"aria-label": z(o)("chatFilePreview.close"),
|
|
1970
1974
|
onClick: i[7] ||= (e) => a("close")
|
|
1971
1975
|
}, null, 8, ["title", "aria-label"])
|
|
1972
1976
|
])
|
|
1973
1977
|
]),
|
|
1974
|
-
|
|
1978
|
+
w("div", _n, [e.loading ? (F(), C("div", vn, [(F(), C(y, null, L(8, (e) => w("div", {
|
|
1975
1979
|
key: e,
|
|
1976
|
-
class:
|
|
1977
|
-
}, null, 2)), 64))])) : e.error || !e.preview ? (
|
|
1980
|
+
class: M(["vv-skeleton__item pk-file-preview__skeleton-line", e % 3 ? "w-full" : "w-128"])
|
|
1981
|
+
}, null, 2)), 64))])) : e.error || !e.preview ? (F(), C("p", yn, R(z(o)("chatFilePreview.unavailable")), 1)) : e.preview.kind === "word" ? (F(), x(tn, {
|
|
1978
1982
|
key: 2,
|
|
1979
1983
|
zoom: g.value,
|
|
1980
1984
|
"onUpdate:zoom": i[8] ||= (e) => g.value = e,
|
|
1981
|
-
fit:
|
|
1982
|
-
"onUpdate:fit": i[9] ||= (e) =>
|
|
1985
|
+
fit: _.value,
|
|
1986
|
+
"onUpdate:fit": i[9] ||= (e) => _.value = e,
|
|
1983
1987
|
preview: e.preview,
|
|
1984
|
-
mode:
|
|
1988
|
+
mode: O.value ? m.value : "markup",
|
|
1985
1989
|
marked: e.changes?.kind === "word" ? e.changes.paragraphs : void 0,
|
|
1986
|
-
onSelect:
|
|
1990
|
+
onSelect: te
|
|
1987
1991
|
}, null, 8, [
|
|
1988
1992
|
"zoom",
|
|
1989
1993
|
"fit",
|
|
1990
1994
|
"preview",
|
|
1991
1995
|
"mode",
|
|
1992
1996
|
"marked"
|
|
1993
|
-
])) : (
|
|
1997
|
+
])) : (F(), x($, {
|
|
1994
1998
|
key: 3,
|
|
1995
1999
|
sheet: h.value,
|
|
1996
2000
|
"onUpdate:sheet": i[10] ||= (e) => h.value = e,
|
|
@@ -1998,28 +2002,28 @@ var W = {
|
|
|
1998
2002
|
"onUpdate:zoom": i[11] ||= (e) => g.value = e,
|
|
1999
2003
|
preview: e.preview,
|
|
2000
2004
|
marked: e.changes?.kind === "spreadsheet" ? e.changes.cells : void 0,
|
|
2001
|
-
onSelect:
|
|
2005
|
+
onSelect: te
|
|
2002
2006
|
}, null, 8, [
|
|
2003
2007
|
"sheet",
|
|
2004
2008
|
"zoom",
|
|
2005
2009
|
"preview",
|
|
2006
2010
|
"marked"
|
|
2007
2011
|
]))]),
|
|
2008
|
-
e.selectionActions &&
|
|
2012
|
+
e.selectionActions && A.value && _e.value ? (F(), x(Ne, {
|
|
2009
2013
|
key: 0,
|
|
2010
|
-
asking:
|
|
2011
|
-
"onUpdate:asking": i[12] ||= (e) =>
|
|
2014
|
+
asking: j.value,
|
|
2015
|
+
"onUpdate:asking": i[12] ||= (e) => j.value = e,
|
|
2012
2016
|
strategy: "absolute",
|
|
2013
|
-
anchor:
|
|
2014
|
-
actions:
|
|
2015
|
-
hint:
|
|
2016
|
-
touch:
|
|
2017
|
-
note:
|
|
2018
|
-
"note-action":
|
|
2019
|
-
onAction:
|
|
2020
|
-
onAsk: i[13] ||= (e) =>
|
|
2021
|
-
onNote:
|
|
2022
|
-
onClose:
|
|
2017
|
+
anchor: _e.value,
|
|
2018
|
+
actions: fe.value,
|
|
2019
|
+
hint: se.value,
|
|
2020
|
+
touch: ne.value,
|
|
2021
|
+
note: P.value ? void 0 : z(o)("selectionActions.notLatest", { version: e.version }),
|
|
2022
|
+
"note-action": z(o)("selectionActions.openLatest"),
|
|
2023
|
+
onAction: K,
|
|
2024
|
+
onAsk: i[13] ||= (e) => he(e, "ask"),
|
|
2025
|
+
onNote: re,
|
|
2026
|
+
onClose: N
|
|
2023
2027
|
}, null, 8, [
|
|
2024
2028
|
"asking",
|
|
2025
2029
|
"anchor",
|
|
@@ -2028,11 +2032,11 @@ var W = {
|
|
|
2028
2032
|
"touch",
|
|
2029
2033
|
"note",
|
|
2030
2034
|
"note-action"
|
|
2031
|
-
])) :
|
|
2032
|
-
], 8,
|
|
2035
|
+
])) : S("", !0)
|
|
2036
|
+
], 8, nn);
|
|
2033
2037
|
};
|
|
2034
2038
|
}
|
|
2035
|
-
}),
|
|
2036
|
-
export {
|
|
2039
|
+
}), xn = /* @__PURE__ */ e({ default: () => Sn }), Sn = bn;
|
|
2040
|
+
export { q as i, xn as n, K as r, Sn as t };
|
|
2037
2041
|
|
|
2038
|
-
//# sourceMappingURL=PkFilePreview-
|
|
2042
|
+
//# sourceMappingURL=PkFilePreview-O8iOSD7k.js.map
|