react-semaphor 0.1.216 → 0.1.218

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 (36) hide show
  1. package/dist/chunks/dashboard-controls-BZWOl4R6.js +47 -0
  2. package/dist/chunks/{dashboard-controls-CE14Z5GT.js → dashboard-controls-DxNoSlYn.js} +546 -469
  3. package/dist/chunks/{dashboard-json-BlcehrzA.js → dashboard-json-B0njIZHe.js} +1 -1
  4. package/dist/chunks/{dashboard-json-CB-PjFQp.js → dashboard-json-M_m0zesx.js} +5 -5
  5. package/dist/chunks/{dashboard-summary-settings-dialog-95pmx2I6.js → dashboard-summary-settings-dialog-CQza-Ibd.js} +1 -1
  6. package/dist/chunks/{dashboard-summary-settings-dialog-ZzGDw_NF.js → dashboard-summary-settings-dialog-DaSFFTUT.js} +1 -1
  7. package/dist/chunks/{edit-dashboard-visual-BCzL8qte.js → edit-dashboard-visual-DzdO1s6y.js} +6590 -6452
  8. package/dist/chunks/edit-dashboard-visual-YPKCrTJ1.js +164 -0
  9. package/dist/chunks/{editor-action-buttons-BkCIjblw.js → editor-action-buttons-BS_2AerZ.js} +1 -1
  10. package/dist/chunks/{editor-action-buttons-CL_G2bSD.js → editor-action-buttons-mOGsJvfw.js} +2 -2
  11. package/dist/chunks/index-CYvDw51J.js +1098 -0
  12. package/dist/chunks/{index-C0uTSIns.js → index-Cxh23oCu.js} +28590 -29139
  13. package/dist/chunks/{notification-bell-DZukXqhn.js → notification-bell-BzaAxClz.js} +37 -37
  14. package/dist/chunks/{notification-bell-ym2iwJpw.js → notification-bell-CORqgHJz.js} +1 -1
  15. package/dist/chunks/{resource-management-panel-BVKxC2EW.js → resource-management-panel-DTqy2qdz.js} +1 -1
  16. package/dist/chunks/{resource-management-panel-DGVVs8UM.js → resource-management-panel-DyB-hsMG.js} +33 -33
  17. package/dist/chunks/{use-role-aware-display-preferences-c-dmtisM.js → use-role-aware-display-preferences-CGoaBI2T.js} +1 -1
  18. package/dist/chunks/{use-role-aware-display-preferences-v3z-8Fyh.js → use-role-aware-display-preferences-KDXzNos5.js} +1 -1
  19. package/dist/chunks/{use-visual-utils-Ba5nPP3L.js → use-visual-utils-DeDb4aaF.js} +1 -1
  20. package/dist/chunks/{use-visual-utils-CaYg_mFN.js → use-visual-utils-T31Qxkp7.js} +1 -1
  21. package/dist/dashboard/index.cjs +1 -1
  22. package/dist/dashboard/index.js +1 -1
  23. package/dist/index.cjs +1 -1
  24. package/dist/index.js +5 -5
  25. package/dist/style.css +1 -1
  26. package/dist/surfboard/index.cjs +1 -1
  27. package/dist/surfboard/index.js +2 -2
  28. package/dist/types/dashboard.d.ts +9 -4
  29. package/dist/types/main.d.ts +22 -8
  30. package/dist/types/shared.d.ts +9 -4
  31. package/dist/types/surfboard.d.ts +9 -4
  32. package/dist/types/types.d.ts +14 -4
  33. package/package.json +2 -1
  34. package/dist/chunks/dashboard-controls-AyLbHPY7.js +0 -47
  35. package/dist/chunks/edit-dashboard-visual-DE2g9so9.js +0 -164
  36. package/dist/chunks/index-BL3sySXQ.js +0 -1109
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-BL3sySXQ.js"),T=require("./chunks/common-types-CfJLrTJd.js"),y=require("./chunks/dashboard-summary-settings-dialog-ZzGDw_NF.js"),t=require("react/jsx-runtime"),g=require("react"),v=require("./chunks/resource-management-panel-BVKxC2EW.js"),P=require("./types/index.cjs"),M=require("./chunks/use-debounced-dirty-check-XHSwAefL.js");require("react-dom");const m=require("./chunks/notification-bell-ym2iwJpw.js"),E=require("./chunks/normalize-dashboard-for-dirty-check-B7NQDI1H.js");function I(r){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const n in r)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(a,n,i.get?i:{enumerable:!0,get:()=>r[n]})}}return a.default=r,Object.freeze(a)}const A=I(g);function _(r){const{displayPreferences:a,...n}=r,i={...n,id:r.dashboardId};return t.jsx(e.ErrorBoundary,{FallbackComponent:e.Fallback,children:t.jsxs(e.SemaphorContextProvider,{dashboardProps:i,children:[t.jsx(e.SemaphorReadyIndicator,{componentType:"visual",componentId:r.cardId}),t.jsx(e.UXProvider,{children:t.jsx(e.DisplayPreferencesProvider,{displayPreferences:a,children:t.jsx(e.Container,{type:"visual",...i,children:t.jsx(F,{cardId:r.cardId})})})})]})})}function F({cardId:r}){const a=e.useDashboardStore(o=>{var u;return(u=o.dashboard)==null?void 0:u.sheets}),{card:n,frame:i}=g.useMemo(()=>{const o=a==null?void 0:a.flatMap(s=>s.frames),u=o==null?void 0:o.flatMap(s=>s==null?void 0:s.cards),d=u==null?void 0:u.find(s=>(s==null?void 0:s.id)===r),l=o==null?void 0:o.find(s=>{var p;return(p=s==null?void 0:s.cards)==null?void 0:p.find(h=>(h==null?void 0:h.id)===r)});return{card:d,frame:l}},[a,r]);return!n||!i?t.jsx(e.FallbackVisual,{error:new Error("Card not found"),resetErrorBoundary:()=>{},customerFacingMessage:`Card not found with ID: ${r}`}):t.jsx("main",{className:"flex h-full grow flex-col",children:t.jsx(e.ErrorBoundary,{FallbackComponent:({error:o,resetErrorBoundary:u})=>t.jsx(e.FallbackVisual,{error:o,resetErrorBoundary:u,customerFacingMessage:"Error creating visual. Please try again."}),children:t.jsx(e.DashboardCard,{card:n,frame:i})})})}function R({name:r,items:a,value:n,onChange:i,isLoading:o,isError:u,refetch:d,className:l,icon:s,showNone:p=!1}){const h=A.useRef(null),[D,f]=A.useState(!1),[S,b]=A.useState("100%"),C=p?[...a||[],{id:"none",name:"None"}]:a;A.useLayoutEffect(()=>{h.current&&b(h.current.offsetWidth)},[]);function N(){var c;return o?"Loading...":u?"Error":n?(c=a==null?void 0:a.find(x=>x.id===n))==null?void 0:c.name:`Select ${r}`}function j(c,x){i(x),f(!1)}return t.jsxs(e.Popover,{open:D,onOpenChange:f,children:[t.jsx(e.PopoverTrigger,{asChild:!0,children:t.jsxs(e.Button,{ref:h,variant:"outline",role:"combobox","aria-expanded":D,className:e.cn("flex h-9 w-full justify-between",l),children:[t.jsxs("div",{className:"flex items-center gap-2",children:[s&&t.jsx("div",{className:"mr-2",children:s}),t.jsx("span",{className:"max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap",children:N()})]}),t.jsx(e.ChevronDown,{className:"size-4 opacity-50"})]})}),t.jsx(e.PopoverContent,{className:"w-full p-0",style:{minWidth:S},children:t.jsxs(e.Command,{children:[t.jsxs("div",{className:"flex h-9 items-center justify-between border-b pr-1",children:[t.jsx(e.CommandInput,{className:"h-9",placeholder:"Search..."}),t.jsx(e.IconButton,{className:"h-7",onClick:d,children:t.jsx(e.RefreshCw,{className:e.cn("size-3.5 opacity-50",o&&"animate-spin")})})]}),t.jsxs(e.CommandList,{children:[t.jsxs(e.CommandEmpty,{children:["No ",r==null?void 0:r.toLowerCase()," found."]}),t.jsx(e.CommandGroup,{children:C==null?void 0:C.map(c=>t.jsx(e.CommandItem,{className:"overflow-x-auto",value:c.name,onSelect:x=>j(x,c.id),children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(e.Check,{className:e.cn("size-4",n===c.id?"opacity-100":"opacity-0")}),t.jsx("div",{title:c.name,children:c.name})]})},c.id))})]})]})})]})}function w({triggerButtonClassName:r,variant:a="ghost"}){const[n,i]=g.useState(!1),o=e.useDashboardStore(d=>{var l;return(l=d.dashboard)==null?void 0:l.id}),u=e.useDashboardStore(d=>{var l;return(l=d.dashboard)==null?void 0:l.title});return o?t.jsxs(t.Fragment,{children:[t.jsx(e.IconButton,{tooltip:"Schedule Dashboard",className:e.cn("h-7 p-2",r),buttonProps:{variant:a},onClick:()=>i(!0),children:t.jsx(e.Clock,{className:"size-4"})}),t.jsx(e.EmailScheduleDialog,{open:n,onOpenChange:i,dashboardId:o,dashboardName:u})]}):null}function k(r,a){g.useEffect(()=>(r&&a&&(window.__SEMAPHOR_PRINT_STATE__={...a}),()=>{r&&window.__SEMAPHOR_PRINT_STATE__&&delete window.__SEMAPHOR_PRINT_STATE__}),[r,a])}function L(){var u,d;const{quotasQuery:r,usageQuery:a}=e.useAlertQuotas(),n=((u=r.data)==null?void 0:u.quotas)||[],i=((d=a.data)==null?void 0:d.usage)||[],o=new Map(i.map(l=>[l.tenantId||"org",l]));return t.jsxs("div",{className:"space-y-4 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-xl font-semibold",children:"Alert Quotas"}),t.jsx(e.Button,{variant:"outline",size:"sm",onClick:()=>{r.refetch(),a.refetch()},children:"Refresh"})]}),r.isLoading||a.isLoading?t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading quota usage..."}):null,t.jsx("div",{className:"overflow-hidden rounded-lg border",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{className:"bg-muted/40",children:t.jsxs("tr",{children:[t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Tenant"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Active Alerts"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Max Active"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Min Cadence"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Max Context Sources"})]})}),t.jsx("tbody",{children:n.map(l=>{const s=l.tenantId||"org",p=o.get(s);return t.jsxs("tr",{className:"border-t",children:[t.jsx("td",{className:"px-3 py-2",children:s}),t.jsx("td",{className:"px-3 py-2",children:(p==null?void 0:p.activeAlerts)??0}),t.jsx("td",{className:"px-3 py-2",children:l.policy.maxActiveAlerts}),t.jsxs("td",{className:"px-3 py-2",children:[l.policy.minCadenceMinutes," min"]}),t.jsx("td",{className:"px-3 py-2",children:l.policy.maxContextSources})]},s)})})]})})]})}exports.AlertCreationDialog=e.AlertCreationDialog;exports.AlertManagementPage=e.AlertManagementPage;exports.AlertsApiError=e.AlertsApiError;exports.CALCULATED_FIELD_ENTITY_MARKER=e.CALCULATED_FIELD_ENTITY_MARKER;exports.CardAlertIndicator=e.CardAlertIndicator;exports.CardSummary=e.CardSummary;exports.DATE_FORMAT_VALUES=e.DATE_FORMAT_VALUES;exports.Dashboard=e.Dashboard;exports.DashboardExportDialog=e.DashboardExportDialog;exports.DashboardWC=e.DashboardWC;exports.EmailScheduleDialog=e.EmailScheduleDialog;exports.ExportError=e.ExportError;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.SummaryCard=e.SummaryCard;exports.Surfboard=e.DashboardPlus;exports.backtestAlert=e.backtestAlert;exports.cancelExport=e.cancelExport;exports.cloneDeep=e.cloneDeep;exports.createAlert=e.createAlert;exports.createEmptyKpiConfig=e.createEmptyKpiConfig;exports.createExport=e.createExport;exports.createSqlGenConfig=e.createSqlGenConfig;exports.deleteAlert=e.deleteAlert;exports.downloadPdf=e.downloadPdf;exports.emitDashboardLoad=e.emitDashboardLoad;exports.emitDashboardUnload=e.emitDashboardUnload;exports.fmt=e.fmt;exports.formatFileSize=e.formatFileSize;exports.getAlert=e.getAlert;exports.getAlertContextSources=e.getAlertContextSources;exports.getAlertHistory=e.getAlertHistory;exports.getAlertQuotaUsage=e.getAlertQuotaUsage;exports.getAlertRunDeliveries=e.getAlertRunDeliveries;exports.getAlertRunSteps=e.getAlertRunSteps;exports.getAlertRuns=e.getAlertRuns;exports.getAlertState=e.getAlertState;exports.getColumnDataType=e.getColumnDataType;exports.getDownloadUrl=e.getDownloadUrl;exports.getExportStatus=e.getExportStatus;exports.getExports=e.getExports;exports.getFilterValueType=e.getFilterValueType;exports.getFormattedTableNameForQuery=e.getFormattedTableNameForQuery;exports.getQualifiedTableName=e.getQualifiedTableName;exports.getSql=e.getSql;exports.interpretAlertContext=e.interpretAlertContext;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.isExportComplete=e.isExportComplete;exports.isExportInProgress=e.isExportInProgress;exports.isNumberDataType=e.isNumberDataType;exports.isTextDataType=e.isTextDataType;exports.listAlertQuotas=e.listAlertQuotas;exports.listAlerts=e.listAlerts;exports.previewAlertDeliverable=e.previewAlertDeliverable;exports.resolveDataType=e.resolveDataType;exports.resolveDatamodelName=e.resolveDatamodelName;exports.triggerAlertNow=e.triggerAlertNow;exports.updateAlert=e.updateAlert;exports.updateAlertContextSources=e.updateAlertContextSources;exports.updateAlertQuota=e.updateAlertQuota;exports.useActiveExports=e.useActiveExports;exports.useAddNewFrame=e.useAddNewFrame;exports.useAlertActions=e.useAlertActions;exports.useAlertBacktest=e.useAlertBacktest;exports.useAlertContextBuilder=e.useAlertContextBuilder;exports.useAlertDeliveries=e.useAlertDeliveries;exports.useAlertDetail=e.useAlertDetail;exports.useAlertDraft=e.useAlertDraft;exports.useAlertFilters=e.useAlertFilters;exports.useAlertHistory=e.useAlertHistory;exports.useAlertQuotas=e.useAlertQuotas;exports.useAlertRuns=e.useAlertRuns;exports.useAlertState=e.useAlertState;exports.useAlertStore=e.useAlertStore;exports.useAlerts=e.useAlerts;exports.useAlertsBootstrap=e.useAlertsBootstrap;exports.useAlertsById=e.useAlertsById;exports.useAlertsForCard=e.useAlertsForCard;exports.useCard=e.useCard;exports.useCardAlertMap=e.useCardAlertMap;exports.useCardSummary=e.useCardSummary;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.useDashboardSummary=e.useDashboardSummary;exports.useDataColumns=e.useDataColumns;exports.useDateFilterHook=e.useDateFilterHook;exports.useEditorActions=e.useEditorActions;exports.useEditorAside=e.useEditorAside;exports.useEditorStore=e.useEditorStore;exports.useExportActions=e.useExportActions;exports.useExportStore=e.useExportStore;exports.useInProgressExportsCount=e.useInProgressExportsCount;exports.useManagementStore=e.useManagementStore;exports.useResourceManagement=e.useResourceManagement;exports.useSelectedAlertId=e.useSelectedAlertId;exports.useTextFilterHook=e.useTextFilterHook;exports.EMPTY_SELECTION=T.EMPTY_SELECTION;exports.CalendarPreferencesDialog=y.CalendarPreferencesDialog;exports.DashboardSummarySettingsDialog=y.DashboardSummarySettingsDialog;exports.ResourceManagementPanel=v.ResourceManagementPanel;exports.DEFAULT_CALENDAR_CONTEXT=P.DEFAULT_CALENDAR_CONTEXT;exports.useDebouncedDirtyCheck=M.useDebouncedDirtyCheck;exports.AdvancedModeToggle=m.AdvancedModeToggle;exports.ExportNotificationItem=m.ExportNotificationItem;exports.ExportNotificationList=m.ExportNotificationList;exports.NotificationBell=m.NotificationBell;exports.UnsavedChangesAlert=m.UnsavedChangesAlert;exports.VisualEditingControls=m.VisualEditingControls;exports.useExportPolling=m.useExportPolling;exports.useExportRecovery=m.useExportRecovery;exports.usePristineSnapshotInitializer=m.usePristineSnapshotInitializer;exports.normalizeDashboardForDirtyCheck=E.normalizeDashboardForDirtyCheck;exports.serializeDashboardForDirtyCheck=E.serializeDashboardForDirtyCheck;exports.Combobox=R;exports.ScheduleDashboard=w;exports.TenantQuotaPage=L;exports.Visual=_;exports.useExposePrintState=k;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-CYvDw51J.js"),T=require("./chunks/common-types-CfJLrTJd.js"),y=require("./chunks/dashboard-summary-settings-dialog-DaSFFTUT.js"),t=require("react/jsx-runtime"),g=require("react"),v=require("./chunks/resource-management-panel-DTqy2qdz.js"),P=require("./types/index.cjs"),M=require("./chunks/use-debounced-dirty-check-XHSwAefL.js");require("react-dom");const m=require("./chunks/notification-bell-CORqgHJz.js"),E=require("./chunks/normalize-dashboard-for-dirty-check-B7NQDI1H.js");function I(r){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const n in r)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(a,n,i.get?i:{enumerable:!0,get:()=>r[n]})}}return a.default=r,Object.freeze(a)}const A=I(g);function _(r){const{displayPreferences:a,...n}=r,i={...n,id:r.dashboardId};return t.jsx(e.ErrorBoundary,{FallbackComponent:e.Fallback,children:t.jsxs(e.SemaphorContextProvider,{dashboardProps:i,children:[t.jsx(e.SemaphorReadyIndicator,{componentType:"visual",componentId:r.cardId}),t.jsx(e.UXProvider,{children:t.jsx(e.DisplayPreferencesProvider,{displayPreferences:a,children:t.jsx(e.Container,{type:"visual",...i,children:t.jsx(F,{cardId:r.cardId})})})})]})})}function F({cardId:r}){const a=e.useDashboardStore(o=>{var u;return(u=o.dashboard)==null?void 0:u.sheets}),{card:n,frame:i}=g.useMemo(()=>{const o=a==null?void 0:a.flatMap(s=>s.frames),u=o==null?void 0:o.flatMap(s=>s==null?void 0:s.cards),d=u==null?void 0:u.find(s=>(s==null?void 0:s.id)===r),l=o==null?void 0:o.find(s=>{var p;return(p=s==null?void 0:s.cards)==null?void 0:p.find(h=>(h==null?void 0:h.id)===r)});return{card:d,frame:l}},[a,r]);return!n||!i?t.jsx(e.FallbackVisual,{error:new Error("Card not found"),resetErrorBoundary:()=>{},customerFacingMessage:`Card not found with ID: ${r}`}):t.jsx("main",{className:"flex h-full grow flex-col",children:t.jsx(e.ErrorBoundary,{FallbackComponent:({error:o,resetErrorBoundary:u})=>t.jsx(e.FallbackVisual,{error:o,resetErrorBoundary:u,customerFacingMessage:"Error creating visual. Please try again."}),children:t.jsx(e.DashboardCard,{card:n,frame:i})})})}function R({name:r,items:a,value:n,onChange:i,isLoading:o,isError:u,refetch:d,className:l,icon:s,showNone:p=!1}){const h=A.useRef(null),[D,f]=A.useState(!1),[S,b]=A.useState("100%"),C=p?[...a||[],{id:"none",name:"None"}]:a;A.useLayoutEffect(()=>{h.current&&b(h.current.offsetWidth)},[]);function N(){var c;return o?"Loading...":u?"Error":n?(c=a==null?void 0:a.find(x=>x.id===n))==null?void 0:c.name:`Select ${r}`}function j(c,x){i(x),f(!1)}return t.jsxs(e.Popover,{open:D,onOpenChange:f,children:[t.jsx(e.PopoverTrigger,{asChild:!0,children:t.jsxs(e.Button,{ref:h,variant:"outline",role:"combobox","aria-expanded":D,className:e.cn("flex h-9 w-full justify-between",l),children:[t.jsxs("div",{className:"flex items-center gap-2",children:[s&&t.jsx("div",{className:"mr-2",children:s}),t.jsx("span",{className:"max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap",children:N()})]}),t.jsx(e.ChevronDown,{className:"size-4 opacity-50"})]})}),t.jsx(e.PopoverContent,{className:"w-full p-0",style:{minWidth:S},children:t.jsxs(e.Command,{children:[t.jsxs("div",{className:"flex h-9 items-center justify-between border-b pr-1",children:[t.jsx(e.CommandInput,{className:"h-9",placeholder:"Search..."}),t.jsx(e.IconButton,{className:"h-7",onClick:d,children:t.jsx(e.RefreshCw,{className:e.cn("size-3.5 opacity-50",o&&"animate-spin")})})]}),t.jsxs(e.CommandList,{children:[t.jsxs(e.CommandEmpty,{children:["No ",r==null?void 0:r.toLowerCase()," found."]}),t.jsx(e.CommandGroup,{children:C==null?void 0:C.map(c=>t.jsx(e.CommandItem,{className:"overflow-x-auto",value:c.name,onSelect:x=>j(x,c.id),children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(e.Check,{className:e.cn("size-4",n===c.id?"opacity-100":"opacity-0")}),t.jsx("div",{title:c.name,children:c.name})]})},c.id))})]})]})})]})}function w({triggerButtonClassName:r,variant:a="ghost"}){const[n,i]=g.useState(!1),o=e.useDashboardStore(d=>{var l;return(l=d.dashboard)==null?void 0:l.id}),u=e.useDashboardStore(d=>{var l;return(l=d.dashboard)==null?void 0:l.title});return o?t.jsxs(t.Fragment,{children:[t.jsx(e.IconButton,{tooltip:"Schedule Dashboard",className:e.cn("h-7 p-2",r),buttonProps:{variant:a},onClick:()=>i(!0),children:t.jsx(e.Clock,{className:"size-4"})}),t.jsx(e.EmailScheduleDialog,{open:n,onOpenChange:i,dashboardId:o,dashboardName:u})]}):null}function k(r,a){g.useEffect(()=>(r&&a&&(window.__SEMAPHOR_PRINT_STATE__={...a}),()=>{r&&window.__SEMAPHOR_PRINT_STATE__&&delete window.__SEMAPHOR_PRINT_STATE__}),[r,a])}function L(){var u,d;const{quotasQuery:r,usageQuery:a}=e.useAlertQuotas(),n=((u=r.data)==null?void 0:u.quotas)||[],i=((d=a.data)==null?void 0:d.usage)||[],o=new Map(i.map(l=>[l.tenantId||"org",l]));return t.jsxs("div",{className:"space-y-4 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-xl font-semibold",children:"Alert Quotas"}),t.jsx(e.Button,{variant:"outline",size:"sm",onClick:()=>{r.refetch(),a.refetch()},children:"Refresh"})]}),r.isLoading||a.isLoading?t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading quota usage..."}):null,t.jsx("div",{className:"overflow-hidden rounded-lg border",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{className:"bg-muted/40",children:t.jsxs("tr",{children:[t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Tenant"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Active Alerts"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Max Active"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Min Cadence"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Max Context Sources"})]})}),t.jsx("tbody",{children:n.map(l=>{const s=l.tenantId||"org",p=o.get(s);return t.jsxs("tr",{className:"border-t",children:[t.jsx("td",{className:"px-3 py-2",children:s}),t.jsx("td",{className:"px-3 py-2",children:(p==null?void 0:p.activeAlerts)??0}),t.jsx("td",{className:"px-3 py-2",children:l.policy.maxActiveAlerts}),t.jsxs("td",{className:"px-3 py-2",children:[l.policy.minCadenceMinutes," min"]}),t.jsx("td",{className:"px-3 py-2",children:l.policy.maxContextSources})]},s)})})]})})]})}exports.AlertCreationDialog=e.AlertCreationDialog;exports.AlertManagementPage=e.AlertManagementPage;exports.AlertsApiError=e.AlertsApiError;exports.CALCULATED_FIELD_ENTITY_MARKER=e.CALCULATED_FIELD_ENTITY_MARKER;exports.CardAlertIndicator=e.CardAlertIndicator;exports.CardSummary=e.CardSummary;exports.DATE_FORMAT_VALUES=e.DATE_FORMAT_VALUES;exports.Dashboard=e.Dashboard;exports.DashboardExportDialog=e.DashboardExportDialog;exports.DashboardWC=e.DashboardWC;exports.EmailScheduleDialog=e.EmailScheduleDialog;exports.ExportError=e.ExportError;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.SummaryCard=e.SummaryCard;exports.Surfboard=e.DashboardPlus;exports.backtestAlert=e.backtestAlert;exports.cancelExport=e.cancelExport;exports.cloneDeep=e.cloneDeep;exports.createAlert=e.createAlert;exports.createEmptyKpiConfig=e.createEmptyKpiConfig;exports.createExport=e.createExport;exports.createSqlGenConfig=e.createSqlGenConfig;exports.deleteAlert=e.deleteAlert;exports.downloadPdf=e.downloadPdf;exports.emitDashboardLoad=e.emitDashboardLoad;exports.emitDashboardUnload=e.emitDashboardUnload;exports.fmt=e.fmt;exports.formatFileSize=e.formatFileSize;exports.getAlert=e.getAlert;exports.getAlertContextSources=e.getAlertContextSources;exports.getAlertHistory=e.getAlertHistory;exports.getAlertQuotaUsage=e.getAlertQuotaUsage;exports.getAlertRunDeliveries=e.getAlertRunDeliveries;exports.getAlertRunSteps=e.getAlertRunSteps;exports.getAlertRuns=e.getAlertRuns;exports.getAlertState=e.getAlertState;exports.getColumnDataType=e.getColumnDataType;exports.getDownloadUrl=e.getDownloadUrl;exports.getExportStatus=e.getExportStatus;exports.getExports=e.getExports;exports.getFilterValueType=e.getFilterValueType;exports.getFormattedTableNameForQuery=e.getFormattedTableNameForQuery;exports.getQualifiedTableName=e.getQualifiedTableName;exports.getSql=e.getSql;exports.interpretAlertContext=e.interpretAlertContext;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.isExportComplete=e.isExportComplete;exports.isExportInProgress=e.isExportInProgress;exports.isNumberDataType=e.isNumberDataType;exports.isTextDataType=e.isTextDataType;exports.listAlertQuotas=e.listAlertQuotas;exports.listAlerts=e.listAlerts;exports.previewAlertDeliverable=e.previewAlertDeliverable;exports.resolveDataType=e.resolveDataType;exports.resolveDatamodelName=e.resolveDatamodelName;exports.triggerAlertNow=e.triggerAlertNow;exports.updateAlert=e.updateAlert;exports.updateAlertContextSources=e.updateAlertContextSources;exports.updateAlertQuota=e.updateAlertQuota;exports.useActiveExports=e.useActiveExports;exports.useAddNewFrame=e.useAddNewFrame;exports.useAlertActions=e.useAlertActions;exports.useAlertBacktest=e.useAlertBacktest;exports.useAlertContextBuilder=e.useAlertContextBuilder;exports.useAlertDeliveries=e.useAlertDeliveries;exports.useAlertDetail=e.useAlertDetail;exports.useAlertDraft=e.useAlertDraft;exports.useAlertFilters=e.useAlertFilters;exports.useAlertHistory=e.useAlertHistory;exports.useAlertQuotas=e.useAlertQuotas;exports.useAlertRuns=e.useAlertRuns;exports.useAlertState=e.useAlertState;exports.useAlertStore=e.useAlertStore;exports.useAlerts=e.useAlerts;exports.useAlertsBootstrap=e.useAlertsBootstrap;exports.useAlertsById=e.useAlertsById;exports.useAlertsForCard=e.useAlertsForCard;exports.useCard=e.useCard;exports.useCardAlertMap=e.useCardAlertMap;exports.useCardSummary=e.useCardSummary;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.useDashboardSummary=e.useDashboardSummary;exports.useDataColumns=e.useDataColumns;exports.useDateFilterHook=e.useDateFilterHook;exports.useEditorActions=e.useEditorActions;exports.useEditorAside=e.useEditorAside;exports.useEditorStore=e.useEditorStore;exports.useExportActions=e.useExportActions;exports.useExportStore=e.useExportStore;exports.useInProgressExportsCount=e.useInProgressExportsCount;exports.useManagementStore=e.useManagementStore;exports.useResourceManagement=e.useResourceManagement;exports.useSelectedAlertId=e.useSelectedAlertId;exports.useTextFilterHook=e.useTextFilterHook;exports.EMPTY_SELECTION=T.EMPTY_SELECTION;exports.CalendarPreferencesDialog=y.CalendarPreferencesDialog;exports.DashboardSummarySettingsDialog=y.DashboardSummarySettingsDialog;exports.ResourceManagementPanel=v.ResourceManagementPanel;exports.DEFAULT_CALENDAR_CONTEXT=P.DEFAULT_CALENDAR_CONTEXT;exports.useDebouncedDirtyCheck=M.useDebouncedDirtyCheck;exports.AdvancedModeToggle=m.AdvancedModeToggle;exports.ExportNotificationItem=m.ExportNotificationItem;exports.ExportNotificationList=m.ExportNotificationList;exports.NotificationBell=m.NotificationBell;exports.UnsavedChangesAlert=m.UnsavedChangesAlert;exports.VisualEditingControls=m.VisualEditingControls;exports.useExportPolling=m.useExportPolling;exports.useExportRecovery=m.useExportRecovery;exports.usePristineSnapshotInitializer=m.usePristineSnapshotInitializer;exports.normalizeDashboardForDirtyCheck=E.normalizeDashboardForDirtyCheck;exports.serializeDashboardForDirtyCheck=E.serializeDashboardForDirtyCheck;exports.Combobox=R;exports.ScheduleDashboard=w;exports.TenantQuotaPage=L;exports.Visual=_;exports.useExposePrintState=k;
package/dist/index.js CHANGED
@@ -1,15 +1,15 @@
1
- import { a2 as D, a3 as w, a4 as _, a5 as I, a6 as M, a7 as R, a8 as F, u as x, a9 as y, aa as k, P as L, s as B, B as E, ab as Q, c as f, t as O, v as z, w as U, ac as N, ad as q, x as H, y as V, z as j, A as W, E as G, ae as K, af as Y, ag as X } from "./chunks/index-C0uTSIns.js";
2
- import { ah as pe, ai as he, aj as be, ak as fe, al as Ae, am as xe, an as Ce, D as ge, ao as ye, ap as De, aq as Ee, ar as Ne, as as Se, at as ve, at as Te, au as Pe, av as we, a as _e, aw as Ie, ax as Me, ay as Re, az as Fe, aA as ke, aB as Le, aC as Be, aD as Qe, aE as Oe, aF as ze, aG as Ue, aH as qe, aI as He, aJ as Ve, aK as je, aL as We, aM as Ge, aN as Ke, aO as Ye, aP as Xe, aQ as $e, aR as Je, aS as Ze, aT as ea, aU as aa, aV as sa, aW as ta, aX as ra, aY as oa, aZ as na, a_ as la, a$ as ia, b0 as da, b1 as ca, b2 as ua, b3 as ma, b4 as pa, b5 as ha, b6 as ba, b7 as fa, b8 as Aa, b9 as xa, ba as Ca, bb as ga, bc as ya, bd as Da, be as Ea, bf as Na, bg as Sa, bh as va, bi as Ta, bj as Pa, bk as wa, bl as _a, bm as Ia, bn as Ma, bo as Ra, bp as Fa, bq as ka, br as La, bs as Ba, bt as Qa, bu as Oa, bv as za, bw as Ua, bx as qa, by as Ha, bz as Va, bA as ja, bB as Wa, bC as Ga, bD as Ka, bE as Ya, Z as Xa, bF as $a, bG as Ja, bH as Za, bI as es, bJ as as, Y as ss, bK as ts, a1 as rs, bL as os, bM as ns, bN as ls, bO as is, bP as ds, bQ as cs, bR as us } from "./chunks/index-C0uTSIns.js";
1
+ import { a2 as D, a3 as w, a4 as _, a5 as I, a6 as M, a7 as R, a8 as F, u as x, a9 as y, aa as k, P as L, s as B, B as E, c as f, ab as Q, t as O, v as z, w as U, ac as N, ad as q, x as H, y as V, z as j, A as W, E as G, ae as K, af as Y, ag as X } from "./chunks/index-Cxh23oCu.js";
2
+ import { a_ as pe, aZ as he, bI as be, b0 as fe, a$ as Ae, az as xe, b1 as Ce, D as ge, ax as ye, ar as De, bO as Ee, b5 as Ne, aj as Se, am as ve, am as Te, an as Pe, ay as we, a as _e, bA as Ie, bN as Me, au as Re, br as Fe, bo as ke, bJ as Le, bc as Be, bt as Qe, aw as Oe, as as ze, at as Ue, b6 as qe, bR as He, bq as Ve, bC as je, bx as We, bG as Ge, by as Ke, bz as Ye, bw as Xe, bv as $e, be as Je, bM as Ze, bL as ea, bK as aa, bd as sa, bh as ta, bi as ra, bb as oa, bB as na, av as la, ba as ia, b3 as da, b4 as ca, b2 as ua, bf as ma, b9 as pa, bQ as ha, bP as ba, b8 as fa, b7 as Aa, bF as xa, bp as Ca, bE as ga, bj as ya, bg as Da, bu as Ea, bs as Na, bD as Sa, bH as va, aG as Ta, aD as Pa, aS as wa, aQ as _a, aP as Ia, aO as Ma, aK as Ra, aY as Fa, aX as ka, aN as La, aM as Ba, aL as Qa, aR as Oa, aI as za, aJ as Ua, aT as qa, aV as Ha, aq as Va, aU as ja, aB as Wa, bl as Ga, bn as Ka, bm as Ya, Z as Xa, ap as $a, ai as Ja, aA as Za, aC as es, ak as as, Y as ss, bk as ts, a1 as rs, aF as os, aE as ns, aH as ls, ah as is, ao as ds, aW as cs, al as us } from "./chunks/index-Cxh23oCu.js";
3
3
  import { E as ps } from "./chunks/common-types-DhqlRVrq.js";
4
- import { C as bs, D as fs } from "./chunks/dashboard-summary-settings-dialog-95pmx2I6.js";
4
+ import { C as bs, D as fs } from "./chunks/dashboard-summary-settings-dialog-CQza-Ibd.js";
5
5
  import { jsx as e, jsxs as n, Fragment as $ } from "react/jsx-runtime";
6
6
  import * as b from "react";
7
7
  import { useMemo as J, useState as Z, useEffect as ee } from "react";
8
- import { ResourceManagementPanel as xs } from "./chunks/resource-management-panel-DGVVs8UM.js";
8
+ import { ResourceManagementPanel as xs } from "./chunks/resource-management-panel-DyB-hsMG.js";
9
9
  import { DEFAULT_CALENDAR_CONTEXT as gs } from "./types/index.js";
10
10
  import { u as Ds } from "./chunks/use-debounced-dirty-check-BwAbnX_5.js";
11
11
  import "react-dom";
12
- import { A as Ns, E as Ss, a as vs, N as Ts, U as Ps, V as ws, u as _s, b as Is, c as Ms } from "./chunks/notification-bell-DZukXqhn.js";
12
+ import { A as Ns, a as Ss, E as vs, N as Ts, U as Ps, V as ws, u as _s, b as Is, c as Ms } from "./chunks/notification-bell-BzaAxClz.js";
13
13
  import { n as Fs, s as ks } from "./chunks/normalize-dashboard-for-dirty-check-Bn27S0PN.js";
14
14
  function ne(a) {
15
15
  const { displayPreferences: s, ...i } = a, d = {