@flamingo-stack/openframe-frontend-core 0.0.555 → 0.0.556-snapshot.20260818165639
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/dist/{chunk-6ER3AYJM.js → chunk-25YLMIWU.js} +3 -3
- package/dist/{chunk-HO3Q7NXJ.js → chunk-26HAJBSQ.js} +2 -2
- package/dist/{chunk-P22HM2MO.cjs → chunk-33FOBAWS.cjs} +18 -18
- package/dist/{chunk-P22HM2MO.cjs.map → chunk-33FOBAWS.cjs.map} +1 -1
- package/dist/{chunk-N5A4AC2J.cjs → chunk-4EGNYOZA.cjs} +23 -23
- package/dist/{chunk-N5A4AC2J.cjs.map → chunk-4EGNYOZA.cjs.map} +1 -1
- package/dist/{chunk-A7ES3NZK.cjs → chunk-4WREPWRL.cjs} +3 -3
- package/dist/{chunk-A7ES3NZK.cjs.map → chunk-4WREPWRL.cjs.map} +1 -1
- package/dist/{chunk-CU6Q2KQT.cjs → chunk-5HNZTPAB.cjs} +12 -12
- package/dist/{chunk-CU6Q2KQT.cjs.map → chunk-5HNZTPAB.cjs.map} +1 -1
- package/dist/{chunk-MLVF3OXU.cjs → chunk-5JF6H7OJ.cjs} +76 -76
- package/dist/{chunk-MLVF3OXU.cjs.map → chunk-5JF6H7OJ.cjs.map} +1 -1
- package/dist/{chunk-UXW63WCV.cjs → chunk-64HHDGRN.cjs} +4 -4
- package/dist/{chunk-UXW63WCV.cjs.map → chunk-64HHDGRN.cjs.map} +1 -1
- package/dist/{chunk-KXLQITOX.cjs → chunk-6YXEZCVG.cjs} +5 -5
- package/dist/{chunk-KXLQITOX.cjs.map → chunk-6YXEZCVG.cjs.map} +1 -1
- package/dist/{chunk-SST2YI7S.cjs → chunk-6ZOVSD4M.cjs} +14 -14
- package/dist/{chunk-SST2YI7S.cjs.map → chunk-6ZOVSD4M.cjs.map} +1 -1
- package/dist/{chunk-M5TWHFIN.cjs → chunk-A6TAVIBX.cjs} +42 -42
- package/dist/{chunk-M5TWHFIN.cjs.map → chunk-A6TAVIBX.cjs.map} +1 -1
- package/dist/{chunk-J76LCSR4.cjs → chunk-BE6TRUKY.cjs} +40 -40
- package/dist/{chunk-J76LCSR4.cjs.map → chunk-BE6TRUKY.cjs.map} +1 -1
- package/dist/{chunk-Q6RC3YGW.cjs → chunk-DFJ7TWH6.cjs} +3 -3
- package/dist/{chunk-Q6RC3YGW.cjs.map → chunk-DFJ7TWH6.cjs.map} +1 -1
- package/dist/{chunk-B2GEKAAA.js → chunk-DRNSIK3V.js} +2 -2
- package/dist/{chunk-CTTY5EKH.js → chunk-FXVMRZIQ.js} +5 -5
- package/dist/{chunk-QZ64JOE2.js → chunk-G3NBTL4I.js} +3246 -2557
- package/dist/chunk-G3NBTL4I.js.map +1 -0
- package/dist/{chunk-TXV444YV.js → chunk-G7ROZAY5.js} +3 -3
- package/dist/{chunk-E56VNTBV.cjs → chunk-IPO24G7U.cjs} +1775 -1086
- package/dist/chunk-IPO24G7U.cjs.map +1 -0
- package/dist/{chunk-CVCQW7WG.js → chunk-LJWTXODF.js} +3 -3
- package/dist/{chunk-P7MSXPGL.js → chunk-NNGQ6ONX.js} +8 -8
- package/dist/{chunk-XOKRFZBD.cjs → chunk-QCBBX6DO.cjs} +97 -97
- package/dist/{chunk-XOKRFZBD.cjs.map → chunk-QCBBX6DO.cjs.map} +1 -1
- package/dist/{chunk-GSONSIWG.js → chunk-R7A7WHXP.js} +60 -35
- package/dist/chunk-R7A7WHXP.js.map +1 -0
- package/dist/{chunk-L36R3G7Z.js → chunk-RPCY2FAC.js} +6 -6
- package/dist/{chunk-QMQQ37RW.js → chunk-RRWWAH37.js} +2 -2
- package/dist/{chunk-ODRMPI3Y.js → chunk-SBKX2VSG.js} +2 -2
- package/dist/{chunk-KQKU4VXB.cjs → chunk-STHVHAV4.cjs} +82 -57
- package/dist/chunk-STHVHAV4.cjs.map +1 -0
- package/dist/{chunk-E2IPBWGT.js → chunk-UTEQHK3H.js} +6 -6
- package/dist/{chunk-6QRKCVYR.cjs → chunk-V5EYGEX7.cjs} +7 -7
- package/dist/{chunk-6QRKCVYR.cjs.map → chunk-V5EYGEX7.cjs.map} +1 -1
- package/dist/{chunk-K432ES7N.js → chunk-VJL46NHW.js} +4 -4
- package/dist/{chunk-QTO3WYB2.cjs → chunk-VJTD2DGF.cjs} +3 -3
- package/dist/{chunk-QTO3WYB2.cjs.map → chunk-VJTD2DGF.cjs.map} +1 -1
- package/dist/{chunk-VGLDA77S.js → chunk-VRX6Y6A7.js} +2 -2
- package/dist/{chunk-OR67WC32.js → chunk-WBQ3NOH7.js} +2 -2
- package/dist/{chunk-UL3WQWTF.js → chunk-Y6TXTBIQ.js} +2 -2
- package/dist/{chunk-YAOBDOI5.cjs → chunk-YHRE4JBF.cjs} +32 -32
- package/dist/{chunk-YAOBDOI5.cjs.map → chunk-YHRE4JBF.cjs.map} +1 -1
- package/dist/components/case-studies/index.cjs +10 -10
- package/dist/components/case-studies/index.js +4 -4
- package/dist/components/chat/index.cjs +4 -4
- package/dist/components/chat/index.js +3 -3
- package/dist/components/contact/index.cjs +5 -5
- package/dist/components/contact/index.js +4 -4
- package/dist/components/docs/index.cjs +7 -7
- package/dist/components/docs/index.js +6 -6
- package/dist/components/embeds/index.cjs +5 -5
- package/dist/components/embeds/index.js +4 -4
- package/dist/components/faq/index.cjs +6 -6
- package/dist/components/faq/index.js +5 -5
- package/dist/components/features/board/aim.d.ts +57 -0
- package/dist/components/features/board/aim.d.ts.map +1 -0
- package/dist/components/features/board/board-column-header.d.ts.map +1 -1
- package/dist/components/features/board/board-column.d.ts +8 -4
- package/dist/components/features/board/board-column.d.ts.map +1 -1
- package/dist/components/features/board/board.d.ts +15 -4
- package/dist/components/features/board/board.d.ts.map +1 -1
- package/dist/components/features/board/drop-aim.d.ts +34 -0
- package/dist/components/features/board/drop-aim.d.ts.map +1 -0
- package/dist/components/features/board/lane-geometry.d.ts +22 -0
- package/dist/components/features/board/lane-geometry.d.ts.map +1 -0
- package/dist/components/features/board/pending-move.d.ts +77 -0
- package/dist/components/features/board/pending-move.d.ts.map +1 -0
- package/dist/components/features/board/resolve-drop.d.ts +19 -0
- package/dist/components/features/board/resolve-drop.d.ts.map +1 -0
- package/dist/components/features/board/ticket-card.d.ts +25 -9
- package/dist/components/features/board/ticket-card.d.ts.map +1 -1
- package/dist/components/features/board/use-board-collapse.d.ts.map +1 -1
- package/dist/components/features/board/use-lane-scroll-anchor.d.ts +27 -0
- package/dist/components/features/board/use-lane-scroll-anchor.d.ts.map +1 -0
- package/dist/components/features/index.cjs +10 -4
- package/dist/components/features/index.cjs.map +1 -1
- package/dist/components/features/index.d.ts +1 -0
- package/dist/components/features/index.d.ts.map +1 -1
- package/dist/components/features/index.js +9 -3
- package/dist/components/features/sortable-list/index.d.ts +4 -0
- package/dist/components/features/sortable-list/index.d.ts.map +1 -0
- package/dist/components/features/sortable-list/slot-geometry.d.ts +57 -0
- package/dist/components/features/sortable-list/slot-geometry.d.ts.map +1 -0
- package/dist/components/features/sortable-list/sortable-list.d.ts +50 -0
- package/dist/components/features/sortable-list/sortable-list.d.ts.map +1 -0
- package/dist/components/features/sortable-list/use-sortable-item.d.ts +29 -0
- package/dist/components/features/sortable-list/use-sortable-item.d.ts.map +1 -0
- package/dist/components/help-center-pages/index.cjs +25 -25
- package/dist/components/help-center-pages/index.js +16 -16
- package/dist/components/index.cjs +144 -138
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +20 -14
- package/dist/components/index.js.map +1 -1
- package/dist/components/meeting-scheduler/index.cjs +35 -35
- package/dist/components/meeting-scheduler/index.js +5 -5
- package/dist/components/navigation/index.cjs +4 -4
- package/dist/components/navigation/index.js +3 -3
- package/dist/components/onboarding-guides/index.cjs +8 -8
- package/dist/components/onboarding-guides/index.js +7 -7
- package/dist/components/related-content/index.cjs +6 -6
- package/dist/components/related-content/index.js +5 -5
- package/dist/components/tickets/index.cjs +8 -8
- package/dist/components/tickets/index.js +7 -7
- package/dist/components/ui/index.cjs +4 -4
- package/dist/components/ui/index.js +3 -3
- package/dist/components/ui/square-avatar.d.ts.map +1 -1
- package/dist/hooks/index.cjs +3 -3
- package/dist/hooks/index.js +2 -2
- package/dist/index.cjs +10 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -3
- package/dist/nats/index.cjs +2 -2
- package/dist/nats/index.js +1 -1
- package/dist/nats/nats.d.ts.map +1 -1
- package/dist/nats/shared-connection.d.ts +13 -6
- package/dist/nats/shared-connection.d.ts.map +1 -1
- package/dist/utils/auto-scroll-ancestors.d.ts +43 -0
- package/dist/utils/auto-scroll-ancestors.d.ts.map +1 -0
- package/dist/utils/drag-effect.d.ts +21 -0
- package/dist/utils/drag-effect.d.ts.map +1 -0
- package/dist/utils/scroll-parent.d.ts +11 -0
- package/dist/utils/scroll-parent.d.ts.map +1 -0
- package/package.json +6 -3
- package/src/__tests__/board-aim.test.ts +152 -0
- package/src/__tests__/board-pending-move.test.ts +113 -0
- package/src/__tests__/board-resolve-drop.test.ts +68 -0
- package/src/__tests__/sortable-slot-geometry.test.ts +105 -0
- package/src/components/features/board/.board-column.md +17 -4
- package/src/components/features/board/.board.md +11 -7
- package/src/components/features/board/.ticket-card.md +27 -5
- package/src/components/features/board/aim.ts +131 -0
- package/src/components/features/board/board-column-header.tsx +2 -9
- package/src/components/features/board/board-column.tsx +137 -66
- package/src/components/features/board/board.tsx +501 -258
- package/src/components/features/board/drop-aim.ts +50 -0
- package/src/components/features/board/lane-geometry.ts +44 -0
- package/src/components/features/board/pending-move.ts +116 -0
- package/src/components/features/board/resolve-drop.ts +28 -0
- package/src/components/features/board/ticket-card.tsx +256 -47
- package/src/components/features/board/use-board-collapse.ts +16 -14
- package/src/components/features/board/use-lane-scroll-anchor.ts +79 -0
- package/src/components/features/index.ts +1 -0
- package/src/components/features/sortable-list/.sortable-list.md +82 -0
- package/src/components/features/sortable-list/index.ts +3 -0
- package/src/components/features/sortable-list/slot-geometry.ts +100 -0
- package/src/components/features/sortable-list/sortable-list.tsx +270 -0
- package/src/components/features/sortable-list/use-sortable-item.ts +92 -0
- package/src/components/ui/square-avatar.tsx +5 -0
- package/src/nats/__tests__/reconnect-lifecycle.test.tsx +814 -0
- package/src/nats/nats.ts +56 -13
- package/src/nats/shared-connection.ts +132 -36
- package/src/stories/.TicketCard.stories.md +6 -12
- package/src/stories/Board.stories.tsx +16 -7
- package/src/stories/TicketCard.stories.tsx +38 -76
- package/src/utils/auto-scroll-ancestors.ts +90 -0
- package/src/utils/drag-effect.ts +26 -0
- package/src/utils/scroll-parent.ts +23 -0
- package/dist/chunk-E56VNTBV.cjs.map +0 -1
- package/dist/chunk-GSONSIWG.js.map +0 -1
- package/dist/chunk-KQKU4VXB.cjs.map +0 -1
- package/dist/chunk-QZ64JOE2.js.map +0 -1
- /package/dist/{chunk-6ER3AYJM.js.map → chunk-25YLMIWU.js.map} +0 -0
- /package/dist/{chunk-HO3Q7NXJ.js.map → chunk-26HAJBSQ.js.map} +0 -0
- /package/dist/{chunk-B2GEKAAA.js.map → chunk-DRNSIK3V.js.map} +0 -0
- /package/dist/{chunk-CTTY5EKH.js.map → chunk-FXVMRZIQ.js.map} +0 -0
- /package/dist/{chunk-TXV444YV.js.map → chunk-G7ROZAY5.js.map} +0 -0
- /package/dist/{chunk-CVCQW7WG.js.map → chunk-LJWTXODF.js.map} +0 -0
- /package/dist/{chunk-P7MSXPGL.js.map → chunk-NNGQ6ONX.js.map} +0 -0
- /package/dist/{chunk-L36R3G7Z.js.map → chunk-RPCY2FAC.js.map} +0 -0
- /package/dist/{chunk-QMQQ37RW.js.map → chunk-RRWWAH37.js.map} +0 -0
- /package/dist/{chunk-ODRMPI3Y.js.map → chunk-SBKX2VSG.js.map} +0 -0
- /package/dist/{chunk-E2IPBWGT.js.map → chunk-UTEQHK3H.js.map} +0 -0
- /package/dist/{chunk-K432ES7N.js.map → chunk-VJL46NHW.js.map} +0 -0
- /package/dist/{chunk-VGLDA77S.js.map → chunk-VRX6Y6A7.js.map} +0 -0
- /package/dist/{chunk-OR67WC32.js.map → chunk-WBQ3NOH7.js.map} +0 -0
- /package/dist/{chunk-UL3WQWTF.js.map → chunk-Y6TXTBIQ.js.map} +0 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine'
|
|
4
|
+
import { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter'
|
|
5
|
+
import { disableNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/disable-native-drag-preview'
|
|
6
|
+
import { type KeyboardEvent, useCallback, useEffect, useState } from 'react'
|
|
7
|
+
import { holdMoveDragEffect } from '../../../utils/drag-effect'
|
|
8
|
+
import { SORTABLE_ITEM_ATTRIBUTE, useSortableListContext } from './sortable-list'
|
|
9
|
+
|
|
10
|
+
export interface SortableItem {
|
|
11
|
+
/** Goes on the item's root element — the thing that moves. */
|
|
12
|
+
itemRef: (node: HTMLElement | null) => void
|
|
13
|
+
/**
|
|
14
|
+
* Goes on the grip. Only the grip starts a drag, so text selection and normal
|
|
15
|
+
* clicking inside the item keep working, and it carries the keyboard
|
|
16
|
+
* alternative — so spread it rather than picking it apart.
|
|
17
|
+
*/
|
|
18
|
+
dragHandleProps: {
|
|
19
|
+
// Callback refs, not `Ref<HTMLElement>`: a ref OBJECT of the wider type
|
|
20
|
+
// cannot be attached to a `<button>` or a `<div>`, a callback taking the
|
|
21
|
+
// wider type can.
|
|
22
|
+
ref: (node: HTMLElement | null) => void
|
|
23
|
+
onKeyDown: (event: KeyboardEvent<HTMLElement>) => void
|
|
24
|
+
}
|
|
25
|
+
isDragging: boolean
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Registers one item of a {@link SortableList}.
|
|
30
|
+
*
|
|
31
|
+
* The item's own element is the draggable, and the list finds it by the marker
|
|
32
|
+
* this hook sets — so nothing about a row's identity has to survive a round trip
|
|
33
|
+
* through the DOM, and there is no per-item id to mismatch during hydration.
|
|
34
|
+
*
|
|
35
|
+
* Pragmatic drag and drop deliberately ships no keyboard dragging, so the grip
|
|
36
|
+
* carries its own: Arrow Up / Arrow Down move the item one place. One press, one
|
|
37
|
+
* move — no lift-and-place mode to get stuck in, and it works identically for
|
|
38
|
+
* screen-reader users, who hear the result from the list's live region.
|
|
39
|
+
*/
|
|
40
|
+
export function useSortableItem(): SortableItem {
|
|
41
|
+
const { dragType, disabled, reorder, readItems } = useSortableListContext()
|
|
42
|
+
// State rather than refs: registration has to wait until the consumer has
|
|
43
|
+
// actually rendered its grip, and only a re-render tells us it did.
|
|
44
|
+
const [item, setItem] = useState<HTMLElement | null>(null)
|
|
45
|
+
const [handle, setHandle] = useState<HTMLElement | null>(null)
|
|
46
|
+
const [isDragging, setIsDragging] = useState(false)
|
|
47
|
+
|
|
48
|
+
const itemRef = useCallback((node: HTMLElement | null) => {
|
|
49
|
+
// Set here rather than rendered as a prop: it is this module's private
|
|
50
|
+
// bookkeeping, and a consumer forgetting to spread it would break the list
|
|
51
|
+
// silently.
|
|
52
|
+
node?.setAttribute(SORTABLE_ITEM_ATTRIBUTE, '')
|
|
53
|
+
setItem(node)
|
|
54
|
+
}, [])
|
|
55
|
+
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
if (!item || !handle || disabled) return
|
|
58
|
+
return combine(
|
|
59
|
+
// The drag has to start as a "move", or its first frame is drawn with the
|
|
60
|
+
// copy cursor — see `drag-effect.ts`.
|
|
61
|
+
holdMoveDragEffect(item),
|
|
62
|
+
draggable({
|
|
63
|
+
element: item,
|
|
64
|
+
dragHandle: handle,
|
|
65
|
+
getInitialData: () => ({ type: dragType }),
|
|
66
|
+
// The list moves the real item instead — see `SortableList`.
|
|
67
|
+
onGenerateDragPreview: ({ nativeSetDragImage }) => disableNativeDragPreview({ nativeSetDragImage }),
|
|
68
|
+
onDragStart: () => setIsDragging(true),
|
|
69
|
+
onDrop: () => setIsDragging(false),
|
|
70
|
+
}),
|
|
71
|
+
)
|
|
72
|
+
}, [item, handle, disabled, dragType])
|
|
73
|
+
|
|
74
|
+
const onKeyDown = useCallback(
|
|
75
|
+
(event: KeyboardEvent<HTMLElement>) => {
|
|
76
|
+
const step = event.key === 'ArrowUp' ? -1 : event.key === 'ArrowDown' ? 1 : 0
|
|
77
|
+
if (!step || disabled) return
|
|
78
|
+
const items = readItems()
|
|
79
|
+
const from = items.indexOf(event.currentTarget.closest(`[${SORTABLE_ITEM_ATTRIBUTE}]`) as HTMLElement)
|
|
80
|
+
const to = from + step
|
|
81
|
+
if (from < 0 || to < 0 || to >= items.length) return
|
|
82
|
+
event.preventDefault()
|
|
83
|
+
reorder(from, to)
|
|
84
|
+
// The grip is re-rendered at its new position; keep the focus on it so a
|
|
85
|
+
// run of presses keeps moving the same item.
|
|
86
|
+
requestAnimationFrame(() => handle?.focus())
|
|
87
|
+
},
|
|
88
|
+
[disabled, readItems, reorder, handle],
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
return { itemRef, dragHandleProps: { ref: setHandle, onKeyDown }, isDragging }
|
|
92
|
+
}
|
|
@@ -80,6 +80,11 @@ const SquareAvatar = React.memo(React.forwardRef<HTMLDivElement, SquareAvatarPro
|
|
|
80
80
|
{resolvedSrc && (
|
|
81
81
|
<Image
|
|
82
82
|
className="absolute -inset-px h-[calc(100%+2px)] w-[calc(100%+2px)] max-w-none object-cover"
|
|
83
|
+
// Images are draggable by default, and a draggable child WINS over a
|
|
84
|
+
// draggable ancestor: an avatar inside a drag-and-drop card lets the
|
|
85
|
+
// browser start its own "drag this picture" instead of the card's
|
|
86
|
+
// drag, so grabbing a card by its assignee did nothing.
|
|
87
|
+
draggable={false}
|
|
83
88
|
src={resolvedSrc}
|
|
84
89
|
alt={alt || ''}
|
|
85
90
|
width={sizePx ?? sizePxBySize[size]}
|