@botiverse/raft-ui 0.16.0 → 0.17.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/CHANGELOG.md +21 -0
- package/dist/index.d.mts +5 -1
- package/dist/index.mjs +11 -19
- package/dist/{message-list-03unCFnE.mjs → touch-drag-CbWqiMlZ.mjs} +96 -1
- package/dist/wip.d.mts +19 -2
- package/dist/wip.mjs +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
## [0.17.0](https://github.com/botiverse/raft-design/compare/v0.16.0...v0.17.0) (2026-10-21)
|
|
2
|
+
|
|
3
|
+
### Design System
|
|
4
|
+
|
|
5
|
+
- **Dragging on a touch screen**: on an item that can be moved, holding still opens its menu and holding then moving drags it. The item arms after 500ms, the same moment raft-ui's long-press menu opens, and the drag starts on the first 10px of movement; moving earlier is a scroll, and a second finger cancels. The component that owns the item's menu closes it when the drag starts. ([#662](https://github.com/botiverse/raft-design/pull/662))
|
|
6
|
+
- Why: on a phone, a long press on a draggable item opened its context menu first, and a scroll that started on a tab, task card or attachment picked the item up instead.
|
|
7
|
+
- Affects: touch drag hold 0ms (tabs, cards and attachments picked up at once) → 500ms, then 10px; held items get `select-none`, `-webkit-touch-callout: none` and `touch-manipulation`. Mouse and pen still start a drag after 5–6px, with no hold.
|
|
8
|
+
- Docs: https://raft-design.botiverse.build/foundations/states/#dragging-on-a-touch-screen
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **SortableTabsList** `onDragStart`: called when a tab drag starts, so an app that puts its own menu on a tab can close it. ([#662](https://github.com/botiverse/raft-design/pull/662))
|
|
13
|
+
- Why: the component that owns an item's menu closes it when the item's drag starts.
|
|
14
|
+
- Docs: https://raft-design.botiverse.build/components/tabs/
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- **SortableTabsList, task drag-and-drop and SortableComposerAttachments**: on a touch screen a finger no longer starts a drag at once; it has to hold still for 500ms and then move. Scrolling that starts on a card or an attachment scrolls again. ([#662](https://github.com/botiverse/raft-design/pull/662))
|
|
19
|
+
- Why: the pointer sensor took every touch before the touch sensor could, and `touch-none` stopped the page from scrolling.
|
|
20
|
+
- Docs: https://raft-design.botiverse.build/foundations/states/#dragging-on-a-touch-screen
|
|
21
|
+
|
|
1
22
|
## [0.16.0](https://github.com/botiverse/raft-design/compare/v0.15.0...v0.16.0) (2026-10-21)
|
|
2
23
|
|
|
3
24
|
### Breaking Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -3890,8 +3890,12 @@ export declare function TabsList({ className, children, variant, ref, ...props }
|
|
|
3890
3890
|
type SortableTabsListProps<T extends string = string> = TabsListProps & {
|
|
3891
3891
|
value: readonly T[];
|
|
3892
3892
|
onReorder: (value: T[]) => void;
|
|
3893
|
+
/** A tab was picked up. On a touch screen the long press that armed it may
|
|
3894
|
+
* have opened a menu the caller owns: close it here (DS › States ›
|
|
3895
|
+
* Dragging on a touch screen). */
|
|
3896
|
+
onDragStart?: (value: T) => void;
|
|
3893
3897
|
};
|
|
3894
|
-
export declare function SortableTabsList<T extends string = string>({ value, onReorder, children, variant, ...props }: SortableTabsListProps<T>): import("react").JSX.Element;
|
|
3898
|
+
export declare function SortableTabsList<T extends string = string>({ value, onReorder, onDragStart, children, variant, ...props }: SortableTabsListProps<T>): import("react").JSX.Element;
|
|
3895
3899
|
type TabsTabProps<T extends string = string> = StyledProps<Tabs$1.Tab.Props> & {
|
|
3896
3900
|
value: T;
|
|
3897
3901
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cn } from "./cn.mjs";
|
|
2
|
-
import { $ as
|
|
2
|
+
import { $ as MessageReactionTooltipMeta, $n as ThemeStateContext, $t as DropdownMenuRadioItem, A as messageEmbed, An as Badge, At as MessageItemContinuationTime, B as MessageReferencePending, Bn as DialogPortal, Bt as useOverflowTitle, C as MessageQuotedPreviewThread, Cn as CheckboxIndicator, Ct as MessageItemBody, D as MessageEmbedContent, Dn as TooltipPortal, Dt as MessageItemFooter, E as MessageEmbed, En as TooltipContent, Et as MessageItemEmbedded, F as MessageMultiSelectCheckbox, Fn as DialogDescription, Ft as AvatarBadge, G as MessageReactionCount, Gn as buttonVariants, Gt as DropdownMenuFooter, H as MessageReferenceUnavailable, Hn as DialogTitle, Ht as DropdownMenuCheckboxItem, I as MessageMultiSelectToolbar, In as DialogFooter, It as AvatarFallback, J as MessageReactionPickerContent, Jn as useParentOverlayKind, Jt as DropdownMenuItemLabel, K as MessageReactionErrorIndicator, Kn as Spinner, Kt as DropdownMenuItem, L as MessageReferenceChip, Ln as DialogHeader, Lt as AvatarGroup, M as MessageTextSelectionToolbarButton, Mn as DialogBody, Mt as MessageItem, N as MessageTextSelectionToolbarSeparator, Nn as DialogClose, Nt as searchHit, O as MessageEmbedFooter, On as TooltipProvider, Ot as MessageItemSearchMatch, P as MessageMultiSelect, Pn as DialogContent, Pt as Avatar, Q as MessageReactionTooltipContent, Qn as useTheme, Qt as DropdownMenuRadioGroup, R as MessageReferenceIndicator, Rn as DialogNav, Rt as AvatarGroupCount, S as MessageQuotedPreviewText, Sn as Checkbox, St as MessageItemAttachments, T as MessageQuotedPreviewUnavailable, Tn as Tooltip, Tt as MessageItemEdited, U as MessageReactionAddButton, Un as DialogTrigger, Ut as DropdownMenuCheckboxItemIndicator, V as MessageReferenceText, Vn as DialogSurface, Vt as DropdownMenu, W as MessageReactionChip, Wn as Button, Wt as DropdownMenuContent, X as MessageReactionQuickButton, Xn as resolveThemeScopeProps, Xt as DropdownMenuPopup, Y as MessageReactionPickerStatic, Yn as withOverlayLayer, Yt as DropdownMenuLabel, Z as MessageReactionQuickRow, Zn as useThemeScopeProps, Zt as DropdownMenuPortal, _ as MessageQuotedPreviewAuthorName, _n as ScrollAreaCorner, _t as MessageItemSender, an as DropdownMenuTrigger, at as MessageItemBadgeSeparator, b as MessageQuotedPreviewHeader, bn as ScrollAreaViewport, bt as MessageItemSenderGroup, c as MessageListHistoryLimited, cn as Panel, ct as MessageItemToolbar, d as MessageQuotedPreview, dn as PanelHeaderRoot, en as DropdownMenuRadioItemIndicator, er as tv, et as MessageReactionTooltipName, f as MessageQuotedPreviewAttachment, fn as PanelScrollContent, g as MessageQuotedPreviewAuthorMeta, gn as ScrollAreaContent, gt as MessageItemMeta, hn as ScrollArea, ht as MessageItemInlineStatus, in as DropdownMenuSubmenuTrigger, it as MessageItemBadge, j as MessageTextSelectionToolbar, jn as Dialog, jt as MessageItemGutter, k as MessageEmbedHeader, kn as TooltipTrigger, kt as MessageItemAvatarSlot, l as MessageListNotice, ln as PanelBody, lt as MessageItemToolbarButton, m as MessageQuotedPreviewAuthor, mn as PanelSection, mt as MessageItemHeader, n as useMouseOnlyPointerSensor, nn as DropdownMenuShortcut, nr as headEdgePull, nt as MessageReactionTooltipNames, on as Kbd, ot as MessageItemReadReceipt, p as MessageQuotedPreviewAttachments, pn as PanelScrollViewport, q as MessageReactionGlyph, qn as defaultNativeButton, qt as DropdownMenuItemCount, rn as DropdownMenuSubmenu, rr as headEdges, rt as MessageReactionTooltipSeparator, s as MessageListDateDivider, sn as KbdGroup, st as MessageItemSavedIndicator, t as useHoldThenMoveTouchSensor, tn as DropdownMenuSeparator, tr as controlIconInset, tt as MessageReactionTooltipNameText, u as MessageList, un as PanelFooter, v as MessageQuotedPreviewChannel, vn as ScrollAreaScrollbar, vt as MessageItemSenderBadges, w as MessageQuotedPreviewTimestamp, wn as PRESENCE_COLOR, wt as MessageItemContent, x as MessageQuotedPreviewLoading, xn as useMobileViewport, xt as MessageItemTime, y as MessageQuotedPreviewContent, yn as ScrollAreaThumb, yt as MessageItemSenderButton, z as MessageReferenceLabel, zn as DialogOverlay, zt as AvatarImage } from "./touch-drag-CbWqiMlZ.mjs";
|
|
3
3
|
import { Dialog as Dialog$1 } from "@base-ui/react/dialog";
|
|
4
4
|
import { AlertTriangle, Bell, Check, CheckCircle2, ChevronDown, ChevronLeft, ChevronRight, Copy, FileText, Image, Info, Upload, X, Zap } from "lucide-react";
|
|
5
5
|
import { Children, cloneElement, createContext, createElement, isValidElement, use, useCallback, useContext, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
@@ -23,7 +23,7 @@ import { Switch as Switch$1 } from "@base-ui/react/switch";
|
|
|
23
23
|
import { Toggle } from "@base-ui/react/toggle";
|
|
24
24
|
import { ToggleGroup as ToggleGroup$1 } from "@base-ui/react/toggle-group";
|
|
25
25
|
import { Progress as Progress$1 } from "@base-ui/react/progress";
|
|
26
|
-
import { DndContext, DragOverlay, KeyboardCode, KeyboardSensor,
|
|
26
|
+
import { DndContext, DragOverlay, KeyboardCode, KeyboardSensor, closestCenter, closestCorners, getFirstCollision, pointerWithin, useDraggable, useDroppable, useSensor, useSensors } from "@dnd-kit/core";
|
|
27
27
|
import { SortableContext, arrayMove, defaultAnimateLayoutChanges, horizontalListSortingStrategy, sortableKeyboardCoordinates, useSortable, verticalListSortingStrategy } from "@dnd-kit/sortable";
|
|
28
28
|
import { CSS } from "@dnd-kit/utilities";
|
|
29
29
|
import { Toast } from "@base-ui/react/toast";
|
|
@@ -9065,10 +9065,7 @@ function SortableComposerAttachmentsRoot({ items, onReorder, children, axis, str
|
|
|
9065
9065
|
const [listMinHeight, setListMinHeight] = useState();
|
|
9066
9066
|
const draftIdsRef = useRef([]);
|
|
9067
9067
|
const lastReorderPointerRef = useRef(null);
|
|
9068
|
-
const sensors = useSensors(
|
|
9069
|
-
delay: 350,
|
|
9070
|
-
tolerance: 8
|
|
9071
|
-
} }), useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates }));
|
|
9068
|
+
const sensors = useSensors(useMouseOnlyPointerSensor(6), useHoldThenMoveTouchSensor(), useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates }));
|
|
9072
9069
|
const attachments = useMemo(() => attachmentsById(children), [children]);
|
|
9073
9070
|
const itemIds = useMemo(() => items.map(String), [items]);
|
|
9074
9071
|
const horizontal = axis === "x";
|
|
@@ -9189,7 +9186,7 @@ function SortableComposerAttachment({ id, label, children }) {
|
|
|
9189
9186
|
return /* @__PURE__ */ jsx("div", {
|
|
9190
9187
|
ref: setNodeRef,
|
|
9191
9188
|
"aria-label": `Reorder ${label}`,
|
|
9192
|
-
className: "w-max max-w-full shrink-0 cursor-grab touch-none active:cursor-grabbing",
|
|
9189
|
+
className: "w-max max-w-full shrink-0 cursor-grab touch-manipulation select-none [-webkit-touch-callout:none] active:cursor-grabbing",
|
|
9193
9190
|
"data-dragging": isDragging ? "true" : void 0,
|
|
9194
9191
|
"data-slot": "sortable-composer-attachment",
|
|
9195
9192
|
style,
|
|
@@ -10735,7 +10732,7 @@ const tabs = tv({
|
|
|
10735
10732
|
],
|
|
10736
10733
|
background: ["", "hidden"],
|
|
10737
10734
|
tab: [
|
|
10738
|
-
"relative z-10 flex shrink-0 cursor-pointer touch-manipulation items-center gap-1.5 whitespace-nowrap outline-none",
|
|
10735
|
+
"relative z-10 flex shrink-0 cursor-pointer touch-manipulation select-none [-webkit-touch-callout:none] items-center gap-1.5 whitespace-nowrap outline-none",
|
|
10739
10736
|
"data-[reorderable=true]:cursor-pointer data-[dragging-source=true]:cursor-grabbing",
|
|
10740
10737
|
"font-sans text-callout font-semibold text-foreground-muted",
|
|
10741
10738
|
"transition-[background-color,box-shadow,color] duration-100 ease-out",
|
|
@@ -10949,14 +10946,11 @@ function TabsList({ className, children, variant = "default", ref, ...props }) {
|
|
|
10949
10946
|
})
|
|
10950
10947
|
});
|
|
10951
10948
|
}
|
|
10952
|
-
function SortableTabsList({ value, onReorder, children, variant = "default", ...props }) {
|
|
10949
|
+
function SortableTabsList({ value, onReorder, onDragStart, children, variant = "default", ...props }) {
|
|
10953
10950
|
const [activeId, setActiveId] = useState(void 0);
|
|
10954
10951
|
const placement = use(TabsPlacementContext);
|
|
10955
10952
|
const dndContextId = useId();
|
|
10956
|
-
const sensors = useSensors(
|
|
10957
|
-
delay: 350,
|
|
10958
|
-
tolerance: 8
|
|
10959
|
-
} }));
|
|
10953
|
+
const sensors = useSensors(useMouseOnlyPointerSensor(6), useHoldThenMoveTouchSensor());
|
|
10960
10954
|
const tabIds = useMemo(() => value.map(String), [value]);
|
|
10961
10955
|
const reorderContext = useMemo(() => ({
|
|
10962
10956
|
enabled: true,
|
|
@@ -10964,7 +10958,8 @@ function SortableTabsList({ value, onReorder, children, variant = "default", ...
|
|
|
10964
10958
|
}), [activeId]);
|
|
10965
10959
|
const handleDragStart = useCallback(({ active }) => {
|
|
10966
10960
|
setActiveId(String(active.id));
|
|
10967
|
-
|
|
10961
|
+
onDragStart?.(String(active.id));
|
|
10962
|
+
}, [onDragStart]);
|
|
10968
10963
|
const handleDragCancel = useCallback(() => {
|
|
10969
10964
|
setActiveId(void 0);
|
|
10970
10965
|
}, []);
|
|
@@ -12505,7 +12500,7 @@ function TaskCardStatus({ busy = false, status, className, render, children, ...
|
|
|
12505
12500
|
//#region src/components/task-dnd/task-dnd.recipe.ts
|
|
12506
12501
|
const taskDnd = tv({ slots: {
|
|
12507
12502
|
draggable: [
|
|
12508
|
-
"group/task-draggable relative cursor-grab touch-none active:cursor-grabbing",
|
|
12503
|
+
"group/task-draggable relative cursor-grab touch-manipulation select-none [-webkit-touch-callout:none] active:cursor-grabbing",
|
|
12509
12504
|
"outline-none",
|
|
12510
12505
|
"data-[dragging=true]:z-20 data-[dragging=true]:will-change-transform",
|
|
12511
12506
|
"data-[disabled=true]:cursor-default data-[disabled=true]:touch-auto",
|
|
@@ -12541,10 +12536,7 @@ function TaskDndProvider({ children, accessibility, disabled = false, isDropAllo
|
|
|
12541
12536
|
const [activeId, setActiveId] = useState(null);
|
|
12542
12537
|
const [activeHeight, setActiveHeight] = useState(null);
|
|
12543
12538
|
const [overStore] = useState(createTaskDndOverStore);
|
|
12544
|
-
const sensors = useSensors(
|
|
12545
|
-
delay: 200,
|
|
12546
|
-
tolerance: 5
|
|
12547
|
-
} }), useSensor(KeyboardSensor, { coordinateGetter: taskKeyboardCoordinates }));
|
|
12539
|
+
const sensors = useSensors(useMouseOnlyPointerSensor(5), useHoldThenMoveTouchSensor(), useSensor(KeyboardSensor, { coordinateGetter: taskKeyboardCoordinates }));
|
|
12548
12540
|
const context = useMemo(() => ({
|
|
12549
12541
|
activeId,
|
|
12550
12542
|
activeHeight,
|
|
@@ -14,6 +14,7 @@ import { Avatar } from "@base-ui/react";
|
|
|
14
14
|
import { Menu } from "@base-ui/react/menu";
|
|
15
15
|
import { Toggle } from "@base-ui/react/toggle";
|
|
16
16
|
import { Toolbar } from "@base-ui/react/toolbar";
|
|
17
|
+
import { PointerSensor, TouchSensor, useSensor } from "@dnd-kit/core";
|
|
17
18
|
//#region src/lib/head-edges.ts
|
|
18
19
|
/**
|
|
19
20
|
* The ends of a header (design/foundations/alignment.md#the-ends-of-a-header).
|
|
@@ -3287,5 +3288,99 @@ function MessageListJumpPillDismiss({ className, children, render, nativeButton,
|
|
|
3287
3288
|
})
|
|
3288
3289
|
});
|
|
3289
3290
|
}
|
|
3291
|
+
const holds = /* @__PURE__ */ new WeakMap();
|
|
3292
|
+
function touchPoint(event) {
|
|
3293
|
+
const touch = event.touches?.[0] ?? event.changedTouches?.[0];
|
|
3294
|
+
return touch ? {
|
|
3295
|
+
x: touch.clientX,
|
|
3296
|
+
y: touch.clientY
|
|
3297
|
+
} : null;
|
|
3298
|
+
}
|
|
3299
|
+
function farther(from, to, limit) {
|
|
3300
|
+
return Math.hypot(to.x - from.x, to.y - from.y) > limit;
|
|
3301
|
+
}
|
|
3302
|
+
var HoldThenMoveTouchSensorImpl = class extends TouchSensor {
|
|
3303
|
+
static activators = TouchSensor.activators;
|
|
3304
|
+
static setup() {
|
|
3305
|
+
return TouchSensor.setup();
|
|
3306
|
+
}
|
|
3307
|
+
attach() {
|
|
3308
|
+
super.attach();
|
|
3309
|
+
const self = this;
|
|
3310
|
+
const { holdMs = 500 } = self.props.options;
|
|
3311
|
+
const state = {
|
|
3312
|
+
heldAt: null,
|
|
3313
|
+
last: null,
|
|
3314
|
+
timer: setTimeout(() => {
|
|
3315
|
+
state.heldAt = state.last ?? self.initialCoordinates;
|
|
3316
|
+
}, holdMs)
|
|
3317
|
+
};
|
|
3318
|
+
holds.set(this, state);
|
|
3319
|
+
}
|
|
3320
|
+
handleMove(event) {
|
|
3321
|
+
const self = this;
|
|
3322
|
+
const state = holds.get(this);
|
|
3323
|
+
if (self.activated || !state) {
|
|
3324
|
+
super.handleMove(event);
|
|
3325
|
+
return;
|
|
3326
|
+
}
|
|
3327
|
+
if ((event.touches?.length ?? 1) > 1) {
|
|
3328
|
+
self.handleCancel();
|
|
3329
|
+
return;
|
|
3330
|
+
}
|
|
3331
|
+
const point = touchPoint(event);
|
|
3332
|
+
const start = self.initialCoordinates;
|
|
3333
|
+
if (!point || !start) return;
|
|
3334
|
+
state.last = point;
|
|
3335
|
+
const { distance = 10, tolerance = 10 } = self.props.options;
|
|
3336
|
+
if (!state.heldAt) {
|
|
3337
|
+
if (farther(start, point, tolerance)) self.handleCancel();
|
|
3338
|
+
return;
|
|
3339
|
+
}
|
|
3340
|
+
if (event.cancelable) event.preventDefault();
|
|
3341
|
+
if (farther(state.heldAt, point, distance)) self.handleStart();
|
|
3342
|
+
}
|
|
3343
|
+
detach() {
|
|
3344
|
+
const state = holds.get(this);
|
|
3345
|
+
if (state) clearTimeout(state.timer);
|
|
3346
|
+
holds.delete(this);
|
|
3347
|
+
super.detach();
|
|
3348
|
+
}
|
|
3349
|
+
};
|
|
3350
|
+
/** A TouchSensor that starts a drag on the first move after a still hold (see above). */
|
|
3351
|
+
const HoldThenMoveTouchSensor = HoldThenMoveTouchSensorImpl;
|
|
3352
|
+
/**
|
|
3353
|
+
* dnd-kit's PointerSensor for a mouse and a pen only: a finger's pointerdown is
|
|
3354
|
+
* left to `HoldThenMoveTouchSensor`.
|
|
3355
|
+
*/
|
|
3356
|
+
var MouseOnlyPointerSensor = class extends PointerSensor {
|
|
3357
|
+
static activators = [{
|
|
3358
|
+
eventName: "onPointerDown",
|
|
3359
|
+
handler: (event, options) => event.nativeEvent.pointerType === "touch" ? false : PointerSensor.activators[0].handler(event, options)
|
|
3360
|
+
}];
|
|
3361
|
+
};
|
|
3362
|
+
/**
|
|
3363
|
+
* `useSensor(HoldThenMoveTouchSensor, …)` with the activation the sensor relies
|
|
3364
|
+
* on: no constraint dnd-kit would act on by itself, so only a move after the
|
|
3365
|
+
* hold starts the drag.
|
|
3366
|
+
*/
|
|
3367
|
+
function useHoldThenMoveTouchSensor({ holdMs = 500, distance = 10, tolerance = 10 } = {}) {
|
|
3368
|
+
const options = useMemo(() => ({
|
|
3369
|
+
holdMs,
|
|
3370
|
+
distance,
|
|
3371
|
+
tolerance,
|
|
3372
|
+
activationConstraint: { distance: Number.POSITIVE_INFINITY }
|
|
3373
|
+
}), [
|
|
3374
|
+
holdMs,
|
|
3375
|
+
distance,
|
|
3376
|
+
tolerance
|
|
3377
|
+
]);
|
|
3378
|
+
return useSensor(HoldThenMoveTouchSensor, options);
|
|
3379
|
+
}
|
|
3380
|
+
/** The mouse / pen sensor that goes with it: picks up after `distance` px. */
|
|
3381
|
+
function useMouseOnlyPointerSensor(distance) {
|
|
3382
|
+
const options = useMemo(() => ({ activationConstraint: { distance } }), [distance]);
|
|
3383
|
+
return useSensor(MouseOnlyPointerSensor, options);
|
|
3384
|
+
}
|
|
3290
3385
|
//#endregion
|
|
3291
|
-
export {
|
|
3386
|
+
export { MessageReactionTooltipMeta as $, ThemeStateContext as $n, DropdownMenuRadioItem as $t, messageEmbed as A, Badge as An, MessageItemContinuationTime as At, MessageReferencePending as B, DialogPortal as Bn, useOverflowTitle as Bt, MessageQuotedPreviewThread as C, CheckboxIndicator as Cn, MessageItemBody as Ct, MessageEmbedContent as D, TooltipPortal as Dn, MessageItemFooter as Dt, MessageEmbed as E, TooltipContent as En, MessageItemEmbedded as Et, MessageMultiSelectCheckbox as F, DialogDescription as Fn, AvatarBadge as Ft, MessageReactionCount as G, buttonVariants as Gn, DropdownMenuFooter as Gt, MessageReferenceUnavailable as H, DialogTitle as Hn, DropdownMenuCheckboxItem as Ht, MessageMultiSelectToolbar as I, DialogFooter as In, AvatarFallback as It, MessageReactionPickerContent as J, useParentOverlayKind as Jn, DropdownMenuItemLabel as Jt, MessageReactionErrorIndicator as K, Spinner as Kn, DropdownMenuItem as Kt, MessageReferenceChip as L, DialogHeader as Ln, AvatarGroup as Lt, MessageTextSelectionToolbarButton as M, DialogBody as Mn, MessageItem as Mt, MessageTextSelectionToolbarSeparator as N, DialogClose as Nn, searchHit as Nt, MessageEmbedFooter as O, TooltipProvider as On, MessageItemSearchMatch as Ot, MessageMultiSelect as P, DialogContent as Pn, Avatar$1 as Pt, MessageReactionTooltipContent as Q, useTheme as Qn, DropdownMenuRadioGroup as Qt, MessageReferenceIndicator as R, DialogNav as Rn, AvatarGroupCount as Rt, MessageQuotedPreviewText as S, Checkbox$1 as Sn, MessageItemAttachments as St, MessageQuotedPreviewUnavailable as T, Tooltip$1 as Tn, MessageItemEdited as Tt, MessageReactionAddButton as U, DialogTrigger as Un, DropdownMenuCheckboxItemIndicator as Ut, MessageReferenceText as V, DialogSurface as Vn, DropdownMenu as Vt, MessageReactionChip as W, Button$1 as Wn, DropdownMenuContent as Wt, MessageReactionQuickButton as X, resolveThemeScopeProps as Xn, DropdownMenuPopup as Xt, MessageReactionPickerStatic as Y, withOverlayLayer as Yn, DropdownMenuLabel as Yt, MessageReactionQuickRow as Z, useThemeScopeProps as Zn, DropdownMenuPortal as Zt, MessageQuotedPreviewAuthorName as _, ScrollAreaCorner as _n, MessageItemSender as _t, MessageListJumpPillDismiss as a, DropdownMenuTrigger as an, MessageItemBadgeSeparator as at, MessageQuotedPreviewHeader as b, ScrollAreaViewport as bn, MessageItemSenderGroup as bt, MessageListHistoryLimited as c, Panel as cn, MessageItemToolbar as ct, MessageQuotedPreview as d, PanelHeaderRoot as dn, MessageItemDelegatedBy as dt, DropdownMenuRadioItemIndicator as en, tv$1 as er, MessageReactionTooltipName as et, MessageQuotedPreviewAttachment as f, PanelScrollContent as fn, MessageItemDelegatedByButton as ft, MessageQuotedPreviewAuthorMeta as g, ScrollAreaContent as gn, MessageItemMeta as gt, MessageQuotedPreviewAuthorDelegatedBy as h, ScrollArea$1 as hn, MessageItemInlineStatus as ht, MessageListJumpPill as i, DropdownMenuSubmenuTrigger as in, MessageItemBadge as it, MessageTextSelectionToolbar as j, Dialog$1 as jn, MessageItemGutter as jt, MessageEmbedHeader as k, TooltipTrigger as kn, MessageItemAvatarSlot as kt, MessageListNotice as l, PanelBody as ln, MessageItemToolbarButton as lt, MessageQuotedPreviewAuthor as m, PanelSection as mn, MessageItemHeader as mt, useMouseOnlyPointerSensor as n, DropdownMenuShortcut as nn, headEdgePull as nr, MessageReactionTooltipNames as nt, MessageListJumpPillGroup as o, Kbd as on, MessageItemReadReceipt as ot, MessageQuotedPreviewAttachments as p, PanelScrollViewport as pn, MessageItemDelegatedByName as pt, MessageReactionGlyph as q, defaultNativeButton as qn, DropdownMenuItemCount as qt, MessageListJumpControls as r, DropdownMenuSubmenu as rn, headEdges as rr, MessageReactionTooltipSeparator as rt, MessageListDateDivider as s, KbdGroup as sn, MessageItemSavedIndicator as st, useHoldThenMoveTouchSensor as t, DropdownMenuSeparator as tn, controlIconInset as tr, MessageReactionTooltipNameText as tt, MessageList as u, PanelFooter as un, MessageItemDelegatedAvatar as ut, MessageQuotedPreviewChannel as v, ScrollAreaScrollbar as vn, MessageItemSenderBadges as vt, MessageQuotedPreviewTimestamp as w, PRESENCE_COLOR as wn, MessageItemContent as wt, MessageQuotedPreviewLoading as x, useMobileViewport as xn, MessageItemTime as xt, MessageQuotedPreviewContent as y, ScrollAreaThumb as yn, MessageItemSenderButton as yt, MessageReferenceLabel as z, DialogOverlay as zn, AvatarImage as zt };
|
package/dist/wip.d.mts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { C as MessageQuotedPreviewAuthorDelegatedBy, Hi as DialogTitleProps, Ki as ButtonProps, Si as DialogClose, Ti as DialogContentProps, Ui as DialogTrigger, Xi as StyledProps, Yi as DataAttributes, a as MessageListJumpPillDismissProps, c as MessageListJumpPillProps, cn as MessageItemDelegatedAvatar, dn as MessageItemDelegatedByButton, fn as MessageItemDelegatedByButtonProps, hn as MessageItemDelegatedByProps, i as MessageListJumpPillDismiss, ln as MessageItemDelegatedAvatarProps, mn as MessageItemDelegatedByNameProps, n as MessageListJumpControlsProps, o as MessageListJumpPillGroup, pn as MessageItemDelegatedByName, r as MessageListJumpPill, s as MessageListJumpPillGroupProps, t as MessageListJumpControls, un as MessageItemDelegatedBy, w as MessageQuotedPreviewAuthorDelegatedByProps, yi as Dialog } from "./index-DsVVBZ5T.mjs";
|
|
2
|
-
import { CSSProperties, ComponentPropsWithRef, ReactNode } from "react";
|
|
2
|
+
import { CSSProperties, ComponentPropsWithRef, PointerEvent, ReactNode } from "react";
|
|
3
3
|
import { Button } from "@base-ui/react/button";
|
|
4
4
|
import { useRender } from "@base-ui/react/use-render";
|
|
5
5
|
import { Combobox } from "@base-ui/react/combobox";
|
|
6
|
+
import { PointerSensor, TouchSensor, TouchSensorOptions } from "@dnd-kit/core";
|
|
6
7
|
//#region src/components/combobox-select/combobox-select.types.d.ts
|
|
7
8
|
type ComboboxSelectValue = string | number;
|
|
8
9
|
interface ComboboxSelectOption {
|
|
@@ -265,4 +266,20 @@ type UseCommentMarginFitsOptions = {
|
|
|
265
266
|
*/
|
|
266
267
|
export declare function useCommentMarginFits(element: Element | null, { minWidth }?: UseCommentMarginFitsOptions): boolean;
|
|
267
268
|
//#endregion
|
|
268
|
-
|
|
269
|
+
//#region src/lib/touch-drag.d.ts
|
|
270
|
+
type HoldThenMoveOptions = {
|
|
271
|
+
/** How long the finger stays still before a move can start the drag. */
|
|
272
|
+
holdMs?: number;
|
|
273
|
+
/** How far the finger moves after the hold to start the drag. */
|
|
274
|
+
distance?: number;
|
|
275
|
+
/** How far the finger may drift during the hold before it counts as a scroll. */
|
|
276
|
+
tolerance?: number;
|
|
277
|
+
};
|
|
278
|
+
/**
|
|
279
|
+
* `useSensor(HoldThenMoveTouchSensor, …)` with the activation the sensor relies
|
|
280
|
+
* on: no constraint dnd-kit would act on by itself, so only a move after the
|
|
281
|
+
* hold starts the drag.
|
|
282
|
+
*/
|
|
283
|
+
export declare function useHoldThenMoveTouchSensor({ holdMs, distance, tolerance }?: HoldThenMoveOptions): import("@dnd-kit/core").SensorDescriptor<TouchSensorOptions>;
|
|
284
|
+
//#endregion
|
|
285
|
+
export { Dialog as AnnouncementDialog, DialogClose as AnnouncementDialogClose, DialogTrigger as AnnouncementDialogTrigger, type ComboboxSelectGroup, type ComboboxSelectMessages, type ComboboxSelectOption, type ComboboxSelectProps, type ComboboxSelectSelection, type ComboboxSelectValue, type CommentCardMetaProps, type CommentCardProps, type CommentCardQuoteProps, type CommentCardTriggerProps, type CommentEntryAuthorProps, type CommentEntryBodyProps, type CommentEntryHeaderProps, type CommentEntryProps, type CommentEntryTimeProps, type CommentMarginItemProps, type CommentMarginLayout, type CommentMarginLayoutItem, type CommentMarginLayoutOptions, type CommentMarginProps, type CommentMarkerProps, type HoldThenMoveOptions, MessageItemDelegatedAvatar, type MessageItemDelegatedAvatarProps, MessageItemDelegatedBy, MessageItemDelegatedByButton, type MessageItemDelegatedByButtonProps, MessageItemDelegatedByName, type MessageItemDelegatedByNameProps, type MessageItemDelegatedByProps, MessageListJumpControls, type MessageListJumpControlsProps, MessageListJumpPill, MessageListJumpPillDismiss, type MessageListJumpPillDismissProps, MessageListJumpPillGroup, type MessageListJumpPillGroupProps, type MessageListJumpPillProps, MessageQuotedPreviewAuthorDelegatedBy, type MessageQuotedPreviewAuthorDelegatedByProps, type UseCommentMarginFitsOptions };
|
package/dist/wip.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Bt as useOverflowTitle, Hn as DialogTitle, Nn as DialogClose, Pn as DialogContent, Qn as useTheme, Un as DialogTrigger, Wn as Button$1, Zn as useThemeScopeProps, a as MessageListJumpPillDismiss, dt as MessageItemDelegatedBy, er as tv, ft as MessageItemDelegatedByButton, h as MessageQuotedPreviewAuthorDelegatedBy, i as MessageListJumpPill, jn as Dialog, o as MessageListJumpPillGroup, pt as MessageItemDelegatedByName, qn as defaultNativeButton, r as MessageListJumpControls, t as useHoldThenMoveTouchSensor, ut as MessageItemDelegatedAvatar } from "./touch-drag-CbWqiMlZ.mjs";
|
|
2
2
|
import { Check, ChevronDown, LoaderCircle, Plus, X } from "lucide-react";
|
|
3
3
|
import { createContext, use, useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
4
4
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1123,4 +1123,4 @@ function useCommentMarginFits(element, { minWidth = 784 } = {}) {
|
|
|
1123
1123
|
return desktop && element !== null && width >= minWidth;
|
|
1124
1124
|
}
|
|
1125
1125
|
//#endregion
|
|
1126
|
-
export { Dialog as AnnouncementDialog, AnnouncementDialogAction, AnnouncementDialogBody, DialogClose as AnnouncementDialogClose, AnnouncementDialogContent, AnnouncementDialogFooter, AnnouncementDialogHeader, AnnouncementDialogLabel, AnnouncementDialogPicture, AnnouncementDialogSecondaryAction, AnnouncementDialogText, AnnouncementDialogTitle, DialogTrigger as AnnouncementDialogTrigger, COMMENT_HIGHLIGHT, COMMENT_HIGHLIGHT_ACTIVE, ComboboxSelect, CommentCard, CommentCardMeta, CommentCardQuote, CommentCardTrigger, CommentEntry, CommentEntryAuthor, CommentEntryBody, CommentEntryHeader, CommentEntryTime, CommentMargin, CommentMarginItem, CommentMarker, MessageItemDelegatedAvatar, MessageItemDelegatedBy, MessageItemDelegatedByButton, MessageItemDelegatedByName, MessageListJumpControls, MessageListJumpPill, MessageListJumpPillDismiss, MessageListJumpPillGroup, MessageQuotedPreviewAuthorDelegatedBy, resolveCommentMarginLayout, setCommentHighlights, useCommentMarginFits };
|
|
1126
|
+
export { Dialog as AnnouncementDialog, AnnouncementDialogAction, AnnouncementDialogBody, DialogClose as AnnouncementDialogClose, AnnouncementDialogContent, AnnouncementDialogFooter, AnnouncementDialogHeader, AnnouncementDialogLabel, AnnouncementDialogPicture, AnnouncementDialogSecondaryAction, AnnouncementDialogText, AnnouncementDialogTitle, DialogTrigger as AnnouncementDialogTrigger, COMMENT_HIGHLIGHT, COMMENT_HIGHLIGHT_ACTIVE, ComboboxSelect, CommentCard, CommentCardMeta, CommentCardQuote, CommentCardTrigger, CommentEntry, CommentEntryAuthor, CommentEntryBody, CommentEntryHeader, CommentEntryTime, CommentMargin, CommentMarginItem, CommentMarker, MessageItemDelegatedAvatar, MessageItemDelegatedBy, MessageItemDelegatedByButton, MessageItemDelegatedByName, MessageListJumpControls, MessageListJumpPill, MessageListJumpPillDismiss, MessageListJumpPillGroup, MessageQuotedPreviewAuthorDelegatedBy, resolveCommentMarginLayout, setCommentHighlights, useCommentMarginFits, useHoldThenMoveTouchSensor };
|