@k2b/ui 0.27.0 → 0.28.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 -1
- package/dist/base.css +147 -2
- package/dist/browser/actions/ContextMenu.js +30 -4
- package/dist/browser/actions/ContextMenu.js.map +1 -1
- package/dist/browser/actions/Dropdown.js +184 -158
- package/dist/browser/actions/Dropdown.js.map +1 -1
- package/dist/browser/actions/GestureMenu.js +71 -138
- package/dist/browser/actions/GestureMenu.js.map +1 -1
- package/dist/browser/actions/Toolbar.js +379 -48
- package/dist/browser/actions/Toolbar.js.map +1 -1
- package/dist/browser/actions/index.js.map +1 -1
- package/dist/browser/actions/menu-rows.js +15 -0
- package/dist/browser/actions/menu-rows.js.map +1 -0
- package/dist/browser/actions/menu-sheet.js +154 -0
- package/dist/browser/actions/menu-sheet.js.map +1 -0
- package/dist/browser/actions/toolbar-messages.js +20 -0
- package/dist/browser/actions/toolbar-messages.js.map +1 -0
- package/dist/browser/chart-inspection.js +3 -0
- package/dist/browser/chart-inspection.js.map +1 -0
- package/dist/browser/chat/ChatComposer.js +581 -397
- package/dist/browser/chat/ChatComposer.js.map +1 -1
- package/dist/browser/chat/chat-messages.js +19 -1
- package/dist/browser/chat/chat-messages.js.map +1 -1
- package/dist/browser/chat/command-search.js +3 -0
- package/dist/browser/chat/command-search.js.map +1 -1
- package/dist/browser/chat/index.js +2 -0
- package/dist/browser/chat/index.js.map +1 -1
- package/dist/browser/chat/reaction-people.js +15 -0
- package/dist/browser/chat/reaction-people.js.map +1 -0
- package/dist/browser/content/Chart.js +6 -15
- package/dist/browser/content/Chart.js.map +1 -1
- package/dist/browser/content/ChartSnapshotView.js +7 -10
- package/dist/browser/content/ChartSnapshotView.js.map +1 -1
- package/dist/browser/content/MessageRow.js +330 -448
- package/dist/browser/content/MessageRow.js.map +1 -1
- package/dist/browser/content/ReactionBar.js +419 -0
- package/dist/browser/content/ReactionBar.js.map +1 -0
- package/dist/browser/content/chart-inspection-core.js +557 -0
- package/dist/browser/content/chart-inspection-core.js.map +1 -0
- package/dist/browser/content/chart-inspection.js +10 -445
- package/dist/browser/content/chart-inspection.js.map +1 -1
- package/dist/browser/content/chart-line-gaps.js +1 -1
- package/dist/browser/content/chart-line-gaps.js.map +1 -1
- package/dist/browser/content/chart-snapshot.js +1 -1
- package/dist/browser/content/chart-snapshot.js.map +1 -1
- package/dist/browser/content/index.js +1 -0
- package/dist/browser/content/index.js.map +1 -1
- package/dist/browser/feedback/dialog-core.js +135 -23
- package/dist/browser/feedback/dialog-core.js.map +1 -1
- package/dist/browser/index.js +1 -0
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/input-mode.js +40 -0
- package/dist/browser/input-mode.js.map +1 -0
- package/dist/browser/inputs/FileDropTarget.js +24 -9
- package/dist/browser/inputs/FileDropTarget.js.map +1 -1
- package/dist/browser/inputs/FileInputs.js +2 -2
- package/dist/browser/inputs/FileInputs.js.map +1 -1
- package/dist/browser/inputs/SelectChip.js +9 -0
- package/dist/browser/inputs/SelectChip.js.map +1 -1
- package/dist/browser/inputs/emoji/EmojiPicker.js +13 -0
- package/dist/browser/inputs/emoji/EmojiPicker.js.map +1 -1
- package/dist/browser/inputs/file-drop.js.map +1 -1
- package/dist/browser/layout/DetailPanel.js +283 -197
- package/dist/browser/layout/DetailPanel.js.map +1 -1
- package/dist/browser/layout/Discussion.js +233 -185
- package/dist/browser/layout/Discussion.js.map +1 -1
- package/dist/browser/layout/TableOfContents.js +10 -2
- package/dist/browser/layout/TableOfContents.js.map +1 -1
- package/dist/browser/layout/detail-panel-messages.js +35 -0
- package/dist/browser/layout/detail-panel-messages.js.map +1 -0
- package/dist/browser/surfaces/Avatar.js +50 -20
- package/dist/browser/surfaces/Avatar.js.map +1 -1
- package/dist/browser/surfaces/AvatarStack.js +406 -0
- package/dist/browser/surfaces/AvatarStack.js.map +1 -0
- package/dist/browser/surfaces/avatar-messages.js +8 -2
- package/dist/browser/surfaces/avatar-messages.js.map +1 -1
- package/dist/browser/surfaces/index.js +1 -0
- package/dist/browser/surfaces/index.js.map +1 -1
- package/dist/ssr/actions/ContextMenu.js +21 -3
- package/dist/ssr/actions/ContextMenu.js.map +1 -1
- package/dist/ssr/actions/Dropdown.js +140 -72
- package/dist/ssr/actions/Dropdown.js.map +1 -1
- package/dist/ssr/actions/GestureMenu.js +52 -106
- package/dist/ssr/actions/GestureMenu.js.map +1 -1
- package/dist/ssr/actions/Toolbar.js +294 -14
- package/dist/ssr/actions/Toolbar.js.map +1 -1
- package/dist/ssr/actions/index.js.map +1 -1
- package/dist/ssr/actions/menu-rows.js +15 -0
- package/dist/ssr/actions/menu-rows.js.map +1 -0
- package/dist/ssr/actions/menu-sheet.js +138 -0
- package/dist/ssr/actions/menu-sheet.js.map +1 -0
- package/dist/ssr/actions/toolbar-messages.js +20 -0
- package/dist/ssr/actions/toolbar-messages.js.map +1 -0
- package/dist/ssr/chart-inspection.js +3 -0
- package/dist/ssr/chart-inspection.js.map +1 -0
- package/dist/ssr/chat/ChatComposer.js +263 -89
- package/dist/ssr/chat/ChatComposer.js.map +1 -1
- package/dist/ssr/chat/chat-messages.js +19 -1
- package/dist/ssr/chat/chat-messages.js.map +1 -1
- package/dist/ssr/chat/command-search.js +3 -0
- package/dist/ssr/chat/command-search.js.map +1 -1
- package/dist/ssr/chat/index.js +2 -0
- package/dist/ssr/chat/index.js.map +1 -1
- package/dist/ssr/chat/reaction-people.js +15 -0
- package/dist/ssr/chat/reaction-people.js.map +1 -0
- package/dist/ssr/content/Chart.js +6 -15
- package/dist/ssr/content/Chart.js.map +1 -1
- package/dist/ssr/content/ChartSnapshotView.js +7 -10
- package/dist/ssr/content/ChartSnapshotView.js.map +1 -1
- package/dist/ssr/content/MessageRow.js +98 -152
- package/dist/ssr/content/MessageRow.js.map +1 -1
- package/dist/ssr/content/ReactionBar.js +304 -0
- package/dist/ssr/content/ReactionBar.js.map +1 -0
- package/dist/ssr/content/chart-inspection-core.js +557 -0
- package/dist/ssr/content/chart-inspection-core.js.map +1 -0
- package/dist/ssr/content/chart-inspection.js +10 -445
- package/dist/ssr/content/chart-inspection.js.map +1 -1
- package/dist/ssr/content/chart-line-gaps.js +1 -1
- package/dist/ssr/content/chart-line-gaps.js.map +1 -1
- package/dist/ssr/content/chart-snapshot.js +1 -1
- package/dist/ssr/content/chart-snapshot.js.map +1 -1
- package/dist/ssr/content/index.js +1 -0
- package/dist/ssr/content/index.js.map +1 -1
- package/dist/ssr/feedback/dialog-core.js +135 -23
- package/dist/ssr/feedback/dialog-core.js.map +1 -1
- package/dist/ssr/index.js +1 -0
- package/dist/ssr/index.js.map +1 -1
- package/dist/ssr/input-mode.js +40 -0
- package/dist/ssr/input-mode.js.map +1 -0
- package/dist/ssr/inputs/FileDropTarget.js +17 -5
- package/dist/ssr/inputs/FileDropTarget.js.map +1 -1
- package/dist/ssr/inputs/FileInputs.js +2 -2
- package/dist/ssr/inputs/FileInputs.js.map +1 -1
- package/dist/ssr/inputs/SelectChip.js +9 -0
- package/dist/ssr/inputs/SelectChip.js.map +1 -1
- package/dist/ssr/inputs/emoji/EmojiPicker.js +12 -0
- package/dist/ssr/inputs/emoji/EmojiPicker.js.map +1 -1
- package/dist/ssr/inputs/file-drop.js.map +1 -1
- package/dist/ssr/layout/DetailPanel.js +112 -58
- package/dist/ssr/layout/DetailPanel.js.map +1 -1
- package/dist/ssr/layout/Discussion.js +63 -36
- package/dist/ssr/layout/Discussion.js.map +1 -1
- package/dist/ssr/layout/TableOfContents.js +10 -2
- package/dist/ssr/layout/TableOfContents.js.map +1 -1
- package/dist/ssr/layout/detail-panel-messages.js +35 -0
- package/dist/ssr/layout/detail-panel-messages.js.map +1 -0
- package/dist/ssr/surfaces/Avatar.js +20 -2
- package/dist/ssr/surfaces/Avatar.js.map +1 -1
- package/dist/ssr/surfaces/AvatarStack.js +286 -0
- package/dist/ssr/surfaces/AvatarStack.js.map +1 -0
- package/dist/ssr/surfaces/avatar-messages.js +8 -2
- package/dist/ssr/surfaces/avatar-messages.js.map +1 -1
- package/dist/ssr/surfaces/index.js +1 -0
- package/dist/ssr/surfaces/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/actions/ContextMenu.d.ts +8 -0
- package/dist/types/actions/Dropdown.d.ts +12 -5
- package/dist/types/actions/GestureMenu.d.ts +6 -4
- package/dist/types/actions/Toolbar.d.ts +20 -0
- package/dist/types/actions/index.d.ts +1 -1
- package/dist/types/actions/menu-rows.d.ts +5 -0
- package/dist/types/actions/menu-sheet.d.ts +22 -0
- package/dist/types/actions/toolbar-messages.d.ts +8 -0
- package/dist/types/chart-inspection.d.ts +2 -0
- package/dist/types/chat/ChatComposer.d.ts +7 -0
- package/dist/types/chat/chat-messages.d.ts +10 -2
- package/dist/types/chat/command-search.d.ts +2 -0
- package/dist/types/chat/index.d.ts +2 -0
- package/dist/types/chat/reaction-people.d.ts +9 -0
- package/dist/types/content/Chart.d.ts +2 -2
- package/dist/types/content/MessageRow.d.ts +3 -10
- package/dist/types/content/ReactionBar.d.ts +32 -0
- package/dist/types/content/chart-inspection-core.d.ts +61 -0
- package/dist/types/content/chart-inspection.d.ts +4 -20
- package/dist/types/content/chart-snapshot.d.ts +1 -1
- package/dist/types/content/index.d.ts +2 -1
- package/dist/types/feedback/dialog-core.d.ts +16 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/input-mode.d.ts +7 -0
- package/dist/types/inputs/FileDropTarget.d.ts +6 -3
- package/dist/types/inputs/SelectChip.d.ts +2 -0
- package/dist/types/inputs/file-drop.d.ts +2 -0
- package/dist/types/layout/DetailPanel.d.ts +11 -0
- package/dist/types/layout/Discussion.d.ts +8 -0
- package/dist/types/layout/TableOfContents.d.ts +2 -0
- package/dist/types/layout/detail-panel-messages.d.ts +15 -0
- package/dist/types/surfaces/Avatar.d.ts +12 -0
- package/dist/types/surfaces/AvatarStack.d.ts +41 -0
- package/dist/types/surfaces/avatar-messages.d.ts +3 -0
- package/dist/types/surfaces/index.d.ts +3 -1
- package/package.json +6 -1
|
@@ -26,40 +26,42 @@ var _tmpl$ = /*#__PURE__*/_$template(`<span><strong>`),
|
|
|
26
26
|
_tmpl$1 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__input role=group><!$><!/><textarea rows=1></textarea><!$><!/>`),
|
|
27
27
|
_tmpl$10 = /*#__PURE__*/_$template(`<span>`),
|
|
28
28
|
_tmpl$11 = /*#__PURE__*/_$template(`<small>`),
|
|
29
|
-
_tmpl$12 = /*#__PURE__*/_$template(`<
|
|
30
|
-
_tmpl$13 = /*#__PURE__*/_$template(`<
|
|
31
|
-
_tmpl$14 = /*#__PURE__*/_$template(`<
|
|
32
|
-
_tmpl$15 = /*#__PURE__*/_$template(`<div
|
|
33
|
-
_tmpl$16 = /*#__PURE__*/_$template(`<div role=status><i class="ti ti-
|
|
34
|
-
_tmpl$17 = /*#__PURE__*/_$template(`<div role=status
|
|
35
|
-
_tmpl$18 = /*#__PURE__*/_$template(`<div
|
|
36
|
-
_tmpl$19 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer-
|
|
37
|
-
_tmpl$20 = /*#__PURE__*/_$template(`<div class=k2b-chat-
|
|
38
|
-
_tmpl$21 = /*#__PURE__*/_$template(`<div class=k2b-chat-
|
|
39
|
-
_tmpl$22 = /*#__PURE__*/_$template(`<div class=k2b-chat-
|
|
40
|
-
_tmpl$23 = /*#__PURE__*/_$template(`<div class=k2b-chat-
|
|
41
|
-
_tmpl$24 = /*#__PURE__*/_$template(`<div class=k2b-chat-
|
|
42
|
-
_tmpl$25 = /*#__PURE__*/_$template(`<
|
|
43
|
-
_tmpl$26 = /*#__PURE__*/_$template(`<
|
|
44
|
-
_tmpl$27 = /*#__PURE__*/_$template(`<
|
|
45
|
-
_tmpl$28 = /*#__PURE__*/_$template(`<
|
|
46
|
-
_tmpl$29 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__command-
|
|
47
|
-
_tmpl$30 = /*#__PURE__*/_$template(`<
|
|
48
|
-
_tmpl$31 = /*#__PURE__*/_$template(`<span class=k2b-chat-
|
|
49
|
-
_tmpl$32 = /*#__PURE__*/_$template(`<
|
|
50
|
-
_tmpl$33 = /*#__PURE__*/_$template(`<button type=button class=k2b-chat-
|
|
51
|
-
_tmpl$34 = /*#__PURE__*/_$template(`<
|
|
52
|
-
_tmpl$35 = /*#__PURE__*/_$template(`<
|
|
53
|
-
_tmpl$36 = /*#__PURE__*/_$template(`<
|
|
54
|
-
_tmpl$37 = /*#__PURE__*/_$template(`<
|
|
55
|
-
_tmpl$38 = /*#__PURE__*/_$template(`<
|
|
56
|
-
_tmpl$39 = /*#__PURE__*/_$template(`<
|
|
57
|
-
_tmpl$40 = /*#__PURE__*/_$template(`<
|
|
58
|
-
_tmpl$41 = /*#__PURE__*/_$template(`<div class=k2b-chat-
|
|
59
|
-
_tmpl$42 = /*#__PURE__*/_$template(`<div class=k2b-chat-
|
|
60
|
-
_tmpl$43 = /*#__PURE__*/_$template(`<
|
|
29
|
+
_tmpl$12 = /*#__PURE__*/_$template(`<span class=k2b-chat-composer__command-end><i class="ti ti-check"aria-hidden=true></i><span class=k2b-sr-only>`),
|
|
30
|
+
_tmpl$13 = /*#__PURE__*/_$template(`<button class=k2b-chat-composer__command type=button role=option tabindex=-1><i aria-hidden=true></i><span class=k2b-chat-composer__command-text><strong></strong><!$><!/></span><!$><!/>`),
|
|
31
|
+
_tmpl$14 = /*#__PURE__*/_$template(`<b>`),
|
|
32
|
+
_tmpl$15 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer-accessory><div class=k2b-chat-composer__commands role=listbox>`),
|
|
33
|
+
_tmpl$16 = /*#__PURE__*/_$template(`<div role=status class=k2b-chat-composer__loading><i class="ti ti-loader-2 k2b-spin"aria-hidden=true></i><strong>`),
|
|
34
|
+
_tmpl$17 = /*#__PURE__*/_$template(`<div role=status><i class="ti ti-alert-circle"></i> <!$><!/>`),
|
|
35
|
+
_tmpl$18 = /*#__PURE__*/_$template(`<div role=status>`),
|
|
36
|
+
_tmpl$19 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer-accessory data-commands><div class=k2b-chat-composer__commands role=listbox><!$><!/><!$><!/><!$><!/><!$><!/>`),
|
|
37
|
+
_tmpl$20 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer-slot><div></div><!$><!/><!$><!/>`),
|
|
38
|
+
_tmpl$21 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__hint aria-live=polite>`),
|
|
39
|
+
_tmpl$22 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__attachments role=list tabindex=0>`),
|
|
40
|
+
_tmpl$23 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__error role=alert><i class="ti ti-alert-circle"aria-hidden=true></i><!$><!/>`),
|
|
41
|
+
_tmpl$24 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__row><!$><!/><!$><!/><div class=k2b-chat-composer__field><!$><!/><div class=k2b-chat-composer__field-tools><!$><!/><!$><!/><!$><!/></div></div><!$><!/>`),
|
|
42
|
+
_tmpl$25 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer-shell><!$><!/><section role=group><!$><!/><!$><!/><!$><!/><!$><!/></section><div class=k2b-sr-only role=status aria-live=polite></div><div class=k2b-chat-composer__status role=status><!$><!/><!$><!/>`),
|
|
43
|
+
_tmpl$26 = /*#__PURE__*/_$template(`<button type=button role=option tabindex=-1><span class=k2b-chat-composer__emoji-glyph aria-hidden=true></span><strong></strong><!$><!/>`),
|
|
44
|
+
_tmpl$27 = /*#__PURE__*/_$template(`<small>:<!$><!/>:`),
|
|
45
|
+
_tmpl$28 = /*#__PURE__*/_$template(`<i class="ti ti-loader-2 k2b-spin"aria-hidden=true>`),
|
|
46
|
+
_tmpl$29 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__command-placeholder aria-hidden=true><span></span><span><span></span><span>`),
|
|
47
|
+
_tmpl$30 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__command-group role=group><div class=k2b-chat-composer__command-heading role=presentation><span></span><!$><!/></div><!$><!/><!$><!/>`),
|
|
48
|
+
_tmpl$31 = /*#__PURE__*/_$template(`<span class=k2b-chat-composer__hint-text>`),
|
|
49
|
+
_tmpl$32 = /*#__PURE__*/_$template(`<span class=k2b-chat-composer__dictation><i aria-hidden=true></i><span>`),
|
|
50
|
+
_tmpl$33 = /*#__PURE__*/_$template(`<button type=button class=k2b-chat-composer__hint-action>`),
|
|
51
|
+
_tmpl$34 = /*#__PURE__*/_$template(`<button type=button class=k2b-chat-composer__attachment-remove><i class="ti ti-x"aria-hidden=true>`),
|
|
52
|
+
_tmpl$35 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__attachment role=listitem><div class=k2b-chat-composer__attachment-content><!$><!/><!$><!/></div><!$><!/>`),
|
|
53
|
+
_tmpl$36 = /*#__PURE__*/_$template(`<img>`),
|
|
54
|
+
_tmpl$37 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__attachment-identity><!$><!/><!$><!/>`),
|
|
55
|
+
_tmpl$38 = /*#__PURE__*/_$template(`<a class=k2b-chat-composer__attachment-link target=_blank rel="noopener noreferrer"><!$><!/><!$><!/>`),
|
|
56
|
+
_tmpl$39 = /*#__PURE__*/_$template(`<button type=button class=k2b-chat-composer__attachment-action><!$><!/><!$><!/>`),
|
|
57
|
+
_tmpl$40 = /*#__PURE__*/_$template(`<footer class=k2b-chat-composer__footer>`),
|
|
58
|
+
_tmpl$41 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__tools><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/>`),
|
|
59
|
+
_tmpl$42 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__submit><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/>`),
|
|
60
|
+
_tmpl$43 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__status-line><i aria-hidden=true></i><span>`),
|
|
61
|
+
_tmpl$44 = /*#__PURE__*/_$template(`<span class=k2b-sr-only>`);
|
|
61
62
|
import { batch, children, createEffect, createMemo, createSignal, createUniqueId, For, onCleanup, onMount, Show, untrack } from "solid-js";
|
|
62
63
|
import { Dropdown } from "../actions/Dropdown";
|
|
64
|
+
import { dialogHistorySettled, holdDialogHistory } from "../feedback/dialog-core";
|
|
63
65
|
import { Tooltip } from "../feedback/Tooltip";
|
|
64
66
|
import { replaceTextareaRange } from "../inputs/editor-dom";
|
|
65
67
|
import { completedEmojiShortcode, emojiInTone, emojiName, emojiShortcodeQuery, loadEmojiIndex, suggestEmoji } from "../inputs/emoji/emoji-index";
|
|
@@ -121,12 +123,40 @@ const isTouchOnly = () => typeof matchMedia === "function" && matchMedia(touchOn
|
|
|
121
123
|
const microphoneHoldMs = 500;
|
|
122
124
|
/** Keeps the field focused (and a phone's keyboard open) when a composer button is pressed with a mouse or finger. */
|
|
123
125
|
const keepFieldFocus = event => event.preventDefault();
|
|
126
|
+
/**
|
|
127
|
+
* Keeps one tap from reaching the page: its pointer, touch and mouse events stop at the window, and neither focus nor a
|
|
128
|
+
* click happens. A finger's tap ends with `touchend`, a scroll with `pointercancel`, a mouse's press with `click`.
|
|
129
|
+
*/
|
|
130
|
+
const swallowTap = down => {
|
|
131
|
+
const blocked = ["pointerup", "pointercancel", "touchstart", "touchend", "mousedown", "mouseup", "click", "contextmenu"];
|
|
132
|
+
const stop = () => {
|
|
133
|
+
window.removeEventListener("pointerdown", next, true);
|
|
134
|
+
for (const type of blocked) window.removeEventListener(type, block, true);
|
|
135
|
+
};
|
|
136
|
+
const block = event => {
|
|
137
|
+
event.stopPropagation();
|
|
138
|
+
if (event.type !== "pointercancel" && event.type !== "touchstart" && event.type !== "pointerup") event.preventDefault();
|
|
139
|
+
if (event.type === "click" || event.type === "touchend" || event.type === "pointercancel") stop();
|
|
140
|
+
};
|
|
141
|
+
// The next press is a new gesture, whatever became of this one.
|
|
142
|
+
const next = event => {
|
|
143
|
+
if (event !== down) stop();
|
|
144
|
+
};
|
|
145
|
+
down.stopPropagation();
|
|
146
|
+
down.preventDefault();
|
|
147
|
+
window.addEventListener("pointerdown", next, true);
|
|
148
|
+
for (const type of blocked) window.addEventListener(type, block, {
|
|
149
|
+
capture: true,
|
|
150
|
+
passive: false
|
|
151
|
+
});
|
|
152
|
+
};
|
|
124
153
|
const attachmentIcon = attachment => attachment.icon ?? (attachment.kind === "image" ? "ti ti-photo" : attachment.kind === "resource" ? "ti ti-link" : "ti ti-file");
|
|
125
154
|
const hasContent = items => items.some(item => item != null && typeof item !== "boolean" && item !== "");
|
|
126
155
|
export function ChatComposer(props) {
|
|
127
156
|
const accessory = children(() => props.accessory);
|
|
128
157
|
const hasAccessory = () => hasContent(accessory.toArray());
|
|
129
158
|
const hint = children(() => props.hint);
|
|
159
|
+
const footer = children(() => props.footerContent);
|
|
130
160
|
const messages = useUiMessages();
|
|
131
161
|
const markdownToolbarMessages = useMarkdownToolbarMessages();
|
|
132
162
|
const chatMessages = useChatMessages();
|
|
@@ -147,6 +177,7 @@ export function ChatComposer(props) {
|
|
|
147
177
|
const [closedAt, setClosedAt] = createSignal();
|
|
148
178
|
// Where the pending native edit starts; a selection replaced as a whole starts at its beginning.
|
|
149
179
|
let inputStart;
|
|
180
|
+
let inputEnd;
|
|
150
181
|
const [commandStatus, setCommandStatus] = createSignal();
|
|
151
182
|
const [announcement, setAnnouncement] = createSignal();
|
|
152
183
|
let statusTimer;
|
|
@@ -165,6 +196,7 @@ export function ChatComposer(props) {
|
|
|
165
196
|
});
|
|
166
197
|
const [addingFiles, setAddingFiles] = createSignal(false);
|
|
167
198
|
const [submitting, setSubmitting] = createSignal(false);
|
|
199
|
+
let shellRef;
|
|
168
200
|
let composerRef;
|
|
169
201
|
let textareaRef;
|
|
170
202
|
let fileInputRef;
|
|
@@ -192,6 +224,45 @@ export function ChatComposer(props) {
|
|
|
192
224
|
const [searching, setSearching] = createSignal(false);
|
|
193
225
|
const [searchError, setSearchError] = createSignal(false);
|
|
194
226
|
const [executing, setExecuting] = createSignal(false);
|
|
227
|
+
const [modelOpen, setModelOpen] = createSignal();
|
|
228
|
+
const [choosingModel, setChoosingModel] = createSignal(false);
|
|
229
|
+
let resolveModel;
|
|
230
|
+
const finishModelSelection = id => {
|
|
231
|
+
const resolve = resolveModel;
|
|
232
|
+
resolveModel = undefined;
|
|
233
|
+
if (choosingModel()) {
|
|
234
|
+
setModelOpen(false);
|
|
235
|
+
// Let the controlled close reach Dropdown before returning normal clicks to its own state.
|
|
236
|
+
queueMicrotask(() => {
|
|
237
|
+
if (!choosingModel()) setModelOpen(undefined);
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
setChoosingModel(false);
|
|
241
|
+
resolve?.(id);
|
|
242
|
+
};
|
|
243
|
+
const blockedBesidesCommand = () => Boolean(props.disabled || stopping() || state() === "submitting" || addingFiles() || submitting());
|
|
244
|
+
const usableModelControl = () => !conversation() && !footer() && !blockedBesidesCommand() && !running() && Boolean(props.models?.length && props.onModelChange);
|
|
245
|
+
const openModelSelection = () => {
|
|
246
|
+
if (!usableModelControl()) return Promise.resolve(null);
|
|
247
|
+
finishModelSelection(null);
|
|
248
|
+
return new Promise(resolve => {
|
|
249
|
+
resolveModel = resolve;
|
|
250
|
+
setChoosingModel(true);
|
|
251
|
+
setModelOpen(true);
|
|
252
|
+
queueMicrotask(() => {
|
|
253
|
+
if (!choosingModel() || !modelOpen()) return;
|
|
254
|
+
// Start on the current model, as a click on the chip would show it checked.
|
|
255
|
+
const menu = composerRef?.querySelector(".k2b-chat-composer__model");
|
|
256
|
+
(menu?.querySelector('[role="menuitemradio"][aria-checked="true"]:not(:disabled)') ?? menu?.querySelector('[role="menuitemradio"]:not(:disabled)'))?.focus();
|
|
257
|
+
});
|
|
258
|
+
});
|
|
259
|
+
};
|
|
260
|
+
createEffect(() => {
|
|
261
|
+
if (!usableModelControl()) finishModelSelection(null);
|
|
262
|
+
});
|
|
263
|
+
onCleanup(() => finishModelSelection(null));
|
|
264
|
+
const [commandOpening, setCommandOpening] = createSignal(0);
|
|
265
|
+
let retrySearch = false;
|
|
195
266
|
let highlightRef;
|
|
196
267
|
let commandListRef;
|
|
197
268
|
const mentions = () => props.mentions ?? [];
|
|
@@ -225,6 +296,12 @@ export function ChatComposer(props) {
|
|
|
225
296
|
const token = caretCommandToken();
|
|
226
297
|
return dismissed() || composing() || token?.start === closedAt() ? null : token;
|
|
227
298
|
});
|
|
299
|
+
const openingStart = createMemo(() => commandQuery()?.start);
|
|
300
|
+
createEffect(() => {
|
|
301
|
+
props.draftKey;
|
|
302
|
+
const start = openingStart();
|
|
303
|
+
if (start !== undefined) setCommandOpening(opening => opening + 1);
|
|
304
|
+
});
|
|
228
305
|
const parsedCommandQuery = createMemo(() => parseChatCommandQuery(commandQuery()?.query ?? "", props.commandScopes ?? []));
|
|
229
306
|
const currentCommandScope = createMemo(() => parsedCommandQuery().scope?.id);
|
|
230
307
|
createEffect(() => {
|
|
@@ -253,20 +330,45 @@ export function ChatComposer(props) {
|
|
|
253
330
|
setCommandMoved(false);
|
|
254
331
|
});
|
|
255
332
|
const commandsOpen = () => Boolean(!emojiOpen() && commandQuery() && (localCommands().length || props.searchCommands));
|
|
333
|
+
const commandSheetHeld = createMemo(() => commandsOpen() && isTouchOnly());
|
|
334
|
+
createEffect(() => {
|
|
335
|
+
if (!commandSheetHeld()) return;
|
|
336
|
+
onCleanup(holdDialogHistory(() => setClosedAt(commandQuery()?.start)));
|
|
337
|
+
});
|
|
256
338
|
const suggestionsOpen = () => commandsOpen() || emojiOpen();
|
|
257
339
|
createEffect(() => {
|
|
258
340
|
if (!suggestionsOpen()) return;
|
|
259
341
|
let disposed = false;
|
|
260
342
|
const measure = () => {
|
|
261
343
|
if (disposed || !commandListRef) return;
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
344
|
+
const accessory = commandListRef.parentElement;
|
|
345
|
+
const viewportTop = window.visualViewport?.offsetTop ?? 0;
|
|
346
|
+
let top = viewportTop;
|
|
347
|
+
// The column a phone sheet spans: the nearest ancestor that clips sideways, or the page.
|
|
348
|
+
let column;
|
|
349
|
+
for (let parent = accessory.parentElement; parent; parent = parent.parentElement) {
|
|
350
|
+
const style = window.getComputedStyle(parent);
|
|
351
|
+
if (/(auto|scroll|hidden|clip)/.test(style.overflowY)) {
|
|
265
352
|
top = Math.max(top, parent.getBoundingClientRect().top);
|
|
266
353
|
}
|
|
354
|
+
if (!column && /(auto|scroll|hidden|clip)/.test(style.overflowX)) {
|
|
355
|
+
const left = parent.getBoundingClientRect().left + parent.clientLeft;
|
|
356
|
+
column = {
|
|
357
|
+
left,
|
|
358
|
+
right: left + parent.clientWidth
|
|
359
|
+
};
|
|
360
|
+
}
|
|
267
361
|
}
|
|
268
|
-
const
|
|
362
|
+
const page = document.documentElement.clientWidth;
|
|
363
|
+
const left = Math.max(0, column?.left ?? 0);
|
|
364
|
+
const right = Math.min(page, column?.right ?? page);
|
|
365
|
+
const slot = accessory.parentElement.getBoundingClientRect();
|
|
366
|
+
const bottom = accessory.getBoundingClientRect().bottom;
|
|
269
367
|
commandListRef.style.setProperty("--k2b-chat-command-space", `${Math.max(40, bottom - top - 8)}px`);
|
|
368
|
+
// Only a list that reaches the screen's top edge keeps clear of a notch or the status bar.
|
|
369
|
+
commandListRef.style.setProperty("--k2b-chat-command-safe-top", top === viewportTop ? "env(safe-area-inset-top, 0px)" : "0px");
|
|
370
|
+
accessory.style.setProperty("--k2b-chat-command-reach-left", `${Math.max(0, slot.left - left)}px`);
|
|
371
|
+
accessory.style.setProperty("--k2b-chat-command-reach-right", `${Math.max(0, right - slot.right)}px`);
|
|
270
372
|
};
|
|
271
373
|
queueMicrotask(measure);
|
|
272
374
|
window.addEventListener("resize", measure);
|
|
@@ -279,6 +381,20 @@ export function ChatComposer(props) {
|
|
|
279
381
|
window.visualViewport?.removeEventListener("resize", measure);
|
|
280
382
|
});
|
|
281
383
|
});
|
|
384
|
+
// A press outside the command list and the field closes the list, as Escape does; the text stays. With a mouse or a
|
|
385
|
+
// trackpad the press then acts as usual. On a touch-only device a tap outside the composer closes only the list: it
|
|
386
|
+
// reaches nothing beneath, and the field keeps focus, so the keyboard stays open.
|
|
387
|
+
createEffect(() => {
|
|
388
|
+
if (!commandsOpen()) return;
|
|
389
|
+
const onPointerDown = event => {
|
|
390
|
+
const target = event.target;
|
|
391
|
+
if (!(target instanceof Node) || commandListRef?.contains(target) || textareaRef?.parentElement?.contains(target)) return;
|
|
392
|
+
setClosedAt(commandQuery()?.start);
|
|
393
|
+
if (isTouchOnly() && !shellRef?.contains(target)) swallowTap(event);
|
|
394
|
+
};
|
|
395
|
+
window.addEventListener("pointerdown", onPointerDown, true);
|
|
396
|
+
onCleanup(() => window.removeEventListener("pointerdown", onPointerDown, true));
|
|
397
|
+
});
|
|
282
398
|
createEffect(() => {
|
|
283
399
|
props.draftKey;
|
|
284
400
|
const token = commandQuery();
|
|
@@ -287,12 +403,17 @@ export function ChatComposer(props) {
|
|
|
287
403
|
setSearching(false);
|
|
288
404
|
return;
|
|
289
405
|
}
|
|
406
|
+
running();
|
|
290
407
|
const parsed = parsedCommandQuery();
|
|
408
|
+
const opening = commandOpening();
|
|
291
409
|
const abort = new AbortController();
|
|
292
410
|
setSearching(true);
|
|
411
|
+
const delay = retrySearch ? 0 : 120;
|
|
412
|
+
retrySearch = false;
|
|
293
413
|
const timer = setTimeout(() => {
|
|
294
414
|
Promise.resolve().then(() => props.searchCommands(parsed.query, abort.signal, {
|
|
295
|
-
scope: parsed.scope?.id
|
|
415
|
+
scope: parsed.scope?.id,
|
|
416
|
+
opening
|
|
296
417
|
})).then(results => {
|
|
297
418
|
if (!abort.signal.aborted) {
|
|
298
419
|
batch(() => {
|
|
@@ -310,7 +431,7 @@ export function ChatComposer(props) {
|
|
|
310
431
|
}).finally(() => {
|
|
311
432
|
if (!abort.signal.aborted) setSearching(false);
|
|
312
433
|
});
|
|
313
|
-
},
|
|
434
|
+
}, delay);
|
|
314
435
|
onCleanup(() => {
|
|
315
436
|
clearTimeout(timer);
|
|
316
437
|
abort.abort();
|
|
@@ -369,6 +490,7 @@ export function ChatComposer(props) {
|
|
|
369
490
|
untrack(() => {
|
|
370
491
|
history.length = 0;
|
|
371
492
|
historyIndex = -1;
|
|
493
|
+
finishModelSelection(null);
|
|
372
494
|
setDismissed(true);
|
|
373
495
|
setClosedAt(undefined);
|
|
374
496
|
setSearchResults([]);
|
|
@@ -394,6 +516,13 @@ export function ChatComposer(props) {
|
|
|
394
516
|
};
|
|
395
517
|
const edit = (value, nextMentions = reconcileChatMentions(props.value, value, mentions())) => {
|
|
396
518
|
if (commandStatus()?.tone === "error") showCommandStatus();
|
|
519
|
+
// Replacing `/` can leave its position and query identical, but starts a new opening.
|
|
520
|
+
if (inputStart !== undefined && inputEnd !== undefined && props.value.slice(inputStart, inputEnd).includes("/")) {
|
|
521
|
+
setCommandOpening(opening => opening + 1);
|
|
522
|
+
setSearchResults([]);
|
|
523
|
+
setSearchResultsQuery(undefined);
|
|
524
|
+
setCommandMoved(false);
|
|
525
|
+
}
|
|
397
526
|
// An edit that starts at or before the closed `/` (select all, then type `/`) replaces it; the new `/` may open again.
|
|
398
527
|
const closed = closedAt();
|
|
399
528
|
if (closed !== undefined) {
|
|
@@ -402,6 +531,7 @@ export function ChatComposer(props) {
|
|
|
402
531
|
if (Math.min(same, inputStart ?? same) <= closed) setClosedAt(undefined);
|
|
403
532
|
}
|
|
404
533
|
inputStart = undefined;
|
|
534
|
+
inputEnd = undefined;
|
|
405
535
|
record();
|
|
406
536
|
props.onValueChange(value);
|
|
407
537
|
props.onMentionsChange?.(nextMentions);
|
|
@@ -445,7 +575,9 @@ export function ChatComposer(props) {
|
|
|
445
575
|
/** The conversation field stays editable while a message is sent, so it keeps the focus and a phone its keyboard. */
|
|
446
576
|
const editBlocked = () => conversation() ? busy() : blocked();
|
|
447
577
|
const hasDraft = () => Boolean(props.value.trim() || !running() && attachments().length > 0);
|
|
448
|
-
|
|
578
|
+
/** The draft may go out now, apart from a submission that is already on its way. */
|
|
579
|
+
const submittable = () => !busy() && hasDraft() && !(running() && runningSubmitIntent() === "steer" && mentions().length);
|
|
580
|
+
const canSubmit = () => !submitting() && submittable();
|
|
449
581
|
const canSelectFiles = () => Boolean(props.fileSelection && !props.fileSelection.disabled && !running() && !blocked());
|
|
450
582
|
const hasAddMenu = () => Boolean(props.fileSelection || props.menuActions?.length);
|
|
451
583
|
const hasContextUsage = () => {
|
|
@@ -571,18 +703,26 @@ export function ChatComposer(props) {
|
|
|
571
703
|
};
|
|
572
704
|
const submit = async () => {
|
|
573
705
|
if (!canSubmit()) return;
|
|
574
|
-
const
|
|
575
|
-
const previousValue = props.value;
|
|
576
|
-
const previousAttachments = attachments();
|
|
577
|
-
const previousMentions = mentions();
|
|
578
|
-
const input = {
|
|
579
|
-
intent,
|
|
580
|
-
text: previousValue,
|
|
581
|
-
mentions: previousMentions,
|
|
582
|
-
attachments: intent !== "steer" ? previousAttachments : []
|
|
583
|
-
};
|
|
706
|
+
const key = props.draftKey;
|
|
584
707
|
setSubmitting(true);
|
|
585
708
|
try {
|
|
709
|
+
if (isTouchOnly()) {
|
|
710
|
+
if (commandSheetHeld()) setClosedAt(commandQuery()?.start);
|
|
711
|
+
// The sheet's Back entry leaves first, so a submit handler that navigates finds the history settled.
|
|
712
|
+
await dialogHistorySettled();
|
|
713
|
+
// A draft that another one replaced, or that may no longer go out, is not sent and keeps its text.
|
|
714
|
+
if (disposed || props.draftKey !== key || !submittable()) return;
|
|
715
|
+
}
|
|
716
|
+
const intent = running() ? runningSubmitIntent() : "send";
|
|
717
|
+
const previousValue = props.value;
|
|
718
|
+
const previousAttachments = attachments();
|
|
719
|
+
const previousMentions = mentions();
|
|
720
|
+
const input = {
|
|
721
|
+
intent,
|
|
722
|
+
text: previousValue,
|
|
723
|
+
mentions: previousMentions,
|
|
724
|
+
attachments: intent !== "steer" ? previousAttachments : []
|
|
725
|
+
};
|
|
586
726
|
await runChatSubmission({
|
|
587
727
|
clear: () => {
|
|
588
728
|
props.onValueChange("");
|
|
@@ -625,6 +765,7 @@ export function ChatComposer(props) {
|
|
|
625
765
|
};
|
|
626
766
|
const executeCommand = async (command, tab = false) => {
|
|
627
767
|
const token = commandQuery();
|
|
768
|
+
const heldHistory = commandSheetHeld();
|
|
628
769
|
if (!token || blocked()) return;
|
|
629
770
|
if (command.disabled || command.reason) {
|
|
630
771
|
// A new object each time, so choosing the same row again inserts and announces its reason again.
|
|
@@ -633,6 +774,11 @@ export function ChatComposer(props) {
|
|
|
633
774
|
} : undefined);
|
|
634
775
|
return;
|
|
635
776
|
}
|
|
777
|
+
if (command.searchAgain) {
|
|
778
|
+
retrySearch = true;
|
|
779
|
+
setCommandOpening(opening => opening + 1);
|
|
780
|
+
return;
|
|
781
|
+
}
|
|
636
782
|
if (command.scope && (tab || !command.action && !command.mention) && narrowCommand(command)) return;
|
|
637
783
|
const previous = snapshot();
|
|
638
784
|
const key = props.draftKey;
|
|
@@ -668,12 +814,19 @@ export function ChatComposer(props) {
|
|
|
668
814
|
text: command.busyLabel
|
|
669
815
|
} : undefined);
|
|
670
816
|
try {
|
|
817
|
+
// The sheet's Back entry leaves first, so an action that navigates or opens a dialog finds the history settled.
|
|
818
|
+
if (heldHistory && command.action) {
|
|
819
|
+
await dialogHistorySettled();
|
|
820
|
+
// Another draft or no composer any more: the command does not run against it.
|
|
821
|
+
if (disposed || props.draftKey !== key) return;
|
|
822
|
+
}
|
|
671
823
|
const result = await command.action?.({
|
|
672
824
|
setValue: value => edit(value),
|
|
673
825
|
submit: () => {
|
|
674
826
|
submitRequested = true;
|
|
675
827
|
},
|
|
676
|
-
focus
|
|
828
|
+
focus,
|
|
829
|
+
openModelSelection
|
|
677
830
|
});
|
|
678
831
|
if (result === "cancelled") {
|
|
679
832
|
submitRequested = false;
|
|
@@ -1282,6 +1435,7 @@ export function ChatComposer(props) {
|
|
|
1282
1435
|
_el$22.$$keydown = onKeyDown;
|
|
1283
1436
|
_el$22.$$beforeinput = event => {
|
|
1284
1437
|
inputStart = event.currentTarget.selectionStart;
|
|
1438
|
+
inputEnd = event.currentTarget.selectionEnd;
|
|
1285
1439
|
if (event.inputType === "historyUndo" || event.inputType === "historyRedo") {
|
|
1286
1440
|
event.preventDefault();
|
|
1287
1441
|
restoreHistory(event.inputType === "historyUndo" ? -1 : 1);
|
|
@@ -1380,17 +1534,19 @@ export function ChatComposer(props) {
|
|
|
1380
1534
|
const highlight = () => commandRowMap().get(command)?.highlight;
|
|
1381
1535
|
const title = () => command.label ?? command.name;
|
|
1382
1536
|
return (() => {
|
|
1383
|
-
var _el$29 = _$getNextElement(_tmpl$
|
|
1537
|
+
var _el$29 = _$getNextElement(_tmpl$13),
|
|
1384
1538
|
_el$30 = _el$29.firstChild,
|
|
1385
1539
|
_el$31 = _el$30.nextSibling,
|
|
1386
1540
|
_el$32 = _el$31.firstChild,
|
|
1387
1541
|
_el$34 = _el$32.nextSibling,
|
|
1388
|
-
[_el$35, _co$6] = _$getNextMarker(_el$34.nextSibling)
|
|
1542
|
+
[_el$35, _co$6] = _$getNextMarker(_el$34.nextSibling),
|
|
1543
|
+
_el$39 = _el$31.nextSibling,
|
|
1544
|
+
[_el$40, _co$7] = _$getNextMarker(_el$39.nextSibling);
|
|
1389
1545
|
_el$29.$$click = event => {
|
|
1390
1546
|
event.preventDefault();
|
|
1391
1547
|
void executeCommand(command);
|
|
1392
1548
|
};
|
|
1393
|
-
_el$29.$$
|
|
1549
|
+
_el$29.$$mousedown = keepFieldFocus;
|
|
1394
1550
|
_$insert(_el$32, _$createComponent(Show, {
|
|
1395
1551
|
get when() {
|
|
1396
1552
|
return highlight();
|
|
@@ -1399,9 +1555,9 @@ export function ChatComposer(props) {
|
|
|
1399
1555
|
return title();
|
|
1400
1556
|
},
|
|
1401
1557
|
children: range => [_$memo(() => title().slice(0, range()[0])), (() => {
|
|
1402
|
-
var _el$
|
|
1403
|
-
_$insert(_el$
|
|
1404
|
-
return _el$
|
|
1558
|
+
var _el$41 = _$getNextElement(_tmpl$14);
|
|
1559
|
+
_$insert(_el$41, () => title().slice(range()[0], range()[1]));
|
|
1560
|
+
return _el$41;
|
|
1405
1561
|
})(), _$memo(() => title().slice(range()[1]))]
|
|
1406
1562
|
}));
|
|
1407
1563
|
_$insert(_el$31, _$createComponent(Show, {
|
|
@@ -1415,6 +1571,18 @@ export function ChatComposer(props) {
|
|
|
1415
1571
|
return _el$33;
|
|
1416
1572
|
}
|
|
1417
1573
|
}), _el$35, _co$6);
|
|
1574
|
+
_$insert(_el$29, _$createComponent(Show, {
|
|
1575
|
+
get when() {
|
|
1576
|
+
return command.selected;
|
|
1577
|
+
},
|
|
1578
|
+
get children() {
|
|
1579
|
+
var _el$36 = _$getNextElement(_tmpl$12),
|
|
1580
|
+
_el$37 = _el$36.firstChild,
|
|
1581
|
+
_el$38 = _el$37.nextSibling;
|
|
1582
|
+
_$insert(_el$38, () => chatMessages().commandSelected);
|
|
1583
|
+
return _el$36;
|
|
1584
|
+
}
|
|
1585
|
+
}), _el$40, _co$7);
|
|
1418
1586
|
_$effect(_p$ => {
|
|
1419
1587
|
var _v$12 = commandOptionId(command),
|
|
1420
1588
|
_v$13 = selectedCommand() === command,
|
|
@@ -1445,83 +1613,85 @@ export function ChatComposer(props) {
|
|
|
1445
1613
|
})();
|
|
1446
1614
|
};
|
|
1447
1615
|
return (() => {
|
|
1448
|
-
var _el$
|
|
1449
|
-
_el$
|
|
1450
|
-
[_el$
|
|
1451
|
-
_el$
|
|
1452
|
-
_el$
|
|
1453
|
-
[_el$
|
|
1454
|
-
_el$
|
|
1455
|
-
[_el$
|
|
1456
|
-
_el$93 = _el$92.nextSibling,
|
|
1457
|
-
[_el$94, _co$22] = _$getNextMarker(_el$93.nextSibling),
|
|
1458
|
-
_el$95 = _el$94.nextSibling,
|
|
1459
|
-
[_el$96, _co$23] = _$getNextMarker(_el$95.nextSibling),
|
|
1460
|
-
_el$97 = _el$65.nextSibling,
|
|
1616
|
+
var _el$42 = _$getNextElement(_tmpl$25),
|
|
1617
|
+
_el$108 = _el$42.firstChild,
|
|
1618
|
+
[_el$109, _co$27] = _$getNextMarker(_el$108.nextSibling),
|
|
1619
|
+
_el$70 = _el$109.nextSibling,
|
|
1620
|
+
_el$94 = _el$70.firstChild,
|
|
1621
|
+
[_el$95, _co$21] = _$getNextMarker(_el$94.nextSibling),
|
|
1622
|
+
_el$96 = _el$95.nextSibling,
|
|
1623
|
+
[_el$97, _co$22] = _$getNextMarker(_el$96.nextSibling),
|
|
1461
1624
|
_el$98 = _el$97.nextSibling,
|
|
1462
|
-
_el$99 = _el$98.
|
|
1463
|
-
|
|
1464
|
-
_el$101 = _el$100.nextSibling,
|
|
1465
|
-
|
|
1466
|
-
|
|
1625
|
+
[_el$99, _co$23] = _$getNextMarker(_el$98.nextSibling),
|
|
1626
|
+
_el$100 = _el$99.nextSibling,
|
|
1627
|
+
[_el$101, _co$24] = _$getNextMarker(_el$100.nextSibling),
|
|
1628
|
+
_el$102 = _el$70.nextSibling,
|
|
1629
|
+
_el$103 = _el$102.nextSibling,
|
|
1630
|
+
_el$104 = _el$103.firstChild,
|
|
1631
|
+
[_el$105, _co$25] = _$getNextMarker(_el$104.nextSibling),
|
|
1632
|
+
_el$106 = _el$105.nextSibling,
|
|
1633
|
+
[_el$107, _co$26] = _$getNextMarker(_el$106.nextSibling);
|
|
1634
|
+
var _ref$6 = shellRef;
|
|
1635
|
+
typeof _ref$6 === "function" ? _$use(_ref$6, _el$42) : shellRef = _el$42;
|
|
1636
|
+
_$insert(_el$42, _$createComponent(Show, {
|
|
1467
1637
|
get when() {
|
|
1468
1638
|
return suggestionsOpen() || hasAccessory();
|
|
1469
1639
|
},
|
|
1470
1640
|
get children() {
|
|
1471
|
-
var _el$
|
|
1472
|
-
_el$
|
|
1473
|
-
_el$
|
|
1474
|
-
[_el$
|
|
1475
|
-
_el$
|
|
1476
|
-
[_el$
|
|
1477
|
-
_$insert(_el$
|
|
1478
|
-
_$insert(_el$
|
|
1641
|
+
var _el$43 = _$getNextElement(_tmpl$20),
|
|
1642
|
+
_el$44 = _el$43.firstChild,
|
|
1643
|
+
_el$66 = _el$44.nextSibling,
|
|
1644
|
+
[_el$67, _co$11] = _$getNextMarker(_el$66.nextSibling),
|
|
1645
|
+
_el$68 = _el$67.nextSibling,
|
|
1646
|
+
[_el$69, _co$12] = _$getNextMarker(_el$68.nextSibling);
|
|
1647
|
+
_$insert(_el$44, accessory);
|
|
1648
|
+
_$insert(_el$43, _$createComponent(Show, {
|
|
1479
1649
|
get when() {
|
|
1480
1650
|
return emojiOpen();
|
|
1481
1651
|
},
|
|
1482
1652
|
get children() {
|
|
1483
|
-
var _el$
|
|
1484
|
-
_el$
|
|
1485
|
-
var _ref$
|
|
1486
|
-
typeof _ref$
|
|
1487
|
-
_$setAttribute(_el$
|
|
1488
|
-
_$insert(_el$
|
|
1653
|
+
var _el$45 = _$getNextElement(_tmpl$15),
|
|
1654
|
+
_el$46 = _el$45.firstChild;
|
|
1655
|
+
var _ref$7 = commandListRef;
|
|
1656
|
+
typeof _ref$7 === "function" ? _$use(_ref$7, _el$46) : commandListRef = _el$46;
|
|
1657
|
+
_$setAttribute(_el$46, "id", commandListId);
|
|
1658
|
+
_$insert(_el$46, _$createComponent(For, {
|
|
1489
1659
|
get each() {
|
|
1490
1660
|
return emojiMatches();
|
|
1491
1661
|
},
|
|
1492
1662
|
children: (entry, index) => (() => {
|
|
1493
|
-
var _el$
|
|
1494
|
-
_el$
|
|
1495
|
-
_el$
|
|
1496
|
-
_el$
|
|
1497
|
-
[_el$
|
|
1498
|
-
_el$
|
|
1499
|
-
_el$
|
|
1500
|
-
_$insert(_el$
|
|
1501
|
-
_$insert(_el$
|
|
1502
|
-
_$insert(_el$
|
|
1663
|
+
var _el$110 = _$getNextElement(_tmpl$26),
|
|
1664
|
+
_el$111 = _el$110.firstChild,
|
|
1665
|
+
_el$112 = _el$111.nextSibling,
|
|
1666
|
+
_el$113 = _el$112.nextSibling,
|
|
1667
|
+
[_el$114, _co$28] = _$getNextMarker(_el$113.nextSibling);
|
|
1668
|
+
_el$110.$$click = () => pickEmojiSuggestion(index());
|
|
1669
|
+
_el$110.$$mousedown = keepFieldFocus;
|
|
1670
|
+
_$insert(_el$111, () => emojiInTone(entry, props.emoji?.skinTone ?? 0));
|
|
1671
|
+
_$insert(_el$112, () => emojiName(entry, locale()));
|
|
1672
|
+
_$insert(_el$110, _$createComponent(Show, {
|
|
1503
1673
|
get when() {
|
|
1504
1674
|
return entry.shortcodes[0];
|
|
1505
1675
|
},
|
|
1506
1676
|
children: code => (() => {
|
|
1507
|
-
var _el$
|
|
1508
|
-
_el$
|
|
1509
|
-
_el$
|
|
1510
|
-
[_el$
|
|
1511
|
-
_el$
|
|
1512
|
-
_$insert(_el$
|
|
1513
|
-
return _el$
|
|
1677
|
+
var _el$115 = _$getNextElement(_tmpl$27),
|
|
1678
|
+
_el$116 = _el$115.firstChild,
|
|
1679
|
+
_el$118 = _el$116.nextSibling,
|
|
1680
|
+
[_el$119, _co$29] = _$getNextMarker(_el$118.nextSibling),
|
|
1681
|
+
_el$117 = _el$119.nextSibling;
|
|
1682
|
+
_$insert(_el$115, code, _el$119, _co$29);
|
|
1683
|
+
return _el$115;
|
|
1514
1684
|
})()
|
|
1515
|
-
}), _el$
|
|
1685
|
+
}), _el$114, _co$28);
|
|
1516
1686
|
_$effect(_p$ => {
|
|
1517
1687
|
var _v$28 = `${commandListId}-${index()}`,
|
|
1518
1688
|
_v$29 = index() === selectedCommandIndex(),
|
|
1519
1689
|
_v$30 = emojiName(entry, locale()),
|
|
1520
1690
|
_v$31 = index() === selectedCommandIndex() ? "true" : undefined;
|
|
1521
|
-
_v$28 !== _p$.e && _$setAttribute(_el$
|
|
1522
|
-
_v$29 !== _p$.t && _$setAttribute(_el$
|
|
1523
|
-
_v$30 !== _p$.a && _$setAttribute(_el$
|
|
1524
|
-
_v$31 !== _p$.o && _$setAttribute(_el$
|
|
1691
|
+
_v$28 !== _p$.e && _$setAttribute(_el$110, "id", _p$.e = _v$28);
|
|
1692
|
+
_v$29 !== _p$.t && _$setAttribute(_el$110, "aria-selected", _p$.t = _v$29);
|
|
1693
|
+
_v$30 !== _p$.a && _$setAttribute(_el$110, "aria-label", _p$.a = _v$30);
|
|
1694
|
+
_v$31 !== _p$.o && _$setAttribute(_el$110, "data-active", _p$.o = _v$31);
|
|
1525
1695
|
return _p$;
|
|
1526
1696
|
}, {
|
|
1527
1697
|
e: undefined,
|
|
@@ -1530,32 +1700,32 @@ export function ChatComposer(props) {
|
|
|
1530
1700
|
o: undefined
|
|
1531
1701
|
});
|
|
1532
1702
|
_$runHydrationEvents();
|
|
1533
|
-
return _el$
|
|
1703
|
+
return _el$110;
|
|
1534
1704
|
})()
|
|
1535
1705
|
}));
|
|
1536
|
-
_$effect(() => _$setAttribute(_el$
|
|
1537
|
-
return _el$
|
|
1706
|
+
_$effect(() => _$setAttribute(_el$46, "aria-label", chatMessages().emojiSuggestions));
|
|
1707
|
+
return _el$45;
|
|
1538
1708
|
}
|
|
1539
|
-
}), _el$
|
|
1540
|
-
_$insert(_el$
|
|
1709
|
+
}), _el$67, _co$11);
|
|
1710
|
+
_$insert(_el$43, _$createComponent(Show, {
|
|
1541
1711
|
get when() {
|
|
1542
1712
|
return commandsOpen();
|
|
1543
1713
|
},
|
|
1544
1714
|
get children() {
|
|
1545
|
-
var _el$
|
|
1546
|
-
_el$
|
|
1547
|
-
_el$
|
|
1548
|
-
[_el$
|
|
1549
|
-
_el$
|
|
1550
|
-
[_el$
|
|
1551
|
-
_el$
|
|
1552
|
-
[_el$
|
|
1553
|
-
_el$
|
|
1554
|
-
[_el$
|
|
1555
|
-
var _ref$
|
|
1556
|
-
typeof _ref$
|
|
1557
|
-
_$setAttribute(_el$
|
|
1558
|
-
_$insert(_el$
|
|
1715
|
+
var _el$47 = _$getNextElement(_tmpl$19),
|
|
1716
|
+
_el$48 = _el$47.firstChild,
|
|
1717
|
+
_el$58 = _el$48.firstChild,
|
|
1718
|
+
[_el$59, _co$9] = _$getNextMarker(_el$58.nextSibling),
|
|
1719
|
+
_el$60 = _el$59.nextSibling,
|
|
1720
|
+
[_el$61, _co$0] = _$getNextMarker(_el$60.nextSibling),
|
|
1721
|
+
_el$62 = _el$61.nextSibling,
|
|
1722
|
+
[_el$63, _co$1] = _$getNextMarker(_el$62.nextSibling),
|
|
1723
|
+
_el$64 = _el$63.nextSibling,
|
|
1724
|
+
[_el$65, _co$10] = _$getNextMarker(_el$64.nextSibling);
|
|
1725
|
+
var _ref$8 = commandListRef;
|
|
1726
|
+
typeof _ref$8 === "function" ? _$use(_ref$8, _el$48) : commandListRef = _el$48;
|
|
1727
|
+
_$setAttribute(_el$48, "id", commandListId);
|
|
1728
|
+
_$insert(_el$48, _$createComponent(For, {
|
|
1559
1729
|
get each() {
|
|
1560
1730
|
return commandModel().groups.map(commandGroupKey);
|
|
1561
1731
|
},
|
|
@@ -1574,343 +1744,343 @@ export function ChatComposer(props) {
|
|
|
1574
1744
|
});
|
|
1575
1745
|
},
|
|
1576
1746
|
get children() {
|
|
1577
|
-
var _el$
|
|
1578
|
-
_el$
|
|
1579
|
-
_el$
|
|
1580
|
-
_el$
|
|
1581
|
-
[_el$
|
|
1582
|
-
_el$
|
|
1583
|
-
[_el$
|
|
1584
|
-
_el$
|
|
1585
|
-
[_el$
|
|
1586
|
-
_$insert(_el$
|
|
1587
|
-
_$insert(_el$
|
|
1747
|
+
var _el$120 = _$getNextElement(_tmpl$30),
|
|
1748
|
+
_el$121 = _el$120.firstChild,
|
|
1749
|
+
_el$122 = _el$121.firstChild,
|
|
1750
|
+
_el$124 = _el$122.nextSibling,
|
|
1751
|
+
[_el$125, _co$30] = _$getNextMarker(_el$124.nextSibling),
|
|
1752
|
+
_el$127 = _el$121.nextSibling,
|
|
1753
|
+
[_el$128, _co$31] = _$getNextMarker(_el$127.nextSibling),
|
|
1754
|
+
_el$129 = _el$128.nextSibling,
|
|
1755
|
+
[_el$130, _co$32] = _$getNextMarker(_el$129.nextSibling);
|
|
1756
|
+
_$insert(_el$122, () => group()?.scopeTitle ?? group()?.section?.label);
|
|
1757
|
+
_$insert(_el$121, _$createComponent(Show, {
|
|
1588
1758
|
get when() {
|
|
1589
1759
|
return group()?.loading;
|
|
1590
1760
|
},
|
|
1591
1761
|
get children() {
|
|
1592
|
-
return _$getNextElement(_tmpl$
|
|
1762
|
+
return _$getNextElement(_tmpl$28);
|
|
1593
1763
|
}
|
|
1594
|
-
}), _el$
|
|
1595
|
-
_$insert(_el$
|
|
1764
|
+
}), _el$125, _co$30);
|
|
1765
|
+
_$insert(_el$120, _$createComponent(For, {
|
|
1596
1766
|
get each() {
|
|
1597
1767
|
return rows();
|
|
1598
1768
|
},
|
|
1599
1769
|
children: renderCommandRow
|
|
1600
|
-
}), _el$
|
|
1601
|
-
_$insert(_el$
|
|
1770
|
+
}), _el$128, _co$31);
|
|
1771
|
+
_$insert(_el$120, _$createComponent(Show, {
|
|
1602
1772
|
get when() {
|
|
1603
1773
|
return group()?.placeholder;
|
|
1604
1774
|
},
|
|
1605
1775
|
get children() {
|
|
1606
|
-
return _$getNextElement(_tmpl$
|
|
1776
|
+
return _$getNextElement(_tmpl$29);
|
|
1607
1777
|
}
|
|
1608
|
-
}), _el$
|
|
1778
|
+
}), _el$130, _co$32);
|
|
1609
1779
|
_$effect(_p$ => {
|
|
1610
1780
|
var _v$32 = headingId(),
|
|
1611
1781
|
_v$33 = headingId();
|
|
1612
|
-
_v$32 !== _p$.e && _$setAttribute(_el$
|
|
1613
|
-
_v$33 !== _p$.t && _$setAttribute(_el$
|
|
1782
|
+
_v$32 !== _p$.e && _$setAttribute(_el$120, "aria-labelledby", _p$.e = _v$32);
|
|
1783
|
+
_v$33 !== _p$.t && _$setAttribute(_el$121, "id", _p$.t = _v$33);
|
|
1614
1784
|
return _p$;
|
|
1615
1785
|
}, {
|
|
1616
1786
|
e: undefined,
|
|
1617
1787
|
t: undefined
|
|
1618
1788
|
});
|
|
1619
|
-
return _el$
|
|
1789
|
+
return _el$120;
|
|
1620
1790
|
}
|
|
1621
1791
|
});
|
|
1622
1792
|
}
|
|
1623
|
-
}), _el$
|
|
1624
|
-
_$insert(_el$
|
|
1793
|
+
}), _el$59, _co$9);
|
|
1794
|
+
_$insert(_el$48, _$createComponent(Show, {
|
|
1625
1795
|
get when() {
|
|
1626
1796
|
return _$memo(() => !!(searching() && commandMatches().length === 0))() && !commandModel().groups.some(group => group.section || group.scopeTitle);
|
|
1627
1797
|
},
|
|
1628
1798
|
get children() {
|
|
1629
|
-
var _el$
|
|
1630
|
-
_el$
|
|
1631
|
-
_el$
|
|
1632
|
-
_$insert(_el$
|
|
1633
|
-
return _el$
|
|
1799
|
+
var _el$49 = _$getNextElement(_tmpl$16),
|
|
1800
|
+
_el$50 = _el$49.firstChild,
|
|
1801
|
+
_el$51 = _el$50.nextSibling;
|
|
1802
|
+
_$insert(_el$51, () => messages().loading);
|
|
1803
|
+
return _el$49;
|
|
1634
1804
|
}
|
|
1635
|
-
}), _el$
|
|
1636
|
-
_$insert(_el$
|
|
1805
|
+
}), _el$61, _co$0);
|
|
1806
|
+
_$insert(_el$48, _$createComponent(Show, {
|
|
1637
1807
|
get when() {
|
|
1638
1808
|
return searchError();
|
|
1639
1809
|
},
|
|
1640
1810
|
get children() {
|
|
1641
|
-
var _el$
|
|
1642
|
-
_el$
|
|
1643
|
-
_el$
|
|
1644
|
-
_el$
|
|
1645
|
-
[_el$
|
|
1646
|
-
_$insert(_el$
|
|
1647
|
-
return _el$
|
|
1811
|
+
var _el$52 = _$getNextElement(_tmpl$17),
|
|
1812
|
+
_el$53 = _el$52.firstChild,
|
|
1813
|
+
_el$54 = _el$53.nextSibling,
|
|
1814
|
+
_el$55 = _el$54.nextSibling,
|
|
1815
|
+
[_el$56, _co$8] = _$getNextMarker(_el$55.nextSibling);
|
|
1816
|
+
_$insert(_el$52, () => messages().error, _el$56, _co$8);
|
|
1817
|
+
return _el$52;
|
|
1648
1818
|
}
|
|
1649
|
-
}), _el$
|
|
1650
|
-
_$insert(_el$
|
|
1819
|
+
}), _el$63, _co$1);
|
|
1820
|
+
_$insert(_el$48, _$createComponent(Show, {
|
|
1651
1821
|
get when() {
|
|
1652
1822
|
return _$memo(() => !!(!searching() && !searchError()))() && commandMatches().length === 0;
|
|
1653
1823
|
},
|
|
1654
1824
|
get children() {
|
|
1655
|
-
var _el$
|
|
1656
|
-
_$insert(_el$
|
|
1825
|
+
var _el$57 = _$getNextElement(_tmpl$18);
|
|
1826
|
+
_$insert(_el$57, (() => {
|
|
1657
1827
|
var _c$ = _$memo(() => !!!parsedCommandQuery().query.trim());
|
|
1658
1828
|
return () => _c$() ? messages().noResults : chatMessages().commandsNothingFound({
|
|
1659
1829
|
query: parsedCommandQuery().query.trim()
|
|
1660
1830
|
});
|
|
1661
1831
|
})());
|
|
1662
|
-
return _el$
|
|
1832
|
+
return _el$57;
|
|
1663
1833
|
}
|
|
1664
|
-
}), _el$
|
|
1834
|
+
}), _el$65, _co$10);
|
|
1665
1835
|
_$effect(_p$ => {
|
|
1666
1836
|
var _v$19 = chatMessages().commands,
|
|
1667
1837
|
_v$20 = searching() ? "true" : undefined;
|
|
1668
|
-
_v$19 !== _p$.e && _$setAttribute(_el$
|
|
1669
|
-
_v$20 !== _p$.t && _$setAttribute(_el$
|
|
1838
|
+
_v$19 !== _p$.e && _$setAttribute(_el$48, "aria-label", _p$.e = _v$19);
|
|
1839
|
+
_v$20 !== _p$.t && _$setAttribute(_el$48, "aria-busy", _p$.t = _v$20);
|
|
1670
1840
|
return _p$;
|
|
1671
1841
|
}, {
|
|
1672
1842
|
e: undefined,
|
|
1673
1843
|
t: undefined
|
|
1674
1844
|
});
|
|
1675
|
-
return _el$
|
|
1845
|
+
return _el$47;
|
|
1676
1846
|
}
|
|
1677
|
-
}), _el$
|
|
1847
|
+
}), _el$69, _co$12);
|
|
1678
1848
|
_$effect(_p$ => {
|
|
1679
1849
|
var _v$21 = hasAccessory() ? undefined : "true",
|
|
1680
1850
|
_v$22 = suggestionsOpen() ? "hidden" : undefined,
|
|
1681
1851
|
_v$23 = suggestionsOpen();
|
|
1682
|
-
_v$21 !== _p$.e && _$setAttribute(_el$
|
|
1683
|
-
_v$22 !== _p$.t && _$setStyleProperty(_el$
|
|
1684
|
-
_v$23 !== _p$.a && _$setProperty(_el$
|
|
1852
|
+
_v$21 !== _p$.e && _$setAttribute(_el$43, "data-overlay", _p$.e = _v$21);
|
|
1853
|
+
_v$22 !== _p$.t && _$setStyleProperty(_el$44, "visibility", _p$.t = _v$22);
|
|
1854
|
+
_v$23 !== _p$.a && _$setProperty(_el$44, "inert", _p$.a = _v$23);
|
|
1685
1855
|
return _p$;
|
|
1686
1856
|
}, {
|
|
1687
1857
|
e: undefined,
|
|
1688
1858
|
t: undefined,
|
|
1689
1859
|
a: undefined
|
|
1690
1860
|
});
|
|
1691
|
-
return _el$
|
|
1861
|
+
return _el$43;
|
|
1692
1862
|
}
|
|
1693
|
-
}), _el$
|
|
1694
|
-
var _ref$
|
|
1695
|
-
typeof _ref$
|
|
1696
|
-
_$insert(_el$
|
|
1863
|
+
}), _el$109, _co$27);
|
|
1864
|
+
var _ref$9 = composerRef;
|
|
1865
|
+
typeof _ref$9 === "function" ? _$use(_ref$9, _el$70) : composerRef = _el$70;
|
|
1866
|
+
_$insert(_el$70, _$createComponent(Show, {
|
|
1697
1867
|
get when() {
|
|
1698
1868
|
return showHint();
|
|
1699
1869
|
},
|
|
1700
1870
|
get children() {
|
|
1701
|
-
var _el$
|
|
1702
|
-
_$insert(_el$
|
|
1871
|
+
var _el$71 = _$getNextElement(_tmpl$21);
|
|
1872
|
+
_$insert(_el$71, _$createComponent(Show, {
|
|
1703
1873
|
get when() {
|
|
1704
1874
|
return dictationStatus();
|
|
1705
1875
|
},
|
|
1706
1876
|
get fallback() {
|
|
1707
1877
|
return (() => {
|
|
1708
|
-
var _el$
|
|
1709
|
-
_$insert(_el$
|
|
1710
|
-
return _el$
|
|
1878
|
+
var _el$131 = _$getNextElement(_tmpl$31);
|
|
1879
|
+
_$insert(_el$131, hint);
|
|
1880
|
+
return _el$131;
|
|
1711
1881
|
})();
|
|
1712
1882
|
},
|
|
1713
1883
|
children: status => [(() => {
|
|
1714
|
-
var _el$
|
|
1715
|
-
_el$
|
|
1716
|
-
_el$
|
|
1717
|
-
_$insert(_el$
|
|
1884
|
+
var _el$132 = _$getNextElement(_tmpl$32),
|
|
1885
|
+
_el$133 = _el$132.firstChild,
|
|
1886
|
+
_el$134 = _el$133.nextSibling;
|
|
1887
|
+
_$insert(_el$134, () => status().text);
|
|
1718
1888
|
_$effect(_p$ => {
|
|
1719
1889
|
var _v$34 = dictation() ?? undefined,
|
|
1720
1890
|
_v$35 = status().icon;
|
|
1721
|
-
_v$34 !== _p$.e && _$setAttribute(_el$
|
|
1722
|
-
_v$35 !== _p$.t && _$className(_el$
|
|
1891
|
+
_v$34 !== _p$.e && _$setAttribute(_el$132, "data-state", _p$.e = _v$34);
|
|
1892
|
+
_v$35 !== _p$.t && _$className(_el$133, _p$.t = _v$35);
|
|
1723
1893
|
return _p$;
|
|
1724
1894
|
}, {
|
|
1725
1895
|
e: undefined,
|
|
1726
1896
|
t: undefined
|
|
1727
1897
|
});
|
|
1728
|
-
return _el$
|
|
1898
|
+
return _el$132;
|
|
1729
1899
|
})(), _$createComponent(Show, {
|
|
1730
1900
|
get when() {
|
|
1731
1901
|
return _$memo(() => dictation() === "refined")() ? props.microphone?.onRestoreOriginal : undefined;
|
|
1732
1902
|
},
|
|
1733
1903
|
children: restore => (() => {
|
|
1734
|
-
var _el$
|
|
1735
|
-
_el$
|
|
1736
|
-
_el$
|
|
1737
|
-
_$insert(_el$
|
|
1738
|
-
_$effect(() => _$setProperty(_el$
|
|
1904
|
+
var _el$135 = _$getNextElement(_tmpl$33);
|
|
1905
|
+
_el$135.$$click = () => reportChatFailure(restore(), props.onError);
|
|
1906
|
+
_el$135.$$mousedown = keepFieldFocus;
|
|
1907
|
+
_$insert(_el$135, () => chatMessages().restoreOriginal);
|
|
1908
|
+
_$effect(() => _$setProperty(_el$135, "disabled", microphoneDisabled()));
|
|
1739
1909
|
_$runHydrationEvents();
|
|
1740
|
-
return _el$
|
|
1910
|
+
return _el$135;
|
|
1741
1911
|
})()
|
|
1742
1912
|
})]
|
|
1743
1913
|
}));
|
|
1744
|
-
return _el$
|
|
1914
|
+
return _el$71;
|
|
1745
1915
|
}
|
|
1746
|
-
}), _el$
|
|
1747
|
-
_$insert(_el$
|
|
1916
|
+
}), _el$95, _co$21);
|
|
1917
|
+
_$insert(_el$70, _$createComponent(Show, {
|
|
1748
1918
|
get when() {
|
|
1749
1919
|
return attachments().length > 0;
|
|
1750
1920
|
},
|
|
1751
1921
|
get children() {
|
|
1752
|
-
var _el$
|
|
1753
|
-
_$insert(_el$
|
|
1922
|
+
var _el$72 = _$getNextElement(_tmpl$22);
|
|
1923
|
+
_$insert(_el$72, _$createComponent(For, {
|
|
1754
1924
|
get each() {
|
|
1755
1925
|
return attachments();
|
|
1756
1926
|
},
|
|
1757
1927
|
children: attachment => (() => {
|
|
1758
|
-
var _el$
|
|
1759
|
-
_el$
|
|
1760
|
-
_el$
|
|
1761
|
-
[_el$
|
|
1762
|
-
_el$
|
|
1763
|
-
[_el$
|
|
1764
|
-
_el$
|
|
1765
|
-
[_el$
|
|
1766
|
-
_$insert(_el$
|
|
1928
|
+
var _el$136 = _$getNextElement(_tmpl$35),
|
|
1929
|
+
_el$137 = _el$136.firstChild,
|
|
1930
|
+
_el$138 = _el$137.firstChild,
|
|
1931
|
+
[_el$139, _co$33] = _$getNextMarker(_el$138.nextSibling),
|
|
1932
|
+
_el$140 = _el$139.nextSibling,
|
|
1933
|
+
[_el$141, _co$34] = _$getNextMarker(_el$140.nextSibling),
|
|
1934
|
+
_el$143 = _el$137.nextSibling,
|
|
1935
|
+
[_el$144, _co$35] = _$getNextMarker(_el$143.nextSibling);
|
|
1936
|
+
_$insert(_el$137, _$createComponent(Show, {
|
|
1767
1937
|
get when() {
|
|
1768
1938
|
return attachment.href;
|
|
1769
1939
|
},
|
|
1770
1940
|
get fallback() {
|
|
1771
1941
|
return (() => {
|
|
1772
|
-
var _el$
|
|
1773
|
-
_el$
|
|
1774
|
-
[_el$
|
|
1775
|
-
_el$
|
|
1776
|
-
[_el$
|
|
1777
|
-
_$insert(_el$
|
|
1942
|
+
var _el$145 = _$getNextElement(_tmpl$37),
|
|
1943
|
+
_el$147 = _el$145.firstChild,
|
|
1944
|
+
[_el$148, _co$36] = _$getNextMarker(_el$147.nextSibling),
|
|
1945
|
+
_el$149 = _el$148.nextSibling,
|
|
1946
|
+
[_el$150, _co$37] = _$getNextMarker(_el$149.nextSibling);
|
|
1947
|
+
_$insert(_el$145, _$createComponent(Show, {
|
|
1778
1948
|
get when() {
|
|
1779
1949
|
return _$memo(() => attachment.kind === "image")() && attachment.previewUrl;
|
|
1780
1950
|
},
|
|
1781
1951
|
get fallback() {
|
|
1782
1952
|
return (() => {
|
|
1783
|
-
var _el$
|
|
1784
|
-
_$effect(() => _$className(_el$
|
|
1785
|
-
return _el$
|
|
1953
|
+
var _el$151 = _$getNextElement(_tmpl$3);
|
|
1954
|
+
_$effect(() => _$className(_el$151, attachmentIcon(attachment)));
|
|
1955
|
+
return _el$151;
|
|
1786
1956
|
})();
|
|
1787
1957
|
},
|
|
1788
1958
|
get children() {
|
|
1789
|
-
var _el$
|
|
1959
|
+
var _el$146 = _$getNextElement(_tmpl$36);
|
|
1790
1960
|
_$effect(_p$ => {
|
|
1791
1961
|
var _v$38 = attachment.previewUrl,
|
|
1792
1962
|
_v$39 = attachment.alt ?? "";
|
|
1793
|
-
_v$38 !== _p$.e && _$setAttribute(_el$
|
|
1794
|
-
_v$39 !== _p$.t && _$setAttribute(_el$
|
|
1963
|
+
_v$38 !== _p$.e && _$setAttribute(_el$146, "src", _p$.e = _v$38);
|
|
1964
|
+
_v$39 !== _p$.t && _$setAttribute(_el$146, "alt", _p$.t = _v$39);
|
|
1795
1965
|
return _p$;
|
|
1796
1966
|
}, {
|
|
1797
1967
|
e: undefined,
|
|
1798
1968
|
t: undefined
|
|
1799
1969
|
});
|
|
1800
|
-
return _el$
|
|
1970
|
+
return _el$146;
|
|
1801
1971
|
}
|
|
1802
|
-
}), _el$
|
|
1803
|
-
_$insert(_el$
|
|
1804
|
-
return _el$
|
|
1972
|
+
}), _el$148, _co$36);
|
|
1973
|
+
_$insert(_el$145, () => renderAttachmentCopy(attachment), _el$150, _co$37);
|
|
1974
|
+
return _el$145;
|
|
1805
1975
|
})();
|
|
1806
1976
|
},
|
|
1807
1977
|
children: href => (() => {
|
|
1808
|
-
var _el$
|
|
1809
|
-
_el$
|
|
1810
|
-
[_el$
|
|
1811
|
-
_el$
|
|
1812
|
-
[_el$
|
|
1813
|
-
_$insert(_el$
|
|
1978
|
+
var _el$152 = _$getNextElement(_tmpl$38),
|
|
1979
|
+
_el$154 = _el$152.firstChild,
|
|
1980
|
+
[_el$155, _co$38] = _$getNextMarker(_el$154.nextSibling),
|
|
1981
|
+
_el$156 = _el$155.nextSibling,
|
|
1982
|
+
[_el$157, _co$39] = _$getNextMarker(_el$156.nextSibling);
|
|
1983
|
+
_$insert(_el$152, _$createComponent(Show, {
|
|
1814
1984
|
get when() {
|
|
1815
1985
|
return _$memo(() => attachment.kind === "image")() && attachment.previewUrl;
|
|
1816
1986
|
},
|
|
1817
1987
|
get fallback() {
|
|
1818
1988
|
return (() => {
|
|
1819
|
-
var _el$
|
|
1820
|
-
_$effect(() => _$className(_el$
|
|
1821
|
-
return _el$
|
|
1989
|
+
var _el$158 = _$getNextElement(_tmpl$3);
|
|
1990
|
+
_$effect(() => _$className(_el$158, attachmentIcon(attachment)));
|
|
1991
|
+
return _el$158;
|
|
1822
1992
|
})();
|
|
1823
1993
|
},
|
|
1824
1994
|
get children() {
|
|
1825
|
-
var _el$
|
|
1995
|
+
var _el$153 = _$getNextElement(_tmpl$36);
|
|
1826
1996
|
_$effect(_p$ => {
|
|
1827
1997
|
var _v$40 = attachment.previewUrl,
|
|
1828
1998
|
_v$41 = attachment.alt ?? "";
|
|
1829
|
-
_v$40 !== _p$.e && _$setAttribute(_el$
|
|
1830
|
-
_v$41 !== _p$.t && _$setAttribute(_el$
|
|
1999
|
+
_v$40 !== _p$.e && _$setAttribute(_el$153, "src", _p$.e = _v$40);
|
|
2000
|
+
_v$41 !== _p$.t && _$setAttribute(_el$153, "alt", _p$.t = _v$41);
|
|
1831
2001
|
return _p$;
|
|
1832
2002
|
}, {
|
|
1833
2003
|
e: undefined,
|
|
1834
2004
|
t: undefined
|
|
1835
2005
|
});
|
|
1836
|
-
return _el$
|
|
2006
|
+
return _el$153;
|
|
1837
2007
|
}
|
|
1838
|
-
}), _el$
|
|
1839
|
-
_$insert(_el$
|
|
2008
|
+
}), _el$155, _co$38);
|
|
2009
|
+
_$insert(_el$152, () => renderAttachmentCopy(attachment), _el$157, _co$39);
|
|
1840
2010
|
_$effect(_p$ => {
|
|
1841
2011
|
var _v$42 = href(),
|
|
1842
2012
|
_v$43 = chatMessages().openInNewTab({
|
|
1843
2013
|
name: attachment.name
|
|
1844
2014
|
});
|
|
1845
|
-
_v$42 !== _p$.e && _$setAttribute(_el$
|
|
1846
|
-
_v$43 !== _p$.t && _$setAttribute(_el$
|
|
2015
|
+
_v$42 !== _p$.e && _$setAttribute(_el$152, "href", _p$.e = _v$42);
|
|
2016
|
+
_v$43 !== _p$.t && _$setAttribute(_el$152, "aria-label", _p$.t = _v$43);
|
|
1847
2017
|
return _p$;
|
|
1848
2018
|
}, {
|
|
1849
2019
|
e: undefined,
|
|
1850
2020
|
t: undefined
|
|
1851
2021
|
});
|
|
1852
|
-
return _el$
|
|
2022
|
+
return _el$152;
|
|
1853
2023
|
})()
|
|
1854
|
-
}), _el$
|
|
1855
|
-
_$insert(_el$
|
|
2024
|
+
}), _el$139, _co$33);
|
|
2025
|
+
_$insert(_el$137, _$createComponent(Show, {
|
|
1856
2026
|
get when() {
|
|
1857
2027
|
return attachment.action;
|
|
1858
2028
|
},
|
|
1859
2029
|
children: action => (() => {
|
|
1860
|
-
var _el$
|
|
1861
|
-
_el$
|
|
1862
|
-
[_el$
|
|
1863
|
-
_el$
|
|
1864
|
-
[_el$
|
|
1865
|
-
_el$
|
|
1866
|
-
_$insert(_el$
|
|
2030
|
+
var _el$159 = _$getNextElement(_tmpl$39),
|
|
2031
|
+
_el$160 = _el$159.firstChild,
|
|
2032
|
+
[_el$161, _co$40] = _$getNextMarker(_el$160.nextSibling),
|
|
2033
|
+
_el$162 = _el$161.nextSibling,
|
|
2034
|
+
[_el$163, _co$41] = _$getNextMarker(_el$162.nextSibling);
|
|
2035
|
+
_el$159.$$click = () => reportChatFailure(() => executeChatAction(action()), props.onError);
|
|
2036
|
+
_$insert(_el$159, _$createComponent(Show, {
|
|
1867
2037
|
get when() {
|
|
1868
2038
|
return action().icon;
|
|
1869
2039
|
},
|
|
1870
2040
|
children: icon => (() => {
|
|
1871
|
-
var _el$
|
|
1872
|
-
_$effect(() => _$className(_el$
|
|
1873
|
-
return _el$
|
|
2041
|
+
var _el$164 = _$getNextElement(_tmpl$3);
|
|
2042
|
+
_$effect(() => _$className(_el$164, icon()));
|
|
2043
|
+
return _el$164;
|
|
1874
2044
|
})()
|
|
1875
|
-
}), _el$
|
|
1876
|
-
_$insert(_el$
|
|
1877
|
-
_$effect(() => _$setProperty(_el$
|
|
2045
|
+
}), _el$161, _co$40);
|
|
2046
|
+
_$insert(_el$159, () => action().label, _el$163, _co$41);
|
|
2047
|
+
_$effect(() => _$setProperty(_el$159, "disabled", blocked() || action().disabled));
|
|
1878
2048
|
_$runHydrationEvents();
|
|
1879
|
-
return _el$
|
|
2049
|
+
return _el$159;
|
|
1880
2050
|
})()
|
|
1881
|
-
}), _el$
|
|
1882
|
-
_$insert(_el$
|
|
2051
|
+
}), _el$141, _co$34);
|
|
2052
|
+
_$insert(_el$136, _$createComponent(Show, {
|
|
1883
2053
|
get when() {
|
|
1884
2054
|
return props.onAttachmentsChange;
|
|
1885
2055
|
},
|
|
1886
2056
|
get children() {
|
|
1887
|
-
var _el$
|
|
1888
|
-
_el$
|
|
2057
|
+
var _el$142 = _$getNextElement(_tmpl$34);
|
|
2058
|
+
_el$142.$$click = () => setAttachments(attachments().filter(candidate => candidate.id !== attachment.id));
|
|
1889
2059
|
_$effect(_p$ => {
|
|
1890
2060
|
var _v$36 = selectMessages().removeNamed({
|
|
1891
2061
|
name: attachment.name
|
|
1892
2062
|
}),
|
|
1893
2063
|
_v$37 = blocked();
|
|
1894
|
-
_v$36 !== _p$.e && _$setAttribute(_el$
|
|
1895
|
-
_v$37 !== _p$.t && _$setProperty(_el$
|
|
2064
|
+
_v$36 !== _p$.e && _$setAttribute(_el$142, "aria-label", _p$.e = _v$36);
|
|
2065
|
+
_v$37 !== _p$.t && _$setProperty(_el$142, "disabled", _p$.t = _v$37);
|
|
1896
2066
|
return _p$;
|
|
1897
2067
|
}, {
|
|
1898
2068
|
e: undefined,
|
|
1899
2069
|
t: undefined
|
|
1900
2070
|
});
|
|
1901
2071
|
_$runHydrationEvents();
|
|
1902
|
-
return _el$
|
|
2072
|
+
return _el$142;
|
|
1903
2073
|
}
|
|
1904
|
-
}), _el$
|
|
1905
|
-
_$effect(() => _el$
|
|
1906
|
-
return _el$
|
|
2074
|
+
}), _el$144, _co$35);
|
|
2075
|
+
_$effect(() => _el$137.classList.toggle("k2b-chat-composer__attachment-content--action", !!Boolean(attachment.action)));
|
|
2076
|
+
return _el$136;
|
|
1907
2077
|
})()
|
|
1908
2078
|
}));
|
|
1909
|
-
_$effect(() => _$setAttribute(_el$
|
|
1910
|
-
return _el$
|
|
2079
|
+
_$effect(() => _$setAttribute(_el$72, "aria-label", chatMessages().attachments));
|
|
2080
|
+
return _el$72;
|
|
1911
2081
|
}
|
|
1912
|
-
}), _el$
|
|
1913
|
-
_$insert(_el$
|
|
2082
|
+
}), _el$97, _co$22);
|
|
2083
|
+
_$insert(_el$70, _$createComponent(Show, {
|
|
1914
2084
|
get when() {
|
|
1915
2085
|
return conversation();
|
|
1916
2086
|
},
|
|
@@ -1920,49 +2090,49 @@ export function ChatComposer(props) {
|
|
|
1920
2090
|
return props.error;
|
|
1921
2091
|
},
|
|
1922
2092
|
get children() {
|
|
1923
|
-
var _el$
|
|
1924
|
-
_el$
|
|
1925
|
-
_el$
|
|
1926
|
-
[_el$
|
|
1927
|
-
_$insert(_el$
|
|
1928
|
-
return _el$
|
|
2093
|
+
var _el$165 = _$getNextElement(_tmpl$23),
|
|
2094
|
+
_el$166 = _el$165.firstChild,
|
|
2095
|
+
_el$167 = _el$166.nextSibling,
|
|
2096
|
+
[_el$168, _co$42] = _$getNextMarker(_el$167.nextSibling);
|
|
2097
|
+
_$insert(_el$165, () => props.error, _el$168, _co$42);
|
|
2098
|
+
return _el$165;
|
|
1929
2099
|
}
|
|
1930
2100
|
}), _$memo(formatRow), (() => {
|
|
1931
|
-
var _el$
|
|
1932
|
-
_$insert(_el$
|
|
2101
|
+
var _el$169 = _$getNextElement(_tmpl$40);
|
|
2102
|
+
_$insert(_el$169, _$createComponent(Show, {
|
|
1933
2103
|
get when() {
|
|
1934
|
-
return
|
|
2104
|
+
return footer();
|
|
1935
2105
|
},
|
|
1936
2106
|
get fallback() {
|
|
1937
2107
|
return [(() => {
|
|
1938
|
-
var _el$
|
|
1939
|
-
_el$
|
|
1940
|
-
[_el$
|
|
1941
|
-
_el$
|
|
1942
|
-
[_el$
|
|
1943
|
-
_el$
|
|
1944
|
-
[_el$
|
|
1945
|
-
_el$
|
|
1946
|
-
[_el$
|
|
1947
|
-
_el$
|
|
1948
|
-
[_el$
|
|
1949
|
-
_el$
|
|
1950
|
-
[_el$
|
|
1951
|
-
_el$
|
|
1952
|
-
[_el$
|
|
1953
|
-
_$insert(_el$
|
|
1954
|
-
_$insert(_el$
|
|
2108
|
+
var _el$170 = _$getNextElement(_tmpl$41),
|
|
2109
|
+
_el$171 = _el$170.firstChild,
|
|
2110
|
+
[_el$172, _co$43] = _$getNextMarker(_el$171.nextSibling),
|
|
2111
|
+
_el$173 = _el$172.nextSibling,
|
|
2112
|
+
[_el$174, _co$44] = _$getNextMarker(_el$173.nextSibling),
|
|
2113
|
+
_el$175 = _el$174.nextSibling,
|
|
2114
|
+
[_el$176, _co$45] = _$getNextMarker(_el$175.nextSibling),
|
|
2115
|
+
_el$177 = _el$176.nextSibling,
|
|
2116
|
+
[_el$178, _co$46] = _$getNextMarker(_el$177.nextSibling),
|
|
2117
|
+
_el$179 = _el$178.nextSibling,
|
|
2118
|
+
[_el$180, _co$47] = _$getNextMarker(_el$179.nextSibling),
|
|
2119
|
+
_el$181 = _el$180.nextSibling,
|
|
2120
|
+
[_el$182, _co$48] = _$getNextMarker(_el$181.nextSibling),
|
|
2121
|
+
_el$183 = _el$182.nextSibling,
|
|
2122
|
+
[_el$184, _co$49] = _$getNextMarker(_el$183.nextSibling);
|
|
2123
|
+
_$insert(_el$170, () => props.footerTools, _el$172, _co$43);
|
|
2124
|
+
_$insert(_el$170, _$createComponent(Show, {
|
|
1955
2125
|
get when() {
|
|
1956
2126
|
return hasAddMenu();
|
|
1957
2127
|
},
|
|
1958
2128
|
get children() {
|
|
1959
2129
|
return addMenu("ti ti-plus");
|
|
1960
2130
|
}
|
|
1961
|
-
}), _el$
|
|
1962
|
-
_$insert(_el$
|
|
1963
|
-
_$insert(_el$
|
|
1964
|
-
_$insert(_el$
|
|
1965
|
-
_$insert(_el$
|
|
2131
|
+
}), _el$174, _co$44);
|
|
2132
|
+
_$insert(_el$170, fileInput, _el$176, _co$45);
|
|
2133
|
+
_$insert(_el$170, formatToggle, _el$178, _co$46);
|
|
2134
|
+
_$insert(_el$170, emojiButton, _el$180, _co$47);
|
|
2135
|
+
_$insert(_el$170, _$createComponent(Show, {
|
|
1966
2136
|
get when() {
|
|
1967
2137
|
return (props.models?.length ?? 0) > 0;
|
|
1968
2138
|
},
|
|
@@ -1987,31 +2157,43 @@ export function ChatComposer(props) {
|
|
|
1987
2157
|
image: model.image
|
|
1988
2158
|
}));
|
|
1989
2159
|
},
|
|
2160
|
+
get open() {
|
|
2161
|
+
return modelOpen();
|
|
2162
|
+
},
|
|
2163
|
+
onOpenChange: open => {
|
|
2164
|
+
if (!choosingModel()) return;
|
|
2165
|
+
setModelOpen(open);
|
|
2166
|
+
// Dropdown closes before committing the choice; let onValueChange settle it first.
|
|
2167
|
+
if (!open) queueMicrotask(() => {
|
|
2168
|
+
if (!modelOpen()) finishModelSelection(null);
|
|
2169
|
+
});
|
|
2170
|
+
},
|
|
1990
2171
|
get disabled() {
|
|
1991
|
-
return blocked() || running() || !props.onModelChange;
|
|
2172
|
+
return (choosingModel() ? blockedBesidesCommand() : blocked()) || running() || !props.onModelChange;
|
|
1992
2173
|
},
|
|
1993
2174
|
onValueChange: modelId => {
|
|
1994
2175
|
props.onModelChange?.(modelId);
|
|
2176
|
+
finishModelSelection(modelId);
|
|
1995
2177
|
queueMicrotask(focus);
|
|
1996
2178
|
}
|
|
1997
2179
|
});
|
|
1998
2180
|
}
|
|
1999
|
-
}), _el$
|
|
2000
|
-
_$insert(_el$
|
|
2001
|
-
return _el$
|
|
2181
|
+
}), _el$182, _co$48);
|
|
2182
|
+
_$insert(_el$170, () => props.modelDetails, _el$184, _co$49);
|
|
2183
|
+
return _el$170;
|
|
2002
2184
|
})(), (() => {
|
|
2003
|
-
var _el$
|
|
2004
|
-
_el$
|
|
2005
|
-
[_el$
|
|
2006
|
-
_el$
|
|
2007
|
-
[_el$
|
|
2008
|
-
_el$
|
|
2009
|
-
[_el$
|
|
2010
|
-
_el$
|
|
2011
|
-
[_el$
|
|
2012
|
-
_el$
|
|
2013
|
-
[_el$
|
|
2014
|
-
_$insert(_el$
|
|
2185
|
+
var _el$185 = _$getNextElement(_tmpl$42),
|
|
2186
|
+
_el$186 = _el$185.firstChild,
|
|
2187
|
+
[_el$187, _co$50] = _$getNextMarker(_el$186.nextSibling),
|
|
2188
|
+
_el$188 = _el$187.nextSibling,
|
|
2189
|
+
[_el$189, _co$51] = _$getNextMarker(_el$188.nextSibling),
|
|
2190
|
+
_el$190 = _el$189.nextSibling,
|
|
2191
|
+
[_el$191, _co$52] = _$getNextMarker(_el$190.nextSibling),
|
|
2192
|
+
_el$192 = _el$191.nextSibling,
|
|
2193
|
+
[_el$193, _co$53] = _$getNextMarker(_el$192.nextSibling),
|
|
2194
|
+
_el$194 = _el$193.nextSibling,
|
|
2195
|
+
[_el$195, _co$54] = _$getNextMarker(_el$194.nextSibling);
|
|
2196
|
+
_$insert(_el$185, _$createComponent(For, {
|
|
2015
2197
|
get each() {
|
|
2016
2198
|
return props.contextActions;
|
|
2017
2199
|
},
|
|
@@ -2035,13 +2217,13 @@ export function ChatComposer(props) {
|
|
|
2035
2217
|
},
|
|
2036
2218
|
onClick: () => reportChatFailure(() => executeChatAction(action), props.onError),
|
|
2037
2219
|
get children() {
|
|
2038
|
-
var _el$
|
|
2039
|
-
_$effect(() => _$className(_el$
|
|
2040
|
-
return _el$
|
|
2220
|
+
var _el$196 = _$getNextElement(_tmpl$3);
|
|
2221
|
+
_$effect(() => _$className(_el$196, action.icon ?? "ti ti-dots"));
|
|
2222
|
+
return _el$196;
|
|
2041
2223
|
}
|
|
2042
2224
|
})
|
|
2043
|
-
}), _el$
|
|
2044
|
-
_$insert(_el$
|
|
2225
|
+
}), _el$187, _co$50);
|
|
2226
|
+
_$insert(_el$185, _$createComponent(Show, {
|
|
2045
2227
|
get when() {
|
|
2046
2228
|
return _$memo(() => !!hasContextUsage())() ? props.contextUsage ?? {} : undefined;
|
|
2047
2229
|
},
|
|
@@ -2053,16 +2235,18 @@ export function ChatComposer(props) {
|
|
|
2053
2235
|
return props.onError;
|
|
2054
2236
|
}
|
|
2055
2237
|
}))
|
|
2056
|
-
}), _el$
|
|
2057
|
-
_$insert(_el$
|
|
2058
|
-
_$insert(_el$
|
|
2059
|
-
_$insert(_el$
|
|
2060
|
-
return _el$
|
|
2238
|
+
}), _el$189, _co$51);
|
|
2239
|
+
_$insert(_el$185, () => props.submitTools, _el$191, _co$52);
|
|
2240
|
+
_$insert(_el$185, microphoneControl, _el$193, _co$53);
|
|
2241
|
+
_$insert(_el$185, sendControl, _el$195, _co$54);
|
|
2242
|
+
return _el$185;
|
|
2061
2243
|
})()];
|
|
2062
2244
|
},
|
|
2063
|
-
children
|
|
2245
|
+
get children() {
|
|
2246
|
+
return footer();
|
|
2247
|
+
}
|
|
2064
2248
|
}));
|
|
2065
|
-
return _el$
|
|
2249
|
+
return _el$169;
|
|
2066
2250
|
})()];
|
|
2067
2251
|
},
|
|
2068
2252
|
get children() {
|
|
@@ -2071,43 +2255,43 @@ export function ChatComposer(props) {
|
|
|
2071
2255
|
return props.error;
|
|
2072
2256
|
},
|
|
2073
2257
|
get children() {
|
|
2074
|
-
var _el$
|
|
2075
|
-
_el$
|
|
2076
|
-
_el$
|
|
2077
|
-
[_el$
|
|
2078
|
-
_$insert(_el$
|
|
2079
|
-
return _el$
|
|
2258
|
+
var _el$73 = _$getNextElement(_tmpl$23),
|
|
2259
|
+
_el$74 = _el$73.firstChild,
|
|
2260
|
+
_el$75 = _el$74.nextSibling,
|
|
2261
|
+
[_el$76, _co$13] = _$getNextMarker(_el$75.nextSibling);
|
|
2262
|
+
_$insert(_el$73, () => props.error, _el$76, _co$13);
|
|
2263
|
+
return _el$73;
|
|
2080
2264
|
}
|
|
2081
2265
|
}), _$memo(() => formatRow()), (() => {
|
|
2082
|
-
var _el$
|
|
2083
|
-
_el$
|
|
2084
|
-
[_el$
|
|
2085
|
-
_el$
|
|
2086
|
-
[_el$
|
|
2087
|
-
_el$
|
|
2088
|
-
_el$
|
|
2089
|
-
[_el$
|
|
2090
|
-
_el$
|
|
2091
|
-
_el$
|
|
2092
|
-
[_el$
|
|
2093
|
-
_el$
|
|
2094
|
-
[_el$
|
|
2095
|
-
_el$
|
|
2096
|
-
[_el$
|
|
2097
|
-
_el$
|
|
2098
|
-
[_el$
|
|
2099
|
-
_$insert(_el$
|
|
2100
|
-
_$insert(_el$
|
|
2101
|
-
_$insert(_el$
|
|
2102
|
-
_$insert(_el$
|
|
2103
|
-
_$insert(_el$
|
|
2104
|
-
_$insert(_el$
|
|
2105
|
-
_$insert(_el$
|
|
2106
|
-
return _el$
|
|
2266
|
+
var _el$77 = _$getNextElement(_tmpl$24),
|
|
2267
|
+
_el$88 = _el$77.firstChild,
|
|
2268
|
+
[_el$89, _co$18] = _$getNextMarker(_el$88.nextSibling),
|
|
2269
|
+
_el$90 = _el$89.nextSibling,
|
|
2270
|
+
[_el$91, _co$19] = _$getNextMarker(_el$90.nextSibling),
|
|
2271
|
+
_el$78 = _el$91.nextSibling,
|
|
2272
|
+
_el$86 = _el$78.firstChild,
|
|
2273
|
+
[_el$87, _co$17] = _$getNextMarker(_el$86.nextSibling),
|
|
2274
|
+
_el$79 = _el$87.nextSibling,
|
|
2275
|
+
_el$80 = _el$79.firstChild,
|
|
2276
|
+
[_el$81, _co$14] = _$getNextMarker(_el$80.nextSibling),
|
|
2277
|
+
_el$82 = _el$81.nextSibling,
|
|
2278
|
+
[_el$83, _co$15] = _$getNextMarker(_el$82.nextSibling),
|
|
2279
|
+
_el$84 = _el$83.nextSibling,
|
|
2280
|
+
[_el$85, _co$16] = _$getNextMarker(_el$84.nextSibling),
|
|
2281
|
+
_el$92 = _el$78.nextSibling,
|
|
2282
|
+
[_el$93, _co$20] = _$getNextMarker(_el$92.nextSibling);
|
|
2283
|
+
_$insert(_el$77, attachControl, _el$89, _co$18);
|
|
2284
|
+
_$insert(_el$77, fileInput, _el$91, _co$19);
|
|
2285
|
+
_$insert(_el$78, field, _el$87, _co$17);
|
|
2286
|
+
_$insert(_el$79, formatToggle, _el$81, _co$14);
|
|
2287
|
+
_$insert(_el$79, emojiButton, _el$83, _co$15);
|
|
2288
|
+
_$insert(_el$79, microphoneControl, _el$85, _co$16);
|
|
2289
|
+
_$insert(_el$77, sendControl, _el$93, _co$20);
|
|
2290
|
+
return _el$77;
|
|
2107
2291
|
})()];
|
|
2108
2292
|
}
|
|
2109
|
-
}), _el$
|
|
2110
|
-
_$insert(_el$
|
|
2293
|
+
}), _el$99, _co$23);
|
|
2294
|
+
_$insert(_el$70, _$createComponent(Show, {
|
|
2111
2295
|
get when() {
|
|
2112
2296
|
return props.fileSelection;
|
|
2113
2297
|
},
|
|
@@ -2126,60 +2310,60 @@ export function ChatComposer(props) {
|
|
|
2126
2310
|
},
|
|
2127
2311
|
onDrop: files => void runFiles(files)
|
|
2128
2312
|
})
|
|
2129
|
-
}), _el$
|
|
2130
|
-
_$insert(_el$
|
|
2313
|
+
}), _el$101, _co$24);
|
|
2314
|
+
_$insert(_el$102, _$createComponent(Show, {
|
|
2131
2315
|
get when() {
|
|
2132
2316
|
return suggestionAnnouncement();
|
|
2133
2317
|
},
|
|
2134
2318
|
keyed: true,
|
|
2135
2319
|
children: announced => (() => {
|
|
2136
|
-
var _el$
|
|
2137
|
-
_$insert(_el$
|
|
2138
|
-
return _el$
|
|
2320
|
+
var _el$197 = _$getNextElement(_tmpl$10);
|
|
2321
|
+
_$insert(_el$197, () => announced.text);
|
|
2322
|
+
return _el$197;
|
|
2139
2323
|
})()
|
|
2140
2324
|
}));
|
|
2141
|
-
_$insert(_el$
|
|
2325
|
+
_$insert(_el$103, _$createComponent(Show, {
|
|
2142
2326
|
get when() {
|
|
2143
2327
|
return _$memo(() => !!!suggestionsOpen())() && commandStatus();
|
|
2144
2328
|
},
|
|
2145
2329
|
children: status => (() => {
|
|
2146
|
-
var _el$
|
|
2147
|
-
_el$
|
|
2148
|
-
_el$
|
|
2149
|
-
_$insert(_el$
|
|
2330
|
+
var _el$198 = _$getNextElement(_tmpl$43),
|
|
2331
|
+
_el$199 = _el$198.firstChild,
|
|
2332
|
+
_el$200 = _el$199.nextSibling;
|
|
2333
|
+
_$insert(_el$200, () => status().text);
|
|
2150
2334
|
_$effect(_p$ => {
|
|
2151
2335
|
var _v$44 = status().tone,
|
|
2152
2336
|
_v$45 = status().tone === "busy" ? "ti ti-loader-2 k2b-spin" : status().tone === "done" ? "ti ti-check" : "ti ti-alert-circle";
|
|
2153
|
-
_v$44 !== _p$.e && _$setAttribute(_el$
|
|
2154
|
-
_v$45 !== _p$.t && _$className(_el$
|
|
2337
|
+
_v$44 !== _p$.e && _$setAttribute(_el$198, "data-tone", _p$.e = _v$44);
|
|
2338
|
+
_v$45 !== _p$.t && _$className(_el$199, _p$.t = _v$45);
|
|
2155
2339
|
return _p$;
|
|
2156
2340
|
}, {
|
|
2157
2341
|
e: undefined,
|
|
2158
2342
|
t: undefined
|
|
2159
2343
|
});
|
|
2160
|
-
return _el$
|
|
2344
|
+
return _el$198;
|
|
2161
2345
|
})()
|
|
2162
|
-
}), _el$
|
|
2163
|
-
_$insert(_el$
|
|
2346
|
+
}), _el$105, _co$25);
|
|
2347
|
+
_$insert(_el$103, _$createComponent(Show, {
|
|
2164
2348
|
get when() {
|
|
2165
2349
|
return _$memo(() => !!suggestionsOpen())() && announcement();
|
|
2166
2350
|
},
|
|
2167
2351
|
keyed: true,
|
|
2168
2352
|
children: announced => (() => {
|
|
2169
|
-
var _el$
|
|
2170
|
-
_$insert(_el$
|
|
2171
|
-
return _el$
|
|
2353
|
+
var _el$201 = _$getNextElement(_tmpl$44);
|
|
2354
|
+
_$insert(_el$201, () => announced.text);
|
|
2355
|
+
return _el$201;
|
|
2172
2356
|
})()
|
|
2173
|
-
}), _el$
|
|
2357
|
+
}), _el$107, _co$26);
|
|
2174
2358
|
_$effect(_p$ => {
|
|
2175
2359
|
var _v$24 = `k2b-chat-composer ${props.class ?? ""}`,
|
|
2176
2360
|
_v$25 = running() ? "true" : undefined,
|
|
2177
2361
|
_v$26 = conversation() ? "conversation" : undefined,
|
|
2178
2362
|
_v$27 = props.label ?? chatMessages().messageComposer;
|
|
2179
|
-
_v$24 !== _p$.e && _$className(_el$
|
|
2180
|
-
_v$25 !== _p$.t && _$setAttribute(_el$
|
|
2181
|
-
_v$26 !== _p$.a && _$setAttribute(_el$
|
|
2182
|
-
_v$27 !== _p$.o && _$setAttribute(_el$
|
|
2363
|
+
_v$24 !== _p$.e && _$className(_el$70, _p$.e = _v$24);
|
|
2364
|
+
_v$25 !== _p$.t && _$setAttribute(_el$70, "data-running", _p$.t = _v$25);
|
|
2365
|
+
_v$26 !== _p$.a && _$setAttribute(_el$70, "data-variant", _p$.a = _v$26);
|
|
2366
|
+
_v$27 !== _p$.o && _$setAttribute(_el$70, "aria-label", _p$.o = _v$27);
|
|
2183
2367
|
return _p$;
|
|
2184
2368
|
}, {
|
|
2185
2369
|
e: undefined,
|
|
@@ -2187,8 +2371,8 @@ export function ChatComposer(props) {
|
|
|
2187
2371
|
a: undefined,
|
|
2188
2372
|
o: undefined
|
|
2189
2373
|
});
|
|
2190
|
-
return _el$
|
|
2374
|
+
return _el$42;
|
|
2191
2375
|
})();
|
|
2192
2376
|
}
|
|
2193
|
-
_$delegateEvents(["input", "click", "keyup", "beforeinput", "keydown", "
|
|
2377
|
+
_$delegateEvents(["input", "click", "keyup", "beforeinput", "keydown", "mousedown"]);
|
|
2194
2378
|
//# sourceMappingURL=ChatComposer.js.map
|