drizzle-cube 0.4.35 → 0.4.37
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/adapters/express/index.cjs +1 -1
- package/dist/adapters/express/index.js +3 -3
- package/dist/adapters/fastify/index.cjs +1 -1
- package/dist/adapters/fastify/index.js +3 -3
- package/dist/adapters/{handler-DzUX7CBs.cjs → handler-dHHEEbG9.cjs} +1 -1
- package/dist/adapters/{handler-J55KQKe5.js → handler-fto6TSVn.js} +1 -1
- package/dist/adapters/hono/index.cjs +1 -1
- package/dist/adapters/hono/index.js +3 -3
- package/dist/adapters/{mcp-transport-Dmf2vbIb.cjs → mcp-transport-ro4OL4BW.cjs} +4 -4
- package/dist/adapters/{mcp-transport-Cdisv8il.js → mcp-transport-tB5a7Het.js} +71 -18
- package/dist/adapters/nextjs/index.cjs +1 -1
- package/dist/adapters/nextjs/index.js +3 -3
- package/dist/adapters/{utils-CDExg9uP.cjs → utils-2MwxiQ2o.cjs} +1 -1
- package/dist/adapters/{utils-DkKcpkx5.js → utils-_2o905Fi.js} +2 -1
- package/dist/adapters/utils.cjs +1 -1
- package/dist/adapters/utils.d.ts +2 -0
- package/dist/adapters/utils.js +1 -1
- package/dist/client/charts.js +3 -3
- package/dist/client/chunks/{DashboardEditModal-DsxYiMct.js → DashboardEditModal-B083DSGL.js} +7 -7
- package/dist/client/chunks/DashboardEditModal-B083DSGL.js.map +1 -0
- package/dist/client/chunks/{FieldSearchModal-CSzgVPdG.js → FieldSearchModal-BxQ5JhWz.js} +2 -2
- package/dist/client/chunks/{FieldSearchModal-CSzgVPdG.js.map → FieldSearchModal-BxQ5JhWz.js.map} +1 -1
- package/dist/client/chunks/{analysis-builder-CxXZDfFR.js → analysis-builder-BFb3zjl5.js} +1783 -2561
- package/dist/client/chunks/analysis-builder-BFb3zjl5.js.map +1 -0
- package/dist/client/chunks/{analysis-builder-shared-fwyLiZ48.js → analysis-builder-shared-BFzd2jx_.js} +1498 -716
- package/dist/client/chunks/analysis-builder-shared-BFzd2jx_.js.map +1 -0
- package/dist/client/chunks/{chart-data-table-CGG-_R93.js → chart-data-table-CW_qZDpt.js} +12 -2
- package/dist/client/chunks/chart-data-table-CW_qZDpt.js.map +1 -0
- package/dist/client/chunks/{chart-kpi-delta-D9eNhKR6.js → chart-kpi-delta-BPexzOe7.js} +2 -2
- package/dist/client/chunks/{chart-kpi-delta-D9eNhKR6.js.map → chart-kpi-delta-BPexzOe7.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-number-IJWReEix.js → chart-kpi-number-BBtGBtZL.js} +3 -3
- package/dist/client/chunks/{chart-kpi-number-IJWReEix.js.map → chart-kpi-number-BBtGBtZL.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-text-Dsr7nPmz.js → chart-kpi-text-BqHhmJEB.js} +2 -2
- package/dist/client/chunks/{chart-kpi-text-Dsr7nPmz.js.map → chart-kpi-text-BqHhmJEB.js.map} +1 -1
- package/dist/client/chunks/{charts-loader-DSdXpr7e.js → charts-loader-gZjOqZwG.js} +5 -5
- package/dist/client/chunks/{charts-loader-DSdXpr7e.js.map → charts-loader-gZjOqZwG.js.map} +1 -1
- package/dist/client/chunks/{schema-visualization-CBQrcxb8.js → schema-visualization-XLFzV_7p.js} +2 -2
- package/dist/client/chunks/{schema-visualization-CBQrcxb8.js.map → schema-visualization-XLFzV_7p.js.map} +1 -1
- package/dist/client/chunks/{useDebounce-BbYqb134.js → useDebounce-C_wstEud.js} +2 -2
- package/dist/client/chunks/{useDebounce-BbYqb134.js.map → useDebounce-C_wstEud.js.map} +1 -1
- package/dist/client/chunks/{useExplainAI-CbAR-1p5.js → useExplainAI-C9ytXRIC.js} +21 -18
- package/dist/client/chunks/{useExplainAI-CbAR-1p5.js.map → useExplainAI-C9ytXRIC.js.map} +1 -1
- package/dist/client/chunks/{utils-BxLeWUeg.js → utils-3FNmeZJR.js} +2 -2
- package/dist/client/chunks/{utils-BxLeWUeg.js.map → utils-3FNmeZJR.js.map} +1 -1
- package/dist/client/chunks/{vendor-QBbbDL5y.js → vendor-BPRWulB7.js} +2 -2
- package/dist/client/chunks/{vendor-QBbbDL5y.js.map → vendor-BPRWulB7.js.map} +1 -1
- package/dist/client/components/AIAssistant/utils.d.ts +1 -1
- package/dist/client/components/DataBrowser/DataBrowserSidebar.d.ts +16 -0
- package/dist/client/components/DataBrowser/DataBrowserTable.d.ts +16 -0
- package/dist/client/components/DataBrowser/DataBrowserToolbar.d.ts +22 -0
- package/dist/client/components/DataBrowser/index.d.ts +28 -0
- package/dist/client/components.js +3 -3
- package/dist/client/hooks/useDataBrowser.d.ts +67 -0
- package/dist/client/hooks.js +3 -3
- package/dist/client/icons/types.d.ts +1 -0
- package/dist/client/icons.js +1 -1
- package/dist/client/index.d.ts +3 -0
- package/dist/client/index.js +774 -192
- package/dist/client/index.js.map +1 -1
- package/dist/client/providers/CubeApiProvider.d.ts +1 -0
- package/dist/client/providers.js +1 -1
- package/dist/client/stores/dataBrowserStore.d.ts +34 -0
- package/dist/client/styles.css +1 -1
- package/dist/client/types.d.ts +2 -0
- package/dist/client/utils.js +3 -3
- package/dist/client-bundle-stats.html +1 -1
- package/dist/server/index.cjs +3 -3
- package/dist/server/index.d.ts +18 -0
- package/dist/server/index.js +69 -16
- package/package.json +1 -1
- package/dist/client/chunks/DashboardEditModal-DsxYiMct.js.map +0 -1
- package/dist/client/chunks/analysis-builder-CxXZDfFR.js.map +0 -1
- package/dist/client/chunks/analysis-builder-shared-fwyLiZ48.js.map +0 -1
- package/dist/client/chunks/chart-data-table-CGG-_R93.js.map +0 -1
package/dist/client/index.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { a as e, n as t, o as n, r, s as i } from "./chunks/vendor-
|
|
2
|
-
import { A as a, C as o, D as s, E as c, O as l, S as u, _ as d, c as f, d as p, f as m, g as h, h as g, j as _, k as v, l as y, m as b, p as x, s as S, u as C, v as w, y as T } from "./chunks/chart-data-table-
|
|
3
|
-
import { _ as E, a as D, b as O, d as k, f as A, g as j, h as M, i as N, l as
|
|
4
|
-
import { a as
|
|
5
|
-
import { a as
|
|
6
|
-
import { n as
|
|
7
|
-
import { n as
|
|
8
|
-
import { A as
|
|
9
|
-
import { A as
|
|
10
|
-
import { u as
|
|
11
|
-
import { a as
|
|
12
|
-
import { A as
|
|
13
|
-
import { r as
|
|
14
|
-
import { A as
|
|
15
|
-
import { r as
|
|
16
|
-
import { t as
|
|
17
|
-
import { n as
|
|
18
|
-
import { n as
|
|
19
|
-
import { i as
|
|
20
|
-
import
|
|
1
|
+
import { a as e, n as t, o as n, r, s as i } from "./chunks/vendor-BPRWulB7.js";
|
|
2
|
+
import { A as a, C as o, D as s, E as c, O as l, S as u, _ as d, c as f, d as p, f as m, g as h, h as g, j as _, k as v, l as y, m as b, p as x, s as S, u as C, v as w, y as T } from "./chunks/chart-data-table-CW_qZDpt.js";
|
|
3
|
+
import { _ as E, a as D, b as O, d as k, f as A, g as j, h as M, i as N, l as ee, m as P, o as F, p as I, s as L, u as te, v as R } from "./chunks/useDebounce-C_wstEud.js";
|
|
4
|
+
import { a as z, i as B, n as ne, o as re, r as ie, t as ae } from "./chunks/useExplainAI-C9ytXRIC.js";
|
|
5
|
+
import { a as oe, c as se, i as ce, l as le, o as ue, r as de, s as fe } from "./chunks/chart-funnel-C9JRW79j.js";
|
|
6
|
+
import { n as pe, r as me } from "./chunks/chart-sankey-8nRYnupt.js";
|
|
7
|
+
import { n as he, t as ge } from "./chunks/providers-DX3Vw5kc.js";
|
|
8
|
+
import { A as _e, _ as ve, c as ye, d as be, f as xe, g as Se, h as Ce, l as we, m as Te, p as Ee, u as De } from "./chunks/chart-activity-grid-wR2Twpo7.js";
|
|
9
|
+
import { A as Oe, C as ke, D as Ae, E as je, M as Me, N as Ne, O as Pe, S as Fe, T as Ie, _ as Le, a as Re, b as ze, c as Be, d as Ve, f as He, g as Ue, h as We, i as Ge, j as Ke, k as qe, l as Je, m as Ye, n as Xe, o as Ze, p as Qe, r as $e, s as et, t as tt, u as nt, v as rt, w as it, x as at, y as ot } from "./chunks/DashboardEditModal-B083DSGL.js";
|
|
10
|
+
import { u as V } from "./chunks/chart-area-e9ysnatQ.js";
|
|
11
|
+
import { a as st, i as ct, n as lt, o as ut, r as dt, s as ft, t as pt } from "./chunks/charts-loader-gZjOqZwG.js";
|
|
12
|
+
import { A as mt, C as ht, D as gt, E as _t, F as vt, I as yt, L as bt, M as xt, N as St, O as Ct, P as wt, R as Tt, S as Et, T as Dt, h as Ot, j as kt, k as At, p as jt, r as Mt, t as Nt, w as Pt } from "./chunks/FieldSearchModal-BxQ5JhWz.js";
|
|
13
|
+
import { r as Ft } from "./chunks/syntaxHighlighting-BLl0ch4A.js";
|
|
14
|
+
import { A as It, D as Lt, E as Rt, F as zt, I as Bt, M as Vt, O as Ht, P as Ut, S as Wt, T as Gt, _ as Kt, a as qt, b as Jt, c as Yt, d as Xt, f as Zt, g as Qt, h as $t, i as en, j as tn, k as nn, l as rn, n as an, o as on, p as sn, r as cn, s as ln, t as un, v as dn, w as fn, x as pn, y as mn } from "./chunks/analysis-builder-shared-BFzd2jx_.js";
|
|
15
|
+
import { r as hn } from "./chunks/chart-markdown-B2X4IwLO.js";
|
|
16
|
+
import { t as gn } from "./chunks/useNotebookLayout-BFZ_33Kb.js";
|
|
17
|
+
import { n as _n } from "./chunks/schema-visualization-XLFzV_7p.js";
|
|
18
|
+
import { n as vn } from "./chunks/chart-bubble-DvyG15UB.js";
|
|
19
|
+
import { i as yn, t as bn } from "./chunks/utils-3FNmeZJR.js";
|
|
20
|
+
import H, { createContext as xn, useCallback as U, useContext as Sn, useEffect as W, useMemo as G, useRef as K, useState as q } from "react";
|
|
21
21
|
import { Fragment as J, jsx as Y, jsxs as X } from "react/jsx-runtime";
|
|
22
22
|
//#region src/client/stores/notebookStore.tsx
|
|
23
|
-
var
|
|
23
|
+
var Cn = () => ({
|
|
24
24
|
blocks: [],
|
|
25
25
|
messages: [],
|
|
26
26
|
isStreaming: !1,
|
|
27
27
|
sessionId: null,
|
|
28
28
|
inputValue: ""
|
|
29
29
|
});
|
|
30
|
-
function
|
|
30
|
+
function wn(e, t) {
|
|
31
31
|
return {
|
|
32
32
|
addBlock: (t) => e((e) => ({ blocks: [...e.blocks, t] })),
|
|
33
33
|
removeBlock: (t) => e((e) => ({ blocks: e.blocks.filter((e) => e.id !== t) })),
|
|
@@ -91,38 +91,38 @@ function xn(e, t) {
|
|
|
91
91
|
blocks: t.blocks || [],
|
|
92
92
|
messages: t.messages || []
|
|
93
93
|
}),
|
|
94
|
-
reset: () => e(
|
|
94
|
+
reset: () => e(Cn())
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
|
-
function
|
|
98
|
-
let t =
|
|
97
|
+
function Tn() {
|
|
98
|
+
let t = Cn();
|
|
99
99
|
return i()(r(e((e, n) => ({
|
|
100
100
|
...t,
|
|
101
|
-
...
|
|
101
|
+
...wn(e, n)
|
|
102
102
|
})), { name: "NotebookStore" }));
|
|
103
103
|
}
|
|
104
|
-
var
|
|
105
|
-
function
|
|
104
|
+
var En = xn(null);
|
|
105
|
+
function Dn({ children: e, initialConfig: t }) {
|
|
106
106
|
let n = K(null);
|
|
107
107
|
if (!n.current) {
|
|
108
|
-
let e =
|
|
108
|
+
let e = Tn();
|
|
109
109
|
t && e.getState().load(t), n.current = e;
|
|
110
110
|
}
|
|
111
|
-
return /* @__PURE__ */ Y(
|
|
111
|
+
return /* @__PURE__ */ Y(En.Provider, {
|
|
112
112
|
value: n.current,
|
|
113
113
|
children: e
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
116
|
function Z(e) {
|
|
117
|
-
let t =
|
|
117
|
+
let t = Sn(En);
|
|
118
118
|
if (!t) throw Error("useNotebookStore must be used within NotebookStoreProvider");
|
|
119
119
|
return n(t, e);
|
|
120
120
|
}
|
|
121
|
-
var
|
|
121
|
+
var On = (e) => e.blocks, kn = (e) => e.messages, An = (e) => e.isStreaming, jn = (e) => e.sessionId, Mn = (e) => e.inputValue, Nn = (e) => ({
|
|
122
122
|
messages: e.messages,
|
|
123
123
|
isStreaming: e.isStreaming,
|
|
124
124
|
inputValue: e.inputValue
|
|
125
|
-
}),
|
|
125
|
+
}), Pn = (e) => ({
|
|
126
126
|
addMessage: e.addMessage,
|
|
127
127
|
appendToLastAssistantMessage: e.appendToLastAssistantMessage,
|
|
128
128
|
setLastAssistantError: e.setLastAssistantError,
|
|
@@ -131,17 +131,17 @@ var Tn = (e) => e.blocks, En = (e) => e.messages, Dn = (e) => e.isStreaming, On
|
|
|
131
131
|
setIsStreaming: e.setIsStreaming,
|
|
132
132
|
setInputValue: e.setInputValue,
|
|
133
133
|
setSessionId: e.setSessionId
|
|
134
|
-
}),
|
|
134
|
+
}), Fn = (e) => ({
|
|
135
135
|
addBlock: e.addBlock,
|
|
136
136
|
removeBlock: e.removeBlock,
|
|
137
137
|
moveBlock: e.moveBlock,
|
|
138
138
|
updateBlock: e.updateBlock
|
|
139
|
-
}),
|
|
139
|
+
}), In = {
|
|
140
140
|
width: "16px",
|
|
141
141
|
height: "16px",
|
|
142
142
|
color: "currentColor"
|
|
143
|
-
},
|
|
144
|
-
let [c, l] = q(null), u =
|
|
143
|
+
}, Ln = p("chevronUp"), Rn = p("chevronDown"), zn = p("edit"), Bn = p("delete"), Vn = H.memo(function({ block: e, colorPalette: t, onRemove: n, onMoveUp: r, onMoveDown: i, onEdit: a, isFirst: o, isLast: s }) {
|
|
144
|
+
let [c, l] = q(null), u = U((e) => {
|
|
145
145
|
l(e);
|
|
146
146
|
}, []);
|
|
147
147
|
return /* @__PURE__ */ X("div", {
|
|
@@ -153,7 +153,7 @@ var Tn = (e) => e.blocks, En = (e) => e.messages, Dn = (e) => e.isStreaming, On
|
|
|
153
153
|
children: [/* @__PURE__ */ Y("h3", {
|
|
154
154
|
className: "dc:font-semibold dc:text-sm text-dc-text dc:truncate",
|
|
155
155
|
children: e.title || "Untitled"
|
|
156
|
-
}), c && /* @__PURE__ */ Y(
|
|
156
|
+
}), c && /* @__PURE__ */ Y(it, {
|
|
157
157
|
chartConfig: c.chartConfig,
|
|
158
158
|
displayConfig: c.displayConfig,
|
|
159
159
|
queryObject: c.queryObject,
|
|
@@ -168,31 +168,31 @@ var Tn = (e) => e.blocks, En = (e) => e.messages, Dn = (e) => e.isStreaming, On
|
|
|
168
168
|
onClick: () => r(e.id),
|
|
169
169
|
className: "dc:p-1 dc:bg-transparent dc:border-none dc:rounded-sm text-dc-text-secondary dc:cursor-pointer dc:hover:bg-dc-surface-hover dc:transition-colors",
|
|
170
170
|
title: "Move up",
|
|
171
|
-
children: /* @__PURE__ */ Y(
|
|
171
|
+
children: /* @__PURE__ */ Y(Ln, { style: In })
|
|
172
172
|
}),
|
|
173
173
|
!s && /* @__PURE__ */ Y("button", {
|
|
174
174
|
onClick: () => i(e.id),
|
|
175
175
|
className: "dc:p-1 dc:bg-transparent dc:border-none dc:rounded-sm text-dc-text-secondary dc:cursor-pointer dc:hover:bg-dc-surface-hover dc:transition-colors",
|
|
176
176
|
title: "Move down",
|
|
177
|
-
children: /* @__PURE__ */ Y(
|
|
177
|
+
children: /* @__PURE__ */ Y(Rn, { style: In })
|
|
178
178
|
}),
|
|
179
179
|
/* @__PURE__ */ Y("button", {
|
|
180
180
|
onClick: () => a(e),
|
|
181
181
|
className: "dc:p-1 dc:bg-transparent dc:border-none dc:rounded-sm text-dc-text-secondary dc:cursor-pointer dc:hover:bg-dc-surface-hover dc:transition-colors",
|
|
182
182
|
title: "Edit visualization",
|
|
183
|
-
children: /* @__PURE__ */ Y(
|
|
183
|
+
children: /* @__PURE__ */ Y(zn, { style: In })
|
|
184
184
|
}),
|
|
185
185
|
/* @__PURE__ */ Y("button", {
|
|
186
186
|
onClick: () => n(e.id),
|
|
187
187
|
className: "dc:p-1 dc:mr-0.5 dc:bg-transparent dc:border-none dc:rounded-sm dc:cursor-pointer dc:hover:bg-dc-danger-bg text-dc-danger dc:transition-colors",
|
|
188
188
|
title: "Remove",
|
|
189
|
-
children: /* @__PURE__ */ Y(
|
|
189
|
+
children: /* @__PURE__ */ Y(Bn, { style: In })
|
|
190
190
|
})
|
|
191
191
|
]
|
|
192
192
|
})]
|
|
193
193
|
}), /* @__PURE__ */ Y("div", {
|
|
194
194
|
className: "dc:flex-1 dc:min-h-0",
|
|
195
|
-
children: /* @__PURE__ */ Y(
|
|
195
|
+
children: /* @__PURE__ */ Y(Ae, {
|
|
196
196
|
query: e.query,
|
|
197
197
|
chartType: e.chartType,
|
|
198
198
|
chartConfig: e.chartConfig,
|
|
@@ -204,12 +204,12 @@ var Tn = (e) => e.blocks, En = (e) => e.messages, Dn = (e) => e.isStreaming, On
|
|
|
204
204
|
})
|
|
205
205
|
})]
|
|
206
206
|
});
|
|
207
|
-
}),
|
|
207
|
+
}), Q = {
|
|
208
208
|
width: "16px",
|
|
209
209
|
height: "16px",
|
|
210
210
|
color: "currentColor"
|
|
211
|
-
},
|
|
212
|
-
function
|
|
211
|
+
}, Hn = p("documentText"), Un = p("chevronUp"), Wn = p("chevronDown"), Gn = p("delete");
|
|
212
|
+
function Kn({ children: e, ...t }) {
|
|
213
213
|
return /* @__PURE__ */ Y("div", {
|
|
214
214
|
className: "dc:overflow-x-auto dc:my-2",
|
|
215
215
|
children: /* @__PURE__ */ Y("table", {
|
|
@@ -218,7 +218,7 @@ function Hn({ children: e, ...t }) {
|
|
|
218
218
|
})
|
|
219
219
|
});
|
|
220
220
|
}
|
|
221
|
-
var
|
|
221
|
+
var qn = { overrides: {
|
|
222
222
|
h1: { props: { className: "dc:text-lg dc:font-bold text-dc-text dc:mb-2 dc:mt-3" } },
|
|
223
223
|
h2: { props: { className: "dc:text-base dc:font-semibold text-dc-text dc:mb-2 dc:mt-3" } },
|
|
224
224
|
h3: { props: { className: "dc:text-sm dc:font-semibold text-dc-text dc:mb-2 dc:mt-3" } },
|
|
@@ -237,21 +237,21 @@ var Un = { overrides: {
|
|
|
237
237
|
hr: { props: { className: "dc:my-3 border-dc-border" } },
|
|
238
238
|
blockquote: { props: { className: "dc:border-l-4 border-dc-accent dc:pl-3 dc:my-2 dc:italic text-dc-text-secondary dc:text-sm" } },
|
|
239
239
|
table: {
|
|
240
|
-
component:
|
|
240
|
+
component: Kn,
|
|
241
241
|
props: { className: "dc:w-full dc:border-collapse dc:text-sm" }
|
|
242
242
|
},
|
|
243
243
|
thead: { props: { className: "bg-dc-surface-secondary" } },
|
|
244
244
|
th: { props: { className: "dc:px-3 dc:py-2 dc:text-left dc:font-semibold dc:text-xs text-dc-text-secondary dc:uppercase dc:tracking-wider border-dc-border dc:border-b" } },
|
|
245
245
|
td: { props: { className: "dc:px-3 dc:py-2 dc:text-sm text-dc-text border-dc-border dc:border-b" } },
|
|
246
246
|
tr: { props: { className: "dc:hover:opacity-80" } }
|
|
247
|
-
} },
|
|
247
|
+
} }, Jn = H.memo(function({ block: e, onRemove: t, onMoveUp: n, onMoveDown: r, isFirst: i, isLast: a }) {
|
|
248
248
|
return /* @__PURE__ */ X("div", {
|
|
249
249
|
className: "dc:relative dc:mb-4 bg-dc-surface dc:border border-dc-border dc:rounded-lg dc:flex dc:flex-col",
|
|
250
250
|
children: [/* @__PURE__ */ X("div", {
|
|
251
251
|
className: "dc:flex dc:items-center dc:justify-between dc:px-3 dc:py-1.5 dc:border-b border-dc-border dc:shrink-0 bg-dc-surface-secondary dc:rounded-t-lg",
|
|
252
252
|
children: [/* @__PURE__ */ X("div", {
|
|
253
253
|
className: "dc:flex dc:items-center dc:gap-2 dc:flex-1 dc:min-w-0",
|
|
254
|
-
children: [/* @__PURE__ */ Y(
|
|
254
|
+
children: [/* @__PURE__ */ Y(Hn, { style: Q }), /* @__PURE__ */ Y("h3", {
|
|
255
255
|
className: "dc:font-semibold dc:text-sm text-dc-text dc:truncate",
|
|
256
256
|
children: e.title || "Markdown"
|
|
257
257
|
})]
|
|
@@ -262,38 +262,38 @@ var Un = { overrides: {
|
|
|
262
262
|
onClick: () => n(e.id),
|
|
263
263
|
className: "dc:p-1 dc:bg-transparent dc:border-none dc:rounded-sm text-dc-text-secondary dc:cursor-pointer dc:hover:bg-dc-surface-hover dc:transition-colors",
|
|
264
264
|
title: "Move up",
|
|
265
|
-
children: /* @__PURE__ */ Y(
|
|
265
|
+
children: /* @__PURE__ */ Y(Un, { style: Q })
|
|
266
266
|
}),
|
|
267
267
|
!a && /* @__PURE__ */ Y("button", {
|
|
268
268
|
onClick: () => r(e.id),
|
|
269
269
|
className: "dc:p-1 dc:bg-transparent dc:border-none dc:rounded-sm text-dc-text-secondary dc:cursor-pointer dc:hover:bg-dc-surface-hover dc:transition-colors",
|
|
270
270
|
title: "Move down",
|
|
271
|
-
children: /* @__PURE__ */ Y(
|
|
271
|
+
children: /* @__PURE__ */ Y(Wn, { style: Q })
|
|
272
272
|
}),
|
|
273
273
|
/* @__PURE__ */ Y("button", {
|
|
274
274
|
onClick: () => t(e.id),
|
|
275
275
|
className: "dc:p-1 dc:mr-0.5 dc:bg-transparent dc:border-none dc:rounded-sm dc:cursor-pointer dc:hover:bg-dc-danger-bg text-dc-danger dc:transition-colors",
|
|
276
276
|
title: "Remove",
|
|
277
|
-
children: /* @__PURE__ */ Y(
|
|
277
|
+
children: /* @__PURE__ */ Y(Gn, { style: Q })
|
|
278
278
|
})
|
|
279
279
|
]
|
|
280
280
|
})]
|
|
281
281
|
}), /* @__PURE__ */ Y("div", {
|
|
282
282
|
className: "dc:p-4 dc:min-w-0 dc:overflow-hidden",
|
|
283
|
-
children: /* @__PURE__ */ Y(
|
|
284
|
-
options:
|
|
283
|
+
children: /* @__PURE__ */ Y(hn, {
|
|
284
|
+
options: qn,
|
|
285
285
|
children: e.content
|
|
286
286
|
})
|
|
287
287
|
})]
|
|
288
288
|
});
|
|
289
|
-
}),
|
|
290
|
-
let n = e ??
|
|
291
|
-
|
|
289
|
+
}), Yn = H.memo(function({ colorPalette: e }) {
|
|
290
|
+
let n = e ?? Ot(), r = Z(On), { removeBlock: i, moveBlock: a, updateBlock: o } = Z(t(Fn)), s = K(null), [c, l] = q(null), u = K(r.length);
|
|
291
|
+
W(() => {
|
|
292
292
|
r.length > u.current && s.current?.scrollIntoView({ behavior: "smooth" }), u.current = r.length;
|
|
293
293
|
}, [r.length]);
|
|
294
|
-
let d =
|
|
294
|
+
let d = U((e) => i(e), [i]), f = U((e) => a(e, "up"), [a]), p = U((e) => a(e, "down"), [a]), m = U((e) => l(e), []), h = U((e) => {
|
|
295
295
|
if (!c) return;
|
|
296
|
-
let { analysisConfig: t } =
|
|
296
|
+
let { analysisConfig: t } = Et(e);
|
|
297
297
|
if (t) {
|
|
298
298
|
let n = t.charts[t.analysisType];
|
|
299
299
|
o(c.id, {
|
|
@@ -323,7 +323,7 @@ var Un = { overrides: {
|
|
|
323
323
|
children: [
|
|
324
324
|
r.map((e, t) => {
|
|
325
325
|
let i = t === 0, a = t === r.length - 1;
|
|
326
|
-
return e.type === "portlet" ? /* @__PURE__ */ Y(
|
|
326
|
+
return e.type === "portlet" ? /* @__PURE__ */ Y(Vn, {
|
|
327
327
|
block: e,
|
|
328
328
|
colorPalette: n,
|
|
329
329
|
onRemove: d,
|
|
@@ -332,7 +332,7 @@ var Un = { overrides: {
|
|
|
332
332
|
onEdit: m,
|
|
333
333
|
isFirst: i,
|
|
334
334
|
isLast: a
|
|
335
|
-
}, e.id) : e.type === "markdown" ? /* @__PURE__ */ Y(
|
|
335
|
+
}, e.id) : e.type === "markdown" ? /* @__PURE__ */ Y(Jn, {
|
|
336
336
|
block: e,
|
|
337
337
|
onRemove: d,
|
|
338
338
|
onMoveUp: f,
|
|
@@ -342,7 +342,7 @@ var Un = { overrides: {
|
|
|
342
342
|
}, e.id) : null;
|
|
343
343
|
}),
|
|
344
344
|
/* @__PURE__ */ Y("div", { ref: s }),
|
|
345
|
-
/* @__PURE__ */ Y(
|
|
345
|
+
/* @__PURE__ */ Y(Ze, {
|
|
346
346
|
isOpen: !!c,
|
|
347
347
|
onClose: () => l(null),
|
|
348
348
|
onSave: h,
|
|
@@ -367,7 +367,7 @@ var Un = { overrides: {
|
|
|
367
367
|
});
|
|
368
368
|
//#endregion
|
|
369
369
|
//#region src/client/hooks/useAgentChat.ts
|
|
370
|
-
function
|
|
370
|
+
function Xn(e) {
|
|
371
371
|
if (e.startsWith("{") || e.includes("\"type\":\"error\"")) try {
|
|
372
372
|
let t = JSON.parse(e.replace(/^Error:\s*/, ""));
|
|
373
373
|
return {
|
|
@@ -385,10 +385,10 @@ function Kn(e) {
|
|
|
385
385
|
}
|
|
386
386
|
return e;
|
|
387
387
|
}
|
|
388
|
-
function
|
|
388
|
+
function Zn(e) {
|
|
389
389
|
let { agentEndpoint: t, agentApiKey: n, agentProvider: r, agentModel: i, agentProviderEndpoint: a } = e, { cubeApi: o } = v(), s = K(null), [c, l] = q(!1), u = K(e);
|
|
390
390
|
return u.current = e, {
|
|
391
|
-
sendMessage:
|
|
391
|
+
sendMessage: U(async (e, c, d) => {
|
|
392
392
|
function f(e) {
|
|
393
393
|
let t = u.current;
|
|
394
394
|
switch (e.type) {
|
|
@@ -475,7 +475,7 @@ function qn(e) {
|
|
|
475
475
|
} catch (e) {
|
|
476
476
|
if (e.name !== "AbortError") {
|
|
477
477
|
let t = e instanceof Error ? e.message : "Stream failed";
|
|
478
|
-
u.current.onError(
|
|
478
|
+
u.current.onError(Xn(t));
|
|
479
479
|
}
|
|
480
480
|
} finally {
|
|
481
481
|
l(!1), s.current = null;
|
|
@@ -489,14 +489,14 @@ function qn(e) {
|
|
|
489
489
|
a
|
|
490
490
|
]),
|
|
491
491
|
isStreaming: c,
|
|
492
|
-
abort:
|
|
492
|
+
abort: U(() => {
|
|
493
493
|
s.current && (s.current.abort(), s.current = null, l(!1));
|
|
494
494
|
}, [])
|
|
495
495
|
};
|
|
496
496
|
}
|
|
497
497
|
//#endregion
|
|
498
498
|
//#region src/client/components/AgenticNotebook/ChatMessage.tsx
|
|
499
|
-
function
|
|
499
|
+
function Qn(e) {
|
|
500
500
|
let t = [], n = e, r = 0;
|
|
501
501
|
for (; n;) {
|
|
502
502
|
let e = n.match(/^(.*?)`([^`]+)`(.*)$/);
|
|
@@ -522,15 +522,15 @@ function Jn(e) {
|
|
|
522
522
|
}
|
|
523
523
|
return t;
|
|
524
524
|
}
|
|
525
|
-
var
|
|
525
|
+
var $n = {
|
|
526
526
|
discover_cubes: "Discovering cubes",
|
|
527
527
|
get_cube_metadata: "Reading metadata",
|
|
528
528
|
execute_query: "Executing query",
|
|
529
529
|
add_portlet: "Adding visualization",
|
|
530
530
|
add_markdown: "Adding explanation"
|
|
531
531
|
};
|
|
532
|
-
function
|
|
533
|
-
let [n, r] = q(!1), i =
|
|
532
|
+
function er({ toolCall: e, loadingComponent: t }) {
|
|
533
|
+
let [n, r] = q(!1), i = $n[e.name] || e.name, a = e.status === "running";
|
|
534
534
|
return /* @__PURE__ */ X("div", {
|
|
535
535
|
className: "dc:my-1 dc:text-xs",
|
|
536
536
|
children: [/* @__PURE__ */ X("button", {
|
|
@@ -540,7 +540,7 @@ function Xn({ toolCall: e, loadingComponent: t }) {
|
|
|
540
540
|
a ? t ? /* @__PURE__ */ Y("span", {
|
|
541
541
|
className: "dc:inline-flex dc:items-center dc:justify-center dc:h-3 dc:w-3",
|
|
542
542
|
children: t
|
|
543
|
-
}) : /* @__PURE__ */ Y(
|
|
543
|
+
}) : /* @__PURE__ */ Y(V, { size: "xs" }) : /* @__PURE__ */ Y("span", {
|
|
544
544
|
className: "dc:text-xs",
|
|
545
545
|
children: e.status === "error" ? "✗" : "✓"
|
|
546
546
|
}),
|
|
@@ -556,17 +556,17 @@ function Xn({ toolCall: e, loadingComponent: t }) {
|
|
|
556
556
|
})]
|
|
557
557
|
});
|
|
558
558
|
}
|
|
559
|
-
var
|
|
559
|
+
var tr = { animation: "dc-msg-in 100ms ease-out" }, nr = H.memo(function({ message: e, loadingComponent: t }) {
|
|
560
560
|
let n = e.role === "user", r = !!e.content?.trim(), i = !!e.error, a = e.toolCalls && e.toolCalls.length > 0;
|
|
561
561
|
return !n && !r && !i && !a ? null : /* @__PURE__ */ Y("div", {
|
|
562
562
|
className: `dc:flex dc:mb-3 ${n ? "dc:justify-end" : "dc:justify-start"}`,
|
|
563
|
-
style:
|
|
563
|
+
style: tr,
|
|
564
564
|
children: /* @__PURE__ */ X("div", {
|
|
565
565
|
className: `dc:max-w-[85%] dc:rounded-lg dc:px-3 dc:py-2 dc:text-sm ${n ? "bg-dc-accent text-dc-accent-text dc:rounded-br-sm" : i && !r ? "bg-dc-warning-bg text-dc-text dc:rounded-bl-sm" : "bg-dc-surface-secondary text-dc-text dc:rounded-bl-sm"}`,
|
|
566
566
|
children: [
|
|
567
567
|
r && /* @__PURE__ */ Y("div", {
|
|
568
568
|
className: "dc:whitespace-pre-wrap dc:break-words",
|
|
569
|
-
children: n ? e.content :
|
|
569
|
+
children: n ? e.content : Qn(e.content)
|
|
570
570
|
}),
|
|
571
571
|
i && /* @__PURE__ */ X("div", {
|
|
572
572
|
className: `dc:flex dc:items-start dc:gap-2 ${r ? "dc:mt-2 dc:pt-2 dc:border-t dc:border-current dc:border-opacity-10" : ""}`,
|
|
@@ -580,7 +580,7 @@ var Zn = { animation: "dc-msg-in 100ms ease-out" }, Qn = U.memo(function({ messa
|
|
|
580
580
|
}),
|
|
581
581
|
a && /* @__PURE__ */ Y("div", {
|
|
582
582
|
className: r || i ? "dc:mt-1 dc:border-t dc:border-current dc:border-opacity-10 dc:pt-1" : "",
|
|
583
|
-
children: e.toolCalls.map((e, n) => /* @__PURE__ */ Y(
|
|
583
|
+
children: e.toolCalls.map((e, n) => /* @__PURE__ */ Y(er, {
|
|
584
584
|
toolCall: e,
|
|
585
585
|
loadingComponent: t
|
|
586
586
|
}, e.id || n))
|
|
@@ -588,9 +588,9 @@ var Zn = { animation: "dc-msg-in 100ms ease-out" }, Qn = U.memo(function({ messa
|
|
|
588
588
|
]
|
|
589
589
|
})
|
|
590
590
|
});
|
|
591
|
-
}),
|
|
591
|
+
}), rr = H.memo(function({ value: e, onChange: t, onSend: n, onStop: r, onContinue: i, isStreaming: a = !1, showContinue: o = !1, disabled: s = !1, placeholder: c = "Ask about your data..." }) {
|
|
592
592
|
let l = K(null);
|
|
593
|
-
return
|
|
593
|
+
return W(() => {
|
|
594
594
|
let e = l.current;
|
|
595
595
|
e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, 150)}px`);
|
|
596
596
|
}, [e]), /* @__PURE__ */ X("div", {
|
|
@@ -599,7 +599,7 @@ var Zn = { animation: "dc-msg-in 100ms ease-out" }, Qn = U.memo(function({ messa
|
|
|
599
599
|
ref: l,
|
|
600
600
|
value: e,
|
|
601
601
|
onChange: (e) => t(e.target.value),
|
|
602
|
-
onKeyDown:
|
|
602
|
+
onKeyDown: U((t) => {
|
|
603
603
|
t.key === "Enter" && !t.shiftKey && (t.preventDefault(), !s && e.trim() && n());
|
|
604
604
|
}, [
|
|
605
605
|
s,
|
|
@@ -627,14 +627,14 @@ var Zn = { animation: "dc-msg-in 100ms ease-out" }, Qn = U.memo(function({ messa
|
|
|
627
627
|
children: "Send"
|
|
628
628
|
})] })]
|
|
629
629
|
});
|
|
630
|
-
}),
|
|
631
|
-
let d = K(null), f = K(!1), [p, m] = q(null), [h, g] = q(/* @__PURE__ */ new Set()), [_, v] = q(!1), y = K(!1), { messages: b, isStreaming: x, inputValue: S } = Z(t(
|
|
632
|
-
|
|
633
|
-
let
|
|
634
|
-
|
|
635
|
-
let
|
|
636
|
-
|
|
637
|
-
let
|
|
630
|
+
}), ir = p("thumbUp"), ar = p("thumbDown"), or = H.memo(function({ agentEndpoint: e, agentApiKey: n, agentProvider: r, agentModel: i, agentProviderEndpoint: a, onClear: o, onDashboardSaved: s, onScore: c, loadingComponent: l, initialPrompt: u }) {
|
|
631
|
+
let d = K(null), f = K(!1), [p, m] = q(null), [h, g] = q(/* @__PURE__ */ new Set()), [_, v] = q(!1), y = K(!1), { messages: b, isStreaming: x, inputValue: S } = Z(t(Nn)), { addMessage: C, appendToLastAssistantMessage: w, setLastAssistantError: T, addToolCallToLastAssistant: E, updateLastToolCall: D, setIsStreaming: O, setInputValue: k, setSessionId: A } = Z(t(Pn)), j = Z((e) => e.sessionId), M = Z((e) => e.addBlock), N = Z((e) => e.reset), ee = Z((e) => e.blocks.filter((e) => e.type === "portlet").length), P = K(b);
|
|
632
|
+
P.current = b;
|
|
633
|
+
let F = K(x);
|
|
634
|
+
F.current = x;
|
|
635
|
+
let I = K(j);
|
|
636
|
+
I.current = j;
|
|
637
|
+
let L = U(() => {
|
|
638
638
|
y.current && (y.current = !1, C({
|
|
639
639
|
id: `msg-${Date.now()}`,
|
|
640
640
|
role: "assistant",
|
|
@@ -642,60 +642,60 @@ var Zn = { animation: "dc-msg-in 100ms ease-out" }, Qn = U.memo(function({ messa
|
|
|
642
642
|
toolCalls: [],
|
|
643
643
|
timestamp: Date.now()
|
|
644
644
|
}));
|
|
645
|
-
}, [C]),
|
|
646
|
-
|
|
647
|
-
b.length >
|
|
648
|
-
}, [b]),
|
|
645
|
+
}, [C]), te = K(b.length);
|
|
646
|
+
W(() => {
|
|
647
|
+
b.length > te.current && d.current?.scrollIntoView({ behavior: "smooth" }), te.current = b.length;
|
|
648
|
+
}, [b]), W(() => {
|
|
649
649
|
_ && d.current?.scrollIntoView({ behavior: "smooth" });
|
|
650
650
|
}, [_]);
|
|
651
|
-
let { sendMessage:
|
|
651
|
+
let { sendMessage: R, abort: z } = Zn({
|
|
652
652
|
agentEndpoint: e,
|
|
653
653
|
agentApiKey: n,
|
|
654
654
|
agentProvider: r,
|
|
655
655
|
agentModel: i,
|
|
656
656
|
agentProviderEndpoint: a,
|
|
657
|
-
onTextDelta:
|
|
658
|
-
v(!1),
|
|
659
|
-
}, [
|
|
660
|
-
onToolStart:
|
|
661
|
-
v(!1),
|
|
657
|
+
onTextDelta: U((e) => {
|
|
658
|
+
v(!1), L(), w(e);
|
|
659
|
+
}, [L, w]),
|
|
660
|
+
onToolStart: U((e, t, n) => {
|
|
661
|
+
v(!1), L(), E({
|
|
662
662
|
id: e,
|
|
663
663
|
name: t,
|
|
664
664
|
input: n,
|
|
665
665
|
status: "running"
|
|
666
666
|
});
|
|
667
|
-
}, [
|
|
668
|
-
onToolResult:
|
|
667
|
+
}, [L, E]),
|
|
668
|
+
onToolResult: U((e, t, n, r) => {
|
|
669
669
|
D({
|
|
670
670
|
id: e,
|
|
671
671
|
status: r ? "error" : "complete",
|
|
672
672
|
result: n
|
|
673
673
|
});
|
|
674
674
|
}, [D]),
|
|
675
|
-
onAddPortlet:
|
|
675
|
+
onAddPortlet: U((e) => {
|
|
676
676
|
M(e);
|
|
677
677
|
}, [M]),
|
|
678
|
-
onAddMarkdown:
|
|
678
|
+
onAddMarkdown: U((e) => {
|
|
679
679
|
M(e);
|
|
680
680
|
}, [M]),
|
|
681
681
|
onDashboardSaved: s,
|
|
682
|
-
onTurnComplete:
|
|
682
|
+
onTurnComplete: U(() => {
|
|
683
683
|
y.current = !0, v(!0);
|
|
684
684
|
}, []),
|
|
685
|
-
onDone:
|
|
685
|
+
onDone: U((e, t) => {
|
|
686
686
|
y.current = !1, A(e), O(!1), v(!1), t && m(t);
|
|
687
687
|
}, [A, O]),
|
|
688
|
-
onError:
|
|
689
|
-
v(!1),
|
|
688
|
+
onError: U((e) => {
|
|
689
|
+
v(!1), L(), T(e), O(!1);
|
|
690
690
|
}, [
|
|
691
|
-
|
|
691
|
+
L,
|
|
692
692
|
T,
|
|
693
693
|
O
|
|
694
694
|
])
|
|
695
|
-
}),
|
|
696
|
-
if (!e ||
|
|
695
|
+
}), B = U((e) => {
|
|
696
|
+
if (!e || F.current) return;
|
|
697
697
|
y.current = !1;
|
|
698
|
-
let t =
|
|
698
|
+
let t = P.current.map((e) => ({
|
|
699
699
|
role: e.role,
|
|
700
700
|
content: e.content,
|
|
701
701
|
...e.toolCalls && e.toolCalls.length > 0 ? { toolCalls: e.toolCalls } : {}
|
|
@@ -711,17 +711,17 @@ var Zn = { animation: "dc-msg-in 100ms ease-out" }, Qn = U.memo(function({ messa
|
|
|
711
711
|
content: "",
|
|
712
712
|
toolCalls: [],
|
|
713
713
|
timestamp: Date.now()
|
|
714
|
-
}), k(""), O(!0), v(!0),
|
|
714
|
+
}), k(""), O(!0), v(!0), R(e, I.current, t);
|
|
715
715
|
}, [
|
|
716
716
|
C,
|
|
717
717
|
k,
|
|
718
718
|
O,
|
|
719
|
-
|
|
719
|
+
R
|
|
720
720
|
]);
|
|
721
|
-
|
|
721
|
+
W(() => {
|
|
722
722
|
if (u && !f.current && b.length === 0) {
|
|
723
723
|
f.current = !0;
|
|
724
|
-
let e = setTimeout(() =>
|
|
724
|
+
let e = setTimeout(() => B(u), 100);
|
|
725
725
|
return () => {
|
|
726
726
|
clearTimeout(e), f.current = !1;
|
|
727
727
|
};
|
|
@@ -729,31 +729,31 @@ var Zn = { animation: "dc-msg-in 100ms ease-out" }, Qn = U.memo(function({ messa
|
|
|
729
729
|
}, [
|
|
730
730
|
u,
|
|
731
731
|
b.length,
|
|
732
|
-
|
|
732
|
+
B
|
|
733
733
|
]);
|
|
734
|
-
let
|
|
735
|
-
|
|
736
|
-
let
|
|
737
|
-
|
|
738
|
-
}, [
|
|
739
|
-
|
|
740
|
-
}, [
|
|
734
|
+
let ne = K(S);
|
|
735
|
+
ne.current = S;
|
|
736
|
+
let re = U(() => {
|
|
737
|
+
B(ne.current.trim());
|
|
738
|
+
}, [B]), ie = U(() => {
|
|
739
|
+
z(), O(!1);
|
|
740
|
+
}, [z, O]), ae = U(() => {
|
|
741
741
|
k("");
|
|
742
|
-
}, [k]),
|
|
743
|
-
|
|
742
|
+
}, [k]), oe = U(() => {
|
|
743
|
+
z(), O(!1), v(!1), N(), m(null), g(/* @__PURE__ */ new Set()), o?.();
|
|
744
744
|
}, [
|
|
745
|
-
|
|
745
|
+
z,
|
|
746
746
|
O,
|
|
747
747
|
N,
|
|
748
748
|
o
|
|
749
|
-
]),
|
|
750
|
-
|
|
751
|
-
}, [
|
|
749
|
+
]), se = U(() => {
|
|
750
|
+
B("Save the current notebook as a dashboard with a professional layout, section headers, and appropriate filters.");
|
|
751
|
+
}, [B]), ce = U((e) => {
|
|
752
752
|
!p || !c || (c({
|
|
753
753
|
traceId: p,
|
|
754
754
|
value: e
|
|
755
755
|
}), g((e) => new Set(e).add(p)));
|
|
756
|
-
}, [p, c]),
|
|
756
|
+
}, [p, c]), le = !!s && !x && ee > 0 && b.length > 0, ue = !!c && !x && p && b.length > 0 && !h.has(p), de = p ? h.has(p) : !1;
|
|
757
757
|
return /* @__PURE__ */ X("div", {
|
|
758
758
|
className: "dc:flex dc:flex-col dc:h-full bg-dc-surface",
|
|
759
759
|
children: [
|
|
@@ -764,13 +764,13 @@ var Zn = { animation: "dc-msg-in 100ms ease-out" }, Qn = U.memo(function({ messa
|
|
|
764
764
|
children: "AI Assistant"
|
|
765
765
|
}), /* @__PURE__ */ X("div", {
|
|
766
766
|
className: "dc:flex dc:items-center dc:gap-1",
|
|
767
|
-
children: [
|
|
768
|
-
onClick:
|
|
767
|
+
children: [le && /* @__PURE__ */ Y("button", {
|
|
768
|
+
onClick: se,
|
|
769
769
|
className: "dc:text-xs dc:px-2 dc:py-1 dc:rounded text-dc-accent dc:hover:opacity-80",
|
|
770
770
|
title: "Save notebook as a dashboard",
|
|
771
771
|
children: "Save as Dashboard"
|
|
772
772
|
}), b.length > 0 && /* @__PURE__ */ Y("button", {
|
|
773
|
-
onClick:
|
|
773
|
+
onClick: oe,
|
|
774
774
|
disabled: x,
|
|
775
775
|
className: "dc:text-xs dc:px-2 dc:py-1 dc:rounded text-dc-text-secondary dc:hover:opacity-80 dc:disabled:opacity-40",
|
|
776
776
|
title: "Clear notebook and chat",
|
|
@@ -781,14 +781,14 @@ var Zn = { animation: "dc-msg-in 100ms ease-out" }, Qn = U.memo(function({ messa
|
|
|
781
781
|
/* @__PURE__ */ X("div", {
|
|
782
782
|
className: "dc:flex-1 dc:overflow-y-auto dc:px-4 dc:py-3",
|
|
783
783
|
children: [
|
|
784
|
-
b.length === 0 ? /* @__PURE__ */ Y(
|
|
784
|
+
b.length === 0 ? /* @__PURE__ */ Y(cr, {}) : b.map((e) => /* @__PURE__ */ Y(nr, {
|
|
785
785
|
message: e,
|
|
786
786
|
loadingComponent: l
|
|
787
787
|
}, e.id)),
|
|
788
|
-
_ && /* @__PURE__ */ Y(
|
|
789
|
-
(
|
|
788
|
+
_ && /* @__PURE__ */ Y(sr, { loadingComponent: l }),
|
|
789
|
+
(ue || de) && /* @__PURE__ */ Y("div", {
|
|
790
790
|
className: "dc:flex dc:items-center dc:justify-center dc:gap-3 dc:py-4 dc:mt-2",
|
|
791
|
-
children:
|
|
791
|
+
children: de ? /* @__PURE__ */ Y("span", {
|
|
792
792
|
className: "dc:text-sm text-dc-text-secondary",
|
|
793
793
|
children: "Thanks for your feedback!"
|
|
794
794
|
}) : /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y("span", {
|
|
@@ -797,32 +797,32 @@ var Zn = { animation: "dc-msg-in 100ms ease-out" }, Qn = U.memo(function({ messa
|
|
|
797
797
|
}), /* @__PURE__ */ X("div", {
|
|
798
798
|
className: "dc:flex dc:items-center dc:gap-2",
|
|
799
799
|
children: [/* @__PURE__ */ X("button", {
|
|
800
|
-
onClick: () =>
|
|
800
|
+
onClick: () => ce(1),
|
|
801
801
|
className: "dc:flex dc:items-center dc:gap-1.5 dc:px-3 dc:py-1.5 dc:rounded-lg dc:text-sm dc:font-medium border-dc-border dc:border text-dc-success hover:bg-dc-success-bg dc:transition-colors bg-dc-surface dc:cursor-pointer",
|
|
802
|
-
children: [/* @__PURE__ */ Y(
|
|
802
|
+
children: [/* @__PURE__ */ Y(ir, { className: "dc:w-4 dc:h-4" }), "Yes"]
|
|
803
803
|
}), /* @__PURE__ */ X("button", {
|
|
804
|
-
onClick: () =>
|
|
804
|
+
onClick: () => ce(0),
|
|
805
805
|
className: "dc:flex dc:items-center dc:gap-1.5 dc:px-3 dc:py-1.5 dc:rounded-lg dc:text-sm dc:font-medium border-dc-border dc:border text-dc-error hover:bg-dc-danger-bg dc:transition-colors bg-dc-surface dc:cursor-pointer",
|
|
806
|
-
children: [/* @__PURE__ */ Y(
|
|
806
|
+
children: [/* @__PURE__ */ Y(ar, { className: "dc:w-4 dc:h-4" }), "No"]
|
|
807
807
|
})]
|
|
808
808
|
})] })
|
|
809
809
|
}),
|
|
810
810
|
/* @__PURE__ */ Y("div", { ref: d })
|
|
811
811
|
]
|
|
812
812
|
}),
|
|
813
|
-
/* @__PURE__ */ Y(
|
|
813
|
+
/* @__PURE__ */ Y(rr, {
|
|
814
814
|
value: S,
|
|
815
815
|
onChange: k,
|
|
816
|
-
onSend:
|
|
817
|
-
onStop:
|
|
818
|
-
onContinue:
|
|
816
|
+
onSend: re,
|
|
817
|
+
onStop: ie,
|
|
818
|
+
onContinue: ae,
|
|
819
819
|
isStreaming: x,
|
|
820
820
|
showContinue: !x && b.length > 0
|
|
821
821
|
})
|
|
822
822
|
]
|
|
823
823
|
});
|
|
824
824
|
});
|
|
825
|
-
function
|
|
825
|
+
function sr({ loadingComponent: e }) {
|
|
826
826
|
return /* @__PURE__ */ Y("div", {
|
|
827
827
|
className: "dc:flex dc:mb-3 dc:justify-start",
|
|
828
828
|
style: { animation: "dc-msg-in 100ms ease-out" },
|
|
@@ -831,11 +831,11 @@ function rr({ loadingComponent: e }) {
|
|
|
831
831
|
children: [e ? /* @__PURE__ */ Y("span", {
|
|
832
832
|
className: "dc:inline-flex dc:items-center dc:justify-center dc:h-4 dc:w-4",
|
|
833
833
|
children: e
|
|
834
|
-
}) : /* @__PURE__ */ Y(
|
|
834
|
+
}) : /* @__PURE__ */ Y(V, { size: "xs" }), /* @__PURE__ */ Y("span", { children: "Thinking..." })]
|
|
835
835
|
})
|
|
836
836
|
});
|
|
837
837
|
}
|
|
838
|
-
function
|
|
838
|
+
function cr() {
|
|
839
839
|
return /* @__PURE__ */ Y("div", {
|
|
840
840
|
className: "dc:flex dc:items-center dc:justify-center dc:h-full",
|
|
841
841
|
children: /* @__PURE__ */ X("div", {
|
|
@@ -863,7 +863,7 @@ function ir() {
|
|
|
863
863
|
}
|
|
864
864
|
//#endregion
|
|
865
865
|
//#region src/client/components/AgenticNotebook/index.tsx
|
|
866
|
-
function
|
|
866
|
+
function lr({ blocks: e, pulsingBlockId: t, nudge: n, onExpand: r }) {
|
|
867
867
|
let i = p("bookOpen"), a = p("documentText");
|
|
868
868
|
return /* @__PURE__ */ X("button", {
|
|
869
869
|
type: "button",
|
|
@@ -893,7 +893,7 @@ function ar({ blocks: e, pulsingBlockId: t, nudge: n, onExpand: r }) {
|
|
|
893
893
|
})]
|
|
894
894
|
});
|
|
895
895
|
}
|
|
896
|
-
function
|
|
896
|
+
function ur({ onExpand: e }) {
|
|
897
897
|
return /* @__PURE__ */ X("button", {
|
|
898
898
|
type: "button",
|
|
899
899
|
onClick: e,
|
|
@@ -906,13 +906,13 @@ function or({ onExpand: e }) {
|
|
|
906
906
|
})]
|
|
907
907
|
});
|
|
908
908
|
}
|
|
909
|
-
function
|
|
910
|
-
let [p, m] = q(60), h = K(null), g = K(!1), { containerRef: _, layoutMode: v } =
|
|
911
|
-
|
|
909
|
+
function dr({ agentEndpoint: e, agentApiKey: t, agentProvider: n, agentModel: r, agentProviderEndpoint: i, onSave: a, onDirtyStateChange: o, onDashboardSaved: s, onScore: c, colorPalette: l, loadingComponent: u, className: d, initialPrompt: f }) {
|
|
910
|
+
let [p, m] = q(60), h = K(null), g = K(!1), { containerRef: _, layoutMode: v } = gn(), [y, b] = q("chat"), [x, S] = q(null), [C, w] = q(!1), T = K(v), E = Z((e) => e.blocks), D = E.length, O = Z((e) => e.messages.length), k = Z((e) => e.isStreaming), A = Z((e) => e.save);
|
|
911
|
+
W(() => {
|
|
912
912
|
T.current === "narrow" && v === "wide" && b("chat"), T.current = v;
|
|
913
913
|
}, [v]);
|
|
914
914
|
let j = K(D);
|
|
915
|
-
|
|
915
|
+
W(() => {
|
|
916
916
|
if (v === "narrow" && y === "chat" && D > j.current) {
|
|
917
917
|
let e = E[E.length - 1];
|
|
918
918
|
if (e) {
|
|
@@ -929,7 +929,7 @@ function sr({ agentEndpoint: e, agentApiKey: t, agentProvider: n, agentModel: r,
|
|
|
929
929
|
y
|
|
930
930
|
]);
|
|
931
931
|
let M = K(!1);
|
|
932
|
-
|
|
932
|
+
W(() => {
|
|
933
933
|
if (k) M.current = !0;
|
|
934
934
|
else if (M.current && v === "narrow" && y === "chat" && D > 0) {
|
|
935
935
|
M.current = !1, w(!0);
|
|
@@ -942,34 +942,34 @@ function sr({ agentEndpoint: e, agentApiKey: t, agentProvider: n, agentModel: r,
|
|
|
942
942
|
y,
|
|
943
943
|
D
|
|
944
944
|
]);
|
|
945
|
-
let N =
|
|
945
|
+
let N = U((e) => {
|
|
946
946
|
_(e), h.current = e;
|
|
947
|
-
}, [_]),
|
|
947
|
+
}, [_]), ee = K({
|
|
948
948
|
blockCount: D,
|
|
949
949
|
msgCount: O
|
|
950
950
|
});
|
|
951
|
-
|
|
952
|
-
o?.(D !==
|
|
951
|
+
W(() => {
|
|
952
|
+
o?.(D !== ee.current.blockCount || O !== ee.current.msgCount);
|
|
953
953
|
}, [
|
|
954
954
|
D,
|
|
955
955
|
O,
|
|
956
956
|
o
|
|
957
957
|
]);
|
|
958
|
-
let
|
|
959
|
-
|
|
960
|
-
let
|
|
961
|
-
|
|
962
|
-
if ((D > 0 || O > 0) && (
|
|
958
|
+
let P = K(), F = K(!1), I = K(a);
|
|
959
|
+
I.current = a;
|
|
960
|
+
let L = K(D > 0 || O > 0);
|
|
961
|
+
W(() => {
|
|
962
|
+
if ((D > 0 || O > 0) && (L.current = !0), !(!I.current || !L.current)) {
|
|
963
963
|
if (k) {
|
|
964
|
-
|
|
964
|
+
F.current = !0, P.current && clearTimeout(P.current);
|
|
965
965
|
return;
|
|
966
966
|
}
|
|
967
|
-
return
|
|
968
|
-
|
|
967
|
+
return P.current && clearTimeout(P.current), P.current = setTimeout(() => {
|
|
968
|
+
F.current = !1;
|
|
969
969
|
let e = A();
|
|
970
|
-
|
|
970
|
+
I.current?.(e);
|
|
971
971
|
}, 1e3), () => {
|
|
972
|
-
|
|
972
|
+
P.current && clearTimeout(P.current);
|
|
973
973
|
};
|
|
974
974
|
}
|
|
975
975
|
}, [
|
|
@@ -977,19 +977,19 @@ function sr({ agentEndpoint: e, agentApiKey: t, agentProvider: n, agentModel: r,
|
|
|
977
977
|
O,
|
|
978
978
|
k,
|
|
979
979
|
A
|
|
980
|
-
]),
|
|
981
|
-
!k &&
|
|
982
|
-
|
|
980
|
+
]), W(() => {
|
|
981
|
+
!k && F.current && I.current && L.current && (P.current && clearTimeout(P.current), P.current = setTimeout(() => {
|
|
982
|
+
F.current = !1;
|
|
983
983
|
let e = A();
|
|
984
|
-
|
|
984
|
+
I.current?.(e);
|
|
985
985
|
}, 1e3));
|
|
986
986
|
}, [k, A]);
|
|
987
|
-
let
|
|
988
|
-
|
|
987
|
+
let te = U(() => {
|
|
988
|
+
I.current && (P.current && clearTimeout(P.current), I.current({
|
|
989
989
|
blocks: [],
|
|
990
990
|
messages: []
|
|
991
991
|
}));
|
|
992
|
-
}, []),
|
|
992
|
+
}, []), R = U((e) => {
|
|
993
993
|
e.preventDefault(), g.current = !0;
|
|
994
994
|
let t = (e) => {
|
|
995
995
|
if (!g.current || !h.current) return;
|
|
@@ -999,13 +999,13 @@ function sr({ agentEndpoint: e, agentApiKey: t, agentProvider: n, agentModel: r,
|
|
|
999
999
|
g.current = !1, document.removeEventListener("mousemove", t), document.removeEventListener("mouseup", n);
|
|
1000
1000
|
};
|
|
1001
1001
|
document.addEventListener("mousemove", t), document.addEventListener("mouseup", n);
|
|
1002
|
-
}, []),
|
|
1002
|
+
}, []), z = /* @__PURE__ */ Y(or, {
|
|
1003
1003
|
agentEndpoint: e,
|
|
1004
1004
|
agentApiKey: t,
|
|
1005
1005
|
agentProvider: n,
|
|
1006
1006
|
agentModel: r,
|
|
1007
1007
|
agentProviderEndpoint: i,
|
|
1008
|
-
onClear:
|
|
1008
|
+
onClear: te,
|
|
1009
1009
|
onDashboardSaved: s,
|
|
1010
1010
|
onScore: c,
|
|
1011
1011
|
loadingComponent: u,
|
|
@@ -1014,18 +1014,18 @@ function sr({ agentEndpoint: e, agentApiKey: t, agentProvider: n, agentModel: r,
|
|
|
1014
1014
|
return v === "narrow" ? /* @__PURE__ */ Y("div", {
|
|
1015
1015
|
ref: N,
|
|
1016
1016
|
className: `dc:flex dc:h-full dc:w-full dc:overflow-hidden bg-dc-surface-secondary ${d || ""}`,
|
|
1017
|
-
children: y === "chat" ? /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(
|
|
1017
|
+
children: y === "chat" ? /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(lr, {
|
|
1018
1018
|
blocks: E,
|
|
1019
1019
|
pulsingBlockId: x,
|
|
1020
1020
|
nudge: C,
|
|
1021
1021
|
onExpand: () => b("notebook")
|
|
1022
1022
|
}), /* @__PURE__ */ Y("div", {
|
|
1023
1023
|
className: "dc:h-full dc:overflow-hidden dc:flex-1",
|
|
1024
|
-
children:
|
|
1024
|
+
children: z
|
|
1025
1025
|
})] }) : /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y("div", {
|
|
1026
1026
|
className: "dc:h-full dc:overflow-hidden dc:flex-1",
|
|
1027
|
-
children: /* @__PURE__ */ Y(
|
|
1028
|
-
}), /* @__PURE__ */ Y(
|
|
1027
|
+
children: /* @__PURE__ */ Y(Yn, { colorPalette: l })
|
|
1028
|
+
}), /* @__PURE__ */ Y(ur, { onExpand: () => b("chat") })] })
|
|
1029
1029
|
}) : /* @__PURE__ */ X("div", {
|
|
1030
1030
|
ref: N,
|
|
1031
1031
|
className: `dc:flex dc:h-full dc:w-full dc:overflow-hidden bg-dc-surface-secondary ${d || ""}`,
|
|
@@ -1033,24 +1033,24 @@ function sr({ agentEndpoint: e, agentApiKey: t, agentProvider: n, agentModel: r,
|
|
|
1033
1033
|
/* @__PURE__ */ Y("div", {
|
|
1034
1034
|
className: "dc:h-full dc:overflow-hidden",
|
|
1035
1035
|
style: { width: `${p}%` },
|
|
1036
|
-
children: /* @__PURE__ */ Y(
|
|
1036
|
+
children: /* @__PURE__ */ Y(Yn, { colorPalette: l })
|
|
1037
1037
|
}),
|
|
1038
1038
|
/* @__PURE__ */ Y("div", {
|
|
1039
1039
|
className: "dc:w-1 dc:h-full dc:cursor-col-resize dc:flex-shrink-0 dc:transition-colors bg-dc-border dc:hover:bg-dc-accent",
|
|
1040
|
-
onMouseDown:
|
|
1040
|
+
onMouseDown: R
|
|
1041
1041
|
}),
|
|
1042
1042
|
/* @__PURE__ */ Y("div", {
|
|
1043
1043
|
className: "dc:h-full dc:overflow-hidden",
|
|
1044
1044
|
style: { width: `${100 - p}%` },
|
|
1045
|
-
children:
|
|
1045
|
+
children: z
|
|
1046
1046
|
})
|
|
1047
1047
|
]
|
|
1048
1048
|
});
|
|
1049
1049
|
}
|
|
1050
|
-
var
|
|
1051
|
-
return /* @__PURE__ */ Y(
|
|
1050
|
+
var fr = H.memo(function({ config: e, colorPalette: t, ...n }) {
|
|
1051
|
+
return /* @__PURE__ */ Y(Dn, {
|
|
1052
1052
|
initialConfig: e,
|
|
1053
|
-
children: /* @__PURE__ */ Y(
|
|
1053
|
+
children: /* @__PURE__ */ Y(dr, {
|
|
1054
1054
|
...n,
|
|
1055
1055
|
colorPalette: t
|
|
1056
1056
|
})
|
|
@@ -1058,18 +1058,600 @@ var cr = U.memo(function({ config: e, colorPalette: t, ...n }) {
|
|
|
1058
1058
|
});
|
|
1059
1059
|
//#endregion
|
|
1060
1060
|
//#region src/client/components/AnalyticsPage.tsx
|
|
1061
|
-
function
|
|
1061
|
+
function pr() {
|
|
1062
1062
|
return /* @__PURE__ */ Y("div", { children: "Analytics Page - Coming in Phase 4" });
|
|
1063
1063
|
}
|
|
1064
1064
|
//#endregion
|
|
1065
|
+
//#region src/client/stores/dataBrowserStore.tsx
|
|
1066
|
+
var mr = "dc-data-browser-column-widths";
|
|
1067
|
+
function hr(e) {
|
|
1068
|
+
try {
|
|
1069
|
+
let t = localStorage.getItem(mr);
|
|
1070
|
+
return t ? JSON.parse(t)[e] ?? {} : {};
|
|
1071
|
+
} catch {
|
|
1072
|
+
return {};
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
function gr(e, t) {
|
|
1076
|
+
try {
|
|
1077
|
+
let n = localStorage.getItem(mr), r = n ? JSON.parse(n) : {};
|
|
1078
|
+
r[e] = t, localStorage.setItem(mr, JSON.stringify(r));
|
|
1079
|
+
} catch {}
|
|
1080
|
+
}
|
|
1081
|
+
function _r(e = {}) {
|
|
1082
|
+
return i()((t, n) => ({
|
|
1083
|
+
selectedCube: e.defaultCube ?? null,
|
|
1084
|
+
visibleColumns: e.defaultColumns ?? [],
|
|
1085
|
+
sortColumn: null,
|
|
1086
|
+
sortDirection: "asc",
|
|
1087
|
+
page: 0,
|
|
1088
|
+
pageSize: e.defaultPageSize ?? 20,
|
|
1089
|
+
filters: [],
|
|
1090
|
+
showFilterBar: !1,
|
|
1091
|
+
showColumnPicker: !1,
|
|
1092
|
+
columnWidths: e.defaultCube ? hr(e.defaultCube) : {},
|
|
1093
|
+
selectCube: (e, n) => t({
|
|
1094
|
+
selectedCube: e,
|
|
1095
|
+
visibleColumns: n,
|
|
1096
|
+
sortColumn: null,
|
|
1097
|
+
sortDirection: "asc",
|
|
1098
|
+
page: 0,
|
|
1099
|
+
filters: [],
|
|
1100
|
+
showFilterBar: !1,
|
|
1101
|
+
columnWidths: hr(e)
|
|
1102
|
+
}),
|
|
1103
|
+
setVisibleColumns: (e) => t({
|
|
1104
|
+
visibleColumns: e,
|
|
1105
|
+
page: 0
|
|
1106
|
+
}),
|
|
1107
|
+
toggleColumn: (e) => t((t) => {
|
|
1108
|
+
let n = t.visibleColumns.indexOf(e);
|
|
1109
|
+
return {
|
|
1110
|
+
visibleColumns: n >= 0 ? t.visibleColumns.filter((t) => t !== e) : [...t.visibleColumns, e],
|
|
1111
|
+
page: 0,
|
|
1112
|
+
sortColumn: n >= 0 && t.sortColumn === e ? null : t.sortColumn
|
|
1113
|
+
};
|
|
1114
|
+
}),
|
|
1115
|
+
setSort: (e) => t((t) => t.sortColumn === e ? t.sortDirection === "asc" ? {
|
|
1116
|
+
sortDirection: "desc",
|
|
1117
|
+
page: 0
|
|
1118
|
+
} : {
|
|
1119
|
+
sortColumn: null,
|
|
1120
|
+
sortDirection: "asc",
|
|
1121
|
+
page: 0
|
|
1122
|
+
} : {
|
|
1123
|
+
sortColumn: e,
|
|
1124
|
+
sortDirection: "asc",
|
|
1125
|
+
page: 0
|
|
1126
|
+
}),
|
|
1127
|
+
clearSort: () => t({
|
|
1128
|
+
sortColumn: null,
|
|
1129
|
+
sortDirection: "asc",
|
|
1130
|
+
page: 0
|
|
1131
|
+
}),
|
|
1132
|
+
setPage: (e) => t({ page: e }),
|
|
1133
|
+
setPageSize: (e) => t({
|
|
1134
|
+
pageSize: e,
|
|
1135
|
+
page: 0
|
|
1136
|
+
}),
|
|
1137
|
+
setFilters: (e) => t({
|
|
1138
|
+
filters: e,
|
|
1139
|
+
page: 0
|
|
1140
|
+
}),
|
|
1141
|
+
toggleFilterBar: () => t((e) => ({ showFilterBar: !e.showFilterBar })),
|
|
1142
|
+
setShowColumnPicker: (e) => t({ showColumnPicker: e }),
|
|
1143
|
+
setColumnWidth: (e, n) => t((t) => {
|
|
1144
|
+
let r = {
|
|
1145
|
+
...t.columnWidths,
|
|
1146
|
+
[e]: n
|
|
1147
|
+
};
|
|
1148
|
+
return t.selectedCube && gr(t.selectedCube, r), { columnWidths: r };
|
|
1149
|
+
}),
|
|
1150
|
+
setColumnWidths: (e) => {
|
|
1151
|
+
let r = n().selectedCube;
|
|
1152
|
+
r && gr(r, e), t({ columnWidths: e });
|
|
1153
|
+
}
|
|
1154
|
+
}));
|
|
1155
|
+
}
|
|
1156
|
+
var vr = xn(null);
|
|
1157
|
+
function yr({ children: e, defaultPageSize: t, defaultCube: n, defaultColumns: r }) {
|
|
1158
|
+
let i = K(null);
|
|
1159
|
+
return i.current ||= _r({
|
|
1160
|
+
defaultPageSize: t,
|
|
1161
|
+
defaultCube: n,
|
|
1162
|
+
defaultColumns: r
|
|
1163
|
+
}), /* @__PURE__ */ Y(vr.Provider, {
|
|
1164
|
+
value: i.current,
|
|
1165
|
+
children: e
|
|
1166
|
+
});
|
|
1167
|
+
}
|
|
1168
|
+
function $(e) {
|
|
1169
|
+
let t = Sn(vr);
|
|
1170
|
+
if (!t) throw Error("useDataBrowserStore must be used within DataBrowserStoreProvider");
|
|
1171
|
+
return n(t, e);
|
|
1172
|
+
}
|
|
1173
|
+
//#endregion
|
|
1174
|
+
//#region src/client/hooks/useDataBrowser.ts
|
|
1175
|
+
function br(e, t) {
|
|
1176
|
+
if (!t) return !0;
|
|
1177
|
+
let [n, r] = e.split("."), i = t.cubes.find((e) => e.name === n);
|
|
1178
|
+
return i ? i.dimensions.some((e) => e.name === `${n}.${r}`) : !0;
|
|
1179
|
+
}
|
|
1180
|
+
function xr(e, t) {
|
|
1181
|
+
if (!t) return "string";
|
|
1182
|
+
let [n] = e.split("."), r = t.cubes.find((e) => e.name === n);
|
|
1183
|
+
if (!r) return "string";
|
|
1184
|
+
let i = r.dimensions.find((t) => t.name === e);
|
|
1185
|
+
if (i) return i.type;
|
|
1186
|
+
let a = r.measures.find((t) => t.name === e);
|
|
1187
|
+
return a ? a.type : "string";
|
|
1188
|
+
}
|
|
1189
|
+
function Sr(e, t) {
|
|
1190
|
+
if (!t) return {
|
|
1191
|
+
dimensions: [],
|
|
1192
|
+
measures: []
|
|
1193
|
+
};
|
|
1194
|
+
let n = t.cubes.find((t) => t.name === e);
|
|
1195
|
+
if (!n) return {
|
|
1196
|
+
dimensions: [],
|
|
1197
|
+
measures: []
|
|
1198
|
+
};
|
|
1199
|
+
let r = new Set([
|
|
1200
|
+
"sum",
|
|
1201
|
+
"avg",
|
|
1202
|
+
"min",
|
|
1203
|
+
"max",
|
|
1204
|
+
"number"
|
|
1205
|
+
]);
|
|
1206
|
+
return {
|
|
1207
|
+
dimensions: n.dimensions.map((e) => e.name),
|
|
1208
|
+
measures: n.measures.filter((e) => r.has(e.type)).map((e) => e.name)
|
|
1209
|
+
};
|
|
1210
|
+
}
|
|
1211
|
+
function Cr() {
|
|
1212
|
+
let e = $((e) => e.selectedCube), n = $((e) => e.visibleColumns), r = $((e) => e.sortColumn), i = $((e) => e.sortDirection), a = $((e) => e.page), o = $((e) => e.pageSize), s = $((e) => e.filters), c = $((e) => e.showFilterBar), l = $((e) => e.showColumnPicker), u = $(t((e) => ({
|
|
1213
|
+
selectCube: e.selectCube,
|
|
1214
|
+
setVisibleColumns: e.setVisibleColumns,
|
|
1215
|
+
toggleColumn: e.toggleColumn,
|
|
1216
|
+
setSort: e.setSort,
|
|
1217
|
+
clearSort: e.clearSort,
|
|
1218
|
+
setPage: e.setPage,
|
|
1219
|
+
setPageSize: e.setPageSize,
|
|
1220
|
+
setFilters: e.setFilters,
|
|
1221
|
+
toggleFilterBar: e.toggleFilterBar,
|
|
1222
|
+
setShowColumnPicker: e.setShowColumnPicker
|
|
1223
|
+
}))), { meta: d, getFieldLabel: f } = _e(), p = G(() => {
|
|
1224
|
+
if (!d || !e) return null;
|
|
1225
|
+
let t = d.cubes.find((t) => t.name === e);
|
|
1226
|
+
if (!t) return null;
|
|
1227
|
+
let n = t.dimensions.find((e) => e.primaryKey);
|
|
1228
|
+
return n ? n.name : t.dimensions.length > 0 ? t.dimensions[0].name : null;
|
|
1229
|
+
}, [d, e]), m = r ?? p, h = r ? i : "asc", g = G(() => {
|
|
1230
|
+
if (!e || n.length === 0) return null;
|
|
1231
|
+
let t = n.filter((e) => br(e, d)), r = n.filter((e) => !br(e, d));
|
|
1232
|
+
if (t.length === 0) return null;
|
|
1233
|
+
let i = {
|
|
1234
|
+
dimensions: t,
|
|
1235
|
+
ungrouped: !0,
|
|
1236
|
+
limit: o,
|
|
1237
|
+
offset: a * o
|
|
1238
|
+
};
|
|
1239
|
+
return r.length > 0 && (i.measures = r), s.length > 0 && (i.filters = s), m && (i.order = { [m]: h }), i;
|
|
1240
|
+
}, [
|
|
1241
|
+
e,
|
|
1242
|
+
n,
|
|
1243
|
+
s,
|
|
1244
|
+
m,
|
|
1245
|
+
h,
|
|
1246
|
+
a,
|
|
1247
|
+
o,
|
|
1248
|
+
d
|
|
1249
|
+
]), { rawData: _, isLoading: v, isFetching: y, isDebouncing: b, error: x, refetch: S } = O(g, {
|
|
1250
|
+
skip: !g,
|
|
1251
|
+
debounceMs: 400,
|
|
1252
|
+
keepPreviousData: !0,
|
|
1253
|
+
staleTime: 6e4
|
|
1254
|
+
}), C = (() => {
|
|
1255
|
+
if (!_ || _.length === 0) return _;
|
|
1256
|
+
let e = Object.keys(_[0]);
|
|
1257
|
+
return n.some((t) => e.includes(t)) ? _ : null;
|
|
1258
|
+
})(), w = v || !C && (b || y), T = C?.length ?? 0;
|
|
1259
|
+
return {
|
|
1260
|
+
selectedCube: e,
|
|
1261
|
+
visibleColumns: n,
|
|
1262
|
+
sortColumn: m,
|
|
1263
|
+
sortDirection: h,
|
|
1264
|
+
page: a,
|
|
1265
|
+
pageSize: o,
|
|
1266
|
+
filters: s,
|
|
1267
|
+
showFilterBar: c,
|
|
1268
|
+
showColumnPicker: l,
|
|
1269
|
+
rawData: C,
|
|
1270
|
+
isLoading: w,
|
|
1271
|
+
isFetching: y,
|
|
1272
|
+
error: x,
|
|
1273
|
+
query: g,
|
|
1274
|
+
rowCount: T,
|
|
1275
|
+
hasNextPage: T === o,
|
|
1276
|
+
hasPrevPage: a > 0,
|
|
1277
|
+
meta: d,
|
|
1278
|
+
getFieldLabel: f,
|
|
1279
|
+
...u,
|
|
1280
|
+
refetch: S
|
|
1281
|
+
};
|
|
1282
|
+
}
|
|
1283
|
+
//#endregion
|
|
1284
|
+
//#region src/client/components/DataBrowser/DataBrowserSidebar.tsx
|
|
1285
|
+
var wr = p("search"), Tr = p("cube");
|
|
1286
|
+
function Er({ cubes: e, selectedCube: t, onSelectCube: n }) {
|
|
1287
|
+
let [r, i] = q(""), a = G(() => {
|
|
1288
|
+
let t = [...e].sort((e, t) => (e.title || e.name).localeCompare(t.title || t.name));
|
|
1289
|
+
if (!r) return t;
|
|
1290
|
+
let n = r.toLowerCase();
|
|
1291
|
+
return t.filter((e) => e.name.toLowerCase().includes(n) || e.title.toLowerCase().includes(n));
|
|
1292
|
+
}, [e, r]);
|
|
1293
|
+
return /* @__PURE__ */ X("div", {
|
|
1294
|
+
className: "dc:flex dc:flex-col dc:h-full dc:border-r border-dc-border bg-dc-surface dc:w-60 dc:shrink-0",
|
|
1295
|
+
children: [/* @__PURE__ */ X("div", {
|
|
1296
|
+
className: "dc:px-3 dc:py-3 dc:border-b border-dc-border",
|
|
1297
|
+
children: [/* @__PURE__ */ Y("h2", {
|
|
1298
|
+
className: "dc:text-sm dc:font-semibold text-dc-text dc:mb-2",
|
|
1299
|
+
children: "Cubes"
|
|
1300
|
+
}), /* @__PURE__ */ X("div", {
|
|
1301
|
+
className: "dc:relative",
|
|
1302
|
+
children: [/* @__PURE__ */ Y(wr, { className: "dc:absolute dc:left-2 dc:top-1/2 dc:-translate-y-1/2 dc:w-3.5 dc:h-3.5 text-dc-text-muted" }), /* @__PURE__ */ Y("input", {
|
|
1303
|
+
type: "text",
|
|
1304
|
+
value: r,
|
|
1305
|
+
onChange: (e) => i(e.target.value),
|
|
1306
|
+
placeholder: "Search...",
|
|
1307
|
+
className: "dc:w-full dc:pl-7 dc:pr-2 dc:py-1.5 dc:text-xs dc:rounded border-dc-border dc:border bg-dc-surface text-dc-text dc:outline-none dc:focus:ring-1 focus:ring-dc-accent"
|
|
1308
|
+
})]
|
|
1309
|
+
})]
|
|
1310
|
+
}), /* @__PURE__ */ X("div", {
|
|
1311
|
+
className: "dc:flex-1 dc:overflow-y-auto dc:py-1",
|
|
1312
|
+
children: [a.map((e) => /* @__PURE__ */ X("button", {
|
|
1313
|
+
onClick: () => n(e.name),
|
|
1314
|
+
className: `dc:flex dc:items-center dc:gap-2 dc:w-full dc:px-3 dc:py-1.5 dc:text-left dc:text-sm dc:transition-colors ${t === e.name ? "bg-dc-accent-bg text-dc-accent dc:font-medium" : "text-dc-text dc:hover:bg-dc-surface-hover"}`,
|
|
1315
|
+
children: [/* @__PURE__ */ Y(Tr, { className: "dc:w-4 dc:h-4 dc:shrink-0 text-dc-text-muted" }), /* @__PURE__ */ Y("span", {
|
|
1316
|
+
className: "dc:truncate",
|
|
1317
|
+
children: e.title || e.name
|
|
1318
|
+
})]
|
|
1319
|
+
}, e.name)), a.length === 0 && /* @__PURE__ */ Y("div", {
|
|
1320
|
+
className: "dc:px-3 dc:py-4 dc:text-xs text-dc-text-muted dc:text-center",
|
|
1321
|
+
children: "No cubes found"
|
|
1322
|
+
})]
|
|
1323
|
+
})]
|
|
1324
|
+
});
|
|
1325
|
+
}
|
|
1326
|
+
//#endregion
|
|
1327
|
+
//#region src/client/components/DataBrowser/DataBrowserToolbar.tsx
|
|
1328
|
+
var Dr = p("filter"), Or = p("settings"), kr = p("chevronLeft"), Ar = p("chevronRight"), jr = p("refresh");
|
|
1329
|
+
function Mr({ showFilterBar: e, filterCount: t, onToggleFilterBar: n, onToggleColumnPicker: r, page: i, pageSize: a, rowCount: o, hasNextPage: s, hasPrevPage: c, onPageChange: l, onPageSizeChange: u, isFetching: d, onRefresh: f }) {
|
|
1330
|
+
return /* @__PURE__ */ X("div", {
|
|
1331
|
+
className: "dc:flex dc:items-center dc:gap-2 dc:px-3 dc:py-2 dc:border-b border-dc-border bg-dc-surface-secondary",
|
|
1332
|
+
children: [
|
|
1333
|
+
/* @__PURE__ */ X("button", {
|
|
1334
|
+
onClick: n,
|
|
1335
|
+
className: `dc:flex dc:items-center dc:gap-1.5 dc:px-2.5 dc:py-1.5 dc:text-xs dc:font-medium dc:rounded dc:border dc:transition-colors ${e ? "border-dc-accent bg-dc-accent-bg text-dc-accent" : "border-dc-border bg-dc-surface text-dc-text dc:hover:bg-dc-surface-hover"}`,
|
|
1336
|
+
children: [
|
|
1337
|
+
/* @__PURE__ */ Y(Dr, { className: "dc:w-3.5 dc:h-3.5" }),
|
|
1338
|
+
"Filters",
|
|
1339
|
+
t > 0 && /* @__PURE__ */ Y("span", {
|
|
1340
|
+
className: "dc:inline-flex dc:items-center dc:justify-center dc:w-4 dc:h-4 dc:text-[10px] dc:font-bold dc:rounded-full bg-dc-accent text-dc-surface",
|
|
1341
|
+
children: t
|
|
1342
|
+
})
|
|
1343
|
+
]
|
|
1344
|
+
}),
|
|
1345
|
+
/* @__PURE__ */ X("button", {
|
|
1346
|
+
onClick: r,
|
|
1347
|
+
className: "dc:flex dc:items-center dc:gap-1.5 dc:px-2.5 dc:py-1.5 dc:text-xs dc:font-medium dc:rounded dc:border border-dc-border bg-dc-surface text-dc-text dc:hover:bg-dc-surface-hover dc:transition-colors",
|
|
1348
|
+
children: [/* @__PURE__ */ Y(Or, { className: "dc:w-3.5 dc:h-3.5" }), "Columns"]
|
|
1349
|
+
}),
|
|
1350
|
+
/* @__PURE__ */ Y("div", { className: "dc:flex-1" }),
|
|
1351
|
+
/* @__PURE__ */ X("span", {
|
|
1352
|
+
className: "dc:text-xs text-dc-text-muted",
|
|
1353
|
+
children: [o, " rows"]
|
|
1354
|
+
}),
|
|
1355
|
+
/* @__PURE__ */ Y("button", {
|
|
1356
|
+
onClick: f,
|
|
1357
|
+
className: "dc:p-1 dc:rounded dc:hover:bg-dc-surface-hover dc:transition-colors",
|
|
1358
|
+
title: "Refresh",
|
|
1359
|
+
children: /* @__PURE__ */ Y(jr, { className: `dc:w-3.5 dc:h-3.5 text-dc-text-muted ${d ? "dc:animate-spin" : ""}` })
|
|
1360
|
+
}),
|
|
1361
|
+
/* @__PURE__ */ X("select", {
|
|
1362
|
+
value: a,
|
|
1363
|
+
onChange: (e) => u(Number(e.target.value)),
|
|
1364
|
+
className: "dc:text-xs dc:px-1.5 dc:py-1 dc:rounded dc:border border-dc-border bg-dc-surface text-dc-text dc:outline-none",
|
|
1365
|
+
children: [
|
|
1366
|
+
/* @__PURE__ */ Y("option", {
|
|
1367
|
+
value: 20,
|
|
1368
|
+
children: "20"
|
|
1369
|
+
}),
|
|
1370
|
+
/* @__PURE__ */ Y("option", {
|
|
1371
|
+
value: 50,
|
|
1372
|
+
children: "50"
|
|
1373
|
+
}),
|
|
1374
|
+
/* @__PURE__ */ Y("option", {
|
|
1375
|
+
value: 100,
|
|
1376
|
+
children: "100"
|
|
1377
|
+
})
|
|
1378
|
+
]
|
|
1379
|
+
}),
|
|
1380
|
+
/* @__PURE__ */ X("div", {
|
|
1381
|
+
className: "dc:flex dc:items-center dc:gap-1",
|
|
1382
|
+
children: [
|
|
1383
|
+
/* @__PURE__ */ Y("button", {
|
|
1384
|
+
onClick: () => l(i - 1),
|
|
1385
|
+
disabled: !c,
|
|
1386
|
+
className: "dc:p-1 dc:rounded dc:hover:bg-dc-surface-hover dc:disabled:opacity-30 dc:disabled:cursor-not-allowed dc:transition-colors",
|
|
1387
|
+
children: /* @__PURE__ */ Y(kr, { className: "dc:w-4 dc:h-4 text-dc-text-muted" })
|
|
1388
|
+
}),
|
|
1389
|
+
/* @__PURE__ */ Y("span", {
|
|
1390
|
+
className: "dc:text-xs dc:font-medium text-dc-text dc:min-w-[2rem] dc:text-center",
|
|
1391
|
+
children: i + 1
|
|
1392
|
+
}),
|
|
1393
|
+
/* @__PURE__ */ Y("button", {
|
|
1394
|
+
onClick: () => l(i + 1),
|
|
1395
|
+
disabled: !s,
|
|
1396
|
+
className: "dc:p-1 dc:rounded dc:hover:bg-dc-surface-hover dc:disabled:opacity-30 dc:disabled:cursor-not-allowed dc:transition-colors",
|
|
1397
|
+
children: /* @__PURE__ */ Y(Ar, { className: "dc:w-4 dc:h-4 text-dc-text-muted" })
|
|
1398
|
+
})
|
|
1399
|
+
]
|
|
1400
|
+
})
|
|
1401
|
+
]
|
|
1402
|
+
});
|
|
1403
|
+
}
|
|
1404
|
+
//#endregion
|
|
1405
|
+
//#region src/client/components/DataBrowser/DataBrowserTable.tsx
|
|
1406
|
+
var Nr = p("chevronUp"), Pr = p("chevronDown");
|
|
1407
|
+
function Fr(e, t) {
|
|
1408
|
+
let n = xr(e, t);
|
|
1409
|
+
return {
|
|
1410
|
+
string: "text",
|
|
1411
|
+
number: "num",
|
|
1412
|
+
time: "time",
|
|
1413
|
+
boolean: "bool",
|
|
1414
|
+
sum: "num",
|
|
1415
|
+
avg: "num",
|
|
1416
|
+
min: "num",
|
|
1417
|
+
max: "num"
|
|
1418
|
+
}[n] || n;
|
|
1419
|
+
}
|
|
1420
|
+
function Ir(e, t) {
|
|
1421
|
+
return Fr(e, t) === "num";
|
|
1422
|
+
}
|
|
1423
|
+
function Lr(e) {
|
|
1424
|
+
return e == null ? "" : typeof e == "number" ? e.toLocaleString() : typeof e == "boolean" ? e ? "true" : "false" : e instanceof Date ? e.toISOString() : String(e);
|
|
1425
|
+
}
|
|
1426
|
+
var Rr = 60, zr = 150, Br = H.memo(function({ data: e, columns: t, sortColumn: n, sortDirection: r, onSort: i, getFieldLabel: a, meta: o, isLoading: s, isFetching: c, selectedCube: l, loadingComponent: u }) {
|
|
1427
|
+
let d = $((e) => e.columnWidths), f = $((e) => e.setColumnWidth), p = $((e) => e.setColumnWidths), m = K(null), h = K(!1), g = U((e, n) => {
|
|
1428
|
+
e.preventDefault(), e.stopPropagation();
|
|
1429
|
+
let r = e.clientX;
|
|
1430
|
+
h.current = !1;
|
|
1431
|
+
let i = m.current;
|
|
1432
|
+
if (i) {
|
|
1433
|
+
let e = i.querySelectorAll("thead th"), n = {};
|
|
1434
|
+
e.forEach((e, r) => {
|
|
1435
|
+
let i = t[r];
|
|
1436
|
+
i && (n[i] = e.getBoundingClientRect().width);
|
|
1437
|
+
}), p(n);
|
|
1438
|
+
}
|
|
1439
|
+
let a = e.target.closest("th"), o = a ? a.getBoundingClientRect().width : zr, s = (e) => {
|
|
1440
|
+
let t = e.clientX - r;
|
|
1441
|
+
Math.abs(t) > 2 && (h.current = !0), f(n, Math.max(Rr, o + t));
|
|
1442
|
+
}, c = () => {
|
|
1443
|
+
document.removeEventListener("mousemove", s), document.removeEventListener("mouseup", c), document.body.style.cursor = "", document.body.style.userSelect = "", requestAnimationFrame(() => {
|
|
1444
|
+
h.current = !1;
|
|
1445
|
+
});
|
|
1446
|
+
};
|
|
1447
|
+
document.addEventListener("mousemove", s), document.addEventListener("mouseup", c), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
|
|
1448
|
+
}, [
|
|
1449
|
+
t,
|
|
1450
|
+
f,
|
|
1451
|
+
p
|
|
1452
|
+
]), _ = U((e) => {
|
|
1453
|
+
h.current || i(e);
|
|
1454
|
+
}, [i]), v = Object.keys(d).length > 0 ? t.reduce((e, t) => e + (d[t] ?? zr), 0) : void 0;
|
|
1455
|
+
return l ? e ? e.length === 0 && !s && !c ? /* @__PURE__ */ Y("div", {
|
|
1456
|
+
className: "dc:flex dc:items-center dc:justify-center dc:h-full",
|
|
1457
|
+
children: /* @__PURE__ */ X("div", {
|
|
1458
|
+
className: "dc:text-center text-dc-text-muted",
|
|
1459
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
1460
|
+
className: "dc:text-sm dc:font-semibold dc:mb-1",
|
|
1461
|
+
children: "No data"
|
|
1462
|
+
}), /* @__PURE__ */ Y("div", {
|
|
1463
|
+
className: "dc:text-xs text-dc-text-secondary",
|
|
1464
|
+
children: "No rows returned for this query"
|
|
1465
|
+
})]
|
|
1466
|
+
})
|
|
1467
|
+
}) : /* @__PURE__ */ X("div", {
|
|
1468
|
+
className: "dc:relative dc:flex-1 dc:overflow-auto",
|
|
1469
|
+
children: [c && /* @__PURE__ */ Y("div", { className: "dc:absolute dc:inset-0 bg-dc-surface dc:opacity-40 dc:z-10 dc:pointer-events-none" }), /* @__PURE__ */ X("table", {
|
|
1470
|
+
ref: m,
|
|
1471
|
+
className: "dc:border-collapse",
|
|
1472
|
+
style: {
|
|
1473
|
+
tableLayout: "fixed",
|
|
1474
|
+
width: v,
|
|
1475
|
+
minWidth: "100%"
|
|
1476
|
+
},
|
|
1477
|
+
children: [
|
|
1478
|
+
/* @__PURE__ */ Y("colgroup", { children: t.map((e) => /* @__PURE__ */ Y("col", { style: { width: d[e] ?? zr } }, e)) }),
|
|
1479
|
+
/* @__PURE__ */ Y("thead", {
|
|
1480
|
+
className: "dc:sticky dc:top-0 dc:z-20",
|
|
1481
|
+
style: { backgroundColor: "var(--dc-surface-secondary)" },
|
|
1482
|
+
children: /* @__PURE__ */ Y("tr", { children: t.map((e, i) => {
|
|
1483
|
+
let s = n === e, c = a(e), l = Fr(e, o), u = i === t.length - 1, d = Ir(e, o);
|
|
1484
|
+
return /* @__PURE__ */ X("th", {
|
|
1485
|
+
onClick: () => _(e),
|
|
1486
|
+
className: `dc:relative dc:px-3 dc:py-2 dc:text-xs dc:font-normal dc:cursor-pointer dc:select-none dc:border-b border-dc-border dc:transition-colors${u ? "" : " dc:border-r"}${d ? " dc:text-right" : " dc:text-left"}`,
|
|
1487
|
+
style: { color: "var(--dc-text-muted)" },
|
|
1488
|
+
children: [/* @__PURE__ */ X("div", {
|
|
1489
|
+
className: `dc:flex dc:items-center dc:gap-1.5 dc:overflow-hidden${d ? " dc:justify-end" : ""}`,
|
|
1490
|
+
children: [
|
|
1491
|
+
/* @__PURE__ */ Y("span", {
|
|
1492
|
+
className: "dc:font-medium dc:truncate",
|
|
1493
|
+
style: { color: "var(--dc-text)" },
|
|
1494
|
+
children: c
|
|
1495
|
+
}),
|
|
1496
|
+
/* @__PURE__ */ Y("span", {
|
|
1497
|
+
className: "dc:text-[10px] dc:opacity-50 dc:shrink-0",
|
|
1498
|
+
children: l
|
|
1499
|
+
}),
|
|
1500
|
+
s && Y(r === "asc" ? Nr : Pr, { className: "dc:w-3 dc:h-3 text-dc-accent dc:shrink-0" })
|
|
1501
|
+
]
|
|
1502
|
+
}), /* @__PURE__ */ Y("div", {
|
|
1503
|
+
onMouseDown: (t) => g(t, e),
|
|
1504
|
+
className: "dc:absolute dc:top-0 dc:right-0 dc:w-1.5 dc:h-full dc:cursor-col-resize dc:hover:bg-dc-accent dc:opacity-0 dc:hover:opacity-100 dc:transition-opacity",
|
|
1505
|
+
style: { zIndex: 30 }
|
|
1506
|
+
})]
|
|
1507
|
+
}, e);
|
|
1508
|
+
}) })
|
|
1509
|
+
}),
|
|
1510
|
+
/* @__PURE__ */ Y("tbody", { children: e.map((e, n) => /* @__PURE__ */ Y("tr", {
|
|
1511
|
+
className: "dc:border-b border-dc-border",
|
|
1512
|
+
style: { transition: "background-color 0.1s" },
|
|
1513
|
+
onMouseEnter: (e) => {
|
|
1514
|
+
e.currentTarget.style.backgroundColor = "var(--dc-surface-hover, rgba(0,0,0,0.02))";
|
|
1515
|
+
},
|
|
1516
|
+
onMouseLeave: (e) => {
|
|
1517
|
+
e.currentTarget.style.backgroundColor = "";
|
|
1518
|
+
},
|
|
1519
|
+
children: t.map((n, r) => {
|
|
1520
|
+
let i = r === t.length - 1, a = Ir(n, o);
|
|
1521
|
+
return /* @__PURE__ */ Y("td", {
|
|
1522
|
+
className: `dc:px-3 dc:py-1.5 dc:text-sm dc:overflow-hidden dc:text-ellipsis dc:whitespace-nowrap${i ? "" : " dc:border-r border-dc-border"}${a ? " dc:text-right dc:tabular-nums" : ""}`,
|
|
1523
|
+
style: { color: "var(--dc-text)" },
|
|
1524
|
+
children: Lr(e[n])
|
|
1525
|
+
}, n);
|
|
1526
|
+
})
|
|
1527
|
+
}, n)) })
|
|
1528
|
+
]
|
|
1529
|
+
})]
|
|
1530
|
+
}) : /* @__PURE__ */ Y("div", {
|
|
1531
|
+
className: "dc:flex dc:flex-col dc:items-center dc:justify-center dc:h-full dc:gap-3",
|
|
1532
|
+
children: u ?? /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(V, { size: "md" }), /* @__PURE__ */ Y("div", {
|
|
1533
|
+
className: "dc:text-sm text-dc-text-muted",
|
|
1534
|
+
children: "Loading data..."
|
|
1535
|
+
})] })
|
|
1536
|
+
}) : /* @__PURE__ */ Y("div", {
|
|
1537
|
+
className: "dc:flex dc:items-center dc:justify-center dc:h-full",
|
|
1538
|
+
children: /* @__PURE__ */ X("div", {
|
|
1539
|
+
className: "dc:text-center text-dc-text-muted",
|
|
1540
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
1541
|
+
className: "dc:text-base dc:font-semibold dc:mb-1",
|
|
1542
|
+
children: "Select a cube"
|
|
1543
|
+
}), /* @__PURE__ */ Y("div", {
|
|
1544
|
+
className: "dc:text-sm text-dc-text-secondary",
|
|
1545
|
+
children: "Choose a cube from the sidebar to browse its data"
|
|
1546
|
+
})]
|
|
1547
|
+
})
|
|
1548
|
+
});
|
|
1549
|
+
});
|
|
1550
|
+
//#endregion
|
|
1551
|
+
//#region src/client/components/DataBrowser/index.tsx
|
|
1552
|
+
function Vr({ className: e = "", maxHeight: t = "100vh", loadingComponent: n }) {
|
|
1553
|
+
let { selectedCube: r, visibleColumns: i, sortColumn: a, sortDirection: o, page: s, pageSize: c, filters: l, showFilterBar: u, showColumnPicker: d, rawData: f, isLoading: p, isFetching: m, rowCount: h, hasNextPage: g, hasPrevPage: _, meta: v, getFieldLabel: y, selectCube: b, setSort: x, setPage: S, setPageSize: C, setFilters: w, toggleFilterBar: T, setShowColumnPicker: E, toggleColumn: D, refetch: O } = Cr(), k = G(() => v ? v.cubes.map((e) => ({
|
|
1554
|
+
name: e.name,
|
|
1555
|
+
title: e.title || e.name
|
|
1556
|
+
})) : [], [v]), A = U((e) => {
|
|
1557
|
+
let { dimensions: t } = Sr(e, v);
|
|
1558
|
+
b(e, t);
|
|
1559
|
+
}, [v, b]), j = G(() => {
|
|
1560
|
+
function e(t) {
|
|
1561
|
+
return t.reduce((t, n) => "member" in n ? t + 1 : "type" in n && "filters" in n ? t + e(n.filters) : t, 0);
|
|
1562
|
+
}
|
|
1563
|
+
return e(l);
|
|
1564
|
+
}, [l]), M = G(() => {
|
|
1565
|
+
if (!v) return null;
|
|
1566
|
+
if (r) {
|
|
1567
|
+
let e = v.cubes.find((e) => e.name === r);
|
|
1568
|
+
return e ? { cubes: [e] } : null;
|
|
1569
|
+
}
|
|
1570
|
+
return v;
|
|
1571
|
+
}, [v, r]), N = U((e, t, n, r) => {
|
|
1572
|
+
D(e.name);
|
|
1573
|
+
}, [D]);
|
|
1574
|
+
return /* @__PURE__ */ X("div", {
|
|
1575
|
+
className: `dc:flex dc:border border-dc-border dc:rounded-lg dc:overflow-hidden bg-dc-surface ${e}`,
|
|
1576
|
+
style: { height: t },
|
|
1577
|
+
children: [
|
|
1578
|
+
/* @__PURE__ */ Y(Er, {
|
|
1579
|
+
cubes: k,
|
|
1580
|
+
selectedCube: r,
|
|
1581
|
+
onSelectCube: A
|
|
1582
|
+
}),
|
|
1583
|
+
/* @__PURE__ */ X("div", {
|
|
1584
|
+
className: "dc:flex dc:flex-col dc:flex-1 dc:min-w-0",
|
|
1585
|
+
children: [
|
|
1586
|
+
r && /* @__PURE__ */ Y(Mr, {
|
|
1587
|
+
showFilterBar: u,
|
|
1588
|
+
filterCount: j,
|
|
1589
|
+
onToggleFilterBar: T,
|
|
1590
|
+
onToggleColumnPicker: () => E(!d),
|
|
1591
|
+
page: s,
|
|
1592
|
+
pageSize: c,
|
|
1593
|
+
rowCount: h,
|
|
1594
|
+
hasNextPage: g,
|
|
1595
|
+
hasPrevPage: _,
|
|
1596
|
+
onPageChange: S,
|
|
1597
|
+
onPageSizeChange: C,
|
|
1598
|
+
isFetching: m,
|
|
1599
|
+
onRefresh: () => O()
|
|
1600
|
+
}),
|
|
1601
|
+
r && u && /* @__PURE__ */ Y("div", {
|
|
1602
|
+
className: "dc:px-3 dc:py-2 dc:border-b border-dc-border bg-dc-surface",
|
|
1603
|
+
children: /* @__PURE__ */ Y(Bt, {
|
|
1604
|
+
filters: l,
|
|
1605
|
+
schema: M,
|
|
1606
|
+
onFiltersChange: w
|
|
1607
|
+
})
|
|
1608
|
+
}),
|
|
1609
|
+
/* @__PURE__ */ Y(Br, {
|
|
1610
|
+
data: f,
|
|
1611
|
+
columns: i,
|
|
1612
|
+
sortColumn: a,
|
|
1613
|
+
sortDirection: o,
|
|
1614
|
+
onSort: x,
|
|
1615
|
+
getFieldLabel: y,
|
|
1616
|
+
meta: v,
|
|
1617
|
+
isLoading: p,
|
|
1618
|
+
isFetching: m,
|
|
1619
|
+
selectedCube: r,
|
|
1620
|
+
loadingComponent: n
|
|
1621
|
+
})
|
|
1622
|
+
]
|
|
1623
|
+
}),
|
|
1624
|
+
d && M && /* @__PURE__ */ Y(Nt, {
|
|
1625
|
+
isOpen: d,
|
|
1626
|
+
onClose: () => E(!1),
|
|
1627
|
+
onSelect: N,
|
|
1628
|
+
mode: "breakdown",
|
|
1629
|
+
schema: M,
|
|
1630
|
+
selectedFields: i
|
|
1631
|
+
})
|
|
1632
|
+
]
|
|
1633
|
+
});
|
|
1634
|
+
}
|
|
1635
|
+
function Hr({ className: e, defaultCube: t, defaultPageSize: n = 20, maxHeight: r, loadingComponent: i }) {
|
|
1636
|
+
return /* @__PURE__ */ Y(yr, {
|
|
1637
|
+
defaultPageSize: n,
|
|
1638
|
+
defaultCube: t,
|
|
1639
|
+
children: /* @__PURE__ */ Y(Vr, {
|
|
1640
|
+
className: e,
|
|
1641
|
+
maxHeight: r,
|
|
1642
|
+
loadingComponent: i
|
|
1643
|
+
})
|
|
1644
|
+
});
|
|
1645
|
+
}
|
|
1646
|
+
//#endregion
|
|
1065
1647
|
//#region src/client/components/DashboardThumbnailPlaceholder.tsx
|
|
1066
|
-
var
|
|
1067
|
-
function
|
|
1648
|
+
var Ur = p("segment");
|
|
1649
|
+
function Wr({ className: e = "" }) {
|
|
1068
1650
|
return /* @__PURE__ */ Y("div", {
|
|
1069
1651
|
className: `dc:flex dc:items-center dc:justify-center bg-dc-bg-secondary ${e}`,
|
|
1070
1652
|
children: /* @__PURE__ */ X("div", {
|
|
1071
1653
|
className: "dc:text-center",
|
|
1072
|
-
children: [/* @__PURE__ */ Y(
|
|
1654
|
+
children: [/* @__PURE__ */ Y(Ur, { className: "dc:w-8 dc:h-8 dc:mx-auto dc:mb-2 text-dc-text-muted dc:opacity-50" }), /* @__PURE__ */ Y("span", {
|
|
1073
1655
|
className: "dc:text-xs text-dc-text-muted",
|
|
1074
1656
|
children: "No preview"
|
|
1075
1657
|
})]
|
|
@@ -1077,6 +1659,6 @@ function dr({ className: e = "" }) {
|
|
|
1077
1659
|
});
|
|
1078
1660
|
}
|
|
1079
1661
|
//#endregion
|
|
1080
|
-
export {
|
|
1662
|
+
export { fr as AgenticNotebook, et as AnalysisBuilder, $e as AnalyticsDashboard, pr as AnalyticsPage, Ae as AnalyticsPortlet, Ne as ChartErrorBoundary, Mt as ConfirmModal, a as CubeClient, S as CubeProvider, T as DEFAULT_ICONS, tt as DashboardEditModal, Ge as DashboardGrid, Be as DashboardStoreProvider, Wr as DashboardThumbnailPlaceholder, Hr as DataBrowser, Ke as DrillBreadcrumb, Me as DrillMenu, Ut as ExecutionPlanPanel, zt as ExplainAIPanel, pt as LazyChart, V as LoadingIndicator, jt as Modal, Dn as NotebookStoreProvider, Ze as PortletAnalysisModal, Xe as PortletContainer, _n as SchemaVisualization, ge as ScrollContainerProvider, ye as THEME_PRESETS, we as applyTheme, de as buildFunnelConfigFromQueries, ce as buildServerFunnelQuery, o as captureThumbnail, rn as compressAndEncode, _ as createCubeClient, bn as createDashboardLayout, Je as createDashboardStore, Dt as createDefaultConfig, _t as createDefaultFlowConfig, gt as createDefaultFunnelConfig, Ct as createDefaultQueryConfig, At as createDefaultRetentionConfig, mt as createDefaultWorkspace, ne as createExplainQueryKey, N as createFlowQueryKey, F as createFunnelQueryKey, Tn as createNotebookStore, Xt as decodeAndDecompress, Qt as detectAsymmetricDateRanges, Kt as detectMeasureCollisions, yn as formatChartData, oe as formatDuration, te as generateQueryLabel, Zt as generateShareUrl, un as getAvailableBindingKeyDimensions, lt as getAvailableChartTypes, ue as getBindingKeyField, an as getBindingKeyLabel, y as getChartTypeIcon, k as getCombinedFields, fe as getCubeNameFromQuery, C as getFieldTypeIcon, p as getIcon, m as getIconData, x as getIconRegistry, b as getIconsByCategory, g as getMeasureTypeIcon, A as getQueryIndices, I as getQueryLabels, De as getTheme, be as getThemeVariable, dt as getUnavailableChartTypes, dn as getValidationSummary, Ft as highlightCodeBlocks, ct as isChartTypeAvailable, xe as isDarkMode, kt as isFlowConfig, xt as isFunnelConfig, se as isFunnelData, cn as isMinimumFunnelConfigValid, St as isMultiQuery, Pe as isMultiQueryConfig, P as isMultiQueryData, mn as isMultiQueryValid, wt as isQueryConfig, vt as isRetentionConfig, pe as isSankeyData, me as isServerFlowQuery, qe as isServerFunnelQuery, sn as isShareableSize, yt as isSingleQuery, c as isThumbnailCaptureAvailable, bt as isValidAnalysisConfig, Tt as isValidAnalysisWorkspace, st as isValidChartType, M as mergeQueryResults, j as mergeResultsByKey, E as mergeResultsConcat, ht as migrateConfig, Pt as migrateLegacyPortlet, $t as parseShareUrl, ut as preloadChart, ft as preloadCharts, h as registerIcons, d as resetIcons, Ee as resetTheme, nt as selectAllActions, Fn as selectBlockActions, On as selectBlocks, fn as selectBreakdowns, Gt as selectChartConfig, Pn as selectChatActions, Nn as selectChatState, Rt as selectCurrentState, Ve as selectDebugData, He as selectDebugDataActions, Qe as selectEditModeActions, Ye as selectEditModeState, Lt as selectFilters, Ht as selectFunnelState, Mn as selectInputValue, An as selectIsStreaming, We as selectLayoutActions, Ue as selectLayoutState, kn as selectMessages, nn as selectMetrics, Le as selectModalActions, rt as selectModalState, It as selectMultiQueryState, ot as selectPortletDebugData, jn as selectSessionId, ze as selectThumbnailDirty, tn as selectUIState, w as setIcon, Te as setTheme, Ce as setThemeVariable, le as transformServerFunnelResult, Zn as useAgentChat, Yt as useAnalysisBuilder, Vt as useAnalysisBuilderStore, v as useCubeApi, f as useCubeContext, u as useCubeFeatures, ve as useCubeFieldLabel, O as useCubeLoadQuery, O as useCubeQuery, _e as useCubeMeta, l as useCubeMetaQuery, Re as useDashboard, at as useDashboardStore, Fe as useDashboardStoreApi, ke as useDashboardStoreOptional, Cr as useDataBrowser, Oe as useDrillInteraction, B as useDryRunQueries, z as useDryRunQuery, Ie as useElementVisibility, ae as useExplainAI, ie as useExplainQuery, D as useFlowQuery, L as useFunnelQuery, ee as useMultiCubeLoadQuery, re as useMultiDryRunQueries, Z as useNotebookStore, he as useScrollContainer, je as useScrollDetection, vn as useTheme, en as validateBindingKeyExists, qt as validateBindingKeyForSteps, on as validateFunnelConfig, R as validateMergeKey, Jt as validateMergeKeys, pn as validateMultiQueryConfig, ln as validateStepQueries, Wt as validateTimeDimensionAlignment, s as warnIfScreenshotLibMissing, Se as watchThemeChanges };
|
|
1081
1663
|
|
|
1082
1664
|
//# sourceMappingURL=index.js.map
|