@burdenoff/microfe-bigconsole 2026.1017.11 → 2026.1019.1

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.
@@ -47,22 +47,20 @@ var b = p(function({ dashboardId: p, pageId: b, title: x, onPaste: ge, onSave: _
47
47
  id: p,
48
48
  value: t.visibility ?? e
49
49
  });
50
- }, [p, R]), { workspaceId: z, apiGatewayUrl: B, authToken: V } = r(), { installedWidgets: Re, loading: ze } = f({
50
+ }, [p, R]), { workspaceId: z, apiGatewayUrl: Re, authToken: ze } = r(), { installedWidgets: Be, loading: Ve } = f({
51
51
  workspaceId: z,
52
- apiGatewayUrl: B,
53
- authToken: V,
54
52
  enabled: F
55
- }), { definitions: Be } = s({
53
+ }), { definitions: He } = s({
56
54
  workspaceId: z,
57
- apiGatewayUrl: B,
58
- authToken: V,
55
+ apiGatewayUrl: Re,
56
+ authToken: ze,
59
57
  enabled: F
60
- }), H = t((e) => e.zoomLevel), U = t((e) => e.sidebarCollapsed), W = t((e) => e.toggleSidebar), G = !U, K = t((e) => e.setGlobalFilterValues), Ve = m((e) => {
61
- K(e);
62
- }, [K]), { createWidget: q } = a(b, p, { skipFetch: !0 }), J = e((e) => e.widgets), Y = fe(() => {
63
- let e = Array.from(J.values());
58
+ }), B = t((e) => e.zoomLevel), V = t((e) => e.sidebarCollapsed), H = t((e) => e.toggleSidebar), U = !V, W = t((e) => e.setGlobalFilterValues), Ue = m((e) => {
59
+ W(e);
60
+ }, [W]), { createWidget: G } = a(b, p, { skipFetch: !0 }), K = e((e) => e.widgets), q = fe(() => {
61
+ let e = Array.from(K.values());
64
62
  return b ? e.filter((e) => e.pageId === b) : e;
65
- }, [J, b]), He = e((e) => e.selectedWidgetId), X = e((e) => e.selectWidget), Ue = e((e) => e.addWidget), Z = e((e) => e.updateWidgetPosition), We = e((e) => e.configPanelOpen), Ge = e((e) => e.closeConfigPanel);
63
+ }, [K, b]), We = e((e) => e.selectedWidgetId), J = e((e) => e.selectWidget), Y = e((e) => e.addWidget), X = e((e) => e.updateWidgetPosition), Z = e((e) => e.configPanelOpen), Ge = e((e) => e.closeConfigPanel);
66
64
  de(() => {
67
65
  let e = T.current;
68
66
  if (!e) return;
@@ -77,16 +75,16 @@ var b = p(function({ dashboardId: p, pageId: b, title: x, onPaste: ge, onSave: _
77
75
  }, []);
78
76
  let Ke = m((e) => {
79
77
  e.forEach((e) => {
80
- Z(e.i, {
78
+ X(e.i, {
81
79
  x: e.x,
82
80
  y: e.y,
83
81
  width: e.w,
84
82
  height: e.h
85
83
  });
86
84
  });
87
- }, [Z]), qe = m((e) => {
88
- X(e);
89
- }, [X]), Q = m(async (e, t) => {
85
+ }, [X]), qe = m((e) => {
86
+ J(e);
87
+ }, [J]), Q = m(async (e, t) => {
90
88
  A(null);
91
89
  let n = t?.definition || (e.type ? o(e.type) : null), r = d(), i = {
92
90
  width: Math.min(n?.defaultSize?.width ?? 4, L),
@@ -94,7 +92,7 @@ var b = p(function({ dashboardId: p, pageId: b, title: x, onPaste: ge, onSave: _
94
92
  }, a;
95
93
  if (t?.position) a = t.position;
96
94
  else {
97
- let { x: e, y: t } = le(Y, i, { cols: L });
95
+ let { x: e, y: t } = le(q, i, { cols: L });
98
96
  a = {
99
97
  x: e,
100
98
  y: t,
@@ -104,7 +102,7 @@ var b = p(function({ dashboardId: p, pageId: b, title: x, onPaste: ge, onSave: _
104
102
  }
105
103
  let s = e;
106
104
  if (b) {
107
- let t = await q({
105
+ let t = await G({
108
106
  pageId: b,
109
107
  dashboardId: p,
110
108
  type: e.type,
@@ -119,7 +117,7 @@ var b = p(function({ dashboardId: p, pageId: b, title: x, onPaste: ge, onSave: _
119
117
  parserId: s.parserId
120
118
  });
121
119
  if (t) {
122
- X(t.id);
120
+ J(t.id);
123
121
  return;
124
122
  }
125
123
  A(w("bigconsole.dashboards.canvas.widgetCreateError", "Could not create the widget. Check the connection and try again."));
@@ -147,14 +145,14 @@ var b = p(function({ dashboardId: p, pageId: b, title: x, onPaste: ge, onSave: _
147
145
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
148
146
  updatedAt: (/* @__PURE__ */ new Date()).toISOString()
149
147
  };
150
- Ue(c), X(c.id);
148
+ Y(c), J(c.id);
151
149
  }, [
152
150
  p,
153
151
  b,
154
- q,
155
- Ue,
156
- X,
152
+ G,
157
153
  Y,
154
+ J,
155
+ q,
158
156
  L,
159
157
  w
160
158
  ]), Je = m((e) => {
@@ -212,15 +210,15 @@ var b = p(function({ dashboardId: p, pageId: b, title: x, onPaste: ge, onSave: _
212
210
  config: n.defaultConfig
213
211
  });
214
212
  }, [Q]), $e = m(() => {
215
- W();
216
- }, [W]), et = m(() => {
217
- U && W(), window.requestAnimationFrame(() => {
213
+ H();
214
+ }, [H]), et = m(() => {
215
+ V && H(), window.requestAnimationFrame(() => {
218
216
  let e = w("bigconsole.dashboards.widgetPalette.searchPlaceholder", "Search widgets...");
219
217
  document.querySelector(`input[placeholder="${e}"]`)?.focus();
220
218
  });
221
219
  }, [
222
- U,
223
- W,
220
+ V,
221
+ H,
224
222
  w
225
223
  ]), { exportPNG: tt, exportPDF: $, isExporting: nt } = l({
226
224
  containerRef: E,
@@ -234,7 +232,7 @@ var b = p(function({ dashboardId: p, pageId: b, title: x, onPaste: ge, onSave: _
234
232
  title: x,
235
233
  onAddWidget: et,
236
234
  onTogglePalette: $e,
237
- isPaletteOpen: G,
235
+ isPaletteOpen: U,
238
236
  onPaste: ge,
239
237
  onSave: _e,
240
238
  isSaving: ve,
@@ -268,16 +266,16 @@ var b = p(function({ dashboardId: p, pageId: b, title: x, onPaste: ge, onSave: _
268
266
  })
269
267
  }),
270
268
  /* @__PURE__ */ v(ie, {
271
- widgets: Y,
269
+ widgets: q,
272
270
  isEditMode: F
273
271
  }),
274
272
  /* @__PURE__ */ v(re, {
275
- widgets: Y,
273
+ widgets: q,
276
274
  isEditMode: F
277
275
  }),
278
276
  De && /* @__PURE__ */ v(ne, {
279
277
  dashboardId: p,
280
- onFilterChange: Ve,
278
+ onFilterChange: Ue,
281
279
  collapsible: !0
282
280
  }),
283
281
  Oe && (F || S.length > 0) && /* @__PURE__ */ v(ae, {
@@ -295,16 +293,16 @@ var b = p(function({ dashboardId: p, pageId: b, title: x, onPaste: ge, onSave: _
295
293
  }),
296
294
  /* @__PURE__ */ y("div", {
297
295
  "data-testid": "dashboard-canvas-panes",
298
- className: `flex flex-1 min-w-0 overflow-hidden ${We ? "lg:mr-[var(--bc-inspector-width,420px)]" : ""}`,
296
+ className: `flex flex-1 min-w-0 overflow-hidden ${Z ? "lg:mr-[var(--bc-inspector-width,420px)]" : ""}`,
299
297
  children: [F && /* @__PURE__ */ v(se, {
300
- isOpen: G,
298
+ isOpen: U,
301
299
  onClose: $e,
302
300
  onWidgetSelect: Qe,
303
301
  onDragStart: Je,
304
302
  onDragEnd: Ye,
305
- installedWidgets: Re,
306
- installedWidgetsLoading: ze,
307
- definitions: Be
303
+ installedWidgets: Be,
304
+ installedWidgetsLoading: Ve,
305
+ definitions: He
308
306
  }), /* @__PURE__ */ y("div", {
309
307
  ref: T,
310
308
  role: "region",
@@ -315,7 +313,7 @@ var b = p(function({ dashboardId: p, pageId: b, title: x, onPaste: ge, onSave: _
315
313
  onDrop: Xe,
316
314
  onDragOver: Ze,
317
315
  onClick: () => {
318
- F && X(null);
316
+ F && J(null);
319
317
  },
320
318
  style: j ? {
321
319
  borderStyle: "dashed",
@@ -354,20 +352,20 @@ var b = p(function({ dashboardId: p, pageId: b, title: x, onPaste: ge, onSave: _
354
352
  ref: E,
355
353
  className: "min-h-full origin-top-left transition-transform",
356
354
  style: {
357
- transform: `scale(${H / 100})`,
358
- width: `${100 / (H / 100)}%`
355
+ transform: `scale(${B / 100})`,
356
+ width: `${100 / (B / 100)}%`
359
357
  },
360
- children: Y.length > 0 ? /* @__PURE__ */ v(n, {
358
+ children: q.length > 0 ? /* @__PURE__ */ v(n, {
361
359
  enabled: ke,
362
360
  onCrossFilter: (e) => {},
363
361
  children: /* @__PURE__ */ v(ee, {
364
- widgets: Y,
362
+ widgets: q,
365
363
  cols: L,
366
364
  isEditMode: F,
367
365
  width: D,
368
366
  onLayoutChange: Ke,
369
367
  onWidgetSelect: qe,
370
- selectedWidgetId: He
368
+ selectedWidgetId: We
371
369
  })
372
370
  }) : /* @__PURE__ */ v("div", {
373
371
  className: "flex min-h-[min(400px,60vh)] items-center justify-center p-card-padding",
@@ -388,7 +386,7 @@ var b = p(function({ dashboardId: p, pageId: b, title: x, onPaste: ge, onSave: _
388
386
  })]
389
387
  }),
390
388
  /* @__PURE__ */ v(ue, {
391
- isOpen: We,
389
+ isOpen: Z,
392
390
  onClose: Ge
393
391
  }),
394
392
  /* @__PURE__ */ v(oe, {
@@ -0,0 +1,12 @@
1
+ import { ApolloClient } from '@apollo/client';
2
+ import { WorkspaceInstalledAppsQuery } from '../../generated/wspace-operations';
3
+ export type InstalledApp = WorkspaceInstalledAppsQuery['workspaceInstalledApps'][number];
4
+ /**
5
+ * Loads the workspace's store-installed apps through the shared Apollo client.
6
+ *
7
+ * The shared transport owns the gateway URL and BOTH authentication tokens
8
+ * (authtoken + workspacetoken) — the workspace public gateway rejects a request
9
+ * that carries only one, and it strips a client-supplied `x-workspace-id`. A raw
10
+ * `fetch` therefore cannot authenticate in an embedded product shell.
11
+ */
12
+ export declare function loadInstalledApps(client: ApolloClient, workspaceId: string): Promise<InstalledApp[]>;
@@ -0,0 +1,16 @@
1
+ import { WorkspaceInstalledAppsDocument as e } from "../../generated/wspace-operations.js";
2
+ //#region src/bigconsole/graphql/installedApps.ts
3
+ async function t(t, n) {
4
+ return (await t.query({
5
+ query: e,
6
+ fetchPolicy: "no-cache",
7
+ errorPolicy: "none",
8
+ context: {
9
+ requiredWorkspaceAuth: !0,
10
+ requiredWorkspaceId: n,
11
+ queryDeduplication: !1
12
+ }
13
+ })).data?.workspaceInstalledApps ?? [];
14
+ }
15
+ //#endregion
16
+ export { t as loadInstalledApps };
@@ -1,11 +1,12 @@
1
+ import { InstalledApp } from '../graphql/installedApps';
1
2
  import { WidgetDefinition } from '../components/widgets/WidgetRegistry';
2
3
  export interface UseInstalledWidgetsParams {
3
4
  workspaceId?: string;
4
- apiGatewayUrl?: string;
5
- authToken?: string;
6
5
  /** When false, the query is skipped entirely (e.g. in read-only/view mode). */
7
6
  enabled?: boolean;
8
7
  }
8
+ /** Maps enabled store-installed widget apps to palette definitions. */
9
+ export declare function toInstalledWidgetDefinitions(apps: readonly InstalledApp[] | undefined): WidgetDefinition[];
9
10
  export declare function useInstalledWidgets(params?: UseInstalledWidgetsParams): {
10
11
  installedWidgets: WidgetDefinition[];
11
12
  loading: boolean;
@@ -1,79 +1,67 @@
1
- import { WorkspaceInstalledAppsDocument as e } from "../../generated/wspace-operations.js";
1
+ import { loadInstalledApps as e } from "../graphql/installedApps.js";
2
2
  import { useEffect as t, useMemo as n } from "react";
3
- import { useQuery as r } from "@tanstack/react-query";
4
- import { print as i } from "graphql";
3
+ import { useApolloClient as r } from "@apollo/client/react";
4
+ import { useQuery as i } from "@tanstack/react-query";
5
5
  //#region src/bigconsole/hooks/useInstalledWidgets.ts
6
- function a(a = {}) {
7
- let { workspaceId: o, apiGatewayUrl: s, authToken: c, enabled: l = !0 } = a, { data: u, isLoading: d, error: f } = r({
8
- queryKey: ["installedWidgets", o],
9
- queryFn: async () => {
10
- let t = {
11
- "Content-Type": "application/json",
12
- "x-workspace-id": o
13
- };
14
- c && (t.Authorization = `Bearer ${c}`);
15
- let n = s ? `${s}/workspaces/graphql` : "/workspaces/graphql", r = await fetch(n, {
16
- method: "POST",
17
- headers: t,
18
- body: JSON.stringify({ query: i(e) })
19
- });
20
- if (!r.ok) throw Error(`Failed to fetch installed apps: ${r.status}`);
21
- let a = await r.json();
22
- if (a.errors?.length) throw Error(a.errors[0].message);
23
- return a.data?.workspaceInstalledApps ?? [];
24
- },
25
- enabled: l && !!o,
6
+ function a(e) {
7
+ return e ? e.filter((e) => e.type.toLowerCase() === "widget" && e.isEnabled).map((e) => {
8
+ let t = e.manifest ?? {};
9
+ return {
10
+ type: "custom",
11
+ name: e.displayName,
12
+ description: `Installed: ${e.displayName} v${e.version}`,
13
+ icon: "Puzzle",
14
+ category: "Installed",
15
+ component: null,
16
+ defaultConfig: {
17
+ componentId: e.appName,
18
+ storeProductId: t.productId ?? null,
19
+ storeIcon: t.icon ?? null,
20
+ isStoreWidget: !0
21
+ },
22
+ defaultSize: {
23
+ width: 4,
24
+ height: 4
25
+ },
26
+ defaultResponsive: {
27
+ xs: 12,
28
+ sm: 6,
29
+ md: 4,
30
+ lg: 4
31
+ },
32
+ minSize: {
33
+ width: 2,
34
+ height: 2
35
+ },
36
+ maxSize: {
37
+ width: 12,
38
+ height: 12
39
+ },
40
+ supportsDataBinding: !0,
41
+ supportsDrilldown: !1,
42
+ supportsAutoRefresh: !0,
43
+ tags: [
44
+ "installed",
45
+ "store",
46
+ e.appName
47
+ ]
48
+ };
49
+ }) : [];
50
+ }
51
+ function o(o = {}) {
52
+ let { workspaceId: s, enabled: c = !0 } = o, l = r(), { data: u, isLoading: d, error: f } = i({
53
+ queryKey: ["installedWidgets", s],
54
+ queryFn: () => e(l, s),
55
+ enabled: c && !!s,
26
56
  staleTime: 300 * 1e3
27
57
  });
28
58
  return t(() => {
29
59
  f && console.warn("Failed to fetch installed widgets:", f.message);
30
60
  }, [f]), {
31
- installedWidgets: n(() => u ? u.filter((e) => e.type.toLowerCase() === "widget" && e.isEnabled).map((e) => {
32
- let t = e.manifest ?? {};
33
- return {
34
- type: "custom",
35
- name: e.displayName,
36
- description: `Installed: ${e.displayName} v${e.version}`,
37
- icon: "Puzzle",
38
- category: "Installed",
39
- component: null,
40
- defaultConfig: {
41
- componentId: e.appName,
42
- storeProductId: t.productId ?? null,
43
- storeIcon: t.icon ?? null,
44
- isStoreWidget: !0
45
- },
46
- defaultSize: {
47
- width: 4,
48
- height: 4
49
- },
50
- defaultResponsive: {
51
- xs: 12,
52
- sm: 6,
53
- md: 4,
54
- lg: 4
55
- },
56
- minSize: {
57
- width: 2,
58
- height: 2
59
- },
60
- maxSize: {
61
- width: 12,
62
- height: 12
63
- },
64
- supportsDataBinding: !0,
65
- supportsDrilldown: !1,
66
- supportsAutoRefresh: !0,
67
- tags: [
68
- "installed",
69
- "store",
70
- e.appName
71
- ]
72
- };
73
- }) : [], [u]),
61
+ installedWidgets: n(() => a(u), [u]),
74
62
  loading: d,
75
63
  error: f ?? void 0
76
64
  };
77
65
  }
78
66
  //#endregion
79
- export { a as useInstalledWidgets };
67
+ export { o as useInstalledWidgets };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-bigconsole",
3
- "version": "2026.1017.11",
3
+ "version": "2026.1019.1",
4
4
  "description": "BigConsole - AI-powered analytics and dashboard platform",
5
5
  "type": "module",
6
6
  "files": [