@tangle-network/agent-app 0.54.0 → 0.55.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{DesignCanvas-BVBMDXBZ.js → DesignCanvas-OWE67ZX3.js} +4 -4
- package/dist/DesignCanvasEditor-VJ3R7RM2.js +15 -0
- package/dist/{TimelineEditor-52YEPDX5.js → TimelineEditor-7KBPJQLT.js} +3 -3
- package/dist/app-auth/index.js +2 -2
- package/dist/assets/index.js +1 -26
- package/dist/assets/index.js.map +1 -1
- package/dist/assets/schema.d.ts +0 -26
- package/dist/assistant/index.js +8 -8
- package/dist/chat-react/index.js +3 -3
- package/dist/chat-routes/index.js +22 -11
- package/dist/chat-routes/index.js.map +1 -1
- package/dist/chat-routes/sandbox-producer.d.ts +7 -0
- package/dist/chat-routes/wire.d.ts +1 -1
- package/dist/chat-store/index.js +4 -14
- package/dist/chat-store/index.js.map +1 -1
- package/dist/chat-store/parts.d.ts +0 -10
- package/dist/{chunk-JB2GFEOC.js → chunk-2N7PDPLC.js} +3 -3
- package/dist/{chunk-CUXCWQMW.js → chunk-47UDWWUN.js} +1 -5
- package/dist/chunk-47UDWWUN.js.map +1 -0
- package/dist/{chunk-XDB7IBYE.js → chunk-5FAKBTCK.js} +1 -22
- package/dist/chunk-5FAKBTCK.js.map +1 -0
- package/dist/{chunk-HQ7R6CGM.js → chunk-6NYVAURR.js} +2 -2
- package/dist/{chunk-TSZIYQAZ.js → chunk-6VRVRWYN.js} +2 -2
- package/dist/{chunk-TY2DALJG.js → chunk-7TYQ43TP.js} +1 -10
- package/dist/chunk-7TYQ43TP.js.map +1 -0
- package/dist/{chunk-RRWC77YY.js → chunk-CFGA7PXM.js} +2 -2
- package/dist/{chunk-CP36C5LZ.js → chunk-D6UJEOZQ.js} +1 -1
- package/dist/chunk-D6UJEOZQ.js.map +1 -0
- package/dist/{chunk-YJYPXMDL.js → chunk-DKHM4B4A.js} +3 -3
- package/dist/{chunk-M3K2HVQD.js → chunk-FCON65I2.js} +1 -1
- package/dist/{chunk-M3K2HVQD.js.map → chunk-FCON65I2.js.map} +1 -1
- package/dist/{chunk-UJHENCPR.js → chunk-GYDFGEJ2.js} +1 -1
- package/dist/chunk-GYDFGEJ2.js.map +1 -0
- package/dist/{chunk-ZGY6QB4F.js → chunk-MEKOWH5E.js} +2 -2
- package/dist/{chunk-2S7QRQUS.js → chunk-NJA6X7JI.js} +2 -2
- package/dist/{chunk-H6XQZFTT.js → chunk-OHWQUKBP.js} +1 -5
- package/dist/{chunk-H6XQZFTT.js.map → chunk-OHWQUKBP.js.map} +1 -1
- package/dist/{chunk-JZ64GXYP.js → chunk-OMHGFN5I.js} +2 -2
- package/dist/{chunk-4KFM7VTH.js → chunk-OXDA7G4E.js} +9 -8
- package/dist/chunk-OXDA7G4E.js.map +1 -0
- package/dist/{chunk-YB6BZKXY.js → chunk-PFOJRQ3Q.js} +32 -6
- package/dist/chunk-PFOJRQ3Q.js.map +1 -0
- package/dist/{chunk-UII6SBT4.js → chunk-RSTPXLC3.js} +4 -4
- package/dist/{chunk-BVKQKGRK.js → chunk-SISVELAA.js} +1 -9
- package/dist/chunk-SISVELAA.js.map +1 -0
- package/dist/{chunk-ZMMIQOFI.js → chunk-UII4YDYS.js} +2 -2
- package/dist/{chunk-W3RSC6XB.js → chunk-V4JZ5OYC.js} +3 -23
- package/dist/chunk-V4JZ5OYC.js.map +1 -0
- package/dist/{chunk-L57CYCXN.js → chunk-WN3UK23P.js} +2 -2
- package/dist/{chunk-LEECH4MY.js → chunk-YHR2P7FY.js} +5 -16
- package/dist/chunk-YHR2P7FY.js.map +1 -0
- package/dist/design-canvas/export-presets.d.ts +0 -2
- package/dist/design-canvas/index.js +1 -11
- package/dist/design-canvas/index.js.map +1 -1
- package/dist/design-canvas/mcp-tools.d.ts +0 -6
- package/dist/design-canvas-react/engine.js +3 -3
- package/dist/design-canvas-react/export.d.ts +0 -7
- package/dist/design-canvas-react/index.js +6 -8
- package/dist/design-canvas-react/index.js.map +1 -1
- package/dist/design-canvas-react/lazy.js +1 -1
- package/dist/interactions/contract.d.ts +4 -3
- package/dist/interactions/index.js +2 -2
- package/dist/platform/index.js +2 -2
- package/dist/preflight/cli.js +1 -2
- package/dist/preflight/cli.js.map +1 -1
- package/dist/preflight/index.d.ts +1 -34
- package/dist/preflight/index.js +3 -6
- package/dist/public-consultation/index.js +6 -6
- package/dist/runtime/index.js +1 -1
- package/dist/runtime/model.d.ts +1 -1
- package/dist/sandbox/index.d.ts +0 -4
- package/dist/sandbox/index.js +2 -2
- package/dist/sandbox/model.d.ts +9 -12
- package/dist/sequences/drizzle.js +1 -1
- package/dist/sequences/index.js +1 -7
- package/dist/sequences/index.js.map +1 -1
- package/dist/sequences/mcp-tools.d.ts +0 -2
- package/dist/sequences/model.d.ts +0 -6
- package/dist/sequences-react/index.js +3 -3
- package/dist/stream/index.js +2 -2
- package/dist/studio/generation.d.ts +0 -5
- package/dist/studio/index.js +1 -3
- package/dist/studio-react/index.js +1 -1
- package/dist/web-react/chat-stream.d.ts +1 -1
- package/dist/web-react/index.d.ts +10 -0
- package/dist/web-react/index.js +8 -10
- package/dist/web-react/work-product.d.ts +0 -2
- package/dist/work-product-react/index.js +1 -1
- package/dist/workspace-react/index.js +51 -5
- package/dist/workspace-react/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/DesignCanvasEditor-IBFHC25D.js +0 -15
- package/dist/chunk-4KFM7VTH.js.map +0 -1
- package/dist/chunk-BVKQKGRK.js.map +0 -1
- package/dist/chunk-CP36C5LZ.js.map +0 -1
- package/dist/chunk-CUXCWQMW.js.map +0 -1
- package/dist/chunk-LEECH4MY.js.map +0 -1
- package/dist/chunk-TY2DALJG.js.map +0 -1
- package/dist/chunk-UJHENCPR.js.map +0 -1
- package/dist/chunk-W3RSC6XB.js.map +0 -1
- package/dist/chunk-XDB7IBYE.js.map +0 -1
- package/dist/chunk-YB6BZKXY.js.map +0 -1
- /package/dist/{DesignCanvas-BVBMDXBZ.js.map → DesignCanvas-OWE67ZX3.js.map} +0 -0
- /package/dist/{DesignCanvasEditor-IBFHC25D.js.map → DesignCanvasEditor-VJ3R7RM2.js.map} +0 -0
- /package/dist/{TimelineEditor-52YEPDX5.js.map → TimelineEditor-7KBPJQLT.js.map} +0 -0
- /package/dist/{chunk-JB2GFEOC.js.map → chunk-2N7PDPLC.js.map} +0 -0
- /package/dist/{chunk-HQ7R6CGM.js.map → chunk-6NYVAURR.js.map} +0 -0
- /package/dist/{chunk-TSZIYQAZ.js.map → chunk-6VRVRWYN.js.map} +0 -0
- /package/dist/{chunk-RRWC77YY.js.map → chunk-CFGA7PXM.js.map} +0 -0
- /package/dist/{chunk-YJYPXMDL.js.map → chunk-DKHM4B4A.js.map} +0 -0
- /package/dist/{chunk-ZGY6QB4F.js.map → chunk-MEKOWH5E.js.map} +0 -0
- /package/dist/{chunk-2S7QRQUS.js.map → chunk-NJA6X7JI.js.map} +0 -0
- /package/dist/{chunk-JZ64GXYP.js.map → chunk-OMHGFN5I.js.map} +0 -0
- /package/dist/{chunk-UII6SBT4.js.map → chunk-RSTPXLC3.js.map} +0 -0
- /package/dist/{chunk-ZMMIQOFI.js.map → chunk-UII4YDYS.js.map} +0 -0
- /package/dist/{chunk-L57CYCXN.js.map → chunk-WN3UK23P.js.map} +0 -0
|
@@ -43,5 +43,3 @@ export declare const SEQUENCE_MEDIA_KINDS: readonly ["video", "image", "audio"];
|
|
|
43
43
|
export declare const MAX_CAPTION_BATCH = 500;
|
|
44
44
|
/** Resolve an array of immutable sequence MCP tool definitions for timeline and frame operations */
|
|
45
45
|
export declare const SEQUENCE_MCP_TOOLS: readonly SequenceMcpToolDefinition[];
|
|
46
|
-
/** Resolve the SequenceMcpToolDefinition matching the given name or return undefined */
|
|
47
|
-
export declare function findSequenceMcpTool(name: string): SequenceMcpToolDefinition | undefined;
|
|
@@ -149,12 +149,6 @@ export declare function clampClipStart(input: {
|
|
|
149
149
|
durationFrames: number;
|
|
150
150
|
sequenceDurationFrames: number;
|
|
151
151
|
}): number;
|
|
152
|
-
/** Clamp clip duration to fit within sequence bounds and minimum length constraints */
|
|
153
|
-
export declare function clampClipDuration(input: {
|
|
154
|
-
startFrame: number;
|
|
155
|
-
durationFrames: number;
|
|
156
|
-
sequenceDurationFrames: number;
|
|
157
|
-
}): number;
|
|
158
152
|
/** Validate that a clip's start and duration fit within the sequence duration without overflow */
|
|
159
153
|
export declare function assertClipFitsSequence(input: {
|
|
160
154
|
startFrame: number;
|
|
@@ -52,8 +52,8 @@ import {
|
|
|
52
52
|
trimClipCommand,
|
|
53
53
|
trimEndDrag,
|
|
54
54
|
trimStartDrag
|
|
55
|
-
} from "../chunk-
|
|
56
|
-
import "../chunk-
|
|
55
|
+
} from "../chunk-MEKOWH5E.js";
|
|
56
|
+
import "../chunk-SISVELAA.js";
|
|
57
57
|
|
|
58
58
|
// src/sequences-react/media/transcription.ts
|
|
59
59
|
var DEFAULT_WHISPER_MODEL = "onnx-community/whisper-large-v3-turbo";
|
|
@@ -187,7 +187,7 @@ function createWhisperTranscriptionProvider(opts) {
|
|
|
187
187
|
|
|
188
188
|
// src/sequences-react/lazy.tsx
|
|
189
189
|
import React from "react";
|
|
190
|
-
var SequenceTimelineEditorLazy = React.lazy(() => import("../TimelineEditor-
|
|
190
|
+
var SequenceTimelineEditorLazy = React.lazy(() => import("../TimelineEditor-7KBPJQLT.js"));
|
|
191
191
|
export {
|
|
192
192
|
BrandMark,
|
|
193
193
|
COMMAND_HISTORY_LIMIT,
|
package/dist/stream/index.js
CHANGED
|
@@ -28,8 +28,8 @@ import {
|
|
|
28
28
|
terminalizeDanglingAssistantToolUpdates,
|
|
29
29
|
terminalizeDanglingToolPart,
|
|
30
30
|
terminalizeDanglingToolParts
|
|
31
|
-
} from "../chunk-
|
|
32
|
-
import "../chunk-
|
|
31
|
+
} from "../chunk-UII4YDYS.js";
|
|
32
|
+
import "../chunk-FCON65I2.js";
|
|
33
33
|
import "../chunk-YJMCRXQQ.js";
|
|
34
34
|
import {
|
|
35
35
|
DEFAULT_RUNNING_TURN_LEASE_MS,
|
|
@@ -61,11 +61,6 @@ export declare function selectedModelsWithDefaults(current: Partial<Record<Gener
|
|
|
61
61
|
export declare function preferredModelId(type: GenerationType, catalog: MediaModelCatalogResponse | null): string | undefined;
|
|
62
62
|
/** True when a model list offers nothing sendable: no models, or every model unavailable. */
|
|
63
63
|
export declare function laneUnavailable(models: readonly MediaModelOption[]): boolean;
|
|
64
|
-
/** DEPRECATED (the composer renders availability in the pill/menu/lane states since #463) — resolve the status message for a media model.
|
|
65
|
-
* @deprecated The composer no longer renders an availability status line (#463) — availability is
|
|
66
|
-
* carried by the model pill, the menu rows, and the lane-down notice. Kept only for external
|
|
67
|
-
* consumers; removal is a breaking change. */
|
|
68
|
-
export declare function modelMessage(model: MediaModelOption | undefined, loading: boolean, count: number): string | null;
|
|
69
64
|
/** Define fields required to configure and request various types of media generation */
|
|
70
65
|
export interface GenerationRequestFields {
|
|
71
66
|
workspaceId: string;
|
package/dist/studio/index.js
CHANGED
|
@@ -32,7 +32,6 @@ import {
|
|
|
32
32
|
mergeGenerationPages,
|
|
33
33
|
mergeLiveGeneration,
|
|
34
34
|
mergeLoaderAndLive,
|
|
35
|
-
modelMessage,
|
|
36
35
|
normalizeImageCount,
|
|
37
36
|
normalizeVaultPath,
|
|
38
37
|
optimisticGeneration,
|
|
@@ -49,7 +48,7 @@ import {
|
|
|
49
48
|
textToVideoSibling,
|
|
50
49
|
userSafeGenerationMessage,
|
|
51
50
|
validateCustomImageSize
|
|
52
|
-
} from "../chunk-
|
|
51
|
+
} from "../chunk-7TYQ43TP.js";
|
|
53
52
|
export {
|
|
54
53
|
FALLBACK_VIDEO_MODEL_OPTIONS,
|
|
55
54
|
GENERATION_TYPES,
|
|
@@ -84,7 +83,6 @@ export {
|
|
|
84
83
|
mergeGenerationPages,
|
|
85
84
|
mergeLiveGeneration,
|
|
86
85
|
mergeLoaderAndLive,
|
|
87
|
-
modelMessage,
|
|
88
86
|
normalizeImageCount,
|
|
89
87
|
normalizeVaultPath,
|
|
90
88
|
optimisticGeneration,
|
|
@@ -47,7 +47,7 @@ export interface ChatStreamCallbacks {
|
|
|
47
47
|
}) => void;
|
|
48
48
|
onNotice?: (notice: {
|
|
49
49
|
id: string;
|
|
50
|
-
noticeKind: 'warning' | 'auto-declined';
|
|
50
|
+
noticeKind: 'warning' | 'auto-declined' | 'error';
|
|
51
51
|
text: string;
|
|
52
52
|
}) => void;
|
|
53
53
|
onMetadata?: (data: Record<string, unknown>) => void;
|
|
@@ -137,7 +137,17 @@ export type ChatMessageSegment = {
|
|
|
137
137
|
} | {
|
|
138
138
|
kind: 'tool';
|
|
139
139
|
call: ChatToolCallInfo;
|
|
140
|
+
}
|
|
141
|
+
/** An out-of-band transcript notice — a failed turn's error, a warning —
|
|
142
|
+
* rendered in its status tone so it never reads as answer prose. Map a
|
|
143
|
+
* persisted `notice` part (`noticeKind: 'error' | 'warning'`) to this. */
|
|
144
|
+
| {
|
|
145
|
+
kind: 'notice';
|
|
146
|
+
tone: ChatNoticeTone;
|
|
147
|
+
content: string;
|
|
140
148
|
};
|
|
149
|
+
/** Status tone of a {@link ChatMessageSegment} notice. */
|
|
150
|
+
export type ChatNoticeTone = 'error' | 'warning';
|
|
141
151
|
/** Describe the structure and properties of a chat message with roles, content, and optional metadata */
|
|
142
152
|
export interface ChatUiMessage extends ChatMessageMetrics {
|
|
143
153
|
id: string;
|
package/dist/web-react/index.js
CHANGED
|
@@ -134,7 +134,7 @@ import {
|
|
|
134
134
|
withoutRecordGridCreated,
|
|
135
135
|
withoutRecordGridRemoved,
|
|
136
136
|
withoutRecordGridUpdate
|
|
137
|
-
} from "../chunk-
|
|
137
|
+
} from "../chunk-PFOJRQ3Q.js";
|
|
138
138
|
import {
|
|
139
139
|
SessionHistoryPanel,
|
|
140
140
|
formatSessionTimestamp,
|
|
@@ -158,10 +158,9 @@ import {
|
|
|
158
158
|
ReviewQueuePanel,
|
|
159
159
|
WorkProductCard,
|
|
160
160
|
mergeReviewQueuePages,
|
|
161
|
-
reviewQueueStateLabel,
|
|
162
161
|
workProductPartsFromMessageParts,
|
|
163
162
|
workProductStatusLabel
|
|
164
|
-
} from "../chunk-
|
|
163
|
+
} from "../chunk-47UDWWUN.js";
|
|
165
164
|
import {
|
|
166
165
|
parseReviewQueueItem
|
|
167
166
|
} from "../chunk-GEYACSFW.js";
|
|
@@ -182,7 +181,7 @@ import {
|
|
|
182
181
|
renamePastedImages,
|
|
183
182
|
useComposerAttachments,
|
|
184
183
|
useDictation
|
|
185
|
-
} from "../chunk-
|
|
184
|
+
} from "../chunk-OMHGFN5I.js";
|
|
186
185
|
import "../chunk-L7MB2LLM.js";
|
|
187
186
|
import {
|
|
188
187
|
WorkspaceInitial,
|
|
@@ -214,7 +213,7 @@ import "../chunk-Q3ZHNN5X.js";
|
|
|
214
213
|
import "../chunk-FQYAJYPW.js";
|
|
215
214
|
import {
|
|
216
215
|
ATTACHMENT_ACCEPT
|
|
217
|
-
} from "../chunk-
|
|
216
|
+
} from "../chunk-NJA6X7JI.js";
|
|
218
217
|
import "../chunk-MCYJON3F.js";
|
|
219
218
|
import "../chunk-7YA4QNTU.js";
|
|
220
219
|
import {
|
|
@@ -224,7 +223,7 @@ import {
|
|
|
224
223
|
isChatAttachmentPart,
|
|
225
224
|
mentionInputToPart,
|
|
226
225
|
mentionPartsFromMessageParts
|
|
227
|
-
} from "../chunk-
|
|
226
|
+
} from "../chunk-V4JZ5OYC.js";
|
|
228
227
|
import "../chunk-ZVEEWGDK.js";
|
|
229
228
|
import {
|
|
230
229
|
DISPATCH_MAX_MEDIA_PARTS,
|
|
@@ -237,11 +236,11 @@ import {
|
|
|
237
236
|
fileMentionsToParts,
|
|
238
237
|
mediaTypeForMentionPath,
|
|
239
238
|
mentionKindForPath
|
|
240
|
-
} from "../chunk-
|
|
239
|
+
} from "../chunk-GYDFGEJ2.js";
|
|
241
240
|
import "../chunk-TXD5HXLE.js";
|
|
242
241
|
import {
|
|
243
242
|
attachmentPartKey
|
|
244
|
-
} from "../chunk-
|
|
243
|
+
} from "../chunk-UII4YDYS.js";
|
|
245
244
|
import {
|
|
246
245
|
INTERACTION_CANCEL_EVENT,
|
|
247
246
|
INTERACTION_EVENT,
|
|
@@ -266,7 +265,7 @@ import {
|
|
|
266
265
|
persistedPartToInteraction,
|
|
267
266
|
questionInteractionContentSignature,
|
|
268
267
|
stampInteractionAnswers
|
|
269
|
-
} from "../chunk-
|
|
268
|
+
} from "../chunk-FCON65I2.js";
|
|
270
269
|
import "../chunk-YJMCRXQQ.js";
|
|
271
270
|
export {
|
|
272
271
|
ATTACHMENT_ACCEPT,
|
|
@@ -454,7 +453,6 @@ export {
|
|
|
454
453
|
resolveProvenanceStanding,
|
|
455
454
|
responseErrorMessage,
|
|
456
455
|
restoreChatInteractions,
|
|
457
|
-
reviewQueueStateLabel,
|
|
458
456
|
rollUpProvenanceStanding,
|
|
459
457
|
sameRecordGridValue,
|
|
460
458
|
segmentMentionContent,
|
|
@@ -22,8 +22,6 @@ import { parseReviewQueueItem, type ReviewQueueItem, type ReviewQueueState } fro
|
|
|
22
22
|
import type { EvidenceEntry, ExceptionEntry, ProfileBacktestSummary, QualityCheck, WorkProductPersistedPart, WorkProductProvenance, WorkProductStatus } from '../work-product/types';
|
|
23
23
|
export { parseReviewQueueItem };
|
|
24
24
|
export type { ReviewQueueItem, ReviewQueueState };
|
|
25
|
-
/** Human label for a queue state. */
|
|
26
|
-
export declare function reviewQueueStateLabel(state: ReviewQueueState): string;
|
|
27
25
|
/** Human label for a work-product status. */
|
|
28
26
|
export declare function workProductStatusLabel(status: WorkProductStatus): string;
|
|
29
27
|
/** Every persisted work-product anchor on one message, re-validated. */
|
|
@@ -185,7 +185,7 @@ function WorkspaceMenu({
|
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
// src/workspace-react/companion.tsx
|
|
188
|
-
import { forwardRef, useCallback as useCallback2, useEffect, useImperativeHandle, useRef, useState as useState2 } from "react";
|
|
188
|
+
import { forwardRef, useCallback as useCallback2, useEffect, useImperativeHandle, useLayoutEffect, useRef, useState as useState2 } from "react";
|
|
189
189
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@tangle-network/sandbox-ui/primitives";
|
|
190
190
|
import { WorkspaceLayout } from "@tangle-network/sandbox-ui/workspace";
|
|
191
191
|
import { FlaskConical, FolderOpen, GitCompare, Monitor, Terminal } from "lucide-react";
|
|
@@ -324,10 +324,7 @@ var AgentWorkspaceCompanion = forwardRef(function AgentWorkspaceCompanion2({
|
|
|
324
324
|
persistenceKey,
|
|
325
325
|
minRightWidth: 280,
|
|
326
326
|
rightContentClassName: "flex flex-col overflow-hidden",
|
|
327
|
-
rightHeader: tabs.length > 0 ? /* @__PURE__ */ jsx2(
|
|
328
|
-
tab.icon,
|
|
329
|
-
/* @__PURE__ */ jsx2("span", { children: tab.label })
|
|
330
|
-
] }, tab.id)) }) : void 0,
|
|
327
|
+
rightHeader: tabs.length > 0 ? /* @__PURE__ */ jsx2(CompanionTabList, { tabs, active, label }) : void 0,
|
|
331
328
|
right: tabs.length > 0 ? tabs.map((tab) => {
|
|
332
329
|
const isActive = tab.id === active;
|
|
333
330
|
const retained = tab.keepMounted && visited.has(tab.id);
|
|
@@ -347,6 +344,55 @@ var AgentWorkspaceCompanion = forwardRef(function AgentWorkspaceCompanion2({
|
|
|
347
344
|
}
|
|
348
345
|
) }, persistenceKey);
|
|
349
346
|
});
|
|
347
|
+
function CompanionTabList({ tabs, active, label }) {
|
|
348
|
+
const frameRef = useRef(null);
|
|
349
|
+
const fullWidth = useRef(0);
|
|
350
|
+
const [compact, setCompact] = useState2(false);
|
|
351
|
+
const signature = tabs.map((tab) => `${tab.id}\0${tab.label}\0${tab.icon ? 1 : 0}`).join("");
|
|
352
|
+
useLayoutEffect(() => {
|
|
353
|
+
fullWidth.current = 0;
|
|
354
|
+
setCompact(false);
|
|
355
|
+
}, [signature]);
|
|
356
|
+
useLayoutEffect(() => {
|
|
357
|
+
const frame = frameRef.current;
|
|
358
|
+
const list = frame?.firstElementChild;
|
|
359
|
+
if (!frame || !(list instanceof HTMLElement)) return;
|
|
360
|
+
const fit = () => {
|
|
361
|
+
const available = frame.clientWidth;
|
|
362
|
+
if (!compact) {
|
|
363
|
+
fullWidth.current = list.scrollWidth;
|
|
364
|
+
if (list.scrollWidth > available + 1) setCompact(true);
|
|
365
|
+
} else if (fullWidth.current > 0 && available >= fullWidth.current) {
|
|
366
|
+
setCompact(false);
|
|
367
|
+
}
|
|
368
|
+
};
|
|
369
|
+
fit();
|
|
370
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
371
|
+
const observer = new ResizeObserver(fit);
|
|
372
|
+
observer.observe(frame);
|
|
373
|
+
return () => observer.disconnect();
|
|
374
|
+
}, [compact, signature]);
|
|
375
|
+
useEffect(() => {
|
|
376
|
+
const trigger = frameRef.current?.querySelector('[role="tab"][data-state="active"]');
|
|
377
|
+
trigger?.scrollIntoView?.({ block: "nearest", inline: "nearest" });
|
|
378
|
+
}, [active, compact]);
|
|
379
|
+
return /* @__PURE__ */ jsx2("div", { ref: frameRef, className: "min-w-0", "data-compact": compact ? "" : void 0, children: /* @__PURE__ */ jsx2(TabsList, { "aria-label": label, className: "h-9 max-w-full justify-start overflow-x-auto bg-transparent p-0", children: tabs.map((tab) => {
|
|
380
|
+
const iconOnly = compact && tab.icon && tab.id !== active;
|
|
381
|
+
return /* @__PURE__ */ jsxs2(
|
|
382
|
+
TabsTrigger,
|
|
383
|
+
{
|
|
384
|
+
value: tab.id,
|
|
385
|
+
title: iconOnly ? tab.label : void 0,
|
|
386
|
+
className: iconOnly ? "gap-1.5 px-2 text-sm" : "gap-1.5 px-2.5 text-sm",
|
|
387
|
+
children: [
|
|
388
|
+
tab.icon,
|
|
389
|
+
/* @__PURE__ */ jsx2("span", { className: iconOnly ? "sr-only" : void 0, children: tab.label })
|
|
390
|
+
]
|
|
391
|
+
},
|
|
392
|
+
tab.id
|
|
393
|
+
);
|
|
394
|
+
}) }) });
|
|
395
|
+
}
|
|
350
396
|
|
|
351
397
|
// src/workspace-react/workspace-list.tsx
|
|
352
398
|
import { useId, useMemo, useState as useState3 } from "react";
|