@8wave/ai-elements 0.125.0-beta.18 → 0.125.0-beta.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{PkFilePreview-BIFkMsAC.js → PkFilePreview-BzNLupQS.js} +318 -315
- package/dist/_chunks/PkFilePreview-BzNLupQS.js.map +1 -0
- package/dist/_chunks/{PkFilePreviewDialog-NLk4gZMd.js → PkFilePreviewDialog-BfZFgdOi.js} +2 -2
- package/dist/_chunks/{PkFilePreviewDialog-NLk4gZMd.js.map → PkFilePreviewDialog-BfZFgdOi.js.map} +1 -1
- package/dist/ai-elements.es.js +205 -202
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/PkChatbotViewConversations.js +1 -1
- package/dist-vue/PkChatbotViewFiles.js +1 -1
- package/dist-vue/PkChatbotViewProfile.js +1 -1
- package/dist-vue/_chunks/{PkChatbot-DCGQnndK.js → PkChatbot-BVZgvanv.js} +6 -6
- package/dist-vue/_chunks/{PkChatbot-DCGQnndK.js.map → PkChatbot-BVZgvanv.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-CHvtUHuO.js → PkChatbotViewChat-C1uzFQCJ.js} +338 -335
- package/dist-vue/_chunks/PkChatbotViewChat-C1uzFQCJ.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewConversations-7JU_5-F2.js → PkChatbotViewConversations-DjhiHp8-.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewConversations-7JU_5-F2.js.map → PkChatbotViewConversations-DjhiHp8-.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-D53wtRPS.js → PkChatbotViewFiles-CtOhnFCc.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewFiles-D53wtRPS.js.map → PkChatbotViewFiles-CtOhnFCc.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-BRlLIofM.js → PkChatbotViewProfile-NfTamy9j.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-BRlLIofM.js.map → PkChatbotViewProfile-NfTamy9j.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreview-DLo9nI2g.js → PkFilePreview-C2VOU99H.js} +469 -466
- package/dist-vue/_chunks/PkFilePreview-C2VOU99H.js.map +1 -0
- package/dist-vue/_chunks/{PkFilePreviewDialog-CgDJQgIJ.js → PkFilePreviewDialog-C6QQMntW.js} +2 -2
- package/dist-vue/_chunks/{PkFilePreviewDialog-CgDJQgIJ.js.map → PkFilePreviewDialog-C6QQMntW.js.map} +1 -1
- package/dist-vue/_chunks/{useChatbotStore-Bj00X4yT.js → useChatbotStore-BZ1n3Hyx.js} +654 -654
- package/dist-vue/_chunks/useChatbotStore-BZ1n3Hyx.js.map +1 -0
- package/dist-vue/composables.js +1 -1
- package/dist-vue/index.js +6 -6
- package/package.json +1 -1
- package/dist/_chunks/PkFilePreview-BIFkMsAC.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotViewChat-CHvtUHuO.js.map +0 -1
- package/dist-vue/_chunks/PkFilePreview-DLo9nI2g.js.map +0 -1
- package/dist-vue/_chunks/useChatbotStore-Bj00X4yT.js.map +0 -1
|
@@ -2,34 +2,35 @@ import { r as e } from "./rolldown-runtime-9rEmUaIe.js";
|
|
|
2
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 T, v as E, vt as te, w as D, wt as O, x as ne, y as k, z as A } from "./vue.runtime.esm-bundler-C2U5uTqB.js";
|
|
3
3
|
import { r as re } from "./vue-i18n-POtLvOl1.js";
|
|
4
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 I, U as ae, V as
|
|
6
|
-
import { d as
|
|
7
|
-
import { t as
|
|
8
|
-
import { t as
|
|
9
|
-
import { n as
|
|
10
|
-
import { t as
|
|
11
|
-
import { t as
|
|
5
|
+
import { B as P, G as F, H as ie, K as I, U as ae, V as oe, W as L, o as R, z } from "./utils-BZuri2jT.js";
|
|
6
|
+
import { d as B, l as se } from "./dist-D6oUr4J_.js";
|
|
7
|
+
import { t as ce } from "./index.es-D-aOuzzp.js";
|
|
8
|
+
import { t as le } from "./VvButtonLocalized-B32dBwWJ.js";
|
|
9
|
+
import { n as ue, t as de } from "./PkSelectionActions-CUymhwsG.js";
|
|
10
|
+
import { t as V } from "./_plugin-vue_export-helper-Djzt4Yr7.js";
|
|
11
|
+
import { t as H } 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 fe = 2e3, pe = 1e3, U = 60, W = 1400, G = 20, K = 100, q = (e) => Number(e.slice(1)), me = (e) => {
|
|
14
|
+
let t = [...new Set(e)].sort((e, t) => q(e) - q(t)), n = [];
|
|
15
15
|
for (let e of t) {
|
|
16
16
|
let t = n[n.length - 1];
|
|
17
|
-
t &&
|
|
17
|
+
t && q(e) === q(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
|
+
}, he = (e, t) => {
|
|
24
24
|
let n = [];
|
|
25
|
-
|
|
25
|
+
if (!t) return n;
|
|
26
|
+
for (let r = e.indexOf(t); r >= 0; r = e.indexOf(t, r + 1)) n.push(r);
|
|
26
27
|
return n;
|
|
27
|
-
},
|
|
28
|
-
let r =
|
|
28
|
+
}, ge = (e, t, n) => {
|
|
29
|
+
let r = he(e, e.slice(t, t + n));
|
|
29
30
|
if (r.length < 2) return {};
|
|
30
31
|
let i = t, a = t + n;
|
|
31
|
-
for (let t = !0; a - i <=
|
|
32
|
-
if (
|
|
32
|
+
for (let t = !0; a - i <= W; t = !t) {
|
|
33
|
+
if (he(e, e.slice(i, a)).length === 1) return { find: e.slice(i, a) };
|
|
33
34
|
if (t && i > 0) i = e.slice(0, i).replace(/\S*\s*$/, "").length;
|
|
34
35
|
else if (a < e.length) {
|
|
35
36
|
let t = e.slice(a).match(/^\s*\S*/)?.[0] ?? "";
|
|
@@ -40,17 +41,18 @@ var de = 2e3, fe = 1e3, W = 60, G = 1400, pe = 20, K = (e) => Number(e.slice(1))
|
|
|
40
41
|
index: r.indexOf(t) + 1 || 1,
|
|
41
42
|
of: r.length
|
|
42
43
|
} };
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
}, _e = (e) => (e.querySelectorAll("[data-quote-skip]").forEach((e) => e.remove()), e.querySelectorAll("[data-paragraph]").forEach((e) => e.append("\n")), e.textContent ?? ""), ve = (e) => e.length > pe ? `${e.slice(0, pe / 2)} […] ${e.slice(-500)}` : e, ye = (e, t, n) => {
|
|
45
|
+
let r = t.commonAncestorContainer;
|
|
46
|
+
if (!e.contains(r) || (r instanceof Element ? r : r.parentElement)?.closest("[data-quote-skip]")) return;
|
|
47
|
+
let i = [...e.querySelectorAll("[data-paragraph]")].filter((e) => !e.closest(n) && t.intersectsNode(e));
|
|
48
|
+
if (!i.length) return;
|
|
49
|
+
let a = i.flatMap((e) => e.dataset.paragraph.split(" ")), o = _e(t.cloneContents()), s = o.trim();
|
|
50
|
+
if (s.length < 2) return;
|
|
51
|
+
let c = {
|
|
50
52
|
format: "docx",
|
|
51
|
-
runs:
|
|
52
|
-
paragraphCount: new Set(
|
|
53
|
-
quote:
|
|
53
|
+
runs: me(a),
|
|
54
|
+
paragraphCount: new Set(a).size,
|
|
55
|
+
quote: ve(s),
|
|
54
56
|
measure: () => {
|
|
55
57
|
let e = t.getBoundingClientRect(), n = t.getClientRects()[0] ?? e;
|
|
56
58
|
return {
|
|
@@ -66,20 +68,20 @@ var de = 2e3, fe = 1e3, W = 60, G = 1400, pe = 20, K = (e) => Number(e.slice(1))
|
|
|
66
68
|
e?.removeAllRanges(), e?.addRange(t.cloneRange());
|
|
67
69
|
}
|
|
68
70
|
};
|
|
69
|
-
if (
|
|
70
|
-
let e =
|
|
71
|
+
if (i.length === 1) {
|
|
72
|
+
let e = i[0], n = document.createRange();
|
|
71
73
|
n.selectNodeContents(e);
|
|
72
|
-
let
|
|
73
|
-
|
|
74
|
-
let l =
|
|
75
|
-
|
|
74
|
+
let r = _e(n.cloneContents()).replace(/\n$/, ""), a = document.createRange();
|
|
75
|
+
a.setStart(e, 0), a.setEnd(t.startContainer, t.startOffset);
|
|
76
|
+
let l = _e(a.cloneContents()).length + (o.length - o.trimStart().length);
|
|
77
|
+
c.before = r.slice(Math.max(0, l - U), l), c.after = r.slice(l + s.length, l + s.length + U), Object.assign(c, ge(r, l, s.length));
|
|
76
78
|
}
|
|
77
|
-
return
|
|
78
|
-
},
|
|
79
|
+
return c;
|
|
80
|
+
}, J = (e) => {
|
|
79
81
|
let t = "";
|
|
80
82
|
for (let n = e; n > 0; n = Math.floor((n - 1) / 26)) t = String.fromCharCode(65 + (n - 1) % 26) + t;
|
|
81
83
|
return t;
|
|
82
|
-
},
|
|
84
|
+
}, be = (e, t) => {
|
|
83
85
|
let n = { ...t }, r = e.rows.flatMap((e) => e.cells.filter((e) => e.span).map((t) => ({
|
|
84
86
|
r1: e.row,
|
|
85
87
|
r2: e.row + t.span.rows - 1,
|
|
@@ -90,7 +92,7 @@ var de = 2e3, fe = 1e3, W = 60, G = 1400, pe = 20, K = (e) => Number(e.slice(1))
|
|
|
90
92
|
e = !1;
|
|
91
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);
|
|
92
94
|
}
|
|
93
|
-
let i = `${
|
|
95
|
+
let i = `${J(n.c1)}${n.r1}`, a = `${J(n.c2)}${n.r2}`, o = (e.hiddenRows ?? []).filter((e) => e >= n.r1 && e <= n.r2).slice(0, K), s = e.columns.filter((e) => e.hidden && e.col >= n.c1 && e.col <= n.c2).map((e) => J(e.col)).slice(0, K), 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, G).map((e) => String(e.value)).join("; ").slice(0, 500);
|
|
94
96
|
return {
|
|
95
97
|
format: "xlsx",
|
|
96
98
|
sheet: e.name,
|
|
@@ -103,23 +105,23 @@ var de = 2e3, fe = 1e3, W = 60, G = 1400, pe = 20, K = (e) => Number(e.slice(1))
|
|
|
103
105
|
};
|
|
104
106
|
// ../../packages/components/src/chat/PkSpreadsheetPreview.vue?vue&type=script&setup=true&lang.ts
|
|
105
107
|
x(), C(), f(), w();
|
|
106
|
-
var
|
|
108
|
+
var xe = { class: "pk-spreadsheet-preview" }, Se = { class: "pk-spreadsheet-preview__bar" }, Ce = ["aria-label"], we = ["aria-label"], Te = ["aria-label"], Ee = [
|
|
107
109
|
"rowspan",
|
|
108
110
|
"colspan",
|
|
109
111
|
"data-focus",
|
|
110
112
|
"title",
|
|
111
113
|
"onMousedown",
|
|
112
114
|
"onMouseenter"
|
|
113
|
-
],
|
|
115
|
+
], De = {
|
|
114
116
|
key: 1,
|
|
115
117
|
class: "pk-spreadsheet-preview__more"
|
|
116
|
-
},
|
|
118
|
+
}, Oe = ["aria-label"], Y = ["aria-current", "onClick"], ke = { class: "pk-spreadsheet-preview__status" }, Ae = { class: "pk-spreadsheet-preview__info" }, je = ["title"], Me = ["title"], Ne = {
|
|
117
119
|
key: 2,
|
|
118
120
|
class: "pk-spreadsheet-preview__stats"
|
|
119
|
-
},
|
|
121
|
+
}, Pe = {
|
|
120
122
|
key: 0,
|
|
121
123
|
class: "pk-spreadsheet-preview__average"
|
|
122
|
-
},
|
|
124
|
+
}, Fe = { key: 1 }, Ie = { class: "pk-spreadsheet-preview__zoom" }, Le = { class: "pk-spreadsheet-preview__percent" }, Re = 64, ze = 20, Be = 28, Ve = 44, He = /*#__PURE__*/ V(/* @__PURE__ */ D({
|
|
123
125
|
__name: "PkSpreadsheetPreview",
|
|
124
126
|
props: /*@__PURE__*/ c({ preview: { type: null } }, {
|
|
125
127
|
sheet: { default: 0 },
|
|
@@ -129,7 +131,7 @@ var ye = { class: "pk-spreadsheet-preview" }, be = { class: "pk-spreadsheet-prev
|
|
|
129
131
|
}),
|
|
130
132
|
emits: /*@__PURE__*/ c(["select"], ["update:sheet", "update:zoom"]),
|
|
131
133
|
setup(e, { emit: t }) {
|
|
132
|
-
let n = e, a = t, { t: s, locale: c } = re({ useScope: "global" }), f = o(e, "sheet"), h = o(e, "zoom"), x = m("scrollEl"), { width: C, height: w } =
|
|
134
|
+
let n = e, a = t, { t: s, locale: c } = re({ useScope: "global" }), f = o(e, "sheet"), h = o(e, "zoom"), x = m("scrollEl"), { width: C, height: w } = se(x, {
|
|
133
135
|
width: 0,
|
|
134
136
|
height: 0
|
|
135
137
|
}, { box: "border-box" }), T = b(() => n.preview.sheets[f.value] ?? n.preview.sheets[0]);
|
|
@@ -143,55 +145,55 @@ var ye = { class: "pk-spreadsheet-preview" }, be = { class: "pk-spreadsheet-prev
|
|
|
143
145
|
}, D = b(() => {
|
|
144
146
|
let e = T.value;
|
|
145
147
|
if (!e) return [];
|
|
146
|
-
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 =
|
|
148
|
+
let t = new Set(e.columns.filter((e) => e.hidden).map((e) => e.col)), n = new Map(e.columns.map((e) => [e.col, e.width])), r = [], i = Ve, a = C.value / h.value;
|
|
147
149
|
for (let o = 1; o <= e.lastColumn || !e.moreColumns && (o <= e.lastColumn + 2 || i < a); o++) {
|
|
148
150
|
if (t.has(o)) continue;
|
|
149
|
-
let e = n.get(o) ??
|
|
151
|
+
let e = n.get(o) ?? Re;
|
|
150
152
|
r.push({
|
|
151
153
|
col: o,
|
|
152
154
|
width: e
|
|
153
155
|
}), i += e;
|
|
154
156
|
}
|
|
155
157
|
return r;
|
|
156
|
-
}), P = b(() => D.value.reduce((e, t) => e + t.width,
|
|
158
|
+
}), P = b(() => D.value.reduce((e, t) => e + t.width, Ve)), F = b(() => D.value.map((e) => `${e.col}:${e.width}`).join(",")), ie = /* @__PURE__ */ new WeakMap(), I = b(() => {
|
|
157
159
|
let e = T.value;
|
|
158
160
|
if (!e) return [];
|
|
159
|
-
let t = new Set(e.hiddenRows ?? []), n = new Map(e.rows.map((e) => [e.row, e.height])), r = Math.ceil((w.value / h.value -
|
|
161
|
+
let t = new Set(e.hiddenRows ?? []), n = new Map(e.rows.map((e) => [e.row, e.height])), r = Math.ceil((w.value / h.value - Be) / ze), i = e.moreRows ? e.lastRow : Math.max(e.lastRow + 5, r + t.size), a = ie.get(e);
|
|
160
162
|
a || (a = /* @__PURE__ */ new Map(), ie.set(e, a));
|
|
161
163
|
let o = a;
|
|
162
164
|
return Array.from({ length: i }, (e, t) => t + 1).filter((e) => !t.has(e)).map((e) => {
|
|
163
165
|
let t = o.get(e);
|
|
164
166
|
return t || (t = {
|
|
165
167
|
row: e,
|
|
166
|
-
height: n.get(e) ??
|
|
168
|
+
height: n.get(e) ?? ze
|
|
167
169
|
}, o.set(e, t)), t;
|
|
168
170
|
});
|
|
169
171
|
}), ae = b(() => {
|
|
170
172
|
let e = /* @__PURE__ */ new Map();
|
|
171
173
|
for (let t of T.value?.rows ?? []) for (let n of t.cells) e.set(`${t.row},${n.col}`, n);
|
|
172
174
|
return e;
|
|
173
|
-
}),
|
|
175
|
+
}), oe = b(() => {
|
|
174
176
|
let e = /* @__PURE__ */ new Map();
|
|
175
177
|
for (let t of T.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}`, {
|
|
176
178
|
row: t.row,
|
|
177
179
|
col: n.col
|
|
178
180
|
});
|
|
179
181
|
return e;
|
|
180
|
-
}),
|
|
181
|
-
let n =
|
|
182
|
+
}), L = (e, t) => ae.value.get(`${e},${t}`), R = (e, t) => {
|
|
183
|
+
let n = L(e, t)?.span;
|
|
182
184
|
if (n) return {
|
|
183
185
|
rows: I.value.filter((t) => t.row >= e && t.row < e + n.rows).length,
|
|
184
186
|
cols: D.value.filter((e) => e.col >= t && e.col < t + n.cols).length
|
|
185
187
|
};
|
|
186
|
-
},
|
|
188
|
+
}, z = (e) => e?.style === void 0 ? void 0 : n.preview.styles[e.style], B = (e) => {
|
|
187
189
|
let t = e.numFmt === void 0 ? void 0 : n.preview.numberFormats?.[e.numFmt], r = e.value;
|
|
188
190
|
if (t !== void 0) try {
|
|
189
191
|
return e.format === "date" ? e.serial === void 0 ? void 0 : M(t, e.serial, c.value, n.preview.date1904) : typeof r == "number" ? j(t) ? M(t, r, c.value, n.preview.date1904) : N(t, r, c.value) : void 0;
|
|
190
192
|
} catch {
|
|
191
193
|
return;
|
|
192
194
|
}
|
|
193
|
-
},
|
|
194
|
-
let n =
|
|
195
|
+
}, ce = (e, t) => {
|
|
196
|
+
let n = B(e);
|
|
195
197
|
if (n) return n.text;
|
|
196
198
|
let r = e.decimals === void 0 ? { maximumFractionDigits: 10 } : {
|
|
197
199
|
minimumFractionDigits: e.decimals,
|
|
@@ -206,18 +208,18 @@ var ye = { class: "pk-spreadsheet-preview" }, be = { class: "pk-spreadsheet-prev
|
|
|
206
208
|
currency: e.currency
|
|
207
209
|
} : {}
|
|
208
210
|
}).format(t);
|
|
209
|
-
},
|
|
211
|
+
}, ue = (e) => {
|
|
210
212
|
let t = /* @__PURE__ */ new Date(`${e}T00:00:00Z`);
|
|
211
213
|
return Number.isNaN(t.getTime()) ? e : new Intl.DateTimeFormat(c.value, {
|
|
212
214
|
dateStyle: "short",
|
|
213
215
|
timeZone: "UTC"
|
|
214
216
|
}).format(t);
|
|
215
|
-
},
|
|
217
|
+
}, de = (e) => {
|
|
216
218
|
if (!e) return "";
|
|
217
219
|
if (e.missing) return "—";
|
|
218
220
|
let t = e.value;
|
|
219
|
-
return t === void 0 ? "" : typeof t == "boolean" ? s(t ? "chatFilePreview.true" : "chatFilePreview.false") : e.format === "date" && typeof t == "string" ?
|
|
220
|
-
},
|
|
221
|
+
return t === void 0 ? "" : typeof t == "boolean" ? s(t ? "chatFilePreview.true" : "chatFilePreview.false") : e.format === "date" && typeof t == "string" ? B(e)?.text ?? ue(t) : typeof t == "number" ? ce(e, t) : t;
|
|
222
|
+
}, V = (e) => {
|
|
221
223
|
if (!e) return "";
|
|
222
224
|
if (e.formula) return `=${e.formula}`;
|
|
223
225
|
let t = e.value;
|
|
@@ -225,9 +227,9 @@ var ye = { class: "pk-spreadsheet-preview" }, be = { class: "pk-spreadsheet-prev
|
|
|
225
227
|
useGrouping: !1,
|
|
226
228
|
maximumFractionDigits: 15,
|
|
227
229
|
...e.format === "percent" ? { style: "percent" } : {}
|
|
228
|
-
}).format(t) :
|
|
229
|
-
},
|
|
230
|
-
let r =
|
|
230
|
+
}).format(t) : de(e);
|
|
231
|
+
}, H = (e) => e ? `${e.width}px solid ${e.color}` : void 0, fe = (e, t, n) => {
|
|
232
|
+
let r = z(e), i = e?.value, a = typeof i == "number" || e?.format === "date" || !!e?.missing, o = {
|
|
231
233
|
textAlign: r?.align ?? (a ? "right" : typeof i == "boolean" || e?.format === "error" ? "center" : "left"),
|
|
232
234
|
verticalAlign: r?.valign === "top" ? "top" : r?.valign === "middle" ? "middle" : "bottom",
|
|
233
235
|
whiteSpace: r?.wrap ? "pre-wrap" : "nowrap"
|
|
@@ -235,32 +237,32 @@ var ye = { class: "pk-spreadsheet-preview" }, be = { class: "pk-spreadsheet-prev
|
|
|
235
237
|
r?.bold && (o.fontWeight = 700), r?.italic && (o.fontStyle = "italic");
|
|
236
238
|
let s = [r?.underline ? "underline" : "", r?.strike ? "line-through" : ""].filter(Boolean).join(" ");
|
|
237
239
|
s && (o.textDecoration = s), r?.size && (o.fontSize = `${r.size}pt`);
|
|
238
|
-
let c = e ?
|
|
240
|
+
let c = e ? B(e)?.color : void 0;
|
|
239
241
|
if ((c ?? r?.color) && (o.color = c ?? r?.color), r?.fill && (o.backgroundColor = r.fill), r?.indent) {
|
|
240
242
|
let e = `${4 + r.indent * 9}px`;
|
|
241
243
|
o.textAlign === "right" ? o.paddingRight = e : o.paddingLeft = e;
|
|
242
244
|
}
|
|
243
|
-
return
|
|
244
|
-
},
|
|
245
|
+
return pe(t, n) ? (o.borderStyle = "hidden", o.boxShadow = ve(e, t, n)) : (o.borderTop = H(r?.borders?.top), o.borderRight = H(r?.borders?.right), o.borderBottom = H(r?.borders?.bottom), o.borderLeft = H(r?.borders?.left), o.boxShadow = G(e, t, n).join(", ")), Object.assign(o, Ue(t, n)), o;
|
|
246
|
+
}, pe = (e, t) => {
|
|
245
247
|
let n = T.value?.frozen;
|
|
246
248
|
return !!n && (e <= n.rows || t <= n.cols);
|
|
247
|
-
},
|
|
249
|
+
}, U = {
|
|
248
250
|
top: (e) => `inset 0 ${e.width}px 0 ${e.color}`,
|
|
249
251
|
right: (e) => `inset -${e.width}px 0 0 ${e.color}`,
|
|
250
252
|
bottom: (e) => `inset 0 -${e.width}px 0 ${e.color}`,
|
|
251
253
|
left: (e) => `inset ${e.width}px 0 0 ${e.color}`
|
|
252
|
-
},
|
|
253
|
-
let r =
|
|
254
|
-
return [t === I.value[0]?.row && r?.top &&
|
|
255
|
-
}, K = b(() => I.value.map((e) => e.row)), q = b(() => D.value.map((e) => e.col)), me = b(() => new Map(K.value.map((e, t) => [e, t]))), he = b(() => new Map(q.value.map((e, t) => [e, t]))),
|
|
254
|
+
}, W = (...e) => e.reduce((e, t) => t && (!e || t.width > e.width) ? t : e, void 0), G = (e, t, n) => {
|
|
255
|
+
let r = z(e)?.borders;
|
|
256
|
+
return [t === I.value[0]?.row && r?.top && U.top(r.top), n === D.value[0]?.col && r?.left && U.left(r.left)].filter((e) => !!e);
|
|
257
|
+
}, K = b(() => I.value.map((e) => e.row)), q = b(() => D.value.map((e) => e.col)), me = b(() => new Map(K.value.map((e, t) => [e, t]))), he = b(() => new Map(q.value.map((e, t) => [e, t]))), ge = (e, t, n, r) => {
|
|
256
258
|
let i = [], a = t.get(n) ?? e.length;
|
|
257
259
|
for (; a < e.length && e[a] < n + r; a++) i.push(e[a]);
|
|
258
260
|
return {
|
|
259
261
|
spanned: i,
|
|
260
262
|
next: e[a]
|
|
261
263
|
};
|
|
262
|
-
},
|
|
263
|
-
let { spanned: i, next: a } =
|
|
264
|
+
}, _e = (e, t, n, r) => {
|
|
265
|
+
let { spanned: i, next: a } = ge(K.value, me.value, t, e?.span?.rows ?? 1), { spanned: o, next: s } = ge(q.value, he.value, n, e?.span?.cols ?? 1);
|
|
264
266
|
return (r === "right" ? s === void 0 ? [] : i.map((e) => ({
|
|
265
267
|
row: e,
|
|
266
268
|
col: s
|
|
@@ -268,62 +270,62 @@ var ye = { class: "pk-spreadsheet-preview" }, be = { class: "pk-spreadsheet-prev
|
|
|
268
270
|
row: a,
|
|
269
271
|
col: e
|
|
270
272
|
}))).map((e) => {
|
|
271
|
-
let t =
|
|
272
|
-
return
|
|
273
|
+
let t = oe.value.get(`${e.row},${e.col}`) ?? e;
|
|
274
|
+
return L(t.row, t.col);
|
|
273
275
|
});
|
|
274
|
-
},
|
|
275
|
-
let r =
|
|
276
|
+
}, ve = (e, t, n) => {
|
|
277
|
+
let r = z(e)?.borders, i = W(r?.right, ..._e(e, t, n, "right").map((e) => z(e)?.borders?.left)), a = W(r?.bottom, ..._e(e, t, n, "bottom").map((e) => z(e)?.borders?.top)), o = T.value?.gridlines;
|
|
276
278
|
return [
|
|
277
|
-
i ?
|
|
278
|
-
a ?
|
|
279
|
-
...
|
|
279
|
+
i ? U.right(i) : o && "inset calc(var(--border) * -1) 0 0 var(--pk-spreadsheet-gridline)",
|
|
280
|
+
a ? U.bottom(a) : o && "inset 0 calc(var(--border) * -1) 0 var(--pk-spreadsheet-gridline)",
|
|
281
|
+
...G(e, t, n)
|
|
280
282
|
].filter(Boolean).join(", ");
|
|
281
|
-
},
|
|
283
|
+
}, ye = (e) => Be + I.value.filter((t) => t.row < e).reduce((e, t) => e + t.height, 0), J = (e) => Ve + D.value.filter((t) => t.col < e).reduce((e, t) => e + t.width, 0), He = b(() => {
|
|
282
284
|
let e = T.value?.frozen;
|
|
283
285
|
return {
|
|
284
|
-
top:
|
|
285
|
-
left:
|
|
286
|
+
top: ye((e?.rows ?? 0) + 1),
|
|
287
|
+
left: J((e?.cols ?? 0) + 1)
|
|
286
288
|
};
|
|
287
|
-
}),
|
|
289
|
+
}), Ue = (e, t) => {
|
|
288
290
|
let n = T.value?.frozen;
|
|
289
291
|
if (!n) return {};
|
|
290
292
|
let r = {};
|
|
291
|
-
return e <= n.rows && (r.position = "sticky", r.top = `${
|
|
292
|
-
},
|
|
293
|
+
return e <= n.rows && (r.position = "sticky", r.top = `${ye(e)}px`, r.scrollMarginTop = r.top, r.zIndex = 0), t <= n.cols && (r.position = "sticky", r.left = `${J(t)}px`, r.scrollMarginLeft = r.left, r.zIndex = +(e <= n.rows)), r;
|
|
294
|
+
}, X = y({
|
|
293
295
|
row: 1,
|
|
294
296
|
col: 1
|
|
295
|
-
}),
|
|
297
|
+
}), Z = y({
|
|
296
298
|
row: 1,
|
|
297
299
|
col: 1
|
|
298
300
|
});
|
|
299
301
|
u(T, () => {
|
|
300
|
-
|
|
302
|
+
X.value = {
|
|
301
303
|
row: 1,
|
|
302
304
|
col: 1
|
|
303
|
-
},
|
|
305
|
+
}, Z.value = {
|
|
304
306
|
row: 1,
|
|
305
307
|
col: 1
|
|
306
308
|
};
|
|
307
309
|
});
|
|
308
|
-
let
|
|
309
|
-
r1: Math.min(
|
|
310
|
-
r2: Math.max(
|
|
311
|
-
c1: Math.min(
|
|
312
|
-
c2: Math.max(
|
|
313
|
-
})),
|
|
314
|
-
x.value?.focus({ preventScroll: !0 }),
|
|
310
|
+
let Q = b(() => ({
|
|
311
|
+
r1: Math.min(X.value.row, Z.value.row),
|
|
312
|
+
r2: Math.max(X.value.row, Z.value.row),
|
|
313
|
+
c1: Math.min(X.value.col, Z.value.col),
|
|
314
|
+
c2: Math.max(X.value.col, Z.value.col)
|
|
315
|
+
})), We = (e, t) => e >= Q.value.r1 && e <= Q.value.r2 && t >= Q.value.c1 && t <= Q.value.c2, Ge = (e, t) => Z.value.row === e && Z.value.col === t, Ke = (e) => e >= Q.value.r1 && e <= Q.value.r2 ? `${Q.value.c1}:${Q.value.c2}:${Z.value.row === e ? Z.value.col : 0}` : "", qe = y(!1), Je = (e, t, n) => {
|
|
316
|
+
x.value?.focus({ preventScroll: !0 }), Z.value = {
|
|
315
317
|
row: e,
|
|
316
318
|
col: t
|
|
317
|
-
}, n.shiftKey || (
|
|
319
|
+
}, n.shiftKey || (X.value = {
|
|
318
320
|
row: e,
|
|
319
321
|
col: t
|
|
320
|
-
}),
|
|
321
|
-
},
|
|
322
|
-
|
|
322
|
+
}), qe.value = !0;
|
|
323
|
+
}, Ye = (e, t) => {
|
|
324
|
+
qe.value && (Z.value = {
|
|
323
325
|
row: e,
|
|
324
326
|
col: t
|
|
325
327
|
});
|
|
326
|
-
},
|
|
328
|
+
}, $, Xe = () => {
|
|
327
329
|
let e = [...x.value?.querySelectorAll(".pk-spreadsheet-preview__cell--range, [data-focus]") ?? []].map((e) => e.getBoundingClientRect());
|
|
328
330
|
if (e.length) return {
|
|
329
331
|
start: {
|
|
@@ -333,17 +335,17 @@ var ye = { class: "pk-spreadsheet-preview" }, be = { class: "pk-spreadsheet-prev
|
|
|
333
335
|
bottom: Math.max(...e.map((e) => e.bottom))
|
|
334
336
|
};
|
|
335
337
|
}, Ze = () => T.value ? {
|
|
336
|
-
...
|
|
338
|
+
...be(T.value, Q.value),
|
|
337
339
|
measure: Xe
|
|
338
340
|
} : void 0;
|
|
339
|
-
u([
|
|
340
|
-
clearTimeout(
|
|
341
|
-
let e =
|
|
341
|
+
u([Q, qe], () => {
|
|
342
|
+
clearTimeout($), !qe.value && ($ = setTimeout(() => {
|
|
343
|
+
let e = Q.value, t = e.r2 > e.r1 || e.c2 > e.c1;
|
|
342
344
|
a("select", t ? Ze() : void 0);
|
|
343
345
|
}, 150));
|
|
344
346
|
});
|
|
345
347
|
let Qe = () => {
|
|
346
|
-
clearTimeout(
|
|
348
|
+
clearTimeout($), a("select", Ze());
|
|
347
349
|
}, $e = (e) => {
|
|
348
350
|
let t = {
|
|
349
351
|
ArrowUp: [-1, 0],
|
|
@@ -355,7 +357,7 @@ var ye = { class: "pk-spreadsheet-preview" }, be = { class: "pk-spreadsheet-prev
|
|
|
355
357
|
}[e.key];
|
|
356
358
|
if (!t) return;
|
|
357
359
|
e.preventDefault();
|
|
358
|
-
let n = I.value.map((e) => e.row), r = D.value.map((e) => e.col), a = (e) =>
|
|
360
|
+
let n = I.value.map((e) => e.row), r = D.value.map((e) => e.col), a = (e) => oe.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;
|
|
359
361
|
for (;;) {
|
|
360
362
|
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]));
|
|
361
363
|
if (e === s && i === c || (s = e, c = i, l = a({
|
|
@@ -363,34 +365,34 @@ var ye = { class: "pk-spreadsheet-preview" }, be = { class: "pk-spreadsheet-prev
|
|
|
363
365
|
col: r[c]
|
|
364
366
|
}), l.row !== o.row || l.col !== o.col)) break;
|
|
365
367
|
}
|
|
366
|
-
|
|
368
|
+
Z.value = l, e.shiftKey || (X.value = l), i(() => x.value?.querySelector("[data-focus]")?.scrollIntoView({
|
|
367
369
|
block: "nearest",
|
|
368
370
|
inline: "nearest"
|
|
369
371
|
}));
|
|
370
|
-
}, et = b(() =>
|
|
371
|
-
let { r1: e, r2: t, c1: n, c2: r } =
|
|
372
|
+
}, et = b(() => L(Z.value.row, Z.value.col)), tt = b(() => {
|
|
373
|
+
let { r1: e, r2: t, c1: n, c2: r } = Q.value;
|
|
372
374
|
if (e === t && n === r) return;
|
|
373
375
|
let i = 0, a = 0, o = 0, s;
|
|
374
376
|
for (let c = e; c <= t; c++) for (let e = n; e <= r; e++) {
|
|
375
|
-
let t =
|
|
377
|
+
let t = L(c, e);
|
|
376
378
|
t && (t.value !== void 0 || t.missing) && (i++, typeof t.value == "number" && (a += t.value, o++, s ??= t));
|
|
377
379
|
}
|
|
378
380
|
if (i) return {
|
|
379
381
|
count: i,
|
|
380
|
-
sum: s ?
|
|
381
|
-
average: s ?
|
|
382
|
+
sum: s ? ce(s, a) : void 0,
|
|
383
|
+
average: s ? ce(s, a / o) : void 0
|
|
382
384
|
};
|
|
383
385
|
}), nt = (e) => {
|
|
384
386
|
h.value = Math.min(2, Math.max(.5, Math.round((h.value + e) * 10) / 10));
|
|
385
387
|
};
|
|
386
388
|
return (t, n) => {
|
|
387
|
-
let i =
|
|
388
|
-
return A(), k("div",
|
|
389
|
-
v("div",
|
|
389
|
+
let i = le;
|
|
390
|
+
return A(), k("div", xe, [
|
|
391
|
+
v("div", Se, [
|
|
390
392
|
v("span", {
|
|
391
393
|
class: "pk-spreadsheet-preview__ref",
|
|
392
394
|
"aria-label": O(s)("chatFilePreview.cell")
|
|
393
|
-
}, S(te(
|
|
395
|
+
}, S(te(Z.value.col)) + S(Z.value.row), 9, Ce),
|
|
394
396
|
n[6] ||= v("span", {
|
|
395
397
|
class: "pk-spreadsheet-preview__fx",
|
|
396
398
|
"aria-hidden": "true"
|
|
@@ -398,7 +400,7 @@ var ye = { class: "pk-spreadsheet-preview" }, be = { class: "pk-spreadsheet-prev
|
|
|
398
400
|
v("output", {
|
|
399
401
|
class: "pk-spreadsheet-preview__formula",
|
|
400
402
|
"aria-label": O(s)("chatFilePreview.formulaBar")
|
|
401
|
-
}, S(
|
|
403
|
+
}, S(V(et.value)), 9, we)
|
|
402
404
|
]),
|
|
403
405
|
v("div", {
|
|
404
406
|
ref_key: "scrollEl",
|
|
@@ -408,28 +410,28 @@ var ye = { class: "pk-spreadsheet-preview" }, be = { class: "pk-spreadsheet-prev
|
|
|
408
410
|
role: "grid",
|
|
409
411
|
"aria-label": T.value?.name,
|
|
410
412
|
onKeydown: $e,
|
|
411
|
-
onMouseup: n[2] ||= (e) =>
|
|
412
|
-
onMouseleave: n[3] ||= (e) =>
|
|
413
|
+
onMouseup: n[2] ||= (e) => qe.value = !1,
|
|
414
|
+
onMouseleave: n[3] ||= (e) => qe.value = !1
|
|
413
415
|
}, [T.value ? (A(), k("table", {
|
|
414
416
|
key: 0,
|
|
415
417
|
class: r(["pk-spreadsheet-preview__grid", { "pk-spreadsheet-preview__grid--lines": T.value.gridlines }]),
|
|
416
418
|
style: l({
|
|
417
419
|
zoom: h.value,
|
|
418
420
|
width: `${P.value}px`,
|
|
419
|
-
"--pk-spreadsheet-stuck-top": `${
|
|
420
|
-
"--pk-spreadsheet-stuck-left": `${
|
|
421
|
+
"--pk-spreadsheet-stuck-top": `${He.value.top}px`,
|
|
422
|
+
"--pk-spreadsheet-stuck-left": `${He.value.left}px`
|
|
421
423
|
})
|
|
422
424
|
}, [
|
|
423
|
-
v("colgroup", null, [v("col", { style: l({ width: `${
|
|
425
|
+
v("colgroup", null, [v("col", { style: l({ width: `${Ve}px` }) }, null, 4), (A(!0), k(_, null, p(D.value, (e) => (A(), k("col", {
|
|
424
426
|
key: e.col,
|
|
425
427
|
style: l({ width: `${e.width}px` })
|
|
426
428
|
}, null, 4))), 128))]),
|
|
427
|
-
v("thead", null, [v("tr", { style: l({ height: `${
|
|
429
|
+
v("thead", null, [v("tr", { style: l({ height: `${Be}px` }) }, [n[7] ||= v("th", { class: "pk-spreadsheet-preview__corner" }, null, -1), (A(!0), k(_, null, p(D.value, (e) => (A(), k("th", {
|
|
428
430
|
key: e.col,
|
|
429
431
|
scope: "col",
|
|
430
|
-
class: r(["pk-spreadsheet-preview__head", { "pk-spreadsheet-preview__head--current": e.col >=
|
|
432
|
+
class: r(["pk-spreadsheet-preview__head", { "pk-spreadsheet-preview__head--current": e.col >= Q.value.c1 && e.col <= Q.value.c2 }]),
|
|
431
433
|
style: l(T.value.frozen && e.col <= T.value.frozen.cols ? {
|
|
432
|
-
left: `${
|
|
434
|
+
left: `${J(e.col)}px`,
|
|
433
435
|
zIndex: 2
|
|
434
436
|
} : void 0)
|
|
435
437
|
}, S(te(e.col)), 7))), 128))], 4)]),
|
|
@@ -439,7 +441,7 @@ var ye = { class: "pk-spreadsheet-preview" }, be = { class: "pk-spreadsheet-prev
|
|
|
439
441
|
T.value,
|
|
440
442
|
F.value,
|
|
441
443
|
O(c),
|
|
442
|
-
|
|
444
|
+
Ke(e.row)
|
|
443
445
|
];
|
|
444
446
|
if (i && i.el && i.key === e.row && ee(i, a)) return i;
|
|
445
447
|
let o = (A(), k("tr", {
|
|
@@ -447,30 +449,30 @@ var ye = { class: "pk-spreadsheet-preview" }, be = { class: "pk-spreadsheet-prev
|
|
|
447
449
|
style: l({ height: `${e.height}px` })
|
|
448
450
|
}, [v("th", {
|
|
449
451
|
scope: "row",
|
|
450
|
-
class: r(["pk-spreadsheet-preview__row", { "pk-spreadsheet-preview__row--current": e.row >=
|
|
452
|
+
class: r(["pk-spreadsheet-preview__row", { "pk-spreadsheet-preview__row--current": e.row >= Q.value.r1 && e.row <= Q.value.r2 }]),
|
|
451
453
|
style: l(T.value.frozen && e.row <= T.value.frozen.rows ? {
|
|
452
|
-
...
|
|
454
|
+
...Ue(e.row, 0),
|
|
453
455
|
left: 0,
|
|
454
456
|
zIndex: 4
|
|
455
457
|
} : void 0)
|
|
456
|
-
}, S(e.row), 7), (A(!0), k(_, null, p(D.value, (t) => (A(), k(_, { key: t.col }, [
|
|
458
|
+
}, S(e.row), 7), (A(!0), k(_, null, p(D.value, (t) => (A(), k(_, { key: t.col }, [oe.value.has(`${e.row},${t.col}`) ? E("", !0) : (A(), k("td", {
|
|
457
459
|
key: 0,
|
|
458
|
-
rowspan:
|
|
459
|
-
colspan:
|
|
460
|
+
rowspan: R(e.row, t.col)?.rows,
|
|
461
|
+
colspan: R(e.row, t.col)?.cols,
|
|
460
462
|
class: r(["pk-spreadsheet-preview__cell", {
|
|
461
|
-
"pk-spreadsheet-preview__cell--range":
|
|
462
|
-
"pk-spreadsheet-preview__cell--missing":
|
|
463
|
+
"pk-spreadsheet-preview__cell--range": We(e.row, t.col) && !Ge(e.row, t.col),
|
|
464
|
+
"pk-spreadsheet-preview__cell--missing": L(e.row, t.col)?.missing
|
|
463
465
|
}]),
|
|
464
|
-
style: l(
|
|
465
|
-
"data-focus":
|
|
466
|
-
title:
|
|
467
|
-
onMousedown: g((n) =>
|
|
468
|
-
onMouseenter: (n) =>
|
|
466
|
+
style: l(fe(L(e.row, t.col), e.row, t.col)),
|
|
467
|
+
"data-focus": Ge(e.row, t.col) ? "" : void 0,
|
|
468
|
+
title: L(e.row, t.col)?.missing ? O(s)("chatFilePreview.missingValue") : void 0,
|
|
469
|
+
onMousedown: g((n) => Je(e.row, t.col, n), ["prevent"]),
|
|
470
|
+
onMouseenter: (n) => Ye(e.row, t.col),
|
|
469
471
|
onDblclick: Qe
|
|
470
|
-
}, S(
|
|
472
|
+
}, S(de(L(e.row, t.col))), 47, Ee))], 64))), 128))], 4));
|
|
471
473
|
return o.memo = a, o;
|
|
472
474
|
}, n, 0), 128))])
|
|
473
|
-
], 6)) : E("", !0), T.value && (T.value.moreRows || T.value.moreColumns) ? (A(), k("p",
|
|
475
|
+
], 6)) : E("", !0), T.value && (T.value.moreRows || T.value.moreColumns) ? (A(), k("p", De, [T.value.moreRows ? (A(), k(_, { key: 0 }, [ne(S(O(s)("chatFilePreview.moreRows", T.value.moreRows)), 1)], 64)) : E("", !0), T.value.moreColumns ? (A(), k(_, { key: 1 }, [ne(S(O(s)("chatFilePreview.moreColumns", T.value.moreColumns)), 1)], 64)) : E("", !0)])) : E("", !0)], 40, Te),
|
|
474
476
|
v("nav", {
|
|
475
477
|
class: "pk-spreadsheet-preview__sheets",
|
|
476
478
|
"aria-label": O(s)("chatFilePreview.sheets")
|
|
@@ -480,20 +482,20 @@ var ye = { class: "pk-spreadsheet-preview" }, be = { class: "pk-spreadsheet-prev
|
|
|
480
482
|
class: "pk-spreadsheet-preview__sheet",
|
|
481
483
|
"aria-current": t === f.value ? "page" : void 0,
|
|
482
484
|
onClick: (e) => f.value = t
|
|
483
|
-
}, S(e.name), 9,
|
|
484
|
-
v("div",
|
|
485
|
+
}, S(e.name), 9, Y))), 128))], 8, Oe),
|
|
486
|
+
v("div", ke, [v("p", Ae, [e.preview.staleFormulas ? (A(), k("span", {
|
|
485
487
|
key: 0,
|
|
486
488
|
class: "pk-spreadsheet-preview__note",
|
|
487
489
|
title: O(s)("chatFilePreview.staleFormulas")
|
|
488
|
-
}, S(O(s)("chatFilePreview.staleFormulas")), 9,
|
|
490
|
+
}, S(O(s)("chatFilePreview.staleFormulas")), 9, je)) : e.preview.computedFormulas ? (A(), k("span", {
|
|
489
491
|
key: 1,
|
|
490
492
|
class: "pk-spreadsheet-preview__note",
|
|
491
493
|
title: O(s)("chatFilePreview.computedFormulas")
|
|
492
|
-
}, S(O(s)("chatFilePreview.computedFormulas")), 9,
|
|
493
|
-
tt.value.average ? (A(), k("span",
|
|
494
|
+
}, S(O(s)("chatFilePreview.computedFormulas")), 9, Me)) : E("", !0), tt.value ? (A(), k("span", Ne, [
|
|
495
|
+
tt.value.average ? (A(), k("span", Pe, S(O(s)("chatFilePreview.average")) + " " + S(tt.value.average), 1)) : E("", !0),
|
|
494
496
|
v("span", null, S(O(s)("chatFilePreview.count")) + " " + S(tt.value.count), 1),
|
|
495
|
-
tt.value.sum ? (A(), k("span",
|
|
496
|
-
])) : E("", !0)]), v("div",
|
|
497
|
+
tt.value.sum ? (A(), k("span", Fe, S(O(s)("chatFilePreview.sum")) + " " + S(tt.value.sum), 1)) : E("", !0)
|
|
498
|
+
])) : E("", !0)]), v("div", Ie, [
|
|
497
499
|
d(i, {
|
|
498
500
|
modifiers: "action-quiet",
|
|
499
501
|
icon: "ri:subtract-line",
|
|
@@ -501,7 +503,7 @@ var ye = { class: "pk-spreadsheet-preview" }, be = { class: "pk-spreadsheet-prev
|
|
|
501
503
|
disabled: h.value <= .5,
|
|
502
504
|
onClick: n[4] ||= (e) => nt(-.1)
|
|
503
505
|
}, null, 8, ["aria-label", "disabled"]),
|
|
504
|
-
v("span",
|
|
506
|
+
v("span", Le, S(Math.round(h.value * 100)) + "% ", 1),
|
|
505
507
|
d(i, {
|
|
506
508
|
modifiers: "action-quiet",
|
|
507
509
|
icon: "ri:add-line",
|
|
@@ -516,11 +518,11 @@ var ye = { class: "pk-spreadsheet-preview" }, be = { class: "pk-spreadsheet-prev
|
|
|
516
518
|
}), [["styles", [".pk-spreadsheet-preview{--pk-spreadsheet-green:#217346;--pk-spreadsheet-green-head:#217346;--pk-spreadsheet-gridline:#e1e1e1;flex-direction:column;flex:1;min-height:0;display:flex}.pk-spreadsheet-preview__bar{min-height:var(--spacing-40);border-bottom:var(--border) solid var(--color-surface-3);background-color:var(--color-surface);font-size:var(--text-14);align-items:stretch;display:flex}.pk-spreadsheet-preview__ref{width:var(--spacing-96);padding:0 var(--spacing-12);box-sizing:border-box;border-right:var(--border) solid var(--color-surface-3);font-variant-numeric:tabular-nums;flex-shrink:0;align-items:center;display:flex}.pk-spreadsheet-preview__fx{width:var(--spacing-40);border-right:var(--border) solid var(--color-surface-3);color:var(--color-word-3);flex-shrink:0;justify-content:center;align-items:center;font-family:Georgia,serif;font-style:italic;display:flex}.pk-spreadsheet-preview__formula{min-width:0;padding:0 var(--spacing-12);text-overflow:ellipsis;white-space:nowrap;flex:1;align-items:center;display:flex;overflow:hidden}.pk-spreadsheet-preview__scroll{cursor:cell;background-color:#fff;outline:none;flex:1;min-height:0;overflow:auto}.pk-spreadsheet-preview__scroll:focus-visible{box-shadow:inset 0 0 0 var(--spacing-2) var(--input-focus-color)}.pk-spreadsheet-preview__grid{border-collapse:collapse;table-layout:fixed;color:#000;-webkit-user-select:none;user-select:none;font-family:Calibri,Carlito,Segoe UI,Arial,sans-serif;font-size:11pt}.pk-spreadsheet-preview__grid td{max-width:0;padding:0 var(--spacing-4);text-overflow:clip;background-color:#fff;line-height:1.2;overflow:hidden}.pk-spreadsheet-preview__grid--lines td{border:var(--border) solid var(--pk-spreadsheet-gridline)}.pk-spreadsheet-preview__corner,.pk-spreadsheet-preview__head,.pk-spreadsheet-preview__row{z-index:1;box-shadow:var(--pk-spreadsheet-lines);background-color:var(--color-surface-1);color:var(--color-word-3);font-family:var(--font-family-sans);font-size:var(--text-12);font-weight:var(--font-normal);text-align:center;border-style:hidden;position:sticky}.pk-spreadsheet-preview__corner,.pk-spreadsheet-preview__head{padding:var(--spacing-4) var(--spacing-4) var(--spacing-2);vertical-align:middle;line-height:1;top:0}.pk-spreadsheet-preview__row{vertical-align:middle}.pk-spreadsheet-preview__corner{--pk-spreadsheet-lines:inset 0 0 0 var(--border) var(--color-surface-3);z-index:5;left:0}.pk-spreadsheet-preview__head{--pk-spreadsheet-lines:inset 0 var(--border) 0 var(--color-surface-3), inset calc(var(--border) * -1) calc(var(--border) * -1) 0 var(--color-surface-3)}.pk-spreadsheet-preview__row{--pk-spreadsheet-lines:inset var(--border) 0 0 var(--color-surface-3), inset calc(var(--border) * -1) calc(var(--border) * -1) 0 var(--color-surface-3);padding:0 var(--spacing-4);font-variant-numeric:tabular-nums;left:0}.pk-spreadsheet-preview__head--current{background-color:var(--color-surface-2);box-shadow:var(--pk-spreadsheet-lines), inset 0 calc((var(--spacing-2) + var(--border)) * -1) 0 var(--pk-spreadsheet-green-head);color:var(--pk-spreadsheet-green-head);font-weight:var(--font-medium)}.pk-spreadsheet-preview__row--current{background-color:var(--color-surface-2);box-shadow:var(--pk-spreadsheet-lines), inset calc((var(--spacing-2) + var(--border)) * -1) 0 0 var(--pk-spreadsheet-green-head);color:var(--pk-spreadsheet-green-head);font-weight:var(--font-medium)}.pk-spreadsheet-preview__cell[data-focus]{scroll-margin-top:var(--pk-spreadsheet-stuck-top);scroll-margin-left:var(--pk-spreadsheet-stuck-left);outline:var(--spacing-2) solid var(--pk-spreadsheet-green);outline-offset:calc(var(--spacing-2) * -1)}.pk-spreadsheet-preview__cell--range{background-image:linear-gradient(#1f1d2b14,#1f1d2b14)}.pk-spreadsheet-preview__cell--missing{color:#6b6880}.pk-spreadsheet-preview__more{padding:var(--spacing-8) var(--spacing-12);color:#6b6880;font-size:var(--text-12);margin:0;position:sticky;left:0}.pk-spreadsheet-preview__sheets{min-height:var(--spacing-32);padding-left:var(--spacing-40);border-top:var(--border) solid var(--color-surface-3);background-color:var(--color-surface-1);flex-shrink:0;display:flex;overflow-x:auto}@media (pointer:coarse){.pk-spreadsheet-preview__sheets{min-height:var(--spacing-40)}}.pk-spreadsheet-preview__status{min-height:var(--spacing-40);border-top:var(--border) solid var(--color-surface-3);background-color:var(--color-surface-1);font-size:var(--text-12);flex-shrink:0;align-items:center;display:flex}.pk-spreadsheet-preview__sheet{padding:0 var(--spacing-16);border:0;border-right:var(--border) solid var(--color-surface-3);color:var(--color-word-2);font:inherit;font-size:var(--text-12);white-space:nowrap;cursor:pointer;background:0 0;flex-shrink:0}.pk-spreadsheet-preview__sheet:first-child{border-left:var(--border) solid var(--color-surface-3)}.pk-spreadsheet-preview__sheet:hover{background-color:var(--color-surface-2)}.pk-spreadsheet-preview__sheet[aria-current=page]{background-color:var(--color-surface);box-shadow:inset 0 calc(var(--spacing-2) * -1) 0 var(--pk-spreadsheet-green-head);color:var(--pk-spreadsheet-green-head);font-weight:var(--font-semibold)}.pk-spreadsheet-preview__info{align-items:center;gap:var(--spacing-16);min-width:0;padding:0 var(--spacing-12);color:var(--color-word-2);font-variant-numeric:tabular-nums;white-space:nowrap;flex:1;margin:0;display:flex;overflow:hidden}.pk-spreadsheet-preview__note{min-width:0;color:var(--color-word-3);text-overflow:ellipsis;overflow:hidden}.pk-spreadsheet-preview__stats{gap:var(--spacing-12);flex-shrink:0;margin-left:auto;display:flex}@container (width<26rem){.pk-spreadsheet-preview__average{display:none}}.pk-spreadsheet-preview__zoom{align-items:center;gap:var(--spacing-2);padding-right:var(--spacing-8);flex-shrink:0;display:flex}.pk-spreadsheet-preview__percent{min-width:var(--spacing-40);font-variant-numeric:tabular-nums;text-align:center}@media (prefers-color-scheme:dark){:where(:host,:root,.theme):not(.theme--light) .pk-spreadsheet-preview{--pk-spreadsheet-green-head:#5fbf8f}}:where(.theme.theme--dark) .pk-spreadsheet-preview{--pk-spreadsheet-green-head:#5fbf8f}"]]]);
|
|
517
519
|
// ../../packages/components/src/chat/PkWordPreviewRuns.vue?vue&type=script&setup=true&lang.ts
|
|
518
520
|
x(), f(), C();
|
|
519
|
-
var
|
|
521
|
+
var Ue = ["src"], X = {
|
|
520
522
|
key: 1,
|
|
521
523
|
class: "pk-word-preview__image",
|
|
522
524
|
"data-quote-skip": ""
|
|
523
|
-
}, Z = ["title"], Q = ["title"],
|
|
525
|
+
}, Z = ["title"], Q = ["title"], We = ["data-quote-skip"], Ge = /* @__PURE__ */ D({
|
|
524
526
|
__name: "PkWordPreviewRuns",
|
|
525
527
|
props: {
|
|
526
528
|
runs: { type: Array },
|
|
@@ -529,7 +531,7 @@ var Ve = ["src"], He = {
|
|
|
529
531
|
numbers: { type: Object }
|
|
530
532
|
},
|
|
531
533
|
setup(e) {
|
|
532
|
-
let n = e, { t: i } = re({ useScope: "global" }), a = t(
|
|
534
|
+
let n = e, { t: i } = re({ useScope: "global" }), a = t(R, void 0), o = (e) => e.picture ? I(a?.value, e.picture.ref) : void 0, s = (e) => n.page ? F(e) : "inline", c = (e) => {
|
|
533
535
|
let t = {
|
|
534
536
|
width: `${e.width}pt`,
|
|
535
537
|
aspectRatio: `${e.width} / ${e.height}`
|
|
@@ -557,7 +559,7 @@ var Ve = ["src"], He = {
|
|
|
557
559
|
zIndex: r.wrap === "behind" ? -1 : 1
|
|
558
560
|
};
|
|
559
561
|
}, u = (e) => e.field && n.numbers ? String(n.numbers[e.field]) : e.text, d = b(() => {
|
|
560
|
-
let e =
|
|
562
|
+
let e = oe(n.runs, n.mode ?? "markup"), t = (e) => !!e.picture && !!n.page && ["around", "block"].includes(F(e.picture));
|
|
561
563
|
return [...e.filter(t), ...e.filter((e) => !t(e))];
|
|
562
564
|
}), f = b(() => !n.mode || n.mode === "markup"), m = (e) => {
|
|
563
565
|
let t = {};
|
|
@@ -577,7 +579,7 @@ var Ve = ["src"], He = {
|
|
|
577
579
|
style: l(c(e.picture)),
|
|
578
580
|
src: o(e),
|
|
579
581
|
alt: ""
|
|
580
|
-
}, null, 14,
|
|
582
|
+
}, null, 14, Ue))], 64)) : (A(), k("span", X, S(O(i)("chatFilePreview.image")), 1))], 64)) : f.value && e.change === "deleted" ? (A(), k("del", {
|
|
581
583
|
key: 1,
|
|
582
584
|
class: "pk-word-preview__removed",
|
|
583
585
|
"data-quote-skip": "",
|
|
@@ -592,16 +594,16 @@ var Ve = ["src"], He = {
|
|
|
592
594
|
key: 3,
|
|
593
595
|
style: l(m(e)),
|
|
594
596
|
"data-quote-skip": e.label ? "" : void 0
|
|
595
|
-
}, S(u(e)), 13,
|
|
597
|
+
}, S(u(e)), 13, We))], 64))), 128));
|
|
596
598
|
}
|
|
597
599
|
});
|
|
598
600
|
// ../../packages/components/src/chat/PkWordPreviewBlock.vue?vue&type=script&setup=true&lang.ts
|
|
599
601
|
x(), f();
|
|
600
|
-
var
|
|
602
|
+
var Ke = { key: 0 }, qe = ["data-paragraph", "colspan"], Je = [
|
|
601
603
|
"data-paragraph",
|
|
602
604
|
"role",
|
|
603
605
|
"aria-level"
|
|
604
|
-
],
|
|
606
|
+
], Ye = { key: 1 }, $ = /* @__PURE__ */ D({
|
|
605
607
|
__name: "PkWordPreviewBlock",
|
|
606
608
|
props: {
|
|
607
609
|
block: { type: null },
|
|
@@ -641,7 +643,7 @@ var We = { key: 0 }, Ge = ["data-paragraph", "colspan"], Ke = [
|
|
|
641
643
|
"pk-word-preview__table--next": e.row !== 0,
|
|
642
644
|
"pk-word-preview__changed": c.value
|
|
643
645
|
}])
|
|
644
|
-
}, [s.value.length ? (A(), k("colgroup",
|
|
646
|
+
}, [s.value.length ? (A(), k("colgroup", Ke, [(A(!0), k(_, null, p(s.value, (e, t) => (A(), k("col", {
|
|
645
647
|
key: t,
|
|
646
648
|
style: l({ width: e })
|
|
647
649
|
}, null, 4))), 128))])) : E("", !0), v("tbody", null, [v("tr", null, [(A(!0), k(_, null, p(o.value, (t, n) => (A(), k("td", {
|
|
@@ -653,7 +655,7 @@ var We = { key: 0 }, Ge = ["data-paragraph", "colspan"], Ke = [
|
|
|
653
655
|
textAlign: t.align,
|
|
654
656
|
fontSize: t.size ? `${t.size}pt` : void 0
|
|
655
657
|
})
|
|
656
|
-
}, [d(
|
|
658
|
+
}, [d(Ge, {
|
|
657
659
|
runs: t.runs,
|
|
658
660
|
mode: e.mode,
|
|
659
661
|
numbers: e.numbers
|
|
@@ -661,7 +663,7 @@ var We = { key: 0 }, Ge = ["data-paragraph", "colspan"], Ke = [
|
|
|
661
663
|
"runs",
|
|
662
664
|
"mode",
|
|
663
665
|
"numbers"
|
|
664
|
-
])], 12,
|
|
666
|
+
])], 12, qe))), 128))])])], 2)) : e.block.kind === "table" ? E("", !0) : (A(), k("div", {
|
|
665
667
|
key: 1,
|
|
666
668
|
class: r(["pk-word-preview__block", { "pk-word-preview__changed": a.value }]),
|
|
667
669
|
"data-paragraph": e.block.id,
|
|
@@ -675,7 +677,7 @@ var We = { key: 0 }, Ge = ["data-paragraph", "colspan"], Ke = [
|
|
|
675
677
|
"data-quote-skip": "",
|
|
676
678
|
style: l(i.value)
|
|
677
679
|
}, S(e.block.label), 5)) : E("", !0),
|
|
678
|
-
d(
|
|
680
|
+
d(Ge, {
|
|
679
681
|
runs: e.block.runs,
|
|
680
682
|
mode: e.mode,
|
|
681
683
|
page: e.page,
|
|
@@ -686,13 +688,13 @@ var We = { key: 0 }, Ge = ["data-paragraph", "colspan"], Ke = [
|
|
|
686
688
|
"page",
|
|
687
689
|
"numbers"
|
|
688
690
|
]),
|
|
689
|
-
!e.block.label && !e.block.runs.length ? (A(), k("br",
|
|
690
|
-
], 14,
|
|
691
|
+
!e.block.label && !e.block.runs.length ? (A(), k("br", Ye)) : E("", !0)
|
|
692
|
+
], 14, Je));
|
|
691
693
|
}
|
|
692
694
|
});
|
|
693
695
|
// ../../packages/components/src/chat/PkWordPreviewPart.vue?vue&type=script&setup=true&lang.ts
|
|
694
696
|
x(), f();
|
|
695
|
-
var
|
|
697
|
+
var Xe = { class: "pk-word-preview__part" }, Ze = ["src"], Qe = /* @__PURE__ */ D({
|
|
696
698
|
__name: "PkWordPreviewPart",
|
|
697
699
|
props: {
|
|
698
700
|
blocks: { type: Array },
|
|
@@ -702,7 +704,7 @@ var Ye = { class: "pk-word-preview__part" }, Xe = ["src"], Ze = /* @__PURE__ */
|
|
|
702
704
|
numbers: { type: Object }
|
|
703
705
|
},
|
|
704
706
|
setup(e) {
|
|
705
|
-
let n = e, r = t(
|
|
707
|
+
let n = e, r = t(R, void 0), i = b(() => z(n.blocks, n.mode)), a = b(() => L(n.blocks, n.mode).flatMap((e) => {
|
|
706
708
|
let t = I(r?.value, e.ref);
|
|
707
709
|
return t ? [{
|
|
708
710
|
src: t,
|
|
@@ -716,10 +718,10 @@ var Ye = { class: "pk-word-preview__part" }, Xe = ["src"], Ze = /* @__PURE__ */
|
|
|
716
718
|
...n.where === "header" ? { top: `${n.section.headerDistance}pt` } : { bottom: `${n.section.footerDistance}pt` }
|
|
717
719
|
};
|
|
718
720
|
});
|
|
719
|
-
return (t, n) => (A(), k("div",
|
|
721
|
+
return (t, n) => (A(), k("div", Xe, [v("div", {
|
|
720
722
|
class: "pk-word-preview__part-flow",
|
|
721
723
|
style: l(o.value)
|
|
722
|
-
}, [(A(!0), k(_, null, p(i.value, (t) => (A(), h(
|
|
724
|
+
}, [(A(!0), k(_, null, p(i.value, (t) => (A(), h($, {
|
|
723
725
|
key: t.key,
|
|
724
726
|
block: e.blocks[t.block],
|
|
725
727
|
row: t.row,
|
|
@@ -738,42 +740,42 @@ var Ye = { class: "pk-word-preview__part" }, Xe = ["src"], Ze = /* @__PURE__ */
|
|
|
738
740
|
style: l(e.css),
|
|
739
741
|
src: e.src,
|
|
740
742
|
alt: ""
|
|
741
|
-
}, null, 12,
|
|
743
|
+
}, null, 12, Ze))), 128))]));
|
|
742
744
|
}
|
|
743
745
|
});
|
|
744
746
|
// ../../packages/components/src/chat/PkWordPreview.vue?vue&type=script&setup=true&lang.ts
|
|
745
747
|
x(), C(), f();
|
|
746
|
-
var
|
|
748
|
+
var $e = ["aria-label"], et = {
|
|
747
749
|
class: "pk-word-preview__tabs",
|
|
748
750
|
role: "tablist"
|
|
749
|
-
},
|
|
751
|
+
}, tt = ["aria-selected"], nt = ["aria-selected"], rt = {
|
|
750
752
|
key: 0,
|
|
751
753
|
class: "pk-word-preview__list"
|
|
752
|
-
},
|
|
754
|
+
}, it = ["aria-current", "onClick"], at = { class: "pk-word-preview__entry-text" }, ot = {
|
|
753
755
|
key: 0,
|
|
754
756
|
class: "u-dot"
|
|
755
|
-
},
|
|
757
|
+
}, st = {
|
|
756
758
|
key: 0,
|
|
757
759
|
class: "pk-word-preview__none"
|
|
758
|
-
},
|
|
760
|
+
}, ct = {
|
|
759
761
|
key: 1,
|
|
760
762
|
class: "pk-word-preview__list"
|
|
761
|
-
},
|
|
763
|
+
}, lt = ["onClick"], ut = {
|
|
762
764
|
key: 0,
|
|
763
765
|
class: "pk-word-preview__removed"
|
|
764
|
-
},
|
|
766
|
+
}, dt = {
|
|
765
767
|
key: 1,
|
|
766
768
|
class: "pk-word-preview__added"
|
|
767
|
-
},
|
|
769
|
+
}, ft = { class: "pk-word-preview__main" }, pt = ["aria-label"], mt = ["src"], ht = {
|
|
768
770
|
key: 2,
|
|
769
771
|
class: "pk-word-preview__truncated"
|
|
770
|
-
},
|
|
772
|
+
}, gt = { class: "pk-word-preview__status" }, _t = {
|
|
771
773
|
key: 0,
|
|
772
774
|
class: "pk-word-preview__count"
|
|
773
|
-
},
|
|
775
|
+
}, vt = { class: "pk-word-preview__count" }, yt = {
|
|
774
776
|
key: 1,
|
|
775
777
|
class: "pk-word-preview__legend"
|
|
776
|
-
},
|
|
778
|
+
}, bt = ["title"], xt = { class: "pk-word-preview__removed" }, St = { class: "pk-word-preview__added" }, Ct = { class: "pk-word-preview__percent" }, wt = ["data-part"], Tt = 96 / 72, Et = .5, Dt = /*#__PURE__*/ V(/* @__PURE__ */ D({
|
|
777
779
|
__name: "PkWordPreview",
|
|
778
780
|
props: /*@__PURE__*/ c({
|
|
779
781
|
preview: { type: null },
|
|
@@ -790,23 +792,23 @@ var Qe = ["aria-label"], $e = {
|
|
|
790
792
|
emits: /*@__PURE__*/ c(["select"], ["update:fit", "update:zoom"]),
|
|
791
793
|
setup(e, { emit: t }) {
|
|
792
794
|
let c = e, f = t, { t: g } = re({ useScope: "global" });
|
|
793
|
-
n(
|
|
794
|
-
let ee = (e) =>
|
|
795
|
+
n(R, b(() => c.preview.images));
|
|
796
|
+
let ee = (e) => oe(e, c.mode), x = b(() => z(c.preview.blocks, c.mode)), C = m("rootEl"), w = m("scrollEl"), T = m("measureEl"), { width: te } = se(C), { width: D } = se(w), ne = b(() => te.value >= 1e3), j = b(() => c.preview.sections?.length ? c.preview.sections : [{
|
|
795
797
|
page: c.preview.page,
|
|
796
798
|
headerDistance: 0,
|
|
797
799
|
footerDistance: 0,
|
|
798
800
|
headers: {},
|
|
799
801
|
footers: {}
|
|
800
|
-
}]), M = b(() => j.value[0].page), N = b(() => (D.value - 48) / (M.value.width *
|
|
802
|
+
}]), M = b(() => j.value[0].page), N = b(() => (D.value - 48) / (M.value.width * Tt)), F = b(() => te.value === 0 || D.value === 0 || N.value >= Et), B = b(() => ({
|
|
801
803
|
fontFamily: P(c.preview.defaults.font),
|
|
802
804
|
fontSize: `${c.preview.defaults.size}pt`,
|
|
803
805
|
color: c.preview.defaults.color ?? "#000000",
|
|
804
806
|
"--pk-word-line": ie(c.preview.defaults.font),
|
|
805
807
|
"--pk-word-size": `${c.preview.defaults.size}pt`
|
|
806
|
-
})),
|
|
807
|
-
...
|
|
808
|
-
width: `${
|
|
809
|
-
})),
|
|
808
|
+
})), ce = b(() => M.value.width - M.value.margins.left - M.value.margins.right), de = b(() => ({
|
|
809
|
+
...B.value,
|
|
810
|
+
width: `${ce.value}pt`
|
|
811
|
+
})), V = m("flowEl"), { width: H } = se(V), fe = b(() => {
|
|
810
812
|
let e = /* @__PURE__ */ new Map(), t = 0;
|
|
811
813
|
for (let n of c.preview.blocks) {
|
|
812
814
|
if (n.kind === "table") continue;
|
|
@@ -819,26 +821,26 @@ var Qe = ["aria-label"], $e = {
|
|
|
819
821
|
let n = 0;
|
|
820
822
|
for (let [r, i] of [...e].sort((e, t) => e[0] - t[0])) if (n += i, n > t / 10) return r;
|
|
821
823
|
return 0;
|
|
822
|
-
}),
|
|
823
|
-
...
|
|
824
|
-
"--pk-word-indent-shared": `${
|
|
825
|
-
"--pk-word-indent-scale":
|
|
826
|
-
})),
|
|
824
|
+
}), pe = b(() => ({
|
|
825
|
+
...B.value,
|
|
826
|
+
"--pk-word-indent-shared": `${fe.value}pt`,
|
|
827
|
+
"--pk-word-indent-scale": H.value ? Math.min(1, H.value / (ce.value * Tt)) : 1
|
|
828
|
+
})), U = y([]), W = y({}), G = async () => {
|
|
827
829
|
await i();
|
|
828
830
|
let e = T.value?.querySelectorAll("[data-item]");
|
|
829
|
-
|
|
831
|
+
U.value = [...e ?? []].map((e) => e.getBoundingClientRect().height);
|
|
830
832
|
let t = T.value?.querySelectorAll("[data-part]");
|
|
831
|
-
|
|
833
|
+
W.value = Object.fromEntries([...t ?? []].map((e) => [e.dataset.part ?? "", e.getBoundingClientRect().height]));
|
|
832
834
|
};
|
|
833
835
|
u([
|
|
834
836
|
x,
|
|
835
837
|
F,
|
|
836
838
|
() => c.preview.parts
|
|
837
|
-
],
|
|
838
|
-
|
|
839
|
+
], G, { flush: "post" }), s(() => {
|
|
840
|
+
G(), document.fonts?.ready.then(G);
|
|
839
841
|
});
|
|
840
842
|
let K = b(() => {
|
|
841
|
-
if (!F.value ||
|
|
843
|
+
if (!F.value || U.value.length !== x.value.length) return [{
|
|
842
844
|
items: x.value.map((e, t) => t),
|
|
843
845
|
section: 0,
|
|
844
846
|
number: 1,
|
|
@@ -849,7 +851,7 @@ var Qe = ["aria-label"], $e = {
|
|
|
849
851
|
let r = j.value[t];
|
|
850
852
|
return n && r.pageStart !== void 0 ? r.pageStart : (i ?? e[e.length - 1]?.number ?? 0) + 1;
|
|
851
853
|
}, o = (e) => {
|
|
852
|
-
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 ? (
|
|
854
|
+
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 ? (W.value[e] ?? 0) / Tt : 0;
|
|
853
855
|
return {
|
|
854
856
|
header: a,
|
|
855
857
|
footer: o,
|
|
@@ -867,12 +869,12 @@ var Qe = ["aria-label"], $e = {
|
|
|
867
869
|
};
|
|
868
870
|
return x.value.forEach((c, l) => {
|
|
869
871
|
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));
|
|
870
|
-
let u = e[e.length - 1], d = u && j.value[u.section].page, f = d ? (d.height - u.top - u.bottom) *
|
|
871
|
-
for (let e = l; x.value[e]?.keepNext && e + 1 < x.value.length && !x.value[e + 1].breakBefore; e++) p +=
|
|
872
|
-
(!u || u.items.length && (c.breakBefore || r +
|
|
872
|
+
let u = e[e.length - 1], d = u && j.value[u.section].page, f = d ? (d.height - u.top - u.bottom) * Tt : 0, p = U.value[l];
|
|
873
|
+
for (let e = l; x.value[e]?.keepNext && e + 1 < x.value.length && !x.value[e + 1].breakBefore; e++) p += U.value[e + 1];
|
|
874
|
+
(!u || u.items.length && (c.breakBefore || r + U.value[l] > f || r + p > f && p <= (() => {
|
|
873
875
|
let e = o(a());
|
|
874
|
-
return (j.value[t].page.height - e.top - e.bottom) *
|
|
875
|
-
})())) && s(), e[e.length - 1].items.push(l), r +=
|
|
876
|
+
return (j.value[t].page.height - e.top - e.bottom) * Tt;
|
|
877
|
+
})())) && s(), e[e.length - 1].items.push(l), r += U.value[l];
|
|
876
878
|
}), e.length || s(), e;
|
|
877
879
|
}), q = b(() => {
|
|
878
880
|
let e = /* @__PURE__ */ new Map();
|
|
@@ -885,23 +887,23 @@ var Qe = ["aria-label"], $e = {
|
|
|
885
887
|
}), me = (e) => {
|
|
886
888
|
let t = j.value[e.section].page;
|
|
887
889
|
return {
|
|
888
|
-
...
|
|
890
|
+
...B.value,
|
|
889
891
|
width: `${t.width}pt`,
|
|
890
892
|
minHeight: `${t.height}pt`,
|
|
891
893
|
padding: `${e.top}pt ${t.margins.right}pt ${e.bottom}pt ${t.margins.left}pt`
|
|
892
894
|
};
|
|
893
895
|
}, he = (e) => {
|
|
894
896
|
let t = [...new Set(e.items.map((e) => x.value[e].block))];
|
|
895
|
-
return
|
|
897
|
+
return L(t.map((e) => c.preview.blocks[e]), c.mode).flatMap((t) => {
|
|
896
898
|
let n = I(c.preview.images, t.ref);
|
|
897
899
|
return n ? [{
|
|
898
900
|
src: n,
|
|
899
901
|
css: ae(t, j.value[e.section].page)
|
|
900
902
|
}] : [];
|
|
901
903
|
});
|
|
902
|
-
},
|
|
903
|
-
|
|
904
|
-
},
|
|
904
|
+
}, ge = o(e, "fit"), _e = o(e, "zoom"), ve = b(() => ge.value ? Math.min(1.25, Math.max(.3, N.value)) : _e.value), J = (e) => {
|
|
905
|
+
_e.value = Math.min(2, Math.max(.3, Math.round((ve.value + e) * 10) / 10)), ge.value = !1;
|
|
906
|
+
}, be = y(0), xe = y(), Se = () => {
|
|
905
907
|
let e = w.value?.getBoundingClientRect();
|
|
906
908
|
if (!e) return;
|
|
907
909
|
let t = w.value?.querySelectorAll("[data-page]") ?? [], n = 0;
|
|
@@ -909,92 +911,92 @@ var Qe = ["aria-label"], $e = {
|
|
|
909
911
|
if (i.getBoundingClientRect().top - e.top > e.height / 3) break;
|
|
910
912
|
n = r;
|
|
911
913
|
}
|
|
912
|
-
|
|
914
|
+
be.value = n;
|
|
913
915
|
let r;
|
|
914
|
-
for (let t of
|
|
916
|
+
for (let t of De.value) {
|
|
915
917
|
let n = w.value?.querySelector(`[data-key="${t.key}"]`);
|
|
916
918
|
if (n) {
|
|
917
919
|
if (n.getBoundingClientRect().top - e.top > 48) break;
|
|
918
920
|
r = t.key;
|
|
919
921
|
}
|
|
920
922
|
}
|
|
921
|
-
|
|
922
|
-
},
|
|
923
|
-
|
|
924
|
-
|
|
923
|
+
xe.value = r ?? De.value[0]?.key;
|
|
924
|
+
}, Ce = 0, we = () => {
|
|
925
|
+
Ce ||= requestAnimationFrame(() => {
|
|
926
|
+
Ce = 0, Se();
|
|
925
927
|
});
|
|
926
928
|
};
|
|
927
|
-
a(() => cancelAnimationFrame(
|
|
928
|
-
let { selection:
|
|
929
|
-
u(
|
|
929
|
+
a(() => cancelAnimationFrame(Ce)), u(K, () => i(we));
|
|
930
|
+
let { selection: Te } = ue({ root: () => w.value?.getRootNode() });
|
|
931
|
+
u(Te, (e) => {
|
|
930
932
|
let t = w.value;
|
|
931
|
-
f("select", e && t ?
|
|
933
|
+
f("select", e && t ? ye(t, e.range, ".pk-word-preview__measure, .pk-word-preview__part") : void 0);
|
|
932
934
|
});
|
|
933
|
-
let
|
|
934
|
-
let t = c.preview.blocks[e.block], n = t.kind === "heading" ? [t.label,
|
|
935
|
+
let Ee = (e) => ee(e).map((e) => e.text).join("").replace(/\s+/g, " ").trim(), De = b(() => x.value.flatMap((e) => {
|
|
936
|
+
let t = c.preview.blocks[e.block], n = t.kind === "heading" ? [t.label, Ee(t.runs)].filter(Boolean).join(" ") : "";
|
|
935
937
|
return t.kind === "heading" && t.level <= 3 && n ? [{
|
|
936
938
|
key: e.key,
|
|
937
939
|
level: t.level,
|
|
938
940
|
text: n
|
|
939
941
|
}] : [];
|
|
940
|
-
})),
|
|
942
|
+
})), Oe = (e) => e.length > 60 ? `${e.slice(0, 60)}…` : e, Y = b(() => x.value.flatMap((e) => {
|
|
941
943
|
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();
|
|
942
944
|
return r || i ? [{
|
|
943
945
|
key: e.key,
|
|
944
|
-
removed:
|
|
945
|
-
added:
|
|
946
|
+
removed: Oe(r),
|
|
947
|
+
added: Oe(i)
|
|
946
948
|
}] : [];
|
|
947
|
-
})),
|
|
949
|
+
})), ke = y("outline"), Ae = y(!1), je = (e) => {
|
|
948
950
|
w.value?.querySelector(`[data-key="${e}"]`)?.scrollIntoView({
|
|
949
951
|
block: "start",
|
|
950
952
|
behavior: "smooth"
|
|
951
|
-
}), ne.value || (
|
|
952
|
-
},
|
|
953
|
+
}), ne.value || (Ae.value = !1);
|
|
954
|
+
}, Me = b(() => c.preview.blocks.flatMap((e) => e.kind === "table" ? e.rows.flat().map((e) => Ee(e.runs)) : [Ee(e.runs)]).join(" ").split(/\s+/).filter(Boolean).length), Ne = b(() => c.preview.revisionAuthors.join(", "));
|
|
953
955
|
return (t, n) => {
|
|
954
|
-
let i =
|
|
956
|
+
let i = le;
|
|
955
957
|
return A(), k("div", {
|
|
956
958
|
ref_key: "rootEl",
|
|
957
959
|
ref: C,
|
|
958
960
|
class: r(["pk-word-preview", { "pk-word-preview--paged": F.value }])
|
|
959
961
|
}, [
|
|
960
|
-
(ne.value ||
|
|
962
|
+
(ne.value || Ae.value) && (De.value.length || Y.value.length) ? (A(), k("aside", {
|
|
961
963
|
key: 0,
|
|
962
964
|
class: r(["pk-word-preview__side", { "pk-word-preview__side--over": !ne.value }]),
|
|
963
965
|
"aria-label": O(g)("chatFilePreview.outline")
|
|
964
|
-
}, [v("div",
|
|
966
|
+
}, [v("div", et, [v("button", {
|
|
965
967
|
type: "button",
|
|
966
968
|
role: "tab",
|
|
967
969
|
class: "pk-word-preview__tab",
|
|
968
|
-
"aria-selected":
|
|
969
|
-
onClick: n[0] ||= (e) =>
|
|
970
|
-
}, S(O(g)("chatFilePreview.outline")), 9,
|
|
970
|
+
"aria-selected": ke.value === "outline",
|
|
971
|
+
onClick: n[0] ||= (e) => ke.value = "outline"
|
|
972
|
+
}, S(O(g)("chatFilePreview.outline")), 9, tt), Y.value.length ? (A(), k("button", {
|
|
971
973
|
key: 0,
|
|
972
974
|
type: "button",
|
|
973
975
|
role: "tab",
|
|
974
976
|
class: "pk-word-preview__tab",
|
|
975
|
-
"aria-selected":
|
|
976
|
-
onClick: n[1] ||= (e) =>
|
|
977
|
-
}, S(O(g)("chatFilePreview.changes", { count:
|
|
977
|
+
"aria-selected": ke.value === "changes",
|
|
978
|
+
onClick: n[1] ||= (e) => ke.value = "changes"
|
|
979
|
+
}, S(O(g)("chatFilePreview.changes", { count: Y.value.length })), 9, nt)) : E("", !0)]), ke.value === "outline" || !Y.value.length ? (A(), k("nav", rt, [(A(!0), k(_, null, p(De.value, (e) => (A(), k("button", {
|
|
978
980
|
key: e.key,
|
|
979
981
|
type: "button",
|
|
980
982
|
class: r(["pk-word-preview__entry", `pk-word-preview__entry--${Math.min(e.level, 3)}`]),
|
|
981
|
-
"aria-current":
|
|
982
|
-
onClick: (t) =>
|
|
983
|
-
}, [v("span",
|
|
983
|
+
"aria-current": xe.value === e.key ? "location" : void 0,
|
|
984
|
+
onClick: (t) => je(e.key)
|
|
985
|
+
}, [v("span", at, S(e.text), 1), Y.value.some((t) => t.key === e.key) ? (A(), k("span", ot)) : E("", !0)], 10, it))), 128)), De.value.length ? E("", !0) : (A(), k("p", st, S(O(g)("chatFilePreview.noHeadings")), 1))])) : (A(), k("nav", ct, [(A(!0), k(_, null, p(Y.value, (e) => (A(), k("button", {
|
|
984
986
|
key: e.key,
|
|
985
987
|
type: "button",
|
|
986
988
|
class: "pk-word-preview__entry pk-word-preview__entry--change",
|
|
987
|
-
onClick: (t) =>
|
|
988
|
-
}, [e.removed ? (A(), k("del",
|
|
989
|
-
v("div",
|
|
989
|
+
onClick: (t) => je(e.key)
|
|
990
|
+
}, [e.removed ? (A(), k("del", ut, S(e.removed), 1)) : E("", !0), e.added ? (A(), k("ins", dt, S(e.added), 1)) : E("", !0)], 8, lt))), 128))]))], 10, $e)) : E("", !0),
|
|
991
|
+
v("div", ft, [v("div", {
|
|
990
992
|
ref_key: "scrollEl",
|
|
991
993
|
ref: w,
|
|
992
994
|
class: "pk-word-preview__scroll",
|
|
993
|
-
onScroll:
|
|
995
|
+
onScroll: we
|
|
994
996
|
}, [F.value ? (A(), k("div", {
|
|
995
997
|
key: 0,
|
|
996
998
|
class: "pk-word-preview__pages",
|
|
997
|
-
style: l({ zoom:
|
|
999
|
+
style: l({ zoom: ve.value })
|
|
998
1000
|
}, [(A(!0), k(_, null, p(K.value, (t, n) => (A(), k("article", {
|
|
999
1001
|
key: n,
|
|
1000
1002
|
"data-page": "",
|
|
@@ -1005,7 +1007,7 @@ var Qe = ["aria-label"], $e = {
|
|
|
1005
1007
|
}),
|
|
1006
1008
|
style: l(me(t))
|
|
1007
1009
|
}, [
|
|
1008
|
-
t.header && e.preview.parts?.[t.header] ? (A(), h(
|
|
1010
|
+
t.header && e.preview.parts?.[t.header] ? (A(), h(Qe, {
|
|
1009
1011
|
key: 0,
|
|
1010
1012
|
blocks: e.preview.parts[t.header],
|
|
1011
1013
|
where: "header",
|
|
@@ -1018,7 +1020,7 @@ var Qe = ["aria-label"], $e = {
|
|
|
1018
1020
|
"mode",
|
|
1019
1021
|
"numbers"
|
|
1020
1022
|
])) : E("", !0),
|
|
1021
|
-
(A(!0), k(_, null, p(t.items, (r) => (A(), h(
|
|
1023
|
+
(A(!0), k(_, null, p(t.items, (r) => (A(), h($, {
|
|
1022
1024
|
key: x.value[r].key,
|
|
1023
1025
|
"data-key": x.value[r].key,
|
|
1024
1026
|
block: e.preview.blocks[x.value[r].block],
|
|
@@ -1040,8 +1042,8 @@ var Qe = ["aria-label"], $e = {
|
|
|
1040
1042
|
style: l(e.css),
|
|
1041
1043
|
src: e.src,
|
|
1042
1044
|
alt: ""
|
|
1043
|
-
}, null, 12,
|
|
1044
|
-
t.footer && e.preview.parts?.[t.footer] ? (A(), h(
|
|
1045
|
+
}, null, 12, mt))), 128)),
|
|
1046
|
+
t.footer && e.preview.parts?.[t.footer] ? (A(), h(Qe, {
|
|
1045
1047
|
key: 1,
|
|
1046
1048
|
blocks: e.preview.parts[t.footer],
|
|
1047
1049
|
where: "footer",
|
|
@@ -1054,13 +1056,13 @@ var Qe = ["aria-label"], $e = {
|
|
|
1054
1056
|
"mode",
|
|
1055
1057
|
"numbers"
|
|
1056
1058
|
])) : E("", !0)
|
|
1057
|
-
], 12,
|
|
1059
|
+
], 12, pt))), 128))], 4)) : (A(), k("article", {
|
|
1058
1060
|
key: 1,
|
|
1059
1061
|
ref_key: "flowEl",
|
|
1060
|
-
ref:
|
|
1062
|
+
ref: V,
|
|
1061
1063
|
class: "pk-word-preview__page pk-word-preview__page--flow",
|
|
1062
|
-
style: l(
|
|
1063
|
-
}, [(A(!0), k(_, null, p(x.value, (t) => (A(), h(
|
|
1064
|
+
style: l(pe.value)
|
|
1065
|
+
}, [(A(!0), k(_, null, p(x.value, (t) => (A(), h($, {
|
|
1064
1066
|
key: t.key,
|
|
1065
1067
|
"data-key": t.key,
|
|
1066
1068
|
block: e.preview.blocks[t.block],
|
|
@@ -1071,22 +1073,22 @@ var Qe = ["aria-label"], $e = {
|
|
|
1071
1073
|
"block",
|
|
1072
1074
|
"row",
|
|
1073
1075
|
"mode"
|
|
1074
|
-
]))), 128))], 4)), e.preview.truncated ? (A(), k("p",
|
|
1075
|
-
F.value ? (A(), k("span",
|
|
1076
|
-
page:
|
|
1076
|
+
]))), 128))], 4)), e.preview.truncated ? (A(), k("p", ht, S(O(g)("chatFilePreview.truncated")), 1)) : E("", !0)], 544), v("div", gt, [
|
|
1077
|
+
F.value ? (A(), k("span", _t, S(O(g)("chatFilePreview.pageOf", {
|
|
1078
|
+
page: be.value + 1,
|
|
1077
1079
|
count: K.value.length
|
|
1078
1080
|
})), 1)) : E("", !0),
|
|
1079
|
-
v("span",
|
|
1080
|
-
e.mode === "markup" && e.preview.revisionAuthors.length ? (A(), k("span",
|
|
1081
|
+
v("span", vt, S(O(g)("chatFilePreview.words", Me.value)), 1),
|
|
1082
|
+
e.mode === "markup" && e.preview.revisionAuthors.length ? (A(), k("span", yt, [
|
|
1081
1083
|
v("span", {
|
|
1082
1084
|
class: "pk-word-preview__legend-text",
|
|
1083
|
-
title: O(g)("chatFilePreview.revisionsOf", { authors:
|
|
1084
|
-
}, S(O(g)("chatFilePreview.revisionsOf", { authors:
|
|
1085
|
-
v("del",
|
|
1086
|
-
v("ins",
|
|
1085
|
+
title: O(g)("chatFilePreview.revisionsOf", { authors: Ne.value })
|
|
1086
|
+
}, S(O(g)("chatFilePreview.revisionsOf", { authors: Ne.value })), 9, bt),
|
|
1087
|
+
v("del", xt, S(O(g)("chatFilePreview.removed")), 1),
|
|
1088
|
+
v("ins", St, S(O(g)("chatFilePreview.added")), 1)
|
|
1087
1089
|
])) : E("", !0),
|
|
1088
1090
|
n[6] ||= v("span", { class: "pk-word-preview__spacer" }, null, -1),
|
|
1089
|
-
!ne.value && (
|
|
1091
|
+
!ne.value && (De.value.length || Y.value.length) ? (A(), h(i, {
|
|
1090
1092
|
key: 2,
|
|
1091
1093
|
class: "pk-word-preview__outline-toggle",
|
|
1092
1094
|
modifiers: "action-quiet",
|
|
@@ -1094,8 +1096,8 @@ var Qe = ["aria-label"], $e = {
|
|
|
1094
1096
|
label: O(g)("chatFilePreview.outline"),
|
|
1095
1097
|
title: O(g)("chatFilePreview.outline"),
|
|
1096
1098
|
"aria-label": O(g)("chatFilePreview.outline"),
|
|
1097
|
-
"aria-expanded":
|
|
1098
|
-
onClick: n[2] ||= (e) =>
|
|
1099
|
+
"aria-expanded": Ae.value,
|
|
1100
|
+
onClick: n[2] ||= (e) => Ae.value = !Ae.value
|
|
1099
1101
|
}, null, 8, [
|
|
1100
1102
|
"label",
|
|
1101
1103
|
"title",
|
|
@@ -1110,8 +1112,8 @@ var Qe = ["aria-label"], $e = {
|
|
|
1110
1112
|
label: O(g)("chatFilePreview.fitWidth"),
|
|
1111
1113
|
title: O(g)("chatFilePreview.fitWidth"),
|
|
1112
1114
|
"aria-label": O(g)("chatFilePreview.fitWidth"),
|
|
1113
|
-
disabled:
|
|
1114
|
-
onClick: n[3] ||= (e) =>
|
|
1115
|
+
disabled: ge.value,
|
|
1116
|
+
onClick: n[3] ||= (e) => ge.value = !0
|
|
1115
1117
|
}, null, 8, [
|
|
1116
1118
|
"label",
|
|
1117
1119
|
"title",
|
|
@@ -1122,16 +1124,16 @@ var Qe = ["aria-label"], $e = {
|
|
|
1122
1124
|
modifiers: "action-quiet",
|
|
1123
1125
|
icon: "ri:subtract-line",
|
|
1124
1126
|
"aria-label": O(g)("chatFilePreview.zoomOut"),
|
|
1125
|
-
disabled:
|
|
1126
|
-
onClick: n[4] ||= (e) =>
|
|
1127
|
+
disabled: ve.value <= .3,
|
|
1128
|
+
onClick: n[4] ||= (e) => J(-.1)
|
|
1127
1129
|
}, null, 8, ["aria-label", "disabled"]),
|
|
1128
|
-
v("span",
|
|
1130
|
+
v("span", Ct, S(Math.round(ve.value * 100)) + "% ", 1),
|
|
1129
1131
|
d(i, {
|
|
1130
1132
|
modifiers: "action-quiet",
|
|
1131
1133
|
icon: "ri:add-line",
|
|
1132
1134
|
"aria-label": O(g)("chatFilePreview.zoomIn"),
|
|
1133
|
-
disabled:
|
|
1134
|
-
onClick: n[5] ||= (e) =>
|
|
1135
|
+
disabled: ve.value >= 2,
|
|
1136
|
+
onClick: n[5] ||= (e) => J(.1)
|
|
1135
1137
|
}, null, 8, ["aria-label", "disabled"])
|
|
1136
1138
|
], 64)) : E("", !0)
|
|
1137
1139
|
])]),
|
|
@@ -1141,11 +1143,11 @@ var Qe = ["aria-label"], $e = {
|
|
|
1141
1143
|
ref: T,
|
|
1142
1144
|
class: "pk-word-preview__measure",
|
|
1143
1145
|
"aria-hidden": "true",
|
|
1144
|
-
style: l(
|
|
1146
|
+
style: l(de.value)
|
|
1145
1147
|
}, [(A(!0), k(_, null, p(x.value, (t) => (A(), k("div", {
|
|
1146
1148
|
key: t.key,
|
|
1147
1149
|
"data-item": ""
|
|
1148
|
-
}, [d(
|
|
1150
|
+
}, [d($, {
|
|
1149
1151
|
block: e.preview.blocks[t.block],
|
|
1150
1152
|
row: t.row,
|
|
1151
1153
|
mode: e.mode,
|
|
@@ -1158,7 +1160,7 @@ var Qe = ["aria-label"], $e = {
|
|
|
1158
1160
|
])]))), 128)), (A(!0), k(_, null, p(e.preview.parts, (t, n) => (A(), k("div", {
|
|
1159
1161
|
key: n,
|
|
1160
1162
|
"data-part": n
|
|
1161
|
-
}, [(A(!0), k(_, null, p(O(
|
|
1163
|
+
}, [(A(!0), k(_, null, p(O(z)(t, e.mode), (n) => (A(), h($, {
|
|
1162
1164
|
key: n.key,
|
|
1163
1165
|
block: t[n.block],
|
|
1164
1166
|
row: n.row,
|
|
@@ -1169,26 +1171,26 @@ var Qe = ["aria-label"], $e = {
|
|
|
1169
1171
|
"row",
|
|
1170
1172
|
"mode",
|
|
1171
1173
|
"page"
|
|
1172
|
-
]))), 128))], 8,
|
|
1174
|
+
]))), 128))], 8, wt))), 128))], 4)) : E("", !0)
|
|
1173
1175
|
], 2);
|
|
1174
1176
|
};
|
|
1175
1177
|
}
|
|
1176
1178
|
}), [["styles", [".pk-word-preview{flex:1;min-height:0;display:flex;position:relative}.pk-word-preview__side{gap:var(--spacing-12);width:16.5rem;padding:var(--spacing-12);box-sizing:border-box;border-right:var(--border) solid var(--color-surface-3);background-color:var(--color-surface);flex-direction:column;flex-shrink:0;display:flex;overflow-y:auto}.pk-word-preview__side--over{inset:0 auto var(--spacing-40) 0;z-index:3;box-shadow:var(--shadow-lg);position:absolute}.pk-word-preview__tabs{border-bottom:var(--border) solid var(--color-surface-3);display:flex}.pk-word-preview__tab{min-height:var(--spacing-40);color:var(--color-word-3);font:inherit;font-size:var(--text-14);cursor:pointer;background:0 0;border:0;flex:1}.pk-word-preview__tab[aria-selected=true]{box-shadow:inset 0 calc(var(--spacing-2) * -1) 0 var(--color-word-1);color:var(--color-word-1);font-weight:var(--font-semibold)}.pk-word-preview__list{border:var(--border) solid var(--color-surface-3);border-radius:var(--rounded-lg);flex-direction:column;flex-shrink:0;display:flex;overflow:hidden}.pk-word-preview__entry{align-items:center;gap:var(--spacing-8);min-height:var(--spacing-40);padding:var(--spacing-8) var(--spacing-12);border:0;border-bottom:var(--border) solid var(--color-surface-2);color:var(--color-word-2);font:inherit;font-size:var(--text-14);text-align:start;cursor:pointer;transition:background-color var(--duration-150) var(--ease-out);background:0 0;display:flex}.pk-word-preview__entry:last-child{border-bottom:0}.pk-word-preview__entry:hover{background-color:var(--color-surface-1)}.pk-word-preview__entry[aria-current=location]{background-color:var(--color-surface-2);box-shadow:inset var(--spacing-3) 0 0 var(--color-word-2);color:var(--color-word-1);font-weight:var(--font-medium)}.pk-word-preview__entry--0{font-weight:var(--font-semibold)}.pk-word-preview__entry--2{padding-left:var(--spacing-24)}.pk-word-preview__entry--3{padding-left:var(--spacing-36)}.pk-word-preview__entry--change{gap:var(--spacing-4) var(--spacing-8);font-size:var(--text-12);flex-wrap:wrap}.pk-word-preview__entry-text{flex:1;min-width:0}.pk-word-preview__none{padding:var(--spacing-md);color:var(--color-word-3);font-size:var(--text-12);text-align:center;margin:0}.pk-word-preview__main{flex-direction:column;flex:1;min-width:0;display:flex}.pk-word-preview__scroll{min-height:0;padding:var(--spacing-md);background-color:var(--color-surface-2);flex:1;overflow:auto}.pk-word-preview__pages{align-items:center;gap:var(--spacing-24);flex-direction:column;width:max-content;min-width:100%;display:flex}.pk-word-preview__page{isolation:isolate;box-sizing:border-box;line-height:var(--pk-word-line,1.17);overflow-wrap:break-word;background-color:#fff;position:relative;overflow:hidden;box-shadow:0 1px 3px #140e3329,0 10px 28px #140e3314}.pk-word-preview__page--flow{width:100%;padding:var(--spacing-24) var(--spacing-20)}.pk-word-preview__measure{visibility:hidden;pointer-events:none;height:0;line-height:var(--pk-word-line,1.17);overflow-wrap:break-word;position:absolute;top:0;left:-100000px;overflow:hidden}.pk-word-preview__block{white-space:pre-wrap;margin:0;display:flow-root;position:relative}.pk-word-preview__picture{vertical-align:baseline;max-width:100%;height:auto}.pk-word-preview__picture--paragraph{max-width:none}.pk-word-preview__float{max-width:none;position:absolute}.pk-word-preview__part{pointer-events:none;position:absolute;inset:0}.pk-word-preview__part-flow{pointer-events:auto;position:absolute}.pk-word-preview__label{text-indent:0;display:inline-block}.pk-word-preview__changed:before{content:\"\";background-color:#3f3c51;width:1.5pt;position:absolute;top:0;bottom:0;left:-14pt}.pk-word-preview__table{border-collapse:collapse;table-layout:fixed;width:100%;margin:0;position:relative}.pk-word-preview__table td{vertical-align:top;white-space:pre-wrap;overflow-wrap:anywhere;padding:0 5.4pt}.pk-word-preview__table--lines td{border:.5pt solid #000}.pk-word-preview__table--lines.pk-word-preview__table--next td{border-top:0}.pk-word-preview__removed{color:var(--u-danger-text,#c42b3c);text-decoration:line-through}.pk-word-preview__added{color:var(--u-success-text,#178230);text-underline-offset:.2em;text-decoration:underline}.pk-word-preview__page .pk-word-preview__removed{color:#c42b3c}.pk-word-preview__page .pk-word-preview__added{color:#178230}.pk-word-preview__removed+.pk-word-preview__added{margin-inline-start:.15em}.pk-word-preview__image{padding:var(--spacing-2) var(--spacing-8);border:var(--border) dashed #c9c8d2;border-radius:var(--rounded);color:#6b6880;text-indent:0;font-size:9pt;display:inline-block}.pk-word-preview__truncated{margin:var(--spacing-md) 0 0;color:var(--color-word-3);font-size:var(--text-12);text-align:center}.pk-word-preview__status{align-items:center;gap:var(--spacing-16);min-height:var(--spacing-40);padding:0 var(--spacing-8) 0 var(--spacing-12);border-top:var(--border) solid var(--color-surface-3);background-color:var(--color-surface-1);color:var(--color-word-2);font-size:var(--text-12);white-space:nowrap;display:flex}.pk-word-preview__status>*{flex-shrink:0}.pk-word-preview__count{font-variant-numeric:tabular-nums}.pk-word-preview__status>.pk-word-preview__legend{gap:var(--spacing-8);flex-shrink:1;min-width:0;display:flex}.pk-word-preview__legend-text{text-overflow:ellipsis;min-width:0;overflow:hidden}.pk-word-preview__legend>.pk-word-preview__removed,.pk-word-preview__legend>.pk-word-preview__added{flex-shrink:0}.pk-word-preview__spacer{flex:1}@container (width<46rem){.pk-word-preview__status{gap:var(--spacing-12)}.pk-word-preview__outline-toggle .vv-button__label,.pk-word-preview__fit .vv-button__label{display:none}}.pk-word-preview__percent{min-width:var(--spacing-40);font-variant-numeric:tabular-nums;text-align:center}"]]]);
|
|
1177
1179
|
// ../../packages/components/src/chat/PkFilePreview.vue?vue&type=script&setup=true&lang.ts
|
|
1178
1180
|
x(), f(), C();
|
|
1179
|
-
var
|
|
1181
|
+
var Ot = ["aria-label"], kt = { class: "pk-file-preview__head" }, At = { class: "pk-file-preview__file" }, jt = {
|
|
1180
1182
|
class: "pk-file-preview__tile",
|
|
1181
1183
|
"aria-hidden": "true"
|
|
1182
|
-
},
|
|
1184
|
+
}, Mt = { class: "pk-file-preview__name" }, Nt = { class: "pk-file-preview__title" }, Pt = { class: "pk-file-preview__note" }, Ft = {
|
|
1183
1185
|
key: 0,
|
|
1184
1186
|
class: "pk-file-preview__tools"
|
|
1185
|
-
},
|
|
1187
|
+
}, It = ["aria-label"], Lt = { class: "pk-file-preview__version" }, Rt = { class: "pk-file-preview__mode-long" }, zt = { class: "pk-file-preview__mode-short" }, Bt = { class: "pk-file-preview__actions" }, Vt = { class: "pk-file-preview__body" }, Ht = {
|
|
1186
1188
|
key: 0,
|
|
1187
1189
|
class: "pk-file-preview__skeleton vv-skeleton"
|
|
1188
|
-
},
|
|
1190
|
+
}, Ut = {
|
|
1189
1191
|
key: 1,
|
|
1190
1192
|
class: "pk-file-preview__empty"
|
|
1191
|
-
},
|
|
1193
|
+
}, Wt = /*@__PURE__*/ D({
|
|
1192
1194
|
__name: "PkFilePreview",
|
|
1193
1195
|
props: /*@__PURE__*/ c({
|
|
1194
1196
|
kind: { type: String },
|
|
@@ -1253,7 +1255,8 @@ var Dt = ["aria-label"], Ot = { class: "pk-file-preview__head" }, kt = { class:
|
|
|
1253
1255
|
u(() => [
|
|
1254
1256
|
n.version,
|
|
1255
1257
|
n.preview,
|
|
1256
|
-
x.value
|
|
1258
|
+
x.value,
|
|
1259
|
+
C.value
|
|
1257
1260
|
], F);
|
|
1258
1261
|
let ie = (e) => {
|
|
1259
1262
|
P.value || (N.value = e);
|
|
@@ -1265,24 +1268,24 @@ var Dt = ["aria-label"], Ot = { class: "pk-file-preview__head" }, kt = { class:
|
|
|
1265
1268
|
let I = b(() => !n.version || n.version === l.value[l.value.length - 1]), ae = () => {
|
|
1266
1269
|
let e = l.value[l.value.length - 1];
|
|
1267
1270
|
e && a("version", e);
|
|
1268
|
-
},
|
|
1271
|
+
}, oe = b(() => {
|
|
1269
1272
|
let e = N.value;
|
|
1270
|
-
return e?.format === "docx" ? e.paragraphCount > 200 : (e?.cells ?? 0) >
|
|
1271
|
-
}),
|
|
1273
|
+
return e?.format === "docx" ? e.paragraphCount > 200 : (e?.cells ?? 0) > fe;
|
|
1274
|
+
}), L = b(() => N.value?.format === "docx" && x.value === "original"), R = b(() => oe.value || L.value), z = b(() => L.value ? s("selectionActions.hintOriginal") : oe.value ? s(N.value?.format === "docx" ? "selectionActions.hintParagraphs" : "selectionActions.hintCells", { count: N.value?.format === "docx" ? 200 : fe }) : void 0), se = (e) => e[c.value] ?? e[c.value.split("-")[0]] ?? Object.values(e)[0] ?? "", ue = ["explain", "summarize"], V = b(() => {
|
|
1272
1275
|
let e = N.value, t = n.selectionActions;
|
|
1273
1276
|
if (!e || !t) return [];
|
|
1274
1277
|
let r = e.format;
|
|
1275
|
-
return [...(r === "docx" &&
|
|
1278
|
+
return [...(r === "docx" && R.value ? ue : t.builtIns).map((e) => ({
|
|
1276
1279
|
id: e,
|
|
1277
1280
|
label: s(`selectionActions.builtIn.${e}`),
|
|
1278
1281
|
...e === "translate" && { asks: s("selectionActions.translateAsks") },
|
|
1279
1282
|
prompt: (t) => s(`selectionActions.prompt.${r}.${e}`, { language: t ?? "" })
|
|
1280
|
-
})), ...(
|
|
1283
|
+
})), ...(R.value ? [] : t.actions).map((e) => ({
|
|
1281
1284
|
id: e.id,
|
|
1282
|
-
label:
|
|
1283
|
-
prompt: () =>
|
|
1285
|
+
label: se(e.label),
|
|
1286
|
+
prompt: () => se(e.prompt)
|
|
1284
1287
|
}))];
|
|
1285
|
-
}),
|
|
1288
|
+
}), pe = (e) => {
|
|
1286
1289
|
if (e.format === "docx") return s("selectionActions.labelParagraphs", {
|
|
1287
1290
|
file: n.filename,
|
|
1288
1291
|
count: e.paragraphCount
|
|
@@ -1298,20 +1301,20 @@ var Dt = ["aria-label"], Ot = { class: "pk-file-preview__head" }, kt = { class:
|
|
|
1298
1301
|
sheet: e.sheet,
|
|
1299
1302
|
cell: t
|
|
1300
1303
|
});
|
|
1301
|
-
},
|
|
1304
|
+
}, U = (e) => {
|
|
1302
1305
|
if (!n.fileId || !n.storedFileName) return;
|
|
1303
1306
|
let t = {
|
|
1304
1307
|
fileId: n.fileId,
|
|
1305
1308
|
version: n.version ?? 1,
|
|
1306
1309
|
storedFileName: n.storedFileName,
|
|
1307
|
-
label:
|
|
1310
|
+
label: pe(e).slice(0, 200)
|
|
1308
1311
|
};
|
|
1309
1312
|
if (e.format === "docx") {
|
|
1310
1313
|
let { measure: n, ...r } = e;
|
|
1311
1314
|
return {
|
|
1312
1315
|
...t,
|
|
1313
1316
|
...r,
|
|
1314
|
-
...
|
|
1317
|
+
...L.value && { original: !0 }
|
|
1315
1318
|
};
|
|
1316
1319
|
}
|
|
1317
1320
|
let { measure: r, cells: i, ...a } = e;
|
|
@@ -1319,20 +1322,20 @@ var Dt = ["aria-label"], Ot = { class: "pk-file-preview__head" }, kt = { class:
|
|
|
1319
1322
|
...t,
|
|
1320
1323
|
...a
|
|
1321
1324
|
};
|
|
1322
|
-
},
|
|
1323
|
-
let n = N.value, r = n &&
|
|
1325
|
+
}, W = (e, t) => {
|
|
1326
|
+
let n = N.value, r = n && U(n);
|
|
1324
1327
|
r && (a("selectionSend", e, r, {
|
|
1325
1328
|
id: t,
|
|
1326
1329
|
size: n.format === "docx" ? n.paragraphCount : n.cells
|
|
1327
1330
|
}), F(), document.getSelection()?.removeAllRanges());
|
|
1328
|
-
},
|
|
1329
|
-
let n =
|
|
1330
|
-
n &&
|
|
1331
|
+
}, G = (e, t) => {
|
|
1332
|
+
let n = V.value.find((t) => t.id === e);
|
|
1333
|
+
n && W(n.prompt(t), e);
|
|
1331
1334
|
}, K = y(0);
|
|
1332
|
-
|
|
1335
|
+
B(M, "scroll", () => K.value++, {
|
|
1333
1336
|
capture: !0,
|
|
1334
1337
|
passive: !0
|
|
1335
|
-
}),
|
|
1338
|
+
}), B(window, "resize", () => K.value++, { passive: !0 });
|
|
1336
1339
|
let q = b(() => {
|
|
1337
1340
|
K.value;
|
|
1338
1341
|
let e = N.value?.measure(), t = M.value?.getBoundingClientRect();
|
|
@@ -1351,7 +1354,7 @@ var Dt = ["aria-label"], Ot = { class: "pk-file-preview__head" }, kt = { class:
|
|
|
1351
1354
|
};
|
|
1352
1355
|
});
|
|
1353
1356
|
return (t, n) => {
|
|
1354
|
-
let i =
|
|
1357
|
+
let i = ce, o = le;
|
|
1355
1358
|
return A(), k("section", {
|
|
1356
1359
|
ref_key: "rootEl",
|
|
1357
1360
|
ref: M,
|
|
@@ -1360,12 +1363,12 @@ var Dt = ["aria-label"], Ot = { class: "pk-file-preview__head" }, kt = { class:
|
|
|
1360
1363
|
tabindex: "-1",
|
|
1361
1364
|
autofocus: ""
|
|
1362
1365
|
}, [
|
|
1363
|
-
v("header",
|
|
1364
|
-
v("div",
|
|
1366
|
+
v("header", kt, [
|
|
1367
|
+
v("div", At, [v("span", jt, [d(i, {
|
|
1365
1368
|
name: e.kind === "word" ? "ri:file-word-2-line" : "ri:file-excel-2-line",
|
|
1366
1369
|
class: r(e.kind === "word" ? "pk-file-preview__icon--word" : "pk-file-preview__icon--sheet")
|
|
1367
|
-
}, null, 8, ["name", "class"])]), v("div",
|
|
1368
|
-
e.version && l.value.length > 1 || j.value ? (A(), k("div",
|
|
1370
|
+
}, null, 8, ["name", "class"])]), v("div", Mt, [v("strong", Nt, S(e.filename), 1), v("span", Pt, S(O(s)("chatFilePreview.readOnly")), 1)])]),
|
|
1371
|
+
e.version && l.value.length > 1 || j.value ? (A(), k("div", Ft, [e.version && l.value.length > 1 ? (A(), k("nav", {
|
|
1369
1372
|
key: 0,
|
|
1370
1373
|
class: "pk-file-preview__versions",
|
|
1371
1374
|
"aria-label": O(s)("chatFilePreview.versions")
|
|
@@ -1377,7 +1380,7 @@ var Dt = ["aria-label"], Ot = { class: "pk-file-preview__head" }, kt = { class:
|
|
|
1377
1380
|
disabled: !g.value,
|
|
1378
1381
|
onClick: n[0] ||= (e) => g.value && a("version", g.value)
|
|
1379
1382
|
}, null, 8, ["aria-label", "disabled"]),
|
|
1380
|
-
v("span",
|
|
1383
|
+
v("span", Lt, S(O(s)("chatFilePreview.versionOf", {
|
|
1381
1384
|
version: e.version,
|
|
1382
1385
|
count: l.value.length
|
|
1383
1386
|
})), 1),
|
|
@@ -1388,7 +1391,7 @@ var Dt = ["aria-label"], Ot = { class: "pk-file-preview__head" }, kt = { class:
|
|
|
1388
1391
|
disabled: !ee.value,
|
|
1389
1392
|
onClick: n[1] ||= (e) => ee.value && a("version", ee.value)
|
|
1390
1393
|
}, null, 8, ["aria-label", "disabled"])
|
|
1391
|
-
], 8,
|
|
1394
|
+
], 8, It)) : E("", !0), j.value ? (A(), h(H, {
|
|
1392
1395
|
key: 1,
|
|
1393
1396
|
modelValue: x.value,
|
|
1394
1397
|
"onUpdate:modelValue": n[2] ||= (e) => x.value = e,
|
|
@@ -1398,14 +1401,14 @@ var Dt = ["aria-label"], Ot = { class: "pk-file-preview__head" }, kt = { class:
|
|
|
1398
1401
|
"aria-label": O(s)("chatFilePreview.modes"),
|
|
1399
1402
|
options: ne.value
|
|
1400
1403
|
}, {
|
|
1401
|
-
markup: T(() => [v("span",
|
|
1404
|
+
markup: T(() => [v("span", Rt, S(O(s)("chatFilePreview.modeMarkup")), 1), v("span", zt, S(O(s)("chatFilePreview.modeMarkupShort")), 1)]),
|
|
1402
1405
|
_: 1
|
|
1403
1406
|
}, 8, [
|
|
1404
1407
|
"modelValue",
|
|
1405
1408
|
"aria-label",
|
|
1406
1409
|
"options"
|
|
1407
1410
|
])) : E("", !0)])) : E("", !0),
|
|
1408
|
-
v("div",
|
|
1411
|
+
v("div", Bt, [
|
|
1409
1412
|
e.restorable ? (A(), h(o, {
|
|
1410
1413
|
key: 0,
|
|
1411
1414
|
modifiers: "action-quiet",
|
|
@@ -1449,10 +1452,10 @@ var Dt = ["aria-label"], Ot = { class: "pk-file-preview__head" }, kt = { class:
|
|
|
1449
1452
|
}, null, 8, ["title", "aria-label"])
|
|
1450
1453
|
])
|
|
1451
1454
|
]),
|
|
1452
|
-
v("div",
|
|
1455
|
+
v("div", Vt, [e.loading ? (A(), k("div", Ht, [(A(), k(_, null, p(8, (e) => v("div", {
|
|
1453
1456
|
key: e,
|
|
1454
1457
|
class: r(["vv-skeleton__item pk-file-preview__skeleton-line", e % 3 ? "w-full" : "w-128"])
|
|
1455
|
-
}, null, 2)), 64))])) : e.error || !e.preview ? (A(), k("p",
|
|
1458
|
+
}, null, 2)), 64))])) : e.error || !e.preview ? (A(), k("p", Ut, S(O(s)("chatFilePreview.unavailable")), 1)) : e.preview.kind === "word" ? (A(), h(Dt, {
|
|
1456
1459
|
key: 2,
|
|
1457
1460
|
zoom: w.value,
|
|
1458
1461
|
"onUpdate:zoom": n[7] ||= (e) => w.value = e,
|
|
@@ -1466,7 +1469,7 @@ var Dt = ["aria-label"], Ot = { class: "pk-file-preview__head" }, kt = { class:
|
|
|
1466
1469
|
"fit",
|
|
1467
1470
|
"preview",
|
|
1468
1471
|
"mode"
|
|
1469
|
-
])) : (A(), h(
|
|
1472
|
+
])) : (A(), h(He, {
|
|
1470
1473
|
key: 3,
|
|
1471
1474
|
sheet: C.value,
|
|
1472
1475
|
"onUpdate:sheet": n[9] ||= (e) => C.value = e,
|
|
@@ -1479,18 +1482,18 @@ var Dt = ["aria-label"], Ot = { class: "pk-file-preview__head" }, kt = { class:
|
|
|
1479
1482
|
"zoom",
|
|
1480
1483
|
"preview"
|
|
1481
1484
|
]))]),
|
|
1482
|
-
e.selectionActions && N.value && q.value ? (A(), h(
|
|
1485
|
+
e.selectionActions && N.value && q.value ? (A(), h(de, {
|
|
1483
1486
|
key: 0,
|
|
1484
1487
|
asking: P.value,
|
|
1485
1488
|
"onUpdate:asking": n[11] ||= (e) => P.value = e,
|
|
1486
1489
|
strategy: "absolute",
|
|
1487
1490
|
anchor: q.value,
|
|
1488
|
-
actions:
|
|
1489
|
-
hint:
|
|
1491
|
+
actions: V.value,
|
|
1492
|
+
hint: z.value,
|
|
1490
1493
|
note: I.value ? void 0 : O(s)("selectionActions.notLatest", { version: e.version }),
|
|
1491
1494
|
"note-action": O(s)("selectionActions.openLatest"),
|
|
1492
|
-
onAction:
|
|
1493
|
-
onAsk: n[12] ||= (e) =>
|
|
1495
|
+
onAction: G,
|
|
1496
|
+
onAsk: n[12] ||= (e) => W(e, "ask"),
|
|
1494
1497
|
onNote: ae,
|
|
1495
1498
|
onClose: F
|
|
1496
1499
|
}, null, 8, [
|
|
@@ -1501,10 +1504,10 @@ var Dt = ["aria-label"], Ot = { class: "pk-file-preview__head" }, kt = { class:
|
|
|
1501
1504
|
"note",
|
|
1502
1505
|
"note-action"
|
|
1503
1506
|
])) : E("", !0)
|
|
1504
|
-
], 8,
|
|
1507
|
+
], 8, Ot);
|
|
1505
1508
|
};
|
|
1506
1509
|
}
|
|
1507
|
-
}),
|
|
1508
|
-
export {
|
|
1510
|
+
}), Gt = ".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}", Kt = /* @__PURE__ */ e({ default: () => qt }), qt = /*#__PURE__*/ V(Wt, [["styles", [Gt]]]);
|
|
1511
|
+
export { Kt as n, qt as t };
|
|
1509
1512
|
|
|
1510
|
-
//# sourceMappingURL=PkFilePreview-
|
|
1513
|
+
//# sourceMappingURL=PkFilePreview-BzNLupQS.js.map
|