pict-docuserve 0.1.3 → 0.1.4

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.
@@ -6327,6 +6327,7 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
6327
6327
  translateY: 0,
6328
6328
  isPanning: false,
6329
6329
  didPan: false,
6330
+ currentKind: '',
6330
6331
  panStartX: 0,
6331
6332
  panStartY: 0,
6332
6333
  panOrigX: 0,
@@ -6422,8 +6423,13 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
6422
6423
  });
6423
6424
  });
6424
6425
 
6425
- // Wheel zoom
6426
+ // Wheel zoom — for images and mermaid diagrams.
6427
+ // For code blocks, let the browser handle native scrolling
6428
+ // so the user can scroll through long code.
6426
6429
  tmpStage.addEventListener('wheel', pEvent => {
6430
+ if (tmpState.currentKind === 'code') {
6431
+ return;
6432
+ }
6427
6433
  pEvent.preventDefault();
6428
6434
  let tmpDelta = -pEvent.deltaY;
6429
6435
  let tmpStep = (tmpDelta > 0 ? 1 : -1) * 0.15;
@@ -6432,8 +6438,11 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
6432
6438
  passive: false
6433
6439
  });
6434
6440
 
6435
- // Drag-to-pan when zoomed
6441
+ // Drag-to-pan when zoomed (not for code blocks — they scroll natively)
6436
6442
  tmpStage.addEventListener('pointerdown', pEvent => {
6443
+ if (tmpState.currentKind === 'code') {
6444
+ return;
6445
+ }
6437
6446
  if (tmpState.scale <= 1.001) {
6438
6447
  return;
6439
6448
  }
@@ -6524,6 +6533,7 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
6524
6533
  tmpTitleEl.textContent = tmpTitle;
6525
6534
  tmpContent.innerHTML = '';
6526
6535
  let tmpKind = pSourceEl.getAttribute('data-fullscreen-source');
6536
+ tmpState.currentKind = tmpKind || '';
6527
6537
  let tmpClone;
6528
6538
  if (tmpKind === 'mermaid') {
6529
6539
  let tmpSvg = pSourceEl.querySelector('svg');
@@ -6546,6 +6556,12 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
6546
6556
  tmpClone.classList.add('pict-fullscreen-codewrap');
6547
6557
  }
6548
6558
  tmpContent.appendChild(tmpClone);
6559
+
6560
+ // Hide zoom controls for code blocks (they scroll natively)
6561
+ let tmpZoomBtns = tmpOverlay.querySelectorAll('[data-action="zoom-in"], [data-action="zoom-out"], [data-action="zoom-reset"]');
6562
+ for (let i = 0; i < tmpZoomBtns.length; i++) {
6563
+ tmpZoomBtns[i].style.display = tmpKind === 'code' ? 'none' : '';
6564
+ }
6549
6565
  fResetTransform();
6550
6566
  tmpOverlay.removeAttribute('hidden');
6551
6567
  document.documentElement.style.overflow = 'hidden';