@8wave/ai-elements 0.125.0-beta.34 → 0.125.0-beta.36
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-CnCu6gNx.js → Agent-D9MWMkLp.js} +15 -11
- package/dist/_chunks/Agent-D9MWMkLp.js.map +1 -0
- package/dist/_chunks/{PkFilePreview-Ctp30WJH.js → PkFilePreview-Bic0SA47.js} +524 -450
- package/dist/_chunks/PkFilePreview-Bic0SA47.js.map +1 -0
- package/dist/_chunks/{PkFilePreviewDialog-B8JKpCXy.js → PkFilePreviewDialog-WKJ0Zm3O.js} +2 -2
- package/dist/_chunks/{PkFilePreviewDialog-B8JKpCXy.js.map → PkFilePreviewDialog-WKJ0Zm3O.js.map} +1 -1
- package/dist/_chunks/{PkSelectionActions-BOuC5Dvy.js → PkSelectionActions-mna8QQGY.js} +66 -56
- package/dist/_chunks/PkSelectionActions-mna8QQGY.js.map +1 -0
- package/dist/_chunks/{PkStreamingMarkdown-B0iGNA8Y.js → PkStreamingMarkdown-DKTxy47I.js} +3 -3
- package/dist/_chunks/{PkStreamingMarkdown-B0iGNA8Y.js.map → PkStreamingMarkdown-DKTxy47I.js.map} +1 -1
- package/dist/_chunks/{PkToolChatFile-DbmXl92B.js → PkToolChatFile-CTBwDxvV.js} +3 -3
- package/dist/_chunks/{PkToolChatFile-DbmXl92B.js.map → PkToolChatFile-CTBwDxvV.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestGeolocation-DqrwL2xq.js → PkToolRequestGeolocation-XmQTnuwg.js} +2 -2
- package/dist/_chunks/{PkToolRequestGeolocation-DqrwL2xq.js.map → PkToolRequestGeolocation-XmQTnuwg.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestOAuthConnection-CRHMFsVo.js → PkToolRequestOAuthConnection-BSKa66Nf.js} +2 -2
- package/dist/_chunks/{PkToolRequestOAuthConnection-CRHMFsVo.js.map → PkToolRequestOAuthConnection-BSKa66Nf.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-BiIFmeNh.js → PkToolShowArtifact-C27hZNJd.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-BiIFmeNh.js.map → PkToolShowArtifact-C27hZNJd.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-CNLEoesy.js → PkToolShowContactForm-VVgxhvQd.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-CNLEoesy.js.map → PkToolShowContactForm-VVgxhvQd.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-DSUzABRs.js → PkToolShowForm-C4t_v1ps.js} +4 -4
- package/dist/_chunks/{PkToolShowForm-DSUzABRs.js.map → PkToolShowForm-C4t_v1ps.js.map} +1 -1
- package/dist/_chunks/{PkToolShowImageGallery-CuSEzHyb.js → PkToolShowImageGallery-y3iOOanc.js} +2 -2
- package/dist/_chunks/{PkToolShowImageGallery-CuSEzHyb.js.map → PkToolShowImageGallery-y3iOOanc.js.map} +1 -1
- package/dist/_chunks/{PkToolShowProductList-BHV90ovg.js → PkToolShowProductList-CTB2wcrz.js} +2 -2
- package/dist/_chunks/{PkToolShowProductList-BHV90ovg.js.map → PkToolShowProductList-CTB2wcrz.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-LxKdEl5a.js → PkToolShowSources-Byv7DkHR.js} +3 -3
- package/dist/_chunks/{PkToolShowSources-LxKdEl5a.js.map → PkToolShowSources-Byv7DkHR.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSuggestedReply-DQ64E-n3.js → PkToolShowSuggestedReply-D8FQu6Pd.js} +2 -2
- package/dist/_chunks/{PkToolShowSuggestedReply-DQ64E-n3.js.map → PkToolShowSuggestedReply-D8FQu6Pd.js.map} +1 -1
- package/dist/_chunks/{PkToolShowVideo-m9TYCZU4.js → PkToolShowVideo-B8Ql2lYD.js} +2 -2
- package/dist/_chunks/{PkToolShowVideo-m9TYCZU4.js.map → PkToolShowVideo-B8Ql2lYD.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWebPages-D836KB_D.js → PkToolShowWebPages-CR-eQrdv.js} +2 -2
- package/dist/_chunks/{PkToolShowWebPages-D836KB_D.js.map → PkToolShowWebPages-CR-eQrdv.js.map} +1 -1
- package/dist/_chunks/{chatImagePolicy-DMvnRaBQ.js → chatImagePolicy-XBxAhi8o.js} +2 -2
- package/dist/_chunks/{chatImagePolicy-DMvnRaBQ.js.map → chatImagePolicy-XBxAhi8o.js.map} +1 -1
- package/dist/_chunks/{markdown-BLSDivef.js → markdown-DGKSBppG.js} +2 -2
- package/dist/_chunks/{markdown-BLSDivef.js.map → markdown-DGKSBppG.js.map} +1 -1
- package/dist/_chunks/{utils-BF9VwhRy.js → utils-DYtnrtNk.js} +2 -2
- package/dist/_chunks/{utils-BF9VwhRy.js.map → utils-DYtnrtNk.js.map} +1 -1
- package/dist/ai-elements.es.js +39 -33
- 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-DuB5Hh7M.js → Agent-hvrlDtLK.js} +15 -11
- package/dist-vue/_chunks/Agent-hvrlDtLK.js.map +1 -0
- package/dist-vue/_chunks/{Document-BJxoQzKV.js → Document-DXSWegFn.js} +2 -2
- package/dist-vue/_chunks/{Document-BJxoQzKV.js.map → Document-DXSWegFn.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbot-CXW3IFfs.js → PkChatbot-BtJsIn4h.js} +8 -8
- package/dist-vue/_chunks/{PkChatbot-CXW3IFfs.js.map → PkChatbot-BtJsIn4h.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotEmptyState-CD6ehXRE.js → PkChatbotEmptyState-BYrTqidA.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-CD6ehXRE.js.map → PkChatbotEmptyState-BYrTqidA.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotInput-2zUenuUE.js → PkChatbotInput-Cwkz19oM.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotInput-2zUenuUE.js.map → PkChatbotInput-Cwkz19oM.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotMessages-DbgmLmbz.js → PkChatbotMessages-Bmrvz0Nv.js} +17 -17
- package/dist-vue/_chunks/{PkChatbotMessages-DbgmLmbz.js.map → PkChatbotMessages-Bmrvz0Nv.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepPayload-CkTJ1nFP.js → PkChatbotStepPayload-C4yEGoXA.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-CkTJ1nFP.js.map → PkChatbotStepPayload-C4yEGoXA.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-DBi87nYU.js → PkChatbotStepToolDetail-DnGYrFSt.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-DBi87nYU.js.map → PkChatbotStepToolDetail-DnGYrFSt.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotSteps-BC2gLvzh.js → PkChatbotSteps-CoP1JyWG.js} +5 -5
- package/dist-vue/_chunks/{PkChatbotSteps-BC2gLvzh.js.map → PkChatbotSteps-CoP1JyWG.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-9BKIdCDD.js → PkChatbotViewChat-B14w_WuO.js} +7 -7
- package/dist-vue/_chunks/{PkChatbotViewChat-9BKIdCDD.js.map → PkChatbotViewChat-B14w_WuO.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewConversations-BWj_CaXs.js → PkChatbotViewConversations-oYUIHDwb.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewConversations-BWj_CaXs.js.map → PkChatbotViewConversations-oYUIHDwb.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-9kcgLUrQ.js → PkChatbotViewFiles-C1ggPJvX.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewFiles-9kcgLUrQ.js.map → PkChatbotViewFiles-C1ggPJvX.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-CJR38-Zw.js → PkChatbotViewProfile-BZJ8OZ9h.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-CJR38-Zw.js.map → PkChatbotViewProfile-BZJ8OZ9h.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreview-CmET6sdA.js → PkFilePreview-CTsoIgC0.js} +516 -432
- package/dist-vue/_chunks/PkFilePreview-CTsoIgC0.js.map +1 -0
- package/dist-vue/_chunks/{PkFilePreviewDialog-CqQBzL5n.js → PkFilePreviewDialog-DbTpN0hb.js} +2 -2
- package/dist-vue/_chunks/{PkFilePreviewDialog-CqQBzL5n.js.map → PkFilePreviewDialog-DbTpN0hb.js.map} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-Db4sGE5U.js → PkStreamingMarkdown-BiS7Huii.js} +3 -3
- package/dist-vue/_chunks/{PkStreamingMarkdown-Db4sGE5U.js.map → PkStreamingMarkdown-BiS7Huii.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolChatFile-CuilyyQV.js → PkToolChatFile-DJouw7ft.js} +3 -3
- package/dist-vue/_chunks/{PkToolChatFile-CuilyyQV.js.map → PkToolChatFile-DJouw7ft.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestGeolocation-DBjweLxM.js → PkToolRequestGeolocation-Du8b17X9.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestGeolocation-DBjweLxM.js.map → PkToolRequestGeolocation-Du8b17X9.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-C3RPmvS9.js → PkToolRequestOAuthConnection-X00hZZJe.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-C3RPmvS9.js.map → PkToolRequestOAuthConnection-X00hZZJe.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-BPM1M44f.js → PkToolShowArtifact-BAfGUGM4.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-BPM1M44f.js.map → PkToolShowArtifact-BAfGUGM4.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-B3Um_vEc.js → PkToolShowContactForm-BEWOoCVa.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-B3Um_vEc.js.map → PkToolShowContactForm-BEWOoCVa.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-BDyGph2_.js → PkToolShowDiagram-CgOAGQCq.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-BDyGph2_.js.map → PkToolShowDiagram-CgOAGQCq.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-D14J_UP1.js → PkToolShowForm-BXpPnVzJ.js} +4 -4
- package/dist-vue/_chunks/{PkToolShowForm-D14J_UP1.js.map → PkToolShowForm-BXpPnVzJ.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-BVrAQqq5.js → PkToolShowImageGallery-DOsnvy1W.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowImageGallery-BVrAQqq5.js.map → PkToolShowImageGallery-DOsnvy1W.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-DkDNFoIh.js → PkToolShowProductList-Buw-GpNJ.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-DkDNFoIh.js.map → PkToolShowProductList-Buw-GpNJ.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-BIsZaSr3.js → PkToolShowSources-CPvjMvqB.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowSources-BIsZaSr3.js.map → PkToolShowSources-CPvjMvqB.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-qbQz8Ia2.js → PkToolShowSuggestedReply-HLFecN53.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-qbQz8Ia2.js.map → PkToolShowSuggestedReply-HLFecN53.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-BursN2E9.js → PkToolShowVideo-DPZtAuLl.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowVideo-BursN2E9.js.map → PkToolShowVideo-DPZtAuLl.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-C2QqzOZx.js → PkToolShowWebPages-DXjDxztJ.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-C2QqzOZx.js.map → PkToolShowWebPages-DXjDxztJ.js.map} +1 -1
- package/dist-vue/_chunks/{createChatbotApiClient-CWQKS07V.js → createChatbotApiClient-CWLca1yc.js} +2 -2
- package/dist-vue/_chunks/{createChatbotApiClient-CWQKS07V.js.map → createChatbotApiClient-CWLca1yc.js.map} +1 -1
- package/dist-vue/_chunks/{useChatbotStore-qgCC4aIL.js → useChatbotStore-CNQ8lTub.js} +3 -3
- package/dist-vue/_chunks/{useChatbotStore-qgCC4aIL.js.map → useChatbotStore-CNQ8lTub.js.map} +1 -1
- package/dist-vue/_chunks/{utils-BcFZVBxd.js → utils-Dqyng-2B.js} +2 -2
- package/dist-vue/_chunks/{utils-BcFZVBxd.js.map → utils-Dqyng-2B.js.map} +1 -1
- package/dist-vue/api.js +1 -1
- package/dist-vue/apps/web-component/src/components/EmbeddedChatWidget.ce.d.ts +4 -4
- package/dist-vue/composables.js +12 -12
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +2917 -2897
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +6 -6
- package/dist-vue/packages/components/src/chat/PkAgentSelectionActionsSettings.d.ts +6 -0
- package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +42 -2
- package/dist-vue/packages/composable/src/useSettledSelection.d.ts +13 -4
- package/dist-vue/packages/models/src/schema/Agent.d.ts +1 -1
- package/dist-vue/packages/models/src/schema/AgentChatStatistics.d.ts +27 -0
- package/dist-vue/packages/models/src/schema/CostReport.d.ts +40 -0
- package/dist-vue/packages/models/src/schema/SelectionAction.d.ts +5 -2
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/Agent-CnCu6gNx.js.map +0 -1
- package/dist/_chunks/PkFilePreview-Ctp30WJH.js.map +0 -1
- package/dist/_chunks/PkSelectionActions-BOuC5Dvy.js.map +0 -1
- package/dist-vue/_chunks/Agent-DuB5Hh7M.js.map +0 -1
- package/dist-vue/_chunks/PkFilePreview-CmET6sdA.js.map +0 -1
|
@@ -2,15 +2,18 @@ import { t as e } from "./rolldown-runtime-CGnMp29N.js";
|
|
|
2
2
|
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
|
-
import { G as o, H as s, J as c, K as l, U as u, W as d, Y as f, o as p, q as m, z as h } from "./utils-
|
|
6
|
-
import { r as ee } from "./PkChatbotViewChat-
|
|
5
|
+
import { G as o, H as s, J as c, K as l, U as u, W as d, Y as f, o as p, q as m, z as h } from "./utils-Dqyng-2B.js";
|
|
6
|
+
import { r as ee } from "./PkChatbotViewChat-B14w_WuO.js";
|
|
7
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 D, mergeModels as O, nextTick as te, normalizeClass as k, normalizeStyle as A, onBeforeUnmount as
|
|
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 D, mergeModels as O, nextTick as te, normalizeClass as k, normalizeStyle as A, onBeforeUnmount as ne, 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 z, vModelText as B, watch as V, withCtx as H, withDirectives as ae, withKeys as oe, withModifiers as U } from "vue";
|
|
9
9
|
import { useI18n as se } from "vue-i18n";
|
|
10
|
-
import { useElementSize as ce, useEventListener as
|
|
10
|
+
import { useElementSize as ce, useEventListener as W } from "@vueuse/core";
|
|
11
11
|
// ../../packages/composable/src/useSettledSelection.ts
|
|
12
|
-
var
|
|
13
|
-
function
|
|
12
|
+
var le = "(hover: hover) and (pointer: fine)", G = "(hover: none) and (pointer: coarse)", ue = 400;
|
|
13
|
+
function K() {
|
|
14
|
+
return typeof matchMedia == "function" && matchMedia(G).matches;
|
|
15
|
+
}
|
|
16
|
+
function de(e) {
|
|
14
17
|
let t = document.getSelection();
|
|
15
18
|
if (!t || t.rangeCount === 0) return;
|
|
16
19
|
if (e.nodeType === Node.DOCUMENT_NODE) return t.getRangeAt(0).cloneRange();
|
|
@@ -30,13 +33,13 @@ function ue(e) {
|
|
|
30
33
|
let r = n.getSelection?.();
|
|
31
34
|
return r && r.rangeCount > 0 ? r.getRangeAt(0).cloneRange() : void 0;
|
|
32
35
|
}
|
|
33
|
-
function
|
|
34
|
-
let
|
|
35
|
-
clearTimeout(
|
|
36
|
-
},
|
|
36
|
+
function fe({ root: e, enabled: t = () => !0, delay: n = 150, minChars: r = 2, touch: i = !1 }) {
|
|
37
|
+
let a = F(), o, s = () => {
|
|
38
|
+
clearTimeout(o), a.value = void 0;
|
|
39
|
+
}, c = () => {
|
|
37
40
|
let n = e();
|
|
38
41
|
if (!n || !t()) return;
|
|
39
|
-
let i =
|
|
42
|
+
let i = de(n);
|
|
40
43
|
if (!i || i.collapsed || i.toString().trim().length < r) return;
|
|
41
44
|
let a = i.getBoundingClientRect();
|
|
42
45
|
return {
|
|
@@ -44,40 +47,40 @@ function de({ root: e, enabled: t = () => !0, delay: n = 150, minChars: r = 2 })
|
|
|
44
47
|
start: i.getClientRects()[0] ?? a,
|
|
45
48
|
box: a
|
|
46
49
|
};
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
},
|
|
50
|
+
}, l = typeof document < "u" && typeof matchMedia == "function" && matchMedia(le).matches, u = i && typeof document < "u" && K(), d = u ? Math.max(n, ue) : n, f = () => {
|
|
51
|
+
s(), o = setTimeout(() => {
|
|
52
|
+
a.value = c();
|
|
53
|
+
}, d);
|
|
51
54
|
};
|
|
52
|
-
return
|
|
53
|
-
clearTimeout(
|
|
55
|
+
return (l || u) && (document.addEventListener("selectionchange", f), j(() => {
|
|
56
|
+
clearTimeout(o), document.removeEventListener("selectionchange", f);
|
|
54
57
|
})), {
|
|
55
|
-
selection:
|
|
56
|
-
clear:
|
|
58
|
+
selection: a,
|
|
59
|
+
clear: s
|
|
57
60
|
};
|
|
58
61
|
}
|
|
59
62
|
// ../../packages/components/src/chat/fileSelection.ts
|
|
60
|
-
var
|
|
61
|
-
let t = [...new Set(e)].sort((e, t) =>
|
|
63
|
+
var pe = 2e3, q = 1e3, me = 60, he = 1400, ge = 20, _e = 100, ve = (e) => Number(e.slice(1)), ye = (e) => {
|
|
64
|
+
let t = [...new Set(e)].sort((e, t) => ve(e) - ve(t)), n = [];
|
|
62
65
|
for (let e of t) {
|
|
63
66
|
let t = n[n.length - 1];
|
|
64
|
-
t &&
|
|
67
|
+
t && ve(e) === ve(t.to) + 1 ? t.to = e : n.push({
|
|
65
68
|
from: e,
|
|
66
69
|
to: e
|
|
67
70
|
});
|
|
68
71
|
}
|
|
69
72
|
return n.slice(0, 100);
|
|
70
|
-
},
|
|
73
|
+
}, be = (e, t) => {
|
|
71
74
|
let n = [];
|
|
72
75
|
if (!t) return n;
|
|
73
76
|
for (let r = e.indexOf(t); r >= 0; r = e.indexOf(t, r + 1)) n.push(r);
|
|
74
77
|
return n;
|
|
75
|
-
},
|
|
76
|
-
let r =
|
|
78
|
+
}, xe = (e, t, n) => {
|
|
79
|
+
let r = be(e, e.slice(t, t + n));
|
|
77
80
|
if (r.length < 2) return {};
|
|
78
81
|
let i = t, a = t + n;
|
|
79
|
-
for (let t = !0; a - i <=
|
|
80
|
-
if (
|
|
82
|
+
for (let t = !0; a - i <= he; t = !t) {
|
|
83
|
+
if (be(e, e.slice(i, a)).length === 1) return { find: e.slice(i, a) };
|
|
81
84
|
if (t && i > 0) i = e.slice(0, i).replace(/\S*\s*$/, "").length;
|
|
82
85
|
else if (a < e.length) {
|
|
83
86
|
let t = e.slice(a).match(/^\s*\S*/)?.[0] ?? "";
|
|
@@ -88,18 +91,23 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
88
91
|
index: r.indexOf(t) + 1 || 1,
|
|
89
92
|
of: r.length
|
|
90
93
|
} };
|
|
91
|
-
},
|
|
94
|
+
}, Se = (e) => (e.querySelectorAll("[data-quote-skip]").forEach((e) => e.remove()), e.querySelectorAll("[data-paragraph]").forEach((e) => e.append("\n")), e.textContent ?? ""), Ce = (e) => e.length > q ? `${e.slice(0, q / 2)} […] ${e.slice(-500)}` : e, we = (e) => {
|
|
95
|
+
let t = e.startContainer.getRootNode().getSelection?.() ?? document.getSelection();
|
|
96
|
+
try {
|
|
97
|
+
t?.setBaseAndExtent(e.startContainer, e.startOffset, e.endContainer, e.endOffset);
|
|
98
|
+
} catch {}
|
|
99
|
+
}, Te = (e, t, n) => {
|
|
92
100
|
let r = t.commonAncestorContainer;
|
|
93
101
|
if (!e.contains(r) || (r instanceof Element ? r : r.parentElement)?.closest("[data-quote-skip]")) return;
|
|
94
102
|
let i = [...e.querySelectorAll("[data-paragraph]")].filter((e) => !e.closest(n) && t.intersectsNode(e));
|
|
95
103
|
if (!i.length) return;
|
|
96
|
-
let a = i.flatMap((e) => e.dataset.paragraph.split(" ")), o =
|
|
104
|
+
let a = i.flatMap((e) => e.dataset.paragraph.split(" ")), o = Se(t.cloneContents()), s = o.trim();
|
|
97
105
|
if (s.length < 2) return;
|
|
98
106
|
let c = {
|
|
99
107
|
format: "docx",
|
|
100
|
-
runs:
|
|
108
|
+
runs: ye(a),
|
|
101
109
|
paragraphCount: new Set(a).size,
|
|
102
|
-
quote:
|
|
110
|
+
quote: Ce(s),
|
|
103
111
|
measure: () => {
|
|
104
112
|
let e = t.getBoundingClientRect(), n = t.getClientRects()[0] ?? e;
|
|
105
113
|
return {
|
|
@@ -110,25 +118,22 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
110
118
|
bottom: e.bottom
|
|
111
119
|
};
|
|
112
120
|
},
|
|
113
|
-
restore: () =>
|
|
114
|
-
let e = document.getSelection();
|
|
115
|
-
e?.removeAllRanges(), e?.addRange(t.cloneRange());
|
|
116
|
-
}
|
|
121
|
+
restore: () => we(t)
|
|
117
122
|
};
|
|
118
123
|
if (i.length === 1) {
|
|
119
124
|
let e = i[0], n = document.createRange();
|
|
120
125
|
n.selectNodeContents(e);
|
|
121
|
-
let r =
|
|
126
|
+
let r = Se(n.cloneContents()).replace(/\n$/, ""), a = document.createRange();
|
|
122
127
|
a.setStart(e, 0), a.setEnd(t.startContainer, t.startOffset);
|
|
123
|
-
let l =
|
|
124
|
-
c.before = r.slice(Math.max(0, l -
|
|
128
|
+
let l = Se(a.cloneContents()).length + (o.length - o.trimStart().length);
|
|
129
|
+
c.before = r.slice(Math.max(0, l - me), l), c.after = r.slice(l + s.length, l + s.length + me), Object.assign(c, xe(r, l, s.length));
|
|
125
130
|
}
|
|
126
131
|
return c;
|
|
127
|
-
},
|
|
132
|
+
}, Ee = (e) => {
|
|
128
133
|
let t = "";
|
|
129
134
|
for (let n = e; n > 0; n = Math.floor((n - 1) / 26)) t = String.fromCharCode(65 + (n - 1) % 26) + t;
|
|
130
135
|
return t;
|
|
131
|
-
},
|
|
136
|
+
}, De = (e, t) => {
|
|
132
137
|
let n = { ...t }, r = e.rows.flatMap((e) => e.cells.filter((e) => e.span).map((t) => ({
|
|
133
138
|
r1: e.row,
|
|
134
139
|
r2: e.row + t.span.rows - 1,
|
|
@@ -139,7 +144,7 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
139
144
|
e = !1;
|
|
140
145
|
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);
|
|
141
146
|
}
|
|
142
|
-
let i = `${
|
|
147
|
+
let i = `${Ee(n.c1)}${n.r1}`, a = `${Ee(n.c2)}${n.r2}`, o = (e.hiddenRows ?? []).filter((e) => e >= n.r1 && e <= n.r2).slice(0, _e), s = e.columns.filter((e) => e.hidden && e.col >= n.c1 && e.col <= n.c2).map((e) => Ee(e.col)).slice(0, _e), 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, ge).map((e) => String(e.value)).join("; ").slice(0, 500);
|
|
143
148
|
return {
|
|
144
149
|
format: "xlsx",
|
|
145
150
|
sheet: e.name,
|
|
@@ -149,10 +154,10 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
149
154
|
...s.length ? { hiddenColumns: s } : {},
|
|
150
155
|
...c ? { sample: c } : {}
|
|
151
156
|
};
|
|
152
|
-
},
|
|
157
|
+
}, Oe = ["placeholder", "aria-label"], J = ["disabled"], ke = ["aria-label"], Y = { class: "pk-selection-actions__text" }, X = {
|
|
153
158
|
key: 0,
|
|
154
159
|
class: "pk-selection-actions__text"
|
|
155
|
-
}, Z = ["onClick"],
|
|
160
|
+
}, Z = ["onClick", "onTouchend"], Ae = "ri:sparkling-line", je = /* @__PURE__ */ T({
|
|
156
161
|
__name: "PkSelectionActions",
|
|
157
162
|
props: /*@__PURE__*/ O({
|
|
158
163
|
actions: {},
|
|
@@ -184,31 +189,34 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
184
189
|
proofread: "ri:check-double-line",
|
|
185
190
|
translate: "ri:translate-2",
|
|
186
191
|
chart: "ri:bar-chart-2-line"
|
|
187
|
-
}, r = e, i = t, a =
|
|
192
|
+
}, r = e, i = t, a = R(e, "asking"), { t: o } = se({ useScope: "global" }), s = z("barEl"), c = z("inputEl"), { width: l, height: u } = ce(s, void 0, { box: "border-box" }), d = v(() => h({
|
|
188
193
|
...r.anchor,
|
|
189
194
|
bar: {
|
|
190
195
|
width: l.value,
|
|
191
196
|
height: u.value
|
|
192
197
|
},
|
|
193
198
|
touch: r.touch
|
|
194
|
-
})), f =
|
|
199
|
+
})), f = N(), p = N(""), m = async (e, t) => {
|
|
195
200
|
f.value = {
|
|
196
201
|
id: e,
|
|
197
202
|
placeholder: t
|
|
198
203
|
}, p.value = "", a.value = !0, await te(), c.value?.focus();
|
|
199
204
|
}, ee = () => {
|
|
200
205
|
f.value = void 0, a.value = !1;
|
|
201
|
-
}, y = (e) => n[e.id] ??
|
|
206
|
+
}, y = () => m(void 0, o("selectionActions.askPlaceholder")), T = (e) => n[e.id] ?? Ae, E = (e) => {
|
|
202
207
|
e.asks ? m(e.id, e.asks) : i("action", e.id);
|
|
203
|
-
},
|
|
208
|
+
}, D = (e, t) => {
|
|
209
|
+
let n = e.currentTarget, r = e.changedTouches[0], i = n.getRootNode(), a = r && i.elementFromPoint(r.clientX, r.clientY);
|
|
210
|
+
a && n.contains(a) && t();
|
|
211
|
+
}, O = () => {
|
|
204
212
|
let e = p.value.trim();
|
|
205
213
|
e && f.value && (f.value.id ? i("action", f.value.id, e) : i("ask", e), ee());
|
|
206
|
-
},
|
|
207
|
-
f.value ? ee() : i("close");
|
|
214
|
+
}, ne = (e) => {
|
|
215
|
+
e.isComposing || (e.stopPropagation(), e.preventDefault(), f.value ? ee() : i("close"));
|
|
208
216
|
};
|
|
209
217
|
return (t, n) => {
|
|
210
218
|
let r = g;
|
|
211
|
-
return
|
|
219
|
+
return M(), x("div", {
|
|
212
220
|
class: k(["pk-selection-actions", {
|
|
213
221
|
"pk-selection-actions--fixed": e.strategy === "fixed",
|
|
214
222
|
"pk-selection-actions--asking": !!f.value
|
|
@@ -217,13 +225,13 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
217
225
|
top: `${d.value.top}px`,
|
|
218
226
|
left: `${d.value.left}px`
|
|
219
227
|
}),
|
|
220
|
-
onKeydown:
|
|
221
|
-
}, [f.value ? (
|
|
228
|
+
onKeydown: oe(ne, ["esc"])
|
|
229
|
+
}, [f.value ? (M(), x("form", {
|
|
222
230
|
key: 0,
|
|
223
231
|
ref_key: "barEl",
|
|
224
232
|
ref: s,
|
|
225
233
|
class: "pk-selection-actions__menu pk-selection-actions__menu--field",
|
|
226
|
-
onSubmit:
|
|
234
|
+
onSubmit: U(O, ["prevent"])
|
|
227
235
|
}, [ae(S("input", {
|
|
228
236
|
ref_key: "inputEl",
|
|
229
237
|
ref: c,
|
|
@@ -233,69 +241,74 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
233
241
|
maxlength: "500",
|
|
234
242
|
placeholder: f.value.placeholder,
|
|
235
243
|
"aria-label": f.value.placeholder
|
|
236
|
-
}, null, 8,
|
|
244
|
+
}, null, 8, Oe), [[B, p.value]]), S("button", {
|
|
237
245
|
type: "submit",
|
|
238
246
|
class: "pk-selection-actions__button pk-selection-actions__button--send",
|
|
239
247
|
disabled: !p.value.trim()
|
|
240
|
-
}, L(
|
|
248
|
+
}, I(L(o)("action.send")), 9, J)], 544)) : (M(), x("div", {
|
|
241
249
|
key: 1,
|
|
242
250
|
ref_key: "barEl",
|
|
243
251
|
ref: s,
|
|
244
252
|
class: "pk-selection-actions__menu",
|
|
245
253
|
role: "toolbar",
|
|
246
254
|
"aria-orientation": "vertical",
|
|
247
|
-
"aria-label":
|
|
248
|
-
|
|
255
|
+
"aria-label": L(o)("selectionActions.label"),
|
|
256
|
+
onTouchstart: n[7] ||= U(() => {}, ["prevent"])
|
|
257
|
+
}, [e.note ? (M(), x(_, { key: 0 }, [S("p", Y, I(e.note), 1), e.noteAction ? (M(), x("button", {
|
|
249
258
|
key: 0,
|
|
250
259
|
type: "button",
|
|
251
260
|
class: "pk-selection-actions__button",
|
|
252
|
-
onMousedown: n[1] ||=
|
|
253
|
-
onClick: n[2] ||= (e) => i("note")
|
|
261
|
+
onMousedown: n[1] ||= U(() => {}, ["prevent"]),
|
|
262
|
+
onClick: n[2] ||= (e) => i("note"),
|
|
263
|
+
onTouchend: n[3] ||= (e) => D(e, () => i("note"))
|
|
254
264
|
}, [w(r, {
|
|
255
265
|
name: "ri:arrow-right-line",
|
|
256
266
|
class: "pk-selection-actions__icon"
|
|
257
|
-
}), C(" " +
|
|
258
|
-
e.hint ? (
|
|
259
|
-
(
|
|
267
|
+
}), C(" " + I(e.noteAction), 1)], 32)) : b("", !0)], 64)) : (M(), x(_, { key: 1 }, [
|
|
268
|
+
e.hint ? (M(), x("p", X, I(e.hint), 1)) : b("", !0),
|
|
269
|
+
(M(!0), x(_, null, P(e.actions, (e) => (M(), x("button", {
|
|
260
270
|
key: e.id,
|
|
261
271
|
type: "button",
|
|
262
272
|
class: "pk-selection-actions__button",
|
|
263
|
-
onMousedown: n[
|
|
264
|
-
onClick: (t) =>
|
|
273
|
+
onMousedown: n[4] ||= U(() => {}, ["prevent"]),
|
|
274
|
+
onClick: (t) => E(e),
|
|
275
|
+
onTouchend: (t) => D(t, () => E(e))
|
|
265
276
|
}, [w(r, {
|
|
266
|
-
name:
|
|
277
|
+
name: T(e),
|
|
267
278
|
class: "pk-selection-actions__icon"
|
|
268
|
-
}, null, 8, ["name"]), C(" " +
|
|
269
|
-
n[
|
|
279
|
+
}, null, 8, ["name"]), C(" " + I(e.label), 1)], 40, Z))), 128)),
|
|
280
|
+
n[8] ||= S("hr", { class: "pk-selection-actions__rule" }, null, -1),
|
|
270
281
|
S("button", {
|
|
271
282
|
type: "button",
|
|
272
283
|
class: "pk-selection-actions__button",
|
|
273
|
-
onMousedown: n[
|
|
274
|
-
onClick:
|
|
284
|
+
onMousedown: n[5] ||= U(() => {}, ["prevent"]),
|
|
285
|
+
onClick: y,
|
|
286
|
+
onTouchend: n[6] ||= (e) => D(e, y)
|
|
275
287
|
}, [w(r, {
|
|
276
288
|
name: "ri:chat-1-line",
|
|
277
289
|
class: "pk-selection-actions__icon"
|
|
278
|
-
}), C(" " + L(
|
|
279
|
-
], 64))],
|
|
290
|
+
}), C(" " + I(L(o)("selectionActions.ask")), 1)], 32)
|
|
291
|
+
], 64))], 40, ke))], 38);
|
|
280
292
|
};
|
|
281
293
|
}
|
|
282
|
-
}),
|
|
294
|
+
}), Me = { class: "pk-spreadsheet-preview" }, Ne = { class: "pk-spreadsheet-preview__bar" }, Pe = ["aria-label"], Fe = ["aria-label"], Ie = ["aria-label"], Le = [
|
|
283
295
|
"rowspan",
|
|
284
296
|
"colspan",
|
|
285
297
|
"data-focus",
|
|
298
|
+
"data-cell",
|
|
286
299
|
"title",
|
|
287
300
|
"onMousedown",
|
|
288
301
|
"onMouseenter"
|
|
289
|
-
],
|
|
302
|
+
], Re = {
|
|
290
303
|
key: 1,
|
|
291
304
|
class: "pk-spreadsheet-preview__more"
|
|
292
|
-
},
|
|
305
|
+
}, ze = ["aria-label"], Be = ["aria-current", "onClick"], Ve = { class: "pk-spreadsheet-preview__status" }, He = { class: "pk-spreadsheet-preview__info" }, Ue = ["title"], We = ["title"], Ge = {
|
|
293
306
|
key: 2,
|
|
294
307
|
class: "pk-spreadsheet-preview__stats"
|
|
295
|
-
},
|
|
308
|
+
}, Ke = {
|
|
296
309
|
key: 0,
|
|
297
310
|
class: "pk-spreadsheet-preview__average"
|
|
298
|
-
},
|
|
311
|
+
}, qe = { key: 1 }, Je = { class: "pk-spreadsheet-preview__zoom" }, Ye = { class: "pk-spreadsheet-preview__percent" }, Xe = 64, Ze = 20, Qe = 28, $e = 44, et = 400, tt = 10, nt = /* @__PURE__ */ T({
|
|
299
312
|
__name: "PkSpreadsheetPreview",
|
|
300
313
|
props: /*@__PURE__*/ O({
|
|
301
314
|
preview: {},
|
|
@@ -308,7 +321,7 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
308
321
|
}),
|
|
309
322
|
emits: /*@__PURE__*/ O(["select"], ["update:sheet", "update:zoom"]),
|
|
310
323
|
setup(e, { emit: t }) {
|
|
311
|
-
let o = e, s = t, { t: c, locale: l } = se({ useScope: "global" }), u =
|
|
324
|
+
let o = e, s = t, { t: c, locale: l } = se({ useScope: "global" }), u = R(e, "sheet"), d = R(e, "zoom"), f = z("scrollEl"), { width: p, height: m } = ce(f, {
|
|
312
325
|
width: 0,
|
|
313
326
|
height: 0
|
|
314
327
|
}, { box: "border-box" }), h = v(() => o.preview.sheets[u.value] ?? o.preview.sheets[0]);
|
|
@@ -329,7 +342,7 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
329
342
|
t >= 0 && (u.value = t);
|
|
330
343
|
}, { immediate: !0 });
|
|
331
344
|
let E = () => ee(f.value, ".pk-spreadsheet-preview__cell--marked");
|
|
332
|
-
V(g, E, { flush: "post" }),
|
|
345
|
+
V(g, E, { flush: "post" }), re(E);
|
|
333
346
|
let O = (e) => {
|
|
334
347
|
let t = "";
|
|
335
348
|
for (let n = e; n > 0; n = Math.floor((n - 1) / 26)) t = String.fromCharCode(65 + (n - 1) % 26) + t;
|
|
@@ -337,54 +350,54 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
337
350
|
}, j = v(() => {
|
|
338
351
|
let e = h.value;
|
|
339
352
|
if (!e) return [];
|
|
340
|
-
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 =
|
|
353
|
+
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 = $e, a = p.value / d.value;
|
|
341
354
|
for (let o = 1; o <= e.lastColumn || !e.moreColumns && (o <= e.lastColumn + 2 || i < a); o++) {
|
|
342
355
|
if (t.has(o)) continue;
|
|
343
|
-
let e = n.get(o) ??
|
|
356
|
+
let e = n.get(o) ?? Xe;
|
|
344
357
|
r.push({
|
|
345
358
|
col: o,
|
|
346
359
|
width: e
|
|
347
360
|
}), i += e;
|
|
348
361
|
}
|
|
349
362
|
return r;
|
|
350
|
-
}),
|
|
363
|
+
}), ie = v(() => j.value.reduce((e, t) => e + t.width, $e)), F = v(() => j.value.map((e) => `${e.col}:${e.width}`).join(",")), B = /* @__PURE__ */ new WeakMap(), H = v(() => {
|
|
351
364
|
let e = h.value;
|
|
352
365
|
if (!e) return [];
|
|
353
|
-
let t = new Set(e.hiddenRows ?? []), n = new Map(e.rows.map((e) => [e.row, e.height])), r = Math.ceil((m.value / d.value -
|
|
354
|
-
a || (a = /* @__PURE__ */ new Map(),
|
|
366
|
+
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) / Ze), i = e.moreRows ? e.lastRow : Math.max(e.lastRow + 5, r + t.size), a = B.get(e);
|
|
367
|
+
a || (a = /* @__PURE__ */ new Map(), B.set(e, a));
|
|
355
368
|
let o = a;
|
|
356
369
|
return Array.from({ length: i }, (e, t) => t + 1).filter((e) => !t.has(e)).map((e) => {
|
|
357
370
|
let t = o.get(e);
|
|
358
371
|
return t || (t = {
|
|
359
372
|
row: e,
|
|
360
|
-
height: n.get(e) ??
|
|
373
|
+
height: n.get(e) ?? Ze
|
|
361
374
|
}, o.set(e, t)), t;
|
|
362
375
|
});
|
|
363
|
-
}),
|
|
376
|
+
}), ae = v(() => {
|
|
364
377
|
let e = /* @__PURE__ */ new Map();
|
|
365
378
|
for (let t of h.value?.rows ?? []) for (let n of t.cells) e.set(`${t.row},${n.col}`, n);
|
|
366
379
|
return e;
|
|
367
|
-
}),
|
|
380
|
+
}), oe = v(() => {
|
|
368
381
|
let e = /* @__PURE__ */ new Map();
|
|
369
382
|
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}`, {
|
|
370
383
|
row: t.row,
|
|
371
384
|
col: n.col
|
|
372
385
|
});
|
|
373
386
|
return e;
|
|
374
|
-
}),
|
|
375
|
-
let n =
|
|
387
|
+
}), W = (e, t) => ae.value.get(`${e},${t}`), le = (e, t) => {
|
|
388
|
+
let n = W(e, t)?.span;
|
|
376
389
|
if (n) return {
|
|
377
|
-
rows:
|
|
390
|
+
rows: H.value.filter((t) => t.row >= e && t.row < e + n.rows).length,
|
|
378
391
|
cols: j.value.filter((e) => e.col >= t && e.col < t + n.cols).length
|
|
379
392
|
};
|
|
380
|
-
},
|
|
393
|
+
}, G = (e) => e?.style === void 0 ? void 0 : o.preview.styles[e.style], ue = (e) => {
|
|
381
394
|
let t = e.numFmt === void 0 ? void 0 : o.preview.numberFormats?.[e.numFmt], a = e.value;
|
|
382
395
|
if (t !== void 0) try {
|
|
383
396
|
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;
|
|
384
397
|
} catch {
|
|
385
398
|
return;
|
|
386
399
|
}
|
|
387
|
-
},
|
|
400
|
+
}, K = (e, t) => {
|
|
388
401
|
let n = ue(e);
|
|
389
402
|
if (n) return n.text;
|
|
390
403
|
let r = e.decimals === void 0 ? { maximumFractionDigits: 10 } : {
|
|
@@ -400,17 +413,17 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
400
413
|
currency: e.currency
|
|
401
414
|
} : {}
|
|
402
415
|
}).format(t);
|
|
403
|
-
},
|
|
416
|
+
}, de = (e) => {
|
|
404
417
|
let t = /* @__PURE__ */ new Date(`${e}T00:00:00Z`);
|
|
405
418
|
return Number.isNaN(t.getTime()) ? e : new Intl.DateTimeFormat(l.value, {
|
|
406
419
|
dateStyle: "short",
|
|
407
420
|
timeZone: "UTC"
|
|
408
421
|
}).format(t);
|
|
409
|
-
},
|
|
422
|
+
}, fe = (e) => {
|
|
410
423
|
if (!e) return "";
|
|
411
424
|
if (e.missing) return "—";
|
|
412
425
|
let t = e.value;
|
|
413
|
-
return t === void 0 ? "" : typeof t == "boolean" ? c(t ? "chatFilePreview.true" : "chatFilePreview.false") : e.format === "date" && typeof t == "string" ? ue(e)?.text ??
|
|
426
|
+
return t === void 0 ? "" : typeof t == "boolean" ? c(t ? "chatFilePreview.true" : "chatFilePreview.false") : e.format === "date" && typeof t == "string" ? ue(e)?.text ?? de(t) : typeof t == "number" ? K(e, t) : t;
|
|
414
427
|
}, pe = (e) => {
|
|
415
428
|
if (!e) return "";
|
|
416
429
|
if (e.formula) return `=${e.formula}`;
|
|
@@ -419,9 +432,9 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
419
432
|
useGrouping: !1,
|
|
420
433
|
maximumFractionDigits: 15,
|
|
421
434
|
...e.format === "percent" ? { style: "percent" } : {}
|
|
422
|
-
}).format(t) :
|
|
423
|
-
},
|
|
424
|
-
let r =
|
|
435
|
+
}).format(t) : fe(e);
|
|
436
|
+
}, q = (e) => e ? `${e.width}px solid ${e.color}` : void 0, me = (e, t, n) => {
|
|
437
|
+
let r = G(e), i = e?.value, a = typeof i == "number" || e?.format === "date" || !!e?.missing, o = {
|
|
425
438
|
textAlign: r?.align ?? (a ? "right" : typeof i == "boolean" || e?.format === "error" ? "center" : "left"),
|
|
426
439
|
verticalAlign: r?.valign === "top" ? "top" : r?.valign === "middle" ? "middle" : "bottom",
|
|
427
440
|
whiteSpace: r?.wrap ? "pre-wrap" : "nowrap"
|
|
@@ -434,28 +447,28 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
434
447
|
let e = `${4 + r.indent * 9}px`;
|
|
435
448
|
o.textAlign === "right" ? o.paddingRight = e : o.paddingLeft = e;
|
|
436
449
|
}
|
|
437
|
-
let l =
|
|
438
|
-
return
|
|
439
|
-
},
|
|
450
|
+
let l = rt(t, n);
|
|
451
|
+
return he(t, n) ? (o.borderStyle = "hidden", o.boxShadow = [...l, Te(e, t, n)].filter(Boolean).join(", ")) : (o.borderTop = q(r?.borders?.top), o.borderRight = q(r?.borders?.right), o.borderBottom = q(r?.borders?.bottom), o.borderLeft = q(r?.borders?.left), o.boxShadow = [...l, ...ve(e, t, n)].join(", ")), Object.assign(o, ke(t, n)), o;
|
|
452
|
+
}, he = (e, t) => {
|
|
440
453
|
let n = h.value?.frozen;
|
|
441
454
|
return !!n && (e <= n.rows || t <= n.cols);
|
|
442
|
-
},
|
|
455
|
+
}, ge = {
|
|
443
456
|
top: (e) => `inset 0 ${e.width}px 0 ${e.color}`,
|
|
444
457
|
right: (e) => `inset -${e.width}px 0 0 ${e.color}`,
|
|
445
458
|
bottom: (e) => `inset 0 -${e.width}px 0 ${e.color}`,
|
|
446
459
|
left: (e) => `inset ${e.width}px 0 0 ${e.color}`
|
|
447
|
-
},
|
|
448
|
-
let r =
|
|
449
|
-
return [t ===
|
|
450
|
-
},
|
|
460
|
+
}, _e = (...e) => e.reduce((e, t) => t && (!e || t.width > e.width) ? t : e, void 0), ve = (e, t, n) => {
|
|
461
|
+
let r = G(e)?.borders;
|
|
462
|
+
return [t === H.value[0]?.row && r?.top && ge.top(r.top), n === j.value[0]?.col && r?.left && ge.left(r.left)].filter((e) => !!e);
|
|
463
|
+
}, ye = v(() => H.value.map((e) => e.row)), be = v(() => j.value.map((e) => e.col)), xe = v(() => new Map(ye.value.map((e, t) => [e, t]))), Se = v(() => new Map(be.value.map((e, t) => [e, t]))), Ce = (e, t, n, r) => {
|
|
451
464
|
let i = [], a = t.get(n) ?? e.length;
|
|
452
465
|
for (; a < e.length && e[a] < n + r; a++) i.push(e[a]);
|
|
453
466
|
return {
|
|
454
467
|
spanned: i,
|
|
455
468
|
next: e[a]
|
|
456
469
|
};
|
|
457
|
-
},
|
|
458
|
-
let { spanned: i, next: a } =
|
|
470
|
+
}, we = (e, t, n, r) => {
|
|
471
|
+
let { spanned: i, next: a } = Ce(ye.value, xe.value, t, e?.span?.rows ?? 1), { spanned: o, next: s } = Ce(be.value, Se.value, n, e?.span?.cols ?? 1);
|
|
459
472
|
return (r === "right" ? s === void 0 ? [] : i.map((e) => ({
|
|
460
473
|
row: e,
|
|
461
474
|
col: s
|
|
@@ -463,72 +476,72 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
463
476
|
row: a,
|
|
464
477
|
col: e
|
|
465
478
|
}))).map((e) => {
|
|
466
|
-
let t =
|
|
467
|
-
return
|
|
479
|
+
let t = oe.value.get(`${e.row},${e.col}`) ?? e;
|
|
480
|
+
return W(t.row, t.col);
|
|
468
481
|
});
|
|
469
|
-
},
|
|
470
|
-
let r =
|
|
482
|
+
}, Te = (e, t, n) => {
|
|
483
|
+
let r = G(e)?.borders, i = _e(r?.right, ...we(e, t, n, "right").map((e) => G(e)?.borders?.left)), a = _e(r?.bottom, ...we(e, t, n, "bottom").map((e) => G(e)?.borders?.top)), o = h.value?.gridlines;
|
|
471
484
|
return [
|
|
472
|
-
i ?
|
|
473
|
-
a ?
|
|
474
|
-
...
|
|
485
|
+
i ? ge.right(i) : o && "inset calc(var(--border) * -1) 0 0 var(--pk-spreadsheet-gridline)",
|
|
486
|
+
a ? ge.bottom(a) : o && "inset 0 calc(var(--border) * -1) 0 var(--pk-spreadsheet-gridline)",
|
|
487
|
+
...ve(e, t, n)
|
|
475
488
|
].filter(Boolean).join(", ");
|
|
476
|
-
},
|
|
489
|
+
}, Ee = (e) => Qe + H.value.filter((t) => t.row < e).reduce((e, t) => e + t.height, 0), Oe = (e) => $e + j.value.filter((t) => t.col < e).reduce((e, t) => e + t.width, 0), J = v(() => {
|
|
477
490
|
let e = h.value?.frozen;
|
|
478
491
|
return {
|
|
479
|
-
top:
|
|
480
|
-
left:
|
|
492
|
+
top: Ee((e?.rows ?? 0) + 1),
|
|
493
|
+
left: Oe((e?.cols ?? 0) + 1)
|
|
481
494
|
};
|
|
482
|
-
}),
|
|
495
|
+
}), ke = (e, t) => {
|
|
483
496
|
let n = h.value?.frozen;
|
|
484
497
|
if (!n) return {};
|
|
485
498
|
let r = {};
|
|
486
|
-
return e <= n.rows && (r.position = "sticky", r.top = `${
|
|
487
|
-
},
|
|
499
|
+
return e <= n.rows && (r.position = "sticky", r.top = `${Ee(e)}px`, r.scrollMarginTop = r.top, r.zIndex = 0), t <= n.cols && (r.position = "sticky", r.left = `${Oe(t)}px`, r.scrollMarginLeft = r.left, r.zIndex = +(e <= n.rows)), r;
|
|
500
|
+
}, Y = N({
|
|
488
501
|
row: 1,
|
|
489
502
|
col: 1
|
|
490
|
-
}),
|
|
503
|
+
}), X = N({
|
|
491
504
|
row: 1,
|
|
492
505
|
col: 1
|
|
493
506
|
});
|
|
494
507
|
V(h, () => {
|
|
495
|
-
|
|
508
|
+
Y.value = {
|
|
496
509
|
row: 1,
|
|
497
510
|
col: 1
|
|
498
|
-
},
|
|
511
|
+
}, X.value = {
|
|
499
512
|
row: 1,
|
|
500
513
|
col: 1
|
|
501
514
|
};
|
|
502
515
|
});
|
|
503
|
-
let
|
|
504
|
-
r1: Math.min(
|
|
505
|
-
r2: Math.max(
|
|
506
|
-
c1: Math.min(
|
|
507
|
-
c2: Math.max(
|
|
508
|
-
})),
|
|
509
|
-
let { r1: n, r2: r, c1: i, c2: a } =
|
|
510
|
-
if (n === r && i === a || !
|
|
511
|
-
let o =
|
|
516
|
+
let Z = v(() => ({
|
|
517
|
+
r1: Math.min(Y.value.row, X.value.row),
|
|
518
|
+
r2: Math.max(Y.value.row, X.value.row),
|
|
519
|
+
c1: Math.min(Y.value.col, X.value.col),
|
|
520
|
+
c2: Math.max(Y.value.col, X.value.col)
|
|
521
|
+
})), Ae = (e, t) => e >= Z.value.r1 && e <= Z.value.r2 && t >= Z.value.c1 && t <= Z.value.c2, je = (e, t) => X.value.row === e && X.value.col === t, nt = (e) => e >= Z.value.r1 && e <= Z.value.r2 ? `${Z.value.c1}:${Z.value.c2}:${X.value.row === e ? X.value.col : 0}:${e === Z.value.r1 ? "t" : ""}${e === Z.value.r2 ? "b" : ""}` : "", rt = (e, t) => {
|
|
522
|
+
let { r1: n, r2: r, c1: i, c2: a } = Z.value;
|
|
523
|
+
if (n === r && i === a || !Ae(e, t)) return [];
|
|
524
|
+
let o = W(e, t)?.span, s = e + (o?.rows ?? 1) - 1, c = t + (o?.cols ?? 1) - 1, l = "var(--spacing-2)", u = "var(--pk-spreadsheet-green)";
|
|
512
525
|
return [
|
|
513
526
|
e === n && `inset 0 ${l} 0 ${u}`,
|
|
514
527
|
s >= r && `inset 0 calc(${l} * -1) 0 ${u}`,
|
|
515
528
|
t === i && `inset ${l} 0 0 ${u}`,
|
|
516
529
|
c >= a && `inset calc(${l} * -1) 0 0 ${u}`
|
|
517
530
|
].filter((e) => !!e);
|
|
518
|
-
},
|
|
519
|
-
f.value?.focus({ preventScroll: !0 }),
|
|
531
|
+
}, Q = N(!1), it = (e, t, n) => {
|
|
532
|
+
f.value?.focus({ preventScroll: !0 }), X.value = {
|
|
520
533
|
row: e,
|
|
521
534
|
col: t
|
|
522
|
-
}, n.shiftKey || (
|
|
535
|
+
}, n.shiftKey || (Y.value = {
|
|
523
536
|
row: e,
|
|
524
537
|
col: t
|
|
525
|
-
}),
|
|
526
|
-
},
|
|
527
|
-
|
|
538
|
+
}), Q.value = !0;
|
|
539
|
+
}, at = (e, t) => {
|
|
540
|
+
Q.value && (X.value = {
|
|
528
541
|
row: e,
|
|
529
542
|
col: t
|
|
530
543
|
});
|
|
531
|
-
},
|
|
544
|
+
}, ot, st = () => {
|
|
532
545
|
let e = [...f.value?.querySelectorAll(".pk-spreadsheet-preview__cell--range, [data-focus]") ?? []].map((e) => e.getBoundingClientRect());
|
|
533
546
|
if (e.length) return {
|
|
534
547
|
start: {
|
|
@@ -537,19 +550,80 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
537
550
|
},
|
|
538
551
|
bottom: Math.max(...e.map((e) => e.bottom))
|
|
539
552
|
};
|
|
540
|
-
},
|
|
541
|
-
...
|
|
542
|
-
measure:
|
|
553
|
+
}, ct = () => h.value ? {
|
|
554
|
+
...De(h.value, Z.value),
|
|
555
|
+
measure: st
|
|
543
556
|
} : void 0;
|
|
544
|
-
V([
|
|
545
|
-
clearTimeout(
|
|
546
|
-
let e =
|
|
547
|
-
s("select", t ?
|
|
557
|
+
V([Z, Q], () => {
|
|
558
|
+
clearTimeout(ot), !Q.value && (ot = setTimeout(() => {
|
|
559
|
+
let e = Z.value, t = e.r2 > e.r1 || e.c2 > e.c1;
|
|
560
|
+
s("select", t ? ct() : void 0);
|
|
548
561
|
}, 150));
|
|
549
562
|
});
|
|
550
|
-
let
|
|
551
|
-
clearTimeout(
|
|
552
|
-
},
|
|
563
|
+
let lt = () => {
|
|
564
|
+
clearTimeout(ot), s("select", ct());
|
|
565
|
+
}, $, ut;
|
|
566
|
+
V(h, () => {
|
|
567
|
+
ut = void 0;
|
|
568
|
+
});
|
|
569
|
+
let dt = (e) => {
|
|
570
|
+
let [t, n] = ((e?.closest?.("[data-cell]"))?.dataset.cell ?? "").split(":").map(Number);
|
|
571
|
+
return t && n ? {
|
|
572
|
+
row: t,
|
|
573
|
+
col: n
|
|
574
|
+
} : void 0;
|
|
575
|
+
}, ft = () => {
|
|
576
|
+
clearTimeout($?.timer), $?.active && (Q.value = !1), $ = void 0;
|
|
577
|
+
};
|
|
578
|
+
ne(() => {
|
|
579
|
+
ft(), clearTimeout(ot);
|
|
580
|
+
});
|
|
581
|
+
let pt = () => void te(lt), mt = (e) => {
|
|
582
|
+
ft();
|
|
583
|
+
let t = e.touches[0], n = e.touches.length === 1 ? dt(e.target) : void 0;
|
|
584
|
+
t && n && ($ = {
|
|
585
|
+
...n,
|
|
586
|
+
x: t.clientX,
|
|
587
|
+
y: t.clientY,
|
|
588
|
+
active: !1,
|
|
589
|
+
timer: setTimeout(() => {
|
|
590
|
+
$ && ($.active = !0, f.value?.focus({ preventScroll: !0 }), Y.value = {
|
|
591
|
+
row: $.row,
|
|
592
|
+
col: $.col
|
|
593
|
+
}, X.value = {
|
|
594
|
+
row: $.row,
|
|
595
|
+
col: $.col
|
|
596
|
+
}, Q.value = !0);
|
|
597
|
+
}, et)
|
|
598
|
+
});
|
|
599
|
+
}, ht = (e) => {
|
|
600
|
+
let t = e.touches[0];
|
|
601
|
+
if (!$ || !t) return;
|
|
602
|
+
if (!$.active) {
|
|
603
|
+
(!e.cancelable || Math.hypot(t.clientX - $.x, t.clientY - $.y) > tt) && ft();
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
e.preventDefault();
|
|
607
|
+
let n = f.value?.getRootNode(), r = dt(n?.elementFromPoint(t.clientX, t.clientY) ?? null);
|
|
608
|
+
r && (X.value = r);
|
|
609
|
+
}, gt = (e) => {
|
|
610
|
+
if (!$) return;
|
|
611
|
+
let { row: t, col: n, active: r } = $;
|
|
612
|
+
ft(), e.preventDefault();
|
|
613
|
+
let i = Z.value, a = i.r1 === i.r2 && i.c1 === i.c2;
|
|
614
|
+
if (r) {
|
|
615
|
+
a && pt();
|
|
616
|
+
return;
|
|
617
|
+
}
|
|
618
|
+
let o = a && je(t, n) && ut === `${t}:${n}`;
|
|
619
|
+
ut = `${t}:${n}`, f.value?.focus({ preventScroll: !0 }), Y.value = {
|
|
620
|
+
row: t,
|
|
621
|
+
col: n
|
|
622
|
+
}, X.value = {
|
|
623
|
+
row: t,
|
|
624
|
+
col: n
|
|
625
|
+
}, o && pt();
|
|
626
|
+
}, _t = (e) => {
|
|
553
627
|
let t = {
|
|
554
628
|
ArrowUp: [-1, 0],
|
|
555
629
|
ArrowDown: [1, 0],
|
|
@@ -560,7 +634,7 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
560
634
|
}[e.key];
|
|
561
635
|
if (!t) return;
|
|
562
636
|
e.preventDefault();
|
|
563
|
-
let n =
|
|
637
|
+
let n = H.value.map((e) => e.row), r = j.value.map((e) => e.col), i = (e) => oe.value.get(`${e.row},${e.col}`) ?? e, a = i(X.value), o = n.indexOf(X.value.row), s = r.indexOf(X.value.col), c = a;
|
|
564
638
|
for (;;) {
|
|
565
639
|
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]));
|
|
566
640
|
if (e === o && l === s || (o = e, s = l, c = i({
|
|
@@ -568,42 +642,42 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
568
642
|
col: r[s]
|
|
569
643
|
}), c.row !== a.row || c.col !== a.col)) break;
|
|
570
644
|
}
|
|
571
|
-
|
|
645
|
+
X.value = c, e.shiftKey || (Y.value = c), te(() => f.value?.querySelector("[data-focus]")?.scrollIntoView({
|
|
572
646
|
block: "nearest",
|
|
573
647
|
inline: "nearest"
|
|
574
648
|
}));
|
|
575
|
-
},
|
|
576
|
-
let { r1: e, r2: t, c1: n, c2: r } =
|
|
649
|
+
}, vt = v(() => W(X.value.row, X.value.col)), yt = v(() => {
|
|
650
|
+
let { r1: e, r2: t, c1: n, c2: r } = Z.value;
|
|
577
651
|
if (e === t && n === r) return;
|
|
578
652
|
let i = 0, a = 0, o = 0, s;
|
|
579
653
|
for (let c = e; c <= t; c++) for (let e = n; e <= r; e++) {
|
|
580
|
-
let t =
|
|
654
|
+
let t = W(c, e);
|
|
581
655
|
t && (t.value !== void 0 || t.missing) && (i++, typeof t.value == "number" && (a += t.value, o++, s ??= t));
|
|
582
656
|
}
|
|
583
657
|
if (i) return {
|
|
584
658
|
count: i,
|
|
585
|
-
sum: s ?
|
|
586
|
-
average: s ?
|
|
659
|
+
sum: s ? K(s, a) : void 0,
|
|
660
|
+
average: s ? K(s, a / o) : void 0
|
|
587
661
|
};
|
|
588
|
-
}),
|
|
662
|
+
}), bt = (e) => {
|
|
589
663
|
d.value = Math.min(2, Math.max(.5, Math.round((d.value + e) * 10) / 10));
|
|
590
664
|
};
|
|
591
665
|
return (t, n) => {
|
|
592
666
|
let r = a;
|
|
593
|
-
return
|
|
594
|
-
S("div",
|
|
667
|
+
return M(), x("div", Me, [
|
|
668
|
+
S("div", Ne, [
|
|
595
669
|
S("span", {
|
|
596
670
|
class: "pk-spreadsheet-preview__ref",
|
|
597
|
-
"aria-label":
|
|
598
|
-
},
|
|
671
|
+
"aria-label": L(c)("chatFilePreview.cell")
|
|
672
|
+
}, I(O(X.value.col)) + I(X.value.row), 9, Pe),
|
|
599
673
|
n[6] ||= S("span", {
|
|
600
674
|
class: "pk-spreadsheet-preview__fx",
|
|
601
675
|
"aria-hidden": "true"
|
|
602
676
|
}, "fx", -1),
|
|
603
677
|
S("output", {
|
|
604
678
|
class: "pk-spreadsheet-preview__formula",
|
|
605
|
-
"aria-label":
|
|
606
|
-
},
|
|
679
|
+
"aria-label": L(c)("chatFilePreview.formulaBar")
|
|
680
|
+
}, I(pe(vt.value)), 9, Fe)
|
|
607
681
|
]),
|
|
608
682
|
S("div", {
|
|
609
683
|
ref_key: "scrollEl",
|
|
@@ -612,119 +686,124 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
612
686
|
tabindex: "0",
|
|
613
687
|
role: "grid",
|
|
614
688
|
"aria-label": h.value?.name,
|
|
615
|
-
onKeydown:
|
|
616
|
-
onMouseup: n[2] ||= (e) =>
|
|
617
|
-
onMouseleave: n[3] ||= (e) =>
|
|
618
|
-
|
|
689
|
+
onKeydown: _t,
|
|
690
|
+
onMouseup: n[2] ||= (e) => Q.value = !1,
|
|
691
|
+
onMouseleave: n[3] ||= (e) => Q.value = !1,
|
|
692
|
+
onTouchstart: mt,
|
|
693
|
+
onTouchmove: ht,
|
|
694
|
+
onTouchend: gt,
|
|
695
|
+
onTouchcancel: ft
|
|
696
|
+
}, [h.value ? (M(), x("table", {
|
|
619
697
|
key: 0,
|
|
620
698
|
class: k(["pk-spreadsheet-preview__grid", { "pk-spreadsheet-preview__grid--lines": h.value.gridlines }]),
|
|
621
699
|
style: A({
|
|
622
700
|
zoom: d.value,
|
|
623
|
-
width: `${
|
|
624
|
-
"--pk-spreadsheet-stuck-top": `${
|
|
625
|
-
"--pk-spreadsheet-stuck-left": `${
|
|
701
|
+
width: `${ie.value}px`,
|
|
702
|
+
"--pk-spreadsheet-stuck-top": `${J.value.top}px`,
|
|
703
|
+
"--pk-spreadsheet-stuck-left": `${J.value.left}px`
|
|
626
704
|
})
|
|
627
705
|
}, [
|
|
628
|
-
S("colgroup", null, [S("col", { style: A({ width: `${
|
|
706
|
+
S("colgroup", null, [S("col", { style: A({ width: `${$e}px` }) }, null, 4), (M(!0), x(_, null, P(j.value, (e) => (M(), x("col", {
|
|
629
707
|
key: e.col,
|
|
630
708
|
style: A({ width: `${e.width}px` })
|
|
631
709
|
}, null, 4))), 128))]),
|
|
632
|
-
S("thead", null, [S("tr", { style: A({ height: `${
|
|
710
|
+
S("thead", null, [S("tr", { style: A({ height: `${Qe}px` }) }, [n[7] ||= S("th", { class: "pk-spreadsheet-preview__corner" }, null, -1), (M(!0), x(_, null, P(j.value, (e) => (M(), x("th", {
|
|
633
711
|
key: e.col,
|
|
634
712
|
scope: "col",
|
|
635
|
-
class: k(["pk-spreadsheet-preview__head", { "pk-spreadsheet-preview__head--current": e.col >=
|
|
713
|
+
class: k(["pk-spreadsheet-preview__head", { "pk-spreadsheet-preview__head--current": e.col >= Z.value.c1 && e.col <= Z.value.c2 }]),
|
|
636
714
|
style: A(h.value.frozen && e.col <= h.value.frozen.cols ? {
|
|
637
|
-
left: `${
|
|
715
|
+
left: `${Oe(e.col)}px`,
|
|
638
716
|
zIndex: 2
|
|
639
717
|
} : void 0)
|
|
640
|
-
},
|
|
641
|
-
S("tbody", null, [(
|
|
718
|
+
}, I(O(e.col)), 7))), 128))], 4)]),
|
|
719
|
+
S("tbody", null, [(M(!0), x(_, null, P(H.value, (e, t, n, r) => {
|
|
642
720
|
let i = [
|
|
643
721
|
e,
|
|
644
722
|
h.value,
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
723
|
+
F.value,
|
|
724
|
+
L(l),
|
|
725
|
+
nt(e.row),
|
|
648
726
|
y.value.get(e.row)
|
|
649
727
|
];
|
|
650
728
|
if (r && r.el && r.key === e.row && D(r, i)) return r;
|
|
651
|
-
let a = (
|
|
729
|
+
let a = (M(), x("tr", {
|
|
652
730
|
key: e.row,
|
|
653
731
|
style: A({ height: `${e.height}px` })
|
|
654
732
|
}, [S("th", {
|
|
655
733
|
scope: "row",
|
|
656
|
-
class: k(["pk-spreadsheet-preview__row", { "pk-spreadsheet-preview__row--current": e.row >=
|
|
734
|
+
class: k(["pk-spreadsheet-preview__row", { "pk-spreadsheet-preview__row--current": e.row >= Z.value.r1 && e.row <= Z.value.r2 }]),
|
|
657
735
|
style: A(h.value.frozen && e.row <= h.value.frozen.rows ? {
|
|
658
|
-
...
|
|
736
|
+
...ke(e.row, 0),
|
|
659
737
|
left: 0,
|
|
660
738
|
zIndex: 4
|
|
661
739
|
} : void 0)
|
|
662
|
-
},
|
|
740
|
+
}, I(e.row), 7), (M(!0), x(_, null, P(j.value, (t) => (M(), x(_, { key: t.col }, [oe.value.has(`${e.row},${t.col}`) ? b("", !0) : (M(), x("td", {
|
|
663
741
|
key: 0,
|
|
664
742
|
rowspan: le(e.row, t.col)?.rows,
|
|
665
743
|
colspan: le(e.row, t.col)?.cols,
|
|
666
744
|
class: k(["pk-spreadsheet-preview__cell", {
|
|
667
|
-
"pk-spreadsheet-preview__cell--range":
|
|
668
|
-
"pk-spreadsheet-preview__cell--missing":
|
|
745
|
+
"pk-spreadsheet-preview__cell--range": Ae(e.row, t.col) && !je(e.row, t.col),
|
|
746
|
+
"pk-spreadsheet-preview__cell--missing": W(e.row, t.col)?.missing,
|
|
669
747
|
"pk-spreadsheet-preview__cell--marked": T(e.row, t.col)
|
|
670
748
|
}]),
|
|
671
|
-
style: A(
|
|
672
|
-
"data-focus":
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
749
|
+
style: A(me(W(e.row, t.col), e.row, t.col)),
|
|
750
|
+
"data-focus": je(e.row, t.col) ? "" : void 0,
|
|
751
|
+
"data-cell": `${e.row}:${t.col}`,
|
|
752
|
+
title: W(e.row, t.col)?.missing ? L(c)("chatFilePreview.missingValue") : void 0,
|
|
753
|
+
onMousedown: U((n) => it(e.row, t.col, n), ["prevent"]),
|
|
754
|
+
onMouseenter: (n) => at(e.row, t.col),
|
|
755
|
+
onDblclick: lt
|
|
756
|
+
}, I(fe(W(e.row, t.col))), 47, Le))], 64))), 128))], 4));
|
|
678
757
|
return a.memo = i, a;
|
|
679
758
|
}, n, 0), 128))])
|
|
680
|
-
], 6)) : b("", !0), h.value && (h.value.moreRows || h.value.moreColumns) ? (
|
|
759
|
+
], 6)) : b("", !0), h.value && (h.value.moreRows || h.value.moreColumns) ? (M(), x("p", Re, [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, Ie),
|
|
681
760
|
S("nav", {
|
|
682
761
|
class: "pk-spreadsheet-preview__sheets",
|
|
683
|
-
"aria-label":
|
|
684
|
-
}, [(
|
|
762
|
+
"aria-label": L(c)("chatFilePreview.sheets")
|
|
763
|
+
}, [(M(!0), x(_, null, P(e.preview.sheets, (e, t) => (M(), x("button", {
|
|
685
764
|
key: e.name,
|
|
686
765
|
type: "button",
|
|
687
766
|
class: "pk-spreadsheet-preview__sheet",
|
|
688
767
|
"aria-current": t === u.value ? "page" : void 0,
|
|
689
768
|
onClick: (e) => u.value = t
|
|
690
|
-
},
|
|
691
|
-
S("div",
|
|
769
|
+
}, I(e.name), 9, Be))), 128))], 8, ze),
|
|
770
|
+
S("div", Ve, [S("p", He, [e.preview.staleFormulas ? (M(), x("span", {
|
|
692
771
|
key: 0,
|
|
693
772
|
class: "pk-spreadsheet-preview__note",
|
|
694
|
-
title:
|
|
695
|
-
}, L(
|
|
773
|
+
title: L(c)("chatFilePreview.staleFormulas")
|
|
774
|
+
}, I(L(c)("chatFilePreview.staleFormulas")), 9, Ue)) : e.preview.computedFormulas ? (M(), x("span", {
|
|
696
775
|
key: 1,
|
|
697
776
|
class: "pk-spreadsheet-preview__note",
|
|
698
|
-
title:
|
|
699
|
-
}, L(
|
|
700
|
-
|
|
701
|
-
S("span", null, L(
|
|
702
|
-
|
|
703
|
-
])) : b("", !0)]), S("div",
|
|
777
|
+
title: L(c)("chatFilePreview.computedFormulas")
|
|
778
|
+
}, I(L(c)("chatFilePreview.computedFormulas")), 9, We)) : b("", !0), yt.value ? (M(), x("span", Ge, [
|
|
779
|
+
yt.value.average ? (M(), x("span", Ke, I(L(c)("chatFilePreview.average")) + " " + I(yt.value.average), 1)) : b("", !0),
|
|
780
|
+
S("span", null, I(L(c)("chatFilePreview.count")) + " " + I(yt.value.count), 1),
|
|
781
|
+
yt.value.sum ? (M(), x("span", qe, I(L(c)("chatFilePreview.sum")) + " " + I(yt.value.sum), 1)) : b("", !0)
|
|
782
|
+
])) : b("", !0)]), S("div", Je, [
|
|
704
783
|
w(r, {
|
|
705
784
|
modifiers: "action-quiet",
|
|
706
785
|
icon: "ri:subtract-line",
|
|
707
|
-
"aria-label":
|
|
786
|
+
"aria-label": L(c)("chatFilePreview.zoomOut"),
|
|
708
787
|
disabled: d.value <= .5,
|
|
709
|
-
onClick: n[4] ||= (e) =>
|
|
788
|
+
onClick: n[4] ||= (e) => bt(-.1)
|
|
710
789
|
}, null, 8, ["aria-label", "disabled"]),
|
|
711
|
-
S("span",
|
|
790
|
+
S("span", Ye, I(Math.round(d.value * 100)) + "% ", 1),
|
|
712
791
|
w(r, {
|
|
713
792
|
modifiers: "action-quiet",
|
|
714
793
|
icon: "ri:add-line",
|
|
715
|
-
"aria-label":
|
|
794
|
+
"aria-label": L(c)("chatFilePreview.zoomIn"),
|
|
716
795
|
disabled: d.value >= 2,
|
|
717
|
-
onClick: n[5] ||= (e) =>
|
|
796
|
+
onClick: n[5] ||= (e) => bt(.1)
|
|
718
797
|
}, null, 8, ["aria-label", "disabled"])
|
|
719
798
|
])])
|
|
720
799
|
]);
|
|
721
800
|
};
|
|
722
801
|
}
|
|
723
|
-
}),
|
|
802
|
+
}), rt = ["src"], Q = {
|
|
724
803
|
key: 1,
|
|
725
804
|
class: "pk-word-preview__image",
|
|
726
805
|
"data-quote-skip": ""
|
|
727
|
-
},
|
|
806
|
+
}, it = ["title"], at = ["title"], ot = ["data-quote-skip"], st = /* @__PURE__ */ T({
|
|
728
807
|
__name: "PkWordPreviewRuns",
|
|
729
808
|
props: {
|
|
730
809
|
runs: {},
|
|
@@ -775,34 +854,34 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
775
854
|
textDecoration: [...n].join(" ")
|
|
776
855
|
};
|
|
777
856
|
}, g = (e) => e.author ? n("chatFilePreview.revisionBy", { author: e.author }) : void 0;
|
|
778
|
-
return (e, t) => (
|
|
857
|
+
return (e, t) => (M(!0), x(_, null, P(l.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", {
|
|
779
858
|
key: 0,
|
|
780
859
|
class: k(["pk-word-preview__picture", `pk-word-preview__picture--${a(e.picture)}`]),
|
|
781
860
|
style: A(o(e.picture)),
|
|
782
861
|
src: i(e),
|
|
783
862
|
alt: ""
|
|
784
|
-
}, null, 14,
|
|
863
|
+
}, null, 14, rt))], 64)) : (M(), x("span", Q, I(L(n)("chatFilePreview.image")), 1))], 64)) : m.value && e.change === "deleted" ? (M(), x("del", {
|
|
785
864
|
key: 1,
|
|
786
865
|
class: "pk-word-preview__removed",
|
|
787
866
|
"data-quote-skip": "",
|
|
788
867
|
style: A(ee(e)),
|
|
789
868
|
title: g(e)
|
|
790
|
-
},
|
|
869
|
+
}, I(s(e)), 13, it)) : m.value && e.change === "inserted" ? (M(), x("ins", {
|
|
791
870
|
key: 2,
|
|
792
871
|
class: "pk-word-preview__added",
|
|
793
872
|
style: A(ee(e)),
|
|
794
873
|
title: g(e)
|
|
795
|
-
},
|
|
874
|
+
}, I(s(e)), 13, at)) : (M(), x("span", {
|
|
796
875
|
key: 3,
|
|
797
876
|
style: A(h(e)),
|
|
798
877
|
"data-quote-skip": e.label ? "" : void 0
|
|
799
|
-
},
|
|
878
|
+
}, I(s(e)), 13, ot))], 64))), 128));
|
|
800
879
|
}
|
|
801
|
-
}),
|
|
880
|
+
}), ct = { key: 0 }, lt = ["data-paragraph", "colspan"], $ = [
|
|
802
881
|
"data-paragraph",
|
|
803
882
|
"role",
|
|
804
883
|
"aria-level"
|
|
805
|
-
],
|
|
884
|
+
], ut = { key: 1 }, dt = /* @__PURE__ */ T({
|
|
806
885
|
__name: "PkWordPreviewBlock",
|
|
807
886
|
props: {
|
|
808
887
|
block: {},
|
|
@@ -836,17 +915,17 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
836
915
|
let e = t.block.widths ?? [], n = e.reduce((e, t) => e + t, 0);
|
|
837
916
|
return n ? e.map((e) => `${e / n * 100}%`) : [];
|
|
838
917
|
}), 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)));
|
|
839
|
-
return (t, u) => e.block.kind === "table" && a.value ? (
|
|
918
|
+
return (t, u) => e.block.kind === "table" && a.value ? (M(), x("table", {
|
|
840
919
|
key: 0,
|
|
841
920
|
class: k(["pk-word-preview__table", {
|
|
842
921
|
"pk-word-preview__table--lines": e.block.borders,
|
|
843
922
|
"pk-word-preview__table--next": e.row !== 0,
|
|
844
923
|
"pk-word-preview__changed": l.value
|
|
845
924
|
}])
|
|
846
|
-
}, [o.value.length ? (
|
|
925
|
+
}, [o.value.length ? (M(), x("colgroup", ct, [(M(!0), x(_, null, P(o.value, (e, t) => (M(), x("col", {
|
|
847
926
|
key: t,
|
|
848
927
|
style: A({ width: e })
|
|
849
|
-
}, null, 4))), 128))])) : b("", !0), S("tbody", null, [S("tr", null, [(
|
|
928
|
+
}, null, 4))), 128))])) : b("", !0), S("tbody", null, [S("tr", null, [(M(!0), x(_, null, P(a.value, (t, n) => (M(), x("td", {
|
|
850
929
|
key: n,
|
|
851
930
|
"data-paragraph": t.ids?.join(" "),
|
|
852
931
|
class: k({ "pk-word-preview__marked": c(t.ids) }),
|
|
@@ -856,7 +935,7 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
856
935
|
textAlign: t.align,
|
|
857
936
|
fontSize: t.size ? `${t.size}pt` : void 0
|
|
858
937
|
})
|
|
859
|
-
}, [w(
|
|
938
|
+
}, [w(st, {
|
|
860
939
|
runs: t.runs,
|
|
861
940
|
mode: e.mode,
|
|
862
941
|
numbers: e.numbers
|
|
@@ -864,7 +943,7 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
864
943
|
"runs",
|
|
865
944
|
"mode",
|
|
866
945
|
"numbers"
|
|
867
|
-
])], 14,
|
|
946
|
+
])], 14, lt))), 128))])])], 2)) : e.block.kind === "table" ? b("", !0) : (M(), x("div", {
|
|
868
947
|
key: 1,
|
|
869
948
|
class: k(["pk-word-preview__block", {
|
|
870
949
|
"pk-word-preview__changed": i.value,
|
|
@@ -875,13 +954,13 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
875
954
|
"aria-level": e.block.kind === "heading" ? Math.max(1, e.block.level) : void 0,
|
|
876
955
|
style: A(n.value)
|
|
877
956
|
}, [
|
|
878
|
-
e.block.label ? (
|
|
957
|
+
e.block.label ? (M(), x("span", {
|
|
879
958
|
key: 0,
|
|
880
959
|
class: "pk-word-preview__label",
|
|
881
960
|
"data-quote-skip": "",
|
|
882
961
|
style: A(r.value)
|
|
883
|
-
},
|
|
884
|
-
w(
|
|
962
|
+
}, I(e.block.label), 5)) : b("", !0),
|
|
963
|
+
w(st, {
|
|
885
964
|
runs: e.block.runs,
|
|
886
965
|
mode: e.mode,
|
|
887
966
|
page: e.page,
|
|
@@ -892,10 +971,10 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
892
971
|
"page",
|
|
893
972
|
"numbers"
|
|
894
973
|
]),
|
|
895
|
-
!e.block.label && !e.block.runs.length ? (
|
|
896
|
-
], 14,
|
|
974
|
+
!e.block.label && !e.block.runs.length ? (M(), x("br", ut)) : b("", !0)
|
|
975
|
+
], 14, $));
|
|
897
976
|
}
|
|
898
|
-
}),
|
|
977
|
+
}), ft = { class: "pk-word-preview__part" }, pt = ["src"], mt = /* @__PURE__ */ T({
|
|
899
978
|
__name: "PkWordPreviewPart",
|
|
900
979
|
props: {
|
|
901
980
|
blocks: {},
|
|
@@ -919,10 +998,10 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
919
998
|
...t.where === "header" ? { top: `${t.section.headerDistance}pt` } : { bottom: `${t.section.footerDistance}pt` }
|
|
920
999
|
};
|
|
921
1000
|
});
|
|
922
|
-
return (t, n) => (
|
|
1001
|
+
return (t, n) => (M(), x("div", ft, [S("div", {
|
|
923
1002
|
class: "pk-word-preview__part-flow",
|
|
924
1003
|
style: A(a.value)
|
|
925
|
-
}, [(
|
|
1004
|
+
}, [(M(!0), x(_, null, P(r.value, (t) => (M(), y(dt, {
|
|
926
1005
|
key: t.key,
|
|
927
1006
|
block: e.blocks[t.block],
|
|
928
1007
|
row: t.row,
|
|
@@ -935,45 +1014,45 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
935
1014
|
"mode",
|
|
936
1015
|
"page",
|
|
937
1016
|
"numbers"
|
|
938
|
-
]))), 128))], 4), (
|
|
1017
|
+
]))), 128))], 4), (M(!0), x(_, null, P(i.value, (e, t) => (M(), x("img", {
|
|
939
1018
|
key: t,
|
|
940
1019
|
class: "pk-word-preview__float",
|
|
941
1020
|
style: A(e.css),
|
|
942
1021
|
src: e.src,
|
|
943
1022
|
alt: ""
|
|
944
|
-
}, null, 12,
|
|
1023
|
+
}, null, 12, pt))), 128))]));
|
|
945
1024
|
}
|
|
946
|
-
}),
|
|
1025
|
+
}), ht = ["aria-label"], gt = {
|
|
947
1026
|
class: "pk-word-preview__tabs",
|
|
948
1027
|
role: "tablist"
|
|
949
|
-
},
|
|
1028
|
+
}, _t = ["aria-selected"], vt = ["aria-selected"], yt = {
|
|
950
1029
|
key: 0,
|
|
951
1030
|
class: "pk-word-preview__list"
|
|
952
|
-
},
|
|
1031
|
+
}, bt = ["aria-current", "onClick"], xt = { class: "pk-word-preview__entry-text" }, St = {
|
|
953
1032
|
key: 0,
|
|
954
1033
|
class: "u-dot"
|
|
955
|
-
},
|
|
1034
|
+
}, Ct = {
|
|
956
1035
|
key: 0,
|
|
957
1036
|
class: "pk-word-preview__none"
|
|
958
|
-
},
|
|
1037
|
+
}, wt = {
|
|
959
1038
|
key: 1,
|
|
960
1039
|
class: "pk-word-preview__list"
|
|
961
|
-
},
|
|
1040
|
+
}, Tt = ["onClick"], Et = {
|
|
962
1041
|
key: 0,
|
|
963
1042
|
class: "pk-word-preview__removed"
|
|
964
|
-
},
|
|
1043
|
+
}, Dt = {
|
|
965
1044
|
key: 1,
|
|
966
1045
|
class: "pk-word-preview__added"
|
|
967
|
-
},
|
|
1046
|
+
}, Ot = { class: "pk-word-preview__main" }, kt = ["aria-label"], At = ["src"], jt = {
|
|
968
1047
|
key: 2,
|
|
969
1048
|
class: "pk-word-preview__truncated"
|
|
970
|
-
},
|
|
1049
|
+
}, Mt = { class: "pk-word-preview__status" }, Nt = {
|
|
971
1050
|
key: 0,
|
|
972
1051
|
class: "pk-word-preview__count"
|
|
973
|
-
},
|
|
1052
|
+
}, Pt = { class: "pk-word-preview__count" }, Ft = {
|
|
974
1053
|
key: 1,
|
|
975
1054
|
class: "pk-word-preview__legend"
|
|
976
|
-
},
|
|
1055
|
+
}, It = ["title"], Lt = { class: "pk-word-preview__removed" }, Rt = { class: "pk-word-preview__added" }, zt = { class: "pk-word-preview__percent" }, Bt = ["data-part"], Vt = 96 / 72, Ht = .5, Ut = /* @__PURE__ */ T({
|
|
977
1056
|
__name: "PkWordPreview",
|
|
978
1057
|
props: /*@__PURE__*/ O({
|
|
979
1058
|
preview: {},
|
|
@@ -991,23 +1070,23 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
991
1070
|
emits: /*@__PURE__*/ O(["select"], ["update:fit", "update:zoom"]),
|
|
992
1071
|
setup(e, { emit: t }) {
|
|
993
1072
|
let n = e, r = t, { t: i } = se({ useScope: "global" });
|
|
994
|
-
|
|
995
|
-
let c = (e) => d(e, n.mode), h = v(() => s(n.preview.blocks, n.mode)), g =
|
|
1073
|
+
ie(p, v(() => n.preview.images));
|
|
1074
|
+
let c = (e) => d(e, n.mode), h = v(() => s(n.preview.blocks, n.mode)), g = z("rootEl"), C = z("scrollEl"), T = z("measureEl"), { width: E } = ce(g), { width: D } = ce(C), O = v(() => E.value >= 1e3), j = v(() => n.preview.sections?.length ? n.preview.sections : [{
|
|
996
1075
|
page: n.preview.page,
|
|
997
1076
|
headerDistance: 0,
|
|
998
1077
|
footerDistance: 0,
|
|
999
1078
|
headers: {},
|
|
1000
1079
|
footers: {}
|
|
1001
|
-
}]),
|
|
1080
|
+
}]), F = v(() => j.value[0].page), B = v(() => (D.value - 48) / (F.value.width * Vt)), H = v(() => E.value === 0 || D.value === 0 || B.value >= Ht), ae = v(() => ({
|
|
1002
1081
|
fontFamily: u(n.preview.defaults.font),
|
|
1003
1082
|
fontSize: `${n.preview.defaults.size}pt`,
|
|
1004
1083
|
color: n.preview.defaults.color ?? "#000000",
|
|
1005
1084
|
"--pk-word-line": o(n.preview.defaults.font),
|
|
1006
1085
|
"--pk-word-size": `${n.preview.defaults.size}pt`
|
|
1007
|
-
})),
|
|
1086
|
+
})), oe = v(() => F.value.width - F.value.margins.left - F.value.margins.right), U = v(() => ({
|
|
1008
1087
|
...ae.value,
|
|
1009
|
-
width: `${
|
|
1010
|
-
})),
|
|
1088
|
+
width: `${oe.value}pt`
|
|
1089
|
+
})), W = z("flowEl"), { width: le } = ce(W), G = v(() => {
|
|
1011
1090
|
let e = /* @__PURE__ */ new Map(), t = 0;
|
|
1012
1091
|
for (let r of n.preview.blocks) {
|
|
1013
1092
|
if (r.kind === "table") continue;
|
|
@@ -1020,37 +1099,37 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
1020
1099
|
let r = 0;
|
|
1021
1100
|
for (let [n, i] of [...e].sort((e, t) => e[0] - t[0])) if (r += i, r > t / 10) return n;
|
|
1022
1101
|
return 0;
|
|
1023
|
-
}),
|
|
1102
|
+
}), ue = v(() => ({
|
|
1024
1103
|
...ae.value,
|
|
1025
|
-
"--pk-word-indent-shared": `${
|
|
1026
|
-
"--pk-word-indent-scale":
|
|
1027
|
-
})),
|
|
1104
|
+
"--pk-word-indent-shared": `${G.value}pt`,
|
|
1105
|
+
"--pk-word-indent-scale": le.value ? Math.min(1, le.value / (oe.value * Vt)) : 1
|
|
1106
|
+
})), K = N([]), de = N({}), pe = async () => {
|
|
1028
1107
|
await te();
|
|
1029
1108
|
let e = T.value?.querySelectorAll("[data-item]");
|
|
1030
|
-
|
|
1109
|
+
K.value = [...e ?? []].map((e) => e.getBoundingClientRect().height);
|
|
1031
1110
|
let t = T.value?.querySelectorAll("[data-part]");
|
|
1032
|
-
|
|
1111
|
+
de.value = Object.fromEntries([...t ?? []].map((e) => [e.dataset.part ?? "", e.getBoundingClientRect().height]));
|
|
1033
1112
|
};
|
|
1034
1113
|
V([
|
|
1035
1114
|
h,
|
|
1036
1115
|
H,
|
|
1037
1116
|
() => n.preview.parts
|
|
1038
|
-
],
|
|
1039
|
-
|
|
1117
|
+
], pe, { flush: "post" }), re(() => {
|
|
1118
|
+
pe(), document.fonts?.ready.then(pe);
|
|
1040
1119
|
});
|
|
1041
1120
|
let q = v(() => {
|
|
1042
|
-
if (!H.value ||
|
|
1121
|
+
if (!H.value || K.value.length !== h.value.length) return [{
|
|
1043
1122
|
items: h.value.map((e, t) => t),
|
|
1044
1123
|
section: 0,
|
|
1045
1124
|
number: 1,
|
|
1046
|
-
top:
|
|
1047
|
-
bottom:
|
|
1125
|
+
top: F.value.margins.top,
|
|
1126
|
+
bottom: F.value.margins.bottom
|
|
1048
1127
|
}];
|
|
1049
1128
|
let e = [], t = 0, r = !0, i = 0, a, o = () => {
|
|
1050
|
-
let n =
|
|
1129
|
+
let n = j.value[t];
|
|
1051
1130
|
return r && n.pageStart !== void 0 ? n.pageStart : (a ?? e[e.length - 1]?.number ?? 0) + 1;
|
|
1052
1131
|
}, s = (e) => {
|
|
1053
|
-
let i =
|
|
1132
|
+
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 ? (de.value[e] ?? 0) / Vt : 0;
|
|
1054
1133
|
return {
|
|
1055
1134
|
header: o,
|
|
1056
1135
|
footer: s,
|
|
@@ -1067,13 +1146,13 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
1067
1146
|
}), r = !1, i = 0;
|
|
1068
1147
|
};
|
|
1069
1148
|
return h.value.forEach((n, l) => {
|
|
1070
|
-
n.section !== void 0 && n.section !== t &&
|
|
1071
|
-
let u = e[e.length - 1], d = u &&
|
|
1072
|
-
for (let e = l; h.value[e]?.keepNext && e + 1 < h.value.length && !h.value[e + 1].breakBefore; e++) p +=
|
|
1073
|
-
(!u || u.items.length && (n.breakBefore || i +
|
|
1149
|
+
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));
|
|
1150
|
+
let u = e[e.length - 1], d = u && j.value[u.section].page, f = d ? (d.height - u.top - u.bottom) * Vt : 0, p = K.value[l];
|
|
1151
|
+
for (let e = l; h.value[e]?.keepNext && e + 1 < h.value.length && !h.value[e + 1].breakBefore; e++) p += K.value[e + 1];
|
|
1152
|
+
(!u || u.items.length && (n.breakBefore || i + K.value[l] > f || i + p > f && p <= (() => {
|
|
1074
1153
|
let e = s(o());
|
|
1075
|
-
return (
|
|
1076
|
-
})())) && c(), e[e.length - 1].items.push(l), i +=
|
|
1154
|
+
return (j.value[t].page.height - e.top - e.bottom) * Vt;
|
|
1155
|
+
})())) && c(), e[e.length - 1].items.push(l), i += K.value[l];
|
|
1077
1156
|
}), e.length || c(), e;
|
|
1078
1157
|
}), me = v(() => {
|
|
1079
1158
|
let e = /* @__PURE__ */ new Map();
|
|
@@ -1083,26 +1162,26 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
1083
1162
|
pages: q.value.length,
|
|
1084
1163
|
sectionPages: e.get(t.section) ?? 1
|
|
1085
1164
|
}));
|
|
1086
|
-
}),
|
|
1087
|
-
let t =
|
|
1165
|
+
}), he = (e) => {
|
|
1166
|
+
let t = j.value[e.section].page;
|
|
1088
1167
|
return {
|
|
1089
1168
|
...ae.value,
|
|
1090
1169
|
width: `${t.width}pt`,
|
|
1091
1170
|
minHeight: `${t.height}pt`,
|
|
1092
1171
|
padding: `${e.top}pt ${t.margins.right}pt ${e.bottom}pt ${t.margins.left}pt`
|
|
1093
1172
|
};
|
|
1094
|
-
},
|
|
1173
|
+
}, ge = (e) => {
|
|
1095
1174
|
let t = [...new Set(e.items.map((e) => h.value[e].block))];
|
|
1096
1175
|
return m(t.map((e) => n.preview.blocks[e]), n.mode).flatMap((t) => {
|
|
1097
1176
|
let r = f(n.preview.images, t.ref);
|
|
1098
1177
|
return r ? [{
|
|
1099
1178
|
src: r,
|
|
1100
|
-
css: l(t,
|
|
1179
|
+
css: l(t, j.value[e.section].page)
|
|
1101
1180
|
}] : [];
|
|
1102
1181
|
});
|
|
1103
|
-
},
|
|
1104
|
-
|
|
1105
|
-
},
|
|
1182
|
+
}, _e = R(e, "fit"), ve = R(e, "zoom"), ye = v(() => _e.value ? Math.min(1.25, Math.max(.3, B.value)) : ve.value), be = (e) => {
|
|
1183
|
+
ve.value = Math.min(2, Math.max(.3, Math.round((ye.value + e) * 10) / 10)), _e.value = !1;
|
|
1184
|
+
}, xe = N(0), Se = N(), Ce = () => {
|
|
1106
1185
|
let e = C.value?.getBoundingClientRect();
|
|
1107
1186
|
if (!e) return;
|
|
1108
1187
|
let t = C.value?.querySelectorAll("[data-page]") ?? [], n = 0;
|
|
@@ -1110,114 +1189,117 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
1110
1189
|
if (i.getBoundingClientRect().top - e.top > e.height / 3) break;
|
|
1111
1190
|
n = r;
|
|
1112
1191
|
}
|
|
1113
|
-
|
|
1192
|
+
xe.value = n;
|
|
1114
1193
|
let r;
|
|
1115
|
-
for (let t of
|
|
1194
|
+
for (let t of J.value) {
|
|
1116
1195
|
let n = C.value?.querySelector(`[data-key="${t.key}"]`);
|
|
1117
1196
|
if (n) {
|
|
1118
1197
|
if (n.getBoundingClientRect().top - e.top > 48) break;
|
|
1119
1198
|
r = t.key;
|
|
1120
1199
|
}
|
|
1121
1200
|
}
|
|
1122
|
-
|
|
1123
|
-
},
|
|
1124
|
-
|
|
1125
|
-
|
|
1201
|
+
Se.value = r ?? J.value[0]?.key;
|
|
1202
|
+
}, we = 0, Ee = () => {
|
|
1203
|
+
we ||= requestAnimationFrame(() => {
|
|
1204
|
+
we = 0, Ce();
|
|
1126
1205
|
});
|
|
1127
1206
|
};
|
|
1128
|
-
|
|
1129
|
-
let { selection:
|
|
1130
|
-
|
|
1207
|
+
ne(() => cancelAnimationFrame(we)), V(q, () => te(Ee));
|
|
1208
|
+
let { selection: De } = fe({
|
|
1209
|
+
root: () => C.value?.getRootNode(),
|
|
1210
|
+
touch: !0
|
|
1211
|
+
});
|
|
1212
|
+
V(De, (e) => {
|
|
1131
1213
|
let t = C.value;
|
|
1132
|
-
r("select", e && t ?
|
|
1214
|
+
r("select", e && t ? Te(t, e.range, ".pk-word-preview__measure, .pk-word-preview__part") : void 0);
|
|
1133
1215
|
});
|
|
1134
|
-
let
|
|
1135
|
-
let t = n.preview.blocks[e.block], r = t.kind === "heading" ? [t.label,
|
|
1216
|
+
let Oe = (e) => c(e).map((e) => e.text).join("").replace(/\s+/g, " ").trim(), J = v(() => h.value.flatMap((e) => {
|
|
1217
|
+
let t = n.preview.blocks[e.block], r = t.kind === "heading" ? [t.label, Oe(t.runs)].filter(Boolean).join(" ") : "";
|
|
1136
1218
|
return t.kind === "heading" && t.level <= 3 && r ? [{
|
|
1137
1219
|
key: e.key,
|
|
1138
1220
|
level: t.level,
|
|
1139
1221
|
text: r
|
|
1140
1222
|
}] : [];
|
|
1141
|
-
})),
|
|
1223
|
+
})), ke = (e) => e.length > 60 ? `${e.slice(0, 60)}…` : e, Y = v(() => h.value.flatMap((e) => {
|
|
1142
1224
|
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();
|
|
1143
1225
|
return i || a ? [{
|
|
1144
1226
|
key: e.key,
|
|
1145
|
-
removed:
|
|
1146
|
-
added:
|
|
1227
|
+
removed: ke(i),
|
|
1228
|
+
added: ke(a)
|
|
1147
1229
|
}] : [];
|
|
1148
|
-
})),
|
|
1230
|
+
})), X;
|
|
1149
1231
|
V([() => n.marked, q], ([e]) => {
|
|
1150
|
-
!e || e ===
|
|
1232
|
+
!e || e === X || H.value && K.value.length !== h.value.length || ee(C.value, ".pk-word-preview__marked") && (X = e);
|
|
1151
1233
|
}, {
|
|
1152
1234
|
flush: "post",
|
|
1153
1235
|
immediate: !0
|
|
1154
1236
|
});
|
|
1155
|
-
let
|
|
1237
|
+
let Z = N("outline"), Ae = N(!1), je = (e) => {
|
|
1156
1238
|
C.value?.querySelector(`[data-key="${e}"]`)?.scrollIntoView({
|
|
1157
1239
|
block: "start",
|
|
1158
1240
|
behavior: "smooth"
|
|
1159
|
-
}), O.value || (
|
|
1160
|
-
},
|
|
1241
|
+
}), O.value || (Ae.value = !1);
|
|
1242
|
+
}, Me = v(() => n.preview.blocks.flatMap((e) => e.kind === "table" ? e.rows.flat().map((e) => Oe(e.runs)) : [Oe(e.runs)]).join(" ").split(/\s+/).filter(Boolean).length), Ne = v(() => n.preview.revisionAuthors.join(", "));
|
|
1161
1243
|
return (t, n) => {
|
|
1162
1244
|
let r = a;
|
|
1163
|
-
return
|
|
1245
|
+
return M(), x("div", {
|
|
1164
1246
|
ref_key: "rootEl",
|
|
1165
1247
|
ref: g,
|
|
1166
1248
|
class: k(["pk-word-preview", { "pk-word-preview--paged": H.value }])
|
|
1167
1249
|
}, [
|
|
1168
|
-
(O.value ||
|
|
1250
|
+
(O.value || Ae.value) && (J.value.length || Y.value.length) ? (M(), x("aside", {
|
|
1169
1251
|
key: 0,
|
|
1170
1252
|
class: k(["pk-word-preview__side", { "pk-word-preview__side--over": !O.value }]),
|
|
1171
|
-
"aria-label":
|
|
1172
|
-
}, [S("div",
|
|
1253
|
+
"aria-label": L(i)("chatFilePreview.outline")
|
|
1254
|
+
}, [S("div", gt, [S("button", {
|
|
1173
1255
|
type: "button",
|
|
1174
1256
|
role: "tab",
|
|
1175
1257
|
class: "pk-word-preview__tab",
|
|
1176
|
-
"aria-selected":
|
|
1177
|
-
onClick: n[0] ||= (e) =>
|
|
1178
|
-
}, L(
|
|
1258
|
+
"aria-selected": Z.value === "outline",
|
|
1259
|
+
onClick: n[0] ||= (e) => Z.value = "outline"
|
|
1260
|
+
}, I(L(i)("chatFilePreview.outline")), 9, _t), Y.value.length ? (M(), x("button", {
|
|
1179
1261
|
key: 0,
|
|
1180
1262
|
type: "button",
|
|
1181
1263
|
role: "tab",
|
|
1182
1264
|
class: "pk-word-preview__tab",
|
|
1183
|
-
"aria-selected":
|
|
1184
|
-
onClick: n[1] ||= (e) =>
|
|
1185
|
-
}, L(
|
|
1265
|
+
"aria-selected": Z.value === "changes",
|
|
1266
|
+
onClick: n[1] ||= (e) => Z.value = "changes"
|
|
1267
|
+
}, I(L(i)("chatFilePreview.changes", { count: Y.value.length })), 9, vt)) : b("", !0)]), Z.value === "outline" || !Y.value.length ? (M(), x("nav", yt, [(M(!0), x(_, null, P(J.value, (e) => (M(), x("button", {
|
|
1186
1268
|
key: e.key,
|
|
1187
1269
|
type: "button",
|
|
1188
1270
|
class: k(["pk-word-preview__entry", `pk-word-preview__entry--${Math.min(e.level, 3)}`]),
|
|
1189
|
-
"aria-current":
|
|
1190
|
-
onClick: (t) =>
|
|
1191
|
-
}, [S("span",
|
|
1271
|
+
"aria-current": Se.value === e.key ? "location" : void 0,
|
|
1272
|
+
onClick: (t) => je(e.key)
|
|
1273
|
+
}, [S("span", xt, I(e.text), 1), Y.value.some((t) => t.key === e.key) ? (M(), x("span", St)) : b("", !0)], 10, bt))), 128)), J.value.length ? b("", !0) : (M(), x("p", Ct, I(L(i)("chatFilePreview.noHeadings")), 1))])) : (M(), x("nav", wt, [(M(!0), x(_, null, P(Y.value, (e) => (M(), x("button", {
|
|
1192
1274
|
key: e.key,
|
|
1193
1275
|
type: "button",
|
|
1194
1276
|
class: "pk-word-preview__entry pk-word-preview__entry--change",
|
|
1195
|
-
onClick: (t) =>
|
|
1196
|
-
}, [e.removed ? (
|
|
1197
|
-
S("div",
|
|
1277
|
+
onClick: (t) => je(e.key)
|
|
1278
|
+
}, [e.removed ? (M(), x("del", Et, I(e.removed), 1)) : b("", !0), e.added ? (M(), x("ins", Dt, I(e.added), 1)) : b("", !0)], 8, Tt))), 128))]))], 10, ht)) : b("", !0),
|
|
1279
|
+
S("div", Ot, [S("div", {
|
|
1198
1280
|
ref_key: "scrollEl",
|
|
1199
1281
|
ref: C,
|
|
1200
1282
|
class: "pk-word-preview__scroll",
|
|
1201
|
-
onScroll:
|
|
1202
|
-
}, [H.value ? (
|
|
1283
|
+
onScroll: Ee
|
|
1284
|
+
}, [H.value ? (M(), x("div", {
|
|
1203
1285
|
key: 0,
|
|
1204
1286
|
class: "pk-word-preview__pages",
|
|
1205
|
-
style: A({ zoom:
|
|
1206
|
-
}, [(
|
|
1287
|
+
style: A({ zoom: ye.value })
|
|
1288
|
+
}, [(M(!0), x(_, null, P(q.value, (t, n) => (M(), x("article", {
|
|
1207
1289
|
key: n,
|
|
1208
1290
|
"data-page": "",
|
|
1209
1291
|
class: "pk-word-preview__page",
|
|
1210
|
-
"aria-label":
|
|
1292
|
+
"aria-label": L(i)("chatFilePreview.pageOf", {
|
|
1211
1293
|
page: n + 1,
|
|
1212
1294
|
count: q.value.length
|
|
1213
1295
|
}),
|
|
1214
|
-
style: A(
|
|
1296
|
+
style: A(he(t))
|
|
1215
1297
|
}, [
|
|
1216
|
-
t.header && e.preview.parts?.[t.header] ? (
|
|
1298
|
+
t.header && e.preview.parts?.[t.header] ? (M(), y(mt, {
|
|
1217
1299
|
key: 0,
|
|
1218
1300
|
blocks: e.preview.parts[t.header],
|
|
1219
1301
|
where: "header",
|
|
1220
|
-
section:
|
|
1302
|
+
section: j.value[t.section],
|
|
1221
1303
|
mode: e.mode,
|
|
1222
1304
|
numbers: me.value[n]
|
|
1223
1305
|
}, null, 8, [
|
|
@@ -1226,13 +1308,13 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
1226
1308
|
"mode",
|
|
1227
1309
|
"numbers"
|
|
1228
1310
|
])) : b("", !0),
|
|
1229
|
-
(
|
|
1311
|
+
(M(!0), x(_, null, P(t.items, (r) => (M(), y(dt, {
|
|
1230
1312
|
key: h.value[r].key,
|
|
1231
1313
|
"data-key": h.value[r].key,
|
|
1232
1314
|
block: e.preview.blocks[h.value[r].block],
|
|
1233
1315
|
row: h.value[r].row,
|
|
1234
1316
|
mode: e.mode,
|
|
1235
|
-
page:
|
|
1317
|
+
page: j.value[t.section].page,
|
|
1236
1318
|
numbers: me.value[n],
|
|
1237
1319
|
marked: e.marked
|
|
1238
1320
|
}, null, 8, [
|
|
@@ -1244,18 +1326,18 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
1244
1326
|
"numbers",
|
|
1245
1327
|
"marked"
|
|
1246
1328
|
]))), 128)),
|
|
1247
|
-
(
|
|
1329
|
+
(M(!0), x(_, null, P(ge(t), (e, t) => (M(), x("img", {
|
|
1248
1330
|
key: `image-${t}`,
|
|
1249
1331
|
class: "pk-word-preview__float",
|
|
1250
1332
|
style: A(e.css),
|
|
1251
1333
|
src: e.src,
|
|
1252
1334
|
alt: ""
|
|
1253
|
-
}, null, 12,
|
|
1254
|
-
t.footer && e.preview.parts?.[t.footer] ? (
|
|
1335
|
+
}, null, 12, At))), 128)),
|
|
1336
|
+
t.footer && e.preview.parts?.[t.footer] ? (M(), y(mt, {
|
|
1255
1337
|
key: 1,
|
|
1256
1338
|
blocks: e.preview.parts[t.footer],
|
|
1257
1339
|
where: "footer",
|
|
1258
|
-
section:
|
|
1340
|
+
section: j.value[t.section],
|
|
1259
1341
|
mode: e.mode,
|
|
1260
1342
|
numbers: me.value[n]
|
|
1261
1343
|
}, null, 8, [
|
|
@@ -1264,13 +1346,13 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
1264
1346
|
"mode",
|
|
1265
1347
|
"numbers"
|
|
1266
1348
|
])) : b("", !0)
|
|
1267
|
-
], 12,
|
|
1349
|
+
], 12, kt))), 128))], 4)) : (M(), x("article", {
|
|
1268
1350
|
key: 1,
|
|
1269
1351
|
ref_key: "flowEl",
|
|
1270
|
-
ref:
|
|
1352
|
+
ref: W,
|
|
1271
1353
|
class: "pk-word-preview__page pk-word-preview__page--flow",
|
|
1272
|
-
style: A(
|
|
1273
|
-
}, [(
|
|
1354
|
+
style: A(ue.value)
|
|
1355
|
+
}, [(M(!0), x(_, null, P(h.value, (t) => (M(), y(dt, {
|
|
1274
1356
|
key: t.key,
|
|
1275
1357
|
"data-key": t.key,
|
|
1276
1358
|
block: e.preview.blocks[t.block],
|
|
@@ -1283,47 +1365,47 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
1283
1365
|
"row",
|
|
1284
1366
|
"mode",
|
|
1285
1367
|
"marked"
|
|
1286
|
-
]))), 128))], 4)), e.preview.truncated ? (
|
|
1287
|
-
H.value ? (
|
|
1288
|
-
page:
|
|
1368
|
+
]))), 128))], 4)), e.preview.truncated ? (M(), x("p", jt, I(L(i)("chatFilePreview.truncated")), 1)) : b("", !0)], 544), S("div", Mt, [
|
|
1369
|
+
H.value ? (M(), x("span", Nt, I(L(i)("chatFilePreview.pageOf", {
|
|
1370
|
+
page: xe.value + 1,
|
|
1289
1371
|
count: q.value.length
|
|
1290
1372
|
})), 1)) : b("", !0),
|
|
1291
|
-
S("span",
|
|
1292
|
-
e.mode === "markup" && e.preview.revisionAuthors.length ? (
|
|
1373
|
+
S("span", Pt, I(L(i)("chatFilePreview.words", Me.value)), 1),
|
|
1374
|
+
e.mode === "markup" && e.preview.revisionAuthors.length ? (M(), x("span", Ft, [
|
|
1293
1375
|
S("span", {
|
|
1294
1376
|
class: "pk-word-preview__legend-text",
|
|
1295
|
-
title:
|
|
1296
|
-
}, L(
|
|
1297
|
-
S("del",
|
|
1298
|
-
S("ins",
|
|
1377
|
+
title: L(i)("chatFilePreview.revisionsOf", { authors: Ne.value })
|
|
1378
|
+
}, I(L(i)("chatFilePreview.revisionsOf", { authors: Ne.value })), 9, It),
|
|
1379
|
+
S("del", Lt, I(L(i)("chatFilePreview.removed")), 1),
|
|
1380
|
+
S("ins", Rt, I(L(i)("chatFilePreview.added")), 1)
|
|
1299
1381
|
])) : b("", !0),
|
|
1300
1382
|
n[6] ||= S("span", { class: "pk-word-preview__spacer" }, null, -1),
|
|
1301
|
-
!O.value && (
|
|
1383
|
+
!O.value && (J.value.length || Y.value.length) ? (M(), y(r, {
|
|
1302
1384
|
key: 2,
|
|
1303
1385
|
class: "pk-word-preview__outline-toggle",
|
|
1304
1386
|
modifiers: "action-quiet",
|
|
1305
1387
|
icon: "ri:list-unordered",
|
|
1306
|
-
label:
|
|
1307
|
-
title:
|
|
1308
|
-
"aria-label":
|
|
1309
|
-
"aria-expanded":
|
|
1310
|
-
onClick: n[2] ||= (e) =>
|
|
1388
|
+
label: L(i)("chatFilePreview.outline"),
|
|
1389
|
+
title: L(i)("chatFilePreview.outline"),
|
|
1390
|
+
"aria-label": L(i)("chatFilePreview.outline"),
|
|
1391
|
+
"aria-expanded": Ae.value,
|
|
1392
|
+
onClick: n[2] ||= (e) => Ae.value = !Ae.value
|
|
1311
1393
|
}, null, 8, [
|
|
1312
1394
|
"label",
|
|
1313
1395
|
"title",
|
|
1314
1396
|
"aria-label",
|
|
1315
1397
|
"aria-expanded"
|
|
1316
1398
|
])) : b("", !0),
|
|
1317
|
-
H.value ? (
|
|
1399
|
+
H.value ? (M(), x(_, { key: 3 }, [
|
|
1318
1400
|
w(r, {
|
|
1319
1401
|
class: "pk-word-preview__fit",
|
|
1320
1402
|
modifiers: "action-quiet",
|
|
1321
1403
|
icon: "ri:expand-width-line",
|
|
1322
|
-
label:
|
|
1323
|
-
title:
|
|
1324
|
-
"aria-label":
|
|
1325
|
-
disabled:
|
|
1326
|
-
onClick: n[3] ||= (e) =>
|
|
1404
|
+
label: L(i)("chatFilePreview.fitWidth"),
|
|
1405
|
+
title: L(i)("chatFilePreview.fitWidth"),
|
|
1406
|
+
"aria-label": L(i)("chatFilePreview.fitWidth"),
|
|
1407
|
+
disabled: _e.value,
|
|
1408
|
+
onClick: n[3] ||= (e) => _e.value = !0
|
|
1327
1409
|
}, null, 8, [
|
|
1328
1410
|
"label",
|
|
1329
1411
|
"title",
|
|
@@ -1333,71 +1415,71 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
1333
1415
|
w(r, {
|
|
1334
1416
|
modifiers: "action-quiet",
|
|
1335
1417
|
icon: "ri:subtract-line",
|
|
1336
|
-
"aria-label":
|
|
1337
|
-
disabled:
|
|
1338
|
-
onClick: n[4] ||= (e) =>
|
|
1418
|
+
"aria-label": L(i)("chatFilePreview.zoomOut"),
|
|
1419
|
+
disabled: ye.value <= .3,
|
|
1420
|
+
onClick: n[4] ||= (e) => be(-.1)
|
|
1339
1421
|
}, null, 8, ["aria-label", "disabled"]),
|
|
1340
|
-
S("span",
|
|
1422
|
+
S("span", zt, I(Math.round(ye.value * 100)) + "% ", 1),
|
|
1341
1423
|
w(r, {
|
|
1342
1424
|
modifiers: "action-quiet",
|
|
1343
1425
|
icon: "ri:add-line",
|
|
1344
|
-
"aria-label":
|
|
1345
|
-
disabled:
|
|
1346
|
-
onClick: n[5] ||= (e) =>
|
|
1426
|
+
"aria-label": L(i)("chatFilePreview.zoomIn"),
|
|
1427
|
+
disabled: ye.value >= 2,
|
|
1428
|
+
onClick: n[5] ||= (e) => be(.1)
|
|
1347
1429
|
}, null, 8, ["aria-label", "disabled"])
|
|
1348
1430
|
], 64)) : b("", !0)
|
|
1349
1431
|
])]),
|
|
1350
|
-
H.value ? (
|
|
1432
|
+
H.value ? (M(), x("div", {
|
|
1351
1433
|
key: 1,
|
|
1352
1434
|
ref_key: "measureEl",
|
|
1353
1435
|
ref: T,
|
|
1354
1436
|
class: "pk-word-preview__measure",
|
|
1355
1437
|
"aria-hidden": "true",
|
|
1356
|
-
style: A(
|
|
1357
|
-
}, [(
|
|
1438
|
+
style: A(U.value)
|
|
1439
|
+
}, [(M(!0), x(_, null, P(h.value, (t) => (M(), x("div", {
|
|
1358
1440
|
key: t.key,
|
|
1359
1441
|
"data-item": ""
|
|
1360
|
-
}, [w(
|
|
1442
|
+
}, [w(dt, {
|
|
1361
1443
|
block: e.preview.blocks[t.block],
|
|
1362
1444
|
row: t.row,
|
|
1363
1445
|
mode: e.mode,
|
|
1364
|
-
page:
|
|
1446
|
+
page: F.value
|
|
1365
1447
|
}, null, 8, [
|
|
1366
1448
|
"block",
|
|
1367
1449
|
"row",
|
|
1368
1450
|
"mode",
|
|
1369
1451
|
"page"
|
|
1370
|
-
])]))), 128)), (
|
|
1452
|
+
])]))), 128)), (M(!0), x(_, null, P(e.preview.parts, (t, n) => (M(), x("div", {
|
|
1371
1453
|
key: n,
|
|
1372
1454
|
"data-part": n
|
|
1373
|
-
}, [(
|
|
1455
|
+
}, [(M(!0), x(_, null, P(L(s)(t, e.mode), (n) => (M(), y(dt, {
|
|
1374
1456
|
key: n.key,
|
|
1375
1457
|
block: t[n.block],
|
|
1376
1458
|
row: n.row,
|
|
1377
1459
|
mode: e.mode,
|
|
1378
|
-
page:
|
|
1460
|
+
page: F.value
|
|
1379
1461
|
}, null, 8, [
|
|
1380
1462
|
"block",
|
|
1381
1463
|
"row",
|
|
1382
1464
|
"mode",
|
|
1383
1465
|
"page"
|
|
1384
|
-
]))), 128))], 8,
|
|
1466
|
+
]))), 128))], 8, Bt))), 128))], 4)) : b("", !0)
|
|
1385
1467
|
], 2);
|
|
1386
1468
|
};
|
|
1387
1469
|
}
|
|
1388
|
-
}),
|
|
1470
|
+
}), Wt = ["aria-label"], Gt = { class: "pk-file-preview__head" }, Kt = { class: "pk-file-preview__file" }, qt = {
|
|
1389
1471
|
class: "pk-file-preview__tile",
|
|
1390
1472
|
"aria-hidden": "true"
|
|
1391
|
-
},
|
|
1473
|
+
}, Jt = { class: "pk-file-preview__name" }, Yt = { class: "pk-file-preview__title" }, Xt = { class: "pk-file-preview__note" }, Zt = {
|
|
1392
1474
|
key: 0,
|
|
1393
1475
|
class: "pk-file-preview__tools"
|
|
1394
|
-
},
|
|
1476
|
+
}, Qt = ["aria-label"], $t = { class: "pk-file-preview__version" }, en = { class: "pk-file-preview__mode-long" }, tn = { class: "pk-file-preview__mode-short" }, nn = { class: "pk-file-preview__actions" }, rn = { class: "pk-file-preview__body" }, an = {
|
|
1395
1477
|
key: 0,
|
|
1396
1478
|
class: "pk-file-preview__skeleton vv-skeleton"
|
|
1397
|
-
},
|
|
1479
|
+
}, on = {
|
|
1398
1480
|
key: 1,
|
|
1399
1481
|
class: "pk-file-preview__empty"
|
|
1400
|
-
},
|
|
1482
|
+
}, sn = /*@__PURE__*/ T({
|
|
1401
1483
|
__name: "PkFilePreview",
|
|
1402
1484
|
props: /*@__PURE__*/ O({
|
|
1403
1485
|
kind: {},
|
|
@@ -1440,7 +1522,7 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
1440
1522
|
"update:fit"
|
|
1441
1523
|
]),
|
|
1442
1524
|
setup(e, { emit: n }) {
|
|
1443
|
-
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 =
|
|
1525
|
+
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(() => [
|
|
1444
1526
|
{
|
|
1445
1527
|
value: "markup",
|
|
1446
1528
|
label: o("chatFilePreview.modeMarkup")
|
|
@@ -1457,7 +1539,7 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
1457
1539
|
V(() => r.version, () => {
|
|
1458
1540
|
f.value = "markup";
|
|
1459
1541
|
});
|
|
1460
|
-
let T =
|
|
1542
|
+
let T = z("rootEl"), E = F(), D = N(!1), O = () => {
|
|
1461
1543
|
E.value = void 0, D.value = !1;
|
|
1462
1544
|
};
|
|
1463
1545
|
V(() => [
|
|
@@ -1468,32 +1550,32 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
1468
1550
|
], O);
|
|
1469
1551
|
let A = (e) => {
|
|
1470
1552
|
D.value || (E.value = e);
|
|
1471
|
-
};
|
|
1553
|
+
}, ne = v(() => E.value?.format === "docx" && K());
|
|
1472
1554
|
V(D, async (e, t) => {
|
|
1473
1555
|
let n = E.value;
|
|
1474
1556
|
t && !e && n?.format === "docx" && (await te(), n.restore());
|
|
1475
1557
|
});
|
|
1476
|
-
let
|
|
1558
|
+
let re = v(() => !r.version || r.version === c.value[c.value.length - 1]), j = () => {
|
|
1477
1559
|
let e = c.value[c.value.length - 1];
|
|
1478
1560
|
e && i("version", e);
|
|
1479
|
-
},
|
|
1561
|
+
}, ie = v(() => {
|
|
1480
1562
|
let e = E.value;
|
|
1481
|
-
return e?.format === "docx" ? e.paragraphCount > 200 : (e?.cells ?? 0) >
|
|
1482
|
-
}),
|
|
1563
|
+
return e?.format === "docx" ? e.paragraphCount > 200 : (e?.cells ?? 0) > pe;
|
|
1564
|
+
}), B = v(() => E.value?.format === "docx" && f.value === "original"), ae = v(() => ie.value || B.value), oe = v(() => B.value ? o("selectionActions.hintOriginal") : ie.value ? o(E.value?.format === "docx" ? "selectionActions.hintParagraphs" : "selectionActions.hintCells", { count: E.value?.format === "docx" ? 200 : pe }) : void 0), U = (e) => e[s.value] ?? e[s.value.split("-")[0]] ?? Object.values(e)[0] ?? "", ce = ["explain", "summarize"], le = v(() => {
|
|
1483
1565
|
let e = E.value, t = r.selectionActions;
|
|
1484
1566
|
if (!e || !t) return [];
|
|
1485
1567
|
let n = e.format;
|
|
1486
|
-
return [...(n === "docx" &&
|
|
1568
|
+
return [...(n === "docx" && ae.value ? ce : t.builtIns).map((e) => ({
|
|
1487
1569
|
id: e,
|
|
1488
1570
|
label: o(`selectionActions.builtIn.${e}`),
|
|
1489
1571
|
...e === "translate" && { asks: o("selectionActions.translateAsks") },
|
|
1490
1572
|
prompt: (t) => o(`selectionActions.prompt.${n}.${e}`, { language: t ?? "" })
|
|
1491
|
-
})), ...(
|
|
1573
|
+
})), ...(ae.value ? [] : t.actions).map((e) => ({
|
|
1492
1574
|
id: e.id,
|
|
1493
1575
|
label: U(e.label),
|
|
1494
1576
|
prompt: () => U(e.prompt)
|
|
1495
1577
|
}))];
|
|
1496
|
-
}),
|
|
1578
|
+
}), G = (e) => {
|
|
1497
1579
|
if (e.format === "docx") return o("selectionActions.labelParagraphs", {
|
|
1498
1580
|
file: r.filename,
|
|
1499
1581
|
count: e.paragraphCount
|
|
@@ -1515,14 +1597,14 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
1515
1597
|
fileId: r.fileId,
|
|
1516
1598
|
version: r.version ?? 1,
|
|
1517
1599
|
storedFileName: r.storedFileName,
|
|
1518
|
-
label:
|
|
1600
|
+
label: G(e).slice(0, 200)
|
|
1519
1601
|
};
|
|
1520
1602
|
if (e.format === "docx") {
|
|
1521
1603
|
let { measure: n, ...r } = e;
|
|
1522
1604
|
return {
|
|
1523
1605
|
...t,
|
|
1524
1606
|
...r,
|
|
1525
|
-
...
|
|
1607
|
+
...B.value && { original: !0 }
|
|
1526
1608
|
};
|
|
1527
1609
|
}
|
|
1528
1610
|
let { measure: n, cells: i, ...a } = e;
|
|
@@ -1536,16 +1618,16 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
1536
1618
|
id: t,
|
|
1537
1619
|
size: n.format === "docx" ? n.paragraphCount : n.cells
|
|
1538
1620
|
}), O(), document.getSelection()?.removeAllRanges());
|
|
1539
|
-
},
|
|
1540
|
-
let n =
|
|
1621
|
+
}, fe = (e, t) => {
|
|
1622
|
+
let n = le.value.find((t) => t.id === e);
|
|
1541
1623
|
n && de(n.prompt(t), e);
|
|
1542
|
-
},
|
|
1543
|
-
|
|
1624
|
+
}, q = N(0);
|
|
1625
|
+
W(T, "scroll", () => q.value++, {
|
|
1544
1626
|
capture: !0,
|
|
1545
1627
|
passive: !0
|
|
1546
|
-
}),
|
|
1547
|
-
let
|
|
1548
|
-
|
|
1628
|
+
}), W(window, "resize", () => q.value++, { passive: !0 });
|
|
1629
|
+
let me = v(() => {
|
|
1630
|
+
q.value;
|
|
1549
1631
|
let e = E.value?.measure(), t = T.value?.getBoundingClientRect();
|
|
1550
1632
|
if (e && t) return {
|
|
1551
1633
|
start: {
|
|
@@ -1563,7 +1645,7 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
1563
1645
|
});
|
|
1564
1646
|
return (n, r) => {
|
|
1565
1647
|
let s = g, l = a;
|
|
1566
|
-
return
|
|
1648
|
+
return M(), x("section", {
|
|
1567
1649
|
ref_key: "rootEl",
|
|
1568
1650
|
ref: T,
|
|
1569
1651
|
class: "pk-file-preview",
|
|
@@ -1571,57 +1653,57 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
1571
1653
|
tabindex: "-1",
|
|
1572
1654
|
autofocus: ""
|
|
1573
1655
|
}, [
|
|
1574
|
-
S("header",
|
|
1575
|
-
S("div",
|
|
1656
|
+
S("header", Gt, [
|
|
1657
|
+
S("div", Kt, [S("span", qt, [w(s, {
|
|
1576
1658
|
name: e.kind === "word" ? "ri:file-word-2-line" : "ri:file-excel-2-line",
|
|
1577
1659
|
class: k(e.kind === "word" ? "pk-file-preview__icon--word" : "pk-file-preview__icon--sheet")
|
|
1578
|
-
}, null, 8, ["name", "class"])]), S("div",
|
|
1579
|
-
e.version && c.value.length > 1 || C.value ? (
|
|
1660
|
+
}, null, 8, ["name", "class"])]), S("div", Jt, [S("strong", Yt, I(e.filename), 1), S("span", Xt, I(L(o)("chatFilePreview.readOnly")), 1)])]),
|
|
1661
|
+
e.version && c.value.length > 1 || C.value ? (M(), x("div", Zt, [e.version && c.value.length > 1 ? (M(), x("nav", {
|
|
1580
1662
|
key: 0,
|
|
1581
1663
|
class: "pk-file-preview__versions",
|
|
1582
|
-
"aria-label":
|
|
1664
|
+
"aria-label": L(o)("chatFilePreview.versions")
|
|
1583
1665
|
}, [
|
|
1584
1666
|
w(l, {
|
|
1585
1667
|
modifiers: "action-quiet",
|
|
1586
1668
|
icon: "ri:arrow-left-s-line",
|
|
1587
|
-
"aria-label":
|
|
1669
|
+
"aria-label": L(o)("chatFilePreview.previousVersion"),
|
|
1588
1670
|
disabled: !u.value,
|
|
1589
1671
|
onClick: r[0] ||= (e) => u.value && i("version", u.value)
|
|
1590
1672
|
}, null, 8, ["aria-label", "disabled"]),
|
|
1591
|
-
S("span",
|
|
1673
|
+
S("span", $t, I(L(o)("chatFilePreview.versionOf", {
|
|
1592
1674
|
version: e.version,
|
|
1593
1675
|
count: c.value.length
|
|
1594
1676
|
})), 1),
|
|
1595
1677
|
w(l, {
|
|
1596
1678
|
modifiers: "action-quiet",
|
|
1597
1679
|
icon: "ri:arrow-right-s-line",
|
|
1598
|
-
"aria-label":
|
|
1680
|
+
"aria-label": L(o)("chatFilePreview.nextVersion"),
|
|
1599
1681
|
disabled: !d.value,
|
|
1600
1682
|
onClick: r[1] ||= (e) => d.value && i("version", d.value)
|
|
1601
1683
|
}, null, 8, ["aria-label", "disabled"])
|
|
1602
|
-
], 8,
|
|
1684
|
+
], 8, Qt)) : b("", !0), C.value ? (M(), y(t, {
|
|
1603
1685
|
key: 1,
|
|
1604
1686
|
modelValue: f.value,
|
|
1605
1687
|
"onUpdate:modelValue": r[2] ||= (e) => f.value = e,
|
|
1606
1688
|
name: "revisions",
|
|
1607
1689
|
segmented: "",
|
|
1608
1690
|
class: "pk-file-preview__modes u-segmented-fit mb-0",
|
|
1609
|
-
"aria-label":
|
|
1691
|
+
"aria-label": L(o)("chatFilePreview.modes"),
|
|
1610
1692
|
options: ee.value
|
|
1611
1693
|
}, {
|
|
1612
|
-
markup: H(() => [S("span",
|
|
1694
|
+
markup: H(() => [S("span", en, I(L(o)("chatFilePreview.modeMarkup")), 1), S("span", tn, I(L(o)("chatFilePreview.modeMarkupShort")), 1)]),
|
|
1613
1695
|
_: 1
|
|
1614
1696
|
}, 8, [
|
|
1615
1697
|
"modelValue",
|
|
1616
1698
|
"aria-label",
|
|
1617
1699
|
"options"
|
|
1618
1700
|
])) : b("", !0)])) : b("", !0),
|
|
1619
|
-
S("div",
|
|
1620
|
-
e.restorable ? (
|
|
1701
|
+
S("div", nn, [
|
|
1702
|
+
e.restorable ? (M(), y(l, {
|
|
1621
1703
|
key: 0,
|
|
1622
1704
|
modifiers: "action-quiet",
|
|
1623
1705
|
icon: "ri:arrow-go-back-line",
|
|
1624
|
-
label:
|
|
1706
|
+
label: L(o)("chatFilePreview.restore"),
|
|
1625
1707
|
onClick: r[3] ||= (e) => i("restore")
|
|
1626
1708
|
}, null, 8, ["label"])) : b("", !0),
|
|
1627
1709
|
w(l, {
|
|
@@ -1629,41 +1711,41 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
1629
1711
|
download: "",
|
|
1630
1712
|
modifiers: "action-quiet",
|
|
1631
1713
|
icon: "ri:download-line",
|
|
1632
|
-
title:
|
|
1633
|
-
"aria-label":
|
|
1714
|
+
title: L(o)("chatFilePreview.download"),
|
|
1715
|
+
"aria-label": L(o)("chatFilePreview.download")
|
|
1634
1716
|
}, null, 8, [
|
|
1635
1717
|
"href",
|
|
1636
1718
|
"title",
|
|
1637
1719
|
"aria-label"
|
|
1638
1720
|
]),
|
|
1639
|
-
e.resize === "expand" ? (
|
|
1721
|
+
e.resize === "expand" ? (M(), y(l, {
|
|
1640
1722
|
key: 1,
|
|
1641
1723
|
modifiers: "action-quiet",
|
|
1642
1724
|
icon: "ri:fullscreen-line",
|
|
1643
|
-
title:
|
|
1644
|
-
"aria-label":
|
|
1725
|
+
title: L(o)("chatFilePreview.expand"),
|
|
1726
|
+
"aria-label": L(o)("chatFilePreview.expand"),
|
|
1645
1727
|
onClick: r[4] ||= (e) => i("resize")
|
|
1646
|
-
}, null, 8, ["title", "aria-label"])) : e.resize === "shrink" ? (
|
|
1728
|
+
}, null, 8, ["title", "aria-label"])) : e.resize === "shrink" ? (M(), y(l, {
|
|
1647
1729
|
key: 2,
|
|
1648
1730
|
modifiers: "action-quiet",
|
|
1649
1731
|
icon: "ri:fullscreen-exit-line",
|
|
1650
|
-
title:
|
|
1651
|
-
"aria-label":
|
|
1732
|
+
title: L(o)("chatFilePreview.shrink"),
|
|
1733
|
+
"aria-label": L(o)("chatFilePreview.shrink"),
|
|
1652
1734
|
onClick: r[5] ||= (e) => i("resize")
|
|
1653
1735
|
}, null, 8, ["title", "aria-label"])) : b("", !0),
|
|
1654
1736
|
w(l, {
|
|
1655
1737
|
modifiers: "action-quiet",
|
|
1656
1738
|
icon: "ri:close-line",
|
|
1657
|
-
title:
|
|
1658
|
-
"aria-label":
|
|
1739
|
+
title: L(o)("chatFilePreview.close"),
|
|
1740
|
+
"aria-label": L(o)("chatFilePreview.close"),
|
|
1659
1741
|
onClick: r[6] ||= (e) => i("close")
|
|
1660
1742
|
}, null, 8, ["title", "aria-label"])
|
|
1661
1743
|
])
|
|
1662
1744
|
]),
|
|
1663
|
-
S("div",
|
|
1745
|
+
S("div", rn, [e.loading ? (M(), x("div", an, [(M(), x(_, null, P(8, (e) => S("div", {
|
|
1664
1746
|
key: e,
|
|
1665
1747
|
class: k(["vv-skeleton__item pk-file-preview__skeleton-line", e % 3 ? "w-full" : "w-128"])
|
|
1666
|
-
}, null, 2)), 64))])) : e.error || !e.preview ? (
|
|
1748
|
+
}, null, 2)), 64))])) : e.error || !e.preview ? (M(), x("p", on, I(L(o)("chatFilePreview.unavailable")), 1)) : e.preview.kind === "word" ? (M(), y(Ut, {
|
|
1667
1749
|
key: 2,
|
|
1668
1750
|
zoom: m.value,
|
|
1669
1751
|
"onUpdate:zoom": r[7] ||= (e) => m.value = e,
|
|
@@ -1679,7 +1761,7 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
1679
1761
|
"preview",
|
|
1680
1762
|
"mode",
|
|
1681
1763
|
"marked"
|
|
1682
|
-
])) : (
|
|
1764
|
+
])) : (M(), y(nt, {
|
|
1683
1765
|
key: 3,
|
|
1684
1766
|
sheet: p.value,
|
|
1685
1767
|
"onUpdate:sheet": r[9] ||= (e) => p.value = e,
|
|
@@ -1694,32 +1776,34 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
1694
1776
|
"preview",
|
|
1695
1777
|
"marked"
|
|
1696
1778
|
]))]),
|
|
1697
|
-
e.selectionActions && E.value &&
|
|
1779
|
+
e.selectionActions && E.value && me.value ? (M(), y(je, {
|
|
1698
1780
|
key: 0,
|
|
1699
1781
|
asking: D.value,
|
|
1700
1782
|
"onUpdate:asking": r[11] ||= (e) => D.value = e,
|
|
1701
1783
|
strategy: "absolute",
|
|
1702
|
-
anchor:
|
|
1703
|
-
actions:
|
|
1704
|
-
hint:
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1784
|
+
anchor: me.value,
|
|
1785
|
+
actions: le.value,
|
|
1786
|
+
hint: oe.value,
|
|
1787
|
+
touch: ne.value,
|
|
1788
|
+
note: re.value ? void 0 : L(o)("selectionActions.notLatest", { version: e.version }),
|
|
1789
|
+
"note-action": L(o)("selectionActions.openLatest"),
|
|
1790
|
+
onAction: fe,
|
|
1708
1791
|
onAsk: r[12] ||= (e) => de(e, "ask"),
|
|
1709
|
-
onNote:
|
|
1792
|
+
onNote: j,
|
|
1710
1793
|
onClose: O
|
|
1711
1794
|
}, null, 8, [
|
|
1712
1795
|
"asking",
|
|
1713
1796
|
"anchor",
|
|
1714
1797
|
"actions",
|
|
1715
1798
|
"hint",
|
|
1799
|
+
"touch",
|
|
1716
1800
|
"note",
|
|
1717
1801
|
"note-action"
|
|
1718
1802
|
])) : b("", !0)
|
|
1719
|
-
], 8,
|
|
1803
|
+
], 8, Wt);
|
|
1720
1804
|
};
|
|
1721
1805
|
}
|
|
1722
|
-
}),
|
|
1723
|
-
export {
|
|
1806
|
+
}), cn = /* @__PURE__ */ e({ default: () => ln }), ln = sn;
|
|
1807
|
+
export { cn as n, ln as t };
|
|
1724
1808
|
|
|
1725
|
-
//# sourceMappingURL=PkFilePreview-
|
|
1809
|
+
//# sourceMappingURL=PkFilePreview-CTsoIgC0.js.map
|