@8wave/ai-elements 0.125.0-beta.13 → 0.125.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-rAHDDtGS.js → PkFilePreview-8nVPKv8k.js} +348 -320
- package/dist/_chunks/PkFilePreview-8nVPKv8k.js.map +1 -0
- package/dist/_chunks/{PkFilePreviewDialog-BBFrC_rn.js → PkFilePreviewDialog-BHPcGlnF.js} +6 -3
- package/dist/_chunks/PkFilePreviewDialog-BHPcGlnF.js.map +1 -0
- package/dist/ai-elements.es.js +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/_chunks/{PkChatbot-D48q-ulR.js → PkChatbot--fyFCXBu.js} +2 -2
- package/dist-vue/_chunks/{PkChatbot-D48q-ulR.js.map → PkChatbot--fyFCXBu.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-lLX_msKI.js → PkChatbotViewChat-CgJlfyd0.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewChat-lLX_msKI.js.map → PkChatbotViewChat-CgJlfyd0.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreview-Ac_8QIBX.js → PkFilePreview-z7JcRtjP.js} +527 -499
- package/dist-vue/_chunks/PkFilePreview-z7JcRtjP.js.map +1 -0
- package/dist-vue/_chunks/{PkFilePreviewDialog-DGBaeZ8y.js → PkFilePreviewDialog-zVon3aPY.js} +6 -3
- package/dist-vue/_chunks/PkFilePreviewDialog-zVon3aPY.js.map +1 -0
- package/dist-vue/index.js +3 -3
- package/dist-vue/packages/components/src/chat/PkFilePreviewDialog.d.ts +2 -2
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/PkFilePreview-rAHDDtGS.js.map +0 -1
- package/dist/_chunks/PkFilePreviewDialog-BBFrC_rn.js.map +0 -1
- package/dist-vue/_chunks/PkFilePreview-Ac_8QIBX.js.map +0 -1
- package/dist-vue/_chunks/PkFilePreviewDialog-DGBaeZ8y.js.map +0 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { r as e } from "./rolldown-runtime-9rEmUaIe.js";
|
|
2
|
-
import { A as t, B as n, Et as r, F as i, H as a, I as o, J as s, L as c, N as l, Ot as u, Q as d, S as f, Tt as p, V as m, X as h, _ as g, c as ee, d as _, f as v, g as y, gt as b, h as x, j as S, k as C, kt as w, nt as T, ot as E, pt as D, r as O, tt as k, u as A, v as j, vt as M, w as N, wt as P, x as
|
|
3
|
-
import { r as
|
|
4
|
-
import { i as
|
|
2
|
+
import { A as t, B as n, Et as r, F as i, H as a, I as o, J as s, L as c, N as l, Ot as u, Q as d, S as f, Tt as p, V as m, X as h, _ as g, c as ee, d as _, f as v, g as y, gt as b, h as x, j as S, k as C, kt as w, nt as T, ot as E, pt as D, r as O, tt as k, u as A, v as j, vt as M, w as N, wt as P, x as F, y as I, z as L } from "./vue.runtime.esm-bundler-C2U5uTqB.js";
|
|
3
|
+
import { r as te } from "./vue-i18n-POtLvOl1.js";
|
|
4
|
+
import { i as ne, n as re, r as ie } from "./excelNumberFormat-BhQjife9.js";
|
|
5
5
|
import { B as R, G as z, H as ae, I as B, K as V, U as oe, V as se, W as ce, o as le, z as H } from "./utils-BZuri2jT.js";
|
|
6
6
|
import { d as ue, l as de } from "./dist-D6oUr4J_.js";
|
|
7
|
-
import { t as
|
|
8
|
-
import { t as
|
|
9
|
-
import { t as
|
|
10
|
-
import { t as
|
|
7
|
+
import { t as U } from "./index.es-D-aOuzzp.js";
|
|
8
|
+
import { t as fe } from "./VvButtonLocalized-B32dBwWJ.js";
|
|
9
|
+
import { t as W } from "./_plugin-vue_export-helper-Djzt4Yr7.js";
|
|
10
|
+
import { t as pe } from "./PkEditorRadioButtons-ClUWPayk.js";
|
|
11
11
|
// ../../packages/composable/src/useSettledSelection.ts
|
|
12
12
|
E();
|
|
13
|
-
var
|
|
14
|
-
function
|
|
13
|
+
var G = "(hover: hover) and (pointer: fine)";
|
|
14
|
+
function me(e) {
|
|
15
15
|
let t = document.getSelection();
|
|
16
16
|
if (!t || t.rangeCount === 0) return;
|
|
17
17
|
if (e.nodeType === Node.DOCUMENT_NODE) return t.getRangeAt(0).cloneRange();
|
|
@@ -31,13 +31,13 @@ function he(e) {
|
|
|
31
31
|
let r = n.getSelection?.();
|
|
32
32
|
return r && r.rangeCount > 0 ? r.getRangeAt(0).cloneRange() : void 0;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function he({ root: e, enabled: t = () => !0, delay: n = 150, minChars: r = 2 }) {
|
|
35
35
|
let i = M(), a, o = () => {
|
|
36
36
|
clearTimeout(a), i.value = void 0;
|
|
37
37
|
}, s = () => {
|
|
38
38
|
let n = e();
|
|
39
39
|
if (!n || !t()) return;
|
|
40
|
-
let i =
|
|
40
|
+
let i = me(n);
|
|
41
41
|
if (!i || i.collapsed || i.toString().trim().length < r) return;
|
|
42
42
|
let a = i.getBoundingClientRect();
|
|
43
43
|
return {
|
|
@@ -50,7 +50,7 @@ function ge({ root: e, enabled: t = () => !0, delay: n = 150, minChars: r = 2 })
|
|
|
50
50
|
i.value = s();
|
|
51
51
|
}, n);
|
|
52
52
|
};
|
|
53
|
-
return typeof document < "u" && typeof matchMedia == "function" && matchMedia(
|
|
53
|
+
return typeof document < "u" && typeof matchMedia == "function" && matchMedia(G).matches && (document.addEventListener("selectionchange", c), D(() => {
|
|
54
54
|
clearTimeout(a), document.removeEventListener("selectionchange", c);
|
|
55
55
|
})), {
|
|
56
56
|
selection: i,
|
|
@@ -58,26 +58,26 @@ function ge({ root: e, enabled: t = () => !0, delay: n = 150, minChars: r = 2 })
|
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
// ../../packages/components/src/chat/fileSelection.ts
|
|
61
|
-
var
|
|
62
|
-
let t = [...new Set(e)].sort((e, t) =>
|
|
61
|
+
var ge = 2e3, _e = 1e3, K = 60, ve = 1400, q = 20, J = (e) => Number(e.slice(1)), ye = (e) => {
|
|
62
|
+
let t = [...new Set(e)].sort((e, t) => J(e) - J(t)), n = [];
|
|
63
63
|
for (let e of t) {
|
|
64
64
|
let t = n[n.length - 1];
|
|
65
|
-
t &&
|
|
65
|
+
t && J(e) === J(t.to) + 1 ? t.to = e : n.push({
|
|
66
66
|
from: e,
|
|
67
67
|
to: e
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
70
|
return n.slice(0, 100);
|
|
71
|
-
},
|
|
71
|
+
}, be = (e, t) => {
|
|
72
72
|
let n = [];
|
|
73
73
|
for (let r = e.indexOf(t); r >= 0;) n.push(r), r = e.indexOf(t, r + t.length);
|
|
74
74
|
return n;
|
|
75
|
-
},
|
|
76
|
-
let r =
|
|
75
|
+
}, xe = (e, t, n) => {
|
|
76
|
+
let r = be(e, e.slice(t, t + n));
|
|
77
77
|
if (r.length < 2) return {};
|
|
78
78
|
let i = t, a = t + n;
|
|
79
|
-
for (let t = !0; a - i <=
|
|
80
|
-
if (
|
|
79
|
+
for (let t = !0; a - i <= ve; t = !t) {
|
|
80
|
+
if (be(e, e.slice(i, a)).length === 1) return { find: e.slice(i, a) };
|
|
81
81
|
if (t && i > 0) i = e.slice(0, i).replace(/\S*\s*$/, "").length;
|
|
82
82
|
else if (a < e.length) {
|
|
83
83
|
let t = e.slice(a).match(/^\s*\S*/)?.[0] ?? "";
|
|
@@ -88,17 +88,17 @@ var _e = 2e3, ve = 1e3, ye = 60, be = 1400, xe = 20, G = (e) => Number(e.slice(1
|
|
|
88
88
|
index: r.indexOf(t) + 1 || 1,
|
|
89
89
|
of: r.length
|
|
90
90
|
} };
|
|
91
|
-
},
|
|
91
|
+
}, Y = (e) => (e.querySelectorAll("[data-quote-skip]").forEach((e) => e.remove()), e.querySelectorAll("[data-paragraph]").forEach((e) => e.append("\n")), e.textContent ?? ""), X = (e) => e.length > _e ? `${e.slice(0, _e / 2)} […] ${e.slice(-500)}` : e, Z = (e, t, n) => {
|
|
92
92
|
if (!e.contains(t.commonAncestorContainer)) return;
|
|
93
93
|
let r = [...e.querySelectorAll("[data-paragraph]")].filter((e) => !e.closest(n) && t.intersectsNode(e));
|
|
94
94
|
if (!r.length) return;
|
|
95
|
-
let i = r.flatMap((e) => e.dataset.paragraph.split(" ")), a =
|
|
95
|
+
let i = r.flatMap((e) => e.dataset.paragraph.split(" ")), a = Y(t.cloneContents()), o = a.trim();
|
|
96
96
|
if (o.length < 2) return;
|
|
97
97
|
let s = {
|
|
98
98
|
format: "docx",
|
|
99
|
-
runs:
|
|
99
|
+
runs: ye(i),
|
|
100
100
|
paragraphCount: new Set(i).size,
|
|
101
|
-
quote:
|
|
101
|
+
quote: X(o),
|
|
102
102
|
measure: () => {
|
|
103
103
|
let e = t.getBoundingClientRect(), n = t.getClientRects()[0] ?? e;
|
|
104
104
|
return {
|
|
@@ -117,13 +117,13 @@ var _e = 2e3, ve = 1e3, ye = 60, be = 1400, xe = 20, G = (e) => Number(e.slice(1
|
|
|
117
117
|
if (r.length === 1) {
|
|
118
118
|
let e = r[0], n = document.createRange();
|
|
119
119
|
n.selectNodeContents(e);
|
|
120
|
-
let i =
|
|
120
|
+
let i = Y(n.cloneContents()).replace(/\n$/, ""), c = document.createRange();
|
|
121
121
|
c.setStart(e, 0), c.setEnd(t.startContainer, t.startOffset);
|
|
122
|
-
let l =
|
|
123
|
-
s.before = i.slice(Math.max(0, l -
|
|
122
|
+
let l = Y(c.cloneContents()).length + (a.length - a.trimStart().length);
|
|
123
|
+
s.before = i.slice(Math.max(0, l - K), l), s.after = i.slice(l + o.length, l + o.length + K), Object.assign(s, xe(i, l, o.length));
|
|
124
124
|
}
|
|
125
125
|
return s;
|
|
126
|
-
},
|
|
126
|
+
}, Se = (e) => {
|
|
127
127
|
let t = "";
|
|
128
128
|
for (let n = e; n > 0; n = Math.floor((n - 1) / 26)) t = String.fromCharCode(65 + (n - 1) % 26) + t;
|
|
129
129
|
return t;
|
|
@@ -138,7 +138,7 @@ var _e = 2e3, ve = 1e3, ye = 60, be = 1400, xe = 20, G = (e) => Number(e.slice(1
|
|
|
138
138
|
e = !1;
|
|
139
139
|
for (let t of r) t.r1 <= n.r2 && t.r2 >= n.r1 && t.c1 <= n.c2 && t.c2 >= n.c1 && (t.r1 < n.r1 || t.r2 > n.r2 || t.c1 < n.c1 || t.c2 > n.c2) && (n.r1 = Math.min(n.r1, t.r1), n.r2 = Math.max(n.r2, t.r2), n.c1 = Math.min(n.c1, t.c1), n.c2 = Math.max(n.c2, t.c2), e = !0);
|
|
140
140
|
}
|
|
141
|
-
let i = `${
|
|
141
|
+
let i = `${Se(n.c1)}${n.r1}`, a = `${Se(n.c2)}${n.r2}`, o = (e.hiddenRows ?? []).filter((e) => e >= n.r1 && e <= n.r2), s = e.columns.filter((e) => e.hidden && e.col >= n.c1 && e.col <= n.c2).map((e) => Se(e.col)), c = e.rows.filter((e) => e.row >= n.r1 && e.row <= n.r2).flatMap((e) => e.cells.filter((e) => e.col >= n.c1 && e.col <= n.c2 && e.value !== void 0 && e.value !== "")).slice(0, q).map((e) => String(e.value)).join("; ").slice(0, 500);
|
|
142
142
|
return {
|
|
143
143
|
format: "xlsx",
|
|
144
144
|
sheet: e.name,
|
|
@@ -151,10 +151,10 @@ var _e = 2e3, ve = 1e3, ye = 60, be = 1400, xe = 20, G = (e) => Number(e.slice(1
|
|
|
151
151
|
};
|
|
152
152
|
// ../../packages/components/src/chat/PkSelectionActions.vue?vue&type=script&setup=true&lang.ts
|
|
153
153
|
C(), O(), E(), p();
|
|
154
|
-
var
|
|
154
|
+
var Q = ["onKeydown"], we = ["placeholder", "aria-label"], $ = ["disabled"], Te = ["aria-label"], Ee = { class: "pk-selection-actions__text" }, De = {
|
|
155
155
|
key: 0,
|
|
156
156
|
class: "pk-selection-actions__text"
|
|
157
|
-
},
|
|
157
|
+
}, Oe = ["onClick"], ke = /*#__PURE__*/ W(/* @__PURE__ */ N({
|
|
158
158
|
__name: "PkSelectionActions",
|
|
159
159
|
props: /*@__PURE__*/ l({
|
|
160
160
|
actions: { type: Array },
|
|
@@ -178,7 +178,7 @@ var we = ["onKeydown"], Te = ["placeholder", "aria-label"], Q = ["disabled"], Ee
|
|
|
178
178
|
"close"
|
|
179
179
|
], ["update:asking"]),
|
|
180
180
|
setup(e, { emit: t }) {
|
|
181
|
-
let n = e, o = t, c = s(e, "asking"), { t: l } =
|
|
181
|
+
let n = e, o = t, c = s(e, "asking"), { t: l } = te({ useScope: "global" }), d = h("barEl"), f = h("inputEl"), { width: p, height: g } = de(d, void 0, { box: "border-box" }), S = x(() => B({
|
|
182
182
|
...n.anchor,
|
|
183
183
|
bar: {
|
|
184
184
|
width: p.value,
|
|
@@ -200,7 +200,7 @@ var we = ["onKeydown"], Te = ["placeholder", "aria-label"], Q = ["disabled"], Ee
|
|
|
200
200
|
}, N = () => {
|
|
201
201
|
C.value ? O() : o("close");
|
|
202
202
|
};
|
|
203
|
-
return (t, n) => (
|
|
203
|
+
return (t, n) => (L(), I("div", {
|
|
204
204
|
class: r(["pk-selection-actions", {
|
|
205
205
|
"pk-selection-actions--fixed": e.strategy === "fixed",
|
|
206
206
|
"pk-selection-actions--asking": !!C.value
|
|
@@ -210,7 +210,7 @@ var we = ["onKeydown"], Te = ["placeholder", "aria-label"], Q = ["disabled"], Ee
|
|
|
210
210
|
left: `${S.value.left}px`
|
|
211
211
|
}),
|
|
212
212
|
onKeydown: A(_(N, ["stop"]), ["esc"])
|
|
213
|
-
}, [C.value ? (
|
|
213
|
+
}, [C.value ? (L(), I("form", {
|
|
214
214
|
key: 0,
|
|
215
215
|
ref_key: "barEl",
|
|
216
216
|
ref: d,
|
|
@@ -225,60 +225,60 @@ var we = ["onKeydown"], Te = ["placeholder", "aria-label"], Q = ["disabled"], Ee
|
|
|
225
225
|
maxlength: "500",
|
|
226
226
|
placeholder: C.value.placeholder,
|
|
227
227
|
"aria-label": C.value.placeholder
|
|
228
|
-
}, null, 8,
|
|
228
|
+
}, null, 8, we), [[ee, E.value]]), y("button", {
|
|
229
229
|
type: "submit",
|
|
230
230
|
class: "pk-selection-actions__button pk-selection-actions__button--send",
|
|
231
231
|
disabled: !E.value.trim()
|
|
232
|
-
}, w(P(l)("action.send")), 9,
|
|
232
|
+
}, w(P(l)("action.send")), 9, $)], 544)) : (L(), I("div", {
|
|
233
233
|
key: 1,
|
|
234
234
|
ref_key: "barEl",
|
|
235
235
|
ref: d,
|
|
236
236
|
class: "pk-selection-actions__bar",
|
|
237
237
|
role: "toolbar",
|
|
238
238
|
"aria-label": P(l)("selectionActions.label")
|
|
239
|
-
}, [e.note ? (
|
|
239
|
+
}, [e.note ? (L(), I(v, { key: 0 }, [y("span", Ee, w(e.note), 1), e.noteAction ? (L(), I("button", {
|
|
240
240
|
key: 0,
|
|
241
241
|
type: "button",
|
|
242
242
|
class: "pk-selection-actions__button",
|
|
243
243
|
onMousedown: n[1] ||= _(() => {}, ["prevent"]),
|
|
244
244
|
onClick: n[2] ||= (e) => o("note")
|
|
245
|
-
}, w(e.noteAction), 33)) : j("", !0)], 64)) : (
|
|
246
|
-
e.hint ? (
|
|
247
|
-
(
|
|
245
|
+
}, w(e.noteAction), 33)) : j("", !0)], 64)) : (L(), I(v, { key: 1 }, [
|
|
246
|
+
e.hint ? (L(), I("span", De, w(e.hint), 1)) : j("", !0),
|
|
247
|
+
(L(!0), I(v, null, m(e.actions, (e) => (L(), I("button", {
|
|
248
248
|
key: e.id,
|
|
249
249
|
type: "button",
|
|
250
250
|
class: "pk-selection-actions__button",
|
|
251
251
|
onMousedown: n[3] ||= _(() => {}, ["prevent"]),
|
|
252
252
|
onClick: (t) => k(e)
|
|
253
|
-
}, w(e.label), 41,
|
|
253
|
+
}, w(e.label), 41, Oe))), 128)),
|
|
254
254
|
y("button", {
|
|
255
255
|
type: "button",
|
|
256
256
|
class: "pk-selection-actions__button",
|
|
257
257
|
onMousedown: n[4] ||= _(() => {}, ["prevent"]),
|
|
258
258
|
onClick: n[5] ||= (e) => D(void 0, P(l)("selectionActions.askPlaceholder"))
|
|
259
259
|
}, w(P(l)("selectionActions.ask")), 33)
|
|
260
|
-
], 64))], 8,
|
|
260
|
+
], 64))], 8, Te)), a(t.$slots, "card")], 46, Q));
|
|
261
261
|
}
|
|
262
262
|
}), [["styles", [".pk-selection-actions{z-index:10;max-width:min(32rem, 100% - var(--spacing-16));position:absolute}.pk-selection-actions--fixed{z-index:2147483647;position:fixed}.pk-selection-actions--asking{width:min(var(--spacing-384), 100% - var(--spacing-16))}.pk-selection-actions__bar{align-items:center;gap:var(--spacing-4);width:max-content;max-width:100%;padding:var(--spacing-4);border-radius:var(--rounded-lg);background-color:var(--color-word-1);color:var(--color-surface);font-family:var(--font-sans);font-size:var(--text-14);font-weight:var(--font-medium);box-shadow:var(--shadow-lg);flex-wrap:wrap;display:flex}.pk-selection-actions__bar--field{flex-wrap:nowrap;width:100%}.pk-selection-actions__text{padding:0 var(--spacing-8);opacity:.75;font-size:var(--text-12);font-weight:var(--font-normal)}.pk-selection-actions__button{border-radius:var(--rounded);padding:var(--spacing-6) var(--spacing-10);color:inherit;font:inherit;cursor:pointer;background-color:#0000;border:0;flex-shrink:0}.pk-selection-actions__button:hover{background-color:color-mix(in srgb, var(--color-surface) 16%, transparent)}.pk-selection-actions__button:focus-visible{outline:var(--spacing-2) solid var(--color-surface);outline-offset:calc(-1 * var(--spacing-2))}.pk-selection-actions__button--send{background-color:var(--color-surface);color:var(--color-word-1)}.pk-selection-actions__button--send:hover{background-color:var(--color-surface)}.pk-selection-actions__button--send:disabled{opacity:.5;cursor:default}.pk-selection-actions__input{border-radius:var(--rounded);min-width:0;padding:var(--spacing-6) var(--spacing-8);background-color:color-mix(in srgb, var(--color-surface) 12%, transparent);color:inherit;font:inherit;font-weight:var(--font-normal);border:0;flex:1}.pk-selection-actions__input::placeholder{color:inherit;opacity:.6}.pk-selection-actions__input:focus-visible{outline:var(--spacing-2) solid var(--color-surface);outline-offset:calc(-1 * var(--spacing-2))}"]]]);
|
|
263
263
|
// ../../packages/components/src/chat/PkSpreadsheetPreview.vue?vue&type=script&setup=true&lang.ts
|
|
264
264
|
C(), E(), p(), O();
|
|
265
|
-
var
|
|
265
|
+
var Ae = { class: "pk-spreadsheet-preview" }, je = { class: "pk-spreadsheet-preview__bar" }, Me = ["aria-label"], Ne = ["aria-label"], Pe = ["aria-label"], Fe = [
|
|
266
266
|
"rowspan",
|
|
267
267
|
"colspan",
|
|
268
268
|
"data-focus",
|
|
269
269
|
"title",
|
|
270
270
|
"onMousedown",
|
|
271
271
|
"onMouseenter"
|
|
272
|
-
],
|
|
272
|
+
], Ie = {
|
|
273
273
|
key: 1,
|
|
274
274
|
class: "pk-spreadsheet-preview__more"
|
|
275
|
-
},
|
|
275
|
+
}, Le = ["aria-label"], Re = ["aria-current", "onClick"], ze = { class: "pk-spreadsheet-preview__status" }, Be = { class: "pk-spreadsheet-preview__info" }, Ve = ["title"], He = ["title"], Ue = {
|
|
276
276
|
key: 2,
|
|
277
277
|
class: "pk-spreadsheet-preview__stats"
|
|
278
|
-
},
|
|
278
|
+
}, We = {
|
|
279
279
|
key: 0,
|
|
280
280
|
class: "pk-spreadsheet-preview__average"
|
|
281
|
-
},
|
|
281
|
+
}, Ge = { key: 1 }, Ke = { class: "pk-spreadsheet-preview__zoom" }, qe = { class: "pk-spreadsheet-preview__percent" }, Je = 64, Ye = 20, Xe = 28, Ze = 44, Qe = /*#__PURE__*/ W(/* @__PURE__ */ N({
|
|
282
282
|
__name: "PkSpreadsheetPreview",
|
|
283
283
|
props: /*@__PURE__*/ l({ preview: { type: null } }, {
|
|
284
284
|
sheet: { default: 0 },
|
|
@@ -288,7 +288,7 @@ var je = { class: "pk-spreadsheet-preview" }, Me = { class: "pk-spreadsheet-prev
|
|
|
288
288
|
}),
|
|
289
289
|
emits: /*@__PURE__*/ l(["select"], ["update:sheet", "update:zoom"]),
|
|
290
290
|
setup(e, { emit: t }) {
|
|
291
|
-
let n = e, a = t, { t: o, locale: c } =
|
|
291
|
+
let n = e, a = t, { t: o, locale: c } = te({ useScope: "global" }), l = s(e, "sheet"), p = s(e, "zoom"), g = h("scrollEl"), { width: ee, height: C } = de(g, {
|
|
292
292
|
width: 0,
|
|
293
293
|
height: 0
|
|
294
294
|
}, { box: "border-box" }), T = x(() => n.preview.sheets[l.value] ?? n.preview.sheets[0]);
|
|
@@ -302,27 +302,27 @@ var je = { class: "pk-spreadsheet-preview" }, Me = { class: "pk-spreadsheet-prev
|
|
|
302
302
|
}, D = x(() => {
|
|
303
303
|
let e = T.value;
|
|
304
304
|
if (!e) return [];
|
|
305
|
-
let t = new Set(e.columns.filter((e) => e.hidden).map((e) => e.col)), n = new Map(e.columns.map((e) => [e.col, e.width])), r = [], i =
|
|
305
|
+
let t = new Set(e.columns.filter((e) => e.hidden).map((e) => e.col)), n = new Map(e.columns.map((e) => [e.col, e.width])), r = [], i = Ze, a = ee.value / p.value;
|
|
306
306
|
for (let o = 1; o <= e.lastColumn || !e.moreColumns && (o <= e.lastColumn + 2 || i < a); o++) {
|
|
307
307
|
if (t.has(o)) continue;
|
|
308
|
-
let e = n.get(o) ??
|
|
308
|
+
let e = n.get(o) ?? Je;
|
|
309
309
|
r.push({
|
|
310
310
|
col: o,
|
|
311
311
|
width: e
|
|
312
312
|
}), i += e;
|
|
313
313
|
}
|
|
314
314
|
return r;
|
|
315
|
-
}), O = x(() => D.value.reduce((e, t) => e + t.width,
|
|
315
|
+
}), O = x(() => D.value.reduce((e, t) => e + t.width, Ze)), k = x(() => D.value.map((e) => `${e.col}:${e.width}`).join(",")), A = /* @__PURE__ */ new WeakMap(), M = x(() => {
|
|
316
316
|
let e = T.value;
|
|
317
317
|
if (!e) return [];
|
|
318
|
-
let t = new Set(e.hiddenRows ?? []), n = new Map(e.rows.map((e) => [e.row, e.height])), r = Math.ceil((C.value / p.value -
|
|
318
|
+
let t = new Set(e.hiddenRows ?? []), n = new Map(e.rows.map((e) => [e.row, e.height])), r = Math.ceil((C.value / p.value - Xe) / Ye), i = e.moreRows ? e.lastRow : Math.max(e.lastRow + 5, r + t.size), a = A.get(e);
|
|
319
319
|
a || (a = /* @__PURE__ */ new Map(), A.set(e, a));
|
|
320
320
|
let o = a;
|
|
321
321
|
return Array.from({ length: i }, (e, t) => t + 1).filter((e) => !t.has(e)).map((e) => {
|
|
322
322
|
let t = o.get(e);
|
|
323
323
|
return t || (t = {
|
|
324
324
|
row: e,
|
|
325
|
-
height: n.get(e) ??
|
|
325
|
+
height: n.get(e) ?? Ye
|
|
326
326
|
}, o.set(e, t)), t;
|
|
327
327
|
});
|
|
328
328
|
}), N = x(() => {
|
|
@@ -345,7 +345,7 @@ var je = { class: "pk-spreadsheet-preview" }, Me = { class: "pk-spreadsheet-prev
|
|
|
345
345
|
}, B = (e) => e?.style === void 0 ? void 0 : n.preview.styles[e.style], V = (e) => {
|
|
346
346
|
let t = e.numFmt === void 0 ? void 0 : n.preview.numberFormats?.[e.numFmt], r = e.value;
|
|
347
347
|
if (t !== void 0) try {
|
|
348
|
-
return e.format === "date" ? e.serial === void 0 ? void 0 : re(t, e.serial, c.value, n.preview.date1904) : typeof r == "number" ?
|
|
348
|
+
return e.format === "date" ? e.serial === void 0 ? void 0 : re(t, e.serial, c.value, n.preview.date1904) : typeof r == "number" ? ne(t) ? re(t, r, c.value, n.preview.date1904) : ie(t, r, c.value) : void 0;
|
|
349
349
|
} catch {
|
|
350
350
|
return;
|
|
351
351
|
}
|
|
@@ -399,27 +399,27 @@ var je = { class: "pk-spreadsheet-preview" }, Me = { class: "pk-spreadsheet-prev
|
|
|
399
399
|
let e = `${4 + r.indent * 9}px`;
|
|
400
400
|
o.textAlign === "right" ? o.paddingRight = e : o.paddingLeft = e;
|
|
401
401
|
}
|
|
402
|
-
return
|
|
403
|
-
},
|
|
402
|
+
return U(t, n) ? (o.borderStyle = "hidden", o.boxShadow = q(e, t, n)) : (o.borderTop = H(r?.borders?.top), o.borderRight = H(r?.borders?.right), o.borderBottom = H(r?.borders?.bottom), o.borderLeft = H(r?.borders?.left), o.boxShadow = G(e, t, n).join(", ")), Object.assign(o, xe(t, n)), o;
|
|
403
|
+
}, U = (e, t) => {
|
|
404
404
|
let n = T.value?.frozen;
|
|
405
405
|
return !!n && (e <= n.rows || t <= n.cols);
|
|
406
|
-
},
|
|
406
|
+
}, W = {
|
|
407
407
|
top: (e) => `inset 0 ${e.width}px 0 ${e.color}`,
|
|
408
408
|
right: (e) => `inset -${e.width}px 0 0 ${e.color}`,
|
|
409
409
|
bottom: (e) => `inset 0 -${e.width}px 0 ${e.color}`,
|
|
410
410
|
left: (e) => `inset ${e.width}px 0 0 ${e.color}`
|
|
411
|
-
},
|
|
411
|
+
}, pe = (...e) => e.reduce((e, t) => t && (!e || t.width > e.width) ? t : e, void 0), G = (e, t, n) => {
|
|
412
412
|
let r = B(e)?.borders;
|
|
413
|
-
return [t === M.value[0]?.row && r?.top &&
|
|
414
|
-
},
|
|
413
|
+
return [t === M.value[0]?.row && r?.top && W.top(r.top), n === D.value[0]?.col && r?.left && W.left(r.left)].filter((e) => !!e);
|
|
414
|
+
}, me = x(() => M.value.map((e) => e.row)), he = x(() => D.value.map((e) => e.col)), ge = x(() => new Map(me.value.map((e, t) => [e, t]))), _e = x(() => new Map(he.value.map((e, t) => [e, t]))), K = (e, t, n, r) => {
|
|
415
415
|
let i = [], a = t.get(n) ?? e.length;
|
|
416
416
|
for (; a < e.length && e[a] < n + r; a++) i.push(e[a]);
|
|
417
417
|
return {
|
|
418
418
|
spanned: i,
|
|
419
419
|
next: e[a]
|
|
420
420
|
};
|
|
421
|
-
},
|
|
422
|
-
let { spanned: i, next: a } =
|
|
421
|
+
}, ve = (e, t, n, r) => {
|
|
422
|
+
let { spanned: i, next: a } = K(me.value, ge.value, t, e?.span?.rows ?? 1), { spanned: o, next: s } = K(he.value, _e.value, n, e?.span?.cols ?? 1);
|
|
423
423
|
return (r === "right" ? s === void 0 ? [] : i.map((e) => ({
|
|
424
424
|
row: e,
|
|
425
425
|
col: s
|
|
@@ -430,59 +430,59 @@ var je = { class: "pk-spreadsheet-preview" }, Me = { class: "pk-spreadsheet-prev
|
|
|
430
430
|
let t = R.value.get(`${e.row},${e.col}`) ?? e;
|
|
431
431
|
return z(t.row, t.col);
|
|
432
432
|
});
|
|
433
|
-
},
|
|
434
|
-
let r = B(e)?.borders, i =
|
|
433
|
+
}, q = (e, t, n) => {
|
|
434
|
+
let r = B(e)?.borders, i = pe(r?.right, ...ve(e, t, n, "right").map((e) => B(e)?.borders?.left)), a = pe(r?.bottom, ...ve(e, t, n, "bottom").map((e) => B(e)?.borders?.top)), o = T.value?.gridlines;
|
|
435
435
|
return [
|
|
436
|
-
i ?
|
|
437
|
-
a ?
|
|
438
|
-
...
|
|
436
|
+
i ? W.right(i) : o && "inset calc(var(--border) * -1) 0 0 var(--pk-spreadsheet-gridline)",
|
|
437
|
+
a ? W.bottom(a) : o && "inset 0 calc(var(--border) * -1) 0 var(--pk-spreadsheet-gridline)",
|
|
438
|
+
...G(e, t, n)
|
|
439
439
|
].filter(Boolean).join(", ");
|
|
440
|
-
},
|
|
440
|
+
}, J = (e) => Xe + M.value.filter((t) => t.row < e).reduce((e, t) => e + t.height, 0), ye = (e) => Ze + D.value.filter((t) => t.col < e).reduce((e, t) => e + t.width, 0), be = x(() => {
|
|
441
441
|
let e = T.value?.frozen;
|
|
442
442
|
return {
|
|
443
|
-
top:
|
|
444
|
-
left:
|
|
443
|
+
top: J((e?.rows ?? 0) + 1),
|
|
444
|
+
left: ye((e?.cols ?? 0) + 1)
|
|
445
445
|
};
|
|
446
|
-
}),
|
|
446
|
+
}), xe = (e, t) => {
|
|
447
447
|
let n = T.value?.frozen;
|
|
448
448
|
if (!n) return {};
|
|
449
449
|
let r = {};
|
|
450
|
-
return e <= n.rows && (r.position = "sticky", r.top = `${
|
|
451
|
-
},
|
|
450
|
+
return e <= n.rows && (r.position = "sticky", r.top = `${J(e)}px`, r.scrollMarginTop = r.top, r.zIndex = 0), t <= n.cols && (r.position = "sticky", r.left = `${ye(t)}px`, r.scrollMarginLeft = r.left, r.zIndex = +(e <= n.rows)), r;
|
|
451
|
+
}, Y = b({
|
|
452
452
|
row: 1,
|
|
453
453
|
col: 1
|
|
454
|
-
}),
|
|
454
|
+
}), X = b({
|
|
455
455
|
row: 1,
|
|
456
456
|
col: 1
|
|
457
457
|
});
|
|
458
458
|
d(T, () => {
|
|
459
|
-
|
|
459
|
+
Y.value = {
|
|
460
460
|
row: 1,
|
|
461
461
|
col: 1
|
|
462
|
-
},
|
|
462
|
+
}, X.value = {
|
|
463
463
|
row: 1,
|
|
464
464
|
col: 1
|
|
465
465
|
};
|
|
466
466
|
});
|
|
467
|
-
let
|
|
468
|
-
r1: Math.min(
|
|
469
|
-
r2: Math.max(
|
|
470
|
-
c1: Math.min(
|
|
471
|
-
c2: Math.max(
|
|
472
|
-
})),
|
|
473
|
-
g.value?.focus({ preventScroll: !0 }),
|
|
467
|
+
let Z = x(() => ({
|
|
468
|
+
r1: Math.min(Y.value.row, X.value.row),
|
|
469
|
+
r2: Math.max(Y.value.row, X.value.row),
|
|
470
|
+
c1: Math.min(Y.value.col, X.value.col),
|
|
471
|
+
c2: Math.max(Y.value.col, X.value.col)
|
|
472
|
+
})), Se = (e, t) => e >= Z.value.r1 && e <= Z.value.r2 && t >= Z.value.c1 && t <= Z.value.c2, Q = (e, t) => X.value.row === e && X.value.col === t, we = (e) => e >= Z.value.r1 && e <= Z.value.r2 ? `${Z.value.c1}:${Z.value.c2}:${X.value.row === e ? X.value.col : 0}` : "", $ = b(!1), Te = (e, t, n) => {
|
|
473
|
+
g.value?.focus({ preventScroll: !0 }), X.value = {
|
|
474
474
|
row: e,
|
|
475
475
|
col: t
|
|
476
|
-
}, n.shiftKey || (
|
|
476
|
+
}, n.shiftKey || (Y.value = {
|
|
477
477
|
row: e,
|
|
478
478
|
col: t
|
|
479
|
-
}),
|
|
480
|
-
},
|
|
481
|
-
|
|
479
|
+
}), $.value = !0;
|
|
480
|
+
}, Ee = (e, t) => {
|
|
481
|
+
$.value && (X.value = {
|
|
482
482
|
row: e,
|
|
483
483
|
col: t
|
|
484
484
|
});
|
|
485
|
-
},
|
|
485
|
+
}, De, Oe = () => {
|
|
486
486
|
let e = [...g.value?.querySelectorAll(".pk-spreadsheet-preview__cell--range, [data-focus]") ?? []].map((e) => e.getBoundingClientRect());
|
|
487
487
|
if (e.length) return {
|
|
488
488
|
start: {
|
|
@@ -491,19 +491,19 @@ var je = { class: "pk-spreadsheet-preview" }, Me = { class: "pk-spreadsheet-prev
|
|
|
491
491
|
},
|
|
492
492
|
bottom: Math.max(...e.map((e) => e.bottom))
|
|
493
493
|
};
|
|
494
|
-
},
|
|
495
|
-
...Ce(T.value,
|
|
496
|
-
measure:
|
|
494
|
+
}, ke = () => T.value ? {
|
|
495
|
+
...Ce(T.value, Z.value),
|
|
496
|
+
measure: Oe
|
|
497
497
|
} : void 0;
|
|
498
|
-
d([
|
|
499
|
-
clearTimeout(
|
|
500
|
-
let e =
|
|
501
|
-
a("select", t ?
|
|
498
|
+
d([Z, $], () => {
|
|
499
|
+
clearTimeout(De), !$.value && (De = setTimeout(() => {
|
|
500
|
+
let e = Z.value, t = e.r2 > e.r1 || e.c2 > e.c1;
|
|
501
|
+
a("select", t ? ke() : void 0);
|
|
502
502
|
}, 150));
|
|
503
503
|
});
|
|
504
|
-
let
|
|
505
|
-
clearTimeout(
|
|
506
|
-
},
|
|
504
|
+
let Qe = () => {
|
|
505
|
+
clearTimeout(De), a("select", ke());
|
|
506
|
+
}, $e = (e) => {
|
|
507
507
|
let t = {
|
|
508
508
|
ArrowUp: [-1, 0],
|
|
509
509
|
ArrowDown: [1, 0],
|
|
@@ -514,7 +514,7 @@ var je = { class: "pk-spreadsheet-preview" }, Me = { class: "pk-spreadsheet-prev
|
|
|
514
514
|
}[e.key];
|
|
515
515
|
if (!t) return;
|
|
516
516
|
e.preventDefault();
|
|
517
|
-
let n = M.value.map((e) => e.row), r = D.value.map((e) => e.col), a = (e) => R.value.get(`${e.row},${e.col}`) ?? e, o = a(
|
|
517
|
+
let n = M.value.map((e) => e.row), r = D.value.map((e) => e.col), a = (e) => R.value.get(`${e.row},${e.col}`) ?? e, o = a(X.value), s = n.indexOf(X.value.row), c = r.indexOf(X.value.col), l = o;
|
|
518
518
|
for (;;) {
|
|
519
519
|
let e = Math.min(n.length - 1, Math.max(0, s + t[0])), i = Math.min(r.length - 1, Math.max(0, c + t[1]));
|
|
520
520
|
if (e === s && i === c || (s = e, c = i, l = a({
|
|
@@ -522,12 +522,12 @@ var je = { class: "pk-spreadsheet-preview" }, Me = { class: "pk-spreadsheet-prev
|
|
|
522
522
|
col: r[c]
|
|
523
523
|
}), l.row !== o.row || l.col !== o.col)) break;
|
|
524
524
|
}
|
|
525
|
-
|
|
525
|
+
X.value = l, e.shiftKey || (Y.value = l), i(() => g.value?.querySelector("[data-focus]")?.scrollIntoView({
|
|
526
526
|
block: "nearest",
|
|
527
527
|
inline: "nearest"
|
|
528
528
|
}));
|
|
529
|
-
},
|
|
530
|
-
let { r1: e, r2: t, c1: n, c2: r } =
|
|
529
|
+
}, et = x(() => z(X.value.row, X.value.col)), tt = x(() => {
|
|
530
|
+
let { r1: e, r2: t, c1: n, c2: r } = Z.value;
|
|
531
531
|
if (e === t && n === r) return;
|
|
532
532
|
let i = 0, a = 0, o = 0, s;
|
|
533
533
|
for (let c = e; c <= t; c++) for (let e = n; e <= r; e++) {
|
|
@@ -543,13 +543,13 @@ var je = { class: "pk-spreadsheet-preview" }, Me = { class: "pk-spreadsheet-prev
|
|
|
543
543
|
p.value = Math.min(2, Math.max(.5, Math.round((p.value + e) * 10) / 10));
|
|
544
544
|
};
|
|
545
545
|
return (t, n) => {
|
|
546
|
-
let i =
|
|
547
|
-
return
|
|
548
|
-
y("div",
|
|
546
|
+
let i = fe;
|
|
547
|
+
return L(), I("div", Ae, [
|
|
548
|
+
y("div", je, [
|
|
549
549
|
y("span", {
|
|
550
550
|
class: "pk-spreadsheet-preview__ref",
|
|
551
551
|
"aria-label": P(o)("chatFilePreview.cell")
|
|
552
|
-
}, w(E(
|
|
552
|
+
}, w(E(X.value.col)) + w(X.value.row), 9, Me),
|
|
553
553
|
n[6] ||= y("span", {
|
|
554
554
|
class: "pk-spreadsheet-preview__fx",
|
|
555
555
|
"aria-hidden": "true"
|
|
@@ -557,7 +557,7 @@ var je = { class: "pk-spreadsheet-preview" }, Me = { class: "pk-spreadsheet-prev
|
|
|
557
557
|
y("output", {
|
|
558
558
|
class: "pk-spreadsheet-preview__formula",
|
|
559
559
|
"aria-label": P(o)("chatFilePreview.formulaBar")
|
|
560
|
-
}, w(le(
|
|
560
|
+
}, w(le(et.value)), 9, Ne)
|
|
561
561
|
]),
|
|
562
562
|
y("div", {
|
|
563
563
|
ref_key: "scrollEl",
|
|
@@ -566,93 +566,93 @@ var je = { class: "pk-spreadsheet-preview" }, Me = { class: "pk-spreadsheet-prev
|
|
|
566
566
|
tabindex: "0",
|
|
567
567
|
role: "grid",
|
|
568
568
|
"aria-label": T.value?.name,
|
|
569
|
-
onKeydown:
|
|
570
|
-
onMouseup: n[2] ||= (e) =>
|
|
571
|
-
onMouseleave: n[3] ||= (e) =>
|
|
572
|
-
}, [T.value ? (
|
|
569
|
+
onKeydown: $e,
|
|
570
|
+
onMouseup: n[2] ||= (e) => $.value = !1,
|
|
571
|
+
onMouseleave: n[3] ||= (e) => $.value = !1
|
|
572
|
+
}, [T.value ? (L(), I("table", {
|
|
573
573
|
key: 0,
|
|
574
574
|
class: r(["pk-spreadsheet-preview__grid", { "pk-spreadsheet-preview__grid--lines": T.value.gridlines }]),
|
|
575
575
|
style: u({
|
|
576
576
|
zoom: p.value,
|
|
577
577
|
width: `${O.value}px`,
|
|
578
|
-
"--pk-spreadsheet-stuck-top": `${
|
|
579
|
-
"--pk-spreadsheet-stuck-left": `${
|
|
578
|
+
"--pk-spreadsheet-stuck-top": `${be.value.top}px`,
|
|
579
|
+
"--pk-spreadsheet-stuck-left": `${be.value.left}px`
|
|
580
580
|
})
|
|
581
581
|
}, [
|
|
582
|
-
y("colgroup", null, [y("col", { style: u({ width: `${
|
|
582
|
+
y("colgroup", null, [y("col", { style: u({ width: `${Ze}px` }) }, null, 4), (L(!0), I(v, null, m(D.value, (e) => (L(), I("col", {
|
|
583
583
|
key: e.col,
|
|
584
584
|
style: u({ width: `${e.width}px` })
|
|
585
585
|
}, null, 4))), 128))]),
|
|
586
|
-
y("thead", null, [y("tr", { style: u({ height: `${
|
|
586
|
+
y("thead", null, [y("tr", { style: u({ height: `${Xe}px` }) }, [n[7] ||= y("th", { class: "pk-spreadsheet-preview__corner" }, null, -1), (L(!0), I(v, null, m(D.value, (e) => (L(), I("th", {
|
|
587
587
|
key: e.col,
|
|
588
588
|
scope: "col",
|
|
589
|
-
class: r(["pk-spreadsheet-preview__head", { "pk-spreadsheet-preview__head--current": e.col >=
|
|
589
|
+
class: r(["pk-spreadsheet-preview__head", { "pk-spreadsheet-preview__head--current": e.col >= Z.value.c1 && e.col <= Z.value.c2 }]),
|
|
590
590
|
style: u(T.value.frozen && e.col <= T.value.frozen.cols ? {
|
|
591
|
-
left: `${
|
|
591
|
+
left: `${ye(e.col)}px`,
|
|
592
592
|
zIndex: 2
|
|
593
593
|
} : void 0)
|
|
594
594
|
}, w(E(e.col)), 7))), 128))], 4)]),
|
|
595
|
-
y("tbody", null, [(
|
|
595
|
+
y("tbody", null, [(L(!0), I(v, null, m(M.value, (e, t, n, i) => {
|
|
596
596
|
let a = [
|
|
597
597
|
e,
|
|
598
598
|
T.value,
|
|
599
599
|
k.value,
|
|
600
600
|
P(c),
|
|
601
|
-
|
|
601
|
+
we(e.row)
|
|
602
602
|
];
|
|
603
603
|
if (i && i.el && i.key === e.row && S(i, a)) return i;
|
|
604
|
-
let s = (
|
|
604
|
+
let s = (L(), I("tr", {
|
|
605
605
|
key: e.row,
|
|
606
606
|
style: u({ height: `${e.height}px` })
|
|
607
607
|
}, [y("th", {
|
|
608
608
|
scope: "row",
|
|
609
|
-
class: r(["pk-spreadsheet-preview__row", { "pk-spreadsheet-preview__row--current": e.row >=
|
|
609
|
+
class: r(["pk-spreadsheet-preview__row", { "pk-spreadsheet-preview__row--current": e.row >= Z.value.r1 && e.row <= Z.value.r2 }]),
|
|
610
610
|
style: u(T.value.frozen && e.row <= T.value.frozen.rows ? {
|
|
611
|
-
...
|
|
611
|
+
...xe(e.row, 0),
|
|
612
612
|
left: 0,
|
|
613
613
|
zIndex: 4
|
|
614
614
|
} : void 0)
|
|
615
|
-
}, w(e.row), 7), (
|
|
615
|
+
}, w(e.row), 7), (L(!0), I(v, null, m(D.value, (t) => (L(), I(v, { key: t.col }, [R.value.has(`${e.row},${t.col}`) ? j("", !0) : (L(), I("td", {
|
|
616
616
|
key: 0,
|
|
617
617
|
rowspan: ae(e.row, t.col)?.rows,
|
|
618
618
|
colspan: ae(e.row, t.col)?.cols,
|
|
619
619
|
class: r(["pk-spreadsheet-preview__cell", {
|
|
620
|
-
"pk-spreadsheet-preview__cell--range":
|
|
620
|
+
"pk-spreadsheet-preview__cell--range": Se(e.row, t.col) && !Q(e.row, t.col),
|
|
621
621
|
"pk-spreadsheet-preview__cell--missing": z(e.row, t.col)?.missing
|
|
622
622
|
}]),
|
|
623
623
|
style: u(ue(z(e.row, t.col), e.row, t.col)),
|
|
624
|
-
"data-focus":
|
|
624
|
+
"data-focus": Q(e.row, t.col) ? "" : void 0,
|
|
625
625
|
title: z(e.row, t.col)?.missing ? P(o)("chatFilePreview.missingValue") : void 0,
|
|
626
|
-
onMousedown: _((n) =>
|
|
627
|
-
onMouseenter: (n) =>
|
|
628
|
-
onDblclick:
|
|
629
|
-
}, w(ce(z(e.row, t.col))), 47,
|
|
626
|
+
onMousedown: _((n) => Te(e.row, t.col, n), ["prevent"]),
|
|
627
|
+
onMouseenter: (n) => Ee(e.row, t.col),
|
|
628
|
+
onDblclick: Qe
|
|
629
|
+
}, w(ce(z(e.row, t.col))), 47, Fe))], 64))), 128))], 4));
|
|
630
630
|
return s.memo = a, s;
|
|
631
631
|
}, n, 0), 128))])
|
|
632
|
-
], 6)) : j("", !0), T.value && (T.value.moreRows || T.value.moreColumns) ? (
|
|
632
|
+
], 6)) : j("", !0), T.value && (T.value.moreRows || T.value.moreColumns) ? (L(), I("p", Ie, [T.value.moreRows ? (L(), I(v, { key: 0 }, [F(w(P(o)("chatFilePreview.moreRows", T.value.moreRows)), 1)], 64)) : j("", !0), T.value.moreColumns ? (L(), I(v, { key: 1 }, [F(w(P(o)("chatFilePreview.moreColumns", T.value.moreColumns)), 1)], 64)) : j("", !0)])) : j("", !0)], 40, Pe),
|
|
633
633
|
y("nav", {
|
|
634
634
|
class: "pk-spreadsheet-preview__sheets",
|
|
635
635
|
"aria-label": P(o)("chatFilePreview.sheets")
|
|
636
|
-
}, [(
|
|
636
|
+
}, [(L(!0), I(v, null, m(e.preview.sheets, (e, t) => (L(), I("button", {
|
|
637
637
|
key: e.name,
|
|
638
638
|
type: "button",
|
|
639
639
|
class: "pk-spreadsheet-preview__sheet",
|
|
640
640
|
"aria-current": t === l.value ? "page" : void 0,
|
|
641
641
|
onClick: (e) => l.value = t
|
|
642
|
-
}, w(e.name), 9,
|
|
643
|
-
y("div",
|
|
642
|
+
}, w(e.name), 9, Re))), 128))], 8, Le),
|
|
643
|
+
y("div", ze, [y("p", Be, [e.preview.staleFormulas ? (L(), I("span", {
|
|
644
644
|
key: 0,
|
|
645
645
|
class: "pk-spreadsheet-preview__note",
|
|
646
646
|
title: P(o)("chatFilePreview.staleFormulas")
|
|
647
|
-
}, w(P(o)("chatFilePreview.staleFormulas")), 9,
|
|
647
|
+
}, w(P(o)("chatFilePreview.staleFormulas")), 9, Ve)) : e.preview.computedFormulas ? (L(), I("span", {
|
|
648
648
|
key: 1,
|
|
649
649
|
class: "pk-spreadsheet-preview__note",
|
|
650
650
|
title: P(o)("chatFilePreview.computedFormulas")
|
|
651
|
-
}, w(P(o)("chatFilePreview.computedFormulas")), 9,
|
|
652
|
-
|
|
653
|
-
y("span", null, w(P(o)("chatFilePreview.count")) + " " + w(
|
|
654
|
-
|
|
655
|
-
])) : j("", !0)]), y("div",
|
|
651
|
+
}, w(P(o)("chatFilePreview.computedFormulas")), 9, He)) : j("", !0), tt.value ? (L(), I("span", Ue, [
|
|
652
|
+
tt.value.average ? (L(), I("span", We, w(P(o)("chatFilePreview.average")) + " " + w(tt.value.average), 1)) : j("", !0),
|
|
653
|
+
y("span", null, w(P(o)("chatFilePreview.count")) + " " + w(tt.value.count), 1),
|
|
654
|
+
tt.value.sum ? (L(), I("span", Ge, w(P(o)("chatFilePreview.sum")) + " " + w(tt.value.sum), 1)) : j("", !0)
|
|
655
|
+
])) : j("", !0)]), y("div", Ke, [
|
|
656
656
|
f(i, {
|
|
657
657
|
modifiers: "action-quiet",
|
|
658
658
|
icon: "ri:subtract-line",
|
|
@@ -660,7 +660,7 @@ var je = { class: "pk-spreadsheet-preview" }, Me = { class: "pk-spreadsheet-prev
|
|
|
660
660
|
disabled: p.value <= .5,
|
|
661
661
|
onClick: n[4] ||= (e) => nt(-.1)
|
|
662
662
|
}, null, 8, ["aria-label", "disabled"]),
|
|
663
|
-
y("span",
|
|
663
|
+
y("span", qe, w(Math.round(p.value * 100)) + "% ", 1),
|
|
664
664
|
f(i, {
|
|
665
665
|
modifiers: "action-quiet",
|
|
666
666
|
icon: "ri:add-line",
|
|
@@ -675,11 +675,11 @@ var je = { class: "pk-spreadsheet-preview" }, Me = { class: "pk-spreadsheet-prev
|
|
|
675
675
|
}), [["styles", [".pk-spreadsheet-preview{--pk-spreadsheet-green:#217346;--pk-spreadsheet-green-head:#217346;--pk-spreadsheet-gridline:#e1e1e1;flex-direction:column;flex:1;min-height:0;display:flex}.pk-spreadsheet-preview__bar{min-height:var(--spacing-40);border-bottom:var(--border) solid var(--color-surface-3);background-color:var(--color-surface);font-size:var(--text-14);align-items:stretch;display:flex}.pk-spreadsheet-preview__ref{width:var(--spacing-96);padding:0 var(--spacing-12);box-sizing:border-box;border-right:var(--border) solid var(--color-surface-3);font-variant-numeric:tabular-nums;flex-shrink:0;align-items:center;display:flex}.pk-spreadsheet-preview__fx{width:var(--spacing-40);border-right:var(--border) solid var(--color-surface-3);color:var(--color-word-3);flex-shrink:0;justify-content:center;align-items:center;font-family:Georgia,serif;font-style:italic;display:flex}.pk-spreadsheet-preview__formula{min-width:0;padding:0 var(--spacing-12);text-overflow:ellipsis;white-space:nowrap;flex:1;align-items:center;display:flex;overflow:hidden}.pk-spreadsheet-preview__scroll{cursor:cell;background-color:#fff;outline:none;flex:1;min-height:0;overflow:auto}.pk-spreadsheet-preview__scroll:focus-visible{box-shadow:inset 0 0 0 var(--spacing-2) var(--input-focus-color)}.pk-spreadsheet-preview__grid{border-collapse:collapse;table-layout:fixed;color:#000;-webkit-user-select:none;user-select:none;font-family:Calibri,Carlito,Segoe UI,Arial,sans-serif;font-size:11pt}.pk-spreadsheet-preview__grid td{max-width:0;padding:0 var(--spacing-4);text-overflow:clip;background-color:#fff;line-height:1.2;overflow:hidden}.pk-spreadsheet-preview__grid--lines td{border:var(--border) solid var(--pk-spreadsheet-gridline)}.pk-spreadsheet-preview__corner,.pk-spreadsheet-preview__head,.pk-spreadsheet-preview__row{z-index:1;box-shadow:var(--pk-spreadsheet-lines);background-color:var(--color-surface-1);color:var(--color-word-3);font-family:var(--font-family-sans);font-size:var(--text-12);font-weight:var(--font-normal);text-align:center;border-style:hidden;position:sticky}.pk-spreadsheet-preview__corner,.pk-spreadsheet-preview__head{padding:var(--spacing-4) var(--spacing-4) var(--spacing-2);vertical-align:middle;line-height:1;top:0}.pk-spreadsheet-preview__row{vertical-align:middle}.pk-spreadsheet-preview__corner{--pk-spreadsheet-lines:inset 0 0 0 var(--border) var(--color-surface-3);z-index:5;left:0}.pk-spreadsheet-preview__head{--pk-spreadsheet-lines:inset 0 var(--border) 0 var(--color-surface-3), inset calc(var(--border) * -1) calc(var(--border) * -1) 0 var(--color-surface-3)}.pk-spreadsheet-preview__row{--pk-spreadsheet-lines:inset var(--border) 0 0 var(--color-surface-3), inset calc(var(--border) * -1) calc(var(--border) * -1) 0 var(--color-surface-3);padding:0 var(--spacing-4);font-variant-numeric:tabular-nums;left:0}.pk-spreadsheet-preview__head--current{background-color:var(--color-surface-2);box-shadow:var(--pk-spreadsheet-lines), inset 0 calc((var(--spacing-2) + var(--border)) * -1) 0 var(--pk-spreadsheet-green-head);color:var(--pk-spreadsheet-green-head);font-weight:var(--font-medium)}.pk-spreadsheet-preview__row--current{background-color:var(--color-surface-2);box-shadow:var(--pk-spreadsheet-lines), inset calc((var(--spacing-2) + var(--border)) * -1) 0 0 var(--pk-spreadsheet-green-head);color:var(--pk-spreadsheet-green-head);font-weight:var(--font-medium)}.pk-spreadsheet-preview__cell[data-focus]{scroll-margin-top:var(--pk-spreadsheet-stuck-top);scroll-margin-left:var(--pk-spreadsheet-stuck-left);outline:var(--spacing-2) solid var(--pk-spreadsheet-green);outline-offset:calc(var(--spacing-2) * -1)}.pk-spreadsheet-preview__cell--range{background-image:linear-gradient(#1f1d2b14,#1f1d2b14)}.pk-spreadsheet-preview__cell--missing{color:#6b6880}.pk-spreadsheet-preview__more{padding:var(--spacing-8) var(--spacing-12);color:#6b6880;font-size:var(--text-12);margin:0;position:sticky;left:0}.pk-spreadsheet-preview__sheets{min-height:var(--spacing-32);padding-left:var(--spacing-40);border-top:var(--border) solid var(--color-surface-3);background-color:var(--color-surface-1);flex-shrink:0;display:flex;overflow-x:auto}@media (pointer:coarse){.pk-spreadsheet-preview__sheets{min-height:var(--spacing-40)}}.pk-spreadsheet-preview__status{min-height:var(--spacing-40);border-top:var(--border) solid var(--color-surface-3);background-color:var(--color-surface-1);font-size:var(--text-12);flex-shrink:0;align-items:center;display:flex}.pk-spreadsheet-preview__sheet{padding:0 var(--spacing-16);border:0;border-right:var(--border) solid var(--color-surface-3);color:var(--color-word-2);font:inherit;font-size:var(--text-12);white-space:nowrap;cursor:pointer;background:0 0;flex-shrink:0}.pk-spreadsheet-preview__sheet:first-child{border-left:var(--border) solid var(--color-surface-3)}.pk-spreadsheet-preview__sheet:hover{background-color:var(--color-surface-2)}.pk-spreadsheet-preview__sheet[aria-current=page]{background-color:var(--color-surface);box-shadow:inset 0 calc(var(--spacing-2) * -1) 0 var(--pk-spreadsheet-green-head);color:var(--pk-spreadsheet-green-head);font-weight:var(--font-semibold)}.pk-spreadsheet-preview__info{align-items:center;gap:var(--spacing-16);min-width:0;padding:0 var(--spacing-12);color:var(--color-word-2);font-variant-numeric:tabular-nums;white-space:nowrap;flex:1;margin:0;display:flex;overflow:hidden}.pk-spreadsheet-preview__note{min-width:0;color:var(--color-word-3);text-overflow:ellipsis;overflow:hidden}.pk-spreadsheet-preview__stats{gap:var(--spacing-12);flex-shrink:0;margin-left:auto;display:flex}@container (width<26rem){.pk-spreadsheet-preview__average{display:none}}.pk-spreadsheet-preview__zoom{align-items:center;gap:var(--spacing-2);padding-right:var(--spacing-8);flex-shrink:0;display:flex}.pk-spreadsheet-preview__percent{min-width:var(--spacing-40);font-variant-numeric:tabular-nums;text-align:center}@media (prefers-color-scheme:dark){:where(:host,:root,.theme):not(.theme--light) .pk-spreadsheet-preview{--pk-spreadsheet-green-head:#5fbf8f}}:where(.theme.theme--dark) .pk-spreadsheet-preview{--pk-spreadsheet-green-head:#5fbf8f}"]]]);
|
|
676
676
|
// ../../packages/components/src/chat/PkWordPreviewRuns.vue?vue&type=script&setup=true&lang.ts
|
|
677
677
|
C(), p(), E();
|
|
678
|
-
var
|
|
678
|
+
var $e = ["src"], et = {
|
|
679
679
|
key: 1,
|
|
680
680
|
class: "pk-word-preview__image",
|
|
681
681
|
"data-quote-skip": ""
|
|
682
|
-
},
|
|
682
|
+
}, tt = ["title"], nt = ["title"], rt = ["data-quote-skip"], it = /* @__PURE__ */ N({
|
|
683
683
|
__name: "PkWordPreviewRuns",
|
|
684
684
|
props: {
|
|
685
685
|
runs: { type: Array },
|
|
@@ -688,7 +688,7 @@ var et = ["src"], tt = {
|
|
|
688
688
|
numbers: { type: Object }
|
|
689
689
|
},
|
|
690
690
|
setup(e) {
|
|
691
|
-
let n = e, { t: i } =
|
|
691
|
+
let n = e, { t: i } = te({ useScope: "global" }), a = t(le, void 0), o = (e) => e.picture ? V(a?.value, e.picture.ref) : void 0, s = (e) => n.page ? z(e) : "inline", c = (e) => {
|
|
692
692
|
let t = {
|
|
693
693
|
width: `${e.width}pt`,
|
|
694
694
|
aspectRatio: `${e.width} / ${e.height}`
|
|
@@ -730,24 +730,24 @@ var et = ["src"], tt = {
|
|
|
730
730
|
textDecoration: [...n].join(" ")
|
|
731
731
|
};
|
|
732
732
|
}, g = (e) => e.author ? i("chatFilePreview.revisionBy", { author: e.author }) : void 0;
|
|
733
|
-
return (e, t) => (
|
|
733
|
+
return (e, t) => (L(!0), I(v, null, m(d.value, (e, t) => (L(), I(v, { key: t }, [e.image ? (L(), I(v, { key: 0 }, [e.picture && o(e) ? (L(), I(v, { key: 0 }, [s(e.picture) === "page" ? j("", !0) : (L(), I("img", {
|
|
734
734
|
key: 0,
|
|
735
735
|
class: r(["pk-word-preview__picture", `pk-word-preview__picture--${s(e.picture)}`]),
|
|
736
736
|
style: u(c(e.picture)),
|
|
737
737
|
src: o(e),
|
|
738
738
|
alt: ""
|
|
739
|
-
}, null, 14,
|
|
739
|
+
}, null, 14, $e))], 64)) : (L(), I("span", et, w(P(i)("chatFilePreview.image")), 1))], 64)) : f.value && e.change === "deleted" ? (L(), I("del", {
|
|
740
740
|
key: 1,
|
|
741
741
|
class: "pk-word-preview__removed",
|
|
742
742
|
"data-quote-skip": "",
|
|
743
743
|
style: u(h(e)),
|
|
744
744
|
title: g(e)
|
|
745
|
-
}, w(l(e)), 13,
|
|
745
|
+
}, w(l(e)), 13, tt)) : f.value && e.change === "inserted" ? (L(), I("ins", {
|
|
746
746
|
key: 2,
|
|
747
747
|
class: "pk-word-preview__added",
|
|
748
748
|
style: u(h(e)),
|
|
749
749
|
title: g(e)
|
|
750
|
-
}, w(l(e)), 13, nt)) : (
|
|
750
|
+
}, w(l(e)), 13, nt)) : (L(), I("span", {
|
|
751
751
|
key: 3,
|
|
752
752
|
style: u(p(e)),
|
|
753
753
|
"data-quote-skip": e.label ? "" : void 0
|
|
@@ -775,9 +775,9 @@ var at = { key: 0 }, ot = ["data-paragraph", "colspan"], st = [
|
|
|
775
775
|
let e = t.block.style ?? {};
|
|
776
776
|
return {
|
|
777
777
|
textAlign: e.align,
|
|
778
|
-
paddingLeft: e.indentLeft ?
|
|
779
|
-
paddingRight: e.indentRight ?
|
|
780
|
-
textIndent: e.firstLine ?
|
|
778
|
+
paddingLeft: e.indentLeft ? `max(0pt, calc((${e.indentLeft}pt - var(--pk-word-indent-shared, 0pt)) * var(--pk-word-indent-scale, 1)))` : void 0,
|
|
779
|
+
paddingRight: e.indentRight ? `calc(${e.indentRight}pt * var(--pk-word-indent-scale, 1))` : void 0,
|
|
780
|
+
textIndent: e.firstLine ? `calc(${e.firstLine}pt * var(--pk-word-indent-scale, 1))` : void 0,
|
|
781
781
|
paddingTop: e.spaceBefore ? `${e.spaceBefore}pt` : void 0,
|
|
782
782
|
paddingBottom: e.spaceAfter ? `${e.spaceAfter}pt` : void 0,
|
|
783
783
|
lineHeight: e.lineExact ? `${e.lineExact}pt` : e.lineAtLeast ? `max(calc(var(--pk-word-line, 1.17) * max(1em, var(--pk-word-size, 1em))), ${e.lineAtLeast}pt)` : `calc(var(--pk-word-line, 1.17) * ${e.lineHeight ?? 1})`,
|
|
@@ -787,23 +787,23 @@ var at = { key: 0 }, ot = ["data-paragraph", "colspan"], st = [
|
|
|
787
787
|
}), i = x(() => {
|
|
788
788
|
if (t.block.kind === "table") return {};
|
|
789
789
|
let e = -(t.block.style?.firstLine ?? 0);
|
|
790
|
-
return e > 0 ? { minWidth:
|
|
790
|
+
return e > 0 ? { minWidth: `calc(${e}pt * var(--pk-word-indent-scale, 1))` } : { paddingRight: "6pt" };
|
|
791
791
|
}), a = x(() => t.mode === "markup" && t.block.kind !== "table" && t.block.runs.some((e) => e.change)), o = x(() => t.block.kind === "table" && t.row !== void 0 ? t.block.rows[t.row] : void 0), s = x(() => {
|
|
792
792
|
if (t.block.kind !== "table") return [];
|
|
793
793
|
let e = t.block.widths ?? [], n = e.reduce((e, t) => e + t, 0);
|
|
794
794
|
return n ? e.map((e) => `${e / n * 100}%`) : [];
|
|
795
795
|
}), c = x(() => t.mode === "markup" && !!o.value?.some((e) => e.runs.some((e) => e.change)));
|
|
796
|
-
return (t, l) => e.block.kind === "table" && o.value ? (
|
|
796
|
+
return (t, l) => e.block.kind === "table" && o.value ? (L(), I("table", {
|
|
797
797
|
key: 0,
|
|
798
798
|
class: r(["pk-word-preview__table", {
|
|
799
799
|
"pk-word-preview__table--lines": e.block.borders,
|
|
800
800
|
"pk-word-preview__table--next": e.row !== 0,
|
|
801
801
|
"pk-word-preview__changed": c.value
|
|
802
802
|
}])
|
|
803
|
-
}, [s.value.length ? (
|
|
803
|
+
}, [s.value.length ? (L(), I("colgroup", at, [(L(!0), I(v, null, m(s.value, (e, t) => (L(), I("col", {
|
|
804
804
|
key: t,
|
|
805
805
|
style: u({ width: e })
|
|
806
|
-
}, null, 4))), 128))])) : j("", !0), y("tbody", null, [y("tr", null, [(
|
|
806
|
+
}, null, 4))), 128))])) : j("", !0), y("tbody", null, [y("tr", null, [(L(!0), I(v, null, m(o.value, (t, n) => (L(), I("td", {
|
|
807
807
|
key: n,
|
|
808
808
|
"data-paragraph": t.ids?.join(" "),
|
|
809
809
|
colspan: t.span,
|
|
@@ -820,7 +820,7 @@ var at = { key: 0 }, ot = ["data-paragraph", "colspan"], st = [
|
|
|
820
820
|
"runs",
|
|
821
821
|
"mode",
|
|
822
822
|
"numbers"
|
|
823
|
-
])], 12, ot))), 128))])])], 2)) : e.block.kind === "table" ? j("", !0) : (
|
|
823
|
+
])], 12, ot))), 128))])])], 2)) : e.block.kind === "table" ? j("", !0) : (L(), I("div", {
|
|
824
824
|
key: 1,
|
|
825
825
|
class: r(["pk-word-preview__block", { "pk-word-preview__changed": a.value }]),
|
|
826
826
|
"data-paragraph": e.block.id,
|
|
@@ -828,7 +828,7 @@ var at = { key: 0 }, ot = ["data-paragraph", "colspan"], st = [
|
|
|
828
828
|
"aria-level": e.block.kind === "heading" ? Math.max(1, e.block.level) : void 0,
|
|
829
829
|
style: u(n.value)
|
|
830
830
|
}, [
|
|
831
|
-
e.block.label ? (
|
|
831
|
+
e.block.label ? (L(), I("span", {
|
|
832
832
|
key: 0,
|
|
833
833
|
class: "pk-word-preview__label",
|
|
834
834
|
"data-quote-skip": "",
|
|
@@ -845,7 +845,7 @@ var at = { key: 0 }, ot = ["data-paragraph", "colspan"], st = [
|
|
|
845
845
|
"page",
|
|
846
846
|
"numbers"
|
|
847
847
|
]),
|
|
848
|
-
!e.block.label && !e.block.runs.length ? (
|
|
848
|
+
!e.block.label && !e.block.runs.length ? (L(), I("br", ct)) : j("", !0)
|
|
849
849
|
], 14, st));
|
|
850
850
|
}
|
|
851
851
|
});
|
|
@@ -875,10 +875,10 @@ var ut = { class: "pk-word-preview__part" }, dt = ["src"], ft = /* @__PURE__ */
|
|
|
875
875
|
...n.where === "header" ? { top: `${n.section.headerDistance}pt` } : { bottom: `${n.section.footerDistance}pt` }
|
|
876
876
|
};
|
|
877
877
|
});
|
|
878
|
-
return (t, n) => (
|
|
878
|
+
return (t, n) => (L(), I("div", ut, [y("div", {
|
|
879
879
|
class: "pk-word-preview__part-flow",
|
|
880
880
|
style: u(o.value)
|
|
881
|
-
}, [(
|
|
881
|
+
}, [(L(!0), I(v, null, m(i.value, (t) => (L(), g(lt, {
|
|
882
882
|
key: t.key,
|
|
883
883
|
block: e.blocks[t.block],
|
|
884
884
|
row: t.row,
|
|
@@ -891,7 +891,7 @@ var ut = { class: "pk-word-preview__part" }, dt = ["src"], ft = /* @__PURE__ */
|
|
|
891
891
|
"mode",
|
|
892
892
|
"page",
|
|
893
893
|
"numbers"
|
|
894
|
-
]))), 128))], 4), (
|
|
894
|
+
]))), 128))], 4), (L(!0), I(v, null, m(a.value, (e, t) => (L(), I("img", {
|
|
895
895
|
key: t,
|
|
896
896
|
class: "pk-word-preview__float",
|
|
897
897
|
style: u(e.css),
|
|
@@ -932,7 +932,7 @@ var pt = ["aria-label"], mt = {
|
|
|
932
932
|
}, Mt = { class: "pk-word-preview__count" }, Nt = {
|
|
933
933
|
key: 1,
|
|
934
934
|
class: "pk-word-preview__legend"
|
|
935
|
-
}, Pt = ["title"], Ft = { class: "pk-word-preview__removed" }, It = { class: "pk-word-preview__added" }, Lt = { class: "pk-word-preview__percent" }, Rt = ["data-part"], zt = 96 / 72, Bt = /*#__PURE__*/
|
|
935
|
+
}, Pt = ["title"], Ft = { class: "pk-word-preview__removed" }, It = { class: "pk-word-preview__added" }, Lt = { class: "pk-word-preview__percent" }, Rt = ["data-part"], zt = 96 / 72, Bt = .5, Vt = /*#__PURE__*/ W(/* @__PURE__ */ N({
|
|
936
936
|
__name: "PkWordPreview",
|
|
937
937
|
props: /*@__PURE__*/ l({
|
|
938
938
|
preview: { type: null },
|
|
@@ -948,50 +948,67 @@ var pt = ["aria-label"], mt = {
|
|
|
948
948
|
}),
|
|
949
949
|
emits: /*@__PURE__*/ l(["select"], ["update:fit", "update:zoom"]),
|
|
950
950
|
setup(e, { emit: t }) {
|
|
951
|
-
let a = e, l = t, { t: p } =
|
|
951
|
+
let a = e, l = t, { t: p } = te({ useScope: "global" });
|
|
952
952
|
n(le, x(() => a.preview.images));
|
|
953
|
-
let ee = (e) => se(e, a.mode), _ = x(() => H(a.preview.blocks, a.mode)), S = h("rootEl"), C = h("scrollEl"), T = h("measureEl"), { width: E } = de(S), { width: D } = de(C), O = x(() => E.value
|
|
953
|
+
let ee = (e) => se(e, a.mode), _ = x(() => H(a.preview.blocks, a.mode)), S = h("rootEl"), C = h("scrollEl"), T = h("measureEl"), { width: E } = de(S), { width: D } = de(C), O = x(() => E.value >= 1e3), k = x(() => a.preview.sections?.length ? a.preview.sections : [{
|
|
954
954
|
page: a.preview.page,
|
|
955
955
|
headerDistance: 0,
|
|
956
956
|
footerDistance: 0,
|
|
957
957
|
headers: {},
|
|
958
958
|
footers: {}
|
|
959
|
-
}]),
|
|
959
|
+
}]), A = x(() => k.value[0].page), M = x(() => (D.value - 48) / (A.value.width * zt)), N = x(() => E.value === 0 || D.value === 0 || M.value >= Bt), F = x(() => ({
|
|
960
960
|
fontFamily: R(a.preview.defaults.font),
|
|
961
961
|
fontSize: `${a.preview.defaults.size}pt`,
|
|
962
962
|
color: a.preview.defaults.color ?? "#000000",
|
|
963
963
|
"--pk-word-line": ae(a.preview.defaults.font),
|
|
964
964
|
"--pk-word-size": `${a.preview.defaults.size}pt`
|
|
965
|
-
})),
|
|
966
|
-
...
|
|
967
|
-
width: `${
|
|
968
|
-
})),
|
|
965
|
+
})), ne = x(() => A.value.width - A.value.margins.left - A.value.margins.right), re = x(() => ({
|
|
966
|
+
...F.value,
|
|
967
|
+
width: `${ne.value}pt`
|
|
968
|
+
})), ie = h("flowEl"), { width: z } = de(ie), B = x(() => {
|
|
969
|
+
let e = /* @__PURE__ */ new Map(), t = 0;
|
|
970
|
+
for (let n of a.preview.blocks) {
|
|
971
|
+
if (n.kind === "table") continue;
|
|
972
|
+
let r = n.runs.reduce((e, t) => e + t.text.trim().length, 0);
|
|
973
|
+
if (r) {
|
|
974
|
+
let i = Math.max(0, n.style?.indentLeft ?? 0);
|
|
975
|
+
e.set(i, (e.get(i) ?? 0) + r), t += r;
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
let n = 0;
|
|
979
|
+
for (let [r, i] of [...e].sort((e, t) => e[0] - t[0])) if (n += i, n > t / 10) return r;
|
|
980
|
+
return 0;
|
|
981
|
+
}), ue = x(() => ({
|
|
982
|
+
...F.value,
|
|
983
|
+
"--pk-word-indent-shared": `${B.value}pt`,
|
|
984
|
+
"--pk-word-indent-scale": z.value ? Math.min(1, z.value / (ne.value * zt)) : 1
|
|
985
|
+
})), U = b([]), W = b({}), pe = async () => {
|
|
969
986
|
await i();
|
|
970
987
|
let e = T.value?.querySelectorAll("[data-item]");
|
|
971
|
-
|
|
988
|
+
U.value = [...e ?? []].map((e) => e.getBoundingClientRect().height);
|
|
972
989
|
let t = T.value?.querySelectorAll("[data-part]");
|
|
973
|
-
|
|
990
|
+
W.value = Object.fromEntries([...t ?? []].map((e) => [e.dataset.part ?? "", e.getBoundingClientRect().height]));
|
|
974
991
|
};
|
|
975
992
|
d([
|
|
976
993
|
_,
|
|
977
|
-
|
|
994
|
+
N,
|
|
978
995
|
() => a.preview.parts
|
|
979
|
-
],
|
|
980
|
-
|
|
996
|
+
], pe, { flush: "post" }), c(() => {
|
|
997
|
+
pe(), document.fonts?.ready.then(pe);
|
|
981
998
|
});
|
|
982
|
-
let
|
|
983
|
-
if (!
|
|
999
|
+
let G = x(() => {
|
|
1000
|
+
if (!N.value || U.value.length !== _.value.length) return [{
|
|
984
1001
|
items: _.value.map((e, t) => t),
|
|
985
1002
|
section: 0,
|
|
986
1003
|
number: 1,
|
|
987
|
-
top:
|
|
988
|
-
bottom:
|
|
1004
|
+
top: A.value.margins.top,
|
|
1005
|
+
bottom: A.value.margins.bottom
|
|
989
1006
|
}];
|
|
990
1007
|
let e = [], t = 0, n = !0, r = 0, i, o = () => {
|
|
991
|
-
let r =
|
|
1008
|
+
let r = k.value[t];
|
|
992
1009
|
return n && r.pageStart !== void 0 ? r.pageStart : (i ?? e[e.length - 1]?.number ?? 0) + 1;
|
|
993
1010
|
}, s = (e) => {
|
|
994
|
-
let r =
|
|
1011
|
+
let r = k.value[t], i = (t) => n && r.titlePage ? t.first : a.preview.evenAndOddHeaders && e % 2 == 0 ? t.even : t.default, o = i(r.headers), s = i(r.footers), c = (e) => e ? (W.value[e] ?? 0) / zt : 0;
|
|
995
1012
|
return {
|
|
996
1013
|
header: o,
|
|
997
1014
|
footer: s,
|
|
@@ -1008,42 +1025,42 @@ var pt = ["aria-label"], mt = {
|
|
|
1008
1025
|
}), n = !1, r = 0;
|
|
1009
1026
|
};
|
|
1010
1027
|
return _.value.forEach((a, l) => {
|
|
1011
|
-
a.section !== void 0 && a.section !== t &&
|
|
1012
|
-
let u = e[e.length - 1], d = u &&
|
|
1013
|
-
for (let e = l; _.value[e]?.keepNext && e + 1 < _.value.length && !_.value[e + 1].breakBefore; e++) p +=
|
|
1014
|
-
(!u || u.items.length && (a.breakBefore || r +
|
|
1028
|
+
a.section !== void 0 && a.section !== t && k.value[a.section] && (t = a.section, n = a.breakBefore || !e.length, n || (i = k.value[t].pageStart));
|
|
1029
|
+
let u = e[e.length - 1], d = u && k.value[u.section].page, f = d ? (d.height - u.top - u.bottom) * zt : 0, p = U.value[l];
|
|
1030
|
+
for (let e = l; _.value[e]?.keepNext && e + 1 < _.value.length && !_.value[e + 1].breakBefore; e++) p += U.value[e + 1];
|
|
1031
|
+
(!u || u.items.length && (a.breakBefore || r + U.value[l] > f || r + p > f && p <= (() => {
|
|
1015
1032
|
let e = s(o());
|
|
1016
|
-
return (
|
|
1017
|
-
})())) && c(), e[e.length - 1].items.push(l), r +=
|
|
1033
|
+
return (k.value[t].page.height - e.top - e.bottom) * zt;
|
|
1034
|
+
})())) && c(), e[e.length - 1].items.push(l), r += U.value[l];
|
|
1018
1035
|
}), e.length || c(), e;
|
|
1019
|
-
}),
|
|
1036
|
+
}), me = x(() => {
|
|
1020
1037
|
let e = /* @__PURE__ */ new Map();
|
|
1021
|
-
for (let t of
|
|
1022
|
-
return
|
|
1038
|
+
for (let t of G.value) e.set(t.section, (e.get(t.section) ?? 0) + 1);
|
|
1039
|
+
return G.value.map((t) => ({
|
|
1023
1040
|
page: t.number,
|
|
1024
|
-
pages:
|
|
1041
|
+
pages: G.value.length,
|
|
1025
1042
|
sectionPages: e.get(t.section) ?? 1
|
|
1026
1043
|
}));
|
|
1027
|
-
}),
|
|
1028
|
-
let t =
|
|
1044
|
+
}), ge = (e) => {
|
|
1045
|
+
let t = k.value[e.section].page;
|
|
1029
1046
|
return {
|
|
1030
|
-
...
|
|
1047
|
+
...F.value,
|
|
1031
1048
|
width: `${t.width}pt`,
|
|
1032
1049
|
minHeight: `${t.height}pt`,
|
|
1033
1050
|
padding: `${e.top}pt ${t.margins.right}pt ${e.bottom}pt ${t.margins.left}pt`
|
|
1034
1051
|
};
|
|
1035
|
-
},
|
|
1052
|
+
}, _e = (e) => {
|
|
1036
1053
|
let t = [...new Set(e.items.map((e) => _.value[e].block))];
|
|
1037
1054
|
return ce(t.map((e) => a.preview.blocks[e]), a.mode).flatMap((t) => {
|
|
1038
1055
|
let n = V(a.preview.images, t.ref);
|
|
1039
1056
|
return n ? [{
|
|
1040
1057
|
src: n,
|
|
1041
|
-
css: oe(t,
|
|
1058
|
+
css: oe(t, k.value[e.section].page)
|
|
1042
1059
|
}] : [];
|
|
1043
1060
|
});
|
|
1044
|
-
},
|
|
1045
|
-
|
|
1046
|
-
},
|
|
1061
|
+
}, K = s(e, "fit"), ve = s(e, "zoom"), q = x(() => K.value ? Math.min(1.25, Math.max(.3, M.value)) : ve.value), J = (e) => {
|
|
1062
|
+
ve.value = Math.min(2, Math.max(.3, Math.round((q.value + e) * 10) / 10)), K.value = !1;
|
|
1063
|
+
}, ye = b(0), be = b(), xe = () => {
|
|
1047
1064
|
let e = C.value?.getBoundingClientRect();
|
|
1048
1065
|
if (!e) return;
|
|
1049
1066
|
let t = C.value?.querySelectorAll("[data-page]") ?? [], n = 0;
|
|
@@ -1051,123 +1068,123 @@ var pt = ["aria-label"], mt = {
|
|
|
1051
1068
|
if (i.getBoundingClientRect().top - e.top > e.height / 3) break;
|
|
1052
1069
|
n = r;
|
|
1053
1070
|
}
|
|
1054
|
-
|
|
1071
|
+
ye.value = n;
|
|
1055
1072
|
let r;
|
|
1056
|
-
for (let t of
|
|
1073
|
+
for (let t of Q.value) {
|
|
1057
1074
|
let n = C.value?.querySelector(`[data-key="${t.key}"]`);
|
|
1058
1075
|
if (n) {
|
|
1059
1076
|
if (n.getBoundingClientRect().top - e.top > 48) break;
|
|
1060
1077
|
r = t.key;
|
|
1061
1078
|
}
|
|
1062
1079
|
}
|
|
1063
|
-
|
|
1064
|
-
},
|
|
1065
|
-
|
|
1066
|
-
|
|
1080
|
+
be.value = r ?? Q.value[0]?.key;
|
|
1081
|
+
}, Y = 0, X = () => {
|
|
1082
|
+
Y ||= requestAnimationFrame(() => {
|
|
1083
|
+
Y = 0, xe();
|
|
1067
1084
|
});
|
|
1068
1085
|
};
|
|
1069
|
-
o(() => cancelAnimationFrame(
|
|
1070
|
-
let { selection:
|
|
1071
|
-
d(
|
|
1086
|
+
o(() => cancelAnimationFrame(Y)), d(G, () => i(X));
|
|
1087
|
+
let { selection: Se } = he({ root: () => C.value?.getRootNode() });
|
|
1088
|
+
d(Se, (e) => {
|
|
1072
1089
|
let t = C.value;
|
|
1073
|
-
l("select", e && t ?
|
|
1090
|
+
l("select", e && t ? Z(t, e.range, ".pk-word-preview__measure, .pk-word-preview__part") : void 0);
|
|
1074
1091
|
});
|
|
1075
|
-
let
|
|
1076
|
-
let t = a.preview.blocks[e.block], n = t.kind === "heading" ? [t.label,
|
|
1092
|
+
let Ce = (e) => ee(e).map((e) => e.text).join("").replace(/\s+/g, " ").trim(), Q = x(() => _.value.flatMap((e) => {
|
|
1093
|
+
let t = a.preview.blocks[e.block], n = t.kind === "heading" ? [t.label, Ce(t.runs)].filter(Boolean).join(" ") : "";
|
|
1077
1094
|
return t.kind === "heading" && t.level <= 3 && n ? [{
|
|
1078
1095
|
key: e.key,
|
|
1079
1096
|
level: t.level,
|
|
1080
1097
|
text: n
|
|
1081
1098
|
}] : [];
|
|
1082
|
-
})),
|
|
1099
|
+
})), we = (e) => e.length > 60 ? `${e.slice(0, 60)}…` : e, $ = x(() => _.value.flatMap((e) => {
|
|
1083
1100
|
let t = a.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();
|
|
1084
1101
|
return r || i ? [{
|
|
1085
1102
|
key: e.key,
|
|
1086
|
-
removed:
|
|
1087
|
-
added:
|
|
1103
|
+
removed: we(r),
|
|
1104
|
+
added: we(i)
|
|
1088
1105
|
}] : [];
|
|
1089
|
-
})),
|
|
1106
|
+
})), Te = b("outline"), Ee = b(!1), De = (e) => {
|
|
1090
1107
|
C.value?.querySelector(`[data-key="${e}"]`)?.scrollIntoView({
|
|
1091
1108
|
block: "start",
|
|
1092
1109
|
behavior: "smooth"
|
|
1093
|
-
}),
|
|
1094
|
-
},
|
|
1110
|
+
}), O.value || (Ee.value = !1);
|
|
1111
|
+
}, Oe = x(() => a.preview.blocks.flatMap((e) => e.kind === "table" ? e.rows.flat().map((e) => Ce(e.runs)) : [Ce(e.runs)]).join(" ").split(/\s+/).filter(Boolean).length), ke = x(() => a.preview.revisionAuthors.join(", "));
|
|
1095
1112
|
return (t, n) => {
|
|
1096
|
-
let i =
|
|
1097
|
-
return
|
|
1113
|
+
let i = fe;
|
|
1114
|
+
return L(), I("div", {
|
|
1098
1115
|
ref_key: "rootEl",
|
|
1099
1116
|
ref: S,
|
|
1100
|
-
class: r(["pk-word-preview", { "pk-word-preview--paged":
|
|
1117
|
+
class: r(["pk-word-preview", { "pk-word-preview--paged": N.value }])
|
|
1101
1118
|
}, [
|
|
1102
|
-
(
|
|
1119
|
+
(O.value || Ee.value) && (Q.value.length || $.value.length) ? (L(), I("aside", {
|
|
1103
1120
|
key: 0,
|
|
1104
|
-
class: r(["pk-word-preview__side", { "pk-word-preview__side--over": !
|
|
1121
|
+
class: r(["pk-word-preview__side", { "pk-word-preview__side--over": !O.value }]),
|
|
1105
1122
|
"aria-label": P(p)("chatFilePreview.outline")
|
|
1106
1123
|
}, [y("div", mt, [y("button", {
|
|
1107
1124
|
type: "button",
|
|
1108
1125
|
role: "tab",
|
|
1109
1126
|
class: "pk-word-preview__tab",
|
|
1110
|
-
"aria-selected":
|
|
1111
|
-
onClick: n[0] ||= (e) =>
|
|
1112
|
-
}, w(P(p)("chatFilePreview.outline")), 9, ht),
|
|
1127
|
+
"aria-selected": Te.value === "outline",
|
|
1128
|
+
onClick: n[0] ||= (e) => Te.value = "outline"
|
|
1129
|
+
}, w(P(p)("chatFilePreview.outline")), 9, ht), $.value.length ? (L(), I("button", {
|
|
1113
1130
|
key: 0,
|
|
1114
1131
|
type: "button",
|
|
1115
1132
|
role: "tab",
|
|
1116
1133
|
class: "pk-word-preview__tab",
|
|
1117
|
-
"aria-selected":
|
|
1118
|
-
onClick: n[1] ||= (e) =>
|
|
1119
|
-
}, w(P(p)("chatFilePreview.changes", { count:
|
|
1134
|
+
"aria-selected": Te.value === "changes",
|
|
1135
|
+
onClick: n[1] ||= (e) => Te.value = "changes"
|
|
1136
|
+
}, w(P(p)("chatFilePreview.changes", { count: $.value.length })), 9, gt)) : j("", !0)]), Te.value === "outline" || !$.value.length ? (L(), I("nav", _t, [(L(!0), I(v, null, m(Q.value, (e) => (L(), I("button", {
|
|
1120
1137
|
key: e.key,
|
|
1121
1138
|
type: "button",
|
|
1122
1139
|
class: r(["pk-word-preview__entry", `pk-word-preview__entry--${Math.min(e.level, 3)}`]),
|
|
1123
|
-
"aria-current":
|
|
1124
|
-
onClick: (t) =>
|
|
1125
|
-
}, [y("span", yt, w(e.text), 1),
|
|
1140
|
+
"aria-current": be.value === e.key ? "location" : void 0,
|
|
1141
|
+
onClick: (t) => De(e.key)
|
|
1142
|
+
}, [y("span", yt, w(e.text), 1), $.value.some((t) => t.key === e.key) ? (L(), I("span", bt)) : j("", !0)], 10, vt))), 128)), Q.value.length ? j("", !0) : (L(), I("p", xt, w(P(p)("chatFilePreview.noHeadings")), 1))])) : (L(), I("nav", St, [(L(!0), I(v, null, m($.value, (e) => (L(), I("button", {
|
|
1126
1143
|
key: e.key,
|
|
1127
1144
|
type: "button",
|
|
1128
1145
|
class: "pk-word-preview__entry pk-word-preview__entry--change",
|
|
1129
|
-
onClick: (t) =>
|
|
1130
|
-
}, [e.removed ? (
|
|
1146
|
+
onClick: (t) => De(e.key)
|
|
1147
|
+
}, [e.removed ? (L(), I("del", wt, w(e.removed), 1)) : j("", !0), e.added ? (L(), I("ins", Tt, w(e.added), 1)) : j("", !0)], 8, Ct))), 128))]))], 10, pt)) : j("", !0),
|
|
1131
1148
|
y("div", Et, [y("div", {
|
|
1132
1149
|
ref_key: "scrollEl",
|
|
1133
1150
|
ref: C,
|
|
1134
1151
|
class: "pk-word-preview__scroll",
|
|
1135
|
-
onScroll:
|
|
1136
|
-
}, [
|
|
1152
|
+
onScroll: X
|
|
1153
|
+
}, [N.value ? (L(), I("div", {
|
|
1137
1154
|
key: 0,
|
|
1138
1155
|
class: "pk-word-preview__pages",
|
|
1139
|
-
style: u({ zoom:
|
|
1140
|
-
}, [(
|
|
1156
|
+
style: u({ zoom: q.value })
|
|
1157
|
+
}, [(L(!0), I(v, null, m(G.value, (t, n) => (L(), I("article", {
|
|
1141
1158
|
key: n,
|
|
1142
1159
|
"data-page": "",
|
|
1143
1160
|
class: "pk-word-preview__page",
|
|
1144
1161
|
"aria-label": P(p)("chatFilePreview.pageOf", {
|
|
1145
1162
|
page: n + 1,
|
|
1146
|
-
count:
|
|
1163
|
+
count: G.value.length
|
|
1147
1164
|
}),
|
|
1148
|
-
style: u(
|
|
1165
|
+
style: u(ge(t))
|
|
1149
1166
|
}, [
|
|
1150
|
-
t.header && e.preview.parts?.[t.header] ? (
|
|
1167
|
+
t.header && e.preview.parts?.[t.header] ? (L(), g(ft, {
|
|
1151
1168
|
key: 0,
|
|
1152
1169
|
blocks: e.preview.parts[t.header],
|
|
1153
1170
|
where: "header",
|
|
1154
|
-
section:
|
|
1171
|
+
section: k.value[t.section],
|
|
1155
1172
|
mode: e.mode,
|
|
1156
|
-
numbers:
|
|
1173
|
+
numbers: me.value[n]
|
|
1157
1174
|
}, null, 8, [
|
|
1158
1175
|
"blocks",
|
|
1159
1176
|
"section",
|
|
1160
1177
|
"mode",
|
|
1161
1178
|
"numbers"
|
|
1162
1179
|
])) : j("", !0),
|
|
1163
|
-
(
|
|
1180
|
+
(L(!0), I(v, null, m(t.items, (r) => (L(), g(lt, {
|
|
1164
1181
|
key: _.value[r].key,
|
|
1165
1182
|
"data-key": _.value[r].key,
|
|
1166
1183
|
block: e.preview.blocks[_.value[r].block],
|
|
1167
1184
|
row: _.value[r].row,
|
|
1168
1185
|
mode: e.mode,
|
|
1169
|
-
page:
|
|
1170
|
-
numbers:
|
|
1186
|
+
page: k.value[t.section].page,
|
|
1187
|
+
numbers: me.value[n]
|
|
1171
1188
|
}, null, 8, [
|
|
1172
1189
|
"data-key",
|
|
1173
1190
|
"block",
|
|
@@ -1176,31 +1193,33 @@ var pt = ["aria-label"], mt = {
|
|
|
1176
1193
|
"page",
|
|
1177
1194
|
"numbers"
|
|
1178
1195
|
]))), 128)),
|
|
1179
|
-
(
|
|
1196
|
+
(L(!0), I(v, null, m(_e(t), (e, t) => (L(), I("img", {
|
|
1180
1197
|
key: `image-${t}`,
|
|
1181
1198
|
class: "pk-word-preview__float",
|
|
1182
1199
|
style: u(e.css),
|
|
1183
1200
|
src: e.src,
|
|
1184
1201
|
alt: ""
|
|
1185
1202
|
}, null, 12, Ot))), 128)),
|
|
1186
|
-
t.footer && e.preview.parts?.[t.footer] ? (
|
|
1203
|
+
t.footer && e.preview.parts?.[t.footer] ? (L(), g(ft, {
|
|
1187
1204
|
key: 1,
|
|
1188
1205
|
blocks: e.preview.parts[t.footer],
|
|
1189
1206
|
where: "footer",
|
|
1190
|
-
section:
|
|
1207
|
+
section: k.value[t.section],
|
|
1191
1208
|
mode: e.mode,
|
|
1192
|
-
numbers:
|
|
1209
|
+
numbers: me.value[n]
|
|
1193
1210
|
}, null, 8, [
|
|
1194
1211
|
"blocks",
|
|
1195
1212
|
"section",
|
|
1196
1213
|
"mode",
|
|
1197
1214
|
"numbers"
|
|
1198
1215
|
])) : j("", !0)
|
|
1199
|
-
], 12, Dt))), 128))], 4)) : (
|
|
1216
|
+
], 12, Dt))), 128))], 4)) : (L(), I("article", {
|
|
1200
1217
|
key: 1,
|
|
1218
|
+
ref_key: "flowEl",
|
|
1219
|
+
ref: ie,
|
|
1201
1220
|
class: "pk-word-preview__page pk-word-preview__page--flow",
|
|
1202
|
-
style: u(
|
|
1203
|
-
}, [(
|
|
1221
|
+
style: u(ue.value)
|
|
1222
|
+
}, [(L(!0), I(v, null, m(_.value, (t) => (L(), g(lt, {
|
|
1204
1223
|
key: t.key,
|
|
1205
1224
|
"data-key": t.key,
|
|
1206
1225
|
block: e.preview.blocks[t.block],
|
|
@@ -1211,22 +1230,22 @@ var pt = ["aria-label"], mt = {
|
|
|
1211
1230
|
"block",
|
|
1212
1231
|
"row",
|
|
1213
1232
|
"mode"
|
|
1214
|
-
]))), 128))], 4)), e.preview.truncated ? (
|
|
1215
|
-
|
|
1216
|
-
page:
|
|
1217
|
-
count:
|
|
1233
|
+
]))), 128))], 4)), e.preview.truncated ? (L(), I("p", kt, w(P(p)("chatFilePreview.truncated")), 1)) : j("", !0)], 544), y("div", At, [
|
|
1234
|
+
N.value ? (L(), I("span", jt, w(P(p)("chatFilePreview.pageOf", {
|
|
1235
|
+
page: ye.value + 1,
|
|
1236
|
+
count: G.value.length
|
|
1218
1237
|
})), 1)) : j("", !0),
|
|
1219
|
-
y("span", Mt, w(P(p)("chatFilePreview.words",
|
|
1220
|
-
e.mode === "markup" && e.preview.revisionAuthors.length ? (
|
|
1238
|
+
y("span", Mt, w(P(p)("chatFilePreview.words", Oe.value)), 1),
|
|
1239
|
+
e.mode === "markup" && e.preview.revisionAuthors.length ? (L(), I("span", Nt, [
|
|
1221
1240
|
y("span", {
|
|
1222
1241
|
class: "pk-word-preview__legend-text",
|
|
1223
|
-
title: P(p)("chatFilePreview.revisionsOf", { authors:
|
|
1224
|
-
}, w(P(p)("chatFilePreview.revisionsOf", { authors:
|
|
1242
|
+
title: P(p)("chatFilePreview.revisionsOf", { authors: ke.value })
|
|
1243
|
+
}, w(P(p)("chatFilePreview.revisionsOf", { authors: ke.value })), 9, Pt),
|
|
1225
1244
|
y("del", Ft, w(P(p)("chatFilePreview.removed")), 1),
|
|
1226
1245
|
y("ins", It, w(P(p)("chatFilePreview.added")), 1)
|
|
1227
1246
|
])) : j("", !0),
|
|
1228
1247
|
n[6] ||= y("span", { class: "pk-word-preview__spacer" }, null, -1),
|
|
1229
|
-
!
|
|
1248
|
+
!O.value && (Q.value.length || $.value.length) ? (L(), g(i, {
|
|
1230
1249
|
key: 2,
|
|
1231
1250
|
class: "pk-word-preview__outline-toggle",
|
|
1232
1251
|
modifiers: "action-quiet",
|
|
@@ -1234,67 +1253,76 @@ var pt = ["aria-label"], mt = {
|
|
|
1234
1253
|
label: P(p)("chatFilePreview.outline"),
|
|
1235
1254
|
title: P(p)("chatFilePreview.outline"),
|
|
1236
1255
|
"aria-label": P(p)("chatFilePreview.outline"),
|
|
1237
|
-
"aria-expanded":
|
|
1238
|
-
onClick: n[2] ||= (e) =>
|
|
1256
|
+
"aria-expanded": Ee.value,
|
|
1257
|
+
onClick: n[2] ||= (e) => Ee.value = !Ee.value
|
|
1239
1258
|
}, null, 8, [
|
|
1240
1259
|
"label",
|
|
1241
1260
|
"title",
|
|
1242
1261
|
"aria-label",
|
|
1243
1262
|
"aria-expanded"
|
|
1244
1263
|
])) : j("", !0),
|
|
1245
|
-
|
|
1264
|
+
N.value ? (L(), I(v, { key: 3 }, [
|
|
1246
1265
|
f(i, {
|
|
1266
|
+
class: "pk-word-preview__fit",
|
|
1247
1267
|
modifiers: "action-quiet",
|
|
1268
|
+
icon: "ri:expand-width-line",
|
|
1248
1269
|
label: P(p)("chatFilePreview.fitWidth"),
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1270
|
+
title: P(p)("chatFilePreview.fitWidth"),
|
|
1271
|
+
"aria-label": P(p)("chatFilePreview.fitWidth"),
|
|
1272
|
+
disabled: K.value,
|
|
1273
|
+
onClick: n[3] ||= (e) => K.value = !0
|
|
1274
|
+
}, null, 8, [
|
|
1275
|
+
"label",
|
|
1276
|
+
"title",
|
|
1277
|
+
"aria-label",
|
|
1278
|
+
"disabled"
|
|
1279
|
+
]),
|
|
1252
1280
|
f(i, {
|
|
1253
1281
|
modifiers: "action-quiet",
|
|
1254
1282
|
icon: "ri:subtract-line",
|
|
1255
1283
|
"aria-label": P(p)("chatFilePreview.zoomOut"),
|
|
1256
|
-
disabled:
|
|
1257
|
-
onClick: n[4] ||= (e) =>
|
|
1284
|
+
disabled: q.value <= .3,
|
|
1285
|
+
onClick: n[4] ||= (e) => J(-.1)
|
|
1258
1286
|
}, null, 8, ["aria-label", "disabled"]),
|
|
1259
|
-
y("span", Lt, w(Math.round(
|
|
1287
|
+
y("span", Lt, w(Math.round(q.value * 100)) + "% ", 1),
|
|
1260
1288
|
f(i, {
|
|
1261
1289
|
modifiers: "action-quiet",
|
|
1262
1290
|
icon: "ri:add-line",
|
|
1263
1291
|
"aria-label": P(p)("chatFilePreview.zoomIn"),
|
|
1264
|
-
disabled:
|
|
1265
|
-
onClick: n[5] ||= (e) =>
|
|
1292
|
+
disabled: q.value >= 2,
|
|
1293
|
+
onClick: n[5] ||= (e) => J(.1)
|
|
1266
1294
|
}, null, 8, ["aria-label", "disabled"])
|
|
1267
1295
|
], 64)) : j("", !0)
|
|
1268
1296
|
])]),
|
|
1269
|
-
|
|
1297
|
+
N.value ? (L(), I("div", {
|
|
1270
1298
|
key: 1,
|
|
1271
1299
|
ref_key: "measureEl",
|
|
1272
1300
|
ref: T,
|
|
1273
1301
|
class: "pk-word-preview__measure",
|
|
1274
1302
|
"aria-hidden": "true",
|
|
1275
|
-
style: u(
|
|
1276
|
-
}, [(
|
|
1303
|
+
style: u(re.value)
|
|
1304
|
+
}, [(L(!0), I(v, null, m(_.value, (t) => (L(), I("div", {
|
|
1277
1305
|
key: t.key,
|
|
1278
1306
|
"data-item": ""
|
|
1279
1307
|
}, [f(lt, {
|
|
1280
1308
|
block: e.preview.blocks[t.block],
|
|
1281
1309
|
row: t.row,
|
|
1282
1310
|
mode: e.mode,
|
|
1283
|
-
page:
|
|
1311
|
+
page: A.value
|
|
1284
1312
|
}, null, 8, [
|
|
1285
1313
|
"block",
|
|
1286
1314
|
"row",
|
|
1287
1315
|
"mode",
|
|
1288
1316
|
"page"
|
|
1289
|
-
])]))), 128)), (
|
|
1317
|
+
])]))), 128)), (L(!0), I(v, null, m(e.preview.parts, (t, n) => (L(), I("div", {
|
|
1290
1318
|
key: n,
|
|
1291
1319
|
"data-part": n
|
|
1292
|
-
}, [(
|
|
1320
|
+
}, [(L(!0), I(v, null, m(P(H)(t, e.mode), (n) => (L(), g(lt, {
|
|
1293
1321
|
key: n.key,
|
|
1294
1322
|
block: t[n.block],
|
|
1295
1323
|
row: n.row,
|
|
1296
1324
|
mode: e.mode,
|
|
1297
|
-
page:
|
|
1325
|
+
page: A.value
|
|
1298
1326
|
}, null, 8, [
|
|
1299
1327
|
"block",
|
|
1300
1328
|
"row",
|
|
@@ -1304,22 +1332,22 @@ var pt = ["aria-label"], mt = {
|
|
|
1304
1332
|
], 2);
|
|
1305
1333
|
};
|
|
1306
1334
|
}
|
|
1307
|
-
}), [["styles", [".pk-word-preview{flex:1;min-height:0;display:flex;position:relative}.pk-word-preview__side{gap:var(--spacing-12);width:16.5rem;padding:var(--spacing-12);box-sizing:border-box;border-right:var(--border) solid var(--color-surface-3);background-color:var(--color-surface);flex-direction:column;flex-shrink:0;display:flex;overflow-y:auto}.pk-word-preview__side--over{inset:0 auto var(--spacing-40) 0;z-index:3;box-shadow:var(--shadow-lg);position:absolute}.pk-word-preview__tabs{border-bottom:var(--border) solid var(--color-surface-3);display:flex}.pk-word-preview__tab{min-height:var(--spacing-40);color:var(--color-word-3);font:inherit;font-size:var(--text-14);cursor:pointer;background:0 0;border:0;flex:1}.pk-word-preview__tab[aria-selected=true]{box-shadow:inset 0 calc(var(--spacing-2) * -1) 0 var(--color-word-1);color:var(--color-word-1);font-weight:var(--font-semibold)}.pk-word-preview__list{border:var(--border) solid var(--color-surface-3);border-radius:var(--rounded-lg);flex-direction:column;flex-shrink:0;display:flex;overflow:hidden}.pk-word-preview__entry{align-items:center;gap:var(--spacing-8);min-height:var(--spacing-40);padding:var(--spacing-8) var(--spacing-12);border:0;border-bottom:var(--border) solid var(--color-surface-2);color:var(--color-word-2);font:inherit;font-size:var(--text-14);text-align:start;cursor:pointer;transition:background-color var(--duration-150) var(--ease-out);background:0 0;display:flex}.pk-word-preview__entry:last-child{border-bottom:0}.pk-word-preview__entry:hover{background-color:var(--color-surface-1)}.pk-word-preview__entry[aria-current=location]{background-color:var(--color-surface-2);box-shadow:inset var(--spacing-3) 0 0 var(--color-word-2);color:var(--color-word-1);font-weight:var(--font-medium)}.pk-word-preview__entry--0{font-weight:var(--font-semibold)}.pk-word-preview__entry--2{padding-left:var(--spacing-24)}.pk-word-preview__entry--3{padding-left:var(--spacing-36)}.pk-word-preview__entry--change{gap:var(--spacing-4) var(--spacing-8);font-size:var(--text-12);flex-wrap:wrap}.pk-word-preview__entry-text{flex:1;min-width:0}.pk-word-preview__none{padding:var(--spacing-md);color:var(--color-word-3);font-size:var(--text-12);text-align:center;margin:0}.pk-word-preview__main{flex-direction:column;flex:1;min-width:0;display:flex}.pk-word-preview__scroll{min-height:0;padding:var(--spacing-md);background-color:var(--color-surface-2);flex:1;overflow:auto}.pk-word-preview__pages{align-items:center;gap:var(--spacing-24);flex-direction:column;width:max-content;min-width:100%;display:flex}.pk-word-preview__page{isolation:isolate;box-sizing:border-box;line-height:var(--pk-word-line,1.17);overflow-wrap:break-word;background-color:#fff;position:relative;overflow:hidden;box-shadow:0 1px 3px #140e3329,0 10px 28px #140e3314}.pk-word-preview__page--flow{width:100%;padding:var(--spacing-24) var(--spacing-20)}.pk-word-preview__measure{visibility:hidden;pointer-events:none;height:0;line-height:var(--pk-word-line,1.17);overflow-wrap:break-word;position:absolute;top:0;left:-100000px;overflow:hidden}.pk-word-preview__block{white-space:pre-wrap;margin:0;display:flow-root;position:relative}.pk-word-preview__picture{vertical-align:baseline;max-width:100%;height:auto}.pk-word-preview__picture--paragraph{max-width:none}.pk-word-preview__float{max-width:none;position:absolute}.pk-word-preview__part{pointer-events:none;position:absolute;inset:0}.pk-word-preview__part-flow{pointer-events:auto;position:absolute}.pk-word-preview__label{text-indent:0;display:inline-block}.pk-word-preview__changed:before{content:\"\";background-color:#3f3c51;width:1.5pt;position:absolute;top:0;bottom:0;left:-14pt}.pk-word-preview__table{border-collapse:collapse;table-layout:fixed;width:100%;margin:0;position:relative}.pk-word-preview__table td{vertical-align:top;white-space:pre-wrap;overflow-wrap:anywhere;padding:0 5.4pt}.pk-word-preview__table--lines td{border:.5pt solid #000}.pk-word-preview__table--lines.pk-word-preview__table--next td{border-top:0}.pk-word-preview__removed{color:var(--u-danger-text,#c42b3c);text-decoration:line-through}.pk-word-preview__added{color:var(--u-success-text,#178230);text-underline-offset:.2em;text-decoration:underline}.pk-word-preview__page .pk-word-preview__removed{color:#c42b3c}.pk-word-preview__page .pk-word-preview__added{color:#178230}.pk-word-preview__removed+.pk-word-preview__added{margin-inline-start:.15em}.pk-word-preview__image{padding:var(--spacing-2) var(--spacing-8);border:var(--border) dashed #c9c8d2;border-radius:var(--rounded);color:#6b6880;text-indent:0;font-size:9pt;display:inline-block}.pk-word-preview__truncated{margin:var(--spacing-md) 0 0;color:var(--color-word-3);font-size:var(--text-12);text-align:center}.pk-word-preview__status{align-items:center;gap:var(--spacing-16);min-height:var(--spacing-40);padding:0 var(--spacing-8) 0 var(--spacing-12);border-top:var(--border) solid var(--color-surface-3);background-color:var(--color-surface-1);color:var(--color-word-2);font-size:var(--text-12);white-space:nowrap;display:flex}.pk-word-preview__status>*{flex-shrink:0}.pk-word-preview__count{font-variant-numeric:tabular-nums}.pk-word-preview__status>.pk-word-preview__legend{gap:var(--spacing-8);flex-shrink:1;min-width:0;display:flex}.pk-word-preview__legend-text{text-overflow:ellipsis;min-width:0;overflow:hidden}.pk-word-preview__legend>.pk-word-preview__removed,.pk-word-preview__legend>.pk-word-preview__added{flex-shrink:0}.pk-word-preview__spacer{flex:1}@container (width<
|
|
1335
|
+
}), [["styles", [".pk-word-preview{flex:1;min-height:0;display:flex;position:relative}.pk-word-preview__side{gap:var(--spacing-12);width:16.5rem;padding:var(--spacing-12);box-sizing:border-box;border-right:var(--border) solid var(--color-surface-3);background-color:var(--color-surface);flex-direction:column;flex-shrink:0;display:flex;overflow-y:auto}.pk-word-preview__side--over{inset:0 auto var(--spacing-40) 0;z-index:3;box-shadow:var(--shadow-lg);position:absolute}.pk-word-preview__tabs{border-bottom:var(--border) solid var(--color-surface-3);display:flex}.pk-word-preview__tab{min-height:var(--spacing-40);color:var(--color-word-3);font:inherit;font-size:var(--text-14);cursor:pointer;background:0 0;border:0;flex:1}.pk-word-preview__tab[aria-selected=true]{box-shadow:inset 0 calc(var(--spacing-2) * -1) 0 var(--color-word-1);color:var(--color-word-1);font-weight:var(--font-semibold)}.pk-word-preview__list{border:var(--border) solid var(--color-surface-3);border-radius:var(--rounded-lg);flex-direction:column;flex-shrink:0;display:flex;overflow:hidden}.pk-word-preview__entry{align-items:center;gap:var(--spacing-8);min-height:var(--spacing-40);padding:var(--spacing-8) var(--spacing-12);border:0;border-bottom:var(--border) solid var(--color-surface-2);color:var(--color-word-2);font:inherit;font-size:var(--text-14);text-align:start;cursor:pointer;transition:background-color var(--duration-150) var(--ease-out);background:0 0;display:flex}.pk-word-preview__entry:last-child{border-bottom:0}.pk-word-preview__entry:hover{background-color:var(--color-surface-1)}.pk-word-preview__entry[aria-current=location]{background-color:var(--color-surface-2);box-shadow:inset var(--spacing-3) 0 0 var(--color-word-2);color:var(--color-word-1);font-weight:var(--font-medium)}.pk-word-preview__entry--0{font-weight:var(--font-semibold)}.pk-word-preview__entry--2{padding-left:var(--spacing-24)}.pk-word-preview__entry--3{padding-left:var(--spacing-36)}.pk-word-preview__entry--change{gap:var(--spacing-4) var(--spacing-8);font-size:var(--text-12);flex-wrap:wrap}.pk-word-preview__entry-text{flex:1;min-width:0}.pk-word-preview__none{padding:var(--spacing-md);color:var(--color-word-3);font-size:var(--text-12);text-align:center;margin:0}.pk-word-preview__main{flex-direction:column;flex:1;min-width:0;display:flex}.pk-word-preview__scroll{min-height:0;padding:var(--spacing-md);background-color:var(--color-surface-2);flex:1;overflow:auto}.pk-word-preview__pages{align-items:center;gap:var(--spacing-24);flex-direction:column;width:max-content;min-width:100%;display:flex}.pk-word-preview__page{isolation:isolate;box-sizing:border-box;line-height:var(--pk-word-line,1.17);overflow-wrap:break-word;background-color:#fff;position:relative;overflow:hidden;box-shadow:0 1px 3px #140e3329,0 10px 28px #140e3314}.pk-word-preview__page--flow{width:100%;padding:var(--spacing-24) var(--spacing-20)}.pk-word-preview__measure{visibility:hidden;pointer-events:none;height:0;line-height:var(--pk-word-line,1.17);overflow-wrap:break-word;position:absolute;top:0;left:-100000px;overflow:hidden}.pk-word-preview__block{white-space:pre-wrap;margin:0;display:flow-root;position:relative}.pk-word-preview__picture{vertical-align:baseline;max-width:100%;height:auto}.pk-word-preview__picture--paragraph{max-width:none}.pk-word-preview__float{max-width:none;position:absolute}.pk-word-preview__part{pointer-events:none;position:absolute;inset:0}.pk-word-preview__part-flow{pointer-events:auto;position:absolute}.pk-word-preview__label{text-indent:0;display:inline-block}.pk-word-preview__changed:before{content:\"\";background-color:#3f3c51;width:1.5pt;position:absolute;top:0;bottom:0;left:-14pt}.pk-word-preview__table{border-collapse:collapse;table-layout:fixed;width:100%;margin:0;position:relative}.pk-word-preview__table td{vertical-align:top;white-space:pre-wrap;overflow-wrap:anywhere;padding:0 5.4pt}.pk-word-preview__table--lines td{border:.5pt solid #000}.pk-word-preview__table--lines.pk-word-preview__table--next td{border-top:0}.pk-word-preview__removed{color:var(--u-danger-text,#c42b3c);text-decoration:line-through}.pk-word-preview__added{color:var(--u-success-text,#178230);text-underline-offset:.2em;text-decoration:underline}.pk-word-preview__page .pk-word-preview__removed{color:#c42b3c}.pk-word-preview__page .pk-word-preview__added{color:#178230}.pk-word-preview__removed+.pk-word-preview__added{margin-inline-start:.15em}.pk-word-preview__image{padding:var(--spacing-2) var(--spacing-8);border:var(--border) dashed #c9c8d2;border-radius:var(--rounded);color:#6b6880;text-indent:0;font-size:9pt;display:inline-block}.pk-word-preview__truncated{margin:var(--spacing-md) 0 0;color:var(--color-word-3);font-size:var(--text-12);text-align:center}.pk-word-preview__status{align-items:center;gap:var(--spacing-16);min-height:var(--spacing-40);padding:0 var(--spacing-8) 0 var(--spacing-12);border-top:var(--border) solid var(--color-surface-3);background-color:var(--color-surface-1);color:var(--color-word-2);font-size:var(--text-12);white-space:nowrap;display:flex}.pk-word-preview__status>*{flex-shrink:0}.pk-word-preview__count{font-variant-numeric:tabular-nums}.pk-word-preview__status>.pk-word-preview__legend{gap:var(--spacing-8);flex-shrink:1;min-width:0;display:flex}.pk-word-preview__legend-text{text-overflow:ellipsis;min-width:0;overflow:hidden}.pk-word-preview__legend>.pk-word-preview__removed,.pk-word-preview__legend>.pk-word-preview__added{flex-shrink:0}.pk-word-preview__spacer{flex:1}@container (width<46rem){.pk-word-preview__status{gap:var(--spacing-12)}.pk-word-preview__outline-toggle .vv-button__label,.pk-word-preview__fit .vv-button__label{display:none}}.pk-word-preview__percent{min-width:var(--spacing-40);font-variant-numeric:tabular-nums;text-align:center}"]]]);
|
|
1308
1336
|
// ../../packages/components/src/chat/PkFilePreview.vue?vue&type=script&setup=true&lang.ts
|
|
1309
1337
|
C(), p(), E();
|
|
1310
|
-
var
|
|
1338
|
+
var Ht = ["aria-label"], Ut = { class: "pk-file-preview__head" }, Wt = { class: "pk-file-preview__file" }, Gt = {
|
|
1311
1339
|
class: "pk-file-preview__tile",
|
|
1312
1340
|
"aria-hidden": "true"
|
|
1313
|
-
},
|
|
1341
|
+
}, Kt = { class: "pk-file-preview__name" }, qt = { class: "pk-file-preview__title" }, Jt = { class: "pk-file-preview__note" }, Yt = {
|
|
1314
1342
|
key: 0,
|
|
1315
1343
|
class: "pk-file-preview__tools"
|
|
1316
|
-
},
|
|
1344
|
+
}, Xt = ["aria-label"], Zt = { class: "pk-file-preview__version" }, Qt = { class: "pk-file-preview__mode-long" }, $t = { class: "pk-file-preview__mode-short" }, en = { class: "pk-file-preview__actions" }, tn = { class: "pk-file-preview__body" }, nn = {
|
|
1317
1345
|
key: 0,
|
|
1318
1346
|
class: "pk-file-preview__skeleton vv-skeleton"
|
|
1319
|
-
},
|
|
1347
|
+
}, rn = {
|
|
1320
1348
|
key: 1,
|
|
1321
1349
|
class: "pk-file-preview__empty"
|
|
1322
|
-
},
|
|
1350
|
+
}, an = /*@__PURE__*/ N({
|
|
1323
1351
|
__name: "PkFilePreview",
|
|
1324
1352
|
props: /*@__PURE__*/ l({
|
|
1325
1353
|
kind: { type: String },
|
|
@@ -1361,7 +1389,7 @@ var Vt = ["aria-label"], Ht = { class: "pk-file-preview__head" }, Ut = { class:
|
|
|
1361
1389
|
"update:fit"
|
|
1362
1390
|
]),
|
|
1363
1391
|
setup(e, { emit: t }) {
|
|
1364
|
-
let n = e, a = t, { t: o, locale: c } =
|
|
1392
|
+
let n = e, a = t, { t: o, locale: c } = te({ useScope: "global" }), l = x(() => n.versions ?? []), u = x(() => n.version ? l.value.indexOf(n.version) : -1), p = x(() => u.value > 0 ? l.value[u.value - 1] : void 0), ee = x(() => u.value >= 0 && u.value < l.value.length - 1 ? l.value[u.value + 1] : void 0), _ = s(e, "mode"), S = s(e, "sheet"), C = s(e, "zoom"), T = s(e, "fit"), E = x(() => [
|
|
1365
1393
|
{
|
|
1366
1394
|
value: "markup",
|
|
1367
1395
|
label: o("chatFilePreview.modeMarkup")
|
|
@@ -1378,15 +1406,15 @@ var Vt = ["aria-label"], Ht = { class: "pk-file-preview__head" }, Ut = { class:
|
|
|
1378
1406
|
d(() => n.version, () => {
|
|
1379
1407
|
_.value = "markup";
|
|
1380
1408
|
});
|
|
1381
|
-
let O = h("rootEl"), A = M(), N = b(!1),
|
|
1409
|
+
let O = h("rootEl"), A = M(), N = b(!1), F = () => {
|
|
1382
1410
|
A.value = void 0, N.value = !1;
|
|
1383
1411
|
};
|
|
1384
1412
|
d(() => [
|
|
1385
1413
|
n.version,
|
|
1386
1414
|
n.preview,
|
|
1387
1415
|
_.value
|
|
1388
|
-
],
|
|
1389
|
-
let
|
|
1416
|
+
], F);
|
|
1417
|
+
let ne = (e) => {
|
|
1390
1418
|
N.value || (A.value = e);
|
|
1391
1419
|
};
|
|
1392
1420
|
d(N, async (e, t) => {
|
|
@@ -1398,8 +1426,8 @@ var Vt = ["aria-label"], Ht = { class: "pk-file-preview__head" }, Ut = { class:
|
|
|
1398
1426
|
e && a("version", e);
|
|
1399
1427
|
}, R = x(() => {
|
|
1400
1428
|
let e = A.value;
|
|
1401
|
-
return e?.format === "docx" ? e.paragraphCount > 200 : (e?.cells ?? 0) >
|
|
1402
|
-
}), z = x(() => A.value?.format === "docx" && _.value === "original"), ae = x(() => R.value || z.value), B = x(() => z.value ? o("selectionActions.hintOriginal") : R.value ? o(A.value?.format === "docx" ? "selectionActions.hintParagraphs" : "selectionActions.hintCells", { count: A.value?.format === "docx" ? 200 :
|
|
1429
|
+
return e?.format === "docx" ? e.paragraphCount > 200 : (e?.cells ?? 0) > ge;
|
|
1430
|
+
}), z = x(() => A.value?.format === "docx" && _.value === "original"), ae = x(() => R.value || z.value), B = x(() => z.value ? o("selectionActions.hintOriginal") : R.value ? o(A.value?.format === "docx" ? "selectionActions.hintParagraphs" : "selectionActions.hintCells", { count: A.value?.format === "docx" ? 200 : ge }) : void 0), V = (e) => e[c.value] ?? e[c.value.split("-")[0]] ?? Object.values(e)[0] ?? "", oe = ["explain", "summarize"], se = x(() => {
|
|
1403
1431
|
let e = A.value, t = n.selectionActions;
|
|
1404
1432
|
if (!e || !t) return [];
|
|
1405
1433
|
let r = e.format;
|
|
@@ -1455,17 +1483,17 @@ var Vt = ["aria-label"], Ht = { class: "pk-file-preview__head" }, Ut = { class:
|
|
|
1455
1483
|
r && (a("selectionSend", e, r, {
|
|
1456
1484
|
id: t,
|
|
1457
1485
|
size: n.format === "docx" ? n.paragraphCount : n.cells
|
|
1458
|
-
}),
|
|
1486
|
+
}), F(), document.getSelection()?.removeAllRanges());
|
|
1459
1487
|
}, de = (e, t) => {
|
|
1460
1488
|
let n = se.value.find((t) => t.id === e);
|
|
1461
1489
|
n && H(n.prompt(t), e);
|
|
1462
|
-
},
|
|
1463
|
-
ue(O, "scroll", () =>
|
|
1490
|
+
}, W = b(0);
|
|
1491
|
+
ue(O, "scroll", () => W.value++, {
|
|
1464
1492
|
capture: !0,
|
|
1465
1493
|
passive: !0
|
|
1466
|
-
}), ue(window, "resize", () =>
|
|
1467
|
-
let
|
|
1468
|
-
|
|
1494
|
+
}), ue(window, "resize", () => W.value++, { passive: !0 });
|
|
1495
|
+
let G = x(() => {
|
|
1496
|
+
W.value;
|
|
1469
1497
|
let e = A.value?.measure(), t = O.value?.getBoundingClientRect();
|
|
1470
1498
|
if (e && t) return {
|
|
1471
1499
|
start: {
|
|
@@ -1482,8 +1510,8 @@ var Vt = ["aria-label"], Ht = { class: "pk-file-preview__head" }, Ut = { class:
|
|
|
1482
1510
|
};
|
|
1483
1511
|
});
|
|
1484
1512
|
return (t, n) => {
|
|
1485
|
-
let i =
|
|
1486
|
-
return
|
|
1513
|
+
let i = U, s = fe;
|
|
1514
|
+
return L(), I("section", {
|
|
1487
1515
|
ref_key: "rootEl",
|
|
1488
1516
|
ref: O,
|
|
1489
1517
|
class: "pk-file-preview",
|
|
@@ -1491,12 +1519,12 @@ var Vt = ["aria-label"], Ht = { class: "pk-file-preview__head" }, Ut = { class:
|
|
|
1491
1519
|
tabindex: "-1",
|
|
1492
1520
|
autofocus: ""
|
|
1493
1521
|
}, [
|
|
1494
|
-
y("header",
|
|
1495
|
-
y("div",
|
|
1522
|
+
y("header", Ut, [
|
|
1523
|
+
y("div", Wt, [y("span", Gt, [f(i, {
|
|
1496
1524
|
name: e.kind === "word" ? "ri:file-word-2-line" : "ri:file-excel-2-line",
|
|
1497
1525
|
class: r(e.kind === "word" ? "pk-file-preview__icon--word" : "pk-file-preview__icon--sheet")
|
|
1498
|
-
}, null, 8, ["name", "class"])]), y("div",
|
|
1499
|
-
e.version && l.value.length > 1 || D.value ? (
|
|
1526
|
+
}, null, 8, ["name", "class"])]), y("div", Kt, [y("strong", qt, w(e.filename), 1), y("span", Jt, w(P(o)("chatFilePreview.readOnly")), 1)])]),
|
|
1527
|
+
e.version && l.value.length > 1 || D.value ? (L(), I("div", Yt, [e.version && l.value.length > 1 ? (L(), I("nav", {
|
|
1500
1528
|
key: 0,
|
|
1501
1529
|
class: "pk-file-preview__versions",
|
|
1502
1530
|
"aria-label": P(o)("chatFilePreview.versions")
|
|
@@ -1508,7 +1536,7 @@ var Vt = ["aria-label"], Ht = { class: "pk-file-preview__head" }, Ut = { class:
|
|
|
1508
1536
|
disabled: !p.value,
|
|
1509
1537
|
onClick: n[0] ||= (e) => p.value && a("version", p.value)
|
|
1510
1538
|
}, null, 8, ["aria-label", "disabled"]),
|
|
1511
|
-
y("span",
|
|
1539
|
+
y("span", Zt, w(P(o)("chatFilePreview.versionOf", {
|
|
1512
1540
|
version: e.version,
|
|
1513
1541
|
count: l.value.length
|
|
1514
1542
|
})), 1),
|
|
@@ -1519,7 +1547,7 @@ var Vt = ["aria-label"], Ht = { class: "pk-file-preview__head" }, Ut = { class:
|
|
|
1519
1547
|
disabled: !ee.value,
|
|
1520
1548
|
onClick: n[1] ||= (e) => ee.value && a("version", ee.value)
|
|
1521
1549
|
}, null, 8, ["aria-label", "disabled"])
|
|
1522
|
-
], 8,
|
|
1550
|
+
], 8, Xt)) : j("", !0), D.value ? (L(), g(pe, {
|
|
1523
1551
|
key: 1,
|
|
1524
1552
|
modelValue: _.value,
|
|
1525
1553
|
"onUpdate:modelValue": n[2] ||= (e) => _.value = e,
|
|
@@ -1529,15 +1557,15 @@ var Vt = ["aria-label"], Ht = { class: "pk-file-preview__head" }, Ut = { class:
|
|
|
1529
1557
|
"aria-label": P(o)("chatFilePreview.modes"),
|
|
1530
1558
|
options: E.value
|
|
1531
1559
|
}, {
|
|
1532
|
-
markup: k(() => [y("span",
|
|
1560
|
+
markup: k(() => [y("span", Qt, w(P(o)("chatFilePreview.modeMarkup")), 1), y("span", $t, w(P(o)("chatFilePreview.modeMarkupShort")), 1)]),
|
|
1533
1561
|
_: 1
|
|
1534
1562
|
}, 8, [
|
|
1535
1563
|
"modelValue",
|
|
1536
1564
|
"aria-label",
|
|
1537
1565
|
"options"
|
|
1538
1566
|
])) : j("", !0)])) : j("", !0),
|
|
1539
|
-
y("div",
|
|
1540
|
-
e.restorable ? (
|
|
1567
|
+
y("div", en, [
|
|
1568
|
+
e.restorable ? (L(), g(s, {
|
|
1541
1569
|
key: 0,
|
|
1542
1570
|
modifiers: "action-quiet",
|
|
1543
1571
|
icon: "ri:arrow-go-back-line",
|
|
@@ -1556,14 +1584,14 @@ var Vt = ["aria-label"], Ht = { class: "pk-file-preview__head" }, Ut = { class:
|
|
|
1556
1584
|
"title",
|
|
1557
1585
|
"aria-label"
|
|
1558
1586
|
]),
|
|
1559
|
-
e.resize === "expand" ? (
|
|
1587
|
+
e.resize === "expand" ? (L(), g(s, {
|
|
1560
1588
|
key: 1,
|
|
1561
1589
|
modifiers: "action-quiet",
|
|
1562
1590
|
icon: "ri:fullscreen-line",
|
|
1563
1591
|
title: P(o)("chatFilePreview.expand"),
|
|
1564
1592
|
"aria-label": P(o)("chatFilePreview.expand"),
|
|
1565
1593
|
onClick: n[4] ||= (e) => a("resize")
|
|
1566
|
-
}, null, 8, ["title", "aria-label"])) : e.resize === "shrink" ? (
|
|
1594
|
+
}, null, 8, ["title", "aria-label"])) : e.resize === "shrink" ? (L(), g(s, {
|
|
1567
1595
|
key: 2,
|
|
1568
1596
|
modifiers: "action-quiet",
|
|
1569
1597
|
icon: "ri:fullscreen-exit-line",
|
|
@@ -1580,10 +1608,10 @@ var Vt = ["aria-label"], Ht = { class: "pk-file-preview__head" }, Ut = { class:
|
|
|
1580
1608
|
}, null, 8, ["title", "aria-label"])
|
|
1581
1609
|
])
|
|
1582
1610
|
]),
|
|
1583
|
-
y("div",
|
|
1611
|
+
y("div", tn, [e.loading ? (L(), I("div", nn, [(L(), I(v, null, m(8, (e) => y("div", {
|
|
1584
1612
|
key: e,
|
|
1585
1613
|
class: r(["vv-skeleton__item pk-file-preview__skeleton-line", e % 3 ? "w-full" : "w-128"])
|
|
1586
|
-
}, null, 2)), 64))])) : e.error || !e.preview ? (
|
|
1614
|
+
}, null, 2)), 64))])) : e.error || !e.preview ? (L(), I("p", rn, w(P(o)("chatFilePreview.unavailable")), 1)) : e.preview.kind === "word" ? (L(), g(Vt, {
|
|
1587
1615
|
key: 2,
|
|
1588
1616
|
zoom: C.value,
|
|
1589
1617
|
"onUpdate:zoom": n[7] ||= (e) => C.value = e,
|
|
@@ -1591,31 +1619,31 @@ var Vt = ["aria-label"], Ht = { class: "pk-file-preview__head" }, Ut = { class:
|
|
|
1591
1619
|
"onUpdate:fit": n[8] ||= (e) => T.value = e,
|
|
1592
1620
|
preview: e.preview,
|
|
1593
1621
|
mode: D.value ? _.value : "markup",
|
|
1594
|
-
onSelect:
|
|
1622
|
+
onSelect: ne
|
|
1595
1623
|
}, null, 8, [
|
|
1596
1624
|
"zoom",
|
|
1597
1625
|
"fit",
|
|
1598
1626
|
"preview",
|
|
1599
1627
|
"mode"
|
|
1600
|
-
])) : (
|
|
1628
|
+
])) : (L(), g(Qe, {
|
|
1601
1629
|
key: 3,
|
|
1602
1630
|
sheet: S.value,
|
|
1603
1631
|
"onUpdate:sheet": n[9] ||= (e) => S.value = e,
|
|
1604
1632
|
zoom: C.value,
|
|
1605
1633
|
"onUpdate:zoom": n[10] ||= (e) => C.value = e,
|
|
1606
1634
|
preview: e.preview,
|
|
1607
|
-
onSelect:
|
|
1635
|
+
onSelect: ne
|
|
1608
1636
|
}, null, 8, [
|
|
1609
1637
|
"sheet",
|
|
1610
1638
|
"zoom",
|
|
1611
1639
|
"preview"
|
|
1612
1640
|
]))]),
|
|
1613
|
-
e.selectionActions && A.value &&
|
|
1641
|
+
e.selectionActions && A.value && G.value ? (L(), g(ke, {
|
|
1614
1642
|
key: 0,
|
|
1615
1643
|
asking: N.value,
|
|
1616
1644
|
"onUpdate:asking": n[11] ||= (e) => N.value = e,
|
|
1617
1645
|
strategy: "absolute",
|
|
1618
|
-
anchor:
|
|
1646
|
+
anchor: G.value,
|
|
1619
1647
|
actions: se.value,
|
|
1620
1648
|
hint: B.value,
|
|
1621
1649
|
note: re.value ? void 0 : P(o)("selectionActions.notLatest", { version: e.version }),
|
|
@@ -1623,7 +1651,7 @@ var Vt = ["aria-label"], Ht = { class: "pk-file-preview__head" }, Ut = { class:
|
|
|
1623
1651
|
onAction: de,
|
|
1624
1652
|
onAsk: n[12] ||= (e) => H(e, "ask"),
|
|
1625
1653
|
onNote: ie,
|
|
1626
|
-
onClose:
|
|
1654
|
+
onClose: F
|
|
1627
1655
|
}, null, 8, [
|
|
1628
1656
|
"asking",
|
|
1629
1657
|
"anchor",
|
|
@@ -1632,10 +1660,10 @@ var Vt = ["aria-label"], Ht = { class: "pk-file-preview__head" }, Ut = { class:
|
|
|
1632
1660
|
"note",
|
|
1633
1661
|
"note-action"
|
|
1634
1662
|
])) : j("", !0)
|
|
1635
|
-
], 8,
|
|
1663
|
+
], 8, Ht);
|
|
1636
1664
|
};
|
|
1637
1665
|
}
|
|
1638
|
-
}),
|
|
1639
|
-
export {
|
|
1666
|
+
}), on = ".pk-file-preview{background-color:var(--color-surface);height:100%;min-height:0;color:var(--color-word-1);outline:none;flex-direction:column;display:flex;position:relative;container-type:inline-size}.pk-file-preview__head{align-items:center;gap:var(--spacing-8) var(--spacing-12);padding:var(--spacing-12) var(--spacing-12) var(--spacing-12) var(--spacing-md);border-bottom:var(--border) solid var(--color-surface-3);flex-wrap:wrap;display:flex}.pk-file-preview__file{align-items:center;gap:var(--spacing-12);flex:12rem;min-width:0;display:flex}.pk-file-preview__tile{width:var(--spacing-32);height:var(--spacing-32);border:var(--border) solid var(--color-surface-3);border-radius:var(--rounded);flex-shrink:0;justify-content:center;align-items:center;display:flex}.pk-file-preview__tile .vv-icon{width:var(--spacing-18);height:var(--spacing-18)}.pk-file-preview__icon--word{color:#2b7de9}.pk-file-preview__icon--sheet{color:#1f9d57}.pk-file-preview__name{flex-direction:column;min-width:0;display:flex}.pk-file-preview__title{font-size:var(--text-14);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.pk-file-preview__note{color:var(--color-word-3);font-size:var(--text-12)}.pk-file-preview__tools{align-items:center;gap:var(--spacing-8) var(--spacing-12);flex-wrap:wrap;display:flex}.pk-file-preview__versions{align-items:center;gap:var(--spacing-2);display:flex}.pk-file-preview__version{font-size:var(--text-14);font-weight:var(--font-semibold);font-variant-numeric:tabular-nums;white-space:nowrap}.pk-file-preview__actions{align-items:center;gap:var(--spacing-8);margin-left:auto;display:flex}@container (width<52rem){.pk-file-preview__file{order:1}.pk-file-preview__actions{order:2}.pk-file-preview__tools{flex-basis:100%;order:3}.pk-file-preview__tools .pk-file-preview__modes{flex:auto}}.pk-file-preview__mode-short{display:none}@container (width<38rem){.pk-file-preview__mode-long{display:none}.pk-file-preview__mode-short{display:inline}}@container (width<30rem){.pk-file-preview__tools .pk-file-preview__modes{flex:100%}.pk-file-preview__tools .pk-file-preview__modes .vv-radio{padding-inline:var(--spacing-4)}}.pk-file-preview__body{background-color:var(--color-surface-1);flex-direction:column;flex:1;min-height:0;display:flex}.pk-file-preview__skeleton{width:min(42rem, 100% - 2 * var(--spacing-md));margin:var(--spacing-md) auto;padding:var(--spacing-lg);box-sizing:border-box;border:var(--border) solid var(--color-surface-3);border-radius:var(--rounded);background-color:var(--color-surface)}.pk-file-preview__skeleton-line{height:var(--spacing-12);margin-bottom:var(--spacing-12);border-radius:var(--rounded)}.pk-file-preview__empty{margin:var(--spacing-lg) var(--spacing-md);color:var(--color-word-3);font-size:var(--text-14);text-align:center}", sn = /* @__PURE__ */ e({ default: () => cn }), cn = /*#__PURE__*/ W(an, [["styles", [on]]]);
|
|
1667
|
+
export { sn as n, cn as t };
|
|
1640
1668
|
|
|
1641
|
-
//# sourceMappingURL=PkFilePreview-
|
|
1669
|
+
//# sourceMappingURL=PkFilePreview-8nVPKv8k.js.map
|