@escalated-dev/escalated 0.8.0 → 0.9.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/LICENSE +21 -21
- package/README.md +380 -361
- package/package.json +85 -84
- package/src/components/ActiveChatsPanel.vue +246 -246
- package/src/components/AdminDashboard.stories.js +1423 -1423
- package/src/components/AttachmentList.vue +65 -65
- package/src/components/ChatActionBar.vue +226 -226
- package/src/components/ChatBubble.vue +162 -162
- package/src/components/ChatComposer.vue +308 -308
- package/src/components/ChatQueue.vue +222 -222
- package/src/components/ChatThread.vue +197 -197
- package/src/components/CustomTicketActions.stories.js +71 -0
- package/src/components/CustomTicketActions.vue +101 -0
- package/src/components/EscalatedLayout.vue +619 -604
- package/src/components/FollowButton.vue +20 -1
- package/src/components/MentionDropdown.vue +154 -154
- package/src/components/MetricComparison.vue +89 -89
- package/src/components/PercentileChart.vue +67 -67
- package/src/components/PeriodSelector.vue +98 -98
- package/src/components/PresenceIndicator.vue +228 -213
- package/src/components/ReplyComposer.vue +336 -336
- package/src/components/ReplyThread.vue +153 -153
- package/src/components/ReportChart.vue +395 -395
- package/src/components/ReportExportButton.vue +108 -108
- package/src/components/SaveViewDialog.vue +172 -172
- package/src/components/SavedViewSidebar.vue +208 -208
- package/src/components/SkillTagManager.vue +3 -0
- package/src/components/SnoozeButton.vue +247 -247
- package/src/components/TicketFilters.vue +270 -270
- package/src/components/TicketList.vue +655 -655
- package/src/components/TicketSidebar.vue +4 -0
- package/src/components/TicketSplitDialog.vue +98 -98
- package/src/components/TicketSubjects.stories.js +63 -0
- package/src/components/TicketSubjects.vue +107 -0
- package/src/components/TwoFactorSetup.vue +1 -37
- package/src/components/VariableTokenInput.vue +111 -111
- package/src/components/WorkflowActionConfig.vue +287 -287
- package/src/components/WorkflowActionList.vue +350 -350
- package/src/components/WorkflowConditionBuilder.vue +265 -265
- package/src/components/WorkflowTriggerSelector.vue +125 -125
- package/src/components/admin/newsletters/AnalyticsTiles.stories.js +14 -0
- package/src/components/admin/newsletters/AnalyticsTiles.vue +55 -0
- package/src/components/admin/newsletters/DeliveriesTable.stories.js +28 -0
- package/src/components/admin/newsletters/DeliveriesTable.vue +104 -0
- package/src/components/admin/newsletters/DynamicFilterBuilder.stories.js +11 -0
- package/src/components/admin/newsletters/DynamicFilterBuilder.vue +53 -0
- package/src/components/admin/newsletters/ListMemberTable.stories.js +12 -0
- package/src/components/admin/newsletters/ListMemberTable.vue +53 -0
- package/src/components/admin/newsletters/MarkdownEditor.stories.js +6 -0
- package/src/components/admin/newsletters/MarkdownEditor.vue +53 -0
- package/src/components/admin/newsletters/MergeFieldDropdown.stories.js +6 -0
- package/src/components/admin/newsletters/MergeFieldDropdown.vue +84 -0
- package/src/components/admin/newsletters/PreviewIframe.stories.js +7 -0
- package/src/components/admin/newsletters/PreviewIframe.vue +40 -0
- package/src/components/admin/newsletters/SummaryTiles.stories.js +8 -0
- package/src/components/admin/newsletters/SummaryTiles.vue +63 -0
- package/src/composables/useChat.js +187 -187
- package/src/composables/useI18n.js +102 -102
- package/src/composables/useMentions.js +134 -134
- package/src/composables/usePermissions.js +31 -0
- package/src/composables/useRealtime.js +182 -182
- package/src/index.js +85 -84
- package/src/locales/README.md +13 -13
- package/src/locales/ar.json +727 -727
- package/src/locales/de.json +690 -690
- package/src/locales/en.json +889 -729
- package/src/locales/es.json +691 -691
- package/src/locales/fr.json +691 -691
- package/src/locales/index.js +16 -16
- package/src/locales/it.json +727 -727
- package/src/locales/ja.json +727 -727
- package/src/locales/ko.json +727 -727
- package/src/locales/nl.json +727 -727
- package/src/locales/pl.json +727 -727
- package/src/locales/pt-BR.json +727 -727
- package/src/locales/ru.json +727 -727
- package/src/locales/tr.json +727 -727
- package/src/locales/zh-CN.json +727 -727
- package/src/pages/Admin/Newsletters/Compose.vue +192 -0
- package/src/pages/Admin/Newsletters/Edit.vue +24 -0
- package/src/pages/Admin/Newsletters/Index.vue +141 -0
- package/src/pages/Admin/Newsletters/Lists/Create.vue +64 -0
- package/src/pages/Admin/Newsletters/Lists/Index.vue +59 -0
- package/src/pages/Admin/Newsletters/Lists/Show.vue +53 -0
- package/src/pages/Admin/Newsletters/Settings.vue +85 -0
- package/src/pages/Admin/Newsletters/Show.vue +140 -0
- package/src/pages/Admin/Newsletters/Templates/Create.vue +11 -0
- package/src/pages/Admin/Newsletters/Templates/Index.vue +54 -0
- package/src/pages/Admin/Newsletters/Templates/Show.vue +65 -0
- package/src/pages/Admin/Newsletters/usePreview.js +44 -0
- package/src/pages/Admin/Reports/AgentDetail.vue +132 -132
- package/src/pages/Admin/Reports/AgentRanking.vue +246 -246
- package/src/pages/Admin/Reports/Cohorts.vue +180 -180
- package/src/pages/Admin/Reports/Comparison.vue +141 -141
- package/src/pages/Admin/Reports/Dashboard.vue +226 -226
- package/src/pages/Admin/Reports/ResolutionTimes.vue +164 -164
- package/src/pages/Admin/Reports/ResponseTimes.vue +164 -164
- package/src/pages/Admin/Reports/SlaTrends.vue +183 -183
- package/src/pages/Admin/Settings/SsoSettings.vue +157 -4
- package/src/pages/Admin/Settings/TwoFactor.vue +32 -6
- package/src/pages/Admin/Settings.vue +1008 -1008
- package/src/pages/Admin/Skills/Form.vue +30 -10
- package/src/pages/Admin/Tickets/Index.vue +126 -126
- package/src/pages/Admin/Tickets/Show.vue +254 -249
- package/src/pages/Admin/Users/Index.vue +145 -145
- package/src/pages/Admin/Workflows/Builder.vue +207 -207
- package/src/pages/Admin/Workflows/Index.vue +235 -235
- package/src/pages/Admin/Workflows/Logs.vue +286 -286
- package/src/pages/Agent/TicketIndex.vue +112 -112
- package/src/pages/Agent/TicketShow.vue +547 -494
- package/src/pages/Customer/Index.vue +56 -56
- package/src/pages/Customer/KnowledgeBase/Article.vue +129 -129
- package/src/plugin.js +175 -175
- package/src/utils/mentionHighlight.js +24 -24
- package/src/widget/EscalatedWidget.vue +804 -804
- package/src/widget/index.js +254 -254
|
@@ -1,162 +1,162 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { computed, inject } from 'vue';
|
|
3
|
-
import { timeAgo } from '../utils/formatting';
|
|
4
|
-
import { highlightMentions } from '../utils/mentionHighlight';
|
|
5
|
-
import { sanitizeHtml } from '../utils/sanitizeHtml';
|
|
6
|
-
|
|
7
|
-
const props = defineProps({
|
|
8
|
-
message: { type: Object, required: true },
|
|
9
|
-
isAgent: { type: Boolean, default: false },
|
|
10
|
-
showAvatar: { type: Boolean, default: true },
|
|
11
|
-
showTimestamp: { type: Boolean, default: false },
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
const escDark = inject(
|
|
15
|
-
'esc-dark',
|
|
16
|
-
computed(() => false),
|
|
17
|
-
);
|
|
18
|
-
|
|
19
|
-
function attachmentUrl(att) {
|
|
20
|
-
if (att.url) return att.url;
|
|
21
|
-
if (typeof window.route === 'function') {
|
|
22
|
-
try {
|
|
23
|
-
return window.route('escalated.attachments.download', att.id);
|
|
24
|
-
} catch {
|
|
25
|
-
// route not registered
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return `/escalated/attachments/${att.id}/download`;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const initials = computed(() => {
|
|
32
|
-
const name = props.message.author?.name || 'U';
|
|
33
|
-
return name
|
|
34
|
-
.split(' ')
|
|
35
|
-
.map((w) => w[0])
|
|
36
|
-
.join('')
|
|
37
|
-
.toUpperCase()
|
|
38
|
-
.slice(0, 2);
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
const formattedTime = computed(() => {
|
|
42
|
-
if (!props.message.created_at) return '';
|
|
43
|
-
const date = new Date(props.message.created_at);
|
|
44
|
-
const diffMs = Date.now() - date.getTime();
|
|
45
|
-
// If less than 24h, show relative; otherwise show absolute
|
|
46
|
-
if (diffMs < 86400000) {
|
|
47
|
-
return timeAgo(props.message.created_at);
|
|
48
|
-
}
|
|
49
|
-
return date.toLocaleString(undefined, {
|
|
50
|
-
month: 'short',
|
|
51
|
-
day: 'numeric',
|
|
52
|
-
hour: '2-digit',
|
|
53
|
-
minute: '2-digit',
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
const isInternalNote = computed(() => props.message.is_internal_note);
|
|
58
|
-
</script>
|
|
59
|
-
|
|
60
|
-
<template>
|
|
61
|
-
<div
|
|
62
|
-
:class="[
|
|
63
|
-
'flex gap-2',
|
|
64
|
-
isAgent ? 'flex-row-reverse' : 'flex-row',
|
|
65
|
-
!showAvatar && isAgent ? 'pr-10' : '',
|
|
66
|
-
!showAvatar && !isAgent ? 'pl-10' : '',
|
|
67
|
-
]"
|
|
68
|
-
:data-message-id="message.id"
|
|
69
|
-
>
|
|
70
|
-
<!-- Avatar -->
|
|
71
|
-
<div v-if="showAvatar" class="flex-shrink-0">
|
|
72
|
-
<div v-if="message.author?.avatar" class="h-8 w-8 overflow-hidden rounded-full">
|
|
73
|
-
<img :src="message.author.avatar" :alt="message.author.name" class="h-full w-full object-cover" />
|
|
74
|
-
</div>
|
|
75
|
-
<div
|
|
76
|
-
v-else
|
|
77
|
-
:class="[
|
|
78
|
-
'flex h-8 w-8 items-center justify-center rounded-full text-xs font-semibold',
|
|
79
|
-
isAgent
|
|
80
|
-
? escDark
|
|
81
|
-
? 'bg-cyan-500/20 text-cyan-400'
|
|
82
|
-
: 'bg-blue-100 text-blue-700'
|
|
83
|
-
: escDark
|
|
84
|
-
? 'bg-neutral-700 text-neutral-300'
|
|
85
|
-
: 'bg-gray-200 text-gray-600',
|
|
86
|
-
]"
|
|
87
|
-
>
|
|
88
|
-
{{ initials }}
|
|
89
|
-
</div>
|
|
90
|
-
</div>
|
|
91
|
-
|
|
92
|
-
<!-- Bubble -->
|
|
93
|
-
<div class="max-w-[75%]">
|
|
94
|
-
<div
|
|
95
|
-
:class="[
|
|
96
|
-
'rounded-2xl px-4 py-2 text-sm',
|
|
97
|
-
isInternalNote
|
|
98
|
-
? escDark
|
|
99
|
-
? 'bg-amber-500/10 text-amber-300 ring-1 ring-amber-500/20'
|
|
100
|
-
: 'bg-yellow-50 text-yellow-800 ring-1 ring-yellow-200'
|
|
101
|
-
: isAgent
|
|
102
|
-
? escDark
|
|
103
|
-
? 'bg-cyan-500/15 text-neutral-200'
|
|
104
|
-
: 'bg-blue-600 text-white'
|
|
105
|
-
: escDark
|
|
106
|
-
? 'bg-neutral-800 text-neutral-200'
|
|
107
|
-
: 'bg-gray-100 text-gray-900',
|
|
108
|
-
]"
|
|
109
|
-
>
|
|
110
|
-
<span v-if="isInternalNote" class="mb-1 block text-[10px] font-semibold uppercase opacity-70">
|
|
111
|
-
Internal Note
|
|
112
|
-
</span>
|
|
113
|
-
<p
|
|
114
|
-
class="whitespace-pre-wrap break-words"
|
|
115
|
-
v-html="highlightMentions(sanitizeHtml(message.body || ''), escDark)"
|
|
116
|
-
></p>
|
|
117
|
-
|
|
118
|
-
<!-- Attachments -->
|
|
119
|
-
<div v-if="message.attachments?.length" class="mt-2 space-y-1">
|
|
120
|
-
<a
|
|
121
|
-
v-for="att in message.attachments"
|
|
122
|
-
:key="att.id || att.url"
|
|
123
|
-
:href="attachmentUrl(att)"
|
|
124
|
-
target="_blank"
|
|
125
|
-
rel="noopener"
|
|
126
|
-
:class="[
|
|
127
|
-
'flex items-center gap-1 text-xs underline',
|
|
128
|
-
isAgent && !isInternalNote
|
|
129
|
-
? escDark
|
|
130
|
-
? 'text-cyan-300'
|
|
131
|
-
: 'text-blue-200'
|
|
132
|
-
: escDark
|
|
133
|
-
? 'text-cyan-400'
|
|
134
|
-
: 'text-blue-600',
|
|
135
|
-
]"
|
|
136
|
-
>
|
|
137
|
-
<svg class="h-3 w-3" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">
|
|
138
|
-
<path
|
|
139
|
-
stroke-linecap="round"
|
|
140
|
-
stroke-linejoin="round"
|
|
141
|
-
d="M18.375 12.739l-7.693 7.693a4.5 4.5 0 01-6.364-6.364l10.94-10.94A3 3 0 1119.5 7.372L8.552 18.32m.009-.01l-.01.01m5.699-9.941l-7.81 7.81a1.5 1.5 0 002.112 2.13"
|
|
142
|
-
/>
|
|
143
|
-
</svg>
|
|
144
|
-
{{ att.name || 'Attachment' }}
|
|
145
|
-
</a>
|
|
146
|
-
</div>
|
|
147
|
-
</div>
|
|
148
|
-
|
|
149
|
-
<!-- Timestamp -->
|
|
150
|
-
<div
|
|
151
|
-
v-if="showTimestamp"
|
|
152
|
-
:class="[
|
|
153
|
-
'mt-1 text-[10px]',
|
|
154
|
-
isAgent ? 'text-right' : 'text-left',
|
|
155
|
-
escDark ? 'text-neutral-600' : 'text-gray-400',
|
|
156
|
-
]"
|
|
157
|
-
>
|
|
158
|
-
{{ formattedTime }}
|
|
159
|
-
</div>
|
|
160
|
-
</div>
|
|
161
|
-
</div>
|
|
162
|
-
</template>
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, inject } from 'vue';
|
|
3
|
+
import { timeAgo } from '../utils/formatting';
|
|
4
|
+
import { highlightMentions } from '../utils/mentionHighlight';
|
|
5
|
+
import { sanitizeHtml } from '../utils/sanitizeHtml';
|
|
6
|
+
|
|
7
|
+
const props = defineProps({
|
|
8
|
+
message: { type: Object, required: true },
|
|
9
|
+
isAgent: { type: Boolean, default: false },
|
|
10
|
+
showAvatar: { type: Boolean, default: true },
|
|
11
|
+
showTimestamp: { type: Boolean, default: false },
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const escDark = inject(
|
|
15
|
+
'esc-dark',
|
|
16
|
+
computed(() => false),
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
function attachmentUrl(att) {
|
|
20
|
+
if (att.url) return att.url;
|
|
21
|
+
if (typeof window.route === 'function') {
|
|
22
|
+
try {
|
|
23
|
+
return window.route('escalated.attachments.download', att.id);
|
|
24
|
+
} catch {
|
|
25
|
+
// route not registered
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return `/escalated/attachments/${att.id}/download`;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const initials = computed(() => {
|
|
32
|
+
const name = props.message.author?.name || 'U';
|
|
33
|
+
return name
|
|
34
|
+
.split(' ')
|
|
35
|
+
.map((w) => w[0])
|
|
36
|
+
.join('')
|
|
37
|
+
.toUpperCase()
|
|
38
|
+
.slice(0, 2);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const formattedTime = computed(() => {
|
|
42
|
+
if (!props.message.created_at) return '';
|
|
43
|
+
const date = new Date(props.message.created_at);
|
|
44
|
+
const diffMs = Date.now() - date.getTime();
|
|
45
|
+
// If less than 24h, show relative; otherwise show absolute
|
|
46
|
+
if (diffMs < 86400000) {
|
|
47
|
+
return timeAgo(props.message.created_at);
|
|
48
|
+
}
|
|
49
|
+
return date.toLocaleString(undefined, {
|
|
50
|
+
month: 'short',
|
|
51
|
+
day: 'numeric',
|
|
52
|
+
hour: '2-digit',
|
|
53
|
+
minute: '2-digit',
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const isInternalNote = computed(() => props.message.is_internal_note);
|
|
58
|
+
</script>
|
|
59
|
+
|
|
60
|
+
<template>
|
|
61
|
+
<div
|
|
62
|
+
:class="[
|
|
63
|
+
'flex gap-2',
|
|
64
|
+
isAgent ? 'flex-row-reverse' : 'flex-row',
|
|
65
|
+
!showAvatar && isAgent ? 'pr-10' : '',
|
|
66
|
+
!showAvatar && !isAgent ? 'pl-10' : '',
|
|
67
|
+
]"
|
|
68
|
+
:data-message-id="message.id"
|
|
69
|
+
>
|
|
70
|
+
<!-- Avatar -->
|
|
71
|
+
<div v-if="showAvatar" class="flex-shrink-0">
|
|
72
|
+
<div v-if="message.author?.avatar" class="h-8 w-8 overflow-hidden rounded-full">
|
|
73
|
+
<img :src="message.author.avatar" :alt="message.author.name" class="h-full w-full object-cover" />
|
|
74
|
+
</div>
|
|
75
|
+
<div
|
|
76
|
+
v-else
|
|
77
|
+
:class="[
|
|
78
|
+
'flex h-8 w-8 items-center justify-center rounded-full text-xs font-semibold',
|
|
79
|
+
isAgent
|
|
80
|
+
? escDark
|
|
81
|
+
? 'bg-cyan-500/20 text-cyan-400'
|
|
82
|
+
: 'bg-blue-100 text-blue-700'
|
|
83
|
+
: escDark
|
|
84
|
+
? 'bg-neutral-700 text-neutral-300'
|
|
85
|
+
: 'bg-gray-200 text-gray-600',
|
|
86
|
+
]"
|
|
87
|
+
>
|
|
88
|
+
{{ initials }}
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
|
|
92
|
+
<!-- Bubble -->
|
|
93
|
+
<div class="max-w-[75%]">
|
|
94
|
+
<div
|
|
95
|
+
:class="[
|
|
96
|
+
'rounded-2xl px-4 py-2 text-sm',
|
|
97
|
+
isInternalNote
|
|
98
|
+
? escDark
|
|
99
|
+
? 'bg-amber-500/10 text-amber-300 ring-1 ring-amber-500/20'
|
|
100
|
+
: 'bg-yellow-50 text-yellow-800 ring-1 ring-yellow-200'
|
|
101
|
+
: isAgent
|
|
102
|
+
? escDark
|
|
103
|
+
? 'bg-cyan-500/15 text-neutral-200'
|
|
104
|
+
: 'bg-blue-600 text-white'
|
|
105
|
+
: escDark
|
|
106
|
+
? 'bg-neutral-800 text-neutral-200'
|
|
107
|
+
: 'bg-gray-100 text-gray-900',
|
|
108
|
+
]"
|
|
109
|
+
>
|
|
110
|
+
<span v-if="isInternalNote" class="mb-1 block text-[10px] font-semibold uppercase opacity-70">
|
|
111
|
+
Internal Note
|
|
112
|
+
</span>
|
|
113
|
+
<p
|
|
114
|
+
class="whitespace-pre-wrap break-words"
|
|
115
|
+
v-html="highlightMentions(sanitizeHtml(message.body || ''), escDark)"
|
|
116
|
+
></p>
|
|
117
|
+
|
|
118
|
+
<!-- Attachments -->
|
|
119
|
+
<div v-if="message.attachments?.length" class="mt-2 space-y-1">
|
|
120
|
+
<a
|
|
121
|
+
v-for="att in message.attachments"
|
|
122
|
+
:key="att.id || att.url"
|
|
123
|
+
:href="attachmentUrl(att)"
|
|
124
|
+
target="_blank"
|
|
125
|
+
rel="noopener"
|
|
126
|
+
:class="[
|
|
127
|
+
'flex items-center gap-1 text-xs underline',
|
|
128
|
+
isAgent && !isInternalNote
|
|
129
|
+
? escDark
|
|
130
|
+
? 'text-cyan-300'
|
|
131
|
+
: 'text-blue-200'
|
|
132
|
+
: escDark
|
|
133
|
+
? 'text-cyan-400'
|
|
134
|
+
: 'text-blue-600',
|
|
135
|
+
]"
|
|
136
|
+
>
|
|
137
|
+
<svg class="h-3 w-3" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">
|
|
138
|
+
<path
|
|
139
|
+
stroke-linecap="round"
|
|
140
|
+
stroke-linejoin="round"
|
|
141
|
+
d="M18.375 12.739l-7.693 7.693a4.5 4.5 0 01-6.364-6.364l10.94-10.94A3 3 0 1119.5 7.372L8.552 18.32m.009-.01l-.01.01m5.699-9.941l-7.81 7.81a1.5 1.5 0 002.112 2.13"
|
|
142
|
+
/>
|
|
143
|
+
</svg>
|
|
144
|
+
{{ att.name || 'Attachment' }}
|
|
145
|
+
</a>
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
|
|
149
|
+
<!-- Timestamp -->
|
|
150
|
+
<div
|
|
151
|
+
v-if="showTimestamp"
|
|
152
|
+
:class="[
|
|
153
|
+
'mt-1 text-[10px]',
|
|
154
|
+
isAgent ? 'text-right' : 'text-left',
|
|
155
|
+
escDark ? 'text-neutral-600' : 'text-gray-400',
|
|
156
|
+
]"
|
|
157
|
+
>
|
|
158
|
+
{{ formattedTime }}
|
|
159
|
+
</div>
|
|
160
|
+
</div>
|
|
161
|
+
</div>
|
|
162
|
+
</template>
|