@simai-studio/chat 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -5
- package/dist/package-receipt.json +438 -436
- package/dist/set.json +4 -2
- package/dist/smart/chat-composer/aliases.json +11 -0
- package/dist/smart/chat-composer/aliases.json.gz +0 -0
- package/dist/smart/chat-composer/component.json +44 -4
- package/dist/smart/chat-composer/component.json.gz +0 -0
- package/dist/smart/chat-composer/css/chat-composer.css +8 -103
- package/dist/smart/chat-composer/css/chat-composer.css.gz +0 -0
- package/dist/smart/chat-composer/css/chat-composer.min.css +2 -2
- package/dist/smart/chat-composer/css/chat-composer.min.css.gz +0 -0
- package/dist/smart/chat-composer/examples.json +27 -8
- package/dist/smart/chat-composer/examples.json.gz +0 -0
- package/dist/smart/chat-composer/js/chat-composer.js +65 -60
- package/dist/smart/chat-composer/js/chat-composer.js.gz +0 -0
- package/dist/smart/chat-composer/js/chat-composer.min.js +17 -19
- package/dist/smart/chat-composer/js/chat-composer.min.js.gz +0 -0
- package/dist/smart/chat-composer/lang/en.json +1 -4
- package/dist/smart/chat-composer/lang/en.json.gz +0 -0
- package/dist/smart/chat-composer/lang/ru.json +1 -4
- package/dist/smart/chat-composer/lang/ru.json.gz +0 -0
- package/dist/smart/chat-composer/probe.json +21 -5
- package/dist/smart/chat-composer/probe.json.gz +0 -0
- package/dist/smart/chat-composer/smart.manifest.json +41 -15
- package/dist/smart/chat-composer/smart.manifest.json.gz +0 -0
- package/dist/smart/chat-composer/static/default/busy.html +2 -2
- package/dist/smart/chat-composer/static/default/busy.html.gz +0 -0
- package/dist/smart/chat-composer/static/default/disabled.html +1 -1
- package/dist/smart/chat-composer/static/default/disabled.html.gz +0 -0
- package/dist/smart/chat-composer/static/default/files.html +82 -27
- package/dist/smart/chat-composer/static/default/files.html.gz +0 -0
- package/dist/smart/chat-composer/static/default/near-limit.html +2 -2
- package/dist/smart/chat-composer/static/default/near-limit.html.gz +0 -0
- package/dist/smart/chat-composer/static/default/reference.html +2 -2
- package/dist/smart/chat-composer/static/default/reference.html.gz +0 -0
- package/dist/smart/chat-composer/static/sheets.json +24 -2
- package/dist/smart/chat-composer/static/sheets.json.gz +0 -0
- package/dist/smart/chat-composer/template/default.css +7 -82
- package/dist/smart/chat-composer/template/default.css.gz +0 -0
- package/dist/smart/chat-composer/template/default.js +1 -1
- package/dist/smart/chat-composer/template/default.js.gz +0 -0
- package/dist/smart/chat-composer/template/parts.js +40 -33
- package/dist/smart/chat-composer/template/parts.js.gz +0 -0
- package/dist/smart/chat-interlocutor/component.json +3 -2
- package/dist/smart/chat-interlocutor/component.json.gz +0 -0
- package/dist/smart/chat-interlocutor/css/chat-interlocutor.css +1 -36
- package/dist/smart/chat-interlocutor/css/chat-interlocutor.css.gz +0 -0
- package/dist/smart/chat-interlocutor/css/chat-interlocutor.min.css +2 -2
- package/dist/smart/chat-interlocutor/css/chat-interlocutor.min.css.gz +0 -0
- package/dist/smart/chat-interlocutor/js/chat-interlocutor.js +1 -1
- package/dist/smart/chat-interlocutor/js/chat-interlocutor.js.gz +0 -0
- package/dist/smart/chat-interlocutor/js/chat-interlocutor.min.js +1 -1
- package/dist/smart/chat-interlocutor/js/chat-interlocutor.min.js.gz +0 -0
- package/dist/smart/chat-interlocutor/smart.manifest.json +4 -4
- package/dist/smart/chat-interlocutor/smart.manifest.json.gz +0 -0
- package/dist/smart/chat-interlocutor/static/default/former.html +1 -1
- package/dist/smart/chat-interlocutor/static/default/former.html.gz +0 -0
- package/dist/smart/chat-interlocutor/static/default/grouped.html +1 -1
- package/dist/smart/chat-interlocutor/static/default/grouped.html.gz +0 -0
- package/dist/smart/chat-interlocutor/static/default/reference.html +1 -1
- package/dist/smart/chat-interlocutor/static/default/reference.html.gz +0 -0
- package/dist/smart/chat-interlocutor/static/default/single.html +1 -1
- package/dist/smart/chat-interlocutor/static/default/single.html.gz +0 -0
- package/dist/smart/chat-interlocutor/static/sheets.json +10 -5
- package/dist/smart/chat-interlocutor/static/sheets.json.gz +0 -0
- package/dist/smart/chat-interlocutor/template/default.css +1 -1
- package/dist/smart/chat-interlocutor/template/default.css.gz +0 -0
- package/dist/smart/chat-message/aliases.json +11 -0
- package/dist/smart/chat-message/aliases.json.gz +0 -0
- package/dist/smart/chat-message/component.json +30 -2
- package/dist/smart/chat-message/component.json.gz +0 -0
- package/dist/smart/chat-message/css/chat-message.css +91 -1122
- package/dist/smart/chat-message/css/chat-message.css.gz +0 -0
- package/dist/smart/chat-message/css/chat-message.min.css +2 -2
- package/dist/smart/chat-message/css/chat-message.min.css.gz +0 -0
- package/dist/smart/chat-message/examples.json +32 -10
- package/dist/smart/chat-message/examples.json.gz +0 -0
- package/dist/smart/chat-message/js/chat-message.js +511 -150
- package/dist/smart/chat-message/js/chat-message.js.gz +0 -0
- package/dist/smart/chat-message/js/chat-message.min.js +15 -25
- package/dist/smart/chat-message/js/chat-message.min.js.gz +0 -0
- package/dist/smart/chat-message/lang/en.json +1 -6
- package/dist/smart/chat-message/lang/en.json.gz +0 -0
- package/dist/smart/chat-message/lang/ru.json +1 -6
- package/dist/smart/chat-message/lang/ru.json.gz +0 -0
- package/dist/smart/chat-message/probe.json +31 -9
- package/dist/smart/chat-message/probe.json.gz +0 -0
- package/dist/smart/chat-message/smart.manifest.json +23 -13
- package/dist/smart/chat-message/smart.manifest.json.gz +0 -0
- package/dist/smart/chat-message/static/default/brief-card.html +1 -1
- package/dist/smart/chat-message/static/default/brief-card.html.gz +0 -0
- package/dist/smart/chat-message/static/default/brief-questions.html +1 -1
- package/dist/smart/chat-message/static/default/brief-questions.html.gz +0 -0
- package/dist/smart/chat-message/static/default/deliverables.html +1 -1
- package/dist/smart/chat-message/static/default/deliverables.html.gz +0 -0
- package/dist/smart/chat-message/static/default/document.html +2 -2
- package/dist/smart/chat-message/static/default/document.html.gz +0 -0
- package/dist/smart/chat-message/static/default/failed.html +1 -1
- package/dist/smart/chat-message/static/default/failed.html.gz +0 -0
- package/dist/smart/chat-message/static/default/feedback-reason.html +1 -1
- package/dist/smart/chat-message/static/default/feedback-reason.html.gz +0 -0
- package/dist/smart/chat-message/static/default/limit.html +1 -1
- package/dist/smart/chat-message/static/default/limit.html.gz +0 -0
- package/dist/smart/chat-message/static/default/proposal.html +17 -19
- package/dist/smart/chat-message/static/default/proposal.html.gz +0 -0
- package/dist/smart/chat-message/static/default/question.html +15 -11
- package/dist/smart/chat-message/static/default/question.html.gz +0 -0
- package/dist/smart/chat-message/static/default/reference.html +1 -1
- package/dist/smart/chat-message/static/default/reference.html.gz +0 -0
- package/dist/smart/chat-message/static/default/steps.html +1 -1
- package/dist/smart/chat-message/static/default/steps.html.gz +0 -0
- package/dist/smart/chat-message/static/default/stopped.html +1 -1
- package/dist/smart/chat-message/static/default/stopped.html.gz +0 -0
- package/dist/smart/chat-message/static/person/person-own.html +1 -1
- package/dist/smart/chat-message/static/person/person-own.html.gz +0 -0
- package/dist/smart/chat-message/static/person/person-reply.html +1 -5
- package/dist/smart/chat-message/static/person/person-reply.html.gz +0 -0
- package/dist/smart/chat-message/static/person/person.html +8 -10
- package/dist/smart/chat-message/static/person/person.html.gz +0 -0
- package/dist/smart/chat-message/static/sheets.json +66 -12
- package/dist/smart/chat-message/static/sheets.json.gz +0 -0
- package/dist/smart/chat-message/template/default.css +9 -99
- package/dist/smart/chat-message/template/default.css.gz +0 -0
- package/dist/smart/chat-threads/component.json +10 -2
- package/dist/smart/chat-threads/component.json.gz +0 -0
- package/dist/smart/chat-threads/css/chat-threads.css +1 -17
- package/dist/smart/chat-threads/css/chat-threads.css.gz +0 -0
- package/dist/smart/chat-threads/css/chat-threads.min.css +2 -2
- package/dist/smart/chat-threads/css/chat-threads.min.css.gz +0 -0
- package/dist/smart/chat-threads/examples.json +3 -3
- package/dist/smart/chat-threads/examples.json.gz +0 -0
- package/dist/smart/chat-threads/js/chat-threads.js +1 -1
- package/dist/smart/chat-threads/js/chat-threads.js.gz +0 -0
- package/dist/smart/chat-threads/js/chat-threads.min.js +1 -1
- package/dist/smart/chat-threads/js/chat-threads.min.js.gz +0 -0
- package/dist/smart/chat-threads/probe.json +3 -3
- package/dist/smart/chat-threads/probe.json.gz +0 -0
- package/dist/smart/chat-threads/smart.manifest.json +11 -4
- package/dist/smart/chat-threads/smart.manifest.json.gz +0 -0
- package/dist/smart/chat-threads/static/default/activity.html +27 -21
- package/dist/smart/chat-threads/static/default/activity.html.gz +0 -0
- package/dist/smart/chat-threads/static/default/activity.skeleton.html +27 -21
- package/dist/smart/chat-threads/static/default/activity.skeleton.html.gz +0 -0
- package/dist/smart/chat-threads/static/default/archive.html +9 -6
- package/dist/smart/chat-threads/static/default/archive.html.gz +0 -0
- package/dist/smart/chat-threads/static/default/archive.skeleton.html +9 -6
- package/dist/smart/chat-threads/static/default/archive.skeleton.html.gz +0 -0
- package/dist/smart/chat-threads/static/default/avatars.html +25 -13
- package/dist/smart/chat-threads/static/default/avatars.html.gz +0 -0
- package/dist/smart/chat-threads/static/default/avatars.skeleton.html +25 -13
- package/dist/smart/chat-threads/static/default/avatars.skeleton.html.gz +0 -0
- package/dist/smart/chat-threads/static/default/empty.html +11 -9
- package/dist/smart/chat-threads/static/default/empty.html.gz +0 -0
- package/dist/smart/chat-threads/static/default/loading.html +11 -9
- package/dist/smart/chat-threads/static/default/loading.html.gz +0 -0
- package/dist/smart/chat-threads/static/default/people.html +20 -11
- package/dist/smart/chat-threads/static/default/people.html.gz +0 -0
- package/dist/smart/chat-threads/static/default/people.skeleton.html +20 -11
- package/dist/smart/chat-threads/static/default/people.skeleton.html.gz +0 -0
- package/dist/smart/chat-threads/static/default/reference.html +22 -13
- package/dist/smart/chat-threads/static/default/reference.html.gz +0 -0
- package/dist/smart/chat-threads/static/default/reference.skeleton.html +22 -13
- package/dist/smart/chat-threads/static/default/reference.skeleton.html.gz +0 -0
- package/dist/smart/chat-threads/static/default/ungrouped.html +18 -13
- package/dist/smart/chat-threads/static/default/ungrouped.html.gz +0 -0
- package/dist/smart/chat-threads/static/default/ungrouped.skeleton.html +18 -13
- package/dist/smart/chat-threads/static/default/ungrouped.skeleton.html.gz +0 -0
- package/dist/smart/chat-threads/static/sheets.json +81 -0
- package/dist/smart/chat-threads/static/sheets.json.gz +0 -0
- package/dist/smart/chat-threads/template/default.css +1 -1
- package/dist/smart/chat-threads/template/default.css.gz +0 -0
- package/dist/smart/chat-window/component.json +12 -2
- package/dist/smart/chat-window/component.json.gz +0 -0
- package/dist/smart/chat-window/css/chat-window.css +1 -209
- package/dist/smart/chat-window/css/chat-window.css.gz +0 -0
- package/dist/smart/chat-window/css/chat-window.min.css +2 -2
- package/dist/smart/chat-window/css/chat-window.min.css.gz +0 -0
- package/dist/smart/chat-window/examples.json +3 -3
- package/dist/smart/chat-window/examples.json.gz +0 -0
- package/dist/smart/chat-window/js/chat-window.js +520 -122
- package/dist/smart/chat-window/js/chat-window.js.gz +0 -0
- package/dist/smart/chat-window/js/chat-window.min.js +1 -1
- package/dist/smart/chat-window/js/chat-window.min.js.gz +0 -0
- package/dist/smart/chat-window/probe.json +3 -3
- package/dist/smart/chat-window/probe.json.gz +0 -0
- package/dist/smart/chat-window/smart.manifest.json +15 -6
- package/dist/smart/chat-window/smart.manifest.json.gz +0 -0
- package/dist/smart/chat-window/static/default/archived.html +15 -12
- package/dist/smart/chat-window/static/default/archived.html.gz +0 -0
- package/dist/smart/chat-window/static/default/embedded.html +19 -13
- package/dist/smart/chat-window/static/default/embedded.html.gz +0 -0
- package/dist/smart/chat-window/static/default/greeting.html +19 -13
- package/dist/smart/chat-window/static/default/greeting.html.gz +0 -0
- package/dist/smart/chat-window/static/default/people.html +21 -27
- package/dist/smart/chat-window/static/default/people.html.gz +0 -0
- package/dist/smart/chat-window/static/default/proposal.html +36 -32
- package/dist/smart/chat-window/static/default/proposal.html.gz +0 -0
- package/dist/smart/chat-window/static/default/reference.html +20 -14
- package/dist/smart/chat-window/static/default/reference.html.gz +0 -0
- package/dist/smart/chat-window/static/default/waiting.html +19 -13
- package/dist/smart/chat-window/static/default/waiting.html.gz +0 -0
- package/dist/smart/chat-window/static/sheets.json +50 -0
- package/dist/smart/chat-window/static/sheets.json.gz +0 -0
- package/dist/smart/chat-window/template/default.css +1 -1
- package/dist/smart/chat-window/template/default.css.gz +0 -0
- package/dist/smart/rule.js +8 -0
- package/dist/smart/rule.js.gz +0 -0
- package/package.json +1 -1
|
@@ -301,26 +301,7 @@ class SfChatComposer extends ChatComposerElement {
|
|
|
301
301
|
dropText: this.sfWord("drop-text"),
|
|
302
302
|
inputId: (0,_core_js_instance_path__WEBPACK_IMPORTED_MODULE_2__.partId)(path, "input"),
|
|
303
303
|
statusId: (0,_core_js_instance_path__WEBPACK_IMPORTED_MODULE_2__.partId)(path, "status"),
|
|
304
|
-
hintId: (0,_core_js_instance_path__WEBPACK_IMPORTED_MODULE_2__.partId)(path, "hint")
|
|
305
|
-
fileWords: {
|
|
306
|
-
file: (name, size) => this.sfWord("file-label", {
|
|
307
|
-
vars: {
|
|
308
|
-
name,
|
|
309
|
-
size
|
|
310
|
-
}
|
|
311
|
-
}),
|
|
312
|
-
uploading: percent => this.sfWord("uploading-text", {
|
|
313
|
-
vars: {
|
|
314
|
-
percent
|
|
315
|
-
}
|
|
316
|
-
}),
|
|
317
|
-
remove: name => this.sfWord("remove-label", {
|
|
318
|
-
vars: {
|
|
319
|
-
name
|
|
320
|
-
}
|
|
321
|
-
}),
|
|
322
|
-
size: bytes => this.formatBytes(bytes)
|
|
323
|
-
}
|
|
304
|
+
hintId: (0,_core_js_instance_path__WEBPACK_IMPORTED_MODULE_2__.partId)(path, "hint")
|
|
324
305
|
};
|
|
325
306
|
}
|
|
326
307
|
|
|
@@ -493,6 +474,15 @@ class SfChatComposer extends ChatComposerElement {
|
|
|
493
474
|
cancelable: true
|
|
494
475
|
});
|
|
495
476
|
}
|
|
477
|
+
/** «Повторить» on a chip that did not upload (K-08): the host sends the file again. */
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
retryFile(file) {
|
|
481
|
+
this.sfEmit("retry", {
|
|
482
|
+
id: file.id ?? file.localId,
|
|
483
|
+
name: file.name
|
|
484
|
+
});
|
|
485
|
+
}
|
|
496
486
|
|
|
497
487
|
canSend() {
|
|
498
488
|
const text = this.value.trim();
|
|
@@ -582,9 +572,9 @@ function renderChatComposerTemplate(context) {
|
|
|
582
572
|
>
|
|
583
573
|
<div class="sf-chat-composer__box${context.tall ? " sf-chat-composer__box--tall" : ""}">
|
|
584
574
|
<div class="sf-chat-composer__files" ?hidden=${!context.files.length}>${(0,lit_directives_repeat_js__WEBPACK_IMPORTED_MODULE_1__.repeat)(context.files, (file, index) => file.localId ?? file.id ?? `#${index}`, file => (0,_parts_js__WEBPACK_IMPORTED_MODULE_2__.renderAttachment)(file, {
|
|
585
|
-
words: context.fileWords,
|
|
586
575
|
removable: true,
|
|
587
|
-
onRemove: one => component.removeFile(one)
|
|
576
|
+
onRemove: one => component.removeFile(one),
|
|
577
|
+
onRetry: one => component.retryFile(one)
|
|
588
578
|
}))}</div>
|
|
589
579
|
<div class="sf-chat-composer__row">
|
|
590
580
|
${(0,_parts_js__WEBPACK_IMPORTED_MODULE_2__.iconButton)({
|
|
@@ -677,8 +667,8 @@ lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_async_dependencies_result__[0];
|
|
|
677
667
|
// The two small pieces the composer draws more than once, as Lit templates:
|
|
678
668
|
// the Framework's icon button and a file chip. In simai/ui-chat they were the
|
|
679
669
|
// base Component's iconButton and renderAttachment (component/chat/js/render.js),
|
|
680
|
-
// plain DOM shared with the site widget;
|
|
681
|
-
// markup
|
|
670
|
+
// plain DOM shared with the site widget; the icon button is the Framework's
|
|
671
|
+
// markup, and since K-08 the chip is the Framework's sf-file-preview (chip).
|
|
682
672
|
// The icon step that sits in a button of each step: 16 in 32, 20 in 40.
|
|
683
673
|
|
|
684
674
|
const ICON_IN_BUTTON = {
|
|
@@ -723,46 +713,61 @@ function attachmentState(file) {
|
|
|
723
713
|
return progress !== undefined && progress !== null && progress < 1 ? "uploading" : "ready";
|
|
724
714
|
}
|
|
725
715
|
/**
|
|
726
|
-
* A file chip
|
|
727
|
-
*
|
|
716
|
+
* A file chip (K-08, SIMAI Framework pair ui-73df5d1b4d4c): the Framework's
|
|
717
|
+
* sf-file-preview in its chip look draws the name, the type and the size,
|
|
718
|
+
* the upload's bar and per cent (state uploading, value), the refusal
|
|
719
|
+
* («Не загрузился: …», state error, error-text, with its «Повторить») and «×».
|
|
720
|
+
* The chat only maps its file to the preview's settings and hears its
|
|
721
|
+
* requests: detach («×») and retry («Повторить»), which go no further than
|
|
722
|
+
* the chip -- the host hears the chat's own events.
|
|
728
723
|
*
|
|
729
|
-
*
|
|
730
|
-
*
|
|
724
|
+
* The class sf-chat-attachment (and sf-chat-attachment--<state>) stays on the
|
|
725
|
+
* preview's host until 2027-01-01, a dated alias for a page that finds or
|
|
726
|
+
* styles a chip by it (aliases.json); its inner parts are the preview's.
|
|
727
|
+
*
|
|
728
|
+
* A progress of 0 (or none known) runs the bar without a share; an error that
|
|
729
|
+
* is not text (true) says «Не загрузился» alone.
|
|
730
|
+
*
|
|
731
|
+
* @param {{id?: string, name: string, bytes: number, href?: string, mime?: string, progress?: number|null, error?: string|boolean|null}} file
|
|
731
732
|
*/
|
|
732
733
|
|
|
733
734
|
function renderAttachment(file, {
|
|
734
|
-
words,
|
|
735
735
|
removable = false,
|
|
736
|
-
|
|
736
|
+
href = "",
|
|
737
|
+
onRemove = null,
|
|
738
|
+
onRetry = null,
|
|
739
|
+
onDownload = null,
|
|
740
|
+
className = ""
|
|
737
741
|
} = {}) {
|
|
738
742
|
const state = attachmentState(file);
|
|
739
743
|
const name = String(file.name ?? "");
|
|
740
|
-
const
|
|
741
|
-
const percent = Math.round((file.progress || 0) * 100);
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
744
|
+
const bytes = file.bytes === null || file.bytes === undefined || file.bytes === "" ? NaN : Number(file.bytes);
|
|
745
|
+
const percent = Math.round(Math.min(1, Math.max(0, Number(file.progress) || 0)) * 100);
|
|
746
|
+
|
|
747
|
+
const stop = handler => event => {
|
|
748
|
+
event.stopPropagation();
|
|
749
|
+
event.preventDefault();
|
|
750
|
+
handler?.(file, event);
|
|
751
|
+
};
|
|
752
|
+
|
|
753
|
+
return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<sf-file-preview
|
|
754
|
+
class="sf-chat-attachment sf-chat-attachment--${state} ${className}"
|
|
755
|
+
appearance="chip"
|
|
756
|
+
file-name=${name}
|
|
757
|
+
file-size=${Number.isFinite(bytes) && bytes >= 0 ? String(bytes) : lit__WEBPACK_IMPORTED_MODULE_0__.nothing}
|
|
758
|
+
mime-type=${file.mime || lit__WEBPACK_IMPORTED_MODULE_0__.nothing}
|
|
759
|
+
href=${href || lit__WEBPACK_IMPORTED_MODULE_0__.nothing}
|
|
760
|
+
state=${state}
|
|
761
|
+
value=${state === "uploading" && Number(file.progress) > 0 ? String(percent) : lit__WEBPACK_IMPORTED_MODULE_0__.nothing}
|
|
762
|
+
error-text=${state === "error" && typeof file.error === "string" ? file.error : lit__WEBPACK_IMPORTED_MODULE_0__.nothing}
|
|
763
|
+
remove-action=${removable ? lit__WEBPACK_IMPORTED_MODULE_0__.nothing : "false"}
|
|
764
|
+
@sf-file-preview-detach=${stop(onRemove)}
|
|
765
|
+
@sf-file-preview-retry=${stop(onRetry)}
|
|
766
|
+
@sf-file-preview-download=${onDownload ? event => {
|
|
767
|
+
event.stopPropagation();
|
|
768
|
+
onDownload(file, event);
|
|
769
|
+
} : lit__WEBPACK_IMPORTED_MODULE_0__.nothing}
|
|
770
|
+
></sf-file-preview>`;
|
|
766
771
|
}
|
|
767
772
|
__webpack_async_result__();
|
|
768
773
|
} catch(e) { __webpack_async_result__(e); } });
|
|
@@ -823,28 +828,28 @@ module.exports = (globalThis.SF && globalThis.SF.runtimeModule ? globalThis.SF.r
|
|
|
823
828
|
/***/ "c570a02c474e"
|
|
824
829
|
(module) {
|
|
825
830
|
|
|
826
|
-
module.exports = /*#__PURE__*/JSON.parse('{"$comment":"Dated aliases of sf-chat-composer for the shim (core/js/aliases.js, standard §16 item 20). The 0.3 events of simai/ui-chat follow the vocabulary\'s names; two need the element\'s detail adapters (sfAliasAdapters).","component":"sf-chat-composer","since":"2026-10-28","remove_after":"2026-12-01","aliases":[{"from":"sf-chat-send","to":"sf-chat-composer-submit","kind":"event","component":"sf-chat-composer","since":"2026-10-28","remove_after":"2026-12-01","mode":"split","cancelable":true,"section":"§8, vocabulary 1.1.5 §5, §5.1, §7","note":"the 0.3 detail {text, attachmentIds}: the element\'s adapter (sfAliasAdapters) makes it from {text, attachmentIds}"},{"from":"sf-chat-stop","to":"sf-chat-composer-stop","kind":"event","component":"sf-chat-composer","since":"2026-10-28","remove_after":"2026-12-01","mode":"same-detail","cancelable":true,"section":"§8, vocabulary 1.1.5 §5, §5.1, §7","note":"an event takes its tag and a verb; the chat\'s own stop (vocabulary 1.1.3 §5.1); {} is unchanged"},{"from":"sf-chat-files","to":"sf-chat-composer-attach","kind":"event","component":"sf-chat-composer","since":"2026-10-28","remove_after":"2026-12-01","mode":"same-detail","cancelable":true,"section":"§8, vocabulary 1.1.5 §5, §5.1, §7","note":"vocabulary §5 attach; {files, rejected} is unchanged"},{"from":"sf-chat-action","to":"sf-chat-composer-detach","kind":"event","component":"sf-chat-composer","since":"2026-10-28","remove_after":"2026-12-01","mode":"split","cancelable":true,"section":"§8, vocabulary 1.1.5 §5, §5.1, §7","note":"the 0.3 general action event {action: remove-attachment, id, name}: the element\'s adapter puts action back on {id, name}"}]}');
|
|
831
|
+
module.exports = /*#__PURE__*/JSON.parse('{"$comment":"Dated aliases of sf-chat-composer for the shim (core/js/aliases.js, standard §16 item 20). The 0.3 events of simai/ui-chat follow the vocabulary\'s names; two need the element\'s detail adapters (sfAliasAdapters).","component":"sf-chat-composer","since":"2026-10-28","remove_after":"2026-12-01","aliases":[{"from":"sf-chat-send","to":"sf-chat-composer-submit","kind":"event","component":"sf-chat-composer","since":"2026-10-28","remove_after":"2026-12-01","mode":"split","cancelable":true,"section":"§8, vocabulary 1.1.5 §5, §5.1, §7","note":"the 0.3 detail {text, attachmentIds}: the element\'s adapter (sfAliasAdapters) makes it from {text, attachmentIds}"},{"from":"sf-chat-stop","to":"sf-chat-composer-stop","kind":"event","component":"sf-chat-composer","since":"2026-10-28","remove_after":"2026-12-01","mode":"same-detail","cancelable":true,"section":"§8, vocabulary 1.1.5 §5, §5.1, §7","note":"an event takes its tag and a verb; the chat\'s own stop (vocabulary 1.1.3 §5.1); {} is unchanged"},{"from":"sf-chat-files","to":"sf-chat-composer-attach","kind":"event","component":"sf-chat-composer","since":"2026-10-28","remove_after":"2026-12-01","mode":"same-detail","cancelable":true,"section":"§8, vocabulary 1.1.5 §5, §5.1, §7","note":"vocabulary §5 attach; {files, rejected} is unchanged"},{"from":"sf-chat-action","to":"sf-chat-composer-detach","kind":"event","component":"sf-chat-composer","since":"2026-10-28","remove_after":"2026-12-01","mode":"split","cancelable":true,"section":"§8, vocabulary 1.1.5 §5, §5.1, §7","note":"the 0.3 general action event {action: remove-attachment, id, name}: the element\'s adapter puts action back on {id, name}"},{"from":"sf-chat-attachment","to":null,"kind":"attribute","component":"sf-chat-composer","since":"2026-11-26","remove_after":"2027-01-01","mode":"host-attribute","section":"K-08, SIMAI Framework pair ui-73df5d1b4d4c","note":"the chip\'s former class (the chip is now sf-file-preview): sf-chat-attachment and sf-chat-attachment--<ready|uploading|error> stay on the sf-file-preview host until the date, for a page that finds or styles a chip by it (Mirai24 docs/ui-chat/HANDOFF.md names it); no shim. Its inner parts (__icon, __body, __name, __meta, __link, __progress, __remove) are gone: the parts are sf-file-preview\'s"}]}');
|
|
827
832
|
|
|
828
833
|
/***/ },
|
|
829
834
|
|
|
830
835
|
/***/ "78eece9c0d65"
|
|
831
836
|
(module) {
|
|
832
837
|
|
|
833
|
-
module.exports = /*#__PURE__*/JSON.parse('{"id":"smart.chat-composer","tag":"sf-chat-composer","version":"1.
|
|
838
|
+
module.exports = /*#__PURE__*/JSON.parse('{"id":"smart.chat-composer","tag":"sf-chat-composer","version":"1.3.0","kind":"leaf","settings":{"placeholder":{"type":"string","default-from":"runtime.placeholder-text"},"maxlength":{"type":"number","default":4000,"integer":true,"min":1},"max-files":{"type":"number","default":5,"integer":true,"min":1},"max-bytes":{"type":"number","default":0,"integer":true,"min":0},"accept":{"type":"string","default":""},"attachments":{"type":"boolean","default":false},"busy":{"type":"boolean","default":false},"queue":{"type":"boolean","default":false},"disabled":{"type":"boolean","default":false},"files":{"type":"list","default":[],"of":{"id":"id","localId":{"type":"id","optional":true},"name":"string","bytes":"number","progress":{"type":"number","nullable":true,"optional":true},"error":{"type":"string","nullable":true,"optional":true}},"entries":{"key":"id","changes":"content"}},"no-stop":{"type":"boolean","default":false}},"values":{"value":{"type":"string","default":""}},"events":{"submit":{"carries":{"text":"string","attachment-ids":"list"},"cancelable":true},"stop":{"carries":{},"cancelable":true},"attach":{"carries":{"files":"list","rejected":{"type":"list","schema":{"items":{"type":"object","required":["file","reason"],"properties":{"file":{"type":"object"},"reason":{"type":"string"}}}}}},"cancelable":true},"detach":{"carries":{"id":"id","name":{"type":"string","optional":true}},"cancelable":true},"retry":{"carries":{"id":"id","name":{"type":"string","optional":true}},"cancelable":false}},"actions":{"set-files":{"with":{"files":{"type":"list","schema":{"items":{"type":"object","required":["name"],"properties":{"id":{"type":"string"},"localId":{"type":"string"},"name":{"type":"string"},"bytes":{"type":"number"},"progress":{"type":["number","null"]},"error":{"type":["string","null"]}}}}}}},"clear":{}},"host-states":{},"css-variables":{"--sf-chat-composer-background-color":{"type":"color","state":"default"},"--sf-chat-composer-border-color":{"type":"color","state":"default"},"--sf-chat-composer-hint-color":{"type":"color","state":"default"},"--sf-chat-composer-height":{"type":"length","state":"default"}}}');
|
|
834
839
|
|
|
835
840
|
/***/ },
|
|
836
841
|
|
|
837
842
|
/***/ "018100550391"
|
|
838
843
|
(module) {
|
|
839
844
|
|
|
840
|
-
module.exports = /*#__PURE__*/JSON.parse('{"title":"Chat composer","runtime":{"attach-label":"Attach a file","bad-type-text":"this file type is not supported","busy-files-text":"A message with files can be sent once the answer comes","busy-text":"Wait for the answer or stop waiting","count-text":"{count} of {max}","drop-text":"Drop to attach","field-label":"Message","
|
|
845
|
+
module.exports = /*#__PURE__*/JSON.parse('{"title":"Chat composer","runtime":{"attach-label":"Attach a file","bad-type-text":"this file type is not supported","busy-files-text":"A message with files can be sent once the answer comes","busy-text":"Wait for the answer or stop waiting","count-text":"{count} of {max}","drop-text":"Drop to attach","field-label":"Message","hint-text":"Enter to send, Shift+Enter for a new line","placeholder-text":"Ask anything","queue-hint-text":"Enter to send after the answer, Shift+Enter for a new line","queue-label":"Send after the answer","send-label":"Send","size-b-text":"{n} B","size-gb-text":"{n} GB","size-kb-text":"{n} KB","size-mb-text":"{n} MB","stop-label":"Stop waiting","too-big-text":"the file is larger than {size}","too-long-text":"The message is longer than {max} characters","too-many-text":{"one":"you can attach only {max} file","other":"you can attach up to {max} files"}}}');
|
|
841
846
|
|
|
842
847
|
/***/ },
|
|
843
848
|
|
|
844
849
|
/***/ "3de0b0ac7d3d"
|
|
845
850
|
(module) {
|
|
846
851
|
|
|
847
|
-
module.exports = /*#__PURE__*/JSON.parse('{"title":"Поле вопроса чата","runtime":{"attach-label":"Прикрепить файл","bad-type-text":"этот тип файла не поддерживается","busy-files-text":"Сообщение с файлами можно отправить, когда придёт ответ","busy-text":"Дождитесь ответа или остановите ожидание","count-text":"{count} из {max}","drop-text":"Отпустите, чтобы прикрепить","field-label":"Сообщение","
|
|
852
|
+
module.exports = /*#__PURE__*/JSON.parse('{"title":"Поле вопроса чата","runtime":{"attach-label":"Прикрепить файл","bad-type-text":"этот тип файла не поддерживается","busy-files-text":"Сообщение с файлами можно отправить, когда придёт ответ","busy-text":"Дождитесь ответа или остановите ожидание","count-text":"{count} из {max}","drop-text":"Отпустите, чтобы прикрепить","field-label":"Сообщение","hint-text":"Enter — отправить, Shift+Enter — новая строка","placeholder-text":"Спросите что-нибудь","queue-hint-text":"Enter — отправить после ответа, Shift+Enter — новая строка","queue-label":"Отправить после ответа","send-label":"Отправить","size-b-text":"{n} Б","size-gb-text":"{n} ГБ","size-kb-text":"{n} КБ","size-mb-text":"{n} МБ","stop-label":"Остановить ожидание","too-big-text":"файл больше {size}","too-long-text":"Сообщение длиннее {max} знаков","too-many-text":{"one":"можно прикрепить не больше {max} файла","other":"можно прикрепить не больше {max} файлов"}}}');
|
|
848
853
|
|
|
849
854
|
/***/ }
|
|
850
855
|
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(()=>{"use strict";var e={e849f0d25e58(e,t,s){s.a(e,async(e,t)=>{try{var a=s("deb1a4d61565"),i=s("5b7d7695b41b"),n=s("e92fd2d1a38c"),r=s("43090d1c8307"),o=s("c790b3e0c605"),l=s("78eece9c0d65"),c=s("c570a02c474e"),h=s("018100550391"),d=s("3de0b0ac7d3d"),u=e([a,i,n,r,o]);[a,i,n,r,o]=u.then?(await u)():u;var p=s.n(a);const f=4e3,m=5,b=()=>({outcome:"applied"}),g=(0,i.elementFromManifest)(l,{base:p(),lang:{en:h,ru:d},source:"ru",aliases:c,actions:{"set-files"({files:e}){return this.files=e,b()},clear(){return this.value="",this.notice="",b()}}});class
|
|
1
|
+
(()=>{"use strict";var e={e849f0d25e58(e,t,s){s.a(e,async(e,t)=>{try{var a=s("deb1a4d61565"),i=s("5b7d7695b41b"),n=s("e92fd2d1a38c"),r=s("43090d1c8307"),o=s("c790b3e0c605"),l=s("78eece9c0d65"),c=s("c570a02c474e"),h=s("018100550391"),d=s("3de0b0ac7d3d"),u=e([a,i,n,r,o]);[a,i,n,r,o]=u.then?(await u)():u;var p=s.n(a);const f=4e3,m=5,b=()=>({outcome:"applied"}),g=(0,i.elementFromManifest)(l,{base:p(),lang:{en:h,ru:d},source:"ru",aliases:c,actions:{"set-files"({files:e}){return this.files=e,b()},clear(){return this.value="",this.notice="",b()}}});class y extends g{static get props(){return{...super.props,templateName:{attribute:"template",default:"default"}}}constructor(){super(),this._notice="",this._busyHint=!1,this._level="",this._said="",this._tallText=!1,this._dragging=!1,this._depth=0,this._draft=void 0,this._observer=null,this._observed=null;for(const e of["files","value","busy","queue","disabled"]){if(!Object.prototype.hasOwnProperty.call(this,e))continue;const t=this[e];delete this[e],this[e]=t}}get field(){return this._hasRendered?this.querySelector("textarea.sf-chat-composer__input"):null}get value(){const e=this.field;return e?e.value:this._draft??this.getAttribute("value")??""}set value(e){const t=null==e?"":String(e),s=this.field;s?(s.value=t,s.dispatchEvent(new Event("input"))):this._draft=t}get chips(){const e=this.files;return Array.isArray(e)?e.filter(e=>e&&"object"==typeof e).map(e=>({...e,name:String(e.name??"")})):[]}get limit(){return this.maxlength>0?this.maxlength:f}get fileLimit(){return this.maxFiles>0?this.maxFiles:m}get notice(){return this._notice}set notice(e){const t=e?String(e):"";t!==this._notice&&(this._notice=t,this.requestComponentUpdate("notice"))}focusDelegate(){return this.field}sfAliasAdapters(){return{"sf-chat-send":e=>e?{text:e.text,attachmentIds:e.attachmentIds}:void 0,"sf-chat-action":e=>e?{action:"remove-attachment",id:e.id,name:e.name}:void 0}}get basePath(){return(0,n.instancePath)(this,{kind:"sf-chat-composer"})}formatBytes(e){const t=Number(e)||0,s=(0,r.pageLocale)(this),a=e=>new Intl.NumberFormat(s,{maximumFractionDigits:e<10?1:0}).format(e);return t<1024?this.sfWord("size-b-text",{vars:{n:t}}):t<1048576?this.sfWord("size-kb-text",{vars:{n:a(t/1024)}}):t<1024**3?this.sfWord("size-mb-text",{vars:{n:a(t/1024/1024)}}):this.sfWord("size-gb-text",{vars:{n:a(t/1024**3)}})}get queueing(){return this.busy&&this.queue&&0===this.chips.length}templateContext(){const e=this.chips,t=this.busy,s=this.queueing,a=this.disabled,i=this.value.length,r=this.limit,o=i>.8*r,l=i>r,c=o?l?this.sfWord("too-long-text",{vars:{max:r}}):this.sfWord("count-text",{vars:{count:i,max:r}}):"",h=l?"over":o?"near":"";h!==this._level&&(this._level=h,this._said=h?c:""),t||(this._busyHint=!1);const d=this._busyHint?this.queue?"busy-files-text":"busy-text":s?"queue-hint-text":"hint-text",u=this.basePath;return{component:this,files:e,busy:t,disabled:a,noStop:this.noStop,attachments:this.attachments,accept:this.accept,attachDisabled:a||e.length>=this.fileLimit,ready:this.canSend(),near:o,over:l,countText:c,said:this._said,notice:this._notice,busyHint:this._busyHint,hint:this.sfWord(d),queueing:s,tall:e.length>0||this._tallText,dragging:this._dragging,placeholder:this.placeholder||this.sfWord("placeholder-text"),fieldLabel:this.sfWord("field-label"),attachLabel:this.sfWord("attach-label"),sendLabel:this.sfWord(s?"queue-label":"send-label"),stopLabel:this.sfWord("stop-label"),dropText:this.sfWord("drop-text"),inputId:(0,n.partId)(u,"input"),statusId:(0,n.partId)(u,"status"),hintId:(0,n.partId)(u,"hint")}}template(){return(0,o.d)(this.templateContext())}afterRender(e){super.afterRender?.(e);const t=this.field;if(t){if(void 0!==this._draft||!this._started){this._started=!0;const e=this._draft??this.getAttribute("value")??"";this._draft=void 0,e&&t.value!==e&&(this.value=e)}this._observed!==t&&(this._observer?.disconnect(),this._observer="undefined"==typeof ResizeObserver?null:new ResizeObserver(()=>this.shape()),this._observer?.observe(t.closest(".sf-chat-composer__field")??t),this._observed=t),this.shape()}}disconnectedCallback(){this._observer?.disconnect(),this._observer=null,this._observed=null,super.disconnectedCallback()}shape(){const e=this.field;if(!e)return;const t=getComputedStyle(e),s=parseFloat(t.lineHeight)||24,a=e.scrollHeight-parseFloat(t.paddingBlockStart||0)-parseFloat(t.paddingBlockEnd||0)>1.5*s;a!==this._tallText&&(this._tallText=a,this.requestComponentUpdate("shape"))}onInput(){this.requestComponentUpdate("input")}onKey(e){if("Enter"===e.key&&!e.shiftKey&&!e.isComposing&&229!==e.keyCode){if(e.preventDefault(),this.busy&&!this.queueing&&this.value.trim())return this._busyHint=!0,void this.requestComponentUpdate("busy-hint");this.send()}}onPaste(e){const t=[...e.clipboardData?.files||[]];t.length&&this.attachments&&(e.preventDefault(),this.offerFiles(t))}pick(){this.querySelector(".sf-chat-composer__picker")?.click()}onPicked(e){this.offerFiles([...e.files||[]]),e.value=""}canAttach(){return this.attachments&&!this.disabled}onDragEnter(e){this.canAttach()&&e.dataTransfer?.types?.includes("Files")&&(e.preventDefault(),this._depth+=1,this.setDragging(!0))}onDragOver(e){this.canAttach()&&e.preventDefault()}onDragLeave(){this._depth=Math.max(0,this._depth-1),this._depth||this.setDragging(!1)}onDrop(e){this._depth=0,this.setDragging(!1),this.canAttach()&&(e.preventDefault(),this.offerFiles([...e.dataTransfer?.files||[]]))}setDragging(e){this._dragging!==e&&(this._dragging=e,this.requestComponentUpdate("dragging"))}offerFiles(e){if(!e.length)return;const t=String(this.accept||"").split(",").map(e=>e.trim().toLowerCase()).filter(Boolean),s=Math.max(0,this.fileLimit-this.chips.length),a=this.maxBytes>0?this.maxBytes:0,i=[],n=[];for(const r of e){const e=`.${(String(r.name).split(".").pop()||"").toLowerCase()}`;t.length&&!t.includes(e)?n.push({file:r,reason:this.sfWord("bad-type-text")}):a&&r.size>a?n.push({file:r,reason:this.sfWord("too-big-text",{vars:{size:this.formatBytes(a)}})}):i.length>=s?n.push({file:r,reason:this.sfWord("too-many-text",{count:this.fileLimit,vars:{max:this.fileLimit}})}):i.push(r)}this.notice=n.map(e=>`${e.file.name}: ${e.reason}`).join("; "),this.sfEmit("attach",{files:i,rejected:n},{cancelable:!0})}removeFile(e){this.sfEmit("detach",{id:e.id,name:e.name},{cancelable:!0})}retryFile(e){this.sfEmit("retry",{id:e.id??e.localId,name:e.name})}canSend(){const e=this.value.trim(),t=this.chips,s=t.some(e=>void 0!==e.progress&&null!==e.progress&&e.progress<1&&!e.error),a=t.some(e=>e.id&&!e.error);return(!this.busy||this.queueing)&&!this.disabled&&!s&&(e.length>0||a)&&this.value.length<=this.limit}send(){if(!this.canSend())return;const e=this.value.trim(),t=this.chips.filter(e=>e.id&&!e.error).map(e=>e.id);this.sfEmit("submit",{text:e,attachmentIds:t,"attachment-ids":t},{cancelable:!0})&&(this.notice="")}stop(){this.sfEmit("stop",{},{cancelable:!0}),this.field?.focus()}}y.define("sf-chat-composer"),t()}catch(e){t(e)}})},c790b3e0c605(e,t,s){s.a(e,async(e,a)=>{try{s.d(t,{d:()=>l});var i=s("2a080a730149"),n=s("efa66f8927d1"),r=s("09772fbfb8c4"),o=e([i,n,r]);[i,n,r]=o.then?(await o)():o;function l(e){const{component:t}=e,s=["sf-chat-composer",e.over?"sf-chat-composer--over":"",e.disabled?"sf-chat-composer--disabled":"",e.dragging?"sf-chat-composer--dragging":""].filter(Boolean).join(" ");return i.html`
|
|
2
2
|
<form
|
|
3
3
|
class=${s}
|
|
4
4
|
novalidate
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
@drop=${e=>t.onDrop(e)}
|
|
10
10
|
>
|
|
11
11
|
<div class="sf-chat-composer__box${e.tall?" sf-chat-composer__box--tall":""}">
|
|
12
|
-
<div class="sf-chat-composer__files" ?hidden=${!e.files.length}>${(0,n.repeat)(e.files,(e,t)=>e.localId??e.id??`#${t}`,
|
|
12
|
+
<div class="sf-chat-composer__files" ?hidden=${!e.files.length}>${(0,n.repeat)(e.files,(e,t)=>e.localId??e.id??`#${t}`,e=>(0,r.ye)(e,{removable:!0,onRemove:e=>t.removeFile(e),onRetry:e=>t.retryFile(e)}))}</div>
|
|
13
13
|
<div class="sf-chat-composer__row">
|
|
14
14
|
${(0,r.gb)({icon:"attach_file",label:e.attachLabel,size:"1",className:"sf-chat-composer__attach",hidden:!e.attachments,disabled:e.attachDisabled,onClick:()=>t.pick()})}
|
|
15
15
|
<label class="sf-textarea sf-textarea--size-1 sf-textarea--flush sf-chat-composer__field"><textarea
|
|
@@ -56,20 +56,18 @@
|
|
|
56
56
|
?disabled=${c}
|
|
57
57
|
?hidden=${h}
|
|
58
58
|
@click=${d??i.nothing}
|
|
59
|
-
><sf-icon icon=${e} size=${o[n]||"1"} aria-hidden="true"></sf-icon></button>`}function c(e){if(e.error)return"error";const t=e.progress;return null!=t&&t<1?"uploading":"ready"}function h(e,{
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
${s?l({icon:"close",label:t.remove(r),size:"1/2",className:"sf-chat-attachment__remove",onClick:()=>a?.(e)}):i.nothing}
|
|
75
|
-
</div>`}a()}catch(d){a(d)}})},"5b7d7695b41b"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("element-manifest",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("element-manifest",1).then(e,t),{once:!0}))},e92fd2d1a38c(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("instance-path",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("instance-path",1).then(e,t),{once:!0}))},efa66f8927d1(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit/directives/repeat.js",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("lit/directives/repeat.js",1).then(e,t),{once:!0}))},"2a080a730149"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("lit",1).then(e,t),{once:!0}))},"43090d1c8307"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("page-language",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("page-language",1).then(e,t),{once:!0}))},deb1a4d61565(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("smart-base",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("smart-base",1).then(e,t),{once:!0}))},c570a02c474e(e){e.exports=JSON.parse('{"$comment":"Dated aliases of sf-chat-composer for the shim (core/js/aliases.js, standard §16 item 20). The 0.3 events of simai/ui-chat follow the vocabulary\'s names; two need the element\'s detail adapters (sfAliasAdapters).","component":"sf-chat-composer","since":"2026-10-28","remove_after":"2026-12-01","aliases":[{"from":"sf-chat-send","to":"sf-chat-composer-submit","kind":"event","component":"sf-chat-composer","since":"2026-10-28","remove_after":"2026-12-01","mode":"split","cancelable":true,"section":"§8, vocabulary 1.1.5 §5, §5.1, §7","note":"the 0.3 detail {text, attachmentIds}: the element\'s adapter (sfAliasAdapters) makes it from {text, attachmentIds}"},{"from":"sf-chat-stop","to":"sf-chat-composer-stop","kind":"event","component":"sf-chat-composer","since":"2026-10-28","remove_after":"2026-12-01","mode":"same-detail","cancelable":true,"section":"§8, vocabulary 1.1.5 §5, §5.1, §7","note":"an event takes its tag and a verb; the chat\'s own stop (vocabulary 1.1.3 §5.1); {} is unchanged"},{"from":"sf-chat-files","to":"sf-chat-composer-attach","kind":"event","component":"sf-chat-composer","since":"2026-10-28","remove_after":"2026-12-01","mode":"same-detail","cancelable":true,"section":"§8, vocabulary 1.1.5 §5, §5.1, §7","note":"vocabulary §5 attach; {files, rejected} is unchanged"},{"from":"sf-chat-action","to":"sf-chat-composer-detach","kind":"event","component":"sf-chat-composer","since":"2026-10-28","remove_after":"2026-12-01","mode":"split","cancelable":true,"section":"§8, vocabulary 1.1.5 §5, §5.1, §7","note":"the 0.3 general action event {action: remove-attachment, id, name}: the element\'s adapter puts action back on {id, name}"}]}')},"78eece9c0d65"(e){e.exports=JSON.parse('{"id":"smart.chat-composer","tag":"sf-chat-composer","version":"1.2.3","kind":"leaf","settings":{"placeholder":{"type":"string","default-from":"runtime.placeholder-text"},"maxlength":{"type":"number","default":4000,"integer":true,"min":1},"max-files":{"type":"number","default":5,"integer":true,"min":1},"max-bytes":{"type":"number","default":0,"integer":true,"min":0},"accept":{"type":"string","default":""},"attachments":{"type":"boolean","default":false},"busy":{"type":"boolean","default":false},"queue":{"type":"boolean","default":false},"disabled":{"type":"boolean","default":false},"files":{"type":"list","default":[],"of":{"id":"id","localId":{"type":"id","optional":true},"name":"string","bytes":"number","progress":{"type":"number","nullable":true,"optional":true},"error":{"type":"string","nullable":true,"optional":true}},"entries":{"key":"id","changes":"content"}},"no-stop":{"type":"boolean","default":false}},"values":{"value":{"type":"string","default":""}},"events":{"submit":{"carries":{"text":"string","attachment-ids":"list"},"cancelable":true},"stop":{"carries":{},"cancelable":true},"attach":{"carries":{"files":"list","rejected":{"type":"list","schema":{"items":{"type":"object","required":["file","reason"],"properties":{"file":{"type":"object"},"reason":{"type":"string"}}}}}},"cancelable":true},"detach":{"carries":{"id":"id","name":{"type":"string","optional":true}},"cancelable":true}},"actions":{"set-files":{"with":{"files":{"type":"list","schema":{"items":{"type":"object","required":["name"],"properties":{"id":{"type":"string"},"localId":{"type":"string"},"name":{"type":"string"},"bytes":{"type":"number"},"progress":{"type":["number","null"]},"error":{"type":["string","null"]}}}}}}},"clear":{}},"host-states":{},"css-variables":{"--sf-chat-composer-background-color":{"type":"color","state":"default"},"--sf-chat-composer-border-color":{"type":"color","state":"default"},"--sf-chat-composer-hint-color":{"type":"color","state":"default"},"--sf-chat-composer-height":{"type":"length","state":"default"}}}')},"018100550391"(e){e.exports=JSON.parse('{"title":"Chat composer","runtime":{"attach-label":"Attach a file","bad-type-text":"this file type is not supported","busy-files-text":"A message with files can be sent once the answer comes","busy-text":"Wait for the answer or stop waiting","count-text":"{count} of {max}","drop-text":"Drop to attach","field-label":"Message","file-label":"File {name}, {size}","hint-text":"Enter to send, Shift+Enter for a new line","placeholder-text":"Ask anything","queue-hint-text":"Enter to send after the answer, Shift+Enter for a new line","queue-label":"Send after the answer","remove-label":"Remove the file {name}","send-label":"Send","size-b-text":"{n} B","size-gb-text":"{n} GB","size-kb-text":"{n} KB","size-mb-text":"{n} MB","stop-label":"Stop waiting","too-big-text":"the file is larger than {size}","too-long-text":"The message is longer than {max} characters","too-many-text":{"one":"you can attach only {max} file","other":"you can attach up to {max} files"},"uploading-text":"Uploading, {percent}%"}}')},"3de0b0ac7d3d"(e){e.exports=JSON.parse('{"title":"Поле вопроса чата","runtime":{"attach-label":"Прикрепить файл","bad-type-text":"этот тип файла не поддерживается","busy-files-text":"Сообщение с файлами можно отправить, когда придёт ответ","busy-text":"Дождитесь ответа или остановите ожидание","count-text":"{count} из {max}","drop-text":"Отпустите, чтобы прикрепить","field-label":"Сообщение","file-label":"Файл {name}, {size}","hint-text":"Enter — отправить, Shift+Enter — новая строка","placeholder-text":"Спросите что-нибудь","queue-hint-text":"Enter — отправить после ответа, Shift+Enter — новая строка","queue-label":"Отправить после ответа","remove-label":"Убрать файл {name}","send-label":"Отправить","size-b-text":"{n} Б","size-gb-text":"{n} ГБ","size-kb-text":"{n} КБ","size-mb-text":"{n} МБ","stop-label":"Остановить ожидание","too-big-text":"файл больше {size}","too-long-text":"Сообщение длиннее {max} знаков","too-many-text":{"one":"можно прикрепить не больше {max} файла","other":"можно прикрепить не больше {max} файлов"},"uploading-text":"Загружается, {percent}%"}}')}};const t={};function s(a){const i=t[a];if(void 0!==i)return i.exports;const n=t[a]={exports:{}};return e[a](n,n.exports,s),n.exports}(()=>{const e="function"==typeof Symbol,t=e?Symbol("webpack queues"):"__webpack_queues__",a=e?Symbol("webpack exports"):"__webpack_exports__",i=e?Symbol("webpack error"):"__webpack_error__",n=e=>{e?.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))};s.a=(e,s,r)=>{let o;r&&((o=[]).d=-1);const l=new Set,c=e.exports;let h,d,u;const p=new Promise((e,t)=>{u=t,d=e});p[a]=c,p[t]=e=>(o&&e(o),l.forEach(e),p.catch(e=>{})),e.exports=p;s(e=>{let s;h=(e=>e.map(e=>{if(null!==e&&"object"==typeof e){if(e[t])return e;if(e.then){const s=[];s.d=0,e.then(e=>{r[a]=e,n(s)},e=>{r[i]=e,n(s)});const r={};return r[t]=e=>e(s),r}}const s={};return s[t]=e=>{},s[a]=e,s}))(e);const r=()=>h.map(e=>{if(e[i])throw e[i];return e[a]}),c=new Promise(e=>{s=()=>e(r),s.r=0;const a=e=>e!==o&&!l.has(e)&&(l.add(e),e&&!e.d&&(s.r++,e.push(s)));h.map(e=>e[t](a))});return s.r?c:r()},e=>(e?u(p[i]=e):d(c),n(o))),o?.d<0&&(o.d=0)}})(),s.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{if(Array.isArray(t))for(var a=0;a<t.length;){var i=t[a++],n=t[a++];s.o(e,i)?0===n&&a++:0===n?Object.defineProperty(e,i,{enumerable:!0,value:t[a++]}):Object.defineProperty(e,i,{enumerable:!0,get:n})}else for(var i in t)s.o(t,i)&&!s.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);s("e849f0d25e58")})();
|
|
59
|
+
><sf-icon icon=${e} size=${o[n]||"1"} aria-hidden="true"></sf-icon></button>`}function c(e){if(e.error)return"error";const t=e.progress;return null!=t&&t<1?"uploading":"ready"}function h(e,{removable:t=!1,href:s="",onRemove:a=null,onRetry:n=null,onDownload:r=null,className:o=""}={}){const l=c(e),h=String(e.name??""),d=null===e.bytes||void 0===e.bytes||""===e.bytes?NaN:Number(e.bytes),u=Math.round(100*Math.min(1,Math.max(0,Number(e.progress)||0))),p=t=>s=>{s.stopPropagation(),s.preventDefault(),t?.(e,s)};return i.html`<sf-file-preview
|
|
60
|
+
class="sf-chat-attachment sf-chat-attachment--${l} ${o}"
|
|
61
|
+
appearance="chip"
|
|
62
|
+
file-name=${h}
|
|
63
|
+
file-size=${Number.isFinite(d)&&d>=0?String(d):i.nothing}
|
|
64
|
+
mime-type=${e.mime||i.nothing}
|
|
65
|
+
href=${s||i.nothing}
|
|
66
|
+
state=${l}
|
|
67
|
+
value=${"uploading"===l&&Number(e.progress)>0?String(u):i.nothing}
|
|
68
|
+
error-text=${"error"===l&&"string"==typeof e.error?e.error:i.nothing}
|
|
69
|
+
remove-action=${t?i.nothing:"false"}
|
|
70
|
+
@sf-file-preview-detach=${p(a)}
|
|
71
|
+
@sf-file-preview-retry=${p(n)}
|
|
72
|
+
@sf-file-preview-download=${r?t=>{t.stopPropagation(),r(e,t)}:i.nothing}
|
|
73
|
+
></sf-file-preview>`}a()}catch(d){a(d)}})},"5b7d7695b41b"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("element-manifest",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("element-manifest",1).then(e,t),{once:!0}))},e92fd2d1a38c(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("instance-path",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("instance-path",1).then(e,t),{once:!0}))},efa66f8927d1(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit/directives/repeat.js",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("lit/directives/repeat.js",1).then(e,t),{once:!0}))},"2a080a730149"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("lit",1).then(e,t),{once:!0}))},"43090d1c8307"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("page-language",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("page-language",1).then(e,t),{once:!0}))},deb1a4d61565(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("smart-base",1):new Promise((e,t)=>globalThis.addEventListener("sf-runtime-ready",()=>globalThis.SF.runtimeModule("smart-base",1).then(e,t),{once:!0}))},c570a02c474e(e){e.exports=JSON.parse('{"$comment":"Dated aliases of sf-chat-composer for the shim (core/js/aliases.js, standard §16 item 20). The 0.3 events of simai/ui-chat follow the vocabulary\'s names; two need the element\'s detail adapters (sfAliasAdapters).","component":"sf-chat-composer","since":"2026-10-28","remove_after":"2026-12-01","aliases":[{"from":"sf-chat-send","to":"sf-chat-composer-submit","kind":"event","component":"sf-chat-composer","since":"2026-10-28","remove_after":"2026-12-01","mode":"split","cancelable":true,"section":"§8, vocabulary 1.1.5 §5, §5.1, §7","note":"the 0.3 detail {text, attachmentIds}: the element\'s adapter (sfAliasAdapters) makes it from {text, attachmentIds}"},{"from":"sf-chat-stop","to":"sf-chat-composer-stop","kind":"event","component":"sf-chat-composer","since":"2026-10-28","remove_after":"2026-12-01","mode":"same-detail","cancelable":true,"section":"§8, vocabulary 1.1.5 §5, §5.1, §7","note":"an event takes its tag and a verb; the chat\'s own stop (vocabulary 1.1.3 §5.1); {} is unchanged"},{"from":"sf-chat-files","to":"sf-chat-composer-attach","kind":"event","component":"sf-chat-composer","since":"2026-10-28","remove_after":"2026-12-01","mode":"same-detail","cancelable":true,"section":"§8, vocabulary 1.1.5 §5, §5.1, §7","note":"vocabulary §5 attach; {files, rejected} is unchanged"},{"from":"sf-chat-action","to":"sf-chat-composer-detach","kind":"event","component":"sf-chat-composer","since":"2026-10-28","remove_after":"2026-12-01","mode":"split","cancelable":true,"section":"§8, vocabulary 1.1.5 §5, §5.1, §7","note":"the 0.3 general action event {action: remove-attachment, id, name}: the element\'s adapter puts action back on {id, name}"},{"from":"sf-chat-attachment","to":null,"kind":"attribute","component":"sf-chat-composer","since":"2026-11-26","remove_after":"2027-01-01","mode":"host-attribute","section":"K-08, SIMAI Framework pair ui-73df5d1b4d4c","note":"the chip\'s former class (the chip is now sf-file-preview): sf-chat-attachment and sf-chat-attachment--<ready|uploading|error> stay on the sf-file-preview host until the date, for a page that finds or styles a chip by it (Mirai24 docs/ui-chat/HANDOFF.md names it); no shim. Its inner parts (__icon, __body, __name, __meta, __link, __progress, __remove) are gone: the parts are sf-file-preview\'s"}]}')},"78eece9c0d65"(e){e.exports=JSON.parse('{"id":"smart.chat-composer","tag":"sf-chat-composer","version":"1.3.0","kind":"leaf","settings":{"placeholder":{"type":"string","default-from":"runtime.placeholder-text"},"maxlength":{"type":"number","default":4000,"integer":true,"min":1},"max-files":{"type":"number","default":5,"integer":true,"min":1},"max-bytes":{"type":"number","default":0,"integer":true,"min":0},"accept":{"type":"string","default":""},"attachments":{"type":"boolean","default":false},"busy":{"type":"boolean","default":false},"queue":{"type":"boolean","default":false},"disabled":{"type":"boolean","default":false},"files":{"type":"list","default":[],"of":{"id":"id","localId":{"type":"id","optional":true},"name":"string","bytes":"number","progress":{"type":"number","nullable":true,"optional":true},"error":{"type":"string","nullable":true,"optional":true}},"entries":{"key":"id","changes":"content"}},"no-stop":{"type":"boolean","default":false}},"values":{"value":{"type":"string","default":""}},"events":{"submit":{"carries":{"text":"string","attachment-ids":"list"},"cancelable":true},"stop":{"carries":{},"cancelable":true},"attach":{"carries":{"files":"list","rejected":{"type":"list","schema":{"items":{"type":"object","required":["file","reason"],"properties":{"file":{"type":"object"},"reason":{"type":"string"}}}}}},"cancelable":true},"detach":{"carries":{"id":"id","name":{"type":"string","optional":true}},"cancelable":true},"retry":{"carries":{"id":"id","name":{"type":"string","optional":true}},"cancelable":false}},"actions":{"set-files":{"with":{"files":{"type":"list","schema":{"items":{"type":"object","required":["name"],"properties":{"id":{"type":"string"},"localId":{"type":"string"},"name":{"type":"string"},"bytes":{"type":"number"},"progress":{"type":["number","null"]},"error":{"type":["string","null"]}}}}}}},"clear":{}},"host-states":{},"css-variables":{"--sf-chat-composer-background-color":{"type":"color","state":"default"},"--sf-chat-composer-border-color":{"type":"color","state":"default"},"--sf-chat-composer-hint-color":{"type":"color","state":"default"},"--sf-chat-composer-height":{"type":"length","state":"default"}}}')},"018100550391"(e){e.exports=JSON.parse('{"title":"Chat composer","runtime":{"attach-label":"Attach a file","bad-type-text":"this file type is not supported","busy-files-text":"A message with files can be sent once the answer comes","busy-text":"Wait for the answer or stop waiting","count-text":"{count} of {max}","drop-text":"Drop to attach","field-label":"Message","hint-text":"Enter to send, Shift+Enter for a new line","placeholder-text":"Ask anything","queue-hint-text":"Enter to send after the answer, Shift+Enter for a new line","queue-label":"Send after the answer","send-label":"Send","size-b-text":"{n} B","size-gb-text":"{n} GB","size-kb-text":"{n} KB","size-mb-text":"{n} MB","stop-label":"Stop waiting","too-big-text":"the file is larger than {size}","too-long-text":"The message is longer than {max} characters","too-many-text":{"one":"you can attach only {max} file","other":"you can attach up to {max} files"}}}')},"3de0b0ac7d3d"(e){e.exports=JSON.parse('{"title":"Поле вопроса чата","runtime":{"attach-label":"Прикрепить файл","bad-type-text":"этот тип файла не поддерживается","busy-files-text":"Сообщение с файлами можно отправить, когда придёт ответ","busy-text":"Дождитесь ответа или остановите ожидание","count-text":"{count} из {max}","drop-text":"Отпустите, чтобы прикрепить","field-label":"Сообщение","hint-text":"Enter — отправить, Shift+Enter — новая строка","placeholder-text":"Спросите что-нибудь","queue-hint-text":"Enter — отправить после ответа, Shift+Enter — новая строка","queue-label":"Отправить после ответа","send-label":"Отправить","size-b-text":"{n} Б","size-gb-text":"{n} ГБ","size-kb-text":"{n} КБ","size-mb-text":"{n} МБ","stop-label":"Остановить ожидание","too-big-text":"файл больше {size}","too-long-text":"Сообщение длиннее {max} знаков","too-many-text":{"one":"можно прикрепить не больше {max} файла","other":"можно прикрепить не больше {max} файлов"}}}')}};const t={};function s(a){const i=t[a];if(void 0!==i)return i.exports;const n=t[a]={exports:{}};return e[a](n,n.exports,s),n.exports}(()=>{const e="function"==typeof Symbol,t=e?Symbol("webpack queues"):"__webpack_queues__",a=e?Symbol("webpack exports"):"__webpack_exports__",i=e?Symbol("webpack error"):"__webpack_error__",n=e=>{e?.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))};s.a=(e,s,r)=>{let o;r&&((o=[]).d=-1);const l=new Set,c=e.exports;let h,d,u;const p=new Promise((e,t)=>{u=t,d=e});p[a]=c,p[t]=e=>(o&&e(o),l.forEach(e),p.catch(e=>{})),e.exports=p;s(e=>{let s;h=(e=>e.map(e=>{if(null!==e&&"object"==typeof e){if(e[t])return e;if(e.then){const s=[];s.d=0,e.then(e=>{r[a]=e,n(s)},e=>{r[i]=e,n(s)});const r={};return r[t]=e=>e(s),r}}const s={};return s[t]=e=>{},s[a]=e,s}))(e);const r=()=>h.map(e=>{if(e[i])throw e[i];return e[a]}),c=new Promise(e=>{s=()=>e(r),s.r=0;const a=e=>e!==o&&!l.has(e)&&(l.add(e),e&&!e.d&&(s.r++,e.push(s)));h.map(e=>e[t](a))});return s.r?c:r()},e=>(e?u(p[i]=e):d(c),n(o))),o?.d<0&&(o.d=0)}})(),s.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{if(Array.isArray(t))for(var a=0;a<t.length;){var i=t[a++],n=t[a++];s.o(e,i)?0===n&&a++:0===n?Object.defineProperty(e,i,{enumerable:!0,value:t[a++]}):Object.defineProperty(e,i,{enumerable:!0,get:n})}else for(var i in t)s.o(t,i)&&!s.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);s("e849f0d25e58")})();
|
|
Binary file
|
|
@@ -8,12 +8,10 @@
|
|
|
8
8
|
"count-text": "{count} of {max}",
|
|
9
9
|
"drop-text": "Drop to attach",
|
|
10
10
|
"field-label": "Message",
|
|
11
|
-
"file-label": "File {name}, {size}",
|
|
12
11
|
"hint-text": "Enter to send, Shift+Enter for a new line",
|
|
13
12
|
"placeholder-text": "Ask anything",
|
|
14
13
|
"queue-hint-text": "Enter to send after the answer, Shift+Enter for a new line",
|
|
15
14
|
"queue-label": "Send after the answer",
|
|
16
|
-
"remove-label": "Remove the file {name}",
|
|
17
15
|
"send-label": "Send",
|
|
18
16
|
"size-b-text": "{n} B",
|
|
19
17
|
"size-gb-text": "{n} GB",
|
|
@@ -25,7 +23,6 @@
|
|
|
25
23
|
"too-many-text": {
|
|
26
24
|
"one": "you can attach only {max} file",
|
|
27
25
|
"other": "you can attach up to {max} files"
|
|
28
|
-
}
|
|
29
|
-
"uploading-text": "Uploading, {percent}%"
|
|
26
|
+
}
|
|
30
27
|
}
|
|
31
28
|
}
|
|
Binary file
|
|
@@ -8,12 +8,10 @@
|
|
|
8
8
|
"count-text": "{count} из {max}",
|
|
9
9
|
"drop-text": "Отпустите, чтобы прикрепить",
|
|
10
10
|
"field-label": "Сообщение",
|
|
11
|
-
"file-label": "Файл {name}, {size}",
|
|
12
11
|
"hint-text": "Enter — отправить, Shift+Enter — новая строка",
|
|
13
12
|
"placeholder-text": "Спросите что-нибудь",
|
|
14
13
|
"queue-hint-text": "Enter — отправить после ответа, Shift+Enter — новая строка",
|
|
15
14
|
"queue-label": "Отправить после ответа",
|
|
16
|
-
"remove-label": "Убрать файл {name}",
|
|
17
15
|
"send-label": "Отправить",
|
|
18
16
|
"size-b-text": "{n} Б",
|
|
19
17
|
"size-gb-text": "{n} ГБ",
|
|
@@ -25,7 +23,6 @@
|
|
|
25
23
|
"too-many-text": {
|
|
26
24
|
"one": "можно прикрепить не больше {max} файла",
|
|
27
25
|
"other": "можно прикрепить не больше {max} файлов"
|
|
28
|
-
}
|
|
29
|
-
"uploading-text": "Загружается, {percent}%"
|
|
26
|
+
}
|
|
30
27
|
}
|
|
31
28
|
}
|
|
Binary file
|
|
@@ -209,8 +209,8 @@
|
|
|
209
209
|
},
|
|
210
210
|
{
|
|
211
211
|
"id": "p6-chips",
|
|
212
|
-
"title": "set-files, the 0.3 setFiles: chips with size, upload
|
|
213
|
-
"covers": "settings.files, actions.set-files, events.detach, aliases sf-chat-action
|
|
212
|
+
"title": "set-files, the 0.3 setFiles: the chips are the Framework's sf-file-preview (chip; K-08) with the size, the upload's own bar and per cent (state uploading, value) and the server's refusal (state error, error-text); while one uploads send is off and the files button is off at max-files; a chip's «×» sends sf-chat-composer-detach {id, name} and the 0.3 sf-chat-action {action: remove-attachment, id, name}; «Повторить» on a refused chip sends sf-chat-composer-retry {id, name}",
|
|
213
|
+
"covers": "settings.files, actions.set-files, events.detach, events.retry, aliases sf-chat-action",
|
|
214
214
|
"steps": [
|
|
215
215
|
{
|
|
216
216
|
"script": "(await customElements.whenDefined('sf-chat-composer'), true)",
|
|
@@ -241,16 +241,16 @@
|
|
|
241
241
|
]
|
|
242
242
|
},
|
|
243
243
|
"target": "#files",
|
|
244
|
-
"wait":
|
|
244
|
+
"wait": 1500,
|
|
245
245
|
"expect": {
|
|
246
246
|
"returns": {
|
|
247
247
|
"outcome": "applied"
|
|
248
248
|
}
|
|
249
249
|
},
|
|
250
|
-
"check": "(() => { const c = document.querySelector('#files'); const chips = c.querySelectorAll('.sf-chat-composer__files .sf-
|
|
250
|
+
"check": "(() => { const c = document.querySelector('#files'); const chips = [...c.querySelectorAll('.sf-chat-composer__files > sf-file-preview')]; const ready = c.querySelector('sf-file-preview[state=ready]'); const up = c.querySelector('sf-file-preview[state=uploading]'); const failed = c.querySelector('sf-file-preview[state=error]'); return chips.length === 3 && chips.every((chip) => chip.getAttribute('appearance') === 'chip' && chip.classList.contains('sf-chat-attachment')) && ready.classList.contains('sf-chat-attachment--ready') && ready.getAttribute('file-name') === 'Договор.pdf' && ready.getAttribute('file-size') === '48213' && /КБ/u.test(ready.querySelector('.sf-file-preview-meta')?.textContent ?? '') && up.getAttribute('value') === '40' && up.querySelector('[aria-busy=true]') !== null && up.querySelector('[role=progressbar]')?.getAttribute('aria-valuenow') === '40' && failed.getAttribute('error-text') === 'не похоже на документ' && /не похоже на документ/u.test(failed.querySelector('.sf-file-preview-error')?.textContent ?? '') && !c.querySelector('.sf-chat-attachment__meta, .sf-chat-attachment__progress') && c.querySelector('.sf-chat-composer__send').disabled && c.querySelector('.sf-chat-composer__attach').disabled && c.querySelector('.sf-chat-composer__box--tall') !== null; })()"
|
|
251
251
|
},
|
|
252
252
|
{
|
|
253
|
-
"user": "click:#files
|
|
253
|
+
"user": "click:#files sf-file-preview[state=ready] [data-action=remove]",
|
|
254
254
|
"expect": {
|
|
255
255
|
"events": [
|
|
256
256
|
{
|
|
@@ -280,6 +280,22 @@
|
|
|
280
280
|
}
|
|
281
281
|
]
|
|
282
282
|
}
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"script": "([...document.querySelectorAll('#files sf-file-preview[state=error] button')].find((button) => /^Повторить/u.test(button.getAttribute('aria-label') || '') && button.getClientRects().length).click(), true)",
|
|
286
|
+
"wait": 300,
|
|
287
|
+
"expect": {
|
|
288
|
+
"events": [
|
|
289
|
+
{
|
|
290
|
+
"name": "sf-chat-composer-retry",
|
|
291
|
+
"count": 1,
|
|
292
|
+
"detail": {
|
|
293
|
+
"id": "f3",
|
|
294
|
+
"name": "Скан.pdf"
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
]
|
|
298
|
+
}
|
|
283
299
|
}
|
|
284
300
|
]
|
|
285
301
|
},
|
|
Binary file
|