drizzle-cube 0.2.19 → 0.2.23

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 (51) hide show
  1. package/dist/adapters/{compiler-7cp4XzHx.js → compiler-DDXMrb9d.js} +2470 -2181
  2. package/dist/adapters/compiler-S2NEGW7Q.cjs +22 -0
  3. package/dist/adapters/express/index.cjs +1 -1
  4. package/dist/adapters/express/index.js +1 -1
  5. package/dist/adapters/fastify/index.cjs +1 -1
  6. package/dist/adapters/fastify/index.js +1 -1
  7. package/dist/adapters/hono/index.cjs +1 -1
  8. package/dist/adapters/hono/index.js +1 -1
  9. package/dist/adapters/nextjs/index.cjs +1 -1
  10. package/dist/adapters/nextjs/index.js +1 -1
  11. package/dist/client/charts.js +2 -2
  12. package/dist/client/chunks/{charts-B8YMw1mi.js → charts--hFH-bsu.js} +2238 -2045
  13. package/dist/client/chunks/charts--hFH-bsu.js.map +1 -0
  14. package/dist/client/chunks/{charts-amt7VOyw.js → charts-DboFPJFN.js} +32 -32
  15. package/dist/client/chunks/{charts-amt7VOyw.js.map → charts-DboFPJFN.js.map} +1 -1
  16. package/dist/client/chunks/{components-K3xrnHN-.js → components-D7wTB56l.js} +8330 -7897
  17. package/dist/client/chunks/components-D7wTB56l.js.map +1 -0
  18. package/dist/client/chunks/core-PxWXpBbW.js +6 -0
  19. package/dist/client/chunks/core-PxWXpBbW.js.map +1 -0
  20. package/dist/client/chunks/{icons-B2XSxpVK.js → icons-DI4Xack3.js} +126 -120
  21. package/dist/client/chunks/icons-DI4Xack3.js.map +1 -0
  22. package/dist/client/chunks/{index-B7NSVb33.js → index-yc7cf-yE.js} +2 -2
  23. package/dist/client/chunks/{index-B7NSVb33.js.map → index-yc7cf-yE.js.map} +1 -1
  24. package/dist/client/components/AnalysisBuilder/types.d.ts +9 -0
  25. package/dist/client/components/FloatingEditToolbar.d.ts +28 -0
  26. package/dist/client/components/charts/ChartTooltip.d.ts +1 -1
  27. package/dist/client/components.js +2 -2
  28. package/dist/client/hooks/useElementVisibility.d.ts +30 -0
  29. package/dist/client/hooks/useScrollDetection.d.ts +3 -1
  30. package/dist/client/hooks.js +2 -2
  31. package/dist/client/icons/types.d.ts +1 -0
  32. package/dist/client/icons.js +1 -1
  33. package/dist/client/index.d.ts +1 -0
  34. package/dist/client/index.js +46 -45
  35. package/dist/client/providers.js +1 -1
  36. package/dist/client/shared/components/CodeBlock.d.ts +1 -0
  37. package/dist/client/styles.css +1 -1
  38. package/dist/client/types.d.ts +20 -0
  39. package/dist/client/utils/comparisonUtils.d.ts +96 -0
  40. package/dist/client/utils/index.d.ts +1 -0
  41. package/dist/client-bundle-stats.html +1 -1
  42. package/dist/server/index.cjs +16 -16
  43. package/dist/server/index.d.ts +44 -0
  44. package/dist/server/index.js +3164 -2875
  45. package/package.json +1 -1
  46. package/dist/adapters/compiler-CITtZq3r.cjs +0 -22
  47. package/dist/client/chunks/charts-B8YMw1mi.js.map +0 -1
  48. package/dist/client/chunks/components-K3xrnHN-.js.map +0 -1
  49. package/dist/client/chunks/core-Dkym7d1O.js +0 -6
  50. package/dist/client/chunks/core-Dkym7d1O.js.map +0 -1
  51. package/dist/client/chunks/icons-B2XSxpVK.js.map +0 -1
@@ -27,6 +27,8 @@ export interface BreakdownItem {
27
27
  granularity?: string;
28
28
  /** Whether this is a time dimension */
29
29
  isTimeDimension: boolean;
30
+ /** Enable period comparison for time dimensions (compares current filter period vs prior period) */
31
+ enableComparison?: boolean;
30
32
  }
31
33
  /** Validation status for query building */
32
34
  export type ValidationStatus = 'idle' | 'validating' | 'valid' | 'invalid';
@@ -168,6 +170,7 @@ export interface AnalysisQueryPanelProps {
168
170
  onAddBreakdown: () => void;
169
171
  onRemoveBreakdown: (id: string) => void;
170
172
  onBreakdownGranularityChange: (id: string, granularity: string) => void;
173
+ onBreakdownComparisonToggle?: (id: string) => void;
171
174
  onReorderBreakdowns?: (fromIndex: number, toIndex: number) => void;
172
175
  onFiltersChange: (filters: Filter[]) => void;
173
176
  onDropFieldToFilter?: (field: string) => void;
@@ -284,6 +287,8 @@ export interface BreakdownSectionProps {
284
287
  onRemove: (id: string) => void;
285
288
  /** Change granularity for time dimension */
286
289
  onGranularityChange: (id: string, granularity: string) => void;
290
+ /** Toggle comparison for time dimension */
291
+ onComparisonToggle?: (id: string) => void;
287
292
  /** Whether the section is expanded */
288
293
  isExpanded?: boolean;
289
294
  /** Toggle expansion */
@@ -340,6 +345,10 @@ export interface BreakdownItemCardProps {
340
345
  onRemove: () => void;
341
346
  /** Granularity change handler (for time dimensions) */
342
347
  onGranularityChange?: (granularity: string) => void;
348
+ /** Toggle comparison for time dimensions */
349
+ onComparisonToggle?: () => void;
350
+ /** Whether another time dimension already has comparison enabled */
351
+ comparisonDisabled?: boolean;
343
352
  /** Current sort direction for this field */
344
353
  sortDirection?: 'asc' | 'desc' | null;
345
354
  /** Sort priority (1, 2, 3...) if sorted */
@@ -0,0 +1,28 @@
1
+ import { default as React } from 'react';
2
+ import { DashboardLayoutMode } from '../types';
3
+ interface FloatingEditToolbarProps {
4
+ /** Whether the static edit bar is visible (toolbar hidden when true) */
5
+ isEditBarVisible: boolean;
6
+ /** Position of the floating toolbar */
7
+ position: 'left' | 'right';
8
+ /** Whether currently in edit mode */
9
+ isEditMode: boolean;
10
+ /** Toggle edit mode on/off */
11
+ onEditModeToggle: () => void;
12
+ /** Current layout mode */
13
+ layoutMode: DashboardLayoutMode;
14
+ /** Change layout mode */
15
+ onLayoutModeChange: (mode: DashboardLayoutMode) => void;
16
+ /** Available layout modes */
17
+ allowedModes: DashboardLayoutMode[];
18
+ /** Whether layout mode can be changed */
19
+ canChangeLayoutMode: boolean;
20
+ /** Current color palette name */
21
+ currentPalette: string;
22
+ /** Change color palette */
23
+ onPaletteChange: (palette: string) => void;
24
+ /** Add new portlet */
25
+ onAddPortlet: () => void;
26
+ }
27
+ export default function FloatingEditToolbar({ isEditBarVisible, position, isEditMode, onEditModeToggle, layoutMode, onLayoutModeChange, allowedModes, canChangeLayoutMode, currentPalette, onPaletteChange, onAddPortlet }: FloatingEditToolbarProps): React.ReactPortal | null;
28
+ export {};
@@ -1,7 +1,7 @@
1
1
  import { default as React } from 'react';
2
2
  interface ChartTooltipProps {
3
3
  formatter?: (value: any, name: any, props: any) => [React.ReactText, React.ReactText];
4
- labelFormatter?: (label: any) => React.ReactText;
4
+ labelFormatter?: (label: any, payload?: readonly any[]) => React.ReactText;
5
5
  }
6
6
  export default function ChartTooltip({ formatter, labelFormatter }: ChartTooltipProps): import("react/jsx-runtime").JSX.Element;
7
7
  export {};
@@ -1,5 +1,5 @@
1
- import { a as t, A as s, d as o, D as r, M as d, P as l, b as i, Q as n } from "./chunks/components-K3xrnHN-.js";
2
- import { c as b, j as u, h as y, e as c, d as h, v as D } from "./chunks/charts-amt7VOyw.js";
1
+ import { a as t, A as s, d as o, D as r, M as d, P as l, b as i, Q as n } from "./chunks/components-D7wTB56l.js";
2
+ import { c as b, j as u, h as y, e as c, d as h, v as D } from "./chunks/charts-DboFPJFN.js";
3
3
  export {
4
4
  t as AnalyticsDashboard,
5
5
  s as AnalyticsPortlet,
@@ -0,0 +1,30 @@
1
+ import { RefObject } from 'react';
2
+ interface UseElementVisibilityOptions {
3
+ /** Threshold in pixels - element considered out of view when this much scrolls past top */
4
+ threshold?: number;
5
+ /** Debounce delay in milliseconds */
6
+ debounceMs?: number;
7
+ /** Custom scroll container ref (uses viewport if not provided) */
8
+ containerRef?: RefObject<HTMLElement | null>;
9
+ /** Optional state value to trigger re-initialization when container is found */
10
+ container?: HTMLElement | null;
11
+ }
12
+ /**
13
+ * Hook to detect whether an element is visible in the viewport/container
14
+ *
15
+ * @param elementRef - Ref to the element to track
16
+ * @param options - Configuration options
17
+ * @returns Boolean indicating if the element is visible (true when in view, false when scrolled out)
18
+ *
19
+ * @example
20
+ * const editBarRef = useRef<HTMLDivElement>(null)
21
+ * const isEditBarVisible = useElementVisibility(editBarRef, {
22
+ * threshold: 80,
23
+ * containerRef: scrollContainerRef
24
+ * })
25
+ *
26
+ * // Show floating toolbar when edit bar scrolls out of view
27
+ * {!isEditBarVisible && <FloatingToolbar />}
28
+ */
29
+ export declare function useElementVisibility(elementRef: RefObject<HTMLElement | null>, { threshold, debounceMs, containerRef, container }?: UseElementVisibilityOptions): boolean;
30
+ export {};
@@ -4,6 +4,8 @@ interface UseScrollDetectionOptions {
4
4
  threshold?: number;
5
5
  /** Debounce delay in milliseconds (default: 150) */
6
6
  debounceMs?: number;
7
+ /** Optional container state to trigger re-initialization when found */
8
+ container?: HTMLElement | null;
7
9
  }
8
10
  /**
9
11
  * Hook to detect scroll position in a container
@@ -23,5 +25,5 @@ interface UseScrollDetectionOptions {
23
25
  * {isScrolled && <div>Shadow visible</div>}
24
26
  * </div>
25
27
  */
26
- export declare function useScrollDetection(containerRef: RefObject<HTMLElement>, { threshold, debounceMs }?: UseScrollDetectionOptions): boolean;
28
+ export declare function useScrollDetection(containerRef: RefObject<HTMLElement | null>, { threshold, debounceMs, container }?: UseScrollDetectionOptions): boolean;
27
29
  export {};
@@ -1,6 +1,6 @@
1
1
  import { useState as b, useRef as w, useEffect as y, useCallback as C, useMemo as m } from "react";
2
- import { u as L } from "./chunks/charts-B8YMw1mi.js";
3
- import { K as F } from "./chunks/charts-B8YMw1mi.js";
2
+ import { u as L } from "./chunks/charts--hFH-bsu.js";
3
+ import { K as F } from "./chunks/charts--hFH-bsu.js";
4
4
  function W(e, r = {}) {
5
5
  const { cubeApi: s, batchCoordinator: u, enableBatching: a } = L(), [l, d] = b({
6
6
  resultSet: null,
@@ -59,6 +59,7 @@ export interface IconRegistry {
59
59
  documentText: IconDefinition;
60
60
  bookOpen: IconDefinition;
61
61
  codeBracket: IconDefinition;
62
+ swatch: IconDefinition;
62
63
  measure: IconDefinition;
63
64
  dimension: IconDefinition;
64
65
  timeDimension: IconDefinition;
@@ -1,4 +1,4 @@
1
- import { D as a, x as t, y as o, l as n, m as I, q as c, t as g, v as r, o as y, p, n as T } from "./chunks/charts-B8YMw1mi.js";
1
+ import { D as a, x as t, y as o, l as n, m as I, q as c, t as g, v as r, o as y, p, n as T } from "./chunks/charts--hFH-bsu.js";
2
2
  export {
3
3
  a as DEFAULT_ICONS,
4
4
  t as getChartTypeIcon,
@@ -21,6 +21,7 @@ export { useCubeFieldLabel } from './hooks/useCubeFieldLabel';
21
21
  export { createCubeClient } from './client/CubeClient';
22
22
  export { useTheme } from './hooks/useTheme';
23
23
  export { useScrollDetection } from './hooks/useScrollDetection';
24
+ export { useElementVisibility } from './hooks/useElementVisibility';
24
25
  export type { PortletConfig, ChartType, ChartAxisConfig, ChartDisplayConfig, CubeQuery, CubeQueryOptions, CubeApiOptions, DashboardConfig } from './types';
25
26
  export type { ChartTypeConfig, DisplayOptionConfig, AxisDropZoneConfig } from './charts/chartConfigs';
26
27
  export { createDashboardLayout, formatChartData, highlightCodeBlocks } from './utils/index';
@@ -1,59 +1,60 @@
1
- import { e as s, a as t, A as r, d as o, D as l, M as i, c as n, P as d, b as h, Q as u, h as C, u as c } from "./chunks/components-K3xrnHN-.js";
2
- import { C as b, D as y, L as p, T, h as m, e as I, x as D, y as M, l as f, m as A, q as P, t as x, v as E, i as L, g as S, k as v, o as B, p as F, r as k, n as Q, j as V, s as w, a as R, u as _, c as j, d as q, b as z, f as G, w as H } from "./chunks/charts-B8YMw1mi.js";
3
- import { L as O, c as U, f as J, g as K, i as W, p as X, a as Y } from "./chunks/charts-amt7VOyw.js";
4
- import { ScrollContainerProvider as $, useScrollContainer as aa } from "./providers.js";
5
- import { useCubeQuery as sa } from "./hooks.js";
1
+ import { e as s, a as t, A as r, d as o, D as i, M as l, c as n, P as u, b as d, Q as h, h as C, f as c, u as b } from "./chunks/components-D7wTB56l.js";
2
+ import { C as y, D as p, L as T, T as m, h as I, e as D, x as f, y as M, l as A, m as E, q as P, t as x, v as L, i as S, g as v, k as B, o as F, p as V, r as k, n as Q, j as w, s as R, a as _, u as j, c as q, d as z, b as G, f as H, w as N } from "./chunks/charts--hFH-bsu.js";
3
+ import { L as U, c as J, f as K, g as W, i as X, p as Y, a as Z } from "./chunks/charts-DboFPJFN.js";
4
+ import { ScrollContainerProvider as aa, useScrollContainer as ea } from "./providers.js";
5
+ import { useCubeQuery as ta } from "./hooks.js";
6
6
  export {
7
7
  s as AnalysisBuilder,
8
8
  t as AnalyticsDashboard,
9
9
  r as AnalyticsPortlet,
10
- b as CubeProvider,
11
- y as DEFAULT_ICONS,
10
+ y as CubeProvider,
11
+ p as DEFAULT_ICONS,
12
12
  o as DashboardEditModal,
13
- l as DashboardGrid,
14
- O as LazyChart,
15
- p as LoadingIndicator,
16
- i as Modal,
13
+ i as DashboardGrid,
14
+ U as LazyChart,
15
+ T as LoadingIndicator,
16
+ l as Modal,
17
17
  n as PortletAnalysisModal,
18
- d as PortletContainer,
19
- h as PortletEditModal,
20
- u as QueryBuilder,
21
- $ as ScrollContainerProvider,
22
- T as THEME_PRESETS,
23
- m as applyTheme,
24
- I as createCubeClient,
25
- U as createDashboardLayout,
26
- J as formatChartData,
27
- K as getAvailableChartTypes,
28
- D as getChartTypeIcon,
18
+ u as PortletContainer,
19
+ d as PortletEditModal,
20
+ h as QueryBuilder,
21
+ aa as ScrollContainerProvider,
22
+ m as THEME_PRESETS,
23
+ I as applyTheme,
24
+ D as createCubeClient,
25
+ J as createDashboardLayout,
26
+ K as formatChartData,
27
+ W as getAvailableChartTypes,
28
+ f as getChartTypeIcon,
29
29
  M as getFieldTypeIcon,
30
- f as getIcon,
31
- A as getIconData,
30
+ A as getIcon,
31
+ E as getIconData,
32
32
  P as getIconRegistry,
33
33
  x as getIconsByCategory,
34
- E as getMeasureTypeIcon,
35
- L as getTheme,
36
- S as getThemeVariable,
34
+ L as getMeasureTypeIcon,
35
+ S as getTheme,
36
+ v as getThemeVariable,
37
37
  C as highlightCodeBlocks,
38
- v as isDarkMode,
39
- W as isValidChartType,
40
- X as preloadChart,
41
- Y as preloadCharts,
42
- B as registerIcons,
43
- F as resetIcons,
38
+ B as isDarkMode,
39
+ X as isValidChartType,
40
+ Y as preloadChart,
41
+ Z as preloadCharts,
42
+ F as registerIcons,
43
+ V as resetIcons,
44
44
  k as resetTheme,
45
45
  Q as setIcon,
46
- V as setTheme,
47
- w as setThemeVariable,
48
- R as useCubeApi,
49
- _ as useCubeContext,
50
- j as useCubeFeatures,
51
- q as useCubeFieldLabel,
52
- z as useCubeMeta,
53
- sa as useCubeQuery,
54
- aa as useScrollContainer,
55
- c as useScrollDetection,
56
- G as useTheme,
57
- H as watchThemeChanges
46
+ w as setTheme,
47
+ R as setThemeVariable,
48
+ _ as useCubeApi,
49
+ j as useCubeContext,
50
+ q as useCubeFeatures,
51
+ z as useCubeFieldLabel,
52
+ G as useCubeMeta,
53
+ ta as useCubeQuery,
54
+ c as useElementVisibility,
55
+ ea as useScrollContainer,
56
+ b as useScrollDetection,
57
+ H as useTheme,
58
+ N as watchThemeChanges
58
59
  };
59
60
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import { C as a, e as c, u as i } from "./chunks/charts-B8YMw1mi.js";
1
+ import { C as a, e as c, u as i } from "./chunks/charts--hFH-bsu.js";
2
2
  import { createContext as o, useContext as t } from "react";
3
3
  const e = o(null), n = e.Provider, C = () => t(e);
4
4
  export {
@@ -4,6 +4,7 @@ interface CodeBlockProps {
4
4
  language: 'json' | 'sql';
5
5
  title?: string;
6
6
  maxHeight?: string;
7
+ height?: string;
7
8
  className?: string;
8
9
  }
9
10
  export declare const CodeBlock: React.FC<CodeBlockProps>;