@8wave/ai-elements 0.125.0-beta.40 → 0.125.0-beta.42
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-CeZ3bgZ3.js → Agent-DMvYDpLa.js} +123 -122
- package/dist/_chunks/Agent-DMvYDpLa.js.map +1 -0
- package/dist/_chunks/{PkFilePreview-D_1ZgiiA.js → PkFilePreview-DC4iX7Yc.js} +234 -209
- package/dist/_chunks/PkFilePreview-DC4iX7Yc.js.map +1 -0
- package/dist/_chunks/{PkFilePreviewDialog-CI22huzK.js → PkFilePreviewDialog-bcTkTcYk.js} +12 -7
- package/dist/_chunks/PkFilePreviewDialog-bcTkTcYk.js.map +1 -0
- package/dist/_chunks/{PkImageEditorDialog-CAEninFi.js → PkImageEditorDialog-FpbyhV3t.js} +2 -2
- package/dist/_chunks/{PkImageEditorDialog-CAEninFi.js.map → PkImageEditorDialog-FpbyhV3t.js.map} +1 -1
- package/dist/_chunks/{PkSelectionActions-BriGyWCi.js → PkSelectionActions-BbfVZY0R.js} +140 -13
- package/dist/_chunks/PkSelectionActions-BbfVZY0R.js.map +1 -0
- package/dist/_chunks/{PkStreamingMarkdown--9i0feuM.js → PkStreamingMarkdown-COSOOhCg.js} +3 -3
- package/dist/_chunks/{PkStreamingMarkdown--9i0feuM.js.map → PkStreamingMarkdown-COSOOhCg.js.map} +1 -1
- package/dist/_chunks/{PkToolChatFile-BKGUnWrj.js → PkToolChatFile-C_gS0X1j.js} +3 -3
- package/dist/_chunks/{PkToolChatFile-BKGUnWrj.js.map → PkToolChatFile-C_gS0X1j.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestGeolocation-DktrQJvA.js → PkToolRequestGeolocation-CwDQnr7u.js} +2 -2
- package/dist/_chunks/{PkToolRequestGeolocation-DktrQJvA.js.map → PkToolRequestGeolocation-CwDQnr7u.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestOAuthConnection-DkcLwFWl.js → PkToolRequestOAuthConnection-DkrnVowp.js} +2 -2
- package/dist/_chunks/{PkToolRequestOAuthConnection-DkcLwFWl.js.map → PkToolRequestOAuthConnection-DkrnVowp.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-BfLpz2-W.js → PkToolShowArtifact-fpFtKrZo.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-BfLpz2-W.js.map → PkToolShowArtifact-fpFtKrZo.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-BsF6DFzV.js → PkToolShowContactForm-BAM772bm.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-BsF6DFzV.js.map → PkToolShowContactForm-BAM772bm.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-w6RvbKEB.js → PkToolShowForm-DJcL0bgw.js} +4 -4
- package/dist/_chunks/{PkToolShowForm-w6RvbKEB.js.map → PkToolShowForm-DJcL0bgw.js.map} +1 -1
- package/dist/_chunks/{PkToolShowImageGallery-BEddh4He.js → PkToolShowImageGallery-DhB_ucYe.js} +2 -2
- package/dist/_chunks/{PkToolShowImageGallery-BEddh4He.js.map → PkToolShowImageGallery-DhB_ucYe.js.map} +1 -1
- package/dist/_chunks/{PkToolShowProductList-k-VB4pUB.js → PkToolShowProductList-DfcJJrOC.js} +2 -2
- package/dist/_chunks/{PkToolShowProductList-k-VB4pUB.js.map → PkToolShowProductList-DfcJJrOC.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-CGESvGrm.js → PkToolShowSources-GeWAMHYC.js} +3 -3
- package/dist/_chunks/{PkToolShowSources-CGESvGrm.js.map → PkToolShowSources-GeWAMHYC.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSuggestedReply-DTAq41wP.js → PkToolShowSuggestedReply-gpuWzpoh.js} +2 -2
- package/dist/_chunks/{PkToolShowSuggestedReply-DTAq41wP.js.map → PkToolShowSuggestedReply-gpuWzpoh.js.map} +1 -1
- package/dist/_chunks/{PkToolShowVideo-DeexblEL.js → PkToolShowVideo-CikqhGpT.js} +2 -2
- package/dist/_chunks/{PkToolShowVideo-DeexblEL.js.map → PkToolShowVideo-CikqhGpT.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWebPages-C42FNo8K.js → PkToolShowWebPages-B-LuiAtg.js} +2 -2
- package/dist/_chunks/{PkToolShowWebPages-C42FNo8K.js.map → PkToolShowWebPages-B-LuiAtg.js.map} +1 -1
- package/dist/_chunks/{chatImagePolicy-DlZPHhW-.js → chatImagePolicy-Dv_WHhDs.js} +2 -2
- package/dist/_chunks/{chatImagePolicy-DlZPHhW-.js.map → chatImagePolicy-Dv_WHhDs.js.map} +1 -1
- package/dist/_chunks/{markdown-DNPhTO5l.js → markdown-BYpvcbWH.js} +2 -2
- package/dist/_chunks/{markdown-DNPhTO5l.js.map → markdown-BYpvcbWH.js.map} +1 -1
- package/dist/_chunks/{utils-zkq8kMz-.js → utils-DMvy5QRR.js} +2 -2
- package/dist/_chunks/{utils-zkq8kMz-.js.map → utils-DMvy5QRR.js.map} +1 -1
- package/dist/ai-elements.es.js +405 -135
- 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-ldDZiq6E.js → Agent-B9iJ1WvR.js} +131 -130
- package/dist-vue/_chunks/Agent-B9iJ1WvR.js.map +1 -0
- package/dist-vue/_chunks/{Document-BfjAfogy.js → Document-DnsOE7s6.js} +2 -2
- package/dist-vue/_chunks/{Document-BfjAfogy.js.map → Document-DnsOE7s6.js.map} +1 -1
- package/dist-vue/_chunks/{PkChart-DyyBXkd3.js → PkChart-D-K7nc0g.js} +2 -2
- package/dist-vue/_chunks/{PkChart-DyyBXkd3.js.map → PkChart-D-K7nc0g.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbot-wsqj3EpU.js → PkChatbot-DVQ-Bb7n.js} +8 -8
- package/dist-vue/_chunks/{PkChatbot-wsqj3EpU.js.map → PkChatbot-DVQ-Bb7n.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotEmptyState-DcgIfNkX.js → PkChatbotEmptyState-OlgewA4_.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-DcgIfNkX.js.map → PkChatbotEmptyState-OlgewA4_.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotInput-CN4rmNgu.js → PkChatbotInput-D_I0Gf_u.js} +4 -4
- package/dist-vue/_chunks/{PkChatbotInput-CN4rmNgu.js.map → PkChatbotInput-D_I0Gf_u.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotMessages-BlF4Xp0_.js → PkChatbotMessages-CAXnEfXK.js} +18 -18
- package/dist-vue/_chunks/{PkChatbotMessages-BlF4Xp0_.js.map → PkChatbotMessages-CAXnEfXK.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepPayload-q9uXE5mr.js → PkChatbotStepPayload-EBri1L10.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-q9uXE5mr.js.map → PkChatbotStepPayload-EBri1L10.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-BJz6Qwh3.js → PkChatbotStepToolDetail-DiQEa0UV.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-BJz6Qwh3.js.map → PkChatbotStepToolDetail-DiQEa0UV.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotSteps-DvJYNl_k.js → PkChatbotSteps-BgLnv2J1.js} +5 -5
- package/dist-vue/_chunks/{PkChatbotSteps-DvJYNl_k.js.map → PkChatbotSteps-BgLnv2J1.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-tmHyxxT3.js → PkChatbotViewChat-CmjD1IXf.js} +360 -355
- package/dist-vue/_chunks/PkChatbotViewChat-CmjD1IXf.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewConversations-DOzUh_A7.js → PkChatbotViewConversations-CVZH5dXx.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewConversations-DOzUh_A7.js.map → PkChatbotViewConversations-CVZH5dXx.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-CsL8OhcA.js → PkChatbotViewFiles-CO4gv9nd.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewFiles-CsL8OhcA.js.map → PkChatbotViewFiles-CO4gv9nd.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-CFqxCK2f.js → PkChatbotViewProfile-CriJtak0.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-CFqxCK2f.js.map → PkChatbotViewProfile-CriJtak0.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreview-Bp5-Pl54.js → PkFilePreview-k5gEl3n8.js} +586 -434
- package/dist-vue/_chunks/PkFilePreview-k5gEl3n8.js.map +1 -0
- package/dist-vue/_chunks/{PkFilePreviewDialog-CS885vBR.js → PkFilePreviewDialog-DUwZPErE.js} +12 -7
- package/dist-vue/_chunks/PkFilePreviewDialog-DUwZPErE.js.map +1 -0
- package/dist-vue/_chunks/{PkImageEditorDialog-BhfdnsmX.js → PkImageEditorDialog-DQPXePae.js} +2 -2
- package/dist-vue/_chunks/{PkImageEditorDialog-BhfdnsmX.js.map → PkImageEditorDialog-DQPXePae.js.map} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-NgrJUZPI.js → PkStreamingMarkdown-ZasabxE0.js} +3 -3
- package/dist-vue/_chunks/{PkStreamingMarkdown-NgrJUZPI.js.map → PkStreamingMarkdown-ZasabxE0.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolChatFile-DnmiNGF4.js → PkToolChatFile-CD26Q2xp.js} +3 -3
- package/dist-vue/_chunks/{PkToolChatFile-DnmiNGF4.js.map → PkToolChatFile-CD26Q2xp.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestGeolocation-D1XNCvdr.js → PkToolRequestGeolocation-Bhh7UomV.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestGeolocation-D1XNCvdr.js.map → PkToolRequestGeolocation-Bhh7UomV.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-OTvMRYaL.js → PkToolRequestOAuthConnection-8GJlt5G1.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-OTvMRYaL.js.map → PkToolRequestOAuthConnection-8GJlt5G1.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-C8ueuIGQ.js → PkToolShowArtifact-BhVd_ZQ8.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-C8ueuIGQ.js.map → PkToolShowArtifact-BhVd_ZQ8.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowChart-BWO6Hzlq.js → PkToolShowChart-BQXxaPIO.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowChart-BWO6Hzlq.js.map → PkToolShowChart-BQXxaPIO.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-BBcDsLEO.js → PkToolShowContactForm-CackCDGD.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-BBcDsLEO.js.map → PkToolShowContactForm-CackCDGD.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-BzUcxOKy.js → PkToolShowDiagram-CABPsFi8.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-BzUcxOKy.js.map → PkToolShowDiagram-CABPsFi8.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-B6uhHzJ8.js → PkToolShowForm-BStbk4Iu.js} +4 -4
- package/dist-vue/_chunks/{PkToolShowForm-B6uhHzJ8.js.map → PkToolShowForm-BStbk4Iu.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-C39nlJrJ.js → PkToolShowImageGallery-BeeHsdTp.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowImageGallery-C39nlJrJ.js.map → PkToolShowImageGallery-BeeHsdTp.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-FLLkRCnm.js → PkToolShowProductList-BfUiap9U.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-FLLkRCnm.js.map → PkToolShowProductList-BfUiap9U.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-Cb7r5jrX.js → PkToolShowSources-CgEkcyRg.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowSources-Cb7r5jrX.js.map → PkToolShowSources-CgEkcyRg.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-BVLCX5Sm.js → PkToolShowSuggestedReply-DxlGhMvE.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-BVLCX5Sm.js.map → PkToolShowSuggestedReply-DxlGhMvE.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-QDLhVlau.js → PkToolShowVideo-CqSRnDNC.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowVideo-QDLhVlau.js.map → PkToolShowVideo-CqSRnDNC.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-P6PdJTEE.js → PkToolShowWebPages-B-qIS8qY.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-P6PdJTEE.js.map → PkToolShowWebPages-B-qIS8qY.js.map} +1 -1
- package/dist-vue/_chunks/{createChatbotApiClient-CGeNprai.js → createChatbotApiClient-DmPcjwB3.js} +7 -7
- package/dist-vue/_chunks/{createChatbotApiClient-CGeNprai.js.map → createChatbotApiClient-DmPcjwB3.js.map} +1 -1
- package/dist-vue/_chunks/{useChatbotStore-KXAltGz3.js → useChatbotStore-B6ILfm5Z.js} +17 -17
- package/dist-vue/_chunks/{useChatbotStore-KXAltGz3.js.map → useChatbotStore-B6ILfm5Z.js.map} +1 -1
- package/dist-vue/_chunks/{utils-D4B1FVGF.js → utils-KBB6SDPn.js} +2 -2
- package/dist-vue/_chunks/{utils-D4B1FVGF.js.map → utils-KBB6SDPn.js.map} +1 -1
- package/dist-vue/api.js +1 -1
- package/dist-vue/apps/web-component/src/composables/useChatbotAgent.d.ts +6 -0
- package/dist-vue/composables.js +270 -6
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +5325 -5232
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +12 -0
- package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +6 -0
- package/dist-vue/packages/components/src/chat/PkFilePreview.d.ts +8 -0
- package/dist-vue/packages/components/src/chat/PkFilePreviewDialog.d.ts +4 -0
- package/dist-vue/packages/components/src/chat/PkSelectionActionIconPicker.d.ts +19 -0
- package/dist-vue/packages/components/src/chat/PkSelectionActions.d.ts +3 -0
- package/dist-vue/packages/components/src/chat/selectionActionEdits.d.ts +1 -0
- package/dist-vue/packages/components/src/chat/selectionActionIcons.d.ts +9 -0
- package/dist-vue/packages/components/src/chat/useChatFilePreview.d.ts +12 -12
- package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +18 -0
- package/dist-vue/packages/models/src/schema/Agent.d.ts +2688 -0
- package/dist-vue/packages/models/src/schema/Chart.d.ts +4 -4
- package/dist-vue/packages/models/src/schema/Lead.d.ts +6 -6
- package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +768 -0
- package/dist-vue/packages/models/src/schema/SelectionAction.d.ts +1415 -0
- package/dist-vue/packages/models/src/schema/SelectionActionPreview.d.ts +38 -0
- package/dist-vue/packages/models/src/schema/SpreadsheetPreview.d.ts +6 -6
- package/dist-vue/packages/models/src/schema/SubAgent.d.ts +768 -0
- package/dist-vue/packages/models/src/schema/WordPreview.d.ts +13 -13
- package/dist-vue/packages/models/src/schema/index.d.ts +1 -0
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/Agent-CeZ3bgZ3.js.map +0 -1
- package/dist/_chunks/PkFilePreview-D_1ZgiiA.js.map +0 -1
- package/dist/_chunks/PkFilePreviewDialog-CI22huzK.js.map +0 -1
- package/dist/_chunks/PkSelectionActions-BriGyWCi.js.map +0 -1
- package/dist-vue/_chunks/Agent-ldDZiq6E.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotViewChat-tmHyxxT3.js.map +0 -1
- package/dist-vue/_chunks/PkFilePreview-Bp5-Pl54.js.map +0 -1
- package/dist-vue/_chunks/PkFilePreviewDialog-CS885vBR.js.map +0 -1
|
@@ -2,10 +2,10 @@ 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 { B as o, G as s, J as c, K as l, U as u, W as d, X as f, Y as p, o as m, q as h } from "./utils-
|
|
6
|
-
import { r as
|
|
7
|
-
import { VvIcon as
|
|
8
|
-
import { Fragment as
|
|
5
|
+
import { B as o, G as s, J as c, K as l, U as u, W as d, X as f, Y as p, o as m, q as h } from "./utils-KBB6SDPn.js";
|
|
6
|
+
import { r as g } from "./PkChatbotViewChat-CmjD1IXf.js";
|
|
7
|
+
import { VvIcon as _ } from "@volverjs/ui-vue/components";
|
|
8
|
+
import { Fragment as v, computed as y, createBlock as b, createCommentVNode as x, createElementBlock as S, createElementVNode as C, createTextVNode as w, createVNode as T, defineComponent as E, inject as ee, 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 ae, vModelText as oe, watch as z, withCtx as B, withDirectives as se, withKeys as ce, withModifiers as V } from "vue";
|
|
9
9
|
import { useI18n as le } from "vue-i18n";
|
|
10
10
|
import { useElementSize as ue, useEventListener as H } from "@vueuse/core";
|
|
11
11
|
// ../../packages/composable/src/useSettledSelection.ts
|
|
@@ -59,28 +59,155 @@ function me({ root: e, enabled: t = () => !0, delay: n = 150, minChars: r = 2, t
|
|
|
59
59
|
clear: s
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
|
-
// ../../packages/components/src/chat/
|
|
63
|
-
var he =
|
|
64
|
-
|
|
62
|
+
// ../../packages/components/src/chat/selectionActionIcons.ts
|
|
63
|
+
var he = {
|
|
64
|
+
sparkles: "ri:sparkling-line",
|
|
65
|
+
magic: "ri:magic-line",
|
|
66
|
+
idea: "ri:lightbulb-line",
|
|
67
|
+
star: "ri:star-line",
|
|
68
|
+
heart: "ri:heart-line",
|
|
69
|
+
lightning: "ri:flashlight-line",
|
|
70
|
+
fire: "ri:fire-line",
|
|
71
|
+
rocket: "ri:rocket-line",
|
|
72
|
+
pen: "ri:quill-pen-line",
|
|
73
|
+
pencil: "ri:pencil-line",
|
|
74
|
+
text: "ri:text",
|
|
75
|
+
paragraph: "ri:paragraph",
|
|
76
|
+
quote: "ri:double-quotes-l",
|
|
77
|
+
list: "ri:list-unordered",
|
|
78
|
+
checklist: "ri:list-check-2",
|
|
79
|
+
highlighter: "ri:mark-pen-line",
|
|
80
|
+
document: "ri:file-text-line",
|
|
81
|
+
folder: "ri:folder-line",
|
|
82
|
+
book: "ri:book-open-line",
|
|
83
|
+
bookmark: "ri:bookmark-line",
|
|
84
|
+
clipboard: "ri:clipboard-line",
|
|
85
|
+
draft: "ri:draft-line",
|
|
86
|
+
contract: "ri:file-paper-2-line",
|
|
87
|
+
attachment: "ri:attachment-2",
|
|
88
|
+
archive: "ri:archive-line",
|
|
89
|
+
search: "ri:search-line",
|
|
90
|
+
filter: "ri:filter-3-line",
|
|
91
|
+
eye: "ri:eye-line",
|
|
92
|
+
questions: "ri:question-answer-line",
|
|
93
|
+
"pie-chart": "ri:pie-chart-line",
|
|
94
|
+
"line-chart": "ri:line-chart-line",
|
|
95
|
+
table: "ri:table-line",
|
|
96
|
+
database: "ri:database-2-line",
|
|
97
|
+
calculator: "ri:calculator-line",
|
|
98
|
+
percent: "ri:percent-line",
|
|
99
|
+
scales: "ri:scales-3-line",
|
|
100
|
+
euro: "ri:money-euro-circle-line",
|
|
101
|
+
dollar: "ri:money-dollar-circle-line",
|
|
102
|
+
wallet: "ri:wallet-3-line",
|
|
103
|
+
bank: "ri:bank-line",
|
|
104
|
+
card: "ri:bank-card-line",
|
|
105
|
+
cart: "ri:shopping-cart-2-line",
|
|
106
|
+
"price-tag": "ri:price-tag-3-line",
|
|
107
|
+
bill: "ri:bill-line",
|
|
108
|
+
gift: "ri:gift-line",
|
|
109
|
+
shop: "ri:store-2-line",
|
|
110
|
+
truck: "ri:truck-line",
|
|
111
|
+
shield: "ri:shield-check-line",
|
|
112
|
+
lock: "ri:lock-line",
|
|
113
|
+
key: "ri:key-2-line",
|
|
114
|
+
gavel: "ri:auction-line",
|
|
115
|
+
institution: "ri:government-line",
|
|
116
|
+
passport: "ri:passport-line",
|
|
117
|
+
person: "ri:user-line",
|
|
118
|
+
team: "ri:team-line",
|
|
119
|
+
group: "ri:group-line",
|
|
120
|
+
smile: "ri:emotion-happy-line",
|
|
121
|
+
handshake: "ri:shake-hands-line",
|
|
122
|
+
support: "ri:customer-service-2-line",
|
|
123
|
+
contacts: "ri:contacts-book-line",
|
|
124
|
+
mail: "ri:mail-line",
|
|
125
|
+
send: "ri:send-plane-line",
|
|
126
|
+
speech: "ri:chat-3-line",
|
|
127
|
+
phone: "ri:phone-line",
|
|
128
|
+
megaphone: "ri:megaphone-line",
|
|
129
|
+
bell: "ri:notification-3-line",
|
|
130
|
+
share: "ri:share-line",
|
|
131
|
+
link: "ri:link",
|
|
132
|
+
globe: "ri:global-line",
|
|
133
|
+
calendar: "ri:calendar-line",
|
|
134
|
+
event: "ri:calendar-event-line",
|
|
135
|
+
clock: "ri:time-line",
|
|
136
|
+
timer: "ri:timer-line",
|
|
137
|
+
history: "ri:history-line",
|
|
138
|
+
hourglass: "ri:hourglass-line",
|
|
139
|
+
plane: "ri:plane-line",
|
|
140
|
+
car: "ri:car-line",
|
|
141
|
+
train: "ri:train-line",
|
|
142
|
+
ship: "ri:ship-line",
|
|
143
|
+
map: "ri:map-2-line",
|
|
144
|
+
pin: "ri:map-pin-line",
|
|
145
|
+
compass: "ri:compass-3-line",
|
|
146
|
+
bed: "ri:hotel-bed-line",
|
|
147
|
+
suitcase: "ri:suitcase-line",
|
|
148
|
+
home: "ri:home-4-line",
|
|
149
|
+
building: "ri:building-line",
|
|
150
|
+
flag: "ri:flag-line",
|
|
151
|
+
earth: "ri:earth-line",
|
|
152
|
+
sun: "ri:sun-line",
|
|
153
|
+
umbrella: "ri:umbrella-line",
|
|
154
|
+
heartbeat: "ri:heart-pulse-line",
|
|
155
|
+
capsule: "ri:capsule-line",
|
|
156
|
+
"first-aid": "ri:first-aid-kit-line",
|
|
157
|
+
restaurant: "ri:restaurant-line",
|
|
158
|
+
cup: "ri:cup-line",
|
|
159
|
+
leaf: "ri:leaf-line",
|
|
160
|
+
plant: "ri:plant-line",
|
|
161
|
+
recycle: "ri:recycle-line",
|
|
162
|
+
school: "ri:school-line",
|
|
163
|
+
graduation: "ri:graduation-cap-line",
|
|
164
|
+
brain: "ri:brain-line",
|
|
165
|
+
puzzle: "ri:puzzle-line",
|
|
166
|
+
award: "ri:award-line",
|
|
167
|
+
trophy: "ri:trophy-line",
|
|
168
|
+
settings: "ri:settings-3-line",
|
|
169
|
+
tools: "ri:tools-line",
|
|
170
|
+
code: "ri:code-s-slash-line",
|
|
171
|
+
bug: "ri:bug-line",
|
|
172
|
+
robot: "ri:robot-2-line",
|
|
173
|
+
cloud: "ri:cloud-line",
|
|
174
|
+
flask: "ri:flask-line",
|
|
175
|
+
microscope: "ri:microscope-line",
|
|
176
|
+
check: "ri:checkbox-circle-line",
|
|
177
|
+
cross: "ri:close-circle-line",
|
|
178
|
+
warning: "ri:alert-line",
|
|
179
|
+
information: "ri:information-line",
|
|
180
|
+
refresh: "ri:refresh-line",
|
|
181
|
+
swap: "ri:arrow-left-right-line",
|
|
182
|
+
arrow: "ri:arrow-right-circle-line",
|
|
183
|
+
"thumbs-up": "ri:thumb-up-line",
|
|
184
|
+
target: "ri:focus-3-line",
|
|
185
|
+
palette: "ri:palette-line",
|
|
186
|
+
image: "ri:image-line",
|
|
187
|
+
music: "ri:music-2-line",
|
|
188
|
+
video: "ri:video-line",
|
|
189
|
+
microphone: "ri:mic-line"
|
|
190
|
+
}, G = (e) => he[e ?? "sparkles"], ge = 2e3, _e = 1e3, K = 60, q = 1400, ve = 20, J = 100, ye = (e) => Number(e.slice(1)), be = (e) => {
|
|
191
|
+
let t = [...new Set(e)].sort((e, t) => ye(e) - ye(t)), n = [];
|
|
65
192
|
for (let e of t) {
|
|
66
193
|
let t = n[n.length - 1];
|
|
67
|
-
t &&
|
|
194
|
+
t && ye(e) === ye(t.to) + 1 ? t.to = e : n.push({
|
|
68
195
|
from: e,
|
|
69
196
|
to: e
|
|
70
197
|
});
|
|
71
198
|
}
|
|
72
199
|
return n.slice(0, 100);
|
|
73
|
-
},
|
|
200
|
+
}, xe = (e, t) => {
|
|
74
201
|
let n = [];
|
|
75
202
|
if (!t) return n;
|
|
76
203
|
for (let r = e.indexOf(t); r >= 0; r = e.indexOf(t, r + 1)) n.push(r);
|
|
77
204
|
return n;
|
|
78
|
-
},
|
|
79
|
-
let r =
|
|
205
|
+
}, Se = (e, t, n) => {
|
|
206
|
+
let r = xe(e, e.slice(t, t + n));
|
|
80
207
|
if (r.length < 2) return {};
|
|
81
208
|
let i = t, a = t + n;
|
|
82
|
-
for (let t = !0; a - i <=
|
|
83
|
-
if (
|
|
209
|
+
for (let t = !0; a - i <= q; t = !t) {
|
|
210
|
+
if (xe(e, e.slice(i, a)).length === 1) return { find: e.slice(i, a) };
|
|
84
211
|
if (t && i > 0) i = e.slice(0, i).replace(/\S*\s*$/, "").length;
|
|
85
212
|
else if (a < e.length) {
|
|
86
213
|
let t = e.slice(a).match(/^\s*\S*/)?.[0] ?? "";
|
|
@@ -91,23 +218,23 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
91
218
|
index: r.indexOf(t) + 1 || 1,
|
|
92
219
|
of: r.length
|
|
93
220
|
} };
|
|
94
|
-
},
|
|
221
|
+
}, Ce = (e) => (e.querySelectorAll("[data-quote-skip]").forEach((e) => e.remove()), e.querySelectorAll("[data-paragraph]").forEach((e) => e.append("\n")), e.textContent ?? ""), we = (e) => e.length > _e ? `${e.slice(0, _e / 2)} […] ${e.slice(-500)}` : e, Te = (e) => {
|
|
95
222
|
let t = e.startContainer.getRootNode().getSelection?.() ?? document.getSelection();
|
|
96
223
|
try {
|
|
97
224
|
t?.setBaseAndExtent(e.startContainer, e.startOffset, e.endContainer, e.endOffset);
|
|
98
225
|
} catch {}
|
|
99
|
-
},
|
|
226
|
+
}, Ee = (e, t, n) => {
|
|
100
227
|
let r = t.commonAncestorContainer;
|
|
101
228
|
if (!e.contains(r) || (r instanceof Element ? r : r.parentElement)?.closest("[data-quote-skip]")) return;
|
|
102
229
|
let i = [...e.querySelectorAll("[data-paragraph]")].filter((e) => !e.closest(n) && t.intersectsNode(e));
|
|
103
230
|
if (!i.length) return;
|
|
104
|
-
let a = i.flatMap((e) => e.dataset.paragraph.split(" ")), o =
|
|
231
|
+
let a = i.flatMap((e) => e.dataset.paragraph.split(" ")), o = Ce(t.cloneContents()), s = o.trim();
|
|
105
232
|
if (s.length < 2) return;
|
|
106
233
|
let c = {
|
|
107
234
|
format: "docx",
|
|
108
|
-
runs:
|
|
235
|
+
runs: be(a),
|
|
109
236
|
paragraphCount: new Set(a).size,
|
|
110
|
-
quote:
|
|
237
|
+
quote: we(s),
|
|
111
238
|
measure: () => {
|
|
112
239
|
let e = t.getBoundingClientRect(), n = t.getClientRects()[0] ?? e;
|
|
113
240
|
return {
|
|
@@ -118,22 +245,22 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
118
245
|
bottom: e.bottom
|
|
119
246
|
};
|
|
120
247
|
},
|
|
121
|
-
restore: () =>
|
|
248
|
+
restore: () => Te(t)
|
|
122
249
|
};
|
|
123
250
|
if (i.length === 1) {
|
|
124
251
|
let e = i[0], n = document.createRange();
|
|
125
252
|
n.selectNodeContents(e);
|
|
126
|
-
let r =
|
|
253
|
+
let r = Ce(n.cloneContents()).replace(/\n$/, ""), a = document.createRange();
|
|
127
254
|
a.setStart(e, 0), a.setEnd(t.startContainer, t.startOffset);
|
|
128
|
-
let l =
|
|
129
|
-
c.before = r.slice(Math.max(0, l - K), l), c.after = r.slice(l + s.length, l + s.length + K), Object.assign(c,
|
|
255
|
+
let l = Ce(a.cloneContents()).length + (o.length - o.trimStart().length);
|
|
256
|
+
c.before = r.slice(Math.max(0, l - K), l), c.after = r.slice(l + s.length, l + s.length + K), Object.assign(c, Se(r, l, s.length));
|
|
130
257
|
}
|
|
131
258
|
return c;
|
|
132
|
-
},
|
|
259
|
+
}, De = (e) => {
|
|
133
260
|
let t = "";
|
|
134
261
|
for (let n = e; n > 0; n = Math.floor((n - 1) / 26)) t = String.fromCharCode(65 + (n - 1) % 26) + t;
|
|
135
262
|
return t;
|
|
136
|
-
},
|
|
263
|
+
}, Oe = (e, t) => {
|
|
137
264
|
let n = { ...t }, r = e.rows.flatMap((e) => e.cells.filter((e) => e.span).map((t) => ({
|
|
138
265
|
r1: e.row,
|
|
139
266
|
r2: e.row + t.span.rows - 1,
|
|
@@ -144,7 +271,7 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
144
271
|
e = !1;
|
|
145
272
|
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);
|
|
146
273
|
}
|
|
147
|
-
let i = `${
|
|
274
|
+
let i = `${De(n.c1)}${n.r1}`, a = `${De(n.c2)}${n.r2}`, o = (e.hiddenRows ?? []).filter((e) => e >= n.r1 && e <= n.r2).slice(0, J), s = e.columns.filter((e) => e.hidden && e.col >= n.c1 && e.col <= n.c2).map((e) => De(e.col)).slice(0, J), 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, ve).map((e) => String(e.value)).join("; ").slice(0, 500);
|
|
148
275
|
return {
|
|
149
276
|
format: "xlsx",
|
|
150
277
|
sheet: e.name,
|
|
@@ -154,10 +281,10 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
154
281
|
...s.length ? { hiddenColumns: s } : {},
|
|
155
282
|
...c ? { sample: c } : {}
|
|
156
283
|
};
|
|
157
|
-
},
|
|
284
|
+
}, ke = ["placeholder", "aria-label"], Y = ["disabled"], X = ["aria-label"], Z = { class: "pk-selection-actions__text" }, Ae = {
|
|
158
285
|
key: 0,
|
|
159
286
|
class: "pk-selection-actions__text"
|
|
160
|
-
},
|
|
287
|
+
}, je = ["onClick", "onTouchend"], Me = /* @__PURE__ */ E({
|
|
161
288
|
__name: "PkSelectionActions",
|
|
162
289
|
props: /*@__PURE__*/ O({
|
|
163
290
|
actions: {},
|
|
@@ -189,7 +316,7 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
189
316
|
proofread: "ri:check-double-line",
|
|
190
317
|
translate: "ri:translate-2",
|
|
191
318
|
chart: "ri:bar-chart-2-line"
|
|
192
|
-
}, r = e, i = t, a = R(e, "asking"), { t: s } = le({ useScope: "global" }), c = ae("barEl"), l = ae("inputEl"), { width: u, height: d } = ue(c, void 0, { box: "border-box" }), f =
|
|
319
|
+
}, r = e, i = t, a = R(e, "asking"), { t: s } = le({ useScope: "global" }), c = ae("barEl"), l = ae("inputEl"), { width: u, height: d } = ue(c, void 0, { box: "border-box" }), f = y(() => o({
|
|
193
320
|
...r.anchor,
|
|
194
321
|
bar: {
|
|
195
322
|
width: u.value,
|
|
@@ -201,22 +328,22 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
201
328
|
id: e,
|
|
202
329
|
placeholder: t
|
|
203
330
|
}, m.value = "", a.value = !0, await te(), l.value?.focus();
|
|
204
|
-
},
|
|
331
|
+
}, g = () => {
|
|
205
332
|
p.value = void 0, a.value = !1;
|
|
206
|
-
},
|
|
333
|
+
}, b = () => h(void 0, s("selectionActions.askPlaceholder")), E = (e) => n[e.id] ?? G(e.icon), ee = (e) => {
|
|
207
334
|
e.asks ? h(e.id, e.asks) : i("action", e.id);
|
|
208
335
|
}, D = (e, t) => {
|
|
209
336
|
let n = e.currentTarget, r = e.changedTouches[0], i = n.getRootNode(), a = r && i.elementFromPoint(r.clientX, r.clientY);
|
|
210
337
|
a && n.contains(a) && t();
|
|
211
338
|
}, O = () => {
|
|
212
339
|
let e = m.value.trim();
|
|
213
|
-
e && p.value && (p.value.id ? i("action", p.value.id, e) : i("ask", e),
|
|
340
|
+
e && p.value && (p.value.id ? i("action", p.value.id, e) : i("ask", e), g());
|
|
214
341
|
}, ne = (e) => {
|
|
215
|
-
e.isComposing || (e.stopPropagation(), e.preventDefault(), p.value ?
|
|
342
|
+
e.isComposing || (e.stopPropagation(), e.preventDefault(), p.value ? g() : i("close"));
|
|
216
343
|
};
|
|
217
344
|
return (t, n) => {
|
|
218
|
-
let r =
|
|
219
|
-
return M(),
|
|
345
|
+
let r = _;
|
|
346
|
+
return M(), S("div", {
|
|
220
347
|
class: k(["pk-selection-actions", {
|
|
221
348
|
"pk-selection-actions--fixed": e.strategy === "fixed",
|
|
222
349
|
"pk-selection-actions--asking": !!p.value
|
|
@@ -226,13 +353,13 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
226
353
|
left: `${f.value.left}px`
|
|
227
354
|
}),
|
|
228
355
|
onKeydown: ce(ne, ["esc"])
|
|
229
|
-
}, [p.value ? (M(),
|
|
356
|
+
}, [p.value ? (M(), S("form", {
|
|
230
357
|
key: 0,
|
|
231
358
|
ref_key: "barEl",
|
|
232
359
|
ref: c,
|
|
233
360
|
class: "pk-selection-actions__menu pk-selection-actions__menu--field",
|
|
234
361
|
onSubmit: V(O, ["prevent"])
|
|
235
|
-
}, [se(
|
|
362
|
+
}, [se(C("input", {
|
|
236
363
|
ref_key: "inputEl",
|
|
237
364
|
ref: l,
|
|
238
365
|
"onUpdate:modelValue": n[0] ||= (e) => m.value = e,
|
|
@@ -241,11 +368,11 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
241
368
|
maxlength: "500",
|
|
242
369
|
placeholder: p.value.placeholder,
|
|
243
370
|
"aria-label": p.value.placeholder
|
|
244
|
-
}, null, 8,
|
|
371
|
+
}, null, 8, ke), [[oe, m.value]]), C("button", {
|
|
245
372
|
type: "submit",
|
|
246
373
|
class: "pk-selection-actions__button pk-selection-actions__button--send",
|
|
247
374
|
disabled: !m.value.trim()
|
|
248
|
-
}, I(L(s)("action.send")), 9,
|
|
375
|
+
}, I(L(s)("action.send")), 9, Y)], 544)) : (M(), S("div", {
|
|
249
376
|
key: 1,
|
|
250
377
|
ref_key: "barEl",
|
|
251
378
|
ref: c,
|
|
@@ -254,44 +381,44 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
254
381
|
"aria-orientation": "vertical",
|
|
255
382
|
"aria-label": L(s)("selectionActions.label"),
|
|
256
383
|
onTouchstart: n[7] ||= V(() => {}, ["prevent"])
|
|
257
|
-
}, [e.note ? (M(),
|
|
384
|
+
}, [e.note ? (M(), S(v, { key: 0 }, [C("p", Z, I(e.note), 1), e.noteAction ? (M(), S("button", {
|
|
258
385
|
key: 0,
|
|
259
386
|
type: "button",
|
|
260
387
|
class: "pk-selection-actions__button",
|
|
261
388
|
onMousedown: n[1] ||= V(() => {}, ["prevent"]),
|
|
262
389
|
onClick: n[2] ||= (e) => i("note"),
|
|
263
390
|
onTouchend: n[3] ||= (e) => D(e, () => i("note"))
|
|
264
|
-
}, [
|
|
391
|
+
}, [T(r, {
|
|
265
392
|
name: "ri:arrow-right-line",
|
|
266
393
|
class: "pk-selection-actions__icon"
|
|
267
|
-
}),
|
|
268
|
-
e.hint ? (M(),
|
|
269
|
-
(M(!0),
|
|
394
|
+
}), w(" " + I(e.noteAction), 1)], 32)) : x("", !0)], 64)) : (M(), S(v, { key: 1 }, [
|
|
395
|
+
e.hint ? (M(), S("p", Ae, I(e.hint), 1)) : x("", !0),
|
|
396
|
+
(M(!0), S(v, null, P(e.actions, (e) => (M(), S("button", {
|
|
270
397
|
key: e.id,
|
|
271
398
|
type: "button",
|
|
272
399
|
class: "pk-selection-actions__button",
|
|
273
400
|
onMousedown: n[4] ||= V(() => {}, ["prevent"]),
|
|
274
|
-
onClick: (t) =>
|
|
275
|
-
onTouchend: (t) => D(t, () =>
|
|
276
|
-
}, [
|
|
277
|
-
name:
|
|
401
|
+
onClick: (t) => ee(e),
|
|
402
|
+
onTouchend: (t) => D(t, () => ee(e))
|
|
403
|
+
}, [T(r, {
|
|
404
|
+
name: E(e),
|
|
278
405
|
class: "pk-selection-actions__icon"
|
|
279
|
-
}, null, 8, ["name"]),
|
|
280
|
-
n[8] ||=
|
|
281
|
-
|
|
406
|
+
}, null, 8, ["name"]), w(" " + I(e.label), 1)], 40, je))), 128)),
|
|
407
|
+
n[8] ||= C("hr", { class: "pk-selection-actions__rule" }, null, -1),
|
|
408
|
+
C("button", {
|
|
282
409
|
type: "button",
|
|
283
410
|
class: "pk-selection-actions__button",
|
|
284
411
|
onMousedown: n[5] ||= V(() => {}, ["prevent"]),
|
|
285
|
-
onClick:
|
|
286
|
-
onTouchend: n[6] ||= (e) => D(e,
|
|
287
|
-
}, [
|
|
412
|
+
onClick: b,
|
|
413
|
+
onTouchend: n[6] ||= (e) => D(e, b)
|
|
414
|
+
}, [T(r, {
|
|
288
415
|
name: "ri:chat-1-line",
|
|
289
416
|
class: "pk-selection-actions__icon"
|
|
290
|
-
}),
|
|
291
|
-
], 64))], 40,
|
|
417
|
+
}), w(" " + I(L(s)("selectionActions.ask")), 1)], 32)
|
|
418
|
+
], 64))], 40, X))], 38);
|
|
292
419
|
};
|
|
293
420
|
}
|
|
294
|
-
}),
|
|
421
|
+
}), Ne = { class: "pk-spreadsheet-preview" }, Pe = { class: "pk-spreadsheet-preview__bar" }, Fe = ["aria-label"], Ie = ["aria-label"], Le = ["aria-label"], Re = [
|
|
295
422
|
"rowspan",
|
|
296
423
|
"colspan",
|
|
297
424
|
"data-focus",
|
|
@@ -299,16 +426,16 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
299
426
|
"title",
|
|
300
427
|
"onMousedown",
|
|
301
428
|
"onMouseenter"
|
|
302
|
-
],
|
|
429
|
+
], ze = {
|
|
303
430
|
key: 1,
|
|
304
431
|
class: "pk-spreadsheet-preview__more"
|
|
305
|
-
},
|
|
432
|
+
}, Be = ["aria-label"], Ve = ["aria-current", "onClick"], He = { class: "pk-spreadsheet-preview__status" }, Ue = { class: "pk-spreadsheet-preview__info" }, We = ["title"], Ge = ["title"], Ke = {
|
|
306
433
|
key: 2,
|
|
307
434
|
class: "pk-spreadsheet-preview__stats"
|
|
308
|
-
},
|
|
435
|
+
}, qe = {
|
|
309
436
|
key: 0,
|
|
310
437
|
class: "pk-spreadsheet-preview__average"
|
|
311
|
-
},
|
|
438
|
+
}, Je = { key: 1 }, Ye = { class: "pk-spreadsheet-preview__zoom" }, Xe = { class: "pk-spreadsheet-preview__percent" }, Ze = 64, Qe = 20, $e = 28, et = 44, tt = 400, nt = 10, rt = /* @__PURE__ */ E({
|
|
312
439
|
__name: "PkSpreadsheetPreview",
|
|
313
440
|
props: /*@__PURE__*/ O({
|
|
314
441
|
preview: {},
|
|
@@ -324,60 +451,60 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
324
451
|
let o = e, s = t, { t: c, locale: l } = le({ useScope: "global" }), u = R(e, "sheet"), d = R(e, "zoom"), f = ae("scrollEl"), { width: p, height: m } = ue(f, {
|
|
325
452
|
width: 0,
|
|
326
453
|
height: 0
|
|
327
|
-
}, { box: "border-box" }), h =
|
|
454
|
+
}, { box: "border-box" }), h = y(() => o.preview.sheets[u.value] ?? o.preview.sheets[0]);
|
|
328
455
|
z(() => o.preview, () => {
|
|
329
456
|
u.value = 0;
|
|
330
457
|
});
|
|
331
|
-
let
|
|
458
|
+
let _ = y(() => o.marked?.get(h.value?.name ?? "")), b = y(() => {
|
|
332
459
|
let e = /* @__PURE__ */ new Map();
|
|
333
|
-
for (let t of
|
|
460
|
+
for (let t of _.value ?? []) {
|
|
334
461
|
let [n, r] = t.split(":"), i = e.get(Number(n));
|
|
335
462
|
e.set(Number(n), i ? `${i},${r}` : r);
|
|
336
463
|
}
|
|
337
464
|
return e;
|
|
338
|
-
}),
|
|
465
|
+
}), E = (e, t) => !!_.value?.has(`${e}:${t}`);
|
|
339
466
|
z(() => o.marked, (e) => {
|
|
340
|
-
if (!e ||
|
|
467
|
+
if (!e || _.value) return;
|
|
341
468
|
let t = o.preview.sheets.findIndex((t) => e.has(t.name));
|
|
342
469
|
t >= 0 && (u.value = t);
|
|
343
470
|
}, { immediate: !0 });
|
|
344
|
-
let
|
|
345
|
-
z(
|
|
471
|
+
let ee = () => g(f.value, ".pk-spreadsheet-preview__cell--marked");
|
|
472
|
+
z(_, ee, { flush: "post" }), re(ee);
|
|
346
473
|
let O = (e) => {
|
|
347
474
|
let t = "";
|
|
348
475
|
for (let n = e; n > 0; n = Math.floor((n - 1) / 26)) t = String.fromCharCode(65 + (n - 1) % 26) + t;
|
|
349
476
|
return t;
|
|
350
|
-
}, j =
|
|
477
|
+
}, j = y(() => {
|
|
351
478
|
let e = h.value;
|
|
352
479
|
if (!e) return [];
|
|
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 =
|
|
480
|
+
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 = et, a = p.value / d.value;
|
|
354
481
|
for (let o = 1; o <= e.lastColumn || !e.moreColumns && (o <= e.lastColumn + 2 || i < a); o++) {
|
|
355
482
|
if (t.has(o)) continue;
|
|
356
|
-
let e = n.get(o) ??
|
|
483
|
+
let e = n.get(o) ?? Ze;
|
|
357
484
|
r.push({
|
|
358
485
|
col: o,
|
|
359
486
|
width: e
|
|
360
487
|
}), i += e;
|
|
361
488
|
}
|
|
362
489
|
return r;
|
|
363
|
-
}), ie =
|
|
490
|
+
}), ie = y(() => j.value.reduce((e, t) => e + t.width, et)), F = y(() => j.value.map((e) => `${e.col}:${e.width}`).join(",")), oe = /* @__PURE__ */ new WeakMap(), B = y(() => {
|
|
364
491
|
let e = h.value;
|
|
365
492
|
if (!e) return [];
|
|
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 -
|
|
493
|
+
let t = new Set(e.hiddenRows ?? []), n = new Map(e.rows.map((e) => [e.row, e.height])), r = Math.ceil((m.value / d.value - $e) / Qe), i = e.moreRows ? e.lastRow : Math.max(e.lastRow + 5, r + t.size), a = oe.get(e);
|
|
367
494
|
a || (a = /* @__PURE__ */ new Map(), oe.set(e, a));
|
|
368
495
|
let o = a;
|
|
369
496
|
return Array.from({ length: i }, (e, t) => t + 1).filter((e) => !t.has(e)).map((e) => {
|
|
370
497
|
let t = o.get(e);
|
|
371
498
|
return t || (t = {
|
|
372
499
|
row: e,
|
|
373
|
-
height: n.get(e) ??
|
|
500
|
+
height: n.get(e) ?? Qe
|
|
374
501
|
}, o.set(e, t)), t;
|
|
375
502
|
});
|
|
376
|
-
}), se =
|
|
503
|
+
}), se = y(() => {
|
|
377
504
|
let e = /* @__PURE__ */ new Map();
|
|
378
505
|
for (let t of h.value?.rows ?? []) for (let n of t.cells) e.set(`${t.row},${n.col}`, n);
|
|
379
506
|
return e;
|
|
380
|
-
}), ce =
|
|
507
|
+
}), ce = y(() => {
|
|
381
508
|
let e = /* @__PURE__ */ new Map();
|
|
382
509
|
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}`, {
|
|
383
510
|
row: t.row,
|
|
@@ -433,7 +560,7 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
433
560
|
maximumFractionDigits: 15,
|
|
434
561
|
...e.format === "percent" ? { style: "percent" } : {}
|
|
435
562
|
}).format(t) : me(e);
|
|
436
|
-
}, G = (e) => e ? `${e.width}px solid ${e.color}` : void 0,
|
|
563
|
+
}, G = (e) => e ? `${e.width}px solid ${e.color}` : void 0, ge = (e, t, n) => {
|
|
437
564
|
let r = U(e), i = e?.value, a = typeof i == "number" || e?.format === "date" || !!e?.missing, o = {
|
|
438
565
|
textAlign: r?.align ?? (a ? "right" : typeof i == "boolean" || e?.format === "error" ? "center" : "left"),
|
|
439
566
|
verticalAlign: r?.valign === "top" ? "top" : r?.valign === "middle" ? "middle" : "bottom",
|
|
@@ -448,27 +575,27 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
448
575
|
o.textAlign === "right" ? o.paddingRight = e : o.paddingLeft = e;
|
|
449
576
|
}
|
|
450
577
|
let l = rt(t, n);
|
|
451
|
-
return
|
|
452
|
-
},
|
|
578
|
+
return _e(t, n) ? (o.borderStyle = "hidden", o.boxShadow = [...l, we(e, t, n)].filter(Boolean).join(", ")) : (o.borderTop = G(r?.borders?.top), o.borderRight = G(r?.borders?.right), o.borderBottom = G(r?.borders?.bottom), o.borderLeft = G(r?.borders?.left), o.boxShadow = [...l, ...ve(e, t, n)].join(", ")), Object.assign(o, ke(t, n)), o;
|
|
579
|
+
}, _e = (e, t) => {
|
|
453
580
|
let n = h.value?.frozen;
|
|
454
581
|
return !!n && (e <= n.rows || t <= n.cols);
|
|
455
|
-
},
|
|
582
|
+
}, K = {
|
|
456
583
|
top: (e) => `inset 0 ${e.width}px 0 ${e.color}`,
|
|
457
584
|
right: (e) => `inset -${e.width}px 0 0 ${e.color}`,
|
|
458
585
|
bottom: (e) => `inset 0 -${e.width}px 0 ${e.color}`,
|
|
459
586
|
left: (e) => `inset ${e.width}px 0 0 ${e.color}`
|
|
460
587
|
}, q = (...e) => e.reduce((e, t) => t && (!e || t.width > e.width) ? t : e, void 0), ve = (e, t, n) => {
|
|
461
588
|
let r = U(e)?.borders;
|
|
462
|
-
return [t === B.value[0]?.row && r?.top &&
|
|
463
|
-
},
|
|
589
|
+
return [t === B.value[0]?.row && r?.top && K.top(r.top), n === j.value[0]?.col && r?.left && K.left(r.left)].filter((e) => !!e);
|
|
590
|
+
}, J = y(() => B.value.map((e) => e.row)), ye = y(() => j.value.map((e) => e.col)), be = y(() => new Map(J.value.map((e, t) => [e, t]))), xe = y(() => new Map(ye.value.map((e, t) => [e, t]))), Se = (e, t, n, r) => {
|
|
464
591
|
let i = [], a = t.get(n) ?? e.length;
|
|
465
592
|
for (; a < e.length && e[a] < n + r; a++) i.push(e[a]);
|
|
466
593
|
return {
|
|
467
594
|
spanned: i,
|
|
468
595
|
next: e[a]
|
|
469
596
|
};
|
|
470
|
-
},
|
|
471
|
-
let { spanned: i, next: a } =
|
|
597
|
+
}, Ce = (e, t, n, r) => {
|
|
598
|
+
let { spanned: i, next: a } = Se(J.value, be.value, t, e?.span?.rows ?? 1), { spanned: o, next: s } = Se(ye.value, xe.value, n, e?.span?.cols ?? 1);
|
|
472
599
|
return (r === "right" ? s === void 0 ? [] : i.map((e) => ({
|
|
473
600
|
row: e,
|
|
474
601
|
col: s
|
|
@@ -479,24 +606,24 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
479
606
|
let t = ce.value.get(`${e.row},${e.col}`) ?? e;
|
|
480
607
|
return H(t.row, t.col);
|
|
481
608
|
});
|
|
482
|
-
},
|
|
483
|
-
let r = U(e)?.borders, i = q(r?.right, ...
|
|
609
|
+
}, we = (e, t, n) => {
|
|
610
|
+
let r = U(e)?.borders, i = q(r?.right, ...Ce(e, t, n, "right").map((e) => U(e)?.borders?.left)), a = q(r?.bottom, ...Ce(e, t, n, "bottom").map((e) => U(e)?.borders?.top)), o = h.value?.gridlines;
|
|
484
611
|
return [
|
|
485
|
-
i ?
|
|
486
|
-
a ?
|
|
612
|
+
i ? K.right(i) : o && "inset calc(var(--border) * -1) 0 0 var(--pk-spreadsheet-gridline)",
|
|
613
|
+
a ? K.bottom(a) : o && "inset 0 calc(var(--border) * -1) 0 var(--pk-spreadsheet-gridline)",
|
|
487
614
|
...ve(e, t, n)
|
|
488
615
|
].filter(Boolean).join(", ");
|
|
489
|
-
},
|
|
616
|
+
}, Te = (e) => $e + B.value.filter((t) => t.row < e).reduce((e, t) => e + t.height, 0), Ee = (e) => et + j.value.filter((t) => t.col < e).reduce((e, t) => e + t.width, 0), De = y(() => {
|
|
490
617
|
let e = h.value?.frozen;
|
|
491
618
|
return {
|
|
492
|
-
top:
|
|
493
|
-
left:
|
|
619
|
+
top: Te((e?.rows ?? 0) + 1),
|
|
620
|
+
left: Ee((e?.cols ?? 0) + 1)
|
|
494
621
|
};
|
|
495
622
|
}), ke = (e, t) => {
|
|
496
623
|
let n = h.value?.frozen;
|
|
497
624
|
if (!n) return {};
|
|
498
625
|
let r = {};
|
|
499
|
-
return e <= n.rows && (r.position = "sticky", r.top = `${
|
|
626
|
+
return e <= n.rows && (r.position = "sticky", r.top = `${Te(e)}px`, r.scrollMarginTop = r.top, r.zIndex = 0), t <= n.cols && (r.position = "sticky", r.left = `${Ee(t)}px`, r.scrollMarginLeft = r.left, r.zIndex = +(e <= n.rows)), r;
|
|
500
627
|
}, Y = N({
|
|
501
628
|
row: 1,
|
|
502
629
|
col: 1
|
|
@@ -513,12 +640,12 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
513
640
|
col: 1
|
|
514
641
|
};
|
|
515
642
|
});
|
|
516
|
-
let Z =
|
|
643
|
+
let Z = y(() => ({
|
|
517
644
|
r1: Math.min(Y.value.row, X.value.row),
|
|
518
645
|
r2: Math.max(Y.value.row, X.value.row),
|
|
519
646
|
c1: Math.min(Y.value.col, X.value.col),
|
|
520
647
|
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,
|
|
648
|
+
})), 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, Me = (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
649
|
let { r1: n, r2: r, c1: i, c2: a } = Z.value;
|
|
523
650
|
if (n === r && i === a || !Ae(e, t)) return [];
|
|
524
651
|
let o = H(e, t)?.span, s = e + (o?.rows ?? 1) - 1, c = t + (o?.cols ?? 1) - 1, l = "var(--spacing-2)", u = "var(--pk-spreadsheet-green)";
|
|
@@ -528,20 +655,20 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
528
655
|
t === i && `inset ${l} 0 0 ${u}`,
|
|
529
656
|
c >= a && `inset calc(${l} * -1) 0 0 ${u}`
|
|
530
657
|
].filter((e) => !!e);
|
|
531
|
-
},
|
|
658
|
+
}, it = N(!1), at = (e, t, n) => {
|
|
532
659
|
f.value?.focus({ preventScroll: !0 }), X.value = {
|
|
533
660
|
row: e,
|
|
534
661
|
col: t
|
|
535
662
|
}, n.shiftKey || (Y.value = {
|
|
536
663
|
row: e,
|
|
537
664
|
col: t
|
|
538
|
-
}),
|
|
539
|
-
},
|
|
540
|
-
|
|
665
|
+
}), it.value = !0;
|
|
666
|
+
}, ot = (e, t) => {
|
|
667
|
+
it.value && (X.value = {
|
|
541
668
|
row: e,
|
|
542
669
|
col: t
|
|
543
670
|
});
|
|
544
|
-
},
|
|
671
|
+
}, st, ct = () => {
|
|
545
672
|
let e = [...f.value?.querySelectorAll(".pk-spreadsheet-preview__cell--range, [data-focus]") ?? []].map((e) => e.getBoundingClientRect());
|
|
546
673
|
if (e.length) return {
|
|
547
674
|
start: {
|
|
@@ -550,73 +677,73 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
550
677
|
},
|
|
551
678
|
bottom: Math.max(...e.map((e) => e.bottom))
|
|
552
679
|
};
|
|
553
|
-
},
|
|
554
|
-
...
|
|
555
|
-
measure:
|
|
680
|
+
}, lt = () => h.value ? {
|
|
681
|
+
...Oe(h.value, Z.value),
|
|
682
|
+
measure: ct
|
|
556
683
|
} : void 0;
|
|
557
|
-
z([Z,
|
|
558
|
-
clearTimeout(
|
|
684
|
+
z([Z, it], () => {
|
|
685
|
+
clearTimeout(st), !it.value && (st = setTimeout(() => {
|
|
559
686
|
let e = Z.value, t = e.r2 > e.r1 || e.c2 > e.c1;
|
|
560
|
-
s("select", t ?
|
|
687
|
+
s("select", t ? lt() : void 0);
|
|
561
688
|
}, 150));
|
|
562
689
|
});
|
|
563
|
-
let
|
|
564
|
-
clearTimeout(
|
|
565
|
-
},
|
|
690
|
+
let ut = () => {
|
|
691
|
+
clearTimeout(st), s("select", lt());
|
|
692
|
+
}, Q, dt;
|
|
566
693
|
z(h, () => {
|
|
567
|
-
|
|
694
|
+
dt = void 0;
|
|
568
695
|
});
|
|
569
|
-
let
|
|
696
|
+
let ft = (e) => {
|
|
570
697
|
let [t, n] = ((e?.closest?.("[data-cell]"))?.dataset.cell ?? "").split(":").map(Number);
|
|
571
698
|
return t && n ? {
|
|
572
699
|
row: t,
|
|
573
700
|
col: n
|
|
574
701
|
} : void 0;
|
|
575
|
-
},
|
|
576
|
-
clearTimeout(
|
|
702
|
+
}, $ = () => {
|
|
703
|
+
clearTimeout(Q?.timer), Q?.active && (it.value = !1), Q = void 0;
|
|
577
704
|
};
|
|
578
705
|
ne(() => {
|
|
579
|
-
|
|
706
|
+
$(), clearTimeout(st);
|
|
580
707
|
});
|
|
581
|
-
let pt = () => void te(
|
|
582
|
-
|
|
583
|
-
let t = e.touches[0], n = e.touches.length === 1 ?
|
|
584
|
-
t && n && (
|
|
708
|
+
let pt = () => void te(ut), mt = (e) => {
|
|
709
|
+
$();
|
|
710
|
+
let t = e.touches[0], n = e.touches.length === 1 ? ft(e.target) : void 0;
|
|
711
|
+
t && n && (Q = {
|
|
585
712
|
...n,
|
|
586
713
|
x: t.clientX,
|
|
587
714
|
y: t.clientY,
|
|
588
715
|
active: !1,
|
|
589
716
|
timer: setTimeout(() => {
|
|
590
|
-
|
|
591
|
-
row:
|
|
592
|
-
col:
|
|
717
|
+
Q && (Q.active = !0, f.value?.focus({ preventScroll: !0 }), Y.value = {
|
|
718
|
+
row: Q.row,
|
|
719
|
+
col: Q.col
|
|
593
720
|
}, X.value = {
|
|
594
|
-
row:
|
|
595
|
-
col:
|
|
596
|
-
},
|
|
597
|
-
},
|
|
721
|
+
row: Q.row,
|
|
722
|
+
col: Q.col
|
|
723
|
+
}, it.value = !0);
|
|
724
|
+
}, tt)
|
|
598
725
|
});
|
|
599
726
|
}, ht = (e) => {
|
|
600
727
|
let t = e.touches[0];
|
|
601
|
-
if (
|
|
602
|
-
if (
|
|
603
|
-
(!e.cancelable || Math.hypot(t.clientX -
|
|
728
|
+
if (!Q || !t) return;
|
|
729
|
+
if (!Q.active) {
|
|
730
|
+
(!e.cancelable || Math.hypot(t.clientX - Q.x, t.clientY - Q.y) > nt) && $();
|
|
604
731
|
return;
|
|
605
732
|
}
|
|
606
733
|
e.preventDefault();
|
|
607
|
-
let n = f.value?.getRootNode(), r =
|
|
734
|
+
let n = f.value?.getRootNode(), r = ft(n?.elementFromPoint(t.clientX, t.clientY) ?? null);
|
|
608
735
|
r && (X.value = r);
|
|
609
736
|
}, gt = (e) => {
|
|
610
|
-
if (
|
|
611
|
-
let { row: t, col: n, active: r } =
|
|
612
|
-
|
|
737
|
+
if (!Q) return;
|
|
738
|
+
let { row: t, col: n, active: r } = Q;
|
|
739
|
+
$(), e.preventDefault();
|
|
613
740
|
let i = Z.value, a = i.r1 === i.r2 && i.c1 === i.c2;
|
|
614
741
|
if (r) {
|
|
615
742
|
a && pt();
|
|
616
743
|
return;
|
|
617
744
|
}
|
|
618
|
-
let o = a && je(t, n) &&
|
|
619
|
-
|
|
745
|
+
let o = a && je(t, n) && dt === `${t}:${n}`;
|
|
746
|
+
dt = `${t}:${n}`, f.value?.focus({ preventScroll: !0 }), Y.value = {
|
|
620
747
|
row: t,
|
|
621
748
|
col: n
|
|
622
749
|
}, X.value = {
|
|
@@ -646,7 +773,7 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
646
773
|
block: "nearest",
|
|
647
774
|
inline: "nearest"
|
|
648
775
|
}));
|
|
649
|
-
}, vt =
|
|
776
|
+
}, vt = y(() => H(X.value.row, X.value.col)), yt = y(() => {
|
|
650
777
|
let { r1: e, r2: t, c1: n, c2: r } = Z.value;
|
|
651
778
|
if (e === t && n === r) return;
|
|
652
779
|
let i = 0, a = 0, o = 0, s;
|
|
@@ -664,22 +791,22 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
664
791
|
};
|
|
665
792
|
return (t, n) => {
|
|
666
793
|
let r = a;
|
|
667
|
-
return M(),
|
|
668
|
-
|
|
669
|
-
|
|
794
|
+
return M(), S("div", Ne, [
|
|
795
|
+
C("div", Pe, [
|
|
796
|
+
C("span", {
|
|
670
797
|
class: "pk-spreadsheet-preview__ref",
|
|
671
798
|
"aria-label": L(c)("chatFilePreview.cell")
|
|
672
|
-
}, I(O(X.value.col)) + I(X.value.row), 9,
|
|
673
|
-
n[6] ||=
|
|
799
|
+
}, I(O(X.value.col)) + I(X.value.row), 9, Fe),
|
|
800
|
+
n[6] ||= C("span", {
|
|
674
801
|
class: "pk-spreadsheet-preview__fx",
|
|
675
802
|
"aria-hidden": "true"
|
|
676
803
|
}, "fx", -1),
|
|
677
|
-
|
|
804
|
+
C("output", {
|
|
678
805
|
class: "pk-spreadsheet-preview__formula",
|
|
679
806
|
"aria-label": L(c)("chatFilePreview.formulaBar")
|
|
680
|
-
}, I(he(vt.value)), 9,
|
|
807
|
+
}, I(he(vt.value)), 9, Ie)
|
|
681
808
|
]),
|
|
682
|
-
|
|
809
|
+
C("div", {
|
|
683
810
|
ref_key: "scrollEl",
|
|
684
811
|
ref: f,
|
|
685
812
|
class: "pk-spreadsheet-preview__scroll",
|
|
@@ -687,49 +814,49 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
687
814
|
role: "grid",
|
|
688
815
|
"aria-label": h.value?.name,
|
|
689
816
|
onKeydown: _t,
|
|
690
|
-
onMouseup: n[2] ||= (e) =>
|
|
691
|
-
onMouseleave: n[3] ||= (e) =>
|
|
817
|
+
onMouseup: n[2] ||= (e) => it.value = !1,
|
|
818
|
+
onMouseleave: n[3] ||= (e) => it.value = !1,
|
|
692
819
|
onTouchstart: mt,
|
|
693
820
|
onTouchmove: ht,
|
|
694
821
|
onTouchend: gt,
|
|
695
|
-
onTouchcancel:
|
|
696
|
-
}, [h.value ? (M(),
|
|
822
|
+
onTouchcancel: $
|
|
823
|
+
}, [h.value ? (M(), S("table", {
|
|
697
824
|
key: 0,
|
|
698
825
|
class: k(["pk-spreadsheet-preview__grid", { "pk-spreadsheet-preview__grid--lines": h.value.gridlines }]),
|
|
699
826
|
style: A({
|
|
700
827
|
zoom: d.value,
|
|
701
828
|
width: `${ie.value}px`,
|
|
702
|
-
"--pk-spreadsheet-stuck-top": `${
|
|
703
|
-
"--pk-spreadsheet-stuck-left": `${
|
|
829
|
+
"--pk-spreadsheet-stuck-top": `${De.value.top}px`,
|
|
830
|
+
"--pk-spreadsheet-stuck-left": `${De.value.left}px`
|
|
704
831
|
})
|
|
705
832
|
}, [
|
|
706
|
-
|
|
833
|
+
C("colgroup", null, [C("col", { style: A({ width: `${et}px` }) }, null, 4), (M(!0), S(v, null, P(j.value, (e) => (M(), S("col", {
|
|
707
834
|
key: e.col,
|
|
708
835
|
style: A({ width: `${e.width}px` })
|
|
709
836
|
}, null, 4))), 128))]),
|
|
710
|
-
|
|
837
|
+
C("thead", null, [C("tr", { style: A({ height: `${$e}px` }) }, [n[7] ||= C("th", { class: "pk-spreadsheet-preview__corner" }, null, -1), (M(!0), S(v, null, P(j.value, (e) => (M(), S("th", {
|
|
711
838
|
key: e.col,
|
|
712
839
|
scope: "col",
|
|
713
840
|
class: k(["pk-spreadsheet-preview__head", { "pk-spreadsheet-preview__head--current": e.col >= Z.value.c1 && e.col <= Z.value.c2 }]),
|
|
714
841
|
style: A(h.value.frozen && e.col <= h.value.frozen.cols ? {
|
|
715
|
-
left: `${
|
|
842
|
+
left: `${Ee(e.col)}px`,
|
|
716
843
|
zIndex: 2
|
|
717
844
|
} : void 0)
|
|
718
845
|
}, I(O(e.col)), 7))), 128))], 4)]),
|
|
719
|
-
|
|
846
|
+
C("tbody", null, [(M(!0), S(v, null, P(B.value, (e, t, n, r) => {
|
|
720
847
|
let i = [
|
|
721
848
|
e,
|
|
722
849
|
h.value,
|
|
723
850
|
F.value,
|
|
724
851
|
L(l),
|
|
725
|
-
|
|
726
|
-
|
|
852
|
+
Me(e.row),
|
|
853
|
+
b.value.get(e.row)
|
|
727
854
|
];
|
|
728
855
|
if (r && r.el && r.key === e.row && D(r, i)) return r;
|
|
729
|
-
let a = (M(),
|
|
856
|
+
let a = (M(), S("tr", {
|
|
730
857
|
key: e.row,
|
|
731
858
|
style: A({ height: `${e.height}px` })
|
|
732
|
-
}, [
|
|
859
|
+
}, [C("th", {
|
|
733
860
|
scope: "row",
|
|
734
861
|
class: k(["pk-spreadsheet-preview__row", { "pk-spreadsheet-preview__row--current": e.row >= Z.value.r1 && e.row <= Z.value.r2 }]),
|
|
735
862
|
style: A(h.value.frozen && e.row <= h.value.frozen.rows ? {
|
|
@@ -737,58 +864,58 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
737
864
|
left: 0,
|
|
738
865
|
zIndex: 4
|
|
739
866
|
} : void 0)
|
|
740
|
-
}, I(e.row), 7), (M(!0),
|
|
867
|
+
}, I(e.row), 7), (M(!0), S(v, null, P(j.value, (t) => (M(), S(v, { key: t.col }, [ce.value.has(`${e.row},${t.col}`) ? x("", !0) : (M(), S("td", {
|
|
741
868
|
key: 0,
|
|
742
869
|
rowspan: de(e.row, t.col)?.rows,
|
|
743
870
|
colspan: de(e.row, t.col)?.cols,
|
|
744
871
|
class: k(["pk-spreadsheet-preview__cell", {
|
|
745
872
|
"pk-spreadsheet-preview__cell--range": Ae(e.row, t.col) && !je(e.row, t.col),
|
|
746
873
|
"pk-spreadsheet-preview__cell--missing": H(e.row, t.col)?.missing,
|
|
747
|
-
"pk-spreadsheet-preview__cell--marked":
|
|
874
|
+
"pk-spreadsheet-preview__cell--marked": E(e.row, t.col)
|
|
748
875
|
}]),
|
|
749
|
-
style: A(
|
|
876
|
+
style: A(ge(H(e.row, t.col), e.row, t.col)),
|
|
750
877
|
"data-focus": je(e.row, t.col) ? "" : void 0,
|
|
751
878
|
"data-cell": `${e.row}:${t.col}`,
|
|
752
879
|
title: H(e.row, t.col)?.missing ? L(c)("chatFilePreview.missingValue") : void 0,
|
|
753
|
-
onMousedown: V((n) =>
|
|
754
|
-
onMouseenter: (n) =>
|
|
755
|
-
onDblclick:
|
|
756
|
-
}, I(me(H(e.row, t.col))), 47,
|
|
880
|
+
onMousedown: V((n) => at(e.row, t.col, n), ["prevent"]),
|
|
881
|
+
onMouseenter: (n) => ot(e.row, t.col),
|
|
882
|
+
onDblclick: ut
|
|
883
|
+
}, I(me(H(e.row, t.col))), 47, Re))], 64))), 128))], 4));
|
|
757
884
|
return a.memo = i, a;
|
|
758
885
|
}, n, 0), 128))])
|
|
759
|
-
], 6)) :
|
|
760
|
-
|
|
886
|
+
], 6)) : x("", !0), h.value && (h.value.moreRows || h.value.moreColumns) ? (M(), S("p", ze, [h.value.moreRows ? (M(), S(v, { key: 0 }, [w(I(L(c)("chatFilePreview.moreRows", h.value.moreRows)), 1)], 64)) : x("", !0), h.value.moreColumns ? (M(), S(v, { key: 1 }, [w(I(L(c)("chatFilePreview.moreColumns", h.value.moreColumns)), 1)], 64)) : x("", !0)])) : x("", !0)], 40, Le),
|
|
887
|
+
C("nav", {
|
|
761
888
|
class: "pk-spreadsheet-preview__sheets",
|
|
762
889
|
"aria-label": L(c)("chatFilePreview.sheets")
|
|
763
|
-
}, [(M(!0),
|
|
890
|
+
}, [(M(!0), S(v, null, P(e.preview.sheets, (e, t) => (M(), S("button", {
|
|
764
891
|
key: e.name,
|
|
765
892
|
type: "button",
|
|
766
893
|
class: "pk-spreadsheet-preview__sheet",
|
|
767
894
|
"aria-current": t === u.value ? "page" : void 0,
|
|
768
895
|
onClick: (e) => u.value = t
|
|
769
|
-
}, I(e.name), 9,
|
|
770
|
-
|
|
896
|
+
}, I(e.name), 9, Ve))), 128))], 8, Be),
|
|
897
|
+
C("div", He, [C("p", Ue, [e.preview.staleFormulas ? (M(), S("span", {
|
|
771
898
|
key: 0,
|
|
772
899
|
class: "pk-spreadsheet-preview__note",
|
|
773
900
|
title: L(c)("chatFilePreview.staleFormulas")
|
|
774
|
-
}, I(L(c)("chatFilePreview.staleFormulas")), 9,
|
|
901
|
+
}, I(L(c)("chatFilePreview.staleFormulas")), 9, We)) : e.preview.computedFormulas ? (M(), S("span", {
|
|
775
902
|
key: 1,
|
|
776
903
|
class: "pk-spreadsheet-preview__note",
|
|
777
904
|
title: L(c)("chatFilePreview.computedFormulas")
|
|
778
|
-
}, I(L(c)("chatFilePreview.computedFormulas")), 9,
|
|
779
|
-
yt.value.average ? (M(),
|
|
780
|
-
|
|
781
|
-
yt.value.sum ? (M(),
|
|
782
|
-
])) :
|
|
783
|
-
|
|
905
|
+
}, I(L(c)("chatFilePreview.computedFormulas")), 9, Ge)) : x("", !0), yt.value ? (M(), S("span", Ke, [
|
|
906
|
+
yt.value.average ? (M(), S("span", qe, I(L(c)("chatFilePreview.average")) + " " + I(yt.value.average), 1)) : x("", !0),
|
|
907
|
+
C("span", null, I(L(c)("chatFilePreview.count")) + " " + I(yt.value.count), 1),
|
|
908
|
+
yt.value.sum ? (M(), S("span", Je, I(L(c)("chatFilePreview.sum")) + " " + I(yt.value.sum), 1)) : x("", !0)
|
|
909
|
+
])) : x("", !0)]), C("div", Ye, [
|
|
910
|
+
T(r, {
|
|
784
911
|
modifiers: "action-quiet",
|
|
785
912
|
icon: "ri:subtract-line",
|
|
786
913
|
"aria-label": L(c)("chatFilePreview.zoomOut"),
|
|
787
914
|
disabled: d.value <= .5,
|
|
788
915
|
onClick: n[4] ||= (e) => bt(-.1)
|
|
789
916
|
}, null, 8, ["aria-label", "disabled"]),
|
|
790
|
-
|
|
791
|
-
|
|
917
|
+
C("span", Xe, I(Math.round(d.value * 100)) + "% ", 1),
|
|
918
|
+
T(r, {
|
|
792
919
|
modifiers: "action-quiet",
|
|
793
920
|
icon: "ri:add-line",
|
|
794
921
|
"aria-label": L(c)("chatFilePreview.zoomIn"),
|
|
@@ -799,11 +926,11 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
799
926
|
]);
|
|
800
927
|
};
|
|
801
928
|
}
|
|
802
|
-
}),
|
|
929
|
+
}), it = ["src"], at = {
|
|
803
930
|
key: 1,
|
|
804
931
|
class: "pk-word-preview__image",
|
|
805
932
|
"data-quote-skip": ""
|
|
806
|
-
},
|
|
933
|
+
}, ot = ["title"], st = ["title"], ct = ["data-quote-skip"], lt = /* @__PURE__ */ E({
|
|
807
934
|
__name: "PkWordPreviewRuns",
|
|
808
935
|
props: {
|
|
809
936
|
runs: {},
|
|
@@ -812,7 +939,7 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
812
939
|
numbers: {}
|
|
813
940
|
},
|
|
814
941
|
setup(e) {
|
|
815
|
-
let t = e, { t: n } = le({ useScope: "global" }), r =
|
|
942
|
+
let t = e, { t: n } = le({ useScope: "global" }), r = ee(m, void 0), i = (e) => e.picture ? f(r?.value, e.picture.ref) : void 0, a = (e) => t.page ? p(e) : "inline", o = (e) => {
|
|
816
943
|
let n = {
|
|
817
944
|
width: `${e.width}pt`,
|
|
818
945
|
aspectRatio: `${e.width} / ${e.height}`
|
|
@@ -839,49 +966,49 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
839
966
|
top: `${r.y}pt`,
|
|
840
967
|
zIndex: r.wrap === "behind" ? -1 : 1
|
|
841
968
|
};
|
|
842
|
-
}, c = (e) => e.field && t.numbers ? String(t.numbers[e.field]) : e.text, l =
|
|
969
|
+
}, c = (e) => e.field && t.numbers ? String(t.numbers[e.field]) : e.text, l = y(() => {
|
|
843
970
|
let e = s(t.runs, t.mode ?? "markup"), n = (e) => !!e.picture && !!t.page && ["around", "block"].includes(p(e.picture));
|
|
844
971
|
return [...e.filter(n), ...e.filter((e) => !n(e))];
|
|
845
|
-
}), u =
|
|
972
|
+
}), u = y(() => !t.mode || t.mode === "markup"), h = (e) => {
|
|
846
973
|
let t = {};
|
|
847
974
|
e.font && (t.fontFamily = d(e.font)), t.fontSize = e.size ? `${e.size}pt` : "var(--pk-word-size)", e.color && (t.color = e.color), e.highlight && (t.backgroundColor = e.highlight), e.bold && (t.fontWeight = 700), e.italic && (t.fontStyle = "italic");
|
|
848
975
|
let n = [e.underline ? "underline" : "", e.strike ? "line-through" : ""].filter(Boolean).join(" ");
|
|
849
976
|
return n && (t.textDecoration = n), e.caps && (t.textTransform = "uppercase"), e.vertAlign && (t.verticalAlign = e.vertAlign, t.fontSize = `${(e.size ?? 11) * .65}pt`), t;
|
|
850
|
-
},
|
|
977
|
+
}, g = (e) => {
|
|
851
978
|
let t = h(e), n = new Set(String(t.textDecoration ?? "").split(" ").filter(Boolean));
|
|
852
979
|
return n.add(e.change === "deleted" ? "line-through" : "underline"), {
|
|
853
980
|
...t,
|
|
854
981
|
textDecoration: [...n].join(" ")
|
|
855
982
|
};
|
|
856
|
-
},
|
|
857
|
-
return (e, t) => (M(!0),
|
|
983
|
+
}, _ = (e) => e.author ? n("chatFilePreview.revisionBy", { author: e.author }) : void 0;
|
|
984
|
+
return (e, t) => (M(!0), S(v, null, P(l.value, (e, t) => (M(), S(v, { key: t }, [e.image ? (M(), S(v, { key: 0 }, [e.picture && i(e) ? (M(), S(v, { key: 0 }, [a(e.picture) === "page" ? x("", !0) : (M(), S("img", {
|
|
858
985
|
key: 0,
|
|
859
986
|
class: k(["pk-word-preview__picture", `pk-word-preview__picture--${a(e.picture)}`]),
|
|
860
987
|
style: A(o(e.picture)),
|
|
861
988
|
src: i(e),
|
|
862
989
|
alt: ""
|
|
863
|
-
}, null, 14,
|
|
990
|
+
}, null, 14, it))], 64)) : (M(), S("span", at, I(L(n)("chatFilePreview.image")), 1))], 64)) : u.value && e.change === "deleted" ? (M(), S("del", {
|
|
864
991
|
key: 1,
|
|
865
992
|
class: "pk-word-preview__removed",
|
|
866
993
|
"data-quote-skip": "",
|
|
867
|
-
style: A(
|
|
868
|
-
title:
|
|
869
|
-
}, I(c(e)), 13,
|
|
994
|
+
style: A(g(e)),
|
|
995
|
+
title: _(e)
|
|
996
|
+
}, I(c(e)), 13, ot)) : u.value && e.change === "inserted" ? (M(), S("ins", {
|
|
870
997
|
key: 2,
|
|
871
998
|
class: "pk-word-preview__added",
|
|
872
|
-
style: A(
|
|
873
|
-
title:
|
|
874
|
-
}, I(c(e)), 13,
|
|
999
|
+
style: A(g(e)),
|
|
1000
|
+
title: _(e)
|
|
1001
|
+
}, I(c(e)), 13, st)) : (M(), S("span", {
|
|
875
1002
|
key: 3,
|
|
876
1003
|
style: A(h(e)),
|
|
877
1004
|
"data-quote-skip": e.label ? "" : void 0
|
|
878
|
-
}, I(c(e)), 13,
|
|
1005
|
+
}, I(c(e)), 13, ct))], 64))), 128));
|
|
879
1006
|
}
|
|
880
|
-
}),
|
|
1007
|
+
}), ut = { key: 0 }, Q = ["data-paragraph", "colspan"], dt = [
|
|
881
1008
|
"data-paragraph",
|
|
882
1009
|
"role",
|
|
883
1010
|
"aria-level"
|
|
884
|
-
],
|
|
1011
|
+
], ft = { key: 1 }, $ = /* @__PURE__ */ E({
|
|
885
1012
|
__name: "PkWordPreviewBlock",
|
|
886
1013
|
props: {
|
|
887
1014
|
block: {},
|
|
@@ -892,7 +1019,7 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
892
1019
|
marked: {}
|
|
893
1020
|
},
|
|
894
1021
|
setup(e) {
|
|
895
|
-
let t = e, n =
|
|
1022
|
+
let t = e, n = y(() => {
|
|
896
1023
|
if (t.block.kind === "table") return {};
|
|
897
1024
|
let e = t.block.style ?? {};
|
|
898
1025
|
return {
|
|
@@ -906,26 +1033,26 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
906
1033
|
backgroundColor: e.shading,
|
|
907
1034
|
fontSize: e.size ? `${e.size}pt` : void 0
|
|
908
1035
|
};
|
|
909
|
-
}), r =
|
|
1036
|
+
}), r = y(() => {
|
|
910
1037
|
if (t.block.kind === "table") return {};
|
|
911
1038
|
let e = -(t.block.style?.firstLine ?? 0);
|
|
912
1039
|
return e > 0 ? { minWidth: `calc(${e}pt * var(--pk-word-indent-scale, 1))` } : { paddingRight: "6pt" };
|
|
913
|
-
}), i =
|
|
1040
|
+
}), i = y(() => t.mode === "markup" && t.block.kind !== "table" && t.block.runs.some((e) => e.change)), a = y(() => t.block.kind === "table" && t.row !== void 0 ? t.block.rows[t.row] : void 0), o = y(() => {
|
|
914
1041
|
if (t.block.kind !== "table") return [];
|
|
915
1042
|
let e = t.block.widths ?? [], n = e.reduce((e, t) => e + t, 0);
|
|
916
1043
|
return n ? e.map((e) => `${e / n * 100}%`) : [];
|
|
917
|
-
}), s =
|
|
918
|
-
return (t, u) => e.block.kind === "table" && a.value ? (M(),
|
|
1044
|
+
}), s = y(() => t.block.kind !== "table" && !!t.block.id && !!t.marked?.has(t.block.id)), c = (e) => !!e?.some((e) => t.marked?.has(e)), l = y(() => t.mode === "markup" && !!a.value?.some((e) => e.runs.some((e) => e.change)));
|
|
1045
|
+
return (t, u) => e.block.kind === "table" && a.value ? (M(), S("table", {
|
|
919
1046
|
key: 0,
|
|
920
1047
|
class: k(["pk-word-preview__table", {
|
|
921
1048
|
"pk-word-preview__table--lines": e.block.borders,
|
|
922
1049
|
"pk-word-preview__table--next": e.row !== 0,
|
|
923
1050
|
"pk-word-preview__changed": l.value
|
|
924
1051
|
}])
|
|
925
|
-
}, [o.value.length ? (M(),
|
|
1052
|
+
}, [o.value.length ? (M(), S("colgroup", ut, [(M(!0), S(v, null, P(o.value, (e, t) => (M(), S("col", {
|
|
926
1053
|
key: t,
|
|
927
1054
|
style: A({ width: e })
|
|
928
|
-
}, null, 4))), 128))])) :
|
|
1055
|
+
}, null, 4))), 128))])) : x("", !0), C("tbody", null, [C("tr", null, [(M(!0), S(v, null, P(a.value, (t, n) => (M(), S("td", {
|
|
929
1056
|
key: n,
|
|
930
1057
|
"data-paragraph": t.ids?.join(" "),
|
|
931
1058
|
class: k({ "pk-word-preview__marked": c(t.ids) }),
|
|
@@ -935,7 +1062,7 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
935
1062
|
textAlign: t.align,
|
|
936
1063
|
fontSize: t.size ? `${t.size}pt` : void 0
|
|
937
1064
|
})
|
|
938
|
-
}, [
|
|
1065
|
+
}, [T(lt, {
|
|
939
1066
|
runs: t.runs,
|
|
940
1067
|
mode: e.mode,
|
|
941
1068
|
numbers: e.numbers
|
|
@@ -943,7 +1070,7 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
943
1070
|
"runs",
|
|
944
1071
|
"mode",
|
|
945
1072
|
"numbers"
|
|
946
|
-
])], 14,
|
|
1073
|
+
])], 14, Q))), 128))])])], 2)) : e.block.kind === "table" ? x("", !0) : (M(), S("div", {
|
|
947
1074
|
key: 1,
|
|
948
1075
|
class: k(["pk-word-preview__block", {
|
|
949
1076
|
"pk-word-preview__changed": i.value,
|
|
@@ -954,13 +1081,13 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
954
1081
|
"aria-level": e.block.kind === "heading" ? Math.max(1, e.block.level) : void 0,
|
|
955
1082
|
style: A(n.value)
|
|
956
1083
|
}, [
|
|
957
|
-
e.block.label ? (M(),
|
|
1084
|
+
e.block.label ? (M(), S("span", {
|
|
958
1085
|
key: 0,
|
|
959
1086
|
class: "pk-word-preview__label",
|
|
960
1087
|
"data-quote-skip": "",
|
|
961
1088
|
style: A(r.value)
|
|
962
|
-
}, I(e.block.label), 5)) :
|
|
963
|
-
|
|
1089
|
+
}, I(e.block.label), 5)) : x("", !0),
|
|
1090
|
+
T(lt, {
|
|
964
1091
|
runs: e.block.runs,
|
|
965
1092
|
mode: e.mode,
|
|
966
1093
|
page: e.page,
|
|
@@ -971,10 +1098,10 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
971
1098
|
"page",
|
|
972
1099
|
"numbers"
|
|
973
1100
|
]),
|
|
974
|
-
!e.block.label && !e.block.runs.length ? (M(),
|
|
975
|
-
], 14,
|
|
1101
|
+
!e.block.label && !e.block.runs.length ? (M(), S("br", ft)) : x("", !0)
|
|
1102
|
+
], 14, dt));
|
|
976
1103
|
}
|
|
977
|
-
}),
|
|
1104
|
+
}), pt = { class: "pk-word-preview__part" }, mt = ["src"], ht = /* @__PURE__ */ E({
|
|
978
1105
|
__name: "PkWordPreviewPart",
|
|
979
1106
|
props: {
|
|
980
1107
|
blocks: {},
|
|
@@ -984,13 +1111,13 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
984
1111
|
numbers: {}
|
|
985
1112
|
},
|
|
986
1113
|
setup(e) {
|
|
987
|
-
let t = e, n =
|
|
1114
|
+
let t = e, n = ee(m, void 0), r = y(() => u(t.blocks, t.mode)), i = y(() => c(t.blocks, t.mode).flatMap((e) => {
|
|
988
1115
|
let r = f(n?.value, e.ref);
|
|
989
1116
|
return r ? [{
|
|
990
1117
|
src: r,
|
|
991
1118
|
css: h(e, t.section.page)
|
|
992
1119
|
}] : [];
|
|
993
|
-
})), a =
|
|
1120
|
+
})), a = y(() => {
|
|
994
1121
|
let { margins: e } = t.section.page;
|
|
995
1122
|
return {
|
|
996
1123
|
left: `${e.left}pt`,
|
|
@@ -998,10 +1125,10 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
998
1125
|
...t.where === "header" ? { top: `${t.section.headerDistance}pt` } : { bottom: `${t.section.footerDistance}pt` }
|
|
999
1126
|
};
|
|
1000
1127
|
});
|
|
1001
|
-
return (t, n) => (M(),
|
|
1128
|
+
return (t, n) => (M(), S("div", pt, [C("div", {
|
|
1002
1129
|
class: "pk-word-preview__part-flow",
|
|
1003
1130
|
style: A(a.value)
|
|
1004
|
-
}, [(M(!0),
|
|
1131
|
+
}, [(M(!0), S(v, null, P(r.value, (t) => (M(), b($, {
|
|
1005
1132
|
key: t.key,
|
|
1006
1133
|
block: e.blocks[t.block],
|
|
1007
1134
|
row: t.row,
|
|
@@ -1014,45 +1141,45 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
1014
1141
|
"mode",
|
|
1015
1142
|
"page",
|
|
1016
1143
|
"numbers"
|
|
1017
|
-
]))), 128))], 4), (M(!0),
|
|
1144
|
+
]))), 128))], 4), (M(!0), S(v, null, P(i.value, (e, t) => (M(), S("img", {
|
|
1018
1145
|
key: t,
|
|
1019
1146
|
class: "pk-word-preview__float",
|
|
1020
1147
|
style: A(e.css),
|
|
1021
1148
|
src: e.src,
|
|
1022
1149
|
alt: ""
|
|
1023
|
-
}, null, 12,
|
|
1150
|
+
}, null, 12, mt))), 128))]));
|
|
1024
1151
|
}
|
|
1025
|
-
}),
|
|
1152
|
+
}), gt = ["aria-label"], _t = {
|
|
1026
1153
|
class: "pk-word-preview__tabs",
|
|
1027
1154
|
role: "tablist"
|
|
1028
|
-
},
|
|
1155
|
+
}, vt = ["aria-selected"], yt = ["aria-selected"], bt = {
|
|
1029
1156
|
key: 0,
|
|
1030
1157
|
class: "pk-word-preview__list"
|
|
1031
|
-
},
|
|
1158
|
+
}, xt = ["aria-current", "onClick"], St = { class: "pk-word-preview__entry-text" }, Ct = {
|
|
1032
1159
|
key: 0,
|
|
1033
1160
|
class: "u-dot"
|
|
1034
|
-
},
|
|
1161
|
+
}, wt = {
|
|
1035
1162
|
key: 0,
|
|
1036
1163
|
class: "pk-word-preview__none"
|
|
1037
|
-
},
|
|
1164
|
+
}, Tt = {
|
|
1038
1165
|
key: 1,
|
|
1039
1166
|
class: "pk-word-preview__list"
|
|
1040
|
-
},
|
|
1167
|
+
}, Et = ["onClick"], Dt = {
|
|
1041
1168
|
key: 0,
|
|
1042
1169
|
class: "pk-word-preview__removed"
|
|
1043
|
-
},
|
|
1170
|
+
}, Ot = {
|
|
1044
1171
|
key: 1,
|
|
1045
1172
|
class: "pk-word-preview__added"
|
|
1046
|
-
},
|
|
1173
|
+
}, kt = { class: "pk-word-preview__main" }, At = ["aria-label"], jt = ["src"], Mt = {
|
|
1047
1174
|
key: 2,
|
|
1048
1175
|
class: "pk-word-preview__truncated"
|
|
1049
|
-
},
|
|
1176
|
+
}, Nt = { class: "pk-word-preview__status" }, Pt = {
|
|
1050
1177
|
key: 0,
|
|
1051
1178
|
class: "pk-word-preview__count"
|
|
1052
|
-
},
|
|
1179
|
+
}, Ft = { class: "pk-word-preview__count" }, It = {
|
|
1053
1180
|
key: 1,
|
|
1054
1181
|
class: "pk-word-preview__legend"
|
|
1055
|
-
},
|
|
1182
|
+
}, Lt = ["title"], Rt = { class: "pk-word-preview__removed" }, zt = { class: "pk-word-preview__added" }, Bt = { class: "pk-word-preview__percent" }, Vt = ["data-part"], Ht = 96 / 72, Ut = .5, Wt = /* @__PURE__ */ E({
|
|
1056
1183
|
__name: "PkWordPreview",
|
|
1057
1184
|
props: /*@__PURE__*/ O({
|
|
1058
1185
|
preview: {},
|
|
@@ -1070,23 +1197,23 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
1070
1197
|
emits: /*@__PURE__*/ O(["select"], ["update:fit", "update:zoom"]),
|
|
1071
1198
|
setup(e, { emit: t }) {
|
|
1072
1199
|
let n = e, r = t, { t: i } = le({ useScope: "global" });
|
|
1073
|
-
ie(m,
|
|
1074
|
-
let o = (e) => s(e, n.mode), p =
|
|
1200
|
+
ie(m, y(() => n.preview.images));
|
|
1201
|
+
let o = (e) => s(e, n.mode), p = y(() => u(n.preview.blocks, n.mode)), _ = ae("rootEl"), w = ae("scrollEl"), E = ae("measureEl"), { width: ee } = ue(_), { width: D } = ue(w), O = y(() => ee.value >= 1e3), j = y(() => n.preview.sections?.length ? n.preview.sections : [{
|
|
1075
1202
|
page: n.preview.page,
|
|
1076
1203
|
headerDistance: 0,
|
|
1077
1204
|
footerDistance: 0,
|
|
1078
1205
|
headers: {},
|
|
1079
1206
|
footers: {}
|
|
1080
|
-
}]), F =
|
|
1207
|
+
}]), F = y(() => j.value[0].page), oe = y(() => (D.value - 48) / (F.value.width * Ht)), B = y(() => ee.value === 0 || D.value === 0 || oe.value >= Ut), se = y(() => ({
|
|
1081
1208
|
fontFamily: d(n.preview.defaults.font),
|
|
1082
1209
|
fontSize: `${n.preview.defaults.size}pt`,
|
|
1083
1210
|
color: n.preview.defaults.color ?? "#000000",
|
|
1084
1211
|
"--pk-word-line": l(n.preview.defaults.font),
|
|
1085
1212
|
"--pk-word-size": `${n.preview.defaults.size}pt`
|
|
1086
|
-
})), ce =
|
|
1213
|
+
})), ce = y(() => F.value.width - F.value.margins.left - F.value.margins.right), V = y(() => ({
|
|
1087
1214
|
...se.value,
|
|
1088
1215
|
width: `${ce.value}pt`
|
|
1089
|
-
})), H = ae("flowEl"), { width: de } = ue(H), U =
|
|
1216
|
+
})), H = ae("flowEl"), { width: de } = ue(H), U = y(() => {
|
|
1090
1217
|
let e = /* @__PURE__ */ new Map(), t = 0;
|
|
1091
1218
|
for (let r of n.preview.blocks) {
|
|
1092
1219
|
if (r.kind === "table") continue;
|
|
@@ -1099,15 +1226,15 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
1099
1226
|
let r = 0;
|
|
1100
1227
|
for (let [n, i] of [...e].sort((e, t) => e[0] - t[0])) if (r += i, r > t / 10) return n;
|
|
1101
1228
|
return 0;
|
|
1102
|
-
}), fe =
|
|
1229
|
+
}), fe = y(() => ({
|
|
1103
1230
|
...se.value,
|
|
1104
1231
|
"--pk-word-indent-shared": `${U.value}pt`,
|
|
1105
|
-
"--pk-word-indent-scale": de.value ? Math.min(1, de.value / (ce.value *
|
|
1232
|
+
"--pk-word-indent-scale": de.value ? Math.min(1, de.value / (ce.value * Ht)) : 1
|
|
1106
1233
|
})), W = N([]), pe = N({}), he = async () => {
|
|
1107
1234
|
await te();
|
|
1108
|
-
let e =
|
|
1235
|
+
let e = E.value?.querySelectorAll("[data-item]");
|
|
1109
1236
|
W.value = [...e ?? []].map((e) => e.getBoundingClientRect().height);
|
|
1110
|
-
let t =
|
|
1237
|
+
let t = E.value?.querySelectorAll("[data-part]");
|
|
1111
1238
|
pe.value = Object.fromEntries([...t ?? []].map((e) => [e.dataset.part ?? "", e.getBoundingClientRect().height]));
|
|
1112
1239
|
};
|
|
1113
1240
|
z([
|
|
@@ -1117,7 +1244,7 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
1117
1244
|
], he, { flush: "post" }), re(() => {
|
|
1118
1245
|
he(), document.fonts?.ready.then(he);
|
|
1119
1246
|
});
|
|
1120
|
-
let G =
|
|
1247
|
+
let G = y(() => {
|
|
1121
1248
|
if (!B.value || W.value.length !== p.value.length) return [{
|
|
1122
1249
|
items: p.value.map((e, t) => t),
|
|
1123
1250
|
section: 0,
|
|
@@ -1129,7 +1256,7 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
1129
1256
|
let n = j.value[t];
|
|
1130
1257
|
return r && n.pageStart !== void 0 ? n.pageStart : (a ?? e[e.length - 1]?.number ?? 0) + 1;
|
|
1131
1258
|
}, s = (e) => {
|
|
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 ? (pe.value[e] ?? 0) /
|
|
1259
|
+
let i = j.value[t], a = (t) => r && i.titlePage ? t.first : n.preview.evenAndOddHeaders && e % 2 == 0 ? t.even : t.default, o = a(i.headers), s = a(i.footers), c = (e) => e ? (pe.value[e] ?? 0) / Ht : 0;
|
|
1133
1260
|
return {
|
|
1134
1261
|
header: o,
|
|
1135
1262
|
footer: s,
|
|
@@ -1147,14 +1274,14 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
1147
1274
|
};
|
|
1148
1275
|
return p.value.forEach((n, l) => {
|
|
1149
1276
|
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) *
|
|
1277
|
+
let u = e[e.length - 1], d = u && j.value[u.section].page, f = d ? (d.height - u.top - u.bottom) * Ht : 0, m = W.value[l];
|
|
1151
1278
|
for (let e = l; p.value[e]?.keepNext && e + 1 < p.value.length && !p.value[e + 1].breakBefore; e++) m += W.value[e + 1];
|
|
1152
1279
|
(!u || u.items.length && (n.breakBefore || i + W.value[l] > f || i + m > f && m <= (() => {
|
|
1153
1280
|
let e = s(o());
|
|
1154
|
-
return (j.value[t].page.height - e.top - e.bottom) *
|
|
1281
|
+
return (j.value[t].page.height - e.top - e.bottom) * Ht;
|
|
1155
1282
|
})())) && c(), e[e.length - 1].items.push(l), i += W.value[l];
|
|
1156
1283
|
}), e.length || c(), e;
|
|
1157
|
-
}),
|
|
1284
|
+
}), ge = y(() => {
|
|
1158
1285
|
let e = /* @__PURE__ */ new Map();
|
|
1159
1286
|
for (let t of G.value) e.set(t.section, (e.get(t.section) ?? 0) + 1);
|
|
1160
1287
|
return G.value.map((t) => ({
|
|
@@ -1162,7 +1289,7 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
1162
1289
|
pages: G.value.length,
|
|
1163
1290
|
sectionPages: e.get(t.section) ?? 1
|
|
1164
1291
|
}));
|
|
1165
|
-
}),
|
|
1292
|
+
}), _e = (e) => {
|
|
1166
1293
|
let t = j.value[e.section].page;
|
|
1167
1294
|
return {
|
|
1168
1295
|
...se.value,
|
|
@@ -1170,7 +1297,7 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
1170
1297
|
minHeight: `${t.height}pt`,
|
|
1171
1298
|
padding: `${e.top}pt ${t.margins.right}pt ${e.bottom}pt ${t.margins.left}pt`
|
|
1172
1299
|
};
|
|
1173
|
-
},
|
|
1300
|
+
}, K = (e) => {
|
|
1174
1301
|
let t = [...new Set(e.items.map((e) => p.value[e].block))];
|
|
1175
1302
|
return c(t.map((e) => n.preview.blocks[e]), n.mode).flatMap((t) => {
|
|
1176
1303
|
let r = f(n.preview.images, t.ref);
|
|
@@ -1179,48 +1306,48 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
1179
1306
|
css: h(t, j.value[e.section].page)
|
|
1180
1307
|
}] : [];
|
|
1181
1308
|
});
|
|
1182
|
-
}, q = R(e, "fit"), ve = R(e, "zoom"),
|
|
1183
|
-
ve.value = Math.min(2, Math.max(.3, Math.round((
|
|
1184
|
-
},
|
|
1185
|
-
let e =
|
|
1309
|
+
}, q = R(e, "fit"), ve = R(e, "zoom"), J = y(() => q.value ? Math.min(1.25, Math.max(.3, oe.value)) : ve.value), ye = (e) => {
|
|
1310
|
+
ve.value = Math.min(2, Math.max(.3, Math.round((J.value + e) * 10) / 10)), q.value = !1;
|
|
1311
|
+
}, be = N(0), xe = N(), Se = () => {
|
|
1312
|
+
let e = w.value?.getBoundingClientRect();
|
|
1186
1313
|
if (!e) return;
|
|
1187
|
-
let t =
|
|
1314
|
+
let t = w.value?.querySelectorAll("[data-page]") ?? [], n = 0;
|
|
1188
1315
|
for (let [r, i] of [...t].entries()) {
|
|
1189
1316
|
if (i.getBoundingClientRect().top - e.top > e.height / 3) break;
|
|
1190
1317
|
n = r;
|
|
1191
1318
|
}
|
|
1192
|
-
|
|
1319
|
+
be.value = n;
|
|
1193
1320
|
let r;
|
|
1194
|
-
for (let t of
|
|
1195
|
-
let n =
|
|
1321
|
+
for (let t of Oe.value) {
|
|
1322
|
+
let n = w.value?.querySelector(`[data-key="${t.key}"]`);
|
|
1196
1323
|
if (n) {
|
|
1197
1324
|
if (n.getBoundingClientRect().top - e.top > 48) break;
|
|
1198
1325
|
r = t.key;
|
|
1199
1326
|
}
|
|
1200
1327
|
}
|
|
1201
|
-
|
|
1202
|
-
},
|
|
1203
|
-
|
|
1204
|
-
|
|
1328
|
+
xe.value = r ?? Oe.value[0]?.key;
|
|
1329
|
+
}, Ce = 0, we = () => {
|
|
1330
|
+
Ce ||= requestAnimationFrame(() => {
|
|
1331
|
+
Ce = 0, Se();
|
|
1205
1332
|
});
|
|
1206
1333
|
};
|
|
1207
|
-
ne(() => cancelAnimationFrame(
|
|
1208
|
-
let { selection:
|
|
1209
|
-
root: () =>
|
|
1334
|
+
ne(() => cancelAnimationFrame(Ce)), z(G, () => te(we));
|
|
1335
|
+
let { selection: Te } = me({
|
|
1336
|
+
root: () => w.value?.getRootNode(),
|
|
1210
1337
|
touch: !0
|
|
1211
1338
|
});
|
|
1212
|
-
z(
|
|
1213
|
-
let t =
|
|
1214
|
-
r("select", e && t ?
|
|
1339
|
+
z(Te, (e) => {
|
|
1340
|
+
let t = w.value;
|
|
1341
|
+
r("select", e && t ? Ee(t, e.range, ".pk-word-preview__measure, .pk-word-preview__part") : void 0);
|
|
1215
1342
|
});
|
|
1216
|
-
let
|
|
1217
|
-
let t = n.preview.blocks[e.block], r = t.kind === "heading" ? [t.label,
|
|
1343
|
+
let De = (e) => o(e).map((e) => e.text).join("").replace(/\s+/g, " ").trim(), Oe = y(() => p.value.flatMap((e) => {
|
|
1344
|
+
let t = n.preview.blocks[e.block], r = t.kind === "heading" ? [t.label, De(t.runs)].filter(Boolean).join(" ") : "";
|
|
1218
1345
|
return t.kind === "heading" && t.level <= 3 && r ? [{
|
|
1219
1346
|
key: e.key,
|
|
1220
1347
|
level: t.level,
|
|
1221
1348
|
text: r
|
|
1222
1349
|
}] : [];
|
|
1223
|
-
})), ke = (e) => e.length > 60 ? `${e.slice(0, 60)}…` : e, Y =
|
|
1350
|
+
})), ke = (e) => e.length > 60 ? `${e.slice(0, 60)}…` : e, Y = y(() => p.value.flatMap((e) => {
|
|
1224
1351
|
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();
|
|
1225
1352
|
return i || a ? [{
|
|
1226
1353
|
key: e.key,
|
|
@@ -1229,63 +1356,63 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
1229
1356
|
}] : [];
|
|
1230
1357
|
})), X;
|
|
1231
1358
|
z([() => n.marked, G], ([e]) => {
|
|
1232
|
-
!e || e === X || B.value && W.value.length !== p.value.length ||
|
|
1359
|
+
!e || e === X || B.value && W.value.length !== p.value.length || g(w.value, ".pk-word-preview__marked") && (X = e);
|
|
1233
1360
|
}, {
|
|
1234
1361
|
flush: "post",
|
|
1235
1362
|
immediate: !0
|
|
1236
1363
|
});
|
|
1237
1364
|
let Z = N("outline"), Ae = N(!1), je = (e) => {
|
|
1238
|
-
|
|
1365
|
+
w.value?.querySelector(`[data-key="${e}"]`)?.scrollIntoView({
|
|
1239
1366
|
block: "start",
|
|
1240
1367
|
behavior: "smooth"
|
|
1241
1368
|
}), O.value || (Ae.value = !1);
|
|
1242
|
-
}, Me =
|
|
1369
|
+
}, Me = y(() => n.preview.blocks.flatMap((e) => e.kind === "table" ? e.rows.flat().map((e) => De(e.runs)) : [De(e.runs)]).join(" ").split(/\s+/).filter(Boolean).length), Ne = y(() => n.preview.revisionAuthors.join(", "));
|
|
1243
1370
|
return (t, n) => {
|
|
1244
1371
|
let r = a;
|
|
1245
|
-
return M(),
|
|
1372
|
+
return M(), S("div", {
|
|
1246
1373
|
ref_key: "rootEl",
|
|
1247
|
-
ref:
|
|
1374
|
+
ref: _,
|
|
1248
1375
|
class: k(["pk-word-preview", { "pk-word-preview--paged": B.value }])
|
|
1249
1376
|
}, [
|
|
1250
|
-
(O.value || Ae.value) && (
|
|
1377
|
+
(O.value || Ae.value) && (Oe.value.length || Y.value.length) ? (M(), S("aside", {
|
|
1251
1378
|
key: 0,
|
|
1252
1379
|
class: k(["pk-word-preview__side", { "pk-word-preview__side--over": !O.value }]),
|
|
1253
1380
|
"aria-label": L(i)("chatFilePreview.outline")
|
|
1254
|
-
}, [
|
|
1381
|
+
}, [C("div", _t, [C("button", {
|
|
1255
1382
|
type: "button",
|
|
1256
1383
|
role: "tab",
|
|
1257
1384
|
class: "pk-word-preview__tab",
|
|
1258
1385
|
"aria-selected": Z.value === "outline",
|
|
1259
1386
|
onClick: n[0] ||= (e) => Z.value = "outline"
|
|
1260
|
-
}, I(L(i)("chatFilePreview.outline")), 9,
|
|
1387
|
+
}, I(L(i)("chatFilePreview.outline")), 9, vt), Y.value.length ? (M(), S("button", {
|
|
1261
1388
|
key: 0,
|
|
1262
1389
|
type: "button",
|
|
1263
1390
|
role: "tab",
|
|
1264
1391
|
class: "pk-word-preview__tab",
|
|
1265
1392
|
"aria-selected": Z.value === "changes",
|
|
1266
1393
|
onClick: n[1] ||= (e) => Z.value = "changes"
|
|
1267
|
-
}, I(L(i)("chatFilePreview.changes", { count: Y.value.length })), 9,
|
|
1394
|
+
}, I(L(i)("chatFilePreview.changes", { count: Y.value.length })), 9, yt)) : x("", !0)]), Z.value === "outline" || !Y.value.length ? (M(), S("nav", bt, [(M(!0), S(v, null, P(Oe.value, (e) => (M(), S("button", {
|
|
1268
1395
|
key: e.key,
|
|
1269
1396
|
type: "button",
|
|
1270
1397
|
class: k(["pk-word-preview__entry", `pk-word-preview__entry--${Math.min(e.level, 3)}`]),
|
|
1271
|
-
"aria-current":
|
|
1398
|
+
"aria-current": xe.value === e.key ? "location" : void 0,
|
|
1272
1399
|
onClick: (t) => je(e.key)
|
|
1273
|
-
}, [
|
|
1400
|
+
}, [C("span", St, I(e.text), 1), Y.value.some((t) => t.key === e.key) ? (M(), S("span", Ct)) : x("", !0)], 10, xt))), 128)), Oe.value.length ? x("", !0) : (M(), S("p", wt, I(L(i)("chatFilePreview.noHeadings")), 1))])) : (M(), S("nav", Tt, [(M(!0), S(v, null, P(Y.value, (e) => (M(), S("button", {
|
|
1274
1401
|
key: e.key,
|
|
1275
1402
|
type: "button",
|
|
1276
1403
|
class: "pk-word-preview__entry pk-word-preview__entry--change",
|
|
1277
1404
|
onClick: (t) => je(e.key)
|
|
1278
|
-
}, [e.removed ? (M(),
|
|
1279
|
-
|
|
1405
|
+
}, [e.removed ? (M(), S("del", Dt, I(e.removed), 1)) : x("", !0), e.added ? (M(), S("ins", Ot, I(e.added), 1)) : x("", !0)], 8, Et))), 128))]))], 10, gt)) : x("", !0),
|
|
1406
|
+
C("div", kt, [C("div", {
|
|
1280
1407
|
ref_key: "scrollEl",
|
|
1281
|
-
ref:
|
|
1408
|
+
ref: w,
|
|
1282
1409
|
class: "pk-word-preview__scroll",
|
|
1283
|
-
onScroll:
|
|
1284
|
-
}, [B.value ? (M(),
|
|
1410
|
+
onScroll: we
|
|
1411
|
+
}, [B.value ? (M(), S("div", {
|
|
1285
1412
|
key: 0,
|
|
1286
1413
|
class: "pk-word-preview__pages",
|
|
1287
|
-
style: A({ zoom:
|
|
1288
|
-
}, [(M(!0),
|
|
1414
|
+
style: A({ zoom: J.value })
|
|
1415
|
+
}, [(M(!0), S(v, null, P(G.value, (t, n) => (M(), S("article", {
|
|
1289
1416
|
key: n,
|
|
1290
1417
|
"data-page": "",
|
|
1291
1418
|
class: "pk-word-preview__page",
|
|
@@ -1293,29 +1420,29 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
1293
1420
|
page: n + 1,
|
|
1294
1421
|
count: G.value.length
|
|
1295
1422
|
}),
|
|
1296
|
-
style: A(
|
|
1423
|
+
style: A(_e(t))
|
|
1297
1424
|
}, [
|
|
1298
|
-
t.header && e.preview.parts?.[t.header] ? (M(),
|
|
1425
|
+
t.header && e.preview.parts?.[t.header] ? (M(), b(ht, {
|
|
1299
1426
|
key: 0,
|
|
1300
1427
|
blocks: e.preview.parts[t.header],
|
|
1301
1428
|
where: "header",
|
|
1302
1429
|
section: j.value[t.section],
|
|
1303
1430
|
mode: e.mode,
|
|
1304
|
-
numbers:
|
|
1431
|
+
numbers: ge.value[n]
|
|
1305
1432
|
}, null, 8, [
|
|
1306
1433
|
"blocks",
|
|
1307
1434
|
"section",
|
|
1308
1435
|
"mode",
|
|
1309
1436
|
"numbers"
|
|
1310
|
-
])) :
|
|
1311
|
-
(M(!0),
|
|
1437
|
+
])) : x("", !0),
|
|
1438
|
+
(M(!0), S(v, null, P(t.items, (r) => (M(), b($, {
|
|
1312
1439
|
key: p.value[r].key,
|
|
1313
1440
|
"data-key": p.value[r].key,
|
|
1314
1441
|
block: e.preview.blocks[p.value[r].block],
|
|
1315
1442
|
row: p.value[r].row,
|
|
1316
1443
|
mode: e.mode,
|
|
1317
1444
|
page: j.value[t.section].page,
|
|
1318
|
-
numbers:
|
|
1445
|
+
numbers: ge.value[n],
|
|
1319
1446
|
marked: e.marked
|
|
1320
1447
|
}, null, 8, [
|
|
1321
1448
|
"data-key",
|
|
@@ -1326,33 +1453,33 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
1326
1453
|
"numbers",
|
|
1327
1454
|
"marked"
|
|
1328
1455
|
]))), 128)),
|
|
1329
|
-
(M(!0),
|
|
1456
|
+
(M(!0), S(v, null, P(K(t), (e, t) => (M(), S("img", {
|
|
1330
1457
|
key: `image-${t}`,
|
|
1331
1458
|
class: "pk-word-preview__float",
|
|
1332
1459
|
style: A(e.css),
|
|
1333
1460
|
src: e.src,
|
|
1334
1461
|
alt: ""
|
|
1335
|
-
}, null, 12,
|
|
1336
|
-
t.footer && e.preview.parts?.[t.footer] ? (M(),
|
|
1462
|
+
}, null, 12, jt))), 128)),
|
|
1463
|
+
t.footer && e.preview.parts?.[t.footer] ? (M(), b(ht, {
|
|
1337
1464
|
key: 1,
|
|
1338
1465
|
blocks: e.preview.parts[t.footer],
|
|
1339
1466
|
where: "footer",
|
|
1340
1467
|
section: j.value[t.section],
|
|
1341
1468
|
mode: e.mode,
|
|
1342
|
-
numbers:
|
|
1469
|
+
numbers: ge.value[n]
|
|
1343
1470
|
}, null, 8, [
|
|
1344
1471
|
"blocks",
|
|
1345
1472
|
"section",
|
|
1346
1473
|
"mode",
|
|
1347
1474
|
"numbers"
|
|
1348
|
-
])) :
|
|
1349
|
-
], 12,
|
|
1475
|
+
])) : x("", !0)
|
|
1476
|
+
], 12, At))), 128))], 4)) : (M(), S("article", {
|
|
1350
1477
|
key: 1,
|
|
1351
1478
|
ref_key: "flowEl",
|
|
1352
1479
|
ref: H,
|
|
1353
1480
|
class: "pk-word-preview__page pk-word-preview__page--flow",
|
|
1354
1481
|
style: A(fe.value)
|
|
1355
|
-
}, [(M(!0),
|
|
1482
|
+
}, [(M(!0), S(v, null, P(p.value, (t) => (M(), b($, {
|
|
1356
1483
|
key: t.key,
|
|
1357
1484
|
"data-key": t.key,
|
|
1358
1485
|
block: e.preview.blocks[t.block],
|
|
@@ -1365,22 +1492,22 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
1365
1492
|
"row",
|
|
1366
1493
|
"mode",
|
|
1367
1494
|
"marked"
|
|
1368
|
-
]))), 128))], 4)), e.preview.truncated ? (M(),
|
|
1369
|
-
B.value ? (M(),
|
|
1370
|
-
page:
|
|
1495
|
+
]))), 128))], 4)), e.preview.truncated ? (M(), S("p", Mt, I(L(i)("chatFilePreview.truncated")), 1)) : x("", !0)], 544), C("div", Nt, [
|
|
1496
|
+
B.value ? (M(), S("span", Pt, I(L(i)("chatFilePreview.pageOf", {
|
|
1497
|
+
page: be.value + 1,
|
|
1371
1498
|
count: G.value.length
|
|
1372
|
-
})), 1)) :
|
|
1373
|
-
|
|
1374
|
-
e.mode === "markup" && e.preview.revisionAuthors.length ? (M(),
|
|
1375
|
-
|
|
1499
|
+
})), 1)) : x("", !0),
|
|
1500
|
+
C("span", Ft, I(L(i)("chatFilePreview.words", Me.value)), 1),
|
|
1501
|
+
e.mode === "markup" && e.preview.revisionAuthors.length ? (M(), S("span", It, [
|
|
1502
|
+
C("span", {
|
|
1376
1503
|
class: "pk-word-preview__legend-text",
|
|
1377
1504
|
title: L(i)("chatFilePreview.revisionsOf", { authors: Ne.value })
|
|
1378
|
-
}, I(L(i)("chatFilePreview.revisionsOf", { authors: Ne.value })), 9,
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
])) :
|
|
1382
|
-
n[6] ||=
|
|
1383
|
-
!O.value && (
|
|
1505
|
+
}, I(L(i)("chatFilePreview.revisionsOf", { authors: Ne.value })), 9, Lt),
|
|
1506
|
+
C("del", Rt, I(L(i)("chatFilePreview.removed")), 1),
|
|
1507
|
+
C("ins", zt, I(L(i)("chatFilePreview.added")), 1)
|
|
1508
|
+
])) : x("", !0),
|
|
1509
|
+
n[6] ||= C("span", { class: "pk-word-preview__spacer" }, null, -1),
|
|
1510
|
+
!O.value && (Oe.value.length || Y.value.length) ? (M(), b(r, {
|
|
1384
1511
|
key: 2,
|
|
1385
1512
|
class: "pk-word-preview__outline-toggle",
|
|
1386
1513
|
modifiers: "action-quiet",
|
|
@@ -1395,9 +1522,9 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
1395
1522
|
"title",
|
|
1396
1523
|
"aria-label",
|
|
1397
1524
|
"aria-expanded"
|
|
1398
|
-
])) :
|
|
1399
|
-
B.value ? (M(),
|
|
1400
|
-
|
|
1525
|
+
])) : x("", !0),
|
|
1526
|
+
B.value ? (M(), S(v, { key: 3 }, [
|
|
1527
|
+
T(r, {
|
|
1401
1528
|
class: "pk-word-preview__fit",
|
|
1402
1529
|
modifiers: "action-quiet",
|
|
1403
1530
|
icon: "ri:expand-width-line",
|
|
@@ -1412,34 +1539,34 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
1412
1539
|
"aria-label",
|
|
1413
1540
|
"disabled"
|
|
1414
1541
|
]),
|
|
1415
|
-
|
|
1542
|
+
T(r, {
|
|
1416
1543
|
modifiers: "action-quiet",
|
|
1417
1544
|
icon: "ri:subtract-line",
|
|
1418
1545
|
"aria-label": L(i)("chatFilePreview.zoomOut"),
|
|
1419
|
-
disabled:
|
|
1420
|
-
onClick: n[4] ||= (e) =>
|
|
1546
|
+
disabled: J.value <= .3,
|
|
1547
|
+
onClick: n[4] ||= (e) => ye(-.1)
|
|
1421
1548
|
}, null, 8, ["aria-label", "disabled"]),
|
|
1422
|
-
|
|
1423
|
-
|
|
1549
|
+
C("span", Bt, I(Math.round(J.value * 100)) + "% ", 1),
|
|
1550
|
+
T(r, {
|
|
1424
1551
|
modifiers: "action-quiet",
|
|
1425
1552
|
icon: "ri:add-line",
|
|
1426
1553
|
"aria-label": L(i)("chatFilePreview.zoomIn"),
|
|
1427
|
-
disabled:
|
|
1428
|
-
onClick: n[5] ||= (e) =>
|
|
1554
|
+
disabled: J.value >= 2,
|
|
1555
|
+
onClick: n[5] ||= (e) => ye(.1)
|
|
1429
1556
|
}, null, 8, ["aria-label", "disabled"])
|
|
1430
|
-
], 64)) :
|
|
1557
|
+
], 64)) : x("", !0)
|
|
1431
1558
|
])]),
|
|
1432
|
-
B.value ? (M(),
|
|
1559
|
+
B.value ? (M(), S("div", {
|
|
1433
1560
|
key: 1,
|
|
1434
1561
|
ref_key: "measureEl",
|
|
1435
|
-
ref:
|
|
1562
|
+
ref: E,
|
|
1436
1563
|
class: "pk-word-preview__measure",
|
|
1437
1564
|
"aria-hidden": "true",
|
|
1438
1565
|
style: A(V.value)
|
|
1439
|
-
}, [(M(!0),
|
|
1566
|
+
}, [(M(!0), S(v, null, P(p.value, (t) => (M(), S("div", {
|
|
1440
1567
|
key: t.key,
|
|
1441
1568
|
"data-item": ""
|
|
1442
|
-
}, [
|
|
1569
|
+
}, [T($, {
|
|
1443
1570
|
block: e.preview.blocks[t.block],
|
|
1444
1571
|
row: t.row,
|
|
1445
1572
|
mode: e.mode,
|
|
@@ -1449,10 +1576,10 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
1449
1576
|
"row",
|
|
1450
1577
|
"mode",
|
|
1451
1578
|
"page"
|
|
1452
|
-
])]))), 128)), (M(!0),
|
|
1579
|
+
])]))), 128)), (M(!0), S(v, null, P(e.preview.parts, (t, n) => (M(), S("div", {
|
|
1453
1580
|
key: n,
|
|
1454
1581
|
"data-part": n
|
|
1455
|
-
}, [(M(!0),
|
|
1582
|
+
}, [(M(!0), S(v, null, P(L(u)(t, e.mode), (n) => (M(), b($, {
|
|
1456
1583
|
key: n.key,
|
|
1457
1584
|
block: t[n.block],
|
|
1458
1585
|
row: n.row,
|
|
@@ -1463,23 +1590,30 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
1463
1590
|
"row",
|
|
1464
1591
|
"mode",
|
|
1465
1592
|
"page"
|
|
1466
|
-
]))), 128))], 8,
|
|
1593
|
+
]))), 128))], 8, Vt))), 128))], 4)) : x("", !0)
|
|
1467
1594
|
], 2);
|
|
1468
1595
|
};
|
|
1469
1596
|
}
|
|
1470
|
-
}),
|
|
1597
|
+
}), Gt = ["aria-label"], Kt = { class: "pk-file-preview__head" }, qt = { class: "pk-file-preview__file" }, Jt = {
|
|
1471
1598
|
class: "pk-file-preview__tile",
|
|
1472
1599
|
"aria-hidden": "true"
|
|
1473
|
-
},
|
|
1600
|
+
}, Yt = { class: "pk-file-preview__name" }, Xt = { class: "pk-file-preview__title" }, Zt = {
|
|
1601
|
+
class: "pk-file-preview__note",
|
|
1602
|
+
role: "status"
|
|
1603
|
+
}, Qt = {
|
|
1474
1604
|
key: 0,
|
|
1605
|
+
class: "pk-file-preview__progress",
|
|
1606
|
+
"aria-hidden": "true"
|
|
1607
|
+
}, $t = {
|
|
1608
|
+
key: 1,
|
|
1475
1609
|
class: "pk-file-preview__tools"
|
|
1476
|
-
},
|
|
1610
|
+
}, en = ["aria-label"], tn = { class: "pk-file-preview__version" }, nn = { class: "pk-file-preview__mode-long" }, rn = { class: "pk-file-preview__mode-short" }, an = { class: "pk-file-preview__actions" }, on = { class: "pk-file-preview__body" }, sn = {
|
|
1477
1611
|
key: 0,
|
|
1478
1612
|
class: "pk-file-preview__skeleton vv-skeleton"
|
|
1479
|
-
},
|
|
1613
|
+
}, cn = {
|
|
1480
1614
|
key: 1,
|
|
1481
1615
|
class: "pk-file-preview__empty"
|
|
1482
|
-
},
|
|
1616
|
+
}, ln = /*@__PURE__*/ E({
|
|
1483
1617
|
__name: "PkFilePreview",
|
|
1484
1618
|
props: /*@__PURE__*/ O({
|
|
1485
1619
|
kind: {},
|
|
@@ -1495,7 +1629,8 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
1495
1629
|
resize: {},
|
|
1496
1630
|
fileId: {},
|
|
1497
1631
|
storedFileName: {},
|
|
1498
|
-
selectionActions: {}
|
|
1632
|
+
selectionActions: {},
|
|
1633
|
+
working: { type: Boolean }
|
|
1499
1634
|
}, {
|
|
1500
1635
|
mode: { default: "markup" },
|
|
1501
1636
|
modeModifiers: {},
|
|
@@ -1514,6 +1649,7 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
1514
1649
|
"version",
|
|
1515
1650
|
"restore",
|
|
1516
1651
|
"resize",
|
|
1652
|
+
"showChat",
|
|
1517
1653
|
"selectionSend"
|
|
1518
1654
|
], [
|
|
1519
1655
|
"update:mode",
|
|
@@ -1522,7 +1658,13 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
1522
1658
|
"update:fit"
|
|
1523
1659
|
]),
|
|
1524
1660
|
setup(e, { emit: n }) {
|
|
1525
|
-
let r = e, i = n, { t: o, locale: s } = le({ useScope: "global" }), c =
|
|
1661
|
+
let r = e, i = n, { t: o, locale: s } = le({ useScope: "global" }), c = N(!1), l;
|
|
1662
|
+
z(() => r.working, (e, t) => {
|
|
1663
|
+
e ? (l = t === void 0 ? void 0 : r.version, c.value = !1) : l !== void 0 && (c.value = r.version === l, l = void 0);
|
|
1664
|
+
}, { immediate: !0 }), z(() => [r.version, r.fileId], () => {
|
|
1665
|
+
r.working || (c.value = !1);
|
|
1666
|
+
});
|
|
1667
|
+
let u = y(() => r.versions ?? []), d = y(() => r.version ? u.value.indexOf(r.version) : -1), f = y(() => d.value > 0 ? u.value[d.value - 1] : void 0), p = y(() => d.value >= 0 && d.value < u.value.length - 1 ? u.value[d.value + 1] : void 0), m = R(e, "mode"), h = R(e, "sheet"), g = R(e, "zoom"), E = R(e, "fit"), ee = y(() => [
|
|
1526
1668
|
{
|
|
1527
1669
|
value: "markup",
|
|
1528
1670
|
label: o("chatFilePreview.modeMarkup")
|
|
@@ -1535,47 +1677,48 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
1535
1677
|
value: "original",
|
|
1536
1678
|
label: o("chatFilePreview.modeOriginal")
|
|
1537
1679
|
}
|
|
1538
|
-
]),
|
|
1680
|
+
]), D = y(() => r.preview?.kind === "word" && r.preview.revisionAuthors.length > 0);
|
|
1539
1681
|
z(() => r.version, () => {
|
|
1540
|
-
|
|
1682
|
+
m.value = "markup";
|
|
1541
1683
|
});
|
|
1542
|
-
let
|
|
1543
|
-
|
|
1684
|
+
let O = ae("rootEl"), A = F(), ne = N(!1), re = () => {
|
|
1685
|
+
A.value = void 0, ne.value = !1;
|
|
1544
1686
|
};
|
|
1545
1687
|
z(() => [
|
|
1546
1688
|
r.version,
|
|
1547
1689
|
r.preview,
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
],
|
|
1551
|
-
let
|
|
1552
|
-
|
|
1553
|
-
},
|
|
1554
|
-
z(
|
|
1555
|
-
let n =
|
|
1690
|
+
m.value,
|
|
1691
|
+
h.value
|
|
1692
|
+
], re);
|
|
1693
|
+
let j = (e) => {
|
|
1694
|
+
ne.value || (A.value = e);
|
|
1695
|
+
}, ie = y(() => A.value?.format === "docx" && W());
|
|
1696
|
+
z(ne, async (e, t) => {
|
|
1697
|
+
let n = A.value;
|
|
1556
1698
|
t && !e && n?.format === "docx" && (await te(), n.restore());
|
|
1557
1699
|
});
|
|
1558
|
-
let
|
|
1559
|
-
let e =
|
|
1700
|
+
let oe = y(() => !r.version || r.version === u.value[u.value.length - 1]), se = () => {
|
|
1701
|
+
let e = u.value[u.value.length - 1];
|
|
1560
1702
|
e && i("version", e);
|
|
1561
|
-
},
|
|
1562
|
-
let e =
|
|
1563
|
-
return e?.format === "docx" ? e.paragraphCount > 200 : (e?.cells ?? 0) >
|
|
1564
|
-
}),
|
|
1565
|
-
let e =
|
|
1703
|
+
}, ce = y(() => {
|
|
1704
|
+
let e = A.value;
|
|
1705
|
+
return e?.format === "docx" ? e.paragraphCount > 200 : (e?.cells ?? 0) > ge;
|
|
1706
|
+
}), V = y(() => A.value?.format === "docx" && m.value === "original"), ue = y(() => ce.value || V.value), de = y(() => V.value ? o("selectionActions.hintOriginal") : ce.value ? o(A.value?.format === "docx" ? "selectionActions.hintParagraphs" : "selectionActions.hintCells", { count: A.value?.format === "docx" ? 200 : ge }) : void 0), U = (e) => e[s.value] ?? e[s.value.split("-")[0]] ?? Object.values(e)[0] ?? "", fe = ["explain", "summarize"], pe = y(() => {
|
|
1707
|
+
let e = A.value, t = r.selectionActions;
|
|
1566
1708
|
if (!e || !t) return [];
|
|
1567
1709
|
let n = e.format;
|
|
1568
|
-
return [...(n === "docx" &&
|
|
1710
|
+
return [...(n === "docx" && ue.value ? fe : t.builtIns).map((e) => ({
|
|
1569
1711
|
id: e,
|
|
1570
1712
|
label: o(`selectionActions.builtIn.${e}`),
|
|
1571
1713
|
...e === "translate" && { asks: o("selectionActions.translateAsks") },
|
|
1572
1714
|
prompt: (t) => o(`selectionActions.prompt.${n}.${e}`, { language: t ?? "" })
|
|
1573
|
-
})), ...(
|
|
1715
|
+
})), ...(ue.value ? [] : t.actions).map((e) => ({
|
|
1574
1716
|
id: e.id,
|
|
1575
|
-
label:
|
|
1576
|
-
|
|
1717
|
+
label: U(e.label),
|
|
1718
|
+
icon: e.icon,
|
|
1719
|
+
prompt: () => U(e.prompt)
|
|
1577
1720
|
}))];
|
|
1578
|
-
}),
|
|
1721
|
+
}), me = (e) => {
|
|
1579
1722
|
if (e.format === "docx") return o("selectionActions.labelParagraphs", {
|
|
1580
1723
|
file: r.filename,
|
|
1581
1724
|
count: e.paragraphCount
|
|
@@ -1591,20 +1734,20 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
1591
1734
|
sheet: e.sheet,
|
|
1592
1735
|
cell: t
|
|
1593
1736
|
});
|
|
1594
|
-
},
|
|
1737
|
+
}, he = (e) => {
|
|
1595
1738
|
if (!r.fileId || !r.storedFileName) return;
|
|
1596
1739
|
let t = {
|
|
1597
1740
|
fileId: r.fileId,
|
|
1598
1741
|
version: r.version ?? 1,
|
|
1599
1742
|
storedFileName: r.storedFileName,
|
|
1600
|
-
label:
|
|
1743
|
+
label: me(e).slice(0, 200)
|
|
1601
1744
|
};
|
|
1602
1745
|
if (e.format === "docx") {
|
|
1603
1746
|
let { measure: n, ...r } = e;
|
|
1604
1747
|
return {
|
|
1605
1748
|
...t,
|
|
1606
1749
|
...r,
|
|
1607
|
-
...
|
|
1750
|
+
...V.value && { original: !0 }
|
|
1608
1751
|
};
|
|
1609
1752
|
}
|
|
1610
1753
|
let { measure: n, cells: i, ...a } = e;
|
|
@@ -1612,23 +1755,23 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
1612
1755
|
...t,
|
|
1613
1756
|
...a
|
|
1614
1757
|
};
|
|
1615
|
-
},
|
|
1616
|
-
let n =
|
|
1758
|
+
}, G = (e, t) => {
|
|
1759
|
+
let n = A.value, r = n && he(n);
|
|
1617
1760
|
r && (i("selectionSend", e, r, {
|
|
1618
1761
|
id: t,
|
|
1619
1762
|
size: n.format === "docx" ? n.paragraphCount : n.cells
|
|
1620
|
-
}),
|
|
1621
|
-
},
|
|
1622
|
-
let n =
|
|
1623
|
-
n &&
|
|
1624
|
-
},
|
|
1625
|
-
H(
|
|
1763
|
+
}), re(), document.getSelection()?.removeAllRanges());
|
|
1764
|
+
}, _e = (e, t) => {
|
|
1765
|
+
let n = pe.value.find((t) => t.id === e);
|
|
1766
|
+
n && G(n.prompt(t), e);
|
|
1767
|
+
}, K = N(0);
|
|
1768
|
+
H(O, "scroll", () => K.value++, {
|
|
1626
1769
|
capture: !0,
|
|
1627
1770
|
passive: !0
|
|
1628
|
-
}), H(window, "resize", () =>
|
|
1629
|
-
let
|
|
1630
|
-
|
|
1631
|
-
let e =
|
|
1771
|
+
}), H(window, "resize", () => K.value++, { passive: !0 });
|
|
1772
|
+
let q = y(() => {
|
|
1773
|
+
K.value;
|
|
1774
|
+
let e = A.value?.measure(), t = O.value?.getBoundingClientRect();
|
|
1632
1775
|
if (e && t) return {
|
|
1633
1776
|
start: {
|
|
1634
1777
|
top: e.start.top - t.top,
|
|
@@ -1644,69 +1787,78 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
1644
1787
|
};
|
|
1645
1788
|
});
|
|
1646
1789
|
return (n, r) => {
|
|
1647
|
-
let s =
|
|
1648
|
-
return M(),
|
|
1790
|
+
let s = _, l = a;
|
|
1791
|
+
return M(), S("section", {
|
|
1649
1792
|
ref_key: "rootEl",
|
|
1650
|
-
ref:
|
|
1793
|
+
ref: O,
|
|
1651
1794
|
class: "pk-file-preview",
|
|
1652
1795
|
"aria-label": e.filename,
|
|
1653
1796
|
tabindex: "-1",
|
|
1654
1797
|
autofocus: ""
|
|
1655
1798
|
}, [
|
|
1656
|
-
|
|
1657
|
-
|
|
1799
|
+
C("header", Kt, [
|
|
1800
|
+
C("div", qt, [C("span", Jt, [T(s, {
|
|
1658
1801
|
name: e.kind === "word" ? "ri:file-word-2-line" : "ri:file-excel-2-line",
|
|
1659
1802
|
class: k(e.kind === "word" ? "pk-file-preview__icon--word" : "pk-file-preview__icon--sheet")
|
|
1660
|
-
}, null, 8, ["name", "class"])]),
|
|
1661
|
-
|
|
1803
|
+
}, null, 8, ["name", "class"])]), C("div", Yt, [C("strong", Xt, I(e.filename), 1), C("span", Zt, [e.working ? (M(), S(v, { key: 0 }, [r[14] ||= C("span", {
|
|
1804
|
+
class: "pk-file-preview__spinner",
|
|
1805
|
+
"aria-hidden": "true"
|
|
1806
|
+
}, null, -1), w(" " + I(L(o)("chatFilePreview.working")), 1)], 64)) : c.value ? (M(), S(v, { key: 1 }, [w(I(L(o)("chatFilePreview.answeredInChat")) + " ", 1), T(l, {
|
|
1807
|
+
modifiers: "link",
|
|
1808
|
+
class: "pk-file-preview__show-chat",
|
|
1809
|
+
label: L(o)("chatFilePreview.showChat"),
|
|
1810
|
+
onClick: r[0] ||= (e) => i("showChat")
|
|
1811
|
+
}, null, 8, ["label"])], 64)) : (M(), S(v, { key: 2 }, [w(I(L(o)("chatFilePreview.readOnly")), 1)], 64))])])]),
|
|
1812
|
+
e.working ? (M(), S("div", Qt)) : x("", !0),
|
|
1813
|
+
e.version && u.value.length > 1 || D.value ? (M(), S("div", $t, [e.version && u.value.length > 1 ? (M(), S("nav", {
|
|
1662
1814
|
key: 0,
|
|
1663
1815
|
class: "pk-file-preview__versions",
|
|
1664
1816
|
"aria-label": L(o)("chatFilePreview.versions")
|
|
1665
1817
|
}, [
|
|
1666
|
-
|
|
1818
|
+
T(l, {
|
|
1667
1819
|
modifiers: "action-quiet",
|
|
1668
1820
|
icon: "ri:arrow-left-s-line",
|
|
1669
1821
|
"aria-label": L(o)("chatFilePreview.previousVersion"),
|
|
1670
|
-
disabled: !
|
|
1671
|
-
onClick: r[
|
|
1822
|
+
disabled: !f.value,
|
|
1823
|
+
onClick: r[1] ||= (e) => f.value && i("version", f.value)
|
|
1672
1824
|
}, null, 8, ["aria-label", "disabled"]),
|
|
1673
|
-
|
|
1825
|
+
C("span", tn, I(L(o)("chatFilePreview.versionOf", {
|
|
1674
1826
|
version: e.version,
|
|
1675
|
-
count:
|
|
1827
|
+
count: u.value.length
|
|
1676
1828
|
})), 1),
|
|
1677
|
-
|
|
1829
|
+
T(l, {
|
|
1678
1830
|
modifiers: "action-quiet",
|
|
1679
1831
|
icon: "ri:arrow-right-s-line",
|
|
1680
1832
|
"aria-label": L(o)("chatFilePreview.nextVersion"),
|
|
1681
|
-
disabled: !
|
|
1682
|
-
onClick: r[
|
|
1833
|
+
disabled: !p.value,
|
|
1834
|
+
onClick: r[2] ||= (e) => p.value && i("version", p.value)
|
|
1683
1835
|
}, null, 8, ["aria-label", "disabled"])
|
|
1684
|
-
], 8,
|
|
1836
|
+
], 8, en)) : x("", !0), D.value ? (M(), b(t, {
|
|
1685
1837
|
key: 1,
|
|
1686
|
-
modelValue:
|
|
1687
|
-
"onUpdate:modelValue": r[
|
|
1838
|
+
modelValue: m.value,
|
|
1839
|
+
"onUpdate:modelValue": r[3] ||= (e) => m.value = e,
|
|
1688
1840
|
name: "revisions",
|
|
1689
1841
|
segmented: "",
|
|
1690
1842
|
class: "pk-file-preview__modes u-segmented-fit mb-0",
|
|
1691
1843
|
"aria-label": L(o)("chatFilePreview.modes"),
|
|
1692
1844
|
options: ee.value
|
|
1693
1845
|
}, {
|
|
1694
|
-
markup: B(() => [
|
|
1846
|
+
markup: B(() => [C("span", nn, I(L(o)("chatFilePreview.modeMarkup")), 1), C("span", rn, I(L(o)("chatFilePreview.modeMarkupShort")), 1)]),
|
|
1695
1847
|
_: 1
|
|
1696
1848
|
}, 8, [
|
|
1697
1849
|
"modelValue",
|
|
1698
1850
|
"aria-label",
|
|
1699
1851
|
"options"
|
|
1700
|
-
])) :
|
|
1701
|
-
|
|
1702
|
-
e.restorable ? (M(),
|
|
1852
|
+
])) : x("", !0)])) : x("", !0),
|
|
1853
|
+
C("div", an, [
|
|
1854
|
+
e.restorable ? (M(), b(l, {
|
|
1703
1855
|
key: 0,
|
|
1704
1856
|
modifiers: "action-quiet",
|
|
1705
1857
|
icon: "ri:arrow-go-back-line",
|
|
1706
1858
|
label: L(o)("chatFilePreview.restore"),
|
|
1707
|
-
onClick: r[
|
|
1708
|
-
}, null, 8, ["label"])) :
|
|
1709
|
-
|
|
1859
|
+
onClick: r[4] ||= (e) => i("restore")
|
|
1860
|
+
}, null, 8, ["label"])) : x("", !0),
|
|
1861
|
+
T(l, {
|
|
1710
1862
|
href: e.downloadUrl,
|
|
1711
1863
|
download: "",
|
|
1712
1864
|
modifiers: "action-quiet",
|
|
@@ -1718,79 +1870,79 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
1718
1870
|
"title",
|
|
1719
1871
|
"aria-label"
|
|
1720
1872
|
]),
|
|
1721
|
-
e.resize === "expand" ? (M(),
|
|
1873
|
+
e.resize === "expand" ? (M(), b(l, {
|
|
1722
1874
|
key: 1,
|
|
1723
1875
|
modifiers: "action-quiet",
|
|
1724
1876
|
icon: "ri:fullscreen-line",
|
|
1725
1877
|
title: L(o)("chatFilePreview.expand"),
|
|
1726
1878
|
"aria-label": L(o)("chatFilePreview.expand"),
|
|
1727
|
-
onClick: r[
|
|
1728
|
-
}, null, 8, ["title", "aria-label"])) : e.resize === "shrink" ? (M(),
|
|
1879
|
+
onClick: r[5] ||= (e) => i("resize")
|
|
1880
|
+
}, null, 8, ["title", "aria-label"])) : e.resize === "shrink" ? (M(), b(l, {
|
|
1729
1881
|
key: 2,
|
|
1730
1882
|
modifiers: "action-quiet",
|
|
1731
1883
|
icon: "ri:fullscreen-exit-line",
|
|
1732
1884
|
title: L(o)("chatFilePreview.shrink"),
|
|
1733
1885
|
"aria-label": L(o)("chatFilePreview.shrink"),
|
|
1734
|
-
onClick: r[
|
|
1735
|
-
}, null, 8, ["title", "aria-label"])) :
|
|
1736
|
-
|
|
1886
|
+
onClick: r[6] ||= (e) => i("resize")
|
|
1887
|
+
}, null, 8, ["title", "aria-label"])) : x("", !0),
|
|
1888
|
+
T(l, {
|
|
1737
1889
|
modifiers: "action-quiet",
|
|
1738
1890
|
icon: "ri:close-line",
|
|
1739
1891
|
title: L(o)("chatFilePreview.close"),
|
|
1740
1892
|
"aria-label": L(o)("chatFilePreview.close"),
|
|
1741
|
-
onClick: r[
|
|
1893
|
+
onClick: r[7] ||= (e) => i("close")
|
|
1742
1894
|
}, null, 8, ["title", "aria-label"])
|
|
1743
1895
|
])
|
|
1744
1896
|
]),
|
|
1745
|
-
|
|
1897
|
+
C("div", on, [e.loading ? (M(), S("div", sn, [(M(), S(v, null, P(8, (e) => C("div", {
|
|
1746
1898
|
key: e,
|
|
1747
1899
|
class: k(["vv-skeleton__item pk-file-preview__skeleton-line", e % 3 ? "w-full" : "w-128"])
|
|
1748
|
-
}, null, 2)), 64))])) : e.error || !e.preview ? (M(),
|
|
1900
|
+
}, null, 2)), 64))])) : e.error || !e.preview ? (M(), S("p", cn, I(L(o)("chatFilePreview.unavailable")), 1)) : e.preview.kind === "word" ? (M(), b(Wt, {
|
|
1749
1901
|
key: 2,
|
|
1750
|
-
zoom:
|
|
1751
|
-
"onUpdate:zoom": r[
|
|
1752
|
-
fit:
|
|
1753
|
-
"onUpdate:fit": r[
|
|
1902
|
+
zoom: g.value,
|
|
1903
|
+
"onUpdate:zoom": r[8] ||= (e) => g.value = e,
|
|
1904
|
+
fit: E.value,
|
|
1905
|
+
"onUpdate:fit": r[9] ||= (e) => E.value = e,
|
|
1754
1906
|
preview: e.preview,
|
|
1755
|
-
mode:
|
|
1907
|
+
mode: D.value ? m.value : "markup",
|
|
1756
1908
|
marked: e.changes?.kind === "word" ? e.changes.paragraphs : void 0,
|
|
1757
|
-
onSelect:
|
|
1909
|
+
onSelect: j
|
|
1758
1910
|
}, null, 8, [
|
|
1759
1911
|
"zoom",
|
|
1760
1912
|
"fit",
|
|
1761
1913
|
"preview",
|
|
1762
1914
|
"mode",
|
|
1763
1915
|
"marked"
|
|
1764
|
-
])) : (M(),
|
|
1916
|
+
])) : (M(), b(rt, {
|
|
1765
1917
|
key: 3,
|
|
1766
|
-
sheet:
|
|
1767
|
-
"onUpdate:sheet": r[
|
|
1768
|
-
zoom:
|
|
1769
|
-
"onUpdate:zoom": r[
|
|
1918
|
+
sheet: h.value,
|
|
1919
|
+
"onUpdate:sheet": r[10] ||= (e) => h.value = e,
|
|
1920
|
+
zoom: g.value,
|
|
1921
|
+
"onUpdate:zoom": r[11] ||= (e) => g.value = e,
|
|
1770
1922
|
preview: e.preview,
|
|
1771
1923
|
marked: e.changes?.kind === "spreadsheet" ? e.changes.cells : void 0,
|
|
1772
|
-
onSelect:
|
|
1924
|
+
onSelect: j
|
|
1773
1925
|
}, null, 8, [
|
|
1774
1926
|
"sheet",
|
|
1775
1927
|
"zoom",
|
|
1776
1928
|
"preview",
|
|
1777
1929
|
"marked"
|
|
1778
1930
|
]))]),
|
|
1779
|
-
e.selectionActions &&
|
|
1931
|
+
e.selectionActions && A.value && q.value ? (M(), b(Me, {
|
|
1780
1932
|
key: 0,
|
|
1781
|
-
asking:
|
|
1782
|
-
"onUpdate:asking": r[
|
|
1933
|
+
asking: ne.value,
|
|
1934
|
+
"onUpdate:asking": r[12] ||= (e) => ne.value = e,
|
|
1783
1935
|
strategy: "absolute",
|
|
1784
|
-
anchor:
|
|
1785
|
-
actions:
|
|
1786
|
-
hint:
|
|
1787
|
-
touch:
|
|
1788
|
-
note:
|
|
1936
|
+
anchor: q.value,
|
|
1937
|
+
actions: pe.value,
|
|
1938
|
+
hint: de.value,
|
|
1939
|
+
touch: ie.value,
|
|
1940
|
+
note: oe.value ? void 0 : L(o)("selectionActions.notLatest", { version: e.version }),
|
|
1789
1941
|
"note-action": L(o)("selectionActions.openLatest"),
|
|
1790
|
-
onAction:
|
|
1791
|
-
onAsk: r[
|
|
1792
|
-
onNote:
|
|
1793
|
-
onClose:
|
|
1942
|
+
onAction: _e,
|
|
1943
|
+
onAsk: r[13] ||= (e) => G(e, "ask"),
|
|
1944
|
+
onNote: se,
|
|
1945
|
+
onClose: re
|
|
1794
1946
|
}, null, 8, [
|
|
1795
1947
|
"asking",
|
|
1796
1948
|
"anchor",
|
|
@@ -1799,11 +1951,11 @@ var he = 2e3, G = 1e3, K = 60, ge = 1400, _e = 20, q = 100, ve = (e) => Number(e
|
|
|
1799
1951
|
"touch",
|
|
1800
1952
|
"note",
|
|
1801
1953
|
"note-action"
|
|
1802
|
-
])) :
|
|
1803
|
-
], 8,
|
|
1954
|
+
])) : x("", !0)
|
|
1955
|
+
], 8, Gt);
|
|
1804
1956
|
};
|
|
1805
1957
|
}
|
|
1806
|
-
}),
|
|
1807
|
-
export {
|
|
1958
|
+
}), un = /* @__PURE__ */ e({ default: () => dn }), dn = ln;
|
|
1959
|
+
export { G as i, un as n, he as r, dn as t };
|
|
1808
1960
|
|
|
1809
|
-
//# sourceMappingURL=PkFilePreview-
|
|
1961
|
+
//# sourceMappingURL=PkFilePreview-k5gEl3n8.js.map
|