@deepagents/react-input 7.0.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/COMPOSER_FEATURE_MATRIX.md +71 -0
- package/dist/browser.d.ts +15 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +3406 -0
- package/dist/browser.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +166 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/Composer.d.ts +90 -0
- package/dist/lib/Composer.d.ts.map +1 -0
- package/dist/lib/ComposerAttachments.d.ts +4 -0
- package/dist/lib/ComposerAttachments.d.ts.map +1 -0
- package/dist/lib/ComposerContext.d.ts +49 -0
- package/dist/lib/ComposerContext.d.ts.map +1 -0
- package/dist/lib/ComposerCore.d.ts +57 -0
- package/dist/lib/ComposerCore.d.ts.map +1 -0
- package/dist/lib/ComposerDraft.d.ts +4 -0
- package/dist/lib/ComposerDraft.d.ts.map +1 -0
- package/dist/lib/ComposerRegistry.d.ts +43 -0
- package/dist/lib/ComposerRegistry.d.ts.map +1 -0
- package/dist/lib/ComposerSlashCommands.d.ts +4 -0
- package/dist/lib/ComposerSlashCommands.d.ts.map +1 -0
- package/dist/lib/ComposerSuggestions.d.ts +3 -0
- package/dist/lib/ComposerSuggestions.d.ts.map +1 -0
- package/dist/lib/ComposerTokenText.d.ts +6 -0
- package/dist/lib/ComposerTokenText.d.ts.map +1 -0
- package/dist/lib/ComposerTriggers.d.ts +11 -0
- package/dist/lib/ComposerTriggers.d.ts.map +1 -0
- package/dist/lib/ComposerTypes.d.ts +163 -0
- package/dist/lib/ComposerTypes.d.ts.map +1 -0
- package/dist/lib/ComposerVisibility.d.ts +3 -0
- package/dist/lib/ComposerVisibility.d.ts.map +1 -0
- package/dist/lib/PersistedPromptText.d.ts +4 -0
- package/dist/lib/PersistedPromptText.d.ts.map +1 -0
- package/dist/lib/persisted-prompt-selection.d.ts +2 -0
- package/dist/lib/persisted-prompt-selection.d.ts.map +1 -0
- package/dist/lib/tiptap/ComposerTiptapDomain.d.ts +68 -0
- package/dist/lib/tiptap/ComposerTiptapDomain.d.ts.map +1 -0
- package/dist/persisted-prompt.d.ts +47 -0
- package/dist/persisted-prompt.d.ts.map +1 -0
- package/package.json +76 -0
- package/src/styles.css +115 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type TokenKind = 'slash-command' | 'mention' | 'image' | 'paste' | 'link' | 'rich-link';
|
|
3
|
+
export type ComposerPopupTrigger = string;
|
|
4
|
+
export type ActivePopup = {
|
|
5
|
+
trigger: ComposerPopupTrigger;
|
|
6
|
+
query: string;
|
|
7
|
+
selectedIndex: number;
|
|
8
|
+
};
|
|
9
|
+
export type ComposerDropTransfer = Pick<DataTransfer, 'files' | 'getData'>;
|
|
10
|
+
export type ComposerTextElement = {
|
|
11
|
+
id: string;
|
|
12
|
+
kind: TokenKind;
|
|
13
|
+
label: string;
|
|
14
|
+
range: {
|
|
15
|
+
start: number;
|
|
16
|
+
end: number;
|
|
17
|
+
};
|
|
18
|
+
detail?: string;
|
|
19
|
+
metadata?: ComposerRichLinkMetadata;
|
|
20
|
+
};
|
|
21
|
+
export type ComposerRichLinkMetadata = {
|
|
22
|
+
title?: string;
|
|
23
|
+
description?: string;
|
|
24
|
+
siteName?: string;
|
|
25
|
+
domain?: string;
|
|
26
|
+
imageUrl?: string;
|
|
27
|
+
faviconUrl?: string;
|
|
28
|
+
};
|
|
29
|
+
export type ComposerItemBinding = {
|
|
30
|
+
id: string;
|
|
31
|
+
trigger: string;
|
|
32
|
+
value: string;
|
|
33
|
+
payload?: unknown;
|
|
34
|
+
persistsAs?: string;
|
|
35
|
+
};
|
|
36
|
+
export type ComposerPendingPaste = {
|
|
37
|
+
id: string;
|
|
38
|
+
placeholder: string;
|
|
39
|
+
content: string;
|
|
40
|
+
};
|
|
41
|
+
export type ComposerRemoteImage = {
|
|
42
|
+
id: string;
|
|
43
|
+
url: string;
|
|
44
|
+
};
|
|
45
|
+
export type ComposerInitialDraft = {
|
|
46
|
+
text?: string;
|
|
47
|
+
elements?: ComposerTextElement[];
|
|
48
|
+
mentionBindings?: ComposerItemBinding[];
|
|
49
|
+
remoteImages?: ComposerRemoteImage[];
|
|
50
|
+
remoteImageUrls?: string[];
|
|
51
|
+
pendingPastes?: ComposerPendingPaste[];
|
|
52
|
+
};
|
|
53
|
+
export type ComposerDraftSource = {
|
|
54
|
+
persistedPrompt: string;
|
|
55
|
+
remoteImages: ComposerRemoteImage[];
|
|
56
|
+
pendingPastes: ComposerPendingPaste[];
|
|
57
|
+
};
|
|
58
|
+
export type ComposerState = {
|
|
59
|
+
text: string;
|
|
60
|
+
cursor: number;
|
|
61
|
+
elements: ComposerTextElement[];
|
|
62
|
+
mentionBindings: ComposerItemBinding[];
|
|
63
|
+
imageAttachments: Array<{
|
|
64
|
+
id: string;
|
|
65
|
+
placeholder: string;
|
|
66
|
+
media: ComposerAttachmentMedia;
|
|
67
|
+
}>;
|
|
68
|
+
remoteImages: ComposerRemoteImage[];
|
|
69
|
+
pendingPastes: ComposerPendingPaste[];
|
|
70
|
+
selectedRemoteImageId: string | null;
|
|
71
|
+
isTaskRunning: boolean;
|
|
72
|
+
queueSubmissions: boolean;
|
|
73
|
+
error: string | null;
|
|
74
|
+
reverseSearch: string | null;
|
|
75
|
+
shortcutsOpen: boolean;
|
|
76
|
+
history: ComposerDraftSource[];
|
|
77
|
+
historyCursor: number | null;
|
|
78
|
+
killBuffer: string;
|
|
79
|
+
};
|
|
80
|
+
export type ComposerVisibility = 'always' | 'hidden' | 'before-interaction' | 'after-interaction';
|
|
81
|
+
export type ComposerItem = {
|
|
82
|
+
id: string;
|
|
83
|
+
value: string;
|
|
84
|
+
label: string;
|
|
85
|
+
detail: string;
|
|
86
|
+
atomic: boolean;
|
|
87
|
+
icon?: ReactNode;
|
|
88
|
+
payload?: unknown;
|
|
89
|
+
expandsTo?: string;
|
|
90
|
+
persistsAs?: string;
|
|
91
|
+
supportsArgs?: boolean;
|
|
92
|
+
aliases?: string[];
|
|
93
|
+
searchTerms?: string[];
|
|
94
|
+
visibility?: ComposerVisibility;
|
|
95
|
+
availability?: 'enabled' | 'disabled';
|
|
96
|
+
};
|
|
97
|
+
export type ComposerItemEntry = ComposerItem & {
|
|
98
|
+
trigger: string;
|
|
99
|
+
};
|
|
100
|
+
export type ComposerTriggerSets = {
|
|
101
|
+
commandTriggers: string[];
|
|
102
|
+
mentionTriggers: string[];
|
|
103
|
+
};
|
|
104
|
+
export type ComposerSuggestion = ComposerItemEntry;
|
|
105
|
+
/** Top-level media type of an attached file; it names the `[Image #N]`, `[Video #N]`, or `[Audio #N]` placeholder. */
|
|
106
|
+
export type ComposerAttachmentMedia = 'image' | 'video' | 'audio';
|
|
107
|
+
export type ComposerSubmissionItem = {
|
|
108
|
+
type: 'text';
|
|
109
|
+
text: string;
|
|
110
|
+
textElements: ComposerTextElement[];
|
|
111
|
+
} | {
|
|
112
|
+
type: 'image';
|
|
113
|
+
placeholder: string;
|
|
114
|
+
file: File;
|
|
115
|
+
} | {
|
|
116
|
+
type: 'video';
|
|
117
|
+
placeholder: string;
|
|
118
|
+
file: File;
|
|
119
|
+
} | {
|
|
120
|
+
type: 'audio';
|
|
121
|
+
placeholder: string;
|
|
122
|
+
file: File;
|
|
123
|
+
} | {
|
|
124
|
+
type: 'remote_image';
|
|
125
|
+
url: string;
|
|
126
|
+
} | {
|
|
127
|
+
type: 'link';
|
|
128
|
+
text: string;
|
|
129
|
+
href: string;
|
|
130
|
+
} | {
|
|
131
|
+
type: 'rich_link';
|
|
132
|
+
text: string;
|
|
133
|
+
href: string;
|
|
134
|
+
metadata?: ComposerRichLinkMetadata;
|
|
135
|
+
} | {
|
|
136
|
+
type: 'item';
|
|
137
|
+
id: string;
|
|
138
|
+
trigger: string;
|
|
139
|
+
value: string;
|
|
140
|
+
payload?: unknown;
|
|
141
|
+
};
|
|
142
|
+
export type ComposerSubmission = {
|
|
143
|
+
id: string;
|
|
144
|
+
at: string;
|
|
145
|
+
mode: 'submitted' | 'queued' | 'command' | 'command-with-args';
|
|
146
|
+
prompt: string;
|
|
147
|
+
persistedPrompt: string;
|
|
148
|
+
action?: string;
|
|
149
|
+
command?: string;
|
|
150
|
+
args?: string;
|
|
151
|
+
items: ComposerSubmissionItem[];
|
|
152
|
+
};
|
|
153
|
+
export type CreateComposerStateOptions = {
|
|
154
|
+
initialDraft?: ComposerInitialDraft;
|
|
155
|
+
text?: string;
|
|
156
|
+
slashCommands?: ComposerItemEntry[];
|
|
157
|
+
mentionCandidates?: ComposerItemEntry[];
|
|
158
|
+
commandTriggers?: string[];
|
|
159
|
+
remoteImageUrls?: string[];
|
|
160
|
+
isTaskRunning?: boolean;
|
|
161
|
+
queueSubmissions?: boolean;
|
|
162
|
+
};
|
|
163
|
+
//# sourceMappingURL=ComposerTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComposerTypes.d.ts","sourceRoot":"","sources":["../../src/lib/ComposerTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,SAAS,GACnB,eAAe,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,WAAW,CAAC;AAEzE,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAE1C,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,oBAAoB,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,YAAY,EAAE,OAAO,GAAG,SAAS,CAAC,CAAC;AAE3E,MAAM,MAAM,mBAAmB,GAAG;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,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B,UAAU,EAAE,kBAAkB,GAAG,SAAS,EAC1C,aAAa,EAAE,OAAO,WAYvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PersistedPromptText.d.ts","sourceRoot":"","sources":["../../src/lib/PersistedPromptText.tsx"],"names":[],"mappings":"AASA,wBAAgB,mBAAmB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,+BAK7D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persisted-prompt-selection.d.ts","sourceRoot":"","sources":["../../src/lib/persisted-prompt-selection.ts"],"names":[],"mappings":"AAAA,wBAAgB,mCAAmC,CACjD,IAAI,EAAE,WAAW,EACjB,SAAS,EAAE,SAAS,GAAG,IAAI,iBAe5B"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Extension, JSONContent, Mark, Node } from '@tiptap/core';
|
|
2
|
+
import { Slice } from '@tiptap/pm/model';
|
|
3
|
+
import { EditorView } from '@tiptap/pm/view';
|
|
4
|
+
import { Editor } from '@tiptap/react';
|
|
5
|
+
import { ComposerPreparedPayload } from '../ComposerCore.ts';
|
|
6
|
+
import { ComposerAttachmentMedia, ComposerDropTransfer, ComposerInitialDraft, ComposerItemEntry, ComposerRemoteImage, ComposerRichLinkMetadata, ComposerState, ComposerTriggerSets } from '../ComposerTypes.ts';
|
|
7
|
+
export type ComposerTiptapKillBuffer = {
|
|
8
|
+
text: string;
|
|
9
|
+
slice: ReturnType<Slice['toJSON']>;
|
|
10
|
+
};
|
|
11
|
+
type PopupKeyEvent = {
|
|
12
|
+
key: string;
|
|
13
|
+
metaKey: boolean;
|
|
14
|
+
ctrlKey: boolean;
|
|
15
|
+
};
|
|
16
|
+
export type ComposerAttachImageFile = (file: File) => string | null;
|
|
17
|
+
type ComposerClipboardOptions = {
|
|
18
|
+
getRemoteImageCount: () => number;
|
|
19
|
+
getMentionTrigger: () => string;
|
|
20
|
+
attachImageFile: ComposerAttachImageFile;
|
|
21
|
+
};
|
|
22
|
+
export declare function createComposerTiptapExtensions(options: ComposerClipboardOptions): (Extension<import('@tiptap/starter-kit').StarterKitOptions, any> | Mark<import('@tiptap/extension-link').LinkOptions, any> | Mark<any, any> | Node<any, any> | Extension<any, any>)[];
|
|
23
|
+
export declare function handleComposerDropInView(view: EditorView, transfer: ComposerDropTransfer, remoteImageCount: number, mentionTrigger: string, attachImageFile: ComposerAttachImageFile): boolean;
|
|
24
|
+
export declare function contentFromStateOrText({ state, text, slashCommands, mentionCandidates, triggers, }: {
|
|
25
|
+
state?: ComposerInitialDraft;
|
|
26
|
+
text?: string;
|
|
27
|
+
slashCommands: ComposerItemEntry[];
|
|
28
|
+
mentionCandidates: ComposerItemEntry[];
|
|
29
|
+
triggers: ComposerTriggerSets;
|
|
30
|
+
}): JSONContent;
|
|
31
|
+
export declare function serializeTiptapContent(content: JSONContent, remoteImages: ComposerRemoteImage[], slashCommands: ComposerItemEntry[], isTaskRunning: boolean, queueSubmissions: boolean, cursor: number): ComposerState;
|
|
32
|
+
export declare function emptyDoc(): JSONContent;
|
|
33
|
+
export declare function mentionNodeContent(candidate: ComposerItemEntry): JSONContent;
|
|
34
|
+
export declare function atomNodeContent({ kind, label, detail, content, href, metadata, }: {
|
|
35
|
+
kind: 'paste' | 'rich-link';
|
|
36
|
+
label: string;
|
|
37
|
+
detail?: string;
|
|
38
|
+
content?: string;
|
|
39
|
+
href?: string;
|
|
40
|
+
metadata?: ComposerRichLinkMetadata;
|
|
41
|
+
}): JSONContent;
|
|
42
|
+
export declare function imageAttachmentNodeContent(id: string, label: string, media?: ComposerAttachmentMedia): JSONContent;
|
|
43
|
+
export declare function activeEditorToken(editor: Editor, triggers: ComposerTriggerSets): {
|
|
44
|
+
trigger: string;
|
|
45
|
+
query: string;
|
|
46
|
+
from: number;
|
|
47
|
+
to: number;
|
|
48
|
+
} | null;
|
|
49
|
+
export declare function renumberImageAttachmentAtoms(content: JSONContent, remoteCount: number): JSONContent;
|
|
50
|
+
export declare function removeImageAttachmentAtom(content: JSONContent, id: string): JSONContent;
|
|
51
|
+
export declare function nextPastePlaceholderFromContent(content: JSONContent, charCount: number): string;
|
|
52
|
+
export declare function killToLineEnd(editor: Editor): ComposerTiptapKillBuffer | null;
|
|
53
|
+
export declare function killToLineStart(editor: Editor): ComposerTiptapKillBuffer | null;
|
|
54
|
+
export declare function deleteBackwardWord(editor: Editor): ComposerTiptapKillBuffer | null;
|
|
55
|
+
export declare function moveCursorToLineEnd(editor: Editor): void;
|
|
56
|
+
export declare function moveCursorByWord(editor: Editor, direction: -1 | 1): void;
|
|
57
|
+
export declare function insertKilledContent(editor: Editor, killBuffer: ComposerTiptapKillBuffer | string): void;
|
|
58
|
+
export declare function deleteAtomAtSelectionEdge(editor: Editor, key: 'Backspace' | 'Delete'): boolean;
|
|
59
|
+
export declare function editorCursorOffset(editor: Editor): number;
|
|
60
|
+
export declare function isEditorCursorAtStart(editor: Editor): boolean;
|
|
61
|
+
export declare function queuedAction(prepared: NonNullable<ComposerPreparedPayload>, commandTriggers: string[]): string;
|
|
62
|
+
export declare function isPopupUpKey(event: PopupKeyEvent): boolean;
|
|
63
|
+
export declare function isPopupDownKey(event: PopupKeyEvent): boolean;
|
|
64
|
+
export declare function characterCount(text: string): number;
|
|
65
|
+
export declare function wrapIndex(index: number, size: number): number;
|
|
66
|
+
export declare function stableId(kind: string, label: string, start: number): string;
|
|
67
|
+
export {};
|
|
68
|
+
//# sourceMappingURL=ComposerTiptapDomain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComposerTiptapDomain.d.ts","sourceRoot":"","sources":["../../../src/lib/tiptap/ComposerTiptapDomain.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,WAAW,EAChB,IAAI,EACJ,IAAI,EAEL,MAAM,cAAc,CAAC;AAEtB,OAAO,EAGL,KAAK,EACN,MAAM,kBAAkB,CAAC;AAE1B,OAA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
|
6
|
+
export type PersistedPromptTextToken = PersistedPromptTokenBase & {
|
|
7
|
+
kind: 'text';
|
|
8
|
+
value: string;
|
|
9
|
+
};
|
|
10
|
+
export type PersistedPromptInlineCodeToken = PersistedPromptTokenBase & {
|
|
11
|
+
kind: 'inline-code';
|
|
12
|
+
value: string;
|
|
13
|
+
};
|
|
14
|
+
export type PersistedPromptCodeBlockToken = PersistedPromptTokenBase & {
|
|
15
|
+
kind: 'code-block';
|
|
16
|
+
language: string;
|
|
17
|
+
value: string;
|
|
18
|
+
};
|
|
19
|
+
export type PersistedPromptLinkToken = PersistedPromptTokenBase & {
|
|
20
|
+
kind: 'link';
|
|
21
|
+
label: string;
|
|
22
|
+
href: string;
|
|
23
|
+
};
|
|
24
|
+
export type PersistedPromptSkillLinkToken = PersistedPromptTokenBase & {
|
|
25
|
+
kind: 'skill-link';
|
|
26
|
+
label: string;
|
|
27
|
+
href: string;
|
|
28
|
+
name: string;
|
|
29
|
+
skillId: string;
|
|
30
|
+
};
|
|
31
|
+
export type PersistedPromptStandaloneSkillToken = PersistedPromptTokenBase & {
|
|
32
|
+
kind: 'standalone-skill';
|
|
33
|
+
name: string;
|
|
34
|
+
};
|
|
35
|
+
export type PersistedPromptMentionToken = PersistedPromptTokenBase & {
|
|
36
|
+
kind: 'mention';
|
|
37
|
+
label: string;
|
|
38
|
+
href: string;
|
|
39
|
+
name: string;
|
|
40
|
+
};
|
|
41
|
+
export type PersistedPromptToken = PersistedPromptTextToken | PersistedPromptInlineCodeToken | PersistedPromptCodeBlockToken | PersistedPromptLinkToken | PersistedPromptSkillLinkToken | PersistedPromptStandaloneSkillToken | PersistedPromptMentionToken;
|
|
42
|
+
export declare function serializePersistedPromptLink(label: string, href: string): string;
|
|
43
|
+
export declare function serializeSkillPromptLink(name: string, skillId: string): string;
|
|
44
|
+
export declare function serializeMentionPromptLink(name: string): string;
|
|
45
|
+
export declare function tokenizePersistedPrompt(text: string): PersistedPromptToken[];
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=persisted-prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persisted-prompt.d.ts","sourceRoot":"","sources":["../src/persisted-prompt.ts"],"names":[],"mappings":"AAAA,KAAK,wBAAwB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,wBAAwB,GAAG;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,wBAAwB,GAAG;IACtE,IAAI,EAAE,aAAa,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,wBAAwB,GAAG;IACrE,IAAI,EAAE,YAAY,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,wBAAwB,GAAG;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,wBAAwB,GAAG;IACrE,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG,wBAAwB,GAAG;IAC3E,IAAI,EAAE,kBAAkB,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,wBAAwB,GAAG;IACnE,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAC5B,wBAAwB,GACxB,8BAA8B,GAC9B,6BAA6B,GAC7B,wBAAwB,GACxB,6BAA6B,GAC7B,mCAAmC,GACnC,2BAA2B,CAAC;AAchC,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAEvE;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,UAKrE;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,UAKtD;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,EAAE,CAsC5E"}
|
package/package.json
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@deepagents/react-input",
|
|
3
|
+
"version": "7.0.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/JanuaryLabs/deepagents",
|
|
8
|
+
"directory": "packages/react/input"
|
|
9
|
+
},
|
|
10
|
+
"type": "module",
|
|
11
|
+
"main": "./dist/index.js",
|
|
12
|
+
"module": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"src/styles.css",
|
|
17
|
+
"COMPOSER_FEATURE_MATRIX.md",
|
|
18
|
+
"!dist/spec/**",
|
|
19
|
+
"!**/*.tsbuildinfo"
|
|
20
|
+
],
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
24
|
+
"exports": {
|
|
25
|
+
"./package.json": "./package.json",
|
|
26
|
+
".": {
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"import": "./dist/index.js",
|
|
29
|
+
"default": "./dist/index.js"
|
|
30
|
+
},
|
|
31
|
+
"./browser": {
|
|
32
|
+
"types": "./dist/browser.d.ts",
|
|
33
|
+
"import": "./dist/browser.js",
|
|
34
|
+
"default": "./dist/browser.js"
|
|
35
|
+
},
|
|
36
|
+
"./styles.css": {
|
|
37
|
+
"import": "./src/styles.css",
|
|
38
|
+
"default": "./src/styles.css"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@base-ui/react": "^1.7.0",
|
|
43
|
+
"@deepagents/react-shadcn": "7.0.0",
|
|
44
|
+
"@tiptap/core": "^3.27.1",
|
|
45
|
+
"@tiptap/extension-link": "^3.27.1",
|
|
46
|
+
"@tiptap/pm": "^3.27.1",
|
|
47
|
+
"@tiptap/react": "^3.27.1",
|
|
48
|
+
"@tiptap/starter-kit": "^3.27.1",
|
|
49
|
+
"lodash-es": "^4.17.21",
|
|
50
|
+
"lucide-react": "^1.33.0"
|
|
51
|
+
},
|
|
52
|
+
"peerDependencies": {
|
|
53
|
+
"react": "19.2.8"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@rolldown/plugin-babel": "^0.2.3",
|
|
57
|
+
"@testing-library/dom": "^10.4.1",
|
|
58
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
59
|
+
"@testing-library/react": "^16.3.2",
|
|
60
|
+
"@testing-library/user-event": "^14.6.1",
|
|
61
|
+
"@types/react": "19.2.18",
|
|
62
|
+
"@types/react-dom": "19.2.5",
|
|
63
|
+
"@vitejs/plugin-react": "^6.0.3",
|
|
64
|
+
"babel-plugin-react-compiler": "^1.0.0",
|
|
65
|
+
"happy-dom": "20.11.2",
|
|
66
|
+
"react": "19.2.8",
|
|
67
|
+
"react-dom": "19.2.8",
|
|
68
|
+
"typescript": "6.0.3",
|
|
69
|
+
"vite": "8.1.5",
|
|
70
|
+
"vite-plugin-dts": "~4.5.0",
|
|
71
|
+
"vitest": "4.1.10"
|
|
72
|
+
},
|
|
73
|
+
"engines": {
|
|
74
|
+
"node": ">=20"
|
|
75
|
+
}
|
|
76
|
+
}
|
package/src/styles.css
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
[data-slot="composer"] {
|
|
2
|
+
--composer-line-height: 1.55rem;
|
|
3
|
+
--composer-font-size: 0.875rem;
|
|
4
|
+
--composer-min-height: 8.5rem;
|
|
5
|
+
--composer-max-height: none;
|
|
6
|
+
--composer-padding: 0.875rem;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
[data-slot="composer"] [data-slot="composer-frame"] {
|
|
10
|
+
position: relative;
|
|
11
|
+
min-height: var(--composer-min-height);
|
|
12
|
+
max-height: var(--composer-max-height);
|
|
13
|
+
overflow-y: auto;
|
|
14
|
+
border: 1px solid var(--color-border);
|
|
15
|
+
border-radius: var(--radius-md);
|
|
16
|
+
background: var(--color-background);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
[data-slot="composer"] [data-slot="composer-placeholder"] {
|
|
20
|
+
box-sizing: border-box;
|
|
21
|
+
min-height: var(--composer-min-height);
|
|
22
|
+
width: 100%;
|
|
23
|
+
padding: var(--composer-padding);
|
|
24
|
+
font-size: var(--composer-font-size);
|
|
25
|
+
line-height: var(--composer-line-height);
|
|
26
|
+
white-space: pre-wrap;
|
|
27
|
+
word-break: break-word;
|
|
28
|
+
pointer-events: none;
|
|
29
|
+
user-select: none;
|
|
30
|
+
position: absolute;
|
|
31
|
+
inset: 0;
|
|
32
|
+
color: var(--color-muted-foreground);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
[data-slot="composer"] [data-slot="composer-frame"]:focus-within {
|
|
36
|
+
border-color: color-mix(in srgb, var(--color-primary) 80%, transparent);
|
|
37
|
+
box-shadow: 0 0 0 3px
|
|
38
|
+
color-mix(in srgb, var(--color-primary) 14%, transparent);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
[data-slot="composer"] [data-token] {
|
|
42
|
+
border-radius: calc(var(--radius-sm) - 1px);
|
|
43
|
+
box-decoration-break: clone;
|
|
44
|
+
-webkit-box-decoration-break: clone;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
[data-slot="composer"] [data-token="slash-command"] {
|
|
48
|
+
color: var(--color-primary);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
[data-slot="composer"] [data-token="mention"] {
|
|
52
|
+
background: color-mix(in srgb, var(--color-info) 12%, transparent);
|
|
53
|
+
color: var(--color-info);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
[data-slot="composer"] [data-token="image"] {
|
|
57
|
+
background: color-mix(in srgb, var(--color-success) 12%, transparent);
|
|
58
|
+
color: var(--color-success);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
[data-slot="composer"] [data-token="paste"] {
|
|
62
|
+
background: color-mix(in srgb, var(--color-warning) 14%, transparent);
|
|
63
|
+
color: var(--color-warning);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
[data-slot="composer"] [data-token="link"] {
|
|
67
|
+
color: var(--color-info);
|
|
68
|
+
text-decoration: underline;
|
|
69
|
+
text-decoration-thickness: 1px;
|
|
70
|
+
text-underline-offset: 0.16em;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
[data-slot="composer"] [data-token="rich-link"] {
|
|
74
|
+
background: color-mix(in srgb, var(--color-success) 12%, transparent);
|
|
75
|
+
color: var(--color-success);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
[data-slot="composer"] [data-slot="composer-editor"] {
|
|
79
|
+
min-height: var(--composer-min-height);
|
|
80
|
+
padding: var(--composer-padding);
|
|
81
|
+
font-size: var(--composer-font-size);
|
|
82
|
+
line-height: var(--composer-line-height);
|
|
83
|
+
outline: none;
|
|
84
|
+
white-space: pre-wrap;
|
|
85
|
+
word-break: break-word;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
[data-slot="composer"] [data-slot="composer-editor"] p {
|
|
89
|
+
margin: 0;
|
|
90
|
+
unicode-bidi: plaintext;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
[data-slot="composer"] [data-slot="composer-editor"] p + p {
|
|
94
|
+
margin-top: var(--composer-line-height);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
[data-slot="composer"] [data-slot="composer-editor"] .is-empty::before {
|
|
98
|
+
content: attr(data-placeholder);
|
|
99
|
+
float: left;
|
|
100
|
+
height: 0;
|
|
101
|
+
pointer-events: none;
|
|
102
|
+
color: var(--color-muted-foreground);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
[data-slot="composer"] [data-slot="composer-editor"] [data-composer-atom],
|
|
106
|
+
[data-slot="composer"] [data-slot="composer-editor"] [data-composer-mention] {
|
|
107
|
+
user-select: all;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
[data-slot="composer"] [data-slot="composer-editor"] a {
|
|
111
|
+
color: var(--color-info);
|
|
112
|
+
text-decoration: underline;
|
|
113
|
+
text-decoration-thickness: 1px;
|
|
114
|
+
text-underline-offset: 0.16em;
|
|
115
|
+
}
|