@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.
Files changed (187) hide show
  1. package/dist/{chunk-6ER3AYJM.js → chunk-25YLMIWU.js} +3 -3
  2. package/dist/{chunk-HO3Q7NXJ.js → chunk-26HAJBSQ.js} +2 -2
  3. package/dist/{chunk-P22HM2MO.cjs → chunk-33FOBAWS.cjs} +18 -18
  4. package/dist/{chunk-P22HM2MO.cjs.map → chunk-33FOBAWS.cjs.map} +1 -1
  5. package/dist/{chunk-N5A4AC2J.cjs → chunk-4EGNYOZA.cjs} +23 -23
  6. package/dist/{chunk-N5A4AC2J.cjs.map → chunk-4EGNYOZA.cjs.map} +1 -1
  7. package/dist/{chunk-A7ES3NZK.cjs → chunk-4WREPWRL.cjs} +3 -3
  8. package/dist/{chunk-A7ES3NZK.cjs.map → chunk-4WREPWRL.cjs.map} +1 -1
  9. package/dist/{chunk-CU6Q2KQT.cjs → chunk-5HNZTPAB.cjs} +12 -12
  10. package/dist/{chunk-CU6Q2KQT.cjs.map → chunk-5HNZTPAB.cjs.map} +1 -1
  11. package/dist/{chunk-MLVF3OXU.cjs → chunk-5JF6H7OJ.cjs} +76 -76
  12. package/dist/{chunk-MLVF3OXU.cjs.map → chunk-5JF6H7OJ.cjs.map} +1 -1
  13. package/dist/{chunk-UXW63WCV.cjs → chunk-64HHDGRN.cjs} +4 -4
  14. package/dist/{chunk-UXW63WCV.cjs.map → chunk-64HHDGRN.cjs.map} +1 -1
  15. package/dist/{chunk-KXLQITOX.cjs → chunk-6YXEZCVG.cjs} +5 -5
  16. package/dist/{chunk-KXLQITOX.cjs.map → chunk-6YXEZCVG.cjs.map} +1 -1
  17. package/dist/{chunk-SST2YI7S.cjs → chunk-6ZOVSD4M.cjs} +14 -14
  18. package/dist/{chunk-SST2YI7S.cjs.map → chunk-6ZOVSD4M.cjs.map} +1 -1
  19. package/dist/{chunk-M5TWHFIN.cjs → chunk-A6TAVIBX.cjs} +42 -42
  20. package/dist/{chunk-M5TWHFIN.cjs.map → chunk-A6TAVIBX.cjs.map} +1 -1
  21. package/dist/{chunk-J76LCSR4.cjs → chunk-BE6TRUKY.cjs} +40 -40
  22. package/dist/{chunk-J76LCSR4.cjs.map → chunk-BE6TRUKY.cjs.map} +1 -1
  23. package/dist/{chunk-Q6RC3YGW.cjs → chunk-DFJ7TWH6.cjs} +3 -3
  24. package/dist/{chunk-Q6RC3YGW.cjs.map → chunk-DFJ7TWH6.cjs.map} +1 -1
  25. package/dist/{chunk-B2GEKAAA.js → chunk-DRNSIK3V.js} +2 -2
  26. package/dist/{chunk-CTTY5EKH.js → chunk-FXVMRZIQ.js} +5 -5
  27. package/dist/{chunk-QZ64JOE2.js → chunk-G3NBTL4I.js} +3246 -2557
  28. package/dist/chunk-G3NBTL4I.js.map +1 -0
  29. package/dist/{chunk-TXV444YV.js → chunk-G7ROZAY5.js} +3 -3
  30. package/dist/{chunk-E56VNTBV.cjs → chunk-IPO24G7U.cjs} +1775 -1086
  31. package/dist/chunk-IPO24G7U.cjs.map +1 -0
  32. package/dist/{chunk-CVCQW7WG.js → chunk-LJWTXODF.js} +3 -3
  33. package/dist/{chunk-P7MSXPGL.js → chunk-NNGQ6ONX.js} +8 -8
  34. package/dist/{chunk-XOKRFZBD.cjs → chunk-QCBBX6DO.cjs} +97 -97
  35. package/dist/{chunk-XOKRFZBD.cjs.map → chunk-QCBBX6DO.cjs.map} +1 -1
  36. package/dist/{chunk-GSONSIWG.js → chunk-R7A7WHXP.js} +60 -35
  37. package/dist/chunk-R7A7WHXP.js.map +1 -0
  38. package/dist/{chunk-L36R3G7Z.js → chunk-RPCY2FAC.js} +6 -6
  39. package/dist/{chunk-QMQQ37RW.js → chunk-RRWWAH37.js} +2 -2
  40. package/dist/{chunk-ODRMPI3Y.js → chunk-SBKX2VSG.js} +2 -2
  41. package/dist/{chunk-KQKU4VXB.cjs → chunk-STHVHAV4.cjs} +82 -57
  42. package/dist/chunk-STHVHAV4.cjs.map +1 -0
  43. package/dist/{chunk-E2IPBWGT.js → chunk-UTEQHK3H.js} +6 -6
  44. package/dist/{chunk-6QRKCVYR.cjs → chunk-V5EYGEX7.cjs} +7 -7
  45. package/dist/{chunk-6QRKCVYR.cjs.map → chunk-V5EYGEX7.cjs.map} +1 -1
  46. package/dist/{chunk-K432ES7N.js → chunk-VJL46NHW.js} +4 -4
  47. package/dist/{chunk-QTO3WYB2.cjs → chunk-VJTD2DGF.cjs} +3 -3
  48. package/dist/{chunk-QTO3WYB2.cjs.map → chunk-VJTD2DGF.cjs.map} +1 -1
  49. package/dist/{chunk-VGLDA77S.js → chunk-VRX6Y6A7.js} +2 -2
  50. package/dist/{chunk-OR67WC32.js → chunk-WBQ3NOH7.js} +2 -2
  51. package/dist/{chunk-UL3WQWTF.js → chunk-Y6TXTBIQ.js} +2 -2
  52. package/dist/{chunk-YAOBDOI5.cjs → chunk-YHRE4JBF.cjs} +32 -32
  53. package/dist/{chunk-YAOBDOI5.cjs.map → chunk-YHRE4JBF.cjs.map} +1 -1
  54. package/dist/components/case-studies/index.cjs +10 -10
  55. package/dist/components/case-studies/index.js +4 -4
  56. package/dist/components/chat/index.cjs +4 -4
  57. package/dist/components/chat/index.js +3 -3
  58. package/dist/components/contact/index.cjs +5 -5
  59. package/dist/components/contact/index.js +4 -4
  60. package/dist/components/docs/index.cjs +7 -7
  61. package/dist/components/docs/index.js +6 -6
  62. package/dist/components/embeds/index.cjs +5 -5
  63. package/dist/components/embeds/index.js +4 -4
  64. package/dist/components/faq/index.cjs +6 -6
  65. package/dist/components/faq/index.js +5 -5
  66. package/dist/components/features/board/aim.d.ts +57 -0
  67. package/dist/components/features/board/aim.d.ts.map +1 -0
  68. package/dist/components/features/board/board-column-header.d.ts.map +1 -1
  69. package/dist/components/features/board/board-column.d.ts +8 -4
  70. package/dist/components/features/board/board-column.d.ts.map +1 -1
  71. package/dist/components/features/board/board.d.ts +15 -4
  72. package/dist/components/features/board/board.d.ts.map +1 -1
  73. package/dist/components/features/board/drop-aim.d.ts +34 -0
  74. package/dist/components/features/board/drop-aim.d.ts.map +1 -0
  75. package/dist/components/features/board/lane-geometry.d.ts +22 -0
  76. package/dist/components/features/board/lane-geometry.d.ts.map +1 -0
  77. package/dist/components/features/board/pending-move.d.ts +77 -0
  78. package/dist/components/features/board/pending-move.d.ts.map +1 -0
  79. package/dist/components/features/board/resolve-drop.d.ts +19 -0
  80. package/dist/components/features/board/resolve-drop.d.ts.map +1 -0
  81. package/dist/components/features/board/ticket-card.d.ts +25 -9
  82. package/dist/components/features/board/ticket-card.d.ts.map +1 -1
  83. package/dist/components/features/board/use-board-collapse.d.ts.map +1 -1
  84. package/dist/components/features/board/use-lane-scroll-anchor.d.ts +27 -0
  85. package/dist/components/features/board/use-lane-scroll-anchor.d.ts.map +1 -0
  86. package/dist/components/features/index.cjs +10 -4
  87. package/dist/components/features/index.cjs.map +1 -1
  88. package/dist/components/features/index.d.ts +1 -0
  89. package/dist/components/features/index.d.ts.map +1 -1
  90. package/dist/components/features/index.js +9 -3
  91. package/dist/components/features/sortable-list/index.d.ts +4 -0
  92. package/dist/components/features/sortable-list/index.d.ts.map +1 -0
  93. package/dist/components/features/sortable-list/slot-geometry.d.ts +57 -0
  94. package/dist/components/features/sortable-list/slot-geometry.d.ts.map +1 -0
  95. package/dist/components/features/sortable-list/sortable-list.d.ts +50 -0
  96. package/dist/components/features/sortable-list/sortable-list.d.ts.map +1 -0
  97. package/dist/components/features/sortable-list/use-sortable-item.d.ts +29 -0
  98. package/dist/components/features/sortable-list/use-sortable-item.d.ts.map +1 -0
  99. package/dist/components/help-center-pages/index.cjs +25 -25
  100. package/dist/components/help-center-pages/index.js +16 -16
  101. package/dist/components/index.cjs +144 -138
  102. package/dist/components/index.cjs.map +1 -1
  103. package/dist/components/index.js +20 -14
  104. package/dist/components/index.js.map +1 -1
  105. package/dist/components/meeting-scheduler/index.cjs +35 -35
  106. package/dist/components/meeting-scheduler/index.js +5 -5
  107. package/dist/components/navigation/index.cjs +4 -4
  108. package/dist/components/navigation/index.js +3 -3
  109. package/dist/components/onboarding-guides/index.cjs +8 -8
  110. package/dist/components/onboarding-guides/index.js +7 -7
  111. package/dist/components/related-content/index.cjs +6 -6
  112. package/dist/components/related-content/index.js +5 -5
  113. package/dist/components/tickets/index.cjs +8 -8
  114. package/dist/components/tickets/index.js +7 -7
  115. package/dist/components/ui/index.cjs +4 -4
  116. package/dist/components/ui/index.js +3 -3
  117. package/dist/components/ui/square-avatar.d.ts.map +1 -1
  118. package/dist/hooks/index.cjs +3 -3
  119. package/dist/hooks/index.js +2 -2
  120. package/dist/index.cjs +10 -4
  121. package/dist/index.cjs.map +1 -1
  122. package/dist/index.js +9 -3
  123. package/dist/nats/index.cjs +2 -2
  124. package/dist/nats/index.js +1 -1
  125. package/dist/nats/nats.d.ts.map +1 -1
  126. package/dist/nats/shared-connection.d.ts +13 -6
  127. package/dist/nats/shared-connection.d.ts.map +1 -1
  128. package/dist/utils/auto-scroll-ancestors.d.ts +43 -0
  129. package/dist/utils/auto-scroll-ancestors.d.ts.map +1 -0
  130. package/dist/utils/drag-effect.d.ts +21 -0
  131. package/dist/utils/drag-effect.d.ts.map +1 -0
  132. package/dist/utils/scroll-parent.d.ts +11 -0
  133. package/dist/utils/scroll-parent.d.ts.map +1 -0
  134. package/package.json +6 -3
  135. package/src/__tests__/board-aim.test.ts +152 -0
  136. package/src/__tests__/board-pending-move.test.ts +113 -0
  137. package/src/__tests__/board-resolve-drop.test.ts +68 -0
  138. package/src/__tests__/sortable-slot-geometry.test.ts +105 -0
  139. package/src/components/features/board/.board-column.md +17 -4
  140. package/src/components/features/board/.board.md +11 -7
  141. package/src/components/features/board/.ticket-card.md +27 -5
  142. package/src/components/features/board/aim.ts +131 -0
  143. package/src/components/features/board/board-column-header.tsx +2 -9
  144. package/src/components/features/board/board-column.tsx +137 -66
  145. package/src/components/features/board/board.tsx +501 -258
  146. package/src/components/features/board/drop-aim.ts +50 -0
  147. package/src/components/features/board/lane-geometry.ts +44 -0
  148. package/src/components/features/board/pending-move.ts +116 -0
  149. package/src/components/features/board/resolve-drop.ts +28 -0
  150. package/src/components/features/board/ticket-card.tsx +256 -47
  151. package/src/components/features/board/use-board-collapse.ts +16 -14
  152. package/src/components/features/board/use-lane-scroll-anchor.ts +79 -0
  153. package/src/components/features/index.ts +1 -0
  154. package/src/components/features/sortable-list/.sortable-list.md +82 -0
  155. package/src/components/features/sortable-list/index.ts +3 -0
  156. package/src/components/features/sortable-list/slot-geometry.ts +100 -0
  157. package/src/components/features/sortable-list/sortable-list.tsx +270 -0
  158. package/src/components/features/sortable-list/use-sortable-item.ts +92 -0
  159. package/src/components/ui/square-avatar.tsx +5 -0
  160. package/src/nats/__tests__/reconnect-lifecycle.test.tsx +814 -0
  161. package/src/nats/nats.ts +56 -13
  162. package/src/nats/shared-connection.ts +132 -36
  163. package/src/stories/.TicketCard.stories.md +6 -12
  164. package/src/stories/Board.stories.tsx +16 -7
  165. package/src/stories/TicketCard.stories.tsx +38 -76
  166. package/src/utils/auto-scroll-ancestors.ts +90 -0
  167. package/src/utils/drag-effect.ts +26 -0
  168. package/src/utils/scroll-parent.ts +23 -0
  169. package/dist/chunk-E56VNTBV.cjs.map +0 -1
  170. package/dist/chunk-GSONSIWG.js.map +0 -1
  171. package/dist/chunk-KQKU4VXB.cjs.map +0 -1
  172. package/dist/chunk-QZ64JOE2.js.map +0 -1
  173. /package/dist/{chunk-6ER3AYJM.js.map → chunk-25YLMIWU.js.map} +0 -0
  174. /package/dist/{chunk-HO3Q7NXJ.js.map → chunk-26HAJBSQ.js.map} +0 -0
  175. /package/dist/{chunk-B2GEKAAA.js.map → chunk-DRNSIK3V.js.map} +0 -0
  176. /package/dist/{chunk-CTTY5EKH.js.map → chunk-FXVMRZIQ.js.map} +0 -0
  177. /package/dist/{chunk-TXV444YV.js.map → chunk-G7ROZAY5.js.map} +0 -0
  178. /package/dist/{chunk-CVCQW7WG.js.map → chunk-LJWTXODF.js.map} +0 -0
  179. /package/dist/{chunk-P7MSXPGL.js.map → chunk-NNGQ6ONX.js.map} +0 -0
  180. /package/dist/{chunk-L36R3G7Z.js.map → chunk-RPCY2FAC.js.map} +0 -0
  181. /package/dist/{chunk-QMQQ37RW.js.map → chunk-RRWWAH37.js.map} +0 -0
  182. /package/dist/{chunk-ODRMPI3Y.js.map → chunk-SBKX2VSG.js.map} +0 -0
  183. /package/dist/{chunk-E2IPBWGT.js.map → chunk-UTEQHK3H.js.map} +0 -0
  184. /package/dist/{chunk-K432ES7N.js.map → chunk-VJL46NHW.js.map} +0 -0
  185. /package/dist/{chunk-VGLDA77S.js.map → chunk-VRX6Y6A7.js.map} +0 -0
  186. /package/dist/{chunk-OR67WC32.js.map → chunk-WBQ3NOH7.js.map} +0 -0
  187. /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]}