@sonatel-os/strapi-plugin-split 0.0.0-stage → 0.2.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.
@@ -0,0 +1,465 @@
1
+ "use strict";
2
+ const jsxRuntime = require("react/jsx-runtime");
3
+ const react = require("react");
4
+ const designSystem = require("@strapi/design-system");
5
+ const icons = require("@strapi/icons");
6
+ require("@strapi/icons/symbols");
7
+ const reactRouterDom = require("react-router-dom");
8
+ const styledComponents = require("styled-components");
9
+ const admin = require("@strapi/strapi/admin");
10
+ const index = require("./index-oyRhs5fN.js");
11
+ const SPRING = "cubic-bezier(0.32, 0.72, 0, 1)";
12
+ const rise = styledComponents.keyframes`
13
+ from { opacity: 0; transform: translateY(14px); filter: blur(6px); }
14
+ to { opacity: 1; transform: translateY(0); filter: blur(0); }
15
+ `;
16
+ const reveal = styledComponents.css`
17
+ animation: ${rise} 720ms ${SPRING} both;
18
+ animation-delay: calc(var(--i, 0) * 70ms);
19
+ @media (prefers-reduced-motion: reduce) {
20
+ animation: none;
21
+ }
22
+ `;
23
+ const Shell = styledComponents.styled.div`
24
+ ${reveal};
25
+ width: 100%;
26
+ height: 100%;
27
+ background: ${({ theme }) => theme.colors.neutral150};
28
+ border: 1px solid ${({ theme }) => theme.colors.neutral150};
29
+ border-radius: 2rem;
30
+ padding: 0.5rem;
31
+ box-shadow:
32
+ 0 1px 2px rgba(33, 33, 52, 0.04),
33
+ 0 18px 40px -24px rgba(33, 33, 52, 0.22);
34
+ transition:
35
+ transform 480ms ${SPRING},
36
+ box-shadow 480ms ${SPRING};
37
+ ${({ $hover }) => $hover && styledComponents.css`
38
+ cursor: pointer;
39
+ &:hover {
40
+ transform: translateY(-3px);
41
+ box-shadow:
42
+ 0 1px 2px rgba(33, 33, 52, 0.04),
43
+ 0 28px 56px -24px rgba(33, 33, 52, 0.28);
44
+ }
45
+ &:active {
46
+ transform: translateY(-1px) scale(0.995);
47
+ }
48
+ `}
49
+ `;
50
+ const Core = styledComponents.styled(designSystem.Box)`
51
+ position: relative;
52
+ background: ${({ theme }) => theme.colors.neutral0};
53
+ border-radius: calc(2rem - 0.5rem);
54
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
55
+ height: 100%;
56
+ ${({ $accent }) => $accent && styledComponents.css`
57
+ overflow: hidden;
58
+ &::before {
59
+ content: '';
60
+ position: absolute;
61
+ top: -60px;
62
+ right: -60px;
63
+ width: 180px;
64
+ height: 180px;
65
+ border-radius: 50%;
66
+ background: radial-gradient(circle, ${$accent}33 0%, ${$accent}00 70%);
67
+ pointer-events: none;
68
+ }
69
+ `}
70
+ `;
71
+ const Card = ({ style, onClick, className, accent, hover, index: index2, children, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx(
72
+ Shell,
73
+ {
74
+ style: { ...index2 != null ? { "--i": index2 } : {}, ...style },
75
+ onClick,
76
+ className,
77
+ $hover: Boolean(hover || onClick),
78
+ children: /* @__PURE__ */ jsxRuntime.jsx(Core, { $accent: accent, ...rest, children })
79
+ }
80
+ );
81
+ const Eyebrow = styledComponents.styled(designSystem.Typography).attrs({ variant: "sigma", tag: "p" })`
82
+ letter-spacing: 0.18em;
83
+ text-transform: uppercase;
84
+ font-size: 1rem;
85
+ color: ${({ theme }) => theme.colors.neutral500};
86
+ `;
87
+ const Section = ({ title, eyebrow, help, aside, children, index: index2, accent, ...rest }) => /* @__PURE__ */ jsxRuntime.jsxs(Card, { padding: 6, index: index2, accent, ...rest, children: [
88
+ title || aside ? /* @__PURE__ */ jsxRuntime.jsxs(
89
+ designSystem.Flex,
90
+ {
91
+ justifyContent: "space-between",
92
+ alignItems: "flex-start",
93
+ paddingBottom: help ? 2 : 5,
94
+ gap: 4,
95
+ children: [
96
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
97
+ eyebrow ? /* @__PURE__ */ jsxRuntime.jsx(Eyebrow, { paddingBottom: 1, children: eyebrow }) : null,
98
+ typeof title === "string" ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "delta", tag: "h2", fontWeight: "bold", children: title }) : title
99
+ ] }),
100
+ aside
101
+ ]
102
+ }
103
+ ) : null,
104
+ help ? /* @__PURE__ */ jsxRuntime.jsx(
105
+ designSystem.Typography,
106
+ {
107
+ variant: "pi",
108
+ textColor: "neutral600",
109
+ tag: "p",
110
+ paddingBottom: 5,
111
+ style: { maxWidth: "72ch" },
112
+ children: help
113
+ }
114
+ ) : null,
115
+ children
116
+ ] });
117
+ const Big = styledComponents.styled(designSystem.Typography)`
118
+ font-size: 3.2rem;
119
+ line-height: 1;
120
+ font-weight: 700;
121
+ letter-spacing: -0.035em;
122
+ font-variant-numeric: tabular-nums;
123
+ `;
124
+ const StatTile = ({ label, value, hint, accent, icon, index: index2, children }) => /* @__PURE__ */ jsxRuntime.jsxs(Card, { padding: 5, accent, index: index2, children: [
125
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "center", children: [
126
+ /* @__PURE__ */ jsxRuntime.jsx(Eyebrow, { children: label }),
127
+ icon ? /* @__PURE__ */ jsxRuntime.jsx(
128
+ designSystem.Box,
129
+ {
130
+ style: {
131
+ color: accent ?? "#8E8EA9",
132
+ display: "inline-flex",
133
+ width: 32,
134
+ height: 32,
135
+ borderRadius: 10,
136
+ alignItems: "center",
137
+ justifyContent: "center",
138
+ background: `${accent ?? "#8E8EA9"}14`
139
+ },
140
+ children: icon
141
+ }
142
+ ) : null
143
+ ] }),
144
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingTop: 4, paddingBottom: 1, children: /* @__PURE__ */ jsxRuntime.jsx(Big, { tag: "p", children: value }) }),
145
+ hint ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral500", tag: "p", children: hint }) : null,
146
+ children
147
+ ] });
148
+ const PillBtn = styledComponents.styled.button`
149
+ display: inline-flex;
150
+ align-items: center;
151
+ gap: 1rem;
152
+ padding: 0.4rem 0.4rem 0.4rem 1.6rem;
153
+ border-radius: 999px;
154
+ border: 0;
155
+ cursor: pointer;
156
+ font: inherit;
157
+ font-size: 1.4rem;
158
+ font-weight: 600;
159
+ color: ${({ theme, $tone }) => $tone === "light" ? theme.colors.neutral800 : theme.colors.neutral0};
160
+ background: ${({ theme, $tone }) => $tone === "light" ? theme.colors.neutral0 : theme.colors.neutral800};
161
+ box-shadow:
162
+ inset 0 1px 0 rgba(255, 255, 255, 0.12),
163
+ 0 10px 24px -12px rgba(33, 33, 52, 0.45);
164
+ transition:
165
+ transform 420ms ${SPRING},
166
+ box-shadow 420ms ${SPRING};
167
+ span.disc {
168
+ display: inline-flex;
169
+ align-items: center;
170
+ justify-content: center;
171
+ width: 3rem;
172
+ height: 3rem;
173
+ border-radius: 50%;
174
+ background: ${({ $tone }) => $tone === "light" ? "rgba(33,33,52,0.06)" : "rgba(255,255,255,0.14)"};
175
+ transition: transform 420ms ${SPRING};
176
+ svg {
177
+ width: 1.4rem;
178
+ height: 1.4rem;
179
+ }
180
+ }
181
+ &:hover {
182
+ transform: translateY(-1px);
183
+ box-shadow:
184
+ inset 0 1px 0 rgba(255, 255, 255, 0.12),
185
+ 0 16px 30px -12px rgba(33, 33, 52, 0.5);
186
+ }
187
+ &:hover span.disc {
188
+ transform: translate(2px, -1px) scale(1.06);
189
+ }
190
+ &:active {
191
+ transform: scale(0.98);
192
+ }
193
+ `;
194
+ const Pill = ({ children, onClick, tone = "dark", icon = /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowRight, {}) }) => /* @__PURE__ */ jsxRuntime.jsxs(PillBtn, { type: "button", onClick, $tone: tone, children: [
195
+ children,
196
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "disc", "aria-hidden": true, children: icon })
197
+ ] });
198
+ styledComponents.styled.span`
199
+ display: inline-block;
200
+ width: 10px;
201
+ height: 10px;
202
+ border-radius: 50%;
203
+ background: ${({ $color }) => $color};
204
+ box-shadow:
205
+ 0 0 0 2px ${({ theme }) => theme.colors.neutral0},
206
+ 0 0 0 3px ${({ $color }) => $color}33;
207
+ `;
208
+ const STATUS_LABEL = {
209
+ active: "Active",
210
+ inactive: "Inactive",
211
+ archived: "Archived",
212
+ pending: "Pending",
213
+ confirmed: "Confirmed",
214
+ rejected: "Rejected",
215
+ cancelled: "Cancelled"
216
+ };
217
+ const StatusBadge = ({ status, label }) => {
218
+ const map = {
219
+ active: "success",
220
+ live: "success",
221
+ open: "success",
222
+ pending: "warning",
223
+ scheduled: "warning",
224
+ fulfilled: "success",
225
+ accepted: "success",
226
+ confirmed: "success",
227
+ draft: "secondary",
228
+ archived: "neutral",
229
+ inactive: "neutral",
230
+ closed: "neutral",
231
+ cancelled: "danger",
232
+ rejected: "danger",
233
+ expired: "neutral"
234
+ };
235
+ const v = map[status] ?? "neutral";
236
+ return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { backgroundColor: `${v}100`, textColor: `${v}700`, size: "S", children: label ?? STATUS_LABEL[status] ?? status });
237
+ };
238
+ const Mono = styledComponents.styled(designSystem.Typography)`
239
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
240
+ letter-spacing: 0.04em;
241
+ font-variant-numeric: tabular-nums;
242
+ `;
243
+ const Bar = ({ value, max, color }) => {
244
+ const w = max ? Math.min(100, Math.round(value / max * 100)) : 0;
245
+ return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { background: "neutral150", hasRadius: true, style: { height: 8, overflow: "hidden" }, children: /* @__PURE__ */ jsxRuntime.jsx(
246
+ designSystem.Box,
247
+ {
248
+ style: {
249
+ width: `${w}%`,
250
+ height: "100%",
251
+ borderRadius: 999,
252
+ background: color ? `linear-gradient(90deg, ${color}, ${color}cc)` : "linear-gradient(90deg, #FF7900, #FACC15)",
253
+ transition: `width 700ms ${SPRING}`
254
+ }
255
+ }
256
+ ) });
257
+ };
258
+ const introKey = (k) => `split.intro.${k}`;
259
+ const recallCollapsed = (k) => {
260
+ try {
261
+ return window.localStorage.getItem(introKey(k)) === "1";
262
+ } catch {
263
+ return false;
264
+ }
265
+ };
266
+ const rememberCollapsed = (k, v) => {
267
+ try {
268
+ if (v) window.localStorage.setItem(introKey(k), "1");
269
+ else window.localStorage.removeItem(introKey(k));
270
+ } catch {
271
+ }
272
+ };
273
+ const IntroShell = styledComponents.styled.div`
274
+ ${reveal};
275
+ position: relative;
276
+ overflow: hidden;
277
+ border-radius: 2rem;
278
+ padding: 0.5rem;
279
+ background: linear-gradient(135deg, #eef0ff 0%, #f6f6f9 55%, #fff4ea 100%);
280
+ box-shadow: 0 18px 40px -28px rgba(73, 69, 255, 0.35);
281
+ `;
282
+ const IntroCore = styledComponents.styled.div`
283
+ position: relative;
284
+ border-radius: calc(2rem - 0.5rem);
285
+ background: rgba(255, 255, 255, 0.72);
286
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
287
+ padding: ${({ $collapsed }) => $collapsed ? "1rem 1.6rem" : "2.4rem 2.8rem"};
288
+ transition: padding 420ms ${SPRING};
289
+ `;
290
+ const StepNo = styledComponents.styled.span`
291
+ display: inline-flex;
292
+ align-items: center;
293
+ justify-content: center;
294
+ width: 2.4rem;
295
+ height: 2.4rem;
296
+ border-radius: 50%;
297
+ flex-shrink: 0;
298
+ font-size: 1.1rem;
299
+ font-weight: 700;
300
+ background: ${({ theme }) => theme.colors.neutral800};
301
+ color: ${({ theme }) => theme.colors.neutral0};
302
+ `;
303
+ const Intro = ({ id, title, body = [], steps = [], links = [] }) => {
304
+ const navigate = reactRouterDom.useNavigate();
305
+ const [collapsed, setCollapsed] = react.useState(() => recallCollapsed(id));
306
+ const toggle = () => {
307
+ rememberCollapsed(id, !collapsed);
308
+ setCollapsed(!collapsed);
309
+ };
310
+ return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { marginBottom: 7, children: /* @__PURE__ */ jsxRuntime.jsx(IntroShell, { children: /* @__PURE__ */ jsxRuntime.jsxs(IntroCore, { $collapsed: collapsed, children: [
311
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "center", gap: 4, children: [
312
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 3, alignItems: "center", children: [
313
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { color: "#4945FF", display: "flex" }, children: /* @__PURE__ */ jsxRuntime.jsx(icons.Lightbulb, { width: "1.8rem", height: "1.8rem" }) }),
314
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
315
+ collapsed ? null : /* @__PURE__ */ jsxRuntime.jsx(Eyebrow, { children: "Guide" }),
316
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: collapsed ? "omega" : "beta", fontWeight: "bold", tag: "h2", children: title })
317
+ ] })
318
+ ] }),
319
+ /* @__PURE__ */ jsxRuntime.jsx(
320
+ designSystem.Button,
321
+ {
322
+ variant: "ghost",
323
+ size: "S",
324
+ onClick: toggle,
325
+ endIcon: collapsed ? /* @__PURE__ */ jsxRuntime.jsx(icons.ChevronDown, {}) : /* @__PURE__ */ jsxRuntime.jsx(icons.ChevronUp, {}),
326
+ children: collapsed ? "Show the guide" : "Hide"
327
+ }
328
+ )
329
+ ] }),
330
+ collapsed ? null : /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 10, alignItems: "flex-start", paddingTop: 4, wrap: "wrap", children: [
331
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { style: { flex: "2 1 360px", minWidth: 0 }, children: [
332
+ body.map((p, i) => /* @__PURE__ */ jsxRuntime.jsx(
333
+ designSystem.Typography,
334
+ {
335
+ tag: "p",
336
+ textColor: "neutral700",
337
+ paddingBottom: 3,
338
+ style: { maxWidth: "68ch", lineHeight: 1.6 },
339
+ children: p
340
+ },
341
+ i
342
+ )),
343
+ links.length ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { gap: 3, paddingTop: 2, wrap: "wrap", children: links.map((l) => /* @__PURE__ */ jsxRuntime.jsx(Pill, { tone: "light", onClick: () => navigate(l.to), children: l.label }, l.to)) }) : null
344
+ ] }),
345
+ steps.length ? /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { style: { flex: "1 1 260px", minWidth: 0 }, children: [
346
+ /* @__PURE__ */ jsxRuntime.jsx(Eyebrow, { paddingBottom: 3, children: "How to" }),
347
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 3, children: steps.map((s, i) => {
348
+ const label = typeof s === "string" ? s : s.label;
349
+ const to = typeof s === "string" ? null : s.to;
350
+ return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 3, alignItems: "center", children: [
351
+ /* @__PURE__ */ jsxRuntime.jsx(StepNo, { children: i + 1 }),
352
+ to ? /* @__PURE__ */ jsxRuntime.jsx(
353
+ designSystem.Button,
354
+ {
355
+ variant: "ghost",
356
+ size: "S",
357
+ onClick: () => navigate(to),
358
+ style: { padding: 0 },
359
+ children: label
360
+ }
361
+ ) : /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", children: label })
362
+ ] }, i);
363
+ }) })
364
+ ] }) : null
365
+ ] })
366
+ ] }) }) });
367
+ };
368
+ styledComponents.styled(designSystem.Flex)`
369
+ border-top: 1px solid ${({ theme }) => theme.colors.neutral150};
370
+ &:first-child {
371
+ border-top: none;
372
+ }
373
+ `;
374
+ styledComponents.styled.span`
375
+ display: inline-flex;
376
+ width: 2.4rem;
377
+ height: 2.4rem;
378
+ border-radius: 50%;
379
+ border: 2px solid ${({ theme }) => theme.colors.neutral300};
380
+ flex-shrink: 0;
381
+ `;
382
+ const BASE = `/${index.PLUGIN_ID}`;
383
+ const TAG = Object.freeze({ DASH: "SplitDashboard", GROUP: "SplitGroup", PERSON: "SplitPerson" });
384
+ const unwrap = (res) => res && typeof res === "object" && "data" in res ? res.data : res;
385
+ const qs = (params = {}) => {
386
+ const clean = Object.fromEntries(
387
+ Object.entries(params).filter(([, v]) => v !== void 0 && v !== null && v !== "")
388
+ );
389
+ const s = new URLSearchParams(clean).toString();
390
+ return s ? `?${s}` : "";
391
+ };
392
+ const enc = encodeURIComponent;
393
+ const api = admin.adminApi.enhanceEndpoints({ addTagTypes: Object.values(TAG) }).injectEndpoints({
394
+ endpoints: (b) => ({
395
+ getDashboard: b.query({
396
+ query: () => `${BASE}/dashboard`,
397
+ transformResponse: unwrap,
398
+ providesTags: [TAG.DASH]
399
+ }),
400
+ getGroups: b.query({ query: (p) => `${BASE}/groups${qs(p)}`, providesTags: [TAG.GROUP] }),
401
+ getGroup: b.query({
402
+ query: (id) => `${BASE}/groups/${enc(id)}`,
403
+ transformResponse: unwrap,
404
+ providesTags: (_r, _e, id) => [{ type: TAG.GROUP, id }]
405
+ }),
406
+ archiveGroup: b.mutation({
407
+ query: (id) => ({ url: `${BASE}/groups/${enc(id)}/archive`, method: "POST" }),
408
+ invalidatesTags: (_r, _e, id) => [TAG.GROUP, { type: TAG.GROUP, id }, TAG.DASH]
409
+ }),
410
+ getPeople: b.query({ query: (p) => `${BASE}/people${qs(p)}`, providesTags: [TAG.PERSON] }),
411
+ getPerson: b.query({
412
+ query: (id) => `${BASE}/people/${enc(id)}`,
413
+ transformResponse: unwrap,
414
+ providesTags: (_r, _e, id) => [{ type: TAG.PERSON, id }]
415
+ }),
416
+ revealPhone: b.mutation({
417
+ query: (id) => ({ url: `${BASE}/people/${enc(id)}/phone`, method: "GET" }),
418
+ transformResponse: unwrap
419
+ }),
420
+ setPersonActive: b.mutation({
421
+ query: ({ id, isActive }) => ({
422
+ url: `${BASE}/people/${enc(id)}/active`,
423
+ method: "PUT",
424
+ data: { data: { isActive } }
425
+ }),
426
+ invalidatesTags: (_r, _e, { id }) => [TAG.PERSON, { type: TAG.PERSON, id }]
427
+ }),
428
+ getSettlements: b.query({ query: (p) => `${BASE}/settlements${qs(p)}` }),
429
+ getEvents: b.query({ query: (p) => `${BASE}/events${qs(p)}` }),
430
+ getSettings: b.query({ query: () => `${BASE}/settings`, transformResponse: unwrap })
431
+ }),
432
+ overrideExisting: true
433
+ });
434
+ const {
435
+ useGetDashboardQuery,
436
+ useGetGroupsQuery,
437
+ useGetGroupQuery,
438
+ useArchiveGroupMutation,
439
+ useGetPeopleQuery,
440
+ useGetPersonQuery,
441
+ useRevealPhoneMutation,
442
+ useSetPersonActiveMutation,
443
+ useGetSettlementsQuery,
444
+ useGetEventsQuery,
445
+ useGetSettingsQuery
446
+ } = api;
447
+ exports.Bar = Bar;
448
+ exports.Eyebrow = Eyebrow;
449
+ exports.Intro = Intro;
450
+ exports.Mono = Mono;
451
+ exports.SPRING = SPRING;
452
+ exports.Section = Section;
453
+ exports.StatTile = StatTile;
454
+ exports.StatusBadge = StatusBadge;
455
+ exports.useArchiveGroupMutation = useArchiveGroupMutation;
456
+ exports.useGetDashboardQuery = useGetDashboardQuery;
457
+ exports.useGetEventsQuery = useGetEventsQuery;
458
+ exports.useGetGroupQuery = useGetGroupQuery;
459
+ exports.useGetGroupsQuery = useGetGroupsQuery;
460
+ exports.useGetPeopleQuery = useGetPeopleQuery;
461
+ exports.useGetPersonQuery = useGetPersonQuery;
462
+ exports.useGetSettingsQuery = useGetSettingsQuery;
463
+ exports.useGetSettlementsQuery = useGetSettlementsQuery;
464
+ exports.useRevealPhoneMutation = useRevealPhoneMutation;
465
+ exports.useSetPersonActiveMutation = useSetPersonActiveMutation;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const en = {
4
+ "menu.label": "Split",
5
+ "settings.title": "Split",
6
+ "settings.link": "Configuration",
7
+ "nav.dashboard": "Dashboard",
8
+ "nav.groups": "Groups",
9
+ "nav.people": "People",
10
+ "nav.settlements": "Settlements",
11
+ "nav.audit": "Audit trail"
12
+ };
13
+ exports.default = en;
@@ -0,0 +1,13 @@
1
+ const en = {
2
+ "menu.label": "Split",
3
+ "settings.title": "Split",
4
+ "settings.link": "Configuration",
5
+ "nav.dashboard": "Dashboard",
6
+ "nav.groups": "Groups",
7
+ "nav.people": "People",
8
+ "nav.settlements": "Settlements",
9
+ "nav.audit": "Audit trail"
10
+ };
11
+ export {
12
+ en as default
13
+ };
@@ -0,0 +1,13 @@
1
+ const fr = {
2
+ "menu.label": "Split",
3
+ "settings.title": "Split",
4
+ "settings.link": "Configuration",
5
+ "nav.dashboard": "Tableau de bord",
6
+ "nav.groups": "Groupes",
7
+ "nav.people": "Personnes",
8
+ "nav.settlements": "Règlements",
9
+ "nav.audit": "Journal d'audit"
10
+ };
11
+ export {
12
+ fr as default
13
+ };
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const fr = {
4
+ "menu.label": "Split",
5
+ "settings.title": "Split",
6
+ "settings.link": "Configuration",
7
+ "nav.dashboard": "Tableau de bord",
8
+ "nav.groups": "Groupes",
9
+ "nav.people": "Personnes",
10
+ "nav.settlements": "Règlements",
11
+ "nav.audit": "Journal d'audit"
12
+ };
13
+ exports.default = fr;
@@ -0,0 +1,98 @@
1
+ import { useRef, useEffect } from "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { PriceTag } from "@strapi/icons";
4
+ const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
5
+ const v = glob[path];
6
+ if (v) {
7
+ return typeof v === "function" ? v() : Promise.resolve(v);
8
+ }
9
+ return new Promise((_, reject) => {
10
+ (typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
11
+ reject.bind(
12
+ null,
13
+ new Error(
14
+ "Unknown variable dynamic import: " + path + (path.split("/").length !== segs ? ". Note that variables only represent file names one level deep." : "")
15
+ )
16
+ )
17
+ );
18
+ });
19
+ };
20
+ const PLUGIN_ID = "split";
21
+ const Initializer = ({ setPlugin }) => {
22
+ const ref = useRef(setPlugin);
23
+ useEffect(() => {
24
+ ref.current(PLUGIN_ID);
25
+ }, []);
26
+ return null;
27
+ };
28
+ const PluginIcon = () => /* @__PURE__ */ jsx(PriceTag, {});
29
+ const fqn = (uid) => `plugin::${PLUGIN_ID}.${uid}`;
30
+ const one = (uid) => [{ action: fqn(uid), subject: null }];
31
+ const PERMISSIONS = Object.freeze({
32
+ access: one("access"),
33
+ dashboardRead: one("dashboard.read"),
34
+ groupsRead: one("groups.read"),
35
+ groupsWrite: one("groups.write"),
36
+ peopleRead: one("people.read"),
37
+ peoplePhone: one("people.phone"),
38
+ peopleWrite: one("people.write"),
39
+ settlementsRead: one("settlements.read"),
40
+ auditRead: one("audit.read"),
41
+ settingsRead: one("settings.read")
42
+ });
43
+ const prefixPluginTranslations = (dictionary, pluginId) => Object.keys(dictionary).reduce((acc, key) => {
44
+ acc[`${pluginId}.${key}`] = dictionary[key];
45
+ return acc;
46
+ }, {});
47
+ const index = {
48
+ register(app) {
49
+ app.addMenuLink({
50
+ to: `plugins/${PLUGIN_ID}`,
51
+ icon: PluginIcon,
52
+ intlLabel: { id: `${PLUGIN_ID}.menu.label`, defaultMessage: "Split" },
53
+ permissions: PERMISSIONS.access,
54
+ Component: async () => {
55
+ const { App } = await import("./App-8QwzQSyg.mjs");
56
+ return App;
57
+ }
58
+ });
59
+ app.createSettingSection(
60
+ { id: PLUGIN_ID, intlLabel: { id: `${PLUGIN_ID}.settings.title`, defaultMessage: "Split" } },
61
+ [
62
+ {
63
+ id: `${PLUGIN_ID}-settings`,
64
+ to: PLUGIN_ID,
65
+ intlLabel: { id: `${PLUGIN_ID}.settings.link`, defaultMessage: "Configuration" },
66
+ permissions: PERMISSIONS.settingsRead,
67
+ Component: async () => {
68
+ const { SettingsPage } = await import("./SettingsPage-CH92IYGk.mjs");
69
+ return SettingsPage;
70
+ }
71
+ }
72
+ ]
73
+ );
74
+ app.registerPlugin({
75
+ id: PLUGIN_ID,
76
+ initializer: Initializer,
77
+ isReady: false,
78
+ name: PLUGIN_ID
79
+ });
80
+ },
81
+ async registerTrads({ locales }) {
82
+ return Promise.all(
83
+ locales.map(async (locale) => {
84
+ try {
85
+ const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => import("./en-BB-FKqG6.mjs"), "./translations/fr.json": () => import("./fr-CKuK9t8l.mjs") }), `./translations/${locale}.json`, 3);
86
+ return { data: prefixPluginTranslations(data, PLUGIN_ID), locale };
87
+ } catch {
88
+ return { data: {}, locale };
89
+ }
90
+ })
91
+ );
92
+ }
93
+ };
94
+ export {
95
+ PLUGIN_ID as P,
96
+ PERMISSIONS as a,
97
+ index as i
98
+ };