@escalated-dev/escalated 0.6.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 (187) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +125 -2
  3. package/package.json +40 -5
  4. package/src/components/ActiveChatsPanel.vue +246 -0
  5. package/src/components/ActivityTimeline.stories.js +55 -0
  6. package/src/components/ActivityTimeline.vue +83 -66
  7. package/src/components/AdminDashboard.stories.js +1423 -0
  8. package/src/components/AgentLoadIndicator.stories.js +37 -0
  9. package/src/components/AgentLoadIndicator.vue +49 -0
  10. package/src/components/AgentPerformanceCard.vue +44 -0
  11. package/src/components/ArticleEditor.vue +82 -0
  12. package/src/components/AssigneeSelect.vue +37 -23
  13. package/src/components/AttachmentList.vue +65 -37
  14. package/src/components/AuditLogEntry.vue +95 -0
  15. package/src/components/BulkActionBar.vue +166 -97
  16. package/src/components/CategoryTree.vue +89 -0
  17. package/src/components/ChartWidget.vue +46 -0
  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 -0
  24. package/src/components/CollisionWarning.vue +68 -0
  25. package/src/components/ConditionalFieldRules.vue +135 -0
  26. package/src/components/ContextPanel.vue +66 -0
  27. package/src/components/ContextPanelSection.vue +65 -0
  28. package/src/components/CustomFieldRenderer.vue +159 -0
  29. package/src/components/EscalatedLayout.vue +424 -70
  30. package/src/components/FileDropzone.vue +57 -41
  31. package/src/components/FollowButton.stories.js +30 -0
  32. package/src/components/FollowButton.vue +88 -63
  33. package/src/components/KeyboardShortcutHelp.vue +213 -123
  34. package/src/components/KnowledgePanel.vue +122 -0
  35. package/src/components/KpiCard.stories.js +32 -0
  36. package/src/components/KpiCard.vue +88 -0
  37. package/src/components/MacroDropdown.vue +150 -90
  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 -0
  43. package/src/components/PinnedNotes.vue +129 -90
  44. package/src/components/PluginSlot.vue +68 -62
  45. package/src/components/PresenceIndicator.vue +138 -28
  46. package/src/components/PriorityBadge.stories.js +33 -0
  47. package/src/components/PriorityBadge.vue +46 -39
  48. package/src/components/QuickFilters.vue +65 -49
  49. package/src/components/ReplyComposer.vue +207 -30
  50. package/src/components/ReplyThread.vue +111 -21
  51. package/src/components/ReportChart.vue +395 -0
  52. package/src/components/ReportExportButton.vue +108 -0
  53. package/src/components/SatisfactionRating.vue +180 -128
  54. package/src/components/SaveViewDialog.vue +172 -0
  55. package/src/components/SavedViewSidebar.vue +208 -0
  56. package/src/components/ScheduleEditor.vue +104 -0
  57. package/src/components/SideConversation.vue +165 -0
  58. package/src/components/SideConversationList.vue +147 -0
  59. package/src/components/SkillTagManager.vue +79 -0
  60. package/src/components/SlaComplianceChart.vue +46 -0
  61. package/src/components/SlaTimer.stories.js +35 -0
  62. package/src/components/SlaTimer.vue +62 -49
  63. package/src/components/SnoozeButton.vue +247 -0
  64. package/src/components/StatsCard.stories.js +24 -0
  65. package/src/components/StatsCard.vue +18 -6
  66. package/src/components/StatusBadge.stories.js +53 -0
  67. package/src/components/StatusBadge.vue +78 -46
  68. package/src/components/TagSelect.vue +84 -53
  69. package/src/components/TicketFilters.vue +247 -46
  70. package/src/components/TicketLinkPanel.vue +193 -0
  71. package/src/components/TicketList.vue +536 -74
  72. package/src/components/TicketMergeDialog.vue +157 -0
  73. package/src/components/TicketSidebar.vue +167 -99
  74. package/src/components/TicketSplitDialog.vue +98 -0
  75. package/src/components/TicketTypeSelector.vue +21 -0
  76. package/src/components/TotpInput.stories.js +9 -0
  77. package/src/components/TotpInput.vue +81 -0
  78. package/src/components/TwoFactorSetup.vue +113 -0
  79. package/src/components/VariableTokenInput.vue +111 -0
  80. package/src/components/WorkflowActionConfig.vue +287 -0
  81. package/src/components/WorkflowActionList.vue +350 -0
  82. package/src/components/WorkflowConditionBuilder.vue +265 -0
  83. package/src/components/WorkflowTriggerSelector.vue +125 -0
  84. package/src/composables/useChat.js +187 -0
  85. package/src/composables/useDebouncedSearch.js +38 -0
  86. package/src/composables/useI18n.js +80 -80
  87. package/src/composables/useKeyboardShortcuts.js +46 -46
  88. package/src/composables/useMentions.js +134 -0
  89. package/src/composables/usePluginExtensions.js +159 -67
  90. package/src/composables/usePluginHooks.js +65 -0
  91. package/src/composables/useRealtime.js +182 -0
  92. package/src/defineEscalatedPlugin.js +76 -50
  93. package/src/index.js +77 -28
  94. package/src/locales/ar.json +727 -0
  95. package/src/locales/de.json +678 -430
  96. package/src/locales/en.json +717 -430
  97. package/src/locales/es.json +679 -430
  98. package/src/locales/fr.json +680 -431
  99. package/src/locales/index.js +12 -2
  100. package/src/locales/it.json +727 -0
  101. package/src/locales/ja.json +727 -0
  102. package/src/locales/ko.json +727 -0
  103. package/src/locales/nl.json +727 -0
  104. package/src/locales/pl.json +727 -0
  105. package/src/locales/pt-BR.json +727 -0
  106. package/src/locales/ru.json +727 -0
  107. package/src/locales/tr.json +727 -0
  108. package/src/locales/zh-CN.json +727 -0
  109. package/src/pages/Admin/ApiTokens/Index.vue +381 -217
  110. package/src/pages/Admin/AuditLog/Index.vue +154 -0
  111. package/src/pages/Admin/BusinessHours/Form.vue +172 -0
  112. package/src/pages/Admin/BusinessHours/Index.vue +113 -0
  113. package/src/pages/Admin/CannedResponses/Index.vue +82 -25
  114. package/src/pages/Admin/Capacity/Index.vue +134 -0
  115. package/src/pages/Admin/CustomFields/Form.vue +195 -0
  116. package/src/pages/Admin/CustomFields/Index.vue +134 -0
  117. package/src/pages/Admin/CustomObjects/Form.vue +202 -0
  118. package/src/pages/Admin/CustomObjects/Index.vue +127 -0
  119. package/src/pages/Admin/CustomObjects/Records.vue +228 -0
  120. package/src/pages/Admin/Departments/Form.vue +35 -11
  121. package/src/pages/Admin/Departments/Index.vue +74 -21
  122. package/src/pages/Admin/EscalationRules/Form.vue +86 -25
  123. package/src/pages/Admin/EscalationRules/Index.vue +158 -37
  124. package/src/pages/Admin/Import/Connect.vue +95 -0
  125. package/src/pages/Admin/Import/Index.vue +102 -0
  126. package/src/pages/Admin/Import/Mapping.vue +110 -0
  127. package/src/pages/Admin/Import/Progress.vue +153 -0
  128. package/src/pages/Admin/Import/Review.vue +76 -0
  129. package/src/pages/Admin/KnowledgeBase/Articles/Form.vue +142 -0
  130. package/src/pages/Admin/KnowledgeBase/Articles/Index.vue +195 -0
  131. package/src/pages/Admin/KnowledgeBase/Categories/Index.vue +193 -0
  132. package/src/pages/Admin/Macros/Index.vue +448 -287
  133. package/src/pages/Admin/Plugins/Index.vue +327 -197
  134. package/src/pages/Admin/Reports/AgentDetail.vue +132 -0
  135. package/src/pages/Admin/Reports/AgentMetrics.vue +115 -0
  136. package/src/pages/Admin/Reports/AgentRanking.vue +246 -0
  137. package/src/pages/Admin/Reports/Cohorts.vue +180 -0
  138. package/src/pages/Admin/Reports/Comparison.vue +141 -0
  139. package/src/pages/Admin/Reports/CsatReport.vue +127 -0
  140. package/src/pages/Admin/Reports/Dashboard.vue +226 -0
  141. package/src/pages/Admin/Reports/ResolutionTimes.vue +164 -0
  142. package/src/pages/Admin/Reports/ResponseTimes.vue +164 -0
  143. package/src/pages/Admin/Reports/SlaReport.vue +162 -0
  144. package/src/pages/Admin/Reports/SlaTrends.vue +183 -0
  145. package/src/pages/Admin/Reports.vue +206 -101
  146. package/src/pages/Admin/Roles/Form.vue +71 -0
  147. package/src/pages/Admin/Roles/Index.vue +122 -0
  148. package/src/pages/Admin/Settings/CsatSettings.vue +165 -0
  149. package/src/pages/Admin/Settings/DataRetention.vue +182 -0
  150. package/src/pages/Admin/Settings/EmailSettings.vue +243 -0
  151. package/src/pages/Admin/Settings/Sandbox.vue +135 -0
  152. package/src/pages/Admin/Settings/SsoSettings.vue +218 -0
  153. package/src/pages/Admin/Settings/TwoFactor.vue +110 -0
  154. package/src/pages/Admin/Settings.vue +847 -99
  155. package/src/pages/Admin/Skills/Form.vue +53 -0
  156. package/src/pages/Admin/Skills/Index.vue +94 -0
  157. package/src/pages/Admin/SlaPolicies/Form.vue +62 -19
  158. package/src/pages/Admin/SlaPolicies/Index.vue +85 -23
  159. package/src/pages/Admin/Statuses/Form.vue +114 -0
  160. package/src/pages/Admin/Statuses/Index.vue +153 -0
  161. package/src/pages/Admin/Tags/Index.vue +121 -35
  162. package/src/pages/Admin/Tickets/Index.vue +96 -9
  163. package/src/pages/Admin/Tickets/Show.vue +130 -37
  164. package/src/pages/Admin/Webhooks/DeliveryLog.vue +120 -0
  165. package/src/pages/Admin/Webhooks/Form.vue +110 -0
  166. package/src/pages/Admin/Webhooks/Index.vue +136 -0
  167. package/src/pages/Admin/Workflows/Builder.vue +207 -0
  168. package/src/pages/Admin/Workflows/Index.vue +235 -0
  169. package/src/pages/Admin/Workflows/Logs.vue +286 -0
  170. package/src/pages/Agent/Dashboard.vue +311 -186
  171. package/src/pages/Agent/TicketIndex.vue +80 -6
  172. package/src/pages/Agent/TicketShow.vue +399 -60
  173. package/src/pages/Customer/Create.vue +37 -10
  174. package/src/pages/Customer/Index.vue +9 -2
  175. package/src/pages/Customer/KnowledgeBase/Article.vue +129 -0
  176. package/src/pages/Customer/KnowledgeBase/Index.vue +151 -0
  177. package/src/pages/Customer/Show.vue +69 -63
  178. package/src/pages/Guest/Create.vue +40 -15
  179. package/src/pages/Guest/Show.vue +124 -93
  180. package/src/plugin.js +111 -1
  181. package/src/utils/constants.js +30 -0
  182. package/src/utils/formatting.js +35 -0
  183. package/src/utils/mentionHighlight.js +24 -0
  184. package/src/utils/sanitizeHtml.js +78 -64
  185. package/src/widget/EscalatedWidget.vue +804 -0
  186. package/src/widget/index.js +254 -0
  187. package/src/pages/Admin/Plugins.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,129 +0,0 @@
1
- <script setup>
2
- import EscalatedLayout from '../../components/EscalatedLayout.vue';
3
- import { useForm, usePage, router } from '@inertiajs/vue3';
4
- import { computed } from 'vue';
5
-
6
- const props = defineProps({ plugins: Array });
7
- const page = usePage();
8
-
9
- const flash = computed(() => ({
10
- success: page.props.flash?.success,
11
- error: page.props.flash?.error,
12
- }));
13
-
14
- const uploadForm = useForm({
15
- plugin: null,
16
- });
17
-
18
- function onFileChange(e) {
19
- uploadForm.plugin = e.target.files[0];
20
- }
21
-
22
- function submitUpload() {
23
- uploadForm.post(route('escalated.admin.plugins.upload'), {
24
- forceFormData: true,
25
- onSuccess: () => {
26
- uploadForm.reset();
27
- },
28
- });
29
- }
30
-
31
- function activate(slug) {
32
- router.post(route('escalated.admin.plugins.activate', slug));
33
- }
34
-
35
- function deactivate(slug) {
36
- router.post(route('escalated.admin.plugins.deactivate', slug));
37
- }
38
-
39
- function deletePlugin(slug) {
40
- if (confirm('Are you sure you want to delete this plugin? This cannot be undone.')) {
41
- router.delete(route('escalated.admin.plugins.destroy', slug));
42
- }
43
- }
44
- </script>
45
-
46
- <template>
47
- <EscalatedLayout title="Plugins">
48
- <div class="mx-auto max-w-4xl space-y-6">
49
- <!-- Flash messages -->
50
- <div v-if="flash.success" class="rounded-lg border border-emerald-500/20 bg-emerald-500/10 px-4 py-3 text-sm text-emerald-400">
51
- {{ flash.success }}
52
- </div>
53
- <div v-if="flash.error" class="rounded-lg border border-red-500/20 bg-red-500/10 px-4 py-3 text-sm text-red-400">
54
- {{ flash.error }}
55
- </div>
56
-
57
- <!-- Upload Plugin -->
58
- <div class="rounded-xl border border-white/[0.06] bg-neutral-900/60 p-6">
59
- <h3 class="mb-4 text-sm font-semibold text-white">Upload Plugin</h3>
60
- <form @submit.prevent="submitUpload" class="flex items-end gap-4">
61
- <div class="flex-1">
62
- <label class="block text-sm font-medium text-neutral-200">Plugin ZIP File</label>
63
- <input type="file" accept=".zip" @change="onFileChange"
64
- class="mt-2 w-full rounded-lg border border-white/10 bg-neutral-950 px-3 py-2 text-sm text-neutral-200 file:mr-3 file:rounded file:border-0 file:bg-white/10 file:px-3 file:py-1 file:text-sm file:text-neutral-300 focus:border-white/20 focus:outline-none focus:ring-1 focus:ring-white/10" />
65
- <p v-if="uploadForm.errors.plugin" class="mt-1 text-xs text-red-400">{{ uploadForm.errors.plugin }}</p>
66
- </div>
67
- <button type="submit" :disabled="uploadForm.processing || !uploadForm.plugin"
68
- class="shrink-0 rounded-lg bg-gradient-to-r from-cyan-500 to-violet-500 px-5 py-2 text-sm font-medium text-white shadow-lg shadow-black/20 transition-all hover:from-cyan-400 hover:to-violet-400 disabled:opacity-50">
69
- {{ uploadForm.processing ? 'Uploading...' : 'Upload' }}
70
- </button>
71
- </form>
72
- </div>
73
-
74
- <!-- Plugin List -->
75
- <div class="rounded-xl border border-white/[0.06] bg-neutral-900/60 p-6">
76
- <h3 class="mb-5 text-sm font-semibold text-white">Installed Plugins</h3>
77
-
78
- <div v-if="!plugins || plugins.length === 0" class="py-8 text-center text-sm text-neutral-500">
79
- No plugins installed yet.
80
- </div>
81
-
82
- <div v-else class="divide-y divide-white/[0.06]">
83
- <div v-for="plugin in plugins" :key="plugin.slug" class="flex items-start justify-between gap-4 py-4 first:pt-0 last:pb-0">
84
- <!-- Plugin info -->
85
- <div class="min-w-0 flex-1">
86
- <div class="flex items-center gap-2.5">
87
- <span class="text-sm font-medium text-white">{{ plugin.name }}</span>
88
- <span class="rounded bg-white/[0.06] px-1.5 py-0.5 text-[10px] font-medium text-neutral-500">
89
- v{{ plugin.version }}
90
- </span>
91
- <span :class="[
92
- 'rounded px-1.5 py-0.5 text-[10px] font-medium',
93
- plugin.source === 'composer'
94
- ? 'bg-violet-500/10 text-violet-400'
95
- : 'bg-cyan-500/10 text-cyan-400'
96
- ]">
97
- {{ plugin.source }}
98
- </span>
99
- </div>
100
- <p v-if="plugin.description" class="mt-1 text-xs text-neutral-500">{{ plugin.description }}</p>
101
- <p class="mt-1 text-xs text-neutral-600">by {{ plugin.author }}</p>
102
- </div>
103
-
104
- <!-- Actions -->
105
- <div class="flex shrink-0 items-center gap-2">
106
- <!-- Active status toggle -->
107
- <button v-if="plugin.is_active" @click="deactivate(plugin.slug)"
108
- class="rounded-lg border border-emerald-500/20 bg-emerald-500/10 px-3 py-1.5 text-xs font-medium text-emerald-400 transition-colors hover:bg-emerald-500/20">
109
- Active
110
- </button>
111
- <button v-else @click="activate(plugin.slug)"
112
- class="rounded-lg border border-white/10 bg-white/[0.04] px-3 py-1.5 text-xs font-medium text-neutral-500 transition-colors hover:bg-white/[0.08] hover:text-neutral-300">
113
- Inactive
114
- </button>
115
-
116
- <!-- Delete (local only) -->
117
- <button v-if="plugin.source === 'local'" @click="deletePlugin(plugin.slug)"
118
- class="rounded-lg border border-white/10 bg-white/[0.04] p-1.5 text-neutral-600 transition-colors hover:border-red-500/20 hover:bg-red-500/10 hover:text-red-400">
119
- <svg class="h-4 w-4" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24">
120
- <path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" />
121
- </svg>
122
- </button>
123
- </div>
124
- </div>
125
- </div>
126
- </div>
127
- </div>
128
- </EscalatedLayout>
129
- </template>