@hiver/connector-agent 4.27.0-appWidgets-beta.25 → 4.27.0-appWidgets-beta.26
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/features/app-widget/components/AppWidget.d.ts +52 -4
- package/features/app-widget/components/AppWidget.d.ts.map +1 -1
- package/features/app-widget/config.d.ts +2 -0
- package/features/app-widget/config.d.ts.map +1 -1
- package/features/app-widget/constants.d.ts +1 -0
- package/features/app-widget/constants.d.ts.map +1 -1
- package/features/app-widget/copy.d.ts +9 -5
- package/features/app-widget/copy.d.ts.map +1 -1
- package/features/app-widget/loader.d.ts +1 -1
- package/features/app-widget/loader.d.ts.map +1 -1
- package/features/app-widget/model.d.ts.map +1 -1
- package/features/app-widget/types.d.ts +5 -1
- package/features/app-widget/types.d.ts.map +1 -1
- package/features/app-widget/useAppWidgetData.d.ts +19 -1
- package/features/app-widget/useAppWidgetData.d.ts.map +1 -1
- package/index.es.js +8761 -8398
- package/index.umd.js +469 -469
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
+
import { ConnectorThemeTokens } from '../../../theme/connector-theme';
|
|
2
3
|
import { AppWidgetModel, AppWidgetRecord } from '../types';
|
|
3
4
|
import { UseAppWidgetDataArgs } from '../useAppWidgetData';
|
|
4
5
|
/** Everything a widget can ask its host to do. The host owns navigation to the app tab. */
|
|
@@ -18,6 +19,11 @@ export type AppWidgetAction = {
|
|
|
18
19
|
type: 'reconnect';
|
|
19
20
|
} | {
|
|
20
21
|
type: 'notify_admin';
|
|
22
|
+
}
|
|
23
|
+
/** The rep picked another of the contact's addresses in "Look up by" (hosts that read the summary themselves re-read it). */
|
|
24
|
+
| {
|
|
25
|
+
type: 'lookup_email';
|
|
26
|
+
email: string;
|
|
21
27
|
};
|
|
22
28
|
export type AppWidgetTrackingFn = (event: string, data: Record<string, unknown>) => void;
|
|
23
29
|
export type AppWidgetCommonProps = UseAppWidgetDataArgs & {
|
|
@@ -26,7 +32,41 @@ export type AppWidgetCommonProps = UseAppWidgetDataArgs & {
|
|
|
26
32
|
trackingContext?: Record<string, unknown>;
|
|
27
33
|
sendTrackingEvent?: AppWidgetTrackingFn;
|
|
28
34
|
};
|
|
35
|
+
/**
|
|
36
|
+
* The widget's colours. Light mode uses the Figma values (Apps · Mini features, "Widgets - All
|
|
37
|
+
* apps"); dark mode keeps the host's tokens, which the design does not cover.
|
|
38
|
+
*/
|
|
39
|
+
declare const palette: (tokens: ConnectorThemeTokens, mode: "light" | "dark") => {
|
|
40
|
+
text: string;
|
|
41
|
+
label: string;
|
|
42
|
+
body: string;
|
|
43
|
+
icon: string;
|
|
44
|
+
iconMuted: string;
|
|
45
|
+
cardBorder: string;
|
|
46
|
+
skeletonBorder: string;
|
|
47
|
+
skeletonFill: string;
|
|
48
|
+
surface: string;
|
|
49
|
+
hover: string;
|
|
50
|
+
link: string;
|
|
51
|
+
primary: string;
|
|
52
|
+
primaryBorder: string;
|
|
53
|
+
primaryHover: string;
|
|
54
|
+
secondary: string;
|
|
55
|
+
secondaryBorder: string;
|
|
56
|
+
badge: string;
|
|
57
|
+
badgeText: string;
|
|
58
|
+
danger: string;
|
|
59
|
+
dangerStrong: string;
|
|
60
|
+
dangerSurface: string;
|
|
61
|
+
dangerBorder: string;
|
|
62
|
+
};
|
|
63
|
+
type Palette = ReturnType<typeof palette>;
|
|
29
64
|
export type AppWidgetSummaryProps = AppWidgetCommonProps & {
|
|
65
|
+
/**
|
|
66
|
+
* The section is expanded: the badge is hidden and the header shows Refresh instead (on hover of
|
|
67
|
+
* an ancestor with the `app-widget-header` class, and while a refresh runs).
|
|
68
|
+
*/
|
|
69
|
+
expanded?: boolean;
|
|
30
70
|
/** Reports what the header shows, for hosts that render their own badge or pill. */
|
|
31
71
|
/**
|
|
32
72
|
* `available` is false when the app has no cards turned on for the conversation's inboxes:
|
|
@@ -37,11 +77,18 @@ export type AppWidgetSummaryProps = AppWidgetCommonProps & {
|
|
|
37
77
|
isLoading: boolean;
|
|
38
78
|
disconnected: boolean;
|
|
39
79
|
available: boolean;
|
|
80
|
+
critical: boolean;
|
|
40
81
|
}) => void;
|
|
41
82
|
};
|
|
83
|
+
/** The collapsed value as a Figma badge: neutral, red, or red with an alert icon when disconnected. */
|
|
84
|
+
export declare const SummaryBadge: FC<{
|
|
85
|
+
text: string;
|
|
86
|
+
tone: 'neutral' | 'critical' | 'disconnected';
|
|
87
|
+
colors: Palette;
|
|
88
|
+
}>;
|
|
42
89
|
/**
|
|
43
|
-
* The
|
|
44
|
-
*
|
|
90
|
+
* The header's right side. Collapsed: the summary badge ("14 orders"), a grey pill while a slow
|
|
91
|
+
* load runs, blank when nothing is found. Expanded: the badge gives way to Refresh.
|
|
45
92
|
*/
|
|
46
93
|
export declare const AppWidgetSummary: FC<AppWidgetSummaryProps>;
|
|
47
94
|
export type AppWidgetBodyProps = AppWidgetCommonProps & {
|
|
@@ -50,8 +97,9 @@ export type AppWidgetBodyProps = AppWidgetCommonProps & {
|
|
|
50
97
|
adminNotified?: boolean;
|
|
51
98
|
};
|
|
52
99
|
/**
|
|
53
|
-
* The expanded widget:
|
|
54
|
-
* Host-agnostic: every click becomes an {@link AppWidgetAction} the host maps to its
|
|
100
|
+
* The expanded widget: "Look up by" (not for PM tools), up to two record cards, View all, and the
|
|
101
|
+
* app's buttons. Host-agnostic: every click becomes an {@link AppWidgetAction} the host maps to its
|
|
102
|
+
* app tab.
|
|
55
103
|
*/
|
|
56
104
|
export declare const AppWidgetBody: FC<AppWidgetBodyProps>;
|
|
57
105
|
export type { AppWidgetModel };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppWidget.d.ts","sourceRoot":"","sources":["../../../../src/features/app-widget/components/AppWidget.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"AppWidget.d.ts","sourceRoot":"","sources":["../../../../src/features/app-widget/components/AppWidget.tsx"],"names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AAO,OAAO,CAAC,CAAC;AAsH1C,MAAM,MAAM,qBAAqB,GAAG,oBAAoB,GAAG;IACzD;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oFAAoF;IACpF;;;OAGG;IACH,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE;QAC1B,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,OAAO,CAAC;QACnB,YAAY,EAAE,OAAO,CAAC;QACtB,SAAS,EAAE,OAAO,CAAC;QACnB,QAAQ,EAAE,OAAO,CAAC;KACnB,KAAK,IAAI,CAAC;CACZ,CAAC;AAEF,uGAAuG;AACvG,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,SAAS,GAAG,UAAU,GAAG,cAAc,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,CA6B7G,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAgFtD,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,oBAAoB,GAAG;IACtD,QAAQ,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;IAC5C,oFAAoF;IACpF,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CA6JhD,CAAC;AAyVF,YAAY,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -21,9 +21,11 @@ export type AppWidgetCardConfig = {
|
|
|
21
21
|
/** Shown above the card title ("Order"); also "Restricted <recordType>". */
|
|
22
22
|
recordType: string;
|
|
23
23
|
/** Joined with a space; when empty, the first `fallback` key with a value. */
|
|
24
|
+
/** `label` heads the card's first row ("Customer name"); without one the record type does. */
|
|
24
25
|
title: {
|
|
25
26
|
keys: string[];
|
|
26
27
|
fallback?: string[];
|
|
28
|
+
label?: string;
|
|
27
29
|
};
|
|
28
30
|
fields: AppWidgetFieldConfig[];
|
|
29
31
|
/** A record whose status matches `closed` (case-insensitive) is not open. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/features/app-widget/config.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC1B,mEAAmE;IACnE,IAAI,CAAC,EAAE,sBAAsB,CAAC;IAC9B,mFAAmF;IACnF,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,iFAAiF;IACjF,MAAM,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,UAAU,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAC/
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/features/app-widget/config.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC1B,mEAAmE;IACnE,IAAI,CAAC,EAAE,sBAAsB,CAAC;IAC9B,mFAAmF;IACnF,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;A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_WIDGET_EVENTS: {
|
|
|
5
5
|
readonly CTA_CLICKED: "app_widget_cta_clicked";
|
|
6
6
|
readonly REFRESHED: "app_widget_refreshed";
|
|
7
7
|
readonly AUTH_ACTION: "app_widget_auth_action";
|
|
8
|
+
readonly LOOKUP_CHANGED: "app_widget_lookup_changed";
|
|
8
9
|
};
|
|
9
10
|
/** Placeholders appear only when a load is slower than this, so fast loads don't flicker (Q29). */
|
|
10
11
|
export declare const PLACEHOLDER_DELAY_MS = 300;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/features/app-widget/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/features/app-widget/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB;;;;;;;;CAQpB,CAAC;AAEX,mGAAmG;AACnG,eAAO,MAAM,oBAAoB,MAAM,CAAC"}
|
|
@@ -6,12 +6,14 @@ import { AppWidgetModel } from './types';
|
|
|
6
6
|
* category and the template's recordWord rather than inlined in components.
|
|
7
7
|
*/
|
|
8
8
|
export declare const emptyStateText: (app: AppWidgetConfig) => string;
|
|
9
|
-
|
|
9
|
+
/** Figma "Disconnected - admin/agent view": a title, then what the rep can do about it. */
|
|
10
|
+
export declare const disconnectedTitle: (appName: string) => string;
|
|
11
|
+
export declare const disconnectedBody: (app: AppWidgetConfig, isAdmin: boolean) => string;
|
|
10
12
|
export declare const reconnectLabel: (appName: string) => string;
|
|
11
13
|
export declare const NOTIFY_ADMIN_LABEL = "Notify admin";
|
|
12
14
|
export declare const NOTIFY_ADMIN_SENT_LABEL = "Admin notified";
|
|
13
|
-
/** Collapsed value while the connection is broken
|
|
14
|
-
export declare const
|
|
15
|
+
/** Collapsed value while the connection is broken: the Figma's red "Disconnected" badge, for every role. */
|
|
16
|
+
export declare const DISCONNECTED_SUMMARY = "Disconnected";
|
|
15
17
|
/** The app needs the rep's own connection (decision for K-10/K-11; collapsed label pending Q30). */
|
|
16
18
|
export declare const personalConnectText: (appName: string) => string;
|
|
17
19
|
export declare const PERSONAL_CONNECT_LABEL = "Connect";
|
|
@@ -24,7 +26,9 @@ export declare const SEARCH_LINK_LABEL = "Search & link";
|
|
|
24
26
|
/** The app's reads failed for a reason that passes (rate limit, server error, network). */
|
|
25
27
|
export declare const UNAVAILABLE_TEXT = "Couldn't load right now.";
|
|
26
28
|
export declare const TRY_AGAIN_LABEL = "Try again";
|
|
27
|
-
export declare const
|
|
29
|
+
export declare const LOOK_UP_BY_LABEL = "Look up by";
|
|
30
|
+
/** "Refresh · updated 2 min ago" (Figma "Refresh on hover"). */
|
|
31
|
+
export declare const refreshTooltip: (updatedAt: number, now: number) => string;
|
|
28
32
|
/** The collapsed value a host shows in its section header; empty when nothing was found. */
|
|
29
|
-
export declare const appWidgetSummaryText: (model: AppWidgetModel | null,
|
|
33
|
+
export declare const appWidgetSummaryText: (model: AppWidgetModel | null, _isAdmin?: boolean) => string;
|
|
30
34
|
//# sourceMappingURL=copy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy.d.ts","sourceRoot":"","sources":["../../../src/features/app-widget/copy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C;;;;GAIG;AAEH,eAAO,MAAM,cAAc,QAAS,eAAe,KAAG,MAarD,CAAC;AAKF,eAAO,MAAM,gBAAgB,QAAS,eAAe,WAAW,
|
|
1
|
+
{"version":3,"file":"copy.d.ts","sourceRoot":"","sources":["../../../src/features/app-widget/copy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C;;;;GAIG;AAEH,eAAO,MAAM,cAAc,QAAS,eAAe,KAAG,MAarD,CAAC;AAKF,2FAA2F;AAC3F,eAAO,MAAM,iBAAiB,YAAa,MAAM,WAAiC,CAAC;AAEnF,eAAO,MAAM,gBAAgB,QAAS,eAAe,WAAW,OAAO,KAAG,MAGkD,CAAC;AAE7H,eAAO,MAAM,cAAc,YAAa,MAAM,WAA2B,CAAC;AAE1E,eAAO,MAAM,kBAAkB,iBAAiB,CAAC;AACjD,eAAO,MAAM,uBAAuB,mBAAmB,CAAC;AAExD,4GAA4G;AAC5G,eAAO,MAAM,oBAAoB,iBAAiB,CAAC;AAEnD,oGAAoG;AACpG,eAAO,MAAM,mBAAmB,YAAa,MAAM,WAAsD,CAAC;AAC1G,eAAO,MAAM,sBAAsB,YAAY,CAAC;AAChD,eAAO,MAAM,wBAAwB,YAAY,CAAC;AAClD,eAAO,MAAM,4BAA4B,iCAAiC,CAAC;AAE3E,yEAAyE;AACzE,eAAO,MAAM,WAAW,UAAW,MAAM,WAAyC,CAAC;AAEnF,eAAO,MAAM,YAAY,UAAW,MAAM,WAAuC,CAAC;AAElF,eAAO,MAAM,iBAAiB,kBAAkB,CAAC;AAEjD,2FAA2F;AAC3F,eAAO,MAAM,gBAAgB,6BAA6B,CAAC;AAC3D,eAAO,MAAM,eAAe,cAAc,CAAC;AAE3C,eAAO,MAAM,gBAAgB,eAAe,CAAC;AAE7C,gEAAgE;AAChE,eAAO,MAAM,cAAc,cAAe,MAAM,OAAO,MAAM,KAAG,MAO/D,CAAC;AAIF,4FAA4F;AAE5F,eAAO,MAAM,oBAAoB,UAAW,cAAc,GAAG,IAAI,aAAa,OAAO,KAAG,MAKvF,CAAC"}
|
|
@@ -14,7 +14,7 @@ export type AppWidgetCardList = {
|
|
|
14
14
|
cards: ICard[];
|
|
15
15
|
/** The app is turned on for these inboxes (see AppWidgetModel.available). */
|
|
16
16
|
available: boolean;
|
|
17
|
-
/** Every one of the app's forms reports it unauthenticated: its connection is broken. */
|
|
17
|
+
/** Every one of the app's forms reports it unauthenticated: its connection is broken (no cards are read). */
|
|
18
18
|
formsUnauthenticated?: boolean;
|
|
19
19
|
/** The app has a link or search form for these inboxes (Search & link has something to open). */
|
|
20
20
|
canSearchLink?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../src/features/app-widget/loader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,KAAK,EAAiB,MAAM,eAAe,CAAC;AAG1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEjE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,iFAAiF;IACjF,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,+EAA+E;IAC/E,KAAK,EAAE,KAAK,EAAE,CAAC;IACf,6EAA6E;IAC7E,SAAS,EAAE,OAAO,CAAC;IACnB,
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../src/features/app-widget/loader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,KAAK,EAAiB,MAAM,eAAe,CAAC;AAG1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEjE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,iFAAiF;IACjF,YAAY,EAAE,MAAM,CAA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,eAAe,SAChB,iBAAiB,EAAE,mFAMzB,cA6BF,CAAC"}
|
|
@@ -11,8 +11,10 @@ export type AppWidgetRecord = {
|
|
|
11
11
|
/** Stable within one widget: card id plus the record's external id (or row index). */
|
|
12
12
|
id: string;
|
|
13
13
|
cardId: string;
|
|
14
|
-
/** The record type the spec names ("Order", "Opportunity")
|
|
14
|
+
/** The record type the spec names ("Order", "Opportunity"). */
|
|
15
15
|
recordType: string;
|
|
16
|
+
/** Label of the card's first row, beside the title ("Customer name"); the record type when the template has none. */
|
|
17
|
+
titleLabel?: string;
|
|
16
18
|
title: string;
|
|
17
19
|
fields: AppWidgetField[];
|
|
18
20
|
/** Opens the record in the third-party app. */
|
|
@@ -34,6 +36,8 @@ export type AppWidgetModel = {
|
|
|
34
36
|
category: AppWidgetCategory;
|
|
35
37
|
/** Collapsed value ("14 orders"); empty string when nothing was found. */
|
|
36
38
|
summary: string;
|
|
39
|
+
/** The collapsed value reads red (taken from a field the template marks critical, e.g. overdue). */
|
|
40
|
+
summaryCritical?: boolean;
|
|
37
41
|
/** At most two, in the category's order. */
|
|
38
42
|
records: AppWidgetRecord[];
|
|
39
43
|
/** Every record the widget could show; drives "View all (N)". */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/features/app-widget/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE1D,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,KAAK,GAAG,SAAS,GAAG,IAAI,CAAC;AAEvE,+FAA+F;AAC/F,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB,CAAC;AAEF,+EAA+E;AAC/E,MAAM,MAAM,eAAe,GAAG;IAC5B,sFAAsF;IACtF,EAAE,EAAE,MAA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B,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,mBAAmB,CAAC;IAChC;;;OAGG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,sFAAsF;AACtF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,KAAK,CAAC;IACZ,IAAI,EAAE,aAAa,GAAG,IAAI,CAAC;IAC3B,oDAAoD;IACpD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wFAAwF;IACxF,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC"}
|
|
@@ -4,6 +4,11 @@ import { AppWidgetModel } from './types';
|
|
|
4
4
|
export type UseAppWidgetDataArgs = AppWidgetLoadArgs & {
|
|
5
5
|
/** Hosts pause reads while the widget is hidden behind a flag or by the user. */
|
|
6
6
|
enabled?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Every email address the conversation's contact has, for the "Look up by" picker. The lookup
|
|
9
|
+
* starts on `contactEmail`; hosts that know only one address can leave this out.
|
|
10
|
+
*/
|
|
11
|
+
contactEmails?: string[];
|
|
7
12
|
};
|
|
8
13
|
export type AppWidgetData = {
|
|
9
14
|
/** The template's widget; null while it loads or when the template declares none. */
|
|
@@ -11,8 +16,21 @@ export type AppWidgetData = {
|
|
|
11
16
|
model: AppWidgetModel | null;
|
|
12
17
|
/** Cards list or a card read still in flight. Hosts show placeholders after a short delay. */
|
|
13
18
|
isLoading: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* A refresh the rep asked for is re-reading the cards. The previous model stays in `model`
|
|
21
|
+
* meanwhile, so hosts show the refresh in progress (button disabled, placeholders) instead.
|
|
22
|
+
*/
|
|
23
|
+
isRefreshing: boolean;
|
|
14
24
|
/** Re-reads every card, skipping the server's short cache of keyed reads. */
|
|
15
25
|
refresh: () => void;
|
|
26
|
+
/** The email the records are looked up by: the rep's pick from `lookupEmails`, else contactEmail. */
|
|
27
|
+
lookupEmail: string;
|
|
28
|
+
/** The addresses the "Look up by" picker offers (contactEmail first, no duplicates). */
|
|
29
|
+
lookupEmails: string[];
|
|
30
|
+
/** Looks the records up by another of the contact's addresses (header and body follow). */
|
|
31
|
+
setLookupEmail: (email: string) => void;
|
|
32
|
+
/** When the shown values were last read (ms epoch), for "updated 2 min ago"; 0 before the first read. */
|
|
33
|
+
updatedAt: number;
|
|
16
34
|
};
|
|
17
35
|
export declare const appWidgetQueryScope: (connectorId: string, conversationId: number) => readonly ["appWidget", string, number];
|
|
18
36
|
/**
|
|
@@ -20,5 +38,5 @@ export declare const appWidgetQueryScope: (connectorId: string, conversationId:
|
|
|
20
38
|
* that slice is a module singleton the tab clears on unmount, so a widget sharing it would be
|
|
21
39
|
* wiped whenever the tab closes. The requests are the tab's, so both show the same records.
|
|
22
40
|
*/
|
|
23
|
-
export declare const useAppWidgetData: ({ connectorId, connectorName, conversationId, contactEmail, inboxIds, enabled }: UseAppWidgetDataArgs) => AppWidgetData;
|
|
41
|
+
export declare const useAppWidgetData: ({ connectorId, connectorName, conversationId, contactEmail, contactEmails, inboxIds, enabled }: UseAppWidgetDataArgs) => AppWidgetData;
|
|
24
42
|
//# sourceMappingURL=useAppWidgetData.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAppWidgetData.d.ts","sourceRoot":"","sources":["../../../src/features/app-widget/useAppWidgetData.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,OAAO,KAAK,EAAqB,cAAc,EAAE,MAAM,SAAS,CAAC;AAEjE,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,GAAG;IACrD,iFAAiF;IACjF,OAAO,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useAppWidgetData.d.ts","sourceRoot":"","sources":["../../../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