@assistant-ui/react 0.15.31 → 0.15.32
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/_virtual/_rolldown/runtime.js +1 -2
- package/dist/adapters/OpenAIRealtimeVoiceAdapter.js +1 -2
- package/dist/assistant-transport.js +1 -2
- package/dist/cloud-renderer/CloudRendererHost.js +1 -2
- package/dist/context/ReadonlyStore.js +1 -2
- package/dist/context/providers/MessageProvider.js +1 -2
- package/dist/context/providers/ThreadViewportProvider.js +1 -2
- package/dist/context/react/ThreadViewportContext.js +1 -2
- package/dist/context/react/utils/createContextHook.js +1 -2
- package/dist/context/react/utils/createContextStoreHook.js +1 -2
- package/dist/context/stores/ThreadViewport.js +1 -2
- package/dist/devtools/DevToolsHooks.js +1 -2
- package/dist/hooks/useMessageQuote.js +1 -2
- package/dist/hooks/useMessageTiming.js +1 -2
- package/dist/hooks/useToolCallElapsed.js +1 -2
- package/dist/internal.js +1 -2
- package/dist/legacy-runtime/AssistantRuntimeProvider.js +1 -2
- package/dist/mcp-apps/McpAppRenderer.d.ts.map +1 -1
- package/dist/mcp-apps/McpAppRenderer.js +3 -3
- package/dist/mcp-apps/McpAppRenderer.js.map +1 -1
- package/dist/mcp-apps/McpAppsRemoteHost.js +1 -2
- package/dist/mcp-apps/app-frame.js +1 -2
- package/dist/mcp-apps/bridge.js +1 -2
- package/dist/mcp-apps/csp.js +1 -2
- package/dist/mcp-apps/types.js +1 -2
- package/dist/mcp-apps/utils.js +1 -2
- package/dist/model-context/frame/useAssistantFrameHost.js +1 -2
- package/dist/model-context/makeAssistantVisible.js +1 -2
- package/dist/primitives/actionBar/ActionBarCopy.js +1 -2
- package/dist/primitives/actionBar/ActionBarEdit.js +1 -2
- package/dist/primitives/actionBar/ActionBarExportMarkdown.js +1 -2
- package/dist/primitives/actionBar/ActionBarFeedbackNegative.js +1 -2
- package/dist/primitives/actionBar/ActionBarFeedbackPositive.js +1 -2
- package/dist/primitives/actionBar/ActionBarInteractionContext.js +1 -2
- package/dist/primitives/actionBar/ActionBarReload.js +1 -2
- package/dist/primitives/actionBar/ActionBarRoot.js +1 -2
- package/dist/primitives/actionBar/ActionBarSpeak.js +1 -2
- package/dist/primitives/actionBar/ActionBarStopSpeaking.js +1 -2
- package/dist/primitives/actionBar/useActionBarFloatStatus.js +1 -2
- package/dist/primitives/actionBar.js +1 -2
- package/dist/primitives/actionBarMore/ActionBarMoreContent.js +1 -2
- package/dist/primitives/actionBarMore/ActionBarMoreItem.js +1 -2
- package/dist/primitives/actionBarMore/ActionBarMoreRoot.js +1 -2
- package/dist/primitives/actionBarMore/ActionBarMoreSeparator.js +1 -2
- package/dist/primitives/actionBarMore/ActionBarMoreTrigger.js +1 -2
- package/dist/primitives/actionBarMore/scope.js +1 -2
- package/dist/primitives/actionBarMore.js +1 -2
- package/dist/primitives/assistantModal/AssistantModalAnchor.js +1 -2
- package/dist/primitives/assistantModal/AssistantModalContent.js +1 -2
- package/dist/primitives/assistantModal/AssistantModalRoot.js +1 -2
- package/dist/primitives/assistantModal/AssistantModalTrigger.js +1 -2
- package/dist/primitives/assistantModal/popoverRenderPrimitives.js +1 -2
- package/dist/primitives/assistantModal/scope.js +1 -2
- package/dist/primitives/assistantModal.js +1 -2
- package/dist/primitives/attachment/AttachmentName.js +1 -2
- package/dist/primitives/attachment/AttachmentRemove.js +1 -2
- package/dist/primitives/attachment/AttachmentRoot.js +1 -2
- package/dist/primitives/attachment/AttachmentThumb.js +1 -2
- package/dist/primitives/attachment.js +1 -2
- package/dist/primitives/branchPicker/BranchPickerCount.js +1 -2
- package/dist/primitives/branchPicker/BranchPickerNext.js +1 -2
- package/dist/primitives/branchPicker/BranchPickerNumber.js +1 -2
- package/dist/primitives/branchPicker/BranchPickerPrevious.js +1 -2
- package/dist/primitives/branchPicker/BranchPickerRoot.js +1 -2
- package/dist/primitives/branchPicker.js +1 -2
- package/dist/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.d.ts +5 -4
- package/dist/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.d.ts.map +1 -1
- package/dist/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.js +57 -20
- package/dist/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.js.map +1 -1
- package/dist/primitives/chainOfThought/ChainOfThoughtRoot.js +1 -2
- package/dist/primitives/chainOfThought.js +1 -2
- package/dist/primitives/composer/ComposerAddAttachment.js +1 -2
- package/dist/primitives/composer/ComposerAttachmentDropzone.js +1 -2
- package/dist/primitives/composer/ComposerCancel.js +1 -2
- package/dist/primitives/composer/ComposerCompactContext.js +1 -2
- package/dist/primitives/composer/ComposerDictate.js +1 -2
- package/dist/primitives/composer/ComposerDictationTranscript.js +1 -2
- package/dist/primitives/composer/ComposerInput.js +1 -2
- package/dist/primitives/composer/ComposerInputPluginContext.js +1 -2
- package/dist/primitives/composer/ComposerQuote.js +1 -2
- package/dist/primitives/composer/ComposerResume.js +1 -2
- package/dist/primitives/composer/ComposerRoot.js +1 -2
- package/dist/primitives/composer/ComposerSend.js +1 -2
- package/dist/primitives/composer/ComposerStopDictation.js +1 -2
- package/dist/primitives/composer/composerInputSelector.js +1 -2
- package/dist/primitives/composer/trigger/TriggerPopover.js +1 -2
- package/dist/primitives/composer/trigger/TriggerPopoverAction.js +1 -2
- package/dist/primitives/composer/trigger/TriggerPopoverBack.js +1 -2
- package/dist/primitives/composer/trigger/TriggerPopoverCategories.js +1 -2
- package/dist/primitives/composer/trigger/TriggerPopoverDirective.js +1 -2
- package/dist/primitives/composer/trigger/TriggerPopoverItems.js +1 -2
- package/dist/primitives/composer/trigger/TriggerPopoverResource.js +1 -2
- package/dist/primitives/composer/trigger/TriggerPopoverRootContext.js +1 -2
- package/dist/primitives/composer/trigger/detectTrigger.js +1 -2
- package/dist/primitives/composer/trigger/index.js +1 -2
- package/dist/primitives/composer/trigger/matchesTriggerItemQuery.js +1 -2
- package/dist/primitives/composer/trigger/triggerDetectionResource.js +1 -2
- package/dist/primitives/composer/trigger/triggerKeyboardResource.js +1 -2
- package/dist/primitives/composer/trigger/triggerNavigationResource.js +1 -2
- package/dist/primitives/composer/trigger/triggerSelectionResource.js +1 -2
- package/dist/primitives/composer/useComposerCancelWithFocus.js +1 -2
- package/dist/primitives/composer/useComposerInputState.js +1 -2
- package/dist/primitives/composer.js +1 -2
- package/dist/primitives/dropdownMenuRenderPrimitives.js +1 -2
- package/dist/primitives/error/ErrorMessage.js +1 -2
- package/dist/primitives/error/ErrorRoot.js +1 -2
- package/dist/primitives/error.js +1 -2
- package/dist/primitives/message/MessageError.js +1 -2
- package/dist/primitives/message/MessageIf.js +1 -2
- package/dist/primitives/message/MessageParts.js +1 -2
- package/dist/primitives/message/MessagePartsGrouped.js +1 -2
- package/dist/primitives/message/MessageRoot.js +1 -2
- package/dist/primitives/message.js +1 -2
- package/dist/primitives/messagePart/MessagePartImage.js +1 -2
- package/dist/primitives/messagePart/MessagePartText.js +1 -2
- package/dist/primitives/messagePart/useMessagePartData.js +1 -2
- package/dist/primitives/messagePart/useMessagePartFile.js +1 -2
- package/dist/primitives/messagePart/useMessagePartImage.js +1 -2
- package/dist/primitives/messagePart/useMessagePartReasoning.js +1 -2
- package/dist/primitives/messagePart/useMessagePartSource.js +1 -2
- package/dist/primitives/messagePart/useMessagePartText.js +1 -2
- package/dist/primitives/messagePart.js +1 -2
- package/dist/primitives/queueItem/QueueItemRemove.js +1 -2
- package/dist/primitives/queueItem/QueueItemSteer.js +1 -2
- package/dist/primitives/queueItem/QueueItemText.js +1 -2
- package/dist/primitives/queueItem.js +1 -2
- package/dist/primitives/reasoning/useScrollLock.d.ts.map +1 -1
- package/dist/primitives/reasoning/useScrollLock.js +41 -25
- package/dist/primitives/reasoning/useScrollLock.js.map +1 -1
- package/dist/primitives/selectionToolbar/SelectionToolbarQuote.js +1 -2
- package/dist/primitives/selectionToolbar/SelectionToolbarRoot.js +1 -2
- package/dist/primitives/selectionToolbar.js +1 -2
- package/dist/primitives/suggestion/SuggestionDescription.js +1 -2
- package/dist/primitives/suggestion/SuggestionTitle.js +1 -2
- package/dist/primitives/suggestion/SuggestionTrigger.js +1 -2
- package/dist/primitives/suggestion.js +1 -2
- package/dist/primitives/thread/ThreadEmpty.js +1 -2
- package/dist/primitives/thread/ThreadIf.js +1 -2
- package/dist/primitives/thread/ThreadLoadEarlier.js +1 -2
- package/dist/primitives/thread/ThreadRoot.js +1 -2
- package/dist/primitives/thread/ThreadRootElementContext.js +1 -2
- package/dist/primitives/thread/ThreadScrollToBottom.js +1 -2
- package/dist/primitives/thread/ThreadSuggestion.js +1 -2
- package/dist/primitives/thread/ThreadViewport.js +1 -2
- package/dist/primitives/thread/ThreadViewportFooter.js +1 -2
- package/dist/primitives/thread/topAnchor/computeTopAnchorSlack.js +1 -2
- package/dist/primitives/thread/topAnchor/createReserveObservers.js +1 -2
- package/dist/primitives/thread/topAnchor/mountTopAnchorReserve.js +1 -2
- package/dist/primitives/thread/topAnchor/topAnchorTurn.js +1 -2
- package/dist/primitives/thread/topAnchor/topAnchorUtils.js +1 -2
- package/dist/primitives/thread/topAnchor/useTopAnchorReserve.js +1 -2
- package/dist/primitives/thread/useThreadViewportAutoScroll.js +1 -2
- package/dist/primitives/thread.js +1 -2
- package/dist/primitives/threadList/ThreadListLoadMore.js +1 -2
- package/dist/primitives/threadList/ThreadListNew.js +1 -2
- package/dist/primitives/threadList/ThreadListRoot.js +1 -2
- package/dist/primitives/threadList.js +1 -2
- package/dist/primitives/threadListFocusGroup.js +1 -2
- package/dist/primitives/threadListItem/ThreadListItemArchive.js +1 -2
- package/dist/primitives/threadListItem/ThreadListItemDelete.js +1 -2
- package/dist/primitives/threadListItem/ThreadListItemRoot.d.ts.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemRoot.js +2 -3
- package/dist/primitives/threadListItem/ThreadListItemRoot.js.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemTrigger.js +1 -2
- package/dist/primitives/threadListItem/ThreadListItemUnarchive.js +1 -2
- package/dist/primitives/threadListItem.js +1 -2
- package/dist/primitives/threadListItemMore/ThreadListItemMoreContent.js +1 -2
- package/dist/primitives/threadListItemMore/ThreadListItemMoreItem.js +1 -2
- package/dist/primitives/threadListItemMore/ThreadListItemMoreRoot.js +1 -2
- package/dist/primitives/threadListItemMore/ThreadListItemMoreSeparator.js +1 -2
- package/dist/primitives/threadListItemMore/ThreadListItemMoreTrigger.js +1 -2
- package/dist/primitives/threadListItemMore/scope.js +1 -2
- package/dist/primitives/threadListItemMore.js +1 -2
- package/dist/sandbox-host/SandboxHost.js +1 -2
- package/dist/unstable/useComposerInput.js +1 -2
- package/dist/unstable/useComposerInputHistory.js +1 -2
- package/dist/unstable/useLiveCompletionAdapter.js +1 -2
- package/dist/unstable/useMentionAdapter.js +1 -2
- package/dist/unstable/useMessageStallDetection.js +1 -2
- package/dist/unstable/useModelContextSnapshot.js +1 -2
- package/dist/unstable/useSlashCommandAdapter.js +1 -2
- package/dist/unstable/webmcp/WebMcpRegistrationResource.js +1 -2
- package/dist/unstable/webmcp/convertTools.js +1 -2
- package/dist/unstable/webmcp/useWebMcpProvider.js +1 -2
- package/dist/unstable/webmcp/webmcp-host.js +1 -2
- package/dist/utils/Primitive.js +1 -2
- package/dist/utils/createActionButton.js +1 -2
- package/dist/utils/getSelectionMessageId.js +1 -2
- package/dist/utils/hooks/useManagedRef.js +1 -2
- package/dist/utils/hooks/useMediaQuery.js +1 -2
- package/dist/utils/hooks/useOnScrollToBottom.js +1 -2
- package/dist/utils/hooks/useSizeHandle.js +1 -2
- package/dist/utils/isCompositionKey.js +1 -2
- package/dist/utils/smooth/SmoothContext.js +1 -2
- package/dist/utils/smooth/useSmooth.d.ts.map +1 -1
- package/dist/utils/smooth/useSmooth.js +11 -4
- package/dist/utils/smooth/useSmooth.js.map +1 -1
- package/dist/utils/useIsomorphicLayoutEffect.js +0 -1
- package/package.json +6 -6
- package/src/mcp-apps/McpAppRenderer.composer.test.tsx +111 -0
- package/src/mcp-apps/McpAppRenderer.test.tsx +24 -23
- package/src/mcp-apps/McpAppRenderer.tsx +9 -1
- package/src/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.test.tsx +91 -0
- package/src/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.tsx +54 -0
- package/src/primitives/reasoning/useScrollLock.test.tsx +71 -2
- package/src/primitives/reasoning/useScrollLock.ts +78 -51
- package/src/primitives/threadListItem/ThreadListItemRoot.tsx +4 -1
- package/src/primitives/threadListItem/ThreadListKeyboardNav.test.tsx +25 -0
- package/src/utils/smooth/useSmooth.test.tsx +113 -4
- package/src/utils/smooth/useSmooth.ts +16 -2
- package/src/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.ts +0 -49
|
@@ -6,7 +6,7 @@ import { forwardRef } from "@assistant-ui/tap/react-shim";
|
|
|
6
6
|
import { useAui } from "@assistant-ui/store";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
import { composeEventHandlers } from "radix-ui/internal";
|
|
9
|
-
|
|
9
|
+
// src/primitives/selectionToolbar/SelectionToolbarQuote.tsx
|
|
10
10
|
/**
|
|
11
11
|
* A button that quotes the currently selected text.
|
|
12
12
|
*
|
|
@@ -80,7 +80,6 @@ const SelectionToolbarPrimitiveQuote = forwardRef((t0, forwardedRef) => {
|
|
|
80
80
|
return t4;
|
|
81
81
|
});
|
|
82
82
|
SelectionToolbarPrimitiveQuote.displayName = "SelectionToolbarPrimitive.Quote";
|
|
83
|
-
//#endregion
|
|
84
83
|
export { SelectionToolbarPrimitiveQuote };
|
|
85
84
|
|
|
86
85
|
//# sourceMappingURL=SelectionToolbarQuote.js.map
|
|
@@ -7,7 +7,7 @@ import { createContext, forwardRef, useContext, useEffect, useRef, useState } fr
|
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
import { composeEventHandlers } from "radix-ui/internal";
|
|
9
9
|
import { createPortal } from "react-dom";
|
|
10
|
-
|
|
10
|
+
// src/primitives/selectionToolbar/SelectionToolbarRoot.tsx
|
|
11
11
|
const SelectionToolbarContext = createContext(null);
|
|
12
12
|
const useSelectionToolbarInfo = () => {
|
|
13
13
|
return useContext(SelectionToolbarContext);
|
|
@@ -198,7 +198,6 @@ SelectionToolbarPrimitiveRoot.displayName = "SelectionToolbarPrimitive.Root";
|
|
|
198
198
|
function _temp(e) {
|
|
199
199
|
e.preventDefault();
|
|
200
200
|
}
|
|
201
|
-
//#endregion
|
|
202
201
|
export { SelectionToolbarPrimitiveRoot, useSelectionToolbarInfo };
|
|
203
202
|
|
|
204
203
|
//# sourceMappingURL=SelectionToolbarRoot.js.map
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { SelectionToolbarPrimitiveRoot } from "./selectionToolbar/SelectionToolbarRoot.js";
|
|
3
3
|
import { SelectionToolbarPrimitiveQuote } from "./selectionToolbar/SelectionToolbarQuote.js";
|
|
4
|
-
|
|
4
|
+
// src/primitives/selectionToolbar.ts
|
|
5
5
|
var selectionToolbar_exports = /* @__PURE__ */ __exportAll({
|
|
6
6
|
Quote: () => SelectionToolbarPrimitiveQuote,
|
|
7
7
|
Root: () => SelectionToolbarPrimitiveRoot
|
|
8
8
|
});
|
|
9
|
-
//#endregion
|
|
10
9
|
export { SelectionToolbarPrimitiveQuote as Quote, SelectionToolbarPrimitiveRoot as Root, selectionToolbar_exports };
|
|
11
10
|
|
|
12
11
|
//# sourceMappingURL=selectionToolbar.js.map
|
|
@@ -4,7 +4,7 @@ import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
|
4
4
|
import { forwardRef } from "@assistant-ui/tap/react-shim";
|
|
5
5
|
import { useAuiState } from "@assistant-ui/store";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
|
-
|
|
7
|
+
// src/primitives/suggestion/SuggestionDescription.tsx
|
|
8
8
|
/**
|
|
9
9
|
* Renders the description/label of the suggestion.
|
|
10
10
|
*
|
|
@@ -35,7 +35,6 @@ SuggestionPrimitiveDescription.displayName = "SuggestionPrimitive.Description";
|
|
|
35
35
|
function _temp(s) {
|
|
36
36
|
return s.suggestion.label;
|
|
37
37
|
}
|
|
38
|
-
//#endregion
|
|
39
38
|
export { SuggestionPrimitiveDescription };
|
|
40
39
|
|
|
41
40
|
//# sourceMappingURL=SuggestionDescription.js.map
|
|
@@ -4,7 +4,7 @@ import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
|
4
4
|
import { forwardRef } from "@assistant-ui/tap/react-shim";
|
|
5
5
|
import { useAuiState } from "@assistant-ui/store";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
|
-
|
|
7
|
+
// src/primitives/suggestion/SuggestionTitle.tsx
|
|
8
8
|
/**
|
|
9
9
|
* Renders the title of the suggestion.
|
|
10
10
|
*
|
|
@@ -35,7 +35,6 @@ SuggestionPrimitiveTitle.displayName = "SuggestionPrimitive.Title";
|
|
|
35
35
|
function _temp(s) {
|
|
36
36
|
return s.suggestion.title;
|
|
37
37
|
}
|
|
38
|
-
//#endregion
|
|
39
38
|
export { SuggestionPrimitiveTitle };
|
|
40
39
|
|
|
41
40
|
//# sourceMappingURL=SuggestionTitle.js.map
|
|
@@ -3,7 +3,7 @@ import { createActionButton } from "../../utils/createActionButton.js";
|
|
|
3
3
|
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
4
4
|
import { useSuggestionTrigger } from "@assistant-ui/core/react";
|
|
5
5
|
import { useAuiState } from "@assistant-ui/store";
|
|
6
|
-
|
|
6
|
+
// src/primitives/suggestion/SuggestionTrigger.ts
|
|
7
7
|
const useSuggestionTrigger$1 = (t0) => {
|
|
8
8
|
const $ = c(4);
|
|
9
9
|
const { send, clearComposer } = t0;
|
|
@@ -38,7 +38,6 @@ const SuggestionPrimitiveTrigger = createActionButton("SuggestionPrimitive.Trigg
|
|
|
38
38
|
function _temp(s) {
|
|
39
39
|
return s.suggestion.prompt;
|
|
40
40
|
}
|
|
41
|
-
//#endregion
|
|
42
41
|
export { SuggestionPrimitiveTrigger };
|
|
43
42
|
|
|
44
43
|
//# sourceMappingURL=SuggestionTrigger.js.map
|
|
@@ -2,13 +2,12 @@ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
|
2
2
|
import { SuggestionPrimitiveTitle } from "./suggestion/SuggestionTitle.js";
|
|
3
3
|
import { SuggestionPrimitiveDescription } from "./suggestion/SuggestionDescription.js";
|
|
4
4
|
import { SuggestionPrimitiveTrigger } from "./suggestion/SuggestionTrigger.js";
|
|
5
|
-
|
|
5
|
+
// src/primitives/suggestion.ts
|
|
6
6
|
var suggestion_exports = /* @__PURE__ */ __exportAll({
|
|
7
7
|
Description: () => SuggestionPrimitiveDescription,
|
|
8
8
|
Title: () => SuggestionPrimitiveTitle,
|
|
9
9
|
Trigger: () => SuggestionPrimitiveTrigger
|
|
10
10
|
});
|
|
11
|
-
//#endregion
|
|
12
11
|
export { SuggestionPrimitiveDescription as Description, SuggestionPrimitiveTitle as Title, SuggestionPrimitiveTrigger as Trigger, suggestion_exports };
|
|
13
12
|
|
|
14
13
|
//# sourceMappingURL=suggestion.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useAuiState } from "@assistant-ui/store";
|
|
3
|
-
|
|
3
|
+
// src/primitives/thread/ThreadEmpty.ts
|
|
4
4
|
/**
|
|
5
5
|
* @deprecated Use `<AuiIf condition={(s) => s.thread.isEmpty} />` instead.
|
|
6
6
|
*/
|
|
@@ -12,7 +12,6 @@ ThreadPrimitiveEmpty.displayName = "ThreadPrimitive.Empty";
|
|
|
12
12
|
function _temp(s) {
|
|
13
13
|
return s.thread.isEmpty;
|
|
14
14
|
}
|
|
15
|
-
//#endregion
|
|
16
15
|
export { ThreadPrimitiveEmpty };
|
|
17
16
|
|
|
18
17
|
//# sourceMappingURL=ThreadEmpty.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
3
3
|
import { useAuiState } from "@assistant-ui/store";
|
|
4
|
-
|
|
4
|
+
// src/primitives/thread/ThreadIf.ts
|
|
5
5
|
const useThreadIf = (props) => {
|
|
6
6
|
const $ = c(4);
|
|
7
7
|
let t0;
|
|
@@ -41,7 +41,6 @@ const ThreadPrimitiveIf = (t0) => {
|
|
|
41
41
|
return useThreadIf(query) ? children : null;
|
|
42
42
|
};
|
|
43
43
|
ThreadPrimitiveIf.displayName = "ThreadPrimitive.If";
|
|
44
|
-
//#endregion
|
|
45
44
|
export { ThreadPrimitiveIf };
|
|
46
45
|
|
|
47
46
|
//# sourceMappingURL=ThreadIf.js.map
|
|
@@ -3,7 +3,7 @@ import { createActionButton } from "../../utils/createActionButton.js";
|
|
|
3
3
|
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
4
4
|
import "@assistant-ui/tap/react-shim";
|
|
5
5
|
import { useAui, useAuiState } from "@assistant-ui/store";
|
|
6
|
-
|
|
6
|
+
// src/primitives/thread/ThreadLoadEarlier.tsx
|
|
7
7
|
const useThreadLoadEarlier = () => {
|
|
8
8
|
const $ = c(2);
|
|
9
9
|
const aui = useAui();
|
|
@@ -30,7 +30,6 @@ const ThreadPrimitiveLoadEarlier = createActionButton("ThreadPrimitive.LoadEarli
|
|
|
30
30
|
function _temp(s) {
|
|
31
31
|
return s.thread.hasEarlier;
|
|
32
32
|
}
|
|
33
|
-
//#endregion
|
|
34
33
|
export { ThreadPrimitiveLoadEarlier };
|
|
35
34
|
|
|
36
35
|
//# sourceMappingURL=ThreadLoadEarlier.js.map
|
|
@@ -7,7 +7,7 @@ import { forwardRef, useEffect, useRef } from "@assistant-ui/tap/react-shim";
|
|
|
7
7
|
import { useAui } from "@assistant-ui/store";
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
9
9
|
import { useComposedRefs } from "radix-ui/internal";
|
|
10
|
-
|
|
10
|
+
// src/primitives/thread/ThreadRoot.tsx
|
|
11
11
|
const escapeEventThreadRoots = /* @__PURE__ */ new WeakMap();
|
|
12
12
|
/**
|
|
13
13
|
* The root container component for a thread.
|
|
@@ -100,7 +100,6 @@ ThreadPrimitiveRoot.displayName = "ThreadPrimitive.Root";
|
|
|
100
100
|
function _temp(target) {
|
|
101
101
|
return target instanceof Element && target.hasAttribute("data-aui-thread-root");
|
|
102
102
|
}
|
|
103
|
-
//#endregion
|
|
104
103
|
export { ThreadPrimitiveRoot };
|
|
105
104
|
|
|
106
105
|
//# sourceMappingURL=ThreadRoot.js.map
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createContext, useContext } from "@assistant-ui/tap/react-shim";
|
|
3
|
-
|
|
3
|
+
// src/primitives/thread/ThreadRootElementContext.ts
|
|
4
4
|
const ThreadRootElementContext = createContext(void 0);
|
|
5
5
|
const useThreadRootElementRef = () => {
|
|
6
6
|
return useContext(ThreadRootElementContext);
|
|
7
7
|
};
|
|
8
|
-
//#endregion
|
|
9
8
|
export { ThreadRootElementContext, useThreadRootElementRef };
|
|
10
9
|
|
|
11
10
|
//# sourceMappingURL=ThreadRootElementContext.js.map
|
|
@@ -3,7 +3,7 @@ import { useThreadViewport, useThreadViewportStore } from "../../context/react/T
|
|
|
3
3
|
import { createActionButton } from "../../utils/createActionButton.js";
|
|
4
4
|
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
5
5
|
import "@assistant-ui/tap/react-shim";
|
|
6
|
-
|
|
6
|
+
// src/primitives/thread/ThreadScrollToBottom.ts
|
|
7
7
|
const useThreadScrollToBottom = (t0) => {
|
|
8
8
|
const $ = c(5);
|
|
9
9
|
let t1;
|
|
@@ -32,7 +32,6 @@ const ThreadPrimitiveScrollToBottom = createActionButton("ThreadPrimitive.Scroll
|
|
|
32
32
|
function _temp(s) {
|
|
33
33
|
return s.isAtBottom;
|
|
34
34
|
}
|
|
35
|
-
//#endregion
|
|
36
35
|
export { ThreadPrimitiveScrollToBottom };
|
|
37
36
|
|
|
38
37
|
//# sourceMappingURL=ThreadScrollToBottom.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { createActionButton } from "../../utils/createActionButton.js";
|
|
3
3
|
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
4
4
|
import { useSuggestionTrigger } from "@assistant-ui/core/react";
|
|
5
|
-
|
|
5
|
+
// src/primitives/thread/ThreadSuggestion.ts
|
|
6
6
|
const useThreadSuggestion = (t0) => {
|
|
7
7
|
const $ = c(4);
|
|
8
8
|
const { prompt, send, clearComposer, autoSend } = t0;
|
|
@@ -30,7 +30,6 @@ const ThreadPrimitiveSuggestion = createActionButton("ThreadPrimitive.Suggestion
|
|
|
30
30
|
"autoSend",
|
|
31
31
|
"method"
|
|
32
32
|
]);
|
|
33
|
-
//#endregion
|
|
34
33
|
export { ThreadPrimitiveSuggestion };
|
|
35
34
|
|
|
36
35
|
//# sourceMappingURL=ThreadSuggestion.js.map
|
|
@@ -13,7 +13,7 @@ import { forwardRef } from "@assistant-ui/tap/react-shim";
|
|
|
13
13
|
import { useAuiState } from "@assistant-ui/store";
|
|
14
14
|
import { jsx } from "react/jsx-runtime";
|
|
15
15
|
import { useComposedRefs } from "radix-ui/internal";
|
|
16
|
-
|
|
16
|
+
// src/primitives/thread/ThreadViewport.tsx
|
|
17
17
|
const useViewportSizeRef = () => {
|
|
18
18
|
const register = useThreadViewport(_temp);
|
|
19
19
|
return useSizeHandle(register, _temp2);
|
|
@@ -261,7 +261,6 @@ function _temp3(s) {
|
|
|
261
261
|
function _temp4(s_1) {
|
|
262
262
|
return s_1.topAnchorTurn;
|
|
263
263
|
}
|
|
264
|
-
//#endregion
|
|
265
264
|
export { ThreadPrimitiveViewport };
|
|
266
265
|
|
|
267
266
|
//# sourceMappingURL=ThreadViewport.js.map
|
|
@@ -6,7 +6,7 @@ import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
|
6
6
|
import { forwardRef } from "@assistant-ui/tap/react-shim";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
import { useComposedRefs } from "radix-ui/internal";
|
|
9
|
-
|
|
9
|
+
// src/primitives/thread/ThreadViewportFooter.tsx
|
|
10
10
|
/**
|
|
11
11
|
* A footer container that measures its height for scroll calculations.
|
|
12
12
|
*
|
|
@@ -56,7 +56,6 @@ function _temp2(el) {
|
|
|
56
56
|
const marginTop = parseFloat(getComputedStyle(el).marginTop) || 0;
|
|
57
57
|
return el.offsetHeight + marginTop;
|
|
58
58
|
}
|
|
59
|
-
//#endregion
|
|
60
59
|
export { ThreadPrimitiveViewportFooter };
|
|
61
60
|
|
|
62
61
|
//# sourceMappingURL=ThreadViewportFooter.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
2
|
+
// src/primitives/thread/topAnchor/computeTopAnchorSlack.ts
|
|
3
3
|
const getDocumentOffsetTop = (element) => {
|
|
4
4
|
let top = 0;
|
|
5
5
|
let current = element;
|
|
@@ -46,7 +46,6 @@ const computeTopAnchorReserve = ({ viewport, reserve, ...targetOptions }) => {
|
|
|
46
46
|
scrollHeight: viewport.scrollHeight - reserve.offsetHeight
|
|
47
47
|
});
|
|
48
48
|
};
|
|
49
|
-
//#endregion
|
|
50
49
|
export { computeTopAnchorReserve, computeTopAnchorTargetScrollTop };
|
|
51
50
|
|
|
52
51
|
//# sourceMappingURL=computeTopAnchorSlack.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
2
|
+
// src/primitives/thread/topAnchor/createReserveObservers.ts
|
|
3
3
|
const createReserveObservers = (onChange) => {
|
|
4
4
|
const resizeObserver = new ResizeObserver(onChange);
|
|
5
5
|
const mutationObserver = new MutationObserver(onChange);
|
|
@@ -32,7 +32,6 @@ const createReserveObservers = (onChange) => {
|
|
|
32
32
|
disconnect
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
|
-
//#endregion
|
|
36
35
|
export { createReserveObservers };
|
|
37
36
|
|
|
38
37
|
//# sourceMappingURL=createReserveObservers.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { createReserveElement, getAnchorId, setReserveHeight, snapScrollTop } from "./topAnchorUtils.js";
|
|
3
3
|
import { computeTopAnchorReserve, computeTopAnchorTargetScrollTop } from "./computeTopAnchorSlack.js";
|
|
4
4
|
import { createReserveObservers } from "./createReserveObservers.js";
|
|
5
|
-
|
|
5
|
+
// src/primitives/thread/topAnchor/mountTopAnchorReserve.ts
|
|
6
6
|
const createFrameScheduler = (fn) => {
|
|
7
7
|
let frame = null;
|
|
8
8
|
return {
|
|
@@ -134,7 +134,6 @@ const mountTopAnchorReserve = (store) => {
|
|
|
134
134
|
reserve?.remove();
|
|
135
135
|
};
|
|
136
136
|
};
|
|
137
|
-
//#endregion
|
|
138
137
|
export { mountTopAnchorReserve };
|
|
139
138
|
|
|
140
139
|
//# sourceMappingURL=mountTopAnchorReserve.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
2
|
+
// src/primitives/thread/topAnchor/topAnchorTurn.ts
|
|
3
3
|
/**
|
|
4
4
|
* A stored turn stays valid only while it is still the trailing turn: the
|
|
5
5
|
* anchor immediately precedes the target, and anything after the target is a
|
|
@@ -25,7 +25,6 @@ const getActiveTopAnchorTurn = ({ isRunning, messages }) => {
|
|
|
25
25
|
};
|
|
26
26
|
const getActiveTopAnchorAnchorId = (options) => getActiveTopAnchorTurn(options)?.anchorId;
|
|
27
27
|
const getActiveTopAnchorTargetId = (options) => getActiveTopAnchorTurn(options)?.targetId;
|
|
28
|
-
//#endregion
|
|
29
28
|
export { getActiveTopAnchorAnchorId, getActiveTopAnchorTargetId, getActiveTopAnchorTurn, isTopAnchorTurnValid };
|
|
30
29
|
|
|
31
30
|
//# sourceMappingURL=topAnchorTurn.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
2
|
+
// src/primitives/thread/topAnchor/topAnchorUtils.ts
|
|
3
3
|
/**
|
|
4
4
|
* Convert a supported CSS length string (`px`, `em`, `rem`) into pixels,
|
|
5
5
|
* resolving font-relative units against the supplied element's computed style.
|
|
@@ -41,7 +41,6 @@ const snapScrollTop = (top) => {
|
|
|
41
41
|
const pixelRatio = window.devicePixelRatio || 1;
|
|
42
42
|
return Math.round(top * pixelRatio) / pixelRatio;
|
|
43
43
|
};
|
|
44
|
-
//#endregion
|
|
45
44
|
export { createReserveElement, getAnchorId, parseCssLength, setReserveHeight, snapScrollTop };
|
|
46
45
|
|
|
47
46
|
//# sourceMappingURL=topAnchorUtils.js.map
|
|
@@ -3,7 +3,7 @@ import { useThreadViewportStore } from "../../../context/react/ThreadViewportCon
|
|
|
3
3
|
import { useIsomorphicLayoutEffect } from "../../../utils/useIsomorphicLayoutEffect.js";
|
|
4
4
|
import { mountTopAnchorReserve } from "./mountTopAnchorReserve.js";
|
|
5
5
|
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
6
|
-
|
|
6
|
+
// src/primitives/thread/topAnchor/useTopAnchorReserve.ts
|
|
7
7
|
/**
|
|
8
8
|
* Mounts the top-turn-anchor reserve element against the active
|
|
9
9
|
* `ThreadViewport` store. Call this from inside the scrollable viewport so
|
|
@@ -30,7 +30,6 @@ const useTopAnchorReserve = (enabled) => {
|
|
|
30
30
|
}
|
|
31
31
|
useIsomorphicLayoutEffect(t0, t1);
|
|
32
32
|
};
|
|
33
|
-
//#endregion
|
|
34
33
|
export { useTopAnchorReserve };
|
|
35
34
|
|
|
36
35
|
//# sourceMappingURL=useTopAnchorReserve.js.map
|
|
@@ -6,7 +6,7 @@ import { useOnScrollToBottom } from "../../utils/hooks/useOnScrollToBottom.js";
|
|
|
6
6
|
import { useManagedRef } from "../../utils/hooks/useManagedRef.js";
|
|
7
7
|
import { useCallback, useEffect, useInsertionEffect, useRef } from "@assistant-ui/tap/react-shim";
|
|
8
8
|
import { useAui, useAuiEvent, useAuiState } from "@assistant-ui/store";
|
|
9
|
-
|
|
9
|
+
// src/primitives/thread/useThreadViewportAutoScroll.ts
|
|
10
10
|
const useThreadViewportAutoScroll = ({ autoScroll, scrollToBottomOnRunStart = true, scrollToBottomOnInitialize = true, scrollToBottomOnThreadSwitch = true }) => {
|
|
11
11
|
const aui = useAui();
|
|
12
12
|
const divRef = useRef(null);
|
|
@@ -71,7 +71,6 @@ const useThreadViewportAutoScroll = ({ autoScroll, scrollToBottomOnRunStart = tr
|
|
|
71
71
|
};
|
|
72
72
|
}, [controller]));
|
|
73
73
|
};
|
|
74
|
-
//#endregion
|
|
75
74
|
export { useThreadViewportAutoScroll };
|
|
76
75
|
|
|
77
76
|
//# sourceMappingURL=useThreadViewportAutoScroll.js.map
|
|
@@ -10,7 +10,7 @@ import { ThreadPrimitiveScrollToBottom } from "./thread/ThreadScrollToBottom.js"
|
|
|
10
10
|
import { ThreadPrimitiveLoadEarlier } from "./thread/ThreadLoadEarlier.js";
|
|
11
11
|
import { ThreadPrimitiveSuggestion } from "./thread/ThreadSuggestion.js";
|
|
12
12
|
import { ThreadPrimitiveSuggestionByIndex, ThreadPrimitiveSuggestions } from "./thread/ThreadSuggestions.js";
|
|
13
|
-
|
|
13
|
+
// src/primitives/thread.ts
|
|
14
14
|
var thread_exports = /* @__PURE__ */ __exportAll({
|
|
15
15
|
Empty: () => ThreadPrimitiveEmpty,
|
|
16
16
|
If: () => ThreadPrimitiveIf,
|
|
@@ -28,7 +28,6 @@ var thread_exports = /* @__PURE__ */ __exportAll({
|
|
|
28
28
|
ViewportFooter: () => ThreadPrimitiveViewportFooter,
|
|
29
29
|
ViewportProvider: () => ThreadPrimitiveViewportProvider
|
|
30
30
|
});
|
|
31
|
-
//#endregion
|
|
32
31
|
export { ThreadPrimitiveEmpty as Empty, ThreadPrimitiveIf as If, ThreadPrimitiveLoadEarlier as LoadEarlier, ThreadPrimitiveMessageByIndex as MessageByIndex, ThreadPrimitiveMessages as Messages, ThreadPrimitiveRoot as Root, ThreadPrimitiveRow as Row, 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 };
|
|
33
32
|
|
|
34
33
|
//# sourceMappingURL=thread.js.map
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createActionButton } from "../../utils/createActionButton.js";
|
|
3
3
|
import { useThreadListLoadMore } from "@assistant-ui/core/react";
|
|
4
|
-
|
|
4
|
+
// src/primitives/threadList/ThreadListLoadMore.tsx
|
|
5
5
|
const useThreadListLoadMore$1 = () => {
|
|
6
6
|
const { loadMore, disabled } = useThreadListLoadMore();
|
|
7
7
|
if (disabled) return null;
|
|
8
8
|
return loadMore;
|
|
9
9
|
};
|
|
10
10
|
const ThreadListPrimitiveLoadMore = createActionButton("ThreadListPrimitive.LoadMore", useThreadListLoadMore$1);
|
|
11
|
-
//#endregion
|
|
12
11
|
export { ThreadListPrimitiveLoadMore };
|
|
13
12
|
|
|
14
13
|
//# sourceMappingURL=ThreadListLoadMore.js.map
|
|
@@ -6,7 +6,7 @@ import { forwardRef } from "@assistant-ui/tap/react-shim";
|
|
|
6
6
|
import { useAuiState } from "@assistant-ui/store";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
import { composeEventHandlers } from "radix-ui/internal";
|
|
9
|
-
|
|
9
|
+
// src/primitives/threadList/ThreadListNew.tsx
|
|
10
10
|
const ThreadListPrimitiveNew = forwardRef((t0, forwardedRef) => {
|
|
11
11
|
const $ = c(15);
|
|
12
12
|
let disabled;
|
|
@@ -64,7 +64,6 @@ ThreadListPrimitiveNew.displayName = "ThreadListPrimitive.New";
|
|
|
64
64
|
function _temp(s) {
|
|
65
65
|
return s.threads.newThreadId === s.threads.mainThreadId;
|
|
66
66
|
}
|
|
67
|
-
//#endregion
|
|
68
67
|
export { ThreadListPrimitiveNew };
|
|
69
68
|
|
|
70
69
|
//# sourceMappingURL=ThreadListNew.js.map
|
|
@@ -4,7 +4,7 @@ import { ThreadListCollection } from "../threadListFocusGroup.js";
|
|
|
4
4
|
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
5
5
|
import { forwardRef } from "@assistant-ui/tap/react-shim";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
|
-
|
|
7
|
+
// src/primitives/threadList/ThreadListRoot.tsx
|
|
8
8
|
const ThreadListPrimitiveRoot = forwardRef((props, ref) => {
|
|
9
9
|
const $ = c(3);
|
|
10
10
|
let t0;
|
|
@@ -26,7 +26,6 @@ const ThreadListPrimitiveRoot = forwardRef((props, ref) => {
|
|
|
26
26
|
return t0;
|
|
27
27
|
});
|
|
28
28
|
ThreadListPrimitiveRoot.displayName = "ThreadListPrimitive.Root";
|
|
29
|
-
//#endregion
|
|
30
29
|
export { ThreadListPrimitiveRoot };
|
|
31
30
|
|
|
32
31
|
//# sourceMappingURL=ThreadListRoot.js.map
|
|
@@ -3,7 +3,7 @@ import { ThreadListPrimitiveNew } from "./threadList/ThreadListNew.js";
|
|
|
3
3
|
import { ThreadListPrimitiveItemByIndex, ThreadListPrimitiveItems } from "./threadList/ThreadListItems.js";
|
|
4
4
|
import { ThreadListPrimitiveLoadMore } from "./threadList/ThreadListLoadMore.js";
|
|
5
5
|
import { ThreadListPrimitiveRoot } from "./threadList/ThreadListRoot.js";
|
|
6
|
-
|
|
6
|
+
// src/primitives/threadList.ts
|
|
7
7
|
var threadList_exports = /* @__PURE__ */ __exportAll({
|
|
8
8
|
ItemByIndex: () => ThreadListPrimitiveItemByIndex,
|
|
9
9
|
Items: () => ThreadListPrimitiveItems,
|
|
@@ -11,7 +11,6 @@ var threadList_exports = /* @__PURE__ */ __exportAll({
|
|
|
11
11
|
New: () => ThreadListPrimitiveNew,
|
|
12
12
|
Root: () => ThreadListPrimitiveRoot
|
|
13
13
|
});
|
|
14
|
-
//#endregion
|
|
15
14
|
export { ThreadListPrimitiveItemByIndex as ItemByIndex, ThreadListPrimitiveItems as Items, ThreadListPrimitiveLoadMore as LoadMore, ThreadListPrimitiveNew as New, ThreadListPrimitiveRoot as Root, threadList_exports };
|
|
16
15
|
|
|
17
16
|
//# sourceMappingURL=threadList.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createContext, useContext } from "@assistant-ui/tap/react-shim";
|
|
3
3
|
import { Collection } from "radix-ui/internal";
|
|
4
|
-
|
|
4
|
+
// src/primitives/threadListFocusGroup.ts
|
|
5
5
|
const [collection, useThreadListCollection] = Collection.createCollection("ThreadList");
|
|
6
6
|
const ThreadListCollection = collection;
|
|
7
7
|
const ThreadListItemFocusContext = createContext(null);
|
|
@@ -9,7 +9,6 @@ const ThreadListItemFocusProvider = ThreadListItemFocusContext.Provider;
|
|
|
9
9
|
const useThreadListItemFocus = () => {
|
|
10
10
|
return useContext(ThreadListItemFocusContext);
|
|
11
11
|
};
|
|
12
|
-
//#endregion
|
|
13
12
|
export { ThreadListCollection, ThreadListItemFocusProvider, useThreadListCollection, useThreadListItemFocus };
|
|
14
13
|
|
|
15
14
|
//# sourceMappingURL=threadListFocusGroup.js.map
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createActionButton } from "../../utils/createActionButton.js";
|
|
3
3
|
import { useThreadListItemArchive } from "@assistant-ui/core/react";
|
|
4
|
-
|
|
4
|
+
// src/primitives/threadListItem/ThreadListItemArchive.ts
|
|
5
5
|
const useThreadListItemArchive$1 = () => {
|
|
6
6
|
const { archive } = useThreadListItemArchive();
|
|
7
7
|
return archive;
|
|
8
8
|
};
|
|
9
9
|
const ThreadListItemPrimitiveArchive = createActionButton("ThreadListItemPrimitive.Archive", useThreadListItemArchive$1);
|
|
10
|
-
//#endregion
|
|
11
10
|
export { ThreadListItemPrimitiveArchive };
|
|
12
11
|
|
|
13
12
|
//# sourceMappingURL=ThreadListItemArchive.js.map
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createActionButton } from "../../utils/createActionButton.js";
|
|
3
3
|
import { useThreadListItemDelete } from "@assistant-ui/core/react";
|
|
4
|
-
|
|
4
|
+
// src/primitives/threadListItem/ThreadListItemDelete.ts
|
|
5
5
|
const useThreadListItemDelete$1 = () => {
|
|
6
6
|
const { delete: deleteThread } = useThreadListItemDelete();
|
|
7
7
|
return deleteThread;
|
|
8
8
|
};
|
|
9
9
|
const ThreadListItemPrimitiveDelete = createActionButton("ThreadListItemPrimitive.Delete", useThreadListItemDelete$1);
|
|
10
|
-
//#endregion
|
|
11
10
|
export { ThreadListItemPrimitiveDelete };
|
|
12
11
|
|
|
13
12
|
//# sourceMappingURL=ThreadListItemDelete.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThreadListItemRoot.d.ts","sourceRoot":"","sources":["../../../src/primitives/threadListItem/ThreadListItemRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,iCAA8B;AAClD,OAAO,EACL,KAAK,YAAY,EAEjB,KAAK,wBAAwB,EAI9B,MAAM,OAAO,CAAC;AASf,KAAK,iBAAiB,GAAG,wBAAwB,CAAC,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;AAExE,yBAAiB,2BAA2B,CAAC;IAC3C,KAAY,OAAO,GAAG,YAAY,CAAC,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;IACzD,KAAY,KAAK,GAAG,iBAAiB,CAAC;CACvC;AAED,eAAO,MAAM,2BAA2B;;;;
|
|
1
|
+
{"version":3,"file":"ThreadListItemRoot.d.ts","sourceRoot":"","sources":["../../../src/primitives/threadListItem/ThreadListItemRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,iCAA8B;AAClD,OAAO,EACL,KAAK,YAAY,EAEjB,KAAK,wBAAwB,EAI9B,MAAM,OAAO,CAAC;AASf,KAAK,iBAAiB,GAAG,wBAAwB,CAAC,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;AAExE,yBAAiB,2BAA2B,CAAC;IAC3C,KAAY,OAAO,GAAG,YAAY,CAAC,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;IACzD,KAAY,KAAK,GAAG,iBAAiB,CAAC;CACvC;AAED,eAAO,MAAM,2BAA2B;;;;0GA2DtC,CAAC"}
|
|
@@ -6,7 +6,7 @@ import { useAuiState } from "@assistant-ui/store";
|
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
import { composeEventHandlers } from "radix-ui/internal";
|
|
8
8
|
import { Direction } from "radix-ui";
|
|
9
|
-
|
|
9
|
+
// src/primitives/threadListItem/ThreadListItemRoot.tsx
|
|
10
10
|
const ThreadListItemPrimitiveRoot = forwardRef((props, ref) => {
|
|
11
11
|
const isMain = useAuiState((s) => s.threads.mainThreadId === s.threadListItem.id);
|
|
12
12
|
const triggerRef = useRef(null);
|
|
@@ -25,7 +25,7 @@ const ThreadListItemPrimitiveRoot = forwardRef((props, ref) => {
|
|
|
25
25
|
const more = moreRef.current;
|
|
26
26
|
if (trigger && event.target === trigger) {
|
|
27
27
|
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
28
|
-
const triggers = getItems().map((item) => item.ref.current).filter((node) => node !== null);
|
|
28
|
+
const triggers = getItems().map((item) => item.ref.current).filter((node) => node !== null && !node.disabled);
|
|
29
29
|
const next = triggers[triggers.indexOf(trigger) + (event.key === "ArrowDown" ? 1 : -1)];
|
|
30
30
|
if (next) {
|
|
31
31
|
next.focus();
|
|
@@ -54,7 +54,6 @@ const ThreadListItemPrimitiveRoot = forwardRef((props, ref) => {
|
|
|
54
54
|
});
|
|
55
55
|
});
|
|
56
56
|
ThreadListItemPrimitiveRoot.displayName = "ThreadListItemPrimitive.Root";
|
|
57
|
-
//#endregion
|
|
58
57
|
export { ThreadListItemPrimitiveRoot };
|
|
59
58
|
|
|
60
59
|
//# sourceMappingURL=ThreadListItemRoot.js.map
|
|
@@ -1 +1 @@
|
|
|
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","altKey","ctrlKey","metaKey","shiftKey","forwardKey","backKey","trigger","current","more","target","key","triggers","map","item","filter","node","next","indexOf","preventDefault","displayName","Primitive"],"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/internal\";\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 if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey)\n return;\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
|
|
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","altKey","ctrlKey","metaKey","shiftKey","forwardKey","backKey","trigger","current","more","target","key","triggers","map","item","filter","node","disabled","next","indexOf","preventDefault","displayName","Primitive"],"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/internal\";\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 if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey)\n return;\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(\n (node): node is HTMLButtonElement =>\n node !== null && !node.disabled,\n );\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,IAAIA,MAAME,UAAUF,MAAMG,WAAWH,MAAMI,WAAWJ,MAAMK,UAC1D;EACF,MAAMC,aAAaT,cAAc,QAAQ,cAAc;EACvD,MAAMU,UAAUV,cAAc,QAAQ,eAAe;EACrD,MAAMW,UAAUjB,WAAWkB;EAC3B,MAAMC,OAAOjB,QAAQgB;EAErB,IAAID,WAAWR,MAAMW,WAAWH,SAAS;GACvC,IAAIR,MAAMY,QAAQ,eAAeZ,MAAMY,QAAQ,WAAW;IACxD,MAAMC,WAAWlB,SAAS,CAAC,CACxBmB,KAAKC,SAASA,KAAK/B,IAAIyB,OAAO,CAAC,CAC/BO,QACEC,SACCA,SAAS,QAAQ,CAACA,KAAKC,QAC3B;IACF,MAAMC,OACJN,SACEA,SAASO,QAAQZ,OAAO,KAAKR,MAAMY,QAAQ,cAAc,IAAI;IAEjE,IAAIO,MAAM;KACRA,KAAKzB,MAAM;KACXM,MAAMqB,eAAe;IACvB;GACF,OAAO,IAAIrB,MAAMY,QAAQN,cAAcI,MAAM;IAC3CA,KAAKhB,MAAM;IACXM,MAAMqB,eAAe;GACvB;EACF,OAAO,IAAIX,QAAQV,MAAMW,WAAWD,QAAQV,MAAMY,QAAQL,SAAS;GACjEC,SAASd,MAAM;GACfM,MAAMqB,eAAe;EACvB;CACF;CAEA,OACE,oBAAC,6BAAD;EAA6B,OAAO3B;EAClC,UAAA,oBAAC6B,YAAU,KAAX;GACE,GAAKtC,SAAS;IAAE,eAAe;IAAQ,gBAAgB;GAAO,IAAI;GAClE,GAAIF;GACJ,WAAWT,qBAAqBS,MAAMgB,WAAWA,SAAS;GACrDf;EAAI,CAAA;CAEgB,CAAA;AAEjC,CAAC;AAEDJ,4BAA4B0C,cAAc"}
|
|
@@ -6,7 +6,7 @@ import { useThreadListItemTrigger } from "@assistant-ui/core/react";
|
|
|
6
6
|
import { forwardRef } from "@assistant-ui/tap/react-shim";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
import { useComposedRefs } from "radix-ui/internal";
|
|
9
|
-
|
|
9
|
+
// src/primitives/threadListItem/ThreadListItemTrigger.tsx
|
|
10
10
|
const useThreadListItemTrigger$1 = () => {
|
|
11
11
|
const { switchTo } = useThreadListItemTrigger();
|
|
12
12
|
return switchTo;
|
|
@@ -32,7 +32,6 @@ const ThreadListItemPrimitiveTrigger = forwardRef((props, forwardedRef) => {
|
|
|
32
32
|
return t0;
|
|
33
33
|
});
|
|
34
34
|
ThreadListItemPrimitiveTrigger.displayName = "ThreadListItemPrimitive.Trigger";
|
|
35
|
-
//#endregion
|
|
36
35
|
export { ThreadListItemPrimitiveTrigger };
|
|
37
36
|
|
|
38
37
|
//# sourceMappingURL=ThreadListItemTrigger.js.map
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createActionButton } from "../../utils/createActionButton.js";
|
|
3
3
|
import { useThreadListItemUnarchive } from "@assistant-ui/core/react";
|
|
4
|
-
|
|
4
|
+
// src/primitives/threadListItem/ThreadListItemUnarchive.ts
|
|
5
5
|
const useThreadListItemUnarchive$1 = () => {
|
|
6
6
|
const { unarchive, disabled } = useThreadListItemUnarchive();
|
|
7
7
|
return disabled ? null : unarchive;
|
|
8
8
|
};
|
|
9
9
|
const ThreadListItemPrimitiveUnarchive = createActionButton("ThreadListItemPrimitive.Unarchive", useThreadListItemUnarchive$1);
|
|
10
|
-
//#endregion
|
|
11
10
|
export { ThreadListItemPrimitiveUnarchive };
|
|
12
11
|
|
|
13
12
|
//# sourceMappingURL=ThreadListItemUnarchive.js.map
|