Skip to content

Commit 963af28

Browse files
authored
Merge branch 'cloudlinux:master' into mkrcho-wp-plugin-v2
2 parents 6c9a882 + 71de8c1 commit 963af28

File tree

31 files changed

+3201
-424
lines changed

31 files changed

+3201
-424
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ jobs:
1818
uses: actions/setup-node@v3
1919
with:
2020
# choose node.js version to use.
21-
node-version: '18'
21+
node-version: '22'
2222

2323
- name: Install and Build 🔧 #
2424
run: |
25-
yarn
25+
yarn install --non-interactive --frozen-lockfile
2626
yarn docs:build
2727
2828
- name: Deploy 🚀

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ docs/.vuepress/dist
44
node_modules
55

66
.idea
7-
yarn.lock
87

98
# OS generated files #
109
######################

Makefile

Lines changed: 0 additions & 21 deletions
This file was deleted.
5.51 KB
Binary file not shown.

docs/.vuepress/client.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import documents from "./config-client/documents";
1212
import sidebar from "./config-client/sidebar";
1313
import social from "./config-client/social";
1414
import Chat from "./components/Chat.vue";
15+
import CodeTabs from "./components/CodeTabs.vue";
16+
import CodeWithCopy from "./components/CodeWithCopy.vue";
1517

1618
export default defineClientConfig({
1719
rootComponents: [

docs/.vuepress/components/Chat.vue

Lines changed: 118 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,12 @@
88
@click="toggleChat"
99
:class="{ 'chat-open': showChat }"
1010
>
11-
<svg
11+
<img
1212
v-if="!showChat"
13-
viewBox="0 0 16 16"
14-
xmlns="http://www.w3.org/2000/svg"
15-
fill="#ffffff"
16-
>
17-
<g id="SVGRepo_iconCarrier">
18-
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.48 4h4l.5.5v2.03h.52l.5.5V8l-.5.5h-.52v3l-.5.5H9.36l-2.5 2.76L6 14.4V12H3.5l-.5-.64V8.5h-.5L2 8v-.97l.5-.5H3V4.36L3.53 4h4V2.86A1 1 0 0 1 7 2a1 1 0 0 1 2 0 1 1 0 0 1-.52.83V4zM12 8V5H4v5.86l2.5.14H7v2.19l1.8-2.04.35-.15H12V8zm-2.12.51a2.71 2.71 0 0 1-1.37.74v-.01a2.71 2.71 0 0 1-2.42-.74l-.7.71c.34.34.745.608 1.19.79.45.188.932.286 1.42.29a3.7 3.7 0 0 0 2.58-1.07l-.7-.71zM6.49 6.5h-1v1h1v-1zm3 0h1v1h-1v-1z"></path>
19-
</g>
20-
</svg>
13+
src="../assets/icons/bot-icon.webp"
14+
alt="Bot icon"
15+
class="bot-icon"
16+
/>
2117
<svg
2218
v-else
2319
xmlns="http://www.w3.org/2000/svg"
@@ -33,8 +29,12 @@
3329
</svg>
3430
</button>
3531

36-
<div v-if="!showChat" class="highlight-container">
37-
<div class="tooltip-text">Try our new Virtual Assistant!</div>
32+
<div v-if="shouldShowTooltip" class="highlight-container">
33+
<div class="tooltip-text">
34+
<div class="tooltip-close" @click="dismissTooltip">×</div>
35+
<div class="tooltip-title"><b>Need help?</b></div>
36+
<div class="tooltip-subtitle">I'm an AI chatbot, trained to answer all your questions.</div>
37+
</div>
3838
</div>
3939
</div>
4040

@@ -44,14 +44,6 @@
4444
:class="{ fullscreen: isMobile, 'desktop-view': !isMobile }"
4545
>
4646
<div class="chat-header">
47-
<div class="header-content">
48-
<img
49-
:src="botOptions.botAvatarImg"
50-
alt="Bot icon"
51-
class="header-avatar"
52-
/>
53-
<span class="bot-title">{{ botOptions.botTitle }}</span>
54-
</div>
5547
<div class="header-actions">
5648
<button class="close-btn" @click="toggleChat">
5749
<svg
@@ -87,43 +79,70 @@
8779
</template>
8880

8981
<script>
90-
import BotIcon from "cl-doc-vue-bot-ui/src/assets/icons/bot.png";
91-
9282
export default {
9383
data() {
9484
return {
9585
showChat: false,
9686
isLoading: true,
97-
botOptions: {
98-
botAvatarImg: BotIcon,
99-
botTitle: "AI Assistant",
100-
},
10187
iframeUrl: "https://chatbot.cloudlinux.com/docs/imunify360",
10288
windowWidth: 0, // Changed from window.innerWidth to avoid SSR error
89+
showTooltip: true,
90+
tooltipDismissDuration: 2 * 60 * 60 * 1000, // 2 hours in milliseconds
10391
};
10492
},
10593
computed: {
10694
isMobile() {
10795
return this.windowWidth < 768;
10896
},
97+
shouldShowTooltip() {
98+
return !this.showChat && this.showTooltip;
99+
},
109100
},
110101
mounted() {
111102
window.addEventListener("resize", this.handleResize);
112103
this.handleResize(); // Set initial windowWidth on client-side
104+
this.updateTooltipVisibility(); // Check tooltip dismissal state on mount
113105
},
114106
beforeUnmount() {
115107
window.removeEventListener("resize", this.handleResize);
116108
},
117109
methods: {
118110
toggleChat() {
119111
this.showChat = !this.showChat;
112+
// If chat is opened, dismiss the tooltip for the set duration
113+
if (this.showChat) {
114+
this.dismissTooltip();
115+
}
120116
},
121117
handleResize() {
122118
this.windowWidth = window.innerWidth;
123119
},
124120
onIframeLoad() {
125121
this.isLoading = false;
126122
},
123+
updateTooltipVisibility() {
124+
const dismissedTime = localStorage.getItem('imdocs_chatbot_tooltip_dismissed_time');
125+
let shouldBeDismissed = false;
126+
127+
if (dismissedTime) {
128+
const currentTime = new Date().getTime();
129+
// Check if the dismissal duration has passed
130+
if (currentTime - parseInt(dismissedTime) < this.tooltipDismissDuration) {
131+
shouldBeDismissed = true;
132+
} else {
133+
// If duration passed, clear the dismissal time so it can show again
134+
localStorage.removeItem('imdocs_chatbot_tooltip_dismissed_time');
135+
}
136+
}
137+
138+
// Update tooltip visibility based on dismissal state
139+
this.showTooltip = !shouldBeDismissed;
140+
},
141+
dismissTooltip() {
142+
const currentTime = new Date().getTime();
143+
localStorage.setItem('imdocs_chatbot_tooltip_dismissed_time', currentTime.toString());
144+
this.updateTooltipVisibility();
145+
},
127146
},
128147
};
129148
</script>
@@ -162,8 +181,8 @@ mobile-breakpoint = 768px
162181
163182
.chat-toggle {
164183
position: relative
165-
background: $primary-color
166-
border: none
184+
background: white
185+
border: 2px solid $primary-color
167186
border-radius: 50%
168187
width: 56px
169188
height: 56px
@@ -174,9 +193,18 @@ mobile-breakpoint = 768px
174193
box-shadow: 0 4px 12px rgba(0,0,0,0.15)
175194
transition: transform 0.3s ease, box-shadow 0.3s ease
176195
z-index: 10000
196+
padding: 0
197+
overflow: hidden
198+
199+
.bot-icon {
200+
width: calc(100% - 4px)
201+
height: calc(100% - 4px)
202+
border-radius: 50%
203+
object-fit: cover
204+
}
177205
178206
svg {
179-
color: white
207+
color: $primary-color
180208
width: 32px
181209
height: 32px
182210
}
@@ -190,31 +218,73 @@ mobile-breakpoint = 768px
190218
.highlight-container {
191219
position: absolute;
192220
bottom: calc(100% + 15px);
193-
left: 50%;
194-
transform: translateX(-35%);
221+
right: 0;
195222
display: flex;
196223
flex-direction: column;
197-
align-items: center;
198-
pointer-events: none;
224+
align-items: flex-end;
225+
pointer-events: auto;
199226
z-index: 10001;
200227
max-width: 90vw;
201228
}
202229
203230
.tooltip-text {
204-
background: $primary-color;
205-
color: white;
206-
padding: 8px 16px;
231+
background: white;
232+
color: black;
233+
padding: 12px 20px;
207234
border-radius: 20px;
208235
font-size: 0.95rem; /* Increase this value to make the tooltip text larger */
209236
animation: float 3s ease-in-out infinite;
210237
position: relative;
211-
text-align: center;
212-
white-space: nowrap;
238+
text-align: right;
213239
font-weight: 500;
214-
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
215-
max-width: 90vw;
240+
box-shadow: 0 0 15px $primary-color;
216241
overflow: visible;
217242
text-overflow: clip;
243+
244+
/* Stop tooltip animation on hover */
245+
&:hover {
246+
animation-play-state: paused;
247+
}
248+
}
249+
250+
.tooltip-close {
251+
position: absolute;
252+
top: -8px;
253+
right: -8px;
254+
width: 20px;
255+
height: 20px;
256+
background: white;
257+
border: 1px solid #ddd;
258+
border-radius: 50%;
259+
display: flex;
260+
align-items: center;
261+
justify-content: center;
262+
cursor: pointer;
263+
font-size: 14px;
264+
line-height: 1;
265+
color: #666;
266+
transition: all 0.2s ease;
267+
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
268+
z-index: 10;
269+
pointer-events: auto;
270+
271+
&:hover {
272+
background: #f5f5f5;
273+
transform: scale(1.1);
274+
color: #333;
275+
}
276+
}
277+
278+
.tooltip-title {
279+
margin-bottom: 4px;
280+
position: relative;
281+
z-index: 2;
282+
}
283+
284+
.tooltip-subtitle {
285+
white-space: nowrap;
286+
position: relative;
287+
z-index: 2;
218288
}
219289
220290
.chat-container {
@@ -252,27 +322,9 @@ mobile-breakpoint = 768px
252322
color: white
253323
padding: 1rem 1.5rem
254324
display: flex
255-
justify-content: space-between
325+
justify-content: flex-end
256326
align-items: center
257327
258-
.header-content {
259-
display: flex
260-
align-items: center
261-
262-
.header-avatar {
263-
width: 32px
264-
height: 32px
265-
border-radius: 50%
266-
margin-right: 10px
267-
object-fit: cover
268-
}
269-
270-
.bot-title {
271-
font-weight: 600
272-
font-size: 1rem
273-
}
274-
}
275-
276328
.header-actions {
277329
display: flex
278330
align-items: center
@@ -354,10 +406,10 @@ mobile-breakpoint = 768px
354406
355407
@keyframes float {
356408
0%, 100% {
357-
transform: translateY(0) translateX(-50%)
409+
transform: translateY(0)
358410
}
359411
50% {
360-
transform: translateY(-4px) translateX(-50%)
412+
transform: translateY(-4px)
361413
}
362414
}
363415
@@ -377,14 +429,16 @@ mobile-breakpoint = 768px
377429
378430
.highlight-container {
379431
bottom: calc(100% + 15px)
380-
right: auto
381-
left: 50%
382-
transform: translateX(-40%)
432+
right: 0
383433
}
384434
385435
.tooltip-text {
386436
font-size: 0.9rem; /* Adjust this value to change the tooltip text size on mobile devices */
387-
padding: 6px 12px;
437+
padding: 10px 16px;
438+
max-width: 90vw;
439+
}
440+
441+
.tooltip-subtitle {
388442
white-space: nowrap;
389443
}
390444
}

0 commit comments

Comments
 (0)