js-kompo-utils 1.0.8 → 1.0.9
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/package.json
CHANGED
|
@@ -181,6 +181,10 @@ export class TutorialEngine {
|
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
_wireButtons() {
|
|
184
|
+
if (this.bubble.closeBtn) {
|
|
185
|
+
this.bubble.closeBtn.addEventListener('click', () => { this._close(); });
|
|
186
|
+
}
|
|
187
|
+
|
|
184
188
|
if (this.bubble.actionBtn) {
|
|
185
189
|
this.bubble.actionBtn.addEventListener('click', () => { this._advance(); });
|
|
186
190
|
}
|
|
@@ -29,6 +29,12 @@ export class Bubble {
|
|
|
29
29
|
this.el.style.fontSize = config.bubbleFontSize;
|
|
30
30
|
this.el.style.lineHeight = config.bubbleLineHeight;
|
|
31
31
|
|
|
32
|
+
this.closeBtn = document.createElement('button');
|
|
33
|
+
this.closeBtn.className = 'tutorial-close-btn';
|
|
34
|
+
this.closeBtn.setAttribute('aria-label', 'Close tutorial');
|
|
35
|
+
this.closeBtn.textContent = '\u00D7';
|
|
36
|
+
this.el.appendChild(this.closeBtn);
|
|
37
|
+
|
|
32
38
|
this.arrowEl = document.createElement('div');
|
|
33
39
|
this.arrowEl.className = 'tutorial-arrow';
|
|
34
40
|
this.el.appendChild(this.arrowEl);
|
|
@@ -209,6 +215,7 @@ export class Bubble {
|
|
|
209
215
|
this.actionBtn = null;
|
|
210
216
|
this.backBtn = null;
|
|
211
217
|
this.pauseBtn = null;
|
|
218
|
+
this.closeBtn = null;
|
|
212
219
|
}
|
|
213
220
|
|
|
214
221
|
// --- Private: mobile positioning (CSS flexbox, no @floating-ui) ---
|
package/tutorials/tutorial.scss
CHANGED
|
@@ -213,6 +213,32 @@
|
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
|
|
216
|
+
// === Close button (top-right of bubble) ===
|
|
217
|
+
.tutorial-close-btn {
|
|
218
|
+
position: absolute;
|
|
219
|
+
top: 8px;
|
|
220
|
+
right: 8px;
|
|
221
|
+
width: 28px;
|
|
222
|
+
height: 28px;
|
|
223
|
+
border: none;
|
|
224
|
+
border-radius: 50%;
|
|
225
|
+
background: rgba(0, 0, 0, 0.06);
|
|
226
|
+
color: #999;
|
|
227
|
+
font-size: 18px;
|
|
228
|
+
line-height: 1;
|
|
229
|
+
cursor: pointer;
|
|
230
|
+
display: flex;
|
|
231
|
+
align-items: center;
|
|
232
|
+
justify-content: center;
|
|
233
|
+
transition: background 0.15s, color 0.15s;
|
|
234
|
+
z-index: 1;
|
|
235
|
+
|
|
236
|
+
&:hover {
|
|
237
|
+
background: rgba(0, 0, 0, 0.12);
|
|
238
|
+
color: #333;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
216
242
|
.tutorial-text {
|
|
217
243
|
margin: 0;
|
|
218
244
|
max-height: clamp(150px, 40vh, 300px);
|