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