react-semaphor 0.1.163 → 0.1.165

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-lOO1Kawo.js → dashboard-controls-BA7vyPHM.js} +104 -104
  2. package/dist/chunks/{dashboard-controls-ChqSrjnv.js → dashboard-controls-CEnWdjuE.js} +1 -1
  3. package/dist/chunks/{dashboard-export-dialog-BVBiNvo4.js → dashboard-export-dialog-9nJsWzgJ.js} +1 -1
  4. package/dist/chunks/{dashboard-export-dialog-h5owxj4H.js → dashboard-export-dialog-CEVJnrSj.js} +42 -42
  5. package/dist/chunks/{dashboard-json-Bp8U1SuM.js → dashboard-json-B4UTFvyR.js} +1 -1
  6. package/dist/chunks/{dashboard-json-D4Apm_Z0.js → dashboard-json-C8YFsFVt.js} +1 -1
  7. package/dist/chunks/{edit-dashboard-visual-BGY-Nj8j.js → edit-dashboard-visual-BMBiT_V_.js} +2 -2
  8. package/dist/chunks/{edit-dashboard-visual-ItNwbDeL.js → edit-dashboard-visual-DKqjPVRM.js} +467 -467
  9. package/dist/chunks/{editor-action-buttons-D91jaw9J.js → editor-action-buttons-De18jUjn.js} +2 -2
  10. package/dist/chunks/{editor-action-buttons-B2mhU48J.js → editor-action-buttons-xrbSWcSm.js} +1 -1
  11. package/dist/chunks/{index-BZpXKhl2.js → index-5dE6RqWv.js} +13528 -13412
  12. package/dist/chunks/{index-CM3-W6qg.js → index-odiH0LJA.js} +229 -224
  13. package/dist/chunks/{resource-management-panel-B_pm6Dv6.js → resource-management-panel-CK-wL4Jy.js} +1 -1
  14. package/dist/chunks/{resource-management-panel-CG1NjRIJ.js → resource-management-panel-CjWRsuif.js} +124 -124
  15. package/dist/chunks/{use-role-aware-display-preferences-DLpbW937.js → use-role-aware-display-preferences-Bj_-I3oD.js} +1 -1
  16. package/dist/chunks/{use-role-aware-display-preferences-VBz5V4SH.js → use-role-aware-display-preferences-Cm7hg_Us.js} +1 -1
  17. package/dist/chunks/{use-visual-utils-CRbrMwuR.js → use-visual-utils-Du173Ucu.js} +1 -1
  18. package/dist/chunks/{use-visual-utils-B1rNqRXZ.js → use-visual-utils-DwnVUHSd.js} +12 -12
  19. package/dist/dashboard/index.cjs +1 -1
  20. package/dist/dashboard/index.js +1 -1
  21. package/dist/index.cjs +2 -2
  22. package/dist/index.js +111 -108
  23. package/dist/surfboard/index.cjs +1 -1
  24. package/dist/surfboard/index.js +1 -1
  25. package/package.json +1 -1
@@ -1 +1 @@
1
- "use strict";const a=require("./index-CM3-W6qg.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-odiH0LJA.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-BZpXKhl2.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-5dE6RqWv.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-CM3-W6qg.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-odiH0LJA.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-BZpXKhl2.js";
1
+ import { ay as z, az as G, p as Y, q as J, aA as K, m as _, o as X, u as U, aB as Z, aC as q, t as v, aD as ee, n as h } from "./index-5dE6RqWv.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");
@@ -204,15 +204,15 @@ function de() {
204
204
  setIsDashboardEditing: p,
205
205
  setIsVisualEditing: A,
206
206
  setSelectedFrameId: N,
207
- clearSelectedFrameId: x,
208
- addFrame: O,
207
+ clearSelectedFrameId: O,
208
+ addFrame: x,
209
209
  setIsDashboardPanelOpen: R
210
- } = X(), I = U((l) => l.selectedSheetId), W = U((l) => l.selectedFrameId), B = U((l) => l.dashboard), D = U((l) => l.filterValues), y = Z((t == null ? void 0 : t.id) || "", {
210
+ } = X(), I = U((l) => l.selectedSheetId), W = U((l) => l.selectedFrameId), D = U((l) => l.dashboard), B = U((l) => l.filterValues), y = Z((t == null ? void 0 : t.id) || "", {
211
211
  enabled: !!(t != null && t.id) && !!(e != null && e.accessToken)
212
212
  }), Q = V(
213
213
  async (l) => {
214
214
  try {
215
- i(l), x();
215
+ i(l), O();
216
216
  const { data: g, fromCache: f } = await M(
217
217
  o.apiServiceUrl,
218
218
  (e == null ? void 0 : e.accessToken) || "",
@@ -235,10 +235,10 @@ function de() {
235
235
  setApplyFilters: C,
236
236
  setIsDashboardEditing: p,
237
237
  setIsVisualEditing: A,
238
- dashboard: B,
238
+ dashboard: D,
239
239
  selectedSheetId: I,
240
240
  selectedFrameId: W,
241
- filterValues: D
241
+ filterValues: B
242
242
  }))
243
243
  throw new Error("Failed to setup editor with visual data");
244
244
  return { success: !0, fromCache: f };
@@ -266,11 +266,11 @@ function de() {
266
266
  F,
267
267
  w,
268
268
  C,
269
- x,
270
- B,
269
+ O,
270
+ D,
271
271
  I,
272
272
  W,
273
- D
273
+ B
274
274
  ]
275
275
  ), k = V(
276
276
  async (l) => {
@@ -297,7 +297,7 @@ function de() {
297
297
  visualId: l.id
298
298
  // Link this frame to the library visual
299
299
  };
300
- return O(I, j, "end"), p(!0), N(j.id), R(!1), { success: !0, fromCache: L };
300
+ return x(I, j, "end"), p(!0), N(j.id), R(!1), { success: !0, fromCache: L };
301
301
  } catch (f) {
302
302
  return console.error("Error adding visual:", f), { success: !1, error: "Failed to add visual to dashboard" };
303
303
  }
@@ -308,7 +308,7 @@ function de() {
308
308
  r,
309
309
  i,
310
310
  I,
311
- O,
311
+ x,
312
312
  p,
313
313
  N,
314
314
  R
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-CM3-W6qg.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-odiH0LJA.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-BZpXKhl2.js";
1
+ import { D as a } from "../chunks/index-5dE6RqWv.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,6 +1,6 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-CM3-W6qg.js"),E=require("./types/index.cjs"),a=require("react/jsx-runtime"),x=require("react"),j=require("./chunks/resource-management-panel-B_pm6Dv6.js"),c=require("./chunks/dashboard-export-dialog-BVBiNvo4.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-odiH0LJA.js"),E=require("./types/index.cjs"),a=require("react/jsx-runtime"),g=require("react"),j=require("./chunks/resource-management-panel-CK-wL4Jy.js"),c=require("./chunks/dashboard-export-dialog-9nJsWzgJ.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(g);/**
2
2
  * @license lucide-react v0.453.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const P=e.createLucideIcon("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);function N(r){const{displayPreferences:o,...s}=r,i={...s,id:r.dashboardId};return a.jsx(e.ErrorBoundary,{FallbackComponent:e.Fallback,children:a.jsx(e.SemaphorContextProvider,{dashboardProps:i,children:a.jsx(e.UXProvider,{children:a.jsx(e.DisplayPreferencesProvider,{displayPreferences:o,children:a.jsx(e.Container,{type:"visual",...i,children:a.jsx(A,{cardId:r.cardId})})})})})})}function A({cardId:r}){const o=e.useDashboardStore(n=>{var l;return(l=n.dashboard)==null?void 0:l.sheets}),{card:s,frame:i}=x.useMemo(()=>{const n=o==null?void 0:o.flatMap(t=>t.frames),l=n==null?void 0:n.flatMap(t=>t==null?void 0:t.cards),C=l==null?void 0:l.find(t=>(t==null?void 0:t.id)===r),f=n==null?void 0:n.find(t=>{var p;return(p=t==null?void 0:t.cards)==null?void 0:p.find(u=>(u==null?void 0:u.id)===r)});return{card:C,frame:f}},[o,r]);return!s||!i?a.jsx(e.FallbackVisual,{error:new Error("Card not found"),resetErrorBoundary:()=>{},customerFacingMessage:`Card not found with ID: ${r}`}):a.jsx("main",{className:"flex h-full grow flex-col",children:a.jsx(e.ErrorBoundary,{FallbackComponent:({error:n,resetErrorBoundary:l})=>a.jsx(e.FallbackVisual,{error:n,resetErrorBoundary:l,customerFacingMessage:"Error creating visual. Please try again."}),children:a.jsx(e.DashboardCard,{card:s,frame:i})})})}function k({name:r,items:o,value:s,onChange:i,isLoading:n,isError:l,refetch:C,className:f,icon:t,showNone:p=!1}){const u=m.useRef(null),[b,g]=m.useState(!1),[y,v]=m.useState("100%"),D=p?[...o||[],{id:"none",name:"None"}]:o;m.useLayoutEffect(()=>{u.current&&v(u.current.offsetWidth)},[]);function T(){var d;return n?"Loading...":l?"Error":s?(d=o==null?void 0:o.find(h=>h.id===s))==null?void 0:d.name:`Select ${r}`}function S(d,h){i(h),g(!1)}return a.jsxs(e.Popover,{open:b,onOpenChange:g,children:[a.jsx(e.PopoverTrigger,{asChild:!0,children:a.jsxs(e.Button,{ref:u,variant:"outline",role:"combobox","aria-expanded":b,className:e.cn("flex h-9 w-full justify-between",f),children:[a.jsxs("div",{className:"flex items-center gap-2",children:[t&&a.jsx("div",{className:"mr-2",children:t}),a.jsx("span",{className:"max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap",children:T()})]}),a.jsx(e.ChevronDown,{className:"size-4 opacity-50"})]})}),a.jsx(e.PopoverContent,{className:"w-full p-0",style:{minWidth:y},children:a.jsxs(e.Command,{children:[a.jsxs("div",{className:"flex h-9 items-center justify-between border-b pr-1",children:[a.jsx(e.CommandInput,{className:"h-9",placeholder:"Search..."}),a.jsx(e.IconButton,{className:"h-7",onClick:C,children:a.jsx(P,{className:e.cn("size-3.5 opacity-50",n&&"animate-spin")})})]}),a.jsxs(e.CommandList,{children:[a.jsxs(e.CommandEmpty,{children:["No ",r==null?void 0:r.toLowerCase()," found."]}),a.jsx(e.CommandGroup,{children:D==null?void 0:D.map(d=>a.jsx(e.CommandItem,{className:"overflow-x-auto",value:d.name,onSelect:h=>S(h,d.id),children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(e.Check,{className:e.cn("size-4",s===d.id?"opacity-100":"opacity-0")}),a.jsx("div",{title:d.name,children:d.name})]})},d.id))})]})]})})]})}exports.CALCULATED_FIELD_ENTITY_MARKER=e.CALCULATED_FIELD_ENTITY_MARKER;exports.DATE_FORMAT_VALUES=e.DATE_FORMAT_VALUES;exports.Dashboard=e.Dashboard;exports.DashboardWC=e.DashboardWC;exports.PivotMarkerEnum=e.PivotMarkerEnum;exports.ResourceType=e.ResourceType;exports.SemaphorContextProvider=e.SemaphorContextProvider;exports.SemaphorDataProvider=e.SemaphorQueryClient;exports.SemaphorQueryClient=e.SemaphorQueryClient;exports.ShareDialog=e.ShareDialog;exports.Surfboard=e.DashboardPlus;exports.cloneDeep=e.cloneDeep;exports.createEmptyKpiConfig=e.createEmptyKpiConfig;exports.createSqlGenConfig=e.createSqlGenConfig;exports.downloadPdf=e.downloadPdf;exports.emitDashboardLoad=e.emitDashboardLoad;exports.emitDashboardUnload=e.emitDashboardUnload;exports.fmt=e.fmt;exports.getColumnDataType=e.getColumnDataType;exports.getFilterValueType=e.getFilterValueType;exports.getFormattedTableNameForQuery=e.getFormattedTableNameForQuery;exports.getQualifiedTableName=e.getQualifiedTableName;exports.getSql=e.getSql;exports.invalidateToken=e.invalidateToken;exports.isBooleanDataType=e.isBooleanDataType;exports.isCalculatedDimension=e.isCalculatedDimension;exports.isCalculatedField=e.isCalculatedField;exports.isCalculatedMetric=e.isCalculatedMetric;exports.isColumnInSqlGen=e.isColumnInSqlGen;exports.isDateDataType=e.isDateDataType;exports.isNumberDataType=e.isNumberDataType;exports.isTextDataType=e.isTextDataType;exports.resolveDataType=e.resolveDataType;exports.resolveDatamodelName=e.resolveDatamodelName;exports.useCard=e.useCard;exports.useCurrentActiveCard=e.useCurrentActiveCard;exports.useCurrentCardConfig=e.useCurrentCardConfig;exports.useCurrentSheetActiveCards=e.useCurrentSheetActiveCards;exports.useDashboardActions=e.useDashboardActions;exports.useDashboardById=e.useDashboardById;exports.useDashboardQuery=e.useDashboardQuery;exports.useDashboardStore=e.useDashboardStore;exports.useDataColumns=e.useDataColumns;exports.useDateFilterHook=e.useDateFilterHook;exports.useEditorActions=e.useEditorActions;exports.useEditorAside=e.useEditorAside;exports.useEditorStore=e.useEditorStore;exports.useManagementStore=e.useManagementStore;exports.useResourceManagement=e.useResourceManagement;exports.useTextFilterHook=e.useTextFilterHook;exports.EMPTY_SELECTION=E.EMPTY_SELECTION;exports.ResourceManagementPanel=j.ResourceManagementPanel;exports.AdvancedModeToggle=c.AdvancedModeToggle;exports.DashboardExportDialog=c.DashboardExportDialog;exports.ScheduleDashboard=c.ScheduleDashboard;exports.UnsavedChangesAlert=c.UnsavedChangesAlert;exports.VisualEditingControls=c.VisualEditingControls;exports.usePristineSnapshotInitializer=c.usePristineSnapshotInitializer;exports.Combobox=k;exports.Visual=N;
6
+ */const P=e.createLucideIcon("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);function N(r){const{displayPreferences:o,...s}=r,i={...s,id:r.dashboardId};return a.jsx(e.ErrorBoundary,{FallbackComponent:e.Fallback,children:a.jsxs(e.SemaphorContextProvider,{dashboardProps:i,children:[a.jsx(e.SemaphorReadyIndicator,{componentType:"visual",componentId:r.cardId}),a.jsx(e.UXProvider,{children:a.jsx(e.DisplayPreferencesProvider,{displayPreferences:o,children:a.jsx(e.Container,{type:"visual",...i,children:a.jsx(A,{cardId:r.cardId})})})})]})})}function A({cardId:r}){const o=e.useDashboardStore(n=>{var d;return(d=n.dashboard)==null?void 0:d.sheets}),{card:s,frame:i}=g.useMemo(()=>{const n=o==null?void 0:o.flatMap(t=>t.frames),d=n==null?void 0:n.flatMap(t=>t==null?void 0:t.cards),C=d==null?void 0:d.find(t=>(t==null?void 0:t.id)===r),f=n==null?void 0:n.find(t=>{var p;return(p=t==null?void 0:t.cards)==null?void 0:p.find(u=>(u==null?void 0:u.id)===r)});return{card:C,frame:f}},[o,r]);return!s||!i?a.jsx(e.FallbackVisual,{error:new Error("Card not found"),resetErrorBoundary:()=>{},customerFacingMessage:`Card not found with ID: ${r}`}):a.jsx("main",{className:"flex h-full grow flex-col",children:a.jsx(e.ErrorBoundary,{FallbackComponent:({error:n,resetErrorBoundary:d})=>a.jsx(e.FallbackVisual,{error:n,resetErrorBoundary:d,customerFacingMessage:"Error creating visual. Please try again."}),children:a.jsx(e.DashboardCard,{card:s,frame:i})})})}function k({name:r,items:o,value:s,onChange:i,isLoading:n,isError:d,refetch:C,className:f,icon:t,showNone:p=!1}){const u=m.useRef(null),[b,x]=m.useState(!1),[y,v]=m.useState("100%"),D=p?[...o||[],{id:"none",name:"None"}]:o;m.useLayoutEffect(()=>{u.current&&v(u.current.offsetWidth)},[]);function T(){var l;return n?"Loading...":d?"Error":s?(l=o==null?void 0:o.find(h=>h.id===s))==null?void 0:l.name:`Select ${r}`}function S(l,h){i(h),x(!1)}return a.jsxs(e.Popover,{open:b,onOpenChange:x,children:[a.jsx(e.PopoverTrigger,{asChild:!0,children:a.jsxs(e.Button,{ref:u,variant:"outline",role:"combobox","aria-expanded":b,className:e.cn("flex h-9 w-full justify-between",f),children:[a.jsxs("div",{className:"flex items-center gap-2",children:[t&&a.jsx("div",{className:"mr-2",children:t}),a.jsx("span",{className:"max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap",children:T()})]}),a.jsx(e.ChevronDown,{className:"size-4 opacity-50"})]})}),a.jsx(e.PopoverContent,{className:"w-full p-0",style:{minWidth:y},children:a.jsxs(e.Command,{children:[a.jsxs("div",{className:"flex h-9 items-center justify-between border-b pr-1",children:[a.jsx(e.CommandInput,{className:"h-9",placeholder:"Search..."}),a.jsx(e.IconButton,{className:"h-7",onClick:C,children:a.jsx(P,{className:e.cn("size-3.5 opacity-50",n&&"animate-spin")})})]}),a.jsxs(e.CommandList,{children:[a.jsxs(e.CommandEmpty,{children:["No ",r==null?void 0:r.toLowerCase()," found."]}),a.jsx(e.CommandGroup,{children:D==null?void 0:D.map(l=>a.jsx(e.CommandItem,{className:"overflow-x-auto",value:l.name,onSelect:h=>S(h,l.id),children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(e.Check,{className:e.cn("size-4",s===l.id?"opacity-100":"opacity-0")}),a.jsx("div",{title:l.name,children:l.name})]})},l.id))})]})]})})]})}exports.CALCULATED_FIELD_ENTITY_MARKER=e.CALCULATED_FIELD_ENTITY_MARKER;exports.DATE_FORMAT_VALUES=e.DATE_FORMAT_VALUES;exports.Dashboard=e.Dashboard;exports.DashboardWC=e.DashboardWC;exports.PivotMarkerEnum=e.PivotMarkerEnum;exports.ResourceType=e.ResourceType;exports.SemaphorContextProvider=e.SemaphorContextProvider;exports.SemaphorDataProvider=e.SemaphorQueryClient;exports.SemaphorQueryClient=e.SemaphorQueryClient;exports.ShareDialog=e.ShareDialog;exports.Surfboard=e.DashboardPlus;exports.cloneDeep=e.cloneDeep;exports.createEmptyKpiConfig=e.createEmptyKpiConfig;exports.createSqlGenConfig=e.createSqlGenConfig;exports.downloadPdf=e.downloadPdf;exports.emitDashboardLoad=e.emitDashboardLoad;exports.emitDashboardUnload=e.emitDashboardUnload;exports.fmt=e.fmt;exports.getColumnDataType=e.getColumnDataType;exports.getFilterValueType=e.getFilterValueType;exports.getFormattedTableNameForQuery=e.getFormattedTableNameForQuery;exports.getQualifiedTableName=e.getQualifiedTableName;exports.getSql=e.getSql;exports.invalidateToken=e.invalidateToken;exports.isBooleanDataType=e.isBooleanDataType;exports.isCalculatedDimension=e.isCalculatedDimension;exports.isCalculatedField=e.isCalculatedField;exports.isCalculatedMetric=e.isCalculatedMetric;exports.isColumnInSqlGen=e.isColumnInSqlGen;exports.isDateDataType=e.isDateDataType;exports.isNumberDataType=e.isNumberDataType;exports.isTextDataType=e.isTextDataType;exports.resolveDataType=e.resolveDataType;exports.resolveDatamodelName=e.resolveDatamodelName;exports.useCard=e.useCard;exports.useCurrentActiveCard=e.useCurrentActiveCard;exports.useCurrentCardConfig=e.useCurrentCardConfig;exports.useCurrentSheetActiveCards=e.useCurrentSheetActiveCards;exports.useDashboardActions=e.useDashboardActions;exports.useDashboardById=e.useDashboardById;exports.useDashboardQuery=e.useDashboardQuery;exports.useDashboardStore=e.useDashboardStore;exports.useDataColumns=e.useDataColumns;exports.useDateFilterHook=e.useDateFilterHook;exports.useEditorActions=e.useEditorActions;exports.useEditorAside=e.useEditorAside;exports.useEditorStore=e.useEditorStore;exports.useManagementStore=e.useManagementStore;exports.useResourceManagement=e.useResourceManagement;exports.useTextFilterHook=e.useTextFilterHook;exports.EMPTY_SELECTION=E.EMPTY_SELECTION;exports.ResourceManagementPanel=j.ResourceManagementPanel;exports.AdvancedModeToggle=c.AdvancedModeToggle;exports.DashboardExportDialog=c.DashboardExportDialog;exports.ScheduleDashboard=c.ScheduleDashboard;exports.UnsavedChangesAlert=c.UnsavedChangesAlert;exports.VisualEditingControls=c.VisualEditingControls;exports.usePristineSnapshotInitializer=c.usePristineSnapshotInitializer;exports.Combobox=k;exports.Visual=N;
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-BZpXKhl2.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-BZpXKhl2.js";
3
- import { EMPTY_SELECTION as Za } from "./types/index.js";
4
- import { jsx as a, jsxs as d } from "react/jsx-runtime";
1
+ import { l as N, E as g, F as w, S as M, v as P, U as k, w as A, x as I, u as R, y as b, z as F, P as L, A as V, B as _, c as v, G as B, H as U, I as W, J as j, K as q, M as z, N as O, O as Q, Q as G, C as H } from "./chunks/index-5dE6RqWv.js";
2
+ import { a9 as na, aa as ta, D as ia, a2 as da, ae as la, V as ca, Z as ua, Z as ha, _ as pa, a as ma, a5 as fa, ax as Ca, al as va, a7 as ya, a3 as Da, a4 as ba, af as ga, an as xa, am as Ea, aq as Sa, ar as Ta, ak as Na, a6 as wa, aj as Ma, ac as Pa, ad as ka, ab as Aa, ao as Ia, ai as Ra, ah as Fa, ag as La, as as Va, ap as _a, a1 as Ba, au as Ua, aw as Wa, av as ja, o as qa, a0 as za, T as Oa, a8 as Qa, W as Ga, m as Ha, at as Ka, n as Ya, R as $a, $ as Za, Y as Ja } from "./chunks/index-5dE6RqWv.js";
3
+ import { EMPTY_SELECTION as ae } from "./types/index.js";
4
+ import { jsx as a, jsxs as i } from "react/jsx-runtime";
5
5
  import * as p from "react";
6
- import { useMemo as H } from "react";
7
- import { ResourceManagementPanel as ee } from "./chunks/resource-management-panel-CG1NjRIJ.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-h5owxj4H.js";
6
+ import { useMemo as K } from "react";
7
+ import { ResourceManagementPanel as se } from "./chunks/resource-management-panel-CjWRsuif.js";
8
+ import { A as re, D as ne, S as te, U as ie, V as de, u as le } from "./chunks/dashboard-export-dialog-CEVJnrSj.js";
9
9
  import "react-dom";
10
10
  /**
11
11
  * @license lucide-react v0.453.0 - ISC
@@ -13,35 +13,38 @@ import "react-dom";
13
13
  * This source code is licensed under the ISC license.
14
14
  * See the LICENSE file in the root directory of this source tree.
15
15
  */
16
- const Y = T("RefreshCw", [
16
+ const Y = N("RefreshCw", [
17
17
  ["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
18
18
  ["path", { d: "M21 3v5h-5", key: "1q7to0" }],
19
19
  ["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
20
20
  ["path", { d: "M8 16H3v5", key: "1cv678" }]
21
21
  ]);
22
- function aa(s) {
23
- const { displayPreferences: o, ...i } = s, l = {
24
- ...i,
22
+ function ea(s) {
23
+ const { displayPreferences: r, ...d } = s, l = {
24
+ ...d,
25
25
  id: s.dashboardId
26
26
  // override the id to the dashboard id so that the dashboard is not loaded
27
27
  };
28
- return /* @__PURE__ */ a(g, { FallbackComponent: w, children: /* @__PURE__ */ a(M, { dashboardProps: l, children: /* @__PURE__ */ a(P, { children: /* @__PURE__ */ a(k, { displayPreferences: o, children: /* @__PURE__ */ a(A, { type: "visual", ...l, children: /* @__PURE__ */ a(K, { cardId: s.cardId }) }) }) }) }) });
28
+ return /* @__PURE__ */ a(g, { FallbackComponent: w, children: /* @__PURE__ */ i(M, { dashboardProps: l, children: [
29
+ /* @__PURE__ */ a(P, { componentType: "visual", componentId: s.cardId }),
30
+ /* @__PURE__ */ a(k, { children: /* @__PURE__ */ a(A, { displayPreferences: r, children: /* @__PURE__ */ a(I, { type: "visual", ...l, children: /* @__PURE__ */ a($, { cardId: s.cardId }) }) }) })
31
+ ] }) });
29
32
  }
30
- function K({ cardId: s }) {
31
- const o = F((r) => {
33
+ function $({ cardId: s }) {
34
+ const r = R((o) => {
32
35
  var n;
33
- return (n = r.dashboard) == null ? void 0 : n.sheets;
34
- }), { card: i, frame: l } = H(() => {
35
- const r = o == null ? void 0 : o.flatMap((e) => e.frames), n = r == null ? void 0 : r.flatMap((e) => e == null ? void 0 : e.cards), m = n == null ? void 0 : n.find((e) => (e == null ? void 0 : e.id) === s), f = r == null ? void 0 : r.find(
36
+ return (n = o.dashboard) == null ? void 0 : n.sheets;
37
+ }), { card: d, frame: l } = K(() => {
38
+ const o = r == null ? void 0 : r.flatMap((e) => e.frames), n = o == null ? void 0 : o.flatMap((e) => e == null ? void 0 : e.cards), m = n == null ? void 0 : n.find((e) => (e == null ? void 0 : e.id) === s), f = o == null ? void 0 : o.find(
36
39
  (e) => {
37
40
  var h;
38
41
  return (h = e == null ? void 0 : e.cards) == null ? void 0 : h.find((c) => (c == null ? void 0 : c.id) === s);
39
42
  }
40
43
  );
41
44
  return { card: m, frame: f };
42
- }, [o, s]);
43
- return !i || !l ? /* @__PURE__ */ a(
44
- y,
45
+ }, [r, s]);
46
+ return !d || !l ? /* @__PURE__ */ a(
47
+ b,
45
48
  {
46
49
  error: new Error("Card not found"),
47
50
  resetErrorBoundary: () => {
@@ -52,98 +55,98 @@ function K({ cardId: s }) {
52
55
  g,
53
56
  {
54
57
  FallbackComponent: ({
55
- error: r,
58
+ error: o,
56
59
  resetErrorBoundary: n
57
60
  }) => /* @__PURE__ */ a(
58
- y,
61
+ b,
59
62
  {
60
- error: r,
63
+ error: o,
61
64
  resetErrorBoundary: n,
62
65
  customerFacingMessage: "Error creating visual. Please try again."
63
66
  }
64
67
  ),
65
- children: /* @__PURE__ */ a(L, { card: i, frame: l })
68
+ children: /* @__PURE__ */ a(F, { card: d, frame: l })
66
69
  }
67
70
  ) });
68
71
  }
69
- function ea({
72
+ function sa({
70
73
  name: s,
71
- items: o,
72
- value: i,
74
+ items: r,
75
+ value: d,
73
76
  onChange: l,
74
- isLoading: r,
77
+ isLoading: o,
75
78
  isError: n,
76
79
  refetch: m,
77
80
  className: f,
78
81
  icon: e,
79
82
  showNone: h = !1
80
83
  }) {
81
- const c = p.useRef(null), [D, b] = p.useState(!1), [x, E] = p.useState("100%"), C = h ? [...o || [], { id: "none", name: "None" }] : o;
84
+ const c = p.useRef(null), [y, D] = p.useState(!1), [x, E] = p.useState("100%"), C = h ? [...r || [], { id: "none", name: "None" }] : r;
82
85
  p.useLayoutEffect(() => {
83
86
  c.current && E(c.current.offsetWidth);
84
87
  }, []);
85
- function N() {
88
+ function S() {
86
89
  var t;
87
- return r ? "Loading..." : n ? "Error" : i ? (t = o == null ? void 0 : o.find((u) => u.id === i)) == null ? void 0 : t.name : `Select ${s}`;
90
+ return o ? "Loading..." : n ? "Error" : d ? (t = r == null ? void 0 : r.find((u) => u.id === d)) == null ? void 0 : t.name : `Select ${s}`;
88
91
  }
89
- function S(t, u) {
90
- l(u), b(!1);
92
+ function T(t, u) {
93
+ l(u), D(!1);
91
94
  }
92
- return /* @__PURE__ */ d(R, { open: D, onOpenChange: b, children: [
93
- /* @__PURE__ */ a(I, { asChild: !0, children: /* @__PURE__ */ d(
94
- V,
95
+ return /* @__PURE__ */ i(L, { open: y, onOpenChange: D, children: [
96
+ /* @__PURE__ */ a(V, { asChild: !0, children: /* @__PURE__ */ i(
97
+ _,
95
98
  {
96
99
  ref: c,
97
100
  variant: "outline",
98
101
  role: "combobox",
99
- "aria-expanded": D,
102
+ "aria-expanded": y,
100
103
  className: v("flex h-9 w-full justify-between", f),
101
104
  children: [
102
- /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
105
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
103
106
  e && /* @__PURE__ */ a("div", { className: "mr-2", children: e }),
104
- /* @__PURE__ */ a("span", { className: "max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap", children: N() })
107
+ /* @__PURE__ */ a("span", { className: "max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap", children: S() })
105
108
  ] }),
106
- /* @__PURE__ */ a(_, { className: "size-4 opacity-50" })
109
+ /* @__PURE__ */ a(B, { className: "size-4 opacity-50" })
107
110
  ]
108
111
  }
109
112
  ) }),
110
113
  /* @__PURE__ */ a(
111
- B,
114
+ U,
112
115
  {
113
116
  className: "w-full p-0",
114
117
  style: { minWidth: x },
115
- children: /* @__PURE__ */ d(U, { children: [
116
- /* @__PURE__ */ d("div", { className: "flex h-9 items-center justify-between border-b pr-1", children: [
117
- /* @__PURE__ */ a(W, { className: "h-9", placeholder: "Search..." }),
118
- /* @__PURE__ */ a(j, { className: "h-7", onClick: m, children: /* @__PURE__ */ a(
118
+ children: /* @__PURE__ */ i(W, { children: [
119
+ /* @__PURE__ */ i("div", { className: "flex h-9 items-center justify-between border-b pr-1", children: [
120
+ /* @__PURE__ */ a(j, { className: "h-9", placeholder: "Search..." }),
121
+ /* @__PURE__ */ a(q, { className: "h-7", onClick: m, children: /* @__PURE__ */ a(
119
122
  Y,
120
123
  {
121
124
  className: v(
122
125
  "size-3.5 opacity-50",
123
- r && "animate-spin"
126
+ o && "animate-spin"
124
127
  )
125
128
  }
126
129
  ) })
127
130
  ] }),
128
- /* @__PURE__ */ d(q, { children: [
129
- /* @__PURE__ */ d(z, { children: [
131
+ /* @__PURE__ */ i(z, { children: [
132
+ /* @__PURE__ */ i(O, { children: [
130
133
  "No ",
131
134
  s == null ? void 0 : s.toLowerCase(),
132
135
  " found."
133
136
  ] }),
134
- /* @__PURE__ */ a(O, { children: C == null ? void 0 : C.map((t) => /* @__PURE__ */ a(
135
- Q,
137
+ /* @__PURE__ */ a(Q, { children: C == null ? void 0 : C.map((t) => /* @__PURE__ */ a(
138
+ G,
136
139
  {
137
140
  className: "overflow-x-auto",
138
141
  value: t.name,
139
- onSelect: (u) => S(u, t.id),
140
- children: /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
142
+ onSelect: (u) => T(u, t.id),
143
+ children: /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
141
144
  /* @__PURE__ */ a(
142
- G,
145
+ H,
143
146
  {
144
147
  className: v(
145
148
  "size-4",
146
- i === t.id ? "opacity-100" : "opacity-0"
149
+ d === t.id ? "opacity-100" : "opacity-0"
147
150
  )
148
151
  }
149
152
  ),
@@ -160,63 +163,63 @@ function ea({
160
163
  }
161
164
  export {
162
165
  re as AdvancedModeToggle,
163
- oa as CALCULATED_FIELD_ENTITY_MARKER,
164
- ea as Combobox,
165
- na as DATE_FORMAT_VALUES,
166
- ta as Dashboard,
167
- oe as DashboardExportDialog,
168
- ia as DashboardWC,
169
- Za as EMPTY_SELECTION,
170
- da as PivotMarkerEnum,
171
- ee as ResourceManagementPanel,
172
- la as ResourceType,
173
- ne as ScheduleDashboard,
166
+ na as CALCULATED_FIELD_ENTITY_MARKER,
167
+ sa as Combobox,
168
+ ta as DATE_FORMAT_VALUES,
169
+ ia as Dashboard,
170
+ ne as DashboardExportDialog,
171
+ da as DashboardWC,
172
+ ae as EMPTY_SELECTION,
173
+ la as PivotMarkerEnum,
174
+ se as ResourceManagementPanel,
175
+ ca as ResourceType,
176
+ te as ScheduleDashboard,
174
177
  M as SemaphorContextProvider,
175
- ca as SemaphorDataProvider,
176
- ua as SemaphorQueryClient,
177
- ha as ShareDialog,
178
- pa as Surfboard,
179
- te as UnsavedChangesAlert,
180
- aa as Visual,
181
- ie as VisualEditingControls,
182
- ma as cloneDeep,
183
- fa as createEmptyKpiConfig,
184
- Ca as createSqlGenConfig,
185
- va as downloadPdf,
178
+ ua as SemaphorDataProvider,
179
+ ha as SemaphorQueryClient,
180
+ pa as ShareDialog,
181
+ ma as Surfboard,
182
+ ie as UnsavedChangesAlert,
183
+ ea as Visual,
184
+ de as VisualEditingControls,
185
+ fa as cloneDeep,
186
+ Ca as createEmptyKpiConfig,
187
+ va as createSqlGenConfig,
188
+ ya as downloadPdf,
186
189
  Da as emitDashboardLoad,
187
190
  ba as emitDashboardUnload,
188
- ya as fmt,
189
- ga as getColumnDataType,
190
- xa as getFilterValueType,
191
- Ea as getFormattedTableNameForQuery,
192
- Na as getQualifiedTableName,
193
- Sa as getSql,
194
- Ta as invalidateToken,
195
- wa as isBooleanDataType,
196
- Ma as isCalculatedDimension,
197
- Pa as isCalculatedField,
198
- ka as isCalculatedMetric,
199
- Aa as isColumnInSqlGen,
200
- Fa as isDateDataType,
201
- La as isNumberDataType,
202
- Ra as isTextDataType,
203
- Ia as resolveDataType,
204
- Va as resolveDatamodelName,
205
- _a as useCard,
206
- Ba as useCurrentActiveCard,
207
- Ua as useCurrentCardConfig,
208
- Wa as useCurrentSheetActiveCards,
209
- ja as useDashboardActions,
210
- qa as useDashboardById,
211
- za as useDashboardQuery,
212
- F as useDashboardStore,
213
- Oa as useDataColumns,
214
- Qa as useDateFilterHook,
215
- Ga as useEditorActions,
216
- Ha as useEditorAside,
191
+ ga as fmt,
192
+ xa as getColumnDataType,
193
+ Ea as getFilterValueType,
194
+ Sa as getFormattedTableNameForQuery,
195
+ Ta as getQualifiedTableName,
196
+ Na as getSql,
197
+ wa as invalidateToken,
198
+ Ma as isBooleanDataType,
199
+ Pa as isCalculatedDimension,
200
+ ka as isCalculatedField,
201
+ Aa as isCalculatedMetric,
202
+ Ia as isColumnInSqlGen,
203
+ Ra as isDateDataType,
204
+ Fa as isNumberDataType,
205
+ La as isTextDataType,
206
+ Va as resolveDataType,
207
+ _a as resolveDatamodelName,
208
+ Ba as useCard,
209
+ Ua as useCurrentActiveCard,
210
+ Wa as useCurrentCardConfig,
211
+ ja as useCurrentSheetActiveCards,
212
+ qa as useDashboardActions,
213
+ za as useDashboardById,
214
+ Oa as useDashboardQuery,
215
+ R as useDashboardStore,
216
+ Qa as useDataColumns,
217
+ Ga as useDateFilterHook,
218
+ Ha as useEditorActions,
219
+ Ka as useEditorAside,
217
220
  Ya as useEditorStore,
218
- Ka as useManagementStore,
219
- de as usePristineSnapshotInitializer,
220
- $a as useResourceManagement,
221
+ $a as useManagementStore,
222
+ le as usePristineSnapshotInitializer,
223
+ Za as useResourceManagement,
221
224
  Ja as useTextFilterHook
222
225
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-CM3-W6qg.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-odiH0LJA.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-BZpXKhl2.js";
1
+ import { a } from "../chunks/index-5dE6RqWv.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.163",
8
+ "version": "0.1.165",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",