@fonderie/vue-admin-screens 0.7.0 → 0.8.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/dist/index.cjs +115 -58
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +115 -58
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -42,20 +42,49 @@ var import_vue_courier_admin_screens = require("@fonderie/vue-courier-admin-scre
|
|
|
42
42
|
var import_vue14 = require("vue");
|
|
43
43
|
|
|
44
44
|
// src/styles.ts
|
|
45
|
+
var t = {
|
|
46
|
+
text: "var(--fonderie-text,#171717)",
|
|
47
|
+
muted: "var(--fonderie-text-muted,#5c5c5c)",
|
|
48
|
+
bg: "var(--fonderie-bg,#fafafa)",
|
|
49
|
+
surface: "var(--fonderie-surface,#fff)",
|
|
50
|
+
surfaceAlt: "var(--fonderie-surface-alt,#fafafa)",
|
|
51
|
+
border: "var(--fonderie-border,#e0e0e0)",
|
|
52
|
+
borderLight: "var(--fonderie-border-light,#f5f5f5)",
|
|
53
|
+
accent: "var(--fonderie-accent,#00d294)",
|
|
54
|
+
accentStrong: "var(--fonderie-accent-strong,#009767)",
|
|
55
|
+
warning: "var(--fonderie-warning,#f5a623)",
|
|
56
|
+
danger: "var(--fonderie-danger,#e00)",
|
|
57
|
+
font: 'var(--fonderie-font,Inter,"Inter Fallback",-apple-system,BlinkMacSystemFont,"Helvetica Neue",system-ui,sans-serif)',
|
|
58
|
+
mono: 'var(--fonderie-mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace)',
|
|
59
|
+
radius: "var(--fonderie-radius,4px)",
|
|
60
|
+
radiusLg: "var(--fonderie-radius-lg,8px)",
|
|
61
|
+
trackingDisplay: "var(--fonderie-tracking-display,-0.05em)",
|
|
62
|
+
shadowCard: "var(--fonderie-shadow-card,0 2px 3px 0 rgba(0,0,0,.05))"
|
|
63
|
+
};
|
|
45
64
|
var styles = {
|
|
46
65
|
shell: {
|
|
47
66
|
display: "flex",
|
|
48
67
|
minHeight: "100vh",
|
|
49
|
-
fontFamily:
|
|
50
|
-
color:
|
|
68
|
+
fontFamily: t.font,
|
|
69
|
+
color: t.text,
|
|
70
|
+
background: t.bg
|
|
71
|
+
},
|
|
72
|
+
// The sidebar sits on the raised surface against the page canvas, which is
|
|
73
|
+
// what separates the two without a heavy rule between them.
|
|
74
|
+
nav: {
|
|
75
|
+
width: 220,
|
|
76
|
+
borderRight: `1px solid ${t.border}`,
|
|
77
|
+
padding: 16,
|
|
78
|
+
flexShrink: 0,
|
|
79
|
+
background: t.surface
|
|
51
80
|
},
|
|
52
|
-
nav: { width: "220px", borderRight: "1px solid #eee", padding: "16px", flexShrink: 0 },
|
|
53
81
|
navGroup: {
|
|
54
|
-
fontSize:
|
|
82
|
+
fontSize: 11,
|
|
55
83
|
textTransform: "uppercase",
|
|
56
|
-
letterSpacing:
|
|
57
|
-
color:
|
|
58
|
-
margin: "16px 0 6px"
|
|
84
|
+
letterSpacing: 0.6,
|
|
85
|
+
color: t.muted,
|
|
86
|
+
margin: "16px 0 6px",
|
|
87
|
+
fontWeight: 600
|
|
59
88
|
},
|
|
60
89
|
navItem: {
|
|
61
90
|
display: "block",
|
|
@@ -63,51 +92,79 @@ var styles = {
|
|
|
63
92
|
textAlign: "left",
|
|
64
93
|
background: "none",
|
|
65
94
|
border: "none",
|
|
66
|
-
borderRadius:
|
|
95
|
+
borderRadius: t.radius,
|
|
67
96
|
padding: "6px 8px",
|
|
68
97
|
cursor: "pointer",
|
|
69
|
-
fontSize:
|
|
70
|
-
color:
|
|
98
|
+
fontSize: 14,
|
|
99
|
+
color: t.text,
|
|
100
|
+
fontFamily: "inherit"
|
|
101
|
+
},
|
|
102
|
+
navItemActive: { background: t.surfaceAlt, fontWeight: 600, color: t.accentStrong },
|
|
103
|
+
main: { flex: 1, padding: 24, maxWidth: 960 },
|
|
104
|
+
container: { padding: 24, maxWidth: 960 },
|
|
105
|
+
title: {
|
|
106
|
+
fontSize: 20,
|
|
107
|
+
fontWeight: 600,
|
|
108
|
+
marginTop: 0,
|
|
109
|
+
marginBottom: 12,
|
|
110
|
+
letterSpacing: t.trackingDisplay
|
|
71
111
|
},
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
112
|
+
subtitle: {
|
|
113
|
+
fontSize: 15,
|
|
114
|
+
fontWeight: 600,
|
|
115
|
+
marginTop: 24,
|
|
116
|
+
marginBottom: 8,
|
|
117
|
+
letterSpacing: t.trackingDisplay
|
|
118
|
+
},
|
|
119
|
+
status: { padding: 12, color: t.muted },
|
|
120
|
+
error: { color: t.danger, marginBottom: 12, fontSize: 14 },
|
|
121
|
+
ok: { color: t.accentStrong, fontWeight: 600 },
|
|
122
|
+
bad: { color: t.danger, fontWeight: 600 },
|
|
123
|
+
advice: { color: t.warning },
|
|
124
|
+
muted: { color: t.muted, fontSize: 13 },
|
|
125
|
+
mono: { fontFamily: t.mono, fontSize: 13 },
|
|
126
|
+
table: { width: "100%", borderCollapse: "collapse", fontSize: 14 },
|
|
85
127
|
th: {
|
|
86
128
|
textAlign: "left",
|
|
87
|
-
borderBottom:
|
|
129
|
+
borderBottom: `1px solid ${t.border}`,
|
|
88
130
|
padding: "6px 8px",
|
|
89
131
|
fontWeight: 600,
|
|
90
|
-
color:
|
|
132
|
+
color: t.muted
|
|
91
133
|
},
|
|
92
|
-
td: { borderBottom:
|
|
134
|
+
td: { borderBottom: `1px solid ${t.borderLight}`, padding: "6px 8px", verticalAlign: "top" },
|
|
93
135
|
list: { listStyle: "none", padding: 0, margin: 0 },
|
|
94
|
-
row: { borderBottom:
|
|
136
|
+
row: { borderBottom: `1px solid ${t.borderLight}`, padding: "8px 0" },
|
|
95
137
|
badge: {
|
|
96
138
|
display: "inline-block",
|
|
97
|
-
borderRadius:
|
|
139
|
+
borderRadius: 999,
|
|
98
140
|
padding: "1px 8px",
|
|
99
|
-
fontSize:
|
|
100
|
-
background:
|
|
141
|
+
fontSize: 12,
|
|
142
|
+
background: t.surfaceAlt,
|
|
143
|
+
border: `1px solid ${t.border}`,
|
|
144
|
+
color: t.muted
|
|
101
145
|
},
|
|
102
146
|
button: {
|
|
103
|
-
background:
|
|
104
|
-
border:
|
|
105
|
-
borderRadius:
|
|
147
|
+
background: t.surface,
|
|
148
|
+
border: `1px solid ${t.border}`,
|
|
149
|
+
borderRadius: t.radius,
|
|
106
150
|
padding: "4px 10px",
|
|
107
151
|
cursor: "pointer",
|
|
108
|
-
fontSize:
|
|
152
|
+
fontSize: 13,
|
|
153
|
+
color: t.text,
|
|
154
|
+
fontFamily: "inherit",
|
|
155
|
+
boxShadow: t.shadowCard
|
|
156
|
+
},
|
|
157
|
+
toolbar: { display: "flex", gap: 8, alignItems: "center", marginBottom: 12 },
|
|
158
|
+
// Surfaces the screens compose themselves, kept here so a card looks the
|
|
159
|
+
// same on every page rather than being re-invented per screen.
|
|
160
|
+
card: {
|
|
161
|
+
background: t.surface,
|
|
162
|
+
border: `1px solid ${t.border}`,
|
|
163
|
+
borderRadius: t.radiusLg,
|
|
164
|
+
padding: 16,
|
|
165
|
+
boxShadow: t.shadowCard
|
|
109
166
|
},
|
|
110
|
-
|
|
167
|
+
accent: { color: t.accent }
|
|
111
168
|
};
|
|
112
169
|
|
|
113
170
|
// src/screens/AdminLogScreen.ts
|
|
@@ -135,7 +192,7 @@ function table(headers, rows) {
|
|
|
135
192
|
(0, import_vue.h)("thead", [
|
|
136
193
|
(0, import_vue.h)(
|
|
137
194
|
"tr",
|
|
138
|
-
headers.map((
|
|
195
|
+
headers.map((t2) => (0, import_vue.h)("th", { style: styles.th }, t2))
|
|
139
196
|
)
|
|
140
197
|
]),
|
|
141
198
|
(0, import_vue.h)("tbody", rows)
|
|
@@ -554,8 +611,8 @@ var TokensScreen = (0, import_vue9.defineComponent)({
|
|
|
554
611
|
name: name.value.trim(),
|
|
555
612
|
scopes: scopes.value,
|
|
556
613
|
...days.value && Number.isInteger(d) && d > 0 ? { expiresInDays: d } : {}
|
|
557
|
-
}).then((
|
|
558
|
-
minted.value = { name:
|
|
614
|
+
}).then((t2) => {
|
|
615
|
+
minted.value = { name: t2.name, token: t2.token };
|
|
559
616
|
name.value = "";
|
|
560
617
|
days.value = "";
|
|
561
618
|
}).catch(() => {
|
|
@@ -601,35 +658,35 @@ var TokensScreen = (0, import_vue9.defineComponent)({
|
|
|
601
658
|
r?.issued && r.issued.length > 0 ? table(
|
|
602
659
|
["Name", "Scopes", "Created", "Expires", "Last used", ""],
|
|
603
660
|
r.issued.map(
|
|
604
|
-
(
|
|
661
|
+
(t2) => (0, import_vue9.h)("tr", { key: t2.id }, [
|
|
605
662
|
td([
|
|
606
|
-
|
|
607
|
-
|
|
663
|
+
t2.name,
|
|
664
|
+
t2.revokedAt ? (0, import_vue9.h)("span", { style: styles.badge }, " revoked") : ""
|
|
608
665
|
]),
|
|
609
|
-
td(
|
|
666
|
+
td(t2.scopes.join(", "), styles.mono),
|
|
610
667
|
td(
|
|
611
|
-
`${new Date(
|
|
668
|
+
`${new Date(t2.createdAt).toLocaleDateString()} \xB7 ${t2.createdBy}`,
|
|
612
669
|
styles.muted
|
|
613
670
|
),
|
|
614
671
|
td(
|
|
615
|
-
|
|
672
|
+
t2.expiresAt ? new Date(t2.expiresAt).toLocaleDateString() : "never",
|
|
616
673
|
styles.muted
|
|
617
674
|
),
|
|
618
675
|
td(
|
|
619
|
-
|
|
676
|
+
t2.lastUsedAt ? new Date(t2.lastUsedAt).toLocaleString() : "never",
|
|
620
677
|
styles.muted
|
|
621
678
|
),
|
|
622
679
|
td(
|
|
623
|
-
|
|
680
|
+
t2.revokedAt ? "" : (0, import_vue9.h)(
|
|
624
681
|
"button",
|
|
625
682
|
{
|
|
626
683
|
type: "button",
|
|
627
684
|
style: styles.button,
|
|
628
685
|
onClick: () => {
|
|
629
686
|
if (window.confirm(
|
|
630
|
-
`Revoke "${
|
|
687
|
+
`Revoke "${t2.name}"? Anything using it stops working immediately.`
|
|
631
688
|
))
|
|
632
|
-
void revoke(
|
|
689
|
+
void revoke(t2.id).catch(() => {
|
|
633
690
|
});
|
|
634
691
|
}
|
|
635
692
|
},
|
|
@@ -875,7 +932,7 @@ var CatalogScreen = (0, import_vue11.defineComponent)({
|
|
|
875
932
|
{
|
|
876
933
|
style: {
|
|
877
934
|
...styles.mono,
|
|
878
|
-
background: "
|
|
935
|
+
background: "var(--fonderie-surface-alt,#fafafa)",
|
|
879
936
|
padding: "12px",
|
|
880
937
|
overflowX: "auto"
|
|
881
938
|
}
|
|
@@ -935,11 +992,11 @@ var SubscriberScreen = (0, import_vue12.defineComponent)({
|
|
|
935
992
|
const subscriber = (0, import_vue12.ref)(null);
|
|
936
993
|
const list = (0, import_vue_admin11.useAdminSubscribers)(props.client, { limit: props.pageSize });
|
|
937
994
|
const { subscription, wallet, ledger, hasMoreLedger, isLoading, error, loadMoreLedger, grant } = (0, import_vue_admin11.useAdminSubscriber)(props.client, subscriber, { limit: 20 });
|
|
938
|
-
const open = (
|
|
995
|
+
const open = (t2, id) => {
|
|
939
996
|
granted.value = null;
|
|
940
|
-
type.value =
|
|
997
|
+
type.value = t2;
|
|
941
998
|
idInput.value = id;
|
|
942
|
-
subscriber.value = { type:
|
|
999
|
+
subscriber.value = { type: t2, id };
|
|
943
1000
|
};
|
|
944
1001
|
const amount = (0, import_vue12.ref)("");
|
|
945
1002
|
const note = (0, import_vue12.ref)("");
|
|
@@ -1119,11 +1176,11 @@ var SubscriberScreen = (0, import_vue12.defineComponent)({
|
|
|
1119
1176
|
ledger.value.length === 0 ? (0, import_vue12.h)("p", { style: styles.muted }, "Nothing moved yet.") : table(
|
|
1120
1177
|
["When", "Kind", "Amount", "Note"],
|
|
1121
1178
|
ledger.value.map(
|
|
1122
|
-
(
|
|
1123
|
-
td(new Date(
|
|
1124
|
-
td(
|
|
1125
|
-
td(
|
|
1126
|
-
td(
|
|
1179
|
+
(t2) => (0, import_vue12.h)("tr", { key: t2.id }, [
|
|
1180
|
+
td(new Date(t2.createdAt).toLocaleString(), styles.muted),
|
|
1181
|
+
td(t2.type),
|
|
1182
|
+
td(t2.amount, styles.mono),
|
|
1183
|
+
td(t2.description ?? "", styles.muted)
|
|
1127
1184
|
])
|
|
1128
1185
|
)
|
|
1129
1186
|
),
|
|
@@ -1378,7 +1435,7 @@ var AdminShell = (0, import_vue14.defineComponent)({
|
|
|
1378
1435
|
];
|
|
1379
1436
|
return (0, import_vue14.h)(import_vue_courier_admin_screens.TemplateListScreen, {
|
|
1380
1437
|
client: kc,
|
|
1381
|
-
"onSelect-template": (
|
|
1438
|
+
"onSelect-template": (t2) => editing.value = { kind: "template", type: t2.type }
|
|
1382
1439
|
});
|
|
1383
1440
|
}
|
|
1384
1441
|
}
|