@pro-laico/payload-dev-tools 0.0.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/LICENSE.md +22 -0
- package/README.md +9 -0
- package/dist/components/DevToolbar.d.ts +27 -0
- package/dist/components/DevToolbar.d.ts.map +1 -0
- package/dist/components/DevToolbar.js +32 -0
- package/dist/components/DevToolbar.js.map +1 -0
- package/dist/components/DevToolbarClient.d.ts +16 -0
- package/dist/components/DevToolbarClient.d.ts.map +1 -0
- package/dist/components/DevToolbarClient.js +983 -0
- package/dist/components/DevToolbarClient.js.map +1 -0
- package/dist/components/resolveDevChrome.d.ts +33 -0
- package/dist/components/resolveDevChrome.d.ts.map +1 -0
- package/dist/components/resolveDevChrome.js +42 -0
- package/dist/components/resolveDevChrome.js.map +1 -0
- package/dist/components/resolveDevChrome.spec.d.ts +2 -0
- package/dist/components/resolveDevChrome.spec.d.ts.map +1 -0
- package/dist/components/resolveDevChrome.spec.js +98 -0
- package/dist/components/resolveDevChrome.spec.js.map +1 -0
- package/dist/components/styles.d.ts +5 -0
- package/dist/components/styles.d.ts.map +1 -0
- package/dist/components/styles.js +110 -0
- package/dist/components/styles.js.map +1 -0
- package/dist/cookies.d.ts +12 -0
- package/dist/cookies.d.ts.map +1 -0
- package/dist/cookies.js +12 -0
- package/dist/cookies.js.map +1 -0
- package/dist/endpoints/activateIconSet.d.ts +10 -0
- package/dist/endpoints/activateIconSet.d.ts.map +1 -0
- package/dist/endpoints/activateIconSet.js +55 -0
- package/dist/endpoints/activateIconSet.js.map +1 -0
- package/dist/endpoints/dev.d.ts +12 -0
- package/dist/endpoints/dev.d.ts.map +1 -0
- package/dist/endpoints/dev.js +31 -0
- package/dist/endpoints/dev.js.map +1 -0
- package/dist/endpoints/stage.d.ts +14 -0
- package/dist/endpoints/stage.d.ts.map +1 -0
- package/dist/endpoints/stage.js +42 -0
- package/dist/endpoints/stage.js.map +1 -0
- package/dist/harness.d.ts +40 -0
- package/dist/harness.d.ts.map +1 -0
- package/dist/harness.js +30 -0
- package/dist/harness.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/getPayloadClient.d.ts +15 -0
- package/dist/lib/getPayloadClient.d.ts.map +1 -0
- package/dist/lib/getPayloadClient.js +29 -0
- package/dist/lib/getPayloadClient.js.map +1 -0
- package/dist/lib/snapshot.d.ts +89 -0
- package/dist/lib/snapshot.d.ts.map +1 -0
- package/dist/lib/snapshot.js +183 -0
- package/dist/lib/snapshot.js.map +1 -0
- package/dist/next/client.d.ts +27 -0
- package/dist/next/client.d.ts.map +1 -0
- package/dist/next/client.js +275 -0
- package/dist/next/client.js.map +1 -0
- package/dist/next/createDevPage.d.ts +37 -0
- package/dist/next/createDevPage.d.ts.map +1 -0
- package/dist/next/createDevPage.js +287 -0
- package/dist/next/createDevPage.js.map +1 -0
- package/dist/next/pageStyles.d.ts +5 -0
- package/dist/next/pageStyles.d.ts.map +1 -0
- package/dist/next/pageStyles.js +83 -0
- package/dist/next/pageStyles.js.map +1 -0
- package/dist/next/specimen.d.ts +24 -0
- package/dist/next/specimen.d.ts.map +1 -0
- package/dist/next/specimen.js +48 -0
- package/dist/next/specimen.js.map +1 -0
- package/dist/next/views.d.ts +31 -0
- package/dist/next/views.d.ts.map +1 -0
- package/dist/next/views.js +431 -0
- package/dist/next/views.js.map +1 -0
- package/dist/next.d.ts +5 -0
- package/dist/next.d.ts.map +1 -0
- package/dist/next.js +6 -0
- package/dist/next.js.map +1 -0
- package/dist/options.d.ts +17 -0
- package/dist/options.d.ts.map +1 -0
- package/dist/options.js +3 -0
- package/dist/options.js.map +1 -0
- package/dist/plugin.d.ts +20 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +51 -0
- package/dist/plugin.js.map +1 -0
- package/dist/toolbar.d.ts +8 -0
- package/dist/toolbar.d.ts.map +1 -0
- package/dist/toolbar.js +8 -0
- package/dist/toolbar.js.map +1 -0
- package/package.json +77 -0
|
@@ -0,0 +1,431 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import Link from "next/link";
|
|
3
|
+
import { FontSpecimen, IconSetSwitcher } from "./client.js";
|
|
4
|
+
import { facesToStyles } from "./specimen.js";
|
|
5
|
+
/** `/dev/icons` — every set as a switcher button (activating one re-skins the site), the active
|
|
6
|
+
* set's glyphs as a grid, and any runtime misses. */ export async function IconsView({ payload, snapshot }) {
|
|
7
|
+
const icons = snapshot.icons;
|
|
8
|
+
if (!icons?.iconSetSlug) {
|
|
9
|
+
return /*#__PURE__*/ _jsx("p", {
|
|
10
|
+
className: "pdtp-muted",
|
|
11
|
+
children: "payload-icons isn't installed (or runs without its iconSet collection)."
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
const res = await payload.find({
|
|
15
|
+
collection: icons.iconSetSlug,
|
|
16
|
+
depth: 1,
|
|
17
|
+
limit: 50,
|
|
18
|
+
overrideAccess: true,
|
|
19
|
+
pagination: false
|
|
20
|
+
});
|
|
21
|
+
const sets = res.docs.map((doc)=>({
|
|
22
|
+
id: doc.id,
|
|
23
|
+
title: doc.title ?? String(doc.id),
|
|
24
|
+
active: !!doc.active,
|
|
25
|
+
rows: (doc.iconsArray ?? []).flatMap((row)=>{
|
|
26
|
+
const svg = row.icon && typeof row.icon === 'object' ? row.icon.svgString : undefined;
|
|
27
|
+
return row.name && svg ? [
|
|
28
|
+
{
|
|
29
|
+
name: row.name,
|
|
30
|
+
svg
|
|
31
|
+
}
|
|
32
|
+
] : [];
|
|
33
|
+
})
|
|
34
|
+
}));
|
|
35
|
+
const active = sets.find((s)=>s.active);
|
|
36
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
37
|
+
children: [
|
|
38
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
39
|
+
className: "pdtp-section",
|
|
40
|
+
children: [
|
|
41
|
+
/*#__PURE__*/ _jsx("h2", {
|
|
42
|
+
children: "Sets"
|
|
43
|
+
}),
|
|
44
|
+
sets.length ? /*#__PURE__*/ _jsx(IconSetSwitcher, {
|
|
45
|
+
sets: sets.map(({ id, title, active: a })=>({
|
|
46
|
+
id,
|
|
47
|
+
title,
|
|
48
|
+
active: a
|
|
49
|
+
}))
|
|
50
|
+
}) : /*#__PURE__*/ _jsx("p", {
|
|
51
|
+
className: "pdtp-muted",
|
|
52
|
+
children: "No icon sets yet."
|
|
53
|
+
}),
|
|
54
|
+
/*#__PURE__*/ _jsx("p", {
|
|
55
|
+
className: "pdtp-note",
|
|
56
|
+
children: "Activating a set publishes it as the single active set — the whole site re-skins on refresh."
|
|
57
|
+
})
|
|
58
|
+
]
|
|
59
|
+
}),
|
|
60
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
61
|
+
className: "pdtp-section",
|
|
62
|
+
children: [
|
|
63
|
+
/*#__PURE__*/ _jsx("h2", {
|
|
64
|
+
children: active ? `Active set — ${active.title} (${active.rows.length})` : 'Active set'
|
|
65
|
+
}),
|
|
66
|
+
active?.rows.length ? /*#__PURE__*/ _jsx("div", {
|
|
67
|
+
className: "pdtp-icon-grid",
|
|
68
|
+
children: active.rows.map((row)=>/*#__PURE__*/ _jsxs("figure", {
|
|
69
|
+
className: "pdtp-icon-cell",
|
|
70
|
+
style: {
|
|
71
|
+
margin: 0
|
|
72
|
+
},
|
|
73
|
+
children: [
|
|
74
|
+
/*#__PURE__*/ _jsx("span", {
|
|
75
|
+
dangerouslySetInnerHTML: {
|
|
76
|
+
__html: row.svg
|
|
77
|
+
}
|
|
78
|
+
}),
|
|
79
|
+
/*#__PURE__*/ _jsx("figcaption", {
|
|
80
|
+
children: row.name
|
|
81
|
+
})
|
|
82
|
+
]
|
|
83
|
+
}, row.name))
|
|
84
|
+
}) : /*#__PURE__*/ _jsx("p", {
|
|
85
|
+
className: "pdtp-muted",
|
|
86
|
+
children: active ? 'The active set has no icons.' : 'No set is active — activate one above.'
|
|
87
|
+
})
|
|
88
|
+
]
|
|
89
|
+
}),
|
|
90
|
+
icons.misses.length ? /*#__PURE__*/ _jsxs("div", {
|
|
91
|
+
className: "pdtp-section",
|
|
92
|
+
children: [
|
|
93
|
+
/*#__PURE__*/ _jsx("h2", {
|
|
94
|
+
children: "Runtime misses"
|
|
95
|
+
}),
|
|
96
|
+
/*#__PURE__*/ _jsx("p", {
|
|
97
|
+
className: "pdtp-warn",
|
|
98
|
+
children: icons.misses.map((m)=>/*#__PURE__*/ _jsxs("span", {
|
|
99
|
+
className: "pdtp-code",
|
|
100
|
+
style: {
|
|
101
|
+
marginRight: 8
|
|
102
|
+
},
|
|
103
|
+
children: [
|
|
104
|
+
m.name,
|
|
105
|
+
" ×",
|
|
106
|
+
m.count
|
|
107
|
+
]
|
|
108
|
+
}, m.name))
|
|
109
|
+
}),
|
|
110
|
+
/*#__PURE__*/ _jsx("p", {
|
|
111
|
+
className: "pdtp-note",
|
|
112
|
+
children: "Names requested in code that didn't resolve through the active set."
|
|
113
|
+
})
|
|
114
|
+
]
|
|
115
|
+
}) : null
|
|
116
|
+
]
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
const capitalize = (key)=>key.charAt(0).toUpperCase() + key.slice(1);
|
|
120
|
+
/** `/dev/fonts` — one interactive specimen per family slot, rendered in the family's own
|
|
121
|
+
* `--font-set*` variable so the page shows the actual served fonts (the host layout loads them
|
|
122
|
+
* via extractFonts / DevFonts). The weight/style controls are built from the `fontOptimized`
|
|
123
|
+
* docs, so only faces that really exist are offered. */ export async function FontsView({ payload, snapshot }) {
|
|
124
|
+
const fonts = snapshot.fonts;
|
|
125
|
+
if (!fonts) return /*#__PURE__*/ _jsx("p", {
|
|
126
|
+
className: "pdtp-muted",
|
|
127
|
+
children: "payload-fonts isn't installed."
|
|
128
|
+
});
|
|
129
|
+
// Which typeface fills each slot (ids), then every served face of those typefaces.
|
|
130
|
+
const slotIds = {};
|
|
131
|
+
if (fonts.fontSetSlug) {
|
|
132
|
+
try {
|
|
133
|
+
const set = await payload.findGlobal({
|
|
134
|
+
slug: fonts.fontSetSlug,
|
|
135
|
+
depth: 0,
|
|
136
|
+
overrideAccess: true
|
|
137
|
+
});
|
|
138
|
+
for (const key of fonts.familyKeys){
|
|
139
|
+
const value = set[key];
|
|
140
|
+
slotIds[key] = typeof value === 'string' || typeof value === 'number' ? value : null;
|
|
141
|
+
}
|
|
142
|
+
} catch {}
|
|
143
|
+
}
|
|
144
|
+
const ids = Object.values(slotIds).filter((id)=>id !== null && id !== undefined);
|
|
145
|
+
let faces = [];
|
|
146
|
+
if (fonts.fontOptimizedSlug && ids.length) {
|
|
147
|
+
try {
|
|
148
|
+
const res = await payload.find({
|
|
149
|
+
collection: fonts.fontOptimizedSlug,
|
|
150
|
+
where: {
|
|
151
|
+
font: {
|
|
152
|
+
in: ids
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
depth: 0,
|
|
156
|
+
limit: 200,
|
|
157
|
+
overrideAccess: true,
|
|
158
|
+
pagination: false
|
|
159
|
+
});
|
|
160
|
+
faces = res.docs;
|
|
161
|
+
} catch {}
|
|
162
|
+
}
|
|
163
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
164
|
+
children: [
|
|
165
|
+
fonts.familyKeys.map((key)=>{
|
|
166
|
+
const id = slotIds[key];
|
|
167
|
+
const styles = id != null ? facesToStyles(faces.filter((f)=>f.font === id)) : [];
|
|
168
|
+
return /*#__PURE__*/ _jsx(FontSpecimen, {
|
|
169
|
+
familyKey: key,
|
|
170
|
+
title: fonts.slots[key] ?? null,
|
|
171
|
+
cssVar: `var(--font-set${capitalize(key)})`,
|
|
172
|
+
styles: styles
|
|
173
|
+
}, key);
|
|
174
|
+
}),
|
|
175
|
+
/*#__PURE__*/ _jsxs("p", {
|
|
176
|
+
className: "pdtp-note",
|
|
177
|
+
children: [
|
|
178
|
+
"Only weights and styles the typeface actually serves are offered (from the",
|
|
179
|
+
' ',
|
|
180
|
+
/*#__PURE__*/ _jsx("span", {
|
|
181
|
+
className: "pdtp-code",
|
|
182
|
+
children: fonts.fontOptimizedSlug ?? 'fontOptimized'
|
|
183
|
+
}),
|
|
184
|
+
" collection); a variable face exposes stops across its range. Slots come from the ",
|
|
185
|
+
/*#__PURE__*/ _jsx("span", {
|
|
186
|
+
className: "pdtp-code",
|
|
187
|
+
children: fonts.fontSetSlug ?? 'fontSet'
|
|
188
|
+
}),
|
|
189
|
+
" global."
|
|
190
|
+
]
|
|
191
|
+
})
|
|
192
|
+
]
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
/** The where-clause for docs with no folder — the pattern Payload's own folder views use. */ const UNFILED_WHERE = {
|
|
196
|
+
or: [
|
|
197
|
+
{
|
|
198
|
+
folder: {
|
|
199
|
+
exists: false
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
folder: {
|
|
204
|
+
equals: null
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
]
|
|
208
|
+
};
|
|
209
|
+
/** `/dev/images` — every original through the on-demand transform endpoint (`?w=320`), so the
|
|
210
|
+
* grid itself exercises payload-images end-to-end. When the collection has Payload folders
|
|
211
|
+
* enabled, the folders render as filter chips (`?folder=<id>`, `?folder=none` for unfiled) so
|
|
212
|
+
* you can click through the library the way it's organized. */ export async function ImagesView({ payload, snapshot, searchParams = {} }) {
|
|
213
|
+
const images = snapshot.images;
|
|
214
|
+
if (!images) return /*#__PURE__*/ _jsx("p", {
|
|
215
|
+
className: "pdtp-muted",
|
|
216
|
+
children: "payload-images isn't installed."
|
|
217
|
+
});
|
|
218
|
+
const base = snapshot.devRoute;
|
|
219
|
+
const sourceSlug = images.sourceSlug;
|
|
220
|
+
// Folder chips — only when the root folders feature is on (a collection opted in).
|
|
221
|
+
const foldersConfig = payload.config.folders;
|
|
222
|
+
const foldersSlug = foldersConfig ? foldersConfig.slug ?? 'payload-folders' : null;
|
|
223
|
+
const folders = [];
|
|
224
|
+
let unfiled = 0;
|
|
225
|
+
if (foldersSlug) {
|
|
226
|
+
try {
|
|
227
|
+
const res = await payload.find({
|
|
228
|
+
collection: foldersSlug,
|
|
229
|
+
depth: 0,
|
|
230
|
+
limit: 100,
|
|
231
|
+
overrideAccess: true,
|
|
232
|
+
sort: 'name'
|
|
233
|
+
});
|
|
234
|
+
for (const doc of res.docs){
|
|
235
|
+
const { totalDocs } = await payload.count({
|
|
236
|
+
collection: sourceSlug,
|
|
237
|
+
where: {
|
|
238
|
+
folder: {
|
|
239
|
+
equals: doc.id
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
overrideAccess: true
|
|
243
|
+
});
|
|
244
|
+
if (totalDocs > 0) folders.push({
|
|
245
|
+
id: doc.id,
|
|
246
|
+
name: doc.name ?? String(doc.id),
|
|
247
|
+
count: totalDocs
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
unfiled = (await payload.count({
|
|
251
|
+
collection: sourceSlug,
|
|
252
|
+
where: UNFILED_WHERE,
|
|
253
|
+
overrideAccess: true
|
|
254
|
+
})).totalDocs;
|
|
255
|
+
} catch {}
|
|
256
|
+
}
|
|
257
|
+
const selected = typeof searchParams.folder === 'string' ? searchParams.folder : undefined;
|
|
258
|
+
const where = selected === 'none' && folders.length ? UNFILED_WHERE : selected && folders.some((f)=>String(f.id) === selected) ? {
|
|
259
|
+
folder: {
|
|
260
|
+
equals: selected
|
|
261
|
+
}
|
|
262
|
+
} : undefined;
|
|
263
|
+
const res = await payload.find({
|
|
264
|
+
collection: sourceSlug,
|
|
265
|
+
depth: 0,
|
|
266
|
+
limit: 60,
|
|
267
|
+
overrideAccess: true,
|
|
268
|
+
sort: '-createdAt',
|
|
269
|
+
...where ? {
|
|
270
|
+
where
|
|
271
|
+
} : {}
|
|
272
|
+
});
|
|
273
|
+
const docs = res.docs;
|
|
274
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
275
|
+
children: [
|
|
276
|
+
folders.length ? /*#__PURE__*/ _jsxs("div", {
|
|
277
|
+
className: "pdtp-chips",
|
|
278
|
+
style: {
|
|
279
|
+
marginBottom: 20
|
|
280
|
+
},
|
|
281
|
+
children: [
|
|
282
|
+
/*#__PURE__*/ _jsxs(Link, {
|
|
283
|
+
href: `${base}/images`,
|
|
284
|
+
className: `pdtp-chip ${!where ? 'pdtp-active' : ''}`,
|
|
285
|
+
children: [
|
|
286
|
+
"All · ",
|
|
287
|
+
images.sourceCount ?? '?'
|
|
288
|
+
]
|
|
289
|
+
}),
|
|
290
|
+
folders.map((folder)=>/*#__PURE__*/ _jsxs(Link, {
|
|
291
|
+
href: `${base}/images?folder=${folder.id}`,
|
|
292
|
+
className: `pdtp-chip ${selected === String(folder.id) ? 'pdtp-active' : ''}`,
|
|
293
|
+
children: [
|
|
294
|
+
folder.name,
|
|
295
|
+
" · ",
|
|
296
|
+
folder.count
|
|
297
|
+
]
|
|
298
|
+
}, folder.id)),
|
|
299
|
+
unfiled > 0 ? /*#__PURE__*/ _jsxs(Link, {
|
|
300
|
+
href: `${base}/images?folder=none`,
|
|
301
|
+
className: `pdtp-chip ${selected === 'none' ? 'pdtp-active' : ''}`,
|
|
302
|
+
children: [
|
|
303
|
+
"Unfiled · ",
|
|
304
|
+
unfiled
|
|
305
|
+
]
|
|
306
|
+
}) : null
|
|
307
|
+
]
|
|
308
|
+
}) : null,
|
|
309
|
+
docs.length ? /*#__PURE__*/ _jsx("div", {
|
|
310
|
+
className: "pdtp-img-grid",
|
|
311
|
+
children: docs.map((doc)=>/*#__PURE__*/ _jsxs("figure", {
|
|
312
|
+
className: "pdtp-img-cell",
|
|
313
|
+
style: {
|
|
314
|
+
margin: 0
|
|
315
|
+
},
|
|
316
|
+
children: [
|
|
317
|
+
/*#__PURE__*/ _jsx("img", {
|
|
318
|
+
src: `${images.basePath}/${doc.id}?w=320`,
|
|
319
|
+
alt: doc.alt ?? doc.filename ?? String(doc.id),
|
|
320
|
+
loading: "lazy"
|
|
321
|
+
}),
|
|
322
|
+
/*#__PURE__*/ _jsx("figcaption", {
|
|
323
|
+
title: doc.alt,
|
|
324
|
+
children: doc.filename ?? doc.id
|
|
325
|
+
})
|
|
326
|
+
]
|
|
327
|
+
}, doc.id))
|
|
328
|
+
}) : /*#__PURE__*/ _jsxs("p", {
|
|
329
|
+
className: "pdtp-muted",
|
|
330
|
+
children: [
|
|
331
|
+
"No images",
|
|
332
|
+
where ? ' in this folder' : ' yet',
|
|
333
|
+
"."
|
|
334
|
+
]
|
|
335
|
+
}),
|
|
336
|
+
/*#__PURE__*/ _jsxs("p", {
|
|
337
|
+
className: "pdtp-note",
|
|
338
|
+
children: [
|
|
339
|
+
docs.length,
|
|
340
|
+
" originals rendered through ",
|
|
341
|
+
/*#__PURE__*/ _jsxs("span", {
|
|
342
|
+
className: "pdtp-code",
|
|
343
|
+
children: [
|
|
344
|
+
images.basePath,
|
|
345
|
+
"/:id?w=320"
|
|
346
|
+
]
|
|
347
|
+
}),
|
|
348
|
+
res.totalDocs > docs.length ? ` (showing ${docs.length} of ${res.totalDocs})` : '',
|
|
349
|
+
" · ",
|
|
350
|
+
images.variantCount ?? 0,
|
|
351
|
+
" cached variants so far",
|
|
352
|
+
folders.length ? ' · folders via Payload folders' : ''
|
|
353
|
+
]
|
|
354
|
+
})
|
|
355
|
+
]
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
const formatDuration = (seconds)=>{
|
|
359
|
+
if (!seconds && seconds !== 0) return '—';
|
|
360
|
+
const m = Math.floor(seconds / 60);
|
|
361
|
+
const s = Math.round(seconds % 60);
|
|
362
|
+
return `${m}:${String(s).padStart(2, '0')}`;
|
|
363
|
+
};
|
|
364
|
+
/** `/dev/mux` — the videos with their persisted ingest status. */ export async function MuxView({ payload, snapshot }) {
|
|
365
|
+
const mux = snapshot.mux;
|
|
366
|
+
if (!mux) return /*#__PURE__*/ _jsx("p", {
|
|
367
|
+
className: "pdtp-muted",
|
|
368
|
+
children: "payload-mux isn't installed."
|
|
369
|
+
});
|
|
370
|
+
const res = await payload.find({
|
|
371
|
+
collection: mux.slug,
|
|
372
|
+
depth: 0,
|
|
373
|
+
limit: 50,
|
|
374
|
+
overrideAccess: true,
|
|
375
|
+
sort: '-createdAt'
|
|
376
|
+
});
|
|
377
|
+
const docs = res.docs;
|
|
378
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
379
|
+
children: [
|
|
380
|
+
!mux.credentialed ? /*#__PURE__*/ _jsx("p", {
|
|
381
|
+
className: "pdtp-warn",
|
|
382
|
+
style: {
|
|
383
|
+
marginTop: 0
|
|
384
|
+
},
|
|
385
|
+
children: "MUX_TOKEN_ID / MUX_TOKEN_SECRET are not set — uploads and ingest will fail."
|
|
386
|
+
}) : null,
|
|
387
|
+
docs.length ? /*#__PURE__*/ _jsxs("table", {
|
|
388
|
+
className: "pdtp-table",
|
|
389
|
+
children: [
|
|
390
|
+
/*#__PURE__*/ _jsx("thead", {
|
|
391
|
+
children: /*#__PURE__*/ _jsxs("tr", {
|
|
392
|
+
children: [
|
|
393
|
+
/*#__PURE__*/ _jsx("th", {
|
|
394
|
+
children: "title"
|
|
395
|
+
}),
|
|
396
|
+
/*#__PURE__*/ _jsx("th", {
|
|
397
|
+
children: "status"
|
|
398
|
+
}),
|
|
399
|
+
/*#__PURE__*/ _jsx("th", {
|
|
400
|
+
children: "duration"
|
|
401
|
+
})
|
|
402
|
+
]
|
|
403
|
+
})
|
|
404
|
+
}),
|
|
405
|
+
/*#__PURE__*/ _jsx("tbody", {
|
|
406
|
+
children: docs.map((doc)=>/*#__PURE__*/ _jsxs("tr", {
|
|
407
|
+
children: [
|
|
408
|
+
/*#__PURE__*/ _jsx("td", {
|
|
409
|
+
children: doc.title ?? doc.id
|
|
410
|
+
}),
|
|
411
|
+
/*#__PURE__*/ _jsx("td", {
|
|
412
|
+
className: doc.status === 'errored' ? 'pdtp-warn' : undefined,
|
|
413
|
+
children: doc.status ?? '—'
|
|
414
|
+
}),
|
|
415
|
+
/*#__PURE__*/ _jsx("td", {
|
|
416
|
+
className: "pdtp-mono",
|
|
417
|
+
children: formatDuration(doc.duration)
|
|
418
|
+
})
|
|
419
|
+
]
|
|
420
|
+
}, doc.id))
|
|
421
|
+
})
|
|
422
|
+
]
|
|
423
|
+
}) : /*#__PURE__*/ _jsx("p", {
|
|
424
|
+
className: "pdtp-muted",
|
|
425
|
+
children: "No videos yet."
|
|
426
|
+
})
|
|
427
|
+
]
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
//# sourceMappingURL=views.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/next/views.tsx"],"sourcesContent":["import Link from 'next/link'\nimport type { CollectionSlug, GlobalSlug, Payload } from 'payload'\nimport type { DevSnapshot } from '../lib/snapshot'\nimport { FontSpecimen, IconSetSwitcher } from './client'\nimport { facesToStyles, type OptimizedFace } from './specimen'\n\n/** `/dev/icons` — every set as a switcher button (activating one re-skins the site), the active\n * set's glyphs as a grid, and any runtime misses. */\nexport async function IconsView({ payload, snapshot }: { payload: Payload; snapshot: DevSnapshot }) {\n const icons = snapshot.icons\n if (!icons?.iconSetSlug) {\n return <p className=\"pdtp-muted\">payload-icons isn't installed (or runs without its iconSet collection).</p>\n }\n\n const res = await payload.find({\n collection: icons.iconSetSlug as CollectionSlug,\n depth: 1,\n limit: 50,\n overrideAccess: true,\n pagination: false,\n })\n const sets = (\n res.docs as {\n id: string | number\n title?: string\n active?: boolean\n iconsArray?: { name?: string; icon?: { svgString?: string } | string | number | null }[]\n }[]\n ).map((doc) => ({\n id: doc.id,\n title: doc.title ?? String(doc.id),\n active: !!doc.active,\n rows: (doc.iconsArray ?? []).flatMap((row) => {\n const svg = row.icon && typeof row.icon === 'object' ? row.icon.svgString : undefined\n return row.name && svg ? [{ name: row.name, svg }] : []\n }),\n }))\n const active = sets.find((s) => s.active)\n\n return (\n <>\n <div className=\"pdtp-section\">\n <h2>Sets</h2>\n {sets.length ? (\n <IconSetSwitcher sets={sets.map(({ id, title, active: a }) => ({ id, title, active: a }))} />\n ) : (\n <p className=\"pdtp-muted\">No icon sets yet.</p>\n )}\n <p className=\"pdtp-note\">Activating a set publishes it as the single active set — the whole site re-skins on refresh.</p>\n </div>\n\n <div className=\"pdtp-section\">\n <h2>{active ? `Active set — ${active.title} (${active.rows.length})` : 'Active set'}</h2>\n {active?.rows.length ? (\n <div className=\"pdtp-icon-grid\">\n {active.rows.map((row) => (\n <figure key={row.name} className=\"pdtp-icon-cell\" style={{ margin: 0 }}>\n {/* dangerouslySetInnerHTML: svgString is sanitized by payload-icons on save */}\n <span dangerouslySetInnerHTML={{ __html: row.svg }} />\n <figcaption>{row.name}</figcaption>\n </figure>\n ))}\n </div>\n ) : (\n <p className=\"pdtp-muted\">{active ? 'The active set has no icons.' : 'No set is active — activate one above.'}</p>\n )}\n </div>\n\n {icons.misses.length ? (\n <div className=\"pdtp-section\">\n <h2>Runtime misses</h2>\n <p className=\"pdtp-warn\">\n {icons.misses.map((m) => (\n <span key={m.name} className=\"pdtp-code\" style={{ marginRight: 8 }}>\n {m.name} ×{m.count}\n </span>\n ))}\n </p>\n <p className=\"pdtp-note\">Names requested in code that didn't resolve through the active set.</p>\n </div>\n ) : null}\n </>\n )\n}\n\nconst capitalize = (key: string): string => key.charAt(0).toUpperCase() + key.slice(1)\n\n/** `/dev/fonts` — one interactive specimen per family slot, rendered in the family's own\n * `--font-set*` variable so the page shows the actual served fonts (the host layout loads them\n * via extractFonts / DevFonts). The weight/style controls are built from the `fontOptimized`\n * docs, so only faces that really exist are offered. */\nexport async function FontsView({ payload, snapshot }: { payload: Payload; snapshot: DevSnapshot }) {\n const fonts = snapshot.fonts\n if (!fonts) return <p className=\"pdtp-muted\">payload-fonts isn't installed.</p>\n\n // Which typeface fills each slot (ids), then every served face of those typefaces.\n const slotIds: Record<string, string | number | null> = {}\n if (fonts.fontSetSlug) {\n try {\n const set = (await payload.findGlobal({ slug: fonts.fontSetSlug as GlobalSlug, depth: 0, overrideAccess: true })) as unknown as Record<\n string,\n unknown\n >\n for (const key of fonts.familyKeys) {\n const value = set[key]\n slotIds[key] = typeof value === 'string' || typeof value === 'number' ? value : null\n }\n } catch {}\n }\n\n const ids = Object.values(slotIds).filter((id): id is string | number => id !== null && id !== undefined)\n let faces: OptimizedFace[] = []\n if (fonts.fontOptimizedSlug && ids.length) {\n try {\n const res = await payload.find({\n collection: fonts.fontOptimizedSlug as CollectionSlug,\n where: { font: { in: ids } },\n depth: 0,\n limit: 200,\n overrideAccess: true,\n pagination: false,\n })\n faces = res.docs as OptimizedFace[]\n } catch {}\n }\n\n return (\n <>\n {fonts.familyKeys.map((key) => {\n const id = slotIds[key]\n const styles = id != null ? facesToStyles(faces.filter((f) => f.font === id)) : []\n return (\n <FontSpecimen\n key={key}\n familyKey={key}\n title={fonts.slots[key] ?? null}\n cssVar={`var(--font-set${capitalize(key)})`}\n styles={styles}\n />\n )\n })}\n <p className=\"pdtp-note\">\n Only weights and styles the typeface actually serves are offered (from the{' '}\n <span className=\"pdtp-code\">{fonts.fontOptimizedSlug ?? 'fontOptimized'}</span> collection); a variable face exposes stops across its\n range. Slots come from the <span className=\"pdtp-code\">{fonts.fontSetSlug ?? 'fontSet'}</span> global.\n </p>\n </>\n )\n}\n\n/** The where-clause for docs with no folder — the pattern Payload's own folder views use. */\nconst UNFILED_WHERE = { or: [{ folder: { exists: false } }, { folder: { equals: null } }] }\n\n/** `/dev/images` — every original through the on-demand transform endpoint (`?w=320`), so the\n * grid itself exercises payload-images end-to-end. When the collection has Payload folders\n * enabled, the folders render as filter chips (`?folder=<id>`, `?folder=none` for unfiled) so\n * you can click through the library the way it's organized. */\nexport async function ImagesView({\n payload,\n snapshot,\n searchParams = {},\n}: {\n payload: Payload\n snapshot: DevSnapshot\n searchParams?: Record<string, string | string[] | undefined>\n}) {\n const images = snapshot.images\n if (!images) return <p className=\"pdtp-muted\">payload-images isn't installed.</p>\n\n const base = snapshot.devRoute\n const sourceSlug = images.sourceSlug as CollectionSlug\n\n // Folder chips — only when the root folders feature is on (a collection opted in).\n const foldersConfig = payload.config.folders\n const foldersSlug = foldersConfig ? (foldersConfig.slug ?? 'payload-folders') : null\n const folders: { id: string | number; name: string; count: number }[] = []\n let unfiled = 0\n if (foldersSlug) {\n try {\n const res = await payload.find({ collection: foldersSlug as CollectionSlug, depth: 0, limit: 100, overrideAccess: true, sort: 'name' })\n for (const doc of res.docs as { id: string | number; name?: string }[]) {\n const { totalDocs } = await payload.count({ collection: sourceSlug, where: { folder: { equals: doc.id } }, overrideAccess: true })\n if (totalDocs > 0) folders.push({ id: doc.id, name: doc.name ?? String(doc.id), count: totalDocs })\n }\n unfiled = (await payload.count({ collection: sourceSlug, where: UNFILED_WHERE, overrideAccess: true })).totalDocs\n } catch {}\n }\n\n const selected = typeof searchParams.folder === 'string' ? searchParams.folder : undefined\n const where =\n selected === 'none' && folders.length\n ? UNFILED_WHERE\n : selected && folders.some((f) => String(f.id) === selected)\n ? { folder: { equals: selected } }\n : undefined\n\n const res = await payload.find({\n collection: sourceSlug,\n depth: 0,\n limit: 60,\n overrideAccess: true,\n sort: '-createdAt',\n ...(where ? { where } : {}),\n })\n const docs = res.docs as { id: string | number; filename?: string; alt?: string }[]\n\n return (\n <>\n {folders.length ? (\n <div className=\"pdtp-chips\" style={{ marginBottom: 20 }}>\n <Link href={`${base}/images`} className={`pdtp-chip ${!where ? 'pdtp-active' : ''}`}>\n All · {images.sourceCount ?? '?'}\n </Link>\n {folders.map((folder) => (\n <Link\n key={folder.id}\n href={`${base}/images?folder=${folder.id}`}\n className={`pdtp-chip ${selected === String(folder.id) ? 'pdtp-active' : ''}`}\n >\n {folder.name} · {folder.count}\n </Link>\n ))}\n {unfiled > 0 ? (\n <Link href={`${base}/images?folder=none`} className={`pdtp-chip ${selected === 'none' ? 'pdtp-active' : ''}`}>\n Unfiled · {unfiled}\n </Link>\n ) : null}\n </div>\n ) : null}\n\n {docs.length ? (\n <div className=\"pdtp-img-grid\">\n {docs.map((doc) => (\n <figure key={doc.id} className=\"pdtp-img-cell\" style={{ margin: 0 }}>\n {/* biome-ignore lint/performance/noImgElement: dev page — exercising the plugin's own transform endpoint, not next/image */}\n <img src={`${images.basePath}/${doc.id}?w=320`} alt={doc.alt ?? doc.filename ?? String(doc.id)} loading=\"lazy\" />\n <figcaption title={doc.alt}>{doc.filename ?? doc.id}</figcaption>\n </figure>\n ))}\n </div>\n ) : (\n <p className=\"pdtp-muted\">No images{where ? ' in this folder' : ' yet'}.</p>\n )}\n <p className=\"pdtp-note\">\n {docs.length} originals rendered through <span className=\"pdtp-code\">{images.basePath}/:id?w=320</span>\n {res.totalDocs > docs.length ? ` (showing ${docs.length} of ${res.totalDocs})` : ''} · {images.variantCount ?? 0} cached variants so far\n {folders.length ? ' · folders via Payload folders' : ''}\n </p>\n </>\n )\n}\n\nconst formatDuration = (seconds?: number | null): string => {\n if (!seconds && seconds !== 0) return '—'\n const m = Math.floor(seconds / 60)\n const s = Math.round(seconds % 60)\n return `${m}:${String(s).padStart(2, '0')}`\n}\n\n/** `/dev/mux` — the videos with their persisted ingest status. */\nexport async function MuxView({ payload, snapshot }: { payload: Payload; snapshot: DevSnapshot }) {\n const mux = snapshot.mux\n if (!mux) return <p className=\"pdtp-muted\">payload-mux isn't installed.</p>\n\n const res = await payload.find({ collection: mux.slug as CollectionSlug, depth: 0, limit: 50, overrideAccess: true, sort: '-createdAt' })\n const docs = res.docs as { id: string | number; title?: string; status?: string; duration?: number }[]\n\n return (\n <>\n {!mux.credentialed ? (\n <p className=\"pdtp-warn\" style={{ marginTop: 0 }}>\n MUX_TOKEN_ID / MUX_TOKEN_SECRET are not set — uploads and ingest will fail.\n </p>\n ) : null}\n {docs.length ? (\n <table className=\"pdtp-table\">\n <thead>\n <tr>\n <th>title</th>\n <th>status</th>\n <th>duration</th>\n </tr>\n </thead>\n <tbody>\n {docs.map((doc) => (\n <tr key={doc.id}>\n <td>{doc.title ?? doc.id}</td>\n <td className={doc.status === 'errored' ? 'pdtp-warn' : undefined}>{doc.status ?? '—'}</td>\n <td className=\"pdtp-mono\">{formatDuration(doc.duration)}</td>\n </tr>\n ))}\n </tbody>\n </table>\n ) : (\n <p className=\"pdtp-muted\">No videos yet.</p>\n )}\n </>\n )\n}\n"],"names":["Link","FontSpecimen","IconSetSwitcher","facesToStyles","IconsView","payload","snapshot","icons","iconSetSlug","p","className","res","find","collection","depth","limit","overrideAccess","pagination","sets","docs","map","doc","id","title","String","active","rows","iconsArray","flatMap","row","svg","icon","svgString","undefined","name","s","div","h2","length","a","figure","style","margin","span","dangerouslySetInnerHTML","__html","figcaption","misses","m","marginRight","count","capitalize","key","charAt","toUpperCase","slice","FontsView","fonts","slotIds","fontSetSlug","set","findGlobal","slug","familyKeys","value","ids","Object","values","filter","faces","fontOptimizedSlug","where","font","in","styles","f","familyKey","slots","cssVar","UNFILED_WHERE","or","folder","exists","equals","ImagesView","searchParams","images","base","devRoute","sourceSlug","foldersConfig","config","folders","foldersSlug","unfiled","sort","totalDocs","push","selected","some","marginBottom","href","sourceCount","img","src","basePath","alt","filename","loading","variantCount","formatDuration","seconds","Math","floor","round","padStart","MuxView","mux","credentialed","marginTop","table","thead","tr","th","tbody","td","status","duration"],"mappings":";AAAA,OAAOA,UAAU,YAAW;AAG5B,SAASC,YAAY,EAAEC,eAAe,QAAQ,cAAU;AACxD,SAASC,aAAa,QAA4B,gBAAY;AAE9D;oDACoD,GACpD,OAAO,eAAeC,UAAU,EAAEC,OAAO,EAAEC,QAAQ,EAA+C;IAChG,MAAMC,QAAQD,SAASC,KAAK;IAC5B,IAAI,CAACA,OAAOC,aAAa;QACvB,qBAAO,KAACC;YAAEC,WAAU;sBAAa;;IACnC;IAEA,MAAMC,MAAM,MAAMN,QAAQO,IAAI,CAAC;QAC7BC,YAAYN,MAAMC,WAAW;QAC7BM,OAAO;QACPC,OAAO;QACPC,gBAAgB;QAChBC,YAAY;IACd;IACA,MAAMC,OAAO,AACXP,IAAIQ,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;kBAAa;;IAE3C,MAAMC,MAAM,MAAMN,QAAQO,IAAI,CAAC;QAAEC,YAAYwG,IAAIvD,IAAI;QAAoBhD,OAAO;QAAGC,OAAO;QAAIC,gBAAgB;QAAM+E,MAAM;IAAa;IACvI,MAAM5E,OAAOR,IAAIQ,IAAI;IAErB,qBACE;;YACG,CAACkG,IAAIC,YAAY,iBAChB,KAAC7G;gBAAEC,WAAU;gBAAY+B,OAAO;oBAAE8E,WAAW;gBAAE;0BAAG;iBAGhD;YACHpG,KAAKmB,MAAM,iBACV,MAACkF;gBAAM9G,WAAU;;kCACf,KAAC+G;kCACC,cAAA,MAACC;;8CACC,KAACC;8CAAG;;8CACJ,KAACA;8CAAG;;8CACJ,KAACA;8CAAG;;;;;kCAGR,KAACC;kCACEzG,KAAKC,GAAG,CAAC,CAACC,oBACT,MAACqG;;kDACC,KAACG;kDAAIxG,IAAIE,KAAK,IAAIF,IAAIC,EAAE;;kDACxB,KAACuG;wCAAGnH,WAAWW,IAAIyG,MAAM,KAAK,YAAY,cAAc7F;kDAAYZ,IAAIyG,MAAM,IAAI;;kDAClF,KAACD;wCAAGnH,WAAU;kDAAaoG,eAAezF,IAAI0G,QAAQ;;;+BAH/C1G,IAAIC,EAAE;;;+BASrB,KAACb;gBAAEC,WAAU;0BAAa;;;;AAIlC"}
|
package/dist/next.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../src/next.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AACtC,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA"}
|
package/dist/next.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// The dev-pages entry — `createDevPage` powers the one drop-in catch-all route
|
|
2
|
+
// (`app/(frontend)/dev/[[...view]]/page.tsx`). Server-side only: it boots Payload.
|
|
3
|
+
export { createDevPage } from "./next/createDevPage.js";
|
|
4
|
+
export { defineTest } from "./harness.js";
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=next.js.map
|
package/dist/next.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/next.ts"],"sourcesContent":["// The dev-pages entry — `createDevPage` powers the one drop-in catch-all route\n// (`app/(frontend)/dev/[[...view]]/page.tsx`). Server-side only: it boots Payload.\nexport { createDevPage } from './next/createDevPage'\nexport type { CreateDevPageOptions } from './next/createDevPage'\nexport { defineTest } from './harness'\nexport type { Test, TestKind, TestVersion } from './harness'\n"],"names":["createDevPage","defineTest"],"mappings":"AAAA,+EAA+E;AAC/E,mFAAmF;AACnF,SAASA,aAAa,QAAQ,0BAAsB;AAEpD,SAASC,UAAU,QAAQ,eAAW"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface DevToolsPluginOptions {
|
|
2
|
+
/**
|
|
3
|
+
* When set, forces the endpoints on or off regardless of environment. By default everything is
|
|
4
|
+
* live only when `NODE_ENV === 'development'` — the endpoints 404 and the toolbar renders
|
|
5
|
+
* nothing anywhere else. Only force `true` on a deployment you'd hand a teammate anyway (a
|
|
6
|
+
* preview env): the snapshot exposes collection counts and config details, unauthenticated.
|
|
7
|
+
*/
|
|
8
|
+
enabled?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Where the host app mounts the dev pages (the `createDevPage` catch-all). Drives the toolbar's
|
|
11
|
+
* built-in link and the browser redirect from `GET /api/dev`. @default '/dev'
|
|
12
|
+
*/
|
|
13
|
+
devRoute?: string;
|
|
14
|
+
}
|
|
15
|
+
/** The shared gate: explicit option wins, otherwise dev-only. */
|
|
16
|
+
export declare const devToolsEnabled: (enabled?: boolean) => boolean;
|
|
17
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACpC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,iEAAiE;AACjE,eAAO,MAAM,eAAe,GAAI,UAAU,OAAO,KAAG,OAA4D,CAAA"}
|
package/dist/options.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/options.ts"],"sourcesContent":["export interface DevToolsPluginOptions {\n /**\n * When set, forces the endpoints on or off regardless of environment. By default everything is\n * live only when `NODE_ENV === 'development'` — the endpoints 404 and the toolbar renders\n * nothing anywhere else. Only force `true` on a deployment you'd hand a teammate anyway (a\n * preview env): the snapshot exposes collection counts and config details, unauthenticated.\n */\n enabled?: boolean\n /**\n * Where the host app mounts the dev pages (the `createDevPage` catch-all). Drives the toolbar's\n * built-in link and the browser redirect from `GET /api/dev`. @default '/dev'\n */\n devRoute?: string\n}\n\n/** The shared gate: explicit option wins, otherwise dev-only. */\nexport const devToolsEnabled = (enabled?: boolean): boolean => enabled ?? process.env.NODE_ENV === 'development'\n"],"names":["devToolsEnabled","enabled","process","env","NODE_ENV"],"mappings":"AAeA,+DAA+D,GAC/D,OAAO,MAAMA,kBAAkB,CAACC,UAA+BA,WAAWC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAa"}
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Plugin } from 'payload';
|
|
2
|
+
import type { DevToolsPluginOptions } from './options';
|
|
3
|
+
/**
|
|
4
|
+
* The dev-tools plugin. Registers dev-only endpoints (all 404 outside dev):
|
|
5
|
+
*
|
|
6
|
+
* - `GET /api/dev` — the machine-readable app snapshot: environment, detected @pro-laico plugins
|
|
7
|
+
* with per-plugin panels (seed status, icon misses, font slots, mux readiness), and doc counts
|
|
8
|
+
* for every collection. Browsers are redirected to the dev pages (`devRoute`).
|
|
9
|
+
* - `GET /api/dev/stage` — sets/clears the test-stage cookie via URL, for scripted staging.
|
|
10
|
+
* - `POST /api/dev/icons/activate` — switch the active icon set (the `/dev/icons` switcher).
|
|
11
|
+
*
|
|
12
|
+
* Pairs with two frontend pieces from `@pro-laico/payload-dev-tools/toolbar` and `/next`:
|
|
13
|
+
* the floating `<DevToolbar>` (one line in your layout) and `createDevPage` (one catch-all file
|
|
14
|
+
* that serves the `/dev` pages). Both feed themselves — no other wiring.
|
|
15
|
+
*
|
|
16
|
+
* plugins: [devToolsPlugin()]
|
|
17
|
+
*/
|
|
18
|
+
export declare function devToolsPlugin(options?: DevToolsPluginOptions): Plugin;
|
|
19
|
+
export default devToolsPlugin;
|
|
20
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,MAAM,EAAE,MAAM,SAAS,CAAA;AAK7C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAA;AAEtD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,OAAO,GAAE,qBAA0B,GAAG,MAAM,CAiB1E;AAED,eAAe,cAAc,CAAA"}
|
package/dist/plugin.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { createActivateIconSetEndpoint } from "./endpoints/activateIconSet.js";
|
|
2
|
+
import { createDevEndpoint } from "./endpoints/dev.js";
|
|
3
|
+
import { createStageEndpoint } from "./endpoints/stage.js";
|
|
4
|
+
import { stashConfig } from "./lib/getPayloadClient.js";
|
|
5
|
+
/**
|
|
6
|
+
* The dev-tools plugin. Registers dev-only endpoints (all 404 outside dev):
|
|
7
|
+
*
|
|
8
|
+
* - `GET /api/dev` — the machine-readable app snapshot: environment, detected @pro-laico plugins
|
|
9
|
+
* with per-plugin panels (seed status, icon misses, font slots, mux readiness), and doc counts
|
|
10
|
+
* for every collection. Browsers are redirected to the dev pages (`devRoute`).
|
|
11
|
+
* - `GET /api/dev/stage` — sets/clears the test-stage cookie via URL, for scripted staging.
|
|
12
|
+
* - `POST /api/dev/icons/activate` — switch the active icon set (the `/dev/icons` switcher).
|
|
13
|
+
*
|
|
14
|
+
* Pairs with two frontend pieces from `@pro-laico/payload-dev-tools/toolbar` and `/next`:
|
|
15
|
+
* the floating `<DevToolbar>` (one line in your layout) and `createDevPage` (one catch-all file
|
|
16
|
+
* that serves the `/dev` pages). Both feed themselves — no other wiring.
|
|
17
|
+
*
|
|
18
|
+
* plugins: [devToolsPlugin()]
|
|
19
|
+
*/ export function devToolsPlugin(options = {}) {
|
|
20
|
+
return (config)=>({
|
|
21
|
+
...config,
|
|
22
|
+
custom: {
|
|
23
|
+
...config.custom,
|
|
24
|
+
payloadDevTools: {
|
|
25
|
+
options,
|
|
26
|
+
devRoute: options.devRoute ?? '/dev'
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
endpoints: [
|
|
30
|
+
...config.endpoints ?? [],
|
|
31
|
+
createDevEndpoint({
|
|
32
|
+
enabled: options.enabled,
|
|
33
|
+
devRoute: options.devRoute ?? '/dev'
|
|
34
|
+
}),
|
|
35
|
+
createStageEndpoint({
|
|
36
|
+
enabled: options.enabled,
|
|
37
|
+
devRoute: options.devRoute ?? '/dev'
|
|
38
|
+
}),
|
|
39
|
+
createActivateIconSetEndpoint(options.enabled)
|
|
40
|
+
],
|
|
41
|
+
onInit: async (payload)=>{
|
|
42
|
+
await config.onInit?.(payload);
|
|
43
|
+
// Remember the app's config so the dev pages resolve it from globalThis — no
|
|
44
|
+
// `@payload-config` alias (and thus no transpilePackages) required once Payload has booted.
|
|
45
|
+
stashConfig(payload.config);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
export default devToolsPlugin;
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/plugin.ts"],"sourcesContent":["import type { Config, Plugin } from 'payload'\nimport { createActivateIconSetEndpoint } from './endpoints/activateIconSet'\nimport { createDevEndpoint } from './endpoints/dev'\nimport { createStageEndpoint } from './endpoints/stage'\nimport { stashConfig } from './lib/getPayloadClient'\nimport type { DevToolsPluginOptions } from './options'\n\n/**\n * The dev-tools plugin. Registers dev-only endpoints (all 404 outside dev):\n *\n * - `GET /api/dev` — the machine-readable app snapshot: environment, detected @pro-laico plugins\n * with per-plugin panels (seed status, icon misses, font slots, mux readiness), and doc counts\n * for every collection. Browsers are redirected to the dev pages (`devRoute`).\n * - `GET /api/dev/stage` — sets/clears the test-stage cookie via URL, for scripted staging.\n * - `POST /api/dev/icons/activate` — switch the active icon set (the `/dev/icons` switcher).\n *\n * Pairs with two frontend pieces from `@pro-laico/payload-dev-tools/toolbar` and `/next`:\n * the floating `<DevToolbar>` (one line in your layout) and `createDevPage` (one catch-all file\n * that serves the `/dev` pages). Both feed themselves — no other wiring.\n *\n * plugins: [devToolsPlugin()]\n */\nexport function devToolsPlugin(options: DevToolsPluginOptions = {}): Plugin {\n return (config: Config): Config => ({\n ...config,\n custom: { ...config.custom, payloadDevTools: { options, devRoute: options.devRoute ?? '/dev' } },\n endpoints: [\n ...(config.endpoints ?? []),\n createDevEndpoint({ enabled: options.enabled, devRoute: options.devRoute ?? '/dev' }),\n createStageEndpoint({ enabled: options.enabled, devRoute: options.devRoute ?? '/dev' }),\n createActivateIconSetEndpoint(options.enabled),\n ],\n onInit: async (payload) => {\n await config.onInit?.(payload)\n // Remember the app's config so the dev pages resolve it from globalThis — no\n // `@payload-config` alias (and thus no transpilePackages) required once Payload has booted.\n stashConfig(payload.config)\n },\n })\n}\n\nexport default devToolsPlugin\n"],"names":["createActivateIconSetEndpoint","createDevEndpoint","createStageEndpoint","stashConfig","devToolsPlugin","options","config","custom","payloadDevTools","devRoute","endpoints","enabled","onInit","payload"],"mappings":"AACA,SAASA,6BAA6B,QAAQ,iCAA6B;AAC3E,SAASC,iBAAiB,QAAQ,qBAAiB;AACnD,SAASC,mBAAmB,QAAQ,uBAAmB;AACvD,SAASC,WAAW,QAAQ,4BAAwB;AAGpD;;;;;;;;;;;;;;CAcC,GACD,OAAO,SAASC,eAAeC,UAAiC,CAAC,CAAC;IAChE,OAAO,CAACC,SAA4B,CAAA;YAClC,GAAGA,MAAM;YACTC,QAAQ;gBAAE,GAAGD,OAAOC,MAAM;gBAAEC,iBAAiB;oBAAEH;oBAASI,UAAUJ,QAAQI,QAAQ,IAAI;gBAAO;YAAE;YAC/FC,WAAW;mBACLJ,OAAOI,SAAS,IAAI,EAAE;gBAC1BT,kBAAkB;oBAAEU,SAASN,QAAQM,OAAO;oBAAEF,UAAUJ,QAAQI,QAAQ,IAAI;gBAAO;gBACnFP,oBAAoB;oBAAES,SAASN,QAAQM,OAAO;oBAAEF,UAAUJ,QAAQI,QAAQ,IAAI;gBAAO;gBACrFT,8BAA8BK,QAAQM,OAAO;aAC9C;YACDC,QAAQ,OAAOC;gBACb,MAAMP,OAAOM,MAAM,GAAGC;gBACtB,6EAA6E;gBAC7E,4FAA4F;gBAC5FV,YAAYU,QAAQP,MAAM;YAC5B;QACF,CAAA;AACF;AAEA,eAAeF,eAAc"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { DevToolbar } from './components/DevToolbar';
|
|
2
|
+
export type { DevToolbarProps } from './components/DevToolbar';
|
|
3
|
+
export type { DevLink } from './components/DevToolbarClient';
|
|
4
|
+
export { resolveDevChrome } from './components/resolveDevChrome';
|
|
5
|
+
export type { ResolveDevChromeOptions } from './components/resolveDevChrome';
|
|
6
|
+
export { defineTest } from './harness';
|
|
7
|
+
export type { Test, TestKind, TestVersion } from './harness';
|
|
8
|
+
//# sourceMappingURL=toolbar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["../src/toolbar.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACpD,YAAY,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAC9D,YAAY,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAA;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAChE,YAAY,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAA;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AACtC,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA"}
|
package/dist/toolbar.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// The toolbar entry — React pieces for your Next layouts
|
|
2
|
+
// (`@pro-laico/payload-dev-tools/toolbar`), never imported from payload.config.
|
|
3
|
+
// `resolveDevChrome` reads cookies (server-only) — call it from a layout.
|
|
4
|
+
export { DevToolbar } from "./components/DevToolbar.js";
|
|
5
|
+
export { resolveDevChrome } from "./components/resolveDevChrome.js";
|
|
6
|
+
export { defineTest } from "./harness.js";
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=toolbar.js.map
|