@escalated-dev/escalated 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +102 -0
- package/package.json +37 -6
- package/src/components/ActivityTimeline.stories.js +55 -0
- package/src/components/ActivityTimeline.vue +83 -66
- package/src/components/AdminDashboard.stories.js +1095 -0
- package/src/components/AgentLoadIndicator.stories.js +37 -0
- package/src/components/AgentLoadIndicator.vue +49 -0
- package/src/components/AgentPerformanceCard.vue +44 -0
- package/src/components/ArticleEditor.vue +82 -0
- package/src/components/AssigneeSelect.vue +37 -23
- package/src/components/AttachmentList.vue +53 -37
- package/src/components/AuditLogEntry.vue +95 -0
- package/src/components/BulkActionBar.vue +99 -30
- package/src/components/CategoryTree.vue +89 -0
- package/src/components/ChartWidget.vue +46 -0
- package/src/components/CollisionWarning.stories.js +30 -0
- package/src/components/CollisionWarning.vue +68 -0
- package/src/components/ConditionalFieldRules.vue +135 -0
- package/src/components/ContextPanel.vue +66 -0
- package/src/components/ContextPanelSection.vue +65 -0
- package/src/components/CustomFieldRenderer.vue +159 -0
- package/src/components/EscalatedLayout.vue +400 -69
- package/src/components/FileDropzone.vue +57 -41
- package/src/components/FollowButton.stories.js +30 -0
- package/src/components/FollowButton.vue +53 -28
- package/src/components/KeyboardShortcutHelp.vue +129 -39
- package/src/components/KnowledgePanel.vue +122 -0
- package/src/components/KpiCard.stories.js +32 -0
- package/src/components/KpiCard.vue +88 -0
- package/src/components/MacroDropdown.vue +95 -35
- package/src/components/PermissionMatrix.vue +107 -0
- package/src/components/PinnedNotes.vue +75 -33
- package/src/components/PresenceIndicator.vue +93 -27
- package/src/components/PriorityBadge.stories.js +33 -0
- package/src/components/PriorityBadge.vue +46 -39
- package/src/components/QuickFilters.vue +65 -49
- package/src/components/ReplyComposer.vue +273 -159
- package/src/components/ReplyThread.vue +78 -23
- package/src/components/SatisfactionRating.vue +98 -46
- package/src/components/ScheduleEditor.vue +104 -0
- package/src/components/SideConversation.vue +165 -0
- package/src/components/SideConversationList.vue +147 -0
- package/src/components/SkillTagManager.vue +79 -0
- package/src/components/SlaComplianceChart.vue +53 -0
- package/src/components/SlaTimer.stories.js +35 -0
- package/src/components/SlaTimer.vue +62 -49
- package/src/components/StatsCard.stories.js +24 -0
- package/src/components/StatsCard.vue +58 -46
- package/src/components/StatusBadge.stories.js +53 -0
- package/src/components/StatusBadge.vue +78 -46
- package/src/components/TagSelect.vue +84 -53
- package/src/components/TicketFilters.vue +225 -69
- package/src/components/TicketLinkPanel.vue +193 -0
- package/src/components/TicketList.vue +594 -193
- package/src/components/TicketMergeDialog.vue +157 -0
- package/src/components/TicketSidebar.vue +167 -99
- package/src/components/TicketTypeSelector.vue +21 -0
- package/src/components/TotpInput.stories.js +9 -0
- package/src/components/TotpInput.vue +81 -0
- package/src/components/TwoFactorSetup.vue +113 -0
- package/src/composables/useDebouncedSearch.js +38 -0
- package/src/composables/useI18n.js +80 -0
- package/src/composables/usePluginExtensions.js +95 -3
- package/src/composables/usePluginHooks.js +65 -0
- package/src/defineEscalatedPlugin.js +34 -8
- package/src/index.js +72 -35
- package/src/locales/de.json +442 -0
- package/src/locales/en.json +467 -0
- package/src/locales/es.json +442 -0
- package/src/locales/fr.json +442 -0
- package/src/locales/index.js +6 -0
- package/src/pages/Admin/ApiTokens/Index.vue +231 -67
- package/src/pages/Admin/AuditLog/Index.vue +154 -0
- package/src/pages/Admin/Automations/Form.vue +184 -0
- package/src/pages/Admin/Automations/Index.vue +129 -0
- package/src/pages/Admin/BusinessHours/Form.vue +172 -0
- package/src/pages/Admin/BusinessHours/Index.vue +113 -0
- package/src/pages/Admin/CannedResponses/Index.vue +127 -70
- package/src/pages/Admin/Capacity/Index.vue +134 -0
- package/src/pages/Admin/CustomFields/Form.vue +195 -0
- package/src/pages/Admin/CustomFields/Index.vue +134 -0
- package/src/pages/Admin/CustomObjects/Form.vue +202 -0
- package/src/pages/Admin/CustomObjects/Index.vue +127 -0
- package/src/pages/Admin/CustomObjects/Records.vue +228 -0
- package/src/pages/Admin/Departments/Form.vue +75 -51
- package/src/pages/Admin/Departments/Index.vue +109 -57
- package/src/pages/Admin/EscalationRules/Form.vue +157 -96
- package/src/pages/Admin/EscalationRules/Index.vue +178 -57
- package/src/pages/Admin/Import/Connect.vue +96 -0
- package/src/pages/Admin/Import/Index.vue +102 -0
- package/src/pages/Admin/Import/Mapping.vue +110 -0
- package/src/pages/Admin/Import/Progress.vue +153 -0
- package/src/pages/Admin/Import/Review.vue +76 -0
- package/src/pages/Admin/KnowledgeBase/Articles/Form.vue +142 -0
- package/src/pages/Admin/KnowledgeBase/Articles/Index.vue +195 -0
- package/src/pages/Admin/KnowledgeBase/Categories/Index.vue +193 -0
- package/src/pages/Admin/Macros/Index.vue +250 -89
- package/src/pages/Admin/Plugins/Index.vue +205 -75
- package/src/pages/Admin/Reports/AgentMetrics.vue +115 -0
- package/src/pages/Admin/Reports/CsatReport.vue +127 -0
- package/src/pages/Admin/Reports/Dashboard.vue +211 -0
- package/src/pages/Admin/Reports/SlaReport.vue +166 -0
- package/src/pages/Admin/Reports.vue +139 -34
- package/src/pages/Admin/Roles/Form.vue +71 -0
- package/src/pages/Admin/Roles/Index.vue +122 -0
- package/src/pages/Admin/Settings/CsatSettings.vue +165 -0
- package/src/pages/Admin/Settings/DataRetention.vue +182 -0
- package/src/pages/Admin/Settings/EmailSettings.vue +243 -0
- package/src/pages/Admin/Settings/Sandbox.vue +135 -0
- package/src/pages/Admin/Settings/SsoSettings.vue +218 -0
- package/src/pages/Admin/Settings/TwoFactor.vue +110 -0
- package/src/pages/Admin/Settings.vue +468 -260
- package/src/pages/Admin/Skills/Form.vue +53 -0
- package/src/pages/Admin/Skills/Index.vue +94 -0
- package/src/pages/Admin/SlaPolicies/Form.vue +118 -75
- package/src/pages/Admin/SlaPolicies/Index.vue +120 -59
- package/src/pages/Admin/Statuses/Form.vue +114 -0
- package/src/pages/Admin/Statuses/Index.vue +153 -0
- package/src/pages/Admin/Tags/Index.vue +191 -105
- package/src/pages/Admin/Tickets/Index.vue +91 -39
- package/src/pages/Admin/Tickets/Show.vue +101 -37
- package/src/pages/Admin/Webhooks/DeliveryLog.vue +120 -0
- package/src/pages/Admin/Webhooks/Form.vue +110 -0
- package/src/pages/Admin/Webhooks/Index.vue +136 -0
- package/src/pages/Agent/Dashboard.vue +311 -186
- package/src/pages/Agent/TicketIndex.vue +88 -38
- package/src/pages/Agent/TicketShow.vue +258 -51
- package/src/pages/Customer/Create.vue +36 -9
- package/src/pages/Customer/Index.vue +31 -24
- package/src/pages/Customer/KnowledgeBase/Article.vue +127 -0
- package/src/pages/Customer/KnowledgeBase/Index.vue +151 -0
- package/src/plugin.js +86 -1
- package/src/utils/constants.js +30 -0
- package/src/utils/formatting.js +35 -0
- package/src/utils/sanitizeHtml.js +64 -0
- package/src/pages/Admin/Plugins.vue +0 -129
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ref, watch, onUnmounted } from 'vue';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Composable that debounces a reactive search term and invokes a callback.
|
|
5
|
+
*
|
|
6
|
+
* @param {Function} callback - Called with the search term value after the debounce delay.
|
|
7
|
+
* @param {number} [delay=300] - Debounce delay in milliseconds.
|
|
8
|
+
* @returns {{ searchTerm: import('vue').Ref<string>, clearSearch: () => void }}
|
|
9
|
+
*/
|
|
10
|
+
export function useDebouncedSearch(callback, delay = 300) {
|
|
11
|
+
const searchTerm = ref('');
|
|
12
|
+
let timer = null;
|
|
13
|
+
|
|
14
|
+
function clearTimer() {
|
|
15
|
+
if (timer !== null) {
|
|
16
|
+
window.clearTimeout(timer);
|
|
17
|
+
timer = null;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
watch(searchTerm, (val) => {
|
|
22
|
+
clearTimer();
|
|
23
|
+
if (!val || val.length < 2) {
|
|
24
|
+
callback(null);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
timer = window.setTimeout(() => callback(val), delay);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
function clearSearch() {
|
|
31
|
+
clearTimer();
|
|
32
|
+
searchTerm.value = '';
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
onUnmounted(clearTimer);
|
|
36
|
+
|
|
37
|
+
return { searchTerm, clearSearch };
|
|
38
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { ref, computed } from 'vue';
|
|
2
|
+
import locales from '../locales/index.js';
|
|
3
|
+
|
|
4
|
+
const currentLocale = ref('en');
|
|
5
|
+
const customMessages = ref({});
|
|
6
|
+
|
|
7
|
+
function resolve(obj, path) {
|
|
8
|
+
return path.split('.').reduce((acc, key) => acc?.[key], obj);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function applyReplacements(str, replacements) {
|
|
12
|
+
if (!replacements) return str;
|
|
13
|
+
return Object.entries(replacements).reduce(
|
|
14
|
+
(result, [key, value]) => result.replace(new RegExp(`:${key}`, 'g'), value),
|
|
15
|
+
str,
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function setLocale(locale) {
|
|
20
|
+
currentLocale.value = locale;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function getLocale() {
|
|
24
|
+
return currentLocale.value;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function mergeMessages(locale, messages) {
|
|
28
|
+
customMessages.value = {
|
|
29
|
+
...customMessages.value,
|
|
30
|
+
[locale]: deepMerge(customMessages.value[locale] || {}, messages),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function deepMerge(target, source) {
|
|
35
|
+
const result = { ...target };
|
|
36
|
+
for (const key of Object.keys(source)) {
|
|
37
|
+
if (
|
|
38
|
+
source[key] &&
|
|
39
|
+
typeof source[key] === 'object' &&
|
|
40
|
+
!Array.isArray(source[key]) &&
|
|
41
|
+
target[key] &&
|
|
42
|
+
typeof target[key] === 'object'
|
|
43
|
+
) {
|
|
44
|
+
result[key] = deepMerge(target[key], source[key]);
|
|
45
|
+
} else {
|
|
46
|
+
result[key] = source[key];
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return result;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function useI18n() {
|
|
53
|
+
const locale = computed(() => currentLocale.value);
|
|
54
|
+
|
|
55
|
+
function t(key, replacements) {
|
|
56
|
+
const lang = currentLocale.value;
|
|
57
|
+
|
|
58
|
+
// Try custom messages for current locale
|
|
59
|
+
const custom = resolve(customMessages.value[lang], key);
|
|
60
|
+
if (typeof custom === 'string') return applyReplacements(custom, replacements);
|
|
61
|
+
|
|
62
|
+
// Try built-in messages for current locale
|
|
63
|
+
const msg = resolve(locales[lang], key);
|
|
64
|
+
if (typeof msg === 'string') return applyReplacements(msg, replacements);
|
|
65
|
+
|
|
66
|
+
// Fallback to English
|
|
67
|
+
if (lang !== 'en') {
|
|
68
|
+
const customEn = resolve(customMessages.value.en, key);
|
|
69
|
+
if (typeof customEn === 'string') return applyReplacements(customEn, replacements);
|
|
70
|
+
|
|
71
|
+
const fallback = resolve(locales.en, key);
|
|
72
|
+
if (typeof fallback === 'string') return applyReplacements(fallback, replacements);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Return raw key
|
|
76
|
+
return key;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return { t, locale };
|
|
80
|
+
}
|
|
@@ -35,6 +35,80 @@ export function usePluginExtensions() {
|
|
|
35
35
|
return [...widgets].sort((a, b) => (a.position || 100) - (b.position || 100));
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
+
/**
|
|
39
|
+
* Ticket actions injected by plugins (e.g., "Escalate to Jira", "Send Approval").
|
|
40
|
+
* Each action: { id, label, icon, handler, position, permission, context }
|
|
41
|
+
* context: 'agent' | 'admin' | 'both'
|
|
42
|
+
*/
|
|
43
|
+
const ticketActions = computed(() => {
|
|
44
|
+
const actions = pluginData.value.ticketActions || [];
|
|
45
|
+
return [...actions].sort((a, b) => (a.position || 100) - (b.position || 100));
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Sidebar panels injected by plugins for the ticket detail context panel.
|
|
50
|
+
* Each panel: { id, title, component, plugin, position, collapsed, icon }
|
|
51
|
+
*/
|
|
52
|
+
const sidebarPanels = computed(() => {
|
|
53
|
+
const panels = pluginData.value.sidebarPanels || [];
|
|
54
|
+
return [...panels].sort((a, b) => (a.position || 100) - (b.position || 100));
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Custom ticket fields injected by plugins for ticket creation/edit forms.
|
|
59
|
+
* Each field: { id, label, type, name, options, required, position, plugin }
|
|
60
|
+
* type: 'text' | 'textarea' | 'select' | 'checkbox' | 'date' | 'number'
|
|
61
|
+
*/
|
|
62
|
+
const ticketFields = computed(() => {
|
|
63
|
+
const fields = pluginData.value.ticketFields || [];
|
|
64
|
+
return [...fields].sort((a, b) => (a.position || 100) - (b.position || 100));
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Reply composer actions injected by plugins (e.g., "AI Suggest", "Insert KB Article").
|
|
69
|
+
* Each action: { id, label, icon, handler, component, plugin, position }
|
|
70
|
+
*/
|
|
71
|
+
const composerActions = computed(() => {
|
|
72
|
+
const actions = pluginData.value.composerActions || [];
|
|
73
|
+
return [...actions].sort((a, b) => (a.position || 100) - (b.position || 100));
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Report widgets injected by plugins for the admin reports page.
|
|
78
|
+
* Each widget: { id, title, component, plugin, data, position, width }
|
|
79
|
+
*/
|
|
80
|
+
const reportWidgets = computed(() => {
|
|
81
|
+
const widgets = pluginData.value.reportWidgets || [];
|
|
82
|
+
return [...widgets].sort((a, b) => (a.position || 100) - (b.position || 100));
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Settings panels injected by plugins for the admin settings page.
|
|
87
|
+
* Each panel: { id, title, component, plugin, position, icon }
|
|
88
|
+
*/
|
|
89
|
+
const settingsPanels = computed(() => {
|
|
90
|
+
const panels = pluginData.value.settingsPanels || [];
|
|
91
|
+
return [...panels].sort((a, b) => (a.position || 100) - (b.position || 100));
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Notification channels registered by plugins (e.g., Slack, SMS, WhatsApp).
|
|
96
|
+
* Each channel: { id, label, icon, plugin, configComponent }
|
|
97
|
+
*/
|
|
98
|
+
const notificationChannels = computed(() => {
|
|
99
|
+
const channels = pluginData.value.notificationChannels || [];
|
|
100
|
+
return [...channels].sort((a, b) => (a.position || 100) - (b.position || 100));
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Custom ticket list columns injected by plugins.
|
|
105
|
+
* Each column: { id, label, key, component, plugin, position, width }
|
|
106
|
+
*/
|
|
107
|
+
const ticketListColumns = computed(() => {
|
|
108
|
+
const columns = pluginData.value.ticketListColumns || [];
|
|
109
|
+
return [...columns].sort((a, b) => (a.position || 100) - (b.position || 100));
|
|
110
|
+
});
|
|
111
|
+
|
|
38
112
|
/**
|
|
39
113
|
* Get plugin components for a specific page slot, sorted by position.
|
|
40
114
|
*
|
|
@@ -52,15 +126,33 @@ export function usePluginExtensions() {
|
|
|
52
126
|
* Check whether any plugins have registered extensions.
|
|
53
127
|
*/
|
|
54
128
|
const hasPlugins = computed(() => {
|
|
55
|
-
return
|
|
56
|
-
|
|
57
|
-
|
|
129
|
+
return (
|
|
130
|
+
menuItems.value.length > 0 ||
|
|
131
|
+
dashboardWidgets.value.length > 0 ||
|
|
132
|
+
Object.keys(pluginData.value.pageComponents || {}).length > 0 ||
|
|
133
|
+
ticketActions.value.length > 0 ||
|
|
134
|
+
sidebarPanels.value.length > 0 ||
|
|
135
|
+
ticketFields.value.length > 0 ||
|
|
136
|
+
composerActions.value.length > 0 ||
|
|
137
|
+
reportWidgets.value.length > 0 ||
|
|
138
|
+
settingsPanels.value.length > 0 ||
|
|
139
|
+
notificationChannels.value.length > 0 ||
|
|
140
|
+
ticketListColumns.value.length > 0
|
|
141
|
+
);
|
|
58
142
|
});
|
|
59
143
|
|
|
60
144
|
return {
|
|
61
145
|
pluginData,
|
|
62
146
|
menuItems,
|
|
63
147
|
dashboardWidgets,
|
|
148
|
+
ticketActions,
|
|
149
|
+
sidebarPanels,
|
|
150
|
+
ticketFields,
|
|
151
|
+
composerActions,
|
|
152
|
+
reportWidgets,
|
|
153
|
+
settingsPanels,
|
|
154
|
+
notificationChannels,
|
|
155
|
+
ticketListColumns,
|
|
64
156
|
getPageComponents,
|
|
65
157
|
hasPlugins,
|
|
66
158
|
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { getCurrentInstance } from 'vue';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Composable for dispatching and consuming plugin hooks.
|
|
5
|
+
*
|
|
6
|
+
* Hooks allow plugins to react to events (e.g., ticket.created, ticket.replied)
|
|
7
|
+
* and to filter/modify data before it's processed (e.g., reply.beforeSubmit).
|
|
8
|
+
*
|
|
9
|
+
* Action hooks: fire-and-forget, all handlers run
|
|
10
|
+
* Filter hooks: chain handlers, each can modify the value
|
|
11
|
+
*
|
|
12
|
+
* @returns {Object} Hook dispatch functions
|
|
13
|
+
*/
|
|
14
|
+
export function usePluginHooks() {
|
|
15
|
+
const instance = getCurrentInstance();
|
|
16
|
+
const hookRegistry = instance?.appContext?.config?.globalProperties?.$escalatedHooks || {};
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Dispatch an action hook. All registered handlers are called.
|
|
20
|
+
* @param {string} event - Hook name (e.g., 'ticket.created')
|
|
21
|
+
* @param {...any} args - Arguments passed to handlers
|
|
22
|
+
*/
|
|
23
|
+
async function dispatch(event, ...args) {
|
|
24
|
+
const handlers = hookRegistry[event] || [];
|
|
25
|
+
for (const { handler } of handlers) {
|
|
26
|
+
try {
|
|
27
|
+
await handler(...args);
|
|
28
|
+
} catch (err) {
|
|
29
|
+
console.warn(`[Escalated] Plugin hook "${event}" error:`, err);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Dispatch a filter hook. Each handler receives the value and can return a modified version.
|
|
36
|
+
* @param {string} event - Hook name (e.g., 'reply.beforeSubmit')
|
|
37
|
+
* @param {*} value - The value to filter
|
|
38
|
+
* @param {...any} args - Additional arguments passed to handlers
|
|
39
|
+
* @returns {*} The filtered value
|
|
40
|
+
*/
|
|
41
|
+
async function filter(event, value, ...args) {
|
|
42
|
+
const handlers = hookRegistry[event] || [];
|
|
43
|
+
let result = value;
|
|
44
|
+
for (const { handler } of handlers) {
|
|
45
|
+
try {
|
|
46
|
+
const modified = await handler(result, ...args);
|
|
47
|
+
if (modified !== undefined) result = modified;
|
|
48
|
+
} catch (err) {
|
|
49
|
+
console.warn(`[Escalated] Plugin filter "${event}" error:`, err);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return result;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Check if any handlers are registered for a given hook.
|
|
57
|
+
* @param {string} event - Hook name
|
|
58
|
+
* @returns {boolean}
|
|
59
|
+
*/
|
|
60
|
+
function hasHook(event) {
|
|
61
|
+
return (hookRegistry[event] || []).length > 0;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return { dispatch, filter, hasHook };
|
|
65
|
+
}
|
|
@@ -3,31 +3,41 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Returns a Vue plugin object that registers components globally when installed.
|
|
5
5
|
*
|
|
6
|
-
* Usage
|
|
6
|
+
* Usage:
|
|
7
7
|
*
|
|
8
8
|
* import { defineEscalatedPlugin } from '@escalated-dev/escalated'
|
|
9
9
|
* import SalesWidget from './Components/SalesWidget.vue'
|
|
10
|
-
* import CustomSidebar from './Components/CustomSidebar.vue'
|
|
11
10
|
*
|
|
12
11
|
* export default defineEscalatedPlugin({
|
|
13
12
|
* name: 'my-plugin',
|
|
14
13
|
* components: {
|
|
15
14
|
* SalesWidget,
|
|
16
|
-
* CustomSidebar,
|
|
17
15
|
* },
|
|
18
|
-
*
|
|
19
|
-
*
|
|
16
|
+
* hooks: {
|
|
17
|
+
* 'ticket.created': (ticket) => { ... },
|
|
18
|
+
* 'ticket.replied': (ticket, reply) => { ... },
|
|
19
|
+
* 'ticket.statusChanged': (ticket, oldStatus, newStatus) => { ... },
|
|
20
|
+
* 'reply.beforeSubmit': (content) => { return modifiedContent; },
|
|
21
|
+
* },
|
|
22
|
+
* setup(app, ctx) {
|
|
23
|
+
* // ctx contains: { provide }
|
|
20
24
|
* },
|
|
21
25
|
* })
|
|
22
26
|
*
|
|
23
27
|
* @param {Object} options
|
|
24
28
|
* @param {string} options.name - Plugin identifier
|
|
25
29
|
* @param {Object} [options.components] - Map of component name to component definition
|
|
26
|
-
* @param {
|
|
30
|
+
* @param {Object} [options.hooks] - Map of hook event name to handler function
|
|
31
|
+
* @param {Function} [options.setup] - Optional setup callback receiving the Vue app instance and context
|
|
27
32
|
* @returns {Object} A Vue plugin object with an install() method
|
|
28
33
|
*/
|
|
29
34
|
export function defineEscalatedPlugin(options = {}) {
|
|
30
35
|
return {
|
|
36
|
+
// Metadata for plugin introspection
|
|
37
|
+
__escalated: true,
|
|
38
|
+
name: options.name || 'unknown',
|
|
39
|
+
hooks: options.hooks || {},
|
|
40
|
+
|
|
31
41
|
install(app) {
|
|
32
42
|
// Register all provided components globally
|
|
33
43
|
if (options.components) {
|
|
@@ -36,9 +46,25 @@ export function defineEscalatedPlugin(options = {}) {
|
|
|
36
46
|
});
|
|
37
47
|
}
|
|
38
48
|
|
|
39
|
-
//
|
|
49
|
+
// Register plugin hooks on a global event bus
|
|
50
|
+
if (options.hooks) {
|
|
51
|
+
const hookRegistry =
|
|
52
|
+
app.config.globalProperties.$escalatedHooks || (app.config.globalProperties.$escalatedHooks = {});
|
|
53
|
+
|
|
54
|
+
Object.entries(options.hooks).forEach(([event, handler]) => {
|
|
55
|
+
if (!hookRegistry[event]) hookRegistry[event] = [];
|
|
56
|
+
hookRegistry[event].push({
|
|
57
|
+
plugin: options.name,
|
|
58
|
+
handler,
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Run optional setup callback with context
|
|
40
64
|
if (typeof options.setup === 'function') {
|
|
41
|
-
options.setup(app
|
|
65
|
+
options.setup(app, {
|
|
66
|
+
provide: app.provide.bind(app),
|
|
67
|
+
});
|
|
42
68
|
}
|
|
43
69
|
|
|
44
70
|
// Provide the plugin name for debugging
|
package/src/index.js
CHANGED
|
@@ -1,35 +1,72 @@
|
|
|
1
|
-
// Plugin
|
|
2
|
-
export { EscalatedPlugin } from './plugin'
|
|
3
|
-
|
|
4
|
-
// Components
|
|
5
|
-
export { default as ActivityTimeline } from './components/ActivityTimeline.vue'
|
|
6
|
-
export { default as
|
|
7
|
-
export { default as
|
|
8
|
-
export { default as
|
|
9
|
-
export { default as
|
|
10
|
-
export { default as
|
|
11
|
-
export { default as
|
|
12
|
-
export { default as
|
|
13
|
-
export { default as
|
|
14
|
-
export { default as
|
|
15
|
-
export { default as
|
|
16
|
-
export { default as
|
|
17
|
-
export { default as
|
|
18
|
-
export { default as
|
|
19
|
-
export { default as
|
|
20
|
-
export { default as
|
|
21
|
-
export { default as
|
|
22
|
-
export { default as
|
|
23
|
-
export { default as
|
|
24
|
-
export { default as
|
|
25
|
-
export { default as
|
|
26
|
-
export { default as
|
|
27
|
-
export { default as
|
|
28
|
-
export { default as
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
export {
|
|
32
|
-
export {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
export {
|
|
1
|
+
// Plugin
|
|
2
|
+
export { EscalatedPlugin } from './plugin';
|
|
3
|
+
|
|
4
|
+
// Components
|
|
5
|
+
export { default as ActivityTimeline } from './components/ActivityTimeline.vue';
|
|
6
|
+
export { default as AgentLoadIndicator } from './components/AgentLoadIndicator.vue';
|
|
7
|
+
export { default as AgentPerformanceCard } from './components/AgentPerformanceCard.vue';
|
|
8
|
+
export { default as ArticleEditor } from './components/ArticleEditor.vue';
|
|
9
|
+
export { default as AssigneeSelect } from './components/AssigneeSelect.vue';
|
|
10
|
+
export { default as AttachmentList } from './components/AttachmentList.vue';
|
|
11
|
+
export { default as AuditLogEntry } from './components/AuditLogEntry.vue';
|
|
12
|
+
export { default as BulkActionBar } from './components/BulkActionBar.vue';
|
|
13
|
+
export { default as CategoryTree } from './components/CategoryTree.vue';
|
|
14
|
+
export { default as ChartWidget } from './components/ChartWidget.vue';
|
|
15
|
+
export { default as CollisionWarning } from './components/CollisionWarning.vue';
|
|
16
|
+
export { default as ConditionalFieldRules } from './components/ConditionalFieldRules.vue';
|
|
17
|
+
export { default as ContextPanel } from './components/ContextPanel.vue';
|
|
18
|
+
export { default as ContextPanelSection } from './components/ContextPanelSection.vue';
|
|
19
|
+
export { default as CustomFieldRenderer } from './components/CustomFieldRenderer.vue';
|
|
20
|
+
export { default as EscalatedLayout } from './components/EscalatedLayout.vue';
|
|
21
|
+
export { default as FileDropzone } from './components/FileDropzone.vue';
|
|
22
|
+
export { default as FollowButton } from './components/FollowButton.vue';
|
|
23
|
+
export { default as KeyboardShortcutHelp } from './components/KeyboardShortcutHelp.vue';
|
|
24
|
+
export { default as KnowledgePanel } from './components/KnowledgePanel.vue';
|
|
25
|
+
export { default as KpiCard } from './components/KpiCard.vue';
|
|
26
|
+
export { default as MacroDropdown } from './components/MacroDropdown.vue';
|
|
27
|
+
export { default as PermissionMatrix } from './components/PermissionMatrix.vue';
|
|
28
|
+
export { default as PinnedNotes } from './components/PinnedNotes.vue';
|
|
29
|
+
export { default as PluginSlot } from './components/PluginSlot.vue';
|
|
30
|
+
export { default as PresenceIndicator } from './components/PresenceIndicator.vue';
|
|
31
|
+
export { default as PriorityBadge } from './components/PriorityBadge.vue';
|
|
32
|
+
export { default as QuickFilters } from './components/QuickFilters.vue';
|
|
33
|
+
export { default as ReplyComposer } from './components/ReplyComposer.vue';
|
|
34
|
+
export { default as ReplyThread } from './components/ReplyThread.vue';
|
|
35
|
+
export { default as SatisfactionRating } from './components/SatisfactionRating.vue';
|
|
36
|
+
export { default as ScheduleEditor } from './components/ScheduleEditor.vue';
|
|
37
|
+
export { default as SideConversation } from './components/SideConversation.vue';
|
|
38
|
+
export { default as SideConversationList } from './components/SideConversationList.vue';
|
|
39
|
+
export { default as SkillTagManager } from './components/SkillTagManager.vue';
|
|
40
|
+
export { default as SlaComplianceChart } from './components/SlaComplianceChart.vue';
|
|
41
|
+
export { default as SlaTimer } from './components/SlaTimer.vue';
|
|
42
|
+
export { default as StatsCard } from './components/StatsCard.vue';
|
|
43
|
+
export { default as StatusBadge } from './components/StatusBadge.vue';
|
|
44
|
+
export { default as TagSelect } from './components/TagSelect.vue';
|
|
45
|
+
export { default as TicketFilters } from './components/TicketFilters.vue';
|
|
46
|
+
export { default as TicketLinkPanel } from './components/TicketLinkPanel.vue';
|
|
47
|
+
export { default as TicketList } from './components/TicketList.vue';
|
|
48
|
+
export { default as TicketMergeDialog } from './components/TicketMergeDialog.vue';
|
|
49
|
+
export { default as TicketSidebar } from './components/TicketSidebar.vue';
|
|
50
|
+
export { default as TicketTypeSelector } from './components/TicketTypeSelector.vue';
|
|
51
|
+
export { default as TotpInput } from './components/TotpInput.vue';
|
|
52
|
+
export { default as TwoFactorSetup } from './components/TwoFactorSetup.vue';
|
|
53
|
+
|
|
54
|
+
// Composables
|
|
55
|
+
export { useDebouncedSearch } from './composables/useDebouncedSearch';
|
|
56
|
+
export { useKeyboardShortcuts } from './composables/useKeyboardShortcuts';
|
|
57
|
+
export { usePluginExtensions } from './composables/usePluginExtensions';
|
|
58
|
+
export { usePluginHooks } from './composables/usePluginHooks';
|
|
59
|
+
|
|
60
|
+
// Utilities
|
|
61
|
+
export { TICKET_STATUSES, TICKET_PRIORITIES, TICKET_TYPES, TICKET_TYPE_COLORS } from './utils/constants';
|
|
62
|
+
export { timeAgo, slaClass } from './utils/formatting';
|
|
63
|
+
|
|
64
|
+
// Plugin authoring helper
|
|
65
|
+
export { defineEscalatedPlugin } from './defineEscalatedPlugin';
|
|
66
|
+
|
|
67
|
+
// Import pages
|
|
68
|
+
export { default as AdminImportIndex } from './pages/Admin/Import/Index.vue';
|
|
69
|
+
export { default as AdminImportConnect } from './pages/Admin/Import/Connect.vue';
|
|
70
|
+
export { default as AdminImportMapping } from './pages/Admin/Import/Mapping.vue';
|
|
71
|
+
export { default as AdminImportReview } from './pages/Admin/Import/Review.vue';
|
|
72
|
+
export { default as AdminImportProgress } from './pages/Admin/Import/Progress.vue';
|