@santi020k/lumen-astro 1.4.0 → 1.6.0
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 +6 -6
- package/runtime/UIPrimitives.astro +19 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@santi020k/lumen-astro",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -37,14 +37,14 @@
|
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"uqr": "^0.1.3",
|
|
40
|
-
"@santi020k/lumen": "^1.4.0",
|
|
41
|
-
"@santi020k/lumen
|
|
40
|
+
"@santi020k/lumen-core": "^1.4.0",
|
|
41
|
+
"@santi020k/lumen": "^1.6.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@astrojs/ts-plugin": "^1.10.
|
|
45
|
-
"astro": "^7.2.
|
|
44
|
+
"@astrojs/ts-plugin": "^1.10.11",
|
|
45
|
+
"astro": "^7.2.6",
|
|
46
46
|
"typescript": "^6.0.3",
|
|
47
|
-
"vitest": "^4.1.
|
|
47
|
+
"vitest": "^4.1.11"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"astro": ">=5"
|
|
@@ -3375,13 +3375,13 @@ const kanbanColumnSelector = '[data-ui-kanban-column]'
|
|
|
3375
3375
|
|
|
3376
3376
|
const initKanbanBoards = (scope: ParentNode): void => {
|
|
3377
3377
|
for (const root of scope.querySelectorAll<HTMLElement>('[data-ui-kanban]')) {
|
|
3378
|
+
for (const handle of root.querySelectorAll<HTMLElement>('[data-ui-kanban-handle]'))
|
|
3379
|
+
handle.draggable = true
|
|
3380
|
+
|
|
3378
3381
|
if (root.dataset.uiKanbanBound === 'true') continue
|
|
3379
3382
|
|
|
3380
3383
|
root.dataset.uiKanbanBound = 'true'
|
|
3381
3384
|
|
|
3382
|
-
for (const handle of root.querySelectorAll<HTMLElement>('[data-ui-kanban-handle]'))
|
|
3383
|
-
handle.draggable = true
|
|
3384
|
-
|
|
3385
3385
|
let pointer: {
|
|
3386
3386
|
active: boolean
|
|
3387
3387
|
handle: HTMLElement
|
|
@@ -3391,13 +3391,21 @@ const initKanbanBoards = (scope: ParentNode): void => {
|
|
|
3391
3391
|
startY: number
|
|
3392
3392
|
} | undefined
|
|
3393
3393
|
|
|
3394
|
-
const itemFor = (target: EventTarget | null): HTMLElement | null =>
|
|
3395
|
-
|
|
3396
|
-
|
|
3394
|
+
const itemFor = (target: EventTarget | null): HTMLElement | null => {
|
|
3395
|
+
const item = target instanceof Element ?
|
|
3396
|
+
target.closest<HTMLElement>('[data-ui-kanban-item]') :
|
|
3397
|
+
null
|
|
3398
|
+
|
|
3399
|
+
return item?.closest<HTMLElement>('[data-ui-kanban]') === root ? item : null
|
|
3400
|
+
}
|
|
3397
3401
|
|
|
3398
|
-
const columnFor = (target: EventTarget | null): HTMLElement | null =>
|
|
3399
|
-
target
|
|
3400
|
-
|
|
3402
|
+
const columnFor = (target: EventTarget | null): HTMLElement | null => {
|
|
3403
|
+
const column = target instanceof Element ?
|
|
3404
|
+
target.closest<HTMLElement>(kanbanColumnSelector) :
|
|
3405
|
+
null
|
|
3406
|
+
|
|
3407
|
+
return column?.closest<HTMLElement>('[data-ui-kanban]') === root ? column : null
|
|
3408
|
+
}
|
|
3401
3409
|
|
|
3402
3410
|
const clearState = (): void => {
|
|
3403
3411
|
pointer = undefined
|
|
@@ -3580,8 +3588,7 @@ const initKanbanBoards = (scope: ParentNode): void => {
|
|
|
3580
3588
|
|
|
3581
3589
|
pointer.item.dataset.state = 'dragging'
|
|
3582
3590
|
|
|
3583
|
-
const target = document.elementFromPoint(event.clientX, event.clientY)
|
|
3584
|
-
?.closest<HTMLElement>(kanbanColumnSelector)
|
|
3591
|
+
const target = columnFor(document.elementFromPoint(event.clientX, event.clientY))
|
|
3585
3592
|
|
|
3586
3593
|
for (const column of root.querySelectorAll<HTMLElement>(kanbanColumnSelector)) {
|
|
3587
3594
|
if (column === target) column.dataset.state = 'drop-target'
|
|
@@ -3592,8 +3599,7 @@ const initKanbanBoards = (scope: ParentNode): void => {
|
|
|
3592
3599
|
root.addEventListener('pointerup', event => {
|
|
3593
3600
|
if (!pointer || pointer.pointerId !== event.pointerId) return
|
|
3594
3601
|
|
|
3595
|
-
const target = document.elementFromPoint(event.clientX, event.clientY)
|
|
3596
|
-
?.closest<HTMLElement>(kanbanColumnSelector)
|
|
3602
|
+
const target = columnFor(document.elementFromPoint(event.clientX, event.clientY))
|
|
3597
3603
|
|
|
3598
3604
|
if (pointer.active && target) requestMove(pointer.item, target, 'pointer')
|
|
3599
3605
|
|