@spscommerce/max 0.7.0 → 0.9.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/eslint.config.mjs +31 -0
- package/lib/MaxPanel.d.ts +4 -0
- package/lib/components/AgentTextarea.d.ts +2 -1
- package/lib/hooks/useMaxChat.d.ts +4 -1
- package/lib/index.js +6393 -6372
- package/lib/index.umd.cjs +547 -547
- package/lib/models/Conversation.d.ts +1 -0
- package/lib/style.css +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import js from "@eslint/js";
|
|
2
|
+
import { FlatCompat } from "@eslint/eslintrc";
|
|
3
|
+
import { fileURLToPath } from "url";
|
|
4
|
+
import { dirname } from "path";
|
|
5
|
+
|
|
6
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = dirname(__filename);
|
|
8
|
+
|
|
9
|
+
const compat = new FlatCompat({
|
|
10
|
+
baseDirectory: __dirname,
|
|
11
|
+
recommendedConfig: js.configs.recommended,
|
|
12
|
+
allConfig: js.configs.all,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export default [
|
|
16
|
+
{
|
|
17
|
+
ignores: ["**/build/**", "**/lib/**"],
|
|
18
|
+
},
|
|
19
|
+
...compat.extends("@spscommerce/eslint-config-typescript"),
|
|
20
|
+
{
|
|
21
|
+
languageOptions: {
|
|
22
|
+
globals: {
|
|
23
|
+
JSX: true,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
rules: {
|
|
27
|
+
"@typescript-eslint/explicit-function-return-type": ["off"],
|
|
28
|
+
"@typescript-eslint/array-element-newline": [0],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
];
|
package/lib/MaxPanel.d.ts
CHANGED
|
@@ -8,6 +8,10 @@ export declare function MaxPanel({ token, currentUser, hideAgentPanel, isAgentPa
|
|
|
8
8
|
currentUser: CurrentUser | undefined;
|
|
9
9
|
hideAgentPanel: () => void;
|
|
10
10
|
isAgentPanelOpen: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Whether the host app's signed-in user is viewing the panel while acting
|
|
13
|
+
* on behalf of a customer.
|
|
14
|
+
*/
|
|
11
15
|
isInCustomerView: boolean;
|
|
12
16
|
flags: FeatureFlagsTitles;
|
|
13
17
|
env: string;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
export declare function AgentTextarea({ onSendMessage, setMessage, message, isMessageLoading, conversationFrozen, }: {
|
|
2
|
+
export declare function AgentTextarea({ onSendMessage, setMessage, message, isMessageLoading, isReadOnly, conversationFrozen, }: {
|
|
3
3
|
onSendMessage: (message: string, appInitiated: boolean, currentAppName?: string | undefined) => Promise<void>;
|
|
4
4
|
setMessage: (message: string) => void;
|
|
5
5
|
message: string;
|
|
6
6
|
isMessageLoading: boolean;
|
|
7
|
+
isReadOnly?: boolean;
|
|
7
8
|
conversationFrozen?: boolean;
|
|
8
9
|
}): React.JSX.Element;
|
|
@@ -2,7 +2,10 @@ import { Chat } from "../models/Chat";
|
|
|
2
2
|
import { Conversation, Message } from "../models/Conversation";
|
|
3
3
|
import { AgentApiService } from "../api-service";
|
|
4
4
|
import type { AdditionalContextProvider } from "../models/AdditionalContext";
|
|
5
|
-
export
|
|
5
|
+
export interface UseMaxChatOptions {
|
|
6
|
+
onConversationIdAssignedByStream?: (conversationId: string) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function useMaxChat(agentApi: AgentApiService, context: AdditionalContextProvider, options?: UseMaxChatOptions): {
|
|
6
9
|
error: boolean;
|
|
7
10
|
conversationFrozen: boolean;
|
|
8
11
|
loading: boolean;
|