react-semaphor 0.0.626 → 0.0.628

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-BgTQ-g-l.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-DlGdDEyt.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-BROU-OfV.js";
1
+ import { D as a } from "../chunks/index-Cml3tKQF.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 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-BgTQ-g-l.js"),C=require("./types/index.cjs"),i=require("./chunks/dashboard-plus-ST0SJPKL.js"),t=require("react/jsx-runtime"),h=require("react");require("react-dom");function T(a){const{displayPreferences:n,...d}=a,u={...d,id:a.dashboardId};return t.jsx(e.ErrorBoundary,{FallbackComponent:e.Fallback,children:t.jsx(e.SemaphorContextProvider,{dashboardProps:u,children:t.jsx(e.UXProvider,{children:t.jsx(e.DisplayPreferencesProvider,{displayPreferences:n,children:t.jsx(e.Container,{type:"visual",...u,children:t.jsx(S,{cardId:a.cardId})})})})})})}function S({cardId:a}){const n=e.useDashboardStore(o=>{var s;return(s=o.dashboard)==null?void 0:s.sheets}),{card:d,frame:u}=h.useMemo(()=>{const o=n==null?void 0:n.flatMap(r=>r.frames),s=o==null?void 0:o.flatMap(r=>r==null?void 0:r.cards),c=s==null?void 0:s.find(r=>(r==null?void 0:r.id)===a),M=o==null?void 0:o.find(r=>{var l;return(l=r==null?void 0:r.cards)==null?void 0:l.find(Y=>(Y==null?void 0:Y.id)===a)});return{card:c,frame:M}},[n,a]);return!d||!u?t.jsx(e.FallbackVisual,{error:new Error("Card not found"),resetErrorBoundary:()=>{},customerFacingMessage:`Card not found with ID: ${a}`}):t.jsx("main",{className:"flex h-full grow flex-col",children:t.jsx(e.ErrorBoundary,{FallbackComponent:({error:o,resetErrorBoundary:s})=>t.jsx(e.FallbackVisual,{error:o,resetErrorBoundary:s,customerFacingMessage:"Error creating visual. Please try again."}),children:t.jsx(e.DashboardCard,{card:d,frame:u})})})}const b=["MM-DD-YYYY","YYYY-MM-DD","MM/DD/YYYY","DD/MM/YYYY","MMMM DD, YYYY","MMM DD, YYYY","DD MMM YYYY","Week of MMM DD, YYYY","Week of MMMM DD, YYYY","YYYY-WW","MMM YYYY","MMMM YYYY","YYYY-MM","MM/YYYY","YYYY MMM","Q1 YYYY","YYYY Q1","1st Quarter YYYY","YYYY-Q1","Quarter 1, YYYY","YYYY","YY","custom"];var D=(a=>(a.SUBTOTAL="__SUBTOTAL__",a.TOTAL="__TOTAL__",a.ALL="__ALL__",a))(D||{});exports.Dashboard=e.Dashboard;exports.DashboardWC=e.DashboardWC;exports.SemaphorContextProvider=e.SemaphorContextProvider;exports.SemaphorDataProvider=e.SemaphorQueryClient;exports.SemaphorQueryClient=e.SemaphorQueryClient;exports.createSqlGenConfig=e.createSqlGenConfig;exports.downloadPdf=e.downloadPdf;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.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.useDashboardStore=e.useDashboardStore;exports.useDataColumns=e.useDataColumns;exports.useDateFilterHook=e.useDateFilterHook;exports.useEditorActions=e.useEditorActions;exports.useEditorAside=e.useEditorAside;exports.useEditorStore=e.useEditorStore;exports.useTextFilterHook=e.useTextFilterHook;exports.EMPTY_SELECTION=C.EMPTY_SELECTION;exports.ResourceManagementPanel=i.ResourceManagementPanel;exports.ScheduleDashboard=i.ScheduleDashboard;exports.SelectComponent=i.SelectComponent;exports.Surfboard=i.DashboardPlus;exports.cleanCard=i.cleanCard;exports.getDashbaordStateWithoutData=i.getDashbaordStateWithoutData;exports.DATE_FORMAT_VALUES=b;exports.PivotMarkerEnum=D;exports.Visual=T;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-DlGdDEyt.js"),h=require("./types/index.cjs"),n=require("./chunks/dashboard-plus-3Kzofa37.js"),t=require("react/jsx-runtime"),C=require("react");require("react-dom");function T(a){const{displayPreferences:i,...d}=a,u={...d,id:a.dashboardId};return t.jsx(e.ErrorBoundary,{FallbackComponent:e.Fallback,children:t.jsx(e.SemaphorContextProvider,{dashboardProps:u,children:t.jsx(e.UXProvider,{children:t.jsx(e.DisplayPreferencesProvider,{displayPreferences:i,children:t.jsx(e.Container,{type:"visual",...u,children:t.jsx(S,{cardId:a.cardId})})})})})})}function S({cardId:a}){const i=e.useDashboardStore(o=>{var s;return(s=o.dashboard)==null?void 0:s.sheets}),{card:d,frame:u}=C.useMemo(()=>{const o=i==null?void 0:i.flatMap(r=>r.frames),s=o==null?void 0:o.flatMap(r=>r==null?void 0:r.cards),c=s==null?void 0:s.find(r=>(r==null?void 0:r.id)===a),M=o==null?void 0:o.find(r=>{var l;return(l=r==null?void 0:r.cards)==null?void 0:l.find(Y=>(Y==null?void 0:Y.id)===a)});return{card:c,frame:M}},[i,a]);return!d||!u?t.jsx(e.FallbackVisual,{error:new Error("Card not found"),resetErrorBoundary:()=>{},customerFacingMessage:`Card not found with ID: ${a}`}):t.jsx("main",{className:"flex h-full grow flex-col",children:t.jsx(e.ErrorBoundary,{FallbackComponent:({error:o,resetErrorBoundary:s})=>t.jsx(e.FallbackVisual,{error:o,resetErrorBoundary:s,customerFacingMessage:"Error creating visual. Please try again."}),children:t.jsx(e.DashboardCard,{card:d,frame:u})})})}const b=["MM-DD-YYYY","YYYY-MM-DD","MM/DD/YYYY","DD/MM/YYYY","MMMM DD, YYYY","MMM DD, YYYY","DD MMM YYYY","Week of MMM DD, YYYY","Week of MMMM DD, YYYY","YYYY-WW","MMM YYYY","MMMM YYYY","YYYY-MM","MM/YYYY","YYYY MMM","Q1 YYYY","YYYY Q1","1st Quarter YYYY","YYYY-Q1","Quarter 1, YYYY","YYYY","YY","custom"];var D=(a=>(a.SUBTOTAL="__SUBTOTAL__",a.TOTAL="__TOTAL__",a.ALL="__ALL__",a))(D||{});exports.Dashboard=e.Dashboard;exports.DashboardWC=e.DashboardWC;exports.ResourceType=e.ResourceType;exports.SemaphorContextProvider=e.SemaphorContextProvider;exports.SemaphorDataProvider=e.SemaphorQueryClient;exports.SemaphorQueryClient=e.SemaphorQueryClient;exports.createSqlGenConfig=e.createSqlGenConfig;exports.downloadPdf=e.downloadPdf;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.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.useDashboardStore=e.useDashboardStore;exports.useDataColumns=e.useDataColumns;exports.useDateFilterHook=e.useDateFilterHook;exports.useEditorActions=e.useEditorActions;exports.useEditorAside=e.useEditorAside;exports.useEditorStore=e.useEditorStore;exports.useTextFilterHook=e.useTextFilterHook;exports.EMPTY_SELECTION=h.EMPTY_SELECTION;exports.ResourceManagementPanel=n.ResourceManagementPanel;exports.ScheduleDashboard=n.ScheduleDashboard;exports.SelectComponent=n.SelectComponent;exports.ShareDialog=n.ShareDialog;exports.Surfboard=n.DashboardPlus;exports.cleanCard=n.cleanCard;exports.getDashbaordStateWithoutData=n.getDashbaordStateWithoutData;exports.DATE_FORMAT_VALUES=b;exports.PivotMarkerEnum=D;exports.Visual=T;
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { E as l, F as c, S as f, U as h, a as p, C as m, u as C, b as u, c as T } from "./chunks/index-BROU-OfV.js";
2
- import { D as L, h as k, f as Q, f as w, r as B, j as N, l as O, t as W, s as U, x as V, y as q, q as I, i as G, p as H, v as R, o as j, n as z, m as J, z as K, w as X, g as $, B as Z, H as aa, G as ea, I as sa, k as ra, d as oa, K as ta, A as Ya, J as na, e as ia } from "./chunks/index-BROU-OfV.js";
3
- import { EMPTY_SELECTION as ua } from "./types/index.js";
4
- import { R as Ma, S as Da, a as ca, D as fa, c as ha, g as pa } from "./chunks/dashboard-plus-DRy8xZTM.js";
1
+ import { E as l, F as c, S as h, U as f, a as p, C as m, u as T, b as u, c as C } from "./chunks/index-Cml3tKQF.js";
2
+ import { D as L, h as k, R as Q, f as w, f as B, r as N, j as O, l as W, t as R, s as U, x as V, y as q, q as I, i as G, p as H, v as j, o as z, n as J, m as K, z as X, w as $, g as Z, B as aa, H as ea, G as sa, I as ra, k as oa, d as ta, K as Ya, A as na, J as ia, e as da } from "./chunks/index-Cml3tKQF.js";
3
+ import { EMPTY_SELECTION as la } from "./types/index.js";
4
+ import { R as Da, a as ca, b as ha, S as fa, D as pa, c as ma, g as Ta } from "./chunks/dashboard-plus-wpXXKAOW.js";
5
5
  import { jsx as s } from "react/jsx-runtime";
6
6
  import { useMemo as b } from "react";
7
7
  import "react-dom";
@@ -11,10 +11,10 @@ function x(a) {
11
11
  id: a.dashboardId
12
12
  // override the id to the dashboard id so that the dashboard is not loaded
13
13
  };
14
- return /* @__PURE__ */ s(l, { FallbackComponent: c, children: /* @__PURE__ */ s(f, { dashboardProps: Y, children: /* @__PURE__ */ s(h, { children: /* @__PURE__ */ s(p, { displayPreferences: t, children: /* @__PURE__ */ s(m, { type: "visual", ...Y, children: /* @__PURE__ */ s(S, { cardId: a.cardId }) }) }) }) }) });
14
+ return /* @__PURE__ */ s(l, { FallbackComponent: c, children: /* @__PURE__ */ s(h, { dashboardProps: Y, children: /* @__PURE__ */ s(f, { children: /* @__PURE__ */ s(p, { displayPreferences: t, children: /* @__PURE__ */ s(m, { type: "visual", ...Y, children: /* @__PURE__ */ s(S, { cardId: a.cardId }) }) }) }) }) });
15
15
  }
16
16
  function S({ cardId: a }) {
17
- const t = C((r) => {
17
+ const t = T((r) => {
18
18
  var o;
19
19
  return (o = r.dashboard) == null ? void 0 : o.sheets;
20
20
  }), { card: n, frame: Y } = b(() => {
@@ -48,7 +48,7 @@ function S({ cardId: a }) {
48
48
  customerFacingMessage: "Error creating visual. Please try again."
49
49
  }
50
50
  ),
51
- children: /* @__PURE__ */ s(T, { card: n, frame: Y })
51
+ children: /* @__PURE__ */ s(C, { card: n, frame: Y })
52
52
  }
53
53
  ) });
54
54
  }
@@ -88,44 +88,46 @@ export {
88
88
  E as DATE_FORMAT_VALUES,
89
89
  L as Dashboard,
90
90
  k as DashboardWC,
91
- ua as EMPTY_SELECTION,
91
+ la as EMPTY_SELECTION,
92
92
  g as PivotMarkerEnum,
93
- Ma as ResourceManagementPanel,
94
- Da as ScheduleDashboard,
95
- ca as SelectComponent,
96
- f as SemaphorContextProvider,
97
- Q as SemaphorDataProvider,
98
- w as SemaphorQueryClient,
99
- fa as Surfboard,
93
+ Da as ResourceManagementPanel,
94
+ Q as ResourceType,
95
+ ca as ScheduleDashboard,
96
+ ha as SelectComponent,
97
+ h as SemaphorContextProvider,
98
+ w as SemaphorDataProvider,
99
+ B as SemaphorQueryClient,
100
+ fa as ShareDialog,
101
+ pa as Surfboard,
100
102
  x as Visual,
101
- ha as cleanCard,
102
- B as createSqlGenConfig,
103
- N as downloadPdf,
104
- O as fmt,
105
- W as getColumnDataType,
106
- pa as getDashbaordStateWithoutData,
103
+ ma as cleanCard,
104
+ N as createSqlGenConfig,
105
+ O as downloadPdf,
106
+ W as fmt,
107
+ R as getColumnDataType,
108
+ Ta as getDashbaordStateWithoutData,
107
109
  U as getFilterValueType,
108
110
  V as getFormattedTableNameForQuery,
109
111
  q as getQualifiedTableName,
110
112
  I as getSql,
111
113
  G as invalidateToken,
112
114
  H as isBooleanDataType,
113
- R as isColumnInSqlGen,
114
- j as isDateDataType,
115
- z as isNumberDataType,
116
- J as isTextDataType,
117
- K as resolveDataType,
118
- X as resolveDatamodelName,
119
- $ as useCard,
120
- Z as useCurrentActiveCard,
121
- aa as useCurrentCardConfig,
122
- ea as useCurrentSheetActiveCards,
123
- sa as useDashboardActions,
124
- C as useDashboardStore,
125
- ra as useDataColumns,
126
- oa as useDateFilterHook,
127
- ta as useEditorActions,
128
- Ya as useEditorAside,
129
- na as useEditorStore,
130
- ia as useTextFilterHook
115
+ j as isColumnInSqlGen,
116
+ z as isDateDataType,
117
+ J as isNumberDataType,
118
+ K as isTextDataType,
119
+ X as resolveDataType,
120
+ $ as resolveDatamodelName,
121
+ Z as useCard,
122
+ aa as useCurrentActiveCard,
123
+ ea as useCurrentCardConfig,
124
+ sa as useCurrentSheetActiveCards,
125
+ ra as useDashboardActions,
126
+ T as useDashboardStore,
127
+ oa as useDataColumns,
128
+ ta as useDateFilterHook,
129
+ Ya as useEditorActions,
130
+ na as useEditorAside,
131
+ ia as useEditorStore,
132
+ da as useTextFilterHook
131
133
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/dashboard-plus-ST0SJPKL.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/dashboard-plus-3Kzofa37.js"),r=require("../types/index.cjs");exports.Surfboard=e.DashboardPlus;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;
@@ -1,4 +1,4 @@
1
- import { D as f } from "../chunks/dashboard-plus-DRy8xZTM.js";
1
+ import { D as f } from "../chunks/dashboard-plus-wpXXKAOW.js";
2
2
  import { EMPTY_SELECTION as a } from "../types/index.js";
3
3
  export {
4
4
  a as EMPTY_SELECTION,
@@ -1146,6 +1146,11 @@ export declare interface MetricField extends Field {
1146
1146
  valueAliases?: Record<string, string>;
1147
1147
  }
1148
1148
 
1149
+ declare interface MinimalResourceForSharing {
1150
+ id: string;
1151
+ title: string;
1152
+ }
1153
+
1149
1154
  export declare type ModelItem = DropdownItem;
1150
1155
 
1151
1156
  declare type NoneOptions = {};
@@ -1286,6 +1291,11 @@ declare interface ResourceManagementPanelProps {
1286
1291
  onDashboardItemClick?: (dashboardId: string) => void;
1287
1292
  }
1288
1293
 
1294
+ export declare enum ResourceType {
1295
+ DASHBOARD = "dashboard",
1296
+ VISUAL = "visual"
1297
+ }
1298
+
1289
1299
  export declare function ScheduleDashboard({ triggerButtonClassName, }: {
1290
1300
  triggerButtonClassName?: string;
1291
1301
  }): JSX_2.Element;
@@ -1328,6 +1338,16 @@ declare function SemaphorQueryClient({ children, }: {
1328
1338
  export { SemaphorQueryClient as SemaphorDataProvider }
1329
1339
  export { SemaphorQueryClient }
1330
1340
 
1341
+ export declare function ShareDialog({ resource, resourceType, onClose, onShareSuccess, onRemoveSuccess, }: ShareDialogProps): JSX_2.Element;
1342
+
1343
+ declare interface ShareDialogProps {
1344
+ resource: MinimalResourceForSharing;
1345
+ resourceType: ResourceType;
1346
+ onClose: () => void;
1347
+ onShareSuccess?: () => void;
1348
+ onRemoveSuccess?: () => void;
1349
+ }
1350
+
1331
1351
  export declare interface SortByField extends Field {
1332
1352
  role: 'sortby';
1333
1353
  direction: 'asc' | 'desc';
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.0.626",
8
+ "version": "0.0.628",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",