react-semaphor 0.1.231 → 0.1.233

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 (32) hide show
  1. package/dist/chunks/{dashboard-controls-D5LGwleP.js → dashboard-controls-B-JK6OPW.js} +1 -1
  2. package/dist/chunks/{dashboard-controls-WDfLhTmh.js → dashboard-controls-DtEL_e1o.js} +4 -4
  3. package/dist/chunks/{dashboard-json-BWWfRH2_.js → dashboard-json-DDcFNCBC.js} +1 -1
  4. package/dist/chunks/{dashboard-json-DXunjBeA.js → dashboard-json-dKHC2nd8.js} +1 -1
  5. package/dist/chunks/{dashboard-summary-settings-dialog-BzEEwHOF.js → dashboard-summary-settings-dialog-Bq6wavS4.js} +1 -1
  6. package/dist/chunks/{dashboard-summary-settings-dialog-CB5TScfc.js → dashboard-summary-settings-dialog-CLt3Wilb.js} +1 -1
  7. package/dist/chunks/{edit-dashboard-visual-Ct8MHaNG.js → edit-dashboard-visual-Cw-WinxH.js} +3609 -3339
  8. package/dist/chunks/edit-dashboard-visual-DPOvNFo6.js +182 -0
  9. package/dist/chunks/{editor-action-buttons-acRlz-51.js → editor-action-buttons-6Wim8skW.js} +1 -1
  10. package/dist/chunks/{editor-action-buttons-TCC22i95.js → editor-action-buttons-zPQktEhf.js} +2 -2
  11. package/dist/chunks/index-DA-adqwo.js +1103 -0
  12. package/dist/chunks/{index-BSv9U5tc.js → index-al-aDbkL.js} +23474 -22840
  13. package/dist/chunks/{notification-bell-z7oT5LAh.js → notification-bell-Ca_iD6ml.js} +1 -1
  14. package/dist/chunks/{notification-bell-a6BxRjVN.js → notification-bell-Cmuv8L1P.js} +3 -3
  15. package/dist/chunks/{resource-management-panel-6WdgxllK.js → resource-management-panel-CNvfKn4q.js} +1 -1
  16. package/dist/chunks/{resource-management-panel-BacphZKd.js → resource-management-panel-OgUs9H5R.js} +2 -2
  17. package/dist/chunks/{use-visual-utils-Bgi4-2vL.js → use-visual-utils-CzY5SwmA.js} +1 -1
  18. package/dist/chunks/{use-visual-utils-CUrMP3ER.js → use-visual-utils-DFIRotZh.js} +1 -1
  19. package/dist/dashboard/index.cjs +1 -1
  20. package/dist/dashboard/index.js +1 -1
  21. package/dist/index.cjs +1 -1
  22. package/dist/index.js +5 -5
  23. package/dist/surfboard/index.cjs +1 -1
  24. package/dist/surfboard/index.js +2 -2
  25. package/dist/types/dashboard.d.ts +40 -3
  26. package/dist/types/main.d.ts +40 -3
  27. package/dist/types/shared.d.ts +40 -3
  28. package/dist/types/surfboard.d.ts +40 -3
  29. package/dist/types/types.d.ts +40 -3
  30. package/package.json +1 -1
  31. package/dist/chunks/edit-dashboard-visual-CCQoz0-3.js +0 -182
  32. package/dist/chunks/index-CcysLOA4.js +0 -1103
@@ -1,4 +1,4 @@
1
- "use strict";const f=require("react"),t=require("./index-CcysLOA4.js"),e=require("react/jsx-runtime"),A=require("./editor-action-buttons-acRlz-51.js"),U=require("./use-visual-utils-CUrMP3ER.js"),I=require("./date-formatter-Sz6QDaM8.js");/**
1
+ "use strict";const f=require("react"),t=require("./index-DA-adqwo.js"),e=require("react/jsx-runtime"),A=require("./editor-action-buttons-6Wim8skW.js"),U=require("./use-visual-utils-DFIRotZh.js"),I=require("./date-formatter-Sz6QDaM8.js");/**
2
2
  * @license lucide-react v0.453.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,8 +1,8 @@
1
1
  import Z, { useState as D, useRef as M, useCallback as k, useEffect as L, useContext as ee } from "react";
2
- import { bK as te, b as O, aw as I, bH as B, bD as q, bE as $, ax as W, bC as ae, e as se, f as re, g as ne, h as oe, i as ie, L as _, cu as le, cA as ce, v as de, B as T, w as j, U as P, J as ue, u as F, K as me, N as Q, cB as he, cC as H, x as R, a9 as pe, c as U, c0 as fe, c1 as ge, a3 as ve, c3 as be, c4 as V, s as xe, c8 as we, b$ as ye, M as Ce, cD as Ne, cE as Ae, cF as De, ch as Ee, ci as Se, cj as Le, cG as Te, ck as Ie, cl as Ue, cm as ke, cn as Fe, co as Ve, am as Me, bJ as Pe, X as Re, cH as ze, cI as Oe, cJ as Be, bF as G, a5 as $e, az as je, P as _e, k as He, cK as Ge, l as Xe } from "./index-BSv9U5tc.js";
2
+ import { bK as te, b as O, aw as I, bH as B, bD as q, bE as $, ax as W, bC as ae, e as se, f as re, g as ne, h as oe, i as ie, L as _, cu as le, cA as ce, v as de, B as T, w as j, U as P, J as ue, u as F, K as me, N as Q, cB as he, cC as H, x as R, a9 as pe, c as U, c0 as fe, c1 as ge, a3 as ve, c3 as be, c4 as V, s as xe, c8 as we, b$ as ye, M as Ce, cD as Ne, cE as Ae, cF as De, ch as Ee, ci as Se, cj as Le, cG as Te, ck as Ie, cl as Ue, cm as ke, cn as Fe, co as Ve, am as Me, bJ as Pe, X as Re, cH as ze, cI as Oe, cJ as Be, bF as G, a5 as $e, az as je, P as _e, k as He, cK as Ge, l as Xe } from "./index-al-aDbkL.js";
3
3
  import { jsx as t, jsxs as n, Fragment as z } from "react/jsx-runtime";
4
- import { V as Je, E as Ke, a as qe, b as We, L as Qe, c as Ye, d as Ze, C as et } from "./editor-action-buttons-TCC22i95.js";
5
- import { a as Y } from "./use-visual-utils-Bgi4-2vL.js";
4
+ import { V as Je, E as Ke, a as qe, b as We, L as Qe, c as Ye, d as Ze, C as et } from "./editor-action-buttons-zPQktEhf.js";
5
+ import { a as Y } from "./use-visual-utils-CzY5SwmA.js";
6
6
  import { c as X } from "./date-formatter-Y8Za1ib3.js";
7
7
  /**
8
8
  * @license lucide-react v0.453.0 - ISC
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./index-CcysLOA4.js"),h=require("react"),re=require("./use-visual-utils-CUrMP3ER.js");/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./index-DA-adqwo.js"),h=require("react"),re=require("./use-visual-utils-DFIRotZh.js");/**
2
2
  * @license lucide-react v0.453.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,7 +1,7 @@
1
1
  import { jsx as e, jsxs as r, Fragment as le } from "react/jsx-runtime";
2
- import { bK as Pe, u as re, U as je, K as ce, bZ as Fe, b_ as ze, c as J, B as P, b$ as ie, c0 as Be, c1 as He, c2 as Ke, c3 as _e, c4 as Z, w as oe, c5 as $e, c6 as qe, c7 as Ge, c8 as ge, c9 as ue, ca as We, cb as Ye, cc as xe, cd as De, ce as we, cf as Ze, af as Ne, ab as ve, cg as ye, ch as Ce, ci as Se, cj as Ee, ck as Ve, cl as Le, cm as Ae, cn as Oe, co as Re, cp as Je, cq as he, cr as Qe, a9 as te, b as Xe, cs as Te, ct as ke, e as et, f as tt, g as rt, h as nt, i as ot, L as be, cu as de, v as st, cv as at, cw as it, cx as dt, bR as lt, bS as ct, bT as ut, bV as ht, cy as mt, cz as pt } from "./index-BSv9U5tc.js";
2
+ import { bK as Pe, u as re, U as je, K as ce, bZ as Fe, b_ as ze, c as J, B as P, b$ as ie, c0 as Be, c1 as He, c2 as Ke, c3 as _e, c4 as Z, w as oe, c5 as $e, c6 as qe, c7 as Ge, c8 as ge, c9 as ue, ca as We, cb as Ye, cc as xe, cd as De, ce as we, cf as Ze, af as Ne, ab as ve, cg as ye, ch as Ce, ci as Se, cj as Ee, ck as Ve, cl as Le, cm as Ae, cn as Oe, co as Re, cp as Je, cq as he, cr as Qe, a9 as te, b as Xe, cs as Te, ct as ke, e as et, f as tt, g as rt, h as nt, i as ot, L as be, cu as de, v as st, cv as at, cw as it, cx as dt, bR as lt, bS as ct, bT as ut, bV as ht, cy as mt, cz as pt } from "./index-al-aDbkL.js";
3
3
  import ft, { useRef as gt, useEffect as ne, useState as x } from "react";
4
- import { a as Ue } from "./use-visual-utils-Bgi4-2vL.js";
4
+ import { a as Ue } from "./use-visual-utils-CzY5SwmA.js";
5
5
  /**
6
6
  * @license lucide-react v0.453.0 - ISC
7
7
  *
@@ -1,4 +1,4 @@
1
- import { G as z, b as J, H as K, J as Y, K as X, M as H, N as Z, u as v, O as q, Q as ee, x as V, T as te, U as f } from "./index-BSv9U5tc.js";
1
+ import { G as z, b as J, H as K, J as Y, K as X, M as H, N as Z, u as v, O as q, Q as ee, x as V, T as te, U as f } from "./index-al-aDbkL.js";
2
2
  import { useState as j, useEffect as re, useCallback as D } from "react";
3
3
  function se(e) {
4
4
  const a = e.toUpperCase().indexOf("WHERE"), t = e.toUpperCase().indexOf("GROUP BY"), r = e.toUpperCase().indexOf("LIMIT"), s = e.toUpperCase().indexOf("ORDER BY");
@@ -1 +1 @@
1
- "use strict";const a=require("./index-CcysLOA4.js"),g=require("react");function H(e){const n=e.toUpperCase().indexOf("WHERE"),t=e.toUpperCase().indexOf("GROUP BY"),r=e.toUpperCase().indexOf("LIMIT"),s=e.toUpperCase().indexOf("ORDER BY");let c=e.length;if(s!==-1&&(c=s),r!==-1&&r<c&&(c=r),n!==-1){const d=e.substring(0,n),o=e.substring(n);return`${d} {{ filters | where }} AND ${o.substring(6)}`}else if(t!==-1){const d=e.substring(0,t),o=e.substring(t);return`${d} {{ filters | where }} ${o}`}else{const d=e.substring(0,c),o=e.substring(c);return console.log("beforeClause",d),console.log("afterClause",o),o?`${d} {{ filters | where }} ${o}`:`${d.replace(/;$/,"")} {{ filters | where }}`}}function k(e){const[n,t]=g.useState(null),[r,s]=g.useState(null),c=a.useEnsureReactGlobals();return g.useEffect(()=>{if(!e||e.trim()===""){t(null),s(null);return}if(!c)return;(async()=>{try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error(`Invalid URL format: ${e}`);try{new URL(e)}catch{throw new Error(`Invalid URL: ${e}`)}const l=`${e.endsWith("/")?e:`${e}/`}index.js`;try{if(!(await fetch(l,{method:"HEAD"})).ok)throw new Error(`Module not found at ${l}`)}catch{}const h=await import(l);if(typeof h.useChartStore!="function")throw new Error("useChartStore is not a function");t(()=>h.useChartStore),s(null)}catch(o){const l=o instanceof Error?o.message:"Unknown error";console.error("Failed to load remote chart store:",l),s(l),t(null)}})()},[e,c]),n}function Q(e,n){if(e.length===0)return"";const t=e.find(r=>{var s,c;return((s=r.customCardPreferences)==null?void 0:s.visualType)==="multiple"||!!((c=r.customCardPreferences)!=null&&c.dataInputCardIds)});if(t)return t.id;if(n){const r=e.find(s=>s.id===n);if(r){const s=r.tabTitle;if(s=="All__Header")return e[0].id;if(s&&s.endsWith("__Header")){const d=s.split("__")[0],o=e.find(l=>l.tabTitle===d);return o?o.id:e[0].id}return n}}return e[0].id}const z=e=>{if(!e||!("detailTableBackup"in e))return e;const{detailTableBackup:n,...t}=e;return t};async function W(e,n,t,r){if(!n||!t)throw new Error("Missing auth token or visual ID");const s=["resource-by-id","visual",t],c=r.getQueryData(s);if(c)return console.log("Using cached visual data for:",t),{data:c,fromCache:!0};console.log("Fetching visual data from network for:",t);const d=a.ue.loading("Loading visual...",{position:"top-center"});try{const o=await fetch(`${e}/management/v1/visuals/${t}`,{headers:{Authorization:`Bearer ${n}`}});if(!o.ok)throw new Error("Failed to load visual");const l=await o.json();return r.setQueryData(s,l),a.ue.dismiss(d),{data:l,fromCache:!1}}catch(o){throw a.ue.dismiss(d),o}}function L(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw new Error("Invalid frame object format")}function G(e,n){var c,d;const t=(e==null?void 0:e.frameObject)??((c=e==null?void 0:e.visual)==null?void 0:c.frameObject);if(!t)return!1;const r=L(t);if(!(r!=null&&r.cards)||r.cards.length===0)return!1;const s=(d=r.cards)==null?void 0:d.find(o=>o.id===r.activeCardId);return s?(a.setupEditorWithCard({...n,frame:r,card:s,visualId:(e==null?void 0:e.id)||r.visualId}),!0):!1}function Y(){var C;const{setCardSql:e}=a.useEditorActions(),n=a.useEditorStore(i=>i.frame),t=a.useEditorStore(i=>i.card),r=a.useEditorStore(i=>i.isDevMode),s=k(((C=t.customCardPreferences)==null?void 0:C.url)||""),c=a.useEditorStore(i=>i.selectedSchemaName),d=a.useEditorStore(i=>i.selectedDatamodelId),o=a.useEditorStore(i=>i.selectedDatabaseName),l=a.useEditorStore(i=>i.selectedTableName),h=a.useEditorStore(i=>i.selectedConnectionId),m=a.useEditorStore(i=>i.isShowingVisual),p=t.sql;return{getUpdatedFrame:g.useCallback(()=>{var I;let i=p;p&&!p.includes("{{")&&(i=H(p),e(i));const E=(I=s==null?void 0:s.getState())==null?void 0:I.settings,v={...t,dataSource:t.dataSource||{mode:"directSource"},lastSelectedSchema:c,lastSelectedDatamodelId:d,lastSelectedDatabase:o,lastSelectedTable:l,connectionId:h,sql:r?i:void 0,python:r?t.python:void 0,config:r?void 0:z(t.config),customCfg:m?t.customCfg:null,preferences:t.preferences,...E&&{customCardPreferences:{...t.customCardPreferences,settings:E}}},w=n.cards.map(S=>S.id===t.id?v:S);return{...n,cards:w,activeCardId:Q(w,n.activeCardId)}},[t,n,r,m,c,d,o,l,h,e,s,p])}}function J(){const{authToken:e,tokenProps:n}=a.useSemaphorContext(),t=a.useQueryClient(),r=a.useSelectedVisual(),{selectVisual:s}=a.useManagementActions(),{setFrame:c,setCard:d,setIsDevMode:o,initializeModeDrafts:l,setActiveTabCardId:h,updateDataSource:m,setQueryResultColumns:p,setSelectedConnectionId:D,setSelectedDatabaseName:C,setSelectedSchemaName:i,setSelectedTableName:E,setSelectedDatamodelId:v,setFilterValues:w,setApplyFilters:I}=a.useEditorActions(),{setIsDashboardEditing:S,setIsVisualEditing:V,setSelectedFrameId:$,clearSelectedFrameId:A,addFrame:R,setIsDashboardPanelOpen:N}=a.useDashboardActions(),y=a.useDashboardStore(u=>u.selectedSheetId),O=a.useDashboardStore(u=>u.selectedFrameId),T=a.useDashboardStore(u=>u.dashboard),x=a.useDashboardStore(u=>u.filterValues),F=a.useVisualById((r==null?void 0:r.id)||"",{enabled:!!(r!=null&&r.id)&&!!(e!=null&&e.accessToken)}),j=g.useCallback(async u=>{try{s(u),A();const{data:b,fromCache:f}=await W(n.apiServiceUrl,(e==null?void 0:e.accessToken)||"",u.id,t);if(!G(b,{setFrame:c,setCard:d,setIsDevMode:o,initializeModeDrafts:l,setActiveTabCardId:h,updateDataSource:m,setQueryResultColumns:p,setSelectedConnectionId:D,setSelectedDatabaseName:C,setSelectedSchemaName:i,setSelectedTableName:E,setSelectedDatamodelId:v,setFilterValues:w,setApplyFilters:I,setIsDashboardEditing:S,setIsVisualEditing:V,dashboard:T,selectedSheetId:y,selectedFrameId:O,filterValues:x}))throw new Error("Failed to setup editor with visual data");return{success:!0,fromCache:f}}catch(b){return console.error("Error editing visual:",b),{success:!1,error:"Failed to load visual for editing"}}},[e==null?void 0:e.accessToken,n.apiServiceUrl,t,s,c,d,S,V,o,l,h,m,p,D,C,i,E,v,w,I,A,T,y,O,x]),_=g.useCallback(async u=>{var b;try{if(s(u),!y)return{success:!1,error:"No sheet selected. Please select a sheet first."};const{data:f,fromCache:B}=await W(n.apiServiceUrl,(e==null?void 0:e.accessToken)||"",u.id,t),M=(f==null?void 0:f.frameObject)??((b=f==null?void 0:f.visual)==null?void 0:b.frameObject);if(!M)return{success:!1,error:"Visual has no frame data"};const U=L(M);if(!(U!=null&&U.cards)||U.cards.length===0)return{success:!1,error:"Visual frame is malformed"};const P={...a.cloneLinkedFrameWithSourceMapping(U),visualId:u.id};return R(y,P,"end"),S(!0),$(P.id),N(!1),{success:!0,fromCache:B}}catch(f){return console.error("Error adding visual:",f),{success:!1,error:"Failed to add visual to dashboard"}}},[e==null?void 0:e.accessToken,n.apiServiceUrl,t,s,y,R,S,$,N]);return{visual:F.data,isLoading:F.isLoading,isError:F.isError,error:F.error,handleEditLibraryVisual:j,handleAddLibraryVisual:_,getUpdatedFrame:Y().getUpdatedFrame,refetch:F.refetch}}exports.useRemoteChartStore=k;exports.useVisualUtils=J;
1
+ "use strict";const a=require("./index-DA-adqwo.js"),g=require("react");function H(e){const n=e.toUpperCase().indexOf("WHERE"),t=e.toUpperCase().indexOf("GROUP BY"),r=e.toUpperCase().indexOf("LIMIT"),s=e.toUpperCase().indexOf("ORDER BY");let c=e.length;if(s!==-1&&(c=s),r!==-1&&r<c&&(c=r),n!==-1){const d=e.substring(0,n),o=e.substring(n);return`${d} {{ filters | where }} AND ${o.substring(6)}`}else if(t!==-1){const d=e.substring(0,t),o=e.substring(t);return`${d} {{ filters | where }} ${o}`}else{const d=e.substring(0,c),o=e.substring(c);return console.log("beforeClause",d),console.log("afterClause",o),o?`${d} {{ filters | where }} ${o}`:`${d.replace(/;$/,"")} {{ filters | where }}`}}function k(e){const[n,t]=g.useState(null),[r,s]=g.useState(null),c=a.useEnsureReactGlobals();return g.useEffect(()=>{if(!e||e.trim()===""){t(null),s(null);return}if(!c)return;(async()=>{try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error(`Invalid URL format: ${e}`);try{new URL(e)}catch{throw new Error(`Invalid URL: ${e}`)}const l=`${e.endsWith("/")?e:`${e}/`}index.js`;try{if(!(await fetch(l,{method:"HEAD"})).ok)throw new Error(`Module not found at ${l}`)}catch{}const h=await import(l);if(typeof h.useChartStore!="function")throw new Error("useChartStore is not a function");t(()=>h.useChartStore),s(null)}catch(o){const l=o instanceof Error?o.message:"Unknown error";console.error("Failed to load remote chart store:",l),s(l),t(null)}})()},[e,c]),n}function Q(e,n){if(e.length===0)return"";const t=e.find(r=>{var s,c;return((s=r.customCardPreferences)==null?void 0:s.visualType)==="multiple"||!!((c=r.customCardPreferences)!=null&&c.dataInputCardIds)});if(t)return t.id;if(n){const r=e.find(s=>s.id===n);if(r){const s=r.tabTitle;if(s=="All__Header")return e[0].id;if(s&&s.endsWith("__Header")){const d=s.split("__")[0],o=e.find(l=>l.tabTitle===d);return o?o.id:e[0].id}return n}}return e[0].id}const z=e=>{if(!e||!("detailTableBackup"in e))return e;const{detailTableBackup:n,...t}=e;return t};async function W(e,n,t,r){if(!n||!t)throw new Error("Missing auth token or visual ID");const s=["resource-by-id","visual",t],c=r.getQueryData(s);if(c)return console.log("Using cached visual data for:",t),{data:c,fromCache:!0};console.log("Fetching visual data from network for:",t);const d=a.ue.loading("Loading visual...",{position:"top-center"});try{const o=await fetch(`${e}/management/v1/visuals/${t}`,{headers:{Authorization:`Bearer ${n}`}});if(!o.ok)throw new Error("Failed to load visual");const l=await o.json();return r.setQueryData(s,l),a.ue.dismiss(d),{data:l,fromCache:!1}}catch(o){throw a.ue.dismiss(d),o}}function L(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw new Error("Invalid frame object format")}function G(e,n){var c,d;const t=(e==null?void 0:e.frameObject)??((c=e==null?void 0:e.visual)==null?void 0:c.frameObject);if(!t)return!1;const r=L(t);if(!(r!=null&&r.cards)||r.cards.length===0)return!1;const s=(d=r.cards)==null?void 0:d.find(o=>o.id===r.activeCardId);return s?(a.setupEditorWithCard({...n,frame:r,card:s,visualId:(e==null?void 0:e.id)||r.visualId}),!0):!1}function Y(){var C;const{setCardSql:e}=a.useEditorActions(),n=a.useEditorStore(i=>i.frame),t=a.useEditorStore(i=>i.card),r=a.useEditorStore(i=>i.isDevMode),s=k(((C=t.customCardPreferences)==null?void 0:C.url)||""),c=a.useEditorStore(i=>i.selectedSchemaName),d=a.useEditorStore(i=>i.selectedDatamodelId),o=a.useEditorStore(i=>i.selectedDatabaseName),l=a.useEditorStore(i=>i.selectedTableName),h=a.useEditorStore(i=>i.selectedConnectionId),m=a.useEditorStore(i=>i.isShowingVisual),p=t.sql;return{getUpdatedFrame:g.useCallback(()=>{var I;let i=p;p&&!p.includes("{{")&&(i=H(p),e(i));const E=(I=s==null?void 0:s.getState())==null?void 0:I.settings,v={...t,dataSource:t.dataSource||{mode:"directSource"},lastSelectedSchema:c,lastSelectedDatamodelId:d,lastSelectedDatabase:o,lastSelectedTable:l,connectionId:h,sql:r?i:void 0,python:r?t.python:void 0,config:r?void 0:z(t.config),customCfg:m?t.customCfg:null,preferences:t.preferences,...E&&{customCardPreferences:{...t.customCardPreferences,settings:E}}},w=n.cards.map(S=>S.id===t.id?v:S);return{...n,cards:w,activeCardId:Q(w,n.activeCardId)}},[t,n,r,m,c,d,o,l,h,e,s,p])}}function J(){const{authToken:e,tokenProps:n}=a.useSemaphorContext(),t=a.useQueryClient(),r=a.useSelectedVisual(),{selectVisual:s}=a.useManagementActions(),{setFrame:c,setCard:d,setIsDevMode:o,initializeModeDrafts:l,setActiveTabCardId:h,updateDataSource:m,setQueryResultColumns:p,setSelectedConnectionId:D,setSelectedDatabaseName:C,setSelectedSchemaName:i,setSelectedTableName:E,setSelectedDatamodelId:v,setFilterValues:w,setApplyFilters:I}=a.useEditorActions(),{setIsDashboardEditing:S,setIsVisualEditing:V,setSelectedFrameId:$,clearSelectedFrameId:A,addFrame:R,setIsDashboardPanelOpen:N}=a.useDashboardActions(),y=a.useDashboardStore(u=>u.selectedSheetId),O=a.useDashboardStore(u=>u.selectedFrameId),T=a.useDashboardStore(u=>u.dashboard),x=a.useDashboardStore(u=>u.filterValues),F=a.useVisualById((r==null?void 0:r.id)||"",{enabled:!!(r!=null&&r.id)&&!!(e!=null&&e.accessToken)}),j=g.useCallback(async u=>{try{s(u),A();const{data:b,fromCache:f}=await W(n.apiServiceUrl,(e==null?void 0:e.accessToken)||"",u.id,t);if(!G(b,{setFrame:c,setCard:d,setIsDevMode:o,initializeModeDrafts:l,setActiveTabCardId:h,updateDataSource:m,setQueryResultColumns:p,setSelectedConnectionId:D,setSelectedDatabaseName:C,setSelectedSchemaName:i,setSelectedTableName:E,setSelectedDatamodelId:v,setFilterValues:w,setApplyFilters:I,setIsDashboardEditing:S,setIsVisualEditing:V,dashboard:T,selectedSheetId:y,selectedFrameId:O,filterValues:x}))throw new Error("Failed to setup editor with visual data");return{success:!0,fromCache:f}}catch(b){return console.error("Error editing visual:",b),{success:!1,error:"Failed to load visual for editing"}}},[e==null?void 0:e.accessToken,n.apiServiceUrl,t,s,c,d,S,V,o,l,h,m,p,D,C,i,E,v,w,I,A,T,y,O,x]),_=g.useCallback(async u=>{var b;try{if(s(u),!y)return{success:!1,error:"No sheet selected. Please select a sheet first."};const{data:f,fromCache:B}=await W(n.apiServiceUrl,(e==null?void 0:e.accessToken)||"",u.id,t),M=(f==null?void 0:f.frameObject)??((b=f==null?void 0:f.visual)==null?void 0:b.frameObject);if(!M)return{success:!1,error:"Visual has no frame data"};const U=L(M);if(!(U!=null&&U.cards)||U.cards.length===0)return{success:!1,error:"Visual frame is malformed"};const P={...a.cloneLinkedFrameWithSourceMapping(U),visualId:u.id};return R(y,P,"end"),S(!0),$(P.id),N(!1),{success:!0,fromCache:B}}catch(f){return console.error("Error adding visual:",f),{success:!1,error:"Failed to add visual to dashboard"}}},[e==null?void 0:e.accessToken,n.apiServiceUrl,t,s,y,R,S,$,N]);return{visual:F.data,isLoading:F.isLoading,isError:F.isError,error:F.error,handleEditLibraryVisual:j,handleAddLibraryVisual:_,getUpdatedFrame:Y().getUpdatedFrame,refetch:F.refetch}}exports.useRemoteChartStore=k;exports.useVisualUtils=J;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-CcysLOA4.js"),r=require("../types/index.cjs");exports.Dashboard=e.Dashboard;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-DA-adqwo.js"),r=require("../types/index.cjs");exports.Dashboard=e.Dashboard;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;
@@ -1,4 +1,4 @@
1
- import { D as a } from "../chunks/index-BSv9U5tc.js";
1
+ import { D as a } from "../chunks/index-al-aDbkL.js";
2
2
  import { EMPTY_SELECTION as e } from "../types/index.js";
3
3
  export {
4
4
  a as Dashboard,
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-CcysLOA4.js"),D=require("./types/index.cjs"),E=require("./chunks/dashboard-summary-settings-dialog-BzEEwHOF.js"),t=require("react/jsx-runtime"),C=require("react"),v=require("./chunks/resource-management-panel-6WdgxllK.js"),P=require("./chunks/use-debounced-dirty-check-XHSwAefL.js");require("react-dom");const p=require("./chunks/notification-bell-z7oT5LAh.js"),S=require("./chunks/normalize-dashboard-for-dirty-check-B7NQDI1H.js");function _(r){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const n in r)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(a,n,i.get?i:{enumerable:!0,get:()=>r[n]})}}return a.default=r,Object.freeze(a)}const A=_(C);function M(r){const{displayPreferences:a,...n}=r,i={...n,id:r.dashboardId};return t.jsx(e.ErrorBoundary,{FallbackComponent:e.Fallback,children:t.jsxs(e.SemaphorContextProvider,{dashboardProps:i,children:[t.jsx(e.SemaphorReadyIndicator,{componentType:"visual",componentId:r.cardId}),t.jsx(e.UXProvider,{children:t.jsx(e.DisplayPreferencesProvider,{displayPreferences:a,children:t.jsx(e.Container,{type:"visual",...i,children:t.jsx(I,{cardId:r.cardId})})})})]})})}function I({cardId:r}){const a=e.useDashboardStore(o=>{var u;return(u=o.dashboard)==null?void 0:u.sheets}),{card:n,frame:i}=C.useMemo(()=>{const o=a==null?void 0:a.flatMap(s=>s.frames),u=o==null?void 0:o.flatMap(s=>s==null?void 0:s.cards),d=u==null?void 0:u.find(s=>(s==null?void 0:s.id)===r),l=o==null?void 0:o.find(s=>{var m;return(m=s==null?void 0:s.cards)==null?void 0:m.find(h=>(h==null?void 0:h.id)===r)});return{card:d,frame:l}},[a,r]);return!n||!i?t.jsx(e.FallbackVisual,{error:new Error("Card not found"),resetErrorBoundary:()=>{},customerFacingMessage:`Card not found with ID: ${r}`}):t.jsx("main",{className:"flex h-full grow flex-col",children:t.jsx(e.ErrorBoundary,{FallbackComponent:({error:o,resetErrorBoundary:u})=>t.jsx(e.FallbackVisual,{error:o,resetErrorBoundary:u,customerFacingMessage:"Error creating visual. Please try again."}),children:t.jsx(e.DashboardCard,{card:n,frame:i})})})}function F({name:r,items:a,value:n,onChange:i,isLoading:o,isError:u,refetch:d,className:l,icon:s,showNone:m=!1}){const h=A.useRef(null),[f,y]=A.useState(!1),[b,N]=A.useState("100%"),g=m?[...a||[],{id:"none",name:"None"}]:a;A.useLayoutEffect(()=>{h.current&&N(h.current.offsetWidth)},[]);function T(){var c;return o?"Loading...":u?"Error":n?(c=a==null?void 0:a.find(x=>x.id===n))==null?void 0:c.name:`Select ${r}`}function j(c,x){i(x),y(!1)}return t.jsxs(e.Popover,{open:f,onOpenChange:y,children:[t.jsx(e.PopoverTrigger,{asChild:!0,children:t.jsxs(e.Button,{ref:h,variant:"outline",role:"combobox","aria-expanded":f,className:e.cn("flex h-9 w-full justify-between",l),children:[t.jsxs("div",{className:"flex items-center gap-2",children:[s&&t.jsx("div",{className:"mr-2",children:s}),t.jsx("span",{className:"max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap",children:T()})]}),t.jsx(e.ChevronDown,{className:"size-4 opacity-50"})]})}),t.jsx(e.PopoverContent,{className:"w-full p-0",style:{minWidth:b},children:t.jsxs(e.Command,{children:[t.jsxs("div",{className:"flex h-9 items-center justify-between border-b pr-1",children:[t.jsx(e.CommandInput,{className:"h-9",placeholder:"Search..."}),t.jsx(e.IconButton,{className:"h-7",onClick:d,children:t.jsx(e.RefreshCw,{className:e.cn("size-3.5 opacity-50",o&&"animate-spin")})})]}),t.jsxs(e.CommandList,{children:[t.jsxs(e.CommandEmpty,{children:["No ",r==null?void 0:r.toLowerCase()," found."]}),t.jsx(e.CommandGroup,{children:g==null?void 0:g.map(c=>t.jsx(e.CommandItem,{className:"overflow-x-auto",value:c.name,onSelect:x=>j(x,c.id),children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(e.Check,{className:e.cn("size-4",n===c.id?"opacity-100":"opacity-0")}),t.jsx("div",{title:c.name,children:c.name})]})},c.id))})]})]})})]})}function R({triggerButtonClassName:r,variant:a="ghost"}){const[n,i]=C.useState(!1),o=e.useDashboardStore(d=>{var l;return(l=d.dashboard)==null?void 0:l.id}),u=e.useDashboardStore(d=>{var l;return(l=d.dashboard)==null?void 0:l.title});return o?t.jsxs(t.Fragment,{children:[t.jsx(e.IconButton,{tooltip:"Schedule Dashboard",className:e.cn("h-7 p-2",r),buttonProps:{variant:a},onClick:()=>i(!0),children:t.jsx(e.Clock,{className:"size-4"})}),t.jsx(e.EmailScheduleDialog,{open:n,onOpenChange:i,dashboardId:o,dashboardName:u})]}):null}function w(r,a){C.useEffect(()=>(r&&a&&(window.__SEMAPHOR_PRINT_STATE__={...a}),()=>{r&&window.__SEMAPHOR_PRINT_STATE__&&delete window.__SEMAPHOR_PRINT_STATE__}),[r,a])}function k(){var u,d;const{quotasQuery:r,usageQuery:a}=e.useAlertQuotas(),n=((u=r.data)==null?void 0:u.quotas)||[],i=((d=a.data)==null?void 0:d.usage)||[],o=new Map(i.map(l=>[l.tenantId||"org",l]));return t.jsxs("div",{className:"space-y-4 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-xl font-semibold",children:"Alert Quotas"}),t.jsx(e.Button,{variant:"outline",size:"sm",onClick:()=>{r.refetch(),a.refetch()},children:"Refresh"})]}),r.isLoading||a.isLoading?t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading quota usage..."}):null,t.jsx("div",{className:"overflow-hidden rounded-lg border",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{className:"bg-muted/40",children:t.jsxs("tr",{children:[t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Tenant"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Active Alerts"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Max Active"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Min Cadence"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Max Context Sources"})]})}),t.jsx("tbody",{children:n.map(l=>{const s=l.tenantId||"org",m=o.get(s);return t.jsxs("tr",{className:"border-t",children:[t.jsx("td",{className:"px-3 py-2",children:s}),t.jsx("td",{className:"px-3 py-2",children:(m==null?void 0:m.activeAlerts)??0}),t.jsx("td",{className:"px-3 py-2",children:l.policy.maxActiveAlerts}),t.jsxs("td",{className:"px-3 py-2",children:[l.policy.minCadenceMinutes," min"]}),t.jsx("td",{className:"px-3 py-2",children:l.policy.maxContextSources})]},s)})})]})})]})}exports.AlertCreationDialog=e.AlertCreationDialog;exports.AlertManagementPage=e.AlertManagementPage;exports.AlertsApiError=e.AlertsApiError;exports.CALCULATED_FIELD_ENTITY_MARKER=e.CALCULATED_FIELD_ENTITY_MARKER;exports.CardAlertIndicator=e.CardAlertIndicator;exports.CardSummary=e.CardSummary;exports.DATE_FORMAT_VALUES=e.DATE_FORMAT_VALUES;exports.Dashboard=e.Dashboard;exports.DashboardExportDialog=e.DashboardExportDialog;exports.DashboardWC=e.DashboardWC;exports.EmailScheduleDialog=e.EmailScheduleDialog;exports.ExportError=e.ExportError;exports.PivotMarkerEnum=e.PivotMarkerEnum;exports.ResourceType=e.ResourceType;exports.SemaphorContextProvider=e.SemaphorContextProvider;exports.SemaphorDataProvider=e.SemaphorQueryClient;exports.SemaphorQueryClient=e.SemaphorQueryClient;exports.ShareDialog=e.ShareDialog;exports.SummaryCard=e.SummaryCard;exports.Surfboard=e.DashboardPlus;exports.backtestAlert=e.backtestAlert;exports.cancelExport=e.cancelExport;exports.cloneDeep=e.cloneDeep;exports.createAlert=e.createAlert;exports.createEmptyKpiConfig=e.createEmptyKpiConfig;exports.createExport=e.createExport;exports.createSqlGenConfig=e.createSqlGenConfig;exports.deleteAlert=e.deleteAlert;exports.downloadPdf=e.downloadPdf;exports.emitDashboardLoad=e.emitDashboardLoad;exports.emitDashboardUnload=e.emitDashboardUnload;exports.fmt=e.fmt;exports.formatFileSize=e.formatFileSize;exports.getAlert=e.getAlert;exports.getAlertContextSources=e.getAlertContextSources;exports.getAlertHistory=e.getAlertHistory;exports.getAlertQuotaUsage=e.getAlertQuotaUsage;exports.getAlertRunDeliveries=e.getAlertRunDeliveries;exports.getAlertRunSteps=e.getAlertRunSteps;exports.getAlertRuns=e.getAlertRuns;exports.getAlertState=e.getAlertState;exports.getColumnDataType=e.getColumnDataType;exports.getDownloadUrl=e.getDownloadUrl;exports.getExportStatus=e.getExportStatus;exports.getExports=e.getExports;exports.getFilterValueType=e.getFilterValueType;exports.getFormattedTableNameForQuery=e.getFormattedTableNameForQuery;exports.getQualifiedTableName=e.getQualifiedTableName;exports.getSql=e.getSql;exports.interpretAlertContext=e.interpretAlertContext;exports.invalidateToken=e.invalidateToken;exports.isBooleanDataType=e.isBooleanDataType;exports.isCalculatedDimension=e.isCalculatedDimension;exports.isCalculatedField=e.isCalculatedField;exports.isCalculatedMetric=e.isCalculatedMetric;exports.isColumnInSqlGen=e.isColumnInSqlGen;exports.isDateDataType=e.isDateDataType;exports.isExportComplete=e.isExportComplete;exports.isExportInProgress=e.isExportInProgress;exports.isNumberDataType=e.isNumberDataType;exports.isTextDataType=e.isTextDataType;exports.listAlertQuotas=e.listAlertQuotas;exports.listAlerts=e.listAlerts;exports.previewAlertDeliverable=e.previewAlertDeliverable;exports.resolveDataType=e.resolveDataType;exports.resolveDatamodelName=e.resolveDatamodelName;exports.triggerAlertNow=e.triggerAlertNow;exports.updateAlert=e.updateAlert;exports.updateAlertContextSources=e.updateAlertContextSources;exports.updateAlertQuota=e.updateAlertQuota;exports.useActiveExports=e.useActiveExports;exports.useAddNewFrame=e.useAddNewFrame;exports.useAlertActions=e.useAlertActions;exports.useAlertBacktest=e.useAlertBacktest;exports.useAlertContextBuilder=e.useAlertContextBuilder;exports.useAlertDeliveries=e.useAlertDeliveries;exports.useAlertDetail=e.useAlertDetail;exports.useAlertDraft=e.useAlertDraft;exports.useAlertFilters=e.useAlertFilters;exports.useAlertHistory=e.useAlertHistory;exports.useAlertQuotas=e.useAlertQuotas;exports.useAlertRuns=e.useAlertRuns;exports.useAlertState=e.useAlertState;exports.useAlertStore=e.useAlertStore;exports.useAlerts=e.useAlerts;exports.useAlertsBootstrap=e.useAlertsBootstrap;exports.useAlertsById=e.useAlertsById;exports.useAlertsForCard=e.useAlertsForCard;exports.useCard=e.useCard;exports.useCardAlertMap=e.useCardAlertMap;exports.useCardSummary=e.useCardSummary;exports.useCurrentActiveCard=e.useCurrentActiveCard;exports.useCurrentCardConfig=e.useCurrentCardConfig;exports.useCurrentSheetActiveCards=e.useCurrentSheetActiveCards;exports.useDashboardActions=e.useDashboardActions;exports.useDashboardById=e.useDashboardById;exports.useDashboardQuery=e.useDashboardQuery;exports.useDashboardStore=e.useDashboardStore;exports.useDashboardSummary=e.useDashboardSummary;exports.useDataColumns=e.useDataColumns;exports.useDateFilterHook=e.useDateFilterHook;exports.useEditorActions=e.useEditorActions;exports.useEditorAside=e.useEditorAside;exports.useEditorStore=e.useEditorStore;exports.useExportActions=e.useExportActions;exports.useExportStore=e.useExportStore;exports.useInProgressExportsCount=e.useInProgressExportsCount;exports.useManagementStore=e.useManagementStore;exports.useResourceManagement=e.useResourceManagement;exports.useSelectedAlertId=e.useSelectedAlertId;exports.useTextFilterHook=e.useTextFilterHook;exports.DEFAULT_CALENDAR_CONTEXT=D.DEFAULT_CALENDAR_CONTEXT;exports.DEFAULT_SEMANTIC_DOMAIN_ACCESS=D.DEFAULT_SEMANTIC_DOMAIN_ACCESS;exports.EMPTY_SELECTION=D.EMPTY_SELECTION;exports.CalendarPreferencesDialog=E.CalendarPreferencesDialog;exports.DashboardSummarySettingsDialog=E.DashboardSummarySettingsDialog;exports.ResourceManagementPanel=v.ResourceManagementPanel;exports.useDebouncedDirtyCheck=P.useDebouncedDirtyCheck;exports.AdvancedModeToggle=p.AdvancedModeToggle;exports.ExportNotificationItem=p.ExportNotificationItem;exports.ExportNotificationList=p.ExportNotificationList;exports.NotificationBell=p.NotificationBell;exports.UnsavedChangesAlert=p.UnsavedChangesAlert;exports.VisualEditingControls=p.VisualEditingControls;exports.useExportPolling=p.useExportPolling;exports.useExportRecovery=p.useExportRecovery;exports.usePristineSnapshotInitializer=p.usePristineSnapshotInitializer;exports.normalizeDashboardForDirtyCheck=S.normalizeDashboardForDirtyCheck;exports.serializeDashboardForDirtyCheck=S.serializeDashboardForDirtyCheck;exports.Combobox=F;exports.ScheduleDashboard=R;exports.TenantQuotaPage=k;exports.Visual=M;exports.useExposePrintState=w;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-DA-adqwo.js"),D=require("./types/index.cjs"),E=require("./chunks/dashboard-summary-settings-dialog-Bq6wavS4.js"),t=require("react/jsx-runtime"),C=require("react"),v=require("./chunks/resource-management-panel-CNvfKn4q.js"),P=require("./chunks/use-debounced-dirty-check-XHSwAefL.js");require("react-dom");const p=require("./chunks/notification-bell-Ca_iD6ml.js"),S=require("./chunks/normalize-dashboard-for-dirty-check-B7NQDI1H.js");function _(r){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const n in r)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(a,n,i.get?i:{enumerable:!0,get:()=>r[n]})}}return a.default=r,Object.freeze(a)}const A=_(C);function M(r){const{displayPreferences:a,...n}=r,i={...n,id:r.dashboardId};return t.jsx(e.ErrorBoundary,{FallbackComponent:e.Fallback,children:t.jsxs(e.SemaphorContextProvider,{dashboardProps:i,children:[t.jsx(e.SemaphorReadyIndicator,{componentType:"visual",componentId:r.cardId}),t.jsx(e.UXProvider,{children:t.jsx(e.DisplayPreferencesProvider,{displayPreferences:a,children:t.jsx(e.Container,{type:"visual",...i,children:t.jsx(I,{cardId:r.cardId})})})})]})})}function I({cardId:r}){const a=e.useDashboardStore(o=>{var u;return(u=o.dashboard)==null?void 0:u.sheets}),{card:n,frame:i}=C.useMemo(()=>{const o=a==null?void 0:a.flatMap(s=>s.frames),u=o==null?void 0:o.flatMap(s=>s==null?void 0:s.cards),d=u==null?void 0:u.find(s=>(s==null?void 0:s.id)===r),l=o==null?void 0:o.find(s=>{var m;return(m=s==null?void 0:s.cards)==null?void 0:m.find(h=>(h==null?void 0:h.id)===r)});return{card:d,frame:l}},[a,r]);return!n||!i?t.jsx(e.FallbackVisual,{error:new Error("Card not found"),resetErrorBoundary:()=>{},customerFacingMessage:`Card not found with ID: ${r}`}):t.jsx("main",{className:"flex h-full grow flex-col",children:t.jsx(e.ErrorBoundary,{FallbackComponent:({error:o,resetErrorBoundary:u})=>t.jsx(e.FallbackVisual,{error:o,resetErrorBoundary:u,customerFacingMessage:"Error creating visual. Please try again."}),children:t.jsx(e.DashboardCard,{card:n,frame:i})})})}function F({name:r,items:a,value:n,onChange:i,isLoading:o,isError:u,refetch:d,className:l,icon:s,showNone:m=!1}){const h=A.useRef(null),[f,y]=A.useState(!1),[b,N]=A.useState("100%"),g=m?[...a||[],{id:"none",name:"None"}]:a;A.useLayoutEffect(()=>{h.current&&N(h.current.offsetWidth)},[]);function T(){var c;return o?"Loading...":u?"Error":n?(c=a==null?void 0:a.find(x=>x.id===n))==null?void 0:c.name:`Select ${r}`}function j(c,x){i(x),y(!1)}return t.jsxs(e.Popover,{open:f,onOpenChange:y,children:[t.jsx(e.PopoverTrigger,{asChild:!0,children:t.jsxs(e.Button,{ref:h,variant:"outline",role:"combobox","aria-expanded":f,className:e.cn("flex h-9 w-full justify-between",l),children:[t.jsxs("div",{className:"flex items-center gap-2",children:[s&&t.jsx("div",{className:"mr-2",children:s}),t.jsx("span",{className:"max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap",children:T()})]}),t.jsx(e.ChevronDown,{className:"size-4 opacity-50"})]})}),t.jsx(e.PopoverContent,{className:"w-full p-0",style:{minWidth:b},children:t.jsxs(e.Command,{children:[t.jsxs("div",{className:"flex h-9 items-center justify-between border-b pr-1",children:[t.jsx(e.CommandInput,{className:"h-9",placeholder:"Search..."}),t.jsx(e.IconButton,{className:"h-7",onClick:d,children:t.jsx(e.RefreshCw,{className:e.cn("size-3.5 opacity-50",o&&"animate-spin")})})]}),t.jsxs(e.CommandList,{children:[t.jsxs(e.CommandEmpty,{children:["No ",r==null?void 0:r.toLowerCase()," found."]}),t.jsx(e.CommandGroup,{children:g==null?void 0:g.map(c=>t.jsx(e.CommandItem,{className:"overflow-x-auto",value:c.name,onSelect:x=>j(x,c.id),children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(e.Check,{className:e.cn("size-4",n===c.id?"opacity-100":"opacity-0")}),t.jsx("div",{title:c.name,children:c.name})]})},c.id))})]})]})})]})}function R({triggerButtonClassName:r,variant:a="ghost"}){const[n,i]=C.useState(!1),o=e.useDashboardStore(d=>{var l;return(l=d.dashboard)==null?void 0:l.id}),u=e.useDashboardStore(d=>{var l;return(l=d.dashboard)==null?void 0:l.title});return o?t.jsxs(t.Fragment,{children:[t.jsx(e.IconButton,{tooltip:"Schedule Dashboard",className:e.cn("h-7 p-2",r),buttonProps:{variant:a},onClick:()=>i(!0),children:t.jsx(e.Clock,{className:"size-4"})}),t.jsx(e.EmailScheduleDialog,{open:n,onOpenChange:i,dashboardId:o,dashboardName:u})]}):null}function w(r,a){C.useEffect(()=>(r&&a&&(window.__SEMAPHOR_PRINT_STATE__={...a}),()=>{r&&window.__SEMAPHOR_PRINT_STATE__&&delete window.__SEMAPHOR_PRINT_STATE__}),[r,a])}function k(){var u,d;const{quotasQuery:r,usageQuery:a}=e.useAlertQuotas(),n=((u=r.data)==null?void 0:u.quotas)||[],i=((d=a.data)==null?void 0:d.usage)||[],o=new Map(i.map(l=>[l.tenantId||"org",l]));return t.jsxs("div",{className:"space-y-4 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-xl font-semibold",children:"Alert Quotas"}),t.jsx(e.Button,{variant:"outline",size:"sm",onClick:()=>{r.refetch(),a.refetch()},children:"Refresh"})]}),r.isLoading||a.isLoading?t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading quota usage..."}):null,t.jsx("div",{className:"overflow-hidden rounded-lg border",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{className:"bg-muted/40",children:t.jsxs("tr",{children:[t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Tenant"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Active Alerts"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Max Active"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Min Cadence"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Max Context Sources"})]})}),t.jsx("tbody",{children:n.map(l=>{const s=l.tenantId||"org",m=o.get(s);return t.jsxs("tr",{className:"border-t",children:[t.jsx("td",{className:"px-3 py-2",children:s}),t.jsx("td",{className:"px-3 py-2",children:(m==null?void 0:m.activeAlerts)??0}),t.jsx("td",{className:"px-3 py-2",children:l.policy.maxActiveAlerts}),t.jsxs("td",{className:"px-3 py-2",children:[l.policy.minCadenceMinutes," min"]}),t.jsx("td",{className:"px-3 py-2",children:l.policy.maxContextSources})]},s)})})]})})]})}exports.AlertCreationDialog=e.AlertCreationDialog;exports.AlertManagementPage=e.AlertManagementPage;exports.AlertsApiError=e.AlertsApiError;exports.CALCULATED_FIELD_ENTITY_MARKER=e.CALCULATED_FIELD_ENTITY_MARKER;exports.CardAlertIndicator=e.CardAlertIndicator;exports.CardSummary=e.CardSummary;exports.DATE_FORMAT_VALUES=e.DATE_FORMAT_VALUES;exports.Dashboard=e.Dashboard;exports.DashboardExportDialog=e.DashboardExportDialog;exports.DashboardWC=e.DashboardWC;exports.EmailScheduleDialog=e.EmailScheduleDialog;exports.ExportError=e.ExportError;exports.PivotMarkerEnum=e.PivotMarkerEnum;exports.ResourceType=e.ResourceType;exports.SemaphorContextProvider=e.SemaphorContextProvider;exports.SemaphorDataProvider=e.SemaphorQueryClient;exports.SemaphorQueryClient=e.SemaphorQueryClient;exports.ShareDialog=e.ShareDialog;exports.SummaryCard=e.SummaryCard;exports.Surfboard=e.DashboardPlus;exports.backtestAlert=e.backtestAlert;exports.cancelExport=e.cancelExport;exports.cloneDeep=e.cloneDeep;exports.createAlert=e.createAlert;exports.createEmptyKpiConfig=e.createEmptyKpiConfig;exports.createExport=e.createExport;exports.createSqlGenConfig=e.createSqlGenConfig;exports.deleteAlert=e.deleteAlert;exports.downloadPdf=e.downloadPdf;exports.emitDashboardLoad=e.emitDashboardLoad;exports.emitDashboardUnload=e.emitDashboardUnload;exports.fmt=e.fmt;exports.formatFileSize=e.formatFileSize;exports.getAlert=e.getAlert;exports.getAlertContextSources=e.getAlertContextSources;exports.getAlertHistory=e.getAlertHistory;exports.getAlertQuotaUsage=e.getAlertQuotaUsage;exports.getAlertRunDeliveries=e.getAlertRunDeliveries;exports.getAlertRunSteps=e.getAlertRunSteps;exports.getAlertRuns=e.getAlertRuns;exports.getAlertState=e.getAlertState;exports.getColumnDataType=e.getColumnDataType;exports.getDownloadUrl=e.getDownloadUrl;exports.getExportStatus=e.getExportStatus;exports.getExports=e.getExports;exports.getFilterValueType=e.getFilterValueType;exports.getFormattedTableNameForQuery=e.getFormattedTableNameForQuery;exports.getQualifiedTableName=e.getQualifiedTableName;exports.getSql=e.getSql;exports.interpretAlertContext=e.interpretAlertContext;exports.invalidateToken=e.invalidateToken;exports.isBooleanDataType=e.isBooleanDataType;exports.isCalculatedDimension=e.isCalculatedDimension;exports.isCalculatedField=e.isCalculatedField;exports.isCalculatedMetric=e.isCalculatedMetric;exports.isColumnInSqlGen=e.isColumnInSqlGen;exports.isDateDataType=e.isDateDataType;exports.isExportComplete=e.isExportComplete;exports.isExportInProgress=e.isExportInProgress;exports.isNumberDataType=e.isNumberDataType;exports.isTextDataType=e.isTextDataType;exports.listAlertQuotas=e.listAlertQuotas;exports.listAlerts=e.listAlerts;exports.previewAlertDeliverable=e.previewAlertDeliverable;exports.resolveDataType=e.resolveDataType;exports.resolveDatamodelName=e.resolveDatamodelName;exports.triggerAlertNow=e.triggerAlertNow;exports.updateAlert=e.updateAlert;exports.updateAlertContextSources=e.updateAlertContextSources;exports.updateAlertQuota=e.updateAlertQuota;exports.useActiveExports=e.useActiveExports;exports.useAddNewFrame=e.useAddNewFrame;exports.useAlertActions=e.useAlertActions;exports.useAlertBacktest=e.useAlertBacktest;exports.useAlertContextBuilder=e.useAlertContextBuilder;exports.useAlertDeliveries=e.useAlertDeliveries;exports.useAlertDetail=e.useAlertDetail;exports.useAlertDraft=e.useAlertDraft;exports.useAlertFilters=e.useAlertFilters;exports.useAlertHistory=e.useAlertHistory;exports.useAlertQuotas=e.useAlertQuotas;exports.useAlertRuns=e.useAlertRuns;exports.useAlertState=e.useAlertState;exports.useAlertStore=e.useAlertStore;exports.useAlerts=e.useAlerts;exports.useAlertsBootstrap=e.useAlertsBootstrap;exports.useAlertsById=e.useAlertsById;exports.useAlertsForCard=e.useAlertsForCard;exports.useCard=e.useCard;exports.useCardAlertMap=e.useCardAlertMap;exports.useCardSummary=e.useCardSummary;exports.useCurrentActiveCard=e.useCurrentActiveCard;exports.useCurrentCardConfig=e.useCurrentCardConfig;exports.useCurrentSheetActiveCards=e.useCurrentSheetActiveCards;exports.useDashboardActions=e.useDashboardActions;exports.useDashboardById=e.useDashboardById;exports.useDashboardQuery=e.useDashboardQuery;exports.useDashboardStore=e.useDashboardStore;exports.useDashboardSummary=e.useDashboardSummary;exports.useDataColumns=e.useDataColumns;exports.useDateFilterHook=e.useDateFilterHook;exports.useEditorActions=e.useEditorActions;exports.useEditorAside=e.useEditorAside;exports.useEditorStore=e.useEditorStore;exports.useExportActions=e.useExportActions;exports.useExportStore=e.useExportStore;exports.useInProgressExportsCount=e.useInProgressExportsCount;exports.useManagementStore=e.useManagementStore;exports.useResourceManagement=e.useResourceManagement;exports.useSelectedAlertId=e.useSelectedAlertId;exports.useTextFilterHook=e.useTextFilterHook;exports.DEFAULT_CALENDAR_CONTEXT=D.DEFAULT_CALENDAR_CONTEXT;exports.DEFAULT_SEMANTIC_DOMAIN_ACCESS=D.DEFAULT_SEMANTIC_DOMAIN_ACCESS;exports.EMPTY_SELECTION=D.EMPTY_SELECTION;exports.CalendarPreferencesDialog=E.CalendarPreferencesDialog;exports.DashboardSummarySettingsDialog=E.DashboardSummarySettingsDialog;exports.ResourceManagementPanel=v.ResourceManagementPanel;exports.useDebouncedDirtyCheck=P.useDebouncedDirtyCheck;exports.AdvancedModeToggle=p.AdvancedModeToggle;exports.ExportNotificationItem=p.ExportNotificationItem;exports.ExportNotificationList=p.ExportNotificationList;exports.NotificationBell=p.NotificationBell;exports.UnsavedChangesAlert=p.UnsavedChangesAlert;exports.VisualEditingControls=p.VisualEditingControls;exports.useExportPolling=p.useExportPolling;exports.useExportRecovery=p.useExportRecovery;exports.usePristineSnapshotInitializer=p.usePristineSnapshotInitializer;exports.normalizeDashboardForDirtyCheck=S.normalizeDashboardForDirtyCheck;exports.serializeDashboardForDirtyCheck=S.serializeDashboardForDirtyCheck;exports.Combobox=F;exports.ScheduleDashboard=R;exports.TenantQuotaPage=k;exports.Visual=M;exports.useExposePrintState=w;
package/dist/index.js CHANGED
@@ -1,14 +1,14 @@
1
- import { V as D, W as _, Y as I, Z as M, _ as w, $ as F, a0 as R, u as C, a1 as y, a2 as k, P as L, k as B, B as E, c as f, a3 as O, l as Q, m as U, n as z, a4 as N, a5 as q, o as V, p as H, q as j, r as W, s as G, a6 as K, a7 as Y, a8 as $ } from "./chunks/index-BSv9U5tc.js";
2
- import { aS as pe, aR as he, bA as be, aU as fe, aT as Ae, ar as Ce, aV as xe, D as ge, ap as ye, aj as De, bG as Ee, aZ as Ne, ab as Se, ae as ve, ae as Te, af as Pe, aq as _e, a as Ie, bs as Me, bF as we, am as Fe, bj as Re, bg as ke, bB as Le, b4 as Be, bl as Oe, ao as Qe, ak as Ue, al as ze, a_ as qe, bJ as Ve, bi as He, bu as je, bp as We, by as Ge, bq as Ke, br as Ye, bo as $e, bn as Xe, b6 as Je, bE as Ze, bD as ea, bC as aa, b5 as sa, b9 as ta, ba as ra, b3 as oa, bt as na, an as la, b2 as ia, aX as da, aY as ca, aW as ua, b7 as ma, b1 as pa, bI as ha, bH as ba, b0 as fa, a$ as Aa, bx as Ca, bh as xa, bw as ga, bb as ya, b8 as Da, bm as Ea, bk as Na, bv as Sa, bz as va, ay as Ta, av as Pa, aK as _a, aI as Ia, aH as Ma, aG as wa, aC as Fa, aQ as Ra, aP as ka, aF as La, aE as Ba, aD as Oa, aJ as Qa, aA as Ua, aB as za, aL as qa, aN as Va, ai as Ha, aM as ja, at as Wa, bd as Ga, bf as Ka, be as Ya, N as $a, ah as Xa, aa as Ja, as as Za, au as es, ac as as, M as ss, bc as ts, U as rs, ax as os, aw as ns, az as ls, a9 as is, ag as ds, aO as cs, ad as us } from "./chunks/index-BSv9U5tc.js";
1
+ import { V as D, W as _, Y as I, Z as M, _ as w, $ as F, a0 as R, u as C, a1 as y, a2 as k, P as L, k as B, B as E, c as f, a3 as O, l as Q, m as U, n as z, a4 as N, a5 as q, o as V, p as H, q as j, r as W, s as G, a6 as K, a7 as Y, a8 as $ } from "./chunks/index-al-aDbkL.js";
2
+ import { aS as pe, aR as he, bA as be, aU as fe, aT as Ae, ar as Ce, aV as xe, D as ge, ap as ye, aj as De, bG as Ee, aZ as Ne, ab as Se, ae as ve, ae as Te, af as Pe, aq as _e, a as Ie, bs as Me, bF as we, am as Fe, bj as Re, bg as ke, bB as Le, b4 as Be, bl as Oe, ao as Qe, ak as Ue, al as ze, a_ as qe, bJ as Ve, bi as He, bu as je, bp as We, by as Ge, bq as Ke, br as Ye, bo as $e, bn as Xe, b6 as Je, bE as Ze, bD as ea, bC as aa, b5 as sa, b9 as ta, ba as ra, b3 as oa, bt as na, an as la, b2 as ia, aX as da, aY as ca, aW as ua, b7 as ma, b1 as pa, bI as ha, bH as ba, b0 as fa, a$ as Aa, bx as Ca, bh as xa, bw as ga, bb as ya, b8 as Da, bm as Ea, bk as Na, bv as Sa, bz as va, ay as Ta, av as Pa, aK as _a, aI as Ia, aH as Ma, aG as wa, aC as Fa, aQ as Ra, aP as ka, aF as La, aE as Ba, aD as Oa, aJ as Qa, aA as Ua, aB as za, aL as qa, aN as Va, ai as Ha, aM as ja, at as Wa, bd as Ga, bf as Ka, be as Ya, N as $a, ah as Xa, aa as Ja, as as Za, au as es, ac as as, M as ss, bc as ts, U as rs, ax as os, aw as ns, az as ls, a9 as is, ag as ds, aO as cs, ad as us } from "./chunks/index-al-aDbkL.js";
3
3
  import { DEFAULT_CALENDAR_CONTEXT as ps, DEFAULT_SEMANTIC_DOMAIN_ACCESS as hs, EMPTY_SELECTION as bs } from "./types/index.js";
4
- import { C as As, D as Cs } from "./chunks/dashboard-summary-settings-dialog-CB5TScfc.js";
4
+ import { C as As, D as Cs } from "./chunks/dashboard-summary-settings-dialog-CLt3Wilb.js";
5
5
  import { jsx as e, jsxs as n, Fragment as X } from "react/jsx-runtime";
6
6
  import * as b from "react";
7
7
  import { useMemo as J, useState as Z, useEffect as ee } from "react";
8
- import { ResourceManagementPanel as gs } from "./chunks/resource-management-panel-BacphZKd.js";
8
+ import { ResourceManagementPanel as gs } from "./chunks/resource-management-panel-OgUs9H5R.js";
9
9
  import { u as Ds } from "./chunks/use-debounced-dirty-check-BwAbnX_5.js";
10
10
  import "react-dom";
11
- import { A as Ns, a as Ss, E as vs, N as Ts, U as Ps, V as _s, u as Is, b as Ms, c as ws } from "./chunks/notification-bell-a6BxRjVN.js";
11
+ import { A as Ns, a as Ss, E as vs, N as Ts, U as Ps, V as _s, u as Is, b as Ms, c as ws } from "./chunks/notification-bell-Cmuv8L1P.js";
12
12
  import { n as Rs, s as ks } from "./chunks/normalize-dashboard-for-dirty-check-Bn27S0PN.js";
13
13
  function ne(a) {
14
14
  const { displayPreferences: s, ...i } = a, d = {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/index-CcysLOA4.js"),a=require("../types/index.cjs"),e=require("../chunks/dashboard-summary-settings-dialog-BzEEwHOF.js");exports.Surfboard=r.DashboardPlus;exports.EMPTY_SELECTION=a.EMPTY_SELECTION;exports.CalendarPreferencesDialog=e.CalendarPreferencesDialog;exports.DashboardSummarySettingsDialog=e.DashboardSummarySettingsDialog;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/index-DA-adqwo.js"),a=require("../types/index.cjs"),e=require("../chunks/dashboard-summary-settings-dialog-Bq6wavS4.js");exports.Surfboard=r.DashboardPlus;exports.EMPTY_SELECTION=a.EMPTY_SELECTION;exports.CalendarPreferencesDialog=e.CalendarPreferencesDialog;exports.DashboardSummarySettingsDialog=e.DashboardSummarySettingsDialog;
@@ -1,6 +1,6 @@
1
- import { a as o } from "../chunks/index-BSv9U5tc.js";
1
+ import { a as o } from "../chunks/index-al-aDbkL.js";
2
2
  import { EMPTY_SELECTION as s } from "../types/index.js";
3
- import { C as m, D as t } from "../chunks/dashboard-summary-settings-dialog-CB5TScfc.js";
3
+ import { C as m, D as t } from "../chunks/dashboard-summary-settings-dialog-CLt3Wilb.js";
4
4
  export {
5
5
  m as CalendarPreferencesDialog,
6
6
  t as DashboardSummarySettingsDialog,
@@ -424,6 +424,8 @@ declare type DateSelectionMode = 'range' | 'months';
424
424
 
425
425
  declare type DateUnit = 'day' | 'week' | 'month' | 'quarter' | 'year';
426
426
 
427
+ declare type DefaultDateFilter = RelativeDateFilter | FixedMonthDefaultDateFilter;
428
+
427
429
  /**
428
430
  * Field configuration for detail table columns.
429
431
  * Unlike GroupByField, DetailField does not support aggregation or granularity.
@@ -802,6 +804,17 @@ declare type FilterSemanticContext = {
802
804
 
803
805
  declare type FilterValue = string | number | boolean | Date | null | [number, number] | [string, string] | string[] | number[];
804
806
 
807
+ /**
808
+ * Absolute fixed month/year default used by Month Picker defaults.
809
+ * - `month` is 0-indexed (0=January, 11=December) to align with MonthPicker.
810
+ */
811
+ declare type FixedMonthDefaultDateFilter = {
812
+ mode: 'fixed';
813
+ unit: 'month';
814
+ year: number;
815
+ month: number;
816
+ };
817
+
805
818
  export declare type GetDashboardResponse = {
806
819
  dashboard: TDashboard;
807
820
  lenses: TLens[];
@@ -999,6 +1012,7 @@ declare interface MetricField extends Field {
999
1012
  */
1000
1013
  parameters?: {
1001
1014
  filters?: FilterGroup;
1015
+ windowTransform?: WindowTransform;
1002
1016
  };
1003
1017
  aliasTemplate?: string;
1004
1018
  valueAliases?: Record<string, string>;
@@ -1663,7 +1677,7 @@ declare type TFilter = {
1663
1677
  uiType?: 'radio' | 'dropdown' | 'tabs';
1664
1678
  dateSelectionMode?: DateSelectionMode;
1665
1679
  defaultValues?: (string | number)[];
1666
- defaultDateFilter?: RelativeDateFilter;
1680
+ defaultDateFilter?: DefaultDateFilter;
1667
1681
  sheetId?: string;
1668
1682
  location?: FilterLocation;
1669
1683
  hide?: boolean;
@@ -1812,8 +1826,8 @@ export declare type TInlineFilter = {
1812
1826
  dateSelectionMode?: DateSelectionMode;
1813
1827
  /** Default values applied when the dashboard first loads */
1814
1828
  defaultValues?: (string | number)[];
1815
- /** Default relative date filter (e.g., "Last 7 days") applied on dashboard load */
1816
- defaultDateFilter?: RelativeDateFilter;
1829
+ /** Default date filter applied on dashboard load (relative or fixed month/year) */
1830
+ defaultDateFilter?: DefaultDateFilter;
1817
1831
  /** Search mode for numeric filters: 'text' treats as text, 'numeric' enables operators (>, <, =) */
1818
1832
  searchMode?: 'text' | 'numeric' | 'auto';
1819
1833
  /** Custom filter UI from a plugin */
@@ -1949,4 +1963,27 @@ export declare type VisualDisplayPreferences = {
1949
1963
  };
1950
1964
  };
1951
1965
 
1966
+ declare type WindowFunction = 'running_total' | 'moving_average' | 'previous_period_delta' | 'percent_of_total';
1967
+
1968
+ declare interface WindowTransform {
1969
+ function: WindowFunction;
1970
+ orderBy?: {
1971
+ fieldId: string;
1972
+ direction?: 'asc' | 'desc';
1973
+ };
1974
+ partitionByFieldIds?: string[];
1975
+ frame?: 'unbounded_preceding';
1976
+ movingAverage?: {
1977
+ windowSize?: number;
1978
+ minPeriods?: number;
1979
+ };
1980
+ previousPeriodDelta?: {
1981
+ mode?: 'absolute' | 'percent';
1982
+ };
1983
+ percentOfTotal?: {
1984
+ scope?: 'grand_total' | 'partition_total';
1985
+ output?: 'fraction' | 'percent';
1986
+ };
1987
+ }
1988
+
1952
1989
  export { }
@@ -1341,6 +1341,8 @@ export declare const DEFAULT_CALENDAR_CONTEXT: CalendarContext;
1341
1341
 
1342
1342
  export declare const DEFAULT_SEMANTIC_DOMAIN_ACCESS: SemanticDomainAccess;
1343
1343
 
1344
+ declare type DefaultDateFilter = RelativeDateFilter | FixedMonthDefaultDateFilter;
1345
+
1344
1346
  export declare function deleteAlert(apiServiceUrl: string, token: string, id: string): Promise<{
1345
1347
  success: boolean;
1346
1348
  }>;
@@ -2116,6 +2118,17 @@ declare type FilterSemanticContext = {
2116
2118
 
2117
2119
  export declare type FilterValue = string | number | boolean | Date | null | [number, number] | [string, string] | string[] | number[];
2118
2120
 
2121
+ /**
2122
+ * Absolute fixed month/year default used by Month Picker defaults.
2123
+ * - `month` is 0-indexed (0=January, 11=December) to align with MonthPicker.
2124
+ */
2125
+ declare type FixedMonthDefaultDateFilter = {
2126
+ mode: 'fixed';
2127
+ unit: 'month';
2128
+ year: number;
2129
+ month: number;
2130
+ };
2131
+
2119
2132
  export declare function fmt(str: string): string;
2120
2133
 
2121
2134
  /**
@@ -2562,6 +2575,7 @@ export declare interface MetricField extends Field {
2562
2575
  */
2563
2576
  parameters?: {
2564
2577
  filters?: FilterGroup;
2578
+ windowTransform?: WindowTransform;
2565
2579
  };
2566
2580
  aliasTemplate?: string;
2567
2581
  valueAliases?: Record<string, string>;
@@ -3592,7 +3606,7 @@ export declare type TFilter = {
3592
3606
  uiType?: 'radio' | 'dropdown' | 'tabs';
3593
3607
  dateSelectionMode?: DateSelectionMode;
3594
3608
  defaultValues?: (string | number)[];
3595
- defaultDateFilter?: RelativeDateFilter;
3609
+ defaultDateFilter?: DefaultDateFilter;
3596
3610
  sheetId?: string;
3597
3611
  location?: FilterLocation;
3598
3612
  hide?: boolean;
@@ -3747,8 +3761,8 @@ export declare type TInlineFilter = {
3747
3761
  dateSelectionMode?: DateSelectionMode;
3748
3762
  /** Default values applied when the dashboard first loads */
3749
3763
  defaultValues?: (string | number)[];
3750
- /** Default relative date filter (e.g., "Last 7 days") applied on dashboard load */
3751
- defaultDateFilter?: RelativeDateFilter;
3764
+ /** Default date filter applied on dashboard load (relative or fixed month/year) */
3765
+ defaultDateFilter?: DefaultDateFilter;
3752
3766
  /** Search mode for numeric filters: 'text' treats as text, 'numeric' enables operators (>, <, =) */
3753
3767
  searchMode?: 'text' | 'numeric' | 'auto';
3754
3768
  /** Custom filter UI from a plugin */
@@ -4980,4 +4994,27 @@ declare type VisualProps = DashboardProps & {
4980
4994
  */
4981
4995
  export declare type WeekStart = 0 | 1 | 2 | 3 | 4 | 5 | 6;
4982
4996
 
4997
+ export declare type WindowFunction = 'running_total' | 'moving_average' | 'previous_period_delta' | 'percent_of_total';
4998
+
4999
+ export declare interface WindowTransform {
5000
+ function: WindowFunction;
5001
+ orderBy?: {
5002
+ fieldId: string;
5003
+ direction?: 'asc' | 'desc';
5004
+ };
5005
+ partitionByFieldIds?: string[];
5006
+ frame?: 'unbounded_preceding';
5007
+ movingAverage?: {
5008
+ windowSize?: number;
5009
+ minPeriods?: number;
5010
+ };
5011
+ previousPeriodDelta?: {
5012
+ mode?: 'absolute' | 'percent';
5013
+ };
5014
+ percentOfTotal?: {
5015
+ scope?: 'grand_total' | 'partition_total';
5016
+ output?: 'fraction' | 'percent';
5017
+ };
5018
+ }
5019
+
4983
5020
  export { }
@@ -335,6 +335,8 @@ declare type DateSelectionMode = 'range' | 'months';
335
335
 
336
336
  declare type DateUnit = 'day' | 'week' | 'month' | 'quarter' | 'year';
337
337
 
338
+ declare type DefaultDateFilter = RelativeDateFilter | FixedMonthDefaultDateFilter;
339
+
338
340
  /**
339
341
  * Field configuration for detail table columns.
340
342
  * Unlike GroupByField, DetailField does not support aggregation or granularity.
@@ -698,6 +700,17 @@ declare type FilterSemanticContext = {
698
700
 
699
701
  declare type FilterValue = string | number | boolean | Date | null | [number, number] | [string, string] | string[] | number[];
700
702
 
703
+ /**
704
+ * Absolute fixed month/year default used by Month Picker defaults.
705
+ * - `month` is 0-indexed (0=January, 11=December) to align with MonthPicker.
706
+ */
707
+ declare type FixedMonthDefaultDateFilter = {
708
+ mode: 'fixed';
709
+ unit: 'month';
710
+ year: number;
711
+ month: number;
712
+ };
713
+
701
714
  declare type Granularity = 'day' | 'week' | 'month' | 'quarter' | 'year' | 'hour' | 'minute' | 'second';
702
715
 
703
716
  declare interface GroupByColumn extends BaseColumn {
@@ -867,6 +880,7 @@ declare interface MetricField extends Field {
867
880
  */
868
881
  parameters?: {
869
882
  filters?: FilterGroup;
883
+ windowTransform?: WindowTransform;
870
884
  };
871
885
  aliasTemplate?: string;
872
886
  valueAliases?: Record<string, string>;
@@ -1492,7 +1506,7 @@ declare type TFilter = {
1492
1506
  uiType?: 'radio' | 'dropdown' | 'tabs';
1493
1507
  dateSelectionMode?: DateSelectionMode;
1494
1508
  defaultValues?: (string | number)[];
1495
- defaultDateFilter?: RelativeDateFilter;
1509
+ defaultDateFilter?: DefaultDateFilter;
1496
1510
  sheetId?: string;
1497
1511
  location?: FilterLocation;
1498
1512
  hide?: boolean;
@@ -1639,8 +1653,8 @@ declare type TInlineFilter = {
1639
1653
  dateSelectionMode?: DateSelectionMode;
1640
1654
  /** Default values applied when the dashboard first loads */
1641
1655
  defaultValues?: (string | number)[];
1642
- /** Default relative date filter (e.g., "Last 7 days") applied on dashboard load */
1643
- defaultDateFilter?: RelativeDateFilter;
1656
+ /** Default date filter applied on dashboard load (relative or fixed month/year) */
1657
+ defaultDateFilter?: DefaultDateFilter;
1644
1658
  /** Search mode for numeric filters: 'text' treats as text, 'numeric' enables operators (>, <, =) */
1645
1659
  searchMode?: 'text' | 'numeric' | 'auto';
1646
1660
  /** Custom filter UI from a plugin */
@@ -1764,4 +1778,27 @@ declare type VisualDisplayPreferences = {
1764
1778
  };
1765
1779
  };
1766
1780
 
1781
+ declare type WindowFunction = 'running_total' | 'moving_average' | 'previous_period_delta' | 'percent_of_total';
1782
+
1783
+ declare interface WindowTransform {
1784
+ function: WindowFunction;
1785
+ orderBy?: {
1786
+ fieldId: string;
1787
+ direction?: 'asc' | 'desc';
1788
+ };
1789
+ partitionByFieldIds?: string[];
1790
+ frame?: 'unbounded_preceding';
1791
+ movingAverage?: {
1792
+ windowSize?: number;
1793
+ minPeriods?: number;
1794
+ };
1795
+ previousPeriodDelta?: {
1796
+ mode?: 'absolute' | 'percent';
1797
+ };
1798
+ percentOfTotal?: {
1799
+ scope?: 'grand_total' | 'partition_total';
1800
+ output?: 'fraction' | 'percent';
1801
+ };
1802
+ }
1803
+
1767
1804
  export { }
@@ -444,6 +444,8 @@ declare type DateSelectionMode = 'range' | 'months';
444
444
 
445
445
  declare type DateUnit = 'day' | 'week' | 'month' | 'quarter' | 'year';
446
446
 
447
+ declare type DefaultDateFilter = RelativeDateFilter | FixedMonthDefaultDateFilter;
448
+
447
449
  /**
448
450
  * Field configuration for detail table columns.
449
451
  * Unlike GroupByField, DetailField does not support aggregation or granularity.
@@ -822,6 +824,17 @@ declare type FilterSemanticContext = {
822
824
 
823
825
  declare type FilterValue = string | number | boolean | Date | null | [number, number] | [string, string] | string[] | number[];
824
826
 
827
+ /**
828
+ * Absolute fixed month/year default used by Month Picker defaults.
829
+ * - `month` is 0-indexed (0=January, 11=December) to align with MonthPicker.
830
+ */
831
+ declare type FixedMonthDefaultDateFilter = {
832
+ mode: 'fixed';
833
+ unit: 'month';
834
+ year: number;
835
+ month: number;
836
+ };
837
+
825
838
  export declare type GetDashboardResponse = {
826
839
  dashboard: TDashboard;
827
840
  lenses: TLens[];
@@ -1019,6 +1032,7 @@ declare interface MetricField extends Field {
1019
1032
  */
1020
1033
  parameters?: {
1021
1034
  filters?: FilterGroup;
1035
+ windowTransform?: WindowTransform;
1022
1036
  };
1023
1037
  aliasTemplate?: string;
1024
1038
  valueAliases?: Record<string, string>;
@@ -1685,7 +1699,7 @@ declare type TFilter = {
1685
1699
  uiType?: 'radio' | 'dropdown' | 'tabs';
1686
1700
  dateSelectionMode?: DateSelectionMode;
1687
1701
  defaultValues?: (string | number)[];
1688
- defaultDateFilter?: RelativeDateFilter;
1702
+ defaultDateFilter?: DefaultDateFilter;
1689
1703
  sheetId?: string;
1690
1704
  location?: FilterLocation;
1691
1705
  hide?: boolean;
@@ -1834,8 +1848,8 @@ export declare type TInlineFilter = {
1834
1848
  dateSelectionMode?: DateSelectionMode;
1835
1849
  /** Default values applied when the dashboard first loads */
1836
1850
  defaultValues?: (string | number)[];
1837
- /** Default relative date filter (e.g., "Last 7 days") applied on dashboard load */
1838
- defaultDateFilter?: RelativeDateFilter;
1851
+ /** Default date filter applied on dashboard load (relative or fixed month/year) */
1852
+ defaultDateFilter?: DefaultDateFilter;
1839
1853
  /** Search mode for numeric filters: 'text' treats as text, 'numeric' enables operators (>, <, =) */
1840
1854
  searchMode?: 'text' | 'numeric' | 'auto';
1841
1855
  /** Custom filter UI from a plugin */
@@ -1971,4 +1985,27 @@ export declare type VisualDisplayPreferences = {
1971
1985
  };
1972
1986
  };
1973
1987
 
1988
+ declare type WindowFunction = 'running_total' | 'moving_average' | 'previous_period_delta' | 'percent_of_total';
1989
+
1990
+ declare interface WindowTransform {
1991
+ function: WindowFunction;
1992
+ orderBy?: {
1993
+ fieldId: string;
1994
+ direction?: 'asc' | 'desc';
1995
+ };
1996
+ partitionByFieldIds?: string[];
1997
+ frame?: 'unbounded_preceding';
1998
+ movingAverage?: {
1999
+ windowSize?: number;
2000
+ minPeriods?: number;
2001
+ };
2002
+ previousPeriodDelta?: {
2003
+ mode?: 'absolute' | 'percent';
2004
+ };
2005
+ percentOfTotal?: {
2006
+ scope?: 'grand_total' | 'partition_total';
2007
+ output?: 'fraction' | 'percent';
2008
+ };
2009
+ }
2010
+
1974
2011
  export { }
@@ -661,6 +661,8 @@ export declare const DEFAULT_CALENDAR_CONTEXT: CalendarContext;
661
661
 
662
662
  export declare const DEFAULT_SEMANTIC_DOMAIN_ACCESS: SemanticDomainAccess;
663
663
 
664
+ declare type DefaultDateFilter = RelativeDateFilter | FixedMonthDefaultDateFilter;
665
+
664
666
  /**
665
667
  * Field configuration for detail table columns.
666
668
  * Unlike GroupByField, DetailField does not support aggregation or granularity.
@@ -1039,6 +1041,17 @@ declare type FilterSemanticContext = {
1039
1041
 
1040
1042
  declare type FilterValue = string | number | boolean | Date | null | [number, number] | [string, string] | string[] | number[];
1041
1043
 
1044
+ /**
1045
+ * Absolute fixed month/year default used by Month Picker defaults.
1046
+ * - `month` is 0-indexed (0=January, 11=December) to align with MonthPicker.
1047
+ */
1048
+ declare type FixedMonthDefaultDateFilter = {
1049
+ mode: 'fixed';
1050
+ unit: 'month';
1051
+ year: number;
1052
+ month: number;
1053
+ };
1054
+
1042
1055
  export declare type GetDashboardResponse = {
1043
1056
  dashboard: TDashboard;
1044
1057
  lenses: TLens[];
@@ -1236,6 +1249,7 @@ declare interface MetricField extends Field {
1236
1249
  */
1237
1250
  parameters?: {
1238
1251
  filters?: FilterGroup;
1252
+ windowTransform?: WindowTransform;
1239
1253
  };
1240
1254
  aliasTemplate?: string;
1241
1255
  valueAliases?: Record<string, string>;
@@ -1936,7 +1950,7 @@ declare type TFilter = {
1936
1950
  uiType?: 'radio' | 'dropdown' | 'tabs';
1937
1951
  dateSelectionMode?: DateSelectionMode;
1938
1952
  defaultValues?: (string | number)[];
1939
- defaultDateFilter?: RelativeDateFilter;
1953
+ defaultDateFilter?: DefaultDateFilter;
1940
1954
  sheetId?: string;
1941
1955
  location?: FilterLocation;
1942
1956
  hide?: boolean;
@@ -2085,8 +2099,8 @@ export declare type TInlineFilter = {
2085
2099
  dateSelectionMode?: DateSelectionMode;
2086
2100
  /** Default values applied when the dashboard first loads */
2087
2101
  defaultValues?: (string | number)[];
2088
- /** Default relative date filter (e.g., "Last 7 days") applied on dashboard load */
2089
- defaultDateFilter?: RelativeDateFilter;
2102
+ /** Default date filter applied on dashboard load (relative or fixed month/year) */
2103
+ defaultDateFilter?: DefaultDateFilter;
2090
2104
  /** Search mode for numeric filters: 'text' treats as text, 'numeric' enables operators (>, <, =) */
2091
2105
  searchMode?: 'text' | 'numeric' | 'auto';
2092
2106
  /** Custom filter UI from a plugin */
@@ -2508,4 +2522,27 @@ export declare type VisualDisplayPreferences = {
2508
2522
  */
2509
2523
  export declare type WeekStart = 0 | 1 | 2 | 3 | 4 | 5 | 6;
2510
2524
 
2525
+ declare type WindowFunction = 'running_total' | 'moving_average' | 'previous_period_delta' | 'percent_of_total';
2526
+
2527
+ declare interface WindowTransform {
2528
+ function: WindowFunction;
2529
+ orderBy?: {
2530
+ fieldId: string;
2531
+ direction?: 'asc' | 'desc';
2532
+ };
2533
+ partitionByFieldIds?: string[];
2534
+ frame?: 'unbounded_preceding';
2535
+ movingAverage?: {
2536
+ windowSize?: number;
2537
+ minPeriods?: number;
2538
+ };
2539
+ previousPeriodDelta?: {
2540
+ mode?: 'absolute' | 'percent';
2541
+ };
2542
+ percentOfTotal?: {
2543
+ scope?: 'grand_total' | 'partition_total';
2544
+ output?: 'fraction' | 'percent';
2545
+ };
2546
+ }
2547
+
2511
2548
  export { }
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.1.231",
8
+ "version": "0.1.233",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",