@knowcode/doc-builder 1.3.4 → 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 +38 -0
- package/assets/css/notion-style.css +41 -34
- package/assets/css/style.css +45 -38
- package/assets/js/main.js +30 -4
- package/lib/core-builder.js +3 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,44 @@ 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
|
+
|
|
32
|
+
## [1.3.5] - 2025-07-19
|
|
33
|
+
|
|
34
|
+
### Fixed
|
|
35
|
+
- Restored proper header and breadcrumb heights for better visual hierarchy
|
|
36
|
+
- Header height increased from 40px to 56px
|
|
37
|
+
- Breadcrumb height restored from 0px to 40px
|
|
38
|
+
- Removed duplicate "Home" link from sidebar to eliminate confusion
|
|
39
|
+
- Cleaned up orphaned CSS styles for removed sidebar breadcrumbs
|
|
40
|
+
|
|
41
|
+
### Improved
|
|
42
|
+
- Better spacing and visual weight for header components
|
|
43
|
+
- Cleaner sidebar with single-purpose filter input
|
|
44
|
+
- More professional appearance with proper proportions
|
|
45
|
+
|
|
8
46
|
## [1.3.4] - 2025-07-19
|
|
9
47
|
|
|
10
48
|
### Fixed
|
|
@@ -125,8 +125,8 @@
|
|
|
125
125
|
/* Layout */
|
|
126
126
|
--container-padding-mobile: 20px;
|
|
127
127
|
--container-padding-desktop: 40px;
|
|
128
|
-
--header-height:
|
|
129
|
-
--breadcrumb-height:
|
|
128
|
+
--header-height: 56px;
|
|
129
|
+
--breadcrumb-height: 40px;
|
|
130
130
|
--sidebar-width: 280px;
|
|
131
131
|
}
|
|
132
132
|
|
|
@@ -337,33 +337,6 @@ pre code {
|
|
|
337
337
|
border-bottom: 1px solid var(--color-border-default);
|
|
338
338
|
}
|
|
339
339
|
|
|
340
|
-
/* Sidebar Breadcrumbs */
|
|
341
|
-
.sidebar-breadcrumbs {
|
|
342
|
-
margin-bottom: var(--space-6);
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
.sidebar-home-link {
|
|
346
|
-
display: inline-flex;
|
|
347
|
-
align-items: center;
|
|
348
|
-
gap: var(--space-2);
|
|
349
|
-
padding: var(--space-2) var(--space-3);
|
|
350
|
-
color: var(--color-text-secondary);
|
|
351
|
-
text-decoration: none;
|
|
352
|
-
border-radius: var(--radius-base);
|
|
353
|
-
font-size: 0.875rem;
|
|
354
|
-
font-weight: 500;
|
|
355
|
-
transition: all 0.2s;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
.sidebar-home-link:hover {
|
|
359
|
-
background: var(--color-bg-secondary);
|
|
360
|
-
color: var(--color-text-primary);
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
.sidebar-home-link i {
|
|
364
|
-
font-size: 1rem;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
340
|
.filter-box {
|
|
368
341
|
position: relative;
|
|
369
342
|
}
|
|
@@ -529,11 +502,6 @@ pre code {
|
|
|
529
502
|
border-bottom: 1px solid var(--color-border-default);
|
|
530
503
|
}
|
|
531
504
|
|
|
532
|
-
/* Already defined above, but ensure consistency */
|
|
533
|
-
.sidebar-breadcrumbs {
|
|
534
|
-
margin-bottom: var(--space-6);
|
|
535
|
-
}
|
|
536
|
-
|
|
537
505
|
.filter-box {
|
|
538
506
|
position: relative;
|
|
539
507
|
display: flex;
|
|
@@ -1019,6 +987,43 @@ tr:hover {
|
|
|
1019
987
|
cursor: pointer;
|
|
1020
988
|
color: var(--color-text-primary);
|
|
1021
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;
|
|
1022
1027
|
}
|
|
1023
1028
|
|
|
1024
1029
|
/* Responsive Design */
|
|
@@ -1026,6 +1031,8 @@ tr:hover {
|
|
|
1026
1031
|
.sidebar {
|
|
1027
1032
|
transform: translateX(-100%);
|
|
1028
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);
|
|
1029
1036
|
}
|
|
1030
1037
|
|
|
1031
1038
|
.sidebar.open {
|
package/assets/css/style.css
CHANGED
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
/* Layout */
|
|
45
45
|
--sidebar-width: 280px;
|
|
46
46
|
--content-max-width: 65rem;
|
|
47
|
-
--header-height:
|
|
48
|
-
--breadcrumb-height:
|
|
47
|
+
--header-height: 56px;
|
|
48
|
+
--breadcrumb-height: 40px;
|
|
49
49
|
--banner-offset: 0rem;
|
|
50
50
|
|
|
51
51
|
/* Transitions */
|
|
@@ -865,33 +865,6 @@ em, i {
|
|
|
865
865
|
z-index: 10;
|
|
866
866
|
}
|
|
867
867
|
|
|
868
|
-
/* Sidebar Breadcrumbs */
|
|
869
|
-
.sidebar-breadcrumbs {
|
|
870
|
-
margin-bottom: var(--space-xl);
|
|
871
|
-
}
|
|
872
|
-
|
|
873
|
-
.sidebar-home-link {
|
|
874
|
-
display: inline-flex;
|
|
875
|
-
align-items: center;
|
|
876
|
-
gap: 0.5rem;
|
|
877
|
-
padding: 0.5rem 0.75rem;
|
|
878
|
-
color: var(--text-secondary);
|
|
879
|
-
text-decoration: none;
|
|
880
|
-
border-radius: 0.375rem;
|
|
881
|
-
font-size: 0.875rem;
|
|
882
|
-
font-weight: 500;
|
|
883
|
-
transition: all 0.2s;
|
|
884
|
-
}
|
|
885
|
-
|
|
886
|
-
.sidebar-home-link:hover {
|
|
887
|
-
background: var(--bg-secondary);
|
|
888
|
-
color: var(--text-primary);
|
|
889
|
-
}
|
|
890
|
-
|
|
891
|
-
.sidebar-home-link i {
|
|
892
|
-
font-size: 1rem;
|
|
893
|
-
}
|
|
894
|
-
|
|
895
868
|
.filter-box {
|
|
896
869
|
position: relative;
|
|
897
870
|
width: 100%;
|
|
@@ -979,15 +952,6 @@ em, i {
|
|
|
979
952
|
background: var(--bg-secondary);
|
|
980
953
|
}
|
|
981
954
|
|
|
982
|
-
[data-theme="dark"] .sidebar-home-link {
|
|
983
|
-
color: var(--text-secondary);
|
|
984
|
-
}
|
|
985
|
-
|
|
986
|
-
[data-theme="dark"] .sidebar-home-link:hover {
|
|
987
|
-
background: var(--bg-tertiary);
|
|
988
|
-
color: var(--text-primary);
|
|
989
|
-
}
|
|
990
|
-
|
|
991
955
|
[data-theme="dark"] .filter-input {
|
|
992
956
|
border-color: rgba(255, 255, 255, 0.1);
|
|
993
957
|
background: var(--bg-tertiary);
|
|
@@ -1424,12 +1388,18 @@ blockquote {
|
|
|
1424
1388
|
@media (max-width: 1024px) {
|
|
1425
1389
|
.sidebar {
|
|
1426
1390
|
transform: translateX(-100%);
|
|
1391
|
+
z-index: 999;
|
|
1392
|
+
box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
|
|
1427
1393
|
}
|
|
1428
1394
|
|
|
1429
1395
|
.sidebar.open {
|
|
1430
1396
|
transform: translateX(0);
|
|
1431
1397
|
}
|
|
1432
1398
|
|
|
1399
|
+
[data-theme="dark"] .sidebar {
|
|
1400
|
+
box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1433
1403
|
.content {
|
|
1434
1404
|
margin-left: 0;
|
|
1435
1405
|
padding: var(--space-xl);
|
|
@@ -1529,6 +1499,17 @@ blockquote {
|
|
|
1529
1499
|
cursor: pointer;
|
|
1530
1500
|
color: var(--text-primary);
|
|
1531
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 */
|
|
1532
1513
|
}
|
|
1533
1514
|
|
|
1534
1515
|
@media (max-width: 1024px) {
|
|
@@ -1537,6 +1518,32 @@ blockquote {
|
|
|
1537
1518
|
}
|
|
1538
1519
|
}
|
|
1539
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
|
+
|
|
1540
1547
|
/* Search Results Dropdown */
|
|
1541
1548
|
.search-results {
|
|
1542
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,15 +141,12 @@ 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">
|
|
147
|
-
<div class="sidebar-breadcrumbs">
|
|
148
|
-
<a href="/index.html" class="sidebar-home-link">
|
|
149
|
-
<i class="fas fa-home"></i>
|
|
150
|
-
<span>Home</span>
|
|
151
|
-
</a>
|
|
152
|
-
</div>
|
|
153
150
|
<div class="filter-box">
|
|
154
151
|
<input type="text" placeholder="Filter items..." class="filter-input" id="nav-filter">
|
|
155
152
|
<i class="fas fa-search filter-icon"></i>
|