@8wave/ai-elements 0.125.0-beta.37 → 0.125.0-beta.39
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-D9MWMkLp.js → Agent-CeZ3bgZ3.js} +4 -3
- package/dist/_chunks/Agent-CeZ3bgZ3.js.map +1 -0
- package/dist/_chunks/PkChart-CbtMRGWc.js +7411 -0
- package/dist/_chunks/PkChart-CbtMRGWc.js.map +1 -0
- package/dist/_chunks/{PkFilePreview-BdqdC1ml.js → PkFilePreview-CT3_vRcU.js} +3 -3
- package/dist/_chunks/{PkFilePreview-BdqdC1ml.js.map → PkFilePreview-CT3_vRcU.js.map} +1 -1
- package/dist/_chunks/{PkFilePreviewDialog-_pdW07pm.js → PkFilePreviewDialog-BOKJCapN.js} +2 -2
- package/dist/_chunks/{PkFilePreviewDialog-_pdW07pm.js.map → PkFilePreviewDialog-BOKJCapN.js.map} +1 -1
- package/dist/_chunks/{PkSelectionActions-CjAiM1G3.js → PkSelectionActions-CXQTnSXQ.js} +2 -2
- package/dist/_chunks/{PkSelectionActions-CjAiM1G3.js.map → PkSelectionActions-CXQTnSXQ.js.map} +1 -1
- package/dist/_chunks/{PkStreamingMarkdown-DKTxy47I.js → PkStreamingMarkdown-5fgxYt_s.js} +3 -3
- package/dist/_chunks/{PkStreamingMarkdown-DKTxy47I.js.map → PkStreamingMarkdown-5fgxYt_s.js.map} +1 -1
- package/dist/_chunks/{PkToolChatFile-39PrHVVm.js → PkToolChatFile-Cbmu6I0S.js} +3 -3
- package/dist/_chunks/{PkToolChatFile-39PrHVVm.js.map → PkToolChatFile-Cbmu6I0S.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestGeolocation-CMSIJu4c.js → PkToolRequestGeolocation-DktrQJvA.js} +2 -2
- package/dist/_chunks/{PkToolRequestGeolocation-CMSIJu4c.js.map → PkToolRequestGeolocation-DktrQJvA.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestOAuthConnection-ClVVaEuK.js → PkToolRequestOAuthConnection-DkcLwFWl.js} +2 -2
- package/dist/_chunks/{PkToolRequestOAuthConnection-ClVVaEuK.js.map → PkToolRequestOAuthConnection-DkcLwFWl.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-D1AOFL1o.js → PkToolShowArtifact-CGUmoTfN.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-D1AOFL1o.js.map → PkToolShowArtifact-CGUmoTfN.js.map} +1 -1
- package/dist/_chunks/PkToolShowChart-DZWu3Yuo.js +224 -0
- package/dist/_chunks/PkToolShowChart-DZWu3Yuo.js.map +1 -0
- package/dist/_chunks/{PkToolShowContactForm-CTitUxv_.js → PkToolShowContactForm-DZ-kgXa6.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-CTitUxv_.js.map → PkToolShowContactForm-DZ-kgXa6.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-YaDgT_04.js → PkToolShowForm-BrxNGFCH.js} +4 -4
- package/dist/_chunks/{PkToolShowForm-YaDgT_04.js.map → PkToolShowForm-BrxNGFCH.js.map} +1 -1
- package/dist/_chunks/{PkToolShowImageGallery-BVrcfe_b.js → PkToolShowImageGallery-BGTncXxq.js} +2 -2
- package/dist/_chunks/{PkToolShowImageGallery-BVrcfe_b.js.map → PkToolShowImageGallery-BGTncXxq.js.map} +1 -1
- package/dist/_chunks/{PkToolShowProductList-CYNh8YRF.js → PkToolShowProductList-k-VB4pUB.js} +2 -2
- package/dist/_chunks/{PkToolShowProductList-CYNh8YRF.js.map → PkToolShowProductList-k-VB4pUB.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-BvH0el0N.js → PkToolShowSources-B3RSUWP7.js} +3 -3
- package/dist/_chunks/{PkToolShowSources-BvH0el0N.js.map → PkToolShowSources-B3RSUWP7.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSuggestedReply-PHcre0Ff.js → PkToolShowSuggestedReply-DTAq41wP.js} +2 -2
- package/dist/_chunks/{PkToolShowSuggestedReply-PHcre0Ff.js.map → PkToolShowSuggestedReply-DTAq41wP.js.map} +1 -1
- package/dist/_chunks/{PkToolShowVideo-SiP-5Ekl.js → PkToolShowVideo-DeexblEL.js} +2 -2
- package/dist/_chunks/{PkToolShowVideo-SiP-5Ekl.js.map → PkToolShowVideo-DeexblEL.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWebPages-Co_33g_K.js → PkToolShowWebPages-C42FNo8K.js} +2 -2
- package/dist/_chunks/{PkToolShowWebPages-Co_33g_K.js.map → PkToolShowWebPages-C42FNo8K.js.map} +1 -1
- package/dist/_chunks/{chatImagePolicy-XBxAhi8o.js → chatImagePolicy-DlZPHhW-.js} +2 -2
- package/dist/_chunks/{chatImagePolicy-XBxAhi8o.js.map → chatImagePolicy-DlZPHhW-.js.map} +1 -1
- package/dist/_chunks/{markdown-DGKSBppG.js → markdown-DNPhTO5l.js} +2 -2
- package/dist/_chunks/{markdown-DGKSBppG.js.map → markdown-DNPhTO5l.js.map} +1 -1
- package/dist/_chunks/{utils-DYtnrtNk.js → utils-Do6urHUh.js} +4 -4
- package/dist/_chunks/utils-Do6urHUh.js.map +1 -0
- package/dist/ai-elements.es.js +2045 -2020
- 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-hvrlDtLK.js → Agent-ldDZiq6E.js} +4 -3
- package/dist-vue/_chunks/Agent-ldDZiq6E.js.map +1 -0
- package/dist-vue/_chunks/{Document-DXSWegFn.js → Document-BfjAfogy.js} +2 -2
- package/dist-vue/_chunks/{Document-DXSWegFn.js.map → Document-BfjAfogy.js.map} +1 -1
- package/dist-vue/_chunks/PkChart-BsF3OtnS.js +243 -0
- package/dist-vue/_chunks/PkChart-BsF3OtnS.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbot-CfBea2qY.js → PkChatbot-BIQh81cA.js} +8 -8
- package/dist-vue/_chunks/{PkChatbot-CfBea2qY.js.map → PkChatbot-BIQh81cA.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotEmptyState-BYrTqidA.js → PkChatbotEmptyState-pAeFPPQc.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-BYrTqidA.js.map → PkChatbotEmptyState-pAeFPPQc.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotInput-Cwkz19oM.js → PkChatbotInput-DSyIo0xB.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotInput-Cwkz19oM.js.map → PkChatbotInput-DSyIo0xB.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotMessages-AkfEvXEN.js → PkChatbotMessages-CZu8feEz.js} +23 -18
- package/dist-vue/_chunks/PkChatbotMessages-CZu8feEz.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotStepPayload-C4yEGoXA.js → PkChatbotStepPayload-r25JHO7_.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-C4yEGoXA.js.map → PkChatbotStepPayload-r25JHO7_.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-DnGYrFSt.js → PkChatbotStepToolDetail-C897BpRX.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-DnGYrFSt.js.map → PkChatbotStepToolDetail-C897BpRX.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotSteps-CoP1JyWG.js → PkChatbotSteps-CRtIVwJV.js} +5 -5
- package/dist-vue/_chunks/{PkChatbotSteps-CoP1JyWG.js.map → PkChatbotSteps-CRtIVwJV.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-CdcZrTJJ.js → PkChatbotViewChat-BBCxj4Qz.js} +369 -365
- package/dist-vue/_chunks/PkChatbotViewChat-BBCxj4Qz.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewConversations-oYUIHDwb.js → PkChatbotViewConversations-rXGl7NKA.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewConversations-oYUIHDwb.js.map → PkChatbotViewConversations-rXGl7NKA.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-C1ggPJvX.js → PkChatbotViewFiles-CsL8OhcA.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewFiles-C1ggPJvX.js.map → PkChatbotViewFiles-CsL8OhcA.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-BZJ8OZ9h.js → PkChatbotViewProfile-CFqxCK2f.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-BZJ8OZ9h.js.map → PkChatbotViewProfile-CFqxCK2f.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreview-DJBrACR3.js → PkFilePreview-1ZNyDAo5.js} +3 -3
- package/dist-vue/_chunks/{PkFilePreview-DJBrACR3.js.map → PkFilePreview-1ZNyDAo5.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreviewDialog-C-m04VEl.js → PkFilePreviewDialog-DnbUHGG2.js} +2 -2
- package/dist-vue/_chunks/{PkFilePreviewDialog-C-m04VEl.js.map → PkFilePreviewDialog-DnbUHGG2.js.map} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-BiS7Huii.js → PkStreamingMarkdown-COQLmP8b.js} +3 -3
- package/dist-vue/_chunks/{PkStreamingMarkdown-BiS7Huii.js.map → PkStreamingMarkdown-COQLmP8b.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolChatFile-DJouw7ft.js → PkToolChatFile-e-7a0k7l.js} +3 -3
- package/dist-vue/_chunks/{PkToolChatFile-DJouw7ft.js.map → PkToolChatFile-e-7a0k7l.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestGeolocation-Du8b17X9.js → PkToolRequestGeolocation-D1XNCvdr.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestGeolocation-Du8b17X9.js.map → PkToolRequestGeolocation-D1XNCvdr.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-X00hZZJe.js → PkToolRequestOAuthConnection-OTvMRYaL.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-X00hZZJe.js.map → PkToolRequestOAuthConnection-OTvMRYaL.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-BAfGUGM4.js → PkToolShowArtifact-CUP3VaC9.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-BAfGUGM4.js.map → PkToolShowArtifact-CUP3VaC9.js.map} +1 -1
- package/dist-vue/_chunks/PkToolShowChart-X6JZDAWD.js +217 -0
- package/dist-vue/_chunks/PkToolShowChart-X6JZDAWD.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowContactForm-CtJSjw8M.js → PkToolShowContactForm-BM8d9M5a.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-CtJSjw8M.js.map → PkToolShowContactForm-BM8d9M5a.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-CgOAGQCq.js → PkToolShowDiagram-DOdzpndK.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-CgOAGQCq.js.map → PkToolShowDiagram-DOdzpndK.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-BXpPnVzJ.js → PkToolShowForm-TYBf8q6g.js} +4 -4
- package/dist-vue/_chunks/{PkToolShowForm-BXpPnVzJ.js.map → PkToolShowForm-TYBf8q6g.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-DOsnvy1W.js → PkToolShowImageGallery-BvwuoyF6.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowImageGallery-DOsnvy1W.js.map → PkToolShowImageGallery-BvwuoyF6.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-Buw-GpNJ.js → PkToolShowProductList-_MHBAgNI.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-Buw-GpNJ.js.map → PkToolShowProductList-_MHBAgNI.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-CPvjMvqB.js → PkToolShowSources-CHw7qZtw.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowSources-CPvjMvqB.js.map → PkToolShowSources-CHw7qZtw.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-HLFecN53.js → PkToolShowSuggestedReply-BVLCX5Sm.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-HLFecN53.js.map → PkToolShowSuggestedReply-BVLCX5Sm.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-DPZtAuLl.js → PkToolShowVideo-D7oiBe4p.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowVideo-DPZtAuLl.js.map → PkToolShowVideo-D7oiBe4p.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-DXjDxztJ.js → PkToolShowWebPages-CRq9Jhmw.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-DXjDxztJ.js.map → PkToolShowWebPages-CRq9Jhmw.js.map} +1 -1
- package/dist-vue/_chunks/{createChatbotApiClient-CWLca1yc.js → createChatbotApiClient-CGeNprai.js} +2 -2
- package/dist-vue/_chunks/{createChatbotApiClient-CWLca1yc.js.map → createChatbotApiClient-CGeNprai.js.map} +1 -1
- package/dist-vue/_chunks/{useChatbotStore-CNQ8lTub.js → useChatbotStore-KXAltGz3.js} +3 -3
- package/dist-vue/_chunks/{useChatbotStore-CNQ8lTub.js.map → useChatbotStore-KXAltGz3.js.map} +1 -1
- package/dist-vue/_chunks/{utils-Dqyng-2B.js → utils-Do3JWPJe.js} +4 -4
- package/dist-vue/_chunks/utils-Do3JWPJe.js.map +1 -0
- package/dist-vue/api.js +1 -1
- package/dist-vue/composables.js +28 -12
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +28 -27
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +22 -4
- package/dist-vue/packages/components/src/chat/PkChart.d.ts +18 -0
- package/dist-vue/packages/components/src/chat/PkChartCard.d.ts +16 -0
- package/dist-vue/packages/components/src/chat/PkToolShowChart.d.ts +12 -0
- package/dist-vue/packages/components/src/chat/chartFormat.d.ts +21 -0
- package/dist-vue/packages/components/src/chat/useChatFilePreview.d.ts +2 -2
- package/dist-vue/packages/composable/src/cssColor.d.ts +44 -0
- package/dist-vue/packages/composable/src/index.d.ts +1 -0
- package/dist-vue/packages/models/src/schema/Agent.d.ts +2 -0
- package/dist-vue/packages/models/src/schema/Chart.d.ts +147 -0
- package/dist-vue/packages/models/src/schema/Document.d.ts +2 -2
- package/dist-vue/packages/models/src/schema/Invitation.d.ts +1 -1
- package/dist-vue/packages/models/src/schema/Lead.d.ts +3 -3
- package/dist-vue/packages/models/src/schema/SelectionAction.d.ts +1 -1
- package/dist-vue/packages/models/src/schema/SpreadsheetPreview.d.ts +5 -5
- package/dist-vue/packages/models/src/schema/index.d.ts +1 -0
- package/dist-vue/style.css +1 -1
- package/package.json +2 -1
- package/dist/_chunks/Agent-D9MWMkLp.js.map +0 -1
- package/dist/_chunks/utils-DYtnrtNk.js.map +0 -1
- package/dist-vue/_chunks/Agent-hvrlDtLK.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotMessages-AkfEvXEN.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotViewChat-CdcZrTJJ.js.map +0 -1
- package/dist-vue/_chunks/utils-Dqyng-2B.js.map +0 -1
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { n as e, r as t } from "./PkToolShowChart-X6JZDAWD.js";
|
|
2
|
+
import { createElementBlock as n, createElementVNode as r, defineComponent as i, nextTick as a, onBeforeUnmount as o, onMounted as s, openBlock as c, useTemplateRef as l, watch as u } from "vue";
|
|
3
|
+
import { useI18n as d } from "vue-i18n";
|
|
4
|
+
import { ArcElement as f, BarController as p, BarElement as m, CategoryScale as h, Chart as g, DoughnutController as _, Legend as v, LineController as y, LineElement as b, LinearScale as x, PieController as S, PointElement as C, Tooltip as w } from "chart.js";
|
|
5
|
+
// ../../packages/composable/src/cssColor.ts
|
|
6
|
+
var T, E = () => typeof CSS < "u" && CSS.supports("color", "color(from red xyz-d65 x y z)") && CSS.supports("color", "color-mix(in srgb, red 50%, blue)"), D = (e) => Math.round(Math.min(1, Math.max(0, Number(e))) * 255);
|
|
7
|
+
function O(e) {
|
|
8
|
+
let t = e.match(/^color\(srgb (\S+) (\S+) (\S+)(?: \/ (\S+))?\)$/);
|
|
9
|
+
return t ? {
|
|
10
|
+
r: D(t[1]),
|
|
11
|
+
g: D(t[2]),
|
|
12
|
+
b: D(t[3]),
|
|
13
|
+
a: t[4] === void 0 ? 1 : Number(t[4])
|
|
14
|
+
} : null;
|
|
15
|
+
}
|
|
16
|
+
function k(e) {
|
|
17
|
+
if (T ??= document.createElement("canvas").getContext("2d", { willReadFrequently: !0 }), !T) return {
|
|
18
|
+
r: 0,
|
|
19
|
+
g: 0,
|
|
20
|
+
b: 0,
|
|
21
|
+
a: 1
|
|
22
|
+
};
|
|
23
|
+
T.clearRect(0, 0, 1, 1), T.fillStyle = e, T.fillRect(0, 0, 1, 1);
|
|
24
|
+
let [t, n, r, i] = T.getImageData(0, 0, 1, 1).data;
|
|
25
|
+
return {
|
|
26
|
+
r: t,
|
|
27
|
+
g: n,
|
|
28
|
+
b: r,
|
|
29
|
+
a: Math.round(i / 255 * 1e3) / 1e3
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function A(e, t) {
|
|
33
|
+
e.style.color = `color-mix(in srgb, ${t} 100%, transparent)`;
|
|
34
|
+
let n = getComputedStyle(e).color;
|
|
35
|
+
return O(n) ?? k(n);
|
|
36
|
+
}
|
|
37
|
+
function j(e, t) {
|
|
38
|
+
let n = document.createElement("span");
|
|
39
|
+
n.setAttribute("aria-hidden", "true"), n.style.cssText = "position:absolute;width:0;height:0;overflow:hidden;visibility:hidden;pointer-events:none", e.append(n);
|
|
40
|
+
try {
|
|
41
|
+
return t.map((e) => A(n, e));
|
|
42
|
+
} finally {
|
|
43
|
+
n.remove();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
var M = ({ r: e, g: t, b: n }) => `#${[
|
|
47
|
+
e,
|
|
48
|
+
t,
|
|
49
|
+
n
|
|
50
|
+
].map((e) => e.toString(16).padStart(2, "0")).join("")}`, N = ["aria-label"], P = /* @__PURE__ */ i({
|
|
51
|
+
__name: "PkChart",
|
|
52
|
+
props: {
|
|
53
|
+
chart: {},
|
|
54
|
+
isDark: { type: Boolean }
|
|
55
|
+
},
|
|
56
|
+
setup(i, { expose: T }) {
|
|
57
|
+
g.register(f, p, m, h, _, v, x, y, b, S, C, w);
|
|
58
|
+
let D = i, { locale: O } = d({ useScope: "global" }), k = l("root"), A = l("canvas"), P, F = [
|
|
59
|
+
"accent",
|
|
60
|
+
"brand",
|
|
61
|
+
"info"
|
|
62
|
+
], I = [
|
|
63
|
+
[100, "surface"],
|
|
64
|
+
[55, "surface"],
|
|
65
|
+
[70, "word"],
|
|
66
|
+
[30, "surface"]
|
|
67
|
+
].flatMap(([e, t]) => F.map((n) => e === 100 ? `var(--color-${n}-graphic)` : `color-mix(in srgb, var(--color-${n}-graphic) ${e}%, var(--color-${t}))`)), L = {
|
|
68
|
+
positive: "var(--color-success-graphic)",
|
|
69
|
+
warning: "var(--color-warning-graphic)",
|
|
70
|
+
negative: "var(--color-danger-graphic)",
|
|
71
|
+
critical: "color-mix(in srgb, var(--color-danger-graphic) 60%, var(--color-word))",
|
|
72
|
+
neutral: "color-mix(in srgb, var(--color-word) 35%, var(--color-surface))"
|
|
73
|
+
}, R = [
|
|
74
|
+
"var(--color-word-2)",
|
|
75
|
+
"var(--color-word-3)",
|
|
76
|
+
"var(--color-surface-3)",
|
|
77
|
+
"var(--color-surface)"
|
|
78
|
+
], z = (e) => ({
|
|
79
|
+
categorical: [
|
|
80
|
+
"#9365ff",
|
|
81
|
+
"#004775",
|
|
82
|
+
"#6e66ed",
|
|
83
|
+
"#003d5c",
|
|
84
|
+
"#4b63d9",
|
|
85
|
+
"#0058a8",
|
|
86
|
+
"#285ec1",
|
|
87
|
+
"#00508f"
|
|
88
|
+
],
|
|
89
|
+
tones: {
|
|
90
|
+
positive: "#5cb327",
|
|
91
|
+
warning: "#e0a800",
|
|
92
|
+
negative: "#fe4242",
|
|
93
|
+
critical: "#991b1b",
|
|
94
|
+
neutral: e ? "#4b4b5c" : "#c4c9d4"
|
|
95
|
+
},
|
|
96
|
+
text: e ? "#d1d5db" : "#4b5563",
|
|
97
|
+
tick: e ? "#9ca3af" : "#6b7280",
|
|
98
|
+
grid: e ? "#374151" : "#f3f4f6",
|
|
99
|
+
surface: e ? "#1f2937" : "#ffffff"
|
|
100
|
+
}), B = () => {
|
|
101
|
+
if (!E()) return z(!!D.isDark);
|
|
102
|
+
let e = [
|
|
103
|
+
...I,
|
|
104
|
+
...Object.values(L),
|
|
105
|
+
...R
|
|
106
|
+
], t = j(k.value, e).map(M), n = t.slice(0, I.length), r = Object.fromEntries(Object.keys(L).map((e, n) => [e, t[I.length + n]])), [i, a, o, s] = t.slice(-R.length);
|
|
107
|
+
return {
|
|
108
|
+
categorical: n,
|
|
109
|
+
tones: r,
|
|
110
|
+
text: i,
|
|
111
|
+
tick: a,
|
|
112
|
+
grid: o,
|
|
113
|
+
surface: s
|
|
114
|
+
};
|
|
115
|
+
}, V = () => {
|
|
116
|
+
let { chart: n } = D, r = B(), i = {
|
|
117
|
+
family: getComputedStyle(k.value).fontFamily,
|
|
118
|
+
size: 11
|
|
119
|
+
}, a = e(O.value, n.format), o = window.matchMedia("(prefers-reduced-motion: reduce)").matches, s = t(n.type), c = 0, l = n.series.map((e) => {
|
|
120
|
+
if (s) return {
|
|
121
|
+
label: e.name,
|
|
122
|
+
data: e.values,
|
|
123
|
+
backgroundColor: n.categories.map((e, t) => r.categorical[t % r.categorical.length]),
|
|
124
|
+
borderColor: r.surface,
|
|
125
|
+
borderWidth: 2
|
|
126
|
+
};
|
|
127
|
+
let t = e.tone ? r.tones[e.tone] : r.categorical[c++ % r.categorical.length];
|
|
128
|
+
return n.type === "line" ? {
|
|
129
|
+
label: e.name,
|
|
130
|
+
data: e.values,
|
|
131
|
+
borderColor: t,
|
|
132
|
+
backgroundColor: t,
|
|
133
|
+
borderWidth: 2,
|
|
134
|
+
pointRadius: 3,
|
|
135
|
+
cubicInterpolationMode: "monotone",
|
|
136
|
+
spanGaps: !1
|
|
137
|
+
} : {
|
|
138
|
+
label: e.name,
|
|
139
|
+
data: e.values,
|
|
140
|
+
backgroundColor: t,
|
|
141
|
+
borderRadius: 3,
|
|
142
|
+
maxBarThickness: 48
|
|
143
|
+
};
|
|
144
|
+
}), u = (e) => ({
|
|
145
|
+
display: !!e,
|
|
146
|
+
text: e ?? "",
|
|
147
|
+
color: r.tick,
|
|
148
|
+
font: i
|
|
149
|
+
}), d = {
|
|
150
|
+
beginAtZero: !0,
|
|
151
|
+
stacked: !!n.stacked,
|
|
152
|
+
ticks: {
|
|
153
|
+
color: r.tick,
|
|
154
|
+
font: i,
|
|
155
|
+
callback: (e) => a(Number(e))
|
|
156
|
+
},
|
|
157
|
+
grid: {
|
|
158
|
+
color: r.grid,
|
|
159
|
+
drawTicks: !1
|
|
160
|
+
},
|
|
161
|
+
border: { display: !1 },
|
|
162
|
+
title: u(n.valueLabel)
|
|
163
|
+
}, f = {
|
|
164
|
+
stacked: !!n.stacked,
|
|
165
|
+
ticks: {
|
|
166
|
+
color: r.tick,
|
|
167
|
+
font: i,
|
|
168
|
+
autoSkip: !0
|
|
169
|
+
},
|
|
170
|
+
grid: { display: !1 },
|
|
171
|
+
border: { display: !1 },
|
|
172
|
+
title: u(n.categoryLabel)
|
|
173
|
+
}, p = n.type === "bar" && !!n.horizontal;
|
|
174
|
+
return {
|
|
175
|
+
type: n.type,
|
|
176
|
+
data: {
|
|
177
|
+
labels: n.categories,
|
|
178
|
+
datasets: l
|
|
179
|
+
},
|
|
180
|
+
options: {
|
|
181
|
+
responsive: !0,
|
|
182
|
+
maintainAspectRatio: !1,
|
|
183
|
+
animation: !o && { duration: 400 },
|
|
184
|
+
indexAxis: p ? "y" : "x",
|
|
185
|
+
...s && { cutout: n.type === "doughnut" ? "55%" : 0 },
|
|
186
|
+
scales: s ? {} : p ? {
|
|
187
|
+
x: d,
|
|
188
|
+
y: f
|
|
189
|
+
} : {
|
|
190
|
+
x: f,
|
|
191
|
+
y: d
|
|
192
|
+
},
|
|
193
|
+
plugins: {
|
|
194
|
+
legend: {
|
|
195
|
+
display: s || n.series.length > 1,
|
|
196
|
+
position: "bottom",
|
|
197
|
+
labels: {
|
|
198
|
+
color: r.text,
|
|
199
|
+
font: i,
|
|
200
|
+
boxWidth: 10,
|
|
201
|
+
boxHeight: 10,
|
|
202
|
+
useBorderRadius: !0,
|
|
203
|
+
borderRadius: 2
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
tooltip: { callbacks: { label: (e) => {
|
|
207
|
+
let t = Number(e.raw);
|
|
208
|
+
if (!s) return `${e.dataset.label}: ${a(t)}`;
|
|
209
|
+
let n = e.dataset.data.filter((e) => typeof e == "number").reduce((e, t) => e + t, 0), r = n ? new Intl.NumberFormat(O.value, {
|
|
210
|
+
style: "percent",
|
|
211
|
+
maximumFractionDigits: 1
|
|
212
|
+
}).format(t / n) : "";
|
|
213
|
+
return `${e.label}: ${a(t)}${r ? ` (${r})` : ""}`;
|
|
214
|
+
} } }
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
}, H = async () => {
|
|
219
|
+
await a(), A.value && k.value && (P?.destroy(), P = new g(A.value, V()));
|
|
220
|
+
};
|
|
221
|
+
return T({ toBlob: async () => {
|
|
222
|
+
if (!A.value || !k.value) return null;
|
|
223
|
+
let e = document.createElement("canvas");
|
|
224
|
+
e.width = A.value.width, e.height = A.value.height;
|
|
225
|
+
let t = e.getContext("2d");
|
|
226
|
+
return t ? (t.fillStyle = B().surface, t.fillRect(0, 0, e.width, e.height), t.drawImage(A.value, 0, 0), new Promise((t) => e.toBlob(t, "image/png"))) : null;
|
|
227
|
+
} }), s(H), u(() => `${D.isDark}|${JSON.stringify(D.chart)}`, H), o(() => {
|
|
228
|
+
P?.destroy(), P = void 0;
|
|
229
|
+
}), (e, t) => (c(), n("div", {
|
|
230
|
+
ref_key: "root",
|
|
231
|
+
ref: k,
|
|
232
|
+
class: "pk-chart"
|
|
233
|
+
}, [r("canvas", {
|
|
234
|
+
ref_key: "canvas",
|
|
235
|
+
ref: A,
|
|
236
|
+
role: "img",
|
|
237
|
+
"aria-label": i.chart.title || i.chart.series.map((e) => e.name).join(", ")
|
|
238
|
+
}, null, 8, N)], 512));
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
export { P as default };
|
|
242
|
+
|
|
243
|
+
//# sourceMappingURL=PkChart-BsF3OtnS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PkChart-BsF3OtnS.js","names":["ChartJS","_openBlock","_createElementBlock","_createElementVNode","_sfc_main","chartValueFormatter","isRoundChart","pixel","supportsColorRoles","channel","value","parseSrgb","match","computed","parseOnCanvas","r","g","b","a","readColor","expression","probe","resolveCssColorsIn","element","expressions","hexString","_hoisted_1","PkChart_default","defineComponent","__expose","ArcElement","BarController","BarElement","CategoryScale","DoughnutController","Legend","LinearScale","LineController","LineElement","PieController","PointElement","Tooltip","props","__props","useI18n","root","useTemplateRef","canvas","instance","ROLES","CATEGORICAL","strength","toward","role","TONES","INK","fallbackColors","dark","readColors","hex","categorical","tones","tone","i","text","tick","grid","surface","configuration","colors","font","format","locale","chart","reducedMotion","round","untoned","datasets","series","color","axisTitle","valueAxis","categoryAxis","horizontal","item","total","v","sum","share","draw","nextTick","Chart","copy","context","resolve","onMounted","watch","onBeforeUnmount","openBlock","createElementBlock","createElementVNode","s"],"sources":["../../../../packages/composable/src/cssColor.ts","../../../../packages/components/src/chat/PkChart.vue","../../../../packages/components/src/chat/PkChart.vue"],"sourcesContent":["/** A color as a canvas draws it: channels 0-255, alpha 0-1. */\nexport type RgbaColor = { r: number; g: number; b: number; a: number }\n\nlet scopes: Record<'light' | 'dark', HTMLElement> | undefined\nlet pixel: CanvasRenderingContext2D | null | undefined\nlet memoRevision = ''\nconst memo = new Map<string, RgbaColor>()\n\n/**\n * Whether this browser computes the color roles of the design system, which\n * derive from the palette with the relative color syntax and `color-mix()`.\n */\nexport const supportsColorRoles = () =>\n typeof CSS !== 'undefined' &&\n CSS.supports('color', 'color(from red xyz-d65 x y z)') &&\n CSS.supports('color', 'color-mix(in srgb, red 50%, blue)')\n\n/**\n * A hidden element per theme, with the classes that pin it: the colors of a\n * theme resolve inside it whatever the document's own theme is at that\n * moment, which during a switch is not yet the one being drawn.\n */\nfunction scopeOf(theme: 'light' | 'dark') {\n if (!scopes) {\n const make = (name: 'light' | 'dark') => {\n const element = document.createElement('span')\n element.className = `theme theme--${name}`\n element.setAttribute('aria-hidden', 'true')\n element.style.cssText =\n 'position:fixed;width:0;height:0;overflow:hidden;visibility:hidden;pointer-events:none'\n document.body.append(element)\n return element\n }\n scopes = { light: make('light'), dark: make('dark') }\n }\n return scopes[theme]\n}\n\nconst channel = (value: string) =>\n Math.round(Math.min(1, Math.max(0, Number(value))) * 255)\n\n/** `color(srgb r g b / a)`, the form a color mixed in sRGB computes to. */\nfunction parseSrgb(computed: string): RgbaColor | null {\n const match = computed.match(\n /^color\\(srgb (\\S+) (\\S+) (\\S+)(?: \\/ (\\S+))?\\)$/,\n )\n if (!match) {\n return null\n }\n return {\n r: channel(match[1]),\n g: channel(match[2]),\n b: channel(match[3]),\n a: match[4] === undefined ? 1 : Number(match[4]),\n }\n}\n\n/** Any other form the browser computed, read back from one pixel. */\nfunction parseOnCanvas(computed: string): RgbaColor {\n pixel ??= document\n .createElement('canvas')\n .getContext('2d', { willReadFrequently: true })\n if (!pixel) {\n return { r: 0, g: 0, b: 0, a: 1 }\n }\n pixel.clearRect(0, 0, 1, 1)\n pixel.fillStyle = computed\n pixel.fillRect(0, 0, 1, 1)\n const [r, g, b, a] = pixel.getImageData(0, 0, 1, 1).data\n return { r, g, b, a: Math.round((a / 255) * 1000) / 1000 }\n}\n\n/**\n * The color a CSS expression (`var(--color-accent-graphic)`, a `color-mix()`)\n * resolves to in a theme, in channels a canvas understands. Chart.js draws on\n * a canvas, which reads no custom property, and the design system derives its\n * roles in XYZ with the relative color syntax: the expression is mixed into\n * sRGB first, so the browser hands it back as `color(srgb ...)`.\n *\n * Results are kept while `revision` stays the same: the caller passes what\n * changes the colors, the theme's version and its stylesheet.\n */\nexport function resolveCssColor(\n expression: string,\n theme: 'light' | 'dark',\n revision: string,\n): RgbaColor {\n if (revision !== memoRevision) {\n memo.clear()\n memoRevision = revision\n }\n const id = `${theme}|${expression}`\n const known = memo.get(id)\n if (known) {\n return known\n }\n const color = readColor(scopeOf(theme), expression)\n memo.set(id, color)\n return color\n}\n\n/** The expression mixed into sRGB on `probe`, read back as channels. */\nfunction readColor(probe: HTMLElement, expression: string): RgbaColor {\n probe.style.color = `color-mix(in srgb, ${expression} 100%, transparent)`\n const computed = getComputedStyle(probe).color\n return parseSrgb(computed) ?? parseOnCanvas(computed)\n}\n\n/**\n * The colors of CSS expressions as they resolve inside `element`, with the\n * theme and the custom properties that reach it there. In the widget that is\n * its shadow root, which the theme scopes of {@link resolveCssColor}, on the\n * document's body, never see. Nothing is memoized: the caller reads again\n * when the theme changes.\n */\nexport function resolveCssColorsIn(\n element: Element,\n expressions: readonly string[],\n): RgbaColor[] {\n const probe = document.createElement('span')\n probe.setAttribute('aria-hidden', 'true')\n probe.style.cssText =\n 'position:absolute;width:0;height:0;overflow:hidden;visibility:hidden;pointer-events:none'\n element.append(probe)\n try {\n return expressions.map((expression) => readColor(probe, expression))\n } finally {\n probe.remove()\n }\n}\n\n/** `#rrggbb`, ready for the hex alpha some charts append. */\nexport const hexString = ({ r, g, b }: RgbaColor) =>\n `#${[r, g, b].map((value) => value.toString(16).padStart(2, '0')).join('')}`\n\n/** A `#rrggbb` color as an `rgba()` string with the alpha given. */\nexport function hexWithAlpha(hex: string, alpha: number) {\n const value = Number.parseInt(hex.slice(1, 7), 16)\n return `rgba(${(value >> 16) & 255}, ${(value >> 8) & 255}, ${value & 255}, ${alpha})`\n}\n\nconst channelsOf = (hex: string) => {\n const value = Number.parseInt(hex.slice(1, 7), 16)\n return [(value >> 16) & 255, (value >> 8) & 255, value & 255]\n}\n\n/** WCAG relative luminance of a `#rrggbb` color. */\nconst luminanceOf = (hex: string) => {\n const [r, g, b] = channelsOf(hex).map((channel) => {\n const value = channel / 255\n return value <= 0.03928\n ? value / 12.92\n : ((value + 0.055) / 1.055) ** 2.4\n })\n return 0.2126 * r + 0.7152 * g + 0.0722 * b\n}\n\nconst contrastOf = (a: string, b: string) => {\n const [high, low] = [luminanceOf(a), luminanceOf(b)].sort((x, y) => y - x)\n return (high + 0.05) / (low + 0.05)\n}\n\n/**\n * `color` as a chart mark on `ground`: unchanged when it already stands 3:1\n * off it, the contrast WCAG asks of a graphic (1.4.11), otherwise mixed\n * toward `toward` (white on a dark ground, black on a light one) a tenth at\n * a time until it does. An agent's own color is often black, which vanished\n * from the bars of the dark theme, and the palette's two dark teals did too.\n * A color that is not `#rgb` or `#rrggbb` is returned as it is.\n */\nexport function readableOn(color: string, ground: string, toward: string) {\n const short = /^#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(color)\n const hex = short\n ? `#${short[1]}${short[1]}${short[2]}${short[2]}${short[3]}${short[3]}`\n : color\n if (!/^#[0-9a-f]{6}$/i.test(hex) || contrastOf(hex, ground) >= 3) {\n return color\n }\n const from = channelsOf(hex)\n const to = channelsOf(toward)\n for (let step = 1; step <= 10; step++) {\n const mixed = hexString({\n r: Math.round(from[0] + ((to[0] - from[0]) * step) / 10),\n g: Math.round(from[1] + ((to[1] - from[1]) * step) / 10),\n b: Math.round(from[2] + ((to[2] - from[2]) * step) / 10),\n a: 1,\n })\n if (contrastOf(mixed, ground) >= 3) {\n return mixed\n }\n }\n return toward\n}\n","<script setup lang=\"ts\">\n import {\n nextTick,\n onBeforeUnmount,\n onMounted,\n useTemplateRef,\n watch,\n } from 'vue'\n import { useI18n } from 'vue-i18n'\n import {\n ArcElement,\n BarController,\n BarElement,\n CategoryScale,\n Chart as ChartJS,\n DoughnutController,\n Legend,\n LinearScale,\n LineController,\n LineElement,\n PieController,\n PointElement,\n Tooltip,\n type ChartConfiguration,\n type TooltipItem,\n } from 'chart.js'\n import {\n hexString,\n resolveCssColorsIn,\n supportsColorRoles,\n } from 'composables'\n import { isRoundChart, type Chart, type ChartTone } from 'models'\n import { chartValueFormatter } from './chartFormat'\n\n ChartJS.register(\n ArcElement,\n BarController,\n BarElement,\n CategoryScale,\n DoughnutController,\n Legend,\n LinearScale,\n LineController,\n LineElement,\n PieController,\n PointElement,\n Tooltip,\n )\n\n /**\n * Draws a chart described as data (spec `chat-charts.md`) with Chart.js,\n * in the colors of the theme it sits in: the categorical palette from the\n * design system's graphic roles, the tones from its semantic ones. The\n * colors are read inside this element, so in the widget they are the\n * widget's own and not the host page's.\n */\n const props = defineProps<{\n chart: Chart\n isDark?: boolean\n }>()\n\n const { locale } = useI18n({ useScope: 'global' })\n\n const root = useTemplateRef<HTMLElement>('root')\n const canvas = useTemplateRef<HTMLCanvasElement>('canvas')\n let instance: ChartJS | undefined\n\n const ROLES = ['accent', 'brand', 'info'] as const\n /**\n * Twelve categorical colors, enough for the slices of a pie: the three\n * graphic roles, then the same roles toward the surface (a tint in the\n * light theme, a shade in the dark one), then toward the text, then\n * further toward the surface. Mixing the default brand, a near black\n * navy, toward the text alone gave two slices nobody could tell apart.\n * Interleaved, so neighbours never share a hue.\n */\n const CATEGORICAL = (\n [\n [100, 'surface'],\n [55, 'surface'],\n [70, 'word'],\n [30, 'surface'],\n ] as const\n ).flatMap(([strength, toward]) =>\n ROLES.map((role) =>\n strength === 100\n ? `var(--color-${role}-graphic)`\n : `color-mix(in srgb, var(--color-${role}-graphic) ${strength}%, var(--color-${toward}))`,\n ),\n )\n const TONES: Record<ChartTone, string> = {\n positive: 'var(--color-success-graphic)',\n warning: 'var(--color-warning-graphic)',\n negative: 'var(--color-danger-graphic)',\n critical:\n 'color-mix(in srgb, var(--color-danger-graphic) 60%, var(--color-word))',\n neutral:\n 'color-mix(in srgb, var(--color-word) 35%, var(--color-surface))',\n }\n const INK = [\n 'var(--color-word-2)',\n 'var(--color-word-3)',\n 'var(--color-surface-3)',\n 'var(--color-surface)',\n ]\n\n /**\n * A browser that cannot compute the design system's roles (no\n * `color-mix()` or relative colors) would draw every series in the text\n * color: it gets the dashboard's colors for the default theme instead.\n */\n const fallbackColors = (dark: boolean) => ({\n categorical: [\n '#9365ff',\n '#004775',\n '#6e66ed',\n '#003d5c',\n '#4b63d9',\n '#0058a8',\n '#285ec1',\n '#00508f',\n ],\n tones: {\n positive: '#5cb327',\n warning: '#e0a800',\n negative: '#fe4242',\n critical: '#991b1b',\n neutral: dark ? '#4b4b5c' : '#c4c9d4',\n } satisfies Record<ChartTone, string>,\n text: dark ? '#d1d5db' : '#4b5563',\n tick: dark ? '#9ca3af' : '#6b7280',\n grid: dark ? '#374151' : '#f3f4f6',\n surface: dark ? '#1f2937' : '#ffffff',\n })\n\n const readColors = () => {\n if (!supportsColorRoles()) {\n return fallbackColors(!!props.isDark)\n }\n const expressions = [...CATEGORICAL, ...Object.values(TONES), ...INK]\n const hex = resolveCssColorsIn(root.value!, expressions).map(hexString)\n const categorical = hex.slice(0, CATEGORICAL.length)\n const tones = Object.fromEntries(\n Object.keys(TONES).map((tone, i) => [\n tone,\n hex[CATEGORICAL.length + i],\n ]),\n ) as Record<ChartTone, string>\n const [text, tick, grid, surface] = hex.slice(-INK.length)\n return { categorical, tones, text, tick, grid, surface }\n }\n\n const configuration = (): ChartConfiguration => {\n const { chart } = props\n const colors = readColors()\n const font = {\n family: getComputedStyle(root.value!).fontFamily,\n size: 11,\n }\n const format = chartValueFormatter(locale.value, chart.format)\n const reducedMotion = window.matchMedia(\n '(prefers-reduced-motion: reduce)',\n ).matches\n const round = isRoundChart(chart.type)\n let untoned = 0\n const datasets = chart.series.map((series) => {\n if (round) {\n return {\n label: series.name,\n data: series.values,\n backgroundColor: chart.categories.map(\n (_, i) =>\n colors.categorical[i % colors.categorical.length],\n ),\n borderColor: colors.surface,\n borderWidth: 2,\n }\n }\n const color = series.tone\n ? colors.tones[series.tone]\n : colors.categorical[untoned++ % colors.categorical.length]\n return chart.type === 'line'\n ? {\n label: series.name,\n data: series.values,\n borderColor: color,\n backgroundColor: color,\n borderWidth: 2,\n pointRadius: 3,\n // Smooth without overshooting a value\n cubicInterpolationMode: 'monotone',\n // A missing value stays a gap, not a guess\n spanGaps: false,\n }\n : {\n label: series.name,\n data: series.values,\n backgroundColor: color,\n borderRadius: 3,\n maxBarThickness: 48,\n }\n })\n const axisTitle = (text?: string) => ({\n display: !!text,\n text: text ?? '',\n color: colors.tick,\n font,\n })\n const valueAxis = {\n beginAtZero: true,\n stacked: !!chart.stacked,\n ticks: {\n color: colors.tick,\n font,\n callback: (value: string | number) => format(Number(value)),\n },\n grid: { color: colors.grid, drawTicks: false },\n border: { display: false },\n title: axisTitle(chart.valueLabel),\n }\n const categoryAxis = {\n stacked: !!chart.stacked,\n ticks: { color: colors.tick, font, autoSkip: true },\n grid: { display: false },\n border: { display: false },\n title: axisTitle(chart.categoryLabel),\n }\n const horizontal = chart.type === 'bar' && !!chart.horizontal\n return {\n type: chart.type,\n data: { labels: chart.categories, datasets },\n options: {\n responsive: true,\n maintainAspectRatio: false,\n animation: reducedMotion ? false : { duration: 400 },\n indexAxis: horizontal ? 'y' : 'x',\n // The hole of a doughnut, and the slices drawn whole in a pie\n ...(round && {\n cutout: chart.type === 'doughnut' ? '55%' : 0,\n }),\n scales: round\n ? {}\n : horizontal\n ? { x: valueAxis, y: categoryAxis }\n : { x: categoryAxis, y: valueAxis },\n plugins: {\n legend: {\n display: round || chart.series.length > 1,\n position: 'bottom',\n labels: {\n color: colors.text,\n font,\n boxWidth: 10,\n boxHeight: 10,\n useBorderRadius: true,\n borderRadius: 2,\n },\n },\n tooltip: {\n callbacks: {\n label: (item: TooltipItem<typeof chart.type>) => {\n const value = Number(item.raw)\n if (!round) {\n return `${item.dataset.label}: ${format(value)}`\n }\n const total = (item.dataset.data as number[])\n .filter((v) => typeof v === 'number')\n .reduce((sum, v) => sum + v, 0)\n const share = total\n ? new Intl.NumberFormat(locale.value, {\n style: 'percent',\n maximumFractionDigits: 1,\n }).format(value / total)\n : ''\n return `${item.label}: ${format(value)}${share ? ` (${share})` : ''}`\n },\n },\n },\n },\n },\n } as ChartConfiguration\n }\n\n const draw = async () => {\n await nextTick()\n if (!canvas.value || !root.value) {\n return\n }\n instance?.destroy()\n instance = new ChartJS(canvas.value, configuration())\n }\n\n /**\n * The chart as a PNG on the surface it is drawn on: the canvas itself is\n * transparent, and a transparent PNG pasted on a dark slide loses its\n * text.\n */\n const toBlob = async (): Promise<Blob | null> => {\n if (!canvas.value || !root.value) {\n return null\n }\n const copy = document.createElement('canvas')\n copy.width = canvas.value.width\n copy.height = canvas.value.height\n const context = copy.getContext('2d')\n if (!context) {\n return null\n }\n context.fillStyle = readColors().surface\n context.fillRect(0, 0, copy.width, copy.height)\n context.drawImage(canvas.value, 0, 0)\n return new Promise((resolve) => copy.toBlob(resolve, 'image/png'))\n }\n\n defineExpose({ toBlob })\n\n onMounted(draw)\n // Redrawn when the numbers or the theme change, not when the parent hands\n // over the same chart as a new object (each update of the message parses\n // the input again): that replayed the animation. The colors are read\n // again with the theme classes.\n watch(() => `${props.isDark}|${JSON.stringify(props.chart)}`, draw)\n onBeforeUnmount(() => {\n instance?.destroy()\n instance = undefined\n })\n</script>\n\n<template>\n <div ref=\"root\" class=\"pk-chart\">\n <canvas\n ref=\"canvas\"\n role=\"img\"\n :aria-label=\"\n chart.title || chart.series.map((s) => s.name).join(', ')\n \" />\n </div>\n</template>\n\n<style lang=\"scss\">\n .pk-chart {\n position: relative;\n width: 100%;\n height: 100%;\n min-height: 0;\n }\n</style>\n","<script setup lang=\"ts\">\n import {\n nextTick,\n onBeforeUnmount,\n onMounted,\n useTemplateRef,\n watch,\n } from 'vue'\n import { useI18n } from 'vue-i18n'\n import {\n ArcElement,\n BarController,\n BarElement,\n CategoryScale,\n Chart as ChartJS,\n DoughnutController,\n Legend,\n LinearScale,\n LineController,\n LineElement,\n PieController,\n PointElement,\n Tooltip,\n type ChartConfiguration,\n type TooltipItem,\n } from 'chart.js'\n import {\n hexString,\n resolveCssColorsIn,\n supportsColorRoles,\n } from 'composables'\n import { isRoundChart, type Chart, type ChartTone } from 'models'\n import { chartValueFormatter } from './chartFormat'\n\n ChartJS.register(\n ArcElement,\n BarController,\n BarElement,\n CategoryScale,\n DoughnutController,\n Legend,\n LinearScale,\n LineController,\n LineElement,\n PieController,\n PointElement,\n Tooltip,\n )\n\n /**\n * Draws a chart described as data (spec `chat-charts.md`) with Chart.js,\n * in the colors of the theme it sits in: the categorical palette from the\n * design system's graphic roles, the tones from its semantic ones. The\n * colors are read inside this element, so in the widget they are the\n * widget's own and not the host page's.\n */\n const props = defineProps<{\n chart: Chart\n isDark?: boolean\n }>()\n\n const { locale } = useI18n({ useScope: 'global' })\n\n const root = useTemplateRef<HTMLElement>('root')\n const canvas = useTemplateRef<HTMLCanvasElement>('canvas')\n let instance: ChartJS | undefined\n\n const ROLES = ['accent', 'brand', 'info'] as const\n /**\n * Twelve categorical colors, enough for the slices of a pie: the three\n * graphic roles, then the same roles toward the surface (a tint in the\n * light theme, a shade in the dark one), then toward the text, then\n * further toward the surface. Mixing the default brand, a near black\n * navy, toward the text alone gave two slices nobody could tell apart.\n * Interleaved, so neighbours never share a hue.\n */\n const CATEGORICAL = (\n [\n [100, 'surface'],\n [55, 'surface'],\n [70, 'word'],\n [30, 'surface'],\n ] as const\n ).flatMap(([strength, toward]) =>\n ROLES.map((role) =>\n strength === 100\n ? `var(--color-${role}-graphic)`\n : `color-mix(in srgb, var(--color-${role}-graphic) ${strength}%, var(--color-${toward}))`,\n ),\n )\n const TONES: Record<ChartTone, string> = {\n positive: 'var(--color-success-graphic)',\n warning: 'var(--color-warning-graphic)',\n negative: 'var(--color-danger-graphic)',\n critical:\n 'color-mix(in srgb, var(--color-danger-graphic) 60%, var(--color-word))',\n neutral:\n 'color-mix(in srgb, var(--color-word) 35%, var(--color-surface))',\n }\n const INK = [\n 'var(--color-word-2)',\n 'var(--color-word-3)',\n 'var(--color-surface-3)',\n 'var(--color-surface)',\n ]\n\n /**\n * A browser that cannot compute the design system's roles (no\n * `color-mix()` or relative colors) would draw every series in the text\n * color: it gets the dashboard's colors for the default theme instead.\n */\n const fallbackColors = (dark: boolean) => ({\n categorical: [\n '#9365ff',\n '#004775',\n '#6e66ed',\n '#003d5c',\n '#4b63d9',\n '#0058a8',\n '#285ec1',\n '#00508f',\n ],\n tones: {\n positive: '#5cb327',\n warning: '#e0a800',\n negative: '#fe4242',\n critical: '#991b1b',\n neutral: dark ? '#4b4b5c' : '#c4c9d4',\n } satisfies Record<ChartTone, string>,\n text: dark ? '#d1d5db' : '#4b5563',\n tick: dark ? '#9ca3af' : '#6b7280',\n grid: dark ? '#374151' : '#f3f4f6',\n surface: dark ? '#1f2937' : '#ffffff',\n })\n\n const readColors = () => {\n if (!supportsColorRoles()) {\n return fallbackColors(!!props.isDark)\n }\n const expressions = [...CATEGORICAL, ...Object.values(TONES), ...INK]\n const hex = resolveCssColorsIn(root.value!, expressions).map(hexString)\n const categorical = hex.slice(0, CATEGORICAL.length)\n const tones = Object.fromEntries(\n Object.keys(TONES).map((tone, i) => [\n tone,\n hex[CATEGORICAL.length + i],\n ]),\n ) as Record<ChartTone, string>\n const [text, tick, grid, surface] = hex.slice(-INK.length)\n return { categorical, tones, text, tick, grid, surface }\n }\n\n const configuration = (): ChartConfiguration => {\n const { chart } = props\n const colors = readColors()\n const font = {\n family: getComputedStyle(root.value!).fontFamily,\n size: 11,\n }\n const format = chartValueFormatter(locale.value, chart.format)\n const reducedMotion = window.matchMedia(\n '(prefers-reduced-motion: reduce)',\n ).matches\n const round = isRoundChart(chart.type)\n let untoned = 0\n const datasets = chart.series.map((series) => {\n if (round) {\n return {\n label: series.name,\n data: series.values,\n backgroundColor: chart.categories.map(\n (_, i) =>\n colors.categorical[i % colors.categorical.length],\n ),\n borderColor: colors.surface,\n borderWidth: 2,\n }\n }\n const color = series.tone\n ? colors.tones[series.tone]\n : colors.categorical[untoned++ % colors.categorical.length]\n return chart.type === 'line'\n ? {\n label: series.name,\n data: series.values,\n borderColor: color,\n backgroundColor: color,\n borderWidth: 2,\n pointRadius: 3,\n // Smooth without overshooting a value\n cubicInterpolationMode: 'monotone',\n // A missing value stays a gap, not a guess\n spanGaps: false,\n }\n : {\n label: series.name,\n data: series.values,\n backgroundColor: color,\n borderRadius: 3,\n maxBarThickness: 48,\n }\n })\n const axisTitle = (text?: string) => ({\n display: !!text,\n text: text ?? '',\n color: colors.tick,\n font,\n })\n const valueAxis = {\n beginAtZero: true,\n stacked: !!chart.stacked,\n ticks: {\n color: colors.tick,\n font,\n callback: (value: string | number) => format(Number(value)),\n },\n grid: { color: colors.grid, drawTicks: false },\n border: { display: false },\n title: axisTitle(chart.valueLabel),\n }\n const categoryAxis = {\n stacked: !!chart.stacked,\n ticks: { color: colors.tick, font, autoSkip: true },\n grid: { display: false },\n border: { display: false },\n title: axisTitle(chart.categoryLabel),\n }\n const horizontal = chart.type === 'bar' && !!chart.horizontal\n return {\n type: chart.type,\n data: { labels: chart.categories, datasets },\n options: {\n responsive: true,\n maintainAspectRatio: false,\n animation: reducedMotion ? false : { duration: 400 },\n indexAxis: horizontal ? 'y' : 'x',\n // The hole of a doughnut, and the slices drawn whole in a pie\n ...(round && {\n cutout: chart.type === 'doughnut' ? '55%' : 0,\n }),\n scales: round\n ? {}\n : horizontal\n ? { x: valueAxis, y: categoryAxis }\n : { x: categoryAxis, y: valueAxis },\n plugins: {\n legend: {\n display: round || chart.series.length > 1,\n position: 'bottom',\n labels: {\n color: colors.text,\n font,\n boxWidth: 10,\n boxHeight: 10,\n useBorderRadius: true,\n borderRadius: 2,\n },\n },\n tooltip: {\n callbacks: {\n label: (item: TooltipItem<typeof chart.type>) => {\n const value = Number(item.raw)\n if (!round) {\n return `${item.dataset.label}: ${format(value)}`\n }\n const total = (item.dataset.data as number[])\n .filter((v) => typeof v === 'number')\n .reduce((sum, v) => sum + v, 0)\n const share = total\n ? new Intl.NumberFormat(locale.value, {\n style: 'percent',\n maximumFractionDigits: 1,\n }).format(value / total)\n : ''\n return `${item.label}: ${format(value)}${share ? ` (${share})` : ''}`\n },\n },\n },\n },\n },\n } as ChartConfiguration\n }\n\n const draw = async () => {\n await nextTick()\n if (!canvas.value || !root.value) {\n return\n }\n instance?.destroy()\n instance = new ChartJS(canvas.value, configuration())\n }\n\n /**\n * The chart as a PNG on the surface it is drawn on: the canvas itself is\n * transparent, and a transparent PNG pasted on a dark slide loses its\n * text.\n */\n const toBlob = async (): Promise<Blob | null> => {\n if (!canvas.value || !root.value) {\n return null\n }\n const copy = document.createElement('canvas')\n copy.width = canvas.value.width\n copy.height = canvas.value.height\n const context = copy.getContext('2d')\n if (!context) {\n return null\n }\n context.fillStyle = readColors().surface\n context.fillRect(0, 0, copy.width, copy.height)\n context.drawImage(canvas.value, 0, 0)\n return new Promise((resolve) => copy.toBlob(resolve, 'image/png'))\n }\n\n defineExpose({ toBlob })\n\n onMounted(draw)\n // Redrawn when the numbers or the theme change, not when the parent hands\n // over the same chart as a new object (each update of the message parses\n // the input again): that replayed the animation. The colors are read\n // again with the theme classes.\n watch(() => `${props.isDark}|${JSON.stringify(props.chart)}`, draw)\n onBeforeUnmount(() => {\n instance?.destroy()\n instance = undefined\n })\n</script>\n\n<template>\n <div ref=\"root\" class=\"pk-chart\">\n <canvas\n ref=\"canvas\"\n role=\"img\"\n :aria-label=\"\n chart.title || chart.series.map((s) => s.name).join(', ')\n \" />\n </div>\n</template>\n\n<style lang=\"scss\">\n .pk-chart {\n position: relative;\n width: 100%;\n height: 100%;\n min-height: 0;\n }\n</style>\n"],"mappings":";;;;;AAIA,IAAIO,GAQSC,UACT,OAAO,MAAQ,OACf,IAAI,SAAS,SAAS,+BAA+B,KACrD,IAAI,SAAS,SAAS,mCAAmC,GAuBvDC,KAAW,MACb,KAAK,MAAM,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,OAAOC,CAAK,CAAC,CAAC,IAAI,GAAG;AAG5D,SAASC,EAAU,GAAoC;CACnD,IAAMC,IAAQC,EAAS,MACnB,iDACJ;CAIA,OAHKD,IAGE;EACH,GAAGH,EAAQG,EAAM,EAAE;EACnB,GAAGH,EAAQG,EAAM,EAAE;EACnB,GAAGH,EAAQG,EAAM,EAAE;EACnB,GAAGA,EAAM,OAAO,KAAA,IAAY,IAAI,OAAOA,EAAM,EAAE;CACnD,IAPW;AAQf;AAGA,SAASE,EAAc,GAA6B;CAIhD,IAHA,MAAU,SACL,cAAc,QAAQ,CAAC,CACvB,WAAW,MAAM,EAAE,oBAAoB,GAAK,CAAC,GAC9C,CAACP,GACD,OAAO;EAAE,GAAG;EAAG,GAAG;EAAG,GAAG;EAAG,GAAG;CAAE;CAIpC,AAFAA,EAAM,UAAU,GAAG,GAAG,GAAG,CAAC,GAC1B,EAAM,YAAYM,GAClBN,EAAM,SAAS,GAAG,GAAG,GAAG,CAAC;CACzB,IAAM,CAACQ,GAAGC,GAAGC,GAAGC,KAAKX,EAAM,aAAa,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC;CACpD,OAAO;EAAE;EAAG;EAAG;EAAG,GAAG,KAAK,MAAOW,IAAI,MAAO,GAAI,IAAI;CAAK;AAC7D;AAgCA,SAASC,EAAU,GAAoB,GA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UD,EAAK,WAAW,IAAI;GAOpC,OANKC,KAGL,EAAQ,YAAYnC,EAAW,CAAC,CAAC,SACjCmC,EAAQ,SAAS,GAAG,GAAGD,EAAK,OAAOA,EAAK,MAAM,GAC9CC,EAAQ,UAAU9C,EAAO,OAAO,GAAG,CAAC,GAC7B,IAAI,SAAS,MAAY6C,EAAK,OAAOE,GAAS,WAAW,CAAC,KALtD;EAMf,EAEsB,CAAC,GAEvBC,EAAUN,CAAI,GAKdO,QAAY,GAAGtD,EAAM,OAAO,GAAG,KAAK,UAAUA,EAAM,KAAK,KAAK+C,CAAI,GAClEQ,QAAsB;GAElB,AADAjD,GAAU,QAAQ,GAClB,IAAW,KAAA;EACf,CAAC,I,UAID/C,EAAA,GAAAC,EAOM,OAAA;GAPG,SAAA;GAAJ,KAAI2C;GAAO,OAAM;E,IAClB1C,EAKQ,UAAA;GAJA,SAAA;GAAJ,KAAI4C;GACJ,MAAK;GACJ,cAA6BJ,EAAA,MAAM,SAASA,EAAA,MAAM,OAAO,KAAK,MAAM0D,EAAE,IAAI,CAAA,CAAE,KAAI,IAAA"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { t as e } from "./VvButtonLocalized-C-vx25u4.js";
|
|
2
|
-
import { n as t, t as n } from "./PkStreamingMarkdown-
|
|
3
|
-
import { n as r } from "./useChatbotStore-
|
|
4
|
-
import { L as i, s as a } from "./utils-
|
|
5
|
-
import { t as ee } from "./PkChatbotViewConversations-
|
|
6
|
-
import { t as te } from "./PkChatbotViewChat-
|
|
2
|
+
import { n as t, t as n } from "./PkStreamingMarkdown-COQLmP8b.js";
|
|
3
|
+
import { n as r } from "./useChatbotStore-KXAltGz3.js";
|
|
4
|
+
import { L as i, s as a } from "./utils-Do3JWPJe.js";
|
|
5
|
+
import { t as ee } from "./PkChatbotViewConversations-rXGl7NKA.js";
|
|
6
|
+
import { t as te } from "./PkChatbotViewChat-BBCxj4Qz.js";
|
|
7
7
|
import { t as o } from "./useShortUrlResolver-KJDk7QLj.js";
|
|
8
|
-
import { t as ne } from "./PkChatbotViewFiles-
|
|
8
|
+
import { t as ne } from "./PkChatbotViewFiles-CsL8OhcA.js";
|
|
9
9
|
import { t as re } from "./useLocalizedString-Dmn92nix.js";
|
|
10
10
|
import { t as ie } from "./PkAvatar-DwtZWSW4.js";
|
|
11
11
|
import { t as s } from "./chatbotProfileContext-b-nve-mR.js";
|
|
12
|
-
import { t as ae } from "./PkChatbotViewProfile-
|
|
12
|
+
import { t as ae } from "./PkChatbotViewProfile-CFqxCK2f.js";
|
|
13
13
|
import { VvAlert as oe, VvButtonGroup as se, VvDropdown as ce, VvDropdownAction as le, VvIcon as ue } from "@volverjs/ui-vue/components";
|
|
14
14
|
import { Fragment as de, computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createSlots as p, createTextVNode as m, createVNode as h, defineComponent as g, guardReactiveProps as _, inject as fe, mergeModels as v, mergeProps as pe, normalizeClass as me, normalizeProps as y, normalizeStyle as b, openBlock as x, renderList as S, renderSlot as C, toDisplayString as w, toRef as he, unref as T, useModel as ge, useSlots as _e, useTemplateRef as ve, watch as E, watchEffect as ye, withCtx as D } from "vue";
|
|
15
15
|
import { useI18n as be } from "vue-i18n";
|
|
@@ -295,4 +295,4 @@ var Ce = { class: "pk-chatbot__header-start" }, we = ["title"], Te = { key: 1 },
|
|
|
295
295
|
});
|
|
296
296
|
export { O as t };
|
|
297
297
|
|
|
298
|
-
//# sourceMappingURL=PkChatbot-
|
|
298
|
+
//# sourceMappingURL=PkChatbot-BIQh81cA.js.map
|