@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
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Escalated Dev
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Escalated Dev
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,14 +1,50 @@
1
+ <p align="center">
2
+ <a href="docs/translations/README.ar.md">العربية</a> •
3
+ <a href="docs/translations/README.de.md">Deutsch</a> •
4
+ <b>English</b> •
5
+ <a href="docs/translations/README.es.md">Español</a> •
6
+ <a href="docs/translations/README.fr.md">Français</a> •
7
+ <a href="docs/translations/README.it.md">Italiano</a> •
8
+ <a href="docs/translations/README.ja.md">日本語</a> •
9
+ <a href="docs/translations/README.ko.md">한국어</a> •
10
+ <a href="docs/translations/README.nl.md">Nederlands</a> •
11
+ <a href="docs/translations/README.pl.md">Polski</a> •
12
+ <a href="docs/translations/README.pt-BR.md">Português (BR)</a> •
13
+ <a href="docs/translations/README.ru.md">Русский</a> •
14
+ <a href="docs/translations/README.tr.md">Türkçe</a> •
15
+ <a href="docs/translations/README.zh-CN.md">简体中文</a>
16
+ </p>
17
+
1
18
  <h1>
2
19
  <img src="https://escalated.dev/apple-touch-icon.png" width="28" style="vertical-align:middle;" />
3
20
  Escalated
4
21
  </h1>
5
22
 
23
+ [![Tests](https://github.com/escalated-dev/escalated/actions/workflows/run-tests.yml/badge.svg)](https://github.com/escalated-dev/escalated/actions/workflows/run-tests.yml)
24
+ [![npm](https://img.shields.io/npm/v/@escalated-dev/escalated)](https://www.npmjs.com/package/@escalated-dev/escalated)
25
+ [![Vue 3](https://img.shields.io/badge/vue-3.x-4FC08D?logo=vue.js&logoColor=white)](https://vuejs.org/)
26
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
27
+
28
+ <p align="center">
29
+ <img src=".github/profile/demo.gif" alt="Escalated demo: filing a ticket and replying from the agent inbox" width="800" />
30
+ </p>
31
+
6
32
  Escalated is an embeddable support ticket system with SLA tracking, escalation rules, agent workflows, and a customer portal. This repo contains all the shared frontend assets (Vue 3 + Inertia.js) used across every supported backend framework.
7
33
 
8
34
  👉 **Learn more, view demos, and compare Cloud vs Self-Hosted options at** **[https://escalated.dev](https://escalated.dev)**
9
35
 
10
36
  **You don't install this package directly.** Start with the backend package for your framework — it handles everything including pulling in these frontend assets.
11
37
 
38
+ ## Features
39
+
40
+ - **Ticket splitting** — Split a reply into a new standalone ticket while preserving context
41
+ - **Ticket snooze** — Snooze tickets with presets (1h, 4h, tomorrow, next week) and automatic wake
42
+ - **Saved views / custom queues** — Save, name, and share filter presets as reusable ticket views
43
+ - **Embeddable support widget** — Drop-in `<script>` widget with KB search, ticket form, and status check
44
+ - **Real-time updates** — WebSocket support (Pusher/Reverb/Soketi) with automatic polling fallback
45
+ - **Knowledge base toggle** — Enable or disable the public knowledge base from admin settings
46
+ - **CI: ESLint + Prettier** — Automated code style enforcement on every pull request
47
+
12
48
  ## Get Started
13
49
 
14
50
  Pick your framework:
@@ -19,6 +55,10 @@ Pick your framework:
19
55
  | **Rails** | [escalated-dev/escalated-rails](https://github.com/escalated-dev/escalated-rails) | `gem "escalated"` |
20
56
  | **Django** | [escalated-dev/escalated-django](https://github.com/escalated-dev/escalated-django) | `pip install escalated-django` |
21
57
  | **AdonisJS** | [escalated-dev/escalated-adonis](https://github.com/escalated-dev/escalated-adonis) | `npm install @escalated-dev/escalated-adonis` |
58
+ | **WordPress** | [escalated-dev/escalated-wordpress](https://github.com/escalated-dev/escalated-wordpress) | [Download escalated.zip](https://github.com/escalated-dev/escalated-wordpress/releases/latest) |
59
+ | **Filament** | [escalated-dev/escalated-filament](https://github.com/escalated-dev/escalated-filament) | `composer require escalated-dev/escalated-filament` |
60
+ | **React Native** | [escalated-dev/escalated-react-native](https://github.com/escalated-dev/escalated-react-native) | `npm install @escalated-dev/escalated-react-native` |
61
+ | **Flutter** | [escalated-dev/escalated-flutter](https://github.com/escalated-dev/escalated-flutter) | See [pubspec.yaml setup](https://github.com/escalated-dev/escalated-flutter#quick-start) |
22
62
 
23
63
  Each backend repo has full setup instructions — install command, migrations, config, and frontend integration.
24
64
 
@@ -127,12 +167,31 @@ All the Vue 3 + Inertia.js components that power the Escalated UI. These are ide
127
167
 
128
168
  ## 📸 Screenshots
129
169
 
170
+ > Screenshots are auto-generated from Storybook via the [component-screenshots](.github/workflows/screenshots.yml) workflow.
171
+
130
172
  <p align="center">
131
- <img src="docs/assets/escalated_admin_1.png" alt="Escalated Admin Screenshot 1" width="800" />
173
+ <strong>Admin Panel (Dark)</strong><br/>
174
+ <img src="docs/assets/escalated_admin_1.png" alt="Escalated Admin Panel — dark mode with sidebar navigation, KPI cards, stats, and ticket list" width="800" />
132
175
  </p>
133
176
 
134
177
  <p align="center">
135
- <img src="docs/assets/escalated_admin_2.png" alt="Escalated Admin Screenshot 2" width="800" />
178
+ <strong>Admin Panel (Light)</strong><br/>
179
+ <img src="docs/assets/escalated_admin_3.png" alt="Escalated Admin Panel — light mode with sidebar navigation, KPI cards, stats, and ticket list" width="800" />
180
+ </p>
181
+
182
+ <p align="center">
183
+ <strong>Ticket Queue</strong><br/>
184
+ <img src="docs/assets/escalated_ticket_list.png" alt="Escalated Ticket Queue — agent ticket list with filters, search, bulk actions, and SLA indicators" width="800" />
185
+ </p>
186
+
187
+ <p align="center">
188
+ <strong>Agent Panel</strong><br/>
189
+ <img src="docs/assets/escalated_admin_2.png" alt="Escalated Agent Panel — top navigation, stats, and assigned ticket queue" width="800" />
190
+ </p>
191
+
192
+ <p align="center">
193
+ <strong>Ticket Detail View</strong><br/>
194
+ <img src="docs/assets/escalated_ticket_view.png" alt="Escalated Ticket Detail View — conversation thread, reply composer, and ticket sidebar with SLA timer" width="800" />
136
195
  </p>
137
196
 
138
197
  ### Pages
@@ -197,6 +256,70 @@ Reusable building blocks used across the pages above.
197
256
  |--------|-------------|
198
257
  | `EscalatedPlugin` | Vue plugin for layout injection and CSS theming |
199
258
 
259
+ ## Plugin Development
260
+
261
+ Escalated supports framework-agnostic plugins built with the [Plugin SDK](https://github.com/escalated-dev/escalated-plugin-sdk). Plugins are written once in TypeScript and work across all Escalated backends.
262
+
263
+ ### How the Frontend Plugin System Works
264
+
265
+ The frontend uses `defineEscalatedPlugin()` to register Vue components — custom admin pages, ticket sidebar widgets, or dashboard panels — that are mounted automatically when the plugin is active.
266
+
267
+ ```typescript
268
+ import { defineEscalatedPlugin } from '@escalated-dev/escalated'
269
+ import MySettingsPage from './MySettingsPage.vue'
270
+
271
+ export default defineEscalatedPlugin({
272
+ name: 'my-plugin',
273
+ pages: {
274
+ 'admin/my-plugin/settings': MySettingsPage,
275
+ },
276
+ })
277
+ ```
278
+
279
+ ### How It Connects to the Backend
280
+
281
+ The backend uses `definePlugin()` from the [Plugin SDK](https://github.com/escalated-dev/escalated-plugin-sdk) to handle TypeScript business logic — subscribing to ticket lifecycle hooks, exposing API endpoints, and persisting data. The frontend and backend entries work together as a single npm package.
282
+
283
+ ```typescript
284
+ // backend entry (index.ts)
285
+ import { definePlugin } from '@escalated-dev/plugin-sdk'
286
+
287
+ export default definePlugin({
288
+ name: 'my-plugin',
289
+ version: '1.0.0',
290
+ actions: {
291
+ 'ticket.created': async (event, ctx) => {
292
+ ctx.log.info('New ticket!', event)
293
+ },
294
+ },
295
+ })
296
+ ```
297
+
298
+ ### Quick Example: Both Entry Points
299
+
300
+ A published plugin package typically exports both:
301
+
302
+ ```
303
+ my-plugin/
304
+ index.ts ← backend: definePlugin() for TypeScript logic
305
+ frontend.ts ← frontend: defineEscalatedPlugin() for Vue components
306
+ ```
307
+
308
+ The backend framework (Laravel, Rails, Django, AdonisJS) loads `index.ts` via the [Plugin Runtime](https://github.com/escalated-dev/escalated-plugin-runtime). The Vue app imports `frontend.ts` and registers it with `app.use()`.
309
+
310
+ ### Installing Plugins
311
+
312
+ ```bash
313
+ npm install @escalated-dev/plugin-slack
314
+ npm install @escalated-dev/plugin-jira
315
+ ```
316
+
317
+ ### Resources
318
+
319
+ - [Plugin SDK](https://github.com/escalated-dev/escalated-plugin-sdk) — TypeScript SDK for building plugins
320
+ - [Plugin Runtime](https://github.com/escalated-dev/escalated-plugin-runtime) — Runtime host for plugins
321
+ - [Plugin Development Guide](https://github.com/escalated-dev/escalated-docs) — Full documentation
322
+
200
323
  ## For Package Maintainers
201
324
 
202
325
  If you're building a new backend integration, this package is available on npm:
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@escalated-dev/escalated",
3
- "version": "0.6.0",
4
- "description": "Vue 3 + Inertia.js UI components for Escalated — the embeddable support ticket system",
3
+ "version": "0.7.1",
4
+ "description": "Vue 3 + Inertia.js UI components for Escalated \u00e2\u20ac\u201d the embeddable support ticket system",
5
5
  "author": "Escalated Dev <hello@escalated.dev>",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/escalated-dev/escalated",
@@ -29,18 +29,53 @@
29
29
  "src"
30
30
  ],
31
31
  "peerDependencies": {
32
- "@inertiajs/vue3": "^1.0.0 || ^2.0.0",
32
+ "@inertiajs/vue3": "^1.0.0 || ^2.0.0 || ^3.0.0",
33
33
  "vue": "^3.3.0"
34
34
  },
35
35
  "scripts": {
36
- "test": "vitest run"
36
+ "test": "vitest run",
37
+ "lint": "eslint src/ --max-warnings 0",
38
+ "lint:fix": "eslint src/ --fix",
39
+ "format": "prettier --write src/",
40
+ "format:check": "prettier --check src/",
41
+ "prepare": "husky",
42
+ "storybook": "storybook dev -p 6006",
43
+ "build-storybook": "storybook build",
44
+ "screenshot": "npx playwright test --config=playwright-screenshots.config.js",
45
+ "demo:serve": "node scripts/demo-server.js",
46
+ "demo:record": "node scripts/generate-demo.js",
47
+ "demo": "concurrently -k -s second \"npm run demo:serve\" \"wait-on http://localhost:3000 && npm run demo:record\""
48
+ },
49
+ "lint-staged": {
50
+ "*.{js,vue}": [
51
+ "eslint --fix",
52
+ "prettier --write"
53
+ ]
37
54
  },
38
55
  "devDependencies": {
56
+ "@eslint/js": "^10.0.1",
39
57
  "@inertiajs/vue3": "^2.0.0",
58
+ "@playwright/test": "^1.50.0",
59
+ "@storybook/addon-a11y": "^10.2.12",
60
+ "@storybook/addon-docs": "^10.2.12",
61
+ "@storybook/vue3-vite": "^10.2.12",
40
62
  "@vitejs/plugin-vue": "^5.0.0",
41
63
  "@vue/test-utils": "^2.4.0",
64
+ "autoprefixer": "^10.4.20",
65
+ "concurrently": "^9.0.0",
66
+ "eslint": "^10.0.1",
67
+ "eslint-plugin-storybook": "^10.2.12",
68
+ "eslint-plugin-vue": "^10.8.0",
42
69
  "happy-dom": "^15.0.0",
70
+ "husky": "^9.1.7",
71
+ "lint-staged": "^16.2.7",
72
+ "playwright": "^1.50.0",
73
+ "postcss": "^8.5.0",
74
+ "prettier": "^3.8.1",
75
+ "storybook": "^10.2.12",
76
+ "tailwindcss": "^3.4.0",
43
77
  "vitest": "^2.0.0",
44
- "vue": "^3.5.0"
78
+ "vue": "^3.5.0",
79
+ "wait-on": "^8.0.0"
45
80
  }
46
81
  }
@@ -0,0 +1,246 @@
1
+ <script setup>
2
+ import { ref, computed, inject, onMounted, onUnmounted } from 'vue';
3
+ import { usePage } from '@inertiajs/vue3';
4
+ import { useI18n } from '../composables/useI18n';
5
+ import { useChat } from '../composables/useChat';
6
+ import { timeAgo } from '../utils/formatting';
7
+
8
+ const props = defineProps({
9
+ chats: { type: Array, default: () => [] },
10
+ agentId: { type: [String, Number], default: null },
11
+ agentStatus: { type: String, default: 'online' },
12
+ navigateRoute: { type: String, default: '' },
13
+ });
14
+
15
+ const emit = defineEmits(['navigate', 'status-change']);
16
+
17
+ const escDark = inject(
18
+ 'esc-dark',
19
+ computed(() => false),
20
+ );
21
+ const { t } = useI18n();
22
+
23
+ const isOpen = ref(false);
24
+ const currentStatus = ref(props.agentStatus);
25
+
26
+ const statusOptions = [
27
+ { value: 'online', label: 'Online', color: 'bg-emerald-500' },
28
+ { value: 'away', label: 'Away', color: 'bg-amber-500' },
29
+ { value: 'offline', label: 'Offline', color: 'bg-neutral-500' },
30
+ ];
31
+
32
+ const currentStatusOption = computed(
33
+ () => statusOptions.find((s) => s.value === currentStatus.value) || statusOptions[0],
34
+ );
35
+
36
+ function changeStatus(status) {
37
+ currentStatus.value = status;
38
+ emit('status-change', status);
39
+ }
40
+
41
+ const totalUnread = computed(() => {
42
+ return props.chats.reduce((sum, chat) => sum + (chat.unread_count || 0), 0);
43
+ });
44
+
45
+ // Activity state for each chat
46
+ const now = ref(Date.now());
47
+ let timerInterval = null;
48
+
49
+ onMounted(() => {
50
+ timerInterval = setInterval(() => {
51
+ now.value = Date.now();
52
+ }, 10000);
53
+ });
54
+
55
+ onUnmounted(() => {
56
+ clearInterval(timerInterval);
57
+ });
58
+
59
+ function chatActivityState(chat) {
60
+ if (!chat.last_message_at) return 'new';
61
+ const diffMs = now.value - new Date(chat.last_message_at).getTime();
62
+ if (diffMs > 2 * 60 * 1000) return 'idle';
63
+ return 'active';
64
+ }
65
+
66
+ function activityDotClass(chat) {
67
+ const state = chatActivityState(chat);
68
+ if (state === 'new') return 'bg-blue-500 animate-pulse';
69
+ if (state === 'idle') return 'bg-amber-500';
70
+ return 'bg-emerald-500';
71
+ }
72
+
73
+ function navigateToChat(chat) {
74
+ emit('navigate', chat);
75
+ }
76
+
77
+ function truncate(str, len = 40) {
78
+ if (!str) return '';
79
+ return str.length > len ? str.slice(0, len) + '...' : str;
80
+ }
81
+
82
+ function chatInitials(chat) {
83
+ const name = chat.customer_name || 'U';
84
+ return name
85
+ .split(' ')
86
+ .map((w) => w[0])
87
+ .join('')
88
+ .toUpperCase()
89
+ .slice(0, 2);
90
+ }
91
+
92
+ // Real-time: listen for new chats assigned to this agent. Read the
93
+ // host framework's route prefix from Inertia page props (default
94
+ // 'support') so chat API calls resolve correctly on NestJS backends
95
+ // that use '/escalated/widget' instead of '/support/widget'.
96
+ const page = usePage();
97
+ const routePrefix = page.props.escalated?.prefix || 'support';
98
+ const { subscribeToChatQueue } = useChat({ widgetPath: `/${routePrefix}/widget` });
99
+
100
+ onMounted(() => {
101
+ subscribeToChatQueue({
102
+ onNewChat() {
103
+ // Parent should refresh chat list
104
+ },
105
+ });
106
+ });
107
+ </script>
108
+
109
+ <template>
110
+ <!-- Toggle button -->
111
+ <button
112
+ :class="[
113
+ 'fixed right-4 bottom-20 z-40 flex h-12 w-12 items-center justify-center rounded-full shadow-lg transition-all',
114
+ escDark
115
+ ? 'bg-gradient-to-r from-cyan-500 to-violet-500 text-white hover:from-cyan-400 hover:to-violet-400'
116
+ : 'bg-blue-600 text-white hover:bg-blue-500',
117
+ ]"
118
+ :aria-label="isOpen ? t('chat.close_panel') : t('chat.open_panel')"
119
+ @click="isOpen = !isOpen"
120
+ >
121
+ <svg class="h-5 w-5" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">
122
+ <path
123
+ stroke-linecap="round"
124
+ stroke-linejoin="round"
125
+ d="M8.625 12a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H8.25m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H12m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0h-.375M21 12c0 4.556-4.03 8.25-9 8.25a9.764 9.764 0 01-2.555-.337A5.972 5.972 0 015.41 20.97a5.969 5.969 0 01-.474-.065 4.48 4.48 0 00.978-2.025c.09-.457-.133-.901-.467-1.226C3.93 16.178 3 14.189 3 12c0-4.556 4.03-8.25 9-8.25s9 3.694 9 8.25z"
126
+ />
127
+ </svg>
128
+ <!-- Unread badge -->
129
+ <span
130
+ v-if="totalUnread > 0"
131
+ class="absolute -right-1 -top-1 flex h-5 min-w-[20px] items-center justify-center rounded-full bg-rose-500 px-1 text-[10px] font-bold text-white"
132
+ >
133
+ {{ totalUnread > 99 ? '99+' : totalUnread }}
134
+ </span>
135
+ </button>
136
+
137
+ <!-- Panel -->
138
+ <div
139
+ v-if="isOpen"
140
+ :class="[
141
+ 'fixed right-4 bottom-36 z-40 w-80 rounded-xl border shadow-2xl',
142
+ escDark ? 'border-white/[0.08] bg-neutral-900' : 'border-gray-200 bg-white',
143
+ ]"
144
+ style="max-height: calc(100vh - 200px)"
145
+ >
146
+ <!-- Header -->
147
+ <div
148
+ :class="[
149
+ 'flex items-center justify-between border-b px-4 py-3',
150
+ escDark ? 'border-white/[0.06]' : 'border-gray-200',
151
+ ]"
152
+ >
153
+ <div class="flex items-center gap-2">
154
+ <h3 :class="['text-sm font-semibold', escDark ? 'text-white' : 'text-gray-900']">
155
+ {{ t('chat.active_chats') }}
156
+ </h3>
157
+ <span
158
+ v-if="chats.length"
159
+ :class="[
160
+ 'rounded-full px-1.5 py-0.5 text-[10px] font-medium',
161
+ escDark ? 'bg-white/[0.06] text-neutral-400' : 'bg-gray-100 text-gray-500',
162
+ ]"
163
+ >
164
+ {{ chats.length }}
165
+ </span>
166
+ </div>
167
+ <!-- Status dropdown -->
168
+ <div class="relative">
169
+ <button
170
+ :class="[
171
+ 'flex items-center gap-1.5 rounded-lg px-2 py-1 text-xs font-medium transition-colors',
172
+ escDark ? 'hover:bg-white/[0.06] text-neutral-400' : 'hover:bg-gray-100 text-gray-500',
173
+ ]"
174
+ @click="
175
+ const idx = statusOptions.findIndex((s) => s.value === currentStatus);
176
+ changeStatus(statusOptions[(idx + 1) % statusOptions.length].value);
177
+ "
178
+ >
179
+ <span :class="['h-2 w-2 rounded-full', currentStatusOption.color]"></span>
180
+ {{ currentStatusOption.label }}
181
+ </button>
182
+ </div>
183
+ </div>
184
+
185
+ <!-- Chat list -->
186
+ <div class="overflow-y-auto" style="max-height: 400px">
187
+ <div
188
+ v-if="!chats.length"
189
+ :class="['p-6 text-center text-sm', escDark ? 'text-neutral-600' : 'text-gray-400']"
190
+ >
191
+ {{ t('chat.no_active_chats') }}
192
+ </div>
193
+ <button
194
+ v-for="chat in chats"
195
+ :key="chat.id"
196
+ :class="[
197
+ 'flex w-full items-start gap-3 px-4 py-3 text-left transition-colors',
198
+ escDark ? 'hover:bg-white/[0.04]' : 'hover:bg-gray-50',
199
+ ]"
200
+ @click="navigateToChat(chat)"
201
+ >
202
+ <!-- Avatar with status dot -->
203
+ <div class="relative flex-shrink-0">
204
+ <div
205
+ :class="[
206
+ 'flex h-9 w-9 items-center justify-center rounded-full text-xs font-semibold',
207
+ escDark ? 'bg-neutral-800 text-neutral-300' : 'bg-gray-200 text-gray-600',
208
+ ]"
209
+ >
210
+ {{ chatInitials(chat) }}
211
+ </div>
212
+ <span
213
+ :class="[
214
+ 'absolute -bottom-0.5 -right-0.5 h-3 w-3 rounded-full border-2',
215
+ escDark ? 'border-neutral-900' : 'border-white',
216
+ activityDotClass(chat),
217
+ ]"
218
+ ></span>
219
+ </div>
220
+
221
+ <!-- Chat info -->
222
+ <div class="min-w-0 flex-1">
223
+ <div class="flex items-center justify-between">
224
+ <span :class="['truncate text-sm font-medium', escDark ? 'text-neutral-200' : 'text-gray-900']">
225
+ {{ chat.customer_name || t('ticket.unknown') }}
226
+ </span>
227
+ <span :class="['flex-shrink-0 text-[10px]', escDark ? 'text-neutral-600' : 'text-gray-400']">
228
+ {{ chat.last_message_at ? timeAgo(chat.last_message_at) : '' }}
229
+ </span>
230
+ </div>
231
+ <div class="flex items-center justify-between">
232
+ <span :class="['truncate text-xs', escDark ? 'text-neutral-500' : 'text-gray-500']">
233
+ {{ truncate(chat.last_message) }}
234
+ </span>
235
+ <span
236
+ v-if="chat.unread_count"
237
+ class="ml-2 flex h-4 min-w-[16px] flex-shrink-0 items-center justify-center rounded-full bg-cyan-500 px-1 text-[10px] font-bold text-white"
238
+ >
239
+ {{ chat.unread_count }}
240
+ </span>
241
+ </div>
242
+ </div>
243
+ </button>
244
+ </div>
245
+ </div>
246
+ </template>
@@ -0,0 +1,55 @@
1
+ import ActivityTimeline from './ActivityTimeline.vue';
2
+
3
+ export default {
4
+ title: 'Components/ActivityTimeline',
5
+ component: ActivityTimeline,
6
+ };
7
+
8
+ const sampleActivities = [
9
+ {
10
+ id: 1,
11
+ type: 'status_changed',
12
+ causer: { name: 'Alice Chen' },
13
+ properties: { from: 'open', to: 'in_progress' },
14
+ created_at: new Date(Date.now() - 300000).toISOString(),
15
+ },
16
+ {
17
+ id: 2,
18
+ type: 'assigned',
19
+ causer: { name: 'Bob Smith' },
20
+ properties: { agent_name: 'Alice Chen' },
21
+ created_at: new Date(Date.now() - 600000).toISOString(),
22
+ },
23
+ {
24
+ id: 3,
25
+ type: 'priority_changed',
26
+ causer: { name: 'Alice Chen' },
27
+ properties: { from: 'medium', to: 'high' },
28
+ created_at: new Date(Date.now() - 1200000).toISOString(),
29
+ },
30
+ {
31
+ id: 4,
32
+ type: 'tag_added',
33
+ causer: { name: 'Alice Chen' },
34
+ properties: { tag: 'billing' },
35
+ created_at: new Date(Date.now() - 1800000).toISOString(),
36
+ },
37
+ {
38
+ id: 5,
39
+ type: 'replied',
40
+ causer: { name: 'Alice Chen' },
41
+ properties: {},
42
+ created_at: new Date(Date.now() - 2400000).toISOString(),
43
+ },
44
+ {
45
+ id: 6,
46
+ type: 'sla_breached',
47
+ causer: null,
48
+ properties: {},
49
+ created_at: new Date(Date.now() - 3600000).toISOString(),
50
+ },
51
+ ];
52
+
53
+ export const Default = { args: { activities: sampleActivities } };
54
+ export const Empty = { args: { activities: [] } };
55
+ export const SingleItem = { args: { activities: [sampleActivities[0]] } };