@escalated-dev/escalated 0.11.7 → 0.11.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +10 -1
- package/package.json +1 -1
- package/pages.json +1 -1
- package/src/components/AuditLogEntry.vue +15 -9
- package/src/components/ChatQueue.vue +1 -1
- package/src/components/EscalatedLayout.vue +224 -38
- package/src/components/PeriodSelector.vue +1 -1
- package/src/components/PermissionMatrix.vue +1 -1
- package/src/components/QuickFilters.vue +5 -2
- package/src/components/TicketList.vue +2 -2
- package/src/components/admin/newsletters/DeliveriesTable.vue +29 -27
- package/src/components/admin/newsletters/ListMemberTable.vue +30 -28
- package/src/pages/Admin/ApiTokens/Index.vue +1 -1
- package/src/pages/Admin/Automations/Form.vue +10 -2
- package/src/pages/Admin/Automations/Index.vue +1 -1
- package/src/pages/Admin/BusinessHours/Index.vue +1 -1
- package/src/pages/Admin/Capacity/Index.vue +1 -1
- package/src/pages/Admin/CustomFields/Index.vue +1 -1
- package/src/pages/Admin/CustomObjects/Index.vue +1 -1
- package/src/pages/Admin/CustomObjects/Records.vue +19 -12
- package/src/pages/Admin/Departments/Index.vue +1 -1
- package/src/pages/Admin/EscalationRules/Index.vue +1 -1
- package/src/pages/Admin/Import/Index.vue +1 -1
- package/src/pages/Admin/KnowledgeBase/Articles/Index.vue +3 -3
- package/src/pages/Admin/Macros/Index.vue +1 -1
- package/src/pages/Admin/Newsletters/Index.vue +31 -29
- package/src/pages/Admin/Newsletters/Lists/Index.vue +22 -20
- package/src/pages/Admin/Reports/AgentMetrics.vue +1 -1
- package/src/pages/Admin/Reports/AgentRanking.vue +3 -3
- package/src/pages/Admin/Reports/Cohorts.vue +7 -5
- package/src/pages/Admin/Reports/Comparison.vue +3 -3
- package/src/pages/Admin/Reports/Dashboard.vue +7 -5
- package/src/pages/Admin/Reports/ResolutionTimes.vue +54 -46
- package/src/pages/Admin/Reports/ResponseTimes.vue +54 -46
- package/src/pages/Admin/Reports/SlaReport.vue +70 -68
- package/src/pages/Admin/Reports/SlaTrends.vue +2 -2
- package/src/pages/Admin/Reports.vue +1 -1
- package/src/pages/Admin/Roles/Index.vue +1 -1
- package/src/pages/Admin/Settings/EmailSettings.vue +1 -1
- package/src/pages/Admin/Skills/Index.vue +1 -1
- package/src/pages/Admin/SlaPolicies/Index.vue +1 -1
- package/src/pages/Admin/Statuses/Index.vue +1 -1
- package/src/pages/Admin/Tags/Index.vue +1 -1
- package/src/pages/Admin/Users/Index.vue +1 -1
- package/src/pages/Admin/Webhooks/DeliveryLog.vue +1 -1
- package/src/pages/Admin/Webhooks/Index.vue +1 -1
- package/src/pages/Admin/Workflows/Index.vue +1 -1
- package/src/pages/Admin/Workflows/Logs.vue +1 -1
- package/src/pages/Agent/Dashboard.vue +1 -1
- package/src/plugin.js +19 -0
- package/src/utils/scrollAffordance.js +87 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// Tables in the admin and agent panels sit in `.esc-table-scroll` containers,
|
|
2
|
+
// which scroll sideways when a table is wider than the screen. A scroll
|
|
3
|
+
// container on its own gives no sign there is more to see -- touch devices and
|
|
4
|
+
// overlay scrollbars hide the bar until you are already scrolling -- so this
|
|
5
|
+
// marks each container with the edges that have content past them, and the
|
|
6
|
+
// layout draws a shadow on those edges.
|
|
7
|
+
|
|
8
|
+
export const SCROLL_CONTAINER_SELECTOR = '.esc-table-scroll';
|
|
9
|
+
|
|
10
|
+
// A pixel of slack: fractional widths leave scrollLeft a hair short of the end.
|
|
11
|
+
const SLACK = 1;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Set `data-esc-overflow` on a container to the edges with hidden content:
|
|
15
|
+
* "start", "end", "start end", or nothing.
|
|
16
|
+
*/
|
|
17
|
+
export function updateScrollEdges(el) {
|
|
18
|
+
const hidden = el.scrollWidth - el.clientWidth;
|
|
19
|
+
const edges = [];
|
|
20
|
+
if (hidden > SLACK) {
|
|
21
|
+
if (el.scrollLeft > SLACK) edges.push('start');
|
|
22
|
+
if (el.scrollLeft < hidden - SLACK) edges.push('end');
|
|
23
|
+
}
|
|
24
|
+
if (edges.length) {
|
|
25
|
+
el.setAttribute('data-esc-overflow', edges.join(' '));
|
|
26
|
+
} else {
|
|
27
|
+
el.removeAttribute('data-esc-overflow');
|
|
28
|
+
}
|
|
29
|
+
return edges;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Keep every scroll container under `root` marked as it scrolls, as the
|
|
34
|
+
* window resizes, and as pages add or replace content. Returns a function
|
|
35
|
+
* that stops watching.
|
|
36
|
+
*/
|
|
37
|
+
export function watchScrollAffordance(root) {
|
|
38
|
+
if (!root || typeof window === 'undefined') return () => {};
|
|
39
|
+
|
|
40
|
+
const watched = new Set();
|
|
41
|
+
let stopped = false;
|
|
42
|
+
const onScroll = (event) => updateScrollEdges(event.currentTarget);
|
|
43
|
+
|
|
44
|
+
const scan = () => {
|
|
45
|
+
const found = new Set(root.querySelectorAll(SCROLL_CONTAINER_SELECTOR));
|
|
46
|
+
for (const el of watched) {
|
|
47
|
+
if (!found.has(el)) {
|
|
48
|
+
el.removeEventListener('scroll', onScroll);
|
|
49
|
+
watched.delete(el);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
for (const el of found) {
|
|
53
|
+
if (!watched.has(el)) {
|
|
54
|
+
el.addEventListener('scroll', onScroll, { passive: true });
|
|
55
|
+
watched.add(el);
|
|
56
|
+
}
|
|
57
|
+
updateScrollEdges(el);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
let frame = null;
|
|
62
|
+
const schedule = () => {
|
|
63
|
+
if (frame !== null) return;
|
|
64
|
+
const raf = window.requestAnimationFrame || ((fn) => setTimeout(fn, 16));
|
|
65
|
+
frame = raf(() => {
|
|
66
|
+
frame = null;
|
|
67
|
+
if (!stopped) scan();
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
scan();
|
|
72
|
+
window.addEventListener('resize', schedule);
|
|
73
|
+
|
|
74
|
+
let observer = null;
|
|
75
|
+
if (typeof window.MutationObserver !== 'undefined') {
|
|
76
|
+
observer = new window.MutationObserver(schedule);
|
|
77
|
+
observer.observe(root, { childList: true, subtree: true });
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return () => {
|
|
81
|
+
stopped = true;
|
|
82
|
+
window.removeEventListener('resize', schedule);
|
|
83
|
+
observer?.disconnect();
|
|
84
|
+
for (const el of watched) el.removeEventListener('scroll', onScroll);
|
|
85
|
+
watched.clear();
|
|
86
|
+
};
|
|
87
|
+
}
|