react-semaphor 0.1.169 → 0.1.171
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.
- package/dist/chunks/{dashboard-controls-CrID4nR7.js → dashboard-controls-CNgQS9BW.js} +1 -1
- package/dist/chunks/{dashboard-controls-BsUYcBI9.js → dashboard-controls-D7m3nKlW.js} +4 -4
- package/dist/chunks/{dashboard-json-B_uiuxzz.js → dashboard-json-CAhDGDMM.js} +1 -1
- package/dist/chunks/{dashboard-json-BoCnlkG-.js → dashboard-json-CdEXvNr2.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-CDlZJO6q.js → edit-dashboard-visual-Cdey2oP9.js} +2 -2
- package/dist/chunks/{edit-dashboard-visual-BZUVep2z.js → edit-dashboard-visual-DF-Rdpsd.js} +1 -1
- package/dist/chunks/{editor-action-buttons-BklKJZw6.js → editor-action-buttons-5J30zd2y.js} +2 -2
- package/dist/chunks/{editor-action-buttons-LavnGyBC.js → editor-action-buttons-Cq6JNj3l.js} +1 -1
- package/dist/chunks/{index-CQd8PU_U.js → index-D89Vy_ym.js} +112 -112
- package/dist/chunks/{index-CENrCRrz.js → index-DDMCK82d.js} +7134 -7119
- package/dist/chunks/{resource-management-panel-uNiuIJOI.js → resource-management-panel-CUUY8a9N.js} +3 -3
- package/dist/chunks/{resource-management-panel-eqSYDHyG.js → resource-management-panel-CwZQ52ME.js} +1 -1
- package/dist/chunks/{schedule-dashboard-Cc07Vqvn.js → schedule-dashboard-26c3ZrMF.js} +1 -1
- package/dist/chunks/{schedule-dashboard-CB6iJnpE.js → schedule-dashboard-dUIVld1r.js} +3 -3
- package/dist/chunks/{use-role-aware-display-preferences-CuzTSsbg.js → use-role-aware-display-preferences-DkIbMMSm.js} +1 -1
- package/dist/chunks/{use-role-aware-display-preferences-CEGdeLQ0.js → use-role-aware-display-preferences-bZFO0mzD.js} +1 -1
- package/dist/chunks/{use-visual-utils-BrhNFq24.js → use-visual-utils-CB_Q8ALy.js} +1 -1
- package/dist/chunks/{use-visual-utils-BICcUVjF.js → use-visual-utils-D-4J8caE.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +113 -105
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/main.d.ts +28 -1
- package/package.json +1 -1
package/dist/chunks/{resource-management-panel-uNiuIJOI.js → resource-management-panel-CUUY8a9N.js}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as e, jsxs as a, Fragment as ge } from "react/jsx-runtime";
|
|
2
|
-
import { l as $e, u as me, n as Qe, aB as re, b9 as Xe, ba as Ze, c as X, bb as ke, aS as et, aT as tt, B as _, aU as st, aV as at, aW as W, bc as pe, L as oe, bd as nt, be as it, bf as rt, bg as ve, bh as De, bi as ot, bj as lt, K as dt, bk as ye, e as le, bl as Se, bm as Ve, bn as ct, _ as Ee, V as Le, bo as Ae, a_ as Te, a$ as Oe, b0 as Re, b2 as Pe, b3 as Ue, b4 as Ie, b5 as je, b6 as Me, bp as ut, bq as ht, br as Fe, bs as Be, bt as ze, bu as mt, bv as He, bw as pt, R as ne, aA as ft, bx as _e, by as gt, bz as Dt, aF as xt, aG as Nt, aH as bt, aI as wt, aJ as vt, aK as Ce, aL as fe, aO as Ct, bA as yt, bB as St, bC as Vt, bD as Et } from "./index-
|
|
2
|
+
import { l as $e, u as me, n as Qe, aB as re, b9 as Xe, ba as Ze, c as X, bb as ke, aS as et, aT as tt, B as _, aU as st, aV as at, aW as W, bc as pe, L as oe, bd as nt, be as it, bf as rt, bg as ve, bh as De, bi as ot, bj as lt, K as dt, bk as ye, e as le, bl as Se, bm as Ve, bn as ct, _ as Ee, V as Le, bo as Ae, a_ as Te, a$ as Oe, b0 as Re, b2 as Pe, b3 as Ue, b4 as Ie, b5 as je, b6 as Me, bp as ut, bq as ht, br as Fe, bs as Be, bt as ze, bu as mt, bv as He, bw as pt, R as ne, aA as ft, bx as _e, by as gt, bz as Dt, aF as xt, aG as Nt, aH as bt, aI as wt, aJ as vt, aK as Ce, aL as fe, aO as Ct, bA as yt, bB as St, bC as Vt, bD as Et } from "./index-DDMCK82d.js";
|
|
3
3
|
import Lt, { useRef as At, useEffect as ie, useState as x } from "react";
|
|
4
|
-
import { a as Ke } from "./use-visual-utils-
|
|
5
|
-
import { u as Tt } from "./use-role-aware-display-preferences-
|
|
4
|
+
import { a as Ke } from "./use-visual-utils-D-4J8caE.js";
|
|
5
|
+
import { u as Tt } from "./use-role-aware-display-preferences-DkIbMMSm.js";
|
|
6
6
|
/**
|
|
7
7
|
* @license lucide-react v0.453.0 - ISC
|
|
8
8
|
*
|
package/dist/chunks/{resource-management-panel-eqSYDHyG.js → resource-management-panel-CwZQ52ME.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./index-D89Vy_ym.js"),c=require("react"),de=require("./use-visual-utils-CB_Q8ALy.js"),pe=require("./use-role-aware-display-preferences-bZFO0mzD.js");/**
|
|
2
2
|
* @license lucide-react v0.453.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const s=require("react/jsx-runtime"),e=require("./index-
|
|
1
|
+
"use strict";const s=require("react/jsx-runtime"),e=require("./index-D89Vy_ym.js"),C=require("./editor-action-buttons-Cq6JNj3l.js"),x=require("react"),y=require("./use-visual-utils-CB_Q8ALy.js");/**
|
|
2
2
|
* @license lucide-react v0.453.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as e, jsxs as a, Fragment as F } from "react/jsx-runtime";
|
|
2
|
-
import { l as _, aF as $, aG as q, aH as K, aI as X, aJ as Y, aK as T, aL as G, aM as J, aN as E, aO as Q, B as I, L as H, n as k, q as Z, u as g, aB as ee, o as R, aP as ae, aQ as O, t as y, R as se, aR as te, c as w, aS as B, aT as P, aU as L, aV as U, aW as z, m as de, aX as le, aY as ne, aZ as re, a_ as oe, a$ as ie, b0 as ce, b1 as he, b2 as ue, b3 as me, b4 as ve, b5 as pe, b6 as be, a5 as fe, K as ge, b7 as Ce, b8 as De } from "./index-
|
|
3
|
-
import { E as xe, V as Ae, a as Se, b as Ne, S as j, c as ye } from "./editor-action-buttons-
|
|
2
|
+
import { l as _, aF as $, aG as q, aH as K, aI as X, aJ as Y, aK as T, aL as G, aM as J, aN as E, aO as Q, B as I, L as H, n as k, q as Z, u as g, aB as ee, o as R, aP as ae, aQ as O, t as y, R as se, aR as te, c as w, aS as B, aT as P, aU as L, aV as U, aW as z, m as de, aX as le, aY as ne, aZ as re, a_ as oe, a$ as ie, b0 as ce, b1 as he, b2 as ue, b3 as me, b4 as ve, b5 as pe, b6 as be, a5 as fe, K as ge, b7 as Ce, b8 as De } from "./index-DDMCK82d.js";
|
|
3
|
+
import { E as xe, V as Ae, a as Se, b as Ne, S as j, c as ye } from "./editor-action-buttons-5J30zd2y.js";
|
|
4
4
|
import we, { useState as D, useContext as Ie, useEffect as ke } from "react";
|
|
5
|
-
import { a as W } from "./use-visual-utils-
|
|
5
|
+
import { a as W } from "./use-visual-utils-D-4J8caE.js";
|
|
6
6
|
/**
|
|
7
7
|
* @license lucide-react v0.453.0 - ISC
|
|
8
8
|
*
|
|
@@ -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-
|
|
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-DDMCK82d.js";
|
|
2
2
|
import { useMemo as i } from "react";
|
|
3
3
|
function S() {
|
|
4
4
|
const { displayPreferences: n, shouldShowElement: c } = m(), { currentUser: a, userContext: s } = t(), r = i(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const a=require("./index-
|
|
1
|
+
"use strict";const a=require("./index-D89Vy_ym.js"),n=require("react");function f(){const{displayPreferences:c,shouldShowElement:o}=a.useDisplayPreferences(),{currentUser:e,userContext:s}=a.useCurrentUserInfo(),i=n.useMemo(()=>a.getRoleBasedDisplayOverrides(e),[e]),t=n.useMemo(()=>r=>i&&i[r]!==void 0&&i[r]===!1?!1:o(r),[i,o,c]),p=n.useMemo(()=>{var r,d,l,u,h;return{canEdit:((r=s==null?void 0:s.permissions)==null?void 0:r.canEdit)??a.canUserEdit(e),canUseFilters:((d=s==null?void 0:s.permissions)==null?void 0:d.canEdit)??a.canUserUseFilters(e),canManageDashboards:((l=s==null?void 0:s.permissions)==null?void 0:l.canCreateDashboard)??a.canUserManageDashboards(e),canCreateDashboards:((u=s==null?void 0:s.permissions)==null?void 0:u.canCreateDashboard)??a.canUserCreateDashboards(e),canAccessVisuals:((h=s==null?void 0:s.permissions)==null?void 0:h.canEdit)??a.canUserAccessVisuals(e)}},[e,s]);return{displayPreferences:c,shouldShowElement:t,permissions:p,currentUser:e}}exports.useRoleAwareDisplayPreferences=f;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const o=require("./index-
|
|
1
|
+
"use strict";const o=require("./index-D89Vy_ym.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 { az as z, aA as G, p as Y, q as J, aB as K, m as _, o as X, u as U, aC as Z, aD as q, t as v, aE as ee, n as h } from "./index-
|
|
1
|
+
import { az as z, aA as G, p as Y, q as J, aB as K, m as _, o as X, u as U, aC as Z, aD as q, t as v, aE as ee, n as h } from "./index-DDMCK82d.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");
|
package/dist/dashboard/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-D89Vy_ym.js"),r=require("../types/index.cjs");exports.Dashboard=e.Dashboard;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;
|
package/dist/dashboard/index.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-D89Vy_ym.js"),v=require("./types/index.cjs"),a=require("react/jsx-runtime"),b=require("react"),j=require("./chunks/resource-management-panel-CwZQ52ME.js"),h=require("./chunks/schedule-dashboard-26c3ZrMF.js");require("react-dom");function P(r){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const s in r)if(s!=="default"){const i=Object.getOwnPropertyDescriptor(r,s);Object.defineProperty(o,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}return o.default=r,Object.freeze(o)}const m=P(b);/**
|
|
2
2
|
* @license lucide-react v0.453.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const
|
|
6
|
+
*/const M=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 _(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 l;return(l=n.dashboard)==null?void 0:l.sheets}),{card:s,frame:i}=b.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 N({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),[x,g]=m.useState(!1),[y,T]=m.useState("100%"),D=p?[...o||[],{id:"none",name:"None"}]:o;m.useLayoutEffect(()=>{u.current&&T(u.current.offsetWidth)},[]);function E(){var d;return n?"Loading...":l?"Error":s?(d=o==null?void 0:o.find(c=>c.id===s))==null?void 0:d.name:`Select ${r}`}function S(d,c){i(c),g(!1)}return a.jsxs(e.Popover,{open:x,onOpenChange:g,children:[a.jsx(e.PopoverTrigger,{asChild:!0,children:a.jsxs(e.Button,{ref:u,variant:"outline",role:"combobox","aria-expanded":x,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:E()})]}),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(M,{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:c=>S(c,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))})]})]})})]})}function w(r,o){b.useEffect(()=>(r&&o&&(window.__SEMAPHOR_PRINT_STATE__={...o}),()=>{r&&window.__SEMAPHOR_PRINT_STATE__&&delete window.__SEMAPHOR_PRINT_STATE__}),[r,o])}exports.CALCULATED_FIELD_ENTITY_MARKER=e.CALCULATED_FIELD_ENTITY_MARKER;exports.DATE_FORMAT_VALUES=e.DATE_FORMAT_VALUES;exports.Dashboard=e.Dashboard;exports.DashboardExportDialog=e.DashboardExportDialog;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=v.EMPTY_SELECTION;exports.ResourceManagementPanel=j.ResourceManagementPanel;exports.AdvancedModeToggle=h.AdvancedModeToggle;exports.ScheduleDashboard=h.ScheduleDashboard;exports.UnsavedChangesAlert=h.UnsavedChangesAlert;exports.VisualEditingControls=h.VisualEditingControls;exports.usePristineSnapshotInitializer=h.usePristineSnapshotInitializer;exports.Combobox=N;exports.Visual=_;exports.useExposePrintState=w;
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { l as
|
|
2
|
-
import { aa as
|
|
3
|
-
import { EMPTY_SELECTION as
|
|
1
|
+
import { l as w, E as T, F as N, S as _, v as P, U as M, w as A, x as I, u as R, y as D, z as k, P as F, A as L, B as V, c as v, G as O, H as B, I as H, J as U, K as W, M as j, N as q, O as z, Q, C as G } from "./chunks/index-DDMCK82d.js";
|
|
2
|
+
import { aa as ia, ab as da, D as la, a8 as ca, a2 as ua, af as ha, V as pa, Z as ma, Z as fa, _ as Ca, a as va, a5 as ya, ay as ba, am as Da, a7 as Ta, a3 as ga, a4 as Ea, ag as Sa, ao as xa, an as wa, ar as Na, as as _a, al as Pa, a6 as Ma, ak as Aa, ad as Ia, ae as Ra, ac as ka, ap as Fa, aj as La, ai as Va, ah as Oa, at as Ba, aq as Ha, a1 as Ua, av as Wa, ax as ja, aw as qa, o as za, a0 as Qa, T as Ga, a9 as Ka, W as Ya, m as $a, au as Za, n as Ja, R as Xa, $ as ae, Y as ee } from "./chunks/index-DDMCK82d.js";
|
|
3
|
+
import { EMPTY_SELECTION as oe } from "./types/index.js";
|
|
4
4
|
import { jsx as a, jsxs as i } from "react/jsx-runtime";
|
|
5
5
|
import * as p from "react";
|
|
6
|
-
import { useMemo as K } from "react";
|
|
7
|
-
import { ResourceManagementPanel as
|
|
8
|
-
import { A as
|
|
6
|
+
import { useMemo as K, useEffect as Y } from "react";
|
|
7
|
+
import { ResourceManagementPanel as ne } from "./chunks/resource-management-panel-CUUY8a9N.js";
|
|
8
|
+
import { A as ie, S as de, U as le, V as ce, u as ue } from "./chunks/schedule-dashboard-dUIVld1r.js";
|
|
9
9
|
import "react-dom";
|
|
10
10
|
/**
|
|
11
11
|
* @license lucide-react v0.453.0 - ISC
|
|
@@ -13,88 +13,88 @@ 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
|
|
16
|
+
const $ = w("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
|
|
23
|
-
const { displayPreferences:
|
|
22
|
+
function sa(e) {
|
|
23
|
+
const { displayPreferences: s, ...d } = e, l = {
|
|
24
24
|
...d,
|
|
25
|
-
id:
|
|
25
|
+
id: e.dashboardId
|
|
26
26
|
// override the id to the dashboard id so that the dashboard is not loaded
|
|
27
27
|
};
|
|
28
|
-
return /* @__PURE__ */ a(
|
|
29
|
-
/* @__PURE__ */ a(P, { componentType: "visual", componentId:
|
|
30
|
-
/* @__PURE__ */ a(
|
|
28
|
+
return /* @__PURE__ */ a(T, { FallbackComponent: N, children: /* @__PURE__ */ i(_, { dashboardProps: l, children: [
|
|
29
|
+
/* @__PURE__ */ a(P, { componentType: "visual", componentId: e.cardId }),
|
|
30
|
+
/* @__PURE__ */ a(M, { children: /* @__PURE__ */ a(A, { displayPreferences: s, children: /* @__PURE__ */ a(I, { type: "visual", ...l, children: /* @__PURE__ */ a(Z, { cardId: e.cardId }) }) }) })
|
|
31
31
|
] }) });
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
const
|
|
33
|
+
function Z({ cardId: e }) {
|
|
34
|
+
const s = R((r) => {
|
|
35
35
|
var n;
|
|
36
|
-
return (n =
|
|
36
|
+
return (n = r.dashboard) == null ? void 0 : n.sheets;
|
|
37
37
|
}), { card: d, frame: l } = K(() => {
|
|
38
|
-
const
|
|
39
|
-
(
|
|
38
|
+
const r = s == null ? void 0 : s.flatMap((o) => o.frames), n = r == null ? void 0 : r.flatMap((o) => o == null ? void 0 : o.cards), m = n == null ? void 0 : n.find((o) => (o == null ? void 0 : o.id) === e), f = r == null ? void 0 : r.find(
|
|
39
|
+
(o) => {
|
|
40
40
|
var h;
|
|
41
|
-
return (h =
|
|
41
|
+
return (h = o == null ? void 0 : o.cards) == null ? void 0 : h.find((c) => (c == null ? void 0 : c.id) === e);
|
|
42
42
|
}
|
|
43
43
|
);
|
|
44
44
|
return { card: m, frame: f };
|
|
45
|
-
}, [
|
|
45
|
+
}, [s, e]);
|
|
46
46
|
return !d || !l ? /* @__PURE__ */ a(
|
|
47
47
|
D,
|
|
48
48
|
{
|
|
49
49
|
error: new Error("Card not found"),
|
|
50
50
|
resetErrorBoundary: () => {
|
|
51
51
|
},
|
|
52
|
-
customerFacingMessage: `Card not found with ID: ${
|
|
52
|
+
customerFacingMessage: `Card not found with ID: ${e}`
|
|
53
53
|
}
|
|
54
54
|
) : /* @__PURE__ */ a("main", { className: "flex h-full grow flex-col", children: /* @__PURE__ */ a(
|
|
55
|
-
|
|
55
|
+
T,
|
|
56
56
|
{
|
|
57
57
|
FallbackComponent: ({
|
|
58
|
-
error:
|
|
58
|
+
error: r,
|
|
59
59
|
resetErrorBoundary: n
|
|
60
60
|
}) => /* @__PURE__ */ a(
|
|
61
61
|
D,
|
|
62
62
|
{
|
|
63
|
-
error:
|
|
63
|
+
error: r,
|
|
64
64
|
resetErrorBoundary: n,
|
|
65
65
|
customerFacingMessage: "Error creating visual. Please try again."
|
|
66
66
|
}
|
|
67
67
|
),
|
|
68
|
-
children: /* @__PURE__ */ a(
|
|
68
|
+
children: /* @__PURE__ */ a(k, { card: d, frame: l })
|
|
69
69
|
}
|
|
70
70
|
) });
|
|
71
71
|
}
|
|
72
|
-
function
|
|
73
|
-
name:
|
|
74
|
-
items:
|
|
72
|
+
function oa({
|
|
73
|
+
name: e,
|
|
74
|
+
items: s,
|
|
75
75
|
value: d,
|
|
76
76
|
onChange: l,
|
|
77
|
-
isLoading:
|
|
77
|
+
isLoading: r,
|
|
78
78
|
isError: n,
|
|
79
79
|
refetch: m,
|
|
80
80
|
className: f,
|
|
81
|
-
icon:
|
|
81
|
+
icon: o,
|
|
82
82
|
showNone: h = !1
|
|
83
83
|
}) {
|
|
84
|
-
const c = p.useRef(null), [y, b] = p.useState(!1), [
|
|
84
|
+
const c = p.useRef(null), [y, b] = p.useState(!1), [g, E] = p.useState("100%"), C = h ? [...s || [], { id: "none", name: "None" }] : s;
|
|
85
85
|
p.useLayoutEffect(() => {
|
|
86
86
|
c.current && E(c.current.offsetWidth);
|
|
87
87
|
}, []);
|
|
88
88
|
function S() {
|
|
89
89
|
var t;
|
|
90
|
-
return
|
|
90
|
+
return r ? "Loading..." : n ? "Error" : d ? (t = s == null ? void 0 : s.find((u) => u.id === d)) == null ? void 0 : t.name : `Select ${e}`;
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function x(t, u) {
|
|
93
93
|
l(u), b(!1);
|
|
94
94
|
}
|
|
95
|
-
return /* @__PURE__ */ i(
|
|
96
|
-
/* @__PURE__ */ a(
|
|
97
|
-
|
|
95
|
+
return /* @__PURE__ */ i(F, { open: y, onOpenChange: b, children: [
|
|
96
|
+
/* @__PURE__ */ a(L, { asChild: !0, children: /* @__PURE__ */ i(
|
|
97
|
+
V,
|
|
98
98
|
{
|
|
99
99
|
ref: c,
|
|
100
100
|
variant: "outline",
|
|
@@ -103,46 +103,46 @@ function sa({
|
|
|
103
103
|
className: v("flex h-9 w-full justify-between", f),
|
|
104
104
|
children: [
|
|
105
105
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
106
|
-
|
|
106
|
+
o && /* @__PURE__ */ a("div", { className: "mr-2", children: o }),
|
|
107
107
|
/* @__PURE__ */ a("span", { className: "max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap", children: S() })
|
|
108
108
|
] }),
|
|
109
|
-
/* @__PURE__ */ a(
|
|
109
|
+
/* @__PURE__ */ a(O, { className: "size-4 opacity-50" })
|
|
110
110
|
]
|
|
111
111
|
}
|
|
112
112
|
) }),
|
|
113
113
|
/* @__PURE__ */ a(
|
|
114
|
-
|
|
114
|
+
B,
|
|
115
115
|
{
|
|
116
116
|
className: "w-full p-0",
|
|
117
|
-
style: { minWidth:
|
|
118
|
-
children: /* @__PURE__ */ i(
|
|
117
|
+
style: { minWidth: g },
|
|
118
|
+
children: /* @__PURE__ */ i(H, { children: [
|
|
119
119
|
/* @__PURE__ */ i("div", { className: "flex h-9 items-center justify-between border-b pr-1", children: [
|
|
120
|
-
/* @__PURE__ */ a(
|
|
121
|
-
/* @__PURE__ */ a(
|
|
122
|
-
|
|
120
|
+
/* @__PURE__ */ a(U, { className: "h-9", placeholder: "Search..." }),
|
|
121
|
+
/* @__PURE__ */ a(W, { className: "h-7", onClick: m, children: /* @__PURE__ */ a(
|
|
122
|
+
$,
|
|
123
123
|
{
|
|
124
124
|
className: v(
|
|
125
125
|
"size-3.5 opacity-50",
|
|
126
|
-
|
|
126
|
+
r && "animate-spin"
|
|
127
127
|
)
|
|
128
128
|
}
|
|
129
129
|
) })
|
|
130
130
|
] }),
|
|
131
|
-
/* @__PURE__ */ i(
|
|
132
|
-
/* @__PURE__ */ i(
|
|
131
|
+
/* @__PURE__ */ i(j, { children: [
|
|
132
|
+
/* @__PURE__ */ i(q, { children: [
|
|
133
133
|
"No ",
|
|
134
|
-
|
|
134
|
+
e == null ? void 0 : e.toLowerCase(),
|
|
135
135
|
" found."
|
|
136
136
|
] }),
|
|
137
|
-
/* @__PURE__ */ a(
|
|
138
|
-
|
|
137
|
+
/* @__PURE__ */ a(z, { children: C == null ? void 0 : C.map((t) => /* @__PURE__ */ a(
|
|
138
|
+
Q,
|
|
139
139
|
{
|
|
140
140
|
className: "overflow-x-auto",
|
|
141
141
|
value: t.name,
|
|
142
|
-
onSelect: (u) =>
|
|
142
|
+
onSelect: (u) => x(u, t.id),
|
|
143
143
|
children: /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
144
144
|
/* @__PURE__ */ a(
|
|
145
|
-
|
|
145
|
+
G,
|
|
146
146
|
{
|
|
147
147
|
className: v(
|
|
148
148
|
"size-4",
|
|
@@ -161,65 +161,73 @@ function sa({
|
|
|
161
161
|
)
|
|
162
162
|
] });
|
|
163
163
|
}
|
|
164
|
+
function ra(e, s) {
|
|
165
|
+
Y(() => (e && s && (window.__SEMAPHOR_PRINT_STATE__ = {
|
|
166
|
+
...s
|
|
167
|
+
}), () => {
|
|
168
|
+
e && window.__SEMAPHOR_PRINT_STATE__ && delete window.__SEMAPHOR_PRINT_STATE__;
|
|
169
|
+
}), [e, s]);
|
|
170
|
+
}
|
|
164
171
|
export {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
172
|
+
ie as AdvancedModeToggle,
|
|
173
|
+
ia as CALCULATED_FIELD_ENTITY_MARKER,
|
|
174
|
+
oa as Combobox,
|
|
175
|
+
da as DATE_FORMAT_VALUES,
|
|
176
|
+
la as Dashboard,
|
|
177
|
+
ca as DashboardExportDialog,
|
|
178
|
+
ua as DashboardWC,
|
|
179
|
+
oe as EMPTY_SELECTION,
|
|
180
|
+
ha as PivotMarkerEnum,
|
|
181
|
+
ne as ResourceManagementPanel,
|
|
182
|
+
pa as ResourceType,
|
|
183
|
+
de as ScheduleDashboard,
|
|
184
|
+
_ as SemaphorContextProvider,
|
|
185
|
+
ma as SemaphorDataProvider,
|
|
186
|
+
fa as SemaphorQueryClient,
|
|
187
|
+
Ca as ShareDialog,
|
|
188
|
+
va as Surfboard,
|
|
189
|
+
le as UnsavedChangesAlert,
|
|
190
|
+
sa as Visual,
|
|
191
|
+
ce as VisualEditingControls,
|
|
192
|
+
ya as cloneDeep,
|
|
193
|
+
ba as createEmptyKpiConfig,
|
|
194
|
+
Da as createSqlGenConfig,
|
|
195
|
+
Ta as downloadPdf,
|
|
196
|
+
ga as emitDashboardLoad,
|
|
197
|
+
Ea as emitDashboardUnload,
|
|
198
|
+
Sa as fmt,
|
|
199
|
+
xa as getColumnDataType,
|
|
200
|
+
wa as getFilterValueType,
|
|
201
|
+
Na as getFormattedTableNameForQuery,
|
|
202
|
+
_a as getQualifiedTableName,
|
|
203
|
+
Pa as getSql,
|
|
197
204
|
Ma as invalidateToken,
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
205
|
+
Aa as isBooleanDataType,
|
|
206
|
+
Ia as isCalculatedDimension,
|
|
207
|
+
Ra as isCalculatedField,
|
|
208
|
+
ka as isCalculatedMetric,
|
|
209
|
+
Fa as isColumnInSqlGen,
|
|
210
|
+
La as isDateDataType,
|
|
211
|
+
Va as isNumberDataType,
|
|
212
|
+
Oa as isTextDataType,
|
|
213
|
+
Ba as resolveDataType,
|
|
214
|
+
Ha as resolveDatamodelName,
|
|
208
215
|
Ua as useCard,
|
|
209
216
|
Wa as useCurrentActiveCard,
|
|
210
217
|
ja as useCurrentCardConfig,
|
|
211
218
|
qa as useCurrentSheetActiveCards,
|
|
212
219
|
za as useDashboardActions,
|
|
213
|
-
|
|
214
|
-
|
|
220
|
+
Qa as useDashboardById,
|
|
221
|
+
Ga as useDashboardQuery,
|
|
215
222
|
R as useDashboardStore,
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
223
|
+
Ka as useDataColumns,
|
|
224
|
+
Ya as useDateFilterHook,
|
|
225
|
+
$a as useEditorActions,
|
|
226
|
+
Za as useEditorAside,
|
|
227
|
+
Ja as useEditorStore,
|
|
228
|
+
ra as useExposePrintState,
|
|
229
|
+
Xa as useManagementStore,
|
|
230
|
+
ue as usePristineSnapshotInitializer,
|
|
231
|
+
ae as useResourceManagement,
|
|
232
|
+
ee as useTextFilterHook
|
|
225
233
|
};
|
package/dist/surfboard/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-D89Vy_ym.js"),r=require("../types/index.cjs");exports.Surfboard=e.DashboardPlus;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;
|
package/dist/surfboard/index.js
CHANGED
package/dist/types/main.d.ts
CHANGED
|
@@ -889,7 +889,7 @@ export declare type Dialect = 'mysql' | 'postgres' | 'bigquery' | 'redshift' | '
|
|
|
889
889
|
|
|
890
890
|
export declare type DisplayDataType = 'string' | 'date' | 'number' | 'html' | 'none';
|
|
891
891
|
|
|
892
|
-
export declare function downloadPdf(apiServiceUrl: string, authToken: AuthToken | undefined, password?: string, sheetSelection?: 'current' | 'all'): Promise<void>;
|
|
892
|
+
export declare function downloadPdf(apiServiceUrl: string, authToken: AuthToken | undefined, password?: string, sheetSelection?: 'current' | 'all', expandedState?: Record<string, boolean>): Promise<void>;
|
|
893
893
|
|
|
894
894
|
declare interface DrillActions {
|
|
895
895
|
updateDrillHierarchies: (h: DrillHierarchy[]) => void;
|
|
@@ -1885,6 +1885,13 @@ export declare type Placeholders = {
|
|
|
1885
1885
|
|
|
1886
1886
|
export declare type PluginType = 'custom' | 'standard';
|
|
1887
1887
|
|
|
1888
|
+
/**
|
|
1889
|
+
* Print state structure exposed to window for Lambda/Puppeteer access.
|
|
1890
|
+
*/
|
|
1891
|
+
export declare type PrintState = {
|
|
1892
|
+
expandedState?: Record<string, boolean>;
|
|
1893
|
+
};
|
|
1894
|
+
|
|
1888
1895
|
export declare type QueryColumn = GroupByColumn | MetricColumn | FilterByColumn;
|
|
1889
1896
|
|
|
1890
1897
|
export declare interface QueryConfig {
|
|
@@ -3188,6 +3195,26 @@ export declare const useEditorStore: UseBoundStore<Omit<StoreApi<EditorStore>, "
|
|
|
3188
3195
|
setState(nextStateOrUpdater: EditorStore | Partial<EditorStore> | ((state: WritableDraft<EditorStore>) => void), shouldReplace?: boolean | undefined): void;
|
|
3189
3196
|
}>;
|
|
3190
3197
|
|
|
3198
|
+
/**
|
|
3199
|
+
* Hook that exposes print state to the window object for Lambda/Puppeteer to access.
|
|
3200
|
+
*
|
|
3201
|
+
* Used by visual-view.tsx and view-container.tsx during PDF rendering to make
|
|
3202
|
+
* the captured expanded state available to the PDF generator.
|
|
3203
|
+
*
|
|
3204
|
+
* @param isPdfRender - Whether the current render is for PDF generation
|
|
3205
|
+
* @param printState - The print state to expose (expandedState, etc.)
|
|
3206
|
+
*
|
|
3207
|
+
* @example
|
|
3208
|
+
* // In visual-view.tsx or view-container.tsx:
|
|
3209
|
+
* const expandedState = useMemo(() => {
|
|
3210
|
+
* const param = searchParams.get('expandedState');
|
|
3211
|
+
* return param ? JSON.parse(param) : null;
|
|
3212
|
+
* }, [searchParams]);
|
|
3213
|
+
*
|
|
3214
|
+
* useExposePrintState(isPdfRender, expandedState ? { expandedState } : null);
|
|
3215
|
+
*/
|
|
3216
|
+
export declare function useExposePrintState(isPdfRender: boolean, printState: PrintState | null): void;
|
|
3217
|
+
|
|
3191
3218
|
export declare const useManagementStore: UseBoundStore<Omit<StoreApi<ManagementStore>, "setState"> & {
|
|
3192
3219
|
setState(nextStateOrUpdater: ManagementStore | Partial<ManagementStore> | ((state: WritableDraft<ManagementStore>) => void), shouldReplace?: boolean | undefined): void;
|
|
3193
3220
|
}>;
|