@trilogy-data/trilogy-studio-components 0.1.17 → 0.1.19

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.
Files changed (46) hide show
  1. package/README.md +36 -0
  2. package/dist/{AssetAutoImporter-COld6ovI.js → AssetAutoImporter-CUqhhNvb.js} +14 -14
  3. package/dist/{CommunityModels-B5DGmouF.js → CommunityModels-BKBxewjm.js} +2 -2
  4. package/dist/{ConnectionView-C9-aVTdE.js → ConnectionView-Dyqm2oeV.js} +14 -14
  5. package/dist/{Dashboard-C8vFmGcL.js → Dashboard-Bsoj1oUW.js} +169 -169
  6. package/dist/{DashboardCreatorInline-DheLBs4U.js → DashboardCreatorInline-BLbkDxBF.js} +1 -1
  7. package/dist/{DashboardMobile-B7HffPju.js → DashboardMobile-Ao8NtF1f.js} +16 -16
  8. package/dist/{DrilldownPane-S2dy0Wvj.js → DrilldownPane-OZMttRBx.js} +2691 -2666
  9. package/dist/{Editor-DKEg-QmG.js → Editor-N40lTR0s.js} +1 -1
  10. package/dist/{IDE-4OJAmj7h.js → IDE-kbUDZPcL.js} +5 -5
  11. package/dist/{JobsView-DE0m37jI.js → JobsView-AYNUDnKG.js} +1 -1
  12. package/dist/{LLMChat-DvoCO2NW.js → LLMChat-CZTQUh53.js} +2 -2
  13. package/dist/{LLMConnectionList-cXc3m9rK.js → LLMConnectionList-BkvCZP5Q.js} +1 -1
  14. package/dist/{LLMView-DzEvz9u4.js → LLMView-CaTlmLGb.js} +2 -2
  15. package/dist/{MobileIDE-w2cNPXWA.js → MobileIDE-Bi7GNE2X.js} +10 -10
  16. package/dist/{ModelCard-DPtVjIMJ.js → ModelCard-Cd6OxExX.js} +2 -2
  17. package/dist/{ModelCreator-gJ86t8SP.js → ModelCreator-DeI-n86Z.js} +1 -1
  18. package/dist/{ModelView-C5y1IU22.js → ModelView-Surdb5KW.js} +2 -2
  19. package/dist/{ResultComponent-DV46CwMw.js → ResultComponent-CXkTwZFS.js} +1 -1
  20. package/dist/{Sidebar-C6FJOAJk.js → Sidebar-CfOATms_.js} +60 -60
  21. package/dist/{TutorialPage-BF9ao6-m.js → TutorialPage-IisHiPL6.js} +8 -8
  22. package/dist/{UserProfile-DPc9-B3S.js → UserProfile-CQAUnKyQ.js} +1 -1
  23. package/dist/components/dashboard/useDashboard.d.ts.map +1 -1
  24. package/dist/composables/useCrossFilterEligibility.d.ts +18 -0
  25. package/dist/composables/useCrossFilterEligibility.d.ts.map +1 -0
  26. package/dist/composables/useEmbeddedDashboardGroup.d.ts +78 -0
  27. package/dist/composables/useEmbeddedDashboardGroup.d.ts.map +1 -0
  28. package/dist/composables/useResolvedCrossFilterController.d.ts +30 -0
  29. package/dist/composables/useResolvedCrossFilterController.d.ts.map +1 -0
  30. package/dist/dashboard.js +313 -82
  31. package/dist/dashboards/barChartSpec.d.ts +39 -0
  32. package/dist/dashboards/barChartSpec.d.ts.map +1 -1
  33. package/dist/dashboards/crossFilters.d.ts +3 -0
  34. package/dist/dashboards/crossFilters.d.ts.map +1 -1
  35. package/dist/entry.dashboard.d.ts +8 -2
  36. package/dist/entry.dashboard.d.ts.map +1 -1
  37. package/dist/main.d.ts +8 -2
  38. package/dist/main.d.ts.map +1 -1
  39. package/dist/{queryExecutionService-obvMrWcu.js → queryExecutionService-KrjL0UCa.js} +167 -128
  40. package/dist/stores/queryExecutionService.d.ts +9 -0
  41. package/dist/stores/queryExecutionService.d.ts.map +1 -1
  42. package/dist/stores.js +1 -1
  43. package/dist/trilogy-studio-components.css +1 -1
  44. package/dist/{useDashboard-B_MH66Yb.js → useDashboard-CtX3sEag.js} +275 -275
  45. package/dist/views.js +2 -2
  46. package/package.json +1 -1
package/README.md CHANGED
@@ -16,6 +16,7 @@ import {
16
16
  QueryExecutionService,
17
17
  TrilogyEmbedProvider,
18
18
  createCrossFilterController,
19
+ useEmbeddedDashboardGroup,
19
20
  } from '@trilogy-data/trilogy-studio-components/dashboard'
20
21
  ```
21
22
 
@@ -31,6 +32,41 @@ Available public subpaths:
31
32
 
32
33
  There is no root package export. Import one of the explicit subpaths above so bundle-splitting stays predictable.
33
34
 
35
+ ## Shared Embedded Dashboard Execution
36
+
37
+ When an embedding app renders several independent dashboard charts on one page, prefer a shared
38
+ embedded dashboard group instead of creating one `DashboardQueryExecutor` per chart. The group
39
+ coalesces sibling refreshes into `generate_queries` calls, so Trilogy only resolves imports and
40
+ model context once per batch.
41
+
42
+ ```ts
43
+ import { useEmbeddedDashboardGroup } from '@trilogy-data/trilogy-studio-components/dashboard'
44
+
45
+ const embeddedGroup = useEmbeddedDashboardGroup({
46
+ dashboardId: 'summary-usbtv',
47
+ connectionId: 'tree-duckdb',
48
+ queryExecutionService,
49
+ imports: SUMMARY_IMPORTS,
50
+ })
51
+
52
+ embeddedGroup.registerItem({
53
+ itemId: 'top-species',
54
+ title: 'Top Species',
55
+ query: 'select species, count(tree_id) as tree_count;',
56
+ })
57
+
58
+ embeddedGroup.registerItem({
59
+ itemId: 'native-status',
60
+ title: 'Native Status',
61
+ query: 'select native_status, count(tree_id) as tree_count;',
62
+ })
63
+
64
+ embeddedGroup.scheduleRun('top-species')
65
+ embeddedGroup.scheduleRun('native-status')
66
+ ```
67
+
68
+ This is the intended fit for tree-style summary pages that compose several standalone charts.
69
+
34
70
  ## Self-Hosted DuckDB Assets
35
71
 
36
72
  Consumers using `DuckDBConnection` can override the default DuckDB asset loading and point the
@@ -1,12 +1,12 @@
1
1
  import { defineComponent as Se, inject as D, ref as i, computed as M, onMounted as Te, onBeforeUnmount as De, createElementBlock as r, openBlock as l, createCommentVNode as J, createVNode as Ce, createElementVNode as t, toDisplayString as m, unref as Ue, normalizeClass as W, createTextVNode as X, withDirectives as B, vModelText as K, Fragment as xe } from "vue";
2
- import { e as Ae, o as C, p as x, q as ie, t as ue } from "./queryExecutionService-obvMrWcu.js";
2
+ import { e as Ae, g as C, r as x, n as ie, f as ue } from "./queryExecutionService-KrjL0UCa.js";
3
3
  import { c as Ee } from "./editorStore-BTPcljeQ.js";
4
4
  import "./toolLoopCore-CK_KVuAS.js";
5
- import { M as Me } from "./UserProfile-DPc9-B3S.js";
5
+ import { M as Me } from "./UserProfile-CQAUnKyQ.js";
6
6
  import { C as Ne } from "./ConfirmDialog-tNLC5CUN.js";
7
7
  import { t as Pe } from "./trilogy-BjoYDgWX.js";
8
- import { _ as qe } from "./_plugin-vue_export-helper-BzkwV_Yn.js";
9
- const je = { class: "auto-import-container" }, $e = {
8
+ import { _ as je } from "./_plugin-vue_export-helper-BzkwV_Yn.js";
9
+ const qe = { class: "auto-import-container" }, $e = {
10
10
  key: 0,
11
11
  class: "import-state error-state"
12
12
  }, Fe = { class: "import-headline" }, Oe = { class: "error-message" }, Re = {
@@ -28,8 +28,8 @@ const je = { class: "auto-import-container" }, $e = {
28
28
  __name: "AssetAutoImporter",
29
29
  emits: ["importComplete", "fullScreen"],
30
30
  setup(St, { emit: ce }) {
31
- const de = ce, N = D("dashboardStore"), P = D("connectionStore"), q = D("editorStore"), j = D("modelStore"), $ = D("communityApiStore"), oe = D("queryExecutionService"), ve = D("saveDashboards"), ae = D("saveAll"), k = Ae();
32
- if (!N || !P || !q || !j || !ve || !oe || !ae)
31
+ const de = ce, N = D("dashboardStore"), P = D("connectionStore"), j = D("editorStore"), q = D("modelStore"), $ = D("communityApiStore"), oe = D("queryExecutionService"), ve = D("saveDashboards"), ae = D("saveAll"), k = Ae();
32
+ if (!N || !P || !j || !q || !ve || !oe || !ae)
33
33
  throw new Error("Required stores not provided");
34
34
  const p = i(!0), z = i(""), y = i(""), F = i(""), O = i(!1), g = i(""), U = i("dashboard"), c = i(""), d = i(""), w = i(null), _ = i(!1), me = i(""), L = i(!1), s = i("importing"), H = i(Date.now()), Y = i(Date.now()), Z = i("0 ms");
35
35
  let A = null;
@@ -141,7 +141,7 @@ const je = { class: "auto-import-container" }, $e = {
141
141
  }, _e = async () => {
142
142
  L.value = !1, w.value = null, await re();
143
143
  }, ne = async () => {
144
- if (j.models[c.value]) {
144
+ if (q.models[c.value]) {
145
145
  p.value = !1, b(), L.value = !0;
146
146
  return;
147
147
  }
@@ -154,8 +154,8 @@ const je = { class: "auto-import-container" }, $e = {
154
154
  }
155
155
  Y.value = Date.now(), H.value = Date.now(), p.value = !0, G(), y.value ? (s.value = "registering", await we(), await te("importing")) : s.value = "importing";
156
156
  let o = `${c.value}-connection`;
157
- const e = new Me(q, j, N);
158
- j.models[c.value] || j.newModelConfig(c.value, !0), P.connections[o] || P.newConnection(o, d.value, {
157
+ const e = new Me(j, q, N);
158
+ q.models[c.value] || q.newModelConfig(c.value, !0), P.connections[o] || P.newConnection(o, d.value, {
159
159
  mdToken: u.value.mdToken,
160
160
  projectId: u.value.projectId,
161
161
  username: u.value.username,
@@ -192,15 +192,15 @@ const je = { class: "auto-import-container" }, $e = {
192
192
  `Dashboard "${g.value}" was not found in the imported model, have ${f}`
193
193
  );
194
194
  }
195
- v = I.id, N.warmDashboardQueries(I.id, oe, q);
195
+ v = I.id, N.warmDashboardQueries(I.id, oe, j);
196
196
  } else {
197
197
  let S = g.value, T = (n == null ? void 0 : n.trilogy.get(g.value)) || (n == null ? void 0 : n.sql.get(g.value)) || (n == null ? void 0 : n.python.get(g.value));
198
198
  T && (S = T);
199
- const I = Object.values(q.editors).find(
199
+ const I = Object.values(j.editors).find(
200
200
  (f) => f.name === S && f.connection === o
201
201
  );
202
202
  if (!I) {
203
- let f = Object.values(q.editors).filter((h) => h.connection === o).map((h) => h.name).join(", ");
203
+ let f = Object.values(j.editors).filter((h) => h.connection === o).map((h) => h.name).join(", ");
204
204
  throw new Error(
205
205
  `Editor "${g.value}" was not found in the imported model, have ${f}`
206
206
  );
@@ -243,7 +243,7 @@ const je = { class: "auto-import-container" }, $e = {
243
243
  }, le = () => {
244
244
  U.value === "dashboard" ? (k.setActiveDashboard(null), k.setActiveScreen("dashboard")) : k.setActiveScreen("editors");
245
245
  };
246
- return (o, e) => (l(), r("div", je, [
246
+ return (o, e) => (l(), r("div", qe, [
247
247
  w.value ? (l(), r("div", $e, [
248
248
  e[5] || (e[5] = t("div", { class: "error-icon" }, "⚠️", -1)),
249
249
  t("h2", Fe, m(V.value) + " Load Failed", 1),
@@ -452,7 +452,7 @@ const je = { class: "auto-import-container" }, $e = {
452
452
  }, null, 8, ["show", "message"])
453
453
  ]));
454
454
  }
455
- }), Nt = /* @__PURE__ */ qe(It, [["__scopeId", "data-v-3c488ec7"]]);
455
+ }), Nt = /* @__PURE__ */ je(It, [["__scopeId", "data-v-3c488ec7"]]);
456
456
  export {
457
457
  Nt as default
458
458
  };
@@ -1,8 +1,8 @@
1
1
  import { defineComponent as K, inject as A, computed as g, createElementBlock as s, openBlock as i, createElementVNode as e, toDisplayString as C, createCommentVNode as k, Fragment as j, renderList as z, ref as S, createTextVNode as N, normalizeClass as V, createVNode as q, watch as O, onMounted as X, createBlock as M, unref as U, withCtx as Q } from "vue";
2
2
  import "./editorStore-BTPcljeQ.js";
3
- import { x as Y } from "./queryExecutionService-obvMrWcu.js";
3
+ import { y as Y } from "./queryExecutionService-KrjL0UCa.js";
4
4
  import { _ as H } from "./_plugin-vue_export-helper-BzkwV_Yn.js";
5
- import { M as Z } from "./ModelCreator-gJ86t8SP.js";
5
+ import { M as Z } from "./ModelCreator-DeI-n86Z.js";
6
6
  import { M as ee } from "./MarkdownRenderer-cdaHKql1.js";
7
7
  import P from "./ErrorMessage-QW4GXCEn.js";
8
8
  import { S as J } from "./StoreTokenModal-CyPiGrhJ.js";
@@ -1,11 +1,11 @@
1
- import { defineComponent as B, ref as p, inject as z, computed as k, watch as A, nextTick as F, onMounted as U, onUnmounted as Y, resolveComponent as q, createElementBlock as n, openBlock as a, createElementVNode as t, createCommentVNode as v, createTextVNode as N, toDisplayString as o, normalizeClass as E, createBlock as G, withDirectives as W, vModelText as J, Fragment as R, renderList as Q, createVNode as K, withCtx as Z } from "vue";
1
+ import { defineComponent as B, ref as p, inject as z, computed as k, watch as F, nextTick as A, onMounted as U, onUnmounted as Y, resolveComponent as q, createElementBlock as n, openBlock as a, createElementVNode as t, createCommentVNode as v, createTextVNode as N, toDisplayString as o, normalizeClass as E, createBlock as G, withDirectives as W, vModelText as J, Fragment as R, renderList as Q, createVNode as K, withCtx as Z } from "vue";
2
2
  import { R as j, c as x } from "./snowflake-CY1Gnu3y.js";
3
3
  import { D as ee } from "./DataTable-Bf7xeKSf.js";
4
4
  import { C as te } from "./CreateEditorFromDatasourcePopup-D5mwCk5D.js";
5
5
  import { _ as I } from "./_plugin-vue_export-helper-BzkwV_Yn.js";
6
6
  import se from "./LoadingButton-BdM3Rygq.js";
7
7
  import { K as H } from "./constants-BXXolEur.js";
8
- import { z as O } from "./queryExecutionService-obvMrWcu.js";
8
+ import { A as O } from "./queryExecutionService-KrjL0UCa.js";
9
9
  import { C as ae } from "./CodeBlock-CDWXUAiQ.js";
10
10
  const ne = B({
11
11
  name: "TableViewer",
@@ -82,17 +82,17 @@ const ne = B({
82
82
  }
83
83
  }
84
84
  };
85
- A(
85
+ F(
86
86
  () => e.table,
87
87
  async (y, f) => {
88
88
  const D = $(y), C = f ? $(f) : null;
89
- D !== C && (c.value = "", V.value && await L(), s.value === "data" && (await F(), g()));
89
+ D !== C && (c.value = "", V.value && await L(), s.value === "data" && (await A(), g()));
90
90
  },
91
91
  { immediate: !1 }
92
- ), A(s, async (y) => {
93
- y === "data" && (await F(), g());
92
+ ), F(s, async (y) => {
93
+ y === "data" && (await A(), g());
94
94
  }), U(async () => {
95
- T(), V.value && await L(), s.value === "data" && (await F(), g());
95
+ T(), V.value && await L(), s.value === "data" && (await A(), g());
96
96
  }), Y(() => {
97
97
  r();
98
98
  });
@@ -324,7 +324,7 @@ const Be = /* @__PURE__ */ I(ne, [["render", Qe], ["__scopeId", "data-v-d07fbaea
324
324
  }
325
325
  };
326
326
  }
327
- }), Me = { class: "database-display" }, Pe = { class: "database-display-body" }, Ve = { class: "header" }, ze = { class: "database-name" }, Fe = { class: "metadata-section" }, Ae = { class: "metadata-grid" }, je = { class: "metadata-item" }, Oe = { class: "metadata-value" }, Ue = { class: "metadata-item" }, Ge = { class: "metadata-value" }, We = { class: "schemas-section" }, Je = { class: "schemas-list" }, Xe = ["onClick"], Ye = { class: "schema-name" }, Ze = { class: "schema-details" }, xe = { class: "table-count" }, et = {
327
+ }), Me = { class: "database-display" }, Pe = { class: "database-display-body" }, Ve = { class: "header" }, ze = { class: "database-name" }, Ae = { class: "metadata-section" }, Fe = { class: "metadata-grid" }, je = { class: "metadata-item" }, Oe = { class: "metadata-value" }, Ue = { class: "metadata-item" }, Ge = { class: "metadata-value" }, We = { class: "schemas-section" }, Je = { class: "schemas-list" }, Xe = ["onClick"], Ye = { class: "schema-name" }, Ze = { class: "schema-details" }, xe = { class: "table-count" }, et = {
328
328
  key: 0,
329
329
  class: "schema-description"
330
330
  };
@@ -337,11 +337,11 @@ function tt(e, s, c, d, b, _) {
337
337
  s[0] || (s[0] = t("span", { class: "separator" }, "/", -1)),
338
338
  t("span", ze, o(e.database.name), 1)
339
339
  ]),
340
- t("div", Fe, [
340
+ t("div", Ae, [
341
341
  s[3] || (s[3] = t("div", { class: "section-header" }, [
342
342
  t("h3", null, "Database Overview")
343
343
  ], -1)),
344
- t("div", Ae, [
344
+ t("div", Fe, [
345
345
  t("div", je, [
346
346
  s[1] || (s[1] = t("span", { class: "metadata-label" }, "Name:", -1)),
347
347
  t("span", Oe, o(e.database.name), 1)
@@ -534,7 +534,7 @@ const Ht = /* @__PURE__ */ I(at, [["render", Lt], ["__scopeId", "data-v-eac58086
534
534
  }, Pt = {
535
535
  key: 3,
536
536
  class: "query-history-list"
537
- }, Vt = ["onClick"], zt = { class: "query-history-item-status" }, Ft = { class: "query-history-item-summary" }, At = { class: "query-history-item-preview" }, jt = { class: "query-history-item-meta" }, Ot = { title: "Execution time" }, Ut = { title: "Result size" }, Gt = { title: "Timestamp" }, Wt = { class: "query-history-item-expand" }, Jt = {
537
+ }, Vt = ["onClick"], zt = { class: "query-history-item-status" }, At = { class: "query-history-item-summary" }, Ft = { class: "query-history-item-preview" }, jt = { class: "query-history-item-meta" }, Ot = { title: "Execution time" }, Ut = { title: "Result size" }, Gt = { title: "Timestamp" }, Wt = { class: "query-history-item-expand" }, Jt = {
538
538
  key: 0,
539
539
  class: "query-history-item-details"
540
540
  }, Xt = {
@@ -571,7 +571,7 @@ const Ht = /* @__PURE__ */ I(at, [["render", Lt], ["__scopeId", "data-v-eac58086
571
571
  }, w = () => {
572
572
  d.value.clearHistory();
573
573
  };
574
- return A(
574
+ return F(
575
575
  () => s.connectionName,
576
576
  (h) => {
577
577
  b.value = {}, _.value = {}, d.value = O(h), g();
@@ -609,8 +609,8 @@ const Ht = /* @__PURE__ */ I(at, [["render", Lt], ["__scopeId", "data-v-eac58086
609
609
  onClick: (L) => l(r.id)
610
610
  }, [
611
611
  t("div", zt, o(r.status === "success" ? "✓" : "✗"), 1),
612
- t("div", Ft, [
613
- t("div", At, o(V(r.query, 50)), 1),
612
+ t("div", At, [
613
+ t("div", Ft, o(V(r.query, 50)), 1),
614
614
  t("div", jt, [
615
615
  t("span", Ot, o(P(r.executionTime)), 1),
616
616
  t("span", Ut, o(r.resultSize) + " rows", 1),