@knowcode/doc-builder 1.3.5 → 1.3.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/CHANGELOG.md +24 -0
- package/assets/css/notion-style.css +39 -0
- package/assets/css/style.css +43 -0
- package/assets/js/main.js +30 -4
- package/lib/core-builder.js +3 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,30 @@ All notable changes to @knowcode/doc-builder will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.3.6] - 2025-07-19
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- Fixed responsive menu toggle button not being visible on mobile devices
|
|
12
|
+
- Added mobile overlay for sidebar with proper click-to-close functionality
|
|
13
|
+
- Improved sidebar z-index stacking for proper mobile display
|
|
14
|
+
- Added smooth transitions and shadow effects for mobile sidebar
|
|
15
|
+
- Fixed body scroll prevention when mobile menu is open
|
|
16
|
+
- Menu toggle button now shows close icon (X) when menu is open
|
|
17
|
+
- Sidebar properly closes when clicking navigation items on mobile
|
|
18
|
+
- Escape key now properly closes mobile menu and overlay
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
- Semi-transparent overlay background when sidebar is open on mobile
|
|
22
|
+
- Visual feedback for menu toggle button state (hamburger/close icon)
|
|
23
|
+
- Box shadow on mobile sidebar for better depth perception
|
|
24
|
+
- Proper ARIA attributes for accessibility
|
|
25
|
+
|
|
26
|
+
### Improved
|
|
27
|
+
- Better mobile user experience with standard mobile navigation patterns
|
|
28
|
+
- Consistent behavior across different mobile breakpoints
|
|
29
|
+
- Smoother animations and transitions for mobile menu
|
|
30
|
+
- Applied fixes to both default and notion-style themes
|
|
31
|
+
|
|
8
32
|
## [1.3.5] - 2025-07-19
|
|
9
33
|
|
|
10
34
|
### Fixed
|
|
@@ -987,6 +987,43 @@ tr:hover {
|
|
|
987
987
|
cursor: pointer;
|
|
988
988
|
color: var(--color-text-primary);
|
|
989
989
|
padding: var(--space-2);
|
|
990
|
+
margin-left: var(--space-2);
|
|
991
|
+
transition: color var(--duration-fast);
|
|
992
|
+
z-index: 1001;
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
.menu-toggle:hover {
|
|
996
|
+
color: var(--color-accent-blue);
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
.menu-toggle.active i::before {
|
|
1000
|
+
content: "\f00d"; /* fa-times icon */
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
/* Mobile Sidebar Overlay */
|
|
1004
|
+
.sidebar-overlay {
|
|
1005
|
+
position: fixed;
|
|
1006
|
+
top: 0;
|
|
1007
|
+
left: 0;
|
|
1008
|
+
right: 0;
|
|
1009
|
+
bottom: 0;
|
|
1010
|
+
background: var(--color-bg-overlay);
|
|
1011
|
+
z-index: 998;
|
|
1012
|
+
opacity: 0;
|
|
1013
|
+
visibility: hidden;
|
|
1014
|
+
transition: opacity var(--duration-normal), visibility var(--duration-normal);
|
|
1015
|
+
display: none;
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
@media (max-width: 1024px) {
|
|
1019
|
+
.sidebar-overlay {
|
|
1020
|
+
display: block;
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
.sidebar-overlay.active {
|
|
1025
|
+
opacity: 1;
|
|
1026
|
+
visibility: visible;
|
|
990
1027
|
}
|
|
991
1028
|
|
|
992
1029
|
/* Responsive Design */
|
|
@@ -994,6 +1031,8 @@ tr:hover {
|
|
|
994
1031
|
.sidebar {
|
|
995
1032
|
transform: translateX(-100%);
|
|
996
1033
|
transition: transform var(--duration-normal) var(--easing-out);
|
|
1034
|
+
z-index: 999;
|
|
1035
|
+
box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
|
|
997
1036
|
}
|
|
998
1037
|
|
|
999
1038
|
.sidebar.open {
|
package/assets/css/style.css
CHANGED
|
@@ -1388,12 +1388,18 @@ blockquote {
|
|
|
1388
1388
|
@media (max-width: 1024px) {
|
|
1389
1389
|
.sidebar {
|
|
1390
1390
|
transform: translateX(-100%);
|
|
1391
|
+
z-index: 999;
|
|
1392
|
+
box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
|
|
1391
1393
|
}
|
|
1392
1394
|
|
|
1393
1395
|
.sidebar.open {
|
|
1394
1396
|
transform: translateX(0);
|
|
1395
1397
|
}
|
|
1396
1398
|
|
|
1399
|
+
[data-theme="dark"] .sidebar {
|
|
1400
|
+
box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1397
1403
|
.content {
|
|
1398
1404
|
margin-left: 0;
|
|
1399
1405
|
padding: var(--space-xl);
|
|
@@ -1493,6 +1499,17 @@ blockquote {
|
|
|
1493
1499
|
cursor: pointer;
|
|
1494
1500
|
color: var(--text-primary);
|
|
1495
1501
|
padding: var(--space-sm);
|
|
1502
|
+
margin-left: var(--space-sm);
|
|
1503
|
+
transition: color var(--transition-fast);
|
|
1504
|
+
z-index: 1001;
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
.menu-toggle:hover {
|
|
1508
|
+
color: var(--accent);
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
.menu-toggle.active i::before {
|
|
1512
|
+
content: "\f00d"; /* fa-times icon */
|
|
1496
1513
|
}
|
|
1497
1514
|
|
|
1498
1515
|
@media (max-width: 1024px) {
|
|
@@ -1501,6 +1518,32 @@ blockquote {
|
|
|
1501
1518
|
}
|
|
1502
1519
|
}
|
|
1503
1520
|
|
|
1521
|
+
/* Mobile Sidebar Overlay */
|
|
1522
|
+
.sidebar-overlay {
|
|
1523
|
+
position: fixed;
|
|
1524
|
+
top: 0;
|
|
1525
|
+
left: 0;
|
|
1526
|
+
right: 0;
|
|
1527
|
+
bottom: 0;
|
|
1528
|
+
background: rgba(0, 0, 0, 0.5);
|
|
1529
|
+
z-index: 998;
|
|
1530
|
+
opacity: 0;
|
|
1531
|
+
visibility: hidden;
|
|
1532
|
+
transition: opacity var(--transition-base), visibility var(--transition-base);
|
|
1533
|
+
display: none;
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
@media (max-width: 1024px) {
|
|
1537
|
+
.sidebar-overlay {
|
|
1538
|
+
display: block;
|
|
1539
|
+
}
|
|
1540
|
+
}
|
|
1541
|
+
|
|
1542
|
+
.sidebar-overlay.active {
|
|
1543
|
+
opacity: 1;
|
|
1544
|
+
visibility: visible;
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1504
1547
|
/* Search Results Dropdown */
|
|
1505
1548
|
.search-results {
|
|
1506
1549
|
position: absolute;
|
package/assets/js/main.js
CHANGED
|
@@ -511,10 +511,30 @@ function updateThemeIcon(theme) {
|
|
|
511
511
|
// Mobile Menu Toggle
|
|
512
512
|
const menuToggle = document.getElementById('menu-toggle');
|
|
513
513
|
const sidebar = document.querySelector('.sidebar');
|
|
514
|
+
const sidebarOverlay = document.querySelector('.sidebar-overlay');
|
|
514
515
|
|
|
515
516
|
if (menuToggle) {
|
|
516
517
|
menuToggle.addEventListener('click', () => {
|
|
517
518
|
sidebar.classList.toggle('open');
|
|
519
|
+
sidebarOverlay.classList.toggle('active');
|
|
520
|
+
menuToggle.classList.toggle('active');
|
|
521
|
+
|
|
522
|
+
// Prevent body scroll when menu is open
|
|
523
|
+
if (sidebar.classList.contains('open')) {
|
|
524
|
+
document.body.style.overflow = 'hidden';
|
|
525
|
+
} else {
|
|
526
|
+
document.body.style.overflow = '';
|
|
527
|
+
}
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
// Close sidebar when clicking overlay
|
|
532
|
+
if (sidebarOverlay) {
|
|
533
|
+
sidebarOverlay.addEventListener('click', () => {
|
|
534
|
+
sidebar.classList.remove('open');
|
|
535
|
+
sidebarOverlay.classList.remove('active');
|
|
536
|
+
menuToggle.classList.remove('active');
|
|
537
|
+
document.body.style.overflow = '';
|
|
518
538
|
});
|
|
519
539
|
}
|
|
520
540
|
|
|
@@ -522,14 +542,17 @@ if (menuToggle) {
|
|
|
522
542
|
// Only close when clicking outside the sidebar or the close button
|
|
523
543
|
document.addEventListener('click', (e) => {
|
|
524
544
|
// Check if we're on mobile
|
|
525
|
-
if (window.innerWidth <=
|
|
545
|
+
if (window.innerWidth <= 1024) {
|
|
526
546
|
const isClickInsideSidebar = sidebar && sidebar.contains(e.target);
|
|
527
547
|
const isMenuToggle = e.target.closest('#menu-toggle');
|
|
528
|
-
const
|
|
548
|
+
const isOverlay = e.target.closest('.sidebar-overlay');
|
|
529
549
|
|
|
530
|
-
// Close sidebar
|
|
531
|
-
if (
|
|
550
|
+
// Close sidebar when clicking nav items on mobile
|
|
551
|
+
if (e.target.closest('.nav-item') && sidebar?.classList.contains('open')) {
|
|
532
552
|
sidebar.classList.remove('open');
|
|
553
|
+
sidebarOverlay?.classList.remove('active');
|
|
554
|
+
menuToggle?.classList.remove('active');
|
|
555
|
+
document.body.style.overflow = '';
|
|
533
556
|
}
|
|
534
557
|
}
|
|
535
558
|
});
|
|
@@ -666,6 +689,9 @@ document.addEventListener('keydown', (e) => {
|
|
|
666
689
|
// Escape to close mobile menu
|
|
667
690
|
if (e.key === 'Escape') {
|
|
668
691
|
sidebar?.classList.remove('open');
|
|
692
|
+
sidebarOverlay?.classList.remove('active');
|
|
693
|
+
menuToggle?.classList.remove('active');
|
|
694
|
+
document.body.style.overflow = '';
|
|
669
695
|
}
|
|
670
696
|
});
|
|
671
697
|
|
package/lib/core-builder.js
CHANGED
|
@@ -141,6 +141,9 @@ function generateHTML(title, content, navigation, currentPath = '', config = {})
|
|
|
141
141
|
|
|
142
142
|
<!-- Main Content -->
|
|
143
143
|
<div class="main-wrapper">
|
|
144
|
+
<!-- Sidebar Overlay -->
|
|
145
|
+
<div class="sidebar-overlay"></div>
|
|
146
|
+
|
|
144
147
|
<!-- Sidebar -->
|
|
145
148
|
<aside class="sidebar">
|
|
146
149
|
<div class="sidebar-header">
|