react-semaphor 0.1.136 → 0.1.138

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 (24) hide show
  1. package/dist/chunks/{dashboard-controls-C35Jz1fx.js → dashboard-controls-CxQYnkax.js} +3 -3
  2. package/dist/chunks/{dashboard-controls-Dxx6-zR2.js → dashboard-controls-hLb7d4n_.js} +1 -1
  3. package/dist/chunks/{dashboard-export-dialog-BDv_HVGR.js → dashboard-export-dialog-JVjnwTLv.js} +1 -1
  4. package/dist/chunks/{dashboard-export-dialog-DYKctzwH.js → dashboard-export-dialog-XQQow9XX.js} +3 -3
  5. package/dist/chunks/{dashboard-json-DbfqDpJH.js → dashboard-json-CSK4231d.js} +1 -1
  6. package/dist/chunks/{dashboard-json-DizAEdr3.js → dashboard-json-W8a-T1U3.js} +1 -1
  7. package/dist/chunks/{edit-dashboard-visual-CovPTSDH.js → edit-dashboard-visual-BGH8yv2A.js} +455 -448
  8. package/dist/chunks/edit-dashboard-visual-C8ZQJfdk.js +200 -0
  9. package/dist/chunks/{editor-action-buttons-CPJ-_aGj.js → editor-action-buttons-BmBNyNxY.js} +1 -1
  10. package/dist/chunks/{editor-action-buttons-D-k-U0HS.js → editor-action-buttons-zUsKxZMu.js} +2 -2
  11. package/dist/chunks/{index-baj-eF5k.js → index-MdpD3qo9.js} +3 -3
  12. package/dist/chunks/{index-Bqqna9eB.js → index-NjRBKdZ2.js} +23 -11
  13. package/dist/chunks/{resource-management-panel-BJfU9o5-.js → resource-management-panel-C_q7Ilyi.js} +2 -2
  14. package/dist/chunks/{resource-management-panel-CU-aO9tG.js → resource-management-panel-Di5Mg69T.js} +1 -1
  15. package/dist/chunks/{use-visual-utils-DP_QQo_Q.js → use-visual-utils-CmKlc7fo.js} +1 -1
  16. package/dist/chunks/{use-visual-utils-r0hON58l.js → use-visual-utils-oliZ5xcR.js} +1 -1
  17. package/dist/dashboard/index.cjs +1 -1
  18. package/dist/dashboard/index.js +1 -1
  19. package/dist/index.cjs +1 -1
  20. package/dist/index.js +4 -4
  21. package/dist/surfboard/index.cjs +1 -1
  22. package/dist/surfboard/index.js +1 -1
  23. package/package.json +1 -1
  24. package/dist/chunks/edit-dashboard-visual-AgjWs5LG.js +0 -200
@@ -71165,7 +71165,10 @@ function f4e({
71165
71165
  onDataChange: E,
71166
71166
  data: (m == null ? void 0 : m.records) || [],
71167
71167
  filters: C,
71168
- filterValues: [...k || [], ...w || []],
71168
+ filterValues: [
71169
+ ...k || [],
71170
+ ...w || []
71171
+ ],
71169
71172
  inlineFilters: N
71170
71173
  }
71171
71174
  ),
@@ -71210,7 +71213,10 @@ function f4e({
71210
71213
  ),
71211
71214
  data: R.map((W) => W != null && W.id ? n == null ? void 0 : n[W.id] : []),
71212
71215
  filters: C,
71213
- filterValues: [...k || [], ...w || []],
71216
+ filterValues: [
71217
+ ...k || [],
71218
+ ...w || []
71219
+ ],
71214
71220
  inlineFilters: N
71215
71221
  }
71216
71222
  )
@@ -71228,7 +71234,7 @@ const YR = Aa(
71228
71234
  f4e,
71229
71235
  (e, t) => {
71230
71236
  var n, r, o, i;
71231
- return e.card.id === t.card.id && e.frame.id === t.frame.id && ((n = e.card.customCardPreferences) == null ? void 0 : n.url) === ((r = t.card.customCardPreferences) == null ? void 0 : r.url) && ((o = e.card.customCardPreferences) == null ? void 0 : o.componentName) === ((i = t.card.customCardPreferences) == null ? void 0 : i.componentName);
71237
+ return e.card.id === t.card.id && e.card.inlineFilters === t.card.inlineFilters && e.frame.id === t.frame.id && ((n = e.card.customCardPreferences) == null ? void 0 : n.url) === ((r = t.card.customCardPreferences) == null ? void 0 : r.url) && ((o = e.card.customCardPreferences) == null ? void 0 : o.componentName) === ((i = t.card.customCardPreferences) == null ? void 0 : i.componentName);
71232
71238
  }
71233
71239
  );
71234
71240
  function GR({
@@ -114524,10 +114530,10 @@ function gJe() {
114524
114530
  }
114525
114531
  );
114526
114532
  }
114527
- const bJe = Zw(() => import("./dashboard-controls-C35Jz1fx.js")), yJe = Zw(
114528
- () => import("./edit-dashboard-visual-CovPTSDH.js")
114529
- ), vJe = Zw(() => import("./dashboard-json-DizAEdr3.js")), xJe = Zw(
114530
- () => import("./resource-management-panel-BJfU9o5-.js").then(
114533
+ const bJe = Zw(() => import("./dashboard-controls-CxQYnkax.js")), yJe = Zw(
114534
+ () => import("./edit-dashboard-visual-BGH8yv2A.js")
114535
+ ), vJe = Zw(() => import("./dashboard-json-W8a-T1U3.js")), xJe = Zw(
114536
+ () => import("./resource-management-panel-C_q7Ilyi.js").then(
114531
114537
  (e) => ({ default: e.ResourceManagementPanel })
114532
114538
  )
114533
114539
  );
@@ -115349,7 +115355,10 @@ function Het({ card: e }) {
115349
115355
  onDataChange: E,
115350
115356
  data: (m == null ? void 0 : m.records) || [],
115351
115357
  filters: C,
115352
- filterValues: [...k || [], ...w || []],
115358
+ filterValues: [
115359
+ ...k || [],
115360
+ ...w || []
115361
+ ],
115353
115362
  inlineFilters: N
115354
115363
  }
115355
115364
  ),
@@ -115386,7 +115395,10 @@ function Het({ card: e }) {
115386
115395
  ),
115387
115396
  data: F.map((B) => B != null && B.id ? r == null ? void 0 : r[B.id] : []),
115388
115397
  filters: C,
115389
- filterValues: [...k || [], ...w || []],
115398
+ filterValues: [
115399
+ ...k || [],
115400
+ ...w || []
115401
+ ],
115390
115402
  inlineFilters: N
115391
115403
  }
115392
115404
  ) })
@@ -115399,8 +115411,8 @@ function Het({ card: e }) {
115399
115411
  const _nt = Aa(
115400
115412
  Het,
115401
115413
  (e, t) => {
115402
- var n, r, o, i;
115403
- return e.card.id === t.card.id && ((n = e.card.customCardPreferences) == null ? void 0 : n.url) === ((r = t.card.customCardPreferences) == null ? void 0 : r.url) && ((o = e.card.customCardPreferences) == null ? void 0 : o.componentName) === ((i = t.card.customCardPreferences) == null ? void 0 : i.componentName);
115414
+ var n, r, o, i, a, s;
115415
+ return e.card.id === t.card.id && e.card.inlineFilters === t.card.inlineFilters && ((n = e.card.customCardPreferences) == null ? void 0 : n.settings) === ((r = t.card.customCardPreferences) == null ? void 0 : r.settings) && ((o = e.card.customCardPreferences) == null ? void 0 : o.url) === ((i = t.card.customCardPreferences) == null ? void 0 : i.url) && ((a = e.card.customCardPreferences) == null ? void 0 : a.componentName) === ((s = t.card.customCardPreferences) == null ? void 0 : s.componentName);
115404
115416
  }
115405
115417
  ), Uet = T.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ f(
115406
115418
  R0,
@@ -1,7 +1,7 @@
1
1
  import { jsx as e, jsxs as a, Fragment as me } from "react/jsx-runtime";
2
- import { b as We, u as de, f as qe, ao as ne, b5 as Je, b6 as Qe, c as ee, b7 as Ye, aG as Xe, aH as Ze, B as G, aI as $e, aJ as ke, aK as Q, b8 as ce, L as ie, b9 as et, ba as tt, bb as st, bc as Ne, bd as pe, be as at, bf as nt, I as it, bg as we, bh as re, bi as ye, bj as Ce, bk as rt, K as ve, R as Se, bl as Ve, aO as Ee, aP as Le, aQ as Te, aS as Ae, aT as Oe, aU as Pe, aV as Re, aW as Ie, bm as ot, bn as lt, bo as Ue, bp as je, bq as Me, br as dt, bs as Fe, bt as ct, aE as ae, an as ut, bu as ht, bv as Be, bw as mt, bx as pt, as as ft, at as gt, au as Dt, av as xt, aw as Nt, ax as be, ay as ue, aB as bt, by as wt, bz as yt, bA as Ct, bB as vt } from "./index-Bqqna9eB.js";
2
+ import { b as We, u as de, f as qe, ao as ne, b5 as Je, b6 as Qe, c as ee, b7 as Ye, aG as Xe, aH as Ze, B as G, aI as $e, aJ as ke, aK as Q, b8 as ce, L as ie, b9 as et, ba as tt, bb as st, bc as Ne, bd as pe, be as at, bf as nt, I as it, bg as we, bh as re, bi as ye, bj as Ce, bk as rt, K as ve, R as Se, bl as Ve, aO as Ee, aP as Le, aQ as Te, aS as Ae, aT as Oe, aU as Pe, aV as Re, aW as Ie, bm as ot, bn as lt, bo as Ue, bp as je, bq as Me, br as dt, bs as Fe, bt as ct, aE as ae, an as ut, bu as ht, bv as Be, bw as mt, bx as pt, as as ft, at as gt, au as Dt, av as xt, aw as Nt, ax as be, ay as ue, aB as bt, by as wt, bz as yt, bA as Ct, bB as vt } from "./index-NjRBKdZ2.js";
3
3
  import St, { useState as g, useEffect as he } from "react";
4
- import { a as ze } from "./use-visual-utils-r0hON58l.js";
4
+ import { a as ze } from "./use-visual-utils-oliZ5xcR.js";
5
5
  import { u as Vt } from "./use-click-outside-CMeO_QFI.js";
6
6
  /**
7
7
  * @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"),s=require("./index-baj-eF5k.js"),m=require("react"),re=require("./use-visual-utils-DP_QQo_Q.js"),ue=require("./use-click-outside-B9T3lmcw.js");/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("./index-MdpD3qo9.js"),m=require("react"),re=require("./use-visual-utils-CmKlc7fo.js"),ue=require("./use-click-outside-B9T3lmcw.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 o=require("./index-baj-eF5k.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-MdpD3qo9.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 { am as G, an as z, h as Y, i as J, ao as K, e as _, g as X, u as U, ap as Z, aq as q, l as v, ar as ee, f as h } from "./index-Bqqna9eB.js";
1
+ import { am as G, an as z, h as Y, i as J, ao as K, e as _, g as X, u as U, ap as Z, aq as q, l as v, ar as ee, f as h } from "./index-NjRBKdZ2.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-baj-eF5k.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-MdpD3qo9.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-Bqqna9eB.js";
1
+ import { D as a } from "../chunks/index-NjRBKdZ2.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-baj-eF5k.js"),S=require("./types/index.cjs"),a=require("react/jsx-runtime"),g=require("react"),j=require("./chunks/resource-management-panel-CU-aO9tG.js"),c=require("./chunks/dashboard-export-dialog-BDv_HVGR.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 C=P(g);/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-MdpD3qo9.js"),S=require("./types/index.cjs"),a=require("react/jsx-runtime"),g=require("react"),j=require("./chunks/resource-management-panel-Di5Mg69T.js"),c=require("./chunks/dashboard-export-dialog-JVjnwTLv.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 C=P(g);/**
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 { b as S, E as g, F as P, S as w, U as M, m as k, n as A, u as F, o as y, p as L, P as R, q as I, B as V, c as v, r as _, s as U, t as B, v as W, I as j, w as q, x as z, y as O, z as Q, C as G } from "./chunks/index-Bqqna9eB.js";
2
- import { Z as oa, _ as na, D as ta, N as ia, a2 as la, R as da, J as ca, J as ua, K as ha, a as pa, T as fa, al as ma, a9 as Ca, W as va, O as ba, Q as Da, a3 as ya, ab as ga, aa as xa, ae as Ea, af as Na, a8 as Ta, V as Sa, a7 as Pa, a0 as wa, a1 as Ma, $ as ka, ac as Aa, a6 as Fa, a5 as La, a4 as Ra, ag as Ia, ad as Va, M as _a, ai as Ua, ak as Ba, aj as Wa, g as ja, A as qa, Y as za, G as Oa, e as Qa, ah as Ga, f as Ha, H as Ka } from "./chunks/index-Bqqna9eB.js";
1
+ import { b as S, E as g, F as P, S as w, U as M, m as k, n as A, u as F, o as y, p as L, P as R, q as I, B as V, c as v, r as _, s as U, t as B, v as W, I as j, w as q, x as z, y as O, z as Q, C as G } from "./chunks/index-NjRBKdZ2.js";
2
+ import { Z as oa, _ as na, D as ta, N as ia, a2 as la, R as da, J as ca, J as ua, K as ha, a as pa, T as fa, al as ma, a9 as Ca, W as va, O as ba, Q as Da, a3 as ya, ab as ga, aa as xa, ae as Ea, af as Na, a8 as Ta, V as Sa, a7 as Pa, a0 as wa, a1 as Ma, $ as ka, ac as Aa, a6 as Fa, a5 as La, a4 as Ra, ag as Ia, ad as Va, M as _a, ai as Ua, ak as Ba, aj as Wa, g as ja, A as qa, Y as za, G as Oa, e as Qa, ah as Ga, f as Ha, H as Ka } from "./chunks/index-NjRBKdZ2.js";
3
3
  import { EMPTY_SELECTION as $a } from "./types/index.js";
4
4
  import { jsx as a, jsxs as l } from "react/jsx-runtime";
5
5
  import * as p from "react";
6
6
  import { useMemo as H } from "react";
7
- import { ResourceManagementPanel as Xa } from "./chunks/resource-management-panel-BJfU9o5-.js";
8
- import { A as ae, D as ee, S as se, U as re, V as oe, u as ne } from "./chunks/dashboard-export-dialog-DYKctzwH.js";
7
+ import { ResourceManagementPanel as Xa } from "./chunks/resource-management-panel-C_q7Ilyi.js";
8
+ import { A as ae, D as ee, S as se, U as re, V as oe, u as ne } from "./chunks/dashboard-export-dialog-XQQow9XX.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-baj-eF5k.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-MdpD3qo9.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-Bqqna9eB.js";
1
+ import { a } from "../chunks/index-NjRBKdZ2.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.136",
8
+ "version": "0.1.138",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",