react-semaphor 0.1.595 → 0.1.597

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 (19) hide show
  1. package/dist/chunks/{assistant-chat-C8VXUHvX.js → assistant-chat-DUDiH9z4.js} +2 -2
  2. package/dist/chunks/{card-filter-builder-Dmh9R278.js → card-filter-builder-2-OxEBWf.js} +1 -1
  3. package/dist/chunks/{dashboard-briefing-launcher-BFlkwqSg.js → dashboard-briefing-launcher-CVDhvsTk.js} +1104 -1099
  4. package/dist/chunks/{dashboard-controls-C-MFtXUc.js → dashboard-controls-CtQY-J33.js} +4 -4
  5. package/dist/chunks/{dashboard-wzORuqkj.js → dashboard-g-7XY0Kw.js} +1 -1
  6. package/dist/chunks/{dashboard-json-H8rjI8MK.js → dashboard-json-DkhzPI3-.js} +1 -1
  7. package/dist/chunks/{edit-dashboard-visual-g78CyvZZ.js → edit-dashboard-visual-DWn74pCl.js} +3 -3
  8. package/dist/chunks/{report-preferences-dialog-B2CoGxJu.js → report-preferences-dialog-5WUi6jC0.js} +5 -5
  9. package/dist/chunks/{semaphor-ready-indicator-CLJFaXjd.js → semaphor-ready-indicator-miYoJ-HP.js} +26013 -25785
  10. package/dist/chunks/{shelf-drop-preview-context-BMUmDkqr.js → shelf-drop-preview-context-D-awfyyo.js} +1 -1
  11. package/dist/dashboard/index.js +1 -1
  12. package/dist/index.js +7 -7
  13. package/dist/style.css +1 -1
  14. package/dist/surfboard/index.js +1 -1
  15. package/dist/types/components/shared/unsaved-changes/unsaved-changes-alert.d.ts +2 -1
  16. package/dist/types/components/sharing-and-management/hooks/paged-list.d.ts +22 -0
  17. package/dist/types/components/sharing-and-management/hooks/use-resource-management.d.ts +17 -2
  18. package/dist/types/lib/hooks/use-dashboard-unsaved-changes-check.d.ts +9 -1
  19. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { a, R as s, D as o } from "../chunks/report-preferences-dialog-B2CoGxJu.js";
1
+ import { a, R as s, D as o } from "../chunks/report-preferences-dialog-5WUi6jC0.js";
2
2
  import { C as f, E as D } from "../chunks/bookmark-state-Be2W3s6t.js";
3
3
  export {
4
4
  f as CONTROL_CARD_DEFAULT_VALUE,
@@ -1,7 +1,8 @@
1
1
  type UnsavedChangesAlertProps = {
2
2
  open: boolean;
3
3
  onOpenChange: (open: boolean) => void;
4
- onSave: () => Promise<void>;
4
+ /** Omit when saving can't keep the changes (an open card's draft): no Save button. */
5
+ onSave?: () => Promise<void>;
5
6
  onDiscard: () => void;
6
7
  isSaving: boolean;
7
8
  title?: string;
@@ -0,0 +1,22 @@
1
+ export type PagedList<T> = {
2
+ /** Every row loaded so far, in the server's order. */
3
+ items: T[];
4
+ /** The server's total for the current search and filters. */
5
+ total: number;
6
+ /** Rows the next page holds (0 at the end of the list). */
7
+ nextCount: number;
8
+ isLoading: boolean;
9
+ isFetchingNextPage: boolean;
10
+ fetchNextPage: () => void;
11
+ /** The rows and total are the previous search's, kept on screen while
12
+ * the new answer loads. */
13
+ isPlaceholderData: boolean;
14
+ };
15
+ /** Rows still to load, at most one page. */
16
+ export declare function nextPageCount(loaded: number, total: number, pageSize: number): number;
17
+ /**
18
+ * Two lists read as one category (a tenant-created dashboard's groups: the
19
+ * organization's and the owning tenant's). The first list pages to its end
20
+ * before the second starts.
21
+ */
22
+ export declare function mergePagedLists<T>(first: PagedList<T>, second: PagedList<T>): PagedList<T>;
@@ -1,5 +1,6 @@
1
1
  import { ResourceType, ShareRole, ShareScope } from '../utils/types.js';
2
2
  import { TDashboard, TFrame } from '../../../lib/types/index.js';
3
+ import { PagedList } from './paged-list.js';
3
4
  import { AppearanceSpec } from '../../../lib/appearance/index.js';
4
5
  import { DashboardListViewer } from '../../../shared/dashboard-viewer/index.js';
5
6
  export interface ResourceListItem {
@@ -78,9 +79,23 @@ export interface ShareResourceRequest {
78
79
  }>;
79
80
  message?: string;
80
81
  }
81
- export declare function useTenants(options?: {
82
+ /** A tenant as the tenants list returns it, with its user count. */
83
+ export type TenantListItem = {
84
+ id: string;
85
+ name: string;
86
+ userCount?: number;
87
+ };
88
+ /**
89
+ * Tenants the caller may share with, a page of `pageSize` at a time by
90
+ * offset, searched by name on the server (the route's default page of 500
91
+ * would leave the rest unreachable). Previous pages stay on screen while a
92
+ * new search loads.
93
+ */
94
+ export declare function useTenantPages(params: {
95
+ search?: string;
96
+ }, pageSize: number, options?: {
82
97
  enabled?: boolean;
83
- }): import('@tanstack/react-query').UseQueryResult<any, Error>;
98
+ }): PagedList<TenantListItem>;
84
99
  export declare function useResources(resourceType: ResourceType, search?: string, view?: string, limit?: number, offset?: number): import('@tanstack/react-query').UseQueryResult<any, Error>;
85
100
  export declare function useCreateResource(resourceType: ResourceType, onSuccessCallback?: (data?: any) => void): import('@tanstack/react-query').UseMutationResult<any, Error, CreateResourceRequest, void>;
86
101
  export declare function useUpdateResource(resourceType: ResourceType): import('@tanstack/react-query').UseMutationResult<any, Error, {
@@ -1,3 +1,11 @@
1
1
  import { TDashboard } from '../types/common-types.js';
2
- /** Share the editor's baseline with host navigation, without a second dirty flag. */
2
+ /**
3
+ * Share the editor's baseline with host navigation, without a second dirty flag.
4
+ *
5
+ * An open card editor counts as unsaved: its draft lives in the editor store
6
+ * and reaches the dashboard only when the author applies it, so a comparison
7
+ * of the dashboard alone would let them leave and lose it. Closing the editor
8
+ * (or loading another dashboard) clears `isVisualEditing`, so this never
9
+ * outlives the editor.
10
+ */
3
11
  export declare function useDashboardUnsavedChangesCheck(pristineDashboard: TDashboard | null, isInspectionMode: boolean, lifecycleEnabled?: boolean): () => boolean;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.1.595",
8
+ "version": "0.1.597",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",