@8wave/ai-elements 0.124.0-beta.4 → 0.124.0-beta.6
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/{Agent-CsSvagZw.js → Agent-BBWFD4nI.js} +7 -1
- package/dist/_chunks/{Agent-CsSvagZw.js.map → Agent-BBWFD4nI.js.map} +1 -1
- package/dist/_chunks/{PkFilePreview-C21RR0l6.js → PkFilePreview-CC2W-RXG.js} +195 -195
- package/dist/_chunks/{PkFilePreview-C21RR0l6.js.map → PkFilePreview-CC2W-RXG.js.map} +1 -1
- package/dist/_chunks/{PkFilePreviewDialog-C5Ex7Rf5.js → PkFilePreviewDialog-DYU2CUZS.js} +2 -2
- package/dist/_chunks/{PkFilePreviewDialog-C5Ex7Rf5.js.map → PkFilePreviewDialog-DYU2CUZS.js.map} +1 -1
- package/dist/_chunks/{PkStreamingMarkdown-PQ3X83Fq.js → PkStreamingMarkdown-CeWyL_2B.js} +3 -3
- package/dist/_chunks/{PkStreamingMarkdown-PQ3X83Fq.js.map → PkStreamingMarkdown-CeWyL_2B.js.map} +1 -1
- package/dist/_chunks/{PkToolChatFile-CYxqugvO.js → PkToolChatFile-BMj7-urz.js} +3 -3
- package/dist/_chunks/{PkToolChatFile-CYxqugvO.js.map → PkToolChatFile-BMj7-urz.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestGeolocation-CSAMqLyV.js → PkToolRequestGeolocation-D98zUqNQ.js} +2 -2
- package/dist/_chunks/{PkToolRequestGeolocation-CSAMqLyV.js.map → PkToolRequestGeolocation-D98zUqNQ.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestOAuthConnection-ST3-OlS4.js → PkToolRequestOAuthConnection-DwcRnUcd.js} +2 -2
- package/dist/_chunks/{PkToolRequestOAuthConnection-ST3-OlS4.js.map → PkToolRequestOAuthConnection-DwcRnUcd.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-BIpD-GkV.js → PkToolShowArtifact-BoJC-NtV.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-BIpD-GkV.js.map → PkToolShowArtifact-BoJC-NtV.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-2_YDqjeM.js → PkToolShowContactForm-CErVBzjl.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-2_YDqjeM.js.map → PkToolShowContactForm-CErVBzjl.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-Bu4igmQL.js → PkToolShowForm-B7Q79XAb.js} +4 -4
- package/dist/_chunks/{PkToolShowForm-Bu4igmQL.js.map → PkToolShowForm-B7Q79XAb.js.map} +1 -1
- package/dist/_chunks/{PkToolShowImageGallery-BMP-xuYr.js → PkToolShowImageGallery-CxeQcE6A.js} +2 -2
- package/dist/_chunks/{PkToolShowImageGallery-BMP-xuYr.js.map → PkToolShowImageGallery-CxeQcE6A.js.map} +1 -1
- package/dist/_chunks/{PkToolShowProductList-AkLG4dBV.js → PkToolShowProductList-DDqYsHNq.js} +2 -2
- package/dist/_chunks/{PkToolShowProductList-AkLG4dBV.js.map → PkToolShowProductList-DDqYsHNq.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-DKtdU_Bq.js → PkToolShowSources-CTc2s510.js} +3 -3
- package/dist/_chunks/{PkToolShowSources-DKtdU_Bq.js.map → PkToolShowSources-CTc2s510.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSuggestedReply-DVr8ps6g.js → PkToolShowSuggestedReply-vui8vph1.js} +2 -2
- package/dist/_chunks/{PkToolShowSuggestedReply-DVr8ps6g.js.map → PkToolShowSuggestedReply-vui8vph1.js.map} +1 -1
- package/dist/_chunks/{PkToolShowVideo-C5jqPYXw.js → PkToolShowVideo-C2kh6pVN.js} +2 -2
- package/dist/_chunks/{PkToolShowVideo-C5jqPYXw.js.map → PkToolShowVideo-C2kh6pVN.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWebPages-BqL9PjpM.js → PkToolShowWebPages-By7zBIVa.js} +2 -2
- package/dist/_chunks/{PkToolShowWebPages-BqL9PjpM.js.map → PkToolShowWebPages-By7zBIVa.js.map} +1 -1
- package/dist/_chunks/{chatImagePolicy-ZiVuD6nX.js → chatImagePolicy-C4jFnVQl.js} +2 -2
- package/dist/_chunks/{chatImagePolicy-ZiVuD6nX.js.map → chatImagePolicy-C4jFnVQl.js.map} +1 -1
- package/dist/_chunks/{markdown-CUaXq5OY.js → markdown-DDYeZICP.js} +2 -2
- package/dist/_chunks/{markdown-CUaXq5OY.js.map → markdown-DDYeZICP.js.map} +1 -1
- package/dist/_chunks/{utils-Bz1Gb3iO.js → utils-DAQfsk2H.js} +109 -70
- package/dist/_chunks/utils-DAQfsk2H.js.map +1 -0
- package/dist/ai-elements.es.js +2529 -2509
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotEmptyState.js +1 -1
- package/dist-vue/PkChatbotInput.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotStepPayload.js +1 -1
- package/dist-vue/PkChatbotStepToolDetail.js +1 -1
- package/dist-vue/PkChatbotSteps.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/{Agent-D3US-D1x.js → Agent-DQl-tv4S.js} +154 -148
- package/dist-vue/_chunks/{Agent-D3US-D1x.js.map → Agent-DQl-tv4S.js.map} +1 -1
- package/dist-vue/_chunks/{Document-D5FVOcP9.js → Document-DXDifFZE.js} +2 -2
- package/dist-vue/_chunks/{Document-D5FVOcP9.js.map → Document-DXDifFZE.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbot-BA2tk9ix.js → PkChatbot-DQssgXm3.js} +8 -8
- package/dist-vue/_chunks/{PkChatbot-BA2tk9ix.js.map → PkChatbot-DQssgXm3.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotEmptyState-qKpfIuvI.js → PkChatbotEmptyState-B6qxJAPT.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-qKpfIuvI.js.map → PkChatbotEmptyState-B6qxJAPT.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotInput-DSH5IrO6.js → PkChatbotInput-Bk8OS1xU.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotInput-DSH5IrO6.js.map → PkChatbotInput-Bk8OS1xU.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotMessages-D4LJZxv7.js +1041 -0
- package/dist-vue/_chunks/{PkChatbotMessages-pWNZCmM2.js.map → PkChatbotMessages-D4LJZxv7.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepPayload-BT-Xg18D.js → PkChatbotStepPayload-_0WRbSR6.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-BT-Xg18D.js.map → PkChatbotStepPayload-_0WRbSR6.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-Cs322RDk.js → PkChatbotStepToolDetail-DiaervF2.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-Cs322RDk.js.map → PkChatbotStepToolDetail-DiaervF2.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotSteps-BqL-ClgI.js +189 -0
- package/dist-vue/_chunks/{PkChatbotSteps-Dd62GEXJ.js.map → PkChatbotSteps-BqL-ClgI.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-C8-fUyQh.js → PkChatbotViewChat-BfVLCU_j.js} +337 -317
- package/dist-vue/_chunks/PkChatbotViewChat-BfVLCU_j.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewConversations-CIv5g2xZ.js → PkChatbotViewConversations-C32O6SsT.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewConversations-CIv5g2xZ.js.map → PkChatbotViewConversations-C32O6SsT.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-DjYF-UoB.js → PkChatbotViewFiles-Du5AAS4v.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewFiles-DjYF-UoB.js.map → PkChatbotViewFiles-Du5AAS4v.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-D3d-hG14.js → PkChatbotViewProfile-UZrZdOyM.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-D3d-hG14.js.map → PkChatbotViewProfile-UZrZdOyM.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreview-DfRbMUCD.js → PkFilePreview-jeqvHDm7.js} +29 -29
- package/dist-vue/_chunks/{PkFilePreview-DfRbMUCD.js.map → PkFilePreview-jeqvHDm7.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreviewDialog-Cap9D7s8.js → PkFilePreviewDialog-BSvgiM9A.js} +2 -2
- package/dist-vue/_chunks/{PkFilePreviewDialog-Cap9D7s8.js.map → PkFilePreviewDialog-BSvgiM9A.js.map} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-QDsT-4jC.js → PkStreamingMarkdown-Dk3iXhTm.js} +3 -3
- package/dist-vue/_chunks/{PkStreamingMarkdown-QDsT-4jC.js.map → PkStreamingMarkdown-Dk3iXhTm.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolChatFile-UZeUytvT.js → PkToolChatFile-Bnj-YFLh.js} +3 -3
- package/dist-vue/_chunks/{PkToolChatFile-UZeUytvT.js.map → PkToolChatFile-Bnj-YFLh.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestGeolocation-gEDbmudT.js → PkToolRequestGeolocation-SDzM1-Wl.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestGeolocation-gEDbmudT.js.map → PkToolRequestGeolocation-SDzM1-Wl.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-C9_w8V0T.js → PkToolRequestOAuthConnection-DNrlGxMX.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-C9_w8V0T.js.map → PkToolRequestOAuthConnection-DNrlGxMX.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-ldnH-U3h.js → PkToolShowArtifact-BtCGilTJ.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-ldnH-U3h.js.map → PkToolShowArtifact-BtCGilTJ.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-4hISKYqb.js → PkToolShowContactForm-BZNIeJpf.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-4hISKYqb.js.map → PkToolShowContactForm-BZNIeJpf.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-uHFCQ0FJ.js → PkToolShowDiagram-KD4MfVkP.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-uHFCQ0FJ.js.map → PkToolShowDiagram-KD4MfVkP.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-DiUz5_Ct.js → PkToolShowForm-Dtfpi58S.js} +4 -4
- package/dist-vue/_chunks/{PkToolShowForm-DiUz5_Ct.js.map → PkToolShowForm-Dtfpi58S.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-CEzeXupr.js → PkToolShowImageGallery-DnS04nTs.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowImageGallery-CEzeXupr.js.map → PkToolShowImageGallery-DnS04nTs.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-h4Dqvk1V.js → PkToolShowProductList-BlFKAtqQ.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-h4Dqvk1V.js.map → PkToolShowProductList-BlFKAtqQ.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-BJd4zYAY.js → PkToolShowSources-DM177ZlR.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowSources-BJd4zYAY.js.map → PkToolShowSources-DM177ZlR.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-Bb7Inxa4.js → PkToolShowSuggestedReply-BlcEfMx8.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-Bb7Inxa4.js.map → PkToolShowSuggestedReply-BlcEfMx8.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-DgkpZriW.js → PkToolShowVideo-DQdVpaWT.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowVideo-DgkpZriW.js.map → PkToolShowVideo-DQdVpaWT.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-DQr3SEGC.js → PkToolShowWebPages-Cx2Ft_wN.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-DQr3SEGC.js.map → PkToolShowWebPages-Cx2Ft_wN.js.map} +1 -1
- package/dist-vue/_chunks/{createChatbotApiClient-CFKeOgEA.js → createChatbotApiClient-Bukf58dz.js} +2 -2
- package/dist-vue/_chunks/{createChatbotApiClient-CFKeOgEA.js.map → createChatbotApiClient-Bukf58dz.js.map} +1 -1
- package/dist-vue/_chunks/{useChatbotStore--PcS9kGN.js → useChatbotStore-DcvdWkgq.js} +3 -3
- package/dist-vue/_chunks/{useChatbotStore--PcS9kGN.js.map → useChatbotStore-DcvdWkgq.js.map} +1 -1
- package/dist-vue/_chunks/{utils-DmBnucJs.js → utils-BuxgMuKv.js} +125 -76
- package/dist-vue/_chunks/utils-BuxgMuKv.js.map +1 -0
- package/dist-vue/api.js +1 -1
- package/dist-vue/apps/web-component/src/composables/useChatbotAgent.d.ts +4 -0
- package/dist-vue/composables.js +8 -8
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +5621 -5555
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +18 -0
- package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +8 -2
- package/dist-vue/packages/components/src/chat/PkAuroraCanvas.d.ts +10 -3
- package/dist-vue/packages/components/src/chat/utils.d.ts +29 -0
- package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +12 -0
- package/dist-vue/packages/models/src/schema/Agent.d.ts +48 -0
- package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +12 -0
- package/dist-vue/packages/models/src/schema/SubAgent.d.ts +12 -0
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/utils-Bz1Gb3iO.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotMessages-pWNZCmM2.js +0 -1041
- package/dist-vue/_chunks/PkChatbotSteps-Dd62GEXJ.js +0 -189
- package/dist-vue/_chunks/PkChatbotViewChat-C8-fUyQh.js.map +0 -1
- package/dist-vue/_chunks/utils-DmBnucJs.js.map +0 -1
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
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 x, k as S, kt as C, ot as w, r as T, tt as E, v as D, w as O, wt as k, x as A, y as j, z as M } from "./vue.runtime.esm-bundler-C2U5uTqB.js";
|
|
3
3
|
import { r as ee } from "./vue-i18n-POtLvOl1.js";
|
|
4
|
-
import { B as te,
|
|
5
|
-
import { c as
|
|
6
|
-
import { t as
|
|
7
|
-
import { t as
|
|
8
|
-
import { t as
|
|
9
|
-
import { t as
|
|
4
|
+
import { B as te, H as N, I as P, L as ne, R as re, U as F, V as ie, a as ae, z as oe } from "./utils-DAQfsk2H.js";
|
|
5
|
+
import { c as se } from "./dist-m75acBC9.js";
|
|
6
|
+
import { t as I } from "./index.es-fkUmGg9G.js";
|
|
7
|
+
import { t as ce } from "./VvButtonLocalized-DCJiCUYU.js";
|
|
8
|
+
import { t as L } from "./_plugin-vue_export-helper-Djzt4Yr7.js";
|
|
9
|
+
import { t as le } from "./PkEditorRadioButtons-DWNs2pp4.js";
|
|
10
10
|
// ../../packages/components/src/chat/PkSpreadsheetPreview.vue?vue&type=script&setup=true&lang.ts
|
|
11
11
|
S(), w(), f(), T();
|
|
12
|
-
var
|
|
12
|
+
var R = { class: "pk-spreadsheet-preview" }, ue = { class: "pk-spreadsheet-preview__bar" }, de = ["aria-label"], z = ["aria-label"], fe = ["aria-label"], pe = [
|
|
13
13
|
"rowspan",
|
|
14
14
|
"colspan",
|
|
15
15
|
"data-focus",
|
|
16
16
|
"title",
|
|
17
17
|
"onMousedown",
|
|
18
18
|
"onMouseenter"
|
|
19
|
-
],
|
|
19
|
+
], me = {
|
|
20
20
|
key: 1,
|
|
21
21
|
class: "pk-spreadsheet-preview__more"
|
|
22
|
-
},
|
|
22
|
+
}, B = ["aria-label"], he = ["aria-current", "onClick"], V = { class: "pk-spreadsheet-preview__status" }, ge = { class: "pk-spreadsheet-preview__info" }, _e = ["title"], ve = ["title"], ye = {
|
|
23
23
|
key: 2,
|
|
24
24
|
class: "pk-spreadsheet-preview__stats"
|
|
25
|
-
},
|
|
25
|
+
}, be = {
|
|
26
26
|
key: 0,
|
|
27
27
|
class: "pk-spreadsheet-preview__average"
|
|
28
|
-
},
|
|
28
|
+
}, xe = { key: 1 }, Se = { class: "pk-spreadsheet-preview__zoom" }, H = { class: "pk-spreadsheet-preview__percent" }, Ce = 64, U = 20, W = 28, G = 44, K = /*#__PURE__*/ L(/* @__PURE__ */ O({
|
|
29
29
|
__name: "PkSpreadsheetPreview",
|
|
30
30
|
props: /*@__PURE__*/ c({ preview: { type: null } }, {
|
|
31
31
|
sheet: { default: 0 },
|
|
@@ -35,7 +35,7 @@ var B = { class: "pk-spreadsheet-preview" }, ce = { class: "pk-spreadsheet-previ
|
|
|
35
35
|
}),
|
|
36
36
|
emits: ["update:sheet", "update:zoom"],
|
|
37
37
|
setup(e) {
|
|
38
|
-
let t = e, { t: n, locale: a } = ee({ useScope: "global" }), s = o(e, "sheet"), c = o(e, "zoom"), f = m("scrollEl"), { width: h, height: S } =
|
|
38
|
+
let t = e, { t: n, locale: a } = ee({ useScope: "global" }), s = o(e, "sheet"), c = o(e, "zoom"), f = m("scrollEl"), { width: h, height: S } = se(f, {
|
|
39
39
|
width: 0,
|
|
40
40
|
height: 0
|
|
41
41
|
}, { box: "border-box" }), w = b(() => t.preview.sheets[s.value] ?? t.preview.sheets[0]);
|
|
@@ -49,27 +49,27 @@ var B = { class: "pk-spreadsheet-preview" }, ce = { class: "pk-spreadsheet-previ
|
|
|
49
49
|
}, E = b(() => {
|
|
50
50
|
let e = w.value;
|
|
51
51
|
if (!e) return [];
|
|
52
|
-
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 =
|
|
52
|
+
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 = G, a = h.value / c.value;
|
|
53
53
|
for (let o = 1; o <= e.lastColumn || !e.moreColumns && (o <= e.lastColumn + 2 || i < a); o++) {
|
|
54
54
|
if (t.has(o)) continue;
|
|
55
|
-
let e = n.get(o) ??
|
|
55
|
+
let e = n.get(o) ?? Ce;
|
|
56
56
|
r.push({
|
|
57
57
|
col: o,
|
|
58
58
|
width: e
|
|
59
59
|
}), i += e;
|
|
60
60
|
}
|
|
61
61
|
return r;
|
|
62
|
-
}), O = b(() => E.value.reduce((e, t) => e + t.width,
|
|
62
|
+
}), O = b(() => E.value.reduce((e, t) => e + t.width, G)), te = b(() => E.value.map((e) => `${e.col}:${e.width}`).join(",")), N = /* @__PURE__ */ new WeakMap(), P = b(() => {
|
|
63
63
|
let e = w.value;
|
|
64
64
|
if (!e) return [];
|
|
65
|
-
let t = new Set(e.hiddenRows ?? []), n = new Map(e.rows.map((e) => [e.row, e.height])), r = Math.ceil((S.value / c.value -
|
|
65
|
+
let t = new Set(e.hiddenRows ?? []), n = new Map(e.rows.map((e) => [e.row, e.height])), r = Math.ceil((S.value / c.value - W) / U), i = e.moreRows ? e.lastRow : Math.max(e.lastRow + 5, r + t.size), a = N.get(e);
|
|
66
66
|
a || (a = /* @__PURE__ */ new Map(), N.set(e, a));
|
|
67
67
|
let o = a;
|
|
68
68
|
return Array.from({ length: i }, (e, t) => t + 1).filter((e) => !t.has(e)).map((e) => {
|
|
69
69
|
let t = o.get(e);
|
|
70
70
|
return t || (t = {
|
|
71
71
|
row: e,
|
|
72
|
-
height: n.get(e) ??
|
|
72
|
+
height: n.get(e) ?? U
|
|
73
73
|
}, o.set(e, t)), t;
|
|
74
74
|
});
|
|
75
75
|
}), ne = b(() => {
|
|
@@ -83,13 +83,13 @@ var B = { class: "pk-spreadsheet-preview" }, ce = { class: "pk-spreadsheet-previ
|
|
|
83
83
|
col: n.col
|
|
84
84
|
});
|
|
85
85
|
return e;
|
|
86
|
-
}), F = (e, t) => ne.value.get(`${e},${t}`),
|
|
86
|
+
}), F = (e, t) => ne.value.get(`${e},${t}`), ie = (e, t) => {
|
|
87
87
|
let n = F(e, t)?.span;
|
|
88
88
|
if (n) return {
|
|
89
89
|
rows: P.value.filter((t) => t.row >= e && t.row < e + n.rows).length,
|
|
90
90
|
cols: E.value.filter((e) => e.col >= t && e.col < t + n.cols).length
|
|
91
91
|
};
|
|
92
|
-
},
|
|
92
|
+
}, ae = (e) => e?.style === void 0 ? void 0 : t.preview.styles[e.style], oe = (e, t) => {
|
|
93
93
|
let n = e.decimals === void 0 ? { maximumFractionDigits: 10 } : {
|
|
94
94
|
minimumFractionDigits: e.decimals,
|
|
95
95
|
maximumFractionDigits: e.maxDecimals ?? e.decimals
|
|
@@ -103,18 +103,18 @@ var B = { class: "pk-spreadsheet-preview" }, ce = { class: "pk-spreadsheet-previ
|
|
|
103
103
|
currency: e.currency
|
|
104
104
|
} : {}
|
|
105
105
|
}).format(t);
|
|
106
|
-
},
|
|
106
|
+
}, I = (e) => {
|
|
107
107
|
let t = /* @__PURE__ */ new Date(`${e}T00:00:00Z`);
|
|
108
108
|
return Number.isNaN(t.getTime()) ? e : new Intl.DateTimeFormat(a.value, {
|
|
109
109
|
dateStyle: "short",
|
|
110
110
|
timeZone: "UTC"
|
|
111
111
|
}).format(t);
|
|
112
|
-
},
|
|
112
|
+
}, L = (e) => {
|
|
113
113
|
if (!e) return "";
|
|
114
114
|
if (e.missing) return "—";
|
|
115
115
|
let t = e.value;
|
|
116
|
-
return t === void 0 ? "" : typeof t == "boolean" ? n(t ? "chatFilePreview.true" : "chatFilePreview.false") : e.format === "date" && typeof t == "string" ?
|
|
117
|
-
},
|
|
116
|
+
return t === void 0 ? "" : typeof t == "boolean" ? n(t ? "chatFilePreview.true" : "chatFilePreview.false") : e.format === "date" && typeof t == "string" ? I(t) : typeof t == "number" ? oe(e, t) : t;
|
|
117
|
+
}, le = (e) => {
|
|
118
118
|
if (!e) return "";
|
|
119
119
|
if (e.formula) return `=${e.formula}`;
|
|
120
120
|
let t = e.value;
|
|
@@ -122,9 +122,9 @@ var B = { class: "pk-spreadsheet-preview" }, ce = { class: "pk-spreadsheet-previ
|
|
|
122
122
|
useGrouping: !1,
|
|
123
123
|
maximumFractionDigits: 15,
|
|
124
124
|
...e.format === "percent" ? { style: "percent" } : {}
|
|
125
|
-
}).format(t) :
|
|
126
|
-
},
|
|
127
|
-
let r =
|
|
125
|
+
}).format(t) : L(e);
|
|
126
|
+
}, K = (e) => e ? `${e.width}px solid ${e.color}` : void 0, we = (e, t, n) => {
|
|
127
|
+
let r = ae(e), i = e?.value, a = typeof i == "number" || !!e?.missing, o = {
|
|
128
128
|
textAlign: r?.align ?? (a ? "right" : typeof i == "boolean" || e?.format === "error" ? "center" : "left"),
|
|
129
129
|
verticalAlign: r?.valign === "top" ? "top" : r?.valign === "middle" ? "middle" : "bottom",
|
|
130
130
|
whiteSpace: r?.wrap ? "pre-wrap" : "nowrap"
|
|
@@ -135,43 +135,43 @@ var B = { class: "pk-spreadsheet-preview" }, ce = { class: "pk-spreadsheet-previ
|
|
|
135
135
|
let e = `${4 + r.indent * 9}px`;
|
|
136
136
|
o.textAlign === "right" ? o.paddingRight = e : o.paddingLeft = e;
|
|
137
137
|
}
|
|
138
|
-
return o.borderTop =
|
|
139
|
-
},
|
|
138
|
+
return o.borderTop = K(r?.borders?.top), o.borderRight = K(r?.borders?.right), o.borderBottom = K(r?.borders?.bottom), o.borderLeft = K(r?.borders?.left), Object.assign(o, q(t, n)), o;
|
|
139
|
+
}, q = (e, t) => {
|
|
140
140
|
let n = w.value?.frozen;
|
|
141
141
|
if (!n) return {};
|
|
142
142
|
let r = {};
|
|
143
|
-
return e <= n.rows && (r.position = "sticky", r.top = `${
|
|
144
|
-
},
|
|
143
|
+
return e <= n.rows && (r.position = "sticky", r.top = `${W + P.value.filter((t) => t.row < e).reduce((e, t) => e + t.height, 0)}px`, r.zIndex = 2), t <= n.cols && (r.position = "sticky", r.left = `${G + E.value.filter((e) => e.col < t).reduce((e, t) => e + t.width, 0)}px`, r.zIndex = e <= n.rows ? 3 : 2), r;
|
|
144
|
+
}, J = y({
|
|
145
145
|
row: 1,
|
|
146
146
|
col: 1
|
|
147
|
-
}),
|
|
147
|
+
}), Y = y({
|
|
148
148
|
row: 1,
|
|
149
149
|
col: 1
|
|
150
150
|
});
|
|
151
151
|
u(w, () => {
|
|
152
|
-
|
|
152
|
+
J.value = {
|
|
153
153
|
row: 1,
|
|
154
154
|
col: 1
|
|
155
|
-
},
|
|
155
|
+
}, Y.value = {
|
|
156
156
|
row: 1,
|
|
157
157
|
col: 1
|
|
158
158
|
};
|
|
159
159
|
});
|
|
160
|
-
let
|
|
161
|
-
r1: Math.min(
|
|
162
|
-
r2: Math.max(
|
|
163
|
-
c1: Math.min(
|
|
164
|
-
c2: Math.max(
|
|
165
|
-
})),
|
|
166
|
-
f.value?.focus({ preventScroll: !0 }),
|
|
160
|
+
let X = b(() => ({
|
|
161
|
+
r1: Math.min(J.value.row, Y.value.row),
|
|
162
|
+
r2: Math.max(J.value.row, Y.value.row),
|
|
163
|
+
c1: Math.min(J.value.col, Y.value.col),
|
|
164
|
+
c2: Math.max(J.value.col, Y.value.col)
|
|
165
|
+
})), Te = (e, t) => e >= X.value.r1 && e <= X.value.r2 && t >= X.value.c1 && t <= X.value.c2, Ee = (e, t) => Y.value.row === e && Y.value.col === t, De = (e) => e >= X.value.r1 && e <= X.value.r2 ? `${X.value.c1}:${X.value.c2}:${Y.value.row === e ? Y.value.col : 0}` : "", Z = y(!1), Q = (e, t, n) => {
|
|
166
|
+
f.value?.focus({ preventScroll: !0 }), Y.value = {
|
|
167
167
|
row: e,
|
|
168
168
|
col: t
|
|
169
|
-
}, n.shiftKey || (
|
|
169
|
+
}, n.shiftKey || (J.value = {
|
|
170
170
|
row: e,
|
|
171
171
|
col: t
|
|
172
|
-
}),
|
|
172
|
+
}), Z.value = !0;
|
|
173
173
|
}, Oe = (e, t) => {
|
|
174
|
-
|
|
174
|
+
Z.value && (Y.value = {
|
|
175
175
|
row: e,
|
|
176
176
|
col: t
|
|
177
177
|
});
|
|
@@ -186,7 +186,7 @@ var B = { class: "pk-spreadsheet-preview" }, ce = { class: "pk-spreadsheet-previ
|
|
|
186
186
|
}[e.key];
|
|
187
187
|
if (!t) return;
|
|
188
188
|
e.preventDefault();
|
|
189
|
-
let n = P.value.map((e) => e.row), r = E.value.map((e) => e.col), a = (e) => re.value.get(`${e.row},${e.col}`) ?? e, o = a(
|
|
189
|
+
let n = P.value.map((e) => e.row), r = E.value.map((e) => e.col), a = (e) => re.value.get(`${e.row},${e.col}`) ?? e, o = a(Y.value), s = n.indexOf(Y.value.row), c = r.indexOf(Y.value.col), l = o;
|
|
190
190
|
for (;;) {
|
|
191
191
|
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]));
|
|
192
192
|
if (e === s && i === c || (s = e, c = i, l = a({
|
|
@@ -194,12 +194,12 @@ var B = { class: "pk-spreadsheet-preview" }, ce = { class: "pk-spreadsheet-previ
|
|
|
194
194
|
col: r[c]
|
|
195
195
|
}), l.row !== o.row || l.col !== o.col)) break;
|
|
196
196
|
}
|
|
197
|
-
|
|
197
|
+
Y.value = l, e.shiftKey || (J.value = l), i(() => f.value?.querySelector("[data-focus]")?.scrollIntoView({
|
|
198
198
|
block: "nearest",
|
|
199
199
|
inline: "nearest"
|
|
200
200
|
}));
|
|
201
|
-
}, Ae = b(() => F(
|
|
202
|
-
let { r1: e, r2: t, c1: n, c2: r } =
|
|
201
|
+
}, Ae = b(() => F(Y.value.row, Y.value.col)), $ = b(() => {
|
|
202
|
+
let { r1: e, r2: t, c1: n, c2: r } = X.value;
|
|
203
203
|
if (e === t && n === r) return;
|
|
204
204
|
let i = 0, a = 0, o = 0, s;
|
|
205
205
|
for (let c = e; c <= t; c++) for (let e = n; e <= r; e++) {
|
|
@@ -208,20 +208,20 @@ var B = { class: "pk-spreadsheet-preview" }, ce = { class: "pk-spreadsheet-previ
|
|
|
208
208
|
}
|
|
209
209
|
if (i) return {
|
|
210
210
|
count: i,
|
|
211
|
-
sum: s ?
|
|
212
|
-
average: s ?
|
|
211
|
+
sum: s ? oe(s, a) : void 0,
|
|
212
|
+
average: s ? oe(s, a / o) : void 0
|
|
213
213
|
};
|
|
214
214
|
}), je = (e) => {
|
|
215
215
|
c.value = Math.min(2, Math.max(.5, Math.round((c.value + e) * 10) / 10));
|
|
216
216
|
};
|
|
217
217
|
return (t, i) => {
|
|
218
|
-
let o =
|
|
219
|
-
return M(), j("div",
|
|
220
|
-
v("div",
|
|
218
|
+
let o = ce;
|
|
219
|
+
return M(), j("div", R, [
|
|
220
|
+
v("div", ue, [
|
|
221
221
|
v("span", {
|
|
222
222
|
class: "pk-spreadsheet-preview__ref",
|
|
223
223
|
"aria-label": k(n)("chatFilePreview.cell")
|
|
224
|
-
}, C(T(
|
|
224
|
+
}, C(T(Y.value.col)) + C(Y.value.row), 9, de),
|
|
225
225
|
i[6] ||= v("span", {
|
|
226
226
|
class: "pk-spreadsheet-preview__fx",
|
|
227
227
|
"aria-hidden": "true"
|
|
@@ -229,7 +229,7 @@ var B = { class: "pk-spreadsheet-preview" }, ce = { class: "pk-spreadsheet-previ
|
|
|
229
229
|
v("output", {
|
|
230
230
|
class: "pk-spreadsheet-preview__formula",
|
|
231
231
|
"aria-label": k(n)("chatFilePreview.formulaBar")
|
|
232
|
-
}, C(
|
|
232
|
+
}, C(le(Ae.value)), 9, z)
|
|
233
233
|
]),
|
|
234
234
|
v("div", {
|
|
235
235
|
ref_key: "scrollEl",
|
|
@@ -239,8 +239,8 @@ var B = { class: "pk-spreadsheet-preview" }, ce = { class: "pk-spreadsheet-previ
|
|
|
239
239
|
role: "grid",
|
|
240
240
|
"aria-label": w.value?.name,
|
|
241
241
|
onKeydown: ke,
|
|
242
|
-
onMouseup: i[2] ||= (e) =>
|
|
243
|
-
onMouseleave: i[3] ||= (e) =>
|
|
242
|
+
onMouseup: i[2] ||= (e) => Z.value = !1,
|
|
243
|
+
onMouseleave: i[3] ||= (e) => Z.value = !1
|
|
244
244
|
}, [w.value ? (M(), j("table", {
|
|
245
245
|
key: 0,
|
|
246
246
|
class: r(["pk-spreadsheet-preview__grid", { "pk-spreadsheet-preview__grid--lines": w.value.gridlines }]),
|
|
@@ -249,14 +249,14 @@ var B = { class: "pk-spreadsheet-preview" }, ce = { class: "pk-spreadsheet-previ
|
|
|
249
249
|
width: `${O.value}px`
|
|
250
250
|
})
|
|
251
251
|
}, [
|
|
252
|
-
v("colgroup", null, [v("col", { style: l({ width: `${
|
|
252
|
+
v("colgroup", null, [v("col", { style: l({ width: `${G}px` }) }, null, 4), (M(!0), j(_, null, p(E.value, (e) => (M(), j("col", {
|
|
253
253
|
key: e.col,
|
|
254
254
|
style: l({ width: `${e.width}px` })
|
|
255
255
|
}, null, 4))), 128))]),
|
|
256
|
-
v("thead", null, [v("tr", { style: l({ height: `${
|
|
256
|
+
v("thead", null, [v("tr", { style: l({ height: `${W}px` }) }, [i[7] ||= v("th", { class: "pk-spreadsheet-preview__corner" }, null, -1), (M(!0), j(_, null, p(E.value, (e) => (M(), j("th", {
|
|
257
257
|
key: e.col,
|
|
258
258
|
scope: "col",
|
|
259
|
-
class: r(["pk-spreadsheet-preview__head", { "pk-spreadsheet-preview__head--current": e.col >=
|
|
259
|
+
class: r(["pk-spreadsheet-preview__head", { "pk-spreadsheet-preview__head--current": e.col >= X.value.c1 && e.col <= X.value.c2 }])
|
|
260
260
|
}, C(T(e.col)), 3))), 128))], 4)]),
|
|
261
261
|
v("tbody", null, [(M(!0), j(_, null, p(P.value, (e, t, i, o) => {
|
|
262
262
|
let s = [
|
|
@@ -264,7 +264,7 @@ var B = { class: "pk-spreadsheet-preview" }, ce = { class: "pk-spreadsheet-previ
|
|
|
264
264
|
w.value,
|
|
265
265
|
te.value,
|
|
266
266
|
k(a),
|
|
267
|
-
|
|
267
|
+
De(e.row)
|
|
268
268
|
];
|
|
269
269
|
if (o && o.el && o.key === e.row && x(o, s)) return o;
|
|
270
270
|
let c = (M(), j("tr", {
|
|
@@ -272,29 +272,29 @@ var B = { class: "pk-spreadsheet-preview" }, ce = { class: "pk-spreadsheet-previ
|
|
|
272
272
|
style: l({ height: `${e.height}px` })
|
|
273
273
|
}, [v("th", {
|
|
274
274
|
scope: "row",
|
|
275
|
-
class: r(["pk-spreadsheet-preview__row", { "pk-spreadsheet-preview__row--current": e.row >=
|
|
275
|
+
class: r(["pk-spreadsheet-preview__row", { "pk-spreadsheet-preview__row--current": e.row >= X.value.r1 && e.row <= X.value.r2 }]),
|
|
276
276
|
style: l(w.value.frozen && e.row <= w.value.frozen.rows ? {
|
|
277
|
-
...
|
|
277
|
+
...q(e.row, 0),
|
|
278
278
|
left: 0,
|
|
279
279
|
zIndex: 4
|
|
280
280
|
} : void 0)
|
|
281
281
|
}, C(e.row), 7), (M(!0), j(_, null, p(E.value, (t) => (M(), j(_, { key: t.col }, [re.value.has(`${e.row},${t.col}`) ? D("", !0) : (M(), j("td", {
|
|
282
282
|
key: 0,
|
|
283
|
-
rowspan:
|
|
284
|
-
colspan:
|
|
283
|
+
rowspan: ie(e.row, t.col)?.rows,
|
|
284
|
+
colspan: ie(e.row, t.col)?.cols,
|
|
285
285
|
class: r(["pk-spreadsheet-preview__cell", {
|
|
286
|
-
"pk-spreadsheet-preview__cell--range":
|
|
286
|
+
"pk-spreadsheet-preview__cell--range": Te(e.row, t.col) && !Ee(e.row, t.col),
|
|
287
287
|
"pk-spreadsheet-preview__cell--missing": F(e.row, t.col)?.missing
|
|
288
288
|
}]),
|
|
289
|
-
style: l(
|
|
290
|
-
"data-focus":
|
|
289
|
+
style: l(we(F(e.row, t.col), e.row, t.col)),
|
|
290
|
+
"data-focus": Ee(e.row, t.col) ? "" : void 0,
|
|
291
291
|
title: F(e.row, t.col)?.missing ? k(n)("chatFilePreview.missingValue") : void 0,
|
|
292
292
|
onMousedown: g((n) => Q(e.row, t.col, n), ["prevent"]),
|
|
293
293
|
onMouseenter: (n) => Oe(e.row, t.col)
|
|
294
|
-
}, C(
|
|
294
|
+
}, C(L(F(e.row, t.col))), 47, pe))], 64))), 128))], 4));
|
|
295
295
|
return c.memo = s, c;
|
|
296
296
|
}, i, 0), 128))])
|
|
297
|
-
], 6)) : D("", !0), w.value && (w.value.moreRows || w.value.moreColumns) ? (M(), j("p",
|
|
297
|
+
], 6)) : D("", !0), w.value && (w.value.moreRows || w.value.moreColumns) ? (M(), j("p", me, [w.value.moreRows ? (M(), j(_, { key: 0 }, [A(C(k(n)("chatFilePreview.moreRows", w.value.moreRows)), 1)], 64)) : D("", !0), w.value.moreColumns ? (M(), j(_, { key: 1 }, [A(C(k(n)("chatFilePreview.moreColumns", w.value.moreColumns)), 1)], 64)) : D("", !0)])) : D("", !0)], 40, fe),
|
|
298
298
|
v("nav", {
|
|
299
299
|
class: "pk-spreadsheet-preview__sheets",
|
|
300
300
|
"aria-label": k(n)("chatFilePreview.sheets")
|
|
@@ -304,20 +304,20 @@ var B = { class: "pk-spreadsheet-preview" }, ce = { class: "pk-spreadsheet-previ
|
|
|
304
304
|
class: "pk-spreadsheet-preview__sheet",
|
|
305
305
|
"aria-current": t === s.value ? "page" : void 0,
|
|
306
306
|
onClick: (e) => s.value = t
|
|
307
|
-
}, C(e.name), 9,
|
|
308
|
-
v("div",
|
|
307
|
+
}, C(e.name), 9, he))), 128))], 8, B),
|
|
308
|
+
v("div", V, [v("p", ge, [e.preview.staleFormulas ? (M(), j("span", {
|
|
309
309
|
key: 0,
|
|
310
310
|
class: "pk-spreadsheet-preview__note",
|
|
311
311
|
title: k(n)("chatFilePreview.staleFormulas")
|
|
312
|
-
}, C(k(n)("chatFilePreview.staleFormulas")), 9,
|
|
312
|
+
}, C(k(n)("chatFilePreview.staleFormulas")), 9, _e)) : e.preview.computedFormulas ? (M(), j("span", {
|
|
313
313
|
key: 1,
|
|
314
314
|
class: "pk-spreadsheet-preview__note",
|
|
315
315
|
title: k(n)("chatFilePreview.computedFormulas")
|
|
316
|
-
}, C(k(n)("chatFilePreview.computedFormulas")), 9,
|
|
317
|
-
$.value.average ? (M(), j("span",
|
|
316
|
+
}, C(k(n)("chatFilePreview.computedFormulas")), 9, ve)) : D("", !0), $.value ? (M(), j("span", ye, [
|
|
317
|
+
$.value.average ? (M(), j("span", be, C(k(n)("chatFilePreview.average")) + " " + C($.value.average), 1)) : D("", !0),
|
|
318
318
|
v("span", null, C(k(n)("chatFilePreview.count")) + " " + C($.value.count), 1),
|
|
319
|
-
$.value.sum ? (M(), j("span",
|
|
320
|
-
])) : D("", !0)]), v("div",
|
|
319
|
+
$.value.sum ? (M(), j("span", xe, C(k(n)("chatFilePreview.sum")) + " " + C($.value.sum), 1)) : D("", !0)
|
|
320
|
+
])) : D("", !0)]), v("div", Se, [
|
|
321
321
|
d(o, {
|
|
322
322
|
modifiers: "action-quiet",
|
|
323
323
|
icon: "ri:subtract-line",
|
|
@@ -325,7 +325,7 @@ var B = { class: "pk-spreadsheet-preview" }, ce = { class: "pk-spreadsheet-previ
|
|
|
325
325
|
disabled: c.value <= .5,
|
|
326
326
|
onClick: i[4] ||= (e) => je(-.1)
|
|
327
327
|
}, null, 8, ["aria-label", "disabled"]),
|
|
328
|
-
v("span",
|
|
328
|
+
v("span", H, C(Math.round(c.value * 100)) + "% ", 1),
|
|
329
329
|
d(o, {
|
|
330
330
|
modifiers: "action-quiet",
|
|
331
331
|
icon: "ri:add-line",
|
|
@@ -340,10 +340,10 @@ var B = { class: "pk-spreadsheet-preview" }, ce = { class: "pk-spreadsheet-previ
|
|
|
340
340
|
}), [["styles", [".pk-spreadsheet-preview{--pk-spreadsheet-green:#217346;--pk-spreadsheet-green-head:#217346;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 #e1e1e1}.pk-spreadsheet-preview__corner,.pk-spreadsheet-preview__head,.pk-spreadsheet-preview__row{z-index:1;border:var(--border) solid var(--color-surface-3);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;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{z-index:5;left:0}.pk-spreadsheet-preview__row{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:inset 0 calc(var(--spacing-2) * -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:inset calc(var(--spacing-2) * -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]{outline:var(--spacing-2) solid var(--pk-spreadsheet-green);outline-offset:calc(var(--spacing-2) * -1)}.pk-spreadsheet-preview__cell--range{box-shadow:inset 0 0 0 100vmax #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}"]]]);
|
|
341
341
|
// ../../packages/components/src/chat/PkWordPreviewRuns.vue?vue&type=script&setup=true&lang.ts
|
|
342
342
|
S(), f(), w();
|
|
343
|
-
var
|
|
343
|
+
var we = ["src"], q = {
|
|
344
344
|
key: 1,
|
|
345
345
|
class: "pk-word-preview__image"
|
|
346
|
-
},
|
|
346
|
+
}, J = ["title"], Y = ["title"], X = /* @__PURE__ */ O({
|
|
347
347
|
__name: "PkWordPreviewRuns",
|
|
348
348
|
props: {
|
|
349
349
|
runs: { type: Array },
|
|
@@ -352,13 +352,13 @@ var Ce = ["src"], J = {
|
|
|
352
352
|
numbers: { type: Object }
|
|
353
353
|
},
|
|
354
354
|
setup(e) {
|
|
355
|
-
let n = e, { t: i } = ee({ useScope: "global" }), a = t(
|
|
355
|
+
let n = e, { t: i } = ee({ useScope: "global" }), a = t(ae, void 0), o = (e) => e.picture ? F(a?.value, e.picture.ref) : void 0, s = (e) => n.page ? N(e) : "inline", c = (e) => {
|
|
356
356
|
let t = {
|
|
357
357
|
width: `${e.width}pt`,
|
|
358
358
|
aspectRatio: `${e.width} / ${e.height}`
|
|
359
359
|
}, r = e.anchor, i = n.page;
|
|
360
360
|
if (!r || !i) return t;
|
|
361
|
-
let a = r.xFrom === "page" ? r.x - i.margins.left : r.x, o =
|
|
361
|
+
let a = r.xFrom === "page" ? r.x - i.margins.left : r.x, o = N(e);
|
|
362
362
|
if (o === "around") {
|
|
363
363
|
let n = i.width - i.margins.left - i.margins.right, o = a + e.width / 2 < n / 2;
|
|
364
364
|
return {
|
|
@@ -380,7 +380,7 @@ var Ce = ["src"], J = {
|
|
|
380
380
|
zIndex: r.wrap === "behind" ? -1 : 1
|
|
381
381
|
};
|
|
382
382
|
}, u = (e) => e.field && n.numbers ? String(n.numbers[e.field]) : e.text, d = b(() => {
|
|
383
|
-
let e = re(n.runs, n.mode ?? "markup"), t = (e) => !!e.picture && !!n.page && ["around", "block"].includes(
|
|
383
|
+
let e = re(n.runs, n.mode ?? "markup"), t = (e) => !!e.picture && !!n.page && ["around", "block"].includes(N(e.picture));
|
|
384
384
|
return [...e.filter(t), ...e.filter((e) => !t(e))];
|
|
385
385
|
}), f = b(() => !n.mode || n.mode === "markup"), m = (e) => {
|
|
386
386
|
let t = {};
|
|
@@ -400,17 +400,17 @@ var Ce = ["src"], J = {
|
|
|
400
400
|
style: l(c(e.picture)),
|
|
401
401
|
src: o(e),
|
|
402
402
|
alt: ""
|
|
403
|
-
}, null, 14,
|
|
403
|
+
}, null, 14, we))], 64)) : (M(), j("span", q, C(k(i)("chatFilePreview.image")), 1))], 64)) : f.value && e.change === "deleted" ? (M(), j("del", {
|
|
404
404
|
key: 1,
|
|
405
405
|
class: "pk-word-preview__removed",
|
|
406
406
|
style: l(h(e)),
|
|
407
407
|
title: g(e)
|
|
408
|
-
}, C(u(e)), 13,
|
|
408
|
+
}, C(u(e)), 13, J)) : f.value && e.change === "inserted" ? (M(), j("ins", {
|
|
409
409
|
key: 2,
|
|
410
410
|
class: "pk-word-preview__added",
|
|
411
411
|
style: l(h(e)),
|
|
412
412
|
title: g(e)
|
|
413
|
-
}, C(u(e)), 13,
|
|
413
|
+
}, C(u(e)), 13, Y)) : (M(), j("span", {
|
|
414
414
|
key: 3,
|
|
415
415
|
style: l(m(e))
|
|
416
416
|
}, C(u(e)), 5))], 64))), 128));
|
|
@@ -418,7 +418,7 @@ var Ce = ["src"], J = {
|
|
|
418
418
|
});
|
|
419
419
|
// ../../packages/components/src/chat/PkWordPreviewBlock.vue?vue&type=script&setup=true&lang.ts
|
|
420
420
|
S(), f();
|
|
421
|
-
var
|
|
421
|
+
var Te = { key: 0 }, Ee = ["colspan"], De = ["role", "aria-level"], Z = { key: 1 }, Q = /* @__PURE__ */ O({
|
|
422
422
|
__name: "PkWordPreviewBlock",
|
|
423
423
|
props: {
|
|
424
424
|
block: { type: null },
|
|
@@ -458,7 +458,7 @@ var we = { key: 0 }, Te = ["colspan"], Ee = ["role", "aria-level"], De = { key:
|
|
|
458
458
|
"pk-word-preview__table--next": e.row !== 0,
|
|
459
459
|
"pk-word-preview__changed": c.value
|
|
460
460
|
}])
|
|
461
|
-
}, [s.value.length ? (M(), j("colgroup",
|
|
461
|
+
}, [s.value.length ? (M(), j("colgroup", Te, [(M(!0), j(_, null, p(s.value, (e, t) => (M(), j("col", {
|
|
462
462
|
key: t,
|
|
463
463
|
style: l({ width: e })
|
|
464
464
|
}, null, 4))), 128))])) : D("", !0), v("tbody", null, [v("tr", null, [(M(!0), j(_, null, p(o.value, (t, n) => (M(), j("td", {
|
|
@@ -469,7 +469,7 @@ var we = { key: 0 }, Te = ["colspan"], Ee = ["role", "aria-level"], De = { key:
|
|
|
469
469
|
textAlign: t.align,
|
|
470
470
|
fontSize: t.size ? `${t.size}pt` : void 0
|
|
471
471
|
})
|
|
472
|
-
}, [d(
|
|
472
|
+
}, [d(X, {
|
|
473
473
|
runs: t.runs,
|
|
474
474
|
mode: e.mode,
|
|
475
475
|
numbers: e.numbers
|
|
@@ -477,7 +477,7 @@ var we = { key: 0 }, Te = ["colspan"], Ee = ["role", "aria-level"], De = { key:
|
|
|
477
477
|
"runs",
|
|
478
478
|
"mode",
|
|
479
479
|
"numbers"
|
|
480
|
-
])], 12,
|
|
480
|
+
])], 12, Ee))), 128))])])], 2)) : e.block.kind === "table" ? D("", !0) : (M(), j("div", {
|
|
481
481
|
key: 1,
|
|
482
482
|
class: r(["pk-word-preview__block", { "pk-word-preview__changed": a.value }]),
|
|
483
483
|
role: e.block.kind === "heading" ? "heading" : void 0,
|
|
@@ -489,7 +489,7 @@ var we = { key: 0 }, Te = ["colspan"], Ee = ["role", "aria-level"], De = { key:
|
|
|
489
489
|
class: "pk-word-preview__label",
|
|
490
490
|
style: l(i.value)
|
|
491
491
|
}, C(e.block.label), 5)) : D("", !0),
|
|
492
|
-
d(
|
|
492
|
+
d(X, {
|
|
493
493
|
runs: e.block.runs,
|
|
494
494
|
mode: e.mode,
|
|
495
495
|
page: e.page,
|
|
@@ -500,8 +500,8 @@ var we = { key: 0 }, Te = ["colspan"], Ee = ["role", "aria-level"], De = { key:
|
|
|
500
500
|
"page",
|
|
501
501
|
"numbers"
|
|
502
502
|
]),
|
|
503
|
-
!e.block.label && !e.block.runs.length ? (M(), j("br",
|
|
504
|
-
], 14,
|
|
503
|
+
!e.block.label && !e.block.runs.length ? (M(), j("br", Z)) : D("", !0)
|
|
504
|
+
], 14, De));
|
|
505
505
|
}
|
|
506
506
|
});
|
|
507
507
|
// ../../packages/components/src/chat/PkWordPreviewPart.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -516,11 +516,11 @@ var Oe = { class: "pk-word-preview__part" }, ke = ["src"], Ae = /* @__PURE__ */
|
|
|
516
516
|
numbers: { type: Object }
|
|
517
517
|
},
|
|
518
518
|
setup(e) {
|
|
519
|
-
let n = e, r = t(
|
|
520
|
-
let t =
|
|
519
|
+
let n = e, r = t(ae, void 0), i = b(() => P(n.blocks, n.mode)), a = b(() => ie(n.blocks, n.mode).flatMap((e) => {
|
|
520
|
+
let t = F(r?.value, e.ref);
|
|
521
521
|
return t ? [{
|
|
522
522
|
src: t,
|
|
523
|
-
css:
|
|
523
|
+
css: te(e, n.section.page)
|
|
524
524
|
}] : [];
|
|
525
525
|
})), o = b(() => {
|
|
526
526
|
let { margins: e } = n.section.page;
|
|
@@ -587,7 +587,7 @@ var $ = ["aria-label"], je = {
|
|
|
587
587
|
}, Ye = { class: "pk-word-preview__count" }, Xe = {
|
|
588
588
|
key: 1,
|
|
589
589
|
class: "pk-word-preview__legend"
|
|
590
|
-
}, Ze = ["title"], Qe = { class: "pk-word-preview__removed" }, $e = { class: "pk-word-preview__added" }, et = { class: "pk-word-preview__percent" }, tt = ["data-part"], nt = 96 / 72, rt = /*#__PURE__*/
|
|
590
|
+
}, Ze = ["title"], Qe = { class: "pk-word-preview__removed" }, $e = { class: "pk-word-preview__added" }, et = { class: "pk-word-preview__percent" }, tt = ["data-part"], nt = 96 / 72, rt = /*#__PURE__*/ L(/* @__PURE__ */ O({
|
|
591
591
|
__name: "PkWordPreview",
|
|
592
592
|
props: /*@__PURE__*/ c({
|
|
593
593
|
preview: { type: null },
|
|
@@ -604,48 +604,48 @@ var $ = ["aria-label"], je = {
|
|
|
604
604
|
emits: ["update:fit", "update:zoom"],
|
|
605
605
|
setup(e) {
|
|
606
606
|
let t = e, { t: c } = ee({ useScope: "global" });
|
|
607
|
-
n(
|
|
608
|
-
let f = (e) => re(e, t.mode), g = b(() =>
|
|
607
|
+
n(ae, b(() => t.preview.images));
|
|
608
|
+
let f = (e) => re(e, t.mode), g = b(() => P(t.preview.blocks, t.mode)), x = m("rootEl"), S = m("scrollEl"), w = m("measureEl"), { width: T } = se(x), { width: E } = se(S), O = b(() => T.value === 0 || T.value >= 640), A = b(() => T.value >= 1e3), N = b(() => t.preview.sections?.length ? t.preview.sections : [{
|
|
609
609
|
page: t.preview.page,
|
|
610
610
|
headerDistance: 0,
|
|
611
611
|
footerDistance: 0,
|
|
612
612
|
headers: {},
|
|
613
613
|
footers: {}
|
|
614
|
-
}]),
|
|
614
|
+
}]), I = b(() => N.value[0].page), L = b(() => ({
|
|
615
615
|
fontFamily: ne(t.preview.defaults.font),
|
|
616
616
|
fontSize: `${t.preview.defaults.size}pt`,
|
|
617
617
|
color: t.preview.defaults.color ?? "#000000",
|
|
618
|
-
"--pk-word-line":
|
|
618
|
+
"--pk-word-line": oe(t.preview.defaults.font),
|
|
619
619
|
"--pk-word-size": `${t.preview.defaults.size}pt`
|
|
620
|
-
})),
|
|
621
|
-
...
|
|
622
|
-
width: `${
|
|
623
|
-
})),
|
|
620
|
+
})), le = b(() => ({
|
|
621
|
+
...L.value,
|
|
622
|
+
width: `${I.value.width - I.value.margins.left - I.value.margins.right}pt`
|
|
623
|
+
})), R = y([]), ue = y({}), de = async () => {
|
|
624
624
|
await i();
|
|
625
625
|
let e = w.value?.querySelectorAll("[data-item]");
|
|
626
|
-
|
|
626
|
+
R.value = [...e ?? []].map((e) => e.getBoundingClientRect().height);
|
|
627
627
|
let t = w.value?.querySelectorAll("[data-part]");
|
|
628
|
-
|
|
628
|
+
ue.value = Object.fromEntries([...t ?? []].map((e) => [e.dataset.part ?? "", e.getBoundingClientRect().height]));
|
|
629
629
|
};
|
|
630
630
|
u([
|
|
631
631
|
g,
|
|
632
632
|
O,
|
|
633
633
|
() => t.preview.parts
|
|
634
|
-
],
|
|
635
|
-
|
|
634
|
+
], de, { flush: "post" }), s(() => {
|
|
635
|
+
de(), document.fonts?.ready.then(de);
|
|
636
636
|
});
|
|
637
|
-
let
|
|
638
|
-
if (!O.value ||
|
|
637
|
+
let z = b(() => {
|
|
638
|
+
if (!O.value || R.value.length !== g.value.length) return [{
|
|
639
639
|
items: g.value.map((e, t) => t),
|
|
640
640
|
section: 0,
|
|
641
641
|
number: 1,
|
|
642
|
-
top:
|
|
643
|
-
bottom:
|
|
642
|
+
top: I.value.margins.top,
|
|
643
|
+
bottom: I.value.margins.bottom
|
|
644
644
|
}];
|
|
645
645
|
let e = [], n = 0, r = !0, i = 0, a, o = () => {
|
|
646
|
-
let o =
|
|
646
|
+
let o = N.value[n], s = r && o.pageStart !== void 0 ? o.pageStart : (a ?? e[e.length - 1]?.number ?? 0) + 1;
|
|
647
647
|
a = void 0;
|
|
648
|
-
let c = (e) => r && o.titlePage ? e.first : t.preview.evenAndOddHeaders && s % 2 == 0 ? e.even : e.default, l = c(o.headers), u = c(o.footers), d = (e) => e ? (
|
|
648
|
+
let c = (e) => r && o.titlePage ? e.first : t.preview.evenAndOddHeaders && s % 2 == 0 ? e.even : e.default, l = c(o.headers), u = c(o.footers), d = (e) => e ? (ue.value[e] ?? 0) / nt : 0;
|
|
649
649
|
e.push({
|
|
650
650
|
items: [],
|
|
651
651
|
section: n,
|
|
@@ -657,38 +657,38 @@ var $ = ["aria-label"], je = {
|
|
|
657
657
|
}), r = !1, i = 0;
|
|
658
658
|
};
|
|
659
659
|
return g.value.forEach((t, s) => {
|
|
660
|
-
t.section !== void 0 && t.section !== n &&
|
|
661
|
-
let c = e[e.length - 1], l = c &&
|
|
662
|
-
(!c || c.items.length && (t.breakBefore || i +
|
|
660
|
+
t.section !== void 0 && t.section !== n && N.value[t.section] && (n = t.section, r = t.breakBefore || !e.length, r || (a = N.value[n].pageStart));
|
|
661
|
+
let c = e[e.length - 1], l = c && N.value[c.section].page, u = l ? (l.height - c.top - c.bottom) * nt : 0;
|
|
662
|
+
(!c || c.items.length && (t.breakBefore || i + R.value[s] > u)) && o(), e[e.length - 1].items.push(s), i += R.value[s];
|
|
663
663
|
}), e.length || o(), e;
|
|
664
|
-
}),
|
|
664
|
+
}), fe = b(() => {
|
|
665
665
|
let e = /* @__PURE__ */ new Map();
|
|
666
|
-
for (let t of
|
|
667
|
-
return
|
|
666
|
+
for (let t of z.value) e.set(t.section, (e.get(t.section) ?? 0) + 1);
|
|
667
|
+
return z.value.map((t) => ({
|
|
668
668
|
page: t.number,
|
|
669
|
-
pages:
|
|
669
|
+
pages: z.value.length,
|
|
670
670
|
sectionPages: e.get(t.section) ?? 1
|
|
671
671
|
}));
|
|
672
|
-
}),
|
|
673
|
-
let t =
|
|
672
|
+
}), pe = (e) => {
|
|
673
|
+
let t = N.value[e.section].page;
|
|
674
674
|
return {
|
|
675
|
-
...
|
|
675
|
+
...L.value,
|
|
676
676
|
width: `${t.width}pt`,
|
|
677
677
|
minHeight: `${t.height}pt`,
|
|
678
678
|
padding: `${e.top}pt ${t.margins.right}pt ${e.bottom}pt ${t.margins.left}pt`
|
|
679
679
|
};
|
|
680
|
-
},
|
|
680
|
+
}, me = (e) => {
|
|
681
681
|
let n = [...new Set(e.items.map((e) => g.value[e].block))];
|
|
682
|
-
return
|
|
683
|
-
let r =
|
|
682
|
+
return ie(n.map((e) => t.preview.blocks[e]), t.mode).flatMap((n) => {
|
|
683
|
+
let r = F(t.preview.images, n.ref);
|
|
684
684
|
return r ? [{
|
|
685
685
|
src: r,
|
|
686
|
-
css:
|
|
686
|
+
css: te(n, N.value[e.section].page)
|
|
687
687
|
}] : [];
|
|
688
688
|
});
|
|
689
|
-
},
|
|
690
|
-
|
|
691
|
-
},
|
|
689
|
+
}, B = o(e, "fit"), he = o(e, "zoom"), V = b(() => B.value ? Math.min(1.25, Math.max(.3, (E.value - 48) / (I.value.width * nt))) : he.value), ge = (e) => {
|
|
690
|
+
he.value = Math.min(2, Math.max(.3, Math.round((V.value + e) * 10) / 10)), B.value = !1;
|
|
691
|
+
}, _e = y(0), ve = y(), ye = () => {
|
|
692
692
|
let e = S.value?.getBoundingClientRect();
|
|
693
693
|
if (!e) return;
|
|
694
694
|
let t = S.value?.querySelectorAll("[data-page]") ?? [], n = 0;
|
|
@@ -696,50 +696,50 @@ var $ = ["aria-label"], je = {
|
|
|
696
696
|
if (i.getBoundingClientRect().top - e.top > e.height / 3) break;
|
|
697
697
|
n = r;
|
|
698
698
|
}
|
|
699
|
-
|
|
699
|
+
_e.value = n;
|
|
700
700
|
let r;
|
|
701
|
-
for (let t of
|
|
701
|
+
for (let t of H.value) {
|
|
702
702
|
let n = S.value?.querySelector(`[data-key="${t.key}"]`);
|
|
703
703
|
if (n) {
|
|
704
704
|
if (n.getBoundingClientRect().top - e.top > 48) break;
|
|
705
705
|
r = t.key;
|
|
706
706
|
}
|
|
707
707
|
}
|
|
708
|
-
|
|
709
|
-
},
|
|
710
|
-
|
|
711
|
-
|
|
708
|
+
ve.value = r ?? H.value[0]?.key;
|
|
709
|
+
}, be = 0, xe = () => {
|
|
710
|
+
be ||= requestAnimationFrame(() => {
|
|
711
|
+
be = 0, ye();
|
|
712
712
|
});
|
|
713
713
|
};
|
|
714
|
-
a(() => cancelAnimationFrame(
|
|
715
|
-
let
|
|
716
|
-
let n = t.preview.blocks[e.block], r = n.kind === "heading" ? [n.label,
|
|
714
|
+
a(() => cancelAnimationFrame(be)), u(z, () => i(xe));
|
|
715
|
+
let Se = (e) => f(e).map((e) => e.text).join("").replace(/\s+/g, " ").trim(), H = b(() => g.value.flatMap((e) => {
|
|
716
|
+
let n = t.preview.blocks[e.block], r = n.kind === "heading" ? [n.label, Se(n.runs)].filter(Boolean).join(" ") : "";
|
|
717
717
|
return n.kind === "heading" && n.level <= 3 && r ? [{
|
|
718
718
|
key: e.key,
|
|
719
719
|
level: n.level,
|
|
720
720
|
text: r
|
|
721
721
|
}] : [];
|
|
722
|
-
})),
|
|
722
|
+
})), Ce = (e) => e.length > 60 ? `${e.slice(0, 60)}…` : e, U = b(() => g.value.flatMap((e) => {
|
|
723
723
|
let n = t.preview.blocks[e.block], r = n.kind === "table" ? (n.rows[e.row ?? 0] ?? []).flatMap((e) => e.runs) : n.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();
|
|
724
724
|
return i || a ? [{
|
|
725
725
|
key: e.key,
|
|
726
|
-
removed:
|
|
727
|
-
added:
|
|
726
|
+
removed: Ce(i),
|
|
727
|
+
added: Ce(a)
|
|
728
728
|
}] : [];
|
|
729
|
-
})),
|
|
729
|
+
})), W = y("outline"), G = y(!1), K = (e) => {
|
|
730
730
|
S.value?.querySelector(`[data-key="${e}"]`)?.scrollIntoView({
|
|
731
731
|
block: "start",
|
|
732
732
|
behavior: "smooth"
|
|
733
|
-
}), A.value || (
|
|
734
|
-
},
|
|
733
|
+
}), A.value || (G.value = !1);
|
|
734
|
+
}, we = b(() => t.preview.blocks.flatMap((e) => e.kind === "table" ? e.rows.flat().map((e) => Se(e.runs)) : [Se(e.runs)]).join(" ").split(/\s+/).filter(Boolean).length), q = b(() => t.preview.revisionAuthors.join(", "));
|
|
735
735
|
return (t, n) => {
|
|
736
|
-
let i =
|
|
736
|
+
let i = ce;
|
|
737
737
|
return M(), j("div", {
|
|
738
738
|
ref_key: "rootEl",
|
|
739
739
|
ref: x,
|
|
740
740
|
class: r(["pk-word-preview", { "pk-word-preview--paged": O.value }])
|
|
741
741
|
}, [
|
|
742
|
-
(A.value ||
|
|
742
|
+
(A.value || G.value) && (H.value.length || U.value.length) ? (M(), j("aside", {
|
|
743
743
|
key: 0,
|
|
744
744
|
class: r(["pk-word-preview__side", { "pk-word-preview__side--over": !A.value }]),
|
|
745
745
|
"aria-label": k(c)("chatFilePreview.outline")
|
|
@@ -747,53 +747,53 @@ var $ = ["aria-label"], je = {
|
|
|
747
747
|
type: "button",
|
|
748
748
|
role: "tab",
|
|
749
749
|
class: "pk-word-preview__tab",
|
|
750
|
-
"aria-selected":
|
|
751
|
-
onClick: n[0] ||= (e) =>
|
|
752
|
-
}, C(k(c)("chatFilePreview.outline")), 9, Me),
|
|
750
|
+
"aria-selected": W.value === "outline",
|
|
751
|
+
onClick: n[0] ||= (e) => W.value = "outline"
|
|
752
|
+
}, C(k(c)("chatFilePreview.outline")), 9, Me), U.value.length ? (M(), j("button", {
|
|
753
753
|
key: 0,
|
|
754
754
|
type: "button",
|
|
755
755
|
role: "tab",
|
|
756
756
|
class: "pk-word-preview__tab",
|
|
757
|
-
"aria-selected":
|
|
758
|
-
onClick: n[1] ||= (e) =>
|
|
759
|
-
}, C(k(c)("chatFilePreview.changes", { count:
|
|
757
|
+
"aria-selected": W.value === "changes",
|
|
758
|
+
onClick: n[1] ||= (e) => W.value = "changes"
|
|
759
|
+
}, C(k(c)("chatFilePreview.changes", { count: U.value.length })), 9, Ne)) : D("", !0)]), W.value === "outline" || !U.value.length ? (M(), j("nav", Pe, [(M(!0), j(_, null, p(H.value, (e) => (M(), j("button", {
|
|
760
760
|
key: e.key,
|
|
761
761
|
type: "button",
|
|
762
762
|
class: r(["pk-word-preview__entry", `pk-word-preview__entry--${Math.min(e.level, 3)}`]),
|
|
763
|
-
"aria-current":
|
|
764
|
-
onClick: (t) =>
|
|
765
|
-
}, [v("span", Ie, C(e.text), 1),
|
|
763
|
+
"aria-current": ve.value === e.key ? "location" : void 0,
|
|
764
|
+
onClick: (t) => K(e.key)
|
|
765
|
+
}, [v("span", Ie, C(e.text), 1), U.value.some((t) => t.key === e.key) ? (M(), j("span", Le)) : D("", !0)], 10, Fe))), 128)), H.value.length ? D("", !0) : (M(), j("p", Re, C(k(c)("chatFilePreview.noHeadings")), 1))])) : (M(), j("nav", ze, [(M(!0), j(_, null, p(U.value, (e) => (M(), j("button", {
|
|
766
766
|
key: e.key,
|
|
767
767
|
type: "button",
|
|
768
768
|
class: "pk-word-preview__entry pk-word-preview__entry--change",
|
|
769
|
-
onClick: (t) =>
|
|
769
|
+
onClick: (t) => K(e.key)
|
|
770
770
|
}, [e.removed ? (M(), j("del", Ve, C(e.removed), 1)) : D("", !0), e.added ? (M(), j("ins", He, C(e.added), 1)) : D("", !0)], 8, Be))), 128))]))], 10, $)) : D("", !0),
|
|
771
771
|
v("div", Ue, [v("div", {
|
|
772
772
|
ref_key: "scrollEl",
|
|
773
773
|
ref: S,
|
|
774
774
|
class: "pk-word-preview__scroll",
|
|
775
|
-
onScroll:
|
|
775
|
+
onScroll: xe
|
|
776
776
|
}, [O.value ? (M(), j("div", {
|
|
777
777
|
key: 0,
|
|
778
778
|
class: "pk-word-preview__pages",
|
|
779
|
-
style: l({ zoom:
|
|
780
|
-
}, [(M(!0), j(_, null, p(
|
|
779
|
+
style: l({ zoom: V.value })
|
|
780
|
+
}, [(M(!0), j(_, null, p(z.value, (t, n) => (M(), j("article", {
|
|
781
781
|
key: n,
|
|
782
782
|
"data-page": "",
|
|
783
783
|
class: "pk-word-preview__page",
|
|
784
784
|
"aria-label": k(c)("chatFilePreview.pageOf", {
|
|
785
785
|
page: n + 1,
|
|
786
|
-
count:
|
|
786
|
+
count: z.value.length
|
|
787
787
|
}),
|
|
788
|
-
style: l(
|
|
788
|
+
style: l(pe(t))
|
|
789
789
|
}, [
|
|
790
790
|
t.header && e.preview.parts?.[t.header] ? (M(), h(Ae, {
|
|
791
791
|
key: 0,
|
|
792
792
|
blocks: e.preview.parts[t.header],
|
|
793
793
|
where: "header",
|
|
794
|
-
section:
|
|
794
|
+
section: N.value[t.section],
|
|
795
795
|
mode: e.mode,
|
|
796
|
-
numbers:
|
|
796
|
+
numbers: fe.value[n]
|
|
797
797
|
}, null, 8, [
|
|
798
798
|
"blocks",
|
|
799
799
|
"section",
|
|
@@ -806,8 +806,8 @@ var $ = ["aria-label"], je = {
|
|
|
806
806
|
block: e.preview.blocks[g.value[r].block],
|
|
807
807
|
row: g.value[r].row,
|
|
808
808
|
mode: e.mode,
|
|
809
|
-
page:
|
|
810
|
-
numbers:
|
|
809
|
+
page: N.value[t.section].page,
|
|
810
|
+
numbers: fe.value[n]
|
|
811
811
|
}, null, 8, [
|
|
812
812
|
"data-key",
|
|
813
813
|
"block",
|
|
@@ -816,7 +816,7 @@ var $ = ["aria-label"], je = {
|
|
|
816
816
|
"page",
|
|
817
817
|
"numbers"
|
|
818
818
|
]))), 128)),
|
|
819
|
-
(M(!0), j(_, null, p(
|
|
819
|
+
(M(!0), j(_, null, p(me(t), (e, t) => (M(), j("img", {
|
|
820
820
|
key: `image-${t}`,
|
|
821
821
|
class: "pk-word-preview__float",
|
|
822
822
|
style: l(e.css),
|
|
@@ -827,9 +827,9 @@ var $ = ["aria-label"], je = {
|
|
|
827
827
|
key: 1,
|
|
828
828
|
blocks: e.preview.parts[t.footer],
|
|
829
829
|
where: "footer",
|
|
830
|
-
section:
|
|
830
|
+
section: N.value[t.section],
|
|
831
831
|
mode: e.mode,
|
|
832
|
-
numbers:
|
|
832
|
+
numbers: fe.value[n]
|
|
833
833
|
}, null, 8, [
|
|
834
834
|
"blocks",
|
|
835
835
|
"section",
|
|
@@ -839,7 +839,7 @@ var $ = ["aria-label"], je = {
|
|
|
839
839
|
], 12, We))), 128))], 4)) : (M(), j("article", {
|
|
840
840
|
key: 1,
|
|
841
841
|
class: "pk-word-preview__page pk-word-preview__page--flow",
|
|
842
|
-
style: l(
|
|
842
|
+
style: l(L.value)
|
|
843
843
|
}, [(M(!0), j(_, null, p(g.value, (t) => (M(), h(Q, {
|
|
844
844
|
key: t.key,
|
|
845
845
|
"data-key": t.key,
|
|
@@ -853,20 +853,20 @@ var $ = ["aria-label"], je = {
|
|
|
853
853
|
"mode"
|
|
854
854
|
]))), 128))], 4)), e.preview.truncated ? (M(), j("p", Ke, C(k(c)("chatFilePreview.truncated")), 1)) : D("", !0)], 544), v("div", qe, [
|
|
855
855
|
O.value ? (M(), j("span", Je, C(k(c)("chatFilePreview.pageOf", {
|
|
856
|
-
page:
|
|
857
|
-
count:
|
|
856
|
+
page: _e.value + 1,
|
|
857
|
+
count: z.value.length
|
|
858
858
|
})), 1)) : D("", !0),
|
|
859
|
-
v("span", Ye, C(k(c)("chatFilePreview.words",
|
|
859
|
+
v("span", Ye, C(k(c)("chatFilePreview.words", we.value)), 1),
|
|
860
860
|
e.mode === "markup" && e.preview.revisionAuthors.length ? (M(), j("span", Xe, [
|
|
861
861
|
v("span", {
|
|
862
862
|
class: "pk-word-preview__legend-text",
|
|
863
|
-
title: k(c)("chatFilePreview.revisionsOf", { authors:
|
|
864
|
-
}, C(k(c)("chatFilePreview.revisionsOf", { authors:
|
|
863
|
+
title: k(c)("chatFilePreview.revisionsOf", { authors: q.value })
|
|
864
|
+
}, C(k(c)("chatFilePreview.revisionsOf", { authors: q.value })), 9, Ze),
|
|
865
865
|
v("del", Qe, C(k(c)("chatFilePreview.removed")), 1),
|
|
866
866
|
v("ins", $e, C(k(c)("chatFilePreview.added")), 1)
|
|
867
867
|
])) : D("", !0),
|
|
868
868
|
n[6] ||= v("span", { class: "pk-word-preview__spacer" }, null, -1),
|
|
869
|
-
!A.value && (
|
|
869
|
+
!A.value && (H.value.length || U.value.length) ? (M(), h(i, {
|
|
870
870
|
key: 2,
|
|
871
871
|
class: "pk-word-preview__outline-toggle",
|
|
872
872
|
modifiers: "action-quiet",
|
|
@@ -874,8 +874,8 @@ var $ = ["aria-label"], je = {
|
|
|
874
874
|
label: k(c)("chatFilePreview.outline"),
|
|
875
875
|
title: k(c)("chatFilePreview.outline"),
|
|
876
876
|
"aria-label": k(c)("chatFilePreview.outline"),
|
|
877
|
-
"aria-expanded":
|
|
878
|
-
onClick: n[2] ||= (e) =>
|
|
877
|
+
"aria-expanded": G.value,
|
|
878
|
+
onClick: n[2] ||= (e) => G.value = !G.value
|
|
879
879
|
}, null, 8, [
|
|
880
880
|
"label",
|
|
881
881
|
"title",
|
|
@@ -886,23 +886,23 @@ var $ = ["aria-label"], je = {
|
|
|
886
886
|
d(i, {
|
|
887
887
|
modifiers: "action-quiet",
|
|
888
888
|
label: k(c)("chatFilePreview.fitWidth"),
|
|
889
|
-
disabled:
|
|
890
|
-
onClick: n[3] ||= (e) =>
|
|
889
|
+
disabled: B.value,
|
|
890
|
+
onClick: n[3] ||= (e) => B.value = !0
|
|
891
891
|
}, null, 8, ["label", "disabled"]),
|
|
892
892
|
d(i, {
|
|
893
893
|
modifiers: "action-quiet",
|
|
894
894
|
icon: "ri:subtract-line",
|
|
895
895
|
"aria-label": k(c)("chatFilePreview.zoomOut"),
|
|
896
|
-
disabled:
|
|
897
|
-
onClick: n[4] ||= (e) =>
|
|
896
|
+
disabled: V.value <= .3,
|
|
897
|
+
onClick: n[4] ||= (e) => ge(-.1)
|
|
898
898
|
}, null, 8, ["aria-label", "disabled"]),
|
|
899
|
-
v("span", et, C(Math.round(
|
|
899
|
+
v("span", et, C(Math.round(V.value * 100)) + "% ", 1),
|
|
900
900
|
d(i, {
|
|
901
901
|
modifiers: "action-quiet",
|
|
902
902
|
icon: "ri:add-line",
|
|
903
903
|
"aria-label": k(c)("chatFilePreview.zoomIn"),
|
|
904
|
-
disabled:
|
|
905
|
-
onClick: n[5] ||= (e) =>
|
|
904
|
+
disabled: V.value >= 2,
|
|
905
|
+
onClick: n[5] ||= (e) => ge(.1)
|
|
906
906
|
}, null, 8, ["aria-label", "disabled"])
|
|
907
907
|
], 64)) : D("", !0)
|
|
908
908
|
])]),
|
|
@@ -912,7 +912,7 @@ var $ = ["aria-label"], je = {
|
|
|
912
912
|
ref: w,
|
|
913
913
|
class: "pk-word-preview__measure",
|
|
914
914
|
"aria-hidden": "true",
|
|
915
|
-
style: l(
|
|
915
|
+
style: l(le.value)
|
|
916
916
|
}, [(M(!0), j(_, null, p(g.value, (t) => (M(), j("div", {
|
|
917
917
|
key: t.key,
|
|
918
918
|
"data-item": ""
|
|
@@ -920,7 +920,7 @@ var $ = ["aria-label"], je = {
|
|
|
920
920
|
block: e.preview.blocks[t.block],
|
|
921
921
|
row: t.row,
|
|
922
922
|
mode: e.mode,
|
|
923
|
-
page:
|
|
923
|
+
page: I.value
|
|
924
924
|
}, null, 8, [
|
|
925
925
|
"block",
|
|
926
926
|
"row",
|
|
@@ -929,12 +929,12 @@ var $ = ["aria-label"], je = {
|
|
|
929
929
|
])]))), 128)), (M(!0), j(_, null, p(e.preview.parts, (t, n) => (M(), j("div", {
|
|
930
930
|
key: n,
|
|
931
931
|
"data-part": n
|
|
932
|
-
}, [(M(!0), j(_, null, p(k(
|
|
932
|
+
}, [(M(!0), j(_, null, p(k(P)(t, e.mode), (n) => (M(), h(Q, {
|
|
933
933
|
key: n.key,
|
|
934
934
|
block: t[n.block],
|
|
935
935
|
row: n.row,
|
|
936
936
|
mode: e.mode,
|
|
937
|
-
page:
|
|
937
|
+
page: I.value
|
|
938
938
|
}, null, 8, [
|
|
939
939
|
"block",
|
|
940
940
|
"row",
|
|
@@ -1014,7 +1014,7 @@ var it = ["aria-label"], at = { class: "pk-file-preview__head" }, ot = { class:
|
|
|
1014
1014
|
return u(() => n.version, () => {
|
|
1015
1015
|
m.value = "markup";
|
|
1016
1016
|
}), (t, n) => {
|
|
1017
|
-
let o =
|
|
1017
|
+
let o = I, c = ce;
|
|
1018
1018
|
return M(), j("section", {
|
|
1019
1019
|
class: "pk-file-preview",
|
|
1020
1020
|
"aria-label": e.filename,
|
|
@@ -1048,7 +1048,7 @@ var it = ["aria-label"], at = { class: "pk-file-preview__head" }, ot = { class:
|
|
|
1048
1048
|
disabled: !f.value,
|
|
1049
1049
|
onClick: n[1] ||= (e) => f.value && i("version", f.value)
|
|
1050
1050
|
}, null, 8, ["aria-label", "disabled"])
|
|
1051
|
-
], 8, ft)) : D("", !0), w.value ? (M(), h(
|
|
1051
|
+
], 8, ft)) : D("", !0), w.value ? (M(), h(le, {
|
|
1052
1052
|
key: 1,
|
|
1053
1053
|
modelValue: m.value,
|
|
1054
1054
|
"onUpdate:modelValue": n[2] ||= (e) => m.value = e,
|
|
@@ -1124,7 +1124,7 @@ var it = ["aria-label"], at = { class: "pk-file-preview__head" }, ot = { class:
|
|
|
1124
1124
|
"fit",
|
|
1125
1125
|
"preview",
|
|
1126
1126
|
"mode"
|
|
1127
|
-
])) : (M(), h(
|
|
1127
|
+
])) : (M(), h(K, {
|
|
1128
1128
|
key: 3,
|
|
1129
1129
|
sheet: g.value,
|
|
1130
1130
|
"onUpdate:sheet": n[9] ||= (e) => g.value = e,
|
|
@@ -1138,7 +1138,7 @@ var it = ["aria-label"], at = { class: "pk-file-preview__head" }, ot = { class:
|
|
|
1138
1138
|
]))])], 8, it);
|
|
1139
1139
|
};
|
|
1140
1140
|
}
|
|
1141
|
-
}), xt = ".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;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}", St = /* @__PURE__ */ e({ default: () => Ct }), Ct = /*#__PURE__*/
|
|
1141
|
+
}), xt = ".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;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}", St = /* @__PURE__ */ e({ default: () => Ct }), Ct = /*#__PURE__*/ L(bt, [["styles", [xt]]]);
|
|
1142
1142
|
export { St as n, Ct as t };
|
|
1143
1143
|
|
|
1144
|
-
//# sourceMappingURL=PkFilePreview-
|
|
1144
|
+
//# sourceMappingURL=PkFilePreview-CC2W-RXG.js.map
|