prev-cli 0.7.0 → 0.7.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prev-cli",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Transform MDX directories into beautiful documentation websites",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -69,6 +69,14 @@ function createDiagramControls(container: HTMLElement): void {
69
69
  openFullscreenModal(svg.outerHTML)
70
70
  })
71
71
 
72
+ // Scroll wheel zoom on container
73
+ container.addEventListener('wheel', (e) => {
74
+ e.preventDefault()
75
+ const delta = e.deltaY > 0 ? -0.1 : 0.1
76
+ scale = Math.min(Math.max(scale + delta, minScale), maxScale)
77
+ updateScale()
78
+ })
79
+
72
80
  container.appendChild(controls)
73
81
  }
74
82
 
@@ -165,10 +173,13 @@ function openFullscreenModal(svgHtml: string): void {
165
173
  startX = e.clientX - translateX
166
174
  startY = e.clientY - translateY
167
175
  svgContainer.style.cursor = 'grabbing'
176
+ svgContainer.style.userSelect = 'none'
177
+ e.preventDefault() // Prevent text selection on drag start
168
178
  })
169
179
 
170
180
  document.addEventListener('mousemove', (e) => {
171
181
  if (!isDragging) return
182
+ e.preventDefault()
172
183
  translateX = e.clientX - startX
173
184
  translateY = e.clientY - startY
174
185
  updateTransform()
@@ -176,7 +187,10 @@ function openFullscreenModal(svgHtml: string): void {
176
187
 
177
188
  document.addEventListener('mouseup', () => {
178
189
  isDragging = false
179
- if (svgContainer) svgContainer.style.cursor = 'grab'
190
+ if (svgContainer) {
191
+ svgContainer.style.cursor = 'grab'
192
+ svgContainer.style.userSelect = ''
193
+ }
180
194
  })
181
195
 
182
196
  // Mouse wheel zoom
@@ -349,6 +349,8 @@ body {
349
349
  justify-content: center;
350
350
  cursor: grab;
351
351
  padding: 2rem;
352
+ -webkit-user-select: none;
353
+ user-select: none;
352
354
  }
353
355
 
354
356
  .diagram-modal-svg-container svg {