react-semaphor 0.1.163 → 0.1.164
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-lOO1Kawo.js → dashboard-controls-CWQ_gUsq.js} +4 -4
- package/dist/chunks/{dashboard-controls-ChqSrjnv.js → dashboard-controls-Czfs9TsO.js} +1 -1
- package/dist/chunks/{dashboard-export-dialog-h5owxj4H.js → dashboard-export-dialog-DiJIOI6i.js} +3 -3
- package/dist/chunks/{dashboard-export-dialog-BVBiNvo4.js → dashboard-export-dialog-zge97BYd.js} +1 -1
- package/dist/chunks/{dashboard-json-D4Apm_Z0.js → dashboard-json-05FNu5_c.js} +1 -1
- package/dist/chunks/{dashboard-json-Bp8U1SuM.js → dashboard-json-BnUM90on.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-BGY-Nj8j.js → edit-dashboard-visual-BQyiGFIJ.js} +2 -2
- package/dist/chunks/{edit-dashboard-visual-ItNwbDeL.js → edit-dashboard-visual-DvcXroC3.js} +467 -467
- package/dist/chunks/{editor-action-buttons-D91jaw9J.js → editor-action-buttons-0lhAtWvK.js} +2 -2
- package/dist/chunks/{editor-action-buttons-B2mhU48J.js → editor-action-buttons-DChxrcx_.js} +1 -1
- package/dist/chunks/{index-BZpXKhl2.js → index-Ba7cbkS0.js} +4 -4
- package/dist/chunks/{index-CM3-W6qg.js → index-SZ7sy6nw.js} +1 -1
- package/dist/chunks/{resource-management-panel-CG1NjRIJ.js → resource-management-panel-BDDrOqYt.js} +3 -3
- package/dist/chunks/{resource-management-panel-B_pm6Dv6.js → resource-management-panel-Dw5GP_kj.js} +1 -1
- package/dist/chunks/{use-role-aware-display-preferences-DLpbW937.js → use-role-aware-display-preferences-C9ydHtPN.js} +1 -1
- package/dist/chunks/{use-role-aware-display-preferences-VBz5V4SH.js → use-role-aware-display-preferences-Dk-fULeQ.js} +1 -1
- package/dist/chunks/{use-visual-utils-CRbrMwuR.js → use-visual-utils-BOMHKg6C.js} +1 -1
- package/dist/chunks/{use-visual-utils-B1rNqRXZ.js → use-visual-utils-DfO9gvaA.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +4 -4
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +1 -1
- package/package.json +1 -1
package/dist/chunks/{resource-management-panel-CG1NjRIJ.js → resource-management-panel-BDDrOqYt.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 qe, u as me, n as We, az as re, bf as Xe, bg as $e, c as X, bh as ke, aQ as et, aR as tt, B as _, aS as st, aT as at, aU as K, bi as pe, L as oe, bj as nt, bk as it, bl as rt, bm as ve, bn as De, bo as ot, bp as lt, J as dt, bq as ye, e as le, br as Se, bs as Ee, bt as ct, Z as Ve, T as Le, bu as Ae, aY as Te, aZ as Re, a_ as Oe, b0 as Pe, b1 as Ue, b2 as Ie, b3 as Me, b4 as je, bv as ut, bw as ht, bx as Fe, by as ze, bz as Be, bA as mt, bB as He, bC as pt, Q as ne, ay as ft, bD as _e, bE as gt, bF as Dt, aD as xt, aE as Nt, aF as bt, aG as wt, aH as vt, aI as Ce, aJ as fe, aM as Ct, bG as yt, bH as St, bI as Et, bJ as Vt } from "./index-
|
|
2
|
+
import { l as qe, u as me, n as We, az as re, bf as Xe, bg as $e, c as X, bh as ke, aQ as et, aR as tt, B as _, aS as st, aT as at, aU as K, bi as pe, L as oe, bj as nt, bk as it, bl as rt, bm as ve, bn as De, bo as ot, bp as lt, J as dt, bq as ye, e as le, br as Se, bs as Ee, bt as ct, Z as Ve, T as Le, bu as Ae, aY as Te, aZ as Re, a_ as Oe, b0 as Pe, b1 as Ue, b2 as Ie, b3 as Me, b4 as je, bv as ut, bw as ht, bx as Fe, by as ze, bz as Be, bA as mt, bB as He, bC as pt, Q as ne, ay as ft, bD as _e, bE as gt, bF as Dt, aD as xt, aE as Nt, aF as bt, aG as wt, aH as vt, aI as Ce, aJ as fe, aM as Ct, bG as yt, bH as St, bI as Et, bJ as Vt } from "./index-Ba7cbkS0.js";
|
|
3
3
|
import Lt, { useRef as At, useEffect as ie, useState as x } from "react";
|
|
4
|
-
import { a as Ge } from "./use-visual-utils-
|
|
5
|
-
import { u as Tt } from "./use-role-aware-display-preferences-
|
|
4
|
+
import { a as Ge } from "./use-visual-utils-DfO9gvaA.js";
|
|
5
|
+
import { u as Tt } from "./use-role-aware-display-preferences-Dk-fULeQ.js";
|
|
6
6
|
/**
|
|
7
7
|
* @license lucide-react v0.453.0 - ISC
|
|
8
8
|
*
|
package/dist/chunks/{resource-management-panel-B_pm6Dv6.js → resource-management-panel-Dw5GP_kj.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-SZ7sy6nw.js"),c=require("react"),de=require("./use-visual-utils-BOMHKg6C.js"),pe=require("./use-role-aware-display-preferences-C9ydHtPN.js");/**
|
|
2
2
|
* @license lucide-react v0.453.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const a=require("./index-
|
|
1
|
+
"use strict";const a=require("./index-SZ7sy6nw.js"),n=require("react");function f(){const{displayPreferences:c,shouldShowElement:o}=a.useDisplayPreferences(),{currentUser:e,userContext:s}=a.useCurrentUserInfo(),i=n.useMemo(()=>a.getRoleBasedDisplayOverrides(e),[e]),t=n.useMemo(()=>r=>i&&i[r]!==void 0&&i[r]===!1?!1:o(r),[i,o,c]),p=n.useMemo(()=>{var r,d,l,u,h;return{canEdit:((r=s==null?void 0:s.permissions)==null?void 0:r.canEdit)??a.canUserEdit(e),canUseFilters:((d=s==null?void 0:s.permissions)==null?void 0:d.canEdit)??a.canUserUseFilters(e),canManageDashboards:((l=s==null?void 0:s.permissions)==null?void 0:l.canCreateDashboard)??a.canUserManageDashboards(e),canCreateDashboards:((u=s==null?void 0:s.permissions)==null?void 0:u.canCreateDashboard)??a.canUserCreateDashboards(e),canAccessVisuals:((h=s==null?void 0:s.permissions)==null?void 0:h.canEdit)??a.canUserAccessVisuals(e)}},[e,s]);return{displayPreferences:c,shouldShowElement:t,permissions:p,currentUser:e}}exports.useRoleAwareDisplayPreferences=f;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as m, e as t, g as D, f as U, h as b, i as u, j as E, k as g } from "./index-
|
|
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-Ba7cbkS0.js";
|
|
2
2
|
import { useMemo as i } from "react";
|
|
3
3
|
function S() {
|
|
4
4
|
const { displayPreferences: n, shouldShowElement: c } = m(), { currentUser: a, userContext: s } = t(), r = i(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const o=require("./index-
|
|
1
|
+
"use strict";const o=require("./index-SZ7sy6nw.js"),b=require("react");function _(e){const a=e.toUpperCase().indexOf("WHERE"),r=e.toUpperCase().indexOf("GROUP BY"),t=e.toUpperCase().indexOf("LIMIT"),d=e.toUpperCase().indexOf("ORDER BY");let c=e.length;if(d!==-1&&(c=d),t!==-1&&t<c&&(c=t),a!==-1){const n=e.substring(0,a),s=e.substring(a);return`${n} {{ filters | where }} AND ${s.substring(6)}`}else if(r!==-1){const n=e.substring(0,r),s=e.substring(r);return`${n} {{ filters | where }} ${s}`}else{const n=e.substring(0,c),s=e.substring(c);return console.log("beforeClause",n),console.log("afterClause",s),s?`${n} {{ filters | where }} ${s}`:`${n.replace(/;$/,"")} {{ filters | where }}`}}function B(e){const[a,r]=b.useState(null),[t,d]=b.useState(null),c=o.useEnsureReactGlobals();return b.useEffect(()=>{if(!e||e.trim()===""){r(null),d(null);return}if(!c)return;(async()=>{try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error(`Invalid URL format: ${e}`);try{new URL(e)}catch{throw new Error(`Invalid URL: ${e}`)}const l=`${e.endsWith("/")?e:`${e}/`}index.js`;try{if(!(await fetch(l,{method:"HEAD"})).ok)throw new Error(`Module not found at ${l}`)}catch{}const m=await import(l);if(typeof m.useChartStore!="function")throw new Error("useChartStore is not a function");r(()=>m.useChartStore),d(null)}catch(s){const l=s instanceof Error?s.message:"Unknown error";console.error("Failed to load remote chart store:",l),d(l),r(null)}})()},[e,c]),a}function H(e,a){if(e.length===0)return"";if(a){const r=e.find(t=>t.id===a);if(r){const t=r.tabTitle;if(t=="All__Header")return e[0].id;if(t&&t.endsWith("__Header")){const c=t.split("__")[0],n=e.find(s=>s.tabTitle===c);return n?n.id:e[0].id}return a}}return e[0].id}async function j(e,a,r,t){if(!a||!r)throw new Error("Missing auth token or visual ID");const d=["resource-by-id","visual",r],c=t.getQueryData(d);if(c)return console.log("Using cached visual data for:",r),{data:c,fromCache:!0};console.log("Fetching visual data from network for:",r);const n=o.ue.loading("Loading visual...",{position:"top-center"});try{const s=await fetch(`${e}/management/v1/visuals/${r}`,{headers:{Authorization:`Bearer ${a}`}});if(!s.ok)throw new Error("Failed to load visual");const l=await s.json();return t.setQueryData(d,l),o.ue.dismiss(n),{data:l,fromCache:!1}}catch(s){throw o.ue.dismiss(n),s}}function T(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw new Error("Invalid frame object format")}function Q(e,a){var c,n;const r=(e==null?void 0:e.frameObject)??((c=e==null?void 0:e.visual)==null?void 0:c.frameObject);if(!r)return!1;const t=T(r);if(!(t!=null&&t.cards)||t.cards.length===0)return!1;const d=(n=t.cards)==null?void 0:n.find(s=>s.id===t.activeCardId);return d?(o.setupEditorWithCard({...a,frame:t,card:d,visualId:(e==null?void 0:e.id)||t.visualId}),!0):!1}function G(){var g;const{setCardSql:e}=o.useEditorActions(),a=o.useEditorStore(i=>i.frame),r=o.useEditorStore(i=>i.card),t=B(((g=r.customCardPreferences)==null?void 0:g.url)||""),d=o.useEditorStore(i=>i.selectedSchemaName),c=o.useEditorStore(i=>i.selectedDatamodelId),n=o.useEditorStore(i=>i.selectedDatabaseName),s=o.useEditorStore(i=>i.selectedTableName),l=o.useEditorStore(i=>i.selectedConnectionId),m=o.useEditorStore(i=>i.isShowingVisual),f=r.sql;return{getUpdatedFrame:b.useCallback(()=>{var E;let i=f;f&&!f.includes("{{")&&(i=_(f),e(i));const C=(E=t==null?void 0:t.getState())==null?void 0:E.settings,U={...r,dataSource:r.dataSource||{mode:"directSource"},lastSelectedSchema:d,lastSelectedDatamodelId:c,lastSelectedDatabase:n,lastSelectedTable:s,connectionId:l,sql:i,customCfg:m?r.customCfg:null,preferences:r.preferences,...C&&{customCardPreferences:{...r.customCardPreferences,settings:C}}},w=a.cards.map(S=>S.id===r.id?U:S);return{...a,cards:w,activeCardId:H(w,a.activeCardId)}},[r,a,m,d,c,n,s,l,e,t,f])}}function z(){const{authToken:e,tokenProps:a}=o.useSemaphorContext(),r=o.useQueryClient(),t=o.useSelectedVisual(),{selectVisual:d}=o.useManagementActions(),{setFrame:c,setCard:n,setIsDevMode:s,setActiveTabCardId:l,updateDataSource:m,setQueryResultColumns:f,setSelectedConnectionId:V,setSelectedDatabaseName:g,setSelectedSchemaName:i,setSelectedTableName:C,setSelectedDatamodelId:U,setFilterValues:w,setApplyFilters:E}=o.useEditorActions(),{setIsDashboardEditing:S,setIsVisualEditing:$,setSelectedFrameId:v,clearSelectedFrameId:A,addFrame:N,setIsDashboardPanelOpen:R}=o.useDashboardActions(),I=o.useDashboardStore(u=>u.selectedSheetId),D=o.useDashboardStore(u=>u.selectedFrameId),O=o.useDashboardStore(u=>u.dashboard),x=o.useDashboardStore(u=>u.filterValues),y=o.useVisualById((t==null?void 0:t.id)||"",{enabled:!!(t!=null&&t.id)&&!!(e!=null&&e.accessToken)}),M=b.useCallback(async u=>{try{d(u),A();const{data:p,fromCache:h}=await j(a.apiServiceUrl,(e==null?void 0:e.accessToken)||"",u.id,r);if(!Q(p,{setFrame:c,setCard:n,setIsDevMode:s,setActiveTabCardId:l,updateDataSource:m,setQueryResultColumns:f,setSelectedConnectionId:V,setSelectedDatabaseName:g,setSelectedSchemaName:i,setSelectedTableName:C,setSelectedDatamodelId:U,setFilterValues:w,setApplyFilters:E,setIsDashboardEditing:S,setIsVisualEditing:$,dashboard:O,selectedSheetId:I,selectedFrameId:D,filterValues:x}))throw new Error("Failed to setup editor with visual data");return{success:!0,fromCache:h}}catch(p){return console.error("Error editing visual:",p),{success:!1,error:"Failed to load visual for editing"}}},[e==null?void 0:e.accessToken,a.apiServiceUrl,r,d,c,n,S,$,s,l,m,f,V,g,i,C,U,w,E,A,O,I,D,x]),k=b.useCallback(async u=>{var p;try{if(d(u),!I)return{success:!1,error:"No sheet selected. Please select a sheet first."};const{data:h,fromCache:W}=await j(a.apiServiceUrl,(e==null?void 0:e.accessToken)||"",u.id,r),L=(h==null?void 0:h.frameObject)??((p=h==null?void 0:h.visual)==null?void 0:p.frameObject);if(!L)return{success:!1,error:"Visual has no frame data"};const F=T(L);if(!(F!=null&&F.cards)||F.cards.length===0)return{success:!1,error:"Visual frame is malformed"};const P={...o.cloneFrameWithNewIds(F),visualId:u.id};return N(I,P,"end"),S(!0),v(P.id),R(!1),{success:!0,fromCache:W}}catch(h){return console.error("Error adding visual:",h),{success:!1,error:"Failed to add visual to dashboard"}}},[e==null?void 0:e.accessToken,a.apiServiceUrl,r,d,I,N,S,v,R]);return{visual:y.data,isLoading:y.isLoading,isError:y.isError,error:y.error,handleEditLibraryVisual:M,handleAddLibraryVisual:k,getUpdatedFrame:G().getUpdatedFrame,refetch:y.refetch}}exports.useRemoteChartStore=B;exports.useVisualUtils=z;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ax as z, ay as G, p as Y, q as J, az as K, m as _, o as X, u as U, aA as Z, aB as q, t as v, aC as ee, n as h } from "./index-
|
|
1
|
+
import { ax as z, ay as G, p as Y, q as J, az as K, m as _, o as X, u as U, aA as Z, aB as q, t as v, aC as ee, n as h } from "./index-Ba7cbkS0.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-SZ7sy6nw.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,4 +1,4 @@
|
|
|
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-SZ7sy6nw.js"),E=require("./types/index.cjs"),a=require("react/jsx-runtime"),x=require("react"),j=require("./chunks/resource-management-panel-Dw5GP_kj.js"),c=require("./chunks/dashboard-export-dialog-zge97BYd.js");require("react-dom");function M(r){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const s in r)if(s!=="default"){const i=Object.getOwnPropertyDescriptor(r,s);Object.defineProperty(o,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}return o.default=r,Object.freeze(o)}const m=M(x);/**
|
|
2
2
|
* @license lucide-react v0.453.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { l as T, E as g, F as w, S as M, U as P, v as k, w as A, u as F, x as y, y as L, P as R, z as I, B as V, c as v, A as _, G as B, H as U, I as W, J as j, K as q, M as z, N as O, O as Q, C as G } from "./chunks/index-
|
|
2
|
-
import { a8 as oa, a9 as na, D as ta, a1 as ia, ad as da, T as la, Y as ca, Y as ua, Z as ha, a as pa, a4 as ma, aw as fa, ak as Ca, a6 as va, a2 as Da, a3 as ba, ae as ya, am as ga, al as xa, ap as Ea, aq as Na, aj as Sa, a5 as Ta, ai as wa, ab as Ma, ac as Pa, aa as ka, an as Aa, ah as Fa, ag as La, af as Ra, ar as Ia, ao as Va, a0 as _a, at as Ba, av as Ua, au as Wa, o as ja, $ as qa, R as za, a7 as Oa, V as Qa, m as Ga, as as Ha, n as Ya, Q as Ka, _ as $a, W as Ja } from "./chunks/index-
|
|
1
|
+
import { l as T, E as g, F as w, S as M, U as P, v as k, w as A, u as F, x as y, y as L, P as R, z as I, B as V, c as v, A as _, G as B, H as U, I as W, J as j, K as q, M as z, N as O, O as Q, C as G } from "./chunks/index-Ba7cbkS0.js";
|
|
2
|
+
import { a8 as oa, a9 as na, D as ta, a1 as ia, ad as da, T as la, Y as ca, Y as ua, Z as ha, a as pa, a4 as ma, aw as fa, ak as Ca, a6 as va, a2 as Da, a3 as ba, ae as ya, am as ga, al as xa, ap as Ea, aq as Na, aj as Sa, a5 as Ta, ai as wa, ab as Ma, ac as Pa, aa as ka, an as Aa, ah as Fa, ag as La, af as Ra, ar as Ia, ao as Va, a0 as _a, at as Ba, av as Ua, au as Wa, o as ja, $ as qa, R as za, a7 as Oa, V as Qa, m as Ga, as as Ha, n as Ya, Q as Ka, _ as $a, W as Ja } from "./chunks/index-Ba7cbkS0.js";
|
|
3
3
|
import { EMPTY_SELECTION as Za } from "./types/index.js";
|
|
4
4
|
import { jsx as a, jsxs as d } from "react/jsx-runtime";
|
|
5
5
|
import * as p from "react";
|
|
6
6
|
import { useMemo as H } from "react";
|
|
7
|
-
import { ResourceManagementPanel as ee } from "./chunks/resource-management-panel-
|
|
8
|
-
import { A as re, D as oe, S as ne, U as te, V as ie, u as de } from "./chunks/dashboard-export-dialog-
|
|
7
|
+
import { ResourceManagementPanel as ee } from "./chunks/resource-management-panel-BDDrOqYt.js";
|
|
8
|
+
import { A as re, D as oe, S as ne, U as te, V as ie, u as de } from "./chunks/dashboard-export-dialog-DiJIOI6i.js";
|
|
9
9
|
import "react-dom";
|
|
10
10
|
/**
|
|
11
11
|
* @license lucide-react v0.453.0 - ISC
|
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-SZ7sy6nw.js"),r=require("../types/index.cjs");exports.Surfboard=e.DashboardPlus;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;
|
package/dist/surfboard/index.js
CHANGED