@knowcode/doc-builder 1.3.7 → 1.3.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/CHANGELOG.md +41 -0
- package/assets/css/style.css +97 -0
- package/assets/js/main.js +35 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,47 @@ 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.9] - 2025-07-19
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- Fixed tooltip JavaScript positioning implementation
|
|
12
|
+
- Removed invalid getComputedStyle call on pseudo-elements
|
|
13
|
+
- Added mouseleave handler to clean up CSS variables
|
|
14
|
+
- Fixed tooltip arrow positioning with proper transform
|
|
15
|
+
- Added event listener cleanup to prevent duplicates
|
|
16
|
+
- Added console logging for tooltip debugging
|
|
17
|
+
|
|
18
|
+
### Improved
|
|
19
|
+
- Tooltips now properly use fixed positioning as per lessons learned
|
|
20
|
+
- Added MutationObserver to handle dynamically updated navigation
|
|
21
|
+
- Better event handling with proper cleanup on element replacement
|
|
22
|
+
- More robust tooltip initialization that works with dynamic content
|
|
23
|
+
|
|
24
|
+
### Technical Details
|
|
25
|
+
- JavaScript now correctly sets `--tooltip-left` and `--tooltip-top` CSS variables
|
|
26
|
+
- Fixed positioning allows tooltips to escape overflow containers
|
|
27
|
+
- Event listeners are properly cleaned up to prevent memory leaks
|
|
28
|
+
- Console logging helps debug tooltip initialization issues
|
|
29
|
+
|
|
30
|
+
## [1.3.8] - 2025-07-19
|
|
31
|
+
|
|
32
|
+
### Fixed
|
|
33
|
+
- Added missing tooltip styles to default theme (style.css)
|
|
34
|
+
- Tooltips now appear on hover for navigation folders with descriptions
|
|
35
|
+
- Matched tooltip styling between default and notion themes
|
|
36
|
+
|
|
37
|
+
### Added
|
|
38
|
+
- Complete tooltip CSS implementation for default theme
|
|
39
|
+
- Tooltip arrow for better visual connection
|
|
40
|
+
- Dark mode tooltip styling
|
|
41
|
+
- Mobile tooltip suppression (disabled on screens < 768px)
|
|
42
|
+
|
|
43
|
+
### Technical Details
|
|
44
|
+
- Tooltips use fixed positioning to escape overflow containers
|
|
45
|
+
- High z-index (10000) ensures tooltips appear above all content
|
|
46
|
+
- JavaScript positioning via CSS custom properties (--tooltip-left, --tooltip-top)
|
|
47
|
+
- Smooth fade transitions for professional appearance
|
|
48
|
+
|
|
8
49
|
## [1.3.7] - 2025-07-19
|
|
9
50
|
|
|
10
51
|
### Fixed
|
package/assets/css/style.css
CHANGED
|
@@ -1816,6 +1816,103 @@ section + section {
|
|
|
1816
1816
|
}
|
|
1817
1817
|
}
|
|
1818
1818
|
|
|
1819
|
+
/* Tooltip Styles */
|
|
1820
|
+
[data-tooltip] {
|
|
1821
|
+
position: relative;
|
|
1822
|
+
}
|
|
1823
|
+
|
|
1824
|
+
/* Tooltip content */
|
|
1825
|
+
[data-tooltip]::after {
|
|
1826
|
+
content: attr(data-tooltip);
|
|
1827
|
+
position: fixed; /* Use fixed positioning to escape overflow containers */
|
|
1828
|
+
left: var(--tooltip-left, 0);
|
|
1829
|
+
top: var(--tooltip-top, 0);
|
|
1830
|
+
transform: translateY(-50%);
|
|
1831
|
+
background: #333;
|
|
1832
|
+
color: white;
|
|
1833
|
+
padding: 8px 12px;
|
|
1834
|
+
border-radius: 4px;
|
|
1835
|
+
font-size: 14px;
|
|
1836
|
+
white-space: normal;
|
|
1837
|
+
line-height: 1.4;
|
|
1838
|
+
max-width: 300px;
|
|
1839
|
+
pointer-events: none;
|
|
1840
|
+
opacity: 0;
|
|
1841
|
+
visibility: hidden;
|
|
1842
|
+
transition: opacity 0.3s, visibility 0.3s;
|
|
1843
|
+
z-index: 10000;
|
|
1844
|
+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
|
|
1845
|
+
}
|
|
1846
|
+
|
|
1847
|
+
/* Tooltip arrow */
|
|
1848
|
+
[data-tooltip]::before {
|
|
1849
|
+
content: '';
|
|
1850
|
+
position: fixed;
|
|
1851
|
+
left: var(--tooltip-left, 0);
|
|
1852
|
+
top: var(--tooltip-top, 0);
|
|
1853
|
+
transform: translateX(-8px) translateY(-50%);
|
|
1854
|
+
width: 0;
|
|
1855
|
+
height: 0;
|
|
1856
|
+
border-style: solid;
|
|
1857
|
+
border-width: 6px 8px 6px 0;
|
|
1858
|
+
border-color: transparent #333 transparent transparent;
|
|
1859
|
+
opacity: 0;
|
|
1860
|
+
visibility: hidden;
|
|
1861
|
+
transition: opacity 0.3s, visibility 0.3s;
|
|
1862
|
+
z-index: 10001;
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1865
|
+
[data-tooltip]:hover::after,
|
|
1866
|
+
[data-tooltip]:hover::before {
|
|
1867
|
+
opacity: 1;
|
|
1868
|
+
visibility: visible;
|
|
1869
|
+
}
|
|
1870
|
+
|
|
1871
|
+
/* Ensure nav items have proper stacking context */
|
|
1872
|
+
.nav-item[data-tooltip],
|
|
1873
|
+
.nav-title[data-tooltip] {
|
|
1874
|
+
position: relative !important;
|
|
1875
|
+
z-index: 1;
|
|
1876
|
+
}
|
|
1877
|
+
|
|
1878
|
+
.nav-item[data-tooltip]:hover,
|
|
1879
|
+
.nav-title[data-tooltip]:hover {
|
|
1880
|
+
z-index: 100000; /* Very high z-index to ensure tooltip appears above everything */
|
|
1881
|
+
}
|
|
1882
|
+
|
|
1883
|
+
/* Tooltip for nav titles (folders) */
|
|
1884
|
+
.nav-title[data-tooltip]::after {
|
|
1885
|
+
max-width: 350px;
|
|
1886
|
+
font-weight: 400;
|
|
1887
|
+
}
|
|
1888
|
+
|
|
1889
|
+
/* Ensure nav sections don't clip tooltips */
|
|
1890
|
+
.nav-section {
|
|
1891
|
+
position: relative;
|
|
1892
|
+
overflow: visible !important;
|
|
1893
|
+
}
|
|
1894
|
+
|
|
1895
|
+
/* Dark mode tooltip styles */
|
|
1896
|
+
[data-theme="dark"] [data-tooltip]::after {
|
|
1897
|
+
background: var(--bg-secondary);
|
|
1898
|
+
color: var(--text-primary);
|
|
1899
|
+
border: 1px solid var(--bg-tertiary);
|
|
1900
|
+
box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
|
|
1901
|
+
}
|
|
1902
|
+
|
|
1903
|
+
[data-theme="dark"] [data-tooltip]::before {
|
|
1904
|
+
border-right-color: var(--bg-secondary);
|
|
1905
|
+
}
|
|
1906
|
+
|
|
1907
|
+
/* Mobile adjustments */
|
|
1908
|
+
@media (max-width: 768px) {
|
|
1909
|
+
/* Disable tooltips on mobile to prevent overlap issues */
|
|
1910
|
+
[data-tooltip]::before,
|
|
1911
|
+
[data-tooltip]::after {
|
|
1912
|
+
display: none;
|
|
1913
|
+
}
|
|
1914
|
+
}
|
|
1915
|
+
|
|
1819
1916
|
/* Print Styles */
|
|
1820
1917
|
@media print {
|
|
1821
1918
|
.header,
|
package/assets/js/main.js
CHANGED
|
@@ -1333,15 +1333,32 @@ function generateBreadcrumbs() {
|
|
|
1333
1333
|
// Initialize tooltip positioning for navigation items
|
|
1334
1334
|
function initTooltips() {
|
|
1335
1335
|
const tooltipElements = document.querySelectorAll('[data-tooltip]');
|
|
1336
|
+
console.log(`Initializing tooltips for ${tooltipElements.length} elements`);
|
|
1336
1337
|
|
|
1337
1338
|
tooltipElements.forEach(element => {
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1339
|
+
// Remove any existing listeners to prevent duplicates
|
|
1340
|
+
const newElement = element.cloneNode(true);
|
|
1341
|
+
element.parentNode.replaceChild(newElement, element);
|
|
1342
|
+
|
|
1343
|
+
newElement.addEventListener('mouseenter', function(e) {
|
|
1344
|
+
const rect = newElement.getBoundingClientRect();
|
|
1345
|
+
const tooltipText = newElement.getAttribute('data-tooltip');
|
|
1341
1346
|
|
|
1342
1347
|
// Position the tooltip using CSS variables
|
|
1343
|
-
|
|
1344
|
-
|
|
1348
|
+
// Tooltip appears to the right of the element with 10px gap
|
|
1349
|
+
const leftPos = rect.right + 10;
|
|
1350
|
+
const topPos = rect.top + rect.height / 2;
|
|
1351
|
+
|
|
1352
|
+
console.log(`Tooltip positioned at: ${leftPos}, ${topPos} for "${tooltipText}"`);
|
|
1353
|
+
|
|
1354
|
+
newElement.style.setProperty('--tooltip-left', `${leftPos}px`);
|
|
1355
|
+
newElement.style.setProperty('--tooltip-top', `${topPos}px`);
|
|
1356
|
+
});
|
|
1357
|
+
|
|
1358
|
+
// Clean up on mouse leave
|
|
1359
|
+
newElement.addEventListener('mouseleave', function(e) {
|
|
1360
|
+
newElement.style.removeProperty('--tooltip-left');
|
|
1361
|
+
newElement.style.removeProperty('--tooltip-top');
|
|
1345
1362
|
});
|
|
1346
1363
|
});
|
|
1347
1364
|
}
|
|
@@ -1356,4 +1373,17 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
1356
1373
|
addPDFExportButton();
|
|
1357
1374
|
generateBreadcrumbs();
|
|
1358
1375
|
initTooltips();
|
|
1376
|
+
|
|
1377
|
+
// Re-initialize tooltips if navigation is dynamically updated
|
|
1378
|
+
const navigation = document.querySelector('.navigation');
|
|
1379
|
+
if (navigation) {
|
|
1380
|
+
const observer = new MutationObserver(() => {
|
|
1381
|
+
initTooltips();
|
|
1382
|
+
});
|
|
1383
|
+
|
|
1384
|
+
observer.observe(navigation, {
|
|
1385
|
+
childList: true,
|
|
1386
|
+
subtree: true
|
|
1387
|
+
});
|
|
1388
|
+
}
|
|
1359
1389
|
});
|