@runtypelabs/persona 4.7.0 → 4.9.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/README.md +1 -0
- package/dist/animations/glyph-cycle.cjs +2 -2
- package/dist/animations/glyph-cycle.d.cts +1 -1
- package/dist/animations/glyph-cycle.d.ts +1 -1
- package/dist/animations/glyph-cycle.js +2 -2
- package/dist/animations/{types-CSmiKRVa.d.cts → types-4ROVJ1gA.d.cts} +85 -3
- package/dist/animations/{types-CSmiKRVa.d.ts → types-4ROVJ1gA.d.ts} +85 -3
- package/dist/animations/wipe.cjs +2 -2
- package/dist/animations/wipe.d.cts +1 -1
- package/dist/animations/wipe.d.ts +1 -1
- package/dist/chunk-5EIIHQLQ.js +1 -0
- package/dist/chunk-IO5VVUKP.js +3 -0
- package/dist/chunk-IPVK3KOM.js +1 -0
- package/dist/chunk-UPO4GUFC.js +1 -0
- package/dist/codegen.cjs +13 -13
- package/dist/codegen.js +14 -14
- package/dist/context-mentions-7S5KVUTG.js +169 -0
- package/dist/context-mentions-inline-TTCN7ZM2.js +4 -0
- package/dist/context-mentions-inline.cjs +4 -0
- package/dist/context-mentions-inline.d.cts +203 -0
- package/dist/context-mentions-inline.d.ts +203 -0
- package/dist/context-mentions-inline.js +4 -0
- package/dist/context-mentions.cjs +295 -0
- package/dist/context-mentions.d.cts +7025 -0
- package/dist/context-mentions.d.ts +7025 -0
- package/dist/context-mentions.js +295 -0
- package/dist/index.cjs +99 -68
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1507 -182
- package/dist/index.d.ts +1507 -182
- package/dist/index.global.js +88 -56
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +99 -68
- package/dist/index.js.map +1 -1
- package/dist/install.global.js +1 -1
- package/dist/install.global.js.map +1 -1
- package/dist/launcher.global.js +3 -2
- package/dist/launcher.global.js.map +1 -1
- package/dist/markdown-parsers.js +24 -24
- package/dist/plugin-kit.cjs +1 -1
- package/dist/plugin-kit.d.cts +17 -0
- package/dist/plugin-kit.d.ts +17 -0
- package/dist/plugin-kit.js +1 -1
- package/dist/runtype-tts-entry-UJAEF7NZ.js +1 -0
- package/dist/runtype-tts.js +1 -1
- package/dist/session-reconnect-JKIJBHS5.js +1 -0
- package/dist/smart-dom-reader.cjs +18 -17
- package/dist/smart-dom-reader.d.cts +1260 -16
- package/dist/smart-dom-reader.d.ts +1260 -16
- package/dist/smart-dom-reader.js +18 -17
- package/dist/testing.cjs +3 -3
- package/dist/testing.js +3 -3
- package/dist/theme-editor-preview.cjs +260 -58
- package/dist/theme-editor-preview.d.cts +1234 -15
- package/dist/theme-editor-preview.d.ts +1234 -15
- package/dist/theme-editor-preview.js +87 -58
- package/dist/theme-editor.cjs +10 -10
- package/dist/theme-editor.d.cts +1226 -15
- package/dist/theme-editor.d.ts +1226 -15
- package/dist/theme-editor.js +10 -10
- package/dist/theme-reference.cjs +1 -1
- package/dist/theme-reference.d.cts +76 -0
- package/dist/theme-reference.d.ts +76 -0
- package/dist/theme-reference.js +1 -1
- package/dist/voice-worklet-player.cjs +2 -2
- package/dist/voice-worklet-player.js +2 -2
- package/dist/webmcp-polyfill.js +2 -2
- package/dist/widget.css +1 -1
- package/package.json +16 -5
- package/src/artifacts-session.test.ts +178 -0
- package/src/client.test.ts +255 -1
- package/src/client.ts +157 -60
- package/src/components/artifact-card.test.ts +333 -0
- package/src/components/artifact-card.ts +75 -28
- package/src/components/artifact-inline.test.ts +1328 -0
- package/src/components/artifact-inline.ts +920 -0
- package/src/components/artifact-pane.test.ts +1042 -0
- package/src/components/artifact-pane.ts +440 -131
- package/src/components/artifact-preview.test.ts +1155 -0
- package/src/components/artifact-preview.ts +994 -0
- package/src/components/composer-parts.ts +3 -12
- package/src/components/context-mention-button.test.ts +70 -0
- package/src/components/context-mention-button.ts +82 -0
- package/src/components/context-mention-chip.ts +134 -0
- package/src/components/context-mention-menu.test.ts +508 -0
- package/src/components/context-mention-menu.ts +0 -0
- package/src/components/message-bubble.test.ts +175 -0
- package/src/components/message-bubble.ts +177 -19
- package/src/components/panel.ts +7 -10
- package/src/components/pill-composer-builder.test.ts +6 -2
- package/src/components/pill-composer-builder.ts +6 -6
- package/src/components/reasoning-bubble.ts +1 -13
- package/src/components/registry.ts +38 -3
- package/src/components/tool-bubble.ts +1 -13
- package/src/context-mentions-bundle.test.ts +163 -0
- package/src/context-mentions-entry.ts +185 -0
- package/src/context-mentions-inline-entry.test.ts +136 -0
- package/src/context-mentions-inline-entry.ts +226 -0
- package/src/context-mentions-inline-loader.test.ts +30 -0
- package/src/context-mentions-inline-loader.ts +36 -0
- package/src/context-mentions-inline.ts +15 -0
- package/src/context-mentions-loader.ts +32 -0
- package/src/context-mentions.ts +16 -0
- package/src/defaults.ts +1 -0
- package/src/generated/runtype-openapi-contract.ts +55 -3
- package/src/index-core.ts +46 -1
- package/src/index-global.ts +51 -0
- package/src/index.ts +8 -0
- package/src/markdown-parsers-loader.test.ts +158 -0
- package/src/markdown-parsers-loader.ts +83 -27
- package/src/plugin-kit.test.ts +40 -0
- package/src/plugin-kit.ts +39 -5
- package/src/runtime/host-layout.test.ts +163 -0
- package/src/runtime/host-layout.ts +110 -7
- package/src/runtime/init.ts +18 -61
- package/src/session.mentions.test.ts +175 -0
- package/src/session.test.ts +52 -4
- package/src/session.ts +197 -27
- package/src/smart-dom-reader.test.ts +129 -2
- package/src/smart-dom-reader.ts +127 -1
- package/src/styles/context-mention-menu-css.ts +176 -0
- package/src/styles/widget.css +1002 -152
- package/src/theme-editor/preview.ts +2 -0
- package/src/theme-editor/sections.test.ts +26 -1
- package/src/theme-editor/sections.ts +13 -5
- package/src/theme-reference.ts +2 -2
- package/src/tool-call-display-defaults.test.ts +1 -0
- package/src/types/theme.ts +79 -0
- package/src/types.ts +1041 -17
- package/src/ui.artifact-pane-gating.test.ts +636 -0
- package/src/ui.component-directive.test.ts +104 -0
- package/src/ui.composer-bar.test.ts +60 -2
- package/src/ui.detached-panel.test.ts +1049 -0
- package/src/ui.mention-submit.test.ts +235 -0
- package/src/ui.tool-display.test.ts +51 -0
- package/src/ui.ts +998 -159
- package/src/utils/artifact-custom-actions.ts +128 -0
- package/src/utils/artifact-display.test.ts +42 -0
- package/src/utils/artifact-display.ts +84 -0
- package/src/utils/artifact-file.test.ts +116 -0
- package/src/utils/artifact-file.ts +117 -0
- package/src/utils/artifact-gate.test.ts +112 -5
- package/src/utils/artifact-gate.ts +39 -14
- package/src/utils/artifact-loading-status.ts +55 -0
- package/src/utils/artifact-status-label.ts +190 -0
- package/src/utils/buttons.ts +7 -1
- package/src/utils/chunk-loader.test.ts +97 -0
- package/src/utils/chunk-loader.ts +88 -0
- package/src/utils/code-highlight.test.ts +186 -0
- package/src/utils/code-highlight.ts +400 -0
- package/src/utils/composer-contenteditable.test.ts +507 -0
- package/src/utils/composer-contenteditable.ts +626 -0
- package/src/utils/composer-document.test.ts +280 -0
- package/src/utils/composer-document.ts +293 -0
- package/src/utils/composer-history.test.ts +35 -7
- package/src/utils/composer-history.ts +30 -20
- package/src/utils/composer-input.ts +159 -0
- package/src/utils/context-mention-controller.test.ts +1215 -0
- package/src/utils/context-mention-controller.ts +1186 -0
- package/src/utils/context-mention-manager.test.ts +422 -0
- package/src/utils/context-mention-manager.ts +410 -0
- package/src/utils/context-mention-orchestrator.test.ts +538 -0
- package/src/utils/context-mention-orchestrator.ts +348 -0
- package/src/utils/icons.ts +2 -0
- package/src/utils/live-region.test.ts +108 -0
- package/src/utils/live-region.ts +94 -0
- package/src/utils/mention-channels.ts +63 -0
- package/src/utils/mention-llm-format.test.ts +91 -0
- package/src/utils/mention-llm-format.ts +79 -0
- package/src/utils/mention-matcher.test.ts +86 -0
- package/src/utils/mention-matcher.ts +221 -0
- package/src/utils/mention-token.ts +72 -0
- package/src/utils/mention-trigger.test.ts +155 -0
- package/src/utils/mention-trigger.ts +156 -0
- package/src/utils/roving-tablist.test.ts +152 -0
- package/src/utils/roving-tablist.ts +111 -0
- package/src/utils/spinner.ts +45 -0
- package/src/utils/theme.test.ts +76 -4
- package/src/utils/theme.ts +7 -0
- package/src/utils/tokens.ts +118 -11
- package/src/utils/tool-loading-animation.test.ts +32 -0
- package/src/utils/tool-loading-animation.ts +24 -0
- package/dist/chunk-DFBSCFYN.js +0 -1
- package/dist/runtype-tts-entry-HFUV2UF7.js +0 -1
- package/dist/session-reconnect-U77QFUR7.js +0 -1
|
@@ -10,36 +10,44 @@
|
|
|
10
10
|
* to the textarea.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Generic over the entry type `T` so the same machine drives both composer
|
|
15
|
+
* surfaces: chip mode recalls `string`s (textarea values); inline mode recalls
|
|
16
|
+
* `ComposerDocument`s (blocks + mention ids). The machine never inspects an entry
|
|
17
|
+
* — it only indexes the list and swaps the draft — so it stays entirely
|
|
18
|
+
* value-agnostic. Defaults to `string` so every existing chip-mode caller is
|
|
19
|
+
* unchanged.
|
|
20
|
+
*/
|
|
21
|
+
export interface ComposerHistoryState<T = string> {
|
|
14
22
|
/** Index into the history list, or -1 when not navigating. */
|
|
15
23
|
index: number;
|
|
16
|
-
/** The user's in-progress
|
|
17
|
-
draft:
|
|
24
|
+
/** The user's in-progress entry, saved when navigation begins. */
|
|
25
|
+
draft: T;
|
|
18
26
|
}
|
|
19
27
|
|
|
20
|
-
export const INITIAL_HISTORY_STATE: ComposerHistoryState = {
|
|
28
|
+
export const INITIAL_HISTORY_STATE: ComposerHistoryState<string> = {
|
|
21
29
|
index: -1,
|
|
22
30
|
draft: ""
|
|
23
31
|
};
|
|
24
32
|
|
|
25
|
-
export interface ComposerHistoryInput {
|
|
33
|
+
export interface ComposerHistoryInput<T = string> {
|
|
26
34
|
direction: "up" | "down";
|
|
27
|
-
/** Previously sent user
|
|
28
|
-
history:
|
|
29
|
-
/** Current
|
|
30
|
-
currentValue:
|
|
31
|
-
/** True when the caret sits at the very start of the
|
|
35
|
+
/** Previously sent user entries, oldest first. */
|
|
36
|
+
history: T[];
|
|
37
|
+
/** Current composer entry (saved as the draft when navigation begins). */
|
|
38
|
+
currentValue: T;
|
|
39
|
+
/** True when the caret sits at the very start of the composer. */
|
|
32
40
|
atStart: boolean;
|
|
33
|
-
state: ComposerHistoryState
|
|
41
|
+
state: ComposerHistoryState<T>;
|
|
34
42
|
}
|
|
35
43
|
|
|
36
|
-
export interface ComposerHistoryResult {
|
|
44
|
+
export interface ComposerHistoryResult<T = string> {
|
|
37
45
|
/** Whether the key was consumed (caller should preventDefault). */
|
|
38
46
|
handled: boolean;
|
|
39
|
-
/** New
|
|
40
|
-
value?:
|
|
47
|
+
/** New entry to apply: only present when it should change. */
|
|
48
|
+
value?: T;
|
|
41
49
|
/** Next navigation state. */
|
|
42
|
-
state: ComposerHistoryState
|
|
50
|
+
state: ComposerHistoryState<T>;
|
|
43
51
|
}
|
|
44
52
|
|
|
45
53
|
/**
|
|
@@ -50,9 +58,9 @@ export interface ComposerHistoryResult {
|
|
|
50
58
|
* - **Down** only acts while already navigating, stepping toward newer messages
|
|
51
59
|
* and finally restoring the saved draft once it walks past the newest entry.
|
|
52
60
|
*/
|
|
53
|
-
export function navigateComposerHistory(
|
|
54
|
-
input: ComposerHistoryInput
|
|
55
|
-
): ComposerHistoryResult {
|
|
61
|
+
export function navigateComposerHistory<T = string>(
|
|
62
|
+
input: ComposerHistoryInput<T>
|
|
63
|
+
): ComposerHistoryResult<T> {
|
|
56
64
|
const { direction, history, currentValue, atStart, state } = input;
|
|
57
65
|
const inHistory = state.index !== -1;
|
|
58
66
|
|
|
@@ -104,10 +112,12 @@ export function navigateComposerHistory(
|
|
|
104
112
|
};
|
|
105
113
|
}
|
|
106
114
|
|
|
107
|
-
// Stepped past the newest entry: restore the saved draft and exit.
|
|
115
|
+
// Stepped past the newest entry: restore the saved draft and exit. `index: -1`
|
|
116
|
+
// marks "not navigating"; the draft field is dead until the next Up overwrites
|
|
117
|
+
// it, so keep the existing (correctly-typed) value rather than fabricating one.
|
|
108
118
|
return {
|
|
109
119
|
handled: true,
|
|
110
120
|
value: state.draft,
|
|
111
|
-
state: {
|
|
121
|
+
state: { index: -1, draft: state.draft }
|
|
112
122
|
};
|
|
113
123
|
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The composer input surface the mention controller drives, abstracted over the
|
|
3
|
+
* two editing modes:
|
|
4
|
+
*
|
|
5
|
+
* - **chip mode** (`display: "chip"`, default): a plain `<textarea>`. Logical
|
|
6
|
+
* text is the raw value and logical caret is `selectionStart`.
|
|
7
|
+
* - **inline mode** (`display: "inline"`, Phase 4): a contenteditable surface
|
|
8
|
+
* whose atomic mention tokens collapse to a single `` in the logical text
|
|
9
|
+
* (see `composer-document.ts`). Its adapter additionally implements the
|
|
10
|
+
* optional document/token methods below.
|
|
11
|
+
*
|
|
12
|
+
* The controller only ever touches the composer through this capability, so the
|
|
13
|
+
* same menu/keyboard/search engine serves both surfaces. `ComposerInputCapability`
|
|
14
|
+
* is a superset of the public `AgentWidgetContextMentionComposerCapability`
|
|
15
|
+
* (`getValue`/`setValue`/`submit`) — the single source of truth for composer
|
|
16
|
+
* access — so a client `command:"action"` handler receives the same object.
|
|
17
|
+
*
|
|
18
|
+
* IMPORTANT (bundle guard): this module imports the document model TYPE-ONLY, so
|
|
19
|
+
* the chip chunk (`context-mentions.js`) never pulls `composer-document.ts`
|
|
20
|
+
* runtime. The contenteditable adapter, which does need it, lives in the separate
|
|
21
|
+
* inline chunk. Keep it that way — see `context-mentions-bundle.test.ts`.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
import type { MentionTriggerMatch } from "./mention-trigger";
|
|
25
|
+
import type {
|
|
26
|
+
ComposerDocument,
|
|
27
|
+
ComposerMentionId
|
|
28
|
+
} from "./composer-document";
|
|
29
|
+
import type {
|
|
30
|
+
AgentWidgetContextMentionComposerCapability,
|
|
31
|
+
AgentWidgetContextMentionRef
|
|
32
|
+
} from "../types";
|
|
33
|
+
|
|
34
|
+
export interface ComposerInputCapability
|
|
35
|
+
extends AgentWidgetContextMentionComposerCapability {
|
|
36
|
+
/** The editable element — ARIA target for the menu, and focus receiver. */
|
|
37
|
+
readonly element: HTMLElement;
|
|
38
|
+
/** Text used for trigger parsing. Chip: `=== getValue()`; inline: text + ``. */
|
|
39
|
+
getLogicalText: () => string;
|
|
40
|
+
/** Caret/selection in LOGICAL coordinates. */
|
|
41
|
+
getSelection: () => { start: number; end: number };
|
|
42
|
+
/** Move the caret/selection (logical coordinates). */
|
|
43
|
+
setSelection: (start: number, end?: number) => void;
|
|
44
|
+
/** Replace the plain text and place the caret. No input event, no focus. */
|
|
45
|
+
setValueWithCaret: (value: string, caret: number) => void;
|
|
46
|
+
/** Fire input listeners after a programmatic edit. */
|
|
47
|
+
dispatchInput: () => void;
|
|
48
|
+
focus: () => void;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* INLINE ONLY (contenteditable). Bounding rect (VIEWPORT coordinates) of the
|
|
52
|
+
* LOGICAL character range `[start, end)`, or `null` when unmeasurable (invalid
|
|
53
|
+
* range or a zero-size/degenerate rect). Used to trigger-anchor the mention menu
|
|
54
|
+
* horizontally to the `@` glyph. Chip (textarea) adapters omit it — no cheap
|
|
55
|
+
* per-glyph rect without a mirror-div hack, so the menu stays composer-anchored
|
|
56
|
+
* (graceful degradation). Callers treat a missing method exactly like a `null`
|
|
57
|
+
* result.
|
|
58
|
+
*/
|
|
59
|
+
getLogicalRangeRect?: (start: number, end: number) => DOMRect | null;
|
|
60
|
+
|
|
61
|
+
// ---- inline-only (contenteditable adapter); chip adapters omit these ----
|
|
62
|
+
|
|
63
|
+
/** Canonical document (inline mode). */
|
|
64
|
+
getDocument?: () => ComposerDocument;
|
|
65
|
+
/**
|
|
66
|
+
* INLINE ONLY. Replace the active trigger range (`match`, logical coordinates)
|
|
67
|
+
* with an atomic mention token and place the caret after it. Returns the new
|
|
68
|
+
* mention's id (resolve-tracking key), or `null` if the range no longer matches
|
|
69
|
+
* the document (stale menu). Chip adapters leave this undefined — the controller
|
|
70
|
+
* then falls back to `stripMentionQuery`.
|
|
71
|
+
*/
|
|
72
|
+
insertMentionAtTrigger?: (
|
|
73
|
+
ref: AgentWidgetContextMentionRef,
|
|
74
|
+
match: MentionTriggerMatch
|
|
75
|
+
) => ComposerMentionId | null;
|
|
76
|
+
/**
|
|
77
|
+
* INLINE ONLY. Insert an atomic mention token at the current caret/selection
|
|
78
|
+
* (picker path — the affordance button opens with no trigger char to replace).
|
|
79
|
+
* Returns the new mention's id. Chip adapters leave this undefined.
|
|
80
|
+
*/
|
|
81
|
+
insertMentionAtSelection?: (
|
|
82
|
+
ref: AgentWidgetContextMentionRef
|
|
83
|
+
) => ComposerMentionId;
|
|
84
|
+
/**
|
|
85
|
+
* INLINE ONLY. Reflect a mention's resolve status on its live token element —
|
|
86
|
+
* used to surface resolve errors inline. Toggles the error styling for `"error"`
|
|
87
|
+
* and clears it otherwise. No-op for an unknown id. Chip adapters omit this.
|
|
88
|
+
*/
|
|
89
|
+
setMentionStatus?: (
|
|
90
|
+
id: ComposerMentionId,
|
|
91
|
+
status: "pending" | "resolved" | "error"
|
|
92
|
+
) => void;
|
|
93
|
+
/**
|
|
94
|
+
* INLINE ONLY. Replace the LOGICAL range `[start, end)` with plain `text`,
|
|
95
|
+
* preserving every mention token that lies outside the range, and place the
|
|
96
|
+
* caret after the inserted text. This is the token-safe edit the controller
|
|
97
|
+
* uses for query-strip / slash-completion / prompt-macro rewrites, since a plain
|
|
98
|
+
* `getValue()` string-slice would misalign against DISPLAY text (`@Label`
|
|
99
|
+
* expands a token to many chars) and re-rendering as one text block would
|
|
100
|
+
* destroy every token. Chip adapters omit it — there DISPLAY === LOGICAL, so the
|
|
101
|
+
* controller string-slices `getValue()` + `setValueWithCaret` instead.
|
|
102
|
+
*/
|
|
103
|
+
replaceLogicalRange?: (start: number, end: number, text: string) => void;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Submit the form that owns a composer element: prefer `requestSubmit()` (fires
|
|
108
|
+
* native validation + a cancelable `submit`), falling back to a dispatched
|
|
109
|
+
* cancelable `submit` event where `requestSubmit` is unavailable. Shared by both
|
|
110
|
+
* composer adapters so submission behaves identically across editing modes.
|
|
111
|
+
*/
|
|
112
|
+
export function requestFormSubmit(form: HTMLFormElement | null | undefined): void {
|
|
113
|
+
if (!form) return;
|
|
114
|
+
if (typeof form.requestSubmit === "function") {
|
|
115
|
+
form.requestSubmit();
|
|
116
|
+
} else {
|
|
117
|
+
form.dispatchEvent(new Event("submit", { bubbles: true, cancelable: true }));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Chip-mode adapter: a `ComposerInputCapability` backed by a raw `<textarea>`.
|
|
123
|
+
* Logical text === value, logical caret === `selectionStart`. `submit()` derives
|
|
124
|
+
* the composer form from `textarea.form` (falling back to a dispatched `submit`
|
|
125
|
+
* event where `requestSubmit` is unavailable), matching the widget's own behavior
|
|
126
|
+
* — so the composer surface owns submission, no separate capability needed.
|
|
127
|
+
*/
|
|
128
|
+
export function createTextareaComposerInput(
|
|
129
|
+
textarea: HTMLTextAreaElement
|
|
130
|
+
): ComposerInputCapability {
|
|
131
|
+
const dispatchInput = (): void => {
|
|
132
|
+
textarea.dispatchEvent(new Event("input", { bubbles: true }));
|
|
133
|
+
};
|
|
134
|
+
return {
|
|
135
|
+
element: textarea,
|
|
136
|
+
getValue: () => textarea.value,
|
|
137
|
+
getLogicalText: () => textarea.value,
|
|
138
|
+
getSelection: () => ({
|
|
139
|
+
start: textarea.selectionStart ?? 0,
|
|
140
|
+
end: textarea.selectionEnd ?? 0
|
|
141
|
+
}),
|
|
142
|
+
setSelection: (start, end = start) => {
|
|
143
|
+
textarea.setSelectionRange(start, end);
|
|
144
|
+
},
|
|
145
|
+
setValueWithCaret: (value, caret) => {
|
|
146
|
+
textarea.value = value;
|
|
147
|
+
textarea.setSelectionRange(caret, caret);
|
|
148
|
+
},
|
|
149
|
+
setValue: (value: string) => {
|
|
150
|
+
textarea.value = value;
|
|
151
|
+
textarea.setSelectionRange(value.length, value.length);
|
|
152
|
+
dispatchInput();
|
|
153
|
+
textarea.focus();
|
|
154
|
+
},
|
|
155
|
+
submit: () => requestFormSubmit(textarea.form),
|
|
156
|
+
dispatchInput,
|
|
157
|
+
focus: () => textarea.focus()
|
|
158
|
+
};
|
|
159
|
+
}
|