@k2b/ui 0.17.0 → 0.18.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.
Files changed (88) hide show
  1. package/dist/browser/chat/ChatComposer.js +261 -274
  2. package/dist/browser/chat/ChatComposer.js.map +1 -1
  3. package/dist/browser/chat/ChatPrimitives.js +9 -6
  4. package/dist/browser/chat/ChatPrimitives.js.map +1 -1
  5. package/dist/browser/content/FileView.js +62 -36
  6. package/dist/browser/content/FileView.js.map +1 -1
  7. package/dist/browser/content/MarkdownView.js +9 -3
  8. package/dist/browser/content/MarkdownView.js.map +1 -1
  9. package/dist/browser/content/VideoPlayer.js +279 -0
  10. package/dist/browser/content/VideoPlayer.js.map +1 -0
  11. package/dist/browser/content/file-view-preview.js +2 -2
  12. package/dist/browser/content/file-view-preview.js.map +1 -1
  13. package/dist/browser/content/index.js +2 -0
  14. package/dist/browser/content/index.js.map +1 -1
  15. package/dist/browser/content/markdown-links.js +178 -0
  16. package/dist/browser/content/markdown-links.js.map +1 -0
  17. package/dist/browser/inputs/FileDropTarget.js +129 -0
  18. package/dist/browser/inputs/FileDropTarget.js.map +1 -0
  19. package/dist/browser/inputs/FileInputs.js +37 -11
  20. package/dist/browser/inputs/FileInputs.js.map +1 -1
  21. package/dist/browser/inputs/file-drop.js +338 -0
  22. package/dist/browser/inputs/file-drop.js.map +1 -0
  23. package/dist/browser/inputs/index.js +1 -0
  24. package/dist/browser/inputs/index.js.map +1 -1
  25. package/dist/browser/inputs/markdown/MarkdownEditor.js +72 -78
  26. package/dist/browser/inputs/markdown/MarkdownEditor.js.map +1 -1
  27. package/dist/browser/intl/messages.js +97 -4
  28. package/dist/browser/intl/messages.js.map +1 -1
  29. package/dist/browser/layout/AppWorkspace.js +210 -44
  30. package/dist/browser/layout/AppWorkspace.js.map +1 -1
  31. package/dist/browser/layout/Navigation.js +274 -197
  32. package/dist/browser/layout/Navigation.js.map +1 -1
  33. package/dist/browser/layout/index.js.map +1 -1
  34. package/dist/browser/layout/navigation-model.js +2 -0
  35. package/dist/browser/layout/navigation-model.js.map +1 -1
  36. package/dist/browser/surfaces/NoticeCard.js +47 -44
  37. package/dist/browser/surfaces/NoticeCard.js.map +1 -1
  38. package/dist/ssr/chat/ChatComposer.js +59 -48
  39. package/dist/ssr/chat/ChatComposer.js.map +1 -1
  40. package/dist/ssr/chat/ChatPrimitives.js +9 -6
  41. package/dist/ssr/chat/ChatPrimitives.js.map +1 -1
  42. package/dist/ssr/content/FileView.js +30 -6
  43. package/dist/ssr/content/FileView.js.map +1 -1
  44. package/dist/ssr/content/MarkdownView.js +9 -3
  45. package/dist/ssr/content/MarkdownView.js.map +1 -1
  46. package/dist/ssr/content/VideoPlayer.js +208 -0
  47. package/dist/ssr/content/VideoPlayer.js.map +1 -0
  48. package/dist/ssr/content/file-view-preview.js +2 -2
  49. package/dist/ssr/content/file-view-preview.js.map +1 -1
  50. package/dist/ssr/content/index.js +2 -0
  51. package/dist/ssr/content/index.js.map +1 -1
  52. package/dist/ssr/content/markdown-links.js +178 -0
  53. package/dist/ssr/content/markdown-links.js.map +1 -0
  54. package/dist/ssr/inputs/FileDropTarget.js +103 -0
  55. package/dist/ssr/inputs/FileDropTarget.js.map +1 -0
  56. package/dist/ssr/inputs/FileInputs.js +32 -10
  57. package/dist/ssr/inputs/FileInputs.js.map +1 -1
  58. package/dist/ssr/inputs/file-drop.js +338 -0
  59. package/dist/ssr/inputs/file-drop.js.map +1 -0
  60. package/dist/ssr/inputs/index.js +1 -0
  61. package/dist/ssr/inputs/index.js.map +1 -1
  62. package/dist/ssr/inputs/markdown/MarkdownEditor.js +14 -2
  63. package/dist/ssr/inputs/markdown/MarkdownEditor.js.map +1 -1
  64. package/dist/ssr/intl/messages.js +97 -4
  65. package/dist/ssr/intl/messages.js.map +1 -1
  66. package/dist/ssr/layout/AppWorkspace.js +173 -27
  67. package/dist/ssr/layout/AppWorkspace.js.map +1 -1
  68. package/dist/ssr/layout/Navigation.js +169 -122
  69. package/dist/ssr/layout/Navigation.js.map +1 -1
  70. package/dist/ssr/layout/index.js.map +1 -1
  71. package/dist/ssr/layout/navigation-model.js +2 -0
  72. package/dist/ssr/layout/navigation-model.js.map +1 -1
  73. package/dist/ssr/surfaces/NoticeCard.js +17 -12
  74. package/dist/ssr/surfaces/NoticeCard.js.map +1 -1
  75. package/dist/styles.css +1 -1
  76. package/dist/types/chat/ChatPrimitives.d.ts +1 -1
  77. package/dist/types/content/VideoPlayer.d.ts +41 -0
  78. package/dist/types/content/index.d.ts +2 -0
  79. package/dist/types/content/markdown-links.d.ts +66 -0
  80. package/dist/types/inputs/FileDropTarget.d.ts +23 -0
  81. package/dist/types/inputs/FileInputs.d.ts +2 -0
  82. package/dist/types/inputs/file-drop.d.ts +80 -0
  83. package/dist/types/inputs/index.d.ts +2 -0
  84. package/dist/types/intl/messages.d.ts +47 -0
  85. package/dist/types/layout/AppWorkspace.d.ts +21 -0
  86. package/dist/types/layout/index.d.ts +2 -2
  87. package/dist/types/layout/navigation-model.d.ts +18 -0
  88. package/package.json +1 -1
@@ -20,26 +20,26 @@ var _tmpl$ = /*#__PURE__*/_$template(`<span><strong>`),
20
20
  _tmpl$5 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer-accessory><div class=k2b-chat-composer__commands role=listbox><!$><!/><!$><!/><!$><!/><!$><!/>`),
21
21
  _tmpl$6 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer-slot><div></div><!$><!/>`),
22
22
  _tmpl$7 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__attachments role=list tabindex=0>`),
23
- _tmpl$8 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__drop aria-hidden=true>`),
24
- _tmpl$9 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__highlight aria-hidden=true><!$><!/>\n`),
25
- _tmpl$0 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__error role=alert><i class="ti ti-alert-circle"aria-hidden=true></i><!$><!/>`),
26
- _tmpl$1 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer-shell><!$><!/><section role=group><!$><!/><div class=k2b-chat-composer__input role=group><!$><!/><!$><!/><textarea rows=1></textarea></div><!$><!/><footer class=k2b-chat-composer__footer>`),
27
- _tmpl$10 = /*#__PURE__*/_$template(`<button type=button role=option tabindex=-1><i aria-hidden=true></i><strong></strong><small>`),
28
- _tmpl$11 = /*#__PURE__*/_$template(`<button type=button class=k2b-chat-composer__attachment-remove><i class="ti ti-x"aria-hidden=true>`),
29
- _tmpl$12 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__attachment role=listitem><div class=k2b-chat-composer__attachment-content><!$><!/><!$><!/></div><!$><!/>`),
30
- _tmpl$13 = /*#__PURE__*/_$template(`<img>`),
31
- _tmpl$14 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__attachment-identity><!$><!/><!$><!/>`),
32
- _tmpl$15 = /*#__PURE__*/_$template(`<i aria-hidden=true>`),
33
- _tmpl$16 = /*#__PURE__*/_$template(`<a class=k2b-chat-composer__attachment-link target=_blank rel="noopener noreferrer"><!$><!/><!$><!/>`),
34
- _tmpl$17 = /*#__PURE__*/_$template(`<button type=button class=k2b-chat-composer__attachment-action><!$><!/><!$><!/>`),
35
- _tmpl$18 = /*#__PURE__*/_$template(`<span>`),
36
- _tmpl$19 = /*#__PURE__*/_$template(`<i class="ti ti-plus"aria-hidden=true>`),
37
- _tmpl$20 = /*#__PURE__*/_$template(`<input class=k2b-sr-only type=file tabindex=-1 aria-hidden=true>`),
38
- _tmpl$21 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__tools><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/>`),
39
- _tmpl$22 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__submit><!$><!/><!$><!/><!$><!/><!$><!/>`);
23
+ _tmpl$8 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__highlight aria-hidden=true><!$><!/>\n`),
24
+ _tmpl$9 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__error role=alert><i class="ti ti-alert-circle"aria-hidden=true></i><!$><!/>`),
25
+ _tmpl$0 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer-shell><!$><!/><section role=group><!$><!/><div class=k2b-chat-composer__input role=group><!$><!/><textarea rows=1></textarea></div><!$><!/><footer class=k2b-chat-composer__footer></footer><!$><!/>`),
26
+ _tmpl$1 = /*#__PURE__*/_$template(`<button type=button role=option tabindex=-1><i aria-hidden=true></i><strong></strong><small>`),
27
+ _tmpl$10 = /*#__PURE__*/_$template(`<button type=button class=k2b-chat-composer__attachment-remove><i class="ti ti-x"aria-hidden=true>`),
28
+ _tmpl$11 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__attachment role=listitem><div class=k2b-chat-composer__attachment-content><!$><!/><!$><!/></div><!$><!/>`),
29
+ _tmpl$12 = /*#__PURE__*/_$template(`<img>`),
30
+ _tmpl$13 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__attachment-identity><!$><!/><!$><!/>`),
31
+ _tmpl$14 = /*#__PURE__*/_$template(`<i aria-hidden=true>`),
32
+ _tmpl$15 = /*#__PURE__*/_$template(`<a class=k2b-chat-composer__attachment-link target=_blank rel="noopener noreferrer"><!$><!/><!$><!/>`),
33
+ _tmpl$16 = /*#__PURE__*/_$template(`<button type=button class=k2b-chat-composer__attachment-action><!$><!/><!$><!/>`),
34
+ _tmpl$17 = /*#__PURE__*/_$template(`<span>`),
35
+ _tmpl$18 = /*#__PURE__*/_$template(`<i class="ti ti-plus"aria-hidden=true>`),
36
+ _tmpl$19 = /*#__PURE__*/_$template(`<input class=k2b-sr-only type=file tabindex=-1 aria-hidden=true>`),
37
+ _tmpl$20 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__tools><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/>`),
38
+ _tmpl$21 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__submit><!$><!/><!$><!/><!$><!/><!$><!/>`);
40
39
  import { children, createEffect, createMemo, createSignal, createUniqueId, For, onCleanup, onMount, Show, untrack } from "solid-js";
41
40
  import { Dropdown } from "../actions/Dropdown";
42
41
  import { Tooltip } from "../feedback/Tooltip";
42
+ import { FileDropTarget } from "../inputs/FileDropTarget";
43
43
  import { SelectChip } from "../inputs/SelectChip";
44
44
  import { useUiMessages } from "../intl/messages";
45
45
  import { ChatContextUsage as ContextUsage } from "./ChatPrimitives";
@@ -55,7 +55,6 @@ export function ChatComposer(props) {
55
55
  const messages = useUiMessages();
56
56
  const commandListId = `k2b-chat-commands-${createUniqueId().replace(/[^A-Za-z0-9_-]/g, "-")}`;
57
57
  const [selectedCommandIndex, setSelectedCommandIndex] = createSignal(0);
58
- const [dragActive, setDragActive] = createSignal(false);
59
58
  const [addingFiles, setAddingFiles] = createSignal(false);
60
59
  const [submitting, setSubmitting] = createSignal(false);
61
60
  let composerRef;
@@ -396,21 +395,21 @@ export function ChatComposer(props) {
396
395
  }
397
396
  };
398
397
  return (() => {
399
- var _el$3 = _$getNextElement(_tmpl$1),
400
- _el$47 = _el$3.firstChild,
401
- [_el$48, _co$11] = _$getNextMarker(_el$47.nextSibling),
402
- _el$25 = _el$48.nextSibling,
403
- _el$43 = _el$25.firstChild,
404
- [_el$44, _co$1] = _$getNextMarker(_el$43.nextSibling),
405
- _el$27 = _el$44.nextSibling,
406
- _el$34 = _el$27.firstChild,
407
- [_el$35, _co$8] = _$getNextMarker(_el$34.nextSibling),
408
- _el$36 = _el$35.nextSibling,
409
- [_el$37, _co$9] = _$getNextMarker(_el$36.nextSibling),
410
- _el$33 = _el$37.nextSibling,
411
- _el$45 = _el$27.nextSibling,
412
- [_el$46, _co$10] = _$getNextMarker(_el$45.nextSibling),
413
- _el$42 = _el$46.nextSibling;
398
+ var _el$3 = _$getNextElement(_tmpl$0),
399
+ _el$46 = _el$3.firstChild,
400
+ [_el$47, _co$11] = _$getNextMarker(_el$46.nextSibling),
401
+ _el$25 = _el$47.nextSibling,
402
+ _el$40 = _el$25.firstChild,
403
+ [_el$41, _co$0] = _$getNextMarker(_el$40.nextSibling),
404
+ _el$27 = _el$41.nextSibling,
405
+ _el$33 = _el$27.firstChild,
406
+ [_el$34, _co$8] = _$getNextMarker(_el$33.nextSibling),
407
+ _el$32 = _el$34.nextSibling,
408
+ _el$42 = _el$27.nextSibling,
409
+ [_el$43, _co$1] = _$getNextMarker(_el$42.nextSibling),
410
+ _el$39 = _el$43.nextSibling,
411
+ _el$44 = _el$39.nextSibling,
412
+ [_el$45, _co$10] = _$getNextMarker(_el$44.nextSibling);
414
413
  _$insert(_el$3, _$createComponent(Show, {
415
414
  get when() {
416
415
  return commandsOpen() || hasAccessory();
@@ -444,25 +443,25 @@ export function ChatComposer(props) {
444
443
  return commandMatches();
445
444
  },
446
445
  children: (command, index) => (() => {
447
- var _el$49 = _$getNextElement(_tmpl$10),
448
- _el$50 = _el$49.firstChild,
449
- _el$51 = _el$50.nextSibling,
450
- _el$52 = _el$51.nextSibling;
451
- _el$49.$$click = () => void executeCommand(command);
452
- _el$49.$$pointerdown = event => event.preventDefault();
453
- _$insert(_el$51, () => command.label ?? `/${command.name}`);
454
- _$insert(_el$52, () => command.description);
446
+ var _el$48 = _$getNextElement(_tmpl$1),
447
+ _el$49 = _el$48.firstChild,
448
+ _el$50 = _el$49.nextSibling,
449
+ _el$51 = _el$50.nextSibling;
450
+ _el$48.$$click = () => void executeCommand(command);
451
+ _el$48.$$pointerdown = event => event.preventDefault();
452
+ _$insert(_el$50, () => command.label ?? `/${command.name}`);
453
+ _$insert(_el$51, () => command.description);
455
454
  _$effect(_p$ => {
456
- var _v$15 = `${commandListId}-${index()}`,
457
- _v$16 = index() === selectedCommandIndex(),
458
- _v$17 = command.disabled,
459
- _v$18 = index() === selectedCommandIndex() ? "true" : undefined,
460
- _v$19 = command.icon ?? "ti ti-slash";
461
- _v$15 !== _p$.e && _$setAttribute(_el$49, "id", _p$.e = _v$15);
462
- _v$16 !== _p$.t && _$setAttribute(_el$49, "aria-selected", _p$.t = _v$16);
463
- _v$17 !== _p$.a && _$setAttribute(_el$49, "aria-disabled", _p$.a = _v$17);
464
- _v$18 !== _p$.o && _$setAttribute(_el$49, "data-active", _p$.o = _v$18);
465
- _v$19 !== _p$.i && _$className(_el$50, _p$.i = _v$19);
455
+ var _v$14 = `${commandListId}-${index()}`,
456
+ _v$15 = index() === selectedCommandIndex(),
457
+ _v$16 = command.disabled,
458
+ _v$17 = index() === selectedCommandIndex() ? "true" : undefined,
459
+ _v$18 = command.icon ?? "ti ti-slash";
460
+ _v$14 !== _p$.e && _$setAttribute(_el$48, "id", _p$.e = _v$14);
461
+ _v$15 !== _p$.t && _$setAttribute(_el$48, "aria-selected", _p$.t = _v$15);
462
+ _v$16 !== _p$.a && _$setAttribute(_el$48, "aria-disabled", _p$.a = _v$16);
463
+ _v$17 !== _p$.o && _$setAttribute(_el$48, "data-active", _p$.o = _v$17);
464
+ _v$18 !== _p$.i && _$className(_el$49, _p$.i = _v$18);
466
465
  return _p$;
467
466
  }, {
468
467
  e: undefined,
@@ -472,7 +471,7 @@ export function ChatComposer(props) {
472
471
  i: undefined
473
472
  });
474
473
  _$runHydrationEvents();
475
- return _el$49;
474
+ return _el$48;
476
475
  })()
477
476
  }), _el$16, _co$2);
478
477
  _$insert(_el$7, _$createComponent(Show, {
@@ -527,7 +526,7 @@ export function ChatComposer(props) {
527
526
  });
528
527
  return _el$4;
529
528
  }
530
- }), _el$48, _co$11);
529
+ }), _el$47, _co$11);
531
530
  var _ref$2 = composerRef;
532
531
  typeof _ref$2 === "function" ? _$use(_ref$2, _el$25) : composerRef = _el$25;
533
532
  _$insert(_el$25, _$createComponent(Show, {
@@ -541,238 +540,209 @@ export function ChatComposer(props) {
541
540
  return attachments();
542
541
  },
543
542
  children: attachment => (() => {
544
- var _el$53 = _$getNextElement(_tmpl$12),
543
+ var _el$52 = _$getNextElement(_tmpl$11),
544
+ _el$53 = _el$52.firstChild,
545
545
  _el$54 = _el$53.firstChild,
546
- _el$55 = _el$54.firstChild,
547
- [_el$56, _co$12] = _$getNextMarker(_el$55.nextSibling),
548
- _el$57 = _el$56.nextSibling,
549
- [_el$58, _co$13] = _$getNextMarker(_el$57.nextSibling),
550
- _el$60 = _el$54.nextSibling,
551
- [_el$61, _co$14] = _$getNextMarker(_el$60.nextSibling);
552
- _$insert(_el$54, _$createComponent(Show, {
546
+ [_el$55, _co$12] = _$getNextMarker(_el$54.nextSibling),
547
+ _el$56 = _el$55.nextSibling,
548
+ [_el$57, _co$13] = _$getNextMarker(_el$56.nextSibling),
549
+ _el$59 = _el$53.nextSibling,
550
+ [_el$60, _co$14] = _$getNextMarker(_el$59.nextSibling);
551
+ _$insert(_el$53, _$createComponent(Show, {
553
552
  get when() {
554
553
  return attachment.href;
555
554
  },
556
555
  get fallback() {
557
556
  return (() => {
558
- var _el$62 = _$getNextElement(_tmpl$14),
559
- _el$64 = _el$62.firstChild,
560
- [_el$65, _co$15] = _$getNextMarker(_el$64.nextSibling),
561
- _el$66 = _el$65.nextSibling,
562
- [_el$67, _co$16] = _$getNextMarker(_el$66.nextSibling);
563
- _$insert(_el$62, _$createComponent(Show, {
557
+ var _el$61 = _$getNextElement(_tmpl$13),
558
+ _el$63 = _el$61.firstChild,
559
+ [_el$64, _co$15] = _$getNextMarker(_el$63.nextSibling),
560
+ _el$65 = _el$64.nextSibling,
561
+ [_el$66, _co$16] = _$getNextMarker(_el$65.nextSibling);
562
+ _$insert(_el$61, _$createComponent(Show, {
564
563
  get when() {
565
564
  return _$memo(() => attachment.kind === "image")() && attachment.previewUrl;
566
565
  },
567
566
  get fallback() {
568
567
  return (() => {
569
- var _el$68 = _$getNextElement(_tmpl$15);
570
- _$effect(() => _$className(_el$68, attachmentIcon(attachment)));
571
- return _el$68;
568
+ var _el$67 = _$getNextElement(_tmpl$14);
569
+ _$effect(() => _$className(_el$67, attachmentIcon(attachment)));
570
+ return _el$67;
572
571
  })();
573
572
  },
574
573
  get children() {
575
- var _el$63 = _$getNextElement(_tmpl$13);
574
+ var _el$62 = _$getNextElement(_tmpl$12);
576
575
  _$effect(_p$ => {
577
- var _v$22 = attachment.previewUrl,
578
- _v$23 = attachment.alt ?? "";
579
- _v$22 !== _p$.e && _$setAttribute(_el$63, "src", _p$.e = _v$22);
580
- _v$23 !== _p$.t && _$setAttribute(_el$63, "alt", _p$.t = _v$23);
576
+ var _v$21 = attachment.previewUrl,
577
+ _v$22 = attachment.alt ?? "";
578
+ _v$21 !== _p$.e && _$setAttribute(_el$62, "src", _p$.e = _v$21);
579
+ _v$22 !== _p$.t && _$setAttribute(_el$62, "alt", _p$.t = _v$22);
581
580
  return _p$;
582
581
  }, {
583
582
  e: undefined,
584
583
  t: undefined
585
584
  });
586
- return _el$63;
585
+ return _el$62;
587
586
  }
588
- }), _el$65, _co$15);
589
- _$insert(_el$62, () => renderAttachmentCopy(attachment), _el$67, _co$16);
590
- return _el$62;
587
+ }), _el$64, _co$15);
588
+ _$insert(_el$61, () => renderAttachmentCopy(attachment), _el$66, _co$16);
589
+ return _el$61;
591
590
  })();
592
591
  },
593
592
  children: href => (() => {
594
- var _el$69 = _$getNextElement(_tmpl$16),
595
- _el$71 = _el$69.firstChild,
596
- [_el$72, _co$17] = _$getNextMarker(_el$71.nextSibling),
597
- _el$73 = _el$72.nextSibling,
598
- [_el$74, _co$18] = _$getNextMarker(_el$73.nextSibling);
599
- _$insert(_el$69, _$createComponent(Show, {
593
+ var _el$68 = _$getNextElement(_tmpl$15),
594
+ _el$70 = _el$68.firstChild,
595
+ [_el$71, _co$17] = _$getNextMarker(_el$70.nextSibling),
596
+ _el$72 = _el$71.nextSibling,
597
+ [_el$73, _co$18] = _$getNextMarker(_el$72.nextSibling);
598
+ _$insert(_el$68, _$createComponent(Show, {
600
599
  get when() {
601
600
  return _$memo(() => attachment.kind === "image")() && attachment.previewUrl;
602
601
  },
603
602
  get fallback() {
604
603
  return (() => {
605
- var _el$75 = _$getNextElement(_tmpl$15);
606
- _$effect(() => _$className(_el$75, attachmentIcon(attachment)));
607
- return _el$75;
604
+ var _el$74 = _$getNextElement(_tmpl$14);
605
+ _$effect(() => _$className(_el$74, attachmentIcon(attachment)));
606
+ return _el$74;
608
607
  })();
609
608
  },
610
609
  get children() {
611
- var _el$70 = _$getNextElement(_tmpl$13);
610
+ var _el$69 = _$getNextElement(_tmpl$12);
612
611
  _$effect(_p$ => {
613
- var _v$24 = attachment.previewUrl,
614
- _v$25 = attachment.alt ?? "";
615
- _v$24 !== _p$.e && _$setAttribute(_el$70, "src", _p$.e = _v$24);
616
- _v$25 !== _p$.t && _$setAttribute(_el$70, "alt", _p$.t = _v$25);
612
+ var _v$23 = attachment.previewUrl,
613
+ _v$24 = attachment.alt ?? "";
614
+ _v$23 !== _p$.e && _$setAttribute(_el$69, "src", _p$.e = _v$23);
615
+ _v$24 !== _p$.t && _$setAttribute(_el$69, "alt", _p$.t = _v$24);
617
616
  return _p$;
618
617
  }, {
619
618
  e: undefined,
620
619
  t: undefined
621
620
  });
622
- return _el$70;
621
+ return _el$69;
623
622
  }
624
- }), _el$72, _co$17);
625
- _$insert(_el$69, () => renderAttachmentCopy(attachment), _el$74, _co$18);
623
+ }), _el$71, _co$17);
624
+ _$insert(_el$68, () => renderAttachmentCopy(attachment), _el$73, _co$18);
626
625
  _$effect(_p$ => {
627
- var _v$26 = href(),
628
- _v$27 = messages().openInNewTab({
626
+ var _v$25 = href(),
627
+ _v$26 = messages().openInNewTab({
629
628
  name: attachment.name
630
629
  });
631
- _v$26 !== _p$.e && _$setAttribute(_el$69, "href", _p$.e = _v$26);
632
- _v$27 !== _p$.t && _$setAttribute(_el$69, "aria-label", _p$.t = _v$27);
630
+ _v$25 !== _p$.e && _$setAttribute(_el$68, "href", _p$.e = _v$25);
631
+ _v$26 !== _p$.t && _$setAttribute(_el$68, "aria-label", _p$.t = _v$26);
633
632
  return _p$;
634
633
  }, {
635
634
  e: undefined,
636
635
  t: undefined
637
636
  });
638
- return _el$69;
637
+ return _el$68;
639
638
  })()
640
- }), _el$56, _co$12);
641
- _$insert(_el$54, _$createComponent(Show, {
639
+ }), _el$55, _co$12);
640
+ _$insert(_el$53, _$createComponent(Show, {
642
641
  get when() {
643
642
  return attachment.action;
644
643
  },
645
644
  children: action => (() => {
646
- var _el$76 = _$getNextElement(_tmpl$17),
647
- _el$77 = _el$76.firstChild,
648
- [_el$78, _co$19] = _$getNextMarker(_el$77.nextSibling),
649
- _el$79 = _el$78.nextSibling,
650
- [_el$80, _co$20] = _$getNextMarker(_el$79.nextSibling);
651
- _el$76.$$click = () => reportChatFailure(() => executeChatAction(action()), props.onError);
652
- _$insert(_el$76, _$createComponent(Show, {
645
+ var _el$75 = _$getNextElement(_tmpl$16),
646
+ _el$76 = _el$75.firstChild,
647
+ [_el$77, _co$19] = _$getNextMarker(_el$76.nextSibling),
648
+ _el$78 = _el$77.nextSibling,
649
+ [_el$79, _co$20] = _$getNextMarker(_el$78.nextSibling);
650
+ _el$75.$$click = () => reportChatFailure(() => executeChatAction(action()), props.onError);
651
+ _$insert(_el$75, _$createComponent(Show, {
653
652
  get when() {
654
653
  return action().icon;
655
654
  },
656
655
  children: icon => (() => {
657
- var _el$81 = _$getNextElement(_tmpl$15);
658
- _$effect(() => _$className(_el$81, icon()));
659
- return _el$81;
656
+ var _el$80 = _$getNextElement(_tmpl$14);
657
+ _$effect(() => _$className(_el$80, icon()));
658
+ return _el$80;
660
659
  })()
661
- }), _el$78, _co$19);
662
- _$insert(_el$76, () => action().label, _el$80, _co$20);
663
- _$effect(() => _$setProperty(_el$76, "disabled", blocked() || action().disabled));
660
+ }), _el$77, _co$19);
661
+ _$insert(_el$75, () => action().label, _el$79, _co$20);
662
+ _$effect(() => _$setProperty(_el$75, "disabled", blocked() || action().disabled));
664
663
  _$runHydrationEvents();
665
- return _el$76;
664
+ return _el$75;
666
665
  })()
667
- }), _el$58, _co$13);
668
- _$insert(_el$53, _$createComponent(Show, {
666
+ }), _el$57, _co$13);
667
+ _$insert(_el$52, _$createComponent(Show, {
669
668
  get when() {
670
669
  return props.onAttachmentsChange;
671
670
  },
672
671
  get children() {
673
- var _el$59 = _$getNextElement(_tmpl$11);
674
- _el$59.$$click = () => setAttachments(attachments().filter(candidate => candidate.id !== attachment.id));
672
+ var _el$58 = _$getNextElement(_tmpl$10);
673
+ _el$58.$$click = () => setAttachments(attachments().filter(candidate => candidate.id !== attachment.id));
675
674
  _$effect(_p$ => {
676
- var _v$20 = messages().removeNamed({
675
+ var _v$19 = messages().removeNamed({
677
676
  name: attachment.name
678
677
  }),
679
- _v$21 = blocked();
680
- _v$20 !== _p$.e && _$setAttribute(_el$59, "aria-label", _p$.e = _v$20);
681
- _v$21 !== _p$.t && _$setProperty(_el$59, "disabled", _p$.t = _v$21);
678
+ _v$20 = blocked();
679
+ _v$19 !== _p$.e && _$setAttribute(_el$58, "aria-label", _p$.e = _v$19);
680
+ _v$20 !== _p$.t && _$setProperty(_el$58, "disabled", _p$.t = _v$20);
682
681
  return _p$;
683
682
  }, {
684
683
  e: undefined,
685
684
  t: undefined
686
685
  });
687
686
  _$runHydrationEvents();
688
- return _el$59;
687
+ return _el$58;
689
688
  }
690
- }), _el$61, _co$14);
691
- _$effect(() => _el$54.classList.toggle("k2b-chat-composer__attachment-content--action", !!Boolean(attachment.action)));
692
- return _el$53;
689
+ }), _el$60, _co$14);
690
+ _$effect(() => _el$53.classList.toggle("k2b-chat-composer__attachment-content--action", !!Boolean(attachment.action)));
691
+ return _el$52;
693
692
  })()
694
693
  }));
695
694
  _$effect(() => _$setAttribute(_el$26, "aria-label", messages().attachments));
696
695
  return _el$26;
697
696
  }
698
- }), _el$44, _co$1);
699
- _el$27.addEventListener("drop", event => {
700
- if (!event.dataTransfer?.types.includes("Files")) return;
701
- event.preventDefault();
702
- setDragActive(false);
703
- if (canSelectFiles() && event.dataTransfer.files.length) void runFiles(event.dataTransfer.files);
704
- });
705
- _el$27.addEventListener("dragleave", event => {
706
- if (!event.currentTarget.contains(event.relatedTarget)) setDragActive(false);
707
- });
708
- _el$27.addEventListener("dragover", event => {
709
- if (!canSelectFiles() || !event.dataTransfer?.types.includes("Files")) return;
710
- event.preventDefault();
711
- setDragActive(true);
712
- });
713
- _el$27.addEventListener("dragenter", event => {
714
- if (!canSelectFiles() || !event.dataTransfer?.types.includes("Files")) return;
715
- event.preventDefault();
716
- setDragActive(true);
717
- });
718
- _$insert(_el$27, _$createComponent(Show, {
719
- get when() {
720
- return dragActive();
721
- },
722
- get children() {
723
- var _el$28 = _$getNextElement(_tmpl$8);
724
- _$insert(_el$28, () => messages().dropFilesToAttach);
725
- return _el$28;
726
- }
727
- }), _el$35, _co$8);
697
+ }), _el$41, _co$0);
728
698
  _$insert(_el$27, _$createComponent(Show, {
729
699
  get when() {
730
700
  return mentions().length > 0;
731
701
  },
732
702
  get children() {
733
- var _el$29 = _$getNextElement(_tmpl$9),
734
- _el$31 = _el$29.firstChild,
735
- [_el$32, _co$7] = _$getNextMarker(_el$31.nextSibling),
736
- _el$30 = _el$32.nextSibling;
703
+ var _el$28 = _$getNextElement(_tmpl$8),
704
+ _el$30 = _el$28.firstChild,
705
+ [_el$31, _co$7] = _$getNextMarker(_el$30.nextSibling),
706
+ _el$29 = _el$31.nextSibling;
737
707
  var _ref$3 = highlightRef;
738
- typeof _ref$3 === "function" ? _$use(_ref$3, _el$29) : highlightRef = _el$29;
739
- _$insert(_el$29, _$createComponent(For, {
708
+ typeof _ref$3 === "function" ? _$use(_ref$3, _el$28) : highlightRef = _el$28;
709
+ _$insert(_el$28, _$createComponent(For, {
740
710
  get each() {
741
711
  return chatMentionSegments(props.value, mentions());
742
712
  },
743
713
  children: part => (() => {
744
- var _el$82 = _$getNextElement(_tmpl$18);
745
- _$insert(_el$82, () => part.text);
746
- _$effect(() => _el$82.classList.toggle("k2b-chat-composer__mention", !!Boolean(part.mention)));
747
- return _el$82;
714
+ var _el$81 = _$getNextElement(_tmpl$17);
715
+ _$insert(_el$81, () => part.text);
716
+ _$effect(() => _el$81.classList.toggle("k2b-chat-composer__mention", !!Boolean(part.mention)));
717
+ return _el$81;
748
718
  })()
749
- }), _el$32, _co$7);
750
- return _el$29;
719
+ }), _el$31, _co$7);
720
+ return _el$28;
751
721
  }
752
- }), _el$37, _co$9);
753
- _el$33.$$keydown = onKeyDown;
754
- _el$33.$$beforeinput = event => {
722
+ }), _el$34, _co$8);
723
+ _el$32.$$keydown = onKeyDown;
724
+ _el$32.$$beforeinput = event => {
755
725
  if (event.inputType === "historyUndo" || event.inputType === "historyRedo") {
756
726
  event.preventDefault();
757
727
  restoreHistory(event.inputType === "historyUndo" ? -1 : 1);
758
728
  }
759
729
  };
760
- _el$33.addEventListener("scroll", () => {
730
+ _el$32.addEventListener("scroll", () => {
761
731
  if (highlightRef && textareaRef) highlightRef.scrollTop = textareaRef.scrollTop;
762
732
  });
763
- _el$33.addEventListener("compositionend", () => {
733
+ _el$32.addEventListener("compositionend", () => {
764
734
  setComposing(false);
765
735
  syncCaret();
766
736
  });
767
- _el$33.addEventListener("compositionstart", () => setComposing(true));
768
- _el$33.$$keyup = syncCaret;
769
- _el$33.$$click = () => {
737
+ _el$32.addEventListener("compositionstart", () => setComposing(true));
738
+ _el$32.$$keyup = syncCaret;
739
+ _el$32.$$click = () => {
770
740
  setDismissed(false);
771
741
  syncCaret();
772
742
  };
773
- _el$33.addEventListener("blur", () => setDismissed(true));
774
- _el$33.addEventListener("select", syncCaret);
775
- _el$33.addEventListener("paste", event => {
743
+ _el$32.addEventListener("blur", () => setDismissed(true));
744
+ _el$32.addEventListener("select", syncCaret);
745
+ _el$32.addEventListener("paste", event => {
776
746
  const clipboardData = event.clipboardData;
777
747
  if (canSelectFiles() && clipboardData?.files.length) {
778
748
  event.preventDefault();
@@ -781,45 +751,45 @@ export function ChatComposer(props) {
781
751
  }
782
752
  props.onPaste?.(event);
783
753
  });
784
- _el$33.$$input = event => {
754
+ _el$32.$$input = event => {
785
755
  edit(event.currentTarget.value);
786
756
  syncCaret();
787
757
  autoResize();
788
758
  };
789
759
  var _ref$4 = textareaRef;
790
- typeof _ref$4 === "function" ? _$use(_ref$4, _el$33) : textareaRef = _el$33;
760
+ typeof _ref$4 === "function" ? _$use(_ref$4, _el$32) : textareaRef = _el$32;
791
761
  _$insert(_el$25, _$createComponent(Show, {
792
762
  get when() {
793
763
  return props.error;
794
764
  },
795
765
  get children() {
796
- var _el$38 = _$getNextElement(_tmpl$0),
797
- _el$39 = _el$38.firstChild,
798
- _el$40 = _el$39.nextSibling,
799
- [_el$41, _co$0] = _$getNextMarker(_el$40.nextSibling);
800
- _$insert(_el$38, () => props.error, _el$41, _co$0);
801
- return _el$38;
766
+ var _el$35 = _$getNextElement(_tmpl$9),
767
+ _el$36 = _el$35.firstChild,
768
+ _el$37 = _el$36.nextSibling,
769
+ [_el$38, _co$9] = _$getNextMarker(_el$37.nextSibling);
770
+ _$insert(_el$35, () => props.error, _el$38, _co$9);
771
+ return _el$35;
802
772
  }
803
- }), _el$46, _co$10);
804
- _$insert(_el$42, _$createComponent(Show, {
773
+ }), _el$43, _co$1);
774
+ _$insert(_el$39, _$createComponent(Show, {
805
775
  get when() {
806
776
  return props.footerContent;
807
777
  },
808
778
  get fallback() {
809
779
  return [(() => {
810
- var _el$83 = _$getNextElement(_tmpl$21),
811
- _el$86 = _el$83.firstChild,
812
- [_el$87, _co$21] = _$getNextMarker(_el$86.nextSibling),
813
- _el$88 = _el$87.nextSibling,
814
- [_el$89, _co$22] = _$getNextMarker(_el$88.nextSibling),
815
- _el$90 = _el$89.nextSibling,
816
- [_el$91, _co$23] = _$getNextMarker(_el$90.nextSibling),
817
- _el$92 = _el$91.nextSibling,
818
- [_el$93, _co$24] = _$getNextMarker(_el$92.nextSibling),
819
- _el$94 = _el$93.nextSibling,
820
- [_el$95, _co$25] = _$getNextMarker(_el$94.nextSibling);
821
- _$insert(_el$83, () => props.footerTools, _el$87, _co$21);
822
- _$insert(_el$83, _$createComponent(Show, {
780
+ var _el$82 = _$getNextElement(_tmpl$20),
781
+ _el$85 = _el$82.firstChild,
782
+ [_el$86, _co$21] = _$getNextMarker(_el$85.nextSibling),
783
+ _el$87 = _el$86.nextSibling,
784
+ [_el$88, _co$22] = _$getNextMarker(_el$87.nextSibling),
785
+ _el$89 = _el$88.nextSibling,
786
+ [_el$90, _co$23] = _$getNextMarker(_el$89.nextSibling),
787
+ _el$91 = _el$90.nextSibling,
788
+ [_el$92, _co$24] = _$getNextMarker(_el$91.nextSibling),
789
+ _el$93 = _el$92.nextSibling,
790
+ [_el$94, _co$25] = _$getNextMarker(_el$93.nextSibling);
791
+ _$insert(_el$82, () => props.footerTools, _el$86, _co$21);
792
+ _$insert(_el$82, _$createComponent(Show, {
823
793
  get when() {
824
794
  return hasAddMenu();
825
795
  },
@@ -846,38 +816,38 @@ export function ChatComposer(props) {
846
816
  return messages().addToChat;
847
817
  },
848
818
  get children() {
849
- return _$getNextElement(_tmpl$19);
819
+ return _$getNextElement(_tmpl$18);
850
820
  }
851
821
  });
852
822
  }
853
823
  });
854
824
  }
855
- }), _el$89, _co$22);
856
- _$insert(_el$83, _$createComponent(Show, {
825
+ }), _el$88, _co$22);
826
+ _$insert(_el$82, _$createComponent(Show, {
857
827
  get when() {
858
828
  return props.fileSelection;
859
829
  },
860
830
  get children() {
861
- var _el$85 = _$getNextElement(_tmpl$20);
862
- _el$85.addEventListener("change", event => {
831
+ var _el$84 = _$getNextElement(_tmpl$19);
832
+ _el$84.addEventListener("change", event => {
863
833
  if (event.currentTarget.files?.length) void runFiles(event.currentTarget.files);
864
834
  });
865
835
  var _ref$5 = fileInputRef;
866
- typeof _ref$5 === "function" ? _$use(_ref$5, _el$85) : fileInputRef = _el$85;
836
+ typeof _ref$5 === "function" ? _$use(_ref$5, _el$84) : fileInputRef = _el$84;
867
837
  _$effect(_p$ => {
868
- var _v$28 = props.fileSelection?.accept,
869
- _v$29 = props.fileSelection?.multiple ?? true;
870
- _v$28 !== _p$.e && _$setAttribute(_el$85, "accept", _p$.e = _v$28);
871
- _v$29 !== _p$.t && _$setProperty(_el$85, "multiple", _p$.t = _v$29);
838
+ var _v$27 = props.fileSelection?.accept,
839
+ _v$28 = props.fileSelection?.multiple ?? true;
840
+ _v$27 !== _p$.e && _$setAttribute(_el$84, "accept", _p$.e = _v$27);
841
+ _v$28 !== _p$.t && _$setProperty(_el$84, "multiple", _p$.t = _v$28);
872
842
  return _p$;
873
843
  }, {
874
844
  e: undefined,
875
845
  t: undefined
876
846
  });
877
- return _el$85;
847
+ return _el$84;
878
848
  }
879
- }), _el$91, _co$23);
880
- _$insert(_el$83, _$createComponent(Show, {
849
+ }), _el$90, _co$23);
850
+ _$insert(_el$82, _$createComponent(Show, {
881
851
  get when() {
882
852
  return (props.models?.length ?? 0) > 0;
883
853
  },
@@ -911,20 +881,20 @@ export function ChatComposer(props) {
911
881
  }
912
882
  });
913
883
  }
914
- }), _el$93, _co$24);
915
- _$insert(_el$83, () => props.modelDetails, _el$95, _co$25);
916
- return _el$83;
884
+ }), _el$92, _co$24);
885
+ _$insert(_el$82, () => props.modelDetails, _el$94, _co$25);
886
+ return _el$82;
917
887
  })(), (() => {
918
- var _el$96 = _$getNextElement(_tmpl$22),
919
- _el$98 = _el$96.firstChild,
920
- [_el$99, _co$26] = _$getNextMarker(_el$98.nextSibling),
921
- _el$100 = _el$99.nextSibling,
922
- [_el$101, _co$27] = _$getNextMarker(_el$100.nextSibling),
923
- _el$102 = _el$101.nextSibling,
924
- [_el$103, _co$28] = _$getNextMarker(_el$102.nextSibling),
925
- _el$104 = _el$103.nextSibling,
926
- [_el$105, _co$29] = _$getNextMarker(_el$104.nextSibling);
927
- _$insert(_el$96, _$createComponent(For, {
888
+ var _el$95 = _$getNextElement(_tmpl$21),
889
+ _el$97 = _el$95.firstChild,
890
+ [_el$98, _co$26] = _$getNextMarker(_el$97.nextSibling),
891
+ _el$99 = _el$98.nextSibling,
892
+ [_el$100, _co$27] = _$getNextMarker(_el$99.nextSibling),
893
+ _el$101 = _el$100.nextSibling,
894
+ [_el$102, _co$28] = _$getNextMarker(_el$101.nextSibling),
895
+ _el$103 = _el$102.nextSibling,
896
+ [_el$104, _co$29] = _$getNextMarker(_el$103.nextSibling);
897
+ _$insert(_el$95, _$createComponent(For, {
928
898
  get each() {
929
899
  return props.contextActions;
930
900
  },
@@ -948,13 +918,13 @@ export function ChatComposer(props) {
948
918
  },
949
919
  onClick: () => reportChatFailure(() => executeChatAction(action), props.onError),
950
920
  get children() {
951
- var _el$106 = _$getNextElement(_tmpl$15);
952
- _$effect(() => _$className(_el$106, action.icon ?? "ti ti-dots"));
953
- return _el$106;
921
+ var _el$105 = _$getNextElement(_tmpl$14);
922
+ _$effect(() => _$className(_el$105, action.icon ?? "ti ti-dots"));
923
+ return _el$105;
954
924
  }
955
925
  })
956
- }), _el$99, _co$26);
957
- _$insert(_el$96, _$createComponent(Show, {
926
+ }), _el$98, _co$26);
927
+ _$insert(_el$95, _$createComponent(Show, {
958
928
  get when() {
959
929
  return _$memo(() => !!hasContextUsage())() ? props.contextUsage ?? {} : undefined;
960
930
  },
@@ -966,9 +936,9 @@ export function ChatComposer(props) {
966
936
  return props.onError;
967
937
  }
968
938
  }))
969
- }), _el$101, _co$27);
970
- _$insert(_el$96, () => props.submitTools, _el$103, _co$28);
971
- _$insert(_el$96, _$createComponent(Show, {
939
+ }), _el$100, _co$27);
940
+ _$insert(_el$95, () => props.submitTools, _el$102, _co$28);
941
+ _$insert(_el$95, _$createComponent(Show, {
972
942
  get when() {
973
943
  return _$memo(() => !!(running() && !hasDraft()))() && props.onStop;
974
944
  },
@@ -987,9 +957,9 @@ export function ChatComposer(props) {
987
957
  },
988
958
  onClick: () => void submit(),
989
959
  get children() {
990
- var _el$107 = _$getNextElement(_tmpl$15);
991
- _$effect(() => _$className(_el$107, submitting() ? "ti ti-loader-2 k2b-spin" : "ti ti-arrow-up"));
992
- return _el$107;
960
+ var _el$106 = _$getNextElement(_tmpl$14);
961
+ _$effect(() => _$className(_el$106, submitting() ? "ti ti-loader-2 k2b-spin" : "ti ti-arrow-up"));
962
+ return _el$106;
993
963
  }
994
964
  });
995
965
  },
@@ -1008,47 +978,65 @@ export function ChatComposer(props) {
1008
978
  },
1009
979
  onClick: () => reportChatFailure(() => props.onStop?.(), props.onError),
1010
980
  get children() {
1011
- var _el$97 = _$getNextElement(_tmpl$15);
1012
- _$effect(() => _$className(_el$97, stopping() ? "ti ti-loader-2 k2b-spin" : "ti ti-player-stop"));
1013
- return _el$97;
981
+ var _el$96 = _$getNextElement(_tmpl$14);
982
+ _$effect(() => _$className(_el$96, stopping() ? "ti ti-loader-2 k2b-spin" : "ti ti-player-stop"));
983
+ return _el$96;
1014
984
  }
1015
985
  });
1016
986
  }
1017
- }), _el$105, _co$29);
1018
- return _el$96;
987
+ }), _el$104, _co$29);
988
+ return _el$95;
1019
989
  })()];
1020
990
  },
1021
991
  children: content => content()
1022
992
  }));
993
+ _$insert(_el$25, _$createComponent(Show, {
994
+ get when() {
995
+ return props.fileSelection;
996
+ },
997
+ children: selection => _$createComponent(FileDropTarget, {
998
+ get label() {
999
+ return messages().dropFilesToAttach;
1000
+ },
1001
+ get accept() {
1002
+ return selection().accept;
1003
+ },
1004
+ get multiple() {
1005
+ return selection().multiple;
1006
+ },
1007
+ get disabled() {
1008
+ return !canSelectFiles();
1009
+ },
1010
+ onDrop: files => void runFiles(files)
1011
+ })
1012
+ }), _el$45, _co$10);
1023
1013
  _$effect(_p$ => {
1024
1014
  var _v$3 = `k2b-chat-composer ${props.class ?? ""}`,
1025
1015
  _v$4 = running() ? "true" : undefined,
1026
- _v$5 = dragActive() ? "true" : undefined,
1027
- _v$6 = props.label ?? messages().messageComposer,
1028
- _v$7 = messages().messageInput,
1029
- _v$8 = !!(mentions().length > 0),
1030
- _v$9 = blocked(),
1031
- _v$0 = props.placeholder ?? (running() ? messages().addGuidance : messages().writeMessage),
1032
- _v$1 = props.inputLabel ?? messages().message,
1033
- _v$10 = commandsOpen() ? "combobox" : undefined,
1034
- _v$11 = commandsOpen() ? "list" : undefined,
1035
- _v$12 = commandsOpen() ? commandListId : undefined,
1036
- _v$13 = commandsOpen() ? "true" : undefined,
1037
- _v$14 = selectedCommand() ? `${commandListId}-${selectedCommandIndex()}` : undefined;
1016
+ _v$5 = props.label ?? messages().messageComposer,
1017
+ _v$6 = messages().messageInput,
1018
+ _v$7 = !!(mentions().length > 0),
1019
+ _v$8 = blocked(),
1020
+ _v$9 = props.placeholder ?? (running() ? messages().addGuidance : messages().writeMessage),
1021
+ _v$0 = props.inputLabel ?? messages().message,
1022
+ _v$1 = commandsOpen() ? "combobox" : undefined,
1023
+ _v$10 = commandsOpen() ? "list" : undefined,
1024
+ _v$11 = commandsOpen() ? commandListId : undefined,
1025
+ _v$12 = commandsOpen() ? "true" : undefined,
1026
+ _v$13 = selectedCommand() ? `${commandListId}-${selectedCommandIndex()}` : undefined;
1038
1027
  _v$3 !== _p$.e && _$className(_el$25, _p$.e = _v$3);
1039
1028
  _v$4 !== _p$.t && _$setAttribute(_el$25, "data-running", _p$.t = _v$4);
1040
- _v$5 !== _p$.a && _$setAttribute(_el$25, "data-drag-active", _p$.a = _v$5);
1041
- _v$6 !== _p$.o && _$setAttribute(_el$25, "aria-label", _p$.o = _v$6);
1042
- _v$7 !== _p$.i && _$setAttribute(_el$27, "aria-label", _p$.i = _v$7);
1043
- _v$8 !== _p$.n && _el$33.classList.toggle("k2b-chat-composer__textarea--highlighted", _p$.n = _v$8);
1044
- _v$9 !== _p$.s && _$setProperty(_el$33, "disabled", _p$.s = _v$9);
1045
- _v$0 !== _p$.h && _$setAttribute(_el$33, "placeholder", _p$.h = _v$0);
1046
- _v$1 !== _p$.r && _$setAttribute(_el$33, "aria-label", _p$.r = _v$1);
1047
- _v$10 !== _p$.d && _$setAttribute(_el$33, "role", _p$.d = _v$10);
1048
- _v$11 !== _p$.l && _$setAttribute(_el$33, "aria-autocomplete", _p$.l = _v$11);
1049
- _v$12 !== _p$.u && _$setAttribute(_el$33, "aria-controls", _p$.u = _v$12);
1050
- _v$13 !== _p$.c && _$setAttribute(_el$33, "aria-expanded", _p$.c = _v$13);
1051
- _v$14 !== _p$.w && _$setAttribute(_el$33, "aria-activedescendant", _p$.w = _v$14);
1029
+ _v$5 !== _p$.a && _$setAttribute(_el$25, "aria-label", _p$.a = _v$5);
1030
+ _v$6 !== _p$.o && _$setAttribute(_el$27, "aria-label", _p$.o = _v$6);
1031
+ _v$7 !== _p$.i && _el$32.classList.toggle("k2b-chat-composer__textarea--highlighted", _p$.i = _v$7);
1032
+ _v$8 !== _p$.n && _$setProperty(_el$32, "disabled", _p$.n = _v$8);
1033
+ _v$9 !== _p$.s && _$setAttribute(_el$32, "placeholder", _p$.s = _v$9);
1034
+ _v$0 !== _p$.h && _$setAttribute(_el$32, "aria-label", _p$.h = _v$0);
1035
+ _v$1 !== _p$.r && _$setAttribute(_el$32, "role", _p$.r = _v$1);
1036
+ _v$10 !== _p$.d && _$setAttribute(_el$32, "aria-autocomplete", _p$.d = _v$10);
1037
+ _v$11 !== _p$.l && _$setAttribute(_el$32, "aria-controls", _p$.l = _v$11);
1038
+ _v$12 !== _p$.u && _$setAttribute(_el$32, "aria-expanded", _p$.u = _v$12);
1039
+ _v$13 !== _p$.c && _$setAttribute(_el$32, "aria-activedescendant", _p$.c = _v$13);
1052
1040
  return _p$;
1053
1041
  }, {
1054
1042
  e: undefined,
@@ -1063,10 +1051,9 @@ export function ChatComposer(props) {
1063
1051
  d: undefined,
1064
1052
  l: undefined,
1065
1053
  u: undefined,
1066
- c: undefined,
1067
- w: undefined
1054
+ c: undefined
1068
1055
  });
1069
- _$effect(() => _$setProperty(_el$33, "value", props.value));
1056
+ _$effect(() => _$setProperty(_el$32, "value", props.value));
1070
1057
  _$runHydrationEvents();
1071
1058
  return _el$3;
1072
1059
  })();