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