@tangle-network/ui 11.44.0 → 11.44.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/_virtual/_rolldown/runtime.js +1 -2
- package/dist/auth/auth.d.ts +1 -3
- package/dist/auth/auth.js +1 -2
- package/dist/auth/login-layout.d.ts +1 -3
- package/dist/auth/login-layout.js +1 -2
- package/dist/chat/agent-timeline.d.ts +1 -3
- package/dist/chat/agent-timeline.js +1 -2
- package/dist/chat/chat-container.d.ts +1 -3
- package/dist/chat/chat-container.js +3 -4
- package/dist/chat/chat-message.d.ts +1 -3
- package/dist/chat/chat-message.js +1 -2
- package/dist/chat/message-author.d.ts +1 -3
- package/dist/chat/message-author.js +1 -2
- package/dist/chat/message-list.d.ts +1 -3
- package/dist/chat/message-list.js +1 -2
- package/dist/chat/synthetic-text.js +1 -2
- package/dist/chat/thinking-indicator.d.ts +1 -3
- package/dist/chat/thinking-indicator.js +1 -2
- package/dist/chat/transcript-text.d.ts +1 -3
- package/dist/chat/transcript-text.js +1 -2
- package/dist/chat/user-message.d.ts +1 -3
- package/dist/chat/user-message.js +1 -2
- package/dist/code-presentation.js +1 -2
- package/dist/editor/document-editor-pane.d.ts +1 -3
- package/dist/editor/document-editor-pane.js +3 -4
- package/dist/editor/editor-lazy.js +1 -2
- package/dist/editor/editor-loading.js +1 -2
- package/dist/editor/editor-peers.js +1 -2
- package/dist/editor/editor-provider.d.ts +1 -3
- package/dist/editor/editor-provider.js +1 -2
- package/dist/editor/editor-toolbar.d.ts +1 -3
- package/dist/editor/editor-toolbar.js +1 -2
- package/dist/editor/markdown-conversion.js +1 -2
- package/dist/editor/markdown-document-editor.js +1 -2
- package/dist/editor/source-markdown-editor.js +1 -2
- package/dist/editor/source-markdown.js +1 -2
- package/dist/editor/tiptap-editor.d.ts +0 -2
- package/dist/editor/tiptap-editor.js +1 -2
- package/dist/editor/use-editor.d.ts +1 -3
- package/dist/editor/use-editor.js +1 -2
- package/dist/files/file-artifact-pane.d.ts +1 -3
- package/dist/files/file-artifact-pane.js +4 -5
- package/dist/files/file-card.d.ts +1 -3
- package/dist/files/file-card.js +1 -2
- package/dist/files/file-format.d.ts +1 -3
- package/dist/files/file-format.js +1 -2
- package/dist/files/file-list.d.ts +1 -3
- package/dist/files/file-list.js +1 -2
- package/dist/files/file-preview.d.ts +1 -3
- package/dist/files/file-preview.js +1 -2
- package/dist/files/file-tabs.d.ts +1 -3
- package/dist/files/file-tabs.js +1 -2
- package/dist/files/file-tree.d.ts +1 -3
- package/dist/files/file-tree.js +1 -2
- package/dist/files/pdf-loader.d.ts +1 -3
- package/dist/files/pdf-loader.js +1 -2
- package/dist/files/pdf-viewer.d.ts +1 -3
- package/dist/files/pdf-viewer.js +1 -2
- package/dist/files/rich-file-tree.d.ts +1 -3
- package/dist/files/rich-file-tree.js +1 -2
- package/dist/hooks/use-auth.d.ts +1 -3
- package/dist/hooks/use-auth.js +1 -2
- package/dist/hooks/use-auto-scroll.d.ts +1 -3
- package/dist/hooks/use-auto-scroll.js +1 -2
- package/dist/hooks/use-dropdown-menu.d.ts +1 -2
- package/dist/hooks/use-dropdown-menu.js +1 -2
- package/dist/hooks/use-live-time.d.ts +1 -3
- package/dist/hooks/use-live-time.js +1 -2
- package/dist/hooks/use-realtime-session.d.ts +1 -3
- package/dist/hooks/use-realtime-session.js +1 -2
- package/dist/hooks/use-run-collapse-state.d.ts +1 -3
- package/dist/hooks/use-run-collapse-state.js +1 -2
- package/dist/hooks/use-run-groups.d.ts +1 -3
- package/dist/hooks/use-run-groups.js +1 -2
- package/dist/hooks/use-sdk-session.d.ts +1 -3
- package/dist/hooks/use-sdk-session.js +1 -2
- package/dist/hooks/use-sse-stream.d.ts +1 -3
- package/dist/hooks/use-sse-stream.js +1 -2
- package/dist/hooks/use-tool-call-stream.d.ts +1 -3
- package/dist/hooks/use-tool-call-stream.js +1 -2
- package/dist/lib/code-presentation.d.ts +1 -3
- package/dist/lib/code-presentation.js +1 -2
- package/dist/lib/control-presentation.d.ts +0 -2
- package/dist/lib/control-presentation.js +1 -2
- package/dist/lib/focus.d.ts +1 -3
- package/dist/lib/focus.js +1 -2
- package/dist/lib/interaction.d.ts +1 -3
- package/dist/lib/interaction.js +1 -2
- package/dist/lib/motion.d.ts +1 -3
- package/dist/lib/motion.js +1 -2
- package/dist/lib/optional-peer.js +1 -2
- package/dist/lib/series.d.ts +1 -3
- package/dist/lib/series.js +1 -2
- package/dist/lib/surface-motion.js +1 -2
- package/dist/lib/utils.d.ts +1 -3
- package/dist/lib/utils.js +1 -2
- package/dist/markdown/api-schema.d.ts +1 -3
- package/dist/markdown/api-schema.js +1 -2
- package/dist/markdown/code-block.d.ts +0 -2
- package/dist/markdown/code-block.js +1 -2
- package/dist/markdown/code-meta.d.ts +1 -3
- package/dist/markdown/code-meta.js +1 -2
- package/dist/markdown/markdown-table.d.ts +1 -3
- package/dist/markdown/markdown-table.js +1 -2
- package/dist/markdown/markdown.d.ts +1 -3
- package/dist/markdown/markdown.js +1 -2
- package/dist/nav.d.ts +0 -2
- package/dist/nav.js +1 -2
- package/dist/openui/openui-artifact-renderer.d.ts +1 -2
- package/dist/openui/openui-artifact-renderer.js +1 -2
- package/dist/openui/schema-compiled.js +1 -2
- package/dist/openui/schema-data.d.ts +1 -3
- package/dist/openui/schema-data.js +1 -2
- package/dist/openui-schema.d.ts +0 -2
- package/dist/openui-schema.js +1 -2
- package/dist/presentation.d.ts +0 -2
- package/dist/presentation.js +1 -2
- package/dist/primitives/alert-dialog.d.ts +0 -2
- package/dist/primitives/alert-dialog.js +1 -2
- package/dist/primitives/alert.d.ts +1 -3
- package/dist/primitives/alert.js +1 -2
- package/dist/primitives/artifact-pane.d.ts +1 -3
- package/dist/primitives/artifact-pane.js +1 -2
- package/dist/primitives/avatar.d.ts +0 -2
- package/dist/primitives/avatar.js +1 -2
- package/dist/primitives/badge.d.ts +0 -2
- package/dist/primitives/badge.js +1 -2
- package/dist/primitives/breadcrumb.d.ts +0 -2
- package/dist/primitives/breadcrumb.js +1 -2
- package/dist/primitives/button.d.ts +0 -2
- package/dist/primitives/button.js +1 -2
- package/dist/primitives/calendar.d.ts +0 -2
- package/dist/primitives/calendar.js +1 -2
- package/dist/primitives/card.d.ts +0 -2
- package/dist/primitives/card.js +1 -2
- package/dist/primitives/checkbox.d.ts +0 -2
- package/dist/primitives/checkbox.js +1 -2
- package/dist/primitives/chip.d.ts +0 -2
- package/dist/primitives/chip.js +1 -2
- package/dist/primitives/code-block.d.ts +0 -2
- package/dist/primitives/code-block.js +1 -2
- package/dist/primitives/collapsible.d.ts +0 -2
- package/dist/primitives/collapsible.js +1 -2
- package/dist/primitives/compliance-badge.d.ts +0 -2
- package/dist/primitives/compliance-badge.js +3 -4
- package/dist/primitives/context-menu.d.ts +0 -2
- package/dist/primitives/context-menu.js +1 -2
- package/dist/primitives/date-picker.d.ts +0 -2
- package/dist/primitives/date-picker.js +1 -2
- package/dist/primitives/dialog.d.ts +0 -2
- package/dist/primitives/dialog.js +3 -4
- package/dist/primitives/drop-zone.d.ts +1 -3
- package/dist/primitives/drop-zone.js +1 -2
- package/dist/primitives/dropdown-menu.d.ts +0 -2
- package/dist/primitives/dropdown-menu.js +1 -2
- package/dist/primitives/empty-state.d.ts +0 -2
- package/dist/primitives/empty-state.js +1 -2
- package/dist/primitives/field.d.ts +1 -3
- package/dist/primitives/field.js +1 -2
- package/dist/primitives/heading.d.ts +0 -2
- package/dist/primitives/heading.js +1 -2
- package/dist/primitives/help-text.d.ts +0 -2
- package/dist/primitives/help-text.js +1 -2
- package/dist/primitives/hover-card.d.ts +0 -2
- package/dist/primitives/hover-card.js +1 -2
- package/dist/primitives/icon-tile.d.ts +0 -2
- package/dist/primitives/icon-tile.js +1 -2
- package/dist/primitives/info-tip.js +1 -2
- package/dist/primitives/input.d.ts +0 -2
- package/dist/primitives/input.js +1 -2
- package/dist/primitives/label.d.ts +0 -2
- package/dist/primitives/label.js +1 -2
- package/dist/primitives/metric-chart.d.ts +0 -2
- package/dist/primitives/metric-chart.js +1 -2
- package/dist/primitives/metric-strip.d.ts +0 -2
- package/dist/primitives/metric-strip.js +1 -2
- package/dist/primitives/page-header.d.ts +0 -2
- package/dist/primitives/page-header.js +1 -2
- package/dist/primitives/page-shell.d.ts +1 -3
- package/dist/primitives/page-shell.js +1 -2
- package/dist/primitives/pagination.d.ts +1 -2
- package/dist/primitives/pagination.js +1 -2
- package/dist/primitives/popover.d.ts +0 -2
- package/dist/primitives/popover.js +1 -2
- package/dist/primitives/progress.d.ts +0 -2
- package/dist/primitives/progress.js +1 -2
- package/dist/primitives/radio-group.d.ts +0 -2
- package/dist/primitives/radio-group.js +1 -2
- package/dist/primitives/segmented-control.d.ts +1 -3
- package/dist/primitives/segmented-control.js +4 -5
- package/dist/primitives/select.d.ts +0 -2
- package/dist/primitives/select.js +1 -2
- package/dist/primitives/separator.d.ts +0 -2
- package/dist/primitives/separator.js +1 -2
- package/dist/primitives/series-sparkline.d.ts +0 -2
- package/dist/primitives/series-sparkline.js +1 -2
- package/dist/primitives/settings.d.ts +1 -3
- package/dist/primitives/settings.js +1 -2
- package/dist/primitives/sheet.d.ts +0 -2
- package/dist/primitives/sheet.js +3 -4
- package/dist/primitives/sidebar-drop-zone.d.ts +1 -3
- package/dist/primitives/sidebar-drop-zone.js +1 -2
- package/dist/primitives/skeleton.d.ts +0 -2
- package/dist/primitives/skeleton.js +1 -2
- package/dist/primitives/slider.d.ts +0 -2
- package/dist/primitives/slider.js +1 -2
- package/dist/primitives/stat-card.d.ts +0 -2
- package/dist/primitives/stat-card.js +1 -2
- package/dist/primitives/status-pill.d.ts +0 -2
- package/dist/primitives/status-pill.js +1 -2
- package/dist/primitives/switch.d.ts +0 -2
- package/dist/primitives/switch.js +1 -2
- package/dist/primitives/table.d.ts +0 -2
- package/dist/primitives/table.js +1 -2
- package/dist/primitives/tabs.d.ts +0 -2
- package/dist/primitives/tabs.js +1 -2
- package/dist/primitives/tag.d.ts +0 -2
- package/dist/primitives/tag.js +1 -2
- package/dist/primitives/terminal-display.d.ts +0 -2
- package/dist/primitives/terminal-display.js +1 -2
- package/dist/primitives/text-shimmer.d.ts +1 -3
- package/dist/primitives/text-shimmer.js +1 -2
- package/dist/primitives/theme-toggle.d.ts +1 -2
- package/dist/primitives/theme-toggle.js +1 -2
- package/dist/primitives/time-select.d.ts +0 -2
- package/dist/primitives/time-select.js +1 -2
- package/dist/primitives/toast.d.ts +1 -2
- package/dist/primitives/toast.js +1 -2
- package/dist/primitives/tone.d.ts +1 -3
- package/dist/primitives/tone.js +1 -2
- package/dist/primitives/toolbar.d.ts +0 -2
- package/dist/primitives/toolbar.js +1 -2
- package/dist/primitives/tooltip.d.ts +0 -2
- package/dist/primitives/tooltip.js +1 -2
- package/dist/primitives/upload-progress.d.ts +1 -3
- package/dist/primitives/upload-progress.js +1 -2
- package/dist/primitives/wizard.d.ts +1 -3
- package/dist/primitives/wizard.js +1 -2
- package/dist/redaction/redacted-document.d.ts +1 -3
- package/dist/redaction/redacted-document.js +1 -2
- package/dist/redaction.js +1 -2
- package/dist/run/approval-card.d.ts +1 -3
- package/dist/run/approval-card.js +1 -2
- package/dist/run/expandable-content.js +1 -2
- package/dist/run/expanded-tool-detail.d.ts +1 -3
- package/dist/run/expanded-tool-detail.js +1 -2
- package/dist/run/inline-thinking-item.d.ts +1 -3
- package/dist/run/inline-thinking-item.js +1 -2
- package/dist/run/inline-tool-item.d.ts +1 -3
- package/dist/run/inline-tool-item.js +1 -2
- package/dist/run/run-group.d.ts +1 -3
- package/dist/run/run-group.js +1 -2
- package/dist/run/run-item-primitives.d.ts +1 -3
- package/dist/run/run-item-primitives.js +1 -2
- package/dist/run/run-phase-list.d.ts +1 -3
- package/dist/run/run-phase-list.js +1 -2
- package/dist/run/run-row-shell.d.ts +1 -3
- package/dist/run/run-row-shell.js +1 -2
- package/dist/run/task-list.d.ts +1 -3
- package/dist/run/task-list.js +1 -2
- package/dist/run/tool-call-feed.d.ts +1 -3
- package/dist/run/tool-call-feed.js +1 -2
- package/dist/run/tool-call-step.d.ts +1 -3
- package/dist/run/tool-call-step.js +1 -2
- package/dist/stores/active-sessions-store.d.ts +1 -3
- package/dist/stores/active-sessions-store.js +1 -2
- package/dist/stores/chat-store.d.ts +1 -3
- package/dist/stores/chat-store.js +1 -2
- package/dist/tool-previews/command-preview.d.ts +1 -3
- package/dist/tool-previews/command-preview.js +1 -2
- package/dist/tool-previews/diff-preview.d.ts +1 -3
- package/dist/tool-previews/diff-preview.js +1 -2
- package/dist/tool-previews/glob-results-preview.d.ts +1 -3
- package/dist/tool-previews/glob-results-preview.js +1 -2
- package/dist/tool-previews/grep-results-preview.d.ts +1 -3
- package/dist/tool-previews/grep-results-preview.js +1 -2
- package/dist/tool-previews/preview-primitives.js +1 -2
- package/dist/tool-previews/question-preview.d.ts +1 -3
- package/dist/tool-previews/question-preview.js +1 -2
- package/dist/tool-previews/web-search-preview.d.ts +1 -3
- package/dist/tool-previews/web-search-preview.js +1 -2
- package/dist/tool-previews/write-file-preview.d.ts +1 -3
- package/dist/tool-previews/write-file-preview.js +1 -2
- package/dist/types/branding.d.ts +1 -3
- package/dist/types/message.d.ts +1 -3
- package/dist/types/parts.d.ts +1 -3
- package/dist/types/run.d.ts +1 -3
- package/dist/types/tool-display.d.ts +1 -3
- package/dist/utils/copy-text.d.ts +1 -3
- package/dist/utils/copy-text.js +1 -2
- package/dist/utils/format.d.ts +1 -3
- package/dist/utils/format.js +1 -2
- package/dist/utils/time-ago.d.ts +1 -3
- package/dist/utils/time-ago.js +1 -2
- package/dist/utils/tool-display.d.ts +1 -3
- package/dist/utils/tool-display.js +1 -2
- package/package.json +38 -38
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// \0rolldown/runtime.js
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __exportAll = (all, no_symbols) => {
|
|
4
4
|
let target = {};
|
|
@@ -9,5 +9,4 @@ var __exportAll = (all, no_symbols) => {
|
|
|
9
9
|
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
10
10
|
return target;
|
|
11
11
|
};
|
|
12
|
-
//#endregion
|
|
13
12
|
export { __exportAll };
|
package/dist/auth/auth.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ButtonProps } from "../primitives/button.js";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
//#region src/auth/auth.d.ts
|
|
4
3
|
export interface SessionUser {
|
|
5
4
|
customer_id: string;
|
|
6
5
|
email: string;
|
|
@@ -49,5 +48,4 @@ export interface AuthHeaderProps {
|
|
|
49
48
|
/** Custom className */
|
|
50
49
|
className?: string;
|
|
51
50
|
}
|
|
52
|
-
export declare function AuthHeader({ user, loading, variant, apiBaseUrl, menuLinks, className }: AuthHeaderProps): React.JSX.Element;
|
|
53
|
-
//#endregion
|
|
51
|
+
export declare function AuthHeader({ user, loading, variant, apiBaseUrl, menuLinks, className }: AuthHeaderProps): React.JSX.Element;
|
package/dist/auth/auth.js
CHANGED
|
@@ -5,7 +5,7 @@ import { Button } from "../primitives/button.js";
|
|
|
5
5
|
import { Avatar, AvatarFallback, AvatarImage } from "../primitives/avatar.js";
|
|
6
6
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from "../primitives/dropdown-menu.js";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
-
|
|
8
|
+
// src/auth/auth.tsx
|
|
9
9
|
function GitHubIcon({ className }) {
|
|
10
10
|
return /* @__PURE__ */ jsx("svg", {
|
|
11
11
|
className,
|
|
@@ -120,5 +120,4 @@ function AuthHeader({ user, loading = false, variant = "sandbox", apiBaseUrl = "
|
|
|
120
120
|
links: menuLinks
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
|
-
//#endregion
|
|
124
123
|
export { AuthHeader, GitHubLoginButton, UserMenu };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
//#region src/auth/login-layout.d.ts
|
|
3
2
|
export interface LoginLayoutProps {
|
|
4
3
|
title?: React.ReactNode;
|
|
5
4
|
subtitle?: React.ReactNode;
|
|
@@ -16,5 +15,4 @@ export interface LoginLayoutProps {
|
|
|
16
15
|
href: string;
|
|
17
16
|
}[];
|
|
18
17
|
}
|
|
19
|
-
export declare function LoginLayout({ title, subtitle, brandIcon, children, className }: LoginLayoutProps): React.JSX.Element;
|
|
20
|
-
//#endregion
|
|
18
|
+
export declare function LoginLayout({ title, subtitle, brandIcon, children, className }: LoginLayoutProps): React.JSX.Element;
|
|
@@ -3,7 +3,7 @@ import { cn } from "../lib/utils.js";
|
|
|
3
3
|
import "react";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { Terminal } from "lucide-react";
|
|
6
|
-
|
|
6
|
+
// src/auth/login-layout.tsx
|
|
7
7
|
function LoginLayout({ title = "Welcome Back", subtitle = "Sign in to your workspace.", brandIcon, children, className }) {
|
|
8
8
|
return /* @__PURE__ */ jsx("div", {
|
|
9
9
|
className: cn("relative flex min-h-screen items-center justify-center bg-background overflow-hidden antialiased font-sans flex-col", className),
|
|
@@ -32,5 +32,4 @@ function LoginLayout({ title = "Welcome Back", subtitle = "Sign in to your works
|
|
|
32
32
|
})
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
-
//#endregion
|
|
36
35
|
export { LoginLayout };
|
|
@@ -3,7 +3,6 @@ import { ToolPart } from "../types/parts.js";
|
|
|
3
3
|
import { MessageRole } from "./chat-message.js";
|
|
4
4
|
import { ToolCallData } from "../run/tool-call-feed.js";
|
|
5
5
|
import { ReactNode } from "react";
|
|
6
|
-
//#region src/chat/agent-timeline.d.ts
|
|
7
6
|
export type AgentTimelineTone = "default" | "info" | "success" | "warning" | "error";
|
|
8
7
|
export interface AgentTimelineMessageItem {
|
|
9
8
|
id: string;
|
|
@@ -91,5 +90,4 @@ export interface AgentTimelineProps {
|
|
|
91
90
|
* as one plain column: prose at the reading size, tool calls as quiet
|
|
92
91
|
* one-liners between the paragraphs, no connector chrome.
|
|
93
92
|
*/
|
|
94
|
-
export declare function AgentTimeline({ items, isThinking, emptyState, className, renderToolActions, collapseAfter, viewerId }: AgentTimelineProps): import("react").JSX.Element | null;
|
|
95
|
-
//#endregion
|
|
93
|
+
export declare function AgentTimeline({ items, isThinking, emptyState, className, renderToolActions, collapseAfter, viewerId }: AgentTimelineProps): import("react").JSX.Element | null;
|
|
@@ -9,7 +9,7 @@ import { ToolCallGroup, ToolCallStep } from "../run/tool-call-step.js";
|
|
|
9
9
|
import { useState } from "react";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { AlertTriangle, CheckCircle2, CircleDot, FileText, Info } from "lucide-react";
|
|
12
|
-
|
|
12
|
+
// src/chat/agent-timeline.tsx
|
|
13
13
|
const TONE_STYLES = {
|
|
14
14
|
default: {
|
|
15
15
|
card: "border-border bg-card",
|
|
@@ -255,5 +255,4 @@ function AgentTimeline({ items, isThinking, emptyState, className, renderToolAct
|
|
|
255
255
|
}) : null]
|
|
256
256
|
});
|
|
257
257
|
}
|
|
258
|
-
//#endregion
|
|
259
258
|
export { AgentTimeline };
|
|
@@ -5,7 +5,6 @@ import { CustomToolRenderer } from "../types/tool-display.js";
|
|
|
5
5
|
import { Run } from "../types/run.js";
|
|
6
6
|
import { OpenUIAction } from "../openui/openui-artifact-renderer.js";
|
|
7
7
|
import { ReactNode } from "react";
|
|
8
|
-
//#region src/chat/chat-container.d.ts
|
|
9
8
|
/**
|
|
10
9
|
* Transcript-only container: message list + auto-scroll. Composers are
|
|
11
10
|
* composed BELOW this by the app (the canonical one is `AgentComposer` in
|
|
@@ -47,5 +46,4 @@ export interface ChatContainerProps {
|
|
|
47
46
|
* Chat transcript container: message list + auto-scroll.
|
|
48
47
|
* Orchestrates useRunGroups, useRunCollapseState, and useAutoScroll.
|
|
49
48
|
*/
|
|
50
|
-
export declare const ChatContainer: import("react").MemoExoticComponent<({ messages, partMap, isStreaming, branding, className, renderToolDetail, presentation, onOpenUIAction, enableOpenUI, renderRunActions, renderUserMessageActions, renderToolActions, renderTimelineToolActions, collapseTimelineAfter }: ChatContainerProps) => import("react").JSX.Element>;
|
|
51
|
-
//#endregion
|
|
49
|
+
export declare const ChatContainer: import("react").MemoExoticComponent<({ messages, partMap, isStreaming, branding, className, renderToolDetail, presentation, onOpenUIAction, enableOpenUI, renderRunActions, renderUserMessageActions, renderToolActions, renderTimelineToolActions, collapseTimelineAfter }: ChatContainerProps) => import("react").JSX.Element>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "../lib/focus.js";
|
|
2
2
|
import { cn } from "../lib/utils.js";
|
|
3
3
|
import { getToolDisplayMetadata } from "../utils/tool-display.js";
|
|
4
4
|
import { useRunGroups } from "../hooks/use-run-groups.js";
|
|
@@ -12,7 +12,7 @@ import { AgentTimeline } from "./agent-timeline.js";
|
|
|
12
12
|
import { memo, useMemo, useRef } from "react";
|
|
13
13
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
14
|
import { ArrowDown } from "lucide-react";
|
|
15
|
-
|
|
15
|
+
// src/chat/chat-container.tsx
|
|
16
16
|
const OPENUI_NODE_TYPES = /* @__PURE__ */ new Set([
|
|
17
17
|
"heading",
|
|
18
18
|
"text",
|
|
@@ -320,12 +320,11 @@ const ChatContainer = memo(({ messages, partMap, isStreaming, branding, classNam
|
|
|
320
320
|
className: "relative z-10 -mt-10 flex justify-center",
|
|
321
321
|
children: /* @__PURE__ */ jsxs("button", {
|
|
322
322
|
onClick: scrollToBottom,
|
|
323
|
-
className: cn("flex items-center gap-1.5 px-3 py-1.5 rounded-full", "border border-border bg-card shadow-[0_6px_16px_rgba(15,23,42,0.08)]", "text-xs text-foreground transition-colors hover:bg-accent",
|
|
323
|
+
className: cn("flex items-center gap-1.5 px-3 py-1.5 rounded-full", "border border-border bg-card shadow-[0_6px_16px_rgba(15,23,42,0.08)]", "text-xs text-foreground transition-colors hover:bg-accent", "focus-visible:outline-1 focus-visible:outline-[var(--focus-border)] focus-visible:ring-4 focus-visible:ring-[var(--focus-halo)] focus-visible:outline-offset-0"),
|
|
324
324
|
children: [/* @__PURE__ */ jsx(ArrowDown, { className: "w-3 h-3" }), "Scroll to bottom"]
|
|
325
325
|
})
|
|
326
326
|
})]
|
|
327
327
|
});
|
|
328
328
|
});
|
|
329
329
|
ChatContainer.displayName = "ChatContainer";
|
|
330
|
-
//#endregion
|
|
331
330
|
export { ChatContainer };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ChatAuthor } from "../types/message.js";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
|
-
//#region src/chat/chat-message.d.ts
|
|
4
3
|
export type MessageRole = "user" | "assistant" | "system";
|
|
5
4
|
export interface ChatMessageProps {
|
|
6
5
|
role: MessageRole;
|
|
@@ -30,5 +29,4 @@ export interface ChatMessageProps {
|
|
|
30
29
|
*/
|
|
31
30
|
viewerId?: string;
|
|
32
31
|
}
|
|
33
|
-
export declare function ChatMessage({ role, content, toolCalls, isStreaming, timestamp, className, userLabel, assistantLabel, hideRoleLabel, author, viewerId }: ChatMessageProps): import("react").JSX.Element;
|
|
34
|
-
//#endregion
|
|
32
|
+
export declare function ChatMessage({ role, content, toolCalls, isStreaming, timestamp, className, userLabel, assistantLabel, hideRoleLabel, author, viewerId }: ChatMessageProps): import("react").JSX.Element;
|
|
@@ -3,7 +3,7 @@ import { Markdown } from "../markdown/markdown.js";
|
|
|
3
3
|
import { TRANSCRIPT_TEXT } from "./transcript-text.js";
|
|
4
4
|
import { MessageAuthor, isViewerMessage } from "./message-author.js";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
|
|
6
|
+
// src/chat/chat-message.tsx
|
|
7
7
|
/**
|
|
8
8
|
* ChatMessage — one message in the conversation.
|
|
9
9
|
*
|
|
@@ -48,5 +48,4 @@ function formatTime(date) {
|
|
|
48
48
|
minute: "2-digit"
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
|
-
//#endregion
|
|
52
51
|
export { ChatMessage };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ChatAuthor } from "../types/message.js";
|
|
2
2
|
import { HTMLAttributes } from "react";
|
|
3
|
-
//#region src/chat/message-author.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Whether the reader wrote a human message. A message without an author is
|
|
6
5
|
* the reader's, which keeps a two-party transcript as it was. A message with
|
|
@@ -20,5 +19,4 @@ export interface MessageAuthorProps extends Omit<HTMLAttributes<HTMLDivElement>,
|
|
|
20
19
|
* participants, so the name is always shown beside it. The avatar repeats the
|
|
21
20
|
* visible name and is hidden from assistive technology.
|
|
22
21
|
*/
|
|
23
|
-
export declare function MessageAuthor({ author, className, ...props }: MessageAuthorProps): import("react").JSX.Element;
|
|
24
|
-
//#endregion
|
|
22
|
+
export declare function MessageAuthor({ author, className, ...props }: MessageAuthorProps): import("react").JSX.Element;
|
|
@@ -3,7 +3,7 @@ import { toneFor } from "../primitives/tone.js";
|
|
|
3
3
|
import { Tag } from "../primitives/tag.js";
|
|
4
4
|
import { IconTile } from "../primitives/icon-tile.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
|
|
6
|
+
// src/chat/message-author.tsx
|
|
7
7
|
/**
|
|
8
8
|
* Whether the reader wrote a human message. A message without an author is
|
|
9
9
|
* the reader's, which keeps a two-party transcript as it was. A message with
|
|
@@ -49,5 +49,4 @@ function MessageAuthor({ author, className, ...props }) {
|
|
|
49
49
|
]
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
|
-
//#endregion
|
|
53
52
|
export { MessageAuthor, isViewerMessage };
|
|
@@ -4,7 +4,6 @@ import { AgentBranding } from "../types/branding.js";
|
|
|
4
4
|
import { CustomToolRenderer } from "../types/tool-display.js";
|
|
5
5
|
import { GroupedMessage } from "../types/run.js";
|
|
6
6
|
import { ReactNode } from "react";
|
|
7
|
-
//#region src/chat/message-list.d.ts
|
|
8
7
|
export interface MessageListProps {
|
|
9
8
|
groups: GroupedMessage[];
|
|
10
9
|
partMap: Record<string, SessionPart[]>;
|
|
@@ -28,5 +27,4 @@ export interface MessageListProps {
|
|
|
28
27
|
* Maps GroupedMessage[] to UserMessage and RunGroup components.
|
|
29
28
|
* This is the main render list for the chat view.
|
|
30
29
|
*/
|
|
31
|
-
export declare const MessageList: import("react").MemoExoticComponent<({ groups, partMap, isCollapsed, onToggleCollapse, branding, renderToolDetail, renderRunActions, renderUserMessageActions, renderToolActions }: MessageListProps) => import("react").JSX.Element>;
|
|
32
|
-
//#endregion
|
|
30
|
+
export declare const MessageList: import("react").MemoExoticComponent<({ groups, partMap, isCollapsed, onToggleCollapse, branding, renderToolDetail, renderRunActions, renderUserMessageActions, renderToolActions }: MessageListProps) => import("react").JSX.Element>;
|
|
@@ -2,7 +2,7 @@ import { RunGroup } from "../run/run-group.js";
|
|
|
2
2
|
import { UserMessage } from "./user-message.js";
|
|
3
3
|
import { memo } from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
|
|
5
|
+
// src/chat/message-list.tsx
|
|
6
6
|
/**
|
|
7
7
|
* Maps GroupedMessage[] to UserMessage and RunGroup components.
|
|
8
8
|
* This is the main render list for the chat view.
|
|
@@ -33,5 +33,4 @@ const MessageList = memo(({ groups, partMap, isCollapsed, onToggleCollapse, bran
|
|
|
33
33
|
});
|
|
34
34
|
});
|
|
35
35
|
MessageList.displayName = "MessageList";
|
|
36
|
-
//#endregion
|
|
37
36
|
export { MessageList };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
|
|
2
|
+
// src/chat/synthetic-text.tsx
|
|
3
3
|
/** Internal transcript chrome, never attributed to a user or model. */
|
|
4
4
|
function SyntheticText({ text }) {
|
|
5
5
|
if (!text.trim()) return null;
|
|
@@ -48,5 +48,4 @@ function userTextSegments(parts) {
|
|
|
48
48
|
flush();
|
|
49
49
|
return segments;
|
|
50
50
|
}
|
|
51
|
-
//#endregion
|
|
52
51
|
export { SyntheticText, userTextSegments };
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
//#region src/chat/thinking-indicator.d.ts
|
|
2
1
|
export interface ThinkingIndicatorProps {
|
|
3
2
|
className?: string;
|
|
4
3
|
}
|
|
5
|
-
export declare function ThinkingIndicator({ className }: ThinkingIndicatorProps): import("react").JSX.Element;
|
|
6
|
-
//#endregion
|
|
4
|
+
export declare function ThinkingIndicator({ className }: ThinkingIndicatorProps): import("react").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn } from "../lib/utils.js";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
|
|
4
|
+
// src/chat/thinking-indicator.tsx
|
|
5
5
|
function ThinkingIndicator({ className }) {
|
|
6
6
|
const [elapsed, setElapsed] = useState(0);
|
|
7
7
|
useEffect(() => {
|
|
@@ -34,5 +34,4 @@ function ThinkingIndicator({ className }) {
|
|
|
34
34
|
})]
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
|
-
//#endregion
|
|
38
37
|
export { ThinkingIndicator };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/chat/transcript-text.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* The one text treatment for every chat message body, the person's and the
|
|
4
3
|
* agent's alike, so the two differ only by alignment and surface.
|
|
@@ -7,5 +6,4 @@
|
|
|
7
6
|
* host that has not loaded brand's globals. `length:` types the token: a bare
|
|
8
7
|
* `text-[var(--x)]` compiles to a color.
|
|
9
8
|
*/
|
|
10
|
-
export declare const TRANSCRIPT_TEXT = "tangle-transcript-text text-[length:var(--transcript-font-size)] leading-[var(--transcript-line-height)]";
|
|
11
|
-
//#endregion
|
|
9
|
+
export declare const TRANSCRIPT_TEXT = "tangle-transcript-text text-[length:var(--transcript-font-size)] leading-[var(--transcript-line-height)]";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/chat/transcript-text.ts
|
|
2
2
|
/**
|
|
3
3
|
* The one text treatment for every chat message body, the person's and the
|
|
4
4
|
* agent's alike, so the two differ only by alignment and surface.
|
|
@@ -8,5 +8,4 @@
|
|
|
8
8
|
* `text-[var(--x)]` compiles to a color.
|
|
9
9
|
*/
|
|
10
10
|
const TRANSCRIPT_TEXT = "tangle-transcript-text text-[length:var(--transcript-font-size)] leading-[var(--transcript-line-height)]";
|
|
11
|
-
//#endregion
|
|
12
11
|
export { TRANSCRIPT_TEXT };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ChatAuthor, SessionMessage } from "../types/message.js";
|
|
2
2
|
import { SessionPart } from "../types/parts.js";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
|
-
//#region src/chat/user-message.d.ts
|
|
5
4
|
export interface UserMessageProps {
|
|
6
5
|
/** Session-model input: text is derived from these parts. */
|
|
7
6
|
message?: SessionMessage;
|
|
@@ -25,5 +24,4 @@ export interface UserMessageProps {
|
|
|
25
24
|
* User speech retains the inverse-theme bubble and direct-content contract.
|
|
26
25
|
* Application notes interrupt the bubble in source order, outside its attribution.
|
|
27
26
|
*/
|
|
28
|
-
export declare const UserMessage: import("react").MemoExoticComponent<({ message: _message, parts, content, timestamp, actions, author, viewerId }: UserMessageProps) => import("react").JSX.Element | null>;
|
|
29
|
-
//#endregion
|
|
27
|
+
export declare const UserMessage: import("react").MemoExoticComponent<({ message: _message, parts, content, timestamp, actions, author, viewerId }: UserMessageProps) => import("react").JSX.Element | null>;
|
|
@@ -3,7 +3,7 @@ import { TRANSCRIPT_TEXT } from "./transcript-text.js";
|
|
|
3
3
|
import { MessageAuthor, isViewerMessage } from "./message-author.js";
|
|
4
4
|
import { memo } from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
|
|
6
|
+
// src/chat/user-message.tsx
|
|
7
7
|
function formatTime(date) {
|
|
8
8
|
return date.toLocaleTimeString(void 0, {
|
|
9
9
|
hour: "numeric",
|
|
@@ -96,5 +96,4 @@ const UserMessage = memo(({ message: _message, parts, content, timestamp, action
|
|
|
96
96
|
});
|
|
97
97
|
});
|
|
98
98
|
UserMessage.displayName = "UserMessage";
|
|
99
|
-
//#endregion
|
|
100
99
|
export { UserMessage };
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { apiMetadataText, bindCodeTabs, bindCopyButton, codeBlockGrammar, codePreStyle, codePresentation, codeTextStyle, createCopyFeedback, highlightCode, interactionBudgets, schemaRows, writeClipboard };
|
|
1
|
+
export { apiMetadataText, bindCodeTabs, bindCopyButton, codeBlockGrammar, codePreStyle, codePresentation, codeTextStyle, createCopyFeedback, highlightCode, interactionBudgets, schemaRows, writeClipboard } from "./lib/code-presentation.js";
|
|
@@ -2,7 +2,6 @@ import { EditorProviderProps } from "./editor-provider.js";
|
|
|
2
2
|
import { ArtifactPaneProps } from "../primitives/artifact-pane.js";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
import { UrlTransform } from "react-markdown";
|
|
5
|
-
//#region src/editor/document-editor-pane.d.ts
|
|
6
5
|
export type DocumentEditorMode = "preview" | "edit";
|
|
7
6
|
export type DocumentEditorBackend = "local" | "collaborative";
|
|
8
7
|
export interface DocumentEditorPaneCollaborationConfig extends Omit<EditorProviderProps, "children"> {}
|
|
@@ -39,5 +38,4 @@ export interface DocumentEditorPaneProps extends Omit<ArtifactPaneProps, "childr
|
|
|
39
38
|
* DocumentEditorPane — reusable markdown document surface with preview/edit
|
|
40
39
|
* modes and optional collaborative editing backed by Yjs/Hocuspocus.
|
|
41
40
|
*/
|
|
42
|
-
export declare function DocumentEditorPane({ eyebrow, title, subtitle, meta, headerActions, footer, className, contentClassName, headerClassName, hideTitleBlock, tabs, toolbar, markdown, savedMarkdown, dirty, urlTransform, mode, defaultMode, onModeChange, backend, placeholder, autoFocus, readOnly, onChange, onSave, saving, saveLabel, previewClassName, editorClassName, collaboration }: DocumentEditorPaneProps): import("react").JSX.Element;
|
|
43
|
-
//#endregion
|
|
41
|
+
export declare function DocumentEditorPane({ eyebrow, title, subtitle, meta, headerActions, footer, className, contentClassName, headerClassName, hideTitleBlock, tabs, toolbar, markdown, savedMarkdown, dirty, urlTransform, mode, defaultMode, onModeChange, backend, placeholder, autoFocus, readOnly, onChange, onSave, saving, saveLabel, previewClassName, editorClassName, collaboration }: DocumentEditorPaneProps): import("react").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import "../lib/focus.js";
|
|
3
3
|
import { cn } from "../lib/utils.js";
|
|
4
4
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "../primitives/tabs.js";
|
|
5
5
|
import { ArtifactPane } from "../primitives/artifact-pane.js";
|
|
@@ -12,7 +12,7 @@ import { useCollaborators, useEditorConnection } from "./use-editor.js";
|
|
|
12
12
|
import { useEffect, useMemo, useState } from "react";
|
|
13
13
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
14
|
import { PencilLine, Save, Users, Wifi, WifiOff } from "lucide-react";
|
|
15
|
-
|
|
15
|
+
// src/editor/document-editor-pane.tsx
|
|
16
16
|
function connectionTone(state) {
|
|
17
17
|
switch (state) {
|
|
18
18
|
case "synced": return "text-[var(--surface-success-text)] border-[var(--surface-success-border)] bg-[var(--surface-success-bg)]";
|
|
@@ -146,7 +146,7 @@ function DocumentEditorPane({ eyebrow, title, subtitle, meta, headerActions, foo
|
|
|
146
146
|
onClick: save,
|
|
147
147
|
disabled: !canSave,
|
|
148
148
|
title: "Save changes (Ctrl+S)",
|
|
149
|
-
className: cn("inline-flex items-center gap-2 rounded-[var(--radius-full)] border border-primary bg-primary px-3 py-1.5 text-sm font-semibold text-primary-foreground transition-colors hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-50",
|
|
149
|
+
className: cn("inline-flex items-center gap-2 rounded-[var(--radius-full)] border border-primary bg-primary px-3 py-1.5 text-sm font-semibold text-primary-foreground transition-colors hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-50", "focus-visible:outline-1 focus-visible:outline-[var(--focus-border)] focus-visible:ring-4 focus-visible:ring-[var(--focus-halo)] focus-visible:outline-offset-0"),
|
|
150
150
|
children: [/* @__PURE__ */ jsx(Save, { className: "h-4 w-4" }), saveLabel]
|
|
151
151
|
})
|
|
152
152
|
]
|
|
@@ -210,5 +210,4 @@ function DocumentEditorPane({ eyebrow, title, subtitle, meta, headerActions, foo
|
|
|
210
210
|
})
|
|
211
211
|
});
|
|
212
212
|
}
|
|
213
|
-
//#endregion
|
|
214
213
|
export { DocumentEditorPane };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isMissingEditorPeersError } from "./editor-peers.js";
|
|
2
2
|
import { lazy } from "react";
|
|
3
|
-
|
|
3
|
+
// src/editor/editor-lazy.ts
|
|
4
4
|
/**
|
|
5
5
|
* Builds a `lazy` editor component that a remount can re-attempt.
|
|
6
6
|
*
|
|
@@ -33,5 +33,4 @@ function retryableLazyEditor(loadComponent) {
|
|
|
33
33
|
let current = build();
|
|
34
34
|
return () => current;
|
|
35
35
|
}
|
|
36
|
-
//#endregion
|
|
37
36
|
export { retryableLazyEditor };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/utils.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
|
|
4
|
+
// src/editor/editor-loading.tsx
|
|
5
5
|
/**
|
|
6
6
|
* Stands in for an editor while its optional peers load. The editors reach
|
|
7
7
|
* tiptap through a dynamic import, so an editor's first frame waits for that
|
|
@@ -17,5 +17,4 @@ function EditorLoadingPlaceholder({ className }) {
|
|
|
17
17
|
children: "Loading editor…"
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
-
//#endregion
|
|
21
20
|
export { EditorLoadingPlaceholder };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isMissingPeerError, rethrow } from "../lib/optional-peer.js";
|
|
2
|
-
|
|
2
|
+
// src/editor/editor-peers.ts
|
|
3
3
|
const DOCUMENT_PEERS_MISSING = "@tangle-network/ui/editor needs its optional editor peers. Install @tiptap/react and @tiptap/starter-kit.";
|
|
4
4
|
const PROVIDER_PEERS_MISSING = "@tangle-network/ui/editor needs its optional collaboration transport peers. Install @hocuspocus/provider and yjs.";
|
|
5
5
|
const COLLABORATION_PEERS_MISSING = "@tangle-network/ui/editor needs its optional collaboration peers. Install @tiptap/react, @tiptap/starter-kit, @tiptap/extension-collaboration, @tiptap/extension-collaboration-caret, @hocuspocus/provider and yjs.";
|
|
@@ -131,5 +131,4 @@ async function loadCollaborationPeers() {
|
|
|
131
131
|
assertCollaborationPeers(peers);
|
|
132
132
|
return peers;
|
|
133
133
|
}
|
|
134
|
-
//#endregion
|
|
135
134
|
export { MissingEditorPeersError, asMissingEditorPeersError, isMissingEditorPeersError, isMissingPeerError, loadCollaborationPeers, loadDocumentEditorPeers, loadEditorProviderPeers };
|
|
@@ -2,7 +2,6 @@ import "./editor-peers.js";
|
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
import { HocuspocusProvider } from "@hocuspocus/provider";
|
|
4
4
|
import * as Y from "yjs";
|
|
5
|
-
//#region src/editor/editor-provider.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* Connection state for the Hocuspocus provider.
|
|
8
7
|
*/
|
|
@@ -93,5 +92,4 @@ export declare function EditorProvider(props: EditorProviderProps): import("reac
|
|
|
93
92
|
* Hook to access the editor context.
|
|
94
93
|
* Must be used within an EditorProvider.
|
|
95
94
|
*/
|
|
96
|
-
export declare function useEditorContext(): EditorContextValue;
|
|
97
|
-
//#endregion
|
|
95
|
+
export declare function useEditorContext(): EditorContextValue;
|
|
@@ -3,7 +3,7 @@ import { loadEditorProviderPeers } from "./editor-peers.js";
|
|
|
3
3
|
import { retryableLazyEditor } from "./editor-lazy.js";
|
|
4
4
|
import { Suspense, createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
|
|
6
|
+
// src/editor/editor-provider.tsx
|
|
7
7
|
const EditorContext = createContext(null);
|
|
8
8
|
/**
|
|
9
9
|
* Generate a random color for user presence.
|
|
@@ -249,5 +249,4 @@ function useEditorContext() {
|
|
|
249
249
|
if (!context) throw new Error("useEditorContext must be used within an EditorProvider");
|
|
250
250
|
return context;
|
|
251
251
|
}
|
|
252
|
-
//#endregion
|
|
253
252
|
export { EditorProvider, createEditorProvider, useEditorContext };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Editor } from "@tiptap/react";
|
|
2
|
-
//#region src/editor/editor-toolbar.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Editor toolbar component.
|
|
5
4
|
* Provides basic formatting controls.
|
|
@@ -7,5 +6,4 @@ import { Editor } from "@tiptap/react";
|
|
|
7
6
|
export declare function EditorToolbar({ editor, className }: {
|
|
8
7
|
editor: Editor | null;
|
|
9
8
|
className?: string;
|
|
10
|
-
}): import("react").JSX.Element | null;
|
|
11
|
-
//#endregion
|
|
9
|
+
}): import("react").JSX.Element | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/utils.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
|
|
4
|
+
// src/editor/editor-toolbar.tsx
|
|
5
5
|
/**
|
|
6
6
|
* Editor toolbar component.
|
|
7
7
|
* Provides basic formatting controls.
|
|
@@ -102,5 +102,4 @@ function EditorToolbar({ editor, className }) {
|
|
|
102
102
|
})
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
|
-
//#endregion
|
|
106
105
|
export { EditorToolbar };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { marked } from "marked";
|
|
2
2
|
import TurndownService from "turndown";
|
|
3
|
-
|
|
3
|
+
// src/editor/markdown-conversion.ts
|
|
4
4
|
const turndown = new TurndownService({
|
|
5
5
|
bulletListMarker: "-",
|
|
6
6
|
codeBlockStyle: "fenced",
|
|
@@ -19,5 +19,4 @@ function htmlToMarkdown(html) {
|
|
|
19
19
|
function normalizeMarkdown(markdown) {
|
|
20
20
|
return markdown.replace(/\r\n/g, "\n").trimEnd();
|
|
21
21
|
}
|
|
22
|
-
//#endregion
|
|
23
22
|
export { htmlToMarkdown, markdownToHtml, normalizeMarkdown };
|
|
@@ -8,7 +8,7 @@ import { normalizeMarkdown } from "./markdown-conversion.js";
|
|
|
8
8
|
import { SourceMarkdownSession, createSourceMarkdownExtensions } from "./source-markdown-editor.js";
|
|
9
9
|
import { Suspense, useEffect, useMemo, useRef } from "react";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
-
|
|
11
|
+
// src/editor/markdown-document-editor.tsx
|
|
12
12
|
/**
|
|
13
13
|
* Builds the local markdown editor against loaded tiptap namespaces. The
|
|
14
14
|
* peers arrive as an argument so that this module reaches them through
|
|
@@ -117,5 +117,4 @@ function MarkdownDocumentEditor(props) {
|
|
|
117
117
|
children: /* @__PURE__ */ jsx(LazyMarkdownDocumentEditor, { ...props })
|
|
118
118
|
});
|
|
119
119
|
}
|
|
120
|
-
//#endregion
|
|
121
120
|
export { MarkdownDocumentEditor, createMarkdownDocumentEditor };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BLOCK_ID_ATTRIBUTE, SOURCE_KIND_ATTRIBUTE, SOURCE_RAW_ATTRIBUTE, asReadOnlyDocument, blockHtml, blockMarkdown, createBlockMerger, parseSourceMarkdown, serializeSourceMarkdown, withReadOnlyBlocks } from "./source-markdown.js";
|
|
2
2
|
import { marked } from "marked";
|
|
3
|
-
|
|
3
|
+
// src/editor/source-markdown-editor.ts
|
|
4
4
|
/** Name of the read-only node that holds a block's raw Markdown. */
|
|
5
5
|
const SOURCE_NODE = "markdownSource";
|
|
6
6
|
/** Top-level node types that can carry a block id. */
|
|
@@ -252,5 +252,4 @@ var SourceMarkdownSession = class {
|
|
|
252
252
|
return serializeSourceMarkdown(this.source, nodes);
|
|
253
253
|
}
|
|
254
254
|
};
|
|
255
|
-
//#endregion
|
|
256
255
|
export { SOURCE_NODE, SourceMarkdownSession, createSourceMarkdownExtensions };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { marked } from "marked";
|
|
2
2
|
import TurndownService from "turndown";
|
|
3
|
-
|
|
3
|
+
// src/editor/source-markdown.ts
|
|
4
4
|
/**
|
|
5
5
|
* Source-preserving Markdown for the rich editor.
|
|
6
6
|
*
|
|
@@ -491,5 +491,4 @@ function serializeSourceMarkdown(source, nodes) {
|
|
|
491
491
|
});
|
|
492
492
|
return out;
|
|
493
493
|
}
|
|
494
|
-
//#endregion
|
|
495
494
|
export { BLOCK_ID_ATTRIBUTE, SOURCE_KIND_ATTRIBUTE, SOURCE_RAW_ATTRIBUTE, asReadOnlyDocument, blockHtml, blockMarkdown, createBlockMerger, diffText, parseSourceMarkdown, serializeSourceMarkdown, withReadOnlyBlocks };
|
|
@@ -3,7 +3,6 @@ import { Collaborator } from "./editor-provider.js";
|
|
|
3
3
|
import { EditorToolbar } from "./editor-toolbar.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { Editor } from "@tiptap/react";
|
|
6
|
-
//#region src/editor/tiptap-editor.d.ts
|
|
7
6
|
/**
|
|
8
7
|
* Props for TiptapEditor component.
|
|
9
8
|
*/
|
|
@@ -41,5 +40,4 @@ export declare function CollaboratorsList({ collaborators, className }: {
|
|
|
41
40
|
collaborators: Collaborator[];
|
|
42
41
|
className?: string;
|
|
43
42
|
}): import("react").JSX.Element | null;
|
|
44
|
-
//#endregion
|
|
45
43
|
export { EditorToolbar };
|
|
@@ -7,7 +7,7 @@ import { EditorLoadingPlaceholder } from "./editor-loading.js";
|
|
|
7
7
|
import { EditorToolbar } from "./editor-toolbar.js";
|
|
8
8
|
import { Suspense, useEffect, useMemo } from "react";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
-
|
|
10
|
+
// src/editor/tiptap-editor.tsx
|
|
11
11
|
/**
|
|
12
12
|
* Cursor colors with contrasting text.
|
|
13
13
|
*/
|
|
@@ -267,5 +267,4 @@ function CollaboratorsList({ collaborators, className }) {
|
|
|
267
267
|
})]
|
|
268
268
|
});
|
|
269
269
|
}
|
|
270
|
-
//#endregion
|
|
271
270
|
export { CollaboratorsList, EditorToolbar, TiptapEditor, createTiptapEditor };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Collaborator, ConnectionState } from "./editor-provider.js";
|
|
2
2
|
import { HocuspocusProvider } from "@hocuspocus/provider";
|
|
3
|
-
//#region src/editor/use-editor.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Hook to get the current connection state and helpers.
|
|
6
5
|
*/
|
|
@@ -63,5 +62,4 @@ export declare function useAwareness(): {
|
|
|
63
62
|
setLocalState: (state: Record<string, unknown>) => void;
|
|
64
63
|
setLocalStateField: (field: string, value: unknown) => void;
|
|
65
64
|
awareness: HocuspocusProvider["awareness"] | undefined;
|
|
66
|
-
};
|
|
67
|
-
//#endregion
|
|
65
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useEditorContext } from "./editor-provider.js";
|
|
3
3
|
import { useCallback, useEffect, useState } from "react";
|
|
4
|
-
|
|
4
|
+
// src/editor/use-editor.ts
|
|
5
5
|
/**
|
|
6
6
|
* Hook to get the current connection state and helpers.
|
|
7
7
|
*/
|
|
@@ -154,5 +154,4 @@ function useAwareness() {
|
|
|
154
154
|
awareness
|
|
155
155
|
};
|
|
156
156
|
}
|
|
157
|
-
//#endregion
|
|
158
157
|
export { useAwareness, useCollaboratorPresence, useCollaborators, useDocumentChanges, useEditorConnection, useYjsState };
|