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