@inboxsdk/core
Advanced tools
Comparing version 2.1.32 to 2.1.33
{ | ||
"name": "@inboxsdk/core", | ||
"version": "2.1.32", | ||
"version": "2.1.33", | ||
"description": "Library for building browser extensions for Gmail", | ||
@@ -5,0 +5,0 @@ "main": "inboxsdk.js", |
@@ -39,2 +39,3 @@ import { EventEmitter } from 'events'; | ||
import type SectionView from './platform-implementation-js/views/section-view'; | ||
import type { RouteParams } from './platform-implementation-js/namespaces/router'; | ||
@@ -320,17 +321,49 @@ export type { User }; | ||
/** | ||
* @alpha | ||
* | ||
* Provides the ability to pass arbitrary HTML into a cell in a {@link SectionView} or {@link CollapsibleSectionView} `tableRow`. | ||
*/ | ||
export type RowDescriptorCellRenderer = (args: { | ||
/** | ||
* The element to render the column into. | ||
*/ | ||
el: HTMLElement; | ||
/** | ||
* A promise that resolves when the row is unmounted. This is useful for cleaning up any resources that were created when the row was mounted. | ||
*/ | ||
unmountPromise: Promise<void>; | ||
}) => void; | ||
/** | ||
* Represents the a single row to render in {@link SectionView}s and {@link CollapsibleSectionView}s | ||
*/ | ||
export interface RowDescriptor { | ||
export type RowDescriptor = { | ||
/** First textual column */ | ||
title: string; | ||
/** Second textual column */ | ||
body: string; | ||
title: string | RowDescriptorCellRenderer; | ||
/** | ||
* @alpha | ||
* | ||
* Render an HTMLElement in the attachment icon area. This is often used to render an icon for the attachment type. | ||
*/ | ||
attachmentIcon?: RowDescriptorCellRenderer; | ||
/** Last text right-aligned. Often used for dates. */ | ||
shortDetailText: string; | ||
shortDetailText: string | RowDescriptorCellRenderer; | ||
/** | ||
* Whether the row should be rendered as read or unread similar to Gmail styles. | ||
* Controls whether the row should be rendered as a read or unread message similar to Gmail styles. | ||
* This affects the row background and font weight. These can be separately controlled by passing an object. | ||
* | ||
* @TODO is this actually required like the docs say? | ||
* @defaultValue { background: false, text: true } | ||
*/ | ||
isRead?: string; | ||
isRead?: | ||
| boolean | ||
| { | ||
/** | ||
* Controls whether the row background should be styled as read (in light themes: gray background) or unread (bright white background) similar to Gmail styles. | ||
*/ | ||
background: boolean; | ||
/** | ||
* Controls whether the row text should be styled as read (regular non-bold) or unread (bold text) similar to Gmail styles. | ||
*/ | ||
text: boolean; | ||
}; | ||
/** Any labels that should be rendered. */ | ||
@@ -341,3 +374,3 @@ labels: LabelDescriptor[]; | ||
/** An optional HTML to an icon to display on the left side of the row */ | ||
iconHtml?: string; | ||
iconHtml?: string | RowDescriptorCellRenderer; | ||
/** An optional url to an icon to display on the left side of the row */ | ||
@@ -348,6 +381,21 @@ iconUrl?: string; | ||
/** The parameters of the route being navigated to when the row is clicked on. */ | ||
routeParams?: string[]; | ||
routeParams?: RouteParams; | ||
/** Callback for when the row is clicked on. */ | ||
onClick?(e: unknown): void; | ||
} | ||
onClick?(): void; | ||
} & ( | ||
| { | ||
/** | ||
* @deprecated alias for {@link RowDescriptor#snippet}. | ||
*/ | ||
body: string; | ||
} | ||
| { | ||
/** | ||
* @alpha | ||
* | ||
* Second textual column. After {@link RowDescriptor#labels} if they're provided. | ||
*/ | ||
snippet: string | RowDescriptorCellRenderer; | ||
} | ||
); | ||
@@ -354,0 +402,0 @@ /** |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3513700
79262