react-semaphor 0.1.131 → 0.1.132

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 (23) hide show
  1. package/dist/chunks/{dashboard-controls-B2o_Ml98.js → dashboard-controls-CWG6EatR.js} +3 -3
  2. package/dist/chunks/{dashboard-controls-CLmhjguK.js → dashboard-controls-DQMFJcPB.js} +1 -1
  3. package/dist/chunks/{dashboard-export-dialog-Ch0ElsMI.js → dashboard-export-dialog-CYRUEIF0.js} +1 -1
  4. package/dist/chunks/{dashboard-export-dialog-DwkHS7L_.js → dashboard-export-dialog-DofqNYdv.js} +3 -3
  5. package/dist/chunks/{dashboard-json-DawmOBwK.js → dashboard-json-CfXtWYQo.js} +1 -1
  6. package/dist/chunks/{dashboard-json-BPO_6NQh.js → dashboard-json-D5b7lskH.js} +1 -1
  7. package/dist/chunks/{edit-dashboard-visual-CE0f3H3D.js → edit-dashboard-visual-C4ur0h-P.js} +1 -1
  8. package/dist/chunks/{edit-dashboard-visual-VH55I2qe.js → edit-dashboard-visual-CSfaO06L.js} +3 -3
  9. package/dist/chunks/{editor-action-buttons-BCRzk-0n.js → editor-action-buttons-7cxzFlCm.js} +2 -2
  10. package/dist/chunks/{editor-action-buttons-BCX2a6QA.js → editor-action-buttons-DWHiK2yJ.js} +1 -1
  11. package/dist/chunks/{index-D3VnAyrW.js → index-B6RYfqnr.js} +21 -21
  12. package/dist/chunks/{index-BiG_2DRk.js → index-CRA38qes.js} +18 -16
  13. package/dist/chunks/{resource-management-panel-DAc7CcYm.js → resource-management-panel-CC_r1yro.js} +1 -1
  14. package/dist/chunks/{resource-management-panel-CFSAxmG5.js → resource-management-panel-DnKFfVOc.js} +2 -2
  15. package/dist/chunks/{use-visual-utils-iLF6cWs6.js → use-visual-utils-B41g03Pc.js} +1 -1
  16. package/dist/chunks/{use-visual-utils-_KE2a0K6.js → use-visual-utils-CZNuwJRU.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
@@ -22950,7 +22950,7 @@ function Hhe(e) {
22950
22950
  return q && (Me.pagination = {
22951
22951
  page: ((se = x.paginationConfig) == null ? void 0 : se.page) || 1,
22952
22952
  pageSize: ((ce = x.paginationConfig) == null ? void 0 : ce.pageSize) || ((Ce = (ge = x.preferences) == null ? void 0 : ge.tablePrefs) == null ? void 0 : Ce.pageSize) || 50
22953
- }), await Q6(
22953
+ }), console.log("[/v1/query] token source:", t != null && t.accessToken ? "context" : "store"), await Q6(
22954
22954
  `${n.apiServiceUrl}/v1/query`,
22955
22955
  (t == null ? void 0 : t.accessToken) || (a == null ? void 0 : a.accessToken) || "",
22956
22956
  Me
@@ -50394,29 +50394,31 @@ function Lke(e, t, n, r, o, i) {
50394
50394
  );
50395
50395
  }
50396
50396
  async function NW(e, t) {
50397
- var a;
50397
+ var l, c, u;
50398
50398
  if (ne.getState().isDownloadingPdf)
50399
50399
  return;
50400
50400
  const r = Intl.DateTimeFormat().resolvedOptions().timeZone, o = new URLSearchParams();
50401
50401
  o.set("theme", t.theme), o.set("filterValues", JSON.stringify(t.filterValues)), o.set("dashboardId", t.dashboardId), t.selectedSheetId !== void 0 && o.set("selectedSheetId", t.selectedSheetId), t.dashboardTitle !== void 0 && o.set("dashboardTitle", t.dashboardTitle), t.visualId !== void 0 && o.set("visualId", t.visualId), t.frameId !== void 0 && o.set("frameId", t.frameId), t.tableMode !== void 0 && o.set("tableMode", String(t.tableMode)), t.cardType !== void 0 && o.set("cardType", t.cardType), t.cardTitle !== void 0 && o.set("reportTitle", t.cardTitle), t.password && o.set("password", t.password), t.pageSize && o.set("pageSize", t.pageSize), t.orientation && o.set("orientation", t.orientation), t.filterLine && o.set("filterLine", t.filterLine), o.set("timezone", t.timezone || r), t.sheetSelection && o.set("sheetSelection", t.sheetSelection);
50402
50402
  const i = `${e}/v1/pdf?params=${encodeURIComponent(o.toString())}`;
50403
50403
  ne.setState({ isDownloadingPdf: !0 });
50404
+ const a = (l = ne.getState().authToken) == null ? void 0 : l.accessToken, s = (c = t.authToken) == null ? void 0 : c.accessToken;
50405
+ console.log("[/v1/pdf] token source: context"), !s || !a ? console.log("[/v1/pdf] TOKEN NULL - context:", s ? "present" : "null", ", store:", a ? "present" : "null") : s !== a && (console.log("[/v1/pdf] TOKEN MISMATCH - context token differs from store token"), console.log("[/v1/pdf] context token:", s), console.log("[/v1/pdf] store token:", a));
50404
50406
  try {
50405
- const s = await fetch(i, {
50407
+ const d = await fetch(i, {
50406
50408
  method: "GET",
50407
50409
  headers: {
50408
- Authorization: `Bearer ${(a = t.authToken) == null ? void 0 : a.accessToken}`
50410
+ Authorization: `Bearer ${(u = t.authToken) == null ? void 0 : u.accessToken}`
50409
50411
  }
50410
50412
  });
50411
- if (!s.ok)
50412
- throw new Error(`HTTP error! status: ${s.status}`);
50413
- const l = await s.json();
50414
- if (!l.url)
50413
+ if (!d.ok)
50414
+ throw new Error(`HTTP error! status: ${d.status}`);
50415
+ const h = await d.json();
50416
+ if (!h.url)
50415
50417
  throw new Error("No download URL received from server");
50416
- const c = l.url, u = document.createElement("a");
50417
- u.href = c, u.download = t.fileName, u.click(), ne.setState({ isDownloadingPdf: !1 });
50418
- } catch (s) {
50419
- throw ne.setState({ isDownloadingPdf: !1 }), s;
50418
+ const p = h.url, m = document.createElement("a");
50419
+ m.href = p, m.download = t.fileName, m.click(), ne.setState({ isDownloadingPdf: !1 });
50420
+ } catch (d) {
50421
+ throw ne.setState({ isDownloadingPdf: !1 }), d;
50420
50422
  }
50421
50423
  }
50422
50424
  function kW(e) {
@@ -113503,10 +113505,10 @@ function KQe() {
113503
113505
  }
113504
113506
  );
113505
113507
  }
113506
- const ZQe = Gw(() => import("./dashboard-controls-B2o_Ml98.js")), XQe = Gw(
113507
- () => import("./edit-dashboard-visual-VH55I2qe.js")
113508
- ), QQe = Gw(() => import("./dashboard-json-DawmOBwK.js")), JQe = Gw(
113509
- () => import("./resource-management-panel-CFSAxmG5.js").then(
113508
+ const ZQe = Gw(() => import("./dashboard-controls-CWG6EatR.js")), XQe = Gw(
113509
+ () => import("./edit-dashboard-visual-CSfaO06L.js")
113510
+ ), QQe = Gw(() => import("./dashboard-json-CfXtWYQo.js")), JQe = Gw(
113511
+ () => import("./resource-management-panel-DnKFfVOc.js").then(
113510
113512
  (e) => ({ default: e.ResourceManagementPanel })
113511
113513
  )
113512
113514
  );
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("./index-D3VnAyrW.js"),m=require("react"),re=require("./use-visual-utils-iLF6cWs6.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-B6RYfqnr.js"),m=require("react"),re=require("./use-visual-utils-B41g03Pc.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,7 +1,7 @@
1
1
  import { jsx as e, jsxs as a, Fragment as me } from "react/jsx-runtime";
2
- import { b as Ke, u as de, f as qe, an as ne, b4 as We, b5 as Ye, c as ee, b6 as Qe, aF as Xe, aG as Ze, B as J, aH as $e, aI as ke, aJ as Y, b7 as ce, L as ie, b8 as et, b9 as tt, ba as st, bb as Ne, bc as pe, bd as at, be as nt, I as it, bf as we, bg as re, bh as Ce, bi as ve, bj as rt, J as ye, R as Se, bk as Ve, aN as Ee, aO as Le, aP as Ae, aR as Te, aS as Oe, aT as Pe, aU as Re, aV as Ie, bl as ot, bm as lt, bn as Ue, bo as je, bp as Me, bq as dt, br as Fe, bs as ct, aD as ae, am as ut, bt as ht, bu as ze, bv as mt, bw as pt, ar as ft, as as gt, at as Dt, au as xt, av as Nt, aw as be, ax as ue, aA as bt, bx as wt, by as Ct, bz as vt, bA as yt } from "./index-BiG_2DRk.js";
2
+ import { b as Ke, u as de, f as qe, an as ne, b4 as We, b5 as Ye, c as ee, b6 as Qe, aF as Xe, aG as Ze, B as J, aH as $e, aI as ke, aJ as Y, b7 as ce, L as ie, b8 as et, b9 as tt, ba as st, bb as Ne, bc as pe, bd as at, be as nt, I as it, bf as we, bg as re, bh as Ce, bi as ve, bj as rt, J as ye, R as Se, bk as Ve, aN as Ee, aO as Le, aP as Ae, aR as Te, aS as Oe, aT as Pe, aU as Re, aV as Ie, bl as ot, bm as lt, bn as Ue, bo as je, bp as Me, bq as dt, br as Fe, bs as ct, aD as ae, am as ut, bt as ht, bu as ze, bv as mt, bw as pt, ar as ft, as as gt, at as Dt, au as xt, av as Nt, aw as be, ax as ue, aA as bt, bx as wt, by as Ct, bz as vt, bA as yt } from "./index-CRA38qes.js";
3
3
  import St, { useState as g, useEffect as he } from "react";
4
- import { a as Be } from "./use-visual-utils-_KE2a0K6.js";
4
+ import { a as Be } from "./use-visual-utils-CZNuwJRU.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 +1 @@
1
- "use strict";const o=require("./index-D3VnAyrW.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-B6RYfqnr.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 { al as G, am as z, h as Y, i as J, an as K, e as _, g as X, u as U, ao as Z, ap as q, l as v, aq as ee, f as h } from "./index-BiG_2DRk.js";
1
+ import { al as G, am as z, h as Y, i as J, an as K, e as _, g as X, u as U, ao as Z, ap as q, l as v, aq as ee, f as h } from "./index-CRA38qes.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-D3VnAyrW.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-B6RYfqnr.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-BiG_2DRk.js";
1
+ import { D as a } from "../chunks/index-CRA38qes.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-D3VnAyrW.js"),S=require("./types/index.cjs"),a=require("react/jsx-runtime"),g=require("react"),j=require("./chunks/resource-management-panel-DAc7CcYm.js"),u=require("./chunks/dashboard-export-dialog-Ch0ElsMI.js");require("react-dom");function P(r){const t=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(t,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}return t.default=r,Object.freeze(t)}const C=P(g);/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-B6RYfqnr.js"),S=require("./types/index.cjs"),a=require("react/jsx-runtime"),g=require("react"),j=require("./chunks/resource-management-panel-CC_r1yro.js"),u=require("./chunks/dashboard-export-dialog-CYRUEIF0.js");require("react-dom");function P(r){const t=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(t,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}return t.default=r,Object.freeze(t)}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 y, F as P, S as w, U as M, m as k, n as A, u as F, o as g, 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 H, z as O, C as G } from "./chunks/index-BiG_2DRk.js";
2
- import { Y as oa, Z as na, D as ta, M as ia, a1 as la, R as da, H as ca, H as ua, J as ha, a as pa, Q as fa, ak as ma, a8 as Ca, V as va, N as ba, O as Da, a2 as ga, aa as ya, a9 as xa, ad as Ea, ae as Na, a7 as Ta, T as Sa, a6 as Pa, $ as wa, a0 as Ma, _ as ka, ab as Aa, a5 as Fa, a4 as La, a3 as Ra, af as Ia, ac as Va, K as _a, ah as Ua, aj as Ba, ai as Wa, g as ja, W as qa, A as za, e as Ha, ag as Oa, f as Ga, G as Qa } from "./chunks/index-BiG_2DRk.js";
1
+ import { b as S, E as y, F as P, S as w, U as M, m as k, n as A, u as F, o as g, 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 H, z as O, C as G } from "./chunks/index-CRA38qes.js";
2
+ import { Y as oa, Z as na, D as ta, M as ia, a1 as la, R as da, H as ca, H as ua, J as ha, a as pa, Q as fa, ak as ma, a8 as Ca, V as va, N as ba, O as Da, a2 as ga, aa as ya, a9 as xa, ad as Ea, ae as Na, a7 as Ta, T as Sa, a6 as Pa, $ as wa, a0 as Ma, _ as ka, ab as Aa, a5 as Fa, a4 as La, a3 as Ra, af as Ia, ac as Va, K as _a, ah as Ua, aj as Ba, ai as Wa, g as ja, W as qa, A as za, e as Ha, ag as Oa, f as Ga, G as Qa } from "./chunks/index-CRA38qes.js";
3
3
  import { EMPTY_SELECTION as Ya } 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 Q } from "react";
7
- import { ResourceManagementPanel as Ja } from "./chunks/resource-management-panel-CFSAxmG5.js";
8
- import { A as Za, D as ae, S as ee, U as se, V as re, u as oe } from "./chunks/dashboard-export-dialog-DwkHS7L_.js";
7
+ import { ResourceManagementPanel as Ja } from "./chunks/resource-management-panel-DnKFfVOc.js";
8
+ import { A as Za, D as ae, S as ee, U as se, V as re, u as oe } from "./chunks/dashboard-export-dialog-DofqNYdv.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-D3VnAyrW.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-B6RYfqnr.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-BiG_2DRk.js";
1
+ import { a } from "../chunks/index-CRA38qes.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.131",
8
+ "version": "0.1.132",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",