react-semaphor 0.1.162 → 0.1.164

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 (29) hide show
  1. package/dist/chunks/{dashboard-controls-CeSBs5Hq.js → dashboard-controls-CWQ_gUsq.js} +4 -4
  2. package/dist/chunks/{dashboard-controls-4GSRkLCI.js → dashboard-controls-Czfs9TsO.js} +1 -1
  3. package/dist/chunks/{dashboard-export-dialog-MpHrSiyY.js → dashboard-export-dialog-DiJIOI6i.js} +3 -3
  4. package/dist/chunks/{dashboard-export-dialog-D514_qGz.js → dashboard-export-dialog-zge97BYd.js} +1 -1
  5. package/dist/chunks/{dashboard-json-O63iXsoj.js → dashboard-json-05FNu5_c.js} +1 -1
  6. package/dist/chunks/{dashboard-json-UCoG-_cW.js → dashboard-json-BnUM90on.js} +1 -1
  7. package/dist/chunks/{edit-dashboard-visual-DsBEfgxL.js → edit-dashboard-visual-BQyiGFIJ.js} +2 -2
  8. package/dist/chunks/{edit-dashboard-visual-E6Kq46ex.js → edit-dashboard-visual-DvcXroC3.js} +467 -467
  9. package/dist/chunks/{editor-action-buttons-CMCgCcUE.js → editor-action-buttons-0lhAtWvK.js} +2 -2
  10. package/dist/chunks/{editor-action-buttons-Cm7pHxM_.js → editor-action-buttons-DChxrcx_.js} +1 -1
  11. package/dist/chunks/{index-B9l7fpA-.js → index-Ba7cbkS0.js} +10579 -10403
  12. package/dist/chunks/{index-oMb4lVSV.js → index-SZ7sy6nw.js} +82 -82
  13. package/dist/chunks/{resource-management-panel-BxvT3mn3.js → resource-management-panel-BDDrOqYt.js} +3 -3
  14. package/dist/chunks/{resource-management-panel-yBYy59zu.js → resource-management-panel-Dw5GP_kj.js} +1 -1
  15. package/dist/chunks/{use-role-aware-display-preferences-jONtUniC.js → use-role-aware-display-preferences-C9ydHtPN.js} +1 -1
  16. package/dist/chunks/{use-role-aware-display-preferences-97_9jIzt.js → use-role-aware-display-preferences-Dk-fULeQ.js} +1 -1
  17. package/dist/chunks/{use-visual-utils-D6xUgbea.js → use-visual-utils-BOMHKg6C.js} +1 -1
  18. package/dist/chunks/{use-visual-utils-lD1p2yII.js → use-visual-utils-DfO9gvaA.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 +4 -4
  23. package/dist/surfboard/index.cjs +1 -1
  24. package/dist/surfboard/index.js +1 -1
  25. package/dist/types/dashboard.d.ts +24 -0
  26. package/dist/types/main.d.ts +24 -0
  27. package/dist/types/surfboard.d.ts +24 -0
  28. package/dist/types/types.d.ts +24 -0
  29. package/package.json +1 -1
@@ -1,8 +1,8 @@
1
1
  import { jsx as e, jsxs as a, Fragment as ge } from "react/jsx-runtime";
2
- import { l as qe, u as me, n as We, az as re, bf as Xe, bg as $e, c as X, bh as ke, aQ as et, aR as tt, B as _, aS as st, aT as at, aU as K, bi as pe, L as oe, bj as nt, bk as it, bl as rt, bm as ve, bn as De, bo as ot, bp as lt, J as dt, bq as ye, e as le, br as Se, bs as Ee, bt as ct, Z as Ve, T as Le, bu as Ae, aY as Te, aZ as Re, a_ as Oe, b0 as Pe, b1 as Ue, b2 as Ie, b3 as Me, b4 as je, bv as ut, bw as ht, bx as Fe, by as ze, bz as Be, bA as mt, bB as He, bC as pt, Q as ne, ay as ft, bD as _e, bE as gt, bF as Dt, aD as xt, aE as Nt, aF as bt, aG as wt, aH as vt, aI as Ce, aJ as fe, aM as Ct, bG as yt, bH as St, bI as Et, bJ as Vt } from "./index-B9l7fpA-.js";
2
+ import { l as qe, u as me, n as We, az as re, bf as Xe, bg as $e, c as X, bh as ke, aQ as et, aR as tt, B as _, aS as st, aT as at, aU as K, bi as pe, L as oe, bj as nt, bk as it, bl as rt, bm as ve, bn as De, bo as ot, bp as lt, J as dt, bq as ye, e as le, br as Se, bs as Ee, bt as ct, Z as Ve, T as Le, bu as Ae, aY as Te, aZ as Re, a_ as Oe, b0 as Pe, b1 as Ue, b2 as Ie, b3 as Me, b4 as je, bv as ut, bw as ht, bx as Fe, by as ze, bz as Be, bA as mt, bB as He, bC as pt, Q as ne, ay as ft, bD as _e, bE as gt, bF as Dt, aD as xt, aE as Nt, aF as bt, aG as wt, aH as vt, aI as Ce, aJ as fe, aM as Ct, bG as yt, bH as St, bI as Et, bJ as Vt } from "./index-Ba7cbkS0.js";
3
3
  import Lt, { useRef as At, useEffect as ie, useState as x } from "react";
4
- import { a as Ge } from "./use-visual-utils-lD1p2yII.js";
5
- import { u as Tt } from "./use-role-aware-display-preferences-97_9jIzt.js";
4
+ import { a as Ge } from "./use-visual-utils-DfO9gvaA.js";
5
+ import { u as Tt } from "./use-role-aware-display-preferences-Dk-fULeQ.js";
6
6
  /**
7
7
  * @license lucide-react v0.453.0 - ISC
8
8
  *
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./index-oMb4lVSV.js"),c=require("react"),de=require("./use-visual-utils-D6xUgbea.js"),pe=require("./use-role-aware-display-preferences-jONtUniC.js");/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./index-SZ7sy6nw.js"),c=require("react"),de=require("./use-visual-utils-BOMHKg6C.js"),pe=require("./use-role-aware-display-preferences-C9ydHtPN.js");/**
2
2
  * @license lucide-react v0.453.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- "use strict";const a=require("./index-oMb4lVSV.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-SZ7sy6nw.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,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-B9l7fpA-.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-Ba7cbkS0.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 o=require("./index-oMb4lVSV.js"),b=require("react");function _(e){const a=e.toUpperCase().indexOf("WHERE"),r=e.toUpperCase().indexOf("GROUP BY"),t=e.toUpperCase().indexOf("LIMIT"),d=e.toUpperCase().indexOf("ORDER BY");let c=e.length;if(d!==-1&&(c=d),t!==-1&&t<c&&(c=t),a!==-1){const n=e.substring(0,a),s=e.substring(a);return`${n} {{ filters | where }} AND ${s.substring(6)}`}else if(r!==-1){const n=e.substring(0,r),s=e.substring(r);return`${n} {{ filters | where }} ${s}`}else{const n=e.substring(0,c),s=e.substring(c);return console.log("beforeClause",n),console.log("afterClause",s),s?`${n} {{ filters | where }} ${s}`:`${n.replace(/;$/,"")} {{ filters | where }}`}}function B(e){const[a,r]=b.useState(null),[t,d]=b.useState(null),c=o.useEnsureReactGlobals();return b.useEffect(()=>{if(!e||e.trim()===""){r(null),d(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 m=await import(l);if(typeof m.useChartStore!="function")throw new Error("useChartStore is not a function");r(()=>m.useChartStore),d(null)}catch(s){const l=s instanceof Error?s.message:"Unknown error";console.error("Failed to load remote chart store:",l),d(l),r(null)}})()},[e,c]),a}function H(e,a){if(e.length===0)return"";if(a){const r=e.find(t=>t.id===a);if(r){const t=r.tabTitle;if(t=="All__Header")return e[0].id;if(t&&t.endsWith("__Header")){const c=t.split("__")[0],n=e.find(s=>s.tabTitle===c);return n?n.id:e[0].id}return a}}return e[0].id}async function j(e,a,r,t){if(!a||!r)throw new Error("Missing auth token or visual ID");const d=["resource-by-id","visual",r],c=t.getQueryData(d);if(c)return console.log("Using cached visual data for:",r),{data:c,fromCache:!0};console.log("Fetching visual data from network for:",r);const n=o.ue.loading("Loading visual...",{position:"top-center"});try{const s=await fetch(`${e}/management/v1/visuals/${r}`,{headers:{Authorization:`Bearer ${a}`}});if(!s.ok)throw new Error("Failed to load visual");const l=await s.json();return t.setQueryData(d,l),o.ue.dismiss(n),{data:l,fromCache:!1}}catch(s){throw o.ue.dismiss(n),s}}function T(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw new Error("Invalid frame object format")}function Q(e,a){var c,n;const r=(e==null?void 0:e.frameObject)??((c=e==null?void 0:e.visual)==null?void 0:c.frameObject);if(!r)return!1;const t=T(r);if(!(t!=null&&t.cards)||t.cards.length===0)return!1;const d=(n=t.cards)==null?void 0:n.find(s=>s.id===t.activeCardId);return d?(o.setupEditorWithCard({...a,frame:t,card:d,visualId:(e==null?void 0:e.id)||t.visualId}),!0):!1}function G(){var g;const{setCardSql:e}=o.useEditorActions(),a=o.useEditorStore(i=>i.frame),r=o.useEditorStore(i=>i.card),t=B(((g=r.customCardPreferences)==null?void 0:g.url)||""),d=o.useEditorStore(i=>i.selectedSchemaName),c=o.useEditorStore(i=>i.selectedDatamodelId),n=o.useEditorStore(i=>i.selectedDatabaseName),s=o.useEditorStore(i=>i.selectedTableName),l=o.useEditorStore(i=>i.selectedConnectionId),m=o.useEditorStore(i=>i.isShowingVisual),f=r.sql;return{getUpdatedFrame:b.useCallback(()=>{var E;let i=f;f&&!f.includes("{{")&&(i=_(f),e(i));const C=(E=t==null?void 0:t.getState())==null?void 0:E.settings,U={...r,dataSource:r.dataSource||{mode:"directSource"},lastSelectedSchema:d,lastSelectedDatamodelId:c,lastSelectedDatabase:n,lastSelectedTable:s,connectionId:l,sql:i,customCfg:m?r.customCfg:null,preferences:r.preferences,...C&&{customCardPreferences:{...r.customCardPreferences,settings:C}}},w=a.cards.map(S=>S.id===r.id?U:S);return{...a,cards:w,activeCardId:H(w,a.activeCardId)}},[r,a,m,d,c,n,s,l,e,t,f])}}function z(){const{authToken:e,tokenProps:a}=o.useSemaphorContext(),r=o.useQueryClient(),t=o.useSelectedVisual(),{selectVisual:d}=o.useManagementActions(),{setFrame:c,setCard:n,setIsDevMode:s,setActiveTabCardId:l,updateDataSource:m,setQueryResultColumns:f,setSelectedConnectionId:V,setSelectedDatabaseName:g,setSelectedSchemaName:i,setSelectedTableName:C,setSelectedDatamodelId:U,setFilterValues:w,setApplyFilters:E}=o.useEditorActions(),{setIsDashboardEditing:S,setIsVisualEditing:$,setSelectedFrameId:v,clearSelectedFrameId:A,addFrame:N,setIsDashboardPanelOpen:R}=o.useDashboardActions(),I=o.useDashboardStore(u=>u.selectedSheetId),D=o.useDashboardStore(u=>u.selectedFrameId),O=o.useDashboardStore(u=>u.dashboard),x=o.useDashboardStore(u=>u.filterValues),y=o.useVisualById((t==null?void 0:t.id)||"",{enabled:!!(t!=null&&t.id)&&!!(e!=null&&e.accessToken)}),M=b.useCallback(async u=>{try{d(u),A();const{data:p,fromCache:h}=await j(a.apiServiceUrl,(e==null?void 0:e.accessToken)||"",u.id,r);if(!Q(p,{setFrame:c,setCard:n,setIsDevMode:s,setActiveTabCardId:l,updateDataSource:m,setQueryResultColumns:f,setSelectedConnectionId:V,setSelectedDatabaseName:g,setSelectedSchemaName:i,setSelectedTableName:C,setSelectedDatamodelId:U,setFilterValues:w,setApplyFilters:E,setIsDashboardEditing:S,setIsVisualEditing:$,dashboard:O,selectedSheetId:I,selectedFrameId:D,filterValues:x}))throw new Error("Failed to setup editor with visual data");return{success:!0,fromCache:h}}catch(p){return console.error("Error editing visual:",p),{success:!1,error:"Failed to load visual for editing"}}},[e==null?void 0:e.accessToken,a.apiServiceUrl,r,d,c,n,S,$,s,l,m,f,V,g,i,C,U,w,E,A,O,I,D,x]),k=b.useCallback(async u=>{var p;try{if(d(u),!I)return{success:!1,error:"No sheet selected. Please select a sheet first."};const{data:h,fromCache:W}=await j(a.apiServiceUrl,(e==null?void 0:e.accessToken)||"",u.id,r),L=(h==null?void 0:h.frameObject)??((p=h==null?void 0:h.visual)==null?void 0:p.frameObject);if(!L)return{success:!1,error:"Visual has no frame data"};const F=T(L);if(!(F!=null&&F.cards)||F.cards.length===0)return{success:!1,error:"Visual frame is malformed"};const P={...o.cloneFrameWithNewIds(F),visualId:u.id};return N(I,P,"end"),S(!0),v(P.id),R(!1),{success:!0,fromCache:W}}catch(h){return console.error("Error adding visual:",h),{success:!1,error:"Failed to add visual to dashboard"}}},[e==null?void 0:e.accessToken,a.apiServiceUrl,r,d,I,N,S,v,R]);return{visual:y.data,isLoading:y.isLoading,isError:y.isError,error:y.error,handleEditLibraryVisual:M,handleAddLibraryVisual:k,getUpdatedFrame:G().getUpdatedFrame,refetch:y.refetch}}exports.useRemoteChartStore=B;exports.useVisualUtils=z;
1
+ "use strict";const o=require("./index-SZ7sy6nw.js"),b=require("react");function _(e){const a=e.toUpperCase().indexOf("WHERE"),r=e.toUpperCase().indexOf("GROUP BY"),t=e.toUpperCase().indexOf("LIMIT"),d=e.toUpperCase().indexOf("ORDER BY");let c=e.length;if(d!==-1&&(c=d),t!==-1&&t<c&&(c=t),a!==-1){const n=e.substring(0,a),s=e.substring(a);return`${n} {{ filters | where }} AND ${s.substring(6)}`}else if(r!==-1){const n=e.substring(0,r),s=e.substring(r);return`${n} {{ filters | where }} ${s}`}else{const n=e.substring(0,c),s=e.substring(c);return console.log("beforeClause",n),console.log("afterClause",s),s?`${n} {{ filters | where }} ${s}`:`${n.replace(/;$/,"")} {{ filters | where }}`}}function B(e){const[a,r]=b.useState(null),[t,d]=b.useState(null),c=o.useEnsureReactGlobals();return b.useEffect(()=>{if(!e||e.trim()===""){r(null),d(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 m=await import(l);if(typeof m.useChartStore!="function")throw new Error("useChartStore is not a function");r(()=>m.useChartStore),d(null)}catch(s){const l=s instanceof Error?s.message:"Unknown error";console.error("Failed to load remote chart store:",l),d(l),r(null)}})()},[e,c]),a}function H(e,a){if(e.length===0)return"";if(a){const r=e.find(t=>t.id===a);if(r){const t=r.tabTitle;if(t=="All__Header")return e[0].id;if(t&&t.endsWith("__Header")){const c=t.split("__")[0],n=e.find(s=>s.tabTitle===c);return n?n.id:e[0].id}return a}}return e[0].id}async function j(e,a,r,t){if(!a||!r)throw new Error("Missing auth token or visual ID");const d=["resource-by-id","visual",r],c=t.getQueryData(d);if(c)return console.log("Using cached visual data for:",r),{data:c,fromCache:!0};console.log("Fetching visual data from network for:",r);const n=o.ue.loading("Loading visual...",{position:"top-center"});try{const s=await fetch(`${e}/management/v1/visuals/${r}`,{headers:{Authorization:`Bearer ${a}`}});if(!s.ok)throw new Error("Failed to load visual");const l=await s.json();return t.setQueryData(d,l),o.ue.dismiss(n),{data:l,fromCache:!1}}catch(s){throw o.ue.dismiss(n),s}}function T(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw new Error("Invalid frame object format")}function Q(e,a){var c,n;const r=(e==null?void 0:e.frameObject)??((c=e==null?void 0:e.visual)==null?void 0:c.frameObject);if(!r)return!1;const t=T(r);if(!(t!=null&&t.cards)||t.cards.length===0)return!1;const d=(n=t.cards)==null?void 0:n.find(s=>s.id===t.activeCardId);return d?(o.setupEditorWithCard({...a,frame:t,card:d,visualId:(e==null?void 0:e.id)||t.visualId}),!0):!1}function G(){var g;const{setCardSql:e}=o.useEditorActions(),a=o.useEditorStore(i=>i.frame),r=o.useEditorStore(i=>i.card),t=B(((g=r.customCardPreferences)==null?void 0:g.url)||""),d=o.useEditorStore(i=>i.selectedSchemaName),c=o.useEditorStore(i=>i.selectedDatamodelId),n=o.useEditorStore(i=>i.selectedDatabaseName),s=o.useEditorStore(i=>i.selectedTableName),l=o.useEditorStore(i=>i.selectedConnectionId),m=o.useEditorStore(i=>i.isShowingVisual),f=r.sql;return{getUpdatedFrame:b.useCallback(()=>{var E;let i=f;f&&!f.includes("{{")&&(i=_(f),e(i));const C=(E=t==null?void 0:t.getState())==null?void 0:E.settings,U={...r,dataSource:r.dataSource||{mode:"directSource"},lastSelectedSchema:d,lastSelectedDatamodelId:c,lastSelectedDatabase:n,lastSelectedTable:s,connectionId:l,sql:i,customCfg:m?r.customCfg:null,preferences:r.preferences,...C&&{customCardPreferences:{...r.customCardPreferences,settings:C}}},w=a.cards.map(S=>S.id===r.id?U:S);return{...a,cards:w,activeCardId:H(w,a.activeCardId)}},[r,a,m,d,c,n,s,l,e,t,f])}}function z(){const{authToken:e,tokenProps:a}=o.useSemaphorContext(),r=o.useQueryClient(),t=o.useSelectedVisual(),{selectVisual:d}=o.useManagementActions(),{setFrame:c,setCard:n,setIsDevMode:s,setActiveTabCardId:l,updateDataSource:m,setQueryResultColumns:f,setSelectedConnectionId:V,setSelectedDatabaseName:g,setSelectedSchemaName:i,setSelectedTableName:C,setSelectedDatamodelId:U,setFilterValues:w,setApplyFilters:E}=o.useEditorActions(),{setIsDashboardEditing:S,setIsVisualEditing:$,setSelectedFrameId:v,clearSelectedFrameId:A,addFrame:N,setIsDashboardPanelOpen:R}=o.useDashboardActions(),I=o.useDashboardStore(u=>u.selectedSheetId),D=o.useDashboardStore(u=>u.selectedFrameId),O=o.useDashboardStore(u=>u.dashboard),x=o.useDashboardStore(u=>u.filterValues),y=o.useVisualById((t==null?void 0:t.id)||"",{enabled:!!(t!=null&&t.id)&&!!(e!=null&&e.accessToken)}),M=b.useCallback(async u=>{try{d(u),A();const{data:p,fromCache:h}=await j(a.apiServiceUrl,(e==null?void 0:e.accessToken)||"",u.id,r);if(!Q(p,{setFrame:c,setCard:n,setIsDevMode:s,setActiveTabCardId:l,updateDataSource:m,setQueryResultColumns:f,setSelectedConnectionId:V,setSelectedDatabaseName:g,setSelectedSchemaName:i,setSelectedTableName:C,setSelectedDatamodelId:U,setFilterValues:w,setApplyFilters:E,setIsDashboardEditing:S,setIsVisualEditing:$,dashboard:O,selectedSheetId:I,selectedFrameId:D,filterValues:x}))throw new Error("Failed to setup editor with visual data");return{success:!0,fromCache:h}}catch(p){return console.error("Error editing visual:",p),{success:!1,error:"Failed to load visual for editing"}}},[e==null?void 0:e.accessToken,a.apiServiceUrl,r,d,c,n,S,$,s,l,m,f,V,g,i,C,U,w,E,A,O,I,D,x]),k=b.useCallback(async u=>{var p;try{if(d(u),!I)return{success:!1,error:"No sheet selected. Please select a sheet first."};const{data:h,fromCache:W}=await j(a.apiServiceUrl,(e==null?void 0:e.accessToken)||"",u.id,r),L=(h==null?void 0:h.frameObject)??((p=h==null?void 0:h.visual)==null?void 0:p.frameObject);if(!L)return{success:!1,error:"Visual has no frame data"};const F=T(L);if(!(F!=null&&F.cards)||F.cards.length===0)return{success:!1,error:"Visual frame is malformed"};const P={...o.cloneFrameWithNewIds(F),visualId:u.id};return N(I,P,"end"),S(!0),v(P.id),R(!1),{success:!0,fromCache:W}}catch(h){return console.error("Error adding visual:",h),{success:!1,error:"Failed to add visual to dashboard"}}},[e==null?void 0:e.accessToken,a.apiServiceUrl,r,d,I,N,S,v,R]);return{visual:y.data,isLoading:y.isLoading,isError:y.isError,error:y.error,handleEditLibraryVisual:M,handleAddLibraryVisual:k,getUpdatedFrame:G().getUpdatedFrame,refetch:y.refetch}}exports.useRemoteChartStore=B;exports.useVisualUtils=z;
@@ -1,4 +1,4 @@
1
- import { ax as z, ay as G, p as Y, q as J, az as K, m as _, o as X, u as U, aA as Z, aB as q, t as v, aC as ee, n as h } from "./index-B9l7fpA-.js";
1
+ import { ax as z, ay as G, p as Y, q as J, az as K, m as _, o as X, u as U, aA as Z, aB as q, t as v, aC as ee, n as h } from "./index-Ba7cbkS0.js";
2
2
  import { useState as T, useEffect as te, useCallback as V } from "react";
3
3
  function re(e) {
4
4
  const o = e.toUpperCase().indexOf("WHERE"), r = e.toUpperCase().indexOf("GROUP BY"), t = e.toUpperCase().indexOf("LIMIT"), i = e.toUpperCase().indexOf("ORDER BY");
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-oMb4lVSV.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-SZ7sy6nw.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-B9l7fpA-.js";
1
+ import { D as a } from "../chunks/index-Ba7cbkS0.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,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-oMb4lVSV.js"),E=require("./types/index.cjs"),a=require("react/jsx-runtime"),x=require("react"),j=require("./chunks/resource-management-panel-yBYy59zu.js"),c=require("./chunks/dashboard-export-dialog-D514_qGz.js");require("react-dom");function M(r){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const s in r)if(s!=="default"){const i=Object.getOwnPropertyDescriptor(r,s);Object.defineProperty(o,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}return o.default=r,Object.freeze(o)}const m=M(x);/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-SZ7sy6nw.js"),E=require("./types/index.cjs"),a=require("react/jsx-runtime"),x=require("react"),j=require("./chunks/resource-management-panel-Dw5GP_kj.js"),c=require("./chunks/dashboard-export-dialog-zge97BYd.js");require("react-dom");function M(r){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const s in r)if(s!=="default"){const i=Object.getOwnPropertyDescriptor(r,s);Object.defineProperty(o,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}return o.default=r,Object.freeze(o)}const m=M(x);/**
2
2
  * @license lucide-react v0.453.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
- import { l as T, E as g, F as w, S as M, U as P, v as k, w as A, u as F, x as y, y as L, P as R, z as I, B as V, c as v, A as _, G as B, H as U, I as W, J as j, K as q, M as z, N as O, O as Q, C as G } from "./chunks/index-B9l7fpA-.js";
2
- import { a8 as oa, a9 as na, D as ta, a1 as ia, ad as da, T as la, Y as ca, Y as ua, Z as ha, a as pa, a4 as ma, aw as fa, ak as Ca, a6 as va, a2 as Da, a3 as ba, ae as ya, am as ga, al as xa, ap as Ea, aq as Na, aj as Sa, a5 as Ta, ai as wa, ab as Ma, ac as Pa, aa as ka, an as Aa, ah as Fa, ag as La, af as Ra, ar as Ia, ao as Va, a0 as _a, at as Ba, av as Ua, au as Wa, o as ja, $ as qa, R as za, a7 as Oa, V as Qa, m as Ga, as as Ha, n as Ya, Q as Ka, _ as $a, W as Ja } from "./chunks/index-B9l7fpA-.js";
1
+ import { l as T, E as g, F as w, S as M, U as P, v as k, w as A, u as F, x as y, y as L, P as R, z as I, B as V, c as v, A as _, G as B, H as U, I as W, J as j, K as q, M as z, N as O, O as Q, C as G } from "./chunks/index-Ba7cbkS0.js";
2
+ import { a8 as oa, a9 as na, D as ta, a1 as ia, ad as da, T as la, Y as ca, Y as ua, Z as ha, a as pa, a4 as ma, aw as fa, ak as Ca, a6 as va, a2 as Da, a3 as ba, ae as ya, am as ga, al as xa, ap as Ea, aq as Na, aj as Sa, a5 as Ta, ai as wa, ab as Ma, ac as Pa, aa as ka, an as Aa, ah as Fa, ag as La, af as Ra, ar as Ia, ao as Va, a0 as _a, at as Ba, av as Ua, au as Wa, o as ja, $ as qa, R as za, a7 as Oa, V as Qa, m as Ga, as as Ha, n as Ya, Q as Ka, _ as $a, W as Ja } from "./chunks/index-Ba7cbkS0.js";
3
3
  import { EMPTY_SELECTION as Za } from "./types/index.js";
4
4
  import { jsx as a, jsxs as d } from "react/jsx-runtime";
5
5
  import * as p from "react";
6
6
  import { useMemo as H } from "react";
7
- import { ResourceManagementPanel as ee } from "./chunks/resource-management-panel-BxvT3mn3.js";
8
- import { A as re, D as oe, S as ne, U as te, V as ie, u as de } from "./chunks/dashboard-export-dialog-MpHrSiyY.js";
7
+ import { ResourceManagementPanel as ee } from "./chunks/resource-management-panel-BDDrOqYt.js";
8
+ import { A as re, D as oe, S as ne, U as te, V as ie, u as de } from "./chunks/dashboard-export-dialog-DiJIOI6i.js";
9
9
  import "react-dom";
10
10
  /**
11
11
  * @license lucide-react v0.453.0 - ISC
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-oMb4lVSV.js"),r=require("../types/index.cjs");exports.Surfboard=e.DashboardPlus;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-SZ7sy6nw.js"),r=require("../types/index.cjs");exports.Surfboard=e.DashboardPlus;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;
@@ -1,4 +1,4 @@
1
- import { a } from "../chunks/index-B9l7fpA-.js";
1
+ import { a } from "../chunks/index-Ba7cbkS0.js";
2
2
  import { EMPTY_SELECTION as E } from "../types/index.js";
3
3
  export {
4
4
  E as EMPTY_SELECTION,
@@ -71,6 +71,7 @@ declare type BaseFilter = {
71
71
  name: string;
72
72
  valueType: 'string' | 'number' | 'date' | 'boolean';
73
73
  connectionType?: 'database' | 'api';
74
+ dataType?: string;
74
75
  };
75
76
 
76
77
  export declare type Breakpoint = 'lg' | 'md' | 'sm' | 'xs' | 'xxs';
@@ -1107,6 +1108,22 @@ declare type TablePreferences = {
1107
1108
  forceClientPagination?: boolean;
1108
1109
  };
1109
1110
 
1111
+ /**
1112
+ * Target column configuration for multi-field filters.
1113
+ * Allows a single filter to target multiple columns from the SAME table,
1114
+ * with users selecting which column to filter at runtime.
1115
+ *
1116
+ * Note: Cross-table filtering is not supported. All target columns must
1117
+ * be from the same table as the filter's primary table. For cross-table
1118
+ * date filtering, create separate filters or use a shared date dimension.
1119
+ */
1120
+ declare type TargetColumn = {
1121
+ /** Column name (e.g., "shipping_date") - must be from the filter's table */
1122
+ column: string;
1123
+ /** Display label shown in the dropdown (e.g., "Shipping Date") */
1124
+ label: string;
1125
+ };
1126
+
1110
1127
  /** Global bar style configuration */
1111
1128
  export declare type TBarStyleConfig = {
1112
1129
  /** Default border radius for all bars - 0-20 pixels */
@@ -1546,6 +1563,13 @@ declare type TFilter = {
1546
1563
  database: string;
1547
1564
  sql: string;
1548
1565
  operation: Operation;
1566
+ /**
1567
+ * Multi-field filter support: When set, provides multiple column options.
1568
+ * The first column becomes the default. Users can select which column
1569
+ * to filter at runtime via a dropdown in the date picker.
1570
+ * If not set, the single `column` field is used (backward compatible).
1571
+ */
1572
+ targetColumns?: TargetColumn[];
1549
1573
  searchMode?: 'text' | 'numeric' | 'auto';
1550
1574
  applyToSheetIds?: string[];
1551
1575
  excludeSheetIds?: string[];
@@ -323,6 +323,7 @@ declare type BaseFilter = {
323
323
  name: string;
324
324
  valueType: 'string' | 'number' | 'date' | 'boolean';
325
325
  connectionType?: 'database' | 'api';
326
+ dataType?: string;
326
327
  };
327
328
 
328
329
  export declare interface BaseInteractionEvent {
@@ -2122,6 +2123,22 @@ declare type TablePreferences = {
2122
2123
  forceClientPagination?: boolean;
2123
2124
  };
2124
2125
 
2126
+ /**
2127
+ * Target column configuration for multi-field filters.
2128
+ * Allows a single filter to target multiple columns from the SAME table,
2129
+ * with users selecting which column to filter at runtime.
2130
+ *
2131
+ * Note: Cross-table filtering is not supported. All target columns must
2132
+ * be from the same table as the filter's primary table. For cross-table
2133
+ * date filtering, create separate filters or use a shared date dimension.
2134
+ */
2135
+ declare type TargetColumn = {
2136
+ /** Column name (e.g., "shipping_date") - must be from the filter's table */
2137
+ column: string;
2138
+ /** Display label shown in the dropdown (e.g., "Shipping Date") */
2139
+ label: string;
2140
+ };
2141
+
2125
2142
  /** Global bar style configuration */
2126
2143
  export declare type TBarStyleConfig = {
2127
2144
  /** Default border radius for all bars - 0-20 pixels */
@@ -2563,6 +2580,13 @@ export declare type TFilter = {
2563
2580
  database: string;
2564
2581
  sql: string;
2565
2582
  operation: Operation;
2583
+ /**
2584
+ * Multi-field filter support: When set, provides multiple column options.
2585
+ * The first column becomes the default. Users can select which column
2586
+ * to filter at runtime via a dropdown in the date picker.
2587
+ * If not set, the single `column` field is used (backward compatible).
2588
+ */
2589
+ targetColumns?: TargetColumn[];
2566
2590
  searchMode?: 'text' | 'numeric' | 'auto';
2567
2591
  applyToSheetIds?: string[];
2568
2592
  excludeSheetIds?: string[];
@@ -71,6 +71,7 @@ declare type BaseFilter = {
71
71
  name: string;
72
72
  valueType: 'string' | 'number' | 'date' | 'boolean';
73
73
  connectionType?: 'database' | 'api';
74
+ dataType?: string;
74
75
  };
75
76
 
76
77
  export declare type Breakpoint = 'lg' | 'md' | 'sm' | 'xs' | 'xxs';
@@ -1112,6 +1113,22 @@ declare type TablePreferences = {
1112
1113
  forceClientPagination?: boolean;
1113
1114
  };
1114
1115
 
1116
+ /**
1117
+ * Target column configuration for multi-field filters.
1118
+ * Allows a single filter to target multiple columns from the SAME table,
1119
+ * with users selecting which column to filter at runtime.
1120
+ *
1121
+ * Note: Cross-table filtering is not supported. All target columns must
1122
+ * be from the same table as the filter's primary table. For cross-table
1123
+ * date filtering, create separate filters or use a shared date dimension.
1124
+ */
1125
+ declare type TargetColumn = {
1126
+ /** Column name (e.g., "shipping_date") - must be from the filter's table */
1127
+ column: string;
1128
+ /** Display label shown in the dropdown (e.g., "Shipping Date") */
1129
+ label: string;
1130
+ };
1131
+
1115
1132
  /** Global bar style configuration */
1116
1133
  export declare type TBarStyleConfig = {
1117
1134
  /** Default border radius for all bars - 0-20 pixels */
@@ -1551,6 +1568,13 @@ declare type TFilter = {
1551
1568
  database: string;
1552
1569
  sql: string;
1553
1570
  operation: Operation;
1571
+ /**
1572
+ * Multi-field filter support: When set, provides multiple column options.
1573
+ * The first column becomes the default. Users can select which column
1574
+ * to filter at runtime via a dropdown in the date picker.
1575
+ * If not set, the single `column` field is used (backward compatible).
1576
+ */
1577
+ targetColumns?: TargetColumn[];
1554
1578
  searchMode?: 'text' | 'numeric' | 'auto';
1555
1579
  applyToSheetIds?: string[];
1556
1580
  excludeSheetIds?: string[];
@@ -70,6 +70,7 @@ declare type BaseFilter = {
70
70
  name: string;
71
71
  valueType: 'string' | 'number' | 'date' | 'boolean';
72
72
  connectionType?: 'database' | 'api';
73
+ dataType?: string;
73
74
  };
74
75
 
75
76
  export declare type Breakpoint = 'lg' | 'md' | 'sm' | 'xs' | 'xxs';
@@ -1104,6 +1105,22 @@ declare type TablePreferences = {
1104
1105
  forceClientPagination?: boolean;
1105
1106
  };
1106
1107
 
1108
+ /**
1109
+ * Target column configuration for multi-field filters.
1110
+ * Allows a single filter to target multiple columns from the SAME table,
1111
+ * with users selecting which column to filter at runtime.
1112
+ *
1113
+ * Note: Cross-table filtering is not supported. All target columns must
1114
+ * be from the same table as the filter's primary table. For cross-table
1115
+ * date filtering, create separate filters or use a shared date dimension.
1116
+ */
1117
+ declare type TargetColumn = {
1118
+ /** Column name (e.g., "shipping_date") - must be from the filter's table */
1119
+ column: string;
1120
+ /** Display label shown in the dropdown (e.g., "Shipping Date") */
1121
+ label: string;
1122
+ };
1123
+
1107
1124
  /** Global bar style configuration */
1108
1125
  export declare type TBarStyleConfig = {
1109
1126
  /** Default border radius for all bars - 0-20 pixels */
@@ -1543,6 +1560,13 @@ declare type TFilter = {
1543
1560
  database: string;
1544
1561
  sql: string;
1545
1562
  operation: Operation;
1563
+ /**
1564
+ * Multi-field filter support: When set, provides multiple column options.
1565
+ * The first column becomes the default. Users can select which column
1566
+ * to filter at runtime via a dropdown in the date picker.
1567
+ * If not set, the single `column` field is used (backward compatible).
1568
+ */
1569
+ targetColumns?: TargetColumn[];
1546
1570
  searchMode?: 'text' | 'numeric' | 'auto';
1547
1571
  applyToSheetIds?: string[];
1548
1572
  excludeSheetIds?: string[];
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.1.162",
8
+ "version": "0.1.164",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",