@8wave/ai-elements 0.125.0-beta.26 → 0.125.0-beta.28
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/{PkChatbotFilePreview-CFGqa-tX.js → PkChatbotFilePreview-CqxtVySb.js} +100 -59
- package/dist/_chunks/PkChatbotFilePreview-CqxtVySb.js.map +1 -0
- package/dist/_chunks/{PkFilePreview-BPsD2P7s.js → PkFilePreview-DiLMoL-6.js} +32 -32
- package/dist/_chunks/{PkFilePreview-BPsD2P7s.js.map → PkFilePreview-DiLMoL-6.js.map} +1 -1
- package/dist/_chunks/{PkFilePreviewDialog-BW-Rubk2.js → PkFilePreviewDialog-CHBtxpoB.js} +2 -2
- package/dist/_chunks/{PkFilePreviewDialog-BW-Rubk2.js.map → PkFilePreviewDialog-CHBtxpoB.js.map} +1 -1
- package/dist/_chunks/PkImageEditorDialog-Cq8y_PtC.js +555 -0
- package/dist/_chunks/PkImageEditorDialog-Cq8y_PtC.js.map +1 -0
- package/dist/_chunks/{PkSelectionActions-DkETXtSL.js → PkSelectionActions-DFyvcEyl.js} +2 -2
- package/dist/_chunks/{PkSelectionActions-DkETXtSL.js.map → PkSelectionActions-DFyvcEyl.js.map} +1 -1
- package/dist/_chunks/{PkStreamingMarkdown-CqLpNWQv.js → PkStreamingMarkdown-0hE_Cx4W.js} +2 -2
- package/dist/_chunks/{PkStreamingMarkdown-CqLpNWQv.js.map → PkStreamingMarkdown-0hE_Cx4W.js.map} +1 -1
- package/dist/_chunks/{PkToolChatFile-iE4ZokYD.js → PkToolChatFile-DtQ9xY4w.js} +3 -3
- package/dist/_chunks/{PkToolChatFile-iE4ZokYD.js.map → PkToolChatFile-DtQ9xY4w.js.map} +1 -1
- package/dist/_chunks/{PkToolShareDocument-lTHNZodf.js → PkToolShareDocument-BvHklbzb.js} +2 -2
- package/dist/_chunks/{PkToolShareDocument-lTHNZodf.js.map → PkToolShareDocument-BvHklbzb.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-BNQrM5fY.js → PkToolShowArtifact-BdkKU6P1.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-BNQrM5fY.js.map → PkToolShowArtifact-BdkKU6P1.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-CvQoLumn.js → PkToolShowContactForm-BmM2MbOK.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-CvQoLumn.js.map → PkToolShowContactForm-BmM2MbOK.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-DcPccCEU.js → PkToolShowForm-CoFlgA-I.js} +3 -3
- package/dist/_chunks/{PkToolShowForm-DcPccCEU.js.map → PkToolShowForm-CoFlgA-I.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-B3VpJBVE.js → PkToolShowSources-DDBlLBt6.js} +2 -2
- package/dist/_chunks/{PkToolShowSources-B3VpJBVE.js.map → PkToolShowSources-DDBlLBt6.js.map} +1 -1
- package/dist/_chunks/{utils-BZuri2jT.js → utils-ChmRkK0t.js} +12 -5
- package/dist/_chunks/utils-ChmRkK0t.js.map +1 -0
- package/dist/ai-elements.es.js +3197 -3115
- 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/PkChatbotFilePreview.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/{PkChatbot-DyzEuNED.js → PkChatbot-BjJzskl7.js} +8 -8
- package/dist-vue/_chunks/{PkChatbot-DyzEuNED.js.map → PkChatbot-BjJzskl7.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotEmptyState-COya3H3C.js → PkChatbotEmptyState-CZC2gP3I.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-COya3H3C.js.map → PkChatbotEmptyState-CZC2gP3I.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotFilePreview-BsvT6orx.js → PkChatbotFilePreview-j_8sDZUE.js} +112 -71
- package/dist-vue/_chunks/PkChatbotFilePreview-j_8sDZUE.js.map +1 -0
- package/dist-vue/_chunks/PkChatbotInput-BmTdIJZ9.js +509 -0
- package/dist-vue/_chunks/PkChatbotInput-BmTdIJZ9.js.map +1 -0
- package/dist-vue/_chunks/PkChatbotMessages-b2lupEv9.js +1049 -0
- package/dist-vue/_chunks/{PkChatbotMessages-BISaZu4z.js.map → PkChatbotMessages-b2lupEv9.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepPayload-cuYclK_2.js → PkChatbotStepPayload-D4w1XlF2.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-cuYclK_2.js.map → PkChatbotStepPayload-D4w1XlF2.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-Yd8cUQJP.js → PkChatbotStepToolDetail-DFTcjzoX.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-Yd8cUQJP.js.map → PkChatbotStepToolDetail-DFTcjzoX.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotSteps-_Aqft0em.js → PkChatbotSteps-D3zLulMo.js} +5 -5
- package/dist-vue/_chunks/{PkChatbotSteps-_Aqft0em.js.map → PkChatbotSteps-D3zLulMo.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-CIfotKyM.js → PkChatbotViewChat-DawyiUjq.js} +323 -345
- package/dist-vue/_chunks/PkChatbotViewChat-DawyiUjq.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewConversations-DjhiHp8-.js → PkChatbotViewConversations-Bs246dtL.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewConversations-DjhiHp8-.js.map → PkChatbotViewConversations-Bs246dtL.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-C4oGN4Xj.js → PkChatbotViewFiles-uzZ5H4Fd.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewFiles-C4oGN4Xj.js.map → PkChatbotViewFiles-uzZ5H4Fd.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-NfTamy9j.js → PkChatbotViewProfile-BhIvfT_n.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-NfTamy9j.js.map → PkChatbotViewProfile-BhIvfT_n.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreview-DEKgCMkr.js → PkFilePreview-DfD48QQ_.js} +48 -48
- package/dist-vue/_chunks/{PkFilePreview-DEKgCMkr.js.map → PkFilePreview-DfD48QQ_.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreviewDialog-0qrzDWID.js → PkFilePreviewDialog-DFCBpQf3.js} +2 -2
- package/dist-vue/_chunks/{PkFilePreviewDialog-0qrzDWID.js.map → PkFilePreviewDialog-DFCBpQf3.js.map} +1 -1
- package/dist-vue/_chunks/PkImageEditorDialog-BLUyILVi.js +550 -0
- package/dist-vue/_chunks/PkImageEditorDialog-BLUyILVi.js.map +1 -0
- package/dist-vue/_chunks/{PkStreamingMarkdown-2FN4WMQD.js → PkStreamingMarkdown-ChMbSviw.js} +2 -2
- package/dist-vue/_chunks/{PkStreamingMarkdown-2FN4WMQD.js.map → PkStreamingMarkdown-ChMbSviw.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolChatFile-DAT1tv52.js → PkToolChatFile-DQtABEaI.js} +3 -3
- package/dist-vue/_chunks/{PkToolChatFile-DAT1tv52.js.map → PkToolChatFile-DQtABEaI.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShareDocument-Qb2Lu5vh.js → PkToolShareDocument-cMUqik6v.js} +2 -2
- package/dist-vue/_chunks/{PkToolShareDocument-Qb2Lu5vh.js.map → PkToolShareDocument-cMUqik6v.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-Bskomw05.js → PkToolShowArtifact-w6SxjLPW.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-Bskomw05.js.map → PkToolShowArtifact-w6SxjLPW.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-iQrlqv7j.js → PkToolShowContactForm-BQ7bBTQU.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-iQrlqv7j.js.map → PkToolShowContactForm-BQ7bBTQU.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-C-43uUoh.js → PkToolShowDiagram-D-yQgdOL.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-C-43uUoh.js.map → PkToolShowDiagram-D-yQgdOL.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-CKXpqQxy.js → PkToolShowForm-CF00JLpa.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowForm-CKXpqQxy.js.map → PkToolShowForm-CF00JLpa.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-DLTn6JmU.js → PkToolShowImageGallery-ZJMWOWHq.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowImageGallery-DLTn6JmU.js.map → PkToolShowImageGallery-ZJMWOWHq.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-hhSBAQVC.js → PkToolShowProductList-CeKI9H36.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-hhSBAQVC.js.map → PkToolShowProductList-CeKI9H36.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-BMo_i8sv.js → PkToolShowSources-CXZqanmw.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSources-BMo_i8sv.js.map → PkToolShowSources-CXZqanmw.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-DJhsbDuX.js → PkToolShowVideo-BCs-i6xQ.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowVideo-DJhsbDuX.js.map → PkToolShowVideo-BCs-i6xQ.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-BAv66f5H.js → PkToolShowWebPages-Bixa0CjQ.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-BAv66f5H.js.map → PkToolShowWebPages-Bixa0CjQ.js.map} +1 -1
- package/dist-vue/_chunks/{useChatbotStore-BZ1n3Hyx.js → useChatbotStore-BIjCGX0B.js} +858 -835
- package/dist-vue/_chunks/useChatbotStore-BIjCGX0B.js.map +1 -0
- package/dist-vue/_chunks/{utils-RwaXl9-x.js → utils-CaYEz-0A.js} +11 -4
- package/dist-vue/_chunks/utils-CaYEz-0A.js.map +1 -0
- package/dist-vue/composables.js +56 -4
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +49 -49
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +56 -0
- package/dist-vue/packages/components/src/chat/PkChatbotFilePreview.d.ts +14 -0
- package/dist-vue/packages/components/src/chat/PkChatbotInput.d.ts +17 -3
- package/dist-vue/packages/components/src/chat/PkImageEditor.d.ts +37 -0
- package/dist-vue/packages/components/src/chat/PkImageEditorDialog.d.ts +19 -0
- package/dist-vue/packages/components/src/chat/imageEdits.d.ts +106 -0
- package/dist-vue/packages/components/src/chat/utils.d.ts +7 -0
- package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +7 -1
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/PkChatbotFilePreview-CFGqa-tX.js.map +0 -1
- package/dist/_chunks/utils-BZuri2jT.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotFilePreview-BsvT6orx.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotInput-D0KUEkAs.js +0 -478
- package/dist-vue/_chunks/PkChatbotInput-D0KUEkAs.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotMessages-BISaZu4z.js +0 -1049
- package/dist-vue/_chunks/PkChatbotViewChat-CIfotKyM.js.map +0 -1
- package/dist-vue/_chunks/useChatbotStore-BZ1n3Hyx.js.map +0 -1
- package/dist-vue/_chunks/utils-RwaXl9-x.js.map +0 -1
|
@@ -2,8 +2,8 @@ import { t as e } from "./rolldown-runtime-CGnMp29N.js";
|
|
|
2
2
|
import { t } from "./PkEditorRadioButtons-Bw576DPQ.js";
|
|
3
3
|
import { i as n, n as r, r as i } from "./excelNumberFormat-C1sCQrOz.js";
|
|
4
4
|
import { t as a } from "./VvButtonLocalized-C-vx25u4.js";
|
|
5
|
-
import { G as o, H as s, J as c, K as l,
|
|
6
|
-
import { r as ee } from "./PkChatbotViewChat-
|
|
5
|
+
import { G as o, H as s, J as c, K as l, U as u, W as d, Y as f, o as p, q as m, z as h } from "./utils-CaYEz-0A.js";
|
|
6
|
+
import { r as ee } from "./PkChatbotViewChat-DawyiUjq.js";
|
|
7
7
|
import { VvIcon as g } from "@volverjs/ui-vue/components";
|
|
8
8
|
import { Fragment as _, computed as v, createBlock as y, createCommentVNode as b, createElementBlock as x, createElementVNode as S, createTextVNode as C, createVNode as w, defineComponent as T, inject as E, isMemoSame as D, mergeModels as O, nextTick as te, normalizeClass as k, normalizeStyle as A, onBeforeUnmount as j, onMounted as ne, onScopeDispose as M, openBlock as N, provide as re, ref as P, renderList as F, shallowRef as I, toDisplayString as L, unref as R, useModel as z, useTemplateRef as ie, vModelText as B, watch as V, withCtx as H, withDirectives as ae, withKeys as U, withModifiers as oe } from "vue";
|
|
9
9
|
import { useI18n as se } from "vue-i18n";
|
|
@@ -184,41 +184,41 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
184
184
|
proofread: "ri:check-double-line",
|
|
185
185
|
translate: "ri:translate-2",
|
|
186
186
|
chart: "ri:bar-chart-2-line"
|
|
187
|
-
}, r = e, i = t, a = z(e, "asking"), { t: o } = se({ useScope: "global" }), s = ie("barEl"), c = ie("inputEl"), { width: l, height:
|
|
187
|
+
}, r = e, i = t, a = z(e, "asking"), { t: o } = se({ useScope: "global" }), s = ie("barEl"), c = ie("inputEl"), { width: l, height: u } = ce(s, void 0, { box: "border-box" }), d = v(() => h({
|
|
188
188
|
...r.anchor,
|
|
189
189
|
bar: {
|
|
190
190
|
width: l.value,
|
|
191
|
-
height:
|
|
191
|
+
height: u.value
|
|
192
192
|
},
|
|
193
193
|
touch: r.touch
|
|
194
|
-
})),
|
|
195
|
-
|
|
194
|
+
})), f = P(), p = P(""), m = async (e, t) => {
|
|
195
|
+
f.value = {
|
|
196
196
|
id: e,
|
|
197
197
|
placeholder: t
|
|
198
|
-
},
|
|
198
|
+
}, p.value = "", a.value = !0, await te(), c.value?.focus();
|
|
199
199
|
}, ee = () => {
|
|
200
|
-
|
|
200
|
+
f.value = void 0, a.value = !1;
|
|
201
201
|
}, y = (e) => n[e.id] ?? Q, T = (e) => {
|
|
202
|
-
e.asks ?
|
|
202
|
+
e.asks ? m(e.id, e.asks) : i("action", e.id);
|
|
203
203
|
}, E = () => {
|
|
204
|
-
let e =
|
|
205
|
-
e &&
|
|
204
|
+
let e = p.value.trim();
|
|
205
|
+
e && f.value && (f.value.id ? i("action", f.value.id, e) : i("ask", e), ee());
|
|
206
206
|
}, D = () => {
|
|
207
|
-
|
|
207
|
+
f.value ? ee() : i("close");
|
|
208
208
|
};
|
|
209
209
|
return (t, n) => {
|
|
210
210
|
let r = g;
|
|
211
211
|
return N(), x("div", {
|
|
212
212
|
class: k(["pk-selection-actions", {
|
|
213
213
|
"pk-selection-actions--fixed": e.strategy === "fixed",
|
|
214
|
-
"pk-selection-actions--asking": !!
|
|
214
|
+
"pk-selection-actions--asking": !!f.value
|
|
215
215
|
}]),
|
|
216
216
|
style: A({
|
|
217
|
-
top: `${
|
|
218
|
-
left: `${
|
|
217
|
+
top: `${d.value.top}px`,
|
|
218
|
+
left: `${d.value.left}px`
|
|
219
219
|
}),
|
|
220
220
|
onKeydown: U(oe(D, ["stop"]), ["esc"])
|
|
221
|
-
}, [
|
|
221
|
+
}, [f.value ? (N(), x("form", {
|
|
222
222
|
key: 0,
|
|
223
223
|
ref_key: "barEl",
|
|
224
224
|
ref: s,
|
|
@@ -227,16 +227,16 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
227
227
|
}, [ae(S("input", {
|
|
228
228
|
ref_key: "inputEl",
|
|
229
229
|
ref: c,
|
|
230
|
-
"onUpdate:modelValue": n[0] ||= (e) =>
|
|
230
|
+
"onUpdate:modelValue": n[0] ||= (e) => p.value = e,
|
|
231
231
|
class: "pk-selection-actions__input",
|
|
232
232
|
type: "text",
|
|
233
233
|
maxlength: "500",
|
|
234
|
-
placeholder:
|
|
235
|
-
"aria-label":
|
|
236
|
-
}, null, 8, Ce), [[B,
|
|
234
|
+
placeholder: f.value.placeholder,
|
|
235
|
+
"aria-label": f.value.placeholder
|
|
236
|
+
}, null, 8, Ce), [[B, p.value]]), S("button", {
|
|
237
237
|
type: "submit",
|
|
238
238
|
class: "pk-selection-actions__button pk-selection-actions__button--send",
|
|
239
|
-
disabled: !
|
|
239
|
+
disabled: !p.value.trim()
|
|
240
240
|
}, L(R(o)("action.send")), 9, we)], 544)) : (N(), x("div", {
|
|
241
241
|
key: 1,
|
|
242
242
|
ref_key: "barEl",
|
|
@@ -271,7 +271,7 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
271
271
|
type: "button",
|
|
272
272
|
class: "pk-selection-actions__button",
|
|
273
273
|
onMousedown: n[4] ||= oe(() => {}, ["prevent"]),
|
|
274
|
-
onClick: n[5] ||= (e) =>
|
|
274
|
+
onClick: n[5] ||= (e) => m(void 0, R(o)("selectionActions.askPlaceholder"))
|
|
275
275
|
}, [w(r, {
|
|
276
276
|
name: "ri:chat-1-line",
|
|
277
277
|
class: "pk-selection-actions__icon"
|
|
@@ -733,13 +733,13 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
733
733
|
numbers: {}
|
|
734
734
|
},
|
|
735
735
|
setup(e) {
|
|
736
|
-
let t = e, { t: n } = se({ useScope: "global" }), r = E(
|
|
736
|
+
let t = e, { t: n } = se({ useScope: "global" }), r = E(p, void 0), i = (e) => e.picture ? f(r?.value, e.picture.ref) : void 0, a = (e) => t.page ? c(e) : "inline", o = (e) => {
|
|
737
737
|
let n = {
|
|
738
738
|
width: `${e.width}pt`,
|
|
739
739
|
aspectRatio: `${e.width} / ${e.height}`
|
|
740
740
|
}, r = e.anchor, i = t.page;
|
|
741
741
|
if (!r || !i) return n;
|
|
742
|
-
let a = r.xFrom === "page" ? r.x - i.margins.left : r.x, o =
|
|
742
|
+
let a = r.xFrom === "page" ? r.x - i.margins.left : r.x, o = c(e);
|
|
743
743
|
if (o === "around") {
|
|
744
744
|
let t = i.width - i.margins.left - i.margins.right, o = a + e.width / 2 < t / 2;
|
|
745
745
|
return {
|
|
@@ -760,43 +760,43 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
760
760
|
top: `${r.y}pt`,
|
|
761
761
|
zIndex: r.wrap === "behind" ? -1 : 1
|
|
762
762
|
};
|
|
763
|
-
},
|
|
764
|
-
let e = d(t.runs, t.mode ?? "markup"), n = (e) => !!e.picture && !!t.page && ["around", "block"].includes(
|
|
763
|
+
}, s = (e) => e.field && t.numbers ? String(t.numbers[e.field]) : e.text, l = v(() => {
|
|
764
|
+
let e = d(t.runs, t.mode ?? "markup"), n = (e) => !!e.picture && !!t.page && ["around", "block"].includes(c(e.picture));
|
|
765
765
|
return [...e.filter(n), ...e.filter((e) => !n(e))];
|
|
766
|
-
}),
|
|
766
|
+
}), m = v(() => !t.mode || t.mode === "markup"), h = (e) => {
|
|
767
767
|
let t = {};
|
|
768
|
-
e.font && (t.fontFamily =
|
|
768
|
+
e.font && (t.fontFamily = u(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");
|
|
769
769
|
let n = [e.underline ? "underline" : "", e.strike ? "line-through" : ""].filter(Boolean).join(" ");
|
|
770
770
|
return n && (t.textDecoration = n), e.caps && (t.textTransform = "uppercase"), e.vertAlign && (t.verticalAlign = e.vertAlign, t.fontSize = `${(e.size ?? 11) * .65}pt`), t;
|
|
771
771
|
}, ee = (e) => {
|
|
772
|
-
let t =
|
|
772
|
+
let t = h(e), n = new Set(String(t.textDecoration ?? "").split(" ").filter(Boolean));
|
|
773
773
|
return n.add(e.change === "deleted" ? "line-through" : "underline"), {
|
|
774
774
|
...t,
|
|
775
775
|
textDecoration: [...n].join(" ")
|
|
776
776
|
};
|
|
777
777
|
}, g = (e) => e.author ? n("chatFilePreview.revisionBy", { author: e.author }) : void 0;
|
|
778
|
-
return (e, t) => (N(!0), x(_, null, F(
|
|
778
|
+
return (e, t) => (N(!0), x(_, null, F(l.value, (e, t) => (N(), x(_, { key: t }, [e.image ? (N(), x(_, { key: 0 }, [e.picture && i(e) ? (N(), x(_, { key: 0 }, [a(e.picture) === "page" ? b("", !0) : (N(), x("img", {
|
|
779
779
|
key: 0,
|
|
780
780
|
class: k(["pk-word-preview__picture", `pk-word-preview__picture--${a(e.picture)}`]),
|
|
781
781
|
style: A(o(e.picture)),
|
|
782
782
|
src: i(e),
|
|
783
783
|
alt: ""
|
|
784
|
-
}, null, 14, Xe))], 64)) : (N(), x("span", Ze, L(R(n)("chatFilePreview.image")), 1))], 64)) :
|
|
784
|
+
}, null, 14, Xe))], 64)) : (N(), x("span", Ze, L(R(n)("chatFilePreview.image")), 1))], 64)) : m.value && e.change === "deleted" ? (N(), x("del", {
|
|
785
785
|
key: 1,
|
|
786
786
|
class: "pk-word-preview__removed",
|
|
787
787
|
"data-quote-skip": "",
|
|
788
788
|
style: A(ee(e)),
|
|
789
789
|
title: g(e)
|
|
790
|
-
}, L(
|
|
790
|
+
}, L(s(e)), 13, Qe)) : m.value && e.change === "inserted" ? (N(), x("ins", {
|
|
791
791
|
key: 2,
|
|
792
792
|
class: "pk-word-preview__added",
|
|
793
793
|
style: A(ee(e)),
|
|
794
794
|
title: g(e)
|
|
795
|
-
}, L(
|
|
795
|
+
}, L(s(e)), 13, $e)) : (N(), x("span", {
|
|
796
796
|
key: 3,
|
|
797
|
-
style: A(
|
|
797
|
+
style: A(h(e)),
|
|
798
798
|
"data-quote-skip": e.label ? "" : void 0
|
|
799
|
-
}, L(
|
|
799
|
+
}, L(s(e)), 13, et))], 64))), 128));
|
|
800
800
|
}
|
|
801
801
|
}), nt = { key: 0 }, rt = ["data-paragraph", "colspan"], it = [
|
|
802
802
|
"data-paragraph",
|
|
@@ -905,11 +905,11 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
905
905
|
numbers: {}
|
|
906
906
|
},
|
|
907
907
|
setup(e) {
|
|
908
|
-
let t = e, n = E(
|
|
909
|
-
let r =
|
|
908
|
+
let t = e, n = E(p, void 0), r = v(() => s(t.blocks, t.mode)), i = v(() => m(t.blocks, t.mode).flatMap((e) => {
|
|
909
|
+
let r = f(n?.value, e.ref);
|
|
910
910
|
return r ? [{
|
|
911
911
|
src: r,
|
|
912
|
-
css:
|
|
912
|
+
css: l(e, t.section.page)
|
|
913
913
|
}] : [];
|
|
914
914
|
})), a = v(() => {
|
|
915
915
|
let { margins: e } = t.section.page;
|
|
@@ -991,18 +991,18 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
991
991
|
emits: /*@__PURE__*/ O(["select"], ["update:fit", "update:zoom"]),
|
|
992
992
|
setup(e, { emit: t }) {
|
|
993
993
|
let n = e, r = t, { t: i } = se({ useScope: "global" });
|
|
994
|
-
re(
|
|
995
|
-
let
|
|
994
|
+
re(p, v(() => n.preview.images));
|
|
995
|
+
let c = (e) => d(e, n.mode), h = v(() => s(n.preview.blocks, n.mode)), g = ie("rootEl"), C = ie("scrollEl"), T = ie("measureEl"), { width: E } = ce(g), { width: D } = ce(C), O = v(() => E.value >= 1e3), M = v(() => n.preview.sections?.length ? n.preview.sections : [{
|
|
996
996
|
page: n.preview.page,
|
|
997
997
|
headerDistance: 0,
|
|
998
998
|
footerDistance: 0,
|
|
999
999
|
headers: {},
|
|
1000
1000
|
footers: {}
|
|
1001
1001
|
}]), I = v(() => M.value[0].page), B = v(() => (D.value - 48) / (I.value.width * It)), H = v(() => E.value === 0 || D.value === 0 || B.value >= Lt), ae = v(() => ({
|
|
1002
|
-
fontFamily:
|
|
1002
|
+
fontFamily: u(n.preview.defaults.font),
|
|
1003
1003
|
fontSize: `${n.preview.defaults.size}pt`,
|
|
1004
1004
|
color: n.preview.defaults.color ?? "#000000",
|
|
1005
|
-
"--pk-word-line":
|
|
1005
|
+
"--pk-word-line": o(n.preview.defaults.font),
|
|
1006
1006
|
"--pk-word-size": `${n.preview.defaults.size}pt`
|
|
1007
1007
|
})), U = v(() => I.value.width - I.value.margins.left - I.value.margins.right), oe = v(() => ({
|
|
1008
1008
|
...ae.value,
|
|
@@ -1093,11 +1093,11 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
1093
1093
|
};
|
|
1094
1094
|
}, he = (e) => {
|
|
1095
1095
|
let t = [...new Set(e.items.map((e) => h.value[e].block))];
|
|
1096
|
-
return
|
|
1097
|
-
let r =
|
|
1096
|
+
return m(t.map((e) => n.preview.blocks[e]), n.mode).flatMap((t) => {
|
|
1097
|
+
let r = f(n.preview.images, t.ref);
|
|
1098
1098
|
return r ? [{
|
|
1099
1099
|
src: r,
|
|
1100
|
-
css:
|
|
1100
|
+
css: l(t, M.value[e.section].page)
|
|
1101
1101
|
}] : [];
|
|
1102
1102
|
});
|
|
1103
1103
|
}, ge = z(e, "fit"), _e = z(e, "zoom"), Y = v(() => ge.value ? Math.min(1.25, Math.max(.3, B.value)) : _e.value), ve = (e) => {
|
|
@@ -1131,7 +1131,7 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
1131
1131
|
let t = C.value;
|
|
1132
1132
|
r("select", e && t ? ye(t, e.range, ".pk-word-preview__measure, .pk-word-preview__part") : void 0);
|
|
1133
1133
|
});
|
|
1134
|
-
let Ee = (e) =>
|
|
1134
|
+
let Ee = (e) => c(e).map((e) => e.text).join("").replace(/\s+/g, " ").trim(), X = v(() => h.value.flatMap((e) => {
|
|
1135
1135
|
let t = n.preview.blocks[e.block], r = t.kind === "heading" ? [t.label, Ee(t.runs)].filter(Boolean).join(" ") : "";
|
|
1136
1136
|
return t.kind === "heading" && t.level <= 3 && r ? [{
|
|
1137
1137
|
key: e.key,
|
|
@@ -1370,7 +1370,7 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
1370
1370
|
])]))), 128)), (N(!0), x(_, null, F(e.preview.parts, (t, n) => (N(), x("div", {
|
|
1371
1371
|
key: n,
|
|
1372
1372
|
"data-part": n
|
|
1373
|
-
}, [(N(!0), x(_, null, F(R(
|
|
1373
|
+
}, [(N(!0), x(_, null, F(R(s)(t, e.mode), (n) => (N(), y(ot, {
|
|
1374
1374
|
key: n.key,
|
|
1375
1375
|
block: t[n.block],
|
|
1376
1376
|
row: n.row,
|
|
@@ -1722,4 +1722,4 @@ var fe = 2e3, G = 1e3, pe = 60, K = 1400, q = 20, me = 100, J = (e) => Number(e.
|
|
|
1722
1722
|
}), nn = /* @__PURE__ */ e({ default: () => rn }), rn = tn;
|
|
1723
1723
|
export { nn as n, rn as t };
|
|
1724
1724
|
|
|
1725
|
-
//# sourceMappingURL=PkFilePreview-
|
|
1725
|
+
//# sourceMappingURL=PkFilePreview-DfD48QQ_.js.map
|