semaphor 0.0.129 → 0.0.130

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 (33) hide show
  1. package/dist/chunks/dashboard-controls-BMLlOkS9.js +1539 -0
  2. package/dist/chunks/dashboard-controls-BdQcYRkf.js +26 -0
  3. package/dist/chunks/dashboard-export-dialog-BpNaUA5x.js +6 -0
  4. package/dist/chunks/dashboard-export-dialog-CbMcLZvW.js +602 -0
  5. package/dist/chunks/dashboard-json-DD-d9gYu.js +66 -0
  6. package/dist/chunks/dashboard-json-DgQozDAv.js +1 -0
  7. package/dist/chunks/edit-dashboard-visual-CR3NqJ7m.js +200 -0
  8. package/dist/chunks/edit-dashboard-visual-CRMhXxdG.js +15517 -0
  9. package/dist/chunks/editor-action-buttons-CNQtSzD5.js +270 -0
  10. package/dist/chunks/editor-action-buttons-DYrSZQhJ.js +6 -0
  11. package/dist/chunks/index-CReqnEJI.js +1081 -0
  12. package/dist/chunks/{index-CE57mw6l.js → index-QdSI9E0a.js} +82751 -68873
  13. package/dist/chunks/resource-management-panel-CBXn6QHi.js +895 -0
  14. package/dist/chunks/resource-management-panel-CXSx9QhW.js +6 -0
  15. package/dist/chunks/use-click-outside-B9T3lmcw.js +1 -0
  16. package/dist/chunks/use-click-outside-CMeO_QFI.js +16 -0
  17. package/dist/chunks/use-visual-utils-BDuNB0Iz.js +1 -0
  18. package/dist/chunks/use-visual-utils-BnCl386t.js +331 -0
  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 +138 -161
  23. package/dist/style.css +1 -1
  24. package/dist/surfboard/index.cjs +1 -1
  25. package/dist/surfboard/index.js +4 -4
  26. package/dist/types/dashboard.d.ts +500 -16
  27. package/dist/types/main.d.ts +882 -82
  28. package/dist/types/surfboard.d.ts +500 -16
  29. package/dist/types/types.d.ts +500 -16
  30. package/package.json +11 -7
  31. package/dist/chunks/dashboard-plus-BZ8k_sGe.js +0 -280
  32. package/dist/chunks/dashboard-plus-qMRXHdYf.js +0 -20761
  33. package/dist/chunks/index-Bo0bvCRT.js +0 -975
package/dist/index.js CHANGED
@@ -1,10 +1,11 @@
1
- import { c as x, E as v, F as N, S as w, U as A, a as L, C as _, u as E, b as g, d as P, P as k, e as W, B as F, f as M, g as R, h as V, i as B, j as O, I as Q, k as I, l as j, m as q, n as U, o as z } from "./chunks/index-CE57mw6l.js";
2
- import { D as ne, t as ie, R as de, r as le, r as ce, $ as Ye, K as ue, w as he, y as pe, M as fe, L as me, Q as Me, T as Ce, J as De, v as ge, H as ve, N as ye, G as be, A as Te, z as Se, V as xe, O as Ne, s as we, X as Ae, Z as Le, Y as _e, _ as Ee, x as Pe, p as ke, a1 as We, W as Fe, a0 as Re, q as Ve } from "./chunks/index-CE57mw6l.js";
3
- import { EMPTY_SELECTION as Oe } from "./types/index.js";
4
- import { A as Ie, R as je, b as qe, S as Ue, D as ze, a as Ge, V as He, c as $e, g as Ke } from "./chunks/dashboard-plus-qMRXHdYf.js";
5
- import { jsx as e, jsxs as d } from "react/jsx-runtime";
6
- import * as h from "react";
7
- import { useMemo as G } from "react";
1
+ import { b as S, E as g, F as P, S as w, U as M, m as k, n as A, u as F, o as y, p as L, P as R, q as I, B as V, c as v, r as _, s as U, t as B, v as W, I as j, w as q, x as z, y as O, z as Q, C as G } from "./chunks/index-QdSI9E0a.js";
2
+ import { Z as oa, _ as na, D as ta, N as ia, a2 as la, R as da, J as ca, J as ua, K as ha, a as pa, T as fa, al as ma, a9 as Ca, W as va, O as ba, Q as Da, a3 as ya, ab as ga, aa as xa, ae as Ea, af as Na, a8 as Ta, V as Sa, a7 as Pa, a0 as wa, a1 as Ma, $ as ka, ac as Aa, a6 as Fa, a5 as La, a4 as Ra, ag as Ia, ad as Va, M as _a, ai as Ua, ak as Ba, aj as Wa, g as ja, A as qa, Y as za, G as Oa, e as Qa, ah as Ga, f as Ha, H as Ka } from "./chunks/index-QdSI9E0a.js";
3
+ import { EMPTY_SELECTION as $a } from "./types/index.js";
4
+ import { jsx as a, jsxs as l } from "react/jsx-runtime";
5
+ import * as p from "react";
6
+ import { useMemo as H } from "react";
7
+ import { ResourceManagementPanel as Xa } from "./chunks/resource-management-panel-CBXn6QHi.js";
8
+ import { A as ae, D as ee, S as se, U as re, V as oe, u as ne } from "./chunks/dashboard-export-dialog-CbMcLZvW.js";
8
9
  import "react-dom";
9
10
  /**
10
11
  * @license lucide-react v0.453.0 - ISC
@@ -12,176 +13,144 @@ import "react-dom";
12
13
  * This source code is licensed under the ISC license.
13
14
  * See the LICENSE file in the root directory of this source tree.
14
15
  */
15
- const H = x("RefreshCw", [
16
+ const K = S("RefreshCw", [
16
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" }],
17
18
  ["path", { d: "M21 3v5h-5", key: "1q7to0" }],
18
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" }],
19
20
  ["path", { d: "M8 16H3v5", key: "1cv678" }]
20
21
  ]);
21
- function ae(a) {
22
- const { displayPreferences: o, ...i } = a, l = {
22
+ function aa(s) {
23
+ const { displayPreferences: o, ...i } = s, d = {
23
24
  ...i,
24
- id: a.dashboardId
25
+ id: s.dashboardId
25
26
  // override the id to the dashboard id so that the dashboard is not loaded
26
27
  };
27
- return /* @__PURE__ */ e(v, { FallbackComponent: N, children: /* @__PURE__ */ e(w, { dashboardProps: l, children: /* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(L, { displayPreferences: o, children: /* @__PURE__ */ e(_, { type: "visual", ...l, children: /* @__PURE__ */ e($, { cardId: a.cardId }) }) }) }) }) });
28
+ return /* @__PURE__ */ a(g, { FallbackComponent: P, children: /* @__PURE__ */ a(w, { dashboardProps: d, children: /* @__PURE__ */ a(M, { children: /* @__PURE__ */ a(k, { displayPreferences: o, children: /* @__PURE__ */ a(A, { type: "visual", ...d, children: /* @__PURE__ */ a(Y, { cardId: s.cardId }) }) }) }) }) });
28
29
  }
29
- function $({ cardId: a }) {
30
- const o = E((r) => {
31
- var t;
32
- return (t = r.dashboard) == null ? void 0 : t.sheets;
33
- }), { card: i, frame: l } = G(() => {
34
- const r = o == null ? void 0 : o.flatMap((s) => s.frames), t = r == null ? void 0 : r.flatMap((s) => s == null ? void 0 : s.cards), p = t == null ? void 0 : t.find((s) => (s == null ? void 0 : s.id) === a), f = r == null ? void 0 : r.find(
35
- (s) => {
36
- var u;
37
- return (u = s == null ? void 0 : s.cards) == null ? void 0 : u.find((c) => (c == null ? void 0 : c.id) === a);
30
+ function Y({ cardId: s }) {
31
+ const o = F((r) => {
32
+ var n;
33
+ return (n = r.dashboard) == null ? void 0 : n.sheets;
34
+ }), { card: i, frame: d } = 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), f = n == null ? void 0 : n.find((e) => (e == null ? void 0 : e.id) === s), m = r == null ? void 0 : r.find(
36
+ (e) => {
37
+ var h;
38
+ return (h = e == null ? void 0 : e.cards) == null ? void 0 : h.find((c) => (c == null ? void 0 : c.id) === s);
38
39
  }
39
40
  );
40
- return { card: p, frame: f };
41
- }, [o, a]);
42
- return !i || !l ? /* @__PURE__ */ e(
43
- g,
41
+ return { card: f, frame: m };
42
+ }, [o, s]);
43
+ return !i || !d ? /* @__PURE__ */ a(
44
+ y,
44
45
  {
45
46
  error: new Error("Card not found"),
46
47
  resetErrorBoundary: () => {
47
48
  },
48
- customerFacingMessage: `Card not found with ID: ${a}`
49
+ customerFacingMessage: `Card not found with ID: ${s}`
49
50
  }
50
- ) : /* @__PURE__ */ e("main", { className: "flex h-full grow flex-col", children: /* @__PURE__ */ e(
51
- v,
51
+ ) : /* @__PURE__ */ a("main", { className: "flex h-full grow flex-col", children: /* @__PURE__ */ a(
52
+ g,
52
53
  {
53
54
  FallbackComponent: ({
54
55
  error: r,
55
- resetErrorBoundary: t
56
- }) => /* @__PURE__ */ e(
57
- g,
56
+ resetErrorBoundary: n
57
+ }) => /* @__PURE__ */ a(
58
+ y,
58
59
  {
59
60
  error: r,
60
- resetErrorBoundary: t,
61
+ resetErrorBoundary: n,
61
62
  customerFacingMessage: "Error creating visual. Please try again."
62
63
  }
63
64
  ),
64
- children: /* @__PURE__ */ e(P, { card: i, frame: l })
65
+ children: /* @__PURE__ */ a(L, { card: i, frame: d })
65
66
  }
66
67
  ) });
67
68
  }
68
- const se = [
69
- // Day granularity formats
70
- "MM-DD-YYYY",
71
- "YYYY-MM-DD",
72
- "MM/DD/YYYY",
73
- "DD/MM/YYYY",
74
- "MMMM DD, YYYY",
75
- "MMM DD, YYYY",
76
- "DD MMM YYYY",
77
- // Week granularity formats
78
- "Week of MMM DD, YYYY",
79
- "Week of MMMM DD, YYYY",
80
- "YYYY-WW",
81
- // Month granularity formats
82
- "MMM YYYY",
83
- "MMMM YYYY",
84
- "YYYY-MM",
85
- "MM/YYYY",
86
- "YYYY MMM",
87
- // Quarter granularity formats
88
- "Q1 YYYY",
89
- "YYYY Q1",
90
- "1st Quarter YYYY",
91
- "YYYY-Q1",
92
- "Quarter 1, YYYY",
93
- // Year granularity formats
94
- "YYYY",
95
- "YY",
96
- // Custom format
97
- "custom"
98
- ];
99
- var K = /* @__PURE__ */ ((a) => (a.SUBTOTAL = "__SUBTOTAL__", a.TOTAL = "__TOTAL__", a.ALL = "__ALL__", a))(K || {});
100
- function re({
101
- name: a,
69
+ function ea({
70
+ name: s,
102
71
  items: o,
103
72
  value: i,
104
- onChange: l,
73
+ onChange: d,
105
74
  isLoading: r,
106
- isError: t,
107
- refetch: p,
108
- className: f,
109
- icon: s,
110
- showNone: u = !1
75
+ isError: n,
76
+ refetch: f,
77
+ className: m,
78
+ icon: e,
79
+ showNone: h = !1
111
80
  }) {
112
- const c = h.useRef(null), [C, D] = h.useState(!1), [y, b] = h.useState("100%"), m = u ? [...o || [], { id: "none", name: "None" }] : o;
113
- h.useLayoutEffect(() => {
114
- c.current && b(c.current.offsetWidth);
81
+ const c = p.useRef(null), [b, D] = p.useState(!1), [x, E] = p.useState("100%"), C = h ? [...o || [], { id: "none", name: "None" }] : o;
82
+ p.useLayoutEffect(() => {
83
+ c.current && E(c.current.offsetWidth);
115
84
  }, []);
116
- function T() {
117
- var n;
118
- return r ? "Loading..." : t ? "Error" : i ? (n = o == null ? void 0 : o.find((Y) => Y.id === i)) == null ? void 0 : n.name : `Select ${a}`;
85
+ function N() {
86
+ 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}`;
119
88
  }
120
- function S(n, Y) {
121
- l(Y), D(!1);
89
+ function T(t, u) {
90
+ d(u), D(!1);
122
91
  }
123
- return /* @__PURE__ */ d(k, { open: C, onOpenChange: D, children: [
124
- /* @__PURE__ */ e(W, { asChild: !0, children: /* @__PURE__ */ d(
125
- F,
92
+ return /* @__PURE__ */ l(R, { open: b, onOpenChange: D, children: [
93
+ /* @__PURE__ */ a(I, { asChild: !0, children: /* @__PURE__ */ l(
94
+ V,
126
95
  {
127
96
  ref: c,
128
97
  variant: "outline",
129
98
  role: "combobox",
130
- "aria-expanded": C,
131
- className: M("flex h-9 w-full justify-between", f),
99
+ "aria-expanded": b,
100
+ className: v("flex h-9 w-full justify-between", m),
132
101
  children: [
133
- /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
134
- s && /* @__PURE__ */ e("div", { className: "mr-2", children: s }),
135
- /* @__PURE__ */ e("span", { className: "max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap", children: T() })
102
+ /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
103
+ 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() })
136
105
  ] }),
137
- /* @__PURE__ */ e(R, { className: "size-4 opacity-50" })
106
+ /* @__PURE__ */ a(_, { className: "size-4 opacity-50" })
138
107
  ]
139
108
  }
140
109
  ) }),
141
- /* @__PURE__ */ e(
142
- V,
110
+ /* @__PURE__ */ a(
111
+ U,
143
112
  {
144
113
  className: "w-full p-0",
145
- style: { minWidth: y },
146
- children: /* @__PURE__ */ d(B, { children: [
147
- /* @__PURE__ */ d("div", { className: "flex h-9 items-center justify-between border-b pr-1", children: [
148
- /* @__PURE__ */ e(O, { className: "h-9", placeholder: "Search..." }),
149
- /* @__PURE__ */ e(Q, { className: "h-7", onClick: p, children: /* @__PURE__ */ e(
150
- H,
114
+ style: { minWidth: x },
115
+ children: /* @__PURE__ */ l(B, { children: [
116
+ /* @__PURE__ */ l("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: f, children: /* @__PURE__ */ a(
119
+ K,
151
120
  {
152
- className: M(
121
+ className: v(
153
122
  "size-3.5 opacity-50",
154
123
  r && "animate-spin"
155
124
  )
156
125
  }
157
126
  ) })
158
127
  ] }),
159
- /* @__PURE__ */ d(I, { children: [
160
- /* @__PURE__ */ d(j, { children: [
128
+ /* @__PURE__ */ l(q, { children: [
129
+ /* @__PURE__ */ l(z, { children: [
161
130
  "No ",
162
- a == null ? void 0 : a.toLowerCase(),
131
+ s == null ? void 0 : s.toLowerCase(),
163
132
  " found."
164
133
  ] }),
165
- /* @__PURE__ */ e(q, { children: m == null ? void 0 : m.map((n) => /* @__PURE__ */ e(
166
- U,
134
+ /* @__PURE__ */ a(O, { children: C == null ? void 0 : C.map((t) => /* @__PURE__ */ a(
135
+ Q,
167
136
  {
168
137
  className: "overflow-x-auto",
169
- value: n.name,
170
- onSelect: (Y) => S(Y, n.id),
171
- children: /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
172
- /* @__PURE__ */ e(
173
- z,
138
+ value: t.name,
139
+ onSelect: (u) => T(u, t.id),
140
+ children: /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
141
+ /* @__PURE__ */ a(
142
+ G,
174
143
  {
175
- className: M(
144
+ className: v(
176
145
  "size-4",
177
- i === n.id ? "opacity-100" : "opacity-0"
146
+ i === t.id ? "opacity-100" : "opacity-0"
178
147
  )
179
148
  }
180
149
  ),
181
- /* @__PURE__ */ e("div", { title: n.name, children: n.name })
150
+ /* @__PURE__ */ a("div", { title: t.name, children: t.name })
182
151
  ] })
183
152
  },
184
- n.id
153
+ t.id
185
154
  )) })
186
155
  ] })
187
156
  ] })
@@ -190,53 +159,61 @@ function re({
190
159
  ] });
191
160
  }
192
161
  export {
193
- Ie as AdvancedModeToggle,
194
- re as Combobox,
195
- se as DATE_FORMAT_VALUES,
196
- ne as Dashboard,
197
- ie as DashboardWC,
198
- Oe as EMPTY_SELECTION,
199
- K as PivotMarkerEnum,
200
- je as ResourceManagementPanel,
201
- de as ResourceType,
202
- qe as ScheduleDashboard,
162
+ ae as AdvancedModeToggle,
163
+ oa as CALCULATED_FIELD_ENTITY_MARKER,
164
+ ea as Combobox,
165
+ na as DATE_FORMAT_VALUES,
166
+ ta as Dashboard,
167
+ ee as DashboardExportDialog,
168
+ ia as DashboardWC,
169
+ $a as EMPTY_SELECTION,
170
+ la as PivotMarkerEnum,
171
+ Xa as ResourceManagementPanel,
172
+ da as ResourceType,
173
+ se as ScheduleDashboard,
203
174
  w as SemaphorContextProvider,
204
- le as SemaphorDataProvider,
205
- ce as SemaphorQueryClient,
206
- Ue as ShareDialog,
207
- ze as Surfboard,
208
- ae as Visual,
209
- Ge as VisualBadge,
210
- He as VisualEditingControls,
211
- $e as cleanCard,
212
- Ye as createEmptyKpiConfig,
213
- ue as createSqlGenConfig,
214
- he as downloadPdf,
215
- pe as fmt,
216
- fe as getColumnDataType,
217
- Ke as getDashbaordStateWithoutData,
218
- me as getFilterValueType,
219
- Me as getFormattedTableNameForQuery,
220
- Ce as getQualifiedTableName,
221
- De as getSql,
222
- ge as invalidateToken,
223
- ve as isBooleanDataType,
224
- ye as isColumnInSqlGen,
225
- be as isDateDataType,
226
- Te as isNumberDataType,
227
- Se as isTextDataType,
228
- xe as resolveDataType,
229
- Ne as resolveDatamodelName,
230
- we as useCard,
231
- Ae as useCurrentActiveCard,
232
- Le as useCurrentCardConfig,
233
- _e as useCurrentSheetActiveCards,
234
- Ee as useDashboardActions,
235
- E as useDashboardStore,
236
- Pe as useDataColumns,
237
- ke as useDateFilterHook,
238
- We as useEditorActions,
239
- Fe as useEditorAside,
240
- Re as useEditorStore,
241
- Ve as useTextFilterHook
175
+ ca as SemaphorDataProvider,
176
+ ua as SemaphorQueryClient,
177
+ ha as ShareDialog,
178
+ pa as Surfboard,
179
+ re as UnsavedChangesAlert,
180
+ aa as Visual,
181
+ oe as VisualEditingControls,
182
+ fa as cloneDeep,
183
+ ma as createEmptyKpiConfig,
184
+ Ca as createSqlGenConfig,
185
+ va as downloadPdf,
186
+ ba as emitDashboardLoad,
187
+ Da as emitDashboardUnload,
188
+ ya as fmt,
189
+ ga as getColumnDataType,
190
+ xa as getFilterValueType,
191
+ Ea as getFormattedTableNameForQuery,
192
+ Na as getQualifiedTableName,
193
+ Ta as getSql,
194
+ Sa as invalidateToken,
195
+ Pa as isBooleanDataType,
196
+ wa as isCalculatedDimension,
197
+ Ma 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
+ Ua as useCurrentActiveCard,
207
+ Ba as useCurrentCardConfig,
208
+ Wa as useCurrentSheetActiveCards,
209
+ ja as useDashboardActions,
210
+ qa as useDashboardQuery,
211
+ F as useDashboardStore,
212
+ za as useDataColumns,
213
+ Oa as useDateFilterHook,
214
+ Qa as useEditorActions,
215
+ Ga as useEditorAside,
216
+ Ha as useEditorStore,
217
+ ne as usePristineSnapshotInitializer,
218
+ Ka as useTextFilterHook
242
219
  };