@webitel/ui-sdk 25.12.53 → 25.12.55

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 (54) hide show
  1. package/dist/{install-BZWlQbtL.js → install-DHbnzyTA.js} +4868 -4819
  2. package/dist/{plyr-BjhPLHtl.js → plyr-DDl8uj6I.js} +1 -1
  3. package/dist/ui-sdk.css +1 -1
  4. package/dist/ui-sdk.js +1 -1
  5. package/dist/ui-sdk.umd.cjs +24 -10
  6. package/dist/{vidstack-Bq6c3Bam-CaQgJvtD.js → vidstack-Bq6c3Bam-c8LF9HSj.js} +2 -2
  7. package/dist/{vidstack-D2pY00kU-C1K9yBS0.js → vidstack-D2pY00kU-b0T6CwgN.js} +2 -2
  8. package/dist/{vidstack-DDXt6fpN-BrNWY994.js → vidstack-DDXt6fpN-NIc6oG3j.js} +1 -1
  9. package/dist/{vidstack-D_-9AA6_-BjQmEj99.js → vidstack-D_-9AA6_-B_Nw0nF1.js} +1 -1
  10. package/dist/{vidstack-DqAw8m9J-cD1m6YSL.js → vidstack-DqAw8m9J-j4x4rCsZ.js} +1 -1
  11. package/dist/{vidstack-audio-DrJ7GLQb.js → vidstack-audio-Dc0lAw8g.js} +2 -2
  12. package/dist/{vidstack-dash-D4-KCoOl.js → vidstack-dash-CTi0XXFj.js} +3 -3
  13. package/dist/{vidstack-google-cast-DpYHSpib.js → vidstack-google-cast-BTfcCr2M.js} +3 -3
  14. package/dist/{vidstack-hls-C0h3iDtC.js → vidstack-hls-Bp1b8Iwo.js} +3 -3
  15. package/dist/{vidstack-video-CPU-Wksg.js → vidstack-video-DZg31EmF.js} +2 -2
  16. package/dist/{vidstack-vimeo-DbZ3Laio.js → vidstack-vimeo-DXQzsSgO.js} +3 -3
  17. package/dist/{vidstack-youtube-BMCERdW-.js → vidstack-youtube-BReczNxo.js} +2 -2
  18. package/dist/{vuex.esm-bundler-CnR5yCWV.js → vuex.esm-bundler-BTTiQ4iy.js} +1 -1
  19. package/package.json +2 -2
  20. package/src/components/wt-vidstack-player/wt-vidstack-player.vue +2 -2
  21. package/src/enums/MimeTypes/MimeTypes.enum.ts +21 -0
  22. package/src/enums/index.ts +2 -0
  23. package/src/locale/en/en.js +12 -0
  24. package/src/locale/es/es.js +12 -0
  25. package/src/locale/kz/kz.js +12 -0
  26. package/src/locale/pl/pl.js +12 -0
  27. package/src/locale/ro/ro.js +12 -0
  28. package/src/locale/ru/ru.js +12 -0
  29. package/src/locale/uk/uk.js +12 -0
  30. package/src/locale/uz/uz.js +12 -0
  31. package/src/locale/vi/vi.js +12 -0
  32. package/src/modules/AgentPdfs/assets/pdf-done.png +0 -0
  33. package/src/modules/AgentPdfs/assets/pdf-error.png +0 -0
  34. package/src/modules/AgentPdfs/assets/pdf-pending.png +0 -0
  35. package/src/modules/AgentPdfs/assets/pdf-processing.png +0 -0
  36. package/src/modules/AgentPdfs/components/agent-pdfs-tab.vue +257 -0
  37. package/src/modules/AgentPdfs/components/pdf-status-preview.vue +55 -0
  38. package/src/modules/AgentPdfs/components/pdf-status.vue +67 -0
  39. package/types/enums/MimeTypes/MimeTypes.enum.d.ts +16 -0
  40. package/types/enums/index.d.ts +2 -1
  41. package/types/locale/en/en.d.ts +11 -0
  42. package/types/locale/es/es.d.ts +18 -5
  43. package/types/locale/i18n.d.ts +99 -0
  44. package/types/locale/index.d.ts +99 -0
  45. package/types/locale/kz/kz.d.ts +18 -5
  46. package/types/locale/pl/pl.d.ts +18 -5
  47. package/types/locale/ro/ro.d.ts +18 -5
  48. package/types/locale/ru/ru.d.ts +18 -5
  49. package/types/locale/uk/uk.d.ts +18 -5
  50. package/types/locale/uz/uz.d.ts +18 -5
  51. package/types/locale/vi/vi.d.ts +18 -5
  52. package/types/modules/AgentPdfs/components/agent-pdfs-tab.vue.d.ts +29 -0
  53. package/types/modules/AgentPdfs/components/pdf-status-preview.vue.d.ts +12 -0
  54. package/types/modules/AgentPdfs/components/pdf-status.vue.d.ts +7 -0
@@ -0,0 +1,257 @@
1
+ <template>
2
+ <section class="table-wrapper table-page table-wrapper--tab-table">
3
+ <header class="table-title">
4
+ <h3 class="table-title__title">
5
+ {{ t('objects.agentPdfs.pdfs', 2) }}
6
+ </h3>
7
+ <slot
8
+ name="action-bar"
9
+ :selected="selected"
10
+ :load-data-list="loadDataList"
11
+ :ask-delete-confirmation="askDeleteConfirmation"
12
+ :handle-delete="handleDelete"
13
+ />
14
+ </header>
15
+
16
+ <delete-confirmation-popup
17
+ :shown="isDeleteConfirmationPopup"
18
+ :callback="deleteCallback"
19
+ :delete-count="deleteCount"
20
+ @close="closeDelete"
21
+ />
22
+
23
+ <wt-loader v-show="isLoading" />
24
+
25
+ <wt-empty
26
+ v-show="showEmpty"
27
+ :image="imageEmpty"
28
+ :text="textEmpty"
29
+ />
30
+
31
+ <div v-show="!isLoading" class="table-loading-wrapper">
32
+ <wt-table
33
+ v-if="dataList?.length"
34
+ :data="dataList"
35
+ :headers="shownHeaders"
36
+ :selected="selected"
37
+ sortable
38
+ @sort="updateSort"
39
+ @update:selected="updateSelected"
40
+ >
41
+ <template #preview="{ item }">
42
+ <pdf-status-preview
43
+ :status="item.status"
44
+ :clickable="item.status === WebitelMediaExporterExportStatus.Done"
45
+ @click="openPdfInNewWindow(item.fileId)"
46
+ />
47
+ </template>
48
+
49
+ <template #name="{ item }">
50
+ {{ item.name }}
51
+ </template>
52
+
53
+ <template #status="{ item }">
54
+ <pdf-status :status="item.status" />
55
+ </template>
56
+
57
+ <template #valid_until="{ item }">
58
+ {{ prettifyTimestamp(item.validUntil) }}
59
+ </template>
60
+
61
+ <template #created_at="{ item }">
62
+ {{ prettifyTimestamp(item.createdAt) }}
63
+ </template>
64
+
65
+ <template #created_by="{ item }">
66
+ {{ item.createdBy }}
67
+ </template>
68
+
69
+ <template #actions="{ item }">
70
+ <wt-icon-action
71
+ action="download"
72
+ :disabled="item.status !== WebitelMediaExporterExportStatus.Done"
73
+ @click="downloadPdf(item.fileId)"
74
+ />
75
+ <wt-icon-action
76
+ action="delete"
77
+ @click="
78
+ askDeleteConfirmation({
79
+ deleted: [item],
80
+ callback: () => handleDelete([item]),
81
+ })
82
+ "
83
+ />
84
+ </template>
85
+ </wt-table>
86
+
87
+ <wt-pagination
88
+ :next="next"
89
+ :prev="page > 1"
90
+ :size="size"
91
+ debounce
92
+ @change="updateSize"
93
+ @next="updatePage(page + 1)"
94
+ @prev="updatePage(page - 1)"
95
+ />
96
+ </div>
97
+ </section>
98
+ </template>
99
+
100
+ <script lang="ts" setup>
101
+ import { downloadFile, getMediaUrl } from '@webitel/api-services/api';
102
+ import { FileServicesAPI, PdfServicesAPI } from '@webitel/api-services/api';
103
+ import { WebitelMediaExporterExportStatus } from '@webitel/api-services/gen/models';
104
+ import { WebitelMediaExporterExportRecord } from '@webitel/api-services/gen/models';
105
+ import { WtEmpty } from '@webitel/ui-sdk/components';
106
+ import { getEndOfDay,getStartOfDay } from '@webitel/ui-sdk/scripts';
107
+ import DeleteConfirmationPopup
108
+ from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue';
109
+ import {
110
+ useDeleteConfirmationPopup,
111
+ } from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/composables/useDeleteConfirmationPopup';
112
+ import { useTableEmpty } from '@webitel/ui-sdk/src/modules/TableComponentModule/composables/useTableEmpty';
113
+ import { storeToRefs } from 'pinia';
114
+ import { computed } from 'vue';
115
+ import { useI18n } from 'vue-i18n';
116
+
117
+ import PdfStatus from './pdf-status.vue';
118
+ import PdfStatusPreview from './pdf-status-preview.vue';
119
+
120
+ interface Props {
121
+ store?: any;
122
+ entityIdKey?: string;
123
+ entityIdValue?: string | number;
124
+ onDeleteItem?: (item: WebitelMediaExporterExportRecord) => Promise<void>;
125
+ }
126
+
127
+ const props = withDefaults(defineProps<Props>(), {
128
+ store: undefined,
129
+ entityIdKey: undefined,
130
+ entityIdValue: undefined,
131
+ onDeleteItem: undefined,
132
+ });
133
+
134
+ const { t } = useI18n();
135
+
136
+ const tableStore = props.store;
137
+
138
+ const {
139
+ dataList,
140
+ selected,
141
+ error,
142
+ isLoading,
143
+ page,
144
+ size,
145
+ next,
146
+ shownHeaders,
147
+ filtersManager,
148
+ } = storeToRefs(tableStore);
149
+
150
+ const {
151
+ initialize,
152
+ loadDataList,
153
+ updateSelected,
154
+ updatePage,
155
+ updateSize,
156
+ updateSort,
157
+ hasFilter,
158
+ addFilter,
159
+ } = tableStore;
160
+
161
+ initialize();
162
+
163
+ const initializeDefaultFilters = () => {
164
+ if (props.entityIdKey && props.entityIdValue) {
165
+ addFilter({
166
+ name: props.entityIdKey,
167
+ value: props.entityIdValue,
168
+ });
169
+ }
170
+
171
+ if (!hasFilter('createdAtFrom')) {
172
+ addFilter({
173
+ name: 'createdAtFrom',
174
+ value: getStartOfDay(),
175
+ });
176
+ }
177
+
178
+ if (!hasFilter('createdAtTo')) {
179
+ addFilter({
180
+ name: 'createdAtTo',
181
+ value: getEndOfDay(),
182
+ });
183
+ }
184
+ };
185
+
186
+ initializeDefaultFilters();
187
+
188
+ const prettifyTimestamp = (timestamp: string | number) => {
189
+ if (!timestamp) return '';
190
+ return new Date(+timestamp).toLocaleString();
191
+ };
192
+
193
+ const {
194
+ isVisible: isDeleteConfirmationPopup,
195
+ deleteCount,
196
+ deleteCallback,
197
+
198
+ askDeleteConfirmation,
199
+ closeDelete,
200
+ } = useDeleteConfirmationPopup();
201
+
202
+ const {
203
+ showEmpty,
204
+ image: imageEmpty,
205
+ text: textEmpty,
206
+ } = useTableEmpty({
207
+ dataList,
208
+ error,
209
+ filters: computed(() => filtersManager.value.getAllValues()),
210
+ isLoading,
211
+ });
212
+
213
+ const handleDelete = async (items: []) => {
214
+ const deleteEl = (el) => {
215
+ // If status is failed, use deletePdfExportRecord with the export id
216
+ if (el.status === WebitelMediaExporterExportStatus.Failed) {
217
+ return PdfServicesAPI.delete(el.id);
218
+ }
219
+ // Otherwise, use custom delete function if provided
220
+ if (props.onDeleteItem) {
221
+ return props.onDeleteItem(el);
222
+ }
223
+ // Fallback to default implementation
224
+ return FileServicesAPI.deleteScreenRecordingsByAgent({
225
+ id: el.fileId,
226
+ agentId: props.entityIdValue,
227
+ });
228
+ };
229
+
230
+ try {
231
+ await Promise.all(items.map(deleteEl));
232
+ } finally {
233
+ // If we're deleting all items from the current page, and we're not on the first page,
234
+ // we should go to the previous page
235
+ if (items.length === dataList.value.length && page.value > 1) {
236
+ updatePage(page.value - 1);
237
+ }
238
+ await loadDataList();
239
+ }
240
+ };
241
+
242
+ const downloadPdf = async (id: string) => {
243
+ await downloadFile(id);
244
+ };
245
+
246
+ const openPdfInNewWindow = (fileId: string) => {
247
+ try {
248
+ const pdfUrl = getMediaUrl(fileId);
249
+ window.open(pdfUrl, '_blank');
250
+ } catch (error) {
251
+ console.error('Error opening PDF:', error);
252
+ }
253
+ };
254
+ </script>
255
+
256
+ <style lang="scss" scoped></style>
257
+
@@ -0,0 +1,55 @@
1
+ <template>
2
+ <wt-image
3
+ :src="statusImage"
4
+ :alt="status"
5
+ width="48"
6
+ :overlay-icon="overlayIcon"
7
+ @click="handleClick"
8
+ />
9
+ </template>
10
+
11
+ <script lang="ts" setup>
12
+ import { WebitelMediaExporterExportStatus } from '@webitel/api-services/gen/models';
13
+ import { computed } from 'vue';
14
+
15
+ import doneImage from '../assets/pdf-done.png';
16
+ import errorImage from '../assets/pdf-error.png';
17
+ import pendingImage from '../assets/pdf-pending.png';
18
+ import processingImage from '../assets/pdf-processing.png';
19
+
20
+ export type PdfExportStatusType = typeof WebitelMediaExporterExportStatus[keyof typeof WebitelMediaExporterExportStatus];
21
+
22
+ const props = defineProps<{
23
+ status: PdfExportStatusType | string;
24
+ clickable?: boolean;
25
+ }>();
26
+
27
+ const emit = defineEmits<{
28
+ click: () => void;
29
+ }>();
30
+
31
+ const statusImageMap: Record<string, string> = {
32
+ [WebitelMediaExporterExportStatus.Pending]: pendingImage,
33
+ [WebitelMediaExporterExportStatus.Processing]: processingImage,
34
+ [WebitelMediaExporterExportStatus.Done]: doneImage,
35
+ [WebitelMediaExporterExportStatus.Failed]: errorImage,
36
+ };
37
+
38
+ const statusImage = computed(() =>
39
+ statusImageMap[props.status] || pendingImage,
40
+ );
41
+
42
+ const overlayIcon = computed(() => {
43
+ return props.status === WebitelMediaExporterExportStatus.Done && 'zoom-in';
44
+ });
45
+
46
+ const handleClick = () => {
47
+ if (props.clickable) {
48
+ emit('click');
49
+ }
50
+ };
51
+ </script>
52
+
53
+ <style lang="scss" scoped>
54
+ </style>
55
+
@@ -0,0 +1,67 @@
1
+ <template>
2
+ <span :class="[`pdf-status--${statusConfig.color}`]">
3
+ {{ statusConfig.text }}
4
+ </span>
5
+ </template>
6
+
7
+ <script lang="ts" setup>
8
+ import { WebitelMediaExporterExportStatus } from '@webitel/api-services/gen/models';
9
+ import { computed } from 'vue';
10
+ import { useI18n } from 'vue-i18n';
11
+
12
+ export type PdfExportStatusType = typeof WebitelMediaExporterExportStatus[keyof typeof WebitelMediaExporterExportStatus];
13
+
14
+ interface Props {
15
+ status: PdfExportStatusType;
16
+ }
17
+
18
+ const props = defineProps<Props>();
19
+ const { t } = useI18n();
20
+
21
+ const STATUS_MAP = {
22
+ [WebitelMediaExporterExportStatus.Pending]: {
23
+ text: `objects.agentPdfs.status.${WebitelMediaExporterExportStatus.Pending}`,
24
+ color: 'main',
25
+ },
26
+ [WebitelMediaExporterExportStatus.Processing]: {
27
+ text: `objects.agentPdfs.status.${WebitelMediaExporterExportStatus.Processing}`,
28
+ color: 'warning',
29
+ },
30
+ [WebitelMediaExporterExportStatus.Done]: {
31
+ text: `objects.agentPdfs.status.${WebitelMediaExporterExportStatus.Done}`,
32
+ color: 'success',
33
+ },
34
+ [WebitelMediaExporterExportStatus.Failed]: {
35
+ text: `objects.agentPdfs.status.${WebitelMediaExporterExportStatus.Failed}`,
36
+ color: 'error',
37
+ },
38
+ } as const;
39
+
40
+ const statusConfig = computed(() => {
41
+ const config = STATUS_MAP[props.status as keyof typeof STATUS_MAP];
42
+ return config
43
+ ? { text: t(config.text), color: config.color }
44
+ : { text: props.status, color: 'main' };
45
+ });
46
+ </script>
47
+
48
+ <style lang="scss" scoped>
49
+ .pdf-status {
50
+ &--main {
51
+ color: var(--main-color);
52
+ }
53
+
54
+ &--warning {
55
+ color: var(--warning-color);
56
+ }
57
+
58
+ &--success {
59
+ color: var(--success-color);
60
+ }
61
+
62
+ &--error {
63
+ color: var(--error-color);
64
+ }
65
+ }
66
+ </style>
67
+
@@ -0,0 +1,16 @@
1
+ export declare const MimeTypes: {
2
+ readonly IMAGE_JPEG: "image/jpeg";
3
+ readonly IMAGE_PNG: "image/png";
4
+ readonly IMAGE_GIF: "image/gif";
5
+ readonly IMAGE_SVG_XML: "image/svg+xml";
6
+ readonly IMAGE_WEBP: "image/webp";
7
+ readonly VIDEO_MP4: "video/mp4";
8
+ readonly VIDEO_WEBM: "video/webm";
9
+ readonly VIDEO_MPEG: "video/mpeg";
10
+ readonly AUDIO_MPEG: "audio/mpeg";
11
+ readonly AUDIO_WAV: "audio/wav";
12
+ readonly APPLICATION_PDF: "application/pdf";
13
+ readonly APPLICATION_MSWORD: "application/msword";
14
+ readonly APPLICATION_DOCX: "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
15
+ };
16
+ export type MimeTypes = (typeof MimeTypes)[keyof typeof MimeTypes];
@@ -11,6 +11,7 @@ import { EmptyCause } from './EmptyCause/EmptyCause';
11
11
  import { FormatDateMode } from './FormatDateMode/FormatDateMode';
12
12
  import IconAction from './IconAction/IconAction.enum.js';
13
13
  import { IconColor } from './IconColor/IconColor';
14
+ import { MimeTypes } from './MimeTypes/MimeTypes.enum';
14
15
  import { ProcessingTableColumnType } from './ProcessingTableColumnType/ProcessingTableColumnType';
15
16
  import { QueueType, QueueTypeName } from './QueueType/QueueType.enum';
16
17
  import { RelativeDatetimeValue } from './RelativeDatetimeValue/RelativeDatetimeValue';
@@ -24,4 +25,4 @@ import { WfmSections } from './WebitelApplications/WfmSections';
24
25
  import { WtApplication } from './WebitelApplications/WtApplication';
25
26
  import { WtObject } from './WtObject/WtObject';
26
27
  import { WtTypeExtensionFieldKind } from './WtTypeExtensionFieldKind/WtTypeExtensionFieldKind';
27
- export { AbstractUserStatus, AdminSections, AgentStatus, AuditorSections, ButtonColor, ButtonVariant, ChatGatewayProvider, ChipColor, ComponentSize, CrmSections, CrudAction, EmptyCause, FormatDateMode, IconAction, IconColor, ProcessingTableColumnType, ProviderIconType, QueueType, QueueTypeName, RelativeDatetimeValue, SupervisorSections, TypesExportedSettings, WebitelApplications, WfmSections, WtApplication, WtObject, WtTypeExtensionFieldKind, };
28
+ export { AbstractUserStatus, AdminSections, AgentStatus, AuditorSections, ButtonColor, ButtonVariant, ChatGatewayProvider, ChipColor, ComponentSize, CrmSections, CrudAction, EmptyCause, FormatDateMode, IconAction, IconColor, MimeTypes, ProcessingTableColumnType, ProviderIconType, QueueType, QueueTypeName, RelativeDatetimeValue, SupervisorSections, TypesExportedSettings, WebitelApplications, WfmSections, WtApplication, WtObject, WtTypeExtensionFieldKind, };
@@ -34,6 +34,7 @@ declare const _default: {
34
34
  to: string;
35
35
  tts: string;
36
36
  state: string;
37
+ status: string;
37
38
  refresh: string;
38
39
  retry: string;
39
40
  downloadAll: string;
@@ -210,6 +211,16 @@ declare const _default: {
210
211
  };
211
212
  screenRecordings: string;
212
213
  screenshots: string;
214
+ agentPdfs: {
215
+ pdfs: string;
216
+ preview: string;
217
+ status: {
218
+ PENDING: string;
219
+ PROCESSING: string;
220
+ DONE: string;
221
+ FAILED: string;
222
+ };
223
+ };
213
224
  };
214
225
  channel: {
215
226
  state: {
@@ -38,6 +38,7 @@ declare namespace _default {
38
38
  export let to: string;
39
39
  export let tts: string;
40
40
  export let state: string;
41
+ export let status: string;
41
42
  export let refresh: string;
42
43
  export let retry: string;
43
44
  export let downloadAll: string;
@@ -192,12 +193,13 @@ declare namespace _default {
192
193
  export namespace agent {
193
194
  let agent_1: string;
194
195
  export { agent_1 as agent };
195
- export let status: {
196
+ let status_1: {
196
197
  [x: number]: string;
197
198
  online: string;
198
199
  pause: string;
199
200
  offline: string;
200
201
  };
202
+ export { status_1 as status };
201
203
  }
202
204
  export namespace flow {
203
205
  let name_1: string;
@@ -228,6 +230,17 @@ declare namespace _default {
228
230
  }
229
231
  export let screenRecordings: string;
230
232
  export let screenshots: string;
233
+ export namespace agentPdfs {
234
+ export let pdfs: string;
235
+ export let preview: string;
236
+ export namespace status_2 {
237
+ let PENDING: string;
238
+ let PROCESSING: string;
239
+ let DONE: string;
240
+ let FAILED: string;
241
+ }
242
+ export { status_2 as status };
243
+ }
231
244
  }
232
245
  export namespace channel_1 {
233
246
  let state_1: {
@@ -262,8 +275,8 @@ declare namespace _default {
262
275
  export { direction_1 as direction };
263
276
  }
264
277
  export namespace cases {
265
- let status_1: string;
266
- export { status_1 as status };
278
+ let status_3: string;
279
+ export { status_3 as status };
267
280
  export let source: string;
268
281
  export let author: string;
269
282
  export let reporter: string;
@@ -894,10 +907,10 @@ declare namespace _default {
894
907
  linked: any;
895
908
  }): any;
896
909
  export { source_1 as source };
897
- export function status_2({ linked }: {
910
+ export function status_4({ linked }: {
898
911
  linked: any;
899
912
  }): any;
900
- export { status_2 as status };
913
+ export { status_4 as status };
901
914
  export function tag_1({ linked }: {
902
915
  linked: any;
903
916
  }): any;