@nivaro/react 0.1.34 → 0.1.36

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 (3) hide show
  1. package/dist/index.d.ts +44 -0
  2. package/dist/index.js +3326 -3131
  3. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -66,6 +66,8 @@ export declare function canOpenChatRoom(): boolean;
66
66
 
67
67
  export declare function canOpenDm(): boolean;
68
68
 
69
+ export declare function canPreviewFile(type: string | null | undefined): boolean;
70
+
69
71
  export { CascadeFilterRule }
70
72
 
71
73
  declare interface ChannelMeta {
@@ -612,6 +614,11 @@ export declare type FieldState = {
612
614
  */
613
615
  export declare function FileField({ field, value, onChange, error, disabled, readOnly, inputId, errorId }: FieldComponentProps): JSX.Element;
614
616
 
617
+ export declare function FilePreviewLightbox({ file, onClose }: {
618
+ file: PreviewFile;
619
+ onClose: () => void;
620
+ }): ReactPortal;
621
+
615
622
  declare interface FilterDef {
616
623
  key: string;
617
624
  placeholder: string;
@@ -1135,6 +1142,8 @@ declare interface MessageToken {
1135
1142
  mention?: string;
1136
1143
  }
1137
1144
 
1145
+ export declare function MyWorkView(): JSX.Element;
1146
+
1138
1147
  export declare const NavigationContext: React_2.Context<NavigationContextValue>;
1139
1148
 
1140
1149
  declare type NavigationContextValue = {
@@ -1341,6 +1350,23 @@ export declare function PipelineTransitionButtons({ collection, item, onBeforeTr
1341
1350
  onBeforeTransition?: () => boolean | Promise<boolean>;
1342
1351
  }): JSX.Element | null;
1343
1352
 
1353
+ /**
1354
+ * Inline attachment preview — click a file, see it, without a download round
1355
+ * trip. Images, PDFs, video and audio render in an overlay; anything else
1356
+ * gets an honest "no preview" panel with the Download action front and center.
1357
+ *
1358
+ * Plain portal to document.body at z-[130] (above popovers at 110 and the
1359
+ * tooltip layer at 120). The asset URL is the same cookie/session-authed
1360
+ * /api/files/:id URL every <img> in the app already uses.
1361
+ */
1362
+ declare interface PreviewFile {
1363
+ id: string;
1364
+ url: string;
1365
+ name: string;
1366
+ type: string | null;
1367
+ size?: number | null;
1368
+ }
1369
+
1344
1370
  export declare function ProfileView({ userId, className }: {
1345
1371
  userId?: string | null;
1346
1372
  className?: string;
@@ -1868,6 +1894,24 @@ export declare function useOverlayState<T>(key: string): {
1868
1894
 
1869
1895
  export declare function usePeerReadAt(room: string | null): string | null;
1870
1896
 
1897
+ /**
1898
+ * Real profile photo (Microsoft Graph, captured at login) with the caller's
1899
+ * initials disc as the fallback. The photo arrives as a small data URI from
1900
+ * GET /users/:id/avatar — react-query caches it per user for the session, so
1901
+ * an owner stack showing the same person twenty times costs one request.
1902
+ *
1903
+ * The FALLBACK is the caller's own styled disc: every site already has its
1904
+ * exact colors/ring/size, and this component must never change how a user
1905
+ * without a photo renders.
1906
+ */
1907
+ export declare function UserAvatar({ userId, fallback, className, alt }: {
1908
+ userId: string | number | null | undefined;
1909
+ fallback: ReactNode;
1910
+ /** Applied to the <img> when a photo exists — size + ring classes of the site's disc. */
1911
+ className?: string;
1912
+ alt?: string;
1913
+ }): JSX.Element;
1914
+
1871
1915
  export declare function UserChip({ userId, size }: {
1872
1916
  userId: string;
1873
1917
  size?: 'default' | 'compact';