@consilioweb/payload-support 0.6.2 → 0.6.3

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 (65) hide show
  1. package/dist/components/TicketConversation/components/AISummaryPanel.cjs +77 -0
  2. package/dist/components/TicketConversation/components/AISummaryPanel.js +76 -0
  3. package/dist/components/TicketConversation/components/ActionPanels.cjs +121 -0
  4. package/dist/components/TicketConversation/components/ActionPanels.js +118 -0
  5. package/dist/components/TicketConversation/components/ActivityLog.cjs +24 -0
  6. package/dist/components/TicketConversation/components/ActivityLog.js +23 -0
  7. package/dist/components/TicketConversation/components/ClientBar.cjs +43 -0
  8. package/dist/components/TicketConversation/components/ClientBar.js +42 -0
  9. package/dist/components/TicketConversation/components/ClientHistory.cjs +138 -0
  10. package/dist/components/TicketConversation/components/ClientHistory.js +137 -0
  11. package/dist/components/TicketConversation/components/CodeBlock.cjs +154 -0
  12. package/dist/components/TicketConversation/components/CodeBlock.js +152 -0
  13. package/dist/components/TicketConversation/components/CodeBlockInserter.cjs +156 -0
  14. package/dist/components/TicketConversation/components/CodeBlockInserter.js +155 -0
  15. package/dist/components/TicketConversation/components/QuickActions.cjs +66 -0
  16. package/dist/components/TicketConversation/components/QuickActions.js +65 -0
  17. package/dist/components/TicketConversation/components/TicketHeader.cjs +93 -0
  18. package/dist/components/TicketConversation/components/TicketHeader.js +92 -0
  19. package/dist/components/TicketConversation/components/TimeTrackingPanel.cjs +134 -0
  20. package/dist/components/TicketConversation/components/TimeTrackingPanel.js +133 -0
  21. package/dist/components/TicketConversation/config.cjs +44 -0
  22. package/dist/components/TicketConversation/config.js +41 -0
  23. package/dist/components/TicketConversation/constants.cjs +100 -0
  24. package/dist/components/TicketConversation/constants.js +96 -0
  25. package/dist/components/TicketConversation/context.cjs +13 -0
  26. package/dist/components/TicketConversation/context.js +11 -0
  27. package/dist/components/TicketConversation/hooks/useAI.cjs +177 -0
  28. package/dist/components/TicketConversation/hooks/useAI.js +176 -0
  29. package/dist/components/TicketConversation/hooks/useMessageActions.cjs +136 -0
  30. package/dist/components/TicketConversation/hooks/useMessageActions.js +135 -0
  31. package/dist/components/TicketConversation/hooks/useReply.cjs +188 -0
  32. package/dist/components/TicketConversation/hooks/useReply.js +187 -0
  33. package/dist/components/TicketConversation/hooks/useTicketActions.cjs +231 -0
  34. package/dist/components/TicketConversation/hooks/useTicketActions.js +230 -0
  35. package/dist/components/TicketConversation/hooks/useTimeTracking.cjs +123 -0
  36. package/dist/components/TicketConversation/hooks/useTimeTracking.js +122 -0
  37. package/dist/components/TicketConversation/hooks/useTranslation.cjs +78 -0
  38. package/dist/components/TicketConversation/hooks/useTranslation.js +70 -0
  39. package/dist/components/TicketConversation/index.cjs +1128 -0
  40. package/dist/components/TicketConversation/index.js +1123 -0
  41. package/dist/components/TicketConversation/locales/en.json +878 -0
  42. package/dist/components/TicketConversation/locales/fr.json +878 -0
  43. package/dist/components/TicketConversation/types.cjs +2 -0
  44. package/dist/components/TicketConversation/types.js +2 -0
  45. package/dist/components/TicketConversation/utils.cjs +27 -0
  46. package/dist/components/TicketConversation/utils.js +25 -0
  47. package/dist/styles/BillingView.module.scss +311 -0
  48. package/dist/styles/ChatView.module.scss +438 -0
  49. package/dist/styles/CommandPalette.module.scss +160 -0
  50. package/dist/styles/CrmView.module.scss +554 -0
  51. package/dist/styles/EmailTracking.module.scss +238 -0
  52. package/dist/styles/ImportConversation.module.scss +267 -0
  53. package/dist/styles/Layout.module.scss +55 -0
  54. package/dist/styles/Logs.module.scss +164 -0
  55. package/dist/styles/NewTicket.module.scss +143 -0
  56. package/dist/styles/PendingEmails.module.scss +629 -0
  57. package/dist/styles/SupportDashboard.module.scss +649 -0
  58. package/dist/styles/TicketDetail.module.scss +1050 -0
  59. package/dist/styles/TicketInbox.module.scss +296 -0
  60. package/dist/styles/TicketingSettings.module.scss +358 -0
  61. package/dist/styles/TimeDashboard.module.scss +287 -0
  62. package/dist/styles/_tokens.scss +78 -0
  63. package/dist/{components/TicketConversation.css → styles/theme.css} +326 -13
  64. package/package.json +2 -2
  65. package/dist/components/TicketConversation.js +0 -3004
@@ -0,0 +1,134 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var constants = require('../constants');
5
+
6
+ function TimeTrackingPanel({
7
+ timeEntries,
8
+ totalMinutes,
9
+ timerRunning,
10
+ timerSeconds,
11
+ setTimerSeconds,
12
+ timerDescription,
13
+ setTimerDescription,
14
+ handleTimerStart,
15
+ handleTimerStop,
16
+ handleTimerSave,
17
+ handleTimerDiscard,
18
+ duration,
19
+ setDuration,
20
+ timeDescription,
21
+ setTimeDescription,
22
+ handleAddTime,
23
+ addingTime,
24
+ timeSuccess
25
+ }) {
26
+ const totalH = Math.floor(totalMinutes / 60);
27
+ const totalM = totalMinutes % 60;
28
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: constants.s.section, children: [
29
+ /* @__PURE__ */ jsxRuntime.jsxs("h4", { style: constants.s.sectionTitle, children: [
30
+ "Temps",
31
+ totalMinutes > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { style: constants.s.badge("#fef3c7", "#92400e"), children: [
32
+ totalH,
33
+ "h",
34
+ String(totalM).padStart(2, "0"),
35
+ " total"
36
+ ] })
37
+ ] }),
38
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: {
39
+ display: "flex",
40
+ alignItems: "center",
41
+ gap: "10px",
42
+ flexWrap: "wrap",
43
+ padding: "12px 16px",
44
+ borderRadius: "10px",
45
+ marginBottom: "14px",
46
+ backgroundColor: timerRunning ? "#fef2f2" : "var(--theme-elevation-100)",
47
+ border: timerRunning ? "1px solid #fca5a5" : "1px solid var(--theme-elevation-300)"
48
+ }, children: [
49
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: {
50
+ fontFamily: "monospace",
51
+ fontSize: "24px",
52
+ fontWeight: 700,
53
+ color: timerRunning ? "#dc2626" : "var(--theme-text)",
54
+ minWidth: "90px"
55
+ }, children: [
56
+ String(Math.floor(timerSeconds / 3600)).padStart(2, "0"),
57
+ ":",
58
+ String(Math.floor(timerSeconds % 3600 / 60)).padStart(2, "0"),
59
+ ":",
60
+ String(timerSeconds % 60).padStart(2, "0")
61
+ ] }),
62
+ !timerRunning && timerSeconds > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [-5, -1, 1, 5, 15, 30].map((m) => /* @__PURE__ */ jsxRuntime.jsx(
63
+ "button",
64
+ {
65
+ onClick: () => setTimerSeconds((p) => Math.max(0, p + m * 60)),
66
+ style: { width: Math.abs(m) >= 15 ? "32px" : "28px", height: "28px", borderRadius: "6px", border: "1px solid #e2e8f0", background: "white", cursor: "pointer", fontSize: Math.abs(m) >= 15 ? "12px" : "14px", fontWeight: 700, color: "#64748b" },
67
+ title: `${m > 0 ? "+" : ""}${m} min`,
68
+ children: m > 0 ? `+${m}` : String(m)
69
+ },
70
+ m
71
+ )) }),
72
+ !timerRunning && timerSeconds === 0 && /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: () => handleTimerStart(true), style: { ...constants.s.btn("#dc2626", false), fontSize: "12px", padding: "6px 16px", display: "flex", alignItems: "center", gap: "6px" }, children: "\u25B6 D\xE9marrer" }),
73
+ timerRunning && /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: handleTimerStop, style: { ...constants.s.btn("#374151", false), fontSize: "12px", padding: "6px 16px", display: "flex", alignItems: "center", gap: "6px" }, children: "\u23F8 Pause" }),
74
+ !timerRunning && timerSeconds > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
75
+ /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: () => handleTimerStart(false), style: { ...constants.s.btn("#dc2626", false), fontSize: "12px", padding: "6px 14px" }, children: "\u25B6 Reprendre" }),
76
+ /* @__PURE__ */ jsxRuntime.jsx(
77
+ "input",
78
+ {
79
+ type: "text",
80
+ value: timerDescription,
81
+ onChange: (e) => setTimerDescription(e.target.value),
82
+ placeholder: "Description...",
83
+ style: { ...constants.s.input, fontSize: "12px", flex: 1, minWidth: "120px" }
84
+ }
85
+ ),
86
+ /* @__PURE__ */ jsxRuntime.jsxs(
87
+ "button",
88
+ {
89
+ onClick: handleTimerSave,
90
+ disabled: addingTime || timerSeconds < 60,
91
+ style: { ...constants.s.btn("#16a34a", addingTime || timerSeconds < 60), fontSize: "12px", padding: "6px 14px" },
92
+ title: timerSeconds < 60 ? "Minimum 1 minute" : `Sauvegarder ${Math.round(timerSeconds / 60)} min`,
93
+ children: [
94
+ "\u{1F4BE} ",
95
+ Math.round(timerSeconds / 60),
96
+ " min"
97
+ ]
98
+ }
99
+ ),
100
+ /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: handleTimerDiscard, style: { background: "none", border: "none", cursor: "pointer", fontSize: "14px", color: "#94a3b8", padding: "4px" }, title: "Annuler", children: "\u2715" })
101
+ ] }),
102
+ timerRunning && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "11px", color: "#dc2626", fontWeight: 600 }, children: "\u25CF Enregistrement en cours \u2014 session maintenue active" })
103
+ ] }),
104
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", gap: "8px", alignItems: "flex-end", flexWrap: "wrap", marginBottom: "14px" }, children: [
105
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
106
+ /* @__PURE__ */ jsxRuntime.jsx("label", { style: { display: "block", fontSize: "11px", color: constants.C.textSecondary, marginBottom: "3px", fontWeight: 600 }, children: "Min" }),
107
+ /* @__PURE__ */ jsxRuntime.jsx("input", { type: "number", min: "1", value: duration, onChange: (e) => setDuration(e.target.value), placeholder: "30", style: { ...constants.s.input, width: "80px" } })
108
+ ] }),
109
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { flex: 1 }, children: [
110
+ /* @__PURE__ */ jsxRuntime.jsx("label", { style: { display: "block", fontSize: "11px", color: constants.C.textSecondary, marginBottom: "3px", fontWeight: 600 }, children: "Description" }),
111
+ /* @__PURE__ */ jsxRuntime.jsx("input", { type: "text", value: timeDescription, onChange: (e) => setTimeDescription(e.target.value), placeholder: "Travail effectu\xE9...", style: { ...constants.s.input, width: "100%" } })
112
+ ] }),
113
+ /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: handleAddTime, disabled: addingTime || !duration, style: constants.s.btn(constants.C.amber, addingTime || !duration), children: addingTime ? "..." : "+ Temps" }),
114
+ timeSuccess && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "12px", color: "#16a34a", fontWeight: 600 }, children: timeSuccess })
115
+ ] }),
116
+ timeEntries.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: "12px" }, children: /* @__PURE__ */ jsxRuntime.jsxs("table", { style: { width: "100%", borderCollapse: "collapse" }, children: [
117
+ /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { style: { borderBottom: `1px solid ${constants.C.border}` }, children: [
118
+ /* @__PURE__ */ jsxRuntime.jsx("th", { style: { textAlign: "left", padding: "6px 8px", fontWeight: 600, fontSize: "11px", color: constants.C.textSecondary }, children: "Date" }),
119
+ /* @__PURE__ */ jsxRuntime.jsx("th", { style: { textAlign: "left", padding: "6px 8px", fontWeight: 600, fontSize: "11px", color: constants.C.textSecondary }, children: "Dur\xE9e" }),
120
+ /* @__PURE__ */ jsxRuntime.jsx("th", { style: { textAlign: "left", padding: "6px 8px", fontWeight: 600, fontSize: "11px", color: constants.C.textSecondary }, children: "Description" })
121
+ ] }) }),
122
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: timeEntries.map((entry) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { style: { borderBottom: "1px solid #f1f5f9" }, children: [
123
+ /* @__PURE__ */ jsxRuntime.jsx("td", { style: { padding: "6px 8px", color: "#374151" }, children: new Date(entry.date).toLocaleDateString("fr-FR", { day: "numeric", month: "short" }) }),
124
+ /* @__PURE__ */ jsxRuntime.jsxs("td", { style: { padding: "6px 8px", fontWeight: 600, color: "#374151" }, children: [
125
+ entry.duration,
126
+ " min"
127
+ ] }),
128
+ /* @__PURE__ */ jsxRuntime.jsx("td", { style: { padding: "6px 8px", color: constants.C.textSecondary }, children: entry.description || "\u2014" })
129
+ ] }, entry.id)) })
130
+ ] }) })
131
+ ] });
132
+ }
133
+
134
+ exports.TimeTrackingPanel = TimeTrackingPanel;
@@ -0,0 +1,133 @@
1
+ "use client";
2
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
3
+ import { s, C } from '../constants';
4
+
5
+ function TimeTrackingPanel({
6
+ timeEntries,
7
+ totalMinutes,
8
+ timerRunning,
9
+ timerSeconds,
10
+ setTimerSeconds,
11
+ timerDescription,
12
+ setTimerDescription,
13
+ handleTimerStart,
14
+ handleTimerStop,
15
+ handleTimerSave,
16
+ handleTimerDiscard,
17
+ duration,
18
+ setDuration,
19
+ timeDescription,
20
+ setTimeDescription,
21
+ handleAddTime,
22
+ addingTime,
23
+ timeSuccess
24
+ }) {
25
+ const totalH = Math.floor(totalMinutes / 60);
26
+ const totalM = totalMinutes % 60;
27
+ return /* @__PURE__ */ jsxs("div", { style: s.section, children: [
28
+ /* @__PURE__ */ jsxs("h4", { style: s.sectionTitle, children: [
29
+ "Temps",
30
+ totalMinutes > 0 && /* @__PURE__ */ jsxs("span", { style: s.badge("#fef3c7", "#92400e"), children: [
31
+ totalH,
32
+ "h",
33
+ String(totalM).padStart(2, "0"),
34
+ " total"
35
+ ] })
36
+ ] }),
37
+ /* @__PURE__ */ jsxs("div", { style: {
38
+ display: "flex",
39
+ alignItems: "center",
40
+ gap: "10px",
41
+ flexWrap: "wrap",
42
+ padding: "12px 16px",
43
+ borderRadius: "10px",
44
+ marginBottom: "14px",
45
+ backgroundColor: timerRunning ? "#fef2f2" : "var(--theme-elevation-100)",
46
+ border: timerRunning ? "1px solid #fca5a5" : "1px solid var(--theme-elevation-300)"
47
+ }, children: [
48
+ /* @__PURE__ */ jsxs("div", { style: {
49
+ fontFamily: "monospace",
50
+ fontSize: "24px",
51
+ fontWeight: 700,
52
+ color: timerRunning ? "#dc2626" : "var(--theme-text)",
53
+ minWidth: "90px"
54
+ }, children: [
55
+ String(Math.floor(timerSeconds / 3600)).padStart(2, "0"),
56
+ ":",
57
+ String(Math.floor(timerSeconds % 3600 / 60)).padStart(2, "0"),
58
+ ":",
59
+ String(timerSeconds % 60).padStart(2, "0")
60
+ ] }),
61
+ !timerRunning && timerSeconds > 0 && /* @__PURE__ */ jsx("div", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [-5, -1, 1, 5, 15, 30].map((m) => /* @__PURE__ */ jsx(
62
+ "button",
63
+ {
64
+ onClick: () => setTimerSeconds((p) => Math.max(0, p + m * 60)),
65
+ style: { width: Math.abs(m) >= 15 ? "32px" : "28px", height: "28px", borderRadius: "6px", border: "1px solid #e2e8f0", background: "white", cursor: "pointer", fontSize: Math.abs(m) >= 15 ? "12px" : "14px", fontWeight: 700, color: "#64748b" },
66
+ title: `${m > 0 ? "+" : ""}${m} min`,
67
+ children: m > 0 ? `+${m}` : String(m)
68
+ },
69
+ m
70
+ )) }),
71
+ !timerRunning && timerSeconds === 0 && /* @__PURE__ */ jsx("button", { onClick: () => handleTimerStart(true), style: { ...s.btn("#dc2626", false), fontSize: "12px", padding: "6px 16px", display: "flex", alignItems: "center", gap: "6px" }, children: "\u25B6 D\xE9marrer" }),
72
+ timerRunning && /* @__PURE__ */ jsx("button", { onClick: handleTimerStop, style: { ...s.btn("#374151", false), fontSize: "12px", padding: "6px 16px", display: "flex", alignItems: "center", gap: "6px" }, children: "\u23F8 Pause" }),
73
+ !timerRunning && timerSeconds > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
74
+ /* @__PURE__ */ jsx("button", { onClick: () => handleTimerStart(false), style: { ...s.btn("#dc2626", false), fontSize: "12px", padding: "6px 14px" }, children: "\u25B6 Reprendre" }),
75
+ /* @__PURE__ */ jsx(
76
+ "input",
77
+ {
78
+ type: "text",
79
+ value: timerDescription,
80
+ onChange: (e) => setTimerDescription(e.target.value),
81
+ placeholder: "Description...",
82
+ style: { ...s.input, fontSize: "12px", flex: 1, minWidth: "120px" }
83
+ }
84
+ ),
85
+ /* @__PURE__ */ jsxs(
86
+ "button",
87
+ {
88
+ onClick: handleTimerSave,
89
+ disabled: addingTime || timerSeconds < 60,
90
+ style: { ...s.btn("#16a34a", addingTime || timerSeconds < 60), fontSize: "12px", padding: "6px 14px" },
91
+ title: timerSeconds < 60 ? "Minimum 1 minute" : `Sauvegarder ${Math.round(timerSeconds / 60)} min`,
92
+ children: [
93
+ "\u{1F4BE} ",
94
+ Math.round(timerSeconds / 60),
95
+ " min"
96
+ ]
97
+ }
98
+ ),
99
+ /* @__PURE__ */ jsx("button", { onClick: handleTimerDiscard, style: { background: "none", border: "none", cursor: "pointer", fontSize: "14px", color: "#94a3b8", padding: "4px" }, title: "Annuler", children: "\u2715" })
100
+ ] }),
101
+ timerRunning && /* @__PURE__ */ jsx("span", { style: { fontSize: "11px", color: "#dc2626", fontWeight: 600 }, children: "\u25CF Enregistrement en cours \u2014 session maintenue active" })
102
+ ] }),
103
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "8px", alignItems: "flex-end", flexWrap: "wrap", marginBottom: "14px" }, children: [
104
+ /* @__PURE__ */ jsxs("div", { children: [
105
+ /* @__PURE__ */ jsx("label", { style: { display: "block", fontSize: "11px", color: C.textSecondary, marginBottom: "3px", fontWeight: 600 }, children: "Min" }),
106
+ /* @__PURE__ */ jsx("input", { type: "number", min: "1", value: duration, onChange: (e) => setDuration(e.target.value), placeholder: "30", style: { ...s.input, width: "80px" } })
107
+ ] }),
108
+ /* @__PURE__ */ jsxs("div", { style: { flex: 1 }, children: [
109
+ /* @__PURE__ */ jsx("label", { style: { display: "block", fontSize: "11px", color: C.textSecondary, marginBottom: "3px", fontWeight: 600 }, children: "Description" }),
110
+ /* @__PURE__ */ jsx("input", { type: "text", value: timeDescription, onChange: (e) => setTimeDescription(e.target.value), placeholder: "Travail effectu\xE9...", style: { ...s.input, width: "100%" } })
111
+ ] }),
112
+ /* @__PURE__ */ jsx("button", { onClick: handleAddTime, disabled: addingTime || !duration, style: s.btn(C.amber, addingTime || !duration), children: addingTime ? "..." : "+ Temps" }),
113
+ timeSuccess && /* @__PURE__ */ jsx("span", { style: { fontSize: "12px", color: "#16a34a", fontWeight: 600 }, children: timeSuccess })
114
+ ] }),
115
+ timeEntries.length > 0 && /* @__PURE__ */ jsx("div", { style: { fontSize: "12px" }, children: /* @__PURE__ */ jsxs("table", { style: { width: "100%", borderCollapse: "collapse" }, children: [
116
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { style: { borderBottom: `1px solid ${C.border}` }, children: [
117
+ /* @__PURE__ */ jsx("th", { style: { textAlign: "left", padding: "6px 8px", fontWeight: 600, fontSize: "11px", color: C.textSecondary }, children: "Date" }),
118
+ /* @__PURE__ */ jsx("th", { style: { textAlign: "left", padding: "6px 8px", fontWeight: 600, fontSize: "11px", color: C.textSecondary }, children: "Dur\xE9e" }),
119
+ /* @__PURE__ */ jsx("th", { style: { textAlign: "left", padding: "6px 8px", fontWeight: 600, fontSize: "11px", color: C.textSecondary }, children: "Description" })
120
+ ] }) }),
121
+ /* @__PURE__ */ jsx("tbody", { children: timeEntries.map((entry) => /* @__PURE__ */ jsxs("tr", { style: { borderBottom: "1px solid #f1f5f9" }, children: [
122
+ /* @__PURE__ */ jsx("td", { style: { padding: "6px 8px", color: "#374151" }, children: new Date(entry.date).toLocaleDateString("fr-FR", { day: "numeric", month: "short" }) }),
123
+ /* @__PURE__ */ jsxs("td", { style: { padding: "6px 8px", fontWeight: 600, color: "#374151" }, children: [
124
+ entry.duration,
125
+ " min"
126
+ ] }),
127
+ /* @__PURE__ */ jsx("td", { style: { padding: "6px 8px", color: C.textSecondary }, children: entry.description || "\u2014" })
128
+ ] }, entry.id)) })
129
+ ] }) })
130
+ ] });
131
+ }
132
+
133
+ export { TimeTrackingPanel };
@@ -0,0 +1,44 @@
1
+ 'use strict';
2
+
3
+ const DEFAULT_FEATURES = {
4
+ timeTracking: true,
5
+ ai: true,
6
+ satisfaction: true,
7
+ chat: true,
8
+ emailTracking: true,
9
+ canned: true,
10
+ merge: true,
11
+ snooze: true,
12
+ externalMessages: true,
13
+ clientHistory: true,
14
+ activityLog: true,
15
+ splitTicket: true,
16
+ scheduledReplies: true,
17
+ autoClose: true,
18
+ autoCloseDays: 7,
19
+ roundRobin: false
20
+ };
21
+ const STORAGE_KEY = "ticketing_features";
22
+ function getFeatures() {
23
+ if (typeof window === "undefined") return DEFAULT_FEATURES;
24
+ try {
25
+ const stored = localStorage.getItem(STORAGE_KEY);
26
+ if (stored) {
27
+ const parsed = JSON.parse(stored);
28
+ return { ...DEFAULT_FEATURES, ...parsed };
29
+ }
30
+ } catch {
31
+ }
32
+ return DEFAULT_FEATURES;
33
+ }
34
+ function saveFeatures(features) {
35
+ if (typeof window === "undefined") return;
36
+ try {
37
+ localStorage.setItem(STORAGE_KEY, JSON.stringify(features));
38
+ } catch {
39
+ }
40
+ }
41
+
42
+ exports.DEFAULT_FEATURES = DEFAULT_FEATURES;
43
+ exports.getFeatures = getFeatures;
44
+ exports.saveFeatures = saveFeatures;
@@ -0,0 +1,41 @@
1
+ "use client";
2
+ const DEFAULT_FEATURES = {
3
+ timeTracking: true,
4
+ ai: true,
5
+ satisfaction: true,
6
+ chat: true,
7
+ emailTracking: true,
8
+ canned: true,
9
+ merge: true,
10
+ snooze: true,
11
+ externalMessages: true,
12
+ clientHistory: true,
13
+ activityLog: true,
14
+ splitTicket: true,
15
+ scheduledReplies: true,
16
+ autoClose: true,
17
+ autoCloseDays: 7,
18
+ roundRobin: false
19
+ };
20
+ const STORAGE_KEY = "ticketing_features";
21
+ function getFeatures() {
22
+ if (typeof window === "undefined") return DEFAULT_FEATURES;
23
+ try {
24
+ const stored = localStorage.getItem(STORAGE_KEY);
25
+ if (stored) {
26
+ const parsed = JSON.parse(stored);
27
+ return { ...DEFAULT_FEATURES, ...parsed };
28
+ }
29
+ } catch {
30
+ }
31
+ return DEFAULT_FEATURES;
32
+ }
33
+ function saveFeatures(features) {
34
+ if (typeof window === "undefined") return;
35
+ try {
36
+ localStorage.setItem(STORAGE_KEY, JSON.stringify(features));
37
+ } catch {
38
+ }
39
+ }
40
+
41
+ export { DEFAULT_FEATURES, getFeatures, saveFeatures };
@@ -0,0 +1,100 @@
1
+ 'use strict';
2
+
3
+ const statusLabels = {
4
+ open: { label: "Ouvert", bg: "#dbeafe", color: "#1e40af" },
5
+ waiting_client: { label: "Attente", bg: "#fef3c7", color: "#92400e" },
6
+ resolved: { label: "R\xE9solu", bg: "#dcfce7", color: "#166534" }
7
+ };
8
+ const projectStatusLabels = {
9
+ active: { label: "Actif", bg: "#dcfce7", color: "#166534" },
10
+ paused: { label: "En pause", bg: "#fef3c7", color: "#92400e" },
11
+ completed: { label: "Termin\xE9", bg: "#e5e7eb", color: "#374151" }
12
+ };
13
+ const C = {
14
+ blue: "#2563eb",
15
+ amber: "#d97706",
16
+ orange: "#ea580c",
17
+ black: "var(--theme-text)",
18
+ white: "#fff",
19
+ bg: "#fafafa",
20
+ textPrimary: "var(--theme-text)",
21
+ textSecondary: "#6b7280",
22
+ textMuted: "#9ca3af",
23
+ border: "#e2e8f0",
24
+ statusOpen: "#2563eb",
25
+ statusProgress: "#ea580c",
26
+ statusWaiting: "#d97706",
27
+ statusResolved: "#16a34a",
28
+ statusClosed: "#6b7280",
29
+ adminBg: "#f8fafc",
30
+ adminBorder: "#2563eb",
31
+ clientBg: "#fafafa",
32
+ clientBorder: "#e2e8f0",
33
+ emailBg: "#fffbeb",
34
+ emailBorder: "#ea580c",
35
+ internalBg: "#fefce8",
36
+ internalBorder: "#d97706"
37
+ };
38
+ const s = {
39
+ section: { borderTop: `1px solid ${C.border}`, paddingTop: "18px", marginTop: "20px" },
40
+ sectionTitle: { fontSize: "14px", fontWeight: 600, marginBottom: "12px", display: "flex", alignItems: "center", gap: "8px" },
41
+ btn: (bg, disabled) => {
42
+ const hex = bg.replace("#", "");
43
+ const r = parseInt(hex.substring(0, 2), 16) || 0;
44
+ const g = parseInt(hex.substring(2, 4), 16) || 0;
45
+ const b = parseInt(hex.substring(4, 6), 16) || 0;
46
+ const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;
47
+ const textColor = luminance > 0.6 ? "#374151" : C.white;
48
+ return {
49
+ padding: "7px 14px",
50
+ borderRadius: "6px",
51
+ border: `1px solid ${C.border}`,
52
+ backgroundColor: bg,
53
+ color: textColor,
54
+ fontWeight: 600,
55
+ fontSize: "13px",
56
+ cursor: disabled ? "not-allowed" : "pointer",
57
+ opacity: disabled ? 0.5 : 1,
58
+ whiteSpace: "nowrap"
59
+ };
60
+ },
61
+ ghostBtn: (color, disabled) => ({
62
+ padding: "7px 14px",
63
+ borderRadius: "6px",
64
+ border: `1px solid ${C.border}`,
65
+ backgroundColor: "transparent",
66
+ color,
67
+ fontWeight: 600,
68
+ fontSize: "13px",
69
+ cursor: disabled ? "not-allowed" : "pointer",
70
+ opacity: disabled ? 0.5 : 1,
71
+ whiteSpace: "nowrap"
72
+ }),
73
+ outlineBtn: (color, disabled) => ({
74
+ padding: "7px 14px",
75
+ borderRadius: "6px",
76
+ border: `1px solid ${color}`,
77
+ backgroundColor: "transparent",
78
+ color,
79
+ fontWeight: 600,
80
+ fontSize: "13px",
81
+ cursor: disabled ? "not-allowed" : "pointer",
82
+ opacity: disabled ? 0.5 : 1,
83
+ whiteSpace: "nowrap"
84
+ }),
85
+ input: { padding: "8px 12px", borderRadius: "6px", border: `1px solid ${C.border}`, fontSize: "14px", color: "#374151", backgroundColor: C.white },
86
+ badge: (bg, color) => ({
87
+ display: "inline-block",
88
+ padding: "2px 8px",
89
+ borderRadius: "4px",
90
+ fontSize: "11px",
91
+ fontWeight: 600,
92
+ backgroundColor: bg,
93
+ color
94
+ })
95
+ };
96
+
97
+ exports.C = C;
98
+ exports.projectStatusLabels = projectStatusLabels;
99
+ exports.s = s;
100
+ exports.statusLabels = statusLabels;
@@ -0,0 +1,96 @@
1
+ "use client";
2
+ const statusLabels = {
3
+ open: { label: "Ouvert", bg: "#dbeafe", color: "#1e40af" },
4
+ waiting_client: { label: "Attente", bg: "#fef3c7", color: "#92400e" },
5
+ resolved: { label: "R\xE9solu", bg: "#dcfce7", color: "#166534" }
6
+ };
7
+ const projectStatusLabels = {
8
+ active: { label: "Actif", bg: "#dcfce7", color: "#166534" },
9
+ paused: { label: "En pause", bg: "#fef3c7", color: "#92400e" },
10
+ completed: { label: "Termin\xE9", bg: "#e5e7eb", color: "#374151" }
11
+ };
12
+ const C = {
13
+ blue: "#2563eb",
14
+ amber: "#d97706",
15
+ orange: "#ea580c",
16
+ black: "var(--theme-text)",
17
+ white: "#fff",
18
+ bg: "#fafafa",
19
+ textPrimary: "var(--theme-text)",
20
+ textSecondary: "#6b7280",
21
+ textMuted: "#9ca3af",
22
+ border: "#e2e8f0",
23
+ statusOpen: "#2563eb",
24
+ statusProgress: "#ea580c",
25
+ statusWaiting: "#d97706",
26
+ statusResolved: "#16a34a",
27
+ statusClosed: "#6b7280",
28
+ adminBg: "#f8fafc",
29
+ adminBorder: "#2563eb",
30
+ clientBg: "#fafafa",
31
+ clientBorder: "#e2e8f0",
32
+ emailBg: "#fffbeb",
33
+ emailBorder: "#ea580c",
34
+ internalBg: "#fefce8",
35
+ internalBorder: "#d97706"
36
+ };
37
+ const s = {
38
+ section: { borderTop: `1px solid ${C.border}`, paddingTop: "18px", marginTop: "20px" },
39
+ sectionTitle: { fontSize: "14px", fontWeight: 600, marginBottom: "12px", display: "flex", alignItems: "center", gap: "8px" },
40
+ btn: (bg, disabled) => {
41
+ const hex = bg.replace("#", "");
42
+ const r = parseInt(hex.substring(0, 2), 16) || 0;
43
+ const g = parseInt(hex.substring(2, 4), 16) || 0;
44
+ const b = parseInt(hex.substring(4, 6), 16) || 0;
45
+ const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;
46
+ const textColor = luminance > 0.6 ? "#374151" : C.white;
47
+ return {
48
+ padding: "7px 14px",
49
+ borderRadius: "6px",
50
+ border: `1px solid ${C.border}`,
51
+ backgroundColor: bg,
52
+ color: textColor,
53
+ fontWeight: 600,
54
+ fontSize: "13px",
55
+ cursor: disabled ? "not-allowed" : "pointer",
56
+ opacity: disabled ? 0.5 : 1,
57
+ whiteSpace: "nowrap"
58
+ };
59
+ },
60
+ ghostBtn: (color, disabled) => ({
61
+ padding: "7px 14px",
62
+ borderRadius: "6px",
63
+ border: `1px solid ${C.border}`,
64
+ backgroundColor: "transparent",
65
+ color,
66
+ fontWeight: 600,
67
+ fontSize: "13px",
68
+ cursor: disabled ? "not-allowed" : "pointer",
69
+ opacity: disabled ? 0.5 : 1,
70
+ whiteSpace: "nowrap"
71
+ }),
72
+ outlineBtn: (color, disabled) => ({
73
+ padding: "7px 14px",
74
+ borderRadius: "6px",
75
+ border: `1px solid ${color}`,
76
+ backgroundColor: "transparent",
77
+ color,
78
+ fontWeight: 600,
79
+ fontSize: "13px",
80
+ cursor: disabled ? "not-allowed" : "pointer",
81
+ opacity: disabled ? 0.5 : 1,
82
+ whiteSpace: "nowrap"
83
+ }),
84
+ input: { padding: "8px 12px", borderRadius: "6px", border: `1px solid ${C.border}`, fontSize: "14px", color: "#374151", backgroundColor: C.white },
85
+ badge: (bg, color) => ({
86
+ display: "inline-block",
87
+ padding: "2px 8px",
88
+ borderRadius: "4px",
89
+ fontSize: "11px",
90
+ fontWeight: 600,
91
+ backgroundColor: bg,
92
+ color
93
+ })
94
+ };
95
+
96
+ export { C, projectStatusLabels, s, statusLabels };
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ var react = require('react');
4
+
5
+ const TicketContext = react.createContext(null);
6
+ function useTicketContext() {
7
+ const ctx = react.useContext(TicketContext);
8
+ if (!ctx) throw new Error("useTicketContext must be used within TicketContext.Provider");
9
+ return ctx;
10
+ }
11
+
12
+ exports.TicketContext = TicketContext;
13
+ exports.useTicketContext = useTicketContext;
@@ -0,0 +1,11 @@
1
+ "use client";
2
+ import { createContext, useContext } from 'react';
3
+
4
+ const TicketContext = createContext(null);
5
+ function useTicketContext() {
6
+ const ctx = useContext(TicketContext);
7
+ if (!ctx) throw new Error("useTicketContext must be used within TicketContext.Provider");
8
+ return ctx;
9
+ }
10
+
11
+ export { TicketContext, useTicketContext };