@mailoo/chat 0.0.0-stage → 1.32.2
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/LICENSE +16 -0
- package/README.md +150 -2
- package/dist/chat-message-Dw6tKBEb.d.cts +10 -0
- package/dist/chat-message-Dw6tKBEb.d.ts +10 -0
- package/dist/chunk-2Y37RYEL.js +141 -0
- package/dist/chunk-2Y37RYEL.js.map +1 -0
- package/dist/chunk-4TNHJERE.js +19 -0
- package/dist/chunk-4TNHJERE.js.map +1 -0
- package/dist/chunk-77E6HUHY.js +41 -0
- package/dist/chunk-77E6HUHY.js.map +1 -0
- package/dist/chunk-AU6EFFLV.js +431 -0
- package/dist/chunk-AU6EFFLV.js.map +1 -0
- package/dist/chunk-QZ7HWQDO.js +839 -0
- package/dist/chunk-QZ7HWQDO.js.map +1 -0
- package/dist/client/index.cjs +1658 -0
- package/dist/client/index.cjs.map +1 -0
- package/dist/client/index.d.cts +33 -0
- package/dist/client/index.d.ts +33 -0
- package/dist/client/index.js +597 -0
- package/dist/client/index.js.map +1 -0
- package/dist/hooks/index.cjs +751 -0
- package/dist/hooks/index.cjs.map +1 -0
- package/dist/hooks/index.d.cts +79 -0
- package/dist/hooks/index.d.ts +79 -0
- package/dist/hooks/index.js +32 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/index.cjs +213 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +53 -0
- package/dist/index.d.ts +53 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/mailoo-site-chat-widget-C7B797Lu.d.ts +130 -0
- package/dist/mailoo-site-chat-widget-h_cBqsJw.d.cts +130 -0
- package/dist/routes/index.cjs +204 -0
- package/dist/routes/index.cjs.map +1 -0
- package/dist/routes/index.d.cts +30 -0
- package/dist/routes/index.d.ts +30 -0
- package/dist/routes/index.js +174 -0
- package/dist/routes/index.js.map +1 -0
- package/dist/shared-glVmghqk.d.cts +40 -0
- package/dist/shared-glVmghqk.d.ts +40 -0
- package/dist/styles/widget.css +122 -0
- package/dist/welcome-presets/index.cjs +479 -0
- package/dist/welcome-presets/index.cjs.map +1 -0
- package/dist/welcome-presets/index.d.cts +53 -0
- package/dist/welcome-presets/index.d.ts +53 -0
- package/dist/welcome-presets/index.js +38 -0
- package/dist/welcome-presets/index.js.map +1 -0
- package/dist/welcome-presets/parse.cjs +44 -0
- package/dist/welcome-presets/parse.cjs.map +1 -0
- package/dist/welcome-presets/parse.d.cts +11 -0
- package/dist/welcome-presets/parse.d.ts +11 -0
- package/dist/welcome-presets/parse.js +9 -0
- package/dist/welcome-presets/parse.js.map +1 -0
- package/dist/widget-config-B5Tf7gqn.d.cts +32 -0
- package/dist/widget-config-B5Tf7gqn.d.ts +32 -0
- package/package.json +85 -3
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
AssistantWelcomePreset,
|
|
4
|
+
GuestContactFields,
|
|
5
|
+
MAILOO_CHAT_WELCOME_PRESET_OPTIONS,
|
|
6
|
+
MailooChatWelcomePresetProvider,
|
|
7
|
+
MailooChatWelcomePresetSwitcher,
|
|
8
|
+
PrivacyFooter,
|
|
9
|
+
TeamWelcomePreset,
|
|
10
|
+
createMailooChatWelcomePresetRenderer,
|
|
11
|
+
mailooChatWelcomePresetPanelClassName,
|
|
12
|
+
operatorInitials,
|
|
13
|
+
renderMailooChatWelcomePreset,
|
|
14
|
+
useMailooChatWelcomePreset,
|
|
15
|
+
useOptionalMailooChatWelcomePreset
|
|
16
|
+
} from "../chunk-AU6EFFLV.js";
|
|
17
|
+
import {
|
|
18
|
+
normalizeLegacyWelcomePresetId,
|
|
19
|
+
parseMailooChatWelcomePreset
|
|
20
|
+
} from "../chunk-4TNHJERE.js";
|
|
21
|
+
export {
|
|
22
|
+
AssistantWelcomePreset,
|
|
23
|
+
GuestContactFields,
|
|
24
|
+
MAILOO_CHAT_WELCOME_PRESET_OPTIONS,
|
|
25
|
+
MailooChatWelcomePresetProvider,
|
|
26
|
+
MailooChatWelcomePresetSwitcher,
|
|
27
|
+
PrivacyFooter,
|
|
28
|
+
TeamWelcomePreset,
|
|
29
|
+
createMailooChatWelcomePresetRenderer,
|
|
30
|
+
mailooChatWelcomePresetPanelClassName,
|
|
31
|
+
normalizeLegacyWelcomePresetId,
|
|
32
|
+
operatorInitials,
|
|
33
|
+
parseMailooChatWelcomePreset,
|
|
34
|
+
renderMailooChatWelcomePreset,
|
|
35
|
+
useMailooChatWelcomePreset,
|
|
36
|
+
useOptionalMailooChatWelcomePreset
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/welcome-presets/types.ts
|
|
21
|
+
var types_exports = {};
|
|
22
|
+
__export(types_exports, {
|
|
23
|
+
normalizeLegacyWelcomePresetId: () => normalizeLegacyWelcomePresetId,
|
|
24
|
+
parseMailooChatWelcomePreset: () => parseMailooChatWelcomePreset
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(types_exports);
|
|
27
|
+
function parseMailooChatWelcomePreset(value) {
|
|
28
|
+
const trimmed = value?.trim();
|
|
29
|
+
if (trimmed === "builtin" || trimmed === "team" || trimmed === "assistant") {
|
|
30
|
+
return trimmed;
|
|
31
|
+
}
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
function normalizeLegacyWelcomePresetId(value) {
|
|
35
|
+
if (value === "delinea") return "team";
|
|
36
|
+
if (value === "mia") return "assistant";
|
|
37
|
+
return parseMailooChatWelcomePreset(value);
|
|
38
|
+
}
|
|
39
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
+
0 && (module.exports = {
|
|
41
|
+
normalizeLegacyWelcomePresetId,
|
|
42
|
+
parseMailooChatWelcomePreset
|
|
43
|
+
});
|
|
44
|
+
//# sourceMappingURL=parse.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/welcome-presets/types.ts"],"sourcesContent":["export type MailooChatWelcomePresetId = 'builtin' | 'team' | 'assistant'\n\nexport type MailooChatWelcomePresetOption = {\n id: MailooChatWelcomePresetId\n label: string\n description: string\n}\n\nexport function parseMailooChatWelcomePreset(\n value: string | undefined | null\n): MailooChatWelcomePresetId | null {\n const trimmed = value?.trim()\n if (trimmed === 'builtin' || trimmed === 'team' || trimmed === 'assistant') {\n return trimmed\n }\n return null\n}\n\n/** Maps legacy preset ids from earlier builds (localStorage only). */\nexport function normalizeLegacyWelcomePresetId(\n value: string\n): MailooChatWelcomePresetId | null {\n if (value === 'delinea') return 'team'\n if (value === 'mia') return 'assistant'\n return parseMailooChatWelcomePreset(value)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQO,SAAS,6BACd,OACkC;AAClC,QAAM,UAAU,OAAO,KAAK;AAC5B,MAAI,YAAY,aAAa,YAAY,UAAU,YAAY,aAAa;AAC1E,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAGO,SAAS,+BACd,OACkC;AAClC,MAAI,UAAU,UAAW,QAAO;AAChC,MAAI,UAAU,MAAO,QAAO;AAC5B,SAAO,6BAA6B,KAAK;AAC3C;","names":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type MailooChatWelcomePresetId = 'builtin' | 'team' | 'assistant';
|
|
2
|
+
type MailooChatWelcomePresetOption = {
|
|
3
|
+
id: MailooChatWelcomePresetId;
|
|
4
|
+
label: string;
|
|
5
|
+
description: string;
|
|
6
|
+
};
|
|
7
|
+
declare function parseMailooChatWelcomePreset(value: string | undefined | null): MailooChatWelcomePresetId | null;
|
|
8
|
+
/** Maps legacy preset ids from earlier builds (localStorage only). */
|
|
9
|
+
declare function normalizeLegacyWelcomePresetId(value: string): MailooChatWelcomePresetId | null;
|
|
10
|
+
|
|
11
|
+
export { type MailooChatWelcomePresetId, type MailooChatWelcomePresetOption, normalizeLegacyWelcomePresetId, parseMailooChatWelcomePreset };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type MailooChatWelcomePresetId = 'builtin' | 'team' | 'assistant';
|
|
2
|
+
type MailooChatWelcomePresetOption = {
|
|
3
|
+
id: MailooChatWelcomePresetId;
|
|
4
|
+
label: string;
|
|
5
|
+
description: string;
|
|
6
|
+
};
|
|
7
|
+
declare function parseMailooChatWelcomePreset(value: string | undefined | null): MailooChatWelcomePresetId | null;
|
|
8
|
+
/** Maps legacy preset ids from earlier builds (localStorage only). */
|
|
9
|
+
declare function normalizeLegacyWelcomePresetId(value: string): MailooChatWelcomePresetId | null;
|
|
10
|
+
|
|
11
|
+
export { type MailooChatWelcomePresetId, type MailooChatWelcomePresetOption, normalizeLegacyWelcomePresetId, parseMailooChatWelcomePreset };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
|
|
3
|
+
type MailooChatWidgetTopic = {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
action: 'start_chat' | 'external_url';
|
|
7
|
+
externalUrl?: string;
|
|
8
|
+
};
|
|
9
|
+
type MailooChatWidgetOperator = {
|
|
10
|
+
userId: string;
|
|
11
|
+
name: string | null;
|
|
12
|
+
image: string | null;
|
|
13
|
+
online: boolean;
|
|
14
|
+
};
|
|
15
|
+
declare const MAILOO_CHAT_LAUNCHER_POSITIONS: readonly ["bottom-right", "bottom-left", "top-right", "top-left", "middle-right", "middle-left"];
|
|
16
|
+
type MailooChatLauncherPosition = (typeof MAILOO_CHAT_LAUNCHER_POSITIONS)[number];
|
|
17
|
+
type MailooChatWidgetConfig = {
|
|
18
|
+
brandPrimary?: string;
|
|
19
|
+
brandOnPrimary?: string;
|
|
20
|
+
welcomeTitle?: string;
|
|
21
|
+
welcomeTagline?: string;
|
|
22
|
+
privacyPolicyUrl?: string;
|
|
23
|
+
position?: MailooChatLauncherPosition;
|
|
24
|
+
topics: MailooChatWidgetTopic[];
|
|
25
|
+
operators: MailooChatWidgetOperator[];
|
|
26
|
+
};
|
|
27
|
+
declare function isMailooChatLauncherPosition(value: unknown): value is MailooChatLauncherPosition;
|
|
28
|
+
declare function resolveMailooChatLauncherPosition(prop: MailooChatLauncherPosition | undefined, config: Pick<MailooChatWidgetConfig, 'position'> | null | undefined): MailooChatLauncherPosition;
|
|
29
|
+
declare function mailooChatLauncherRootClassNames(position: MailooChatLauncherPosition): string;
|
|
30
|
+
declare function chatWidgetCssVariables(config: Pick<MailooChatWidgetConfig, 'brandPrimary' | 'brandOnPrimary'> | null | undefined): CSSProperties;
|
|
31
|
+
|
|
32
|
+
export { type MailooChatWidgetConfig as M, type MailooChatLauncherPosition as a, MAILOO_CHAT_LAUNCHER_POSITIONS as b, chatWidgetCssVariables as c, type MailooChatWidgetOperator as d, type MailooChatWidgetTopic as e, isMailooChatLauncherPosition as i, mailooChatLauncherRootClassNames as m, resolveMailooChatLauncherPosition as r };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
|
|
3
|
+
type MailooChatWidgetTopic = {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
action: 'start_chat' | 'external_url';
|
|
7
|
+
externalUrl?: string;
|
|
8
|
+
};
|
|
9
|
+
type MailooChatWidgetOperator = {
|
|
10
|
+
userId: string;
|
|
11
|
+
name: string | null;
|
|
12
|
+
image: string | null;
|
|
13
|
+
online: boolean;
|
|
14
|
+
};
|
|
15
|
+
declare const MAILOO_CHAT_LAUNCHER_POSITIONS: readonly ["bottom-right", "bottom-left", "top-right", "top-left", "middle-right", "middle-left"];
|
|
16
|
+
type MailooChatLauncherPosition = (typeof MAILOO_CHAT_LAUNCHER_POSITIONS)[number];
|
|
17
|
+
type MailooChatWidgetConfig = {
|
|
18
|
+
brandPrimary?: string;
|
|
19
|
+
brandOnPrimary?: string;
|
|
20
|
+
welcomeTitle?: string;
|
|
21
|
+
welcomeTagline?: string;
|
|
22
|
+
privacyPolicyUrl?: string;
|
|
23
|
+
position?: MailooChatLauncherPosition;
|
|
24
|
+
topics: MailooChatWidgetTopic[];
|
|
25
|
+
operators: MailooChatWidgetOperator[];
|
|
26
|
+
};
|
|
27
|
+
declare function isMailooChatLauncherPosition(value: unknown): value is MailooChatLauncherPosition;
|
|
28
|
+
declare function resolveMailooChatLauncherPosition(prop: MailooChatLauncherPosition | undefined, config: Pick<MailooChatWidgetConfig, 'position'> | null | undefined): MailooChatLauncherPosition;
|
|
29
|
+
declare function mailooChatLauncherRootClassNames(position: MailooChatLauncherPosition): string;
|
|
30
|
+
declare function chatWidgetCssVariables(config: Pick<MailooChatWidgetConfig, 'brandPrimary' | 'brandOnPrimary'> | null | undefined): CSSProperties;
|
|
31
|
+
|
|
32
|
+
export { type MailooChatWidgetConfig as M, type MailooChatLauncherPosition as a, MAILOO_CHAT_LAUNCHER_POSITIONS as b, chatWidgetCssVariables as c, type MailooChatWidgetOperator as d, type MailooChatWidgetTopic as e, isMailooChatLauncherPosition as i, mailooChatLauncherRootClassNames as m, resolveMailooChatLauncherPosition as r };
|
package/package.json
CHANGED
|
@@ -1,6 +1,88 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mailoo/chat",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "1.32.2",
|
|
4
|
+
"description": "Mailoo JSBOX chat visitor widget and Next.js BFF routes",
|
|
5
|
+
"license": "LicenseRef-Mailoo-NoModification",
|
|
6
|
+
"homepage": "https://mailoo.app/en/support/docs/integrations/nextjs-packages",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"mailoo",
|
|
9
|
+
"nextjs",
|
|
10
|
+
"chat"
|
|
11
|
+
],
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"main": "./dist/index.cjs",
|
|
17
|
+
"module": "./dist/index.js",
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"import": "./dist/index.js",
|
|
23
|
+
"require": "./dist/index.cjs"
|
|
24
|
+
},
|
|
25
|
+
"./routes": {
|
|
26
|
+
"types": "./dist/routes/index.d.ts",
|
|
27
|
+
"import": "./dist/routes/index.js",
|
|
28
|
+
"require": "./dist/routes/index.cjs"
|
|
29
|
+
},
|
|
30
|
+
"./client": {
|
|
31
|
+
"types": "./dist/client/index.d.ts",
|
|
32
|
+
"import": "./dist/client/index.js",
|
|
33
|
+
"require": "./dist/client/index.cjs"
|
|
34
|
+
},
|
|
35
|
+
"./hooks": {
|
|
36
|
+
"types": "./dist/hooks/index.d.ts",
|
|
37
|
+
"import": "./dist/hooks/index.js",
|
|
38
|
+
"require": "./dist/hooks/index.cjs"
|
|
39
|
+
},
|
|
40
|
+
"./welcome-presets": {
|
|
41
|
+
"types": "./dist/welcome-presets/index.d.ts",
|
|
42
|
+
"import": "./dist/welcome-presets/index.js",
|
|
43
|
+
"require": "./dist/welcome-presets/index.cjs"
|
|
44
|
+
},
|
|
45
|
+
"./welcome-presets/parse": {
|
|
46
|
+
"types": "./dist/welcome-presets/parse.d.ts",
|
|
47
|
+
"import": "./dist/welcome-presets/parse.js",
|
|
48
|
+
"require": "./dist/welcome-presets/parse.cjs"
|
|
49
|
+
},
|
|
50
|
+
"./styles": {
|
|
51
|
+
"style": "./dist/styles/widget.css",
|
|
52
|
+
"default": "./dist/styles/widget.css"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"files": [
|
|
56
|
+
"dist",
|
|
57
|
+
"README.md",
|
|
58
|
+
"LICENSE"
|
|
59
|
+
],
|
|
60
|
+
"peerDependencies": {
|
|
61
|
+
"@heroicons/react": ">=2.2.0",
|
|
62
|
+
"@mailoo/next-core": "^1.18.4",
|
|
63
|
+
"next": ">=16.3.4",
|
|
64
|
+
"react": ">=18.3.1",
|
|
65
|
+
"react-dom": ">=18.3.1"
|
|
66
|
+
},
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"@heroicons/react": "^2.2.0",
|
|
69
|
+
"@mailoo/next-core": "1.32.2",
|
|
70
|
+
"@types/node": "^25.9.5",
|
|
71
|
+
"@types/react": "^19.2.18",
|
|
72
|
+
"next": "^16.3.4",
|
|
73
|
+
"react": "^19.2.8",
|
|
74
|
+
"react-dom": "^19.2.8",
|
|
75
|
+
"tsup": "^8.5.1",
|
|
76
|
+
"typescript": "^5.9.3",
|
|
77
|
+
"vitest": "^4.1.11"
|
|
78
|
+
},
|
|
79
|
+
"engines": {
|
|
80
|
+
"node": ">=20.20.2"
|
|
81
|
+
},
|
|
82
|
+
"scripts": {
|
|
83
|
+
"build": "tsup",
|
|
84
|
+
"clean": "rm -rf dist .turbo",
|
|
85
|
+
"test": "vitest run",
|
|
86
|
+
"type-check": "tsc --noEmit"
|
|
87
|
+
}
|
|
6
88
|
}
|