@knowcode/doc-builder 1.3.11 → 1.3.12

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 CHANGED
@@ -5,6 +5,20 @@ 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.12] - 2025-07-19
9
+
10
+ ### Fixed
11
+ - Fixed tooltip positioning by using `position: fixed` to match original implementation
12
+ - Updated tooltip JavaScript to match simpler original approach
13
+ - Fixed content-inner wrapper already present in HTML generation
14
+ - Improved tooltip initialization with console logging for debugging
15
+
16
+ ### Technical Details
17
+ - Tooltips now use fixed positioning with CSS variables for placement
18
+ - Simplified event handling for tooltip hover events
19
+ - Added debug logging to help diagnose tooltip initialization issues
20
+ - Content structure matches original with proper content-inner wrapper
21
+
8
22
  ## [1.3.11] - 2025-07-19
9
23
 
10
24
  ### Fixed
@@ -690,17 +690,7 @@ pre code {
690
690
  }
691
691
 
692
692
  /* Main Content */
693
- .main-wrapper {
694
- display: flex;
695
- padding-top: calc(var(--header-height) + var(--breadcrumb-height));
696
- min-height: 100vh;
697
- transition: padding-top var(--duration-normal);
698
- }
699
-
700
- /* Adjust layout when banner is visible */
701
- .main-wrapper.banner-visible {
702
- padding-top: calc(var(--header-height) + var(--breadcrumb-height) + 3.5rem);
703
- }
693
+ /* Removed duplicate .main-wrapper - using the one defined earlier */
704
694
 
705
695
  .content {
706
696
  flex: 1;
package/assets/js/main.js CHANGED
@@ -1332,33 +1332,24 @@ function generateBreadcrumbs() {
1332
1332
 
1333
1333
  // Initialize tooltip positioning for navigation items
1334
1334
  function initTooltips() {
1335
- // Use event delegation for better performance and dynamic content support
1336
- const navigation = document.querySelector('.navigation');
1337
- if (!navigation) return;
1335
+ const tooltipElements = document.querySelectorAll('[data-tooltip]');
1336
+ console.log('[Tooltips] Found', tooltipElements.length, 'elements with tooltips');
1338
1337
 
1339
- navigation.addEventListener('mouseenter', function(e) {
1340
- const tooltipElement = e.target.closest('[data-tooltip]');
1341
- if (!tooltipElement) return;
1342
-
1343
- const rect = tooltipElement.getBoundingClientRect();
1344
- const tooltipText = tooltipElement.getAttribute('data-tooltip');
1345
-
1346
- // Position the tooltip using CSS variables
1347
- // Tooltip appears to the right of the element with 10px gap
1348
- const leftPos = rect.right + 10;
1349
- const topPos = rect.top + rect.height / 2;
1350
-
1351
- tooltipElement.style.setProperty('--tooltip-left', `${leftPos}px`);
1352
- tooltipElement.style.setProperty('--tooltip-top', `${topPos}px`);
1353
- }, true); // Use capture phase
1354
-
1355
- navigation.addEventListener('mouseleave', function(e) {
1356
- const tooltipElement = e.target.closest('[data-tooltip]');
1357
- if (!tooltipElement) return;
1338
+ tooltipElements.forEach(element => {
1339
+ element.addEventListener('mouseenter', function(e) {
1340
+ const rect = element.getBoundingClientRect();
1341
+
1342
+ // Position the tooltip using CSS variables
1343
+ element.style.setProperty('--tooltip-left', `${rect.right + 10}px`);
1344
+ element.style.setProperty('--tooltip-top', `${rect.top + rect.height / 2}px`);
1345
+ console.log('[Tooltip] Positioned at:', rect.right + 10, rect.top + rect.height / 2);
1346
+ });
1358
1347
 
1359
- tooltipElement.style.removeProperty('--tooltip-left');
1360
- tooltipElement.style.removeProperty('--tooltip-top');
1361
- }, true); // Use capture phase
1348
+ element.addEventListener('mouseleave', function(e) {
1349
+ element.style.removeProperty('--tooltip-left');
1350
+ element.style.removeProperty('--tooltip-top');
1351
+ });
1352
+ });
1362
1353
  }
1363
1354
 
1364
1355
  // Initialize on DOM Load
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowcode/doc-builder",
3
- "version": "1.3.11",
3
+ "version": "1.3.12",
4
4
  "description": "Reusable documentation builder for markdown-based sites with Vercel deployment support",
5
5
  "main": "index.js",
6
6
  "bin": {