@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 +77 -76
- package/src/components/PreviewRibbon.vue +22 -5
package/package.json
CHANGED
|
@@ -1,76 +1,77 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@duffcloudservices/cms",
|
|
3
|
-
"version": "0.1.
|
|
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
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"vue",
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
"
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
"
|
|
73
|
-
|
|
74
|
-
|
|
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
|
-
|
|
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 {
|