@duffcloudservices/cms 0.1.4 → 0.1.5

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,76 +1,77 @@
1
- {
2
- "name": "@duffcloudservices/cms",
3
- "version": "0.1.4",
4
- "description": "Vue 3 composables and Vite plugins for DCS CMS integration",
5
- "type": "module",
6
- "exports": {
7
- ".": {
8
- "types": "./dist/index.d.ts",
9
- "import": "./dist/index.js"
10
- },
11
- "./plugins": {
12
- "types": "./dist/plugins/index.d.ts",
13
- "import": "./dist/plugins/index.js"
14
- },
15
- "./editor": {
16
- "types": "./dist/editor/editorBridge.d.ts",
17
- "import": "./dist/editor/editorBridge.js"
18
- },
19
- "./components": {
20
- "import": "./src/components/PreviewRibbon.vue"
21
- }
22
- },
23
- "main": "./dist/index.js",
24
- "types": "./dist/index.d.ts",
25
- "files": [
26
- "dist",
27
- "src/components"
28
- ],
29
- "peerDependencies": {
30
- "vue": "^3.4.0",
31
- "@unhead/vue": "^1.9.0"
32
- },
33
- "dependencies": {
34
- "js-yaml": "^4.1.0"
35
- },
36
- "devDependencies": {
37
- "@types/js-yaml": "^4.0.9",
38
- "@types/node": "^20.11.0",
39
- "@vue/test-utils": "^2.4.0",
40
- "tsup": "^8.0.0",
41
- "typescript": "~5.6.3",
42
- "vite": "^6.3.5",
43
- "vitest": "^3.2.3",
44
- "vue": "^3.5.16",
45
- "@unhead/vue": "^2.0.5"
46
- },
47
- "keywords": [
48
- "vue",
49
- "vitepress",
50
- "cms",
51
- "dcs",
52
- "composables",
53
- "duff-cloud-services"
54
- ],
55
- "author": "Duff Cloud Services",
56
- "license": "MIT",
57
- "repository": {
58
- "type": "git",
59
- "url": "https://github.com/duffn/dcs"
60
- },
61
- "homepage": "https://portal.duffcloudservices.com",
62
- "bugs": {
63
- "url": "https://github.com/duffn/dcs/issues"
64
- },
65
- "engines": {
66
- "node": ">=18.0.0"
67
- },
68
- "scripts": {
69
- "build": "tsup",
70
- "dev": "tsup --watch",
71
- "test": "vitest run",
72
- "test:watch": "vitest",
73
- "type-check": "tsc --noEmit",
74
- "lint": "eslint src --ext .ts"
75
- }
76
- }
1
+ {
2
+ "name": "@duffcloudservices/cms",
3
+ "version": "0.1.5",
4
+ "description": "Vue 3 composables and Vite plugins for DCS CMS integration",
5
+ "type": "module",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./dist/index.d.ts",
9
+ "import": "./dist/index.js"
10
+ },
11
+ "./plugins": {
12
+ "types": "./dist/plugins/index.d.ts",
13
+ "import": "./dist/plugins/index.js"
14
+ },
15
+ "./editor": {
16
+ "types": "./dist/editor/editorBridge.d.ts",
17
+ "import": "./dist/editor/editorBridge.js"
18
+ },
19
+ "./components": {
20
+ "import": "./src/components/PreviewRibbon.vue"
21
+ }
22
+ },
23
+ "main": "./dist/index.js",
24
+ "types": "./dist/index.d.ts",
25
+ "files": [
26
+ "dist",
27
+ "src/components"
28
+ ],
29
+ "scripts": {
30
+ "build": "tsup",
31
+ "dev": "tsup --watch",
32
+ "test": "vitest run",
33
+ "test:watch": "vitest",
34
+ "type-check": "tsc --noEmit",
35
+ "lint": "eslint src --ext .ts",
36
+ "prepublishOnly": "pnpm run build"
37
+ },
38
+ "peerDependencies": {
39
+ "vue": "^3.4.0",
40
+ "@unhead/vue": "^1.9.0"
41
+ },
42
+ "dependencies": {
43
+ "js-yaml": "^4.1.0"
44
+ },
45
+ "devDependencies": {
46
+ "@types/js-yaml": "^4.0.9",
47
+ "@types/node": "^20.11.0",
48
+ "@vue/test-utils": "^2.4.0",
49
+ "tsup": "^8.0.0",
50
+ "typescript": "~5.6.3",
51
+ "vite": "^6.3.5",
52
+ "vitest": "^3.2.3",
53
+ "vue": "^3.5.16",
54
+ "@unhead/vue": "^2.0.5"
55
+ },
56
+ "keywords": [
57
+ "vue",
58
+ "vitepress",
59
+ "cms",
60
+ "dcs",
61
+ "composables",
62
+ "duff-cloud-services"
63
+ ],
64
+ "author": "Duff Cloud Services",
65
+ "license": "MIT",
66
+ "repository": {
67
+ "type": "git",
68
+ "url": "https://github.com/duffn/dcs"
69
+ },
70
+ "homepage": "https://portal.duffcloudservices.com",
71
+ "bugs": {
72
+ "url": "https://github.com/duffn/dcs/issues"
73
+ },
74
+ "engines": {
75
+ "node": ">=18.0.0"
76
+ }
77
+ }
@@ -261,22 +261,27 @@ const bandPath = computed(() => {
261
261
  const ribbonSvgRef = ref<SVGSVGElement | null>(null)
262
262
  let dragState: { startX: number; startY: number } | null = null
263
263
  let springRaf = 0
264
+ let capturedTarget: Element | null = null
264
265
 
265
266
  function onRibbonPointerDown(e: PointerEvent) {
266
- const el = ribbonSvgRef.value
267
- if (!el) return
268
-
269
267
  // Cancel any in-progress spring animation
270
268
  if (springRaf) {
271
269
  cancelAnimationFrame(springRaf)
272
270
  springRaf = 0
273
271
  }
274
272
 
275
- el.setPointerCapture(e.pointerId)
273
+ // Capture the pointer on the element that received the event (the band path).
274
+ // This ensures all subsequent pointer events are delivered to this element,
275
+ // preventing the browser from cancelling the pointer sequence for scrolling.
276
+ const target = e.currentTarget as Element
277
+ target.setPointerCapture(e.pointerId)
278
+ capturedTarget = target
279
+
276
280
  isDragging.value = true
277
281
  dragState = { startX: e.clientX, startY: e.clientY }
278
282
  globalThis.addEventListener('pointermove', onPointerMove)
279
283
  globalThis.addEventListener('pointerup', onPointerUp)
284
+ globalThis.addEventListener('pointercancel', onPointerCancel)
280
285
  }
281
286
 
282
287
  function onPointerMove(e: PointerEvent) {
@@ -285,14 +290,24 @@ function onPointerMove(e: PointerEvent) {
285
290
  stretchY.value = e.clientY - dragState.startY
286
291
  }
287
292
 
288
- function onPointerUp() {
293
+ function onPointerUp(e?: PointerEvent) {
294
+ if (capturedTarget && e) {
295
+ try { capturedTarget.releasePointerCapture(e.pointerId) } catch { /* already released */ }
296
+ }
297
+ capturedTarget = null
289
298
  isDragging.value = false
290
299
  dragState = null
291
300
  globalThis.removeEventListener('pointermove', onPointerMove)
292
301
  globalThis.removeEventListener('pointerup', onPointerUp)
302
+ globalThis.removeEventListener('pointercancel', onPointerCancel)
293
303
  animateSnapBack()
294
304
  }
295
305
 
306
+ /** Handle browser cancelling the pointer (e.g. when native scroll takes over) */
307
+ function onPointerCancel(e: PointerEvent) {
308
+ onPointerUp(e)
309
+ }
310
+
296
311
  /** Spring-physics animation to snap the control point back to default */
297
312
  function animateSnapBack() {
298
313
  const stiffness = 0.12
@@ -331,6 +346,7 @@ onBeforeUnmount(() => {
331
346
  if (springRaf) cancelAnimationFrame(springRaf)
332
347
  globalThis.removeEventListener('pointermove', onPointerMove)
333
348
  globalThis.removeEventListener('pointerup', onPointerUp)
349
+ globalThis.removeEventListener('pointercancel', onPointerCancel)
334
350
  })
335
351
  </script>
336
352
 
@@ -365,6 +381,7 @@ onBeforeUnmount(() => {
365
381
  .dcs-ribbon-band {
366
382
  pointer-events: auto;
367
383
  cursor: grab;
384
+ touch-action: none;
368
385
  }
369
386
 
370
387
  .dcs-ribbon-band--dragging {