react-semaphor 0.1.101 → 0.1.103
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-BOWrupBW.js → dashboard-controls-DAzaYym5.js} +283 -283
- package/dist/chunks/{dashboard-controls-DZ3mfITk.js → dashboard-controls-Ds2RCrWu.js} +2 -2
- package/dist/chunks/{dashboard-json-BHLhFEdC.js → dashboard-json-BQy-8SIJ.js} +1 -1
- package/dist/chunks/{dashboard-json-37BidbHV.js → dashboard-json-o5bAUblk.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-D7Ic8u1b.js → edit-dashboard-visual-BHwFOR_7.js} +3 -3
- package/dist/chunks/{edit-dashboard-visual-BJD5eZpR.js → edit-dashboard-visual-DLOAVvlt.js} +1 -1
- package/dist/chunks/{editor-action-buttons-DpbEl7Rx.js → editor-action-buttons-Bw5bnTxX.js} +2 -2
- package/dist/chunks/{editor-action-buttons-DPAlJF2w.js → editor-action-buttons-rOZTI_GI.js} +1 -1
- package/dist/chunks/{index-CGyjzIO0.js → index-CPOSsRox.js} +13199 -13073
- package/dist/chunks/{index-DUJ50AjE.js → index-dvY8LY1x.js} +150 -150
- package/dist/chunks/{resource-management-panel-Ddyzqha7.js → resource-management-panel-CGTRDq_I.js} +1 -1
- package/dist/chunks/{resource-management-panel-DpASGkNn.js → resource-management-panel-C_TggF7q.js} +2 -2
- package/dist/chunks/{schedule-dashboard-e0SVfJ6s.js → schedule-dashboard-CUvbs5p8.js} +4 -4
- package/dist/chunks/schedule-dashboard-DV_zyKrN.js +6 -0
- package/dist/chunks/{use-visual-utils-CfCFNHJ6.js → use-visual-utils-DcXPSN6e.js} +1 -1
- package/dist/chunks/{use-visual-utils-CFuV8lsO.js → use-visual-utils-s86DJ2mG.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/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/dashboard.d.ts +19 -0
- package/dist/types/main.d.ts +19 -0
- package/dist/types/surfboard.d.ts +19 -0
- package/dist/types/types.d.ts +19 -0
- package/package.json +1 -1
- package/dist/chunks/schedule-dashboard-Dy7czCFY.js +0 -6
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-dvY8LY1x.js"),r=require("../types/index.cjs");exports.Surfboard=e.DashboardPlus;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;
|
package/dist/surfboard/index.js
CHANGED
|
@@ -1491,6 +1491,10 @@ export declare type TStyle = {
|
|
|
1491
1491
|
dark?: StyleProps;
|
|
1492
1492
|
};
|
|
1493
1493
|
|
|
1494
|
+
export declare interface UpdateUserPreferenceRequest {
|
|
1495
|
+
defaultDashboardId: string | null;
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1494
1498
|
/**
|
|
1495
1499
|
* URL Parameter for drill-to-URL interpolation
|
|
1496
1500
|
* Represents a placeholder in the URL template (e.g., {{product_id}})
|
|
@@ -1518,6 +1522,21 @@ declare interface URLParameter {
|
|
|
1518
1522
|
field?: Field;
|
|
1519
1523
|
}
|
|
1520
1524
|
|
|
1525
|
+
export declare interface UserPreference {
|
|
1526
|
+
id: string;
|
|
1527
|
+
actorType: 'ORG_USER' | 'TENANT_USER';
|
|
1528
|
+
projectId: string;
|
|
1529
|
+
defaultDashboardId: string | null;
|
|
1530
|
+
defaultDashboard?: {
|
|
1531
|
+
id: string;
|
|
1532
|
+
title: string;
|
|
1533
|
+
description: string;
|
|
1534
|
+
};
|
|
1535
|
+
preferences: Record<string, any> | null;
|
|
1536
|
+
createdAt: string;
|
|
1537
|
+
updatedAt: string;
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1521
1540
|
/**
|
|
1522
1541
|
* Display mode for visual components - controls which UI elements are shown
|
|
1523
1542
|
*/
|
package/dist/types/main.d.ts
CHANGED
|
@@ -2698,6 +2698,10 @@ export declare type UIConfig = {
|
|
|
2698
2698
|
showDashboardAssistant?: boolean;
|
|
2699
2699
|
};
|
|
2700
2700
|
|
|
2701
|
+
export declare interface UpdateUserPreferenceRequest {
|
|
2702
|
+
defaultDashboardId: string | null;
|
|
2703
|
+
}
|
|
2704
|
+
|
|
2701
2705
|
/**
|
|
2702
2706
|
* URL Parameter for drill-to-URL interpolation
|
|
2703
2707
|
* Represents a placeholder in the URL template (e.g., {{product_id}})
|
|
@@ -2834,6 +2838,21 @@ export declare const useEditorStore: UseBoundStore<Omit<StoreApi<EditorStore>, "
|
|
|
2834
2838
|
setState(nextStateOrUpdater: EditorStore | Partial<EditorStore> | ((state: WritableDraft<EditorStore>) => void), shouldReplace?: boolean | undefined): void;
|
|
2835
2839
|
}>;
|
|
2836
2840
|
|
|
2841
|
+
export declare interface UserPreference {
|
|
2842
|
+
id: string;
|
|
2843
|
+
actorType: 'ORG_USER' | 'TENANT_USER';
|
|
2844
|
+
projectId: string;
|
|
2845
|
+
defaultDashboardId: string | null;
|
|
2846
|
+
defaultDashboard?: {
|
|
2847
|
+
id: string;
|
|
2848
|
+
title: string;
|
|
2849
|
+
description: string;
|
|
2850
|
+
};
|
|
2851
|
+
preferences: Record<string, any> | null;
|
|
2852
|
+
createdAt: string;
|
|
2853
|
+
updatedAt: string;
|
|
2854
|
+
}
|
|
2855
|
+
|
|
2837
2856
|
export declare function useTextFilterHook(filterId: string): {
|
|
2838
2857
|
isLoading: boolean;
|
|
2839
2858
|
isFetching: boolean;
|
|
@@ -1496,6 +1496,10 @@ export declare type TStyle = {
|
|
|
1496
1496
|
dark?: StyleProps;
|
|
1497
1497
|
};
|
|
1498
1498
|
|
|
1499
|
+
export declare interface UpdateUserPreferenceRequest {
|
|
1500
|
+
defaultDashboardId: string | null;
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1499
1503
|
/**
|
|
1500
1504
|
* URL Parameter for drill-to-URL interpolation
|
|
1501
1505
|
* Represents a placeholder in the URL template (e.g., {{product_id}})
|
|
@@ -1523,6 +1527,21 @@ declare interface URLParameter {
|
|
|
1523
1527
|
field?: Field;
|
|
1524
1528
|
}
|
|
1525
1529
|
|
|
1530
|
+
export declare interface UserPreference {
|
|
1531
|
+
id: string;
|
|
1532
|
+
actorType: 'ORG_USER' | 'TENANT_USER';
|
|
1533
|
+
projectId: string;
|
|
1534
|
+
defaultDashboardId: string | null;
|
|
1535
|
+
defaultDashboard?: {
|
|
1536
|
+
id: string;
|
|
1537
|
+
title: string;
|
|
1538
|
+
description: string;
|
|
1539
|
+
};
|
|
1540
|
+
preferences: Record<string, any> | null;
|
|
1541
|
+
createdAt: string;
|
|
1542
|
+
updatedAt: string;
|
|
1543
|
+
}
|
|
1544
|
+
|
|
1526
1545
|
/**
|
|
1527
1546
|
* Display mode for visual components - controls which UI elements are shown
|
|
1528
1547
|
*/
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1488,6 +1488,10 @@ export declare type TStyle = {
|
|
|
1488
1488
|
dark?: StyleProps;
|
|
1489
1489
|
};
|
|
1490
1490
|
|
|
1491
|
+
export declare interface UpdateUserPreferenceRequest {
|
|
1492
|
+
defaultDashboardId: string | null;
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1491
1495
|
/**
|
|
1492
1496
|
* URL Parameter for drill-to-URL interpolation
|
|
1493
1497
|
* Represents a placeholder in the URL template (e.g., {{product_id}})
|
|
@@ -1515,6 +1519,21 @@ declare interface URLParameter {
|
|
|
1515
1519
|
field?: Field;
|
|
1516
1520
|
}
|
|
1517
1521
|
|
|
1522
|
+
export declare interface UserPreference {
|
|
1523
|
+
id: string;
|
|
1524
|
+
actorType: 'ORG_USER' | 'TENANT_USER';
|
|
1525
|
+
projectId: string;
|
|
1526
|
+
defaultDashboardId: string | null;
|
|
1527
|
+
defaultDashboard?: {
|
|
1528
|
+
id: string;
|
|
1529
|
+
title: string;
|
|
1530
|
+
description: string;
|
|
1531
|
+
};
|
|
1532
|
+
preferences: Record<string, any> | null;
|
|
1533
|
+
createdAt: string;
|
|
1534
|
+
updatedAt: string;
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1518
1537
|
/**
|
|
1519
1538
|
* Display mode for visual components - controls which UI elements are shown
|
|
1520
1539
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";const s=require("react/jsx-runtime"),e=require("./index-DUJ50AjE.js"),f=require("./editor-action-buttons-DPAlJF2w.js"),p=require("react"),y=require("./use-visual-utils-CFuV8lsO.js");/**
|
|
2
|
-
* @license lucide-react v0.453.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const k=e.createLucideIcon("CirclePlus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);function F({open:a,onOpenChange:r,isLibraryVisual:t,currentVisualName:n,isSaving:l=!1,onConfirm:h}){const[i,d]=p.useState(t&&n?`Copy of ${n}`:n||""),[c,v]=p.useState(""),[b,D]=p.useState(!t),[j,S]=p.useState(!0);p.useEffect(()=>{a&&(d(t&&n?`Copy of ${n}`:n||""),v(""),D(!t),S(!0))},[a,t,n]);const C=()=>{i.trim()&&(!b&&!j||h({name:i.trim(),description:c.trim()||void 0,saveToLibrary:b,saveToCurrentDashboard:j}))},g=i.trim()&&(b||j);return s.jsx(e.Dialog,{open:a,onOpenChange:r,children:s.jsxs(e.DialogContent,{className:"sm:max-w-[425px]",children:[s.jsxs(e.DialogHeader,{children:[s.jsx(e.DialogTitle,{children:"Save Visual As"}),s.jsx(e.DialogDescription,{children:t?"Create a copy of this visual with a new name":"Save this visual to make it reusable"})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(e.Label,{htmlFor:"name",children:"Name"}),s.jsx(e.Input,{id:"name",value:i,onChange:m=>d(m.target.value),placeholder:"Enter visual name",disabled:l})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(e.Label,{htmlFor:"description",children:"Description (optional)"}),s.jsx(e.Textarea,{id:"description",value:c,onChange:m=>v(m.target.value),placeholder:"Enter visual description",rows:3,disabled:l})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx(e.Label,{children:"Save to:"}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(e.Checkbox,{id:"save-to-dashboard",checked:j,onCheckedChange:m=>S(!!m),disabled:l}),s.jsxs("label",{htmlFor:"save-to-dashboard",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:["Current Dashboard",s.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:t?"(add copy to this dashboard)":"(keep as local visual)"})]})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(e.Checkbox,{id:"save-to-library",checked:b,onCheckedChange:m=>D(!!m),disabled:l}),s.jsxs("label",{htmlFor:"save-to-library",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:["Visual Library",s.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:t?"(save as new reusable visual)":"(make available to all dashboards)"})]})]})]}),!b&&!j&&s.jsx("p",{className:"text-sm text-destructive",children:"Please select at least one destination"})]})]}),s.jsxs(e.DialogFooter,{children:[s.jsx(e.Button,{variant:"outline",onClick:()=>r(!1),disabled:l,children:"Cancel"}),s.jsxs(e.Button,{onClick:C,disabled:!g||l,children:[l&&s.jsx(e.LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),l?"Saving...":"Save"]})]})]})})}function N(){const[a,r]=p.useState(!1),[t,n]=p.useState(!1),[l,h]=p.useState(null),i=e.useEditorStore(o=>o.frame),d=e.useEditorStore(o=>o.card),c=e.useSelectedVisual(),v=e.useDashboardStore(o=>o.selectedSheetId),b=e.useDashboardStore(o=>o.actions.setIsDashboardPanelOpen),{getUpdatedFrame:D}=y.useVisualUtils(),{selectVisual:j}=e.useManagementActions(),{addFrame:S,setSelectedFrameId:C,setIsVisualEditing:g}=e.useDashboardActions(),m=!!(i!=null&&i.visualId),w=(()=>{var o,x;return c!=null&&c.title?c.title:((o=i==null?void 0:i.cards)==null?void 0:o.length)===1&&((x=i.cards[0])!=null&&x.title)?i.cards[0].title:(d==null?void 0:d.title)||"Untitled Visual"})(),u=e.useCreateVisualWithFrame(o=>{if(o!=null&&o.id){if(j(o),t&&l&&v){const x={...l,id:e.v4(),visualId:o.id};S(v,x,"end"),C(x.id),n(!1),h(null),g(!1)}b(!0),r(!1)}});return{saveAsDialogOpen:a,setSaveAsDialogOpen:r,handleSaveAs:async o=>{if(!v){e.ue.error("No sheet selected");return}const x=D(),I=x.cards.length===1?{...x,cards:x.cards.map(A=>({...A,title:o.name}))}:x;if(o.saveToLibrary){n(o.saveToCurrentDashboard),h(I);const A={title:o.name,description:o.description,frameObject:I,isPrivate:!1};u.mutate(A)}else if(o.saveToCurrentDashboard){const A={...I,id:e.v4(),visualId:void 0};S(v,A,"end"),C(A.id),e.ue.success("Visual saved to dashboard"),r(!1),g(!1)}},isLibraryVisual:m,currentVisualName:w,isSaving:u.isPending}}function V({className:a}){const r=e.useEditorStore(u=>u.frame),t=e.useEditorStore(u=>u.card),n=e.useManagementStore(u=>u.selectedVisual),l=e.useDashboardStore(u=>u.selectedFrameId),h=e.useDashboardStore(u=>u.selectedSheetId),{setIsVisualEditing:i}=e.useDashboardActions(),d=!!(r!=null&&r.visualId||n!=null&&n.id),c=!!(r!=null&&r.visualId&&l),v=d&&!c,{saveAsDialogOpen:b,setSaveAsDialogOpen:D,handleSaveAs:j,isLibraryVisual:S,currentVisualName:C,isSaving:g}=N(),{handleAddLibraryVisual:m}=y.useVisualUtils(),w=async()=>{if(!h){e.ue.error("No dashboard sheet selected");return}if(!n){e.ue.error("No visual selected");return}const u=await m(n);u.success?(e.ue.success("Visual added to dashboard"),i(!1)):e.ue.error(u.error||"Failed to add visual to dashboard")};return s.jsxs(s.Fragment,{children:[!d&&s.jsx(f.EditorAcceptButton,{className:a,variant:"default"}),d&&s.jsxs(s.Fragment,{children:[c&&s.jsx(f.VisualApplyLocalButton,{className:a}),v&&h&&t&&(t.sql||e.hasValidCardConfig(t.config))&&s.jsxs(e.Button,{onClick:w,className:e.cn(a),size:"sm",variant:"outline",children:[s.jsx(k,{className:"mr-2 size-4 font-bold"}),"Add to Dashboard"]}),v&&s.jsx(f.VisualSaveButton,{className:a,variant:"default"}),c&&s.jsx(f.VisualSaveAndApplyButton,{className:a}),s.jsxs(e.DropdownMenu,{modal:!1,children:[s.jsx(e.DropdownMenuTrigger,{asChild:!0,children:s.jsx(e.Button,{variant:"outline",size:"sm",className:e.cn(a,"w-8 p-0"),children:s.jsx(e.EllipsisVertical,{className:"h-4 w-4"})})}),s.jsx(e.DropdownMenuContent,{align:"end",children:s.jsxs(e.DropdownMenuItem,{onClick:u=>{u.stopPropagation(),D(!0)},children:[s.jsx(f.Save,{className:"mr-2 h-4 w-4"}),"Save As..."]})})]})]}),!d&&s.jsxs(e.DropdownMenu,{modal:!1,children:[s.jsx(e.DropdownMenuTrigger,{asChild:!0,children:s.jsx(e.Button,{variant:"outline",size:"sm",className:e.cn(a,"w-8 p-0"),children:s.jsx(e.EllipsisVertical,{className:"h-4 w-4"})})}),s.jsx(e.DropdownMenuContent,{align:"end",children:s.jsxs(e.DropdownMenuItem,{onClick:()=>D(!0),children:[s.jsx(f.Save,{className:"mr-2 h-4 w-4"}),"Save As..."]})})]}),s.jsx(f.EditorCancelButton,{className:a}),s.jsx(F,{open:b,onOpenChange:u=>{g||D(u)},isLibraryVisual:S,currentVisualName:C,isSaving:g,onConfirm:j})]})}function E({className:a,switchClassName:r}){const t=e.useEditorStore(d=>d.isDevMode),n=e.useDashboardStore(d=>d.isVisualEditing),{setIsDevMode:l}=e.useEditorActions(),{config:h}=p.useContext(e.SemaphorContext).tokenProps,i=(h==null?void 0:h.showAdvancedMode)!==!1;return!n||!i?null:s.jsxs("div",{className:e.cn("flex items-center space-x-2",a),children:[s.jsx(e.DevModeSwitch,{className:e.cn("",r),checked:t,onCheckedChange:()=>l(!t),id:"advanced-mode",icon:s.jsx(e.CodeXml,{className:"h-4 w-4"}),tooltip:t?"Standard Mode":"Advanced Mode"}),s.jsx("label",{htmlFor:"advanced-mode",className:"sr-only",children:"Advanced Mode"})]})}function T(a){var r;return{...a,sheets:(r=a==null?void 0:a.sheets)==null?void 0:r.map(t=>{var n;return{...t,frames:(n=t.frames)==null?void 0:n.map(l=>{var h;return{...l,cards:(h=l.cards)==null?void 0:h.map(i=>M(i))}})}})}}function M(a){return{...a,customCfg:B(a.customCfg),data:[]}}function B(a){var r,t;return a?{...a,data:{...a==null?void 0:a.data,labels:[],datasets:(t=(r=a==null?void 0:a.data)==null?void 0:r.datasets)==null?void 0:t.map(n=>({...n,data:[]}))}}:null}function O({triggerButtonClassName:a}){const[r,t]=p.useState(!1),n=e.useDashboardStore(d=>{var c;return(c=d.dashboard)==null?void 0:c.id}),l=e.useDashboardStore(d=>{var c;return(c=d.dashboard)==null?void 0:c.title}),h=e.useDashboardStore(d=>{var c;return(c=d.dashboard)==null?void 0:c.sheets}),i=e.useDashboardStore(d=>d.selectedSheetId);return h==null||h.find(d=>d.id===i),n?s.jsxs(s.Fragment,{children:[s.jsx(e.IconButton,{tooltip:"Schedule Dashboard",className:e.cn("h-7 p-2",a),onClick:()=>t(!0),children:s.jsx(e.Clock,{className:"size-4"})}),s.jsx(e.EmailScheduleDialog,{open:r,onOpenChange:t,dashboardId:n,dashboardName:l})]}):null}exports.AdvancedModeToggle=E;exports.ScheduleDashboard=O;exports.VisualEditingControls=V;exports.cleanCard=M;exports.getDashbaordStateWithoutData=T;
|