react-semaphor 0.1.175 → 0.1.176

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 (25) hide show
  1. package/dist/chunks/{dashboard-controls-CQNvLMGb.js → dashboard-controls-BtrmT5hV.js} +4 -4
  2. package/dist/chunks/{dashboard-controls-BF1ISsg_.js → dashboard-controls-DR6ruxzW.js} +1 -1
  3. package/dist/chunks/{dashboard-json-DddaSWpl.js → dashboard-json-BnCOeWny.js} +1 -1
  4. package/dist/chunks/{dashboard-json-CMYMYz8t.js → dashboard-json-CY8Vbmi5.js} +1 -1
  5. package/dist/chunks/{edit-dashboard-visual-DPKlhiyI.js → edit-dashboard-visual-BX-hJR3k.js} +34 -34
  6. package/dist/chunks/{edit-dashboard-visual-CYfGc778.js → edit-dashboard-visual-BXBPQpCA.js} +762 -726
  7. package/dist/chunks/{editor-action-buttons-D2f078Q2.js → editor-action-buttons-B-m2BOfh.js} +1 -1
  8. package/dist/chunks/{editor-action-buttons-DPK6j7ie.js → editor-action-buttons-DUp8ZHiE.js} +2 -2
  9. package/dist/chunks/{index-nz5YKmTp.js → index-Cskof6E0.js} +233 -232
  10. package/dist/chunks/{index-Ddo6owXU.js → index-D9Vg4Ioz.js} +51 -51
  11. package/dist/chunks/{resource-management-panel-CnlQHXZ9.js → resource-management-panel-DxRvAR5Q.js} +1 -1
  12. package/dist/chunks/{resource-management-panel-DpWhJzMn.js → resource-management-panel-N2ZpMRwr.js} +3 -3
  13. package/dist/chunks/{schedule-dashboard-CA-u7Ov1.js → schedule-dashboard-Cd9H79qL.js} +3 -3
  14. package/dist/chunks/{schedule-dashboard-BL5CTGzo.js → schedule-dashboard-CmpnXuyb.js} +1 -1
  15. package/dist/chunks/{use-role-aware-display-preferences-BAbYQx23.js → use-role-aware-display-preferences-0BX-GN_0.js} +1 -1
  16. package/dist/chunks/{use-role-aware-display-preferences-CSacCN5X.js → use-role-aware-display-preferences-Cl52AceY.js} +1 -1
  17. package/dist/chunks/{use-visual-utils-Dt5WKeeY.js → use-visual-utils-Czmg35Mw.js} +1 -1
  18. package/dist/chunks/{use-visual-utils-DV14Lork.js → use-visual-utils-DsrKjvLV.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/package.json +1 -1
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./index-Ddo6owXU.js"),c=require("react"),de=require("./use-visual-utils-Dt5WKeeY.js"),pe=require("./use-role-aware-display-preferences-CSacCN5X.js");/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./index-D9Vg4Ioz.js"),c=require("react"),de=require("./use-visual-utils-Czmg35Mw.js"),pe=require("./use-role-aware-display-preferences-Cl52AceY.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 a, Fragment as ge } from "react/jsx-runtime";
2
- import { l as $e, u as me, n as Qe, aB as re, b9 as Xe, ba as Ze, c as X, bb as ke, aS as et, aT as tt, B as _, aU as st, aV as at, aW as W, bc as pe, L as oe, bd as nt, be as it, bf as rt, bg as ve, bh as De, bi as ot, bj as lt, K as dt, bk as ye, e as le, bl as Se, bm as Ve, bn as ct, _ as Ee, V as Le, bo as Ae, a_ as Te, a$ as Oe, b0 as Re, b2 as Pe, b3 as Ue, b4 as Ie, b5 as je, b6 as Me, bp as ut, bq as ht, br as Fe, bs as Be, bt as ze, bu as mt, bv as He, bw as pt, R as ne, aA as ft, bx as _e, by as gt, bz as Dt, aF as xt, aG as Nt, aH as bt, aI as wt, aJ as vt, aK as Ce, aL as fe, aO as Ct, bA as yt, bB as St, bC as Vt, bD as Et } from "./index-nz5YKmTp.js";
2
+ import { l as $e, u as me, n as Qe, aB as re, b9 as Xe, ba as Ze, c as X, bb as ke, aS as et, aT as tt, B as _, aU as st, aV as at, aW as W, bc as pe, L as oe, bd as nt, be as it, bf as rt, bg as ve, bh as De, bi as ot, bj as lt, K as dt, bk as ye, e as le, bl as Se, bm as Ve, bn as ct, _ as Ee, V as Le, bo as Ae, a_ as Te, a$ as Oe, b0 as Re, b2 as Pe, b3 as Ue, b4 as Ie, b5 as je, b6 as Me, bp as ut, bq as ht, br as Fe, bs as Be, bt as ze, bu as mt, bv as He, bw as pt, R as ne, aA as ft, bx as _e, by as gt, bz as Dt, aF as xt, aG as Nt, aH as bt, aI as wt, aJ as vt, aK as Ce, aL as fe, aO as Ct, bA as yt, bB as St, bC as Vt, bD as Et } from "./index-Cskof6E0.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-DV14Lork.js";
5
- import { u as Tt } from "./use-role-aware-display-preferences-BAbYQx23.js";
4
+ import { a as Ke } from "./use-visual-utils-DsrKjvLV.js";
5
+ import { u as Tt } from "./use-role-aware-display-preferences-0BX-GN_0.js";
6
6
  /**
7
7
  * @license lucide-react v0.453.0 - ISC
8
8
  *
@@ -1,8 +1,8 @@
1
1
  import { jsx as e, jsxs as a, Fragment as F } from "react/jsx-runtime";
2
- import { l as _, aF as $, aG as q, aH as K, aI as X, aJ as Y, aK as T, aL as G, aM as J, aN as E, aO as Q, B as I, L as H, n as k, q as Z, u as g, aB as ee, o as R, aP as ae, aQ as O, t as y, R as se, aR as te, c as w, aS as B, aT as P, aU as L, aV as U, aW as z, m as de, aX as le, aY as ne, aZ as re, a_ as oe, a$ as ie, b0 as ce, b1 as he, b2 as ue, b3 as me, b4 as ve, b5 as pe, b6 as be, a5 as fe, K as ge, b7 as Ce, b8 as De } from "./index-nz5YKmTp.js";
3
- import { E as xe, V as Ae, a as Se, b as Ne, S as j, c as ye } from "./editor-action-buttons-DPK6j7ie.js";
2
+ import { l as _, aF as $, aG as q, aH as K, aI as X, aJ as Y, aK as T, aL as G, aM as J, aN as E, aO as Q, B as I, L as H, n as k, q as Z, u as g, aB as ee, o as R, aP as ae, aQ as O, t as y, R as se, aR as te, c as w, aS as B, aT as P, aU as L, aV as U, aW as z, m as de, aX as le, aY as ne, aZ as re, a_ as oe, a$ as ie, b0 as ce, b1 as he, b2 as ue, b3 as me, b4 as ve, b5 as pe, b6 as be, a5 as fe, K as ge, b7 as Ce, b8 as De } from "./index-Cskof6E0.js";
3
+ import { E as xe, V as Ae, a as Se, b as Ne, S as j, c as ye } from "./editor-action-buttons-DUp8ZHiE.js";
4
4
  import we, { useState as D, useContext as Ie, useEffect as ke } from "react";
5
- import { a as W } from "./use-visual-utils-DV14Lork.js";
5
+ import { a as W } from "./use-visual-utils-DsrKjvLV.js";
6
6
  /**
7
7
  * @license lucide-react v0.453.0 - ISC
8
8
  *
@@ -1,4 +1,4 @@
1
- "use strict";const s=require("react/jsx-runtime"),e=require("./index-Ddo6owXU.js"),C=require("./editor-action-buttons-D2f078Q2.js"),x=require("react"),y=require("./use-visual-utils-Dt5WKeeY.js");/**
1
+ "use strict";const s=require("react/jsx-runtime"),e=require("./index-D9Vg4Ioz.js"),C=require("./editor-action-buttons-B-m2BOfh.js"),x=require("react"),y=require("./use-visual-utils-Czmg35Mw.js");/**
2
2
  * @license lucide-react v0.453.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -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-nz5YKmTp.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-Cskof6E0.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-Ddo6owXU.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-D9Vg4Ioz.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 s=require("./index-Ddo6owXU.js"),g=require("react");function H(e){const a=e.toUpperCase().indexOf("WHERE"),t=e.toUpperCase().indexOf("GROUP BY"),r=e.toUpperCase().indexOf("LIMIT"),c=e.toUpperCase().indexOf("ORDER BY");let d=e.length;if(c!==-1&&(d=c),r!==-1&&r<d&&(d=r),a!==-1){const i=e.substring(0,a),o=e.substring(a);return`${i} {{ filters | where }} AND ${o.substring(6)}`}else if(t!==-1){const i=e.substring(0,t),o=e.substring(t);return`${i} {{ filters | where }} ${o}`}else{const i=e.substring(0,d),o=e.substring(d);return console.log("beforeClause",i),console.log("afterClause",o),o?`${i} {{ filters | where }} ${o}`:`${i.replace(/;$/,"")} {{ filters | where }}`}}function B(e){const[a,t]=g.useState(null),[r,c]=g.useState(null),d=s.useEnsureReactGlobals();return g.useEffect(()=>{if(!e||e.trim()===""){t(null),c(null);return}if(!d)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),c(null)}catch(o){const l=o instanceof Error?o.message:"Unknown error";console.error("Failed to load remote chart store:",l),c(l),t(null)}})()},[e,d]),a}function Q(e,a){if(e.length===0)return"";if(a){const t=e.find(r=>r.id===a);if(t){const r=t.tabTitle;if(r=="All__Header")return e[0].id;if(r&&r.endsWith("__Header")){const d=r.split("__")[0],i=e.find(o=>o.tabTitle===d);return i?i.id:e[0].id}return a}}return e[0].id}async function j(e,a,t,r){if(!a||!t)throw new Error("Missing auth token or visual ID");const c=["resource-by-id","visual",t],d=r.getQueryData(c);if(d)return console.log("Using cached visual data for:",t),{data:d,fromCache:!0};console.log("Fetching visual data from network for:",t);const i=s.ue.loading("Loading visual...",{position:"top-center"});try{const o=await fetch(`${e}/management/v1/visuals/${t}`,{headers:{Authorization:`Bearer ${a}`}});if(!o.ok)throw new Error("Failed to load visual");const l=await o.json();return r.setQueryData(c,l),s.ue.dismiss(i),{data:l,fromCache:!1}}catch(o){throw s.ue.dismiss(i),o}}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 z(e,a){var d,i;const t=(e==null?void 0:e.frameObject)??((d=e==null?void 0:e.visual)==null?void 0:d.frameObject);if(!t)return!1;const r=T(t);if(!(r!=null&&r.cards)||r.cards.length===0)return!1;const c=(i=r.cards)==null?void 0:i.find(o=>o.id===r.activeCardId);return c?(s.setupEditorWithCard({...a,frame:r,card:c,visualId:(e==null?void 0:e.id)||r.visualId}),!0):!1}function G(){var C;const{setCardSql:e}=s.useEditorActions(),a=s.useEditorStore(n=>n.frame),t=s.useEditorStore(n=>n.card),r=s.useEditorStore(n=>n.isDevMode),c=B(((C=t.customCardPreferences)==null?void 0:C.url)||""),d=s.useEditorStore(n=>n.selectedSchemaName),i=s.useEditorStore(n=>n.selectedDatamodelId),o=s.useEditorStore(n=>n.selectedDatabaseName),l=s.useEditorStore(n=>n.selectedTableName),h=s.useEditorStore(n=>n.selectedConnectionId),m=s.useEditorStore(n=>n.isShowingVisual),S=t.sql;return{getUpdatedFrame:g.useCallback(()=>{var I;let n=S;S&&!S.includes("{{")&&(n=H(S),e(n));const w=(I=c==null?void 0:c.getState())==null?void 0:I.settings,v={...t,dataSource:t.dataSource||{mode:"directSource"},lastSelectedSchema:d,lastSelectedDatamodelId:i,lastSelectedDatabase:o,lastSelectedTable:l,connectionId:h,sql:r?n:void 0,python:r?t.python:void 0,config:r?void 0:t.config,customCfg:m?t.customCfg:null,preferences:t.preferences,...w&&{customCardPreferences:{...t.customCardPreferences,settings:w}}},E=a.cards.map(p=>p.id===t.id?v:p);return{...a,cards:E,activeCardId:Q(E,a.activeCardId)}},[t,a,r,m,d,i,o,l,h,e,c,S])}}function Y(){const{authToken:e,tokenProps:a}=s.useSemaphorContext(),t=s.useQueryClient(),r=s.useSelectedVisual(),{selectVisual:c}=s.useManagementActions(),{setFrame:d,setCard:i,setIsDevMode:o,initializeModeDrafts:l,setActiveTabCardId:h,updateDataSource:m,setQueryResultColumns:S,setSelectedConnectionId:V,setSelectedDatabaseName:C,setSelectedSchemaName:n,setSelectedTableName:w,setSelectedDatamodelId:v,setFilterValues:E,setApplyFilters:I}=s.useEditorActions(),{setIsDashboardEditing:p,setIsVisualEditing:$,setSelectedFrameId:D,clearSelectedFrameId:A,addFrame:N,setIsDashboardPanelOpen:R}=s.useDashboardActions(),y=s.useDashboardStore(u=>u.selectedSheetId),O=s.useDashboardStore(u=>u.selectedFrameId),x=s.useDashboardStore(u=>u.dashboard),W=s.useDashboardStore(u=>u.filterValues),F=s.useVisualById((r==null?void 0:r.id)||"",{enabled:!!(r!=null&&r.id)&&!!(e!=null&&e.accessToken)}),k=g.useCallback(async u=>{try{c(u),A();const{data:b,fromCache:f}=await j(a.apiServiceUrl,(e==null?void 0:e.accessToken)||"",u.id,t);if(!z(b,{setFrame:d,setCard:i,setIsDevMode:o,initializeModeDrafts:l,setActiveTabCardId:h,updateDataSource:m,setQueryResultColumns:S,setSelectedConnectionId:V,setSelectedDatabaseName:C,setSelectedSchemaName:n,setSelectedTableName:w,setSelectedDatamodelId:v,setFilterValues:E,setApplyFilters:I,setIsDashboardEditing:p,setIsVisualEditing:$,dashboard:x,selectedSheetId:y,selectedFrameId:O,filterValues:W}))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,a.apiServiceUrl,t,c,d,i,p,$,o,l,h,m,S,V,C,n,w,v,E,I,A,x,y,O,W]),_=g.useCallback(async u=>{var b;try{if(c(u),!y)return{success:!1,error:"No sheet selected. Please select a sheet first."};const{data:f,fromCache:M}=await j(a.apiServiceUrl,(e==null?void 0:e.accessToken)||"",u.id,t),L=(f==null?void 0:f.frameObject)??((b=f==null?void 0:f.visual)==null?void 0:b.frameObject);if(!L)return{success:!1,error:"Visual has no frame data"};const U=T(L);if(!(U!=null&&U.cards)||U.cards.length===0)return{success:!1,error:"Visual frame is malformed"};const P={...s.cloneFrameWithNewIds(U),visualId:u.id};return N(y,P,"end"),p(!0),D(P.id),R(!1),{success:!0,fromCache:M}}catch(f){return console.error("Error adding visual:",f),{success:!1,error:"Failed to add visual to dashboard"}}},[e==null?void 0:e.accessToken,a.apiServiceUrl,t,c,y,N,p,D,R]);return{visual:F.data,isLoading:F.isLoading,isError:F.isError,error:F.error,handleEditLibraryVisual:k,handleAddLibraryVisual:_,getUpdatedFrame:G().getUpdatedFrame,refetch:F.refetch}}exports.useRemoteChartStore=B;exports.useVisualUtils=Y;
1
+ "use strict";const s=require("./index-D9Vg4Ioz.js"),g=require("react");function H(e){const a=e.toUpperCase().indexOf("WHERE"),t=e.toUpperCase().indexOf("GROUP BY"),r=e.toUpperCase().indexOf("LIMIT"),c=e.toUpperCase().indexOf("ORDER BY");let d=e.length;if(c!==-1&&(d=c),r!==-1&&r<d&&(d=r),a!==-1){const i=e.substring(0,a),o=e.substring(a);return`${i} {{ filters | where }} AND ${o.substring(6)}`}else if(t!==-1){const i=e.substring(0,t),o=e.substring(t);return`${i} {{ filters | where }} ${o}`}else{const i=e.substring(0,d),o=e.substring(d);return console.log("beforeClause",i),console.log("afterClause",o),o?`${i} {{ filters | where }} ${o}`:`${i.replace(/;$/,"")} {{ filters | where }}`}}function B(e){const[a,t]=g.useState(null),[r,c]=g.useState(null),d=s.useEnsureReactGlobals();return g.useEffect(()=>{if(!e||e.trim()===""){t(null),c(null);return}if(!d)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),c(null)}catch(o){const l=o instanceof Error?o.message:"Unknown error";console.error("Failed to load remote chart store:",l),c(l),t(null)}})()},[e,d]),a}function Q(e,a){if(e.length===0)return"";if(a){const t=e.find(r=>r.id===a);if(t){const r=t.tabTitle;if(r=="All__Header")return e[0].id;if(r&&r.endsWith("__Header")){const d=r.split("__")[0],i=e.find(o=>o.tabTitle===d);return i?i.id:e[0].id}return a}}return e[0].id}async function j(e,a,t,r){if(!a||!t)throw new Error("Missing auth token or visual ID");const c=["resource-by-id","visual",t],d=r.getQueryData(c);if(d)return console.log("Using cached visual data for:",t),{data:d,fromCache:!0};console.log("Fetching visual data from network for:",t);const i=s.ue.loading("Loading visual...",{position:"top-center"});try{const o=await fetch(`${e}/management/v1/visuals/${t}`,{headers:{Authorization:`Bearer ${a}`}});if(!o.ok)throw new Error("Failed to load visual");const l=await o.json();return r.setQueryData(c,l),s.ue.dismiss(i),{data:l,fromCache:!1}}catch(o){throw s.ue.dismiss(i),o}}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 z(e,a){var d,i;const t=(e==null?void 0:e.frameObject)??((d=e==null?void 0:e.visual)==null?void 0:d.frameObject);if(!t)return!1;const r=T(t);if(!(r!=null&&r.cards)||r.cards.length===0)return!1;const c=(i=r.cards)==null?void 0:i.find(o=>o.id===r.activeCardId);return c?(s.setupEditorWithCard({...a,frame:r,card:c,visualId:(e==null?void 0:e.id)||r.visualId}),!0):!1}function G(){var C;const{setCardSql:e}=s.useEditorActions(),a=s.useEditorStore(n=>n.frame),t=s.useEditorStore(n=>n.card),r=s.useEditorStore(n=>n.isDevMode),c=B(((C=t.customCardPreferences)==null?void 0:C.url)||""),d=s.useEditorStore(n=>n.selectedSchemaName),i=s.useEditorStore(n=>n.selectedDatamodelId),o=s.useEditorStore(n=>n.selectedDatabaseName),l=s.useEditorStore(n=>n.selectedTableName),h=s.useEditorStore(n=>n.selectedConnectionId),m=s.useEditorStore(n=>n.isShowingVisual),S=t.sql;return{getUpdatedFrame:g.useCallback(()=>{var I;let n=S;S&&!S.includes("{{")&&(n=H(S),e(n));const w=(I=c==null?void 0:c.getState())==null?void 0:I.settings,v={...t,dataSource:t.dataSource||{mode:"directSource"},lastSelectedSchema:d,lastSelectedDatamodelId:i,lastSelectedDatabase:o,lastSelectedTable:l,connectionId:h,sql:r?n:void 0,python:r?t.python:void 0,config:r?void 0:t.config,customCfg:m?t.customCfg:null,preferences:t.preferences,...w&&{customCardPreferences:{...t.customCardPreferences,settings:w}}},E=a.cards.map(p=>p.id===t.id?v:p);return{...a,cards:E,activeCardId:Q(E,a.activeCardId)}},[t,a,r,m,d,i,o,l,h,e,c,S])}}function Y(){const{authToken:e,tokenProps:a}=s.useSemaphorContext(),t=s.useQueryClient(),r=s.useSelectedVisual(),{selectVisual:c}=s.useManagementActions(),{setFrame:d,setCard:i,setIsDevMode:o,initializeModeDrafts:l,setActiveTabCardId:h,updateDataSource:m,setQueryResultColumns:S,setSelectedConnectionId:V,setSelectedDatabaseName:C,setSelectedSchemaName:n,setSelectedTableName:w,setSelectedDatamodelId:v,setFilterValues:E,setApplyFilters:I}=s.useEditorActions(),{setIsDashboardEditing:p,setIsVisualEditing:$,setSelectedFrameId:D,clearSelectedFrameId:A,addFrame:N,setIsDashboardPanelOpen:R}=s.useDashboardActions(),y=s.useDashboardStore(u=>u.selectedSheetId),O=s.useDashboardStore(u=>u.selectedFrameId),x=s.useDashboardStore(u=>u.dashboard),W=s.useDashboardStore(u=>u.filterValues),F=s.useVisualById((r==null?void 0:r.id)||"",{enabled:!!(r!=null&&r.id)&&!!(e!=null&&e.accessToken)}),k=g.useCallback(async u=>{try{c(u),A();const{data:b,fromCache:f}=await j(a.apiServiceUrl,(e==null?void 0:e.accessToken)||"",u.id,t);if(!z(b,{setFrame:d,setCard:i,setIsDevMode:o,initializeModeDrafts:l,setActiveTabCardId:h,updateDataSource:m,setQueryResultColumns:S,setSelectedConnectionId:V,setSelectedDatabaseName:C,setSelectedSchemaName:n,setSelectedTableName:w,setSelectedDatamodelId:v,setFilterValues:E,setApplyFilters:I,setIsDashboardEditing:p,setIsVisualEditing:$,dashboard:x,selectedSheetId:y,selectedFrameId:O,filterValues:W}))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,a.apiServiceUrl,t,c,d,i,p,$,o,l,h,m,S,V,C,n,w,v,E,I,A,x,y,O,W]),_=g.useCallback(async u=>{var b;try{if(c(u),!y)return{success:!1,error:"No sheet selected. Please select a sheet first."};const{data:f,fromCache:M}=await j(a.apiServiceUrl,(e==null?void 0:e.accessToken)||"",u.id,t),L=(f==null?void 0:f.frameObject)??((b=f==null?void 0:f.visual)==null?void 0:b.frameObject);if(!L)return{success:!1,error:"Visual has no frame data"};const U=T(L);if(!(U!=null&&U.cards)||U.cards.length===0)return{success:!1,error:"Visual frame is malformed"};const P={...s.cloneFrameWithNewIds(U),visualId:u.id};return N(y,P,"end"),p(!0),D(P.id),R(!1),{success:!0,fromCache:M}}catch(f){return console.error("Error adding visual:",f),{success:!1,error:"Failed to add visual to dashboard"}}},[e==null?void 0:e.accessToken,a.apiServiceUrl,t,c,y,N,p,D,R]);return{visual:F.data,isLoading:F.isLoading,isError:F.isError,error:F.error,handleEditLibraryVisual:k,handleAddLibraryVisual:_,getUpdatedFrame:G().getUpdatedFrame,refetch:F.refetch}}exports.useRemoteChartStore=B;exports.useVisualUtils=Y;
@@ -1,4 +1,4 @@
1
- import { az as G, aA as Y, p as J, q as K, aB as X, m as z, o as Z, u as v, aC as q, aD as ee, t as V, aE as te, n as f } from "./index-nz5YKmTp.js";
1
+ import { az as G, aA as Y, p as J, q as K, aB as X, m as z, o as Z, u as v, aC as q, aD as ee, t as V, aE as te, n as f } from "./index-Cskof6E0.js";
2
2
  import { useState as T, useEffect as re, useCallback as A } from "react";
3
3
  function se(e) {
4
4
  const o = e.toUpperCase().indexOf("WHERE"), t = e.toUpperCase().indexOf("GROUP BY"), r = e.toUpperCase().indexOf("LIMIT"), n = e.toUpperCase().indexOf("ORDER BY");
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-Ddo6owXU.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-D9Vg4Ioz.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-nz5YKmTp.js";
1
+ import { D as a } from "../chunks/index-Cskof6E0.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-Ddo6owXU.js"),v=require("./types/index.cjs"),a=require("react/jsx-runtime"),b=require("react"),j=require("./chunks/resource-management-panel-CnlQHXZ9.js"),h=require("./chunks/schedule-dashboard-BL5CTGzo.js");require("react-dom");function P(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=P(b);/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-D9Vg4Ioz.js"),v=require("./types/index.cjs"),a=require("react/jsx-runtime"),b=require("react"),j=require("./chunks/resource-management-panel-DxRvAR5Q.js"),h=require("./chunks/schedule-dashboard-CmpnXuyb.js");require("react-dom");function P(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=P(b);/**
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 w, E as T, F as N, S as _, v as P, U as M, w as A, x as I, u as R, y as D, z as k, P as F, A as L, B as V, c as v, G as O, H as B, I as H, J as U, K as W, M as j, N as q, O as z, Q, C as G } from "./chunks/index-nz5YKmTp.js";
2
- import { aa as ia, ab as da, D as la, a8 as ca, a2 as ua, af as ha, V as pa, Z as ma, Z as fa, _ as Ca, a as va, a5 as ya, ay as ba, am as Da, a7 as Ta, a3 as ga, a4 as Ea, ag as Sa, ao as xa, an as wa, ar as Na, as as _a, al as Pa, a6 as Ma, ak as Aa, ad as Ia, ae as Ra, ac as ka, ap as Fa, aj as La, ai as Va, ah as Oa, at as Ba, aq as Ha, a1 as Ua, av as Wa, ax as ja, aw as qa, o as za, a0 as Qa, T as Ga, a9 as Ka, W as Ya, m as $a, au as Za, n as Ja, R as Xa, $ as ae, Y as ee } from "./chunks/index-nz5YKmTp.js";
1
+ import { l as w, E as T, F as N, S as _, v as P, U as M, w as A, x as I, u as R, y as D, z as k, P as F, A as L, B as V, c as v, G as O, H as B, I as H, J as U, K as W, M as j, N as q, O as z, Q, C as G } from "./chunks/index-Cskof6E0.js";
2
+ import { aa as ia, ab as da, D as la, a8 as ca, a2 as ua, af as ha, V as pa, Z as ma, Z as fa, _ as Ca, a as va, a5 as ya, ay as ba, am as Da, a7 as Ta, a3 as ga, a4 as Ea, ag as Sa, ao as xa, an as wa, ar as Na, as as _a, al as Pa, a6 as Ma, ak as Aa, ad as Ia, ae as Ra, ac as ka, ap as Fa, aj as La, ai as Va, ah as Oa, at as Ba, aq as Ha, a1 as Ua, av as Wa, ax as ja, aw as qa, o as za, a0 as Qa, T as Ga, a9 as Ka, W as Ya, m as $a, au as Za, n as Ja, R as Xa, $ as ae, Y as ee } from "./chunks/index-Cskof6E0.js";
3
3
  import { EMPTY_SELECTION as oe } from "./types/index.js";
4
4
  import { jsx as a, jsxs as i } from "react/jsx-runtime";
5
5
  import * as p from "react";
6
6
  import { useMemo as K, useEffect as Y } from "react";
7
- import { ResourceManagementPanel as ne } from "./chunks/resource-management-panel-DpWhJzMn.js";
8
- import { A as ie, S as de, U as le, V as ce, u as ue } from "./chunks/schedule-dashboard-CA-u7Ov1.js";
7
+ import { ResourceManagementPanel as ne } from "./chunks/resource-management-panel-N2ZpMRwr.js";
8
+ import { A as ie, S as de, U as le, V as ce, u as ue } from "./chunks/schedule-dashboard-Cd9H79qL.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-Ddo6owXU.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-D9Vg4Ioz.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-nz5YKmTp.js";
1
+ import { a } from "../chunks/index-Cskof6E0.js";
2
2
  import { EMPTY_SELECTION as E } from "../types/index.js";
3
3
  export {
4
4
  E as EMPTY_SELECTION,
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.1.175",
8
+ "version": "0.1.176",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",