@product7/product7-js 0.5.4 → 0.5.6
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 +6 -5
- package/dist/README.md +6 -5
- package/dist/product7-js.js +821 -816
- 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 +37 -37
- package/src/styles/base.js +8 -8
- package/src/styles/{web-chat-components.js → live-chat-components.js} +114 -114
- package/src/styles/{web-chat-core.js → live-chat-core.js} +30 -30
- package/src/styles/{web-chat-features.js → live-chat-features.js} +20 -20
- package/src/styles/{web-chat-views.js → live-chat-views.js} +137 -137
- package/src/styles/live-chat.js +17 -0
- package/src/styles/{webChatCustomStyles.js → liveChatCustomStyles.js} +16 -16
- package/src/styles/styles.js +3 -3
- package/src/widgets/{WebChatWidget.js → LiveChatWidget.js} +166 -166
- package/src/widgets/WidgetFactory.js +2 -2
- package/src/widgets/{web-chat/WebChatState.js → live-chat/LiveChatState.js} +1 -1
- package/src/widgets/{web-chat/components/WebChatLauncher.js → live-chat/components/LiveChatLauncher.js} +15 -15
- package/src/widgets/{web-chat/components/WebChatPanel.js → live-chat/components/LiveChatPanel.js} +10 -10
- package/src/widgets/{web-chat → live-chat}/components/NavigationTabs.js +12 -12
- package/src/widgets/{web-chat → live-chat}/views/ChangelogView.js +16 -16
- package/src/widgets/{web-chat → live-chat}/views/ChatView.js +90 -90
- package/src/widgets/{web-chat → live-chat}/views/ConversationsView.js +23 -23
- package/src/widgets/{web-chat → live-chat}/views/HelpView.js +28 -28
- package/src/widgets/{web-chat → live-chat}/views/HomeView.js +52 -52
- package/src/widgets/{web-chat → live-chat}/views/PreChatFormView.js +16 -16
- package/types/index.d.ts +11 -9
- package/src/styles/web-chat.js +0 -17
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { liveChatComponentsStyles } from './live-chat-components.js';
|
|
2
|
+
import { liveChatCoreStyles } from './live-chat-core.js';
|
|
3
|
+
import { liveChatFeaturesStyles } from './live-chat-features.js';
|
|
4
|
+
import { liveChatViewsStyles } from './live-chat-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-live-chat-custom-styles');
|
|
10
10
|
|
|
11
11
|
if (!styleElement) {
|
|
12
12
|
styleElement = document.createElement('style');
|
|
13
|
-
styleElement.id = 'product7-
|
|
13
|
+
styleElement.id = 'product7-live-chat-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-live-chat-widget {
|
|
41
41
|
--color-primary: ${primaryColor} !important;
|
|
42
42
|
--color-primary-hover: ${adjustColor(primaryColor, -10)} !important;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
.
|
|
45
|
+
.live-chat-launcher-btn {
|
|
46
46
|
background: ${primaryColor} !important;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
.
|
|
49
|
+
.live-chat-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
|
+
.live-chat-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
|
+
.live-chat-nav-tab.active .live-chat-nav-icon,
|
|
70
|
+
.live-chat-nav-tab.active .live-chat-nav-label {
|
|
71
71
|
color: ${primaryColor} !important;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
.
|
|
74
|
+
.live-chat-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
|
+
.live-chat-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
|
+
.live-chat-panel-content,
|
|
92
|
+
.live-chat-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 live-chat-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-live-chat-custom-styles'
|
|
108
108
|
);
|
|
109
109
|
if (styleElement && styleElement.parentNode) {
|
|
110
110
|
styleElement.parentNode.removeChild(styleElement);
|
package/src/styles/styles.js
CHANGED
|
@@ -4,7 +4,7 @@ import { componentsStyles } from './components.js';
|
|
|
4
4
|
import { designTokens } from './design-tokens.js';
|
|
5
5
|
import { feedbackStyles } from './feedback.js';
|
|
6
6
|
import { surveyStyles } from './survey.js';
|
|
7
|
-
import {
|
|
7
|
+
import { liveChatStyles } from './live-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,
|
|
@@ -22,5 +22,5 @@ export {
|
|
|
22
22
|
designTokens,
|
|
23
23
|
feedbackStyles,
|
|
24
24
|
surveyStyles,
|
|
25
|
-
|
|
25
|
+
liveChatStyles,
|
|
26
26
|
};
|