react-semaphor 0.1.382 → 0.1.383

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 (50) hide show
  1. package/dist/brand-studio/index.cjs +4 -4
  2. package/dist/brand-studio/index.js +27 -27
  3. package/dist/chunks/{braces-CP8BEzl3.js → braces--20GzUQh.js} +1 -1
  4. package/dist/chunks/{braces-CGi-YFZp.js → braces-C0Vh_Mft.js} +1 -1
  5. package/dist/chunks/{calendar-preferences-dialog-CV4xF2Tp.js → calendar-preferences-dialog-B-VsxhsA.js} +3 -3
  6. package/dist/chunks/calendar-preferences-dialog-DE67Z3oQ.js +1 -0
  7. package/dist/chunks/{dashboard-briefing-launcher-BT00MvGB.js → dashboard-briefing-launcher-BIj3X7b3.js} +107 -106
  8. package/dist/chunks/dashboard-briefing-launcher-Czx6BcXW.js +80 -0
  9. package/dist/chunks/dashboard-controls-BP-DcPFs.js +52 -0
  10. package/dist/chunks/{dashboard-controls-B6y7jkKO.js → dashboard-controls-BXxucM4f.js} +114 -113
  11. package/dist/chunks/dashboard-json-BNwshkK2.js +1 -0
  12. package/dist/chunks/{dashboard-json-CfIUG8k1.js → dashboard-json-C6oZuipD.js} +8 -8
  13. package/dist/chunks/edit-dashboard-visual-BAprin3J.js +178 -0
  14. package/dist/chunks/{edit-dashboard-visual-DMbf89xa.js → edit-dashboard-visual-CmfrI_L3.js} +1277 -1276
  15. package/dist/chunks/{index-CrKxP9uF.js → index-4W_ElSBJ.js} +219 -239
  16. package/dist/chunks/{index-BAsWLkZ8.js → index-icb12JV1.js} +879 -932
  17. package/dist/chunks/{layout-grid-jJQUqDN9.js → layout-grid-B7-klXiK.js} +1 -1
  18. package/dist/chunks/{layout-grid-BsKH3TgY.js → layout-grid-DV89AC9_.js} +1 -1
  19. package/dist/chunks/{palette-xU9Qt6bE.js → palette-5IwhMbSF.js} +1 -1
  20. package/dist/chunks/{palette-9zLPGlj2.js → palette-Dj-dgPYh.js} +1 -1
  21. package/dist/chunks/{save-DzciESDh.js → save-16C6YSW2.js} +1 -1
  22. package/dist/chunks/{save-8A_q6K4E.js → save-C5fwVdTF.js} +1 -1
  23. package/dist/chunks/search-0LmWwZzW.js +57 -0
  24. package/dist/chunks/search-Dq1Mbb03.js +21 -0
  25. package/dist/chunks/{switch-DArtNJZh.js → switch-DUdaHFZQ.js} +2332 -2419
  26. package/dist/chunks/{switch-k7kj6NRg.js → switch-bdJp0Bkw.js} +29 -54
  27. package/dist/chunks/use-create-flow-overlay-state-BIHKf_XK.js +21 -0
  28. package/dist/chunks/{use-create-flow-overlay-state-BdG1DiSx.js → use-create-flow-overlay-state-YvqCp6Zo.js} +74 -74
  29. package/dist/chunks/x-B_cx7LwM.js +26 -0
  30. package/dist/chunks/x-IdR_js6f.js +139 -0
  31. package/dist/dashboard/index.cjs +1 -1
  32. package/dist/dashboard/index.js +1 -1
  33. package/dist/data-app-builder/index.cjs +23 -23
  34. package/dist/data-app-builder/index.js +17 -15
  35. package/dist/data-app-sdk/index.cjs +68 -1
  36. package/dist/data-app-sdk/index.js +2705 -422
  37. package/dist/index.cjs +1 -1
  38. package/dist/index.js +14 -14
  39. package/dist/surfboard/index.cjs +1 -1
  40. package/dist/surfboard/index.js +2 -2
  41. package/dist/types/data-app-sdk.d.ts +127 -1
  42. package/package.json +1 -1
  43. package/dist/chunks/calendar-preferences-dialog-rDDobeLo.js +0 -1
  44. package/dist/chunks/dashboard-briefing-launcher-Dcbh-mjY.js +0 -80
  45. package/dist/chunks/dashboard-controls-CRqnPibB.js +0 -52
  46. package/dist/chunks/dashboard-json-DEQqRR1x.js +0 -1
  47. package/dist/chunks/edit-dashboard-visual-wDOcHak3.js +0 -178
  48. package/dist/chunks/index-BxM99sFL.js +0 -1
  49. package/dist/chunks/index-CuHybtft.js +0 -51
  50. package/dist/chunks/use-create-flow-overlay-state-ipeaE65_.js +0 -21
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-CrKxP9uF.js"),d=require("./chunks/common-types-C73-Ud1-.js"),N=require("./chunks/calendar-preferences-dialog-rDDobeLo.js"),t=require("react/jsx-runtime"),a=require("./chunks/switch-k7kj6NRg.js"),C=require("react"),y=require("./types/index.cjs"),r=require("./chunks/dashboard-briefing-launcher-Dcbh-mjY.js"),P=require("./chunks/use-debounced-dirty-check-XHSwAefL.js");require("./chunks/analyze-result-contract-CtXfp3nv.js");require("react-dom");require("./chunks/index-DRlMUglg.js");const S=require("./chunks/normalize-dashboard-for-dirty-check-BXRUMVb2.js");require("./chunks/index-BxM99sFL.js");function _(i){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const n in i)if(n!=="default"){const u=Object.getOwnPropertyDescriptor(i,n);Object.defineProperty(o,n,u.get?u:{enumerable:!0,get:()=>i[n]})}}return o.default=i,Object.freeze(o)}const h=_(C);function R(i){const{displayPreferences:o,cardId:n,...u}=i,s={...u,id:i.dashboardId};return t.jsx(e.ErrorBoundary,{FallbackComponent:e.Fallback,children:t.jsxs(e.SemaphorContextProvider,{dashboardProps:s,children:[t.jsx(e.SemaphorReadyIndicator,{componentType:"visual",componentId:i.cardId}),t.jsx(e.UXProvider,{appearance:i.appearance,children:t.jsx(e.DisplayPreferencesProvider,{displayPreferences:o,children:t.jsx(e.Container,{type:"visual",cardId:n,...s,children:t.jsx(w,{cardId:n})})})})]})})}function w({cardId:i}){const o=a.useDashboardStore(s=>{var c;return(c=s.dashboard)==null?void 0:c.sheets}),{card:n,frame:u}=C.useMemo(()=>{const s=o==null?void 0:o.flatMap(l=>l.frames),c=s==null?void 0:s.flatMap(l=>l==null?void 0:l.cards),D=c==null?void 0:c.find(l=>(l==null?void 0:l.id)===i),E=s==null?void 0:s.find(l=>{var p;return(p=l==null?void 0:l.cards)==null?void 0:p.find(g=>(g==null?void 0:g.id)===i)});return{card:D,frame:E}},[o,i]);return!n||!u?t.jsx(e.FallbackVisual,{error:new Error("Card not found"),resetErrorBoundary:()=>{},customerFacingMessage:`Card not found with ID: ${i}`}):t.jsx("main",{className:"flex h-full grow flex-col",children:t.jsx(e.ErrorBoundary,{FallbackComponent:({error:s,resetErrorBoundary:c})=>t.jsx(e.FallbackVisual,{error:s,resetErrorBoundary:c,customerFacingMessage:"Error creating visual. Please try again."}),children:t.jsx(e.DashboardCard,{card:n,frame:u})})})}function j(i,o,n,u){C.useEffect(()=>{i&&!n&&o&&u(e.cloneDeep(o))},[i,n,o,u])}function L({name:i,items:o,value:n,onChange:u,isLoading:s,isError:c,refetch:D,className:E,icon:l,showNone:p=!1}){const g=h.useRef(null),[b,T]=h.useState(!1),[B,A]=h.useState("100%"),x=p?[...o||[],{id:"none",name:"None"}]:o;h.useLayoutEffect(()=>{g.current&&A(g.current.offsetWidth)},[]);function v(){var f;return s?"Loading...":c?"Error":n?(f=o==null?void 0:o.find(m=>m.id===n))==null?void 0:f.name:`Select ${i}`}function F(f,m){u(m),T(!1)}return t.jsxs(a.Popover,{open:b,onOpenChange:T,children:[t.jsx(a.PopoverTrigger,{asChild:!0,children:t.jsxs(a.Button,{ref:g,variant:"outline",role:"combobox","aria-expanded":b,className:a.cn("flex h-9 w-full justify-between",E),children:[t.jsxs("div",{className:"flex items-center gap-2",children:[l&&t.jsx("div",{className:"mr-2",children:l}),t.jsx("span",{className:"max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap",children:v()})]}),t.jsx(a.ChevronDown,{className:"size-4 opacity-50"})]})}),t.jsx(a.PopoverContent,{className:"w-full p-0",style:{minWidth:B},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:a.cn("size-3.5 opacity-50",s&&"animate-spin")})})]}),t.jsxs(e.CommandList,{children:[t.jsxs(e.CommandEmpty,{children:["No ",i==null?void 0:i.toLowerCase()," found."]}),t.jsx(e.CommandGroup,{children:x==null?void 0:x.map(f=>t.jsx(e.CommandItem,{className:"overflow-x-auto",value:f.name,onSelect:m=>F(m,f.id),children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(a.Check,{className:a.cn("size-4",n===f.id?"opacity-100":"opacity-0")}),t.jsx("div",{title:f.name,children:f.name})]})},f.id))})]})]})})]})}function M(i,o){C.useEffect(()=>(i&&o&&(window.__SEMAPHOR_PRINT_STATE__={...o}),()=>{i&&window.__SEMAPHOR_PRINT_STATE__&&delete window.__SEMAPHOR_PRINT_STATE__}),[i,o])}exports.CardSummary=e.CardSummary;exports.Dashboard=e.Dashboard;exports.DashboardCreateDialogBase=e.DashboardCreateDialogBase;exports.DashboardExportDialog=e.DashboardExportDialog;exports.DashboardWC=e.DashboardWC;exports.ExportError=e.ExportError;exports.MatrixTableVisual=e.MatrixTableVisual;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.cancelExport=e.cancelExport;exports.cloneDeep=e.cloneDeep;exports.createExport=e.createExport;exports.downloadDocumentPdf=e.downloadDocumentPdf;exports.downloadPdf=e.downloadPdf;exports.formatFileSize=e.formatFileSize;exports.getDownloadUrl=e.getDownloadUrl;exports.getExportStatus=e.getExportStatus;exports.getExports=e.getExports;exports.isExportComplete=e.isExportComplete;exports.isExportInProgress=e.isExportInProgress;exports.useActiveExports=e.useActiveExports;exports.useAddNewFrame=e.useAddNewFrame;exports.useCard=e.useCard;exports.useCardSummary=e.useCardSummary;exports.useDashboardById=e.useDashboardById;exports.useDashboardQuery=e.useDashboardQuery;exports.useDashboardSummary=e.useDashboardSummary;exports.useDataColumns=e.useDataColumns;exports.useDateFilterHook=e.useDateFilterHook;exports.useEditorAside=e.useEditorAside;exports.useExportActions=e.useExportActions;exports.useExportStore=e.useExportStore;exports.useInProgressExportsCount=e.useInProgressExportsCount;exports.useManagementStore=e.useManagementStore;exports.useResourceManagement=e.useResourceManagement;exports.useTextFilterHook=e.useTextFilterHook;exports.CALCULATED_FIELD_ENTITY_MARKER=d.CALCULATED_FIELD_ENTITY_MARKER;exports.CONTROL_CARD_DEFAULT_VALUE=d.CONTROL_CARD_DEFAULT_VALUE;exports.DATE_FORMAT_VALUES=d.DATE_FORMAT_VALUES;exports.EMPTY_SELECTION=d.EMPTY_SELECTION;exports.PivotMarkerEnum=d.PivotMarkerEnum;exports.getFieldRuntimeColumnName=d.getFieldRuntimeColumnName;exports.hasCalculatedFieldMarker=d.hasCalculatedFieldMarker;exports.hasCalculatedFormulaInputs=d.hasCalculatedFormulaInputs;exports.isCalculatedDimension=d.isCalculatedDimension;exports.isCalculatedField=d.isCalculatedField;exports.isCalculatedMetric=d.isCalculatedMetric;exports.CalendarPreferencesDialog=N.CalendarPreferencesDialog;exports.createEmptyKpiConfig=a.createEmptyKpiConfig;exports.createSqlGenConfig=a.createSqlGenConfig;exports.emitDashboardLoad=a.emitDashboardLoad;exports.emitDashboardUnload=a.emitDashboardUnload;exports.fmt=a.fmt;exports.getColumnDataType=a.getColumnDataType;exports.getFilterValueType=a.getFilterValueType;exports.getFormattedTableNameForQuery=a.getFormattedTableNameForQuery;exports.getQualifiedTableName=a.getQualifiedTableName;exports.getSql=a.getSql;exports.invalidateToken=a.invalidateToken;exports.isBooleanDataType=a.isBooleanDataType;exports.isColumnInSqlGen=a.isColumnInSqlGen;exports.isDateDataType=a.isDateDataType;exports.isNumberDataType=a.isNumberDataType;exports.isTextDataType=a.isTextDataType;exports.resolveDataType=a.resolveDataType;exports.resolveDatamodelName=a.resolveDatamodelName;exports.useCurrentActiveCard=a.useCurrentActiveCard;exports.useCurrentCardConfig=a.useCurrentCardConfig;exports.useCurrentSheetActiveCards=a.useCurrentSheetActiveCards;exports.useDashboardActions=a.useDashboardActions;exports.useDashboardStore=a.useDashboardStore;exports.useEditorActions=a.useEditorActions;exports.useEditorStore=a.useEditorStore;exports.DEFAULT_CALENDAR_CONTEXT=y.DEFAULT_CALENDAR_CONTEXT;exports.DEFAULT_SEMANTIC_DOMAIN_ACCESS=y.DEFAULT_SEMANTIC_DOMAIN_ACCESS;exports.AdvancedModeToggle=r.AdvancedModeToggle;exports.BriefingAuthor=r.BriefingAuthor;exports.BriefingsApiError=r.BriefingsApiError;exports.DashboardBriefingLauncher=r.DashboardBriefingLauncher;exports.DashboardControlsSettings=r.DashboardControlsSettings;exports.DashboardFilterControlsButton=r.DashboardFilterControlsButton;exports.DashboardFilterControlsLauncher=r.DashboardFilterControlsLauncher;exports.DocumentControlsSettings=r.DocumentControlsSettings;exports.ExportNotificationItem=r.ExportNotificationItem;exports.ExportNotificationList=r.ExportNotificationList;exports.NotificationBell=r.NotificationBell;exports.UnsavedChangesAlert=r.UnsavedChangesAlert;exports.VisualEditingControls=r.VisualEditingControls;exports.VisualsLibraryDialog=r.VisualsLibraryDialog;exports.WatchDashboardButton=r.WatchDashboardButton;exports.applyBriefingFormPatch=r.applyBriefingFormPatch;exports.briefingFormDraftToCreateRequest=r.briefingFormDraftToCreateRequest;exports.briefingFormDraftToUpdateRequest=r.briefingFormDraftToUpdateRequest;exports.briefingToFormDraft=r.briefingToFormDraft;exports.cancelBriefingPreviewRun=r.cancelBriefingPreviewRun;exports.cancelBriefingRun=r.cancelBriefingRun;exports.createBriefing=r.createBriefing;exports.createBriefingFormDraft=r.createBriefingFormDraft;exports.deleteBriefing=r.deleteBriefing;exports.deleteBriefingRun=r.deleteBriefingRun;exports.getBriefing=r.getBriefing;exports.getBriefingArtifact=r.getBriefingArtifact;exports.getBriefingEvidence=r.getBriefingEvidence;exports.getBriefingPreviewRun=r.getBriefingPreviewRun;exports.getBriefingRun=r.getBriefingRun;exports.listBriefingRuns=r.listBriefingRuns;exports.listBriefingTenantSummaries=r.listBriefingTenantSummaries;exports.listBriefings=r.listBriefings;exports.pauseBriefing=r.pauseBriefing;exports.polishBriefingText=r.polishBriefingText;exports.previewBriefingPlan=r.previewBriefingPlan;exports.resumeBriefing=r.resumeBriefing;exports.runBriefingNow=r.runBriefingNow;exports.runBriefingPreview=r.runBriefingPreview;exports.updateBriefing=r.updateBriefing;exports.useExportPolling=r.useExportPolling;exports.useExportRecovery=r.useExportRecovery;exports.validateBriefingFormDraft=r.validateBriefingFormDraft;exports.useDebouncedDirtyCheck=P.useDebouncedDirtyCheck;exports.normalizeDashboardForDirtyCheck=S.normalizeDashboardForDirtyCheck;exports.serializeDashboardForDirtyCheck=S.serializeDashboardForDirtyCheck;exports.Combobox=L;exports.Visual=R;exports.useExposePrintState=M;exports.usePristineSnapshotInitializer=j;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-4W_ElSBJ.js"),d=require("./chunks/common-types-C73-Ud1-.js"),N=require("./chunks/calendar-preferences-dialog-DE67Z3oQ.js"),t=require("react/jsx-runtime"),a=require("./chunks/switch-bdJp0Bkw.js"),C=require("react"),y=require("./types/index.cjs"),r=require("./chunks/dashboard-briefing-launcher-Czx6BcXW.js"),P=require("./chunks/use-debounced-dirty-check-XHSwAefL.js");require("./chunks/analyze-result-contract-CtXfp3nv.js");require("react-dom");require("./chunks/index-DRlMUglg.js");const S=require("./chunks/normalize-dashboard-for-dirty-check-BXRUMVb2.js");require("./chunks/x-B_cx7LwM.js");function _(i){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const n in i)if(n!=="default"){const u=Object.getOwnPropertyDescriptor(i,n);Object.defineProperty(o,n,u.get?u:{enumerable:!0,get:()=>i[n]})}}return o.default=i,Object.freeze(o)}const h=_(C);function R(i){const{displayPreferences:o,cardId:n,...u}=i,s={...u,id:i.dashboardId};return t.jsx(e.ErrorBoundary,{FallbackComponent:e.Fallback,children:t.jsxs(e.SemaphorContextProvider,{dashboardProps:s,children:[t.jsx(e.SemaphorReadyIndicator,{componentType:"visual",componentId:i.cardId}),t.jsx(e.UXProvider,{appearance:i.appearance,children:t.jsx(e.DisplayPreferencesProvider,{displayPreferences:o,children:t.jsx(e.Container,{type:"visual",cardId:n,...s,children:t.jsx(w,{cardId:n})})})})]})})}function w({cardId:i}){const o=a.useDashboardStore(s=>{var c;return(c=s.dashboard)==null?void 0:c.sheets}),{card:n,frame:u}=C.useMemo(()=>{const s=o==null?void 0:o.flatMap(l=>l.frames),c=s==null?void 0:s.flatMap(l=>l==null?void 0:l.cards),D=c==null?void 0:c.find(l=>(l==null?void 0:l.id)===i),E=s==null?void 0:s.find(l=>{var p;return(p=l==null?void 0:l.cards)==null?void 0:p.find(g=>(g==null?void 0:g.id)===i)});return{card:D,frame:E}},[o,i]);return!n||!u?t.jsx(e.FallbackVisual,{error:new Error("Card not found"),resetErrorBoundary:()=>{},customerFacingMessage:`Card not found with ID: ${i}`}):t.jsx("main",{className:"flex h-full grow flex-col",children:t.jsx(e.ErrorBoundary,{FallbackComponent:({error:s,resetErrorBoundary:c})=>t.jsx(e.FallbackVisual,{error:s,resetErrorBoundary:c,customerFacingMessage:"Error creating visual. Please try again."}),children:t.jsx(e.DashboardCard,{card:n,frame:u})})})}function j(i,o,n,u){C.useEffect(()=>{i&&!n&&o&&u(e.cloneDeep(o))},[i,n,o,u])}function L({name:i,items:o,value:n,onChange:u,isLoading:s,isError:c,refetch:D,className:E,icon:l,showNone:p=!1}){const g=h.useRef(null),[b,T]=h.useState(!1),[B,A]=h.useState("100%"),x=p?[...o||[],{id:"none",name:"None"}]:o;h.useLayoutEffect(()=>{g.current&&A(g.current.offsetWidth)},[]);function v(){var f;return s?"Loading...":c?"Error":n?(f=o==null?void 0:o.find(m=>m.id===n))==null?void 0:f.name:`Select ${i}`}function F(f,m){u(m),T(!1)}return t.jsxs(a.Popover,{open:b,onOpenChange:T,children:[t.jsx(a.PopoverTrigger,{asChild:!0,children:t.jsxs(a.Button,{ref:g,variant:"outline",role:"combobox","aria-expanded":b,className:a.cn("flex h-9 w-full justify-between",E),children:[t.jsxs("div",{className:"flex items-center gap-2",children:[l&&t.jsx("div",{className:"mr-2",children:l}),t.jsx("span",{className:"max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap",children:v()})]}),t.jsx(a.ChevronDown,{className:"size-4 opacity-50"})]})}),t.jsx(a.PopoverContent,{className:"w-full p-0",style:{minWidth:B},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:a.cn("size-3.5 opacity-50",s&&"animate-spin")})})]}),t.jsxs(e.CommandList,{children:[t.jsxs(e.CommandEmpty,{children:["No ",i==null?void 0:i.toLowerCase()," found."]}),t.jsx(e.CommandGroup,{children:x==null?void 0:x.map(f=>t.jsx(e.CommandItem,{className:"overflow-x-auto",value:f.name,onSelect:m=>F(m,f.id),children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(a.Check,{className:a.cn("size-4",n===f.id?"opacity-100":"opacity-0")}),t.jsx("div",{title:f.name,children:f.name})]})},f.id))})]})]})})]})}function M(i,o){C.useEffect(()=>(i&&o&&(window.__SEMAPHOR_PRINT_STATE__={...o}),()=>{i&&window.__SEMAPHOR_PRINT_STATE__&&delete window.__SEMAPHOR_PRINT_STATE__}),[i,o])}exports.CardSummary=e.CardSummary;exports.Dashboard=e.Dashboard;exports.DashboardCreateDialogBase=e.DashboardCreateDialogBase;exports.DashboardExportDialog=e.DashboardExportDialog;exports.DashboardWC=e.DashboardWC;exports.ExportError=e.ExportError;exports.MatrixTableVisual=e.MatrixTableVisual;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.cancelExport=e.cancelExport;exports.cloneDeep=e.cloneDeep;exports.createExport=e.createExport;exports.downloadDocumentPdf=e.downloadDocumentPdf;exports.downloadPdf=e.downloadPdf;exports.formatFileSize=e.formatFileSize;exports.getDownloadUrl=e.getDownloadUrl;exports.getExportStatus=e.getExportStatus;exports.getExports=e.getExports;exports.isExportComplete=e.isExportComplete;exports.isExportInProgress=e.isExportInProgress;exports.useActiveExports=e.useActiveExports;exports.useAddNewFrame=e.useAddNewFrame;exports.useCard=e.useCard;exports.useCardSummary=e.useCardSummary;exports.useDashboardById=e.useDashboardById;exports.useDashboardQuery=e.useDashboardQuery;exports.useDashboardSummary=e.useDashboardSummary;exports.useDataColumns=e.useDataColumns;exports.useDateFilterHook=e.useDateFilterHook;exports.useEditorAside=e.useEditorAside;exports.useExportActions=e.useExportActions;exports.useExportStore=e.useExportStore;exports.useInProgressExportsCount=e.useInProgressExportsCount;exports.useManagementStore=e.useManagementStore;exports.useResourceManagement=e.useResourceManagement;exports.useTextFilterHook=e.useTextFilterHook;exports.CALCULATED_FIELD_ENTITY_MARKER=d.CALCULATED_FIELD_ENTITY_MARKER;exports.CONTROL_CARD_DEFAULT_VALUE=d.CONTROL_CARD_DEFAULT_VALUE;exports.DATE_FORMAT_VALUES=d.DATE_FORMAT_VALUES;exports.EMPTY_SELECTION=d.EMPTY_SELECTION;exports.PivotMarkerEnum=d.PivotMarkerEnum;exports.getFieldRuntimeColumnName=d.getFieldRuntimeColumnName;exports.hasCalculatedFieldMarker=d.hasCalculatedFieldMarker;exports.hasCalculatedFormulaInputs=d.hasCalculatedFormulaInputs;exports.isCalculatedDimension=d.isCalculatedDimension;exports.isCalculatedField=d.isCalculatedField;exports.isCalculatedMetric=d.isCalculatedMetric;exports.CalendarPreferencesDialog=N.CalendarPreferencesDialog;exports.createEmptyKpiConfig=a.createEmptyKpiConfig;exports.createSqlGenConfig=a.createSqlGenConfig;exports.emitDashboardLoad=a.emitDashboardLoad;exports.emitDashboardUnload=a.emitDashboardUnload;exports.fmt=a.fmt;exports.getColumnDataType=a.getColumnDataType;exports.getFilterValueType=a.getFilterValueType;exports.getFormattedTableNameForQuery=a.getFormattedTableNameForQuery;exports.getQualifiedTableName=a.getQualifiedTableName;exports.getSql=a.getSql;exports.invalidateToken=a.invalidateToken;exports.isBooleanDataType=a.isBooleanDataType;exports.isColumnInSqlGen=a.isColumnInSqlGen;exports.isDateDataType=a.isDateDataType;exports.isNumberDataType=a.isNumberDataType;exports.isTextDataType=a.isTextDataType;exports.resolveDataType=a.resolveDataType;exports.resolveDatamodelName=a.resolveDatamodelName;exports.useCurrentActiveCard=a.useCurrentActiveCard;exports.useCurrentCardConfig=a.useCurrentCardConfig;exports.useCurrentSheetActiveCards=a.useCurrentSheetActiveCards;exports.useDashboardActions=a.useDashboardActions;exports.useDashboardStore=a.useDashboardStore;exports.useEditorActions=a.useEditorActions;exports.useEditorStore=a.useEditorStore;exports.DEFAULT_CALENDAR_CONTEXT=y.DEFAULT_CALENDAR_CONTEXT;exports.DEFAULT_SEMANTIC_DOMAIN_ACCESS=y.DEFAULT_SEMANTIC_DOMAIN_ACCESS;exports.AdvancedModeToggle=r.AdvancedModeToggle;exports.BriefingAuthor=r.BriefingAuthor;exports.BriefingsApiError=r.BriefingsApiError;exports.DashboardBriefingLauncher=r.DashboardBriefingLauncher;exports.DashboardControlsSettings=r.DashboardControlsSettings;exports.DashboardFilterControlsButton=r.DashboardFilterControlsButton;exports.DashboardFilterControlsLauncher=r.DashboardFilterControlsLauncher;exports.DocumentControlsSettings=r.DocumentControlsSettings;exports.ExportNotificationItem=r.ExportNotificationItem;exports.ExportNotificationList=r.ExportNotificationList;exports.NotificationBell=r.NotificationBell;exports.UnsavedChangesAlert=r.UnsavedChangesAlert;exports.VisualEditingControls=r.VisualEditingControls;exports.VisualsLibraryDialog=r.VisualsLibraryDialog;exports.WatchDashboardButton=r.WatchDashboardButton;exports.applyBriefingFormPatch=r.applyBriefingFormPatch;exports.briefingFormDraftToCreateRequest=r.briefingFormDraftToCreateRequest;exports.briefingFormDraftToUpdateRequest=r.briefingFormDraftToUpdateRequest;exports.briefingToFormDraft=r.briefingToFormDraft;exports.cancelBriefingPreviewRun=r.cancelBriefingPreviewRun;exports.cancelBriefingRun=r.cancelBriefingRun;exports.createBriefing=r.createBriefing;exports.createBriefingFormDraft=r.createBriefingFormDraft;exports.deleteBriefing=r.deleteBriefing;exports.deleteBriefingRun=r.deleteBriefingRun;exports.getBriefing=r.getBriefing;exports.getBriefingArtifact=r.getBriefingArtifact;exports.getBriefingEvidence=r.getBriefingEvidence;exports.getBriefingPreviewRun=r.getBriefingPreviewRun;exports.getBriefingRun=r.getBriefingRun;exports.listBriefingRuns=r.listBriefingRuns;exports.listBriefingTenantSummaries=r.listBriefingTenantSummaries;exports.listBriefings=r.listBriefings;exports.pauseBriefing=r.pauseBriefing;exports.polishBriefingText=r.polishBriefingText;exports.previewBriefingPlan=r.previewBriefingPlan;exports.resumeBriefing=r.resumeBriefing;exports.runBriefingNow=r.runBriefingNow;exports.runBriefingPreview=r.runBriefingPreview;exports.updateBriefing=r.updateBriefing;exports.useExportPolling=r.useExportPolling;exports.useExportRecovery=r.useExportRecovery;exports.validateBriefingFormDraft=r.validateBriefingFormDraft;exports.useDebouncedDirtyCheck=P.useDebouncedDirtyCheck;exports.normalizeDashboardForDirtyCheck=S.normalizeDashboardForDirtyCheck;exports.serializeDashboardForDirtyCheck=S.serializeDashboardForDirtyCheck;exports.Combobox=L;exports.Visual=R;exports.useExposePrintState=M;exports.usePristineSnapshotInitializer=j;
package/dist/index.js CHANGED
@@ -1,20 +1,20 @@
1
- import { E as T, F as N, S, q as P, U as w, r as _, s as F, t as x, v as R, w as M, h as I, i as L, I as k, x as U, j as O, k as V, l as z, m as H } from "./chunks/index-BAsWLkZ8.js";
2
- import { X as fa, D as ma, V as pa, T as ha, O as ga, aa as Ca, M as Da, A as Ea, H as xa, H as Ta, J as ba, W as ya, a as va, a9 as Ba, a5 as Aa, Q as Na, P as Sa, ad as Pa, a8 as wa, a7 as _a, a6 as Fa, ac as Ra, ab as Ma, a2 as Ia, $ as La, N as ka, Z as Ua, L as Oa, z as Va, Y as za, _ as Ha, B as qa, a4 as Wa, a1 as ja, a0 as Ga, a3 as Qa, y as Ka, K as Xa, G as Ya } from "./chunks/index-BAsWLkZ8.js";
1
+ import { E as T, F as N, S, q as P, U as w, r as _, s as F, t as x, v as R, w as M, h as I, i as L, I as k, x as U, j as O, k as V, l as z, m as q } from "./chunks/index-icb12JV1.js";
2
+ import { X as fa, D as ma, V as pa, T as ha, O as ga, aa as Ca, M as Da, A as Ea, H as xa, H as Ta, J as ba, W as ya, a as va, a9 as Ba, a5 as Aa, Q as Na, P as Sa, ad as Pa, a8 as wa, a7 as _a, a6 as Fa, ac as Ra, ab as Ma, a2 as Ia, $ as La, N as ka, Z as Ua, L as Oa, z as Va, Y as za, _ as qa, B as Ha, a4 as Wa, a1 as ja, a0 as Ga, a3 as Qa, y as Ka, K as Xa, G as Ya } from "./chunks/index-icb12JV1.js";
3
3
  import { a as Ja, C as Za, D as ae, E as ee, P as se, g as re, d as oe, h as te, b as ie, c as ne, i as le } from "./chunks/common-types-4bjoIgvm.js";
4
- import { C as ue } from "./chunks/calendar-preferences-dialog-CV4xF2Tp.js";
4
+ import { C as ue } from "./chunks/calendar-preferences-dialog-B-VsxhsA.js";
5
5
  import { jsx as a, jsxs as d } from "react/jsx-runtime";
6
- import { u as q, P as W, b as j, B as G, a as C, g as Q, d as K, e as X } from "./chunks/switch-DArtNJZh.js";
7
- import { F as fe, q as me, h as pe, i as he, k as ge, s as Ce, r as De, w as Ee, x as xe, p as Te, j as be, o as ye, t as ve, n as Be, m as Ae, l as Ne, y as Se, v as Pe, z as we, D as _e, A as Fe, E as Re, H as Me, G as Ie } from "./chunks/switch-DArtNJZh.js";
6
+ import { u as H, P as W, a as j, B as G, c as C, f as Q, b as K, d as X } from "./chunks/switch-DUdaHFZQ.js";
7
+ import { E as fe, p as me, g as pe, h as he, j as ge, r as Ce, q as De, v as Ee, w as xe, o as Te, i as be, n as ye, s as ve, m as Be, l as Ae, k as Ne, x as Se, t as Pe, y as we, A as _e, z as Fe, D as Re, G as Me, F as Ie } from "./chunks/switch-DUdaHFZQ.js";
8
8
  import * as m from "react";
9
9
  import { useMemo as Y, useEffect as b } from "react";
10
10
  import { DEFAULT_CALENDAR_CONTEXT as ke, DEFAULT_SEMANTIC_DOMAIN_ACCESS as Ue } from "./types/index.js";
11
- import { A as Ve, L as ze, B as He, M as qe, D as We, e as je, f as Ge, d as Qe, b as Ke, E as Xe, N as Ye, U as $e, a as Je, V as Ze, W as as, G as es, I as ss, J as rs, H as os, s as ts, w as is, i as ns, F as ls, k as ds, x as us, h as cs, y as fs, z as ms, q as ps, v as hs, t as gs, g as Cs, l as Ds, p as Es, C as xs, n as Ts, r as bs, m as ys, o as vs, j as Bs, u as As, c as Ns, K as Ss } from "./chunks/dashboard-briefing-launcher-BT00MvGB.js";
11
+ import { A as Ve, L as ze, B as qe, M as He, D as We, e as je, f as Ge, d as Qe, b as Ke, E as Xe, N as Ye, U as $e, a as Je, V as Ze, W as as, G as es, I as ss, J as rs, H as os, s as ts, w as is, i as ns, F as ls, k as ds, x as us, h as cs, y as fs, z as ms, q as ps, v as hs, t as gs, g as Cs, l as Ds, p as Es, C as xs, n as Ts, r as bs, m as ys, o as vs, j as Bs, u as As, c as Ns, K as Ss } from "./chunks/dashboard-briefing-launcher-BIj3X7b3.js";
12
12
  import { u as ws } from "./chunks/use-debounced-dirty-check-BwAbnX_5.js";
13
13
  import "./chunks/analyze-result-contract-DuhlklhI.js";
14
14
  import "react-dom";
15
15
  import "./chunks/index-CJdxSyQq.js";
16
16
  import { n as Fs, s as Rs } from "./chunks/normalize-dashboard-for-dirty-check-5KpZN8xr.js";
17
- import "./chunks/index-CuHybtft.js";
17
+ import "./chunks/x-IdR_js6f.js";
18
18
  function ia(e) {
19
19
  const { displayPreferences: s, cardId: t, ...l } = e, r = {
20
20
  ...l,
@@ -27,7 +27,7 @@ function ia(e) {
27
27
  ] }) });
28
28
  }
29
29
  function $({ cardId: e }) {
30
- const s = q((r) => {
30
+ const s = H((r) => {
31
31
  var i;
32
32
  return (i = r.dashboard) == null ? void 0 : i.sheets;
33
33
  }), { card: t, frame: l } = Y(() => {
@@ -136,7 +136,7 @@ function la({
136
136
  " found."
137
137
  ] }),
138
138
  /* @__PURE__ */ a(z, { children: g == null ? void 0 : g.map((n) => /* @__PURE__ */ a(
139
- H,
139
+ q,
140
140
  {
141
141
  className: "overflow-x-auto",
142
142
  value: n.name,
@@ -172,7 +172,7 @@ function da(e, s) {
172
172
  export {
173
173
  Ve as AdvancedModeToggle,
174
174
  ze as BriefingAuthor,
175
- He as BriefingsApiError,
175
+ qe as BriefingsApiError,
176
176
  Ja as CALCULATED_FIELD_ENTITY_MARKER,
177
177
  Za as CONTROL_CARD_DEFAULT_VALUE,
178
178
  ue as CalendarPreferencesDialog,
@@ -182,7 +182,7 @@ export {
182
182
  ke as DEFAULT_CALENDAR_CONTEXT,
183
183
  Ue as DEFAULT_SEMANTIC_DOMAIN_ACCESS,
184
184
  ma as Dashboard,
185
- qe as DashboardBriefingLauncher,
185
+ He as DashboardBriefingLauncher,
186
186
  We as DashboardControlsSettings,
187
187
  pa as DashboardCreateDialogBase,
188
188
  ha as DashboardExportDialog,
@@ -281,10 +281,10 @@ export {
281
281
  Re as useDashboardActions,
282
282
  Oa as useDashboardById,
283
283
  Va as useDashboardQuery,
284
- q as useDashboardStore,
284
+ H as useDashboardStore,
285
285
  za as useDashboardSummary,
286
- Ha as useDataColumns,
287
- qa as useDateFilterHook,
286
+ qa as useDataColumns,
287
+ Ha as useDateFilterHook,
288
288
  ws as useDebouncedDirtyCheck,
289
289
  Me as useEditorActions,
290
290
  Wa as useEditorAside,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/index-CrKxP9uF.js"),e=require("../chunks/common-types-C73-Ud1-.js"),a=require("../chunks/calendar-preferences-dialog-rDDobeLo.js");exports.Surfboard=r.DashboardPlus;exports.CONTROL_CARD_DEFAULT_VALUE=e.CONTROL_CARD_DEFAULT_VALUE;exports.EMPTY_SELECTION=e.EMPTY_SELECTION;exports.CalendarPreferencesDialog=a.CalendarPreferencesDialog;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/index-4W_ElSBJ.js"),e=require("../chunks/common-types-C73-Ud1-.js"),a=require("../chunks/calendar-preferences-dialog-DE67Z3oQ.js");exports.Surfboard=r.DashboardPlus;exports.CONTROL_CARD_DEFAULT_VALUE=e.CONTROL_CARD_DEFAULT_VALUE;exports.EMPTY_SELECTION=e.EMPTY_SELECTION;exports.CalendarPreferencesDialog=a.CalendarPreferencesDialog;
@@ -1,6 +1,6 @@
1
- import { a as e } from "../chunks/index-BAsWLkZ8.js";
1
+ import { a as e } from "../chunks/index-icb12JV1.js";
2
2
  import { C, E } from "../chunks/common-types-4bjoIgvm.js";
3
- import { C as s } from "../chunks/calendar-preferences-dialog-CV4xF2Tp.js";
3
+ import { C as s } from "../chunks/calendar-preferences-dialog-B-VsxhsA.js";
4
4
  export {
5
5
  C as CONTROL_CARD_DEFAULT_VALUE,
6
6
  s as CalendarPreferencesDialog,
@@ -1,4 +1,6 @@
1
+ import { CSSProperties } from 'react';
1
2
  import { JSX } from 'react/jsx-runtime';
3
+ import { ReactElement } from 'react';
2
4
  import { ReactNode } from 'react';
3
5
 
4
6
  /**
@@ -646,6 +648,13 @@ export declare type SemaphorControlInputSpec<TValue extends SemaphorInputValue =
646
648
 
647
649
  export declare type SemaphorControlRole = 'grain' | 'measure' | 'dimension' | 'aggregation' | 'sqlParam';
648
650
 
651
+ export declare type SemaphorDataAppDebugConfig = boolean | {
652
+ enabled?: boolean;
653
+ exposeWindowBridge?: boolean;
654
+ maxQueries?: number;
655
+ maxEventsPerQuery?: number;
656
+ };
657
+
649
658
  export declare type SemaphorDataAppDefinition = {
650
659
  id?: string;
651
660
  title?: string;
@@ -655,13 +664,95 @@ export declare type SemaphorDataAppDefinition = {
655
664
  views: SemaphorDataAppViewDefinition[];
656
665
  };
657
666
 
658
- export declare function SemaphorDataAppProvider({ token, apiBaseUrl, executor, children, }: SemaphorDataAppProviderProps): JSX.Element;
667
+ export declare type SemaphorDataAppDevtoolsState = {
668
+ enabled: boolean;
669
+ queries: SemaphorDataAppTrace[];
670
+ getQuery(queryId: string): SemaphorDataAppTrace | undefined;
671
+ getQueries(queryId: string): SemaphorDataAppTrace[];
672
+ };
673
+
674
+ export declare type SemaphorDataAppDevtoolsWindowBridge = {
675
+ snapshot(): SemaphorDataAppDevtoolsState;
676
+ getQuery(queryId: string): SemaphorDataAppTrace | undefined;
677
+ getQueries(queryId: string): SemaphorDataAppTrace[];
678
+ };
679
+
680
+ export declare function SemaphorDataAppProvider({ token, apiBaseUrl, executor, debug, children, }: SemaphorDataAppProviderProps): JSX.Element;
659
681
 
660
682
  export declare type SemaphorDataAppProviderProps = SemaphorQueryExecutorContext & {
661
683
  executor?: SemaphorQueryExecutor;
684
+ debug?: SemaphorDataAppDebugConfig;
662
685
  children: ReactNode;
663
686
  };
664
687
 
688
+ export declare type SemaphorDataAppTrace = {
689
+ traceId: string;
690
+ viewId?: string;
691
+ queryId: string;
692
+ queryLabel?: string;
693
+ queryKind: SemaphorQueryDefinition['queryKind'];
694
+ builder: 'semaphor.metric' | 'semaphor.records' | 'semaphor.matrix' | 'semaphor.analysis' | 'semaphor.inputOptions' | 'semaphor.sql';
695
+ sourceRefs: SemaphorSourceRef[];
696
+ projectionFieldRefs?: SemaphorFieldRef[];
697
+ inputFieldRefs?: SemaphorFieldRef[];
698
+ fieldRefs: SemaphorFieldRef[];
699
+ inputsApplied: Array<{
700
+ inputId: string;
701
+ fieldRef?: SemaphorFieldRef;
702
+ operator?: string;
703
+ valuePreview?: string;
704
+ }>;
705
+ latestAttempt?: {
706
+ requestId?: string;
707
+ status: SemaphorQueryStatus;
708
+ durationMs?: number;
709
+ rowCount?: number;
710
+ columnCount?: number;
711
+ cacheStatus?: 'hit' | 'miss' | 'unknown';
712
+ executionResult?: SemaphorAnalyticsExecutionResult;
713
+ errorMessage?: string;
714
+ };
715
+ recentEvents: SemaphorDataAppTraceEvent[];
716
+ server?: {
717
+ compiledSql?: string;
718
+ dialect?: string;
719
+ sqlHash?: string;
720
+ executionPlanSummary?: string;
721
+ };
722
+ clientWarnings: string[];
723
+ };
724
+
725
+ export declare type SemaphorDataAppTraceEvent = {
726
+ type: 'query_started';
727
+ queryId: string;
728
+ requestId?: string;
729
+ at: string;
730
+ } | {
731
+ type: 'query_succeeded';
732
+ queryId: string;
733
+ requestId?: string;
734
+ at: string;
735
+ rowCount?: number;
736
+ durationMs?: number;
737
+ } | {
738
+ type: 'query_failed';
739
+ queryId: string;
740
+ requestId?: string;
741
+ at: string;
742
+ errorMessage: string;
743
+ } | {
744
+ type: 'query_ignored_stale';
745
+ queryId: string;
746
+ requestId?: string;
747
+ at: string;
748
+ reason: 'newer_inputs' | 'unmounted' | 'superseded';
749
+ } | {
750
+ type: 'input_changed';
751
+ inputId: string;
752
+ at: string;
753
+ valuePreview?: string;
754
+ };
755
+
665
756
  export declare type SemaphorDataAppViewDefinition<TQuery extends SemaphorQueryDefinition = SemaphorQueryDefinition> = {
666
757
  id: string;
667
758
  title?: string;
@@ -702,6 +793,26 @@ declare type SemaphorDerivedFieldInput = {
702
793
 
703
794
  declare type SemaphorDerivedFieldResultRole = 'measure' | 'dimension' | 'date' | 'id' | 'unknown';
704
795
 
796
+ export declare function SemaphorDevtools({ buttonPosition, initialIsOpen, panelPosition, className, style, }?: SemaphorDevtoolsProps): ReactElement | null;
797
+
798
+ export declare function SemaphorDevtoolsInspectButton({ queryId, viewId, label, className, style, }?: SemaphorDevtoolsInspectButtonProps): ReactElement | null;
799
+
800
+ export declare type SemaphorDevtoolsInspectButtonProps = {
801
+ queryId?: string;
802
+ viewId?: string;
803
+ label?: string;
804
+ className?: string;
805
+ style?: CSSProperties;
806
+ };
807
+
808
+ export declare type SemaphorDevtoolsProps = {
809
+ buttonPosition?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative';
810
+ initialIsOpen?: boolean;
811
+ panelPosition?: 'bottom' | 'right';
812
+ className?: string;
813
+ style?: CSSProperties;
814
+ };
815
+
705
816
  declare type SemaphorDialect = 'postgres' | 'mysql' | 'mssql' | 'snowflake' | 'clickhouse' | 'bigquery' | 'redshift' | 'duckdb' | 'sqlite' | 'unknown';
706
817
 
707
818
  declare type SemaphorExecutionFieldRef = SemaphorFieldRef & {
@@ -1191,6 +1302,11 @@ declare type SemaphorProtocolIssue = {
1191
1302
 
1192
1303
  declare type SemaphorProtocolVersion = 1;
1193
1304
 
1305
+ export declare type SemaphorQueryDebugOptions = {
1306
+ viewId?: string;
1307
+ title?: string;
1308
+ };
1309
+
1194
1310
  export declare type SemaphorQueryDefinition = SemaphorMetricQueryDefinition | SemaphorAnalysisQueryDefinition | SemaphorRecordsQueryDefinition | SemaphorInputOptionsQueryDefinition | SemaphorSqlQueryDefinition | SemaphorMatrixQueryDefinition;
1195
1311
 
1196
1312
  export declare type SemaphorQueryExecutor = {
@@ -1225,6 +1341,7 @@ export declare type SemaphorQueryResultFor<TQuery extends SemaphorQueryDefinitio
1225
1341
 
1226
1342
  export declare type SemaphorQueryRuntimeOptions = {
1227
1343
  inputs?: SemaphorInputReference[];
1344
+ debug?: SemaphorQueryDebugOptions;
1228
1345
  };
1229
1346
 
1230
1347
  export declare type SemaphorQuerySourceSpec = {
@@ -1235,6 +1352,7 @@ export declare type SemaphorQueryState = {
1235
1352
  status: SemaphorQueryStatus;
1236
1353
  isLoading: boolean;
1237
1354
  error: Error | null;
1355
+ trace?: SemaphorDataAppTrace;
1238
1356
  };
1239
1357
 
1240
1358
  export declare type SemaphorQueryStatus = 'idle' | 'loading' | 'success' | 'error';
@@ -1522,8 +1640,16 @@ declare type SemaphorValueFormat = {
1522
1640
  suffix?: string;
1523
1641
  };
1524
1642
 
1643
+ export declare function SemaphorViewBoundary({ id, title, children, }: {
1644
+ id: string;
1645
+ title?: string;
1646
+ children: ReactNode;
1647
+ }): ReactElement;
1648
+
1525
1649
  export declare function useClearInvalidSemaphorInputValue(input: SemaphorInputHandle, optionsResult: Pick<SemaphorInputOptionsQueryResult, 'options' | 'status'> | undefined): void;
1526
1650
 
1651
+ export declare function useSemaphorDevtools(): SemaphorDataAppDevtoolsState;
1652
+
1527
1653
  export declare function useSemaphorInput<TValue extends SemaphorInputValue = SemaphorInputValue>(spec: SemaphorInputSpec<TValue>): SemaphorInputHandle;
1528
1654
 
1529
1655
  export declare function useSemaphorInputs(specs: readonly SemaphorInputSpec[]): SemaphorInputHandle[];
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.1.382",
8
+ "version": "0.1.383",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",
@@ -1 +0,0 @@
1
- "use strict";const e=require("react/jsx-runtime"),l=require("react"),t=require("./index-CrKxP9uF.js"),o=require("./switch-k7kj6NRg.js");require("./index-BxM99sFL.js");require("./analyze-result-contract-CtXfp3nv.js");function G(n={}){var y,P,z,A;const{authToken:d,tokenProps:a}=t.useSemaphorContext(),x=n.enabled??!0,m=(d==null?void 0:d.accessToken)??null,f=(a==null?void 0:a.apiServiceUrl)??null,[L,C]=l.useState(!1),[j,b]=l.useState(!1),[h,g]=l.useState(!1),[N,c]=l.useState(null),[v,S]=l.useState(null),k=v||{tz:((P=(y=a==null?void 0:a.params)==null?void 0:y.calendarContext)==null?void 0:P.tz)||null,weekStart:((A=(z=a==null?void 0:a.params)==null?void 0:z.calendarContext)==null?void 0:A.weekStart)??null},p=l.useCallback(async()=>{if(!(!x||!m||!f)){C(!0),c(null);try{const i=await fetch(`${f}/v1/user-preferences/calendar`,{method:"GET",headers:{Authorization:`Bearer ${m}`}});if(!i.ok){const u=await i.json().catch(()=>({}));throw new Error(u.error||"Failed to fetch preferences")}const r=await i.json();S({tz:r.tz,weekStart:r.weekStart,source:r.source,isInherited:r.isInherited,userHasPrefs:r.userHasPrefs,inherited:r.inherited})}catch(i){const r=i instanceof Error?i.message:"Unknown error";c(r)}finally{C(!1)}}},[m,f,x]);l.useEffect(()=>{x&&p()},[x,p]);const T=l.useCallback(async i=>{if(!m||!f)return c("Not authenticated"),!1;b(!0),c(null);try{const r=await fetch(`${f}/v1/user-preferences/calendar`,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${m}`},body:JSON.stringify(i)});if(!r.ok){const u=await r.json().catch(()=>({}));throw new Error(u.error||"Failed to update preferences")}return await p(),!0}catch(r){const u=r instanceof Error?r.message:"Unknown error";return c(u),!1}finally{b(!1)}},[m,f,p]),w=l.useCallback(async()=>{if(!m||!f)return c("Not authenticated"),!1;g(!0),c(null);try{const i=await fetch(`${f}/v1/user-preferences/calendar`,{method:"DELETE",headers:{Authorization:`Bearer ${m}`}});if(!i.ok){const u=await i.json().catch(()=>({}));throw new Error(u.error||"Failed to clear preferences")}const r=await i.text();if(r)try{const u=JSON.parse(r);return S({tz:u.tz,weekStart:u.weekStart,source:u.source,isInherited:u.isInherited??!0,userHasPrefs:!1,inherited:u.inherited}),!0}catch{}return await p(),!0}catch(i){const r=i instanceof Error?i.message:"Unknown error";return c(r),!1}finally{g(!1)}},[m,f,p]);return{preferences:k,isLoading:L,isSaving:j,isClearing:h,error:N,updatePreferences:T,clearPreferences:w,refetch:p}}const E=[{value:"America/New_York",label:"Eastern Time (US & Canada)"},{value:"America/Chicago",label:"Central Time (US & Canada)"},{value:"America/Denver",label:"Mountain Time (US & Canada)"},{value:"America/Los_Angeles",label:"Pacific Time (US & Canada)"},{value:"America/Phoenix",label:"Arizona"},{value:"America/Anchorage",label:"Alaska"},{value:"Pacific/Honolulu",label:"Hawaii"},{value:"Europe/London",label:"London"},{value:"Europe/Paris",label:"Paris, Berlin, Rome"},{value:"Asia/Tokyo",label:"Tokyo"},{value:"Asia/Shanghai",label:"Beijing, Shanghai"},{value:"Asia/Kolkata",label:"Mumbai, New Delhi"},{value:"Australia/Sydney",label:"Sydney"},{value:"UTC",label:"UTC"}],M=[{value:0,label:"Sunday"},{value:1,label:"Monday"},{value:6,label:"Saturday"}],H="text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";function W(){try{const n=Intl;if(n.supportedValuesOf)return n.supportedValuesOf("timeZone")}catch{}return E.map(n=>n.value)}function _(n){switch(n){case"tenant":return"tenant";case"organization":return"organization";case"system":return"system";default:return"default"}}function O(n){const d=E.find(a=>a.value===n);return d?d.label:n}function q(n){const d=M.find(a=>a.value===n);return d?d.label:String(n)}function V({open:n,onOpenChange:d}){var D,U,F;const{preferences:a,isLoading:x,isSaving:m,isClearing:f,updatePreferences:L,clearPreferences:C}=G({enabled:n}),j=a.tz||((D=a.inherited)==null?void 0:D.tz)||Intl.DateTimeFormat().resolvedOptions().timeZone,b=a.weekStart??((U=a.inherited)==null?void 0:U.weekStart)??1,[h,g]=l.useState(!a.userHasPrefs),[N,c]=l.useState(!1),[v,S]=l.useState(j),[k,p]=l.useState(b),[T,w]=l.useState(!1),y=l.useMemo(()=>W(),[]),P=l.useMemo(()=>y.filter(s=>!E.some(R=>R.value===s)),[y]),z=l.useMemo(()=>O(v),[v]),A=a.inherited?O(a.inherited.tz):"UTC",i=a.inherited?q(a.inherited.weekStart):"Monday",r=_((F=a.inherited)==null?void 0:F.source);l.useEffect(()=>{if(!n){c(!1);return}N||(a.userHasPrefs!==void 0&&g(!a.userHasPrefs),S(j),p(b))},[n,N,a.userHasPrefs,j,b]);const u=async()=>{if(x){t.ue.error("Preferences are still loading. Please try again.");return}h?await C()?(t.ue.success("Now using default settings. Please refresh the page to apply changes.",{duration:5e3}),d(!1)):t.ue.error("Failed to save preferences. Please try again."):await L({tz:v,weekStart:k})?(t.ue.success("Preferences saved. Please refresh the page to apply changes.",{duration:5e3}),d(!1)):t.ue.error("Failed to save preferences. Please try again.")},$=()=>{d(!1)},I=m||f,B=I||x;return e.jsx(t.Dialog,{open:n,onOpenChange:d,children:e.jsxs(t.DialogContent,{className:"rounded-control border-border/60 sm:max-w-[440px] sm:rounded-control",children:[e.jsxs(t.DialogHeader,{children:[e.jsx(t.DialogTitle,{className:"text-[15px]",children:"Calendar preferences"}),e.jsx(t.DialogDescription,{className:"text-[13px] leading-5",children:"Set your timezone and week-start for date calculations and displays."})]}),e.jsxs("div",{className:"space-y-4 py-1",children:[e.jsxs(t.RadioGroup,{value:h?"defaults":"custom",onValueChange:s=>{c(!0),g(s==="defaults")},className:"space-y-0.5",children:[e.jsxs("label",{htmlFor:"mode-defaults",className:o.cn("flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",h&&"bg-muted/50"),onClick:()=>{c(!0),g(!0)},children:[e.jsx(t.RadioGroupItem,{value:"defaults",id:"mode-defaults",className:"mt-0.5"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-[13px] font-medium text-foreground",children:["Use ",r," defaults"]}),e.jsxs("p",{className:"text-[12px] text-muted-foreground",children:[A,", week starts ",i]})]})]}),e.jsxs("label",{htmlFor:"mode-custom",className:o.cn("flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",!h&&"bg-muted/50"),onClick:()=>{c(!0),g(!1)},children:[e.jsx(t.RadioGroupItem,{value:"custom",id:"mode-custom",className:"mt-0.5"}),e.jsx("p",{className:"flex-1 text-[13px] font-medium text-foreground",children:"Use custom settings"})]})]}),e.jsxs("div",{className:o.cn("space-y-4 border-t border-border/60 pt-4 transition-opacity",h&&"pointer-events-none opacity-50"),children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(o.Label,{className:H,children:"Timezone"}),e.jsxs(o.Popover,{open:T,onOpenChange:w,modal:!0,children:[e.jsx(o.PopoverTrigger,{asChild:!0,children:e.jsxs(o.Button,{variant:"outline",size:"xs",role:"combobox","aria-expanded":T,className:"w-full justify-between text-[12px] font-normal",disabled:h,children:[e.jsx("span",{className:"truncate",children:z}),e.jsx(t.ChevronsUpDown,{className:"ml-2 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),e.jsx(o.PopoverContent,{className:"z-50 w-[--radix-popover-trigger-width] p-0",align:"start",children:e.jsxs(t.Command,{className:"overflow-visible",children:[e.jsx(t.CommandInput,{placeholder:"Search timezones…"}),e.jsxs(t.CommandList,{children:[e.jsx(t.CommandEmpty,{children:"No timezone found."}),e.jsx(t.CommandGroup,{heading:"Common",children:E.map(s=>e.jsxs(t.CommandItem,{value:`${s.value} ${s.label}`,onSelect:()=>{c(!0),S(s.value),w(!1)},children:[e.jsx(o.Check,{className:o.cn("h-3.5 w-3.5",v===s.value?"opacity-100":"opacity-0")}),e.jsx("span",{className:"flex-1",children:s.label}),e.jsx("span",{className:"text-[11px] text-muted-foreground",children:s.value})]},s.value))}),e.jsx(t.CommandSeparator,{}),e.jsx(t.CommandGroup,{heading:"All timezones",children:P.map(s=>e.jsxs(t.CommandItem,{value:s,onSelect:()=>{c(!0),S(s),w(!1)},children:[e.jsx(o.Check,{className:o.cn("h-3.5 w-3.5",v===s?"opacity-100":"opacity-0")}),s]},s))})]})]})})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(o.Label,{className:H,children:"Week starts on"}),e.jsx(t.RadioGroup,{value:String(k),onValueChange:s=>{c(!0),p(Number(s))},className:"flex gap-4",disabled:h,children:M.map(s=>e.jsxs("label",{htmlFor:`week-start-${s.value}`,className:o.cn("flex cursor-pointer items-center gap-2 text-[13px]",h&&"cursor-not-allowed"),children:[e.jsx(t.RadioGroupItem,{value:String(s.value),id:`week-start-${s.value}`,disabled:h}),s.label]},s.value))})]})]})]}),e.jsxs(t.DialogFooter,{children:[e.jsx(o.Button,{variant:"outline",size:"xs",onClick:$,disabled:I,children:"Cancel"}),e.jsx(o.Button,{size:"xs",onClick:u,disabled:B,children:I?e.jsxs(e.Fragment,{children:[e.jsx(o.LoaderCircle,{className:"h-3.5 w-3.5 animate-spin"}),"Saving…"]}):"Save"})]})]})})}exports.CalendarPreferencesDialog=V;