@escalated-dev/escalated 0.7.0 → 0.7.1

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 (179) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +31 -0
  3. package/package.json +12 -6
  4. package/src/components/ActiveChatsPanel.vue +246 -0
  5. package/src/components/ActivityTimeline.stories.js +55 -55
  6. package/src/components/ActivityTimeline.vue +83 -83
  7. package/src/components/AdminDashboard.stories.js +1423 -1095
  8. package/src/components/AgentLoadIndicator.stories.js +37 -37
  9. package/src/components/AgentLoadIndicator.vue +49 -49
  10. package/src/components/AgentPerformanceCard.vue +44 -44
  11. package/src/components/ArticleEditor.vue +82 -82
  12. package/src/components/AssigneeSelect.vue +37 -37
  13. package/src/components/AttachmentList.vue +13 -1
  14. package/src/components/AuditLogEntry.vue +95 -95
  15. package/src/components/BulkActionBar.vue +166 -166
  16. package/src/components/CategoryTree.vue +89 -89
  17. package/src/components/ChartWidget.vue +46 -46
  18. package/src/components/ChatActionBar.vue +226 -0
  19. package/src/components/ChatBubble.vue +162 -0
  20. package/src/components/ChatComposer.vue +308 -0
  21. package/src/components/ChatQueue.vue +222 -0
  22. package/src/components/ChatThread.vue +197 -0
  23. package/src/components/CollisionWarning.stories.js +30 -30
  24. package/src/components/CollisionWarning.vue +68 -68
  25. package/src/components/ConditionalFieldRules.vue +135 -135
  26. package/src/components/ContextPanel.vue +66 -66
  27. package/src/components/ContextPanelSection.vue +65 -65
  28. package/src/components/CustomFieldRenderer.vue +159 -159
  29. package/src/components/EscalatedLayout.vue +29 -6
  30. package/src/components/FileDropzone.vue +57 -57
  31. package/src/components/FollowButton.stories.js +30 -30
  32. package/src/components/FollowButton.vue +88 -88
  33. package/src/components/KeyboardShortcutHelp.vue +213 -213
  34. package/src/components/KnowledgePanel.vue +122 -122
  35. package/src/components/KpiCard.stories.js +32 -32
  36. package/src/components/KpiCard.vue +88 -88
  37. package/src/components/MacroDropdown.vue +150 -150
  38. package/src/components/MentionDropdown.vue +154 -0
  39. package/src/components/MetricComparison.vue +89 -0
  40. package/src/components/PercentileChart.vue +67 -0
  41. package/src/components/PeriodSelector.vue +98 -0
  42. package/src/components/PermissionMatrix.vue +107 -107
  43. package/src/components/PinnedNotes.vue +129 -129
  44. package/src/components/PluginSlot.vue +68 -62
  45. package/src/components/PresenceIndicator.vue +46 -2
  46. package/src/components/PriorityBadge.stories.js +33 -33
  47. package/src/components/PriorityBadge.vue +46 -46
  48. package/src/components/ReplyComposer.vue +81 -18
  49. package/src/components/ReplyThread.vue +40 -2
  50. package/src/components/ReportChart.vue +395 -0
  51. package/src/components/ReportExportButton.vue +108 -0
  52. package/src/components/SatisfactionRating.vue +180 -180
  53. package/src/components/SaveViewDialog.vue +172 -0
  54. package/src/components/SavedViewSidebar.vue +208 -0
  55. package/src/components/ScheduleEditor.vue +104 -104
  56. package/src/components/SideConversation.vue +165 -165
  57. package/src/components/SideConversationList.vue +147 -147
  58. package/src/components/SkillTagManager.vue +79 -79
  59. package/src/components/SlaComplianceChart.vue +46 -53
  60. package/src/components/SlaTimer.stories.js +35 -35
  61. package/src/components/SlaTimer.vue +62 -62
  62. package/src/components/SnoozeButton.vue +247 -0
  63. package/src/components/StatsCard.stories.js +24 -24
  64. package/src/components/StatsCard.vue +58 -58
  65. package/src/components/StatusBadge.stories.js +53 -53
  66. package/src/components/StatusBadge.vue +78 -78
  67. package/src/components/TagSelect.vue +84 -84
  68. package/src/components/TicketFilters.vue +270 -225
  69. package/src/components/TicketLinkPanel.vue +193 -193
  70. package/src/components/TicketList.vue +655 -594
  71. package/src/components/TicketMergeDialog.vue +157 -157
  72. package/src/components/TicketSplitDialog.vue +98 -0
  73. package/src/components/TotpInput.stories.js +9 -9
  74. package/src/components/TotpInput.vue +81 -81
  75. package/src/components/TwoFactorSetup.vue +113 -113
  76. package/src/components/VariableTokenInput.vue +111 -0
  77. package/src/components/WorkflowActionConfig.vue +287 -0
  78. package/src/components/WorkflowActionList.vue +350 -0
  79. package/src/components/WorkflowConditionBuilder.vue +265 -0
  80. package/src/components/WorkflowTriggerSelector.vue +125 -0
  81. package/src/composables/useChat.js +187 -0
  82. package/src/composables/useI18n.js +80 -80
  83. package/src/composables/useKeyboardShortcuts.js +46 -46
  84. package/src/composables/useMentions.js +134 -0
  85. package/src/composables/usePluginExtensions.js +159 -159
  86. package/src/composables/usePluginHooks.js +65 -65
  87. package/src/composables/useRealtime.js +182 -0
  88. package/src/defineEscalatedPlugin.js +76 -76
  89. package/src/index.js +84 -72
  90. package/src/locales/ar.json +727 -0
  91. package/src/locales/de.json +678 -430
  92. package/src/locales/en.json +717 -455
  93. package/src/locales/es.json +679 -430
  94. package/src/locales/fr.json +680 -431
  95. package/src/locales/index.js +12 -2
  96. package/src/locales/it.json +727 -0
  97. package/src/locales/ja.json +727 -0
  98. package/src/locales/ko.json +727 -0
  99. package/src/locales/nl.json +727 -0
  100. package/src/locales/pl.json +727 -0
  101. package/src/locales/pt-BR.json +727 -0
  102. package/src/locales/ru.json +727 -0
  103. package/src/locales/tr.json +727 -0
  104. package/src/locales/zh-CN.json +727 -0
  105. package/src/pages/Admin/ApiTokens/Index.vue +381 -381
  106. package/src/pages/Admin/AuditLog/Index.vue +154 -154
  107. package/src/pages/Admin/BusinessHours/Form.vue +172 -172
  108. package/src/pages/Admin/BusinessHours/Index.vue +113 -113
  109. package/src/pages/Admin/CannedResponses/Index.vue +127 -127
  110. package/src/pages/Admin/Capacity/Index.vue +134 -134
  111. package/src/pages/Admin/CustomFields/Form.vue +195 -195
  112. package/src/pages/Admin/CustomFields/Index.vue +134 -134
  113. package/src/pages/Admin/CustomObjects/Form.vue +202 -202
  114. package/src/pages/Admin/CustomObjects/Index.vue +127 -127
  115. package/src/pages/Admin/CustomObjects/Records.vue +228 -228
  116. package/src/pages/Admin/Departments/Form.vue +75 -75
  117. package/src/pages/Admin/Departments/Index.vue +110 -109
  118. package/src/pages/Admin/EscalationRules/Form.vue +157 -157
  119. package/src/pages/Admin/EscalationRules/Index.vue +178 -178
  120. package/src/pages/Admin/Import/Connect.vue +0 -1
  121. package/src/pages/Admin/Import/Index.vue +1 -1
  122. package/src/pages/Admin/Import/Progress.vue +1 -1
  123. package/src/pages/Admin/KnowledgeBase/Articles/Form.vue +142 -142
  124. package/src/pages/Admin/KnowledgeBase/Articles/Index.vue +195 -195
  125. package/src/pages/Admin/KnowledgeBase/Categories/Index.vue +193 -193
  126. package/src/pages/Admin/Macros/Index.vue +448 -448
  127. package/src/pages/Admin/Plugins/Index.vue +327 -327
  128. package/src/pages/Admin/Reports/AgentDetail.vue +132 -0
  129. package/src/pages/Admin/Reports/AgentMetrics.vue +115 -115
  130. package/src/pages/Admin/Reports/AgentRanking.vue +246 -0
  131. package/src/pages/Admin/Reports/Cohorts.vue +180 -0
  132. package/src/pages/Admin/Reports/Comparison.vue +141 -0
  133. package/src/pages/Admin/Reports/CsatReport.vue +127 -127
  134. package/src/pages/Admin/Reports/Dashboard.vue +36 -21
  135. package/src/pages/Admin/Reports/ResolutionTimes.vue +164 -0
  136. package/src/pages/Admin/Reports/ResponseTimes.vue +164 -0
  137. package/src/pages/Admin/Reports/SlaReport.vue +162 -166
  138. package/src/pages/Admin/Reports/SlaTrends.vue +183 -0
  139. package/src/pages/Admin/Reports.vue +206 -206
  140. package/src/pages/Admin/Roles/Form.vue +71 -71
  141. package/src/pages/Admin/Roles/Index.vue +122 -122
  142. package/src/pages/Admin/Settings/CsatSettings.vue +165 -165
  143. package/src/pages/Admin/Settings/DataRetention.vue +182 -182
  144. package/src/pages/Admin/Settings/EmailSettings.vue +243 -243
  145. package/src/pages/Admin/Settings/Sandbox.vue +135 -135
  146. package/src/pages/Admin/Settings/SsoSettings.vue +218 -218
  147. package/src/pages/Admin/Settings/TwoFactor.vue +110 -110
  148. package/src/pages/Admin/Settings.vue +1008 -468
  149. package/src/pages/Admin/Skills/Form.vue +53 -53
  150. package/src/pages/Admin/Skills/Index.vue +94 -94
  151. package/src/pages/Admin/SlaPolicies/Form.vue +118 -118
  152. package/src/pages/Admin/SlaPolicies/Index.vue +121 -120
  153. package/src/pages/Admin/Statuses/Form.vue +114 -114
  154. package/src/pages/Admin/Statuses/Index.vue +153 -153
  155. package/src/pages/Admin/Tags/Index.vue +191 -191
  156. package/src/pages/Admin/Tickets/Index.vue +126 -91
  157. package/src/pages/Admin/Tickets/Show.vue +29 -0
  158. package/src/pages/Admin/Webhooks/DeliveryLog.vue +120 -120
  159. package/src/pages/Admin/Webhooks/Form.vue +110 -110
  160. package/src/pages/Admin/Webhooks/Index.vue +136 -136
  161. package/src/pages/Admin/Workflows/Builder.vue +207 -0
  162. package/src/pages/Admin/Workflows/Index.vue +235 -0
  163. package/src/pages/Admin/Workflows/Logs.vue +286 -0
  164. package/src/pages/Agent/TicketIndex.vue +112 -88
  165. package/src/pages/Agent/TicketShow.vue +192 -60
  166. package/src/pages/Customer/Create.vue +1 -1
  167. package/src/pages/Customer/Index.vue +31 -31
  168. package/src/pages/Customer/KnowledgeBase/Article.vue +4 -2
  169. package/src/pages/Customer/KnowledgeBase/Index.vue +151 -151
  170. package/src/pages/Customer/Show.vue +69 -63
  171. package/src/pages/Guest/Create.vue +40 -15
  172. package/src/pages/Guest/Show.vue +124 -93
  173. package/src/plugin.js +25 -0
  174. package/src/utils/mentionHighlight.js +24 -0
  175. package/src/utils/sanitizeHtml.js +78 -64
  176. package/src/widget/EscalatedWidget.vue +804 -0
  177. package/src/widget/index.js +254 -0
  178. package/src/pages/Admin/Automations/Form.vue +0 -184
  179. package/src/pages/Admin/Automations/Index.vue +0 -129
@@ -0,0 +1,254 @@
1
+ import { createApp, h } from 'vue';
2
+ import EscalatedWidget from './EscalatedWidget.vue';
3
+
4
+ (function () {
5
+ const scriptTag = document.currentScript || document.querySelector('script[data-escalated-widget]');
6
+ const globalConfig = window.EscalatedWidget || {};
7
+
8
+ const config = {
9
+ baseUrl: scriptTag?.getAttribute('data-base-url') || globalConfig.baseUrl || '',
10
+ // Host-framework-specific path prefix. Every plugin except the NestJS
11
+ // reference mounts at /support/widget; NestJS mounts at
12
+ // /escalated/widget. Set via data-widget-path on NestJS backends.
13
+ widgetPath: scriptTag?.getAttribute('data-widget-path') || globalConfig.widgetPath || '/support/widget',
14
+ color: scriptTag?.getAttribute('data-color') || globalConfig.color || '#4F46E5',
15
+ position: scriptTag?.getAttribute('data-position') || globalConfig.position || 'bottom-right',
16
+ };
17
+
18
+ const host = document.createElement('div');
19
+ host.id = 'escalated-widget-host';
20
+ document.body.appendChild(host);
21
+
22
+ const shadow = host.attachShadow({ mode: 'open' });
23
+
24
+ const mountEl = document.createElement('div');
25
+ mountEl.id = 'escalated-widget-root';
26
+ shadow.appendChild(mountEl);
27
+
28
+ const styleEl = document.createElement('style');
29
+ styleEl.textContent = getWidgetStyles();
30
+ shadow.appendChild(styleEl);
31
+
32
+ const app = createApp({
33
+ render() {
34
+ return h(EscalatedWidget, {
35
+ baseUrl: config.baseUrl,
36
+ widgetPath: config.widgetPath,
37
+ initialColor: config.color,
38
+ initialPosition: config.position,
39
+ });
40
+ },
41
+ });
42
+
43
+ app.mount(mountEl);
44
+
45
+ window.EscalatedWidget = Object.assign(window.EscalatedWidget || {}, {
46
+ open() {
47
+ mountEl.querySelector('[data-widget-panel]')?.classList.add('esc-open');
48
+ },
49
+ close() {
50
+ mountEl.querySelector('[data-widget-panel]')?.classList.remove('esc-open');
51
+ },
52
+ });
53
+ })();
54
+
55
+ function getWidgetStyles() {
56
+ return `
57
+ *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
58
+ #escalated-widget-root {
59
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
60
+ font-size: 14px; line-height: 1.5; color: #1f2937; -webkit-font-smoothing: antialiased;
61
+ }
62
+ .esc-w-fab {
63
+ position: fixed; z-index: 2147483646; width: 56px; height: 56px;
64
+ border-radius: 50%; border: none; cursor: pointer;
65
+ display: flex; align-items: center; justify-content: center;
66
+ box-shadow: 0 4px 12px rgba(0,0,0,0.15);
67
+ transition: transform 0.2s, box-shadow 0.2s; color: #fff;
68
+ }
69
+ .esc-w-fab:hover { transform: scale(1.05); box-shadow: 0 6px 20px rgba(0,0,0,0.2); }
70
+ .esc-w-fab.bottom-right { bottom: 20px; right: 20px; }
71
+ .esc-w-fab.bottom-left { bottom: 20px; left: 20px; }
72
+ .esc-w-fab svg { width: 24px; height: 24px; fill: currentColor; }
73
+ .esc-w-panel {
74
+ position: fixed; z-index: 2147483647;
75
+ width: 380px; max-width: calc(100vw - 24px);
76
+ height: 560px; max-height: calc(100vh - 100px);
77
+ border-radius: 12px; background: #ffffff;
78
+ box-shadow: 0 8px 30px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
79
+ display: flex; flex-direction: column; overflow: hidden;
80
+ transform: scale(0.95) translateY(10px); opacity: 0;
81
+ pointer-events: none; transition: transform 0.25s ease, opacity 0.25s ease;
82
+ }
83
+ .esc-w-panel.esc-open { transform: scale(1) translateY(0); opacity: 1; pointer-events: auto; }
84
+ .esc-w-panel.bottom-right { bottom: 84px; right: 20px; }
85
+ .esc-w-panel.bottom-left { bottom: 84px; left: 20px; }
86
+ @media (max-width: 440px) {
87
+ .esc-w-panel {
88
+ width: calc(100vw - 16px); height: calc(100vh - 80px);
89
+ max-height: calc(100vh - 80px); bottom: 8px !important;
90
+ right: 8px !important; left: 8px !important; border-radius: 10px;
91
+ }
92
+ }
93
+ .esc-w-header { padding: 16px 20px; color: #fff; flex-shrink: 0; }
94
+ .esc-w-header h2 { font-size: 16px; font-weight: 600; margin-bottom: 2px; }
95
+ .esc-w-header p { font-size: 13px; opacity: 0.9; }
96
+ .esc-w-tabs { display: flex; border-bottom: 1px solid #e5e7eb; flex-shrink: 0; background: #f9fafb; }
97
+ .esc-w-tab {
98
+ flex: 1; padding: 10px 8px; font-size: 12px; font-weight: 500;
99
+ text-align: center; border: none; background: none; cursor: pointer;
100
+ color: #6b7280; border-bottom: 2px solid transparent;
101
+ transition: color 0.15s, border-color 0.15s;
102
+ }
103
+ .esc-w-tab:hover { color: #374151; }
104
+ .esc-w-tab.active { color: #1f2937; border-bottom-color: var(--esc-widget-color, #4F46E5); }
105
+ .esc-w-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
106
+ .esc-w-input {
107
+ width: 100%; padding: 8px 12px; border: 1px solid #d1d5db;
108
+ border-radius: 8px; font-size: 13px; outline: none;
109
+ transition: border-color 0.15s; background: #fff; color: #1f2937;
110
+ }
111
+ .esc-w-input:focus { border-color: var(--esc-widget-color, #4F46E5); box-shadow: 0 0 0 2px rgba(79,70,229,0.1); }
112
+ .esc-w-textarea {
113
+ width: 100%; padding: 8px 12px; border: 1px solid #d1d5db;
114
+ border-radius: 8px; font-size: 13px; outline: none;
115
+ resize: vertical; min-height: 80px; font-family: inherit;
116
+ transition: border-color 0.15s; background: #fff; color: #1f2937;
117
+ }
118
+ .esc-w-textarea:focus { border-color: var(--esc-widget-color, #4F46E5); box-shadow: 0 0 0 2px rgba(79,70,229,0.1); }
119
+ .esc-w-select {
120
+ width: 100%; padding: 8px 12px; border: 1px solid #d1d5db;
121
+ border-radius: 8px; font-size: 13px; outline: none;
122
+ background: #fff; color: #1f2937; cursor: pointer;
123
+ }
124
+ .esc-w-select:focus { border-color: var(--esc-widget-color, #4F46E5); }
125
+ .esc-w-label { display: block; font-size: 12px; font-weight: 500; color: #374151; margin-bottom: 4px; }
126
+ .esc-w-field { margin-bottom: 12px; }
127
+ .esc-w-btn {
128
+ width: 100%; padding: 10px 16px; border: none; border-radius: 8px;
129
+ font-size: 13px; font-weight: 600; color: #fff; cursor: pointer; transition: opacity 0.15s;
130
+ }
131
+ .esc-w-btn:hover { opacity: 0.9; }
132
+ .esc-w-btn:disabled { opacity: 0.5; cursor: not-allowed; }
133
+ .esc-w-article { padding: 10px 0; border-bottom: 1px solid #f3f4f6; cursor: pointer; }
134
+ .esc-w-article:last-child { border-bottom: none; }
135
+ .esc-w-article:hover { background: #f9fafb; margin: 0 -20px; padding: 10px 20px; }
136
+ .esc-w-article h4 { font-size: 13px; font-weight: 600; color: #1f2937; margin-bottom: 2px; }
137
+ .esc-w-article p { font-size: 12px; color: #6b7280; }
138
+ .esc-w-back {
139
+ display: inline-flex; align-items: center; gap: 4px; font-size: 12px;
140
+ color: #6b7280; cursor: pointer; margin-bottom: 12px;
141
+ background: none; border: none; padding: 0;
142
+ }
143
+ .esc-w-back:hover { color: #374151; }
144
+ .esc-w-article-detail h3 { font-size: 16px; font-weight: 600; margin-bottom: 12px; color: #1f2937; }
145
+ .esc-w-article-detail .esc-w-article-body { font-size: 13px; line-height: 1.7; color: #374151; }
146
+ .esc-w-article-detail .esc-w-article-body p { margin-bottom: 8px; }
147
+ .esc-w-article-detail .esc-w-article-body a { color: var(--esc-widget-color, #4F46E5); }
148
+ .esc-w-success { text-align: center; padding: 24px 0; }
149
+ .esc-w-success svg { width: 48px; height: 48px; color: #10b981; margin: 0 auto 12px; }
150
+ .esc-w-success h4 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
151
+ .esc-w-success p { font-size: 13px; color: #6b7280; }
152
+ .esc-w-success .esc-w-ref {
153
+ display: inline-block; margin-top: 8px; padding: 4px 12px;
154
+ background: #f0fdf4; border-radius: 6px; font-size: 14px; font-weight: 600; color: #059669;
155
+ }
156
+ .esc-w-status-card { padding: 16px; border-radius: 10px; border: 1px solid #e5e7eb; margin-bottom: 12px; }
157
+ .esc-w-status-card h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
158
+ .esc-w-status-badge {
159
+ display: inline-block; padding: 2px 8px; border-radius: 12px;
160
+ font-size: 11px; font-weight: 600; color: #fff;
161
+ }
162
+ .esc-w-reply { padding: 10px 0; border-bottom: 1px solid #f3f4f6; }
163
+ .esc-w-reply:last-child { border-bottom: none; }
164
+ .esc-w-reply-author { font-size: 12px; font-weight: 600; color: #374151; }
165
+ .esc-w-reply-agent {
166
+ font-size: 10px; padding: 1px 6px; background: #eff6ff;
167
+ color: #3b82f6; border-radius: 4px; margin-left: 4px;
168
+ }
169
+ .esc-w-reply-time { font-size: 11px; color: #9ca3af; }
170
+ .esc-w-reply-body { font-size: 13px; color: #374151; margin-top: 4px; line-height: 1.6; }
171
+ .esc-w-error {
172
+ padding: 8px 12px; background: #fef2f2; border: 1px solid #fecaca;
173
+ border-radius: 8px; font-size: 12px; color: #dc2626; margin-bottom: 12px;
174
+ }
175
+ .esc-w-empty { text-align: center; padding: 24px 0; color: #9ca3af; font-size: 13px; }
176
+ .esc-w-chat-avail {
177
+ display: flex; align-items: center; gap: 8px; padding: 10px 14px;
178
+ background: #f0fdf4; border-radius: 8px; font-size: 13px; color: #166534; margin-bottom: 16px;
179
+ }
180
+ .esc-w-chat-dot-green {
181
+ width: 8px; height: 8px; border-radius: 50%; background: #22c55e; flex-shrink: 0;
182
+ }
183
+ .esc-w-chat-header-bar {
184
+ display: flex; justify-content: space-between; align-items: center;
185
+ padding: 8px 0; margin-bottom: 8px; border-bottom: 1px solid #e5e7eb;
186
+ }
187
+ .esc-w-chat-agent-info { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: #1f2937; }
188
+ .esc-w-chat-agent-avatar {
189
+ width: 28px; height: 28px; border-radius: 50%; background: var(--esc-widget-color, #4F46E5);
190
+ color: #fff; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700;
191
+ }
192
+ .esc-w-chat-header-actions { display: flex; align-items: center; gap: 8px; }
193
+ .esc-w-chat-conn-dot { width: 6px; height: 6px; border-radius: 50%; }
194
+ .esc-w-chat-conn-connected { background: #22c55e; }
195
+ .esc-w-chat-conn-reconnecting { background: #eab308; }
196
+ .esc-w-chat-conn-disconnected { background: #ef4444; }
197
+ .esc-w-chat-end-link { background: none; border: none; color: #6b7280; font-size: 12px; cursor: pointer; }
198
+ .esc-w-chat-end-link:hover { color: #ef4444; }
199
+ .esc-w-chat-messages {
200
+ flex: 1; overflow-y: auto; max-height: 280px; min-height: 120px;
201
+ padding: 8px 0; display: flex; flex-direction: column; gap: 6px;
202
+ }
203
+ .esc-w-chat-bubble-row { display: flex; align-items: flex-end; gap: 6px; }
204
+ .esc-w-chat-bubble-row.esc-w-chat-agent { flex-direction: row-reverse; }
205
+ .esc-w-chat-bubble-row.esc-w-chat-customer { flex-direction: row; }
206
+ .esc-w-chat-avatar-sm {
207
+ width: 24px; height: 24px; border-radius: 50%; background: #e5e7eb;
208
+ display: flex; align-items: center; justify-content: center;
209
+ font-size: 9px; font-weight: 700; color: #6b7280; flex-shrink: 0;
210
+ }
211
+ .esc-w-chat-avatar-agent { background: var(--esc-widget-color, #4F46E5); color: #fff; }
212
+ .esc-w-chat-bubble {
213
+ max-width: 75%; padding: 8px 12px; border-radius: 16px; font-size: 13px; line-height: 1.5; word-break: break-word;
214
+ }
215
+ .esc-w-chat-bubble-customer { background: #f3f4f6; color: #1f2937; border-bottom-left-radius: 4px; }
216
+ .esc-w-chat-bubble-agent { color: #fff; border-bottom-right-radius: 4px; }
217
+ .esc-w-chat-typing { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #9ca3af; padding: 4px 0; }
218
+ .esc-w-chat-typing-dots { display: inline-flex; gap: 3px; }
219
+ .esc-w-chat-typing-dots span {
220
+ width: 5px; height: 5px; border-radius: 50%; background: #9ca3af;
221
+ animation: esc-chat-bounce 1.4s infinite both;
222
+ }
223
+ .esc-w-chat-typing-dots span:nth-child(2) { animation-delay: 0.16s; }
224
+ .esc-w-chat-typing-dots span:nth-child(3) { animation-delay: 0.32s; }
225
+ @keyframes esc-chat-bounce {
226
+ 0%, 80%, 100% { transform: scale(0); }
227
+ 40% { transform: scale(1); }
228
+ }
229
+ .esc-w-chat-input-bar {
230
+ display: flex; gap: 8px; padding-top: 8px; border-top: 1px solid #e5e7eb; margin-top: 8px;
231
+ }
232
+ .esc-w-chat-input {
233
+ flex: 1; padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 20px;
234
+ font-size: 13px; outline: none; background: #fff; color: #1f2937;
235
+ }
236
+ .esc-w-chat-input:focus { border-color: var(--esc-widget-color, #4F46E5); }
237
+ .esc-w-chat-send {
238
+ width: 36px; height: 36px; border-radius: 50%; border: none; color: #fff;
239
+ display: flex; align-items: center; justify-content: center; cursor: pointer;
240
+ transition: opacity 0.15s; flex-shrink: 0;
241
+ }
242
+ .esc-w-chat-send:disabled { opacity: 0.4; cursor: not-allowed; }
243
+ .esc-w-chat-rating { display: flex; justify-content: center; gap: 4px; margin: 12px 0; }
244
+ .esc-w-chat-star { background: none; border: none; cursor: pointer; color: #d1d5db; padding: 2px; transition: color 0.15s; }
245
+ .esc-w-chat-star:hover, .esc-w-chat-star-active { color: #f59e0b; }
246
+ .esc-w-chat-star svg { width: 28px; height: 28px; }
247
+ .esc-w-spinner {
248
+ width: 20px; height: 20px; border: 2px solid #e5e7eb;
249
+ border-top-color: var(--esc-widget-color, #4F46E5);
250
+ border-radius: 50%; animation: esc-spin 0.6s linear infinite; margin: 24px auto;
251
+ }
252
+ @keyframes esc-spin { to { transform: rotate(360deg); } }
253
+ `;
254
+ }
@@ -1,184 +0,0 @@
1
- <script setup>
2
- import EscalatedLayout from '../../../components/EscalatedLayout.vue';
3
- import { useForm } from '@inertiajs/vue3';
4
-
5
- const props = defineProps({
6
- automation: { type: Object, default: null },
7
- });
8
-
9
- const conditionFields = [
10
- { value: 'hours_since_created', label: 'Hours since created' },
11
- { value: 'hours_since_updated', label: 'Hours since updated' },
12
- { value: 'hours_since_assigned', label: 'Hours since assigned' },
13
- { value: 'status', label: 'Status' },
14
- { value: 'priority', label: 'Priority' },
15
- { value: 'assigned', label: 'Assignment' },
16
- ];
17
-
18
- const actionTypes = [
19
- { value: 'change_status', label: 'Change status' },
20
- { value: 'assign', label: 'Assign to agent (ID)' },
21
- { value: 'add_tag', label: 'Add tag (name)' },
22
- { value: 'change_priority', label: 'Change priority' },
23
- { value: 'add_note', label: 'Add internal note' },
24
- ];
25
-
26
- const form = useForm({
27
- name: props.automation?.name || '',
28
- conditions: props.automation?.conditions || [{ field: 'hours_since_updated', operator: '>', value: '' }],
29
- actions: props.automation?.actions || [{ type: 'change_status', value: '' }],
30
- active: props.automation?.active ?? true,
31
- });
32
-
33
- function addCondition() {
34
- form.conditions.push({ field: 'hours_since_updated', operator: '>', value: '' });
35
- }
36
-
37
- function removeCondition(index) {
38
- form.conditions.splice(index, 1);
39
- }
40
-
41
- function addAction() {
42
- form.actions.push({ type: 'change_status', value: '' });
43
- }
44
-
45
- function removeAction(index) {
46
- form.actions.splice(index, 1);
47
- }
48
-
49
- function submit() {
50
- if (props.automation) {
51
- form.put(route('escalated.admin.automations.update', props.automation.id));
52
- } else {
53
- form.post(route('escalated.admin.automations.store'));
54
- }
55
- }
56
- </script>
57
-
58
- <template>
59
- <EscalatedLayout :title="automation ? 'Edit Automation' : 'Create Automation'">
60
- <form class="max-w-2xl space-y-6" @submit.prevent="submit">
61
- <div>
62
- <label class="block text-sm font-medium text-[var(--esc-panel-text-secondary)]">Name</label>
63
- <input
64
- v-model="form.name"
65
- type="text"
66
- required
67
- class="mt-1 w-full rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)] px-3 py-2 text-sm text-[var(--esc-panel-text-secondary)] focus:border-[var(--esc-panel-border-input)] focus:outline-none focus:ring-1 focus:ring-[var(--esc-panel-border-input)]"
68
- />
69
- <p v-if="form.errors.name" class="mt-1 text-xs text-rose-400">{{ form.errors.name }}</p>
70
- </div>
71
-
72
- <!-- Conditions -->
73
- <div>
74
- <label class="mb-2 block text-sm font-medium text-[var(--esc-panel-text-secondary)]"
75
- >Conditions (ALL must match)</label
76
- >
77
- <div class="space-y-2">
78
- <div v-for="(condition, i) in form.conditions" :key="i" class="flex items-center gap-2">
79
- <select
80
- v-model="condition.field"
81
- class="rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)] px-2 py-1.5 text-sm text-[var(--esc-panel-text-secondary)] focus:border-[var(--esc-panel-border-input)] focus:outline-none"
82
- >
83
- <option v-for="f in conditionFields" :key="f.value" :value="f.value">{{ f.label }}</option>
84
- </select>
85
- <select
86
- v-model="condition.operator"
87
- class="w-16 rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)] px-2 py-1.5 text-sm text-[var(--esc-panel-text-secondary)] focus:border-[var(--esc-panel-border-input)] focus:outline-none"
88
- >
89
- <option value=">">&gt;</option>
90
- <option value=">=">&gt;=</option>
91
- <option value="<">&lt;</option>
92
- <option value="<=">&lt;=</option>
93
- <option value="=">=</option>
94
- </select>
95
- <input
96
- v-model="condition.value"
97
- type="text"
98
- placeholder="Value"
99
- class="flex-1 rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)] px-2 py-1.5 text-sm text-[var(--esc-panel-text-secondary)] focus:border-[var(--esc-panel-border-input)] focus:outline-none focus:ring-1 focus:ring-[var(--esc-panel-border-input)]"
100
- />
101
- <button
102
- v-if="form.conditions.length > 1"
103
- type="button"
104
- class="text-rose-400 hover:text-rose-300"
105
- @click="removeCondition(i)"
106
- >
107
- &times;
108
- </button>
109
- </div>
110
- </div>
111
- <button
112
- type="button"
113
- class="mt-2 text-xs text-[var(--esc-panel-text-tertiary)] hover:text-[var(--esc-panel-text-secondary)]"
114
- @click="addCondition"
115
- >
116
- + Add condition
117
- </button>
118
- </div>
119
-
120
- <!-- Actions -->
121
- <div>
122
- <label class="mb-2 block text-sm font-medium text-[var(--esc-panel-text-secondary)]">Actions</label>
123
- <div class="space-y-2">
124
- <div v-for="(action, i) in form.actions" :key="i" class="flex items-center gap-2">
125
- <select
126
- v-model="action.type"
127
- class="rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)] px-2 py-1.5 text-sm text-[var(--esc-panel-text-secondary)] focus:border-[var(--esc-panel-border-input)] focus:outline-none"
128
- >
129
- <option v-for="a in actionTypes" :key="a.value" :value="a.value">{{ a.label }}</option>
130
- </select>
131
- <input
132
- v-model="action.value"
133
- type="text"
134
- placeholder="Value"
135
- class="flex-1 rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)] px-2 py-1.5 text-sm text-[var(--esc-panel-text-secondary)] focus:border-[var(--esc-panel-border-input)] focus:outline-none focus:ring-1 focus:ring-[var(--esc-panel-border-input)]"
136
- />
137
- <button
138
- v-if="form.actions.length > 1"
139
- type="button"
140
- class="text-rose-400 hover:text-rose-300"
141
- @click="removeAction(i)"
142
- >
143
- &times;
144
- </button>
145
- </div>
146
- </div>
147
- <button
148
- type="button"
149
- class="mt-2 text-xs text-[var(--esc-panel-text-tertiary)] hover:text-[var(--esc-panel-text-secondary)]"
150
- @click="addAction"
151
- >
152
- + Add action
153
- </button>
154
- </div>
155
-
156
- <div>
157
- <label class="flex items-center gap-2 text-sm text-[var(--esc-panel-text-secondary)]">
158
- <input
159
- v-model="form.active"
160
- type="checkbox"
161
- class="rounded border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)] text-cyan-500 focus:ring-cyan-500/20"
162
- />
163
- Active
164
- </label>
165
- </div>
166
-
167
- <div class="flex gap-3">
168
- <button
169
- type="submit"
170
- :disabled="form.processing"
171
- class="rounded-lg bg-gradient-to-r from-[var(--esc-panel-accent)] to-[var(--esc-panel-accent-secondary)] px-4 py-2 text-sm font-medium text-white shadow-lg shadow-[var(--esc-panel-bg)]/20 transition-all hover:from-[var(--esc-panel-accent-hover)] hover:to-[var(--esc-panel-accent-secondary-hover)] disabled:opacity-50"
172
- >
173
- {{ automation ? 'Update' : 'Create' }}
174
- </button>
175
- <a
176
- :href="route('escalated.admin.automations.index')"
177
- class="rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-hover)] px-4 py-2 text-sm font-medium text-[var(--esc-panel-text-secondary)] transition-colors hover:bg-[var(--esc-panel-hover)]"
178
- >
179
- Cancel
180
- </a>
181
- </div>
182
- </form>
183
- </EscalatedLayout>
184
- </template>
@@ -1,129 +0,0 @@
1
- <script setup>
2
- import EscalatedLayout from '../../../components/EscalatedLayout.vue';
3
- import { Link, router } from '@inertiajs/vue3';
4
-
5
- defineProps({ automations: Array });
6
-
7
- function destroy(id) {
8
- if (confirm('Delete this automation?')) {
9
- router.delete(route('escalated.admin.automations.destroy', id));
10
- }
11
- }
12
-
13
- function conditionsSummary(automation) {
14
- return (automation.conditions || []).map((c) => `${c.field} ${c.operator} ${c.value}`).join(', ');
15
- }
16
-
17
- function actionsSummary(automation) {
18
- return (automation.actions || []).map((a) => `${a.type}: ${a.value}`).join(', ');
19
- }
20
- </script>
21
-
22
- <template>
23
- <EscalatedLayout title="Automations">
24
- <div class="mb-4 flex justify-end">
25
- <Link
26
- :href="route('escalated.admin.automations.create')"
27
- class="rounded-lg bg-gradient-to-r from-[var(--esc-panel-accent)] to-[var(--esc-panel-accent-secondary)] px-4 py-2 text-sm font-medium text-white shadow-lg shadow-[var(--esc-panel-bg)]/20 transition-all hover:from-[var(--esc-panel-accent-hover)] hover:to-[var(--esc-panel-accent-secondary-hover)]"
28
- >
29
- Add Automation
30
- </Link>
31
- </div>
32
- <div class="overflow-hidden rounded-xl border border-[var(--esc-panel-border)] bg-[var(--esc-panel-surface)]">
33
- <table class="min-w-full divide-y divide-[var(--esc-panel-border)]">
34
- <thead>
35
- <tr class="bg-[var(--esc-panel-hover)]">
36
- <th
37
- class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
38
- >
39
- Name
40
- </th>
41
- <th
42
- class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
43
- >
44
- Conditions
45
- </th>
46
- <th
47
- class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
48
- >
49
- Actions
50
- </th>
51
- <th
52
- class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
53
- >
54
- Active
55
- </th>
56
- <th
57
- class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
58
- >
59
- Last Run
60
- </th>
61
- <th
62
- class="px-4 py-3 text-right text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
63
- >
64
- Actions
65
- </th>
66
- </tr>
67
- </thead>
68
- <tbody class="divide-y divide-[var(--esc-panel-border)]">
69
- <tr v-if="!automations?.length">
70
- <td colspan="6" class="px-4 py-12 text-center">
71
- <svg
72
- class="mx-auto mb-3 h-8 w-8 text-[var(--esc-panel-text-muted)]"
73
- fill="none"
74
- stroke="currentColor"
75
- stroke-width="1.5"
76
- viewBox="0 0 24 24"
77
- >
78
- <path
79
- stroke-linecap="round"
80
- stroke-linejoin="round"
81
- d="M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"
82
- />
83
- </svg>
84
- <p class="text-sm text-[var(--esc-panel-text-muted)]">No automations yet</p>
85
- <p class="mt-1 text-xs text-[var(--esc-panel-text-muted)]">
86
- Create time-based automations to act on idle tickets
87
- </p>
88
- </td>
89
- </tr>
90
- <tr
91
- v-for="automation in automations"
92
- :key="automation.id"
93
- class="transition-colors hover:bg-[var(--esc-panel-hover)]"
94
- >
95
- <td class="px-4 py-3 text-sm font-medium text-[var(--esc-panel-text-secondary)]">
96
- {{ automation.name }}
97
- </td>
98
- <td class="px-4 py-3 text-sm text-[var(--esc-panel-text-tertiary)] max-w-xs truncate">
99
- {{ conditionsSummary(automation) }}
100
- </td>
101
- <td class="px-4 py-3 text-sm text-[var(--esc-panel-text-tertiary)] max-w-xs truncate">
102
- {{ actionsSummary(automation) }}
103
- </td>
104
- <td class="px-4 py-3 text-sm">
105
- <span
106
- :class="automation.active ? 'text-emerald-400' : 'text-[var(--esc-panel-text-muted)]'"
107
- >{{ automation.active ? 'Yes' : 'No' }}</span
108
- >
109
- </td>
110
- <td class="px-4 py-3 text-sm text-[var(--esc-panel-text-tertiary)]">
111
- {{ automation.last_run_at || '---' }}
112
- </td>
113
- <td class="px-4 py-3 text-right text-sm">
114
- <Link
115
- :href="route('escalated.admin.automations.edit', automation.id)"
116
- class="text-[var(--esc-panel-text-secondary)] hover:text-[var(--esc-panel-text)]"
117
- >
118
- Edit
119
- </Link>
120
- <button class="ml-3 text-rose-400 hover:text-rose-300" @click="destroy(automation.id)">
121
- Delete
122
- </button>
123
- </td>
124
- </tr>
125
- </tbody>
126
- </table>
127
- </div>
128
- </EscalatedLayout>
129
- </template>