react-semaphor 0.1.199 → 0.1.201

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 (31) hide show
  1. package/dist/chunks/{dashboard-controls-D-lU3D5L.js → dashboard-controls-BacLhDZ5.js} +5 -5
  2. package/dist/chunks/{dashboard-controls-B6gqaQL1.js → dashboard-controls-dHxXj3lu.js} +1 -1
  3. package/dist/chunks/{dashboard-json-C3BE6uN_.js → dashboard-json-B9GQb5g8.js} +1 -1
  4. package/dist/chunks/{dashboard-json-BzVtq54n.js → dashboard-json-D_ssqHMn.js} +1 -1
  5. package/dist/chunks/{dashboard-summary-settings-dialog-Bnq5921w.js → dashboard-summary-settings-dialog-CrK0Y8eU.js} +1 -1
  6. package/dist/chunks/{dashboard-summary-settings-dialog-Chmxt_4e.js → dashboard-summary-settings-dialog-PTZFYaCj.js} +1 -1
  7. package/dist/chunks/{edit-dashboard-visual-DvAuZHDg.js → edit-dashboard-visual-4m9e0fE3.js} +11 -11
  8. package/dist/chunks/{edit-dashboard-visual-BmdaNAnk.js → edit-dashboard-visual-B09o_T1B.js} +2104 -2099
  9. package/dist/chunks/{editor-action-buttons-BtFxLRx0.js → editor-action-buttons-BTfSScCK.js} +1 -1
  10. package/dist/chunks/{editor-action-buttons-DDmc2pWg.js → editor-action-buttons-DqVXlwGQ.js} +2 -2
  11. package/dist/chunks/{index-DvPV1l5p.js → index-Bbio7O6b.js} +214 -214
  12. package/dist/chunks/{index-BsmVQ6V_.js → index-dzyROcGu.js} +5449 -5361
  13. package/dist/chunks/{notification-bell-1nHRlNVm.js → notification-bell-DUgBTV22.js} +1 -1
  14. package/dist/chunks/{notification-bell-G1R5nji8.js → notification-bell-zly06Xaf.js} +3 -3
  15. package/dist/chunks/{resource-management-panel-nfB5YoSU.js → resource-management-panel-Bcm1QBik.js} +1 -1
  16. package/dist/chunks/{resource-management-panel-DEmbaJIX.js → resource-management-panel-CGjcKL2u.js} +3 -3
  17. package/dist/chunks/{use-role-aware-display-preferences-XnHpJXhg.js → use-role-aware-display-preferences-CTtWN05-.js} +1 -1
  18. package/dist/chunks/{use-role-aware-display-preferences-BBcrHphg.js → use-role-aware-display-preferences-DVP5ZxZJ.js} +1 -1
  19. package/dist/chunks/{use-visual-utils-BJ9ugeMi.js → use-visual-utils-D5Tp7ZlC.js} +1 -1
  20. package/dist/chunks/{use-visual-utils-BSVc8pNF.js → use-visual-utils-agqKw1Gz.js} +1 -1
  21. package/dist/dashboard/index.cjs +1 -1
  22. package/dist/dashboard/index.js +1 -1
  23. package/dist/index.cjs +1 -1
  24. package/dist/index.js +5 -5
  25. package/dist/surfboard/index.cjs +1 -1
  26. package/dist/surfboard/index.js +2 -2
  27. package/dist/types/dashboard.d.ts +20 -0
  28. package/dist/types/main.d.ts +20 -0
  29. package/dist/types/surfboard.d.ts +20 -0
  30. package/dist/types/types.d.ts +20 -0
  31. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- "use strict";const f=require("react"),t=require("./index-DvPV1l5p.js"),e=require("react/jsx-runtime"),N=require("./editor-action-buttons-BtFxLRx0.js"),T=require("./use-visual-utils-BJ9ugeMi.js"),I=require("./date-formatter-Sz6QDaM8.js");/**
1
+ "use strict";const f=require("react"),t=require("./index-Bbio7O6b.js"),e=require("react/jsx-runtime"),N=require("./editor-action-buttons-BTfSScCK.js"),T=require("./use-visual-utils-D5Tp7ZlC.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 oe, { useState as A, useRef as L, useCallback as P, useEffect as D, useContext as ie } from "react";
2
- import { b3 as te, aK as R, a5 as I, aH as B, aD as ae, aE as $, a6 as se, aC as le, aL as ce, aM as de, aN as ue, aO as me, aP as he, aS as O, bX as pe, c0 as fe, c1 as H, aV as ge, B as E, aW as _, az as M, bb as ve, u as S, bf as xe, ax as re, c2 as be, c3 as j, aX as U, A as we, c4 as Ce, c as T, bm as X, bn as q, bo as G, bp as W, bq as J, aA as Ne, c5 as ye, c6 as Ae, c7 as Ee, bE as Se, bF as De, bG as Ie, c8 as ke, bH as Ue, bI as Te, bJ as Fe, bK as Pe, bL as Me, Y as Ve, I as Le, c9 as ze, ca as Oe, aJ as Re, X as Be, cb as $e, cc as _e, cd as He, aF as K, R as je, a8 as Xe, P as qe, p as Ge, ce as We, r as Je } from "./index-BsmVQ6V_.js";
2
+ import { b3 as te, aK as R, a5 as I, aH as B, aD as ae, aE as $, a6 as se, aC as le, aL as ce, aM as de, aN as ue, aO as me, aP as he, aS as O, bX as pe, c0 as fe, c1 as H, aV as ge, B as E, aW as _, az as M, bb as ve, u as S, bf as xe, ax as re, c2 as be, c3 as j, aX as U, A as we, c4 as Ce, c as T, bm as X, bn as q, bo as G, bp as W, bq as J, aA as Ne, c5 as ye, c6 as Ae, c7 as Ee, bE as Se, bF as De, bG as Ie, c8 as ke, bH as Ue, bI as Te, bJ as Fe, bK as Pe, bL as Me, Y as Ve, I as Le, c9 as ze, ca as Oe, aJ as Re, X as Be, cb as $e, cc as _e, cd as He, aF as K, R as je, a8 as Xe, P as qe, p as Ge, ce as We, r as Je } from "./index-dzyROcGu.js";
3
3
  import { jsx as t, jsxs as r, Fragment as V } from "react/jsx-runtime";
4
- import { E as Ke, V as Ye, a as Qe, b as Ze, S as Y, c as et, C as tt } from "./editor-action-buttons-DDmc2pWg.js";
5
- import { a as ne } from "./use-visual-utils-BSVc8pNF.js";
4
+ import { E as Ke, V as Ye, a as Qe, b as Ze, S as Y, c as et, C as tt } from "./editor-action-buttons-DqVXlwGQ.js";
5
+ import { a as ne } from "./use-visual-utils-agqKw1Gz.js";
6
6
  import { c as Q } 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-DvPV1l5p.js"),c=require("react"),de=require("./use-visual-utils-BJ9ugeMi.js"),pe=require("./use-role-aware-display-preferences-BBcrHphg.js");/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./index-Bbio7O6b.js"),c=require("react"),de=require("./use-visual-utils-D5Tp7ZlC.js"),pe=require("./use-role-aware-display-preferences-DVP5ZxZJ.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 { jsx as e, jsxs as n, Fragment as ge } from "react/jsx-runtime";
2
- import { b3 as Qe, u as me, az as Xe, bf as re, bj as Ze, bk as $e, c as Z, bl as ke, bm as et, bn as tt, B as _, bo as st, bp as nt, bq as G, br as pe, aW as oe, bs as at, bt as it, bu as rt, bv as ve, bw as De, bx as ot, by as lt, I as dt, bz as ye, e as le, bA as Se, bB as Ee, bC as ct, M as Ve, H as Le, bD as Ae, bE as Oe, bF as Te, bG as Re, bH as Pe, bI as Ue, bJ as Ie, bK as Me, bL as je, bM as ut, bN as ht, bO as Fe, bP as ze, bQ as Be, bR as mt, bS as He, bT as pt, A as ae, aK as ft, bU as _e, bV as gt, bW as Dt, aL as xt, aM as bt, aN as Nt, aO as wt, aP as vt, aS as Ce, bX as fe, aV as Ct, bY as yt, bZ as St, b_ as Et, b$ as Vt } from "./index-BsmVQ6V_.js";
2
+ import { b3 as Qe, u as me, az as Xe, bf as re, bj as Ze, bk as $e, c as Z, bl as ke, bm as et, bn as tt, B as _, bo as st, bp as nt, bq as G, br as pe, aW as oe, bs as at, bt as it, bu as rt, bv as ve, bw as De, bx as ot, by as lt, I as dt, bz as ye, e as le, bA as Se, bB as Ee, bC as ct, M as Ve, H as Le, bD as Ae, bE as Oe, bF as Te, bG as Re, bH as Pe, bI as Ue, bJ as Ie, bK as Me, bL as je, bM as ut, bN as ht, bO as Fe, bP as ze, bQ as Be, bR as mt, bS as He, bT as pt, A as ae, aK as ft, bU as _e, bV as gt, bW as Dt, aL as xt, aM as bt, aN as Nt, aO as wt, aP as vt, aS as Ce, bX as fe, aV as Ct, bY as yt, bZ as St, b_ as Et, b$ as Vt } from "./index-dzyROcGu.js";
3
3
  import Lt, { useRef as At, useEffect as ie, useState as x } from "react";
4
- import { a as Ke } from "./use-visual-utils-BSVc8pNF.js";
5
- import { u as Ot } from "./use-role-aware-display-preferences-XnHpJXhg.js";
4
+ import { a as Ke } from "./use-visual-utils-agqKw1Gz.js";
5
+ import { u as Ot } from "./use-role-aware-display-preferences-CTtWN05-.js";
6
6
  /**
7
7
  * @license lucide-react v0.453.0 - ISC
8
8
  *
@@ -1,4 +1,4 @@
1
- import { b as m, e as t, g as D, f as U, h as b, i as u, j as E, k as g } from "./index-BsmVQ6V_.js";
1
+ import { b as m, e as t, g as D, f as U, h as b, i as u, j as E, k as g } from "./index-dzyROcGu.js";
2
2
  import { useMemo as i } from "react";
3
3
  function S() {
4
4
  const { displayPreferences: n, shouldShowElement: c } = m(), { currentUser: a, userContext: s } = t(), r = i(
@@ -1 +1 @@
1
- "use strict";const a=require("./index-DvPV1l5p.js"),n=require("react");function f(){const{displayPreferences:c,shouldShowElement:o}=a.useDisplayPreferences(),{currentUser:e,userContext:s}=a.useCurrentUserInfo(),i=n.useMemo(()=>a.getRoleBasedDisplayOverrides(e),[e]),t=n.useMemo(()=>r=>i&&i[r]!==void 0&&i[r]===!1?!1:o(r),[i,o,c]),p=n.useMemo(()=>{var r,d,l,u,h;return{canEdit:((r=s==null?void 0:s.permissions)==null?void 0:r.canEdit)??a.canUserEdit(e),canUseFilters:((d=s==null?void 0:s.permissions)==null?void 0:d.canEdit)??a.canUserUseFilters(e),canManageDashboards:((l=s==null?void 0:s.permissions)==null?void 0:l.canCreateDashboard)??a.canUserManageDashboards(e),canCreateDashboards:((u=s==null?void 0:s.permissions)==null?void 0:u.canCreateDashboard)??a.canUserCreateDashboards(e),canAccessVisuals:((h=s==null?void 0:s.permissions)==null?void 0:h.canEdit)??a.canUserAccessVisuals(e)}},[e,s]);return{displayPreferences:c,shouldShowElement:t,permissions:p,currentUser:e}}exports.useRoleAwareDisplayPreferences=f;
1
+ "use strict";const a=require("./index-Bbio7O6b.js"),n=require("react");function f(){const{displayPreferences:c,shouldShowElement:o}=a.useDisplayPreferences(),{currentUser:e,userContext:s}=a.useCurrentUserInfo(),i=n.useMemo(()=>a.getRoleBasedDisplayOverrides(e),[e]),t=n.useMemo(()=>r=>i&&i[r]!==void 0&&i[r]===!1?!1:o(r),[i,o,c]),p=n.useMemo(()=>{var r,d,l,u,h;return{canEdit:((r=s==null?void 0:s.permissions)==null?void 0:r.canEdit)??a.canUserEdit(e),canUseFilters:((d=s==null?void 0:s.permissions)==null?void 0:d.canEdit)??a.canUserUseFilters(e),canManageDashboards:((l=s==null?void 0:s.permissions)==null?void 0:l.canCreateDashboard)??a.canUserManageDashboards(e),canCreateDashboards:((u=s==null?void 0:s.permissions)==null?void 0:u.canCreateDashboard)??a.canUserCreateDashboards(e),canAccessVisuals:((h=s==null?void 0:s.permissions)==null?void 0:h.canEdit)??a.canUserAccessVisuals(e)}},[e,s]);return{displayPreferences:c,shouldShowElement:t,permissions:p,currentUser:e}}exports.useRoleAwareDisplayPreferences=f;
@@ -1 +1 @@
1
- "use strict";const a=require("./index-DvPV1l5p.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 M(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 w=(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,...w&&{customCardPreferences:{...t.customCardPreferences,settings:w}}},E=n.cards.map(S=>S.id===t.id?v:S);return{...n,cards:E,activeCardId:Q(E,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:w,setSelectedDatamodelId:v,setFilterValues:E,setApplyFilters:I}=a.useEditorActions(),{setIsDashboardEditing:S,setIsVisualEditing:V,setSelectedFrameId:$,clearSelectedFrameId:A,addFrame:N,setIsDashboardPanelOpen:R}=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 M(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:w,setSelectedDatamodelId:v,setFilterValues:E,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,w,v,E,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 M(n.apiServiceUrl,(e==null?void 0:e.accessToken)||"",u.id,t),P=(f==null?void 0:f.frameObject)??((b=f==null?void 0:f.visual)==null?void 0:b.frameObject);if(!P)return{success:!1,error:"Visual has no frame data"};const U=L(P);if(!(U!=null&&U.cards)||U.cards.length===0)return{success:!1,error:"Visual frame is malformed"};const W={...a.cloneFrameWithNewIds(U),visualId:u.id};return N(y,W,"end"),S(!0),$(W.id),R(!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,N,S,$,R]);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-Bbio7O6b.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 M(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 w=(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,...w&&{customCardPreferences:{...t.customCardPreferences,settings:w}}},E=n.cards.map(S=>S.id===t.id?v:S);return{...n,cards:E,activeCardId:Q(E,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:w,setSelectedDatamodelId:v,setFilterValues:E,setApplyFilters:I}=a.useEditorActions(),{setIsDashboardEditing:S,setIsVisualEditing:V,setSelectedFrameId:$,clearSelectedFrameId:A,addFrame:N,setIsDashboardPanelOpen:R}=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 M(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:w,setSelectedDatamodelId:v,setFilterValues:E,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,w,v,E,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 M(n.apiServiceUrl,(e==null?void 0:e.accessToken)||"",u.id,t),P=(f==null?void 0:f.frameObject)??((b=f==null?void 0:f.visual)==null?void 0:b.frameObject);if(!P)return{success:!1,error:"Visual has no frame data"};const U=L(P);if(!(U!=null&&U.cards)||U.cards.length===0)return{success:!1,error:"Visual frame is malformed"};const W={...a.cloneFrameWithNewIds(U),visualId:u.id};return N(y,W,"end"),S(!0),$(W.id),R(!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,N,S,$,R]);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,4 +1,4 @@
1
- import { be as G, aK as K, ba as Y, bb as J, bf as X, aA as _, ax as Z, u as v, bg as q, bh as ee, aX as V, bi as te, az as f } from "./index-BsmVQ6V_.js";
1
+ import { be as G, aK as K, ba as Y, bb as J, bf as X, aA as _, ax as Z, u as v, bg as q, bh as ee, aX as V, bi as te, az as f } from "./index-dzyROcGu.js";
2
2
  import { useState as j, useEffect as re, useCallback as A } 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";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-DvPV1l5p.js"),o=require("../chunks/common-types-CfJLrTJd.js");exports.Dashboard=e.Dashboard;exports.EMPTY_SELECTION=o.EMPTY_SELECTION;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-Bbio7O6b.js"),o=require("../chunks/common-types-CfJLrTJd.js");exports.Dashboard=e.Dashboard;exports.EMPTY_SELECTION=o.EMPTY_SELECTION;
@@ -1,4 +1,4 @@
1
- import { D as a } from "../chunks/index-BsmVQ6V_.js";
1
+ import { D as a } from "../chunks/index-dzyROcGu.js";
2
2
  import { E as s } from "../chunks/common-types-DhqlRVrq.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-DvPV1l5p.js"),P=require("./chunks/common-types-CfJLrTJd.js"),S=require("./chunks/dashboard-summary-settings-dialog-Chmxt_4e.js"),r=require("react/jsx-runtime"),f=require("react"),A=require("./chunks/resource-management-panel-nfB5YoSU.js"),N=require("./types/index.cjs");require("react-dom");const d=require("./chunks/notification-bell-1nHRlNVm.js");function j(a){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const s in a)if(s!=="default"){const i=Object.getOwnPropertyDescriptor(a,s);Object.defineProperty(o,s,i.get?i:{enumerable:!0,get:()=>a[s]})}}return o.default=a,Object.freeze(o)}const h=j(f);function _(a){const{displayPreferences:o,...s}=a,i={...s,id:a.dashboardId};return r.jsx(e.ErrorBoundary,{FallbackComponent:e.Fallback,children:r.jsxs(e.SemaphorContextProvider,{dashboardProps:i,children:[r.jsx(e.SemaphorReadyIndicator,{componentType:"visual",componentId:a.cardId}),r.jsx(e.UXProvider,{children:r.jsx(e.DisplayPreferencesProvider,{displayPreferences:o,children:r.jsx(e.Container,{type:"visual",...i,children:r.jsx(M,{cardId:a.cardId})})})})]})})}function M({cardId:a}){const o=e.useDashboardStore(n=>{var l;return(l=n.dashboard)==null?void 0:l.sheets}),{card:s,frame:i}=f.useMemo(()=>{const n=o==null?void 0:o.flatMap(t=>t.frames),l=n==null?void 0:n.flatMap(t=>t==null?void 0:t.cards),C=l==null?void 0:l.find(t=>(t==null?void 0:t.id)===a),x=n==null?void 0:n.find(t=>{var m;return(m=t==null?void 0:t.cards)==null?void 0:m.find(c=>(c==null?void 0:c.id)===a)});return{card:C,frame:x}},[o,a]);return!s||!i?r.jsx(e.FallbackVisual,{error:new Error("Card not found"),resetErrorBoundary:()=>{},customerFacingMessage:`Card not found with ID: ${a}`}):r.jsx("main",{className:"flex h-full grow flex-col",children:r.jsx(e.ErrorBoundary,{FallbackComponent:({error:n,resetErrorBoundary:l})=>r.jsx(e.FallbackVisual,{error:n,resetErrorBoundary:l,customerFacingMessage:"Error creating visual. Please try again."}),children:r.jsx(e.DashboardCard,{card:s,frame:i})})})}function w({name:a,items:o,value:s,onChange:i,isLoading:n,isError:l,refetch:C,className:x,icon:t,showNone:m=!1}){const c=h.useRef(null),[D,g]=h.useState(!1),[y,b]=h.useState("100%"),E=m?[...o||[],{id:"none",name:"None"}]:o;h.useLayoutEffect(()=>{c.current&&b(c.current.offsetWidth)},[]);function T(){var u;return n?"Loading...":l?"Error":s?(u=o==null?void 0:o.find(p=>p.id===s))==null?void 0:u.name:`Select ${a}`}function v(u,p){i(p),g(!1)}return r.jsxs(e.Popover,{open:D,onOpenChange:g,children:[r.jsx(e.PopoverTrigger,{asChild:!0,children:r.jsxs(e.Button,{ref:c,variant:"outline",role:"combobox","aria-expanded":D,className:e.cn("flex h-9 w-full justify-between",x),children:[r.jsxs("div",{className:"flex items-center gap-2",children:[t&&r.jsx("div",{className:"mr-2",children:t}),r.jsx("span",{className:"max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap",children:T()})]}),r.jsx(e.ChevronDown,{className:"size-4 opacity-50"})]})}),r.jsx(e.PopoverContent,{className:"w-full p-0",style:{minWidth:y},children:r.jsxs(e.Command,{children:[r.jsxs("div",{className:"flex h-9 items-center justify-between border-b pr-1",children:[r.jsx(e.CommandInput,{className:"h-9",placeholder:"Search..."}),r.jsx(e.IconButton,{className:"h-7",onClick:C,children:r.jsx(e.RefreshCw,{className:e.cn("size-3.5 opacity-50",n&&"animate-spin")})})]}),r.jsxs(e.CommandList,{children:[r.jsxs(e.CommandEmpty,{children:["No ",a==null?void 0:a.toLowerCase()," found."]}),r.jsx(e.CommandGroup,{children:E==null?void 0:E.map(u=>r.jsx(e.CommandItem,{className:"overflow-x-auto",value:u.name,onSelect:p=>v(p,u.id),children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(e.Check,{className:e.cn("size-4",s===u.id?"opacity-100":"opacity-0")}),r.jsx("div",{title:u.name,children:u.name})]})},u.id))})]})]})})]})}function I(a,o){f.useEffect(()=>(a&&o&&(window.__SEMAPHOR_PRINT_STATE__={...o}),()=>{a&&window.__SEMAPHOR_PRINT_STATE__&&delete window.__SEMAPHOR_PRINT_STATE__}),[a,o])}exports.CALCULATED_FIELD_ENTITY_MARKER=e.CALCULATED_FIELD_ENTITY_MARKER;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.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.cancelExport=e.cancelExport;exports.cloneDeep=e.cloneDeep;exports.createEmptyKpiConfig=e.createEmptyKpiConfig;exports.createExport=e.createExport;exports.createSqlGenConfig=e.createSqlGenConfig;exports.downloadPdf=e.downloadPdf;exports.emitDashboardLoad=e.emitDashboardLoad;exports.emitDashboardUnload=e.emitDashboardUnload;exports.fmt=e.fmt;exports.formatFileSize=e.formatFileSize;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.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.resolveDataType=e.resolveDataType;exports.resolveDatamodelName=e.resolveDatamodelName;exports.useActiveExports=e.useActiveExports;exports.useCard=e.useCard;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.useTextFilterHook=e.useTextFilterHook;exports.EMPTY_SELECTION=P.EMPTY_SELECTION;exports.CalendarPreferencesDialog=S.CalendarPreferencesDialog;exports.DashboardSummarySettingsDialog=S.DashboardSummarySettingsDialog;exports.ResourceManagementPanel=A.ResourceManagementPanel;exports.DEFAULT_CALENDAR_CONTEXT=N.DEFAULT_CALENDAR_CONTEXT;exports.AdvancedModeToggle=d.AdvancedModeToggle;exports.ExportNotificationItem=d.ExportNotificationItem;exports.ExportNotificationList=d.ExportNotificationList;exports.NotificationBell=d.NotificationBell;exports.ScheduleDashboard=d.ScheduleDashboard;exports.UnsavedChangesAlert=d.UnsavedChangesAlert;exports.VisualEditingControls=d.VisualEditingControls;exports.useExportPolling=d.useExportPolling;exports.useExportRecovery=d.useExportRecovery;exports.usePristineSnapshotInitializer=d.usePristineSnapshotInitializer;exports.Combobox=w;exports.Visual=_;exports.useExposePrintState=I;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-Bbio7O6b.js"),P=require("./chunks/common-types-CfJLrTJd.js"),S=require("./chunks/dashboard-summary-settings-dialog-PTZFYaCj.js"),r=require("react/jsx-runtime"),f=require("react"),A=require("./chunks/resource-management-panel-Bcm1QBik.js"),N=require("./types/index.cjs");require("react-dom");const d=require("./chunks/notification-bell-DUgBTV22.js");function j(a){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const s in a)if(s!=="default"){const i=Object.getOwnPropertyDescriptor(a,s);Object.defineProperty(o,s,i.get?i:{enumerable:!0,get:()=>a[s]})}}return o.default=a,Object.freeze(o)}const h=j(f);function _(a){const{displayPreferences:o,...s}=a,i={...s,id:a.dashboardId};return r.jsx(e.ErrorBoundary,{FallbackComponent:e.Fallback,children:r.jsxs(e.SemaphorContextProvider,{dashboardProps:i,children:[r.jsx(e.SemaphorReadyIndicator,{componentType:"visual",componentId:a.cardId}),r.jsx(e.UXProvider,{children:r.jsx(e.DisplayPreferencesProvider,{displayPreferences:o,children:r.jsx(e.Container,{type:"visual",...i,children:r.jsx(M,{cardId:a.cardId})})})})]})})}function M({cardId:a}){const o=e.useDashboardStore(n=>{var l;return(l=n.dashboard)==null?void 0:l.sheets}),{card:s,frame:i}=f.useMemo(()=>{const n=o==null?void 0:o.flatMap(t=>t.frames),l=n==null?void 0:n.flatMap(t=>t==null?void 0:t.cards),C=l==null?void 0:l.find(t=>(t==null?void 0:t.id)===a),x=n==null?void 0:n.find(t=>{var m;return(m=t==null?void 0:t.cards)==null?void 0:m.find(c=>(c==null?void 0:c.id)===a)});return{card:C,frame:x}},[o,a]);return!s||!i?r.jsx(e.FallbackVisual,{error:new Error("Card not found"),resetErrorBoundary:()=>{},customerFacingMessage:`Card not found with ID: ${a}`}):r.jsx("main",{className:"flex h-full grow flex-col",children:r.jsx(e.ErrorBoundary,{FallbackComponent:({error:n,resetErrorBoundary:l})=>r.jsx(e.FallbackVisual,{error:n,resetErrorBoundary:l,customerFacingMessage:"Error creating visual. Please try again."}),children:r.jsx(e.DashboardCard,{card:s,frame:i})})})}function w({name:a,items:o,value:s,onChange:i,isLoading:n,isError:l,refetch:C,className:x,icon:t,showNone:m=!1}){const c=h.useRef(null),[D,g]=h.useState(!1),[y,b]=h.useState("100%"),E=m?[...o||[],{id:"none",name:"None"}]:o;h.useLayoutEffect(()=>{c.current&&b(c.current.offsetWidth)},[]);function T(){var u;return n?"Loading...":l?"Error":s?(u=o==null?void 0:o.find(p=>p.id===s))==null?void 0:u.name:`Select ${a}`}function v(u,p){i(p),g(!1)}return r.jsxs(e.Popover,{open:D,onOpenChange:g,children:[r.jsx(e.PopoverTrigger,{asChild:!0,children:r.jsxs(e.Button,{ref:c,variant:"outline",role:"combobox","aria-expanded":D,className:e.cn("flex h-9 w-full justify-between",x),children:[r.jsxs("div",{className:"flex items-center gap-2",children:[t&&r.jsx("div",{className:"mr-2",children:t}),r.jsx("span",{className:"max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap",children:T()})]}),r.jsx(e.ChevronDown,{className:"size-4 opacity-50"})]})}),r.jsx(e.PopoverContent,{className:"w-full p-0",style:{minWidth:y},children:r.jsxs(e.Command,{children:[r.jsxs("div",{className:"flex h-9 items-center justify-between border-b pr-1",children:[r.jsx(e.CommandInput,{className:"h-9",placeholder:"Search..."}),r.jsx(e.IconButton,{className:"h-7",onClick:C,children:r.jsx(e.RefreshCw,{className:e.cn("size-3.5 opacity-50",n&&"animate-spin")})})]}),r.jsxs(e.CommandList,{children:[r.jsxs(e.CommandEmpty,{children:["No ",a==null?void 0:a.toLowerCase()," found."]}),r.jsx(e.CommandGroup,{children:E==null?void 0:E.map(u=>r.jsx(e.CommandItem,{className:"overflow-x-auto",value:u.name,onSelect:p=>v(p,u.id),children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(e.Check,{className:e.cn("size-4",s===u.id?"opacity-100":"opacity-0")}),r.jsx("div",{title:u.name,children:u.name})]})},u.id))})]})]})})]})}function I(a,o){f.useEffect(()=>(a&&o&&(window.__SEMAPHOR_PRINT_STATE__={...o}),()=>{a&&window.__SEMAPHOR_PRINT_STATE__&&delete window.__SEMAPHOR_PRINT_STATE__}),[a,o])}exports.CALCULATED_FIELD_ENTITY_MARKER=e.CALCULATED_FIELD_ENTITY_MARKER;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.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.cancelExport=e.cancelExport;exports.cloneDeep=e.cloneDeep;exports.createEmptyKpiConfig=e.createEmptyKpiConfig;exports.createExport=e.createExport;exports.createSqlGenConfig=e.createSqlGenConfig;exports.downloadPdf=e.downloadPdf;exports.emitDashboardLoad=e.emitDashboardLoad;exports.emitDashboardUnload=e.emitDashboardUnload;exports.fmt=e.fmt;exports.formatFileSize=e.formatFileSize;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.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.resolveDataType=e.resolveDataType;exports.resolveDatamodelName=e.resolveDatamodelName;exports.useActiveExports=e.useActiveExports;exports.useCard=e.useCard;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.useTextFilterHook=e.useTextFilterHook;exports.EMPTY_SELECTION=P.EMPTY_SELECTION;exports.CalendarPreferencesDialog=S.CalendarPreferencesDialog;exports.DashboardSummarySettingsDialog=S.DashboardSummarySettingsDialog;exports.ResourceManagementPanel=A.ResourceManagementPanel;exports.DEFAULT_CALENDAR_CONTEXT=N.DEFAULT_CALENDAR_CONTEXT;exports.AdvancedModeToggle=d.AdvancedModeToggle;exports.ExportNotificationItem=d.ExportNotificationItem;exports.ExportNotificationList=d.ExportNotificationList;exports.NotificationBell=d.NotificationBell;exports.ScheduleDashboard=d.ScheduleDashboard;exports.UnsavedChangesAlert=d.UnsavedChangesAlert;exports.VisualEditingControls=d.VisualEditingControls;exports.useExportPolling=d.useExportPolling;exports.useExportRecovery=d.useExportRecovery;exports.usePristineSnapshotInitializer=d.usePristineSnapshotInitializer;exports.Combobox=w;exports.Visual=_;exports.useExposePrintState=I;
package/dist/index.js CHANGED
@@ -1,14 +1,14 @@
1
- import { E as y, F as N, S as P, l as _, U as A, m as w, C as I, u as M, n as g, o as R, P as F, p as L, B as k, c as E, q as B, r as O, s as U, t as V, I as z, R as H, v as W, w as j, x as q, y as G, z as Q } from "./chunks/index-BsmVQ6V_.js";
2
- import { a9 as na, a1 as ia, aa as la, D as da, $ as ca, T as ua, aG as pa, ae as ma, H as ha, L as fa, L as Ca, M as Ea, a0 as xa, a as Da, aF as ga, Y as ya, ay as Sa, aB as ba, al as Ta, _ as va, V as Na, W as Pa, af as _a, aJ as Aa, an as wa, aE as Ia, aD as Ma, aC as Ra, am as Fa, aq as La, ar as ka, ak as Ba, Z as Oa, aj as Ua, ac as Va, ad as za, ab as Ha, ao as Wa, ai as ja, aI as qa, aH as Ga, ah as Qa, ag as Ka, as as Ya, ap as $a, a7 as Ja, Q as Xa, a3 as Za, au as ae, aw as ee, av as se, ax as oe, O as re, G as te, a2 as ne, a4 as ie, J as le, aA as de, at as ce, az as ue, a6 as pe, a5 as me, a8 as he, A as fe, N as Ce, K as Ee } from "./chunks/index-BsmVQ6V_.js";
1
+ import { E as y, F as N, S as P, l as _, U as A, m as w, C as I, u as M, n as g, o as R, P as F, p as L, B as k, c as E, q as B, r as O, s as U, t as V, I as z, R as H, v as W, w as j, x as q, y as G, z as Q } from "./chunks/index-dzyROcGu.js";
2
+ import { a9 as na, a1 as ia, aa as la, D as da, $ as ca, T as ua, aG as pa, ae as ma, H as ha, L as fa, L as Ca, M as Ea, a0 as xa, a as Da, aF as ga, Y as ya, ay as Sa, aB as ba, al as Ta, _ as va, V as Na, W as Pa, af as _a, aJ as Aa, an as wa, aE as Ia, aD as Ma, aC as Ra, am as Fa, aq as La, ar as ka, ak as Ba, Z as Oa, aj as Ua, ac as Va, ad as za, ab as Ha, ao as Wa, ai as ja, aI as qa, aH as Ga, ah as Qa, ag as Ka, as as Ya, ap as $a, a7 as Ja, Q as Xa, a3 as Za, au as ae, aw as ee, av as se, ax as oe, O as re, G as te, a2 as ne, a4 as ie, J as le, aA as de, at as ce, az as ue, a6 as pe, a5 as me, a8 as he, A as fe, N as Ce, K as Ee } from "./chunks/index-dzyROcGu.js";
3
3
  import { E as De } from "./chunks/common-types-DhqlRVrq.js";
4
- import { C as ye, D as Se } from "./chunks/dashboard-summary-settings-dialog-Bnq5921w.js";
4
+ import { C as ye, D as Se } from "./chunks/dashboard-summary-settings-dialog-CrK0Y8eU.js";
5
5
  import { jsx as a, jsxs as i } from "react/jsx-runtime";
6
6
  import * as m from "react";
7
7
  import { useMemo as K, useEffect as Y } from "react";
8
- import { ResourceManagementPanel as Te } from "./chunks/resource-management-panel-DEmbaJIX.js";
8
+ import { ResourceManagementPanel as Te } from "./chunks/resource-management-panel-CGjcKL2u.js";
9
9
  import { DEFAULT_CALENDAR_CONTEXT as Ne } from "./types/index.js";
10
10
  import "react-dom";
11
- import { A as _e, a as Ae, E as we, N as Ie, S as Me, U as Re, V as Fe, u as Le, b as ke, c as Be } from "./chunks/notification-bell-G1R5nji8.js";
11
+ import { A as _e, a as Ae, E as we, N as Ie, S as Me, U as Re, V as Fe, u as Le, b as ke, c as Be } from "./chunks/notification-bell-zly06Xaf.js";
12
12
  function ea(e) {
13
13
  const { displayPreferences: s, ...l } = e, d = {
14
14
  ...l,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/index-DvPV1l5p.js"),a=require("../chunks/common-types-CfJLrTJd.js"),e=require("../chunks/dashboard-summary-settings-dialog-Chmxt_4e.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-Bbio7O6b.js"),a=require("../chunks/common-types-CfJLrTJd.js"),e=require("../chunks/dashboard-summary-settings-dialog-PTZFYaCj.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-BsmVQ6V_.js";
1
+ import { a as o } from "../chunks/index-dzyROcGu.js";
2
2
  import { E as s } from "../chunks/common-types-DhqlRVrq.js";
3
- import { C as m, D as t } from "../chunks/dashboard-summary-settings-dialog-Bnq5921w.js";
3
+ import { C as m, D as t } from "../chunks/dashboard-summary-settings-dialog-CrK0Y8eU.js";
4
4
  export {
5
5
  m as CalendarPreferencesDialog,
6
6
  t as DashboardSummarySettingsDialog,
@@ -72,6 +72,8 @@ declare type BaseFilter = {
72
72
  valueType: 'string' | 'number' | 'date' | 'boolean';
73
73
  connectionType?: 'database' | 'api';
74
74
  dataType?: string;
75
+ fieldMeta?: FilterFieldMeta;
76
+ semanticContext?: FilterSemanticContext;
75
77
  };
76
78
 
77
79
  export declare type Breakpoint = 'lg' | 'md' | 'sm' | 'xs' | 'xxs';
@@ -710,6 +712,13 @@ declare interface FilterCondition {
710
712
  */
711
713
  declare type FilterDisplayMode = 'canvas' | 'toolbar' | 'inherit';
712
714
 
715
+ declare type FilterFieldMeta = Pick<Field, 'name' | 'qualifiedFieldName'> & Partial<Pick<Field, 'qualifiedEntityName' | 'entityId' | 'dataType' | 'role'>> & {
716
+ entityName?: Field['entityName'];
717
+ entityType?: string;
718
+ expression?: string;
719
+ calculatedFormula?: CalculatedFieldFormula;
720
+ };
721
+
713
722
  declare type FilterForBetween = BaseFilter & {
714
723
  operation: 'between' | 'not between';
715
724
  values: [number, number];
@@ -779,6 +788,13 @@ declare type FilterOnClick = {
779
788
  columnIndex: number;
780
789
  };
781
790
 
791
+ declare type FilterSemanticContext = {
792
+ semanticDomainId?: string;
793
+ selectedEntities?: unknown[];
794
+ connectionId?: string;
795
+ connectionType?: string;
796
+ };
797
+
782
798
  declare type FilterValue = string | number | boolean | Date | null | [number, number] | [string, string] | string[] | number[];
783
799
 
784
800
  export declare type GetDashboardResponse = {
@@ -1645,6 +1661,8 @@ declare type TFilter = {
1645
1661
  qualifiedTableName?: string;
1646
1662
  sql: string;
1647
1663
  operation: Operation;
1664
+ fieldMeta?: FilterFieldMeta;
1665
+ semanticContext?: FilterSemanticContext;
1648
1666
  /**
1649
1667
  * Multi-field filter support: When set, provides multiple column options.
1650
1668
  * The first column becomes the default. Users can select which column
@@ -1768,6 +1786,8 @@ export declare type TInlineFilter = {
1768
1786
  connectionId: string;
1769
1787
  operation: Operation;
1770
1788
  sql: string;
1789
+ fieldMeta?: FilterFieldMeta;
1790
+ semanticContext?: FilterSemanticContext;
1771
1791
  /** Selection type: 'single' allows one value, 'multiple' allows many */
1772
1792
  type?: 'single' | 'multiple';
1773
1793
  /** UI component for single-select filters */
@@ -368,6 +368,8 @@ declare type BaseFilter = {
368
368
  valueType: 'string' | 'number' | 'date' | 'boolean';
369
369
  connectionType?: 'database' | 'api';
370
370
  dataType?: string;
371
+ fieldMeta?: FilterFieldMeta;
372
+ semanticContext?: FilterSemanticContext;
371
373
  };
372
374
 
373
375
  export declare interface BaseInteractionEvent {
@@ -1703,6 +1705,13 @@ export declare interface FilterCondition {
1703
1705
  */
1704
1706
  declare type FilterDisplayMode = 'canvas' | 'toolbar' | 'inherit';
1705
1707
 
1708
+ declare type FilterFieldMeta = Pick<Field, 'name' | 'qualifiedFieldName'> & Partial<Pick<Field, 'qualifiedEntityName' | 'entityId' | 'dataType' | 'role'>> & {
1709
+ entityName?: Field['entityName'];
1710
+ entityType?: string;
1711
+ expression?: string;
1712
+ calculatedFormula?: CalculatedFieldFormula;
1713
+ };
1714
+
1706
1715
  declare type FilterForBetween = BaseFilter & {
1707
1716
  operation: 'between' | 'not between';
1708
1717
  values: [number, number];
@@ -1772,6 +1781,13 @@ declare type FilterOnClick = {
1772
1781
  columnIndex: number;
1773
1782
  };
1774
1783
 
1784
+ declare type FilterSemanticContext = {
1785
+ semanticDomainId?: string;
1786
+ selectedEntities?: unknown[];
1787
+ connectionId?: string;
1788
+ connectionType?: string;
1789
+ };
1790
+
1775
1791
  export declare type FilterValue = string | number | boolean | Date | null | [number, number] | [string, string] | string[] | number[];
1776
1792
 
1777
1793
  export declare function fmt(str: string): string;
@@ -3137,6 +3153,8 @@ export declare type TFilter = {
3137
3153
  qualifiedTableName?: string;
3138
3154
  sql: string;
3139
3155
  operation: Operation;
3156
+ fieldMeta?: FilterFieldMeta;
3157
+ semanticContext?: FilterSemanticContext;
3140
3158
  /**
3141
3159
  * Multi-field filter support: When set, provides multiple column options.
3142
3160
  * The first column becomes the default. Users can select which column
@@ -3266,6 +3284,8 @@ export declare type TInlineFilter = {
3266
3284
  connectionId: string;
3267
3285
  operation: Operation;
3268
3286
  sql: string;
3287
+ fieldMeta?: FilterFieldMeta;
3288
+ semanticContext?: FilterSemanticContext;
3269
3289
  /** Selection type: 'single' allows one value, 'multiple' allows many */
3270
3290
  type?: 'single' | 'multiple';
3271
3291
  /** UI component for single-select filters */
@@ -72,6 +72,8 @@ declare type BaseFilter = {
72
72
  valueType: 'string' | 'number' | 'date' | 'boolean';
73
73
  connectionType?: 'database' | 'api';
74
74
  dataType?: string;
75
+ fieldMeta?: FilterFieldMeta;
76
+ semanticContext?: FilterSemanticContext;
75
77
  };
76
78
 
77
79
  export declare type Breakpoint = 'lg' | 'md' | 'sm' | 'xs' | 'xxs';
@@ -730,6 +732,13 @@ declare interface FilterCondition {
730
732
  */
731
733
  declare type FilterDisplayMode = 'canvas' | 'toolbar' | 'inherit';
732
734
 
735
+ declare type FilterFieldMeta = Pick<Field, 'name' | 'qualifiedFieldName'> & Partial<Pick<Field, 'qualifiedEntityName' | 'entityId' | 'dataType' | 'role'>> & {
736
+ entityName?: Field['entityName'];
737
+ entityType?: string;
738
+ expression?: string;
739
+ calculatedFormula?: CalculatedFieldFormula;
740
+ };
741
+
733
742
  declare type FilterForBetween = BaseFilter & {
734
743
  operation: 'between' | 'not between';
735
744
  values: [number, number];
@@ -799,6 +808,13 @@ declare type FilterOnClick = {
799
808
  columnIndex: number;
800
809
  };
801
810
 
811
+ declare type FilterSemanticContext = {
812
+ semanticDomainId?: string;
813
+ selectedEntities?: unknown[];
814
+ connectionId?: string;
815
+ connectionType?: string;
816
+ };
817
+
802
818
  declare type FilterValue = string | number | boolean | Date | null | [number, number] | [string, string] | string[] | number[];
803
819
 
804
820
  export declare type GetDashboardResponse = {
@@ -1667,6 +1683,8 @@ declare type TFilter = {
1667
1683
  qualifiedTableName?: string;
1668
1684
  sql: string;
1669
1685
  operation: Operation;
1686
+ fieldMeta?: FilterFieldMeta;
1687
+ semanticContext?: FilterSemanticContext;
1670
1688
  /**
1671
1689
  * Multi-field filter support: When set, provides multiple column options.
1672
1690
  * The first column becomes the default. Users can select which column
@@ -1790,6 +1808,8 @@ export declare type TInlineFilter = {
1790
1808
  connectionId: string;
1791
1809
  operation: Operation;
1792
1810
  sql: string;
1811
+ fieldMeta?: FilterFieldMeta;
1812
+ semanticContext?: FilterSemanticContext;
1793
1813
  /** Selection type: 'single' allows one value, 'multiple' allows many */
1794
1814
  type?: 'single' | 'multiple';
1795
1815
  /** UI component for single-select filters */
@@ -71,6 +71,8 @@ declare type BaseFilter = {
71
71
  valueType: 'string' | 'number' | 'date' | 'boolean';
72
72
  connectionType?: 'database' | 'api';
73
73
  dataType?: string;
74
+ fieldMeta?: FilterFieldMeta;
75
+ semanticContext?: FilterSemanticContext;
74
76
  };
75
77
 
76
78
  export declare type Breakpoint = 'lg' | 'md' | 'sm' | 'xs' | 'xxs';
@@ -742,6 +744,13 @@ declare interface FilterCondition {
742
744
  */
743
745
  declare type FilterDisplayMode = 'canvas' | 'toolbar' | 'inherit';
744
746
 
747
+ declare type FilterFieldMeta = Pick<Field, 'name' | 'qualifiedFieldName'> & Partial<Pick<Field, 'qualifiedEntityName' | 'entityId' | 'dataType' | 'role'>> & {
748
+ entityName?: Field['entityName'];
749
+ entityType?: string;
750
+ expression?: string;
751
+ calculatedFormula?: CalculatedFieldFormula;
752
+ };
753
+
745
754
  declare type FilterForBetween = BaseFilter & {
746
755
  operation: 'between' | 'not between';
747
756
  values: [number, number];
@@ -811,6 +820,13 @@ declare type FilterOnClick = {
811
820
  columnIndex: number;
812
821
  };
813
822
 
823
+ declare type FilterSemanticContext = {
824
+ semanticDomainId?: string;
825
+ selectedEntities?: unknown[];
826
+ connectionId?: string;
827
+ connectionType?: string;
828
+ };
829
+
814
830
  declare type FilterValue = string | number | boolean | Date | null | [number, number] | [string, string] | string[] | number[];
815
831
 
816
832
  export declare type GetDashboardResponse = {
@@ -1693,6 +1709,8 @@ declare type TFilter = {
1693
1709
  qualifiedTableName?: string;
1694
1710
  sql: string;
1695
1711
  operation: Operation;
1712
+ fieldMeta?: FilterFieldMeta;
1713
+ semanticContext?: FilterSemanticContext;
1696
1714
  /**
1697
1715
  * Multi-field filter support: When set, provides multiple column options.
1698
1716
  * The first column becomes the default. Users can select which column
@@ -1816,6 +1834,8 @@ export declare type TInlineFilter = {
1816
1834
  connectionId: string;
1817
1835
  operation: Operation;
1818
1836
  sql: string;
1837
+ fieldMeta?: FilterFieldMeta;
1838
+ semanticContext?: FilterSemanticContext;
1819
1839
  /** Selection type: 'single' allows one value, 'multiple' allows many */
1820
1840
  type?: 'single' | 'multiple';
1821
1841
  /** UI component for single-select filters */
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.1.199",
8
+ "version": "0.1.201",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",