@product7/product7-js 0.5.5 → 0.5.7
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/README.md +10 -10
- package/dist/README.md +10 -10
- package/dist/product7-js.js +7261 -7100
- package/dist/product7-js.js.map +1 -1
- package/dist/product7-js.min.js +1 -1
- package/dist/product7-js.min.js.map +1 -1
- package/package.json +1 -1
- package/src/api/services/{WebChatService.js → LiveChatService.js} +14 -14
- package/src/core/APIService.js +15 -15
- package/src/core/Product7.js +9 -4
- package/src/core/WebSocketService.js +1 -1
- package/src/docs/api.md +8 -8
- package/src/docs/example.md +9 -9
- package/src/docs/framework-integrations.md +3 -3
- package/src/index.js +38 -37
- package/src/styles/base.js +8 -8
- package/src/styles/{web-chat-components.js → liveChat-components.js} +114 -114
- package/src/styles/{web-chat-core.js → liveChat-core.js} +96 -31
- package/src/styles/{web-chat-features.js → liveChat-features.js} +20 -20
- package/src/styles/{web-chat-views.js → liveChat-views.js} +137 -137
- package/src/styles/liveChat.js +17 -0
- package/src/styles/{webChatCustomStyles.js → liveChatCustomStyles.js} +16 -16
- package/src/styles/styles.js +3 -3
- package/src/widgets/BaseWidget.js +2 -2
- package/src/widgets/ChangelogWidget.js +3 -3
- package/src/widgets/{WebChatWidget.js → LiveChatWidget.js} +169 -165
- package/src/widgets/SurveyWidget.js +7 -7
- package/src/widgets/WidgetFactory.js +2 -2
- package/src/widgets/{web-chat/WebChatState.js → liveChat/LiveChatState.js} +1 -1
- package/src/widgets/{web-chat/components/WebChatLauncher.js → liveChat/components/LiveChatLauncher.js} +16 -16
- package/src/widgets/{web-chat/components/WebChatPanel.js → liveChat/components/LiveChatPanel.js} +41 -10
- package/src/widgets/{web-chat → liveChat}/components/NavigationTabs.js +16 -16
- package/src/widgets/{web-chat → liveChat}/views/ChangelogView.js +17 -17
- package/src/widgets/{web-chat → liveChat}/views/ChatView.js +153 -95
- package/src/widgets/{web-chat → liveChat}/views/ConversationsView.js +24 -24
- package/src/widgets/{web-chat → liveChat}/views/HelpView.js +32 -32
- package/src/widgets/{web-chat → liveChat}/views/HomeView.js +52 -52
- package/src/widgets/{web-chat → liveChat}/views/PreChatFormView.js +15 -18
- package/types/index.d.ts +8 -9
- package/src/styles/web-chat.js +0 -17
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { liveChatComponentsStyles } from './liveChat-components.js';
|
|
2
|
+
import { liveChatCoreStyles } from './liveChat-core.js';
|
|
3
|
+
import { liveChatFeaturesStyles } from './liveChat-features.js';
|
|
4
|
+
import { liveChatViewsStyles } from './liveChat-views.js';
|
|
5
|
+
|
|
6
|
+
export const liveChatStyles =
|
|
7
|
+
liveChatCoreStyles +
|
|
8
|
+
liveChatViewsStyles +
|
|
9
|
+
liveChatComponentsStyles +
|
|
10
|
+
liveChatFeaturesStyles;
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
liveChatComponentsStyles,
|
|
14
|
+
liveChatCoreStyles,
|
|
15
|
+
liveChatFeaturesStyles,
|
|
16
|
+
liveChatViewsStyles,
|
|
17
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function
|
|
1
|
+
export function applyliveChatCustomStyles(options = {}) {
|
|
2
2
|
const {
|
|
3
3
|
primaryColor = '#155EEF',
|
|
4
4
|
textColor = '#1d1d1f',
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
theme = 'light',
|
|
7
7
|
} = options;
|
|
8
8
|
|
|
9
|
-
let styleElement = document.getElementById('product7-
|
|
9
|
+
let styleElement = document.getElementById('product7-liveChat-custom-styles');
|
|
10
10
|
|
|
11
11
|
if (!styleElement) {
|
|
12
12
|
styleElement = document.createElement('style');
|
|
13
|
-
styleElement.id = 'product7-
|
|
13
|
+
styleElement.id = 'product7-liveChat-custom-styles';
|
|
14
14
|
document.head.appendChild(styleElement);
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -37,16 +37,16 @@
|
|
|
37
37
|
const darkBorder = adjustColor(backgroundColor, 34);
|
|
38
38
|
|
|
39
39
|
styleElement.textContent = `
|
|
40
|
-
#product7-
|
|
40
|
+
#product7-liveChat-widget {
|
|
41
41
|
--color-primary: ${primaryColor} !important;
|
|
42
42
|
--color-primary-hover: ${adjustColor(primaryColor, -10)} !important;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
.
|
|
45
|
+
.liveChat-launcher-btn {
|
|
46
46
|
background: ${primaryColor} !important;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
.
|
|
49
|
+
.liveChat-launcher-btn:hover {
|
|
50
50
|
box-shadow: 0 8px 24px ${adjustColor(primaryColor, 0, 0.3)} !important;
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -60,25 +60,25 @@
|
|
|
60
60
|
border-color: ${adjustColor(primaryColor, -10)} !important;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
.
|
|
63
|
+
.liveChat-compose-send:hover:not(:disabled) {
|
|
64
64
|
background: ${primaryColor} !important;
|
|
65
65
|
border-color: ${primaryColor} !important;
|
|
66
66
|
color: #FFFFFF !important;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
.
|
|
70
|
-
.
|
|
69
|
+
.liveChat-nav-tab.active .liveChat-nav-icon,
|
|
70
|
+
.liveChat-nav-tab.active .liveChat-nav-label {
|
|
71
71
|
color: ${primaryColor} !important;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
.
|
|
74
|
+
.liveChat-home-view::before {
|
|
75
75
|
background: radial-gradient(circle, ${adjustColor(primaryColor, 0, 0.08)} 0%, transparent 70%) !important;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
${
|
|
79
79
|
backgroundColor !== '#ffffff'
|
|
80
80
|
? `
|
|
81
|
-
.
|
|
81
|
+
.liveChat-panel-content {
|
|
82
82
|
background: ${backgroundColor} !important;
|
|
83
83
|
}
|
|
84
84
|
`
|
|
@@ -88,23 +88,23 @@
|
|
|
88
88
|
${
|
|
89
89
|
textColor !== '#1d1d1f'
|
|
90
90
|
? `
|
|
91
|
-
.
|
|
92
|
-
.
|
|
91
|
+
.liveChat-panel-content,
|
|
92
|
+
.liveChat-view {
|
|
93
93
|
color: ${textColor} !important;
|
|
94
94
|
}
|
|
95
95
|
`
|
|
96
96
|
: ''
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
/* Dark theme is now handled by CSS custom properties in
|
|
99
|
+
/* Dark theme is now handled by CSS custom properties in liveChat-core.js */
|
|
100
100
|
`;
|
|
101
101
|
|
|
102
102
|
console.log('✅ Custom web chat styles applied:', { primaryColor, theme });
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
export function
|
|
105
|
+
export function removeliveChatCustomStyles() {
|
|
106
106
|
const styleElement = document.getElementById(
|
|
107
|
-
'product7-
|
|
107
|
+
'product7-liveChat-custom-styles'
|
|
108
108
|
);
|
|
109
109
|
if (styleElement && styleElement.parentNode) {
|
|
110
110
|
styleElement.parentNode.removeChild(styleElement);
|
package/src/styles/styles.js
CHANGED
|
@@ -3,8 +3,8 @@ import { changelogStyles } from './changelog.js';
|
|
|
3
3
|
import { componentsStyles } from './components.js';
|
|
4
4
|
import { designTokens } from './design-tokens.js';
|
|
5
5
|
import { feedbackStyles } from './feedback.js';
|
|
6
|
+
import { liveChatStyles } from './liveChat.js';
|
|
6
7
|
import { surveyStyles } from './survey.js';
|
|
7
|
-
import { webChatStyles } from './web-chat.js';
|
|
8
8
|
|
|
9
9
|
export const CSS_STYLES =
|
|
10
10
|
designTokens +
|
|
@@ -13,7 +13,7 @@ export const CSS_STYLES =
|
|
|
13
13
|
feedbackStyles +
|
|
14
14
|
changelogStyles +
|
|
15
15
|
surveyStyles +
|
|
16
|
-
|
|
16
|
+
liveChatStyles;
|
|
17
17
|
|
|
18
18
|
export {
|
|
19
19
|
baseStyles,
|
|
@@ -21,6 +21,6 @@ export {
|
|
|
21
21
|
componentsStyles,
|
|
22
22
|
designTokens,
|
|
23
23
|
feedbackStyles,
|
|
24
|
+
liveChatStyles,
|
|
24
25
|
surveyStyles,
|
|
25
|
-
webChatStyles,
|
|
26
26
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export class BaseWidget {
|
|
1
|
+
export class BaseWidget {
|
|
2
2
|
static STORAGE_KEY = 'feedback_submitted';
|
|
3
3
|
static DEFAULT_COOLDOWN_DAYS = 30;
|
|
4
4
|
|
|
@@ -384,7 +384,7 @@ export class BaseWidget {
|
|
|
384
384
|
<div class="feedback-panel-header">
|
|
385
385
|
<h3>Send Feedback</h3>
|
|
386
386
|
<button class="sdk-close-btn" type="button" aria-label="Close">
|
|
387
|
-
<iconify-icon icon="ph:x
|
|
387
|
+
<iconify-icon icon="ph:x" width="18" height="18"></iconify-icon>
|
|
388
388
|
</button>
|
|
389
389
|
</div>
|
|
390
390
|
<div class="feedback-panel-body">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseWidget } from './BaseWidget.js';
|
|
1
|
+
import { BaseWidget } from './BaseWidget.js';
|
|
2
2
|
|
|
3
3
|
export class ChangelogWidget extends BaseWidget {
|
|
4
4
|
constructor(options) {
|
|
@@ -112,7 +112,7 @@ export class ChangelogWidget extends BaseWidget {
|
|
|
112
112
|
this.modalElement.innerHTML = `
|
|
113
113
|
<div class="changelog-modal-container">
|
|
114
114
|
<button class="changelog-modal-close" type="button" aria-label="Close">
|
|
115
|
-
<iconify-icon icon="ph:x
|
|
115
|
+
<iconify-icon icon="ph:x" width="18" height="18"></iconify-icon>
|
|
116
116
|
</button>
|
|
117
117
|
<div class="changelog-modal-content">
|
|
118
118
|
<div class="changelog-loading">
|
|
@@ -263,7 +263,7 @@ export class ChangelogWidget extends BaseWidget {
|
|
|
263
263
|
<div class="changelog-list-modal-header">
|
|
264
264
|
<h2>${this.options.title || "What's New"} 🎉</h2>
|
|
265
265
|
<button class="changelog-list-modal-close" type="button" aria-label="Close">
|
|
266
|
-
<iconify-icon icon="ph:x
|
|
266
|
+
<iconify-icon icon="ph:x" width="18" height="18"></iconify-icon>
|
|
267
267
|
</button>
|
|
268
268
|
</div>
|
|
269
269
|
<div class="changelog-list-modal-body">
|