@repzo/widget-react-native 1.0.9 → 1.2.0
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/CHANGELOG.md +400 -0
- package/README.md +104 -5
- package/lib/commonjs/agent-ui-blocks.js +2 -1
- package/lib/commonjs/agent-ui-blocks.js.map +1 -1
- package/lib/commonjs/api/client.js +25 -0
- package/lib/commonjs/api/client.js.map +1 -1
- package/lib/commonjs/attachments/pickers.js +3 -6
- package/lib/commonjs/attachments/pickers.js.map +1 -1
- package/lib/commonjs/device-id.js +31 -3
- package/lib/commonjs/device-id.js.map +1 -1
- package/lib/commonjs/i18n.js +40 -4
- package/lib/commonjs/i18n.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/locales.js +34 -1
- package/lib/commonjs/locales.js.map +1 -1
- package/lib/commonjs/push/push-notifications.js +9 -8
- package/lib/commonjs/push/push-notifications.js.map +1 -1
- package/lib/commonjs/state/widget-store.js +507 -26
- package/lib/commonjs/state/widget-store.js.map +1 -1
- package/lib/commonjs/storage.js +13 -1
- package/lib/commonjs/storage.js.map +1 -1
- package/lib/commonjs/types.js +20 -2
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/ui/WidgetProvider.js +138 -49
- package/lib/commonjs/ui/WidgetProvider.js.map +1 -1
- package/lib/commonjs/ui/components/AgentUiBlocks.js +35 -15
- package/lib/commonjs/ui/components/AgentUiBlocks.js.map +1 -1
- package/lib/commonjs/ui/components/Launcher.js +4 -1
- package/lib/commonjs/ui/components/Launcher.js.map +1 -1
- package/lib/commonjs/ui/components/Markdown.js +32 -2
- package/lib/commonjs/ui/components/Markdown.js.map +1 -1
- package/lib/commonjs/ui/components/Post.js +1241 -0
- package/lib/commonjs/ui/components/Post.js.map +1 -0
- package/lib/commonjs/ui/components/RatingCard.js +6 -3
- package/lib/commonjs/ui/components/RatingCard.js.map +1 -1
- package/lib/commonjs/ui/hooks/use-widget-insets.js +0 -1
- package/lib/commonjs/ui/hooks/use-widget-insets.js.map +1 -1
- package/lib/commonjs/ui/screens/chat/ChatView.js +67 -29
- package/lib/commonjs/ui/screens/chat/ChatView.js.map +1 -1
- package/lib/commonjs/ui/utils/html.js +9 -1
- package/lib/commonjs/ui/utils/html.js.map +1 -1
- package/lib/commonjs/ui/utils/native-gradient.js +0 -1
- package/lib/commonjs/ui/utils/native-gradient.js.map +1 -1
- package/lib/commonjs/ui/utils/post-html.js +276 -0
- package/lib/commonjs/ui/utils/post-html.js.map +1 -0
- package/lib/commonjs/ui/utils/safe-url.js +16 -0
- package/lib/commonjs/ui/utils/safe-url.js.map +1 -1
- package/lib/module/agent-ui-blocks.js +2 -1
- package/lib/module/agent-ui-blocks.js.map +1 -1
- package/lib/module/api/client.js +25 -0
- package/lib/module/api/client.js.map +1 -1
- package/lib/module/attachments/pickers.js +3 -6
- package/lib/module/attachments/pickers.js.map +1 -1
- package/lib/module/device-id.js +31 -3
- package/lib/module/device-id.js.map +1 -1
- package/lib/module/i18n.js +40 -4
- package/lib/module/i18n.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/locales.js +34 -1
- package/lib/module/locales.js.map +1 -1
- package/lib/module/push/push-notifications.js +9 -8
- package/lib/module/push/push-notifications.js.map +1 -1
- package/lib/module/state/widget-store.js +507 -25
- package/lib/module/state/widget-store.js.map +1 -1
- package/lib/module/storage.js +13 -1
- package/lib/module/storage.js.map +1 -1
- package/lib/module/types.js +20 -2
- package/lib/module/types.js.map +1 -1
- package/lib/module/ui/WidgetProvider.js +139 -50
- package/lib/module/ui/WidgetProvider.js.map +1 -1
- package/lib/module/ui/components/AgentUiBlocks.js +35 -15
- package/lib/module/ui/components/AgentUiBlocks.js.map +1 -1
- package/lib/module/ui/components/Launcher.js +4 -1
- package/lib/module/ui/components/Launcher.js.map +1 -1
- package/lib/module/ui/components/Markdown.js +32 -3
- package/lib/module/ui/components/Markdown.js.map +1 -1
- package/lib/module/ui/components/Post.js +1236 -0
- package/lib/module/ui/components/Post.js.map +1 -0
- package/lib/module/ui/components/RatingCard.js +6 -3
- package/lib/module/ui/components/RatingCard.js.map +1 -1
- package/lib/module/ui/hooks/use-widget-insets.js +0 -1
- package/lib/module/ui/hooks/use-widget-insets.js.map +1 -1
- package/lib/module/ui/screens/chat/ChatView.js +68 -30
- package/lib/module/ui/screens/chat/ChatView.js.map +1 -1
- package/lib/module/ui/utils/html.js +9 -2
- package/lib/module/ui/utils/html.js.map +1 -1
- package/lib/module/ui/utils/native-gradient.js +0 -1
- package/lib/module/ui/utils/native-gradient.js.map +1 -1
- package/lib/module/ui/utils/post-html.js +271 -0
- package/lib/module/ui/utils/post-html.js.map +1 -0
- package/lib/module/ui/utils/safe-url.js +15 -0
- package/lib/module/ui/utils/safe-url.js.map +1 -1
- package/lib/typescript/commonjs/agent-ui-blocks.d.ts.map +1 -1
- package/lib/typescript/commonjs/api/client.d.ts +19 -1
- package/lib/typescript/commonjs/api/client.d.ts.map +1 -1
- package/lib/typescript/commonjs/attachments/pickers.d.ts.map +1 -1
- package/lib/typescript/commonjs/device-id.d.ts.map +1 -1
- package/lib/typescript/commonjs/i18n.d.ts +35 -1
- package/lib/typescript/commonjs/i18n.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +1 -1
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/locales.d.ts.map +1 -1
- package/lib/typescript/commonjs/push/push-notifications.d.ts +6 -2
- package/lib/typescript/commonjs/push/push-notifications.d.ts.map +1 -1
- package/lib/typescript/commonjs/state/widget-store.d.ts +97 -8
- package/lib/typescript/commonjs/state/widget-store.d.ts.map +1 -1
- package/lib/typescript/commonjs/storage.d.ts.map +1 -1
- package/lib/typescript/commonjs/types.d.ts +91 -8
- package/lib/typescript/commonjs/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/WidgetProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/AgentUiBlocks.d.ts +14 -0
- package/lib/typescript/commonjs/ui/components/AgentUiBlocks.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/Launcher.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/Markdown.d.ts +8 -0
- package/lib/typescript/commonjs/ui/components/Markdown.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/Post.d.ts +69 -0
- package/lib/typescript/commonjs/ui/components/Post.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/RatingCard.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/use-widget-insets.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/chat/ChatView.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/chat/ChatView.types.d.ts +10 -0
- package/lib/typescript/commonjs/ui/screens/chat/ChatView.types.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/html.d.ts +1 -0
- package/lib/typescript/commonjs/ui/utils/html.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/native-gradient.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/post-html.d.ts +54 -0
- package/lib/typescript/commonjs/ui/utils/post-html.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/utils/safe-url.d.ts +6 -0
- package/lib/typescript/commonjs/ui/utils/safe-url.d.ts.map +1 -1
- package/lib/typescript/module/agent-ui-blocks.d.ts.map +1 -1
- package/lib/typescript/module/api/client.d.ts +19 -1
- package/lib/typescript/module/api/client.d.ts.map +1 -1
- package/lib/typescript/module/attachments/pickers.d.ts.map +1 -1
- package/lib/typescript/module/device-id.d.ts.map +1 -1
- package/lib/typescript/module/i18n.d.ts +35 -1
- package/lib/typescript/module/i18n.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +1 -1
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/locales.d.ts.map +1 -1
- package/lib/typescript/module/push/push-notifications.d.ts +6 -2
- package/lib/typescript/module/push/push-notifications.d.ts.map +1 -1
- package/lib/typescript/module/state/widget-store.d.ts +97 -8
- package/lib/typescript/module/state/widget-store.d.ts.map +1 -1
- package/lib/typescript/module/storage.d.ts.map +1 -1
- package/lib/typescript/module/types.d.ts +91 -8
- package/lib/typescript/module/types.d.ts.map +1 -1
- package/lib/typescript/module/ui/WidgetProvider.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/AgentUiBlocks.d.ts +14 -0
- package/lib/typescript/module/ui/components/AgentUiBlocks.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/Launcher.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/Markdown.d.ts +8 -0
- package/lib/typescript/module/ui/components/Markdown.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/Post.d.ts +69 -0
- package/lib/typescript/module/ui/components/Post.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/RatingCard.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/use-widget-insets.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/chat/ChatView.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/chat/ChatView.types.d.ts +10 -0
- package/lib/typescript/module/ui/screens/chat/ChatView.types.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/html.d.ts +1 -0
- package/lib/typescript/module/ui/utils/html.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/native-gradient.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/post-html.d.ts +54 -0
- package/lib/typescript/module/ui/utils/post-html.d.ts.map +1 -0
- package/lib/typescript/module/ui/utils/safe-url.d.ts +6 -0
- package/lib/typescript/module/ui/utils/safe-url.d.ts.map +1 -1
- package/package.json +14 -4
- package/src/agent-ui-blocks.ts +2 -1
- package/src/api/client.ts +27 -0
- package/src/attachments/pickers.ts +3 -6
- package/src/device-id.ts +34 -3
- package/src/i18n.ts +39 -2
- package/src/index.tsx +4 -0
- package/src/locales.ts +33 -0
- package/src/push/push-notifications.ts +10 -8
- package/src/state/widget-store.ts +480 -24
- package/src/storage.ts +18 -1
- package/src/types.ts +91 -8
- package/src/ui/WidgetProvider.tsx +166 -48
- package/src/ui/components/AgentUiBlocks.tsx +40 -12
- package/src/ui/components/Launcher.tsx +6 -1
- package/src/ui/components/Markdown.tsx +34 -3
- package/src/ui/components/Post.tsx +943 -0
- package/src/ui/components/RatingCard.tsx +6 -2
- package/src/ui/hooks/use-widget-insets.ts +0 -1
- package/src/ui/screens/chat/ChatView.tsx +77 -42
- package/src/ui/screens/chat/ChatView.types.ts +10 -0
- package/src/ui/utils/html.ts +10 -2
- package/src/ui/utils/native-gradient.ts +0 -1
- package/src/ui/utils/post-html.ts +256 -0
- package/src/ui/utils/safe-url.ts +15 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Send post HTML → blocks a React Native view can draw.
|
|
3
|
+
*
|
|
4
|
+
* The CRM renders and sanitizes the post before sending it, down to a flat
|
|
5
|
+
* set: `<p>` with `<strong>` / `<em>` / `<code>` / `<a href>` / `<br>`,
|
|
6
|
+
* `<ul>` / `<ol>` of `<li>`, `<pre><code>`, a button
|
|
7
|
+
* (`<div data-post-button data-align>` around one link) and social links
|
|
8
|
+
* (`<div data-post-social data-align>` of `<a data-network>`). React Native
|
|
9
|
+
* has no HTML renderer, so this turns that subset into blocks. Unknown tags
|
|
10
|
+
* keep their text. A link survives when it's one the host could route
|
|
11
|
+
* (`myapp://…` through `onOpenUrl`) or the allow-list would open; tapping it
|
|
12
|
+
* goes through `openExternalUrl` like every other widget link.
|
|
13
|
+
*/
|
|
14
|
+
export interface PostTextRun {
|
|
15
|
+
text: string;
|
|
16
|
+
bold: boolean;
|
|
17
|
+
italic: boolean;
|
|
18
|
+
code: boolean;
|
|
19
|
+
/** Set when the run is a link the SDK may open. */
|
|
20
|
+
href: string | null;
|
|
21
|
+
}
|
|
22
|
+
export type PostAlign = 'left' | 'center' | 'right';
|
|
23
|
+
export declare const POST_SOCIAL_NETWORKS: readonly ["facebook", "x", "linkedin", "instagram", "youtube"];
|
|
24
|
+
export type PostSocialNetwork = (typeof POST_SOCIAL_NETWORKS)[number];
|
|
25
|
+
export type PostBlock = {
|
|
26
|
+
type: 'paragraph';
|
|
27
|
+
runs: PostTextRun[];
|
|
28
|
+
} | {
|
|
29
|
+
type: 'list';
|
|
30
|
+
ordered: boolean;
|
|
31
|
+
items: PostTextRun[][];
|
|
32
|
+
/** Per item: how deep it's nested (0 = top level) and its own list's kind. */
|
|
33
|
+
levels: Array<{
|
|
34
|
+
depth: number;
|
|
35
|
+
ordered: boolean;
|
|
36
|
+
}>;
|
|
37
|
+
} | {
|
|
38
|
+
type: 'code';
|
|
39
|
+
text: string;
|
|
40
|
+
} | {
|
|
41
|
+
type: 'button';
|
|
42
|
+
label: string;
|
|
43
|
+
href: string;
|
|
44
|
+
align: PostAlign;
|
|
45
|
+
} | {
|
|
46
|
+
type: 'social';
|
|
47
|
+
align: PostAlign;
|
|
48
|
+
links: Array<{
|
|
49
|
+
network: PostSocialNetwork;
|
|
50
|
+
href: string;
|
|
51
|
+
}>;
|
|
52
|
+
};
|
|
53
|
+
export declare function parsePostHtml(html: string): PostBlock[];
|
|
54
|
+
//# sourceMappingURL=post-html.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post-html.d.ts","sourceRoot":"","sources":["../../../../../src/ui/utils/post-html.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,mDAAmD;IACnD,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEpD,eAAO,MAAM,oBAAoB,gEAAiE,CAAC;AACnG,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,MAAM,MAAM,SAAS,GACjB;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,WAAW,EAAE,CAAA;CAAE,GAC1C;IACE,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,WAAW,EAAE,EAAE,CAAC;IACvB,8EAA8E;IAC9E,MAAM,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;CACpD,GACD;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC9B;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,GACjE;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,iBAAiB,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC;AAwCrG,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,CA4KvD"}
|
|
@@ -15,6 +15,12 @@ export declare function urlScheme(url: string): string | null;
|
|
|
15
15
|
/** Absolute `http(s)://host…` — the only shape media URLs may take. */
|
|
16
16
|
export declare function isHttpUrl(url: string): boolean;
|
|
17
17
|
export declare function isSafeExternalUrl(url: string): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Worth drawing as a link: absolute, with a scheme the host could route
|
|
20
|
+
* through `onOpenUrl` (`myapp://…`) or the allow-list would open. Tapping it
|
|
21
|
+
* still goes through `openExternalUrl`, which makes the actual call.
|
|
22
|
+
*/
|
|
23
|
+
export declare function isRoutableUrl(url: string): boolean;
|
|
18
24
|
/** Host handler first, then the allow-list. Never throws. */
|
|
19
25
|
export declare function openExternalUrl(url: string | null | undefined): Promise<void>;
|
|
20
26
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safe-url.d.ts","sourceRoot":"","sources":["../../../../../src/ui/utils/safe-url.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,KAAK,cAAc,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AASlE,0EAA0E;AAC1E,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,GAAG,IAAI,CAEtE;AAED,kFAAkF;AAClF,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGpD;AAED,uEAAuE;AACvE,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE9C;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAKtD;AAED,6DAA6D;AAC7D,wBAAsB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBnF"}
|
|
1
|
+
{"version":3,"file":"safe-url.d.ts","sourceRoot":"","sources":["../../../../../src/ui/utils/safe-url.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,KAAK,cAAc,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AASlE,0EAA0E;AAC1E,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,GAAG,IAAI,CAEtE;AAED,kFAAkF;AAClF,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGpD;AAED,uEAAuE;AACvE,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE9C;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAKtD;AAKD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAKlD;AAED,6DAA6D;AAC7D,wBAAsB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBnF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-ui-blocks.d.ts","sourceRoot":"","sources":["../../../src/agent-ui-blocks.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAgM/E;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,EAAE,CAmBjE;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,kBAGpF;AAED,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,GACnD,kBAAkB,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"agent-ui-blocks.d.ts","sourceRoot":"","sources":["../../../src/agent-ui-blocks.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAgM/E;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,EAAE,CAmBjE;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,kBAGpF;AAED,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,GACnD,kBAAkB,GAAG,IAAI,CAkB3B;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CA+CxE"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* 401 triggers one silent re-init + retry (single-flight, owned by the store).
|
|
8
8
|
* The token itself lives in `SecureStorage`.
|
|
9
9
|
*/
|
|
10
|
-
import type { AgentUiAction, Conversation, ConversationRatingResult, InitResponse, Message, OutboundMessage, RepzoWidgetErrorCode, WidgetConfig, WidgetUser } from '../types';
|
|
10
|
+
import type { AgentUiAction, Conversation, ConversationRatingResult, InitResponse, Message, OutboundMessage, PostInteractionKind, PostReply, RepzoWidgetErrorCode, WidgetConfig, WidgetPost, WidgetUser } from '../types';
|
|
11
11
|
export declare function isTerminalErrorCode(code: string | null | undefined): boolean;
|
|
12
12
|
export declare class RepzoWidgetError extends Error {
|
|
13
13
|
readonly status: number;
|
|
@@ -46,6 +46,24 @@ export declare class WidgetApiClient {
|
|
|
46
46
|
getOutboundMessage(): Promise<{
|
|
47
47
|
message: OutboundMessage | null;
|
|
48
48
|
}>;
|
|
49
|
+
/**
|
|
50
|
+
* The Send post this visitor should see now, if any.
|
|
51
|
+
* `recheckInMs`: ask again after this long — the shown one stops then.
|
|
52
|
+
*/
|
|
53
|
+
getPost(): Promise<{
|
|
54
|
+
post: WidgetPost | null;
|
|
55
|
+
recheckInMs?: number | null;
|
|
56
|
+
}>;
|
|
57
|
+
/**
|
|
58
|
+
* Reports what the visitor did with a post; `hidden` means load the next
|
|
59
|
+
* one. A reply comes back as saved (`reply`) — it's also delivered to the
|
|
60
|
+
* post's conversation in the inbox, where the team answers.
|
|
61
|
+
*/
|
|
62
|
+
sendPostInteraction(campaignId: string, kind: PostInteractionKind, value?: string): Promise<{
|
|
63
|
+
hidden: boolean;
|
|
64
|
+
reply?: PostReply;
|
|
65
|
+
conversationId?: string | null;
|
|
66
|
+
}>;
|
|
49
67
|
/**
|
|
50
68
|
* Does NOT store the returned token — the store persists it only once it
|
|
51
69
|
* knows the identity op that asked for it is still current.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/api/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EACZ,wBAAwB,EACxB,YAAY,EACZ,OAAO,EACP,eAAe,EACf,oBAAoB,EACpB,YAAY,EACZ,UAAU,EACX,MAAM,UAAU,CAAC;AASlB,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAE5E;AAED,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB,QAAQ,CAAC,IAAI,EAAE,oBAAoB,CAAC;gBAExB,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,GAAE,oBAA6B;IAOhF,+DAA+D;IAC/D,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,gBAAgB;CAYrE;AAcD,qBAAa,eAAe;IAC1B,OAAO,CAAC,OAAO,CAAM;IAErB,OAAO,CAAC,gBAAgB,CAAM;IAE9B,OAAO,CAAC,KAAK,CAAuB;IAEpC,OAAO,CAAC,WAAW,CAAS;IAE5B;;;OAGG;IACH,WAAW,EAAE,CAAC,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAQ;IAEpF,kFAAkF;IAClF,eAAe,EAAE,CAAC,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC,GAAG,IAAI,CAAQ;IAEnE,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,gBA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ACd,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjB,qEAAqE;IACrE,eAAe,CACb,KAAK,EAAE,MAAM,EACb,IAAI,GAAE;QAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,UAAU,CAAC,EAAE,OAAO,CAAA;KAAO,GAC7D,OAAO,CAAC,IAAI,CAAC;CAOjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pickers.d.ts","sourceRoot":"","sources":["../../../../src/attachments/pickers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAmB,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAEhG,mEAAmE;AACnE,eAAO,MAAM,eAAe,IAAI,CAAC;AACjC,oEAAoE;AACpE,eAAO,MAAM,oBAAoB,UAAY,CAAC;AAC9C;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,UAAY,CAAC;AAKpD,mFAAmF;AACnF,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,gEAAgE;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,kDAAkD;IAClD,OAAO,EAAE,MAAM,CAAC;IAChB,gFAAgF;IAChF,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,oEAAoE;AACpE,MAAM,MAAM,iBAAiB,GACzB,SAAS,GACT,UAAU,GACV,kBAAkB,GAClB,cAAc,GACd,QAAQ,CAAC;AAEb,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,uEAAuE;IACvE,OAAO,EAAE,iBAAiB,GAAG,IAAI,CAAC;CACnC;
|
|
1
|
+
{"version":3,"file":"pickers.d.ts","sourceRoot":"","sources":["../../../../src/att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AAI,CAM1B;AAED,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAExE;AAKD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAIpF;AAED,uEAAuE;AACvE,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGxD;AAED,8DAA8D;AAC9D,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAKvD;AAED,mFAAmF;AACnF,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIjD;AAED,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAEjF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device-id.d.ts","sourceRoot":"","sources":["../../../src/device-id.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"device-id.d.ts","sourceRoot":"","sources":["../../../src/device-id.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAqEH,wBAAsB,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC,CAanD;AAED,iDAAiD;AACjD,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC;AAED;;;GAGG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAGpD"}
|
|
@@ -12,7 +12,7 @@ export type Translator = (key: string, fallback: string) => string;
|
|
|
12
12
|
* copy always outranks a bundled translation.
|
|
13
13
|
*/
|
|
14
14
|
export declare function createTranslator(config: WidgetConfig | null, locale: string): Translator;
|
|
15
|
-
/** The config with its welcome text in the active locale. */
|
|
15
|
+
/** The config with its welcome text and offline message in the active locale. */
|
|
16
16
|
export declare function localizeWelcomeText(config: WidgetConfig | null, locale: string): WidgetConfig | null;
|
|
17
17
|
export declare const DEFAULT_LABELS: {
|
|
18
18
|
readonly back: "Back";
|
|
@@ -89,6 +89,14 @@ export declare const DEFAULT_LABELS: {
|
|
|
89
89
|
readonly rating5: "Amazing";
|
|
90
90
|
readonly procedureSend: "Send details";
|
|
91
91
|
readonly procedureSent: "Sent";
|
|
92
|
+
readonly procedureShareDetails: "Share details";
|
|
93
|
+
readonly procedureDetailsSent: "Details sent";
|
|
94
|
+
readonly procedureHide: "Hide";
|
|
95
|
+
readonly procedureFieldCount: "{count} fields";
|
|
96
|
+
readonly procedureFieldCountOne: "1 field";
|
|
97
|
+
readonly procedureTitle: "Details";
|
|
98
|
+
readonly procedureEmailPlaceholder: "name@example.com";
|
|
99
|
+
readonly procedurePhonePlaceholder: "+962 7...";
|
|
92
100
|
readonly fieldRequired: "{field} is required";
|
|
93
101
|
readonly invalidEmail: "Enter a valid email address";
|
|
94
102
|
readonly working: "Working...";
|
|
@@ -99,11 +107,37 @@ export declare const DEFAULT_LABELS: {
|
|
|
99
107
|
readonly notificationNewReply: "New reply";
|
|
100
108
|
readonly notificationAttachment: "Sent an attachment";
|
|
101
109
|
readonly notificationOpenHint: "Opens the conversation";
|
|
110
|
+
readonly postFrom: "{name} from {workspace}";
|
|
111
|
+
readonly postNewMessage: "New message";
|
|
112
|
+
readonly postOpenHint: "Opens the message";
|
|
113
|
+
readonly postClose: "Close";
|
|
114
|
+
readonly postMinimize: "Minimize";
|
|
115
|
+
readonly postReplyPlaceholder: "Write a reply…";
|
|
116
|
+
readonly postSend: "Send";
|
|
117
|
+
readonly postSent: "Sent";
|
|
118
|
+
readonly postReplyFailed: "Couldn't send your reply. Try again.";
|
|
119
|
+
readonly postReactions: "Reactions";
|
|
120
|
+
readonly postThanks: "Thanks for your feedback!";
|
|
121
|
+
readonly postConversation: "Your conversation";
|
|
122
|
+
readonly postContinueChat: "Continue in Messenger";
|
|
102
123
|
readonly blockService: "Service";
|
|
103
124
|
readonly blockProduct: "Product";
|
|
104
125
|
readonly blockChooseTime: "Choose a time";
|
|
105
126
|
readonly blockProfessional: "Professional";
|
|
106
127
|
readonly blockPriceOffer: "Price offer";
|
|
128
|
+
readonly blockSubtotal: "Subtotal";
|
|
129
|
+
readonly blockDiscount: "Discount";
|
|
130
|
+
readonly blockTax: "Tax";
|
|
131
|
+
readonly blockShipping: "Shipping";
|
|
132
|
+
readonly blockTotal: "Total";
|
|
133
|
+
readonly blockMinutes: "{count} min";
|
|
134
|
+
readonly blockSave: "Save";
|
|
135
|
+
readonly blockAnyAvailable: "Any available";
|
|
136
|
+
readonly blockWithProvider: "With {name}";
|
|
137
|
+
readonly blockBookTime: "Book this time";
|
|
138
|
+
readonly blockValidUntil: "Valid until {date}";
|
|
139
|
+
readonly launcherOpen: "Open chat";
|
|
140
|
+
readonly launcherClose: "Close chat";
|
|
107
141
|
};
|
|
108
142
|
export type LabelKey = keyof typeof DEFAULT_LABELS;
|
|
109
143
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../src/i18n.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;AAEnE;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,CAYxF;
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../src/i18n.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;AAEnE;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,CAYxF;AAeD,iFAAiF;AACjF,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI,CAQpG;AAED,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0IjB,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,cAAc,CAAC;AAEnD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG,MAAM,CAI7F;AAED,wBAAgB,WAAW,CAAC,SAAS,EAAE,UAAU,GAAG,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAM3E"}
|
|
@@ -13,7 +13,7 @@ export { RepzoWidgetEvents } from './events';
|
|
|
13
13
|
export { RepzoWidgetError } from './api/client';
|
|
14
14
|
export { DEFAULT_BASE_URL } from './types';
|
|
15
15
|
export { useWidgetState } from './state/use-widget-state';
|
|
16
|
-
export type { AgentUiAction, AgentUiBlock, AttachmentSource, BootOptions, Conversation, InAppNotification, Message, OutboundMessage, PreChatField, RepzoPickedFile, RepzoWidgetAttachmentOptions, RepzoWidgetErrorCode, RepzoWidgetStorageAdapter, WidgetAttachment, WidgetConfig, WidgetCustomAttributes, WidgetSpace, WidgetSpaceType, WidgetState, WidgetUser, WidgetUserAccount, WidgetView, } from './types';
|
|
16
|
+
export type { AgentUiAction, AgentUiBlock, AttachmentSource, BootOptions, Conversation, InAppNotification, Message, OutboundMessage, PostInteractionKind, PostReply, PostThreadMessage, PreChatField, RepzoPickedFile, RepzoWidgetAttachmentOptions, RepzoWidgetErrorCode, RepzoWidgetStorageAdapter, WidgetAttachment, WidgetConfig, WidgetCustomAttributes, WidgetPost, WidgetSpace, WidgetSpaceType, WidgetState, WidgetUser, WidgetUserAccount, WidgetView, } from './types';
|
|
17
17
|
export type { EventSubscription, MessageDidArrivePayload, RepzoWidgetEvent, RepzoWidgetEventPayloads, } from './events';
|
|
18
18
|
export type { WidgetTheme } from './ui/styles/theme';
|
|
19
19
|
/** Spaces the widget can open into — the analogue of Intercom's `Space`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5F,OAAO,KAAK,EACV,WAAW,EACX,yBAAyB,EACzB,sBAAsB,EACtB,eAAe,EACf,UAAU,EACX,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,QAAQ,IAAI,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,YAAY,EACV,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,OAAO,EACP,eAAe,EACf,YAAY,EACZ,eAAe,EACf,4BAA4B,EAC5B,oBAAoB,EACpB,yBAAyB,EACzB,gBAAgB,EAChB,YAAY,EACZ,sBAAsB,EACtB,WAAW,EACX,eAAe,EACf,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4ClB,CAAC;AAEF,eAAe,WAAW,CAAC;AAC3B,OAAO,EAAE,iBAAiB,IAAI,MAAM,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../../src/locales.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAE7C,KAAK,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,OAAO,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../../src/locales.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAE7C,KAAK,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,OAAO,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC;AAgIrE,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAU,CAAC;AAErE,gEAAgE;AAChE,wBAAgB,YAAY,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAE3D"}
|
|
@@ -36,6 +36,7 @@ interface ManualToken {
|
|
|
36
36
|
export declare class PushManager {
|
|
37
37
|
private client;
|
|
38
38
|
private openConversation;
|
|
39
|
+
private openPost;
|
|
39
40
|
private options;
|
|
40
41
|
private listenersWired;
|
|
41
42
|
private lastToken;
|
|
@@ -45,7 +46,7 @@ export declare class PushManager {
|
|
|
45
46
|
private active;
|
|
46
47
|
/** Registrations still on the wire; unregister() waits for them. */
|
|
47
48
|
private inflight;
|
|
48
|
-
constructor(client: WidgetApiClient, openConversation: (conversationId: string) => void);
|
|
49
|
+
constructor(client: WidgetApiClient, openConversation: (conversationId: string) => void, openPost?: (campaignId: string) => void);
|
|
49
50
|
/** Remember the boot options; actual work happens in start() post-init. */
|
|
50
51
|
configure(options?: WidgetPushOptions): void;
|
|
51
52
|
/**
|
|
@@ -64,7 +65,10 @@ export declare class PushManager {
|
|
|
64
65
|
unregister(authToken: string | null): Promise<void>;
|
|
65
66
|
private register;
|
|
66
67
|
private wireTapHandlers;
|
|
67
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* Only widget pushes are ours — host app notifications pass through. A team
|
|
70
|
+
* reply opens its conversation; a Send post opens the post.
|
|
71
|
+
*/
|
|
68
72
|
private handleTap;
|
|
69
73
|
}
|
|
70
74
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push-notifications.d.ts","sourceRoot":"","sources":["../../../../src/push/push-notifications.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,MAAM,WAAW,iBAAiB;IAChC,+EAA+E;IAC/E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,WAAW;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;
|
|
1
|
+
{"version":3,"file":"push-notifications.d.ts","sourceRoot":"","sources":["../../../../src/push/push-notifications.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,MAAM,WAAW,iBAAiB;IAChC,+EAA+E;IAC/E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,WAAW;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAsDD,qBAAa,WAAW;IAkBpB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,gBAAgB;IACxB,OAAO,CAAC,QAAQ;IAnBlB,OAAO,CAAC,OAAO,CAAyB;IAExC,OAAO,CAAC,cAAc,CAAS;IAE/B,OAAO,CAAC,SAAS,CAAuB;IAExC,OAAO,CAAC,WAAW,CAA4B;IAE/C,OAAO,CAAC,mBAAmB,CAAS;IAEpC,2EAA2E;IAC3E,OAAO,CAAC,MAAM,CAAS;IAEvB,oEAAoE;IACpE,OAAO,CAAC,QAAQ,CAA4B;gBAGlC,MAAM,EAAE,eAAe,EACvB,gBAAgB,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,IAAI,EAClD,QAAQ,GAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAe;IAG3D,2EAA2E;IAC3E,SAAS,CAAC,OAAO,CAAC,EAAE,iBAAiB;IAIrC;;;;OAIG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAwD5B,gEAAgE;IAC1D,cAAc,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAMxD;;;;OAIG;IACG,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAazD,OAAO,CAAC,QAAQ;IAuBhB,OAAO,CAAC,eAAe;IAevB;;;OAGG;IACH,OAAO,CAAC,SAAS;CAOlB"}
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
import { WidgetApiClient } from '../api/client';
|
|
11
11
|
import { EventEmitter } from '../events';
|
|
12
12
|
import { PushManager } from '../push/push-notifications';
|
|
13
|
-
import type { AgentUiAction, BootOptions, ConversationRatingResult, OutgoingAttachment, WidgetCustomAttributes, WidgetSpaceType, WidgetState, WidgetUser, WidgetView } from '../types';
|
|
13
|
+
import type { AgentUiAction, BootOptions, ConversationRatingResult, OutgoingAttachment, PostInteractionKind, PostReply, WidgetCustomAttributes, WidgetSpaceType, WidgetState, WidgetUser, WidgetView } from '../types';
|
|
14
|
+
/** How long a post stays up after a reaction, thanking them, before it goes. */
|
|
15
|
+
export declare const POST_THANKS_MS = 1600;
|
|
14
16
|
export declare class WidgetStore {
|
|
15
17
|
readonly client: WidgetApiClient;
|
|
16
18
|
readonly events: EventEmitter;
|
|
@@ -23,6 +25,25 @@ export declare class WidgetStore {
|
|
|
23
25
|
private bootConfig;
|
|
24
26
|
/** `boot({ inAppNotifications })` — the card over the app for new replies. */
|
|
25
27
|
private inAppNotificationsEnabled;
|
|
28
|
+
/** `boot({ posts })` — Send posts over the app. */
|
|
29
|
+
private postsEnabled;
|
|
30
|
+
/** Posts whose view was reported this session (the server also dedupes per day). */
|
|
31
|
+
private viewedPostIds;
|
|
32
|
+
/** Bumped per post load, so an older answer never lands over a newer one. */
|
|
33
|
+
private postRequest;
|
|
34
|
+
/** Bumped when a live answer or a saved reply joins the post, so a load sent before it is retried, not shown. */
|
|
35
|
+
private postRevision;
|
|
36
|
+
/** Conversations whose unread replies include one the post can't show (attachments only): opening the post leaves them unread. */
|
|
37
|
+
private postUnshownReplies;
|
|
38
|
+
private postRecheckTimer;
|
|
39
|
+
/** A post push tapped before the session was ready: open it once it is. */
|
|
40
|
+
private pendingPostId;
|
|
41
|
+
/** Posts closed with × whose report failed (offline, say): kept down, and the close re-sent when they come back. */
|
|
42
|
+
private unsentDismissIds;
|
|
43
|
+
/** Bumped when the visitor's posts are reset (logout, wipe, posts off): older post callbacks stand down. */
|
|
44
|
+
private postSession;
|
|
45
|
+
/** A reaction's "thanks" moment: when it ends, the post goes. */
|
|
46
|
+
private postThanksTimer;
|
|
26
47
|
/** The launch card (see showUnreadOnLaunch) is offered once per visitor session. */
|
|
27
48
|
private launchCardOffered;
|
|
28
49
|
private bootPromise;
|
|
@@ -188,18 +209,18 @@ export declare class WidgetStore {
|
|
|
188
209
|
private loadUnread;
|
|
189
210
|
private clearUnreadFor;
|
|
190
211
|
private isReplayedMessage;
|
|
191
|
-
/**
|
|
192
|
-
* A teammate deleted a message: the visitor sees "This message was deleted"
|
|
193
|
-
* in its place (they can't delete anything themselves), and the list is
|
|
194
|
-
* refreshed so its preview stops showing the text. The id stays in
|
|
195
|
-
* `seenMessageIds`, so a replayed `message.new` can't restore the content.
|
|
196
|
-
*/
|
|
197
212
|
/**
|
|
198
213
|
* A teammate opened the conversation: the visitor's messages are now Seen.
|
|
199
214
|
* The ids are also remembered, because the event can arrive before the send
|
|
200
215
|
* response swaps a pending bubble's temporary id for the server id.
|
|
201
216
|
*/
|
|
202
217
|
private handleMessageStatus;
|
|
218
|
+
/**
|
|
219
|
+
* A teammate deleted a message: the visitor sees "This message was deleted"
|
|
220
|
+
* in its place (they can't delete anything themselves), and the list is
|
|
221
|
+
* refreshed so its preview stops showing the text. The id stays in
|
|
222
|
+
* `seenMessageIds`, so a replayed `message.new` can't restore the content.
|
|
223
|
+
*/
|
|
203
224
|
private handleDeletedMessage;
|
|
204
225
|
private handleNewMessage;
|
|
205
226
|
/** Trailing debounce: one read call per burst of live replies. */
|
|
@@ -249,8 +270,14 @@ export declare class WidgetStore {
|
|
|
249
270
|
private refreshOpenThread;
|
|
250
271
|
/** A history page (newest-first) as the oldest-first list the UI renders. */
|
|
251
272
|
private hydrateMessages;
|
|
252
|
-
/**
|
|
273
|
+
/**
|
|
274
|
+
* Media URLs inside metadata (the "joined" line's avatar, product photos in
|
|
275
|
+
* agent blocks) can be server-relative paths, and are remote content: like
|
|
276
|
+
* every other media URL they resolve against `baseUrl`, and anything that
|
|
277
|
+
* isn't http(s) is dropped before it reaches an `<Image>`.
|
|
278
|
+
*/
|
|
253
279
|
private hydrateMetadata;
|
|
280
|
+
private hydrateBlockMedia;
|
|
254
281
|
/**
|
|
255
282
|
* Rejects when the message wasn't sent, so the composer can keep
|
|
256
283
|
* attachments for a retry. A text-only bubble is marked failed; one with
|
|
@@ -277,6 +304,68 @@ export declare class WidgetStore {
|
|
|
277
304
|
notifyTyping(isTyping: boolean): void;
|
|
278
305
|
track(event: string, metadata?: Record<string, unknown>): void;
|
|
279
306
|
private loadOutboundMessage;
|
|
307
|
+
/** Ask the server for the post this visitor should see now. */
|
|
308
|
+
loadPost(): void;
|
|
309
|
+
/**
|
|
310
|
+
* Coerces the server's post into the shape the view relies on: missing
|
|
311
|
+
* strings become empty, unknown enum values fall back to the plainest
|
|
312
|
+
* option, and malformed reactions or replies are dropped.
|
|
313
|
+
*/
|
|
314
|
+
private hydratePost;
|
|
315
|
+
/**
|
|
316
|
+
* Puts a post on screen (or takes it down). A different post starts open or
|
|
317
|
+
* as its card per `expand`; the same one keeps what the visitor left it as,
|
|
318
|
+
* so a full post put back to its card doesn't pop open on every foreground.
|
|
319
|
+
*/
|
|
320
|
+
private showPost;
|
|
321
|
+
/** The post's card or full view is on screen. Reported once each time it's shown. */
|
|
322
|
+
postDidShow(campaignId: string): void;
|
|
323
|
+
/** The visitor tapped the post's card: open it in full. */
|
|
324
|
+
expandPost(campaignId: string): void;
|
|
325
|
+
/**
|
|
326
|
+
* The post is open in front of them (and the messenger isn't): the team's
|
|
327
|
+
* answers under it are read, here and on the server. Not when one of them
|
|
328
|
+
* is something the post can't show, or the post has fewer answers since
|
|
329
|
+
* their last reply than are unread (an attachment from before this launch,
|
|
330
|
+
* say): those wait for the messenger.
|
|
331
|
+
*/
|
|
332
|
+
private readPostConversation;
|
|
333
|
+
/** Back to its pill or card for now, without telling the server (see PostOverlay's onCollapse). */
|
|
334
|
+
collapsePost(campaignId: string): void;
|
|
335
|
+
/**
|
|
336
|
+
* "Not now" — the ⌄ button, a swipe down, or Android's back: the post goes
|
|
337
|
+
* back to its badge (or snippet card) and stays there, on later launches
|
|
338
|
+
* too, instead of opening by itself again. Unlike ×, it can be opened again.
|
|
339
|
+
*/
|
|
340
|
+
minimizePost(campaignId: string): void;
|
|
341
|
+
private reportPostOpen;
|
|
342
|
+
/**
|
|
343
|
+
* The visitor tapped a link, reacted, replied to or closed the post. Closing
|
|
344
|
+
* takes it down at once and loads the next one; a reaction shows as picked
|
|
345
|
+
* right away. A reply resolves with what was saved (shown under the post)
|
|
346
|
+
* and rejects when it wasn't, so the reply box can keep the text.
|
|
347
|
+
*/
|
|
348
|
+
recordPostInteraction(campaignId: string, kind: Exclude<PostInteractionKind, 'view' | 'open' | 'minimize'>, value?: string): Promise<PostReply | undefined>;
|
|
349
|
+
private startPostThanks;
|
|
350
|
+
private clearPostThanks;
|
|
351
|
+
private resendPostDismiss;
|
|
352
|
+
/**
|
|
353
|
+
* A post push was tapped: show that post, open in full, as soon as the
|
|
354
|
+
* session is ready. The messenger steps aside for it, the way a reply push
|
|
355
|
+
* opens its conversation.
|
|
356
|
+
*/
|
|
357
|
+
private openPostFromPush;
|
|
358
|
+
private clearPostRecheck;
|
|
359
|
+
/** The server knows when the shown post stops; ask again then, so it leaves on time. */
|
|
360
|
+
private schedulePostRecheck;
|
|
361
|
+
/**
|
|
362
|
+
* Post callbacks check this, not the identity epoch: a same-user login or
|
|
363
|
+
* an anonymous re-login bumps the epoch but keeps the session (and the post),
|
|
364
|
+
* and would otherwise drop the post's load and strand its timers.
|
|
365
|
+
*/
|
|
366
|
+
private postStale;
|
|
367
|
+
/** The visitor changed or posts were turned off: drop it and any pending load. */
|
|
368
|
+
private resetPost;
|
|
280
369
|
destroy(): void;
|
|
281
370
|
}
|
|
282
371
|
//# sourceMappingURL=widget-store.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget-store.d.ts","sourceRoot":"","sources":["../../../../src/state/widget-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAAyC,eAAe,EAAE,MAAM,eAAe,CAAC;AAGvF,OAAO,EAAE,YAAY,EAAqB,MAAM,WAAW,CAAC;AAC5D,OA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;AACH,eAAO,MAAM,UAAU,2BAA2B,CAAC;AACnD,eAAO,MAAM,iBAAiB,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../src/storage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAEzD,eAAO,MAAM,SAAS,uBAAuB,CAAC;AAC9C,sFAAsF;AACtF,eAAO,MAAM,QAAQ,0BAA0B,CAAC;AAChD,eAAO,MAAM,aAAa,2BAA2B,CAAC;AACtD,eAAO,MAAM,UAAU,wBAAwB,CAAC;AAChD,4EAA4E;AAC5E;;;;GAIG;AACH,eAAO,MAAM,UAAU,2BAA2B,CAAC;AACnD,eAAO,MAAM,iBAAiB,wBAAwB,CAAC;AAwCvD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,yBAAyB,GAAG,IAAI,GAAG,IAAI,CAEjF;AAED,eAAO,MAAM,OAAO;iBACC,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;iBAS/B,MAAM,SAAS,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;oBAQlC,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAO7C,CAAC;AAMF,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,yBAAyB,GAAG,IAAI,GAAG,IAAI,CAEvF;AAiBD,eAAO,MAAM,aAAa;iBACL,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;iBAkB/B,MAAM,SAAS,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBxD,0EAA0E;oBACpD,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAU7C,CAAC"}
|
|
@@ -153,11 +153,17 @@ export interface WidgetUser {
|
|
|
153
153
|
/**
|
|
154
154
|
* The user's account (company) in your app. Matched by `id`, so a renamed
|
|
155
155
|
* account updates the same CRM account instead of creating another.
|
|
156
|
+
* @since 1.0.8
|
|
156
157
|
*/
|
|
157
158
|
account?: WidgetUserAccount;
|
|
158
|
-
/**
|
|
159
|
+
/**
|
|
160
|
+
* When they signed up in your app — a Date, unix seconds/ms, or an ISO
|
|
161
|
+
* string. Shown as "Signed up" in the inbox.
|
|
162
|
+
* @since 1.0.9
|
|
163
|
+
*/
|
|
159
164
|
signedUpAt?: Date | number | string;
|
|
160
165
|
}
|
|
166
|
+
/** The user's account (company) in your app, sent as `WidgetUser.account`. @since 1.0.8 */
|
|
161
167
|
export interface WidgetUserAccount {
|
|
162
168
|
/** Your app's stable account id — required. */
|
|
163
169
|
id: string;
|
|
@@ -224,6 +230,13 @@ export interface BootOptions {
|
|
|
224
230
|
* `<RepzoWidgetProvider>` to be mounted.
|
|
225
231
|
*/
|
|
226
232
|
inAppNotifications?: boolean;
|
|
233
|
+
/**
|
|
234
|
+
* Show Send posts from Workstation (Send → Post, "Show on: Mobile") over the
|
|
235
|
+
* app (default true): a card that opens into the full post, with replies or
|
|
236
|
+
* reactions. Requires `<RepzoWidgetProvider>`.
|
|
237
|
+
* @since 1.2.0
|
|
238
|
+
*/
|
|
239
|
+
posts?: boolean;
|
|
227
240
|
}
|
|
228
241
|
/** An option in the composer's attach menu. */
|
|
229
242
|
export type AttachmentSource = 'photo' | 'camera' | 'file';
|
|
@@ -429,13 +442,6 @@ export interface RepzoWidgetStorageAdapter {
|
|
|
429
442
|
setItem(key: string, value: string): Promise<void> | void;
|
|
430
443
|
removeItem(key: string): Promise<void> | void;
|
|
431
444
|
}
|
|
432
|
-
/**
|
|
433
|
-
* `RepzoWidgetError.code`. The last two come from the server's 403 body and
|
|
434
|
-
* are terminal — the SDK stops realtime and does not retry on its own:
|
|
435
|
-
* - `messenger_api_disabled` — the channel's Messenger API is switched off.
|
|
436
|
-
* - `identity_verification_failed` — `userHash` missing/wrong while the
|
|
437
|
-
* channel enforces identity verification.
|
|
438
|
-
*/
|
|
439
445
|
/** A bad-rating reason on the rating card, labelled per language. */
|
|
440
446
|
export interface RatingReason {
|
|
441
447
|
id: string;
|
|
@@ -453,6 +459,13 @@ export interface ConversationRatingResult {
|
|
|
453
459
|
/** A comment was left: the rating can't change any more. */
|
|
454
460
|
locked: boolean;
|
|
455
461
|
}
|
|
462
|
+
/**
|
|
463
|
+
* `RepzoWidgetError.code`. The last two come from the server's 403 body and
|
|
464
|
+
* are terminal — the SDK stops realtime and does not retry on its own:
|
|
465
|
+
* - `messenger_api_disabled` — the channel's Messenger API is switched off.
|
|
466
|
+
* - `identity_verification_failed` — `userHash` missing/wrong while the
|
|
467
|
+
* channel enforces identity verification.
|
|
468
|
+
*/
|
|
456
469
|
export type RepzoWidgetErrorCode = 'network' | 'http' | 'messenger_api_disabled' | 'identity_verification_failed';
|
|
457
470
|
export type WidgetView = 'bubble' | 'home' | 'prechat' | 'chat' | 'conversations';
|
|
458
471
|
export interface WidgetState {
|
|
@@ -498,6 +511,18 @@ export interface WidgetState {
|
|
|
498
511
|
* app. Only set while the messenger is closed and its thread is unread.
|
|
499
512
|
*/
|
|
500
513
|
inAppNotification: InAppNotification | null;
|
|
514
|
+
/**
|
|
515
|
+
* The Send post this visitor should see now (Send → Post shown on Mobile),
|
|
516
|
+
* drawn over the app. One at a time: the next one loads once this one is
|
|
517
|
+
* closed. Always `null` with `boot({ posts: false })`.
|
|
518
|
+
* @since 1.2.0
|
|
519
|
+
*/
|
|
520
|
+
post: WidgetPost | null;
|
|
521
|
+
/**
|
|
522
|
+
* The post is open in full (tapped from its card, or sent as a full post).
|
|
523
|
+
* @since 1.2.0
|
|
524
|
+
*/
|
|
525
|
+
postExpanded: boolean;
|
|
501
526
|
}
|
|
502
527
|
export interface InAppNotification {
|
|
503
528
|
conversationId: string;
|
|
@@ -508,4 +533,62 @@ export interface InAppNotification {
|
|
|
508
533
|
preview: string;
|
|
509
534
|
hasAttachments: boolean;
|
|
510
535
|
}
|
|
536
|
+
/** What a visitor did with a post: saw it, opened it, tapped a link, reacted, replied, minimized or closed it. @since 1.2.0 */
|
|
537
|
+
export type PostInteractionKind = 'view' | 'open' | 'click' | 'reaction' | 'reply' | 'minimize' | 'dismiss';
|
|
538
|
+
/** Something the visitor already replied to a post (shown under it). @since 1.2.0 */
|
|
539
|
+
export interface PostReply {
|
|
540
|
+
text: string;
|
|
541
|
+
/** ISO time. */
|
|
542
|
+
at: string;
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* A Send post as Workstation sends it for this visitor: already personalized
|
|
546
|
+
* and sanitized down to paragraphs, bold/italic/code, links, lists, code
|
|
547
|
+
* blocks, a button (`div[data-post-button]`) and social links
|
|
548
|
+
* (`div[data-post-social]`). Fields the SDK doesn't recognize fall back to the
|
|
549
|
+
* plainest option.
|
|
550
|
+
* @since 1.2.0
|
|
551
|
+
*/
|
|
552
|
+
export interface WidgetPost {
|
|
553
|
+
/** The Send campaign id. */
|
|
554
|
+
id: string;
|
|
555
|
+
bodyHtml: string;
|
|
556
|
+
/** First words of the post, for its card. */
|
|
557
|
+
snippet: string;
|
|
558
|
+
sender: {
|
|
559
|
+
name: string;
|
|
560
|
+
initials: string;
|
|
561
|
+
avatarUrl: string | null;
|
|
562
|
+
} | null;
|
|
563
|
+
workspaceName: string;
|
|
564
|
+
/** `small` opens as a sheet, `large` as a full screen. */
|
|
565
|
+
format: 'small' | 'large';
|
|
566
|
+
replyType: 'text' | 'reaction' | 'none';
|
|
567
|
+
reactions: string[];
|
|
568
|
+
/** `badge`: a small pill; `snippet`: a card with the first words; `full`: opens right away. */
|
|
569
|
+
sentAs: 'badge' | 'snippet' | 'full';
|
|
570
|
+
/** The reaction this visitor already picked. */
|
|
571
|
+
reacted: string | null;
|
|
572
|
+
/** What they already replied, oldest first. */
|
|
573
|
+
replies: PostReply[];
|
|
574
|
+
/** They minimized it ("not now"): it waits as its badge or card instead of opening by itself. */
|
|
575
|
+
minimized: boolean;
|
|
576
|
+
/**
|
|
577
|
+
* The post's conversation with them, oldest first: their replies and the
|
|
578
|
+
* team's answers from the inbox. Older Workstation versions send only
|
|
579
|
+
* `replies`, which then fill it.
|
|
580
|
+
*/
|
|
581
|
+
thread: PostThreadMessage[];
|
|
582
|
+
/** That conversation, to continue it in the messenger (null before their first reply). */
|
|
583
|
+
conversationId: string | null;
|
|
584
|
+
}
|
|
585
|
+
/** One message under a post: theirs, or a teammate's answer. @since 1.2.0 */
|
|
586
|
+
export interface PostThreadMessage {
|
|
587
|
+
from: 'person' | 'team';
|
|
588
|
+
text: string;
|
|
589
|
+
/** The teammate's name on team answers. */
|
|
590
|
+
senderName: string | null;
|
|
591
|
+
/** ISO time. */
|
|
592
|
+
at: string;
|
|
593
|
+
}
|
|
511
594
|
//# sourceMappingURL=types.d.ts.map
|