@simai-studio/chat 0.0.0-stage → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (261) hide show
  1. package/LICENSE.md +182 -0
  2. package/README.md +65 -2
  3. package/dist/package-receipt.json +1551 -0
  4. package/dist/set.json +105 -0
  5. package/dist/smart/chat-composer/aliases.json +56 -0
  6. package/dist/smart/chat-composer/aliases.json.gz +0 -0
  7. package/dist/smart/chat-composer/component.json +658 -0
  8. package/dist/smart/chat-composer/component.json.gz +0 -0
  9. package/dist/smart/chat-composer/css/chat-composer.css +318 -0
  10. package/dist/smart/chat-composer/css/chat-composer.css.gz +0 -0
  11. package/dist/smart/chat-composer/css/chat-composer.min.css +2 -0
  12. package/dist/smart/chat-composer/css/chat-composer.min.css.gz +0 -0
  13. package/dist/smart/chat-composer/examples.json +531 -0
  14. package/dist/smart/chat-composer/examples.json.gz +0 -0
  15. package/dist/smart/chat-composer/js/chat-composer.js +1023 -0
  16. package/dist/smart/chat-composer/js/chat-composer.js.gz +0 -0
  17. package/dist/smart/chat-composer/js/chat-composer.min.js +75 -0
  18. package/dist/smart/chat-composer/js/chat-composer.min.js.gz +0 -0
  19. package/dist/smart/chat-composer/lang/en.json +31 -0
  20. package/dist/smart/chat-composer/lang/en.json.gz +0 -0
  21. package/dist/smart/chat-composer/lang/ru.json +31 -0
  22. package/dist/smart/chat-composer/lang/ru.json.gz +0 -0
  23. package/dist/smart/chat-composer/probe.json +400 -0
  24. package/dist/smart/chat-composer/probe.json.gz +0 -0
  25. package/dist/smart/chat-composer/smart.manifest.json +625 -0
  26. package/dist/smart/chat-composer/smart.manifest.json.gz +0 -0
  27. package/dist/smart/chat-composer/static/default/busy.html +20 -0
  28. package/dist/smart/chat-composer/static/default/busy.html.gz +0 -0
  29. package/dist/smart/chat-composer/static/default/disabled.html +20 -0
  30. package/dist/smart/chat-composer/static/default/disabled.html.gz +0 -0
  31. package/dist/smart/chat-composer/static/default/files.html +44 -0
  32. package/dist/smart/chat-composer/static/default/files.html.gz +0 -0
  33. package/dist/smart/chat-composer/static/default/near-limit.html +20 -0
  34. package/dist/smart/chat-composer/static/default/near-limit.html.gz +0 -0
  35. package/dist/smart/chat-composer/static/default/reference.html +20 -0
  36. package/dist/smart/chat-composer/static/default/reference.html.gz +0 -0
  37. package/dist/smart/chat-composer/static/sheets.json +88 -0
  38. package/dist/smart/chat-composer/static/sheets.json.gz +0 -0
  39. package/dist/smart/chat-composer/studio.fixture.json +18 -0
  40. package/dist/smart/chat-composer/studio.fixture.json.gz +0 -0
  41. package/dist/smart/chat-composer/studio.scenario.json +37 -0
  42. package/dist/smart/chat-composer/studio.scenario.json.gz +0 -0
  43. package/dist/smart/chat-composer/template/default.css +273 -0
  44. package/dist/smart/chat-composer/template/default.css.gz +0 -0
  45. package/dist/smart/chat-composer/template/default.js +109 -0
  46. package/dist/smart/chat-composer/template/default.js.gz +0 -0
  47. package/dist/smart/chat-composer/template/parts.js +82 -0
  48. package/dist/smart/chat-composer/template/parts.js.gz +0 -0
  49. package/dist/smart/chat-interlocutor/aliases.json +20 -0
  50. package/dist/smart/chat-interlocutor/aliases.json.gz +0 -0
  51. package/dist/smart/chat-interlocutor/component.json +435 -0
  52. package/dist/smart/chat-interlocutor/component.json.gz +0 -0
  53. package/dist/smart/chat-interlocutor/css/chat-interlocutor.css +107 -0
  54. package/dist/smart/chat-interlocutor/css/chat-interlocutor.css.gz +0 -0
  55. package/dist/smart/chat-interlocutor/css/chat-interlocutor.min.css +2 -0
  56. package/dist/smart/chat-interlocutor/css/chat-interlocutor.min.css.gz +0 -0
  57. package/dist/smart/chat-interlocutor/examples.json +379 -0
  58. package/dist/smart/chat-interlocutor/examples.json.gz +0 -0
  59. package/dist/smart/chat-interlocutor/js/chat-interlocutor.js +531 -0
  60. package/dist/smart/chat-interlocutor/js/chat-interlocutor.js.gz +0 -0
  61. package/dist/smart/chat-interlocutor/js/chat-interlocutor.min.js +22 -0
  62. package/dist/smart/chat-interlocutor/js/chat-interlocutor.min.js.gz +0 -0
  63. package/dist/smart/chat-interlocutor/lang/en.json +13 -0
  64. package/dist/smart/chat-interlocutor/lang/en.json.gz +0 -0
  65. package/dist/smart/chat-interlocutor/lang/ru.json +13 -0
  66. package/dist/smart/chat-interlocutor/lang/ru.json.gz +0 -0
  67. package/dist/smart/chat-interlocutor/probe.json +204 -0
  68. package/dist/smart/chat-interlocutor/probe.json.gz +0 -0
  69. package/dist/smart/chat-interlocutor/smart.manifest.json +406 -0
  70. package/dist/smart/chat-interlocutor/smart.manifest.json.gz +0 -0
  71. package/dist/smart/chat-interlocutor/static/default/former.html +10 -0
  72. package/dist/smart/chat-interlocutor/static/default/former.html.gz +0 -0
  73. package/dist/smart/chat-interlocutor/static/default/grouped.html +10 -0
  74. package/dist/smart/chat-interlocutor/static/default/grouped.html.gz +0 -0
  75. package/dist/smart/chat-interlocutor/static/default/reference.html +10 -0
  76. package/dist/smart/chat-interlocutor/static/default/reference.html.gz +0 -0
  77. package/dist/smart/chat-interlocutor/static/default/single.html +10 -0
  78. package/dist/smart/chat-interlocutor/static/default/single.html.gz +0 -0
  79. package/dist/smart/chat-interlocutor/static/sheets.json +105 -0
  80. package/dist/smart/chat-interlocutor/static/sheets.json.gz +0 -0
  81. package/dist/smart/chat-interlocutor/studio.fixture.json +25 -0
  82. package/dist/smart/chat-interlocutor/studio.fixture.json.gz +0 -0
  83. package/dist/smart/chat-interlocutor/studio.scenario.json +41 -0
  84. package/dist/smart/chat-interlocutor/studio.scenario.json.gz +0 -0
  85. package/dist/smart/chat-interlocutor/template/default.css +58 -0
  86. package/dist/smart/chat-interlocutor/template/default.css.gz +0 -0
  87. package/dist/smart/chat-interlocutor/template/default.js +43 -0
  88. package/dist/smart/chat-interlocutor/template/default.js.gz +0 -0
  89. package/dist/smart/chat-message/aliases.json +114 -0
  90. package/dist/smart/chat-message/aliases.json.gz +0 -0
  91. package/dist/smart/chat-message/component.json +822 -0
  92. package/dist/smart/chat-message/component.json.gz +0 -0
  93. package/dist/smart/chat-message/css/chat-message.css +3291 -0
  94. package/dist/smart/chat-message/css/chat-message.css.gz +0 -0
  95. package/dist/smart/chat-message/css/chat-message.min.css +2 -0
  96. package/dist/smart/chat-message/css/chat-message.min.css.gz +0 -0
  97. package/dist/smart/chat-message/examples.json +1604 -0
  98. package/dist/smart/chat-message/examples.json.gz +0 -0
  99. package/dist/smart/chat-message/js/chat-message.js +5498 -0
  100. package/dist/smart/chat-message/js/chat-message.js.gz +0 -0
  101. package/dist/smart/chat-message/js/chat-message.min.js +25 -0
  102. package/dist/smart/chat-message/js/chat-message.min.js.gz +0 -0
  103. package/dist/smart/chat-message/lang/en.json +181 -0
  104. package/dist/smart/chat-message/lang/en.json.gz +0 -0
  105. package/dist/smart/chat-message/lang/ru.json +185 -0
  106. package/dist/smart/chat-message/lang/ru.json.gz +0 -0
  107. package/dist/smart/chat-message/probe.json +1029 -0
  108. package/dist/smart/chat-message/probe.json.gz +0 -0
  109. package/dist/smart/chat-message/smart.manifest.json +814 -0
  110. package/dist/smart/chat-message/smart.manifest.json.gz +0 -0
  111. package/dist/smart/chat-message/static/default/brief-card.html +2 -0
  112. package/dist/smart/chat-message/static/default/brief-card.html.gz +0 -0
  113. package/dist/smart/chat-message/static/default/brief-questions.html +2 -0
  114. package/dist/smart/chat-message/static/default/brief-questions.html.gz +0 -0
  115. package/dist/smart/chat-message/static/default/deliverables.html +2 -0
  116. package/dist/smart/chat-message/static/default/deliverables.html.gz +0 -0
  117. package/dist/smart/chat-message/static/default/document.html +13 -0
  118. package/dist/smart/chat-message/static/default/document.html.gz +0 -0
  119. package/dist/smart/chat-message/static/default/failed.html +2 -0
  120. package/dist/smart/chat-message/static/default/failed.html.gz +0 -0
  121. package/dist/smart/chat-message/static/default/feedback-reason.html +2 -0
  122. package/dist/smart/chat-message/static/default/feedback-reason.html.gz +0 -0
  123. package/dist/smart/chat-message/static/default/limit.html +2 -0
  124. package/dist/smart/chat-message/static/default/limit.html.gz +0 -0
  125. package/dist/smart/chat-message/static/default/proposal.html +42 -0
  126. package/dist/smart/chat-message/static/default/proposal.html.gz +0 -0
  127. package/dist/smart/chat-message/static/default/question.html +18 -0
  128. package/dist/smart/chat-message/static/default/question.html.gz +0 -0
  129. package/dist/smart/chat-message/static/default/reference.html +2 -0
  130. package/dist/smart/chat-message/static/default/reference.html.gz +0 -0
  131. package/dist/smart/chat-message/static/default/steps.html +2 -0
  132. package/dist/smart/chat-message/static/default/steps.html.gz +0 -0
  133. package/dist/smart/chat-message/static/default/stopped.html +2 -0
  134. package/dist/smart/chat-message/static/default/stopped.html.gz +0 -0
  135. package/dist/smart/chat-message/static/default/waiting.html +2 -0
  136. package/dist/smart/chat-message/static/default/waiting.html.gz +0 -0
  137. package/dist/smart/chat-message/static/person/person-own.html +2 -0
  138. package/dist/smart/chat-message/static/person/person-own.html.gz +0 -0
  139. package/dist/smart/chat-message/static/person/person-reply.html +6 -0
  140. package/dist/smart/chat-message/static/person/person-reply.html.gz +0 -0
  141. package/dist/smart/chat-message/static/person/person.html +14 -0
  142. package/dist/smart/chat-message/static/person/person.html.gz +0 -0
  143. package/dist/smart/chat-message/static/sheets.json +398 -0
  144. package/dist/smart/chat-message/static/sheets.json.gz +0 -0
  145. package/dist/smart/chat-message/studio.fixture.json +27 -0
  146. package/dist/smart/chat-message/studio.fixture.json.gz +0 -0
  147. package/dist/smart/chat-message/studio.scenario.json +22 -0
  148. package/dist/smart/chat-message/studio.scenario.json.gz +0 -0
  149. package/dist/smart/chat-message/template/default.css +1895 -0
  150. package/dist/smart/chat-message/template/default.css.gz +0 -0
  151. package/dist/smart/chat-message/template/default.js +27 -0
  152. package/dist/smart/chat-message/template/default.js.gz +0 -0
  153. package/dist/smart/chat-message/template/person.js +11 -0
  154. package/dist/smart/chat-message/template/person.js.gz +0 -0
  155. package/dist/smart/chat-threads/aliases.json +174 -0
  156. package/dist/smart/chat-threads/aliases.json.gz +0 -0
  157. package/dist/smart/chat-threads/component.json +1232 -0
  158. package/dist/smart/chat-threads/component.json.gz +0 -0
  159. package/dist/smart/chat-threads/css/chat-threads.css +150 -0
  160. package/dist/smart/chat-threads/css/chat-threads.css.gz +0 -0
  161. package/dist/smart/chat-threads/css/chat-threads.min.css +2 -0
  162. package/dist/smart/chat-threads/css/chat-threads.min.css.gz +0 -0
  163. package/dist/smart/chat-threads/examples.json +689 -0
  164. package/dist/smart/chat-threads/examples.json.gz +0 -0
  165. package/dist/smart/chat-threads/js/chat-threads.js +859 -0
  166. package/dist/smart/chat-threads/js/chat-threads.js.gz +0 -0
  167. package/dist/smart/chat-threads/js/chat-threads.min.js +39 -0
  168. package/dist/smart/chat-threads/js/chat-threads.min.js.gz +0 -0
  169. package/dist/smart/chat-threads/lang/en.json +18 -0
  170. package/dist/smart/chat-threads/lang/en.json.gz +0 -0
  171. package/dist/smart/chat-threads/lang/ru.json +18 -0
  172. package/dist/smart/chat-threads/lang/ru.json.gz +0 -0
  173. package/dist/smart/chat-threads/probe.json +406 -0
  174. package/dist/smart/chat-threads/probe.json.gz +0 -0
  175. package/dist/smart/chat-threads/smart.manifest.json +1152 -0
  176. package/dist/smart/chat-threads/smart.manifest.json.gz +0 -0
  177. package/dist/smart/chat-threads/static/default/activity.html +139 -0
  178. package/dist/smart/chat-threads/static/default/activity.html.gz +0 -0
  179. package/dist/smart/chat-threads/static/default/activity.skeleton.html +139 -0
  180. package/dist/smart/chat-threads/static/default/activity.skeleton.html.gz +0 -0
  181. package/dist/smart/chat-threads/static/default/archive.html +55 -0
  182. package/dist/smart/chat-threads/static/default/archive.html.gz +0 -0
  183. package/dist/smart/chat-threads/static/default/archive.skeleton.html +55 -0
  184. package/dist/smart/chat-threads/static/default/archive.skeleton.html.gz +0 -0
  185. package/dist/smart/chat-threads/static/default/avatars.html +104 -0
  186. package/dist/smart/chat-threads/static/default/avatars.html.gz +0 -0
  187. package/dist/smart/chat-threads/static/default/avatars.skeleton.html +104 -0
  188. package/dist/smart/chat-threads/static/default/avatars.skeleton.html.gz +0 -0
  189. package/dist/smart/chat-threads/static/default/empty.html +48 -0
  190. package/dist/smart/chat-threads/static/default/empty.html.gz +0 -0
  191. package/dist/smart/chat-threads/static/default/loading.html +48 -0
  192. package/dist/smart/chat-threads/static/default/loading.html.gz +0 -0
  193. package/dist/smart/chat-threads/static/default/people.html +95 -0
  194. package/dist/smart/chat-threads/static/default/people.html.gz +0 -0
  195. package/dist/smart/chat-threads/static/default/people.skeleton.html +95 -0
  196. package/dist/smart/chat-threads/static/default/people.skeleton.html.gz +0 -0
  197. package/dist/smart/chat-threads/static/default/reference.html +114 -0
  198. package/dist/smart/chat-threads/static/default/reference.html.gz +0 -0
  199. package/dist/smart/chat-threads/static/default/reference.skeleton.html +114 -0
  200. package/dist/smart/chat-threads/static/default/reference.skeleton.html.gz +0 -0
  201. package/dist/smart/chat-threads/static/default/ungrouped.html +94 -0
  202. package/dist/smart/chat-threads/static/default/ungrouped.html.gz +0 -0
  203. package/dist/smart/chat-threads/static/default/ungrouped.skeleton.html +94 -0
  204. package/dist/smart/chat-threads/static/default/ungrouped.skeleton.html.gz +0 -0
  205. package/dist/smart/chat-threads/static/sheets.json +422 -0
  206. package/dist/smart/chat-threads/static/sheets.json.gz +0 -0
  207. package/dist/smart/chat-threads/studio.fixture.json +23 -0
  208. package/dist/smart/chat-threads/studio.fixture.json.gz +0 -0
  209. package/dist/smart/chat-threads/template/default.css +113 -0
  210. package/dist/smart/chat-threads/template/default.css.gz +0 -0
  211. package/dist/smart/chat-threads/template/default.js +62 -0
  212. package/dist/smart/chat-threads/template/default.js.gz +0 -0
  213. package/dist/smart/chat-window/aliases.json +395 -0
  214. package/dist/smart/chat-window/aliases.json.gz +0 -0
  215. package/dist/smart/chat-window/component.json +2809 -0
  216. package/dist/smart/chat-window/component.json.gz +0 -0
  217. package/dist/smart/chat-window/css/chat-window.css +1717 -0
  218. package/dist/smart/chat-window/css/chat-window.css.gz +0 -0
  219. package/dist/smart/chat-window/css/chat-window.min.css +2 -0
  220. package/dist/smart/chat-window/css/chat-window.min.css.gz +0 -0
  221. package/dist/smart/chat-window/examples.json +2798 -0
  222. package/dist/smart/chat-window/examples.json.gz +0 -0
  223. package/dist/smart/chat-window/js/chat-window.js +12382 -0
  224. package/dist/smart/chat-window/js/chat-window.js.gz +0 -0
  225. package/dist/smart/chat-window/js/chat-window.min.js +1 -0
  226. package/dist/smart/chat-window/js/chat-window.min.js.gz +0 -0
  227. package/dist/smart/chat-window/lang/en.json +212 -0
  228. package/dist/smart/chat-window/lang/en.json.gz +0 -0
  229. package/dist/smart/chat-window/lang/ru.json +218 -0
  230. package/dist/smart/chat-window/lang/ru.json.gz +0 -0
  231. package/dist/smart/chat-window/probe.json +2023 -0
  232. package/dist/smart/chat-window/probe.json.gz +0 -0
  233. package/dist/smart/chat-window/smart.manifest.json +2835 -0
  234. package/dist/smart/chat-window/smart.manifest.json.gz +0 -0
  235. package/dist/smart/chat-window/static/default/archived.html +97 -0
  236. package/dist/smart/chat-window/static/default/archived.html.gz +0 -0
  237. package/dist/smart/chat-window/static/default/embedded.html +119 -0
  238. package/dist/smart/chat-window/static/default/embedded.html.gz +0 -0
  239. package/dist/smart/chat-window/static/default/greeting.html +119 -0
  240. package/dist/smart/chat-window/static/default/greeting.html.gz +0 -0
  241. package/dist/smart/chat-window/static/default/people.html +110 -0
  242. package/dist/smart/chat-window/static/default/people.html.gz +0 -0
  243. package/dist/smart/chat-window/static/default/proposal.html +157 -0
  244. package/dist/smart/chat-window/static/default/proposal.html.gz +0 -0
  245. package/dist/smart/chat-window/static/default/reference.html +117 -0
  246. package/dist/smart/chat-window/static/default/reference.html.gz +0 -0
  247. package/dist/smart/chat-window/static/default/waiting.html +117 -0
  248. package/dist/smart/chat-window/static/default/waiting.html.gz +0 -0
  249. package/dist/smart/chat-window/static/sheets.json +476 -0
  250. package/dist/smart/chat-window/static/sheets.json.gz +0 -0
  251. package/dist/smart/chat-window/studio.fixture.json +13 -0
  252. package/dist/smart/chat-window/studio.fixture.json.gz +0 -0
  253. package/dist/smart/chat-window/studio.scenario.json +95 -0
  254. package/dist/smart/chat-window/studio.scenario.json.gz +0 -0
  255. package/dist/smart/chat-window/template/default.css +1168 -0
  256. package/dist/smart/chat-window/template/default.css.gz +0 -0
  257. package/dist/smart/chat-window/template/default.js +12 -0
  258. package/dist/smart/chat-window/template/default.js.gz +0 -0
  259. package/dist/smart/rule.js +185 -0
  260. package/dist/smart/rule.js.gz +0 -0
  261. package/package.json +29 -4
@@ -0,0 +1,44 @@
1
+ <!-- sf-chat-composer, example «files»: the static markup (standard simai.smart-component 1.3.8 §5.4). Generated by scripts/snapshot-first-paint.mjs from the built output; do not edit, run it again. -->
2
+ <sf-chat-composer attachments accept=".pdf,.docx" style="display: contents;"><script type="application/json" data-sf-settings>{"files":[{"id":"att_1","localId":"f1","name":"Договор.pdf","bytes":48213,"progress":null,"error":""},{"localId":"f2","name":"Регламент.docx","bytes":1572864,"progress":0.4,"error":""},{"localId":"f3","name":"Скан.pdf","bytes":2048,"progress":null,"error":"не похоже на документ"}]}</script>
3
+ <form novalidate class="sf-chat-composer" data-sf-static>
4
+ <div class="sf-chat-composer__box sf-chat-composer__box--tall">
5
+ <div class="sf-chat-composer__files"><div role="group" class="sf-chat-attachment sf-chat-attachment--ready" aria-label="Файл Договор.pdf, 47 КБ">
6
+ <span class="sf-chat-attachment__icon" aria-hidden="true"><sf-icon size="2" aria-hidden="true" icon="description" style="display: contents;" data-sf-size-relative><i class="sf-icon sf-icon--size-2 sf-icon--weight-regular" style="--sf-icon--grade:0;--sf-icon--optical-size:24" aria-hidden="true" data-sf-static>description</i></sf-icon></span>
7
+ <span class="sf-chat-attachment__body">
8
+ <span class="sf-chat-attachment__name" title="Договор.pdf">Договор.pdf</span>
9
+ <span class="sf-chat-attachment__meta">47 КБ</span>
10
+ </span>
11
+
12
+ <button type="button" class="sf-icon-button sf-icon-button--size-1/2 sf-icon-button--icon sf-icon-button--link sf-icon-button--on-surface flex items-cross-center content-main-center sf-chat-attachment__remove" aria-label="Убрать файл Договор.pdf" title="Убрать файл Договор.pdf"><sf-icon aria-hidden="true" icon="close" size="1" style="display: contents;" data-sf-size-relative><i class="sf-icon sf-icon--size-1 sf-icon--weight-regular" style="--sf-icon--grade:0;--sf-icon--optical-size:24" aria-hidden="true" data-sf-static>close</i></sf-icon></button>
13
+ </div><div role="group" class="sf-chat-attachment sf-chat-attachment--uploading" aria-label="Файл Регламент.docx, 1,5 МБ">
14
+ <span class="sf-chat-attachment__icon" aria-hidden="true"><sf-icon size="2" aria-hidden="true" icon="description" style="display: contents;" data-sf-size-relative><i class="sf-icon sf-icon--size-2 sf-icon--weight-regular" style="--sf-icon--grade:0;--sf-icon--optical-size:24" aria-hidden="true" data-sf-static>description</i></sf-icon></span>
15
+ <span class="sf-chat-attachment__body">
16
+ <span class="sf-chat-attachment__name" title="Регламент.docx">Регламент.docx</span>
17
+ <span class="sf-chat-attachment__meta">Загружается, 40%</span>
18
+ </span>
19
+ <span class="sf-chat-attachment__progress" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="40" aria-label="Регламент.docx" style="--sf-chat-attachment--progress: 0.4"></span>
20
+ <button type="button" class="sf-icon-button sf-icon-button--size-1/2 sf-icon-button--icon sf-icon-button--link sf-icon-button--on-surface flex items-cross-center content-main-center sf-chat-attachment__remove" aria-label="Убрать файл Регламент.docx" title="Убрать файл Регламент.docx"><sf-icon aria-hidden="true" icon="close" size="1" style="display: contents;" data-sf-size-relative><i class="sf-icon sf-icon--size-1 sf-icon--weight-regular" style="--sf-icon--grade:0;--sf-icon--optical-size:24" aria-hidden="true" data-sf-static>close</i></sf-icon></button>
21
+ </div><div role="group" class="sf-chat-attachment sf-chat-attachment--error" aria-label="Файл Скан.pdf, 2 КБ">
22
+ <span class="sf-chat-attachment__icon" aria-hidden="true"><sf-icon size="2" aria-hidden="true" icon="error" style="display: contents;" data-sf-size-relative><i class="sf-icon sf-icon--size-2 sf-icon--weight-regular" style="--sf-icon--grade:0;--sf-icon--optical-size:24" aria-hidden="true" data-sf-static>error</i></sf-icon></span>
23
+ <span class="sf-chat-attachment__body">
24
+ <span class="sf-chat-attachment__name" title="Скан.pdf">Скан.pdf</span>
25
+ <span class="sf-chat-attachment__meta" title="не похоже на документ" role="alert">не похоже на документ</span>
26
+ </span>
27
+
28
+ <button type="button" class="sf-icon-button sf-icon-button--size-1/2 sf-icon-button--icon sf-icon-button--link sf-icon-button--on-surface flex items-cross-center content-main-center sf-chat-attachment__remove" aria-label="Убрать файл Скан.pdf" title="Убрать файл Скан.pdf"><sf-icon aria-hidden="true" icon="close" size="1" style="display: contents;" data-sf-size-relative><i class="sf-icon sf-icon--size-1 sf-icon--weight-regular" style="--sf-icon--grade:0;--sf-icon--optical-size:24" aria-hidden="true" data-sf-static>close</i></sf-icon></button>
29
+ </div></div>
30
+ <div class="sf-chat-composer__row">
31
+ <button type="button" class="sf-icon-button sf-icon-button--size-1 sf-icon-button--icon sf-icon-button--link sf-icon-button--on-surface flex items-cross-center content-main-center sf-chat-composer__attach" aria-label="Прикрепить файл" title="Прикрепить файл"><sf-icon aria-hidden="true" icon="attach_file" size="2" style="display: contents;" data-sf-size-relative><i class="sf-icon sf-icon--size-2 sf-icon--weight-regular" style="--sf-icon--grade:0;--sf-icon--optical-size:24" aria-hidden="true" data-sf-static>attach_file</i></sf-icon></button>
32
+ <label class="sf-textarea sf-textarea--size-1 sf-textarea--flush sf-chat-composer__field sf-textarea--auto-grow" data-sf-textarea-bound="1" for="sf-chat-composer-files-1"><textarea class="sf-chat-composer__input" rows="1" data-auto-grow data-max-rows="8" id="sf-chat-composer-files-1" aria-label="Сообщение" aria-describedby="sf-chat-composer-files-2" placeholder="Спросите что-нибудь" style="--sf-textarea--min-rows: 1; --sf-textarea--max-rows: 8;"></textarea></label>
33
+ <span class="sf-chat-composer__count" id="sf-chat-composer-files-2" hidden></span>
34
+ <button type="submit" class="sf-icon-button sf-icon-button--size-1 sf-icon-button--icon sf-icon-button--tonal sf-icon-button--on-surface flex items-cross-center content-main-center sf-chat-composer__send" aria-label="Отправить" title="Отправить" disabled><sf-icon aria-hidden="true" icon="arrow_upward" size="2" style="display: contents;" data-sf-size-relative><i class="sf-icon sf-icon--size-2 sf-icon--weight-regular" style="--sf-icon--grade:0;--sf-icon--optical-size:24" aria-hidden="true" data-sf-static>arrow_upward</i></sf-icon></button>
35
+ <button type="button" class="sf-icon-button sf-icon-button--size-1 sf-icon-button--icon sf-icon-button--default sf-icon-button--on-surface flex items-cross-center content-main-center sf-chat-composer__stop" aria-label="Остановить ожидание" title="Остановить ожидание" hidden></button>
36
+ </div>
37
+ <div class="sf-chat-composer__drop" aria-hidden="true">Отпустите, чтобы прикрепить</div>
38
+ </div>
39
+ <p class="sf-chat-composer__notice" role="alert" hidden></p>
40
+ <p aria-live="polite" class="sf-chat-composer__hint" id="sf-chat-composer-files-3">Enter — отправить, Shift+Enter — новая строка</p>
41
+ <input class="sf-chat-composer__picker" type="file" multiple hidden accept=".pdf,.docx">
42
+ <span class="sf-chat-composer__said sr-only" aria-live="polite"></span>
43
+ </form>
44
+ </sf-chat-composer>
@@ -0,0 +1,20 @@
1
+ <!-- sf-chat-composer, example «near-limit»: the static markup (standard simai.smart-component 1.3.8 §5.4). Generated by scripts/snapshot-first-paint.mjs from the built output; do not edit, run it again. -->
2
+ <sf-chat-composer maxlength="12" value="Мой отпуск?" style="display: contents;">
3
+ <form novalidate class="sf-chat-composer" data-sf-static>
4
+ <div class="sf-chat-composer__box">
5
+ <div class="sf-chat-composer__files" hidden></div>
6
+ <div class="sf-chat-composer__row">
7
+ <button type="button" class="sf-icon-button sf-icon-button--size-1 sf-icon-button--icon sf-icon-button--link sf-icon-button--on-surface flex items-cross-center content-main-center sf-chat-composer__attach" aria-label="Прикрепить файл" title="Прикрепить файл" hidden></button>
8
+ <label class="sf-textarea sf-textarea--size-1 sf-textarea--flush sf-chat-composer__field sf-textarea--auto-grow" data-sf-textarea-bound="1" for="sf-chat-composer-near-limit-1"><textarea class="sf-chat-composer__input" rows="1" data-auto-grow data-max-rows="8" id="sf-chat-composer-near-limit-1" aria-label="Сообщение" aria-describedby="sf-chat-composer-near-limit-2" placeholder="Спросите что-нибудь" style="--sf-textarea--min-rows: 1; --sf-textarea--max-rows: 8;"></textarea></label>
9
+ <span class="sf-chat-composer__count" id="sf-chat-composer-near-limit-2">11 из 12</span>
10
+ <button type="submit" class="sf-icon-button sf-icon-button--size-1 sf-icon-button--icon sf-icon-button--default sf-icon-button--primary flex items-cross-center content-main-center sf-chat-composer__send" aria-label="Отправить" title="Отправить"><sf-icon aria-hidden="true" icon="arrow_upward" size="2" style="display: contents;" data-sf-size-relative><i class="sf-icon sf-icon--size-2 sf-icon--weight-regular" style="--sf-icon--grade:0;--sf-icon--optical-size:24" aria-hidden="true" data-sf-static>arrow_upward</i></sf-icon></button>
11
+ <button type="button" class="sf-icon-button sf-icon-button--size-1 sf-icon-button--icon sf-icon-button--default sf-icon-button--on-surface flex items-cross-center content-main-center sf-chat-composer__stop" aria-label="Остановить ожидание" title="Остановить ожидание" hidden></button>
12
+ </div>
13
+ <div class="sf-chat-composer__drop" aria-hidden="true">Отпустите, чтобы прикрепить</div>
14
+ </div>
15
+ <p class="sf-chat-composer__notice" role="alert" hidden></p>
16
+ <p aria-live="polite" class="sf-chat-composer__hint" id="sf-chat-composer-near-limit-3">Enter — отправить, Shift+Enter — новая строка</p>
17
+ <input class="sf-chat-composer__picker" type="file" multiple hidden>
18
+ <span class="sf-chat-composer__said sr-only" aria-live="polite">11 из 12</span>
19
+ </form>
20
+ </sf-chat-composer>
@@ -0,0 +1,20 @@
1
+ <!-- sf-chat-composer, example «reference»: the static markup (standard simai.smart-component 1.3.8 §5.4). Generated by scripts/snapshot-first-paint.mjs from the built output; do not edit, run it again. -->
2
+ <sf-chat-composer placeholder="Спросите о регламентах" maxlength="4000" attachments accept=".pdf,.docx" max-files="5" max-bytes="10485760" style="display: contents;">
3
+ <form novalidate class="sf-chat-composer" data-sf-static>
4
+ <div class="sf-chat-composer__box">
5
+ <div class="sf-chat-composer__files" hidden></div>
6
+ <div class="sf-chat-composer__row">
7
+ <button type="button" class="sf-icon-button sf-icon-button--size-1 sf-icon-button--icon sf-icon-button--link sf-icon-button--on-surface flex items-cross-center content-main-center sf-chat-composer__attach" aria-label="Прикрепить файл" title="Прикрепить файл"><sf-icon aria-hidden="true" icon="attach_file" size="2" style="display: contents;" data-sf-size-relative><i class="sf-icon sf-icon--size-2 sf-icon--weight-regular" style="--sf-icon--grade:0;--sf-icon--optical-size:24" aria-hidden="true" data-sf-static>attach_file</i></sf-icon></button>
8
+ <label class="sf-textarea sf-textarea--size-1 sf-textarea--flush sf-chat-composer__field sf-textarea--auto-grow" data-sf-textarea-bound="1" for="sf-chat-composer-reference-1"><textarea class="sf-chat-composer__input" rows="1" data-auto-grow data-max-rows="8" id="sf-chat-composer-reference-1" aria-label="Сообщение" aria-describedby="sf-chat-composer-reference-2" placeholder="Спросите о регламентах" style="--sf-textarea--min-rows: 1; --sf-textarea--max-rows: 8;"></textarea></label>
9
+ <span class="sf-chat-composer__count" id="sf-chat-composer-reference-2" hidden></span>
10
+ <button type="submit" class="sf-icon-button sf-icon-button--size-1 sf-icon-button--icon sf-icon-button--tonal sf-icon-button--on-surface flex items-cross-center content-main-center sf-chat-composer__send" aria-label="Отправить" title="Отправить" disabled><sf-icon aria-hidden="true" icon="arrow_upward" size="2" style="display: contents;" data-sf-size-relative><i class="sf-icon sf-icon--size-2 sf-icon--weight-regular" style="--sf-icon--grade:0;--sf-icon--optical-size:24" aria-hidden="true" data-sf-static>arrow_upward</i></sf-icon></button>
11
+ <button type="button" class="sf-icon-button sf-icon-button--size-1 sf-icon-button--icon sf-icon-button--default sf-icon-button--on-surface flex items-cross-center content-main-center sf-chat-composer__stop" aria-label="Остановить ожидание" title="Остановить ожидание" hidden></button>
12
+ </div>
13
+ <div class="sf-chat-composer__drop" aria-hidden="true">Отпустите, чтобы прикрепить</div>
14
+ </div>
15
+ <p class="sf-chat-composer__notice" role="alert" hidden></p>
16
+ <p aria-live="polite" class="sf-chat-composer__hint" id="sf-chat-composer-reference-3">Enter — отправить, Shift+Enter — новая строка</p>
17
+ <input class="sf-chat-composer__picker" type="file" multiple hidden accept=".pdf,.docx">
18
+ <span class="sf-chat-composer__said sr-only" aria-live="polite"></span>
19
+ </form>
20
+ </sf-chat-composer>
@@ -0,0 +1,88 @@
1
+ {
2
+ "$comment": "The sheets the first paint of sf-chat-composer needs, as the Loader asked for them while each example was rendered (standard simai.smart-component 1.3.8 §5.4). Paths are under the distribution root (distr/). The markup also needs the theme class on <html>: theme-light or theme-dark. Generated by scripts/snapshot-first-paint.mjs.",
3
+ "component": "sf-chat-composer",
4
+ "theme": [
5
+ "theme-light",
6
+ "theme-dark"
7
+ ],
8
+ "sheets": [
9
+ "component/icon-buttons/css/icon-buttons.min.css",
10
+ "component/icons/css/icons.min.css",
11
+ "component/textarea/css/textarea.min.css",
12
+ "core/css/core.css",
13
+ "smart/chat-composer/css/chat-composer.min.css",
14
+ "utility/align-items/default/css/default.min.css",
15
+ "utility/display/default/css/default.min.css",
16
+ "utility/font-weight/default/css/default.min.css",
17
+ "utility/justify-content/default/css/default.min.css",
18
+ "utility/position/default/css/default.min.css",
19
+ "utility/sr-only/default/css/default.min.css"
20
+ ],
21
+ "examples": {
22
+ "busy": [
23
+ "component/icon-buttons/css/icon-buttons.min.css",
24
+ "component/icons/css/icons.min.css",
25
+ "component/textarea/css/textarea.min.css",
26
+ "core/css/core.css",
27
+ "smart/chat-composer/css/chat-composer.min.css",
28
+ "utility/align-items/default/css/default.min.css",
29
+ "utility/display/default/css/default.min.css",
30
+ "utility/font-weight/default/css/default.min.css",
31
+ "utility/justify-content/default/css/default.min.css",
32
+ "utility/position/default/css/default.min.css",
33
+ "utility/sr-only/default/css/default.min.css"
34
+ ],
35
+ "disabled": [
36
+ "component/icon-buttons/css/icon-buttons.min.css",
37
+ "component/icons/css/icons.min.css",
38
+ "component/textarea/css/textarea.min.css",
39
+ "core/css/core.css",
40
+ "smart/chat-composer/css/chat-composer.min.css",
41
+ "utility/align-items/default/css/default.min.css",
42
+ "utility/display/default/css/default.min.css",
43
+ "utility/font-weight/default/css/default.min.css",
44
+ "utility/justify-content/default/css/default.min.css",
45
+ "utility/position/default/css/default.min.css",
46
+ "utility/sr-only/default/css/default.min.css"
47
+ ],
48
+ "files": [
49
+ "component/icon-buttons/css/icon-buttons.min.css",
50
+ "component/icons/css/icons.min.css",
51
+ "component/textarea/css/textarea.min.css",
52
+ "core/css/core.css",
53
+ "smart/chat-composer/css/chat-composer.min.css",
54
+ "utility/align-items/default/css/default.min.css",
55
+ "utility/display/default/css/default.min.css",
56
+ "utility/font-weight/default/css/default.min.css",
57
+ "utility/justify-content/default/css/default.min.css",
58
+ "utility/position/default/css/default.min.css",
59
+ "utility/sr-only/default/css/default.min.css"
60
+ ],
61
+ "near-limit": [
62
+ "component/icon-buttons/css/icon-buttons.min.css",
63
+ "component/icons/css/icons.min.css",
64
+ "component/textarea/css/textarea.min.css",
65
+ "core/css/core.css",
66
+ "smart/chat-composer/css/chat-composer.min.css",
67
+ "utility/align-items/default/css/default.min.css",
68
+ "utility/display/default/css/default.min.css",
69
+ "utility/font-weight/default/css/default.min.css",
70
+ "utility/justify-content/default/css/default.min.css",
71
+ "utility/position/default/css/default.min.css",
72
+ "utility/sr-only/default/css/default.min.css"
73
+ ],
74
+ "reference": [
75
+ "component/icon-buttons/css/icon-buttons.min.css",
76
+ "component/icons/css/icons.min.css",
77
+ "component/textarea/css/textarea.min.css",
78
+ "core/css/core.css",
79
+ "smart/chat-composer/css/chat-composer.min.css",
80
+ "utility/align-items/default/css/default.min.css",
81
+ "utility/display/default/css/default.min.css",
82
+ "utility/font-weight/default/css/default.min.css",
83
+ "utility/justify-content/default/css/default.min.css",
84
+ "utility/position/default/css/default.min.css",
85
+ "utility/sr-only/default/css/default.min.css"
86
+ ]
87
+ }
88
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "schema": "simai.smart-component-fixture.v2",
3
+ "id": "composer-reference",
4
+ "component": "smart.chat-composer",
5
+ "title": "Composer reference",
6
+ "summary": "Deterministic reference fixture for sf-chat-composer: files allowed (.pdf, .docx, up to five, 10 MB each), the field empty.",
7
+ "locale": "ru",
8
+ "props": {
9
+ "placeholder": "Спросите о регламентах",
10
+ "maxlength": 4000,
11
+ "attachments": true,
12
+ "accept": ".pdf,.docx",
13
+ "max-files": 5,
14
+ "max-bytes": 10485760
15
+ },
16
+ "children": [],
17
+ "state": "default"
18
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "schema": "simai.smart-component-scenario.v1",
3
+ "id": "smoke",
4
+ "component": "smart.chat-composer",
5
+ "fixture": "composer-reference",
6
+ "viewport": "desktop",
7
+ "actions": [
8
+ {
9
+ "type": "invoke",
10
+ "method": "setFiles",
11
+ "arguments": [
12
+ [
13
+ {
14
+ "id": "att_1",
15
+ "localId": "f1",
16
+ "name": "Договор.pdf",
17
+ "bytes": 48213
18
+ }
19
+ ]
20
+ ]
21
+ }
22
+ ],
23
+ "assertions": [
24
+ {
25
+ "type": "upgraded"
26
+ },
27
+ {
28
+ "type": "visible"
29
+ },
30
+ {
31
+ "type": "no-console-error"
32
+ },
33
+ {
34
+ "type": "no-network"
35
+ }
36
+ ]
37
+ }
@@ -0,0 +1,273 @@
1
+ @layer sf.reset, sf.tokens, sf.base, sf.utilities, sf.components, sf.overrides, sf.states;
2
+ @layer sf.components {
3
+ /* sf-chat-composer. The host is display: contents; .sf-chat-composer is
4
+ what a window places. Every value is a Framework token. The public
5
+ variables (component.json css-variables) are read here and never set, on
6
+ the element or any ancestor (public-variables.v1 rule):
7
+ --sf-chat-composer-background-color the box's ground
8
+ --sf-chat-composer-border-color the box's edge
9
+ --sf-chat-composer-hint-color the hint and the count
10
+ --sf-chat-composer-height the buttons' and one line's height
11
+ Their fallbacks are the tokens simai/ui-chat's chat.css and smart.css
12
+ gave the same places (--sf-chat--ink-muted, --sf-chat--touch, the
13
+ elevation-1 surface, now the card surface, the outline at 3:1), so the
14
+ composer reads as it did there. The box casts the raised shadow (C20). */
15
+ .sf-chat-composer {
16
+ --sf-chat-composer--muted: var(--sf-chat-composer-hint-color, var(--sf-on-surface-variant));
17
+ --sf-chat-composer--control: var(--sf-chat-composer-height, var(--sf-ui-1--control-height));
18
+ --sf-chat-composer--meta-size: var(--sf-label-medium--size);
19
+ --sf-chat-composer--meta-height: var(--sf-label-medium--height);
20
+ --sf-chat-composer--ui-size: var(--sf-label-large--size);
21
+ --sf-chat-composer--ui-height: var(--sf-label-large--height);
22
+ position: relative;
23
+ display: flex;
24
+ flex-direction: column;
25
+ gap: var(--sf-space-1\/3);
26
+ margin: 0;
27
+ }
28
+
29
+ /* Files stay one row, scrolled sideways: two of them must not take a
30
+ quarter of a phone's screen. */
31
+ .sf-chat-composer__files {
32
+ display: flex;
33
+ flex-wrap: nowrap;
34
+ align-items: flex-start;
35
+ gap: var(--sf-space-1\/3);
36
+ overflow-x: auto;
37
+ scrollbar-width: none;
38
+ }
39
+
40
+ .sf-chat-composer__files[hidden] { display: none; }
41
+
42
+ /* The box sets the nesting: its radius and its inset. One line and no
43
+ files -- a capsule, its round buttons concentric with it; taller -- the
44
+ corner is derived from what sits in it, the button's half plus the
45
+ inset, and the buttons and files inside take radius - inset. */
46
+ .sf-chat-composer__box {
47
+ --sf-chat-composer--radius: var(--sf-radius-rounded);
48
+ --sf-chat-composer--inset: var(--sf-space-1\/3);
49
+ position: relative;
50
+ display: flex;
51
+ flex-direction: column;
52
+ gap: var(--sf-space-1\/3);
53
+ padding: var(--sf-chat-composer--inset);
54
+ /* The field's edge at 3:1 against the page (WCAG 1.4.11). */
55
+ border: var(--sf-px) solid var(--sf-chat-composer-border-color, var(--sf-outline));
56
+ border-radius: var(--sf-chat-composer--radius);
57
+ background: var(--sf-chat-composer-background-color, var(--sf-surface-card));
58
+ box-shadow: var(--sf-shadow-raised);
59
+ transition: border-color var(--sf-duration-fast), box-shadow var(--sf-duration-fast);
60
+ }
61
+
62
+ .sf-chat-composer__box--tall {
63
+ --sf-chat-composer--radius: calc(var(--sf-chat-composer--control) / 2 + var(--sf-chat-composer--inset));
64
+ }
65
+
66
+ .sf-chat-composer__row {
67
+ display: flex;
68
+ align-items: center;
69
+ gap: var(--sf-space-1\/4);
70
+ }
71
+
72
+ .sf-chat-composer__box--tall .sf-chat-composer__row { align-items: flex-end; }
73
+
74
+ .sf-chat-composer__box .sf-icon-button {
75
+ --sf-icon-button-radius: max(var(--sf-radius--ui), calc(var(--sf-chat-composer--radius) - var(--sf-chat-composer--inset)));
76
+ min-inline-size: var(--sf-chat-composer--control);
77
+ min-block-size: var(--sf-chat-composer--control);
78
+ /* Stretched here, so centred here: the Framework's content-main-center
79
+ utility arrives by the Loader a moment later, and the icon would jump. */
80
+ justify-content: center;
81
+ }
82
+
83
+ /* The flush field draws no focus of its own; the box does, with the
84
+ Framework's ring, and only for the keyboard: a page that marks a
85
+ pointer's input (data-chat-input="pointer") gets a darker edge after a
86
+ click. Without a known input mode the ring shows. */
87
+ .sf-chat-composer__box:has(.sf-chat-composer__input:focus-visible) {
88
+ outline: var(--sf-focus--width) var(--sf-focus--style) var(--sf-focus--color);
89
+ outline-offset: var(--sf-focus--offset);
90
+ }
91
+
92
+ [data-chat-input='pointer'] .sf-chat-composer__box:has(.sf-chat-composer__input:focus-visible) {
93
+ outline: none;
94
+ border-color: var(--sf-chat-composer-border-color, var(--sf-outline));
95
+ }
96
+
97
+ /* In forced colours the field keeps the system outline (Framework, flush
98
+ surface); a second ring on the box would double it. */
99
+ @media (forced-colors: active) {
100
+ .sf-chat-composer__box:has(.sf-chat-composer__input:focus-visible) { outline: none; }
101
+ }
102
+
103
+ .sf-chat-composer--over .sf-chat-composer__box { border-color: var(--sf-outline-error); }
104
+
105
+ /* One line of text takes the buttons' own vertical inset, so the line and
106
+ the round buttons share one axis and the capsule stays concentric. The
107
+ label is a flex box: no baseline gap under the field. */
108
+ .sf-chat-composer__field {
109
+ display: flex;
110
+ flex: 1;
111
+ align-self: center;
112
+ min-inline-size: 0;
113
+ --sf-textarea-padding-inline: var(--sf-space-1\/4);
114
+ --sf-textarea-padding-block: calc((var(--sf-chat-composer--control) - var(--sf-text--height)) / 2);
115
+ }
116
+
117
+ .sf-chat-composer__input { flex: 1; }
118
+
119
+ /* No smaller than 16px on any width: iOS zooms the page into a smaller
120
+ field. The size ladder's 14px on phones loses to the floor: the same
121
+ element and selector shape as the Framework's size rule, one class more
122
+ (requested from the Framework as simai/ui-source#25 (c)). */
123
+ .sf-chat-composer__field.sf-textarea.sf-textarea--flush textarea.sf-chat-composer__input {
124
+ --sf-textarea-textarea--font-size: max(var(--sf-b6), var(--sf-text--size));
125
+ }
126
+
127
+ .sf-chat-composer__input:disabled { cursor: not-allowed; }
128
+
129
+ .sf-chat-composer__attach[hidden],
130
+ .sf-chat-composer__send[hidden],
131
+ .sf-chat-composer__stop[hidden],
132
+ .sf-chat-composer__count[hidden],
133
+ .sf-chat-composer__notice[hidden] { display: none; }
134
+
135
+ .sf-chat-composer__count {
136
+ align-self: center;
137
+ padding-inline: var(--sf-space-1\/4);
138
+ color: var(--sf-chat-composer--muted);
139
+ font-size: var(--sf-chat-composer--meta-size);
140
+ line-height: var(--sf-chat-composer--meta-height);
141
+ white-space: nowrap;
142
+ }
143
+
144
+ .sf-chat-composer--over .sf-chat-composer__count { color: var(--sf-error); }
145
+
146
+ .sf-chat-composer__notice {
147
+ margin: 0;
148
+ padding-inline: var(--sf-space-1\/2);
149
+ color: var(--sf-error);
150
+ font-size: var(--sf-chat-composer--meta-size);
151
+ line-height: var(--sf-chat-composer--meta-height);
152
+ }
153
+
154
+ .sf-chat-composer__hint {
155
+ margin: 0;
156
+ min-block-size: var(--sf-chat-composer--meta-height);
157
+ color: var(--sf-chat-composer--muted);
158
+ font-size: var(--sf-chat-composer--meta-size);
159
+ line-height: var(--sf-chat-composer--meta-height);
160
+ text-align: center;
161
+ }
162
+
163
+ .sf-chat-composer__drop {
164
+ position: absolute;
165
+ inset: 0;
166
+ display: none;
167
+ place-items: center;
168
+ border: calc(2 * var(--sf-px)) dashed var(--sf-outline-primary);
169
+ border-radius: inherit;
170
+ background: var(--sf-primary-container);
171
+ color: var(--sf-on-primary-container);
172
+ font-size: var(--sf-chat-composer--ui-size);
173
+ pointer-events: none;
174
+ }
175
+
176
+ .sf-chat-composer--dragging .sf-chat-composer__drop { display: grid; }
177
+
178
+ /* --- a file chip (the chat's attachment, as simai/ui-chat's chat.css) -- */
179
+
180
+ .sf-chat-attachment {
181
+ position: relative;
182
+ display: inline-flex;
183
+ flex: none;
184
+ align-items: center;
185
+ gap: var(--sf-space-1\/3);
186
+ max-inline-size: var(--sf-f6);
187
+ min-inline-size: 0;
188
+ min-block-size: var(--sf-ui-2--control-height);
189
+ padding-block: var(--sf-space-1\/4);
190
+ padding-inline: var(--sf-space-1\/3);
191
+ border: var(--sf-px) solid var(--sf-outline-variant);
192
+ /* A file inside the box follows the box's corner, and passes the rule on
193
+ to its own icon and remove button. */
194
+ --sf-chat-attachment--radius: max(var(--sf-radius--ui), calc(var(--sf-chat-composer--radius) - var(--sf-chat-composer--inset)));
195
+ border-radius: var(--sf-chat-attachment--radius);
196
+ background: var(--sf-surface-0);
197
+ color: var(--sf-on-surface);
198
+ }
199
+
200
+ .sf-chat-attachment--error { border-color: var(--sf-outline-error); }
201
+
202
+ .sf-chat-attachment__icon {
203
+ flex: none;
204
+ display: grid;
205
+ place-items: center;
206
+ inline-size: var(--sf-ui-1\/2--control-height);
207
+ block-size: var(--sf-ui-1\/2--control-height);
208
+ border-radius: max(var(--sf-radius--ui), calc(var(--sf-chat-attachment--radius) - var(--sf-space-1\/3)));
209
+ background: var(--sf-surface-container);
210
+ color: var(--sf-chat-composer--muted);
211
+ }
212
+
213
+ .sf-chat-attachment--error .sf-chat-attachment__icon { color: var(--sf-error); }
214
+
215
+ .sf-chat-attachment__body {
216
+ display: flex;
217
+ flex: 1;
218
+ flex-direction: column;
219
+ min-inline-size: 0;
220
+ }
221
+
222
+ .sf-chat-attachment__name {
223
+ overflow: hidden;
224
+ text-overflow: ellipsis;
225
+ white-space: nowrap;
226
+ font-size: var(--sf-chat-composer--ui-size);
227
+ line-height: var(--sf-chat-composer--ui-height);
228
+ }
229
+
230
+ /* One line: a refusal's reason is shortened here and said in full in the
231
+ notice under the field. */
232
+ .sf-chat-attachment__meta {
233
+ overflow: hidden;
234
+ text-overflow: ellipsis;
235
+ white-space: nowrap;
236
+ color: var(--sf-chat-composer--muted);
237
+ font-size: var(--sf-chat-composer--meta-size);
238
+ line-height: var(--sf-chat-composer--meta-height);
239
+ }
240
+
241
+ .sf-chat-attachment--error .sf-chat-attachment__meta { color: var(--sf-error); }
242
+
243
+ .sf-chat-attachment__progress {
244
+ position: absolute;
245
+ inset-inline: var(--sf-space-1\/3);
246
+ inset-block-end: 0;
247
+ block-size: calc(2 * var(--sf-px));
248
+ border-radius: var(--sf-radius-circle);
249
+ background: linear-gradient(90deg, var(--sf-primary) calc(var(--sf-chat-attachment--progress, 0) * 100%), transparent 0);
250
+ }
251
+
252
+ .sf-chat-attachment__remove { flex: none; }
253
+
254
+ .sf-chat-composer__files .sf-chat-attachment__remove {
255
+ --sf-icon-button-radius: max(var(--sf-radius--ui), calc(var(--sf-chat-attachment--radius) - var(--sf-space-1\/3)));
256
+ border-radius: max(var(--sf-radius--ui), calc(var(--sf-chat-attachment--radius) - var(--sf-space-1\/3)));
257
+ }
258
+
259
+ /* Touch screens: every target at least the comfortable control, and no
260
+ keyboard to press Enter on, so the hint has nothing to say. */
261
+ @media (pointer: coarse) {
262
+ .sf-chat-composer {
263
+ --sf-chat-composer--control: var(--sf-chat-composer-height, var(--sf-ui-2--control-height));
264
+ }
265
+
266
+ .sf-chat-attachment__remove {
267
+ min-inline-size: var(--sf-ui-2--control-height);
268
+ min-block-size: var(--sf-ui-2--control-height);
269
+ }
270
+
271
+ .sf-chat-composer__hint:not(.sf-chat-composer__hint--busy) { display: none; }
272
+ }
273
+ }
@@ -0,0 +1,109 @@
1
+ import {html, nothing} from "lit";
2
+ import {repeat} from "lit/directives/repeat.js";
3
+ import {iconButton, renderAttachment} from "./parts.js";
4
+ import "./default.css";
5
+
6
+ // Where a question is written and files are added: a form with the box (the
7
+ // chips over the line they go with, then attach, the field, the count, send
8
+ // or stop, or both while a typed message would be queued), the notice of
9
+ // refused files, the hint under the field, the hidden file picker and the
10
+ // polite line that speaks a threshold of the count.
11
+ //
12
+ // The field is the Framework's flush sf-textarea with its auto-grow (eight
13
+ // rows). Its value is never bound: a redraw keeps the text, the caret and an
14
+ // IME composition; the element reads and writes the field itself.
15
+ //
16
+ // The first paint is the box with its field and buttons, the chips the host
17
+ // gave, and the hint (§5.4).
18
+ export function renderChatComposerTemplate(context) {
19
+ const {component} = context;
20
+ const rootClass = [
21
+ "sf-chat-composer",
22
+ context.over ? "sf-chat-composer--over" : "",
23
+ context.disabled ? "sf-chat-composer--disabled" : "",
24
+ context.dragging ? "sf-chat-composer--dragging" : "",
25
+ ].filter(Boolean).join(" ");
26
+ return html`
27
+ <form
28
+ class=${rootClass}
29
+ novalidate
30
+ @submit=${(event) => { event.preventDefault(); component.send(); }}
31
+ @dragenter=${(event) => component.onDragEnter(event)}
32
+ @dragover=${(event) => component.onDragOver(event)}
33
+ @dragleave=${() => component.onDragLeave()}
34
+ @drop=${(event) => component.onDrop(event)}
35
+ >
36
+ <div class="sf-chat-composer__box${context.tall ? " sf-chat-composer__box--tall" : ""}">
37
+ <div class="sf-chat-composer__files" ?hidden=${!context.files.length}>${repeat(
38
+ context.files,
39
+ (file, index) => file.localId ?? file.id ?? `#${index}`,
40
+ (file) => renderAttachment(file, {words: context.fileWords, removable: true, onRemove: (one) => component.removeFile(one)}),
41
+ )}</div>
42
+ <div class="sf-chat-composer__row">
43
+ ${iconButton({
44
+ icon: "attach_file",
45
+ label: context.attachLabel,
46
+ size: "1",
47
+ className: "sf-chat-composer__attach",
48
+ hidden: !context.attachments,
49
+ disabled: context.attachDisabled,
50
+ onClick: () => component.pick(),
51
+ })}
52
+ <label class="sf-textarea sf-textarea--size-1 sf-textarea--flush sf-chat-composer__field"><textarea
53
+ class="sf-chat-composer__input"
54
+ rows="1"
55
+ data-auto-grow
56
+ data-max-rows="8"
57
+ id=${context.inputId}
58
+ aria-label=${context.fieldLabel}
59
+ aria-describedby=${context.statusId}
60
+ placeholder=${context.placeholder}
61
+ ?disabled=${context.disabled}
62
+ @input=${() => component.onInput()}
63
+ @keydown=${(event) => component.onKey(event)}
64
+ @paste=${(event) => component.onPaste(event)}
65
+ ></textarea></label>
66
+ <span class="sf-chat-composer__count" id=${context.statusId} ?hidden=${!context.near}>${context.countText}</span>
67
+ ${iconButton({
68
+ icon: "arrow_upward",
69
+ label: context.sendLabel,
70
+ appearance: context.ready ? "default" : "tonal",
71
+ scheme: context.ready ? "primary" : "on-surface",
72
+ size: "1",
73
+ className: "sf-chat-composer__send",
74
+ type: "submit",
75
+ // Busy, it stands beside stop only for a message the host queues.
76
+ hidden: context.busy && !(context.queueing && context.ready),
77
+ disabled: !context.ready,
78
+ })}
79
+ ${iconButton({
80
+ icon: "stop",
81
+ label: context.stopLabel,
82
+ appearance: "default",
83
+ scheme: "on-surface",
84
+ size: "1",
85
+ className: "sf-chat-composer__stop",
86
+ hidden: !context.busy || context.noStop,
87
+ onClick: () => component.stop(),
88
+ })}
89
+ </div>
90
+ <div class="sf-chat-composer__drop" aria-hidden="true">${context.dropText}</div>
91
+ </div>
92
+ <p class="sf-chat-composer__notice" role="alert" ?hidden=${!context.notice}>${context.notice}</p>
93
+ <p
94
+ class="sf-chat-composer__hint${context.busyHint ? " sf-chat-composer__hint--busy" : ""}"
95
+ id=${context.hintId}
96
+ aria-live="polite"
97
+ >${context.hint}</p>
98
+ <input
99
+ class="sf-chat-composer__picker"
100
+ type="file"
101
+ multiple
102
+ hidden
103
+ accept=${context.accept || nothing}
104
+ @change=${(event) => component.onPicked(event.currentTarget)}
105
+ >
106
+ <span class="sf-chat-composer__said sr-only" aria-live="polite">${context.said}</span>
107
+ </form>
108
+ `;
109
+ }