@carbon/ai-chat-components 1.9.0-rc.1 → 1.9.0-rc.2
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/custom-elements.json +3764 -3440
- package/es/components/prompt-line/autocomplete/src/autocomplete.d.ts +8 -1
- package/es/components/prompt-line/autocomplete/src/autocomplete.js +58 -13
- package/es/components/prompt-line/autocomplete/src/autocomplete.js.map +1 -1
- package/es/components/prompt-line/autocomplete/src/autocomplete.scss.js +1 -1
- package/es/components/prompt-line/src/autocomplete-controller.js +5 -15
- package/es/components/prompt-line/src/autocomplete-controller.js.map +1 -1
- package/es/components/prompt-line/src/prompt-line-constants.d.ts +10 -0
- package/es/components/prompt-line/src/prompt-line-constants.js +8 -1
- package/es/components/prompt-line/src/prompt-line-constants.js.map +1 -1
- package/es/components/prompt-line/src/prompt-line-controller.d.ts +15 -2
- package/es/components/prompt-line/src/prompt-line-controller.js +5 -2
- package/es/components/prompt-line/src/prompt-line-controller.js.map +1 -1
- package/es/components/prompt-line/src/prompt-line-rich-loader.js +5 -0
- package/es/components/prompt-line/src/prompt-line-rich-loader.js.map +1 -1
- package/es/components/prompt-line/src/prompt-line-rich-runtime.d.ts +2 -0
- package/es/components/prompt-line/src/prompt-line-rich-runtime.js +111 -15
- package/es/components/prompt-line/src/prompt-line-rich-runtime.js.map +1 -1
- package/es/components/prompt-line/src/prompt-line.d.ts +44 -7
- package/es/components/prompt-line/src/prompt-line.js +124 -31
- package/es/components/prompt-line/src/prompt-line.js.map +1 -1
- package/es/components/prompt-line/src/tiptap/build-extensions.js +35 -5
- package/es/components/prompt-line/src/tiptap/build-extensions.js.map +1 -1
- package/es/components/prompt-line/src/tiptap/carbon-autocomplete.d.ts +5 -1
- package/es/components/prompt-line/src/tiptap/carbon-autocomplete.js +16 -7
- package/es/components/prompt-line/src/tiptap/carbon-autocomplete.js.map +1 -1
- package/es/components/prompt-line/src/tiptap/carbon-mention.js +3 -3
- package/es/components/prompt-line/src/tiptap/carbon-mention.js.map +1 -1
- package/es/components/prompt-line/src/tiptap/carbon-starter-trigger.d.ts +12 -1
- package/es/components/prompt-line/src/tiptap/carbon-starter-trigger.js +28 -3
- package/es/components/prompt-line/src/tiptap/carbon-starter-trigger.js.map +1 -1
- package/es/components/prompt-line/src/tiptap/editor-styles.js +1 -1
- package/es/components/prompt-line/src/tiptap/editor-styles.js.map +1 -1
- package/es/components/prompt-line/src/tiptap/extension-equivalence.d.ts +63 -0
- package/es/components/prompt-line/src/tiptap/extension-equivalence.js +80 -0
- package/es/components/prompt-line/src/tiptap/extension-equivalence.js.map +1 -0
- package/es/components/prompt-line/src/tiptap/index.d.ts +1 -4
- package/es/components/prompt-line/src/tiptap/index.js +1 -18
- package/es/components/prompt-line/src/tiptap/index.js.map +1 -1
- package/es/components/prompt-line/src/tiptap/json-utils.d.ts +8 -0
- package/es/components/prompt-line/src/tiptap/json-utils.js +11 -1
- package/es/components/prompt-line/src/tiptap/json-utils.js.map +1 -1
- package/es/components/prompt-line/src/tiptap/render-token-chip.js +3 -5
- package/es/components/prompt-line/src/tiptap/render-token-chip.js.map +1 -1
- package/es/components/prompt-line/src/tiptap/types.d.ts +5 -15
- package/es/react/hooks/useChatAutocomplete.js +14 -1
- package/es/react/hooks/useChatAutocomplete.js.map +1 -1
- package/es/react/prompt-line.d.ts +3 -2
- package/es/react/prompt-line.js +3 -2
- package/es/react/prompt-line.js.map +1 -1
- package/es-custom/components/prompt-line/autocomplete/src/autocomplete.d.ts +8 -1
- package/es-custom/components/prompt-line/autocomplete/src/autocomplete.js +58 -13
- package/es-custom/components/prompt-line/autocomplete/src/autocomplete.js.map +1 -1
- package/es-custom/components/prompt-line/autocomplete/src/autocomplete.scss.js +1 -1
- package/es-custom/components/prompt-line/src/autocomplete-controller.js +5 -15
- package/es-custom/components/prompt-line/src/autocomplete-controller.js.map +1 -1
- package/es-custom/components/prompt-line/src/prompt-line-constants.d.ts +10 -0
- package/es-custom/components/prompt-line/src/prompt-line-constants.js +8 -1
- package/es-custom/components/prompt-line/src/prompt-line-constants.js.map +1 -1
- package/es-custom/components/prompt-line/src/prompt-line-controller.d.ts +15 -2
- package/es-custom/components/prompt-line/src/prompt-line-controller.js +5 -2
- package/es-custom/components/prompt-line/src/prompt-line-controller.js.map +1 -1
- package/es-custom/components/prompt-line/src/prompt-line-rich-loader.js +5 -0
- package/es-custom/components/prompt-line/src/prompt-line-rich-loader.js.map +1 -1
- package/es-custom/components/prompt-line/src/prompt-line-rich-runtime.d.ts +2 -0
- package/es-custom/components/prompt-line/src/prompt-line-rich-runtime.js +111 -15
- package/es-custom/components/prompt-line/src/prompt-line-rich-runtime.js.map +1 -1
- package/es-custom/components/prompt-line/src/prompt-line.d.ts +44 -7
- package/es-custom/components/prompt-line/src/prompt-line.js +124 -31
- package/es-custom/components/prompt-line/src/prompt-line.js.map +1 -1
- package/es-custom/components/prompt-line/src/tiptap/build-extensions.js +35 -5
- package/es-custom/components/prompt-line/src/tiptap/build-extensions.js.map +1 -1
- package/es-custom/components/prompt-line/src/tiptap/carbon-autocomplete.d.ts +5 -1
- package/es-custom/components/prompt-line/src/tiptap/carbon-autocomplete.js +16 -7
- package/es-custom/components/prompt-line/src/tiptap/carbon-autocomplete.js.map +1 -1
- package/es-custom/components/prompt-line/src/tiptap/carbon-mention.js +3 -3
- package/es-custom/components/prompt-line/src/tiptap/carbon-mention.js.map +1 -1
- package/es-custom/components/prompt-line/src/tiptap/carbon-starter-trigger.d.ts +12 -1
- package/es-custom/components/prompt-line/src/tiptap/carbon-starter-trigger.js +28 -3
- package/es-custom/components/prompt-line/src/tiptap/carbon-starter-trigger.js.map +1 -1
- package/es-custom/components/prompt-line/src/tiptap/editor-styles.js +1 -1
- package/es-custom/components/prompt-line/src/tiptap/editor-styles.js.map +1 -1
- package/es-custom/components/prompt-line/src/tiptap/extension-equivalence.d.ts +63 -0
- package/es-custom/components/prompt-line/src/tiptap/extension-equivalence.js +80 -0
- package/es-custom/components/prompt-line/src/tiptap/extension-equivalence.js.map +1 -0
- package/es-custom/components/prompt-line/src/tiptap/index.d.ts +1 -4
- package/es-custom/components/prompt-line/src/tiptap/index.js +1 -18
- package/es-custom/components/prompt-line/src/tiptap/index.js.map +1 -1
- package/es-custom/components/prompt-line/src/tiptap/json-utils.d.ts +8 -0
- package/es-custom/components/prompt-line/src/tiptap/json-utils.js +11 -1
- package/es-custom/components/prompt-line/src/tiptap/json-utils.js.map +1 -1
- package/es-custom/components/prompt-line/src/tiptap/render-token-chip.js +3 -5
- package/es-custom/components/prompt-line/src/tiptap/render-token-chip.js.map +1 -1
- package/es-custom/components/prompt-line/src/tiptap/types.d.ts +5 -15
- package/es-custom/react/hooks/useChatAutocomplete.js +14 -1
- package/es-custom/react/hooks/useChatAutocomplete.js.map +1 -1
- package/es-custom/react/prompt-line.d.ts +3 -2
- package/es-custom/react/prompt-line.js +3 -2
- package/es-custom/react/prompt-line.js.map +1 -1
- package/package.json +14 -24
|
@@ -9,20 +9,22 @@ import { Editor } from '@tiptap/core';
|
|
|
9
9
|
import DocumentNode from '@tiptap/extension-document';
|
|
10
10
|
import HardBreakNode from '@tiptap/extension-hard-break';
|
|
11
11
|
import ParagraphNode from '@tiptap/extension-paragraph';
|
|
12
|
+
import Placeholder from '@tiptap/extension-placeholder';
|
|
12
13
|
import TextNode from '@tiptap/extension-text';
|
|
14
|
+
import { UndoRedo } from '@tiptap/extensions';
|
|
13
15
|
import { IS_PHONE } from '../../../globals/utils/browser-utils.js';
|
|
14
16
|
import { setVarsForSelector } from '../../shared/dynamic-css-var-sheet.js';
|
|
15
17
|
import { applyEditorStyles } from './tiptap/editor-styles.js';
|
|
16
|
-
import { HISTORY_DEFAULTS } from './
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
18
|
+
import { HISTORY_DEFAULTS } from './prompt-line-constants.js';
|
|
19
|
+
import { writeStarterStorage } from './tiptap/carbon-starter-trigger.js';
|
|
20
|
+
import { areExtensionSetsEquivalent, getExtensionSource } from './tiptap/extension-equivalence.js';
|
|
21
|
+
import { carbonChatEnter } from './tiptap/chat-enter.js';
|
|
20
22
|
import { Keymap } from './tiptap/keymap.js';
|
|
21
|
-
import {
|
|
23
|
+
import { PlainTextPaste } from './tiptap/plain-text-paste.js';
|
|
22
24
|
import { TypingIndicator } from './tiptap/typing-indicator.js';
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import
|
|
25
|
+
import { ValueSync } from './tiptap/value-sync.js';
|
|
26
|
+
import { textToDoc } from './tiptap/json-utils.js';
|
|
27
|
+
import { setHostOriginMeta } from './tiptap/origin-meta.js';
|
|
26
28
|
|
|
27
29
|
/**
|
|
28
30
|
* @license
|
|
@@ -49,6 +51,7 @@ import Placeholder from '@tiptap/extension-placeholder';
|
|
|
49
51
|
* `cds-aichat-prompt-*` events so the shell, React wrapper, and `Input`
|
|
50
52
|
* handlers are mode-agnostic.
|
|
51
53
|
*/
|
|
54
|
+
/** Exported so tests assert the ring without retyping the literal. */
|
|
52
55
|
const PM_KEYBOARD_FOCUS_CLASS = 'cds-aichat--input-pm-content--keyboard-focus';
|
|
53
56
|
let keyboardFocusRuleInstalled = false;
|
|
54
57
|
function ensureKeyboardFocusRule() {
|
|
@@ -67,10 +70,25 @@ class RichController {
|
|
|
67
70
|
this._editor = null;
|
|
68
71
|
this._host = null;
|
|
69
72
|
this._extensions = [];
|
|
73
|
+
/**
|
|
74
|
+
* The set the live editor was built from. `_createEditor` assigns it the same
|
|
75
|
+
* reference as `_extensions`, so the two are normally identical; they diverge
|
|
76
|
+
* only between a `setExtensions` that adopted an equivalent set without
|
|
77
|
+
* rebuilding and the next `_createEditor`. Only `_flushPendingRecreate` needs
|
|
78
|
+
* the distinction: a rebuild withheld for a composition has to be judged
|
|
79
|
+
* against what is installed, not against the set that was pending when the
|
|
80
|
+
* composition began, or a host that changed the config and changed it back
|
|
81
|
+
* loses its undo history for nothing.
|
|
82
|
+
*/
|
|
83
|
+
this._installedExtensions = [];
|
|
70
84
|
this._placeholder = '';
|
|
71
85
|
this._testId = '';
|
|
72
86
|
this._disabled = false;
|
|
73
87
|
this._focusFromMouse = false;
|
|
88
|
+
this._isComposing = false;
|
|
89
|
+
/** Set when a recreate is withheld during an IME composition. */
|
|
90
|
+
this._pendingRecreate = false;
|
|
91
|
+
this._pendingRecreateTimer = null;
|
|
74
92
|
// -------------------------------------------------------------------------
|
|
75
93
|
// Internals
|
|
76
94
|
// -------------------------------------------------------------------------
|
|
@@ -113,6 +131,12 @@ class RichController {
|
|
|
113
131
|
host.removeEventListener('mousedown', this._setMouseFlag);
|
|
114
132
|
host.removeEventListener('touchstart', this._setMouseFlag);
|
|
115
133
|
}
|
|
134
|
+
if (this._pendingRecreateTimer) {
|
|
135
|
+
clearTimeout(this._pendingRecreateTimer);
|
|
136
|
+
this._pendingRecreateTimer = null;
|
|
137
|
+
}
|
|
138
|
+
this._isComposing = false;
|
|
139
|
+
this._pendingRecreate = false;
|
|
116
140
|
this._editor?.destroy();
|
|
117
141
|
this._editor = null;
|
|
118
142
|
this._host = null;
|
|
@@ -190,9 +214,14 @@ class RichController {
|
|
|
190
214
|
this._editor?.setEditable(editable);
|
|
191
215
|
}
|
|
192
216
|
setPlaceholder(placeholder) {
|
|
193
|
-
// Placeholder is fixed at editor creation (matches the pre-split element);
|
|
194
|
-
// record it so a later extension-driven recreate keeps the latest value.
|
|
195
217
|
this._placeholder = placeholder;
|
|
218
|
+
// The Placeholder extension reads this back through the resolver installed
|
|
219
|
+
// in `_createEditor`; the empty transaction repaints the decoration so the
|
|
220
|
+
// new text shows without waiting for the next edit.
|
|
221
|
+
const editor = this._editor;
|
|
222
|
+
if (editor) {
|
|
223
|
+
editor.view.dispatch(editor.state.tr);
|
|
224
|
+
}
|
|
196
225
|
}
|
|
197
226
|
setAriaLabel(ariaLabel) {
|
|
198
227
|
if (!this._host) {
|
|
@@ -210,15 +239,72 @@ class RichController {
|
|
|
210
239
|
this._applyTestIdToEditorDom();
|
|
211
240
|
}
|
|
212
241
|
setExtensions(extensions) {
|
|
242
|
+
const equivalent = areExtensionSetsEquivalent(this._extensions, extensions);
|
|
243
|
+
// Adopt the new list either way — a later genuine change is compared
|
|
244
|
+
// against what the host most recently supplied.
|
|
213
245
|
this._extensions = extensions;
|
|
246
|
+
if (equivalent) {
|
|
247
|
+
// Starter items / isOn ride on extension storage precisely so they can be
|
|
248
|
+
// swapped without a recreate.
|
|
249
|
+
this._syncStarterStorage();
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
214
252
|
this._recreateEditor();
|
|
215
253
|
}
|
|
254
|
+
setComposing(composing) {
|
|
255
|
+
this._isComposing = composing;
|
|
256
|
+
if (composing || !this._pendingRecreate || this._pendingRecreateTimer) {
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
// ProseMirror defers the last composed segment to a microtask after
|
|
260
|
+
// compositionend, so recreating here would snapshot the doc without it and
|
|
261
|
+
// lose the character the user just committed. A macrotask runs after that
|
|
262
|
+
// flush.
|
|
263
|
+
this._pendingRecreateTimer = setTimeout(() => {
|
|
264
|
+
this._pendingRecreateTimer = null;
|
|
265
|
+
this._flushPendingRecreate();
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
/** Push the current starter config onto the live editor's storage. */
|
|
269
|
+
_syncStarterStorage() {
|
|
270
|
+
const source = this._extensions
|
|
271
|
+
.map(getExtensionSource)
|
|
272
|
+
.find((descriptor) => descriptor?.kind === 'starters');
|
|
273
|
+
const config = source?.config;
|
|
274
|
+
if (!config) {
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
writeStarterStorage(this._editor, {
|
|
278
|
+
items: config.items,
|
|
279
|
+
isOn: config.isOn !== false,
|
|
280
|
+
});
|
|
281
|
+
}
|
|
216
282
|
undo() {
|
|
217
283
|
return Boolean(this._editor?.commands.undo());
|
|
218
284
|
}
|
|
219
285
|
redo() {
|
|
220
286
|
return Boolean(this._editor?.commands.redo());
|
|
221
287
|
}
|
|
288
|
+
_flushPendingRecreate() {
|
|
289
|
+
// A fresh composition may have started while the flush was queued; its own
|
|
290
|
+
// compositionend re-queues this. A detached host means the element's own
|
|
291
|
+
// deferred teardown is already pending, so rebuilding would raise an editor
|
|
292
|
+
// only to destroy it a task later.
|
|
293
|
+
if (!this._host?.isConnected ||
|
|
294
|
+
!this._pendingRecreate ||
|
|
295
|
+
this._isComposing) {
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
// Compare against what is installed, not the set that was pending when the
|
|
299
|
+
// composition began: a host that changed the config and changed it back has
|
|
300
|
+
// nothing left to rebuild, and rebuilding anyway would drop undo history.
|
|
301
|
+
if (areExtensionSetsEquivalent(this._installedExtensions, this._extensions)) {
|
|
302
|
+
this._pendingRecreate = false;
|
|
303
|
+
this._syncStarterStorage();
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
this._recreateEditor();
|
|
307
|
+
}
|
|
222
308
|
_createEditor(element, content) {
|
|
223
309
|
const baseExtensions = [
|
|
224
310
|
DocumentNode,
|
|
@@ -226,7 +312,10 @@ class RichController {
|
|
|
226
312
|
TextNode,
|
|
227
313
|
HardBreakNode,
|
|
228
314
|
UndoRedo.configure({ ...HISTORY_DEFAULTS }),
|
|
229
|
-
|
|
315
|
+
// Resolved per decoration build rather than captured, so `setPlaceholder`
|
|
316
|
+
// lands on the live editor. Tiptap snapshots an extension's options when
|
|
317
|
+
// it builds plugins, so a value here could never be updated in place.
|
|
318
|
+
Placeholder.configure({ placeholder: () => this._placeholder }),
|
|
230
319
|
PlainTextPaste,
|
|
231
320
|
Keymap,
|
|
232
321
|
// Plain Enter sends (non-empty); empty Enter falls through to a newline.
|
|
@@ -236,6 +325,7 @@ class RichController {
|
|
|
236
325
|
ValueSync,
|
|
237
326
|
TypingIndicator,
|
|
238
327
|
];
|
|
328
|
+
this._installedExtensions = this._extensions;
|
|
239
329
|
return new Editor({
|
|
240
330
|
element,
|
|
241
331
|
extensions: [...baseExtensions, ...this._extensions],
|
|
@@ -268,6 +358,11 @@ class RichController {
|
|
|
268
358
|
if (!host) {
|
|
269
359
|
return;
|
|
270
360
|
}
|
|
361
|
+
if (this._isComposing) {
|
|
362
|
+
this._pendingRecreate = true;
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
this._pendingRecreate = false;
|
|
271
366
|
const previousJson = this._editor?.getJSON();
|
|
272
367
|
const previousSelection = this._editor
|
|
273
368
|
? {
|
|
@@ -276,6 +371,8 @@ class RichController {
|
|
|
276
371
|
}
|
|
277
372
|
: null;
|
|
278
373
|
const wasFocused = this._editor?.isFocused ?? false;
|
|
374
|
+
const wasKeyboardFocus = this._editor?.view.dom.classList.contains(PM_KEYBOARD_FOCUS_CLASS) ??
|
|
375
|
+
false;
|
|
279
376
|
this._editor?.destroy();
|
|
280
377
|
this._editor = this._createEditor(host, previousJson);
|
|
281
378
|
this._wireEditorEvents(this._editor);
|
|
@@ -288,7 +385,6 @@ class RichController {
|
|
|
288
385
|
const to = Math.min(previousSelection.to, size);
|
|
289
386
|
this._editor.commands.setTextSelection({ from, to });
|
|
290
387
|
}
|
|
291
|
-
const wasKeyboardFocus = this._editor.view.dom.classList.contains(PM_KEYBOARD_FOCUS_CLASS);
|
|
292
388
|
if (wasFocused) {
|
|
293
389
|
this._focusFromMouse = !wasKeyboardFocus;
|
|
294
390
|
this._editor.commands.focus();
|
|
@@ -300,8 +396,8 @@ class RichController {
|
|
|
300
396
|
return;
|
|
301
397
|
}
|
|
302
398
|
// Chain a no-op command that meta-tags the accumulator tr as host-origin,
|
|
303
|
-
// then setContent on the same tr so downstream readers (typing-indicator
|
|
304
|
-
//
|
|
399
|
+
// then setContent on the same tr so downstream readers (typing-indicator)
|
|
400
|
+
// recognize the update.
|
|
305
401
|
editor
|
|
306
402
|
.chain()
|
|
307
403
|
.command(({ tr }) => {
|
|
@@ -338,5 +434,5 @@ function createRichController() {
|
|
|
338
434
|
return new RichController();
|
|
339
435
|
}
|
|
340
436
|
|
|
341
|
-
export { createRichController };
|
|
437
|
+
export { PM_KEYBOARD_FOCUS_CLASS, createRichController };
|
|
342
438
|
//# sourceMappingURL=prompt-line-rich-runtime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-line-rich-runtime.js","sources":["../../../../src/components/prompt-line/src/prompt-line-rich-runtime.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prompt-line-rich-runtime.js","sources":["../../../../src/components/prompt-line/src/prompt-line-rich-runtime.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;AAOG;AAEH;;;;;;;;;;;;;;;;AAgBG;AAiCH;AACO,MAAM,uBAAuB,GAClC;AAEF,IAAI,0BAA0B,GAAG,KAAK;AACtC,SAAS,uBAAuB,GAAA;IAC9B,IAAI,0BAA0B,EAAE;QAC9B;IACF;IACA,kBAAkB,CAAC,CAAA,CAAA,EAAI,uBAAuB,CAAA,CAAE,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;IACxE,0BAA0B,GAAG,IAAI;AACnC;AAEA;;;AAGG;AACH,MAAM,cAAc,CAAA;AAApB,IAAA,WAAA,GAAA;QACU,IAAA,CAAA,OAAO,GAAkB,IAAI;QAC7B,IAAA,CAAA,KAAK,GAAuB,IAAI;QAChC,IAAA,CAAA,WAAW,GAAgB,EAAE;AACrC;;;;;;;;;AASG;QACK,IAAA,CAAA,oBAAoB,GAAgB,EAAE;QACtC,IAAA,CAAA,YAAY,GAAG,EAAE;QACjB,IAAA,CAAA,OAAO,GAAG,EAAE;QACZ,IAAA,CAAA,SAAS,GAAG,KAAK;QACjB,IAAA,CAAA,eAAe,GAAG,KAAK;QACvB,IAAA,CAAA,YAAY,GAAG,KAAK;;QAEpB,IAAA,CAAA,gBAAgB,GAAG,KAAK;QACxB,IAAA,CAAA,qBAAqB,GAAyC,IAAI;;;;QA+NlE,IAAA,CAAA,aAAa,GAAG,MAAW;AACjC,YA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CAAC;aACA,UAAU,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;AACxC,aAAA,GAAG,EAAE;IACV;;;;IAKQ,uBAAuB,GAAA;QAC7B,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,GAA8B;QACnE,IAAI,CAAC,SAAS,EAAE;YACd;QACF;AACA,QAAA,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,SAAS,CAAC,YAAY,CAAC,aAAa,EAAE,IAAI,CAAC,OAAO,CAAC;QACrD;aAAO;AACL,YAAA,SAAS,CAAC,eAAe,CAAC,aAAa,CAAC;QAC1C;IACF;IAEQ,SAAS,CAAC,IAAY,EAAE,MAAgB,EAAA;QAC9C,IAAI,CAAC,KAAK,EAAE,aAAa,CACvB,IAAI,WAAW,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CACjE;IACH;AACD;AAED;;;AAGG;SACa,oBAAoB,GAAA;IAClC,OAAO,IAAI,cAAc,EAAE;AAC7B;;;;"}
|
|
@@ -12,11 +12,12 @@
|
|
|
12
12
|
*
|
|
13
13
|
* It renders a lightweight `<textarea>` by default and **never statically
|
|
14
14
|
* imports `@tiptap/*`**, so chats that don't use advanced input features ship
|
|
15
|
-
* no Tiptap. When the `rich` property is set
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* rich
|
|
15
|
+
* no Tiptap. When the `rich` property is set, or `ensureEditor()` is called,
|
|
16
|
+
* the element dynamically imports a Tiptap runtime and upgrades the surface in
|
|
17
|
+
* place — text, caret, and focus carry over because the textarea holds plain
|
|
18
|
+
* text. Host `extensions` alone do not trigger it; they are staged for whichever
|
|
19
|
+
* surface mounts. The upgrade is **sticky**: once rich, the element stays rich
|
|
20
|
+
* for the rest of its life.
|
|
20
21
|
*
|
|
21
22
|
* Both modes expose the same imperative API (`getEditor`, `setContent`,
|
|
22
23
|
* `insertContent`, …) and emit the same events, so the React wrapper and
|
|
@@ -44,8 +45,16 @@ declare class PromptLineElement extends LitElement {
|
|
|
44
45
|
* rich editor mounts. These are *staged*, not a rich-mode trigger: setting
|
|
45
46
|
* them while in textarea mode does not load Tiptap. Select rich explicitly
|
|
46
47
|
* with `rich` or call `ensureEditor()`; the upgrade mounts with these
|
|
47
|
-
* already installed.
|
|
48
|
-
*
|
|
48
|
+
* already installed.
|
|
49
|
+
*
|
|
50
|
+
* A new array is compared by value against the set last supplied, so a config
|
|
51
|
+
* update that rebuilds an equivalent one leaves the live editor and its undo
|
|
52
|
+
* history in place, writing any starter `items`/`isOn` through to storage.
|
|
53
|
+
* Only a genuinely different set recreates the editor, preserving content,
|
|
54
|
+
* selection, and focus but resetting history.
|
|
55
|
+
* Extensions built by `buildCarbonExtensions` compare by their source
|
|
56
|
+
* config; anything you supply directly compares by reference, so memoize
|
|
57
|
+
* those (a fresh instance each render reads as a real change).
|
|
49
58
|
*/
|
|
50
59
|
extensions: Extension[];
|
|
51
60
|
/**
|
|
@@ -73,9 +82,26 @@ declare class PromptLineElement extends LitElement {
|
|
|
73
82
|
private _mode;
|
|
74
83
|
private _editorHost;
|
|
75
84
|
private _lastExtensionsRef;
|
|
85
|
+
/**
|
|
86
|
+
* The `content` value the current surface was seeded with, and whether that
|
|
87
|
+
* seed is still unconsumed. Both are needed: the value catches the echo, and
|
|
88
|
+
* the latch releases after one `updated()` so a later change back to the same
|
|
89
|
+
* value still lands. Comparing on the value alone suppressed it for the life
|
|
90
|
+
* of the surface, dropping `a` in an `a` -> `b` -> `a` sequence.
|
|
91
|
+
*/
|
|
92
|
+
private _seededContent?;
|
|
93
|
+
private _seedPending;
|
|
94
|
+
/** Pending deferred teardown, cancelled if the element is reattached. */
|
|
95
|
+
private _pendingTeardownTimer;
|
|
76
96
|
/** Sticky latch — once rich is wanted it never reverts. */
|
|
77
97
|
private _richLatched;
|
|
78
98
|
private _upgrading;
|
|
99
|
+
/**
|
|
100
|
+
* The element owns the host's composition listeners for both layers — it
|
|
101
|
+
* gates its own textarea→rich upgrade on this, and pushes the state to the
|
|
102
|
+
* active controller via `setComposing` so rich mode can withhold a recreate.
|
|
103
|
+
* One observer, so the two layers cannot disagree.
|
|
104
|
+
*/
|
|
79
105
|
private _isComposing;
|
|
80
106
|
private _pendingUpgrade;
|
|
81
107
|
/**
|
|
@@ -87,8 +113,13 @@ declare class PromptLineElement extends LitElement {
|
|
|
87
113
|
private _resolveRichReady;
|
|
88
114
|
private _rejectRichReady;
|
|
89
115
|
firstUpdated(): void;
|
|
116
|
+
connectedCallback(): void;
|
|
90
117
|
updated(changed: Map<string | number | symbol, unknown>): void;
|
|
91
118
|
disconnectedCallback(): void;
|
|
119
|
+
/** Destroy the editing surface. Deferred from `disconnectedCallback`. */
|
|
120
|
+
private _teardownSurface;
|
|
121
|
+
/** Mount the editing surface. Runs on first render and on a late reconnect. */
|
|
122
|
+
private _initializeSurface;
|
|
92
123
|
render(): import("lit-html").TemplateResult<1>;
|
|
93
124
|
/** Returns the live Tiptap editor, or `null` in textarea mode. */
|
|
94
125
|
getEditor(): Editor | null;
|
|
@@ -123,6 +154,12 @@ declare class PromptLineElement extends LitElement {
|
|
|
123
154
|
undo(): boolean;
|
|
124
155
|
redo(): boolean;
|
|
125
156
|
private _wantsRich;
|
|
157
|
+
/**
|
|
158
|
+
* Rendered once and then torn down — the element is inert until something
|
|
159
|
+
* re-runs the mount path. Distinct from "not yet rendered", where Lit's own
|
|
160
|
+
* `firstUpdated` still has it.
|
|
161
|
+
*/
|
|
162
|
+
private _isTornDown;
|
|
126
163
|
private _mountEditorHost;
|
|
127
164
|
private _onCompositionStart;
|
|
128
165
|
private _onCompositionEnd;
|
|
@@ -13,7 +13,7 @@ import prefix from '../../../globals/settings.js';
|
|
|
13
13
|
import { adoptOnRoot } from '../../shared/dynamic-css-var-sheet.js';
|
|
14
14
|
import { TextareaController } from './prompt-line-controller.js';
|
|
15
15
|
import { getRichRuntimeIfLoaded, loadRichRuntime } from './prompt-line-rich-loader.js';
|
|
16
|
-
import { getRawText } from './tiptap/json-utils.js';
|
|
16
|
+
import { getRawText, textOffsetToDocPos } from './tiptap/json-utils.js';
|
|
17
17
|
import styles from './prompt-line.scss.js';
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -32,8 +32,16 @@ let PromptLineElement = class PromptLineElement extends LitElement {
|
|
|
32
32
|
* rich editor mounts. These are *staged*, not a rich-mode trigger: setting
|
|
33
33
|
* them while in textarea mode does not load Tiptap. Select rich explicitly
|
|
34
34
|
* with `rich` or call `ensureEditor()`; the upgrade mounts with these
|
|
35
|
-
* already installed.
|
|
36
|
-
*
|
|
35
|
+
* already installed.
|
|
36
|
+
*
|
|
37
|
+
* A new array is compared by value against the set last supplied, so a config
|
|
38
|
+
* update that rebuilds an equivalent one leaves the live editor and its undo
|
|
39
|
+
* history in place, writing any starter `items`/`isOn` through to storage.
|
|
40
|
+
* Only a genuinely different set recreates the editor, preserving content,
|
|
41
|
+
* selection, and focus but resetting history.
|
|
42
|
+
* Extensions built by `buildCarbonExtensions` compare by their source
|
|
43
|
+
* config; anything you supply directly compares by reference, so memoize
|
|
44
|
+
* those (a fresh instance each render reads as a real change).
|
|
37
45
|
*/
|
|
38
46
|
this.extensions = [];
|
|
39
47
|
/**
|
|
@@ -56,9 +64,18 @@ let PromptLineElement = class PromptLineElement extends LitElement {
|
|
|
56
64
|
this._mode = 'textarea';
|
|
57
65
|
this._editorHost = null;
|
|
58
66
|
this._lastExtensionsRef = null;
|
|
67
|
+
this._seedPending = false;
|
|
68
|
+
/** Pending deferred teardown, cancelled if the element is reattached. */
|
|
69
|
+
this._pendingTeardownTimer = null;
|
|
59
70
|
/** Sticky latch — once rich is wanted it never reverts. */
|
|
60
71
|
this._richLatched = false;
|
|
61
72
|
this._upgrading = false;
|
|
73
|
+
/**
|
|
74
|
+
* The element owns the host's composition listeners for both layers — it
|
|
75
|
+
* gates its own textarea→rich upgrade on this, and pushes the state to the
|
|
76
|
+
* active controller via `setComposing` so rich mode can withhold a recreate.
|
|
77
|
+
* One observer, so the two layers cannot disagree.
|
|
78
|
+
*/
|
|
62
79
|
this._isComposing = false;
|
|
63
80
|
this._pendingUpgrade = false;
|
|
64
81
|
/**
|
|
@@ -71,9 +88,11 @@ let PromptLineElement = class PromptLineElement extends LitElement {
|
|
|
71
88
|
this._rejectRichReady = null;
|
|
72
89
|
this._onCompositionStart = () => {
|
|
73
90
|
this._isComposing = true;
|
|
91
|
+
this._controller?.setComposing(true);
|
|
74
92
|
};
|
|
75
93
|
this._onCompositionEnd = () => {
|
|
76
94
|
this._isComposing = false;
|
|
95
|
+
this._controller?.setComposing(false);
|
|
77
96
|
if (this._pendingUpgrade) {
|
|
78
97
|
this._pendingUpgrade = false;
|
|
79
98
|
void this._upgradeToRich();
|
|
@@ -84,28 +103,32 @@ let PromptLineElement = class PromptLineElement extends LitElement {
|
|
|
84
103
|
// Lifecycle
|
|
85
104
|
// ---------------------------------------------------------------------------
|
|
86
105
|
firstUpdated() {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
if (
|
|
92
|
-
//
|
|
93
|
-
//
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
this
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
106
|
+
this._initializeSurface();
|
|
107
|
+
}
|
|
108
|
+
connectedCallback() {
|
|
109
|
+
super.connectedCallback();
|
|
110
|
+
if (this._pendingTeardownTimer !== null) {
|
|
111
|
+
// Reattached before the deferred teardown ran — a move, not an unmount.
|
|
112
|
+
// The controller and its editor host travelled with the element, so the
|
|
113
|
+
// Tiptap instance (and its undo history) survives untouched.
|
|
114
|
+
//
|
|
115
|
+
// Unlike `_teardownSurface`, this deliberately leaves `_isComposing` /
|
|
116
|
+
// `_pendingUpgrade` alone: the host div and its composition listeners are
|
|
117
|
+
// still attached, so a later `compositionend` reaches them and releases
|
|
118
|
+
// whatever was parked. Teardown has to reset eagerly only because it
|
|
119
|
+
// discards the listeners that would otherwise do it.
|
|
120
|
+
clearTimeout(this._pendingTeardownTimer);
|
|
121
|
+
this._pendingTeardownTimer = null;
|
|
122
|
+
const root = this._editorHost?.getRootNode();
|
|
123
|
+
if (root instanceof ShadowRoot || root instanceof Document) {
|
|
124
|
+
adoptOnRoot(root);
|
|
104
125
|
}
|
|
126
|
+
return;
|
|
105
127
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
128
|
+
// Reattached after a real teardown. `firstUpdated` is a one-shot, so
|
|
129
|
+
// without this the element would come back permanently inert.
|
|
130
|
+
if (this._isTornDown()) {
|
|
131
|
+
this._initializeSurface();
|
|
109
132
|
}
|
|
110
133
|
}
|
|
111
134
|
updated(changed) {
|
|
@@ -129,8 +152,17 @@ let PromptLineElement = class PromptLineElement extends LitElement {
|
|
|
129
152
|
if (changed.has('disabled')) {
|
|
130
153
|
this._controller.setEditable(!this.disabled);
|
|
131
154
|
}
|
|
132
|
-
|
|
133
|
-
|
|
155
|
+
// The seed echo is skipped once — re-applying it would emit a spurious
|
|
156
|
+
// host-origin change event. Every later update lands, including one that
|
|
157
|
+
// returns to the seed value, and including one alongside an extensions
|
|
158
|
+
// change (which may no-op or recreate; either way the seed is the previous
|
|
159
|
+
// doc).
|
|
160
|
+
if (changed.has('content')) {
|
|
161
|
+
const echoesSeed = this._seedPending && this.content === this._seededContent;
|
|
162
|
+
this._seedPending = false;
|
|
163
|
+
if (!echoesSeed) {
|
|
164
|
+
this._controller.setContent(this.content ?? '');
|
|
165
|
+
}
|
|
134
166
|
}
|
|
135
167
|
if (changed.has('placeholder')) {
|
|
136
168
|
this._controller.setPlaceholder(this.placeholder);
|
|
@@ -144,12 +176,65 @@ let PromptLineElement = class PromptLineElement extends LitElement {
|
|
|
144
176
|
}
|
|
145
177
|
disconnectedCallback() {
|
|
146
178
|
super.disconnectedCallback();
|
|
179
|
+
if (!this._controller || this._pendingTeardownTimer !== null) {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
// Deferred by a task so a reparent — remove and re-append in the same
|
|
183
|
+
// frame — keeps the live editor instead of destroying and rebuilding it.
|
|
184
|
+
// A macrotask rather than a microtask because the reconnect can be
|
|
185
|
+
// scheduled separately from the removal, and rather than a frame callback
|
|
186
|
+
// because those never fire in a background tab, which would leak the
|
|
187
|
+
// editor of a chat that really was unmounted.
|
|
188
|
+
this._pendingTeardownTimer = setTimeout(() => {
|
|
189
|
+
this._pendingTeardownTimer = null;
|
|
190
|
+
this._teardownSurface();
|
|
191
|
+
}, 0);
|
|
192
|
+
}
|
|
193
|
+
/** Destroy the editing surface. Deferred from `disconnectedCallback`. */
|
|
194
|
+
_teardownSurface() {
|
|
147
195
|
this._failRichReady(new Error('Input is not currently rendered'));
|
|
148
196
|
this._controller?.destroy();
|
|
149
197
|
this._controller = null;
|
|
150
198
|
this._editorHost?.remove();
|
|
151
199
|
this._editorHost = null;
|
|
152
200
|
this._lastExtensionsRef = null;
|
|
201
|
+
// Back to the default surface. `_richLatched` is the sticky flag, so a late
|
|
202
|
+
// reconnect still comes back rich; leaving `_mode` on 'rich' with no
|
|
203
|
+
// controller would just be a field outliving what it describes.
|
|
204
|
+
this._mode = 'textarea';
|
|
205
|
+
// The host div (and its composition listeners) is gone, so a composition
|
|
206
|
+
// that was in flight can never fire its `compositionend`. Left set, these
|
|
207
|
+
// would park the first upgrade after a reattach forever.
|
|
208
|
+
this._isComposing = false;
|
|
209
|
+
this._pendingUpgrade = false;
|
|
210
|
+
}
|
|
211
|
+
/** Mount the editing surface. Runs on first render and on a late reconnect. */
|
|
212
|
+
_initializeSurface() {
|
|
213
|
+
const host = this._mountEditorHost();
|
|
214
|
+
this._lastExtensionsRef = this.extensions;
|
|
215
|
+
this._seededContent = this.content;
|
|
216
|
+
this._seedPending = true;
|
|
217
|
+
this._richLatched = this._wantsRich();
|
|
218
|
+
const warmRuntime = this._richLatched ? getRichRuntimeIfLoaded() : null;
|
|
219
|
+
if (warmRuntime) {
|
|
220
|
+
// Runtime already loaded (e.g. preloaded at boot) — mount rich directly,
|
|
221
|
+
// no textarea flash.
|
|
222
|
+
this._mode = 'rich';
|
|
223
|
+
this._controller = warmRuntime.createRichController();
|
|
224
|
+
this._controller.mount(host, this._makeInit());
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
this._mode = 'textarea';
|
|
228
|
+
this._controller = new TextareaController();
|
|
229
|
+
this._controller.mount(host, this._makeInit());
|
|
230
|
+
if (this._richLatched) {
|
|
231
|
+
void this._upgradeToRich();
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
if (this.autofocus) {
|
|
235
|
+
// Defer so consumer listeners are attached first.
|
|
236
|
+
Promise.resolve().then(() => this._controller?.focus());
|
|
237
|
+
}
|
|
153
238
|
}
|
|
154
239
|
render() {
|
|
155
240
|
return html `
|
|
@@ -238,6 +323,14 @@ let PromptLineElement = class PromptLineElement extends LitElement {
|
|
|
238
323
|
_wantsRich() {
|
|
239
324
|
return this._richLatched || this.rich;
|
|
240
325
|
}
|
|
326
|
+
/**
|
|
327
|
+
* Rendered once and then torn down — the element is inert until something
|
|
328
|
+
* re-runs the mount path. Distinct from "not yet rendered", where Lit's own
|
|
329
|
+
* `firstUpdated` still has it.
|
|
330
|
+
*/
|
|
331
|
+
_isTornDown() {
|
|
332
|
+
return this.hasUpdated && !this._controller;
|
|
333
|
+
}
|
|
241
334
|
_mountEditorHost() {
|
|
242
335
|
const host = document.createElement('div');
|
|
243
336
|
host.setAttribute('slot', 'editor');
|
|
@@ -340,14 +433,14 @@ let PromptLineElement = class PromptLineElement extends LitElement {
|
|
|
340
433
|
previous.destroy();
|
|
341
434
|
this._controller = rich;
|
|
342
435
|
this._mode = 'rich';
|
|
436
|
+
// Seeded losslessly from the textarea's text, which already reflects
|
|
437
|
+
// `content`, so an in-flight identical `content` update stays a no-op.
|
|
438
|
+
this._seededContent = this.content;
|
|
439
|
+
this._seedPending = true;
|
|
343
440
|
rich.mount(host, this._makeInit(value));
|
|
344
|
-
// Map plain-text caret offsets into the seeded doc. `textToDoc` makes one
|
|
345
|
-
// paragraph per line, so a position costs +1 for the doc/first-paragraph
|
|
346
|
-
// start plus +1 for every newline before it (each opens a new paragraph).
|
|
347
|
-
const toDocPos = (offset) => offset + 1 + (value.slice(0, offset).split('\n').length - 1);
|
|
348
441
|
rich.setTextSelection({
|
|
349
|
-
from:
|
|
350
|
-
to:
|
|
442
|
+
from: textOffsetToDocPos(value, selection.from),
|
|
443
|
+
to: textOffsetToDocPos(value, selection.to),
|
|
351
444
|
});
|
|
352
445
|
if (hadFocus) {
|
|
353
446
|
rich.focus();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-line.js","sources":["../../../../src/components/prompt-line/src/prompt-line.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;AAOG;AAqDH,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,UAAU,CAAA;AAA1C,IAAA,WAAA,GAAA;;AAKE;;;;;;;AAOG;QAEH,IAAA,CAAA,UAAU,GAAgB,EAAE;AAS5B;;;;AAIG;QAEH,IAAA,CAAA,IAAI,GAAG,KAAK;;QAIZ,IAAA,CAAA,QAAQ,GAAG,KAAK;;QAIhB,IAAA,CAAA,WAAW,GAAG,EAAE;;QAIP,IAAA,CAAA,SAAS,GAAG,EAAE;;QAIvB,IAAA,CAAA,MAAM,GAAG,EAAE;;QAIF,IAAA,CAAA,SAAS,GAAG,KAAK;QAElB,IAAA,CAAA,WAAW,GAAgC,IAAI;QAC/C,IAAA,CAAA,KAAK,GAAwB,UAAU;QACvC,IAAA,CAAA,WAAW,GAAuB,IAAI;QACtC,IAAA,CAAA,kBAAkB,GAAuB,IAAI;;QAE7C,IAAA,CAAA,YAAY,GAAG,KAAK;QACpB,IAAA,CAAA,UAAU,GAAG,KAAK;QAClB,IAAA,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