@assistant-ui/react 0.14.23 → 0.14.26
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/index.d.ts +4 -3
- package/dist/index.js +4 -3
- package/dist/legacy-runtime/hooks/AttachmentContext.d.ts +12 -12
- package/dist/legacy-runtime/runtime-cores/assistant-transport/commandQueue.d.ts +3 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/commandQueue.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/commandQueue.js +2 -2
- package/dist/legacy-runtime/runtime-cores/assistant-transport/commandQueue.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.js +6 -2
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.js.map +1 -1
- package/dist/primitives/composer/ComposerInput.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerInput.js +5 -14
- package/dist/primitives/composer/ComposerInput.js.map +1 -1
- package/dist/primitives/composer/useComposerInputState.d.ts +13 -0
- package/dist/primitives/composer/useComposerInputState.d.ts.map +1 -0
- package/dist/primitives/composer/useComposerInputState.js +47 -0
- package/dist/primitives/composer/useComposerInputState.js.map +1 -0
- package/dist/primitives/messagePart/MessagePartText.d.ts +2 -0
- package/dist/primitives/messagePart/MessagePartText.d.ts.map +1 -1
- package/dist/primitives/messagePart/MessagePartText.js.map +1 -1
- package/dist/primitives/thread/ThreadMessages.d.ts +2 -2
- package/dist/primitives/thread/ThreadMessages.js +2 -2
- package/dist/primitives/thread.d.ts +3 -3
- package/dist/primitives/thread.js +3 -2
- package/dist/primitives/thread.js.map +1 -1
- package/dist/primitives/threadList/ThreadListRoot.d.ts.map +1 -1
- package/dist/primitives/threadList/ThreadListRoot.js +10 -3
- package/dist/primitives/threadList/ThreadListRoot.js.map +1 -1
- package/dist/primitives/threadListFocusGroup.d.ts +26 -0
- package/dist/primitives/threadListFocusGroup.d.ts.map +1 -0
- package/dist/primitives/threadListFocusGroup.js +15 -0
- package/dist/primitives/threadListFocusGroup.js.map +1 -0
- package/dist/primitives/threadListItem/ThreadListItemRoot.d.ts.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemRoot.js +45 -27
- package/dist/primitives/threadListItem/ThreadListItemRoot.js.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemTrigger.d.ts.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemTrigger.js +26 -2
- package/dist/primitives/threadListItem/ThreadListItemTrigger.js.map +1 -1
- package/dist/primitives/threadListItemMore/ThreadListItemMoreContent.d.ts.map +1 -1
- package/dist/primitives/threadListItemMore/ThreadListItemMoreContent.js +63 -38
- package/dist/primitives/threadListItemMore/ThreadListItemMoreContent.js.map +1 -1
- package/dist/primitives/threadListItemMore/ThreadListItemMoreRoot.d.ts +20 -3
- package/dist/primitives/threadListItemMore/ThreadListItemMoreRoot.d.ts.map +1 -1
- package/dist/primitives/threadListItemMore/ThreadListItemMoreRoot.js +95 -14
- package/dist/primitives/threadListItemMore/ThreadListItemMoreRoot.js.map +1 -1
- package/dist/primitives/threadListItemMore/ThreadListItemMoreTrigger.d.ts.map +1 -1
- package/dist/primitives/threadListItemMore/ThreadListItemMoreTrigger.js +38 -21
- package/dist/primitives/threadListItemMore/ThreadListItemMoreTrigger.js.map +1 -1
- package/dist/unstable/useComposerInput.d.ts +84 -0
- package/dist/unstable/useComposerInput.d.ts.map +1 -0
- package/dist/unstable/useComposerInput.js +78 -0
- package/dist/unstable/useComposerInput.js.map +1 -0
- package/dist/utils/hooks/useMediaQuery.js +2 -2
- package/dist/utils/hooks/useMediaQuery.js.map +1 -1
- package/dist/utils/smooth/useSmooth.d.ts +4 -0
- package/dist/utils/smooth/useSmooth.d.ts.map +1 -1
- package/dist/utils/smooth/useSmooth.js +7 -1
- package/dist/utils/smooth/useSmooth.js.map +1 -1
- package/dist/utils/useToolArgsFieldStatus.d.ts +2 -2
- package/dist/utils/useToolArgsFieldStatus.d.ts.map +1 -1
- package/package.json +16 -14
- package/src/index.ts +39 -0
- package/src/legacy-runtime/runtime-cores/assistant-transport/commandQueue.ts +5 -2
- package/src/legacy-runtime/runtime-cores/assistant-transport/transport-scheduling.test.ts +22 -0
- package/src/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.ts +12 -2
- package/src/primitives/composer/ComposerInput.tsx +9 -20
- package/src/primitives/composer/trigger/triggerKeyboardResource.test.ts +18 -22
- package/src/primitives/composer/useComposerInputState.ts +34 -0
- package/src/primitives/messagePart/MessagePartText.tsx +1 -0
- package/src/primitives/thread/ThreadMessages.tsx +1 -0
- package/src/primitives/thread.ts +1 -0
- package/src/primitives/threadList/ThreadListRoot.tsx +8 -1
- package/src/primitives/threadListFocusGroup.ts +24 -0
- package/src/primitives/threadListItem/ThreadListItemRoot.tsx +53 -5
- package/src/primitives/threadListItem/ThreadListItemTrigger.tsx +45 -0
- package/src/primitives/threadListItem/ThreadListKeyboardNav.test.tsx +141 -0
- package/src/primitives/threadListItemMore/ThreadListItemMoreContent.tsx +22 -1
- package/src/primitives/threadListItemMore/ThreadListItemMoreRoot.tsx +64 -3
- package/src/primitives/threadListItemMore/ThreadListItemMoreTrigger.tsx +29 -2
- package/src/tests/generative-ui.test.tsx +21 -1
- package/src/tests/threadMessageById.test.tsx +224 -0
- package/src/unstable/useComposerInput.test.tsx +187 -0
- package/src/unstable/useComposerInput.ts +126 -0
- package/src/utils/hooks/useMediaQuery.ts +3 -2
- package/src/utils/smooth/useSmooth.test.tsx +26 -0
- package/src/utils/smooth/useSmooth.ts +7 -1
- package/src/primitives/threadListItem/ThreadListItemTrigger.ts +0 -23
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useTriggerPopoverActiveAriaOptional } from "./trigger/TriggerPopoverRootContext.js";
|
|
3
|
+
import { useAuiState } from "@assistant-ui/store";
|
|
4
|
+
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
5
|
+
//#region src/primitives/composer/useComposerInputState.ts
|
|
6
|
+
function useComposerInputValue() {
|
|
7
|
+
return useAuiState(_temp);
|
|
8
|
+
}
|
|
9
|
+
function _temp(s) {
|
|
10
|
+
return s.composer.isEditing ? s.composer.text : "";
|
|
11
|
+
}
|
|
12
|
+
function useComposerInputDisabled(disabled) {
|
|
13
|
+
const composerDisabled = useAuiState(_temp2);
|
|
14
|
+
return Boolean(composerDisabled) || Boolean(disabled);
|
|
15
|
+
}
|
|
16
|
+
function _temp2(s) {
|
|
17
|
+
return s.thread.isDisabled || s.composer.dictation?.inputDisabled;
|
|
18
|
+
}
|
|
19
|
+
function useTriggerPopoverAriaProps() {
|
|
20
|
+
const $ = c(4);
|
|
21
|
+
const activeAria = useTriggerPopoverActiveAriaOptional();
|
|
22
|
+
if (!activeAria) {
|
|
23
|
+
let t0;
|
|
24
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
25
|
+
t0 = {};
|
|
26
|
+
$[0] = t0;
|
|
27
|
+
} else t0 = $[0];
|
|
28
|
+
return t0;
|
|
29
|
+
}
|
|
30
|
+
let t0;
|
|
31
|
+
if ($[1] !== activeAria.highlightedItemId || $[2] !== activeAria.popoverId) {
|
|
32
|
+
t0 = {
|
|
33
|
+
"aria-controls": activeAria.popoverId,
|
|
34
|
+
"aria-expanded": true,
|
|
35
|
+
"aria-haspopup": "listbox",
|
|
36
|
+
"aria-activedescendant": activeAria.highlightedItemId
|
|
37
|
+
};
|
|
38
|
+
$[1] = activeAria.highlightedItemId;
|
|
39
|
+
$[2] = activeAria.popoverId;
|
|
40
|
+
$[3] = t0;
|
|
41
|
+
} else t0 = $[3];
|
|
42
|
+
return t0;
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
export { useComposerInputDisabled, useComposerInputValue, useTriggerPopoverAriaProps };
|
|
46
|
+
|
|
47
|
+
//# sourceMappingURL=useComposerInputState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useComposerInputState.js","names":["c","_c","useAuiState","useTriggerPopoverActiveAriaOptional","TriggerPopoverAriaProps","useComposerInputValue","_temp","s","composer","isEditing","text","useComposerInputDisabled","disabled","composerDisabled","_temp2","Boolean","thread","isDisabled","dictation","inputDisabled","useTriggerPopoverAriaProps","$","activeAria","t0","Symbol","for","highlightedItemId","popoverId"],"sources":["../../../src/primitives/composer/useComposerInputState.ts"],"sourcesContent":["\"use client\";\n\nimport { useAuiState } from \"@assistant-ui/store\";\nimport { useTriggerPopoverActiveAriaOptional } from \"./trigger/TriggerPopoverRootContext\";\n\nexport type TriggerPopoverAriaProps = {\n \"aria-controls\"?: string;\n \"aria-expanded\"?: true;\n \"aria-haspopup\"?: \"listbox\";\n \"aria-activedescendant\"?: string | undefined;\n};\n\nexport function useComposerInputValue() {\n return useAuiState((s) => (s.composer.isEditing ? s.composer.text : \"\"));\n}\n\nexport function useComposerInputDisabled(disabled?: boolean | undefined) {\n const composerDisabled = useAuiState(\n (s) => s.thread.isDisabled || s.composer.dictation?.inputDisabled,\n );\n return Boolean(composerDisabled) || Boolean(disabled);\n}\n\nexport function useTriggerPopoverAriaProps(): TriggerPopoverAriaProps {\n const activeAria = useTriggerPopoverActiveAriaOptional();\n if (!activeAria) return {};\n\n return {\n \"aria-controls\": activeAria.popoverId,\n \"aria-expanded\": true,\n \"aria-haspopup\": \"listbox\",\n \"aria-activedescendant\": activeAria.highlightedItemId,\n };\n}\n"],"mappings":";;;;;AAYA,SAAOK,wBAAA;CAAA,OACEH,YAAYI,KAAoD;AAAC;AADnE,SAAAA,MAAAC,GAAA;CAAA,OACsBA,EAACC,SAASC,YAAaF,EAACC,SAASE,OAAjC;AAA2C;AAGxE,SAAOC,yBAAAC,UAAA;CACL,MAAAC,mBAAyBX,YACvBY,MACF;CAAE,OACKC,QAAQF,gBAAqC,KAAhBE,QAAQH,QAAQ;AAAC;AAJhD,SAAAE,OAAAP,GAAA;CAAA,OAEIA,EAACS,OAAOC,cAAeV,EAACC,SAASU,WAAyBC;AAAA;AAKrE,SAAOC,6BAAA;CAAA,MAAAC,IAAApB,EAAA,CAAA;CACL,MAAAqB,aAAmBnB,oCAAoC;CACvD,IAAI,CAACmB,YAAU;EAAA,IAAAC;EAAA,IAAAF,EAAA,OAAAG,OAAAC,IAAA,2BAAA,GAAA;GAASF,KAAA,CAAC;GAACF,EAAA,KAAAE;EAAA,OAAAA,KAAAF,EAAA;EAAA,OAAFE;CAAE;CAAC,IAAAA;CAAA,IAAAF,EAAA,OAAAC,WAAAI,qBAAAL,EAAA,OAAAC,WAAAK,WAAA;EAEpBJ,KAAA;GAAA,iBACYD,WAAUK;GAAU,iBACpB;GAAI,iBACJ;GAAS,yBACDL,WAAUI;EACrC;EAACL,EAAA,KAAAC,WAAAI;EAAAL,EAAA,KAAAC,WAAAK;EAAAN,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,OALME;AAKN"}
|
|
@@ -10,6 +10,7 @@ declare namespace MessagePartPrimitiveText {
|
|
|
10
10
|
* Whether to enable smooth text streaming animation.
|
|
11
11
|
* When enabled, text appears with a typing effect as it streams in.
|
|
12
12
|
* Pass a `SmoothOptions` object to tune the reveal rate.
|
|
13
|
+
* Auto-disables under `prefers-reduced-motion: reduce`.
|
|
13
14
|
* @default true
|
|
14
15
|
*/
|
|
15
16
|
smooth?: boolean | SmoothOptions;
|
|
@@ -45,6 +46,7 @@ declare const MessagePartPrimitiveText: import("react").ForwardRefExoticComponen
|
|
|
45
46
|
* Whether to enable smooth text streaming animation.
|
|
46
47
|
* When enabled, text appears with a typing effect as it streams in.
|
|
47
48
|
* Pass a `SmoothOptions` object to tune the reveal rate.
|
|
49
|
+
* Auto-disables under `prefers-reduced-motion: reduce`.
|
|
48
50
|
* @default true
|
|
49
51
|
*/
|
|
50
52
|
smooth?: boolean | SmoothOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessagePartText.d.ts","names":[],"sources":["../../../src/primitives/messagePart/MessagePartText.tsx"],"mappings":";;;;;kBAYiB,wBAAA;EAAA,KACH,OAAA,GAAU,YAAA,QAAoB,SAAA,CAAU,IAAA;EAAA,KACxC,KAAA,GAAQ,IAAA,CAClB,wBAAA,QAAgC,SAAA,CAAU,IAAA;IAHL
|
|
1
|
+
{"version":3,"file":"MessagePartText.d.ts","names":[],"sources":["../../../src/primitives/messagePart/MessagePartText.tsx"],"mappings":";;;;;kBAYiB,wBAAA;EAAA,KACH,OAAA,GAAU,YAAA,QAAoB,SAAA,CAAU,IAAA;EAAA,KACxC,KAAA,GAAQ,IAAA,CAClB,wBAAA,QAAgC,SAAA,CAAU,IAAA;IAHL;;;;;;;IAarC,MAAA,aAAmB,aAAA;IAKP;;;;IAAZ,SAAA,GAAY,WAAA;EAAA;AAAA;;;;;;;;;;;AAAW;AAoB3B;;;;;cAAa,wBAAA,kBAAwB,yBAAA,CAAA,IAAA,CAAA,IAAA,CAAA,IAAA,iBAAA,eAAA,CAAA,eAAA,oBAAA,cAAA,CAAA,eAAA;;;;;EApBrB;;;;;;;qBALO,aAAA;EAyBc;;;;cApBrB,WAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessagePartText.js","names":["c","_c","Primitive","ComponentRef","forwardRef","ComponentPropsWithoutRef","ElementType","useMessagePartText","useSmooth","SmoothOptions","MessagePartPrimitiveText","Element","span","Props","Omit","smooth","component","t0","forwardedRef","$","rest","t1","t2","undefined","Component","text","status","t3","type","displayName"],"sources":["../../../src/primitives/messagePart/MessagePartText.tsx"],"sourcesContent":["\"use client\";\n\nimport type { Primitive } from \"../../utils/Primitive\";\nimport {\n type ComponentRef,\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementType,\n} from \"react\";\nimport { useMessagePartText } from \"./useMessagePartText\";\nimport { useSmooth, type SmoothOptions } from \"../../utils/smooth/useSmooth\";\n\nexport namespace MessagePartPrimitiveText {\n export type Element = ComponentRef<typeof Primitive.span>;\n export type Props = Omit<\n ComponentPropsWithoutRef<typeof Primitive.span>,\n \"children\" | \"asChild\"\n > & {\n /**\n * Whether to enable smooth text streaming animation.\n * When enabled, text appears with a typing effect as it streams in.\n * Pass a `SmoothOptions` object to tune the reveal rate.\n * @default true\n */\n smooth?: boolean | SmoothOptions;\n /**\n * The HTML element or React component to render as.\n * @default \"span\"\n */\n component?: ElementType;\n };\n}\n\n/**\n * Renders the text content of a message part with optional smooth streaming.\n *\n * This component displays text content from the current message part context,\n * with support for smooth streaming animation that shows text appearing\n * character by character as it's generated.\n *\n * @example\n * ```tsx\n * <MessagePartPrimitive.Text\n * smooth={true}\n * component=\"p\"\n * className=\"message-text\"\n * />\n * ```\n */\nexport const MessagePartPrimitiveText = forwardRef<\n MessagePartPrimitiveText.Element,\n MessagePartPrimitiveText.Props\n>(({ smooth = true, component: Component = \"span\", ...rest }, forwardedRef) => {\n const { text, status } = useSmooth(useMessagePartText(), smooth);\n\n return (\n <Component data-status={status.type} {...rest} ref={forwardedRef}>\n {text}\n </Component>\n );\n});\n\nMessagePartPrimitiveText.displayName = \"MessagePartPrimitive.Text\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"MessagePartText.js","names":["c","_c","Primitive","ComponentRef","forwardRef","ComponentPropsWithoutRef","ElementType","useMessagePartText","useSmooth","SmoothOptions","MessagePartPrimitiveText","Element","span","Props","Omit","smooth","component","t0","forwardedRef","$","rest","t1","t2","undefined","Component","text","status","t3","type","displayName"],"sources":["../../../src/primitives/messagePart/MessagePartText.tsx"],"sourcesContent":["\"use client\";\n\nimport type { Primitive } from \"../../utils/Primitive\";\nimport {\n type ComponentRef,\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementType,\n} from \"react\";\nimport { useMessagePartText } from \"./useMessagePartText\";\nimport { useSmooth, type SmoothOptions } from \"../../utils/smooth/useSmooth\";\n\nexport namespace MessagePartPrimitiveText {\n export type Element = ComponentRef<typeof Primitive.span>;\n export type Props = Omit<\n ComponentPropsWithoutRef<typeof Primitive.span>,\n \"children\" | \"asChild\"\n > & {\n /**\n * Whether to enable smooth text streaming animation.\n * When enabled, text appears with a typing effect as it streams in.\n * Pass a `SmoothOptions` object to tune the reveal rate.\n * Auto-disables under `prefers-reduced-motion: reduce`.\n * @default true\n */\n smooth?: boolean | SmoothOptions;\n /**\n * The HTML element or React component to render as.\n * @default \"span\"\n */\n component?: ElementType;\n };\n}\n\n/**\n * Renders the text content of a message part with optional smooth streaming.\n *\n * This component displays text content from the current message part context,\n * with support for smooth streaming animation that shows text appearing\n * character by character as it's generated.\n *\n * @example\n * ```tsx\n * <MessagePartPrimitive.Text\n * smooth={true}\n * component=\"p\"\n * className=\"message-text\"\n * />\n * ```\n */\nexport const MessagePartPrimitiveText = forwardRef<\n MessagePartPrimitiveText.Element,\n MessagePartPrimitiveText.Props\n>(({ smooth = true, component: Component = \"span\", ...rest }, forwardedRef) => {\n const { text, status } = useSmooth(useMessagePartText(), smooth);\n\n return (\n <Component data-status={status.type} {...rest} ref={forwardedRef}>\n {text}\n </Component>\n );\n});\n\nMessagePartPrimitiveText.displayName = \"MessagePartPrimitive.Text\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAkDA,MAAaU,2BAA2BN,YAGtCa,IAAAC,iBAAA;CAAA,MAAAC,IAAAlB,EAAA,EAAA;CAAA,IAAAmB;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAH,EAAA,OAAAF,IAAA;EAAC,CAAA,CAAAF,QAAAM,IAAAL,WAAAM,OAAAF,QAAAH;EAAyDE,EAAA,KAAAF;EAAAE,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,KAAAG;CAAA,OAAA;EAAAF,OAAAD,EAAA;EAAAE,KAAAF,EAAA;EAAAG,KAAAH,EAAA;CAAA;CAAvD,MAAAJ,SAAAM,OAAAE,KAAAA,IAAA,OAAAF;CAA0B,MAAAG,YAAAF,OAAAC,KAAAA,IAAA,SAAAD;CAC7B,MAAA,EAAAG,MAAAC,WAAyBlB,UAAUD,mBAAmB,GAAGQ,MAAM;CAAE,IAAAY;CAAA,IAAAR,EAAA,OAAAK,aAAAL,EAAA,OAAAD,gBAAAC,EAAA,OAAAC,QAAAD,EAAA,OAAAO,OAAAE,QAAAT,EAAA,OAAAM,MAAA;EAG/DE,KAAA,oBAAC,WAAD;GAAwB,eAAAD,OAAME;GAAK,GAAMR;GAAWF,KAAAA;aACjDO;EADO,CAAA;EAEEN,EAAA,KAAAK;EAAAL,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAO,OAAAE;EAAAT,EAAA,KAAAM;EAAAN,EAAA,KAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,OAFZQ;AAEY,CAEf;AAEDjB,yBAAyBmB,cAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ThreadPrimitiveMessageByIndex, ThreadPrimitiveMessages, ThreadPrimitiveMessagesImpl } from "@assistant-ui/core/react";
|
|
2
|
-
export { ThreadPrimitiveMessageByIndex, ThreadPrimitiveMessages, ThreadPrimitiveMessagesImpl };
|
|
1
|
+
import { ThreadPrimitiveMessageByIndex, ThreadPrimitiveMessages, ThreadPrimitiveMessagesImpl, ThreadPrimitiveUnstable_MessageById } from "@assistant-ui/core/react";
|
|
2
|
+
export { ThreadPrimitiveMessageByIndex, ThreadPrimitiveMessages, ThreadPrimitiveMessagesImpl, ThreadPrimitiveUnstable_MessageById };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { ThreadPrimitiveMessageByIndex, ThreadPrimitiveMessages, ThreadPrimitiveMessagesImpl } from "@assistant-ui/core/react";
|
|
3
|
-
export { ThreadPrimitiveMessageByIndex, ThreadPrimitiveMessages, ThreadPrimitiveMessagesImpl };
|
|
2
|
+
import { ThreadPrimitiveMessageByIndex, ThreadPrimitiveMessages, ThreadPrimitiveMessagesImpl, ThreadPrimitiveUnstable_MessageById } from "@assistant-ui/core/react";
|
|
3
|
+
export { ThreadPrimitiveMessageByIndex, ThreadPrimitiveMessages, ThreadPrimitiveMessagesImpl, ThreadPrimitiveUnstable_MessageById };
|
|
@@ -4,15 +4,15 @@ import { ThreadPrimitiveEmpty } from "./thread/ThreadEmpty.js";
|
|
|
4
4
|
import { ThreadPrimitiveIf } from "./thread/ThreadIf.js";
|
|
5
5
|
import { ThreadPrimitiveViewport } from "./thread/ThreadViewport.js";
|
|
6
6
|
import { ThreadPrimitiveViewportFooter } from "./thread/ThreadViewportFooter.js";
|
|
7
|
-
import { ThreadPrimitiveMessageByIndex, ThreadPrimitiveMessages } from "./thread/ThreadMessages.js";
|
|
7
|
+
import { ThreadPrimitiveMessageByIndex, ThreadPrimitiveMessages, ThreadPrimitiveUnstable_MessageById } from "./thread/ThreadMessages.js";
|
|
8
8
|
import { ThreadPrimitiveScrollToBottom } from "./thread/ThreadScrollToBottom.js";
|
|
9
9
|
import { ThreadPrimitiveSuggestion } from "./thread/ThreadSuggestion.js";
|
|
10
10
|
import { ThreadPrimitiveSuggestionByIndex, ThreadPrimitiveSuggestions } from "./thread/ThreadSuggestions.js";
|
|
11
11
|
|
|
12
12
|
//#region src/primitives/thread.d.ts
|
|
13
13
|
declare namespace thread_d_exports {
|
|
14
|
-
export { ThreadPrimitiveEmpty as Empty, ThreadPrimitiveIf as If, ThreadPrimitiveMessageByIndex as MessageByIndex, ThreadPrimitiveMessages as Messages, ThreadPrimitiveRoot as Root, ThreadPrimitiveScrollToBottom as ScrollToBottom, ThreadPrimitiveSuggestion as Suggestion, ThreadPrimitiveSuggestionByIndex as SuggestionByIndex, ThreadPrimitiveSuggestions as Suggestions, ThreadPrimitiveViewport as Viewport, ThreadPrimitiveViewportFooter as ViewportFooter, ThreadPrimitiveViewportProvider as ViewportProvider };
|
|
14
|
+
export { ThreadPrimitiveEmpty as Empty, ThreadPrimitiveIf as If, ThreadPrimitiveMessageByIndex as MessageByIndex, ThreadPrimitiveMessages as Messages, ThreadPrimitiveRoot as Root, ThreadPrimitiveScrollToBottom as ScrollToBottom, ThreadPrimitiveSuggestion as Suggestion, ThreadPrimitiveSuggestionByIndex as SuggestionByIndex, ThreadPrimitiveSuggestions as Suggestions, ThreadPrimitiveUnstable_MessageById as Unstable_MessageById, ThreadPrimitiveViewport as Viewport, ThreadPrimitiveViewportFooter as ViewportFooter, ThreadPrimitiveViewportProvider as ViewportProvider };
|
|
15
15
|
}
|
|
16
16
|
//#endregion
|
|
17
|
-
export { ThreadPrimitiveEmpty as Empty, ThreadPrimitiveIf as If, ThreadPrimitiveMessageByIndex as MessageByIndex, ThreadPrimitiveMessages as Messages, ThreadPrimitiveRoot as Root, ThreadPrimitiveScrollToBottom as ScrollToBottom, ThreadPrimitiveSuggestion as Suggestion, ThreadPrimitiveSuggestionByIndex as SuggestionByIndex, ThreadPrimitiveSuggestions as Suggestions, ThreadPrimitiveViewport as Viewport, ThreadPrimitiveViewportFooter as ViewportFooter, ThreadPrimitiveViewportProvider as ViewportProvider, thread_d_exports };
|
|
17
|
+
export { ThreadPrimitiveEmpty as Empty, ThreadPrimitiveIf as If, ThreadPrimitiveMessageByIndex as MessageByIndex, ThreadPrimitiveMessages as Messages, ThreadPrimitiveRoot as Root, ThreadPrimitiveScrollToBottom as ScrollToBottom, ThreadPrimitiveSuggestion as Suggestion, ThreadPrimitiveSuggestionByIndex as SuggestionByIndex, ThreadPrimitiveSuggestions as Suggestions, ThreadPrimitiveUnstable_MessageById as Unstable_MessageById, ThreadPrimitiveViewport as Viewport, ThreadPrimitiveViewportFooter as ViewportFooter, ThreadPrimitiveViewportProvider as ViewportProvider, thread_d_exports };
|
|
18
18
|
//# sourceMappingURL=thread.d.ts.map
|
|
@@ -5,7 +5,7 @@ import { ThreadPrimitiveEmpty } from "./thread/ThreadEmpty.js";
|
|
|
5
5
|
import { ThreadPrimitiveIf } from "./thread/ThreadIf.js";
|
|
6
6
|
import { ThreadPrimitiveViewport } from "./thread/ThreadViewport.js";
|
|
7
7
|
import { ThreadPrimitiveViewportFooter } from "./thread/ThreadViewportFooter.js";
|
|
8
|
-
import { ThreadPrimitiveMessageByIndex, ThreadPrimitiveMessages } from "./thread/ThreadMessages.js";
|
|
8
|
+
import { ThreadPrimitiveMessageByIndex, ThreadPrimitiveMessages, ThreadPrimitiveUnstable_MessageById } from "./thread/ThreadMessages.js";
|
|
9
9
|
import { ThreadPrimitiveScrollToBottom } from "./thread/ThreadScrollToBottom.js";
|
|
10
10
|
import { ThreadPrimitiveSuggestion } from "./thread/ThreadSuggestion.js";
|
|
11
11
|
import { ThreadPrimitiveSuggestionByIndex, ThreadPrimitiveSuggestions } from "./thread/ThreadSuggestions.js";
|
|
@@ -20,11 +20,12 @@ var thread_exports = /* @__PURE__ */ __exportAll({
|
|
|
20
20
|
Suggestion: () => ThreadPrimitiveSuggestion,
|
|
21
21
|
SuggestionByIndex: () => ThreadPrimitiveSuggestionByIndex,
|
|
22
22
|
Suggestions: () => ThreadPrimitiveSuggestions,
|
|
23
|
+
Unstable_MessageById: () => ThreadPrimitiveUnstable_MessageById,
|
|
23
24
|
Viewport: () => ThreadPrimitiveViewport,
|
|
24
25
|
ViewportFooter: () => ThreadPrimitiveViewportFooter,
|
|
25
26
|
ViewportProvider: () => ThreadPrimitiveViewportProvider
|
|
26
27
|
});
|
|
27
28
|
//#endregion
|
|
28
|
-
export { ThreadPrimitiveEmpty as Empty, ThreadPrimitiveIf as If, ThreadPrimitiveMessageByIndex as MessageByIndex, ThreadPrimitiveMessages as Messages, ThreadPrimitiveRoot as Root, ThreadPrimitiveScrollToBottom as ScrollToBottom, ThreadPrimitiveSuggestion as Suggestion, ThreadPrimitiveSuggestionByIndex as SuggestionByIndex, ThreadPrimitiveSuggestions as Suggestions, ThreadPrimitiveViewport as Viewport, ThreadPrimitiveViewportFooter as ViewportFooter, ThreadPrimitiveViewportProvider as ViewportProvider, thread_exports };
|
|
29
|
+
export { ThreadPrimitiveEmpty as Empty, ThreadPrimitiveIf as If, ThreadPrimitiveMessageByIndex as MessageByIndex, ThreadPrimitiveMessages as Messages, ThreadPrimitiveRoot as Root, ThreadPrimitiveScrollToBottom as ScrollToBottom, ThreadPrimitiveSuggestion as Suggestion, ThreadPrimitiveSuggestionByIndex as SuggestionByIndex, ThreadPrimitiveSuggestions as Suggestions, ThreadPrimitiveUnstable_MessageById as Unstable_MessageById, ThreadPrimitiveViewport as Viewport, ThreadPrimitiveViewportFooter as ViewportFooter, ThreadPrimitiveViewportProvider as ViewportProvider, thread_exports };
|
|
29
30
|
|
|
30
31
|
//# sourceMappingURL=thread.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thread.js","names":["ThreadPrimitiveRoot","Root","ThreadPrimitiveEmpty","Empty","ThreadPrimitiveIf","If","ThreadPrimitiveViewport","Viewport","ThreadPrimitiveViewportProvider","ViewportProvider","ThreadPrimitiveViewportFooter","ViewportFooter","ThreadPrimitiveMessages","Messages","ThreadPrimitiveMessageByIndex","MessageByIndex","ThreadPrimitiveScrollToBottom","ScrollToBottom","ThreadPrimitiveSuggestion","Suggestion","ThreadPrimitiveSuggestions","Suggestions","ThreadPrimitiveSuggestionByIndex","SuggestionByIndex"],"sources":["../../src/primitives/thread.ts"],"sourcesContent":["export { ThreadPrimitiveRoot as Root } from \"./thread/ThreadRoot\";\nexport { ThreadPrimitiveEmpty as Empty } from \"./thread/ThreadEmpty\";\nexport { ThreadPrimitiveIf as If } from \"./thread/ThreadIf\";\nexport { ThreadPrimitiveViewport as Viewport } from \"./thread/ThreadViewport\";\nexport { ThreadPrimitiveViewportProvider as ViewportProvider } from \"../context/providers/ThreadViewportProvider\";\nexport { ThreadPrimitiveViewportFooter as ViewportFooter } from \"./thread/ThreadViewportFooter\";\nexport { ThreadPrimitiveMessages as Messages } from \"./thread/ThreadMessages\";\nexport { ThreadPrimitiveMessageByIndex as MessageByIndex } from \"./thread/ThreadMessages\";\nexport { ThreadPrimitiveScrollToBottom as ScrollToBottom } from \"./thread/ThreadScrollToBottom\";\nexport { ThreadPrimitiveSuggestion as Suggestion } from \"./thread/ThreadSuggestion\";\nexport {\n ThreadPrimitiveSuggestions as Suggestions,\n ThreadPrimitiveSuggestionByIndex as SuggestionByIndex,\n} from \"./thread/ThreadSuggestions\";\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"thread.js","names":["ThreadPrimitiveRoot","Root","ThreadPrimitiveEmpty","Empty","ThreadPrimitiveIf","If","ThreadPrimitiveViewport","Viewport","ThreadPrimitiveViewportProvider","ViewportProvider","ThreadPrimitiveViewportFooter","ViewportFooter","ThreadPrimitiveMessages","Messages","ThreadPrimitiveMessageByIndex","MessageByIndex","ThreadPrimitiveUnstable_MessageById","Unstable_MessageById","ThreadPrimitiveScrollToBottom","ScrollToBottom","ThreadPrimitiveSuggestion","Suggestion","ThreadPrimitiveSuggestions","Suggestions","ThreadPrimitiveSuggestionByIndex","SuggestionByIndex"],"sources":["../../src/primitives/thread.ts"],"sourcesContent":["export { ThreadPrimitiveRoot as Root } from \"./thread/ThreadRoot\";\nexport { ThreadPrimitiveEmpty as Empty } from \"./thread/ThreadEmpty\";\nexport { ThreadPrimitiveIf as If } from \"./thread/ThreadIf\";\nexport { ThreadPrimitiveViewport as Viewport } from \"./thread/ThreadViewport\";\nexport { ThreadPrimitiveViewportProvider as ViewportProvider } from \"../context/providers/ThreadViewportProvider\";\nexport { ThreadPrimitiveViewportFooter as ViewportFooter } from \"./thread/ThreadViewportFooter\";\nexport { ThreadPrimitiveMessages as Messages } from \"./thread/ThreadMessages\";\nexport { ThreadPrimitiveMessageByIndex as MessageByIndex } from \"./thread/ThreadMessages\";\nexport { ThreadPrimitiveUnstable_MessageById as Unstable_MessageById } from \"./thread/ThreadMessages\";\nexport { ThreadPrimitiveScrollToBottom as ScrollToBottom } from \"./thread/ThreadScrollToBottom\";\nexport { ThreadPrimitiveSuggestion as Suggestion } from \"./thread/ThreadSuggestion\";\nexport {\n ThreadPrimitiveSuggestions as Suggestions,\n ThreadPrimitiveSuggestionByIndex as SuggestionByIndex,\n} from \"./thread/ThreadSuggestions\";\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThreadListRoot.d.ts","names":[],"sources":["../../../src/primitives/threadList/ThreadListRoot.tsx"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"ThreadListRoot.d.ts","names":[],"sources":["../../../src/primitives/threadList/ThreadListRoot.tsx"],"mappings":";;;;KAUK,iBAAA,GAAoB,wBAAwB,QAAQ,SAAA,CAAU,GAAA;AAAA,kBAElD,uBAAA;EAAA,KACH,OAAA,GAAU,YAAA,QAAoB,SAAA,CAAU,GAAA;EAAA,KACxC,KAAA,GAAQ,iBAAA;AAAA;AAAA,cAGT,uBAAA,kBAAuB,yBAAA,CAAA,IAAA,CAAA,IAAA,iBAAA,eAAA,CAAA,cAAA,oBAAA,cAAA,CAAA,cAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Primitive } from "../../utils/Primitive.js";
|
|
3
|
+
import { ThreadListCollection } from "../threadListFocusGroup.js";
|
|
3
4
|
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
4
5
|
import { forwardRef } from "@assistant-ui/tap/react-shim";
|
|
5
6
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -8,9 +9,15 @@ const ThreadListPrimitiveRoot = forwardRef((props, ref) => {
|
|
|
8
9
|
const $ = c(3);
|
|
9
10
|
let t0;
|
|
10
11
|
if ($[0] !== props || $[1] !== ref) {
|
|
11
|
-
t0 = /* @__PURE__ */ jsx(
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
t0 = /* @__PURE__ */ jsx(ThreadListCollection.Provider, {
|
|
13
|
+
scope: void 0,
|
|
14
|
+
children: /* @__PURE__ */ jsx(ThreadListCollection.Slot, {
|
|
15
|
+
scope: void 0,
|
|
16
|
+
children: /* @__PURE__ */ jsx(Primitive.div, {
|
|
17
|
+
...props,
|
|
18
|
+
ref
|
|
19
|
+
})
|
|
20
|
+
})
|
|
14
21
|
});
|
|
15
22
|
$[0] = props;
|
|
16
23
|
$[1] = ref;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThreadListRoot.js","names":["c","_c","Primitive","ComponentPropsWithoutRef","ComponentRef","forwardRef","PrimitiveDivProps","div","ThreadListPrimitiveRoot","Element","Props","props","ref","$","t0","displayName"],"sources":["../../../src/primitives/threadList/ThreadListRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport { Primitive } from \"../../utils/Primitive\";\nimport {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\n\ntype PrimitiveDivProps = ComponentPropsWithoutRef<typeof Primitive.div>;\n\nexport namespace ThreadListPrimitiveRoot {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = PrimitiveDivProps;\n}\n\nexport const ThreadListPrimitiveRoot = forwardRef<\n ThreadListPrimitiveRoot.Element,\n ThreadListPrimitiveRoot.Props\n>((props, ref) => {\n return <Primitive.div {...props} ref={ref}
|
|
1
|
+
{"version":3,"file":"ThreadListRoot.js","names":["c","_c","Primitive","ComponentPropsWithoutRef","ComponentRef","forwardRef","ThreadListCollection","PrimitiveDivProps","div","ThreadListPrimitiveRoot","Element","Props","props","ref","$","t0","undefined","displayName"],"sources":["../../../src/primitives/threadList/ThreadListRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport { Primitive } from \"../../utils/Primitive\";\nimport {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { ThreadListCollection } from \"../threadListFocusGroup\";\n\ntype PrimitiveDivProps = ComponentPropsWithoutRef<typeof Primitive.div>;\n\nexport namespace ThreadListPrimitiveRoot {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = PrimitiveDivProps;\n}\n\nexport const ThreadListPrimitiveRoot = forwardRef<\n ThreadListPrimitiveRoot.Element,\n ThreadListPrimitiveRoot.Props\n>((props, ref) => {\n return (\n <ThreadListCollection.Provider scope={undefined}>\n <ThreadListCollection.Slot scope={undefined}>\n <Primitive.div {...props} ref={ref} />\n </ThreadListCollection.Slot>\n </ThreadListCollection.Provider>\n );\n});\n\nThreadListPrimitiveRoot.displayName = \"ThreadListPrimitive.Root\";\n"],"mappings":";;;;;;;AAiBA,MAAaS,0BAA0BJ,YAGrCO,OAAAC,QAAA;CAAA,MAAAC,IAAAb,EAAA,CAAA;CAAA,IAAAc;CAAA,IAAAD,EAAA,OAAAF,SAAAE,EAAA,OAAAD,KAAA;EAEEE,KAAA,oBAAA,qBAAA,UAAA;GAAsCC,OAAAA,KAAAA;aACpC,oBAAA,qBAAA,MAAA;IAAkCA,OAAAA,KAAAA;cAChC,oBAAA,UAAA,KAAA;KAAA,GAAmBJ;KAAYC;IAAG,CAAA;GACpC,CAAA;EACF,CAAA;EAAgCC,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAC;CAAA,OAAAA,KAAAD,EAAA;CAAA,OAJhCC;AAIgC,CAEnC;AAEDN,wBAAwBQ,cAAc"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { RefObject } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/primitives/threadListFocusGroup.d.ts
|
|
4
|
+
declare const useThreadListCollection: (scope: any) => () => {
|
|
5
|
+
ref: RefObject<HTMLButtonElement | null>;
|
|
6
|
+
}[];
|
|
7
|
+
declare const ThreadListCollection: {
|
|
8
|
+
readonly Provider: React.FC<{
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
scope: any;
|
|
11
|
+
}>;
|
|
12
|
+
readonly Slot: React.ForwardRefExoticComponent<import("@radix-ui/react-collection").CollectionProps & React.RefAttributes<HTMLElement>>;
|
|
13
|
+
readonly ItemSlot: import("react").ForwardRefExoticComponent<{
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
scope: any;
|
|
16
|
+
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
17
|
+
};
|
|
18
|
+
type ThreadListItemFocus = {
|
|
19
|
+
triggerRef: RefObject<HTMLButtonElement | null>;
|
|
20
|
+
moreRef: RefObject<HTMLButtonElement | null>;
|
|
21
|
+
};
|
|
22
|
+
declare const ThreadListItemFocusProvider: import("react").Provider<ThreadListItemFocus | null>;
|
|
23
|
+
declare const useThreadListItemFocus: () => ThreadListItemFocus | null;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { ThreadListCollection, ThreadListItemFocusProvider, useThreadListCollection, useThreadListItemFocus };
|
|
26
|
+
//# sourceMappingURL=threadListFocusGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"threadListFocusGroup.d.ts","names":[],"sources":["../../src/primitives/threadListFocusGroup.ts"],"mappings":";;;cAKmB,uBAAA,GAAuB,KAAA;OACS,SAAA,CAAA,iBAAA;AAAA;AAAA,cAEtC,oBAAA;EAAA;eAKgB,KAAA,CAAA,SAAA;;;;;;;;;KAFxB,mBAAA;EACH,UAAA,EAAY,SAAA,CAAU,iBAAA;EACtB,OAAA,EAAS,SAAA,CAAU,iBAAA;AAAA;AAAA,cAOR,2BAAA,kBAA2B,QAAA,CAAA,mBAAA;AAAA,cAE3B,sBAAA,QAA6B,mBAAmB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext, useContext } from "@assistant-ui/tap/react-shim";
|
|
3
|
+
import { createCollection } from "@radix-ui/react-collection";
|
|
4
|
+
//#region src/primitives/threadListFocusGroup.ts
|
|
5
|
+
const [collection, useThreadListCollection] = createCollection("ThreadList");
|
|
6
|
+
const ThreadListCollection = collection;
|
|
7
|
+
const ThreadListItemFocusContext = createContext(null);
|
|
8
|
+
const ThreadListItemFocusProvider = ThreadListItemFocusContext.Provider;
|
|
9
|
+
const useThreadListItemFocus = () => {
|
|
10
|
+
return useContext(ThreadListItemFocusContext);
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { ThreadListCollection, ThreadListItemFocusProvider, useThreadListCollection, useThreadListItemFocus };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=threadListFocusGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"threadListFocusGroup.js","names":["createCollection","createContext","useContext","RefObject","collection","useThreadListCollection","HTMLButtonElement","ThreadListCollection","ThreadListItemFocus","triggerRef","moreRef","ThreadListItemFocusContext","ThreadListItemFocusProvider","Provider","useThreadListItemFocus"],"sources":["../../src/primitives/threadListFocusGroup.ts"],"sourcesContent":["\"use client\";\n\nimport { createCollection } from \"@radix-ui/react-collection\";\nimport { createContext, useContext, type RefObject } from \"react\";\n\nconst [collection, useThreadListCollection] =\n createCollection<HTMLButtonElement>(\"ThreadList\");\n\nexport const ThreadListCollection = collection;\nexport { useThreadListCollection };\n\ntype ThreadListItemFocus = {\n triggerRef: RefObject<HTMLButtonElement | null>;\n moreRef: RefObject<HTMLButtonElement | null>;\n};\n\nconst ThreadListItemFocusContext = createContext<ThreadListItemFocus | null>(\n null,\n);\n\nexport const ThreadListItemFocusProvider = ThreadListItemFocusContext.Provider;\n\nexport const useThreadListItemFocus = (): ThreadListItemFocus | null =>\n useContext(ThreadListItemFocusContext);\n"],"mappings":";;;;AAKA,MAAM,CAACI,YAAYC,2BACjBL,iBAAoC,YAAY;AAElD,MAAaO,uBAAuBH;AAQpC,MAAMO,6BAA6BV,cACjC,IACF;AAEA,MAAaW,8BAA8BD,2BAA2BE;AAEtE,MAAaC,+BAAyB;CAAA,OACpCZ,WAAWS,0BAA0B;AAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThreadListItemRoot.d.ts","names":[],"sources":["../../../src/primitives/threadListItem/ThreadListItemRoot.tsx"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"ThreadListItemRoot.d.ts","names":[],"sources":["../../../src/primitives/threadListItem/ThreadListItemRoot.tsx"],"mappings":";;;;KAmBK,iBAAA,GAAoB,wBAAwB,QAAQ,SAAA,CAAU,GAAA;AAAA,kBAElD,2BAAA;EAAA,KACH,OAAA,GAAU,YAAA,QAAoB,SAAA,CAAU,GAAA;EAAA,KACxC,KAAA,GAAQ,iBAAA;AAAA;AAAA,cAGT,2BAAA,kBAA2B,yBAAA,CAAA,IAAA,CAAA,IAAA,iBAAA,eAAA,CAAA,cAAA,oBAAA,cAAA,CAAA,cAAA"}
|
|
@@ -1,40 +1,58 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Primitive } from "../../utils/Primitive.js";
|
|
3
|
+
import { ThreadListItemFocusProvider, useThreadListCollection } from "../threadListFocusGroup.js";
|
|
3
4
|
import { useAuiState } from "@assistant-ui/store";
|
|
4
|
-
import {
|
|
5
|
-
import { forwardRef } from "@assistant-ui/tap/react-shim";
|
|
5
|
+
import { forwardRef, useMemo, useRef } from "@assistant-ui/tap/react-shim";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import { composeEventHandlers } from "@radix-ui/primitive";
|
|
8
|
+
import { Direction } from "radix-ui";
|
|
7
9
|
//#region src/primitives/threadListItem/ThreadListItemRoot.tsx
|
|
8
10
|
const ThreadListItemPrimitiveRoot = forwardRef((props, ref) => {
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
11
|
+
const isMain = useAuiState((s) => s.threads.mainThreadId === s.threadListItem.id);
|
|
12
|
+
const triggerRef = useRef(null);
|
|
13
|
+
const moreRef = useRef(null);
|
|
14
|
+
const focus = useMemo(() => ({
|
|
15
|
+
triggerRef,
|
|
16
|
+
moreRef
|
|
17
|
+
}), []);
|
|
18
|
+
const getItems = useThreadListCollection(void 0);
|
|
19
|
+
const direction = Direction.useDirection();
|
|
20
|
+
const onKeyDown = (event) => {
|
|
21
|
+
const forwardKey = direction === "rtl" ? "ArrowLeft" : "ArrowRight";
|
|
22
|
+
const backKey = direction === "rtl" ? "ArrowRight" : "ArrowLeft";
|
|
23
|
+
const trigger = triggerRef.current;
|
|
24
|
+
const more = moreRef.current;
|
|
25
|
+
if (trigger && event.target === trigger) {
|
|
26
|
+
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
27
|
+
const triggers = getItems().map((item) => item.ref.current).filter((node) => node !== null);
|
|
28
|
+
const next = triggers[triggers.indexOf(trigger) + (event.key === "ArrowDown" ? 1 : -1)];
|
|
29
|
+
if (next) {
|
|
30
|
+
next.focus();
|
|
31
|
+
event.preventDefault();
|
|
32
|
+
}
|
|
33
|
+
} else if (event.key === forwardKey && more) {
|
|
34
|
+
more.focus();
|
|
35
|
+
event.preventDefault();
|
|
36
|
+
}
|
|
37
|
+
} else if (more && event.target === more && event.key === backKey) {
|
|
38
|
+
trigger?.focus();
|
|
39
|
+
event.preventDefault();
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
return /* @__PURE__ */ jsx(ThreadListItemFocusProvider, {
|
|
43
|
+
value: focus,
|
|
44
|
+
children: /* @__PURE__ */ jsx(Primitive.div, {
|
|
45
|
+
...isMain ? {
|
|
46
|
+
"data-active": "true",
|
|
47
|
+
"aria-current": "true"
|
|
48
|
+
} : null,
|
|
24
49
|
...props,
|
|
50
|
+
onKeyDown: composeEventHandlers(props.onKeyDown, onKeyDown),
|
|
25
51
|
ref
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
$[3] = ref;
|
|
29
|
-
$[4] = t0;
|
|
30
|
-
$[5] = t1;
|
|
31
|
-
} else t1 = $[5];
|
|
32
|
-
return t1;
|
|
52
|
+
})
|
|
53
|
+
});
|
|
33
54
|
});
|
|
34
55
|
ThreadListItemPrimitiveRoot.displayName = "ThreadListItemPrimitive.Root";
|
|
35
|
-
function _temp(s) {
|
|
36
|
-
return s.threads.mainThreadId === s.threadListItem.id;
|
|
37
|
-
}
|
|
38
56
|
//#endregion
|
|
39
57
|
export { ThreadListItemPrimitiveRoot };
|
|
40
58
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThreadListItemRoot.js","names":["
|
|
1
|
+
{"version":3,"file":"ThreadListItemRoot.js","names":["Primitive","ComponentRef","forwardRef","ComponentPropsWithoutRef","KeyboardEvent","useMemo","useRef","useAuiState","composeEventHandlers","Direction","ThreadListItemFocusProvider","useThreadListCollection","PrimitiveDivProps","div","ThreadListItemPrimitiveRoot","Element","Props","props","ref","isMain","s","threads","mainThreadId","threadListItem","id","triggerRef","HTMLButtonElement","moreRef","focus","getItems","undefined","direction","useDirection","onKeyDown","event","HTMLDivElement","forwardKey","backKey","trigger","current","more","target","key","triggers","map","item","filter","node","next","indexOf","preventDefault","displayName"],"sources":["../../../src/primitives/threadListItem/ThreadListItemRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport { Primitive } from \"../../utils/Primitive\";\nimport {\n type ComponentRef,\n forwardRef,\n type ComponentPropsWithoutRef,\n type KeyboardEvent,\n useMemo,\n useRef,\n} from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { Direction } from \"radix-ui\";\nimport {\n ThreadListItemFocusProvider,\n useThreadListCollection,\n} from \"../threadListFocusGroup\";\n\ntype PrimitiveDivProps = ComponentPropsWithoutRef<typeof Primitive.div>;\n\nexport namespace ThreadListItemPrimitiveRoot {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = PrimitiveDivProps;\n}\n\nexport const ThreadListItemPrimitiveRoot = forwardRef<\n ThreadListItemPrimitiveRoot.Element,\n ThreadListItemPrimitiveRoot.Props\n>((props, ref) => {\n const isMain = useAuiState(\n (s) => s.threads.mainThreadId === s.threadListItem.id,\n );\n\n const triggerRef = useRef<HTMLButtonElement | null>(null);\n const moreRef = useRef<HTMLButtonElement | null>(null);\n const focus = useMemo(() => ({ triggerRef, moreRef }), []);\n\n const getItems = useThreadListCollection(undefined);\n const direction = Direction.useDirection();\n\n const onKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n const forwardKey = direction === \"rtl\" ? \"ArrowLeft\" : \"ArrowRight\";\n const backKey = direction === \"rtl\" ? \"ArrowRight\" : \"ArrowLeft\";\n const trigger = triggerRef.current;\n const more = moreRef.current;\n\n if (trigger && event.target === trigger) {\n if (event.key === \"ArrowDown\" || event.key === \"ArrowUp\") {\n const triggers = getItems()\n .map((item) => item.ref.current)\n .filter((node): node is HTMLButtonElement => node !== null);\n const next =\n triggers[\n triggers.indexOf(trigger) + (event.key === \"ArrowDown\" ? 1 : -1)\n ];\n if (next) {\n next.focus();\n event.preventDefault();\n }\n } else if (event.key === forwardKey && more) {\n more.focus();\n event.preventDefault();\n }\n } else if (more && event.target === more && event.key === backKey) {\n trigger?.focus();\n event.preventDefault();\n }\n };\n\n return (\n <ThreadListItemFocusProvider value={focus}>\n <Primitive.div\n {...(isMain ? { \"data-active\": \"true\", \"aria-current\": \"true\" } : null)}\n {...props}\n onKeyDown={composeEventHandlers(props.onKeyDown, onKeyDown)}\n ref={ref}\n />\n </ThreadListItemFocusProvider>\n );\n});\n\nThreadListItemPrimitiveRoot.displayName = \"ThreadListItemPrimitive.Root\";\n"],"mappings":";;;;;;;;;AA0BA,MAAac,8BAA8BZ,YAGxCe,OAAOC,QAAQ;CAChB,MAAMC,SAASZ,aACZa,MAAMA,EAAEC,QAAQC,iBAAiBF,EAAEG,eAAeC,EACrD;CAEA,MAAMC,aAAanB,OAAiC,IAAI;CACxD,MAAMqB,UAAUrB,OAAiC,IAAI;CACrD,MAAMsB,QAAQvB,eAAe;EAAEoB;EAAYE;CAAQ,IAAI,CAAA,CAAE;CAEzD,MAAME,WAAWlB,wBAAwBmB,KAAAA,CAAS;CAClD,MAAMC,YAAYtB,UAAUuB,aAAa;CAEzC,MAAMC,aAAaC,UAAyC;EAC1D,MAAME,aAAaL,cAAc,QAAQ,cAAc;EACvD,MAAMM,UAAUN,cAAc,QAAQ,eAAe;EACrD,MAAMO,UAAUb,WAAWc;EAC3B,MAAMC,OAAOb,QAAQY;EAErB,IAAID,WAAWJ,MAAMO,WAAWH;OAC1BJ,MAAMQ,QAAQ,eAAeR,MAAMQ,QAAQ,WAAW;IACxD,MAAMC,WAAWd,SAAS,CAAC,CACxBe,KAAKC,SAASA,KAAK3B,IAAIqB,OAAO,CAAC,CAC/BO,QAAQC,SAAoCA,SAAS,IAAI;IAC5D,MAAMC,OACJL,SACEA,SAASM,QAAQX,OAAO,KAAKJ,MAAMQ,QAAQ,cAAc,IAAI;IAEjE,IAAIM,MAAM;KACRA,KAAKpB,MAAM;KACXM,MAAMgB,eAAe;IACvB;GACF,OAAO,IAAIhB,MAAMQ,QAAQN,cAAcI,MAAM;IAC3CA,KAAKZ,MAAM;IACXM,MAAMgB,eAAe;GACvB;SACK,IAAIV,QAAQN,MAAMO,WAAWD,QAAQN,MAAMQ,QAAQL,SAAS;GACjEC,SAASV,MAAM;GACfM,MAAMgB,eAAe;EACvB;CACF;CAEA,OACE,oBAAC,6BAAD;EAA6B,OAAOtB;YAClC,oBAAC,UAAU,KAAX;GACE,GAAKT,SAAS;IAAE,eAAe;IAAQ,gBAAgB;GAAO,IAAI;GAClE,GAAIF;GACJ,WAAWT,qBAAqBS,MAAMgB,WAAWA,SAAS;GACrDf;EAAI,CAAA;CAEgB,CAAA;AAEjC,CAAC;AAEDJ,4BAA4BqC,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThreadListItemTrigger.d.ts","names":[],"sources":["../../../src/primitives/threadListItem/ThreadListItemTrigger.
|
|
1
|
+
{"version":3,"file":"ThreadListItemTrigger.d.ts","names":[],"sources":["../../../src/primitives/threadListItem/ThreadListItemTrigger.tsx"],"mappings":";;;cAeM,wBAAA;AAAA,kBAKW,8BAAA;EAAA,KACH,OAAA,GAAU,mBAAA;EAAA,KACV,KAAA,GAAQ,iBAAA,QAAyB,wBAAA;AAAA;AAAA,cAQlC,8BAAA,kBAA8B,yBAAA,CAAA,IAAA,CAAA,IAAA,iBAAA,eAAA,CAAA,iBAAA,oBAAA,oBAAA,CAAA,iBAAA"}
|
|
@@ -1,12 +1,36 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createActionButton } from "../../utils/createActionButton.js";
|
|
3
|
+
import { ThreadListCollection, useThreadListItemFocus } from "../threadListFocusGroup.js";
|
|
4
|
+
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
3
5
|
import { useThreadListItemTrigger } from "@assistant-ui/core/react";
|
|
4
|
-
|
|
6
|
+
import { forwardRef } from "@assistant-ui/tap/react-shim";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
import { useComposedRefs } from "@radix-ui/react-compose-refs";
|
|
9
|
+
//#region src/primitives/threadListItem/ThreadListItemTrigger.tsx
|
|
5
10
|
const useThreadListItemTrigger$1 = () => {
|
|
6
11
|
const { switchTo } = useThreadListItemTrigger();
|
|
7
12
|
return switchTo;
|
|
8
13
|
};
|
|
9
|
-
const
|
|
14
|
+
const ThreadListItemTriggerButton = createActionButton("ThreadListItemPrimitive.Trigger", useThreadListItemTrigger$1);
|
|
15
|
+
const ThreadListItemPrimitiveTrigger = forwardRef((props, forwardedRef) => {
|
|
16
|
+
const $ = c(3);
|
|
17
|
+
const ref = useComposedRefs(forwardedRef, useThreadListItemFocus()?.triggerRef);
|
|
18
|
+
let t0;
|
|
19
|
+
if ($[0] !== props || $[1] !== ref) {
|
|
20
|
+
t0 = /* @__PURE__ */ jsx(ThreadListCollection.ItemSlot, {
|
|
21
|
+
scope: void 0,
|
|
22
|
+
children: /* @__PURE__ */ jsx(ThreadListItemTriggerButton, {
|
|
23
|
+
...props,
|
|
24
|
+
ref
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
$[0] = props;
|
|
28
|
+
$[1] = ref;
|
|
29
|
+
$[2] = t0;
|
|
30
|
+
} else t0 = $[2];
|
|
31
|
+
return t0;
|
|
32
|
+
});
|
|
33
|
+
ThreadListItemPrimitiveTrigger.displayName = "ThreadListItemPrimitive.Trigger";
|
|
10
34
|
//#endregion
|
|
11
35
|
export { ThreadListItemPrimitiveTrigger };
|
|
12
36
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThreadListItemTrigger.js","names":["ActionButtonElement","ActionButtonProps","createActionButton","useThreadListItemTrigger","useThreadListItemTriggerBehavior","switchTo","ThreadListItemPrimitiveTrigger","Element","Props"],"sources":["../../../src/primitives/threadListItem/ThreadListItemTrigger.
|
|
1
|
+
{"version":3,"file":"ThreadListItemTrigger.js","names":["c","_c","forwardRef","useComposedRefs","ActionButtonElement","ActionButtonProps","createActionButton","useThreadListItemTrigger","useThreadListItemTriggerBehavior","ThreadListCollection","useThreadListItemFocus","switchTo","ThreadListItemPrimitiveTrigger","Element","Props","ThreadListItemTriggerButton","props","forwardedRef","$","focus","ref","triggerRef","t0","undefined","displayName"],"sources":["../../../src/primitives/threadListItem/ThreadListItemTrigger.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef } from \"react\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport {\n type ActionButtonElement,\n type ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useThreadListItemTrigger as useThreadListItemTriggerBehavior } from \"@assistant-ui/core/react\";\nimport {\n ThreadListCollection,\n useThreadListItemFocus,\n} from \"../threadListFocusGroup\";\n\nconst useThreadListItemTrigger = () => {\n const { switchTo } = useThreadListItemTriggerBehavior();\n return switchTo;\n};\n\nexport namespace ThreadListItemPrimitiveTrigger {\n export type Element = ActionButtonElement;\n export type Props = ActionButtonProps<typeof useThreadListItemTrigger>;\n}\n\nconst ThreadListItemTriggerButton = createActionButton(\n \"ThreadListItemPrimitive.Trigger\",\n useThreadListItemTrigger,\n);\n\nexport const ThreadListItemPrimitiveTrigger = forwardRef<\n ThreadListItemPrimitiveTrigger.Element,\n ThreadListItemPrimitiveTrigger.Props\n>((props, forwardedRef) => {\n const focus = useThreadListItemFocus();\n const ref = useComposedRefs(forwardedRef, focus?.triggerRef);\n\n return (\n <ThreadListCollection.ItemSlot scope={undefined}>\n <ThreadListItemTriggerButton {...props} ref={ref} />\n </ThreadListCollection.ItemSlot>\n );\n});\n\nThreadListItemPrimitiveTrigger.displayName = \"ThreadListItemPrimitive.Trigger\";\n"],"mappings":";;;;;;;;;AAeA,MAAMO,mCAA2B;CAC/B,MAAA,EAAAI,aAAqBH,yBAAiC;CAAE,OACjDG;AAAQ;AAQjB,MAAMI,8BAA8BT,mBAClC,mCACAC,0BACF;AAEA,MAAaK,iCAAiCV,YAG5Cc,OAAAC,iBAAA;CAAA,MAAAC,IAAAjB,EAAA,CAAA;CAEA,MAAAmB,MAAYjB,gBAAgBc,cADdP,uBAC4BS,CAAK,EAAAE,UAAY;CAAE,IAAAC;CAAA,IAAAJ,EAAA,OAAAF,SAAAE,EAAA,OAAAE,KAAA;EAG3DE,KAAA,oBAAA,qBAAA,UAAA;GAAsCC,OAAAA,KAAAA;aACpC,oBAAC,6BAAD;IAA4B,GAAKP;IAAYI;GAAG,CAAA;EAClD,CAAA;EAAgCF,EAAA,KAAAF;EAAAE,EAAA,KAAAE;EAAAF,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,OAFhCI;AAEgC,CAEnC;AAEDV,+BAA+BY,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThreadListItemMoreContent.d.ts","names":[],"sources":["../../../src/primitives/threadListItemMore/ThreadListItemMoreContent.tsx"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"ThreadListItemMoreContent.d.ts","names":[],"sources":["../../../src/primitives/threadListItemMore/ThreadListItemMoreContent.tsx"],"mappings":";;;;;kBAkBiB,kCAAA;EAAA,KACH,OAAA,GAAU,YAAA,QAAoB,YAAA,CAAsB,OAAA;EAAA,KACpD,KAAA,GAAQ,mBAAA,QACX,YAAA,CAAsB,OAAA;IAE7B,WAAA,GACI,wBAAA,QAAgC,YAAA,CAAsB,MAAA;EAAA;AAAA;AAAA,cAKjD,kCAAA,kBAAkC,yBAAA,CAAA,IAAA,CAAA,YAAA,CAAA,wBAAA,mBAAA,aAAA,CAAA,cAAA;;;gBALvC,wBAAA,QAAgC,YAAA,CAAsB,MAAA;AAAA"}
|
|
@@ -1,59 +1,84 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { DropdownMenuRenderContent } from "../dropdownMenuRenderPrimitives.js";
|
|
3
|
+
import { useThreadListItemFocus } from "../threadListFocusGroup.js";
|
|
3
4
|
import { useDropdownMenuScope } from "./scope.js";
|
|
5
|
+
import { useThreadListItemMoreSetOpen, useThreadListItemMoreSharedFocusGroup } from "./ThreadListItemMoreRoot.js";
|
|
4
6
|
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
5
7
|
import { forwardRef } from "@assistant-ui/tap/react-shim";
|
|
6
8
|
import { jsx } from "react/jsx-runtime";
|
|
7
|
-
import {
|
|
9
|
+
import { composeEventHandlers } from "@radix-ui/primitive";
|
|
10
|
+
import { Direction, DropdownMenu } from "radix-ui";
|
|
8
11
|
//#region src/primitives/threadListItemMore/ThreadListItemMoreContent.tsx
|
|
9
12
|
const ThreadListItemMorePrimitiveContent = forwardRef((t0, forwardedRef) => {
|
|
10
|
-
const $ = c(
|
|
11
|
-
|
|
12
|
-
let portalProps;
|
|
13
|
-
let props;
|
|
14
|
-
let t1;
|
|
15
|
-
if ($[0] !== t0) {
|
|
16
|
-
({__scopeThreadListItemMore, portalProps, sideOffset: t1, ...props} = t0);
|
|
17
|
-
$[0] = t0;
|
|
18
|
-
$[1] = __scopeThreadListItemMore;
|
|
19
|
-
$[2] = portalProps;
|
|
20
|
-
$[3] = props;
|
|
21
|
-
$[4] = t1;
|
|
22
|
-
} else {
|
|
23
|
-
__scopeThreadListItemMore = $[1];
|
|
24
|
-
portalProps = $[2];
|
|
25
|
-
props = $[3];
|
|
26
|
-
t1 = $[4];
|
|
27
|
-
}
|
|
13
|
+
const $ = c(21);
|
|
14
|
+
const { __scopeThreadListItemMore, portalProps, sideOffset: t1, ...props } = t0;
|
|
28
15
|
const sideOffset = t1 === void 0 ? 4 : t1;
|
|
29
16
|
const scope = useDropdownMenuScope(__scopeThreadListItemMore);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
17
|
+
const setOpen = useThreadListItemMoreSetOpen();
|
|
18
|
+
const focus = useThreadListItemFocus();
|
|
19
|
+
const sharedFocusGroup = useThreadListItemMoreSharedFocusGroup();
|
|
20
|
+
const closeKey = Direction.useDirection() === "rtl" ? "ArrowRight" : "ArrowLeft";
|
|
21
|
+
const t2 = DropdownMenu;
|
|
22
|
+
const T0 = DropdownMenuRenderContent;
|
|
23
|
+
let t3;
|
|
24
|
+
if ($[0] !== closeKey || $[1] !== focus?.moreRef || $[2] !== setOpen || $[3] !== sharedFocusGroup) {
|
|
25
|
+
t3 = (event) => {
|
|
26
|
+
if (!sharedFocusGroup || event.key !== closeKey) return;
|
|
27
|
+
event.preventDefault();
|
|
28
|
+
setOpen(false);
|
|
29
|
+
focus?.moreRef.current?.focus();
|
|
30
|
+
};
|
|
31
|
+
$[0] = closeKey;
|
|
32
|
+
$[1] = focus?.moreRef;
|
|
33
|
+
$[2] = setOpen;
|
|
34
|
+
$[3] = sharedFocusGroup;
|
|
35
|
+
$[4] = t3;
|
|
36
|
+
} else t3 = $[4];
|
|
37
|
+
const t4 = composeEventHandlers(props.onKeyDown, t3);
|
|
38
|
+
let t5;
|
|
39
|
+
if ($[5] !== focus?.moreRef || $[6] !== sharedFocusGroup) {
|
|
40
|
+
t5 = () => {
|
|
41
|
+
if (!sharedFocusGroup) return;
|
|
42
|
+
focus?.moreRef.current?.focus();
|
|
43
|
+
};
|
|
44
|
+
$[5] = focus?.moreRef;
|
|
45
|
+
$[6] = sharedFocusGroup;
|
|
46
|
+
$[7] = t5;
|
|
47
|
+
} else t5 = $[7];
|
|
48
|
+
const t6 = composeEventHandlers(props.onEscapeKeyDown, t5);
|
|
49
|
+
let t7;
|
|
50
|
+
if ($[8] !== T0 || $[9] !== forwardedRef || $[10] !== props || $[11] !== scope || $[12] !== sideOffset || $[13] !== t4 || $[14] !== t6) {
|
|
51
|
+
t7 = /* @__PURE__ */ jsx(T0, {
|
|
33
52
|
...scope,
|
|
34
53
|
...props,
|
|
54
|
+
onKeyDown: t4,
|
|
55
|
+
onEscapeKeyDown: t6,
|
|
35
56
|
ref: forwardedRef,
|
|
36
57
|
sideOffset
|
|
37
58
|
});
|
|
38
|
-
$[
|
|
39
|
-
$[
|
|
40
|
-
$[
|
|
41
|
-
$[
|
|
42
|
-
$[
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
59
|
+
$[8] = T0;
|
|
60
|
+
$[9] = forwardedRef;
|
|
61
|
+
$[10] = props;
|
|
62
|
+
$[11] = scope;
|
|
63
|
+
$[12] = sideOffset;
|
|
64
|
+
$[13] = t4;
|
|
65
|
+
$[14] = t6;
|
|
66
|
+
$[15] = t7;
|
|
67
|
+
} else t7 = $[15];
|
|
68
|
+
let t8;
|
|
69
|
+
if ($[16] !== portalProps || $[17] !== scope || $[18] !== t2.Portal || $[19] !== t7) {
|
|
70
|
+
t8 = /* @__PURE__ */ jsx(t2.Portal, {
|
|
47
71
|
...scope,
|
|
48
72
|
...portalProps,
|
|
49
|
-
children:
|
|
73
|
+
children: t7
|
|
50
74
|
});
|
|
51
|
-
$[
|
|
52
|
-
$[
|
|
53
|
-
$[
|
|
54
|
-
$[
|
|
55
|
-
|
|
56
|
-
|
|
75
|
+
$[16] = portalProps;
|
|
76
|
+
$[17] = scope;
|
|
77
|
+
$[18] = t2.Portal;
|
|
78
|
+
$[19] = t7;
|
|
79
|
+
$[20] = t8;
|
|
80
|
+
} else t8 = $[20];
|
|
81
|
+
return t8;
|
|
57
82
|
});
|
|
58
83
|
ThreadListItemMorePrimitiveContent.displayName = "ThreadListItemMorePrimitive.Content";
|
|
59
84
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThreadListItemMoreContent.js","names":["c","_c","ComponentPropsWithoutRef","ComponentRef","forwardRef","DropdownMenu","DropdownMenuPrimitive","WithRenderPropProps","DropdownMenuRenderContent","ScopedProps","useDropdownMenuScope","ThreadListItemMorePrimitiveContent","Element","Content","Props","portalProps","Portal","t0","forwardedRef","$","__scopeThreadListItemMore","
|
|
1
|
+
{"version":3,"file":"ThreadListItemMoreContent.js","names":["c","_c","ComponentPropsWithoutRef","ComponentRef","forwardRef","Direction","DropdownMenu","DropdownMenuPrimitive","composeEventHandlers","WithRenderPropProps","DropdownMenuRenderContent","useThreadListItemFocus","useThreadListItemMoreSharedFocusGroup","useThreadListItemMoreSetOpen","ScopedProps","useDropdownMenuScope","ThreadListItemMorePrimitiveContent","Element","Content","Props","portalProps","Portal","t0","forwardedRef","$","__scopeThreadListItemMore","sideOffset","t1","props","undefined","scope","setOpen","focus","sharedFocusGroup","direction","useDirection","closeKey","t2","T0","t3","moreRef","event","key","preventDefault","current","t4","onKeyDown","t5","t6","onEscapeKeyDown","t7","t8","displayName"],"sources":["../../../src/primitives/threadListItemMore/ThreadListItemMoreContent.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Direction, DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport type { WithRenderPropProps } from \"../../utils/Primitive\";\nimport { DropdownMenuRenderContent } from \"../dropdownMenuRenderPrimitives\";\nimport { useThreadListItemFocus } from \"../threadListFocusGroup\";\nimport {\n useThreadListItemMoreSharedFocusGroup,\n useThreadListItemMoreSetOpen,\n} from \"./ThreadListItemMoreRoot\";\nimport { type ScopedProps, useDropdownMenuScope } from \"./scope\";\n\nexport namespace ThreadListItemMorePrimitiveContent {\n export type Element = ComponentRef<typeof DropdownMenuPrimitive.Content>;\n export type Props = WithRenderPropProps<\n typeof DropdownMenuPrimitive.Content\n > & {\n portalProps?:\n | ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Portal>\n | undefined;\n };\n}\n\nexport const ThreadListItemMorePrimitiveContent = forwardRef<\n ThreadListItemMorePrimitiveContent.Element,\n ThreadListItemMorePrimitiveContent.Props\n>(\n (\n {\n __scopeThreadListItemMore,\n portalProps,\n sideOffset = 4,\n ...props\n }: ScopedProps<ThreadListItemMorePrimitiveContent.Props>,\n forwardedRef,\n ) => {\n const scope = useDropdownMenuScope(__scopeThreadListItemMore);\n const setOpen = useThreadListItemMoreSetOpen();\n const focus = useThreadListItemFocus();\n const sharedFocusGroup = useThreadListItemMoreSharedFocusGroup();\n const direction = Direction.useDirection();\n const closeKey = direction === \"rtl\" ? \"ArrowRight\" : \"ArrowLeft\";\n\n return (\n <DropdownMenuPrimitive.Portal {...scope} {...portalProps}>\n <DropdownMenuRenderContent\n {...scope}\n {...props}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n if (!sharedFocusGroup || event.key !== closeKey) return;\n event.preventDefault();\n setOpen(false);\n focus?.moreRef.current?.focus();\n })}\n onEscapeKeyDown={composeEventHandlers(props.onEscapeKeyDown, () => {\n if (!sharedFocusGroup) return;\n focus?.moreRef.current?.focus();\n })}\n ref={forwardedRef}\n sideOffset={sideOffset}\n />\n </DropdownMenuPrimitive.Portal>\n );\n },\n);\n\nThreadListItemMorePrimitiveContent.displayName =\n \"ThreadListItemMorePrimitive.Content\";\n"],"mappings":";;;;;;;;;;;AA6BA,MAAagB,qCAAqCZ,YAIhDkB,IAAAC,iBAAA;CAAA,MAAAC,IAAAvB,EAAA,EAAA;CACE,MAAA,EAAAwB,2BAAAL,aAAAM,YAAAC,IAAA,GAAAC,UAAAN;CAGE,MAAAI,aAAAC,OAAAE,KAAAA,IAAA,IAAAF;CAKF,MAAAG,QAAcf,qBAAqBU,yBAAyB;CAC5D,MAAAM,UAAgBlB,6BAA6B;CAC7C,MAAAmB,QAAcrB,uBAAuB;CACrC,MAAAsB,mBAAyBrB,sCAAsC;CAE/D,MAAAwB,WADkB/B,UAAS8B,aACVD,MAAc,QAAd,eAAA;CAGd,MAAAG,KAAA9B;CACE,MAAA+B,KAAA5B;CAAyB,IAAA6B;CAAA,IAAAf,EAAA,OAAAY,YAAAZ,EAAA,OAAAQ,OAAAQ,WAAAhB,EAAA,OAAAO,WAAAP,EAAA,OAAAS,kBAAA;EAGyBM,MAAAE,UAAA;GAC/C,IAAI,CAACR,oBAAoBQ,MAAKC,QAASN,UAAQ;GAC/CK,MAAKE,eAAgB;GACrBZ,QAAQ,KAAK;GACbC,OAAKQ,QAAiBI,SAAOZ,MAAC;EAAC;EAChCR,EAAA,KAAAY;EAAAZ,EAAA,KAAAQ,OAAAQ;EAAAhB,EAAA,KAAAO;EAAAP,EAAA,KAAAS;EAAAT,EAAA,KAAAe;CAAA,OAAAA,KAAAf,EAAA;CALU,MAAAqB,KAAArC,qBAAqBoB,MAAKkB,WAAYP,EAKhD;CAAC,IAAAQ;CAAA,IAAAvB,EAAA,OAAAQ,OAAAQ,WAAAhB,EAAA,OAAAS,kBAAA;EAC2Dc,WAAA;GAC3D,IAAI,CAACd,kBAAgB;GACrBD,OAAKQ,QAAiBI,SAAOZ,MAAC;EAAC;EAChCR,EAAA,KAAAQ,OAAAQ;EAAAhB,EAAA,KAAAS;EAAAT,EAAA,KAAAuB;CAAA,OAAAA,KAAAvB,EAAA;CAHgB,MAAAwB,KAAAxC,qBAAqBoB,MAAKqB,iBAAkBF,EAG5D;CAAC,IAAAG;CAAA,IAAA1B,EAAA,OAAAc,MAAAd,EAAA,OAAAD,gBAAAC,EAAA,QAAAI,SAAAJ,EAAA,QAAAM,SAAAN,EAAA,QAAAE,cAAAF,EAAA,QAAAqB,MAAArB,EAAA,QAAAwB,IAAA;EAZJE,KAAA,oBAAC,IAAD;GAA0B,GACpBpB;GAAK,GACLF;GACO,WAAAiB;GAMM,iBAAAG;GAIZzB,KAAAA;GACOG;EAAU,CAAA;EACtBF,EAAA,KAAAc;EAAAd,EAAA,KAAAD;EAAAC,EAAA,MAAAI;EAAAJ,EAAA,MAAAM;EAAAN,EAAA,MAAAE;EAAAF,EAAA,MAAAqB;EAAArB,EAAA,MAAAwB;EAAAxB,EAAA,MAAA0B;CAAA,OAAAA,KAAA1B,EAAA;CAAA,IAAA2B;CAAA,IAAA3B,EAAA,QAAAJ,eAAAI,EAAA,QAAAM,SAAAN,EAAA,QAAAa,GAAAhB,UAAAG,EAAA,QAAA0B,IAAA;EAhBJC,KAAA,oBAAA,GAAA,QAAA;GAAA,GAAkCrB;GAAK,GAAMV;aAC3C8B;EAgBF,CAAA;EAA+B1B,EAAA,MAAAJ;EAAAI,EAAA,MAAAM;EAAAN,EAAA,MAAAa,GAAAhB;EAAAG,EAAA,MAAA0B;EAAA1B,EAAA,MAAA2B;CAAA,OAAAA,KAAA3B,EAAA;CAAA,OAjB/B2B;AAiB+B,CAGrC;AAEAnC,mCAAmCoC,cACjC"}
|