@oktis-works/admin 0.1.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/bin/admin.js +19 -0
- package/dist/client/_astro/ContentEditor.A5N-aCxT.js +1 -0
- package/dist/client/_astro/PostTypesManager.w66_1tDh.js +1 -0
- package/dist/client/_astro/TaxonomiesManager.Dv_OOCEw.js +1 -0
- package/dist/client/_astro/api.GqKwASBH.js +1 -0
- package/dist/client/_astro/client.CCQ0X2AX.js +1 -0
- package/dist/client/_astro/edit.B4LyOiwH.css +1 -0
- package/dist/client/_astro/hoisted.SqllSTyr.js +1 -0
- package/dist/client/_astro/web.D5F0ytYW.js +1 -0
- package/dist/server/_empty-middleware.mjs +3 -0
- package/dist/server/chunks/astro/assets-service_BADPYD54.mjs +438 -0
- package/dist/server/chunks/astro_C5DJOQ1V.mjs +2038 -0
- package/dist/server/chunks/edit_CLlDPSWF.mjs +6 -0
- package/dist/server/chunks/index_By1s_hvq.mjs +6 -0
- package/dist/server/chunks/index_CAPo3ste.mjs +6 -0
- package/dist/server/chunks/login_GjNKFqRH.mjs +6 -0
- package/dist/server/chunks/node_CZILS-L9.mjs +6 -0
- package/dist/server/chunks/pages/edit_DSkfb6lH.mjs +2173 -0
- package/dist/server/chunks/pages/index_7XvpCth_.mjs +61 -0
- package/dist/server/chunks/pages/login_BKgn8hvS.mjs +12 -0
- package/dist/server/chunks/pages/node_CxUkTckt.mjs +268 -0
- package/dist/server/chunks/pages/post-types_BeBr92jW.mjs +246 -0
- package/dist/server/chunks/pages/taxonomies_B0jngTat.mjs +69 -0
- package/dist/server/chunks/post-types_CVELl9a2.mjs +6 -0
- package/dist/server/chunks/taxonomies_D8nuzf2R.mjs +6 -0
- package/dist/server/entry.mjs +9777 -0
- package/dist/server/manifest_BgSBppnI.mjs +455 -0
- package/dist/server/renderers.mjs +101 -0
- package/package.json +43 -0
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
import { J as bold, K as red, O as yellow, Q as dim, T as blue } from './chunks/astro_C5DJOQ1V.mjs';
|
|
2
|
+
|
|
3
|
+
const dateTimeFormat = new Intl.DateTimeFormat([], {
|
|
4
|
+
hour: "2-digit",
|
|
5
|
+
minute: "2-digit",
|
|
6
|
+
second: "2-digit",
|
|
7
|
+
hour12: false
|
|
8
|
+
});
|
|
9
|
+
const levels = {
|
|
10
|
+
debug: 20,
|
|
11
|
+
info: 30,
|
|
12
|
+
warn: 40,
|
|
13
|
+
error: 50,
|
|
14
|
+
silent: 90
|
|
15
|
+
};
|
|
16
|
+
function log(opts, level, label, message) {
|
|
17
|
+
const logLevel = opts.level;
|
|
18
|
+
const dest = opts.dest;
|
|
19
|
+
const event = {
|
|
20
|
+
label,
|
|
21
|
+
level,
|
|
22
|
+
message
|
|
23
|
+
};
|
|
24
|
+
if (!isLogLevelEnabled(logLevel, level)) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
dest.write(event);
|
|
28
|
+
}
|
|
29
|
+
function isLogLevelEnabled(configuredLogLevel, level) {
|
|
30
|
+
return levels[configuredLogLevel] <= levels[level];
|
|
31
|
+
}
|
|
32
|
+
function info(opts, label, message) {
|
|
33
|
+
return log(opts, "info", label, message);
|
|
34
|
+
}
|
|
35
|
+
function warn(opts, label, message) {
|
|
36
|
+
return log(opts, "warn", label, message);
|
|
37
|
+
}
|
|
38
|
+
function error(opts, label, message) {
|
|
39
|
+
return log(opts, "error", label, message);
|
|
40
|
+
}
|
|
41
|
+
function debug(...args) {
|
|
42
|
+
if ("_astroGlobalDebug" in globalThis) {
|
|
43
|
+
globalThis._astroGlobalDebug(...args);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function getEventPrefix({ level, label }) {
|
|
47
|
+
const timestamp = `${dateTimeFormat.format(/* @__PURE__ */ new Date())}`;
|
|
48
|
+
const prefix = [];
|
|
49
|
+
if (level === "error" || level === "warn") {
|
|
50
|
+
prefix.push(bold(timestamp));
|
|
51
|
+
prefix.push(`[${level.toUpperCase()}]`);
|
|
52
|
+
} else {
|
|
53
|
+
prefix.push(timestamp);
|
|
54
|
+
}
|
|
55
|
+
if (label) {
|
|
56
|
+
prefix.push(`[${label}]`);
|
|
57
|
+
}
|
|
58
|
+
if (level === "error") {
|
|
59
|
+
return red(prefix.join(" "));
|
|
60
|
+
}
|
|
61
|
+
if (level === "warn") {
|
|
62
|
+
return yellow(prefix.join(" "));
|
|
63
|
+
}
|
|
64
|
+
if (prefix.length === 1) {
|
|
65
|
+
return dim(prefix[0]);
|
|
66
|
+
}
|
|
67
|
+
return dim(prefix[0]) + " " + blue(prefix.splice(1).join(" "));
|
|
68
|
+
}
|
|
69
|
+
if (typeof process !== "undefined") {
|
|
70
|
+
let proc = process;
|
|
71
|
+
if ("argv" in proc && Array.isArray(proc.argv)) {
|
|
72
|
+
if (proc.argv.includes("--verbose")) ; else if (proc.argv.includes("--silent")) ; else ;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
class Logger {
|
|
76
|
+
options;
|
|
77
|
+
constructor(options) {
|
|
78
|
+
this.options = options;
|
|
79
|
+
}
|
|
80
|
+
info(label, message) {
|
|
81
|
+
info(this.options, label, message);
|
|
82
|
+
}
|
|
83
|
+
warn(label, message) {
|
|
84
|
+
warn(this.options, label, message);
|
|
85
|
+
}
|
|
86
|
+
error(label, message) {
|
|
87
|
+
error(this.options, label, message);
|
|
88
|
+
}
|
|
89
|
+
debug(label, ...messages) {
|
|
90
|
+
debug(label, ...messages);
|
|
91
|
+
}
|
|
92
|
+
level() {
|
|
93
|
+
return this.options.level;
|
|
94
|
+
}
|
|
95
|
+
forkIntegrationLogger(label) {
|
|
96
|
+
return new AstroIntegrationLogger(this.options, label);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
class AstroIntegrationLogger {
|
|
100
|
+
options;
|
|
101
|
+
label;
|
|
102
|
+
constructor(logging, label) {
|
|
103
|
+
this.options = logging;
|
|
104
|
+
this.label = label;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Creates a new logger instance with a new label, but the same log options.
|
|
108
|
+
*/
|
|
109
|
+
fork(label) {
|
|
110
|
+
return new AstroIntegrationLogger(this.options, label);
|
|
111
|
+
}
|
|
112
|
+
info(message) {
|
|
113
|
+
info(this.options, this.label, message);
|
|
114
|
+
}
|
|
115
|
+
warn(message) {
|
|
116
|
+
warn(this.options, this.label, message);
|
|
117
|
+
}
|
|
118
|
+
error(message) {
|
|
119
|
+
error(this.options, this.label, message);
|
|
120
|
+
}
|
|
121
|
+
debug(message) {
|
|
122
|
+
debug(this.label, message);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Tokenize input string.
|
|
128
|
+
*/
|
|
129
|
+
function lexer(str) {
|
|
130
|
+
var tokens = [];
|
|
131
|
+
var i = 0;
|
|
132
|
+
while (i < str.length) {
|
|
133
|
+
var char = str[i];
|
|
134
|
+
if (char === "*" || char === "+" || char === "?") {
|
|
135
|
+
tokens.push({ type: "MODIFIER", index: i, value: str[i++] });
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
if (char === "\\") {
|
|
139
|
+
tokens.push({ type: "ESCAPED_CHAR", index: i++, value: str[i++] });
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
if (char === "{") {
|
|
143
|
+
tokens.push({ type: "OPEN", index: i, value: str[i++] });
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
if (char === "}") {
|
|
147
|
+
tokens.push({ type: "CLOSE", index: i, value: str[i++] });
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
if (char === ":") {
|
|
151
|
+
var name = "";
|
|
152
|
+
var j = i + 1;
|
|
153
|
+
while (j < str.length) {
|
|
154
|
+
var code = str.charCodeAt(j);
|
|
155
|
+
if (
|
|
156
|
+
// `0-9`
|
|
157
|
+
(code >= 48 && code <= 57) ||
|
|
158
|
+
// `A-Z`
|
|
159
|
+
(code >= 65 && code <= 90) ||
|
|
160
|
+
// `a-z`
|
|
161
|
+
(code >= 97 && code <= 122) ||
|
|
162
|
+
// `_`
|
|
163
|
+
code === 95) {
|
|
164
|
+
name += str[j++];
|
|
165
|
+
continue;
|
|
166
|
+
}
|
|
167
|
+
break;
|
|
168
|
+
}
|
|
169
|
+
if (!name)
|
|
170
|
+
throw new TypeError("Missing parameter name at ".concat(i));
|
|
171
|
+
tokens.push({ type: "NAME", index: i, value: name });
|
|
172
|
+
i = j;
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
if (char === "(") {
|
|
176
|
+
var count = 1;
|
|
177
|
+
var pattern = "";
|
|
178
|
+
var j = i + 1;
|
|
179
|
+
if (str[j] === "?") {
|
|
180
|
+
throw new TypeError("Pattern cannot start with \"?\" at ".concat(j));
|
|
181
|
+
}
|
|
182
|
+
while (j < str.length) {
|
|
183
|
+
if (str[j] === "\\") {
|
|
184
|
+
pattern += str[j++] + str[j++];
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
if (str[j] === ")") {
|
|
188
|
+
count--;
|
|
189
|
+
if (count === 0) {
|
|
190
|
+
j++;
|
|
191
|
+
break;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
else if (str[j] === "(") {
|
|
195
|
+
count++;
|
|
196
|
+
if (str[j + 1] !== "?") {
|
|
197
|
+
throw new TypeError("Capturing groups are not allowed at ".concat(j));
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
pattern += str[j++];
|
|
201
|
+
}
|
|
202
|
+
if (count)
|
|
203
|
+
throw new TypeError("Unbalanced pattern at ".concat(i));
|
|
204
|
+
if (!pattern)
|
|
205
|
+
throw new TypeError("Missing pattern at ".concat(i));
|
|
206
|
+
tokens.push({ type: "PATTERN", index: i, value: pattern });
|
|
207
|
+
i = j;
|
|
208
|
+
continue;
|
|
209
|
+
}
|
|
210
|
+
tokens.push({ type: "CHAR", index: i, value: str[i++] });
|
|
211
|
+
}
|
|
212
|
+
tokens.push({ type: "END", index: i, value: "" });
|
|
213
|
+
return tokens;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Parse a string for the raw tokens.
|
|
217
|
+
*/
|
|
218
|
+
function parse(str, options) {
|
|
219
|
+
if (options === void 0) { options = {}; }
|
|
220
|
+
var tokens = lexer(str);
|
|
221
|
+
var _a = options.prefixes, prefixes = _a === void 0 ? "./" : _a, _b = options.delimiter, delimiter = _b === void 0 ? "/#?" : _b;
|
|
222
|
+
var result = [];
|
|
223
|
+
var key = 0;
|
|
224
|
+
var i = 0;
|
|
225
|
+
var path = "";
|
|
226
|
+
var tryConsume = function (type) {
|
|
227
|
+
if (i < tokens.length && tokens[i].type === type)
|
|
228
|
+
return tokens[i++].value;
|
|
229
|
+
};
|
|
230
|
+
var mustConsume = function (type) {
|
|
231
|
+
var value = tryConsume(type);
|
|
232
|
+
if (value !== undefined)
|
|
233
|
+
return value;
|
|
234
|
+
var _a = tokens[i], nextType = _a.type, index = _a.index;
|
|
235
|
+
throw new TypeError("Unexpected ".concat(nextType, " at ").concat(index, ", expected ").concat(type));
|
|
236
|
+
};
|
|
237
|
+
var consumeText = function () {
|
|
238
|
+
var result = "";
|
|
239
|
+
var value;
|
|
240
|
+
while ((value = tryConsume("CHAR") || tryConsume("ESCAPED_CHAR"))) {
|
|
241
|
+
result += value;
|
|
242
|
+
}
|
|
243
|
+
return result;
|
|
244
|
+
};
|
|
245
|
+
var isSafe = function (value) {
|
|
246
|
+
for (var _i = 0, delimiter_1 = delimiter; _i < delimiter_1.length; _i++) {
|
|
247
|
+
var char = delimiter_1[_i];
|
|
248
|
+
if (value.indexOf(char) > -1)
|
|
249
|
+
return true;
|
|
250
|
+
}
|
|
251
|
+
return false;
|
|
252
|
+
};
|
|
253
|
+
var safePattern = function (prefix) {
|
|
254
|
+
var prev = result[result.length - 1];
|
|
255
|
+
var prevText = prefix || (prev && typeof prev === "string" ? prev : "");
|
|
256
|
+
if (prev && !prevText) {
|
|
257
|
+
throw new TypeError("Must have text between two parameters, missing text after \"".concat(prev.name, "\""));
|
|
258
|
+
}
|
|
259
|
+
if (!prevText || isSafe(prevText))
|
|
260
|
+
return "[^".concat(escapeString(delimiter), "]+?");
|
|
261
|
+
return "(?:(?!".concat(escapeString(prevText), ")[^").concat(escapeString(delimiter), "])+?");
|
|
262
|
+
};
|
|
263
|
+
while (i < tokens.length) {
|
|
264
|
+
var char = tryConsume("CHAR");
|
|
265
|
+
var name = tryConsume("NAME");
|
|
266
|
+
var pattern = tryConsume("PATTERN");
|
|
267
|
+
if (name || pattern) {
|
|
268
|
+
var prefix = char || "";
|
|
269
|
+
if (prefixes.indexOf(prefix) === -1) {
|
|
270
|
+
path += prefix;
|
|
271
|
+
prefix = "";
|
|
272
|
+
}
|
|
273
|
+
if (path) {
|
|
274
|
+
result.push(path);
|
|
275
|
+
path = "";
|
|
276
|
+
}
|
|
277
|
+
result.push({
|
|
278
|
+
name: name || key++,
|
|
279
|
+
prefix: prefix,
|
|
280
|
+
suffix: "",
|
|
281
|
+
pattern: pattern || safePattern(prefix),
|
|
282
|
+
modifier: tryConsume("MODIFIER") || "",
|
|
283
|
+
});
|
|
284
|
+
continue;
|
|
285
|
+
}
|
|
286
|
+
var value = char || tryConsume("ESCAPED_CHAR");
|
|
287
|
+
if (value) {
|
|
288
|
+
path += value;
|
|
289
|
+
continue;
|
|
290
|
+
}
|
|
291
|
+
if (path) {
|
|
292
|
+
result.push(path);
|
|
293
|
+
path = "";
|
|
294
|
+
}
|
|
295
|
+
var open = tryConsume("OPEN");
|
|
296
|
+
if (open) {
|
|
297
|
+
var prefix = consumeText();
|
|
298
|
+
var name_1 = tryConsume("NAME") || "";
|
|
299
|
+
var pattern_1 = tryConsume("PATTERN") || "";
|
|
300
|
+
var suffix = consumeText();
|
|
301
|
+
mustConsume("CLOSE");
|
|
302
|
+
result.push({
|
|
303
|
+
name: name_1 || (pattern_1 ? key++ : ""),
|
|
304
|
+
pattern: name_1 && !pattern_1 ? safePattern(prefix) : pattern_1,
|
|
305
|
+
prefix: prefix,
|
|
306
|
+
suffix: suffix,
|
|
307
|
+
modifier: tryConsume("MODIFIER") || "",
|
|
308
|
+
});
|
|
309
|
+
continue;
|
|
310
|
+
}
|
|
311
|
+
mustConsume("END");
|
|
312
|
+
}
|
|
313
|
+
return result;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Compile a string to a template function for the path.
|
|
317
|
+
*/
|
|
318
|
+
function compile(str, options) {
|
|
319
|
+
return tokensToFunction(parse(str, options), options);
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Expose a method for transforming tokens into the path function.
|
|
323
|
+
*/
|
|
324
|
+
function tokensToFunction(tokens, options) {
|
|
325
|
+
if (options === void 0) { options = {}; }
|
|
326
|
+
var reFlags = flags(options);
|
|
327
|
+
var _a = options.encode, encode = _a === void 0 ? function (x) { return x; } : _a, _b = options.validate, validate = _b === void 0 ? true : _b;
|
|
328
|
+
// Compile all the tokens into regexps.
|
|
329
|
+
var matches = tokens.map(function (token) {
|
|
330
|
+
if (typeof token === "object") {
|
|
331
|
+
return new RegExp("^(?:".concat(token.pattern, ")$"), reFlags);
|
|
332
|
+
}
|
|
333
|
+
});
|
|
334
|
+
return function (data) {
|
|
335
|
+
var path = "";
|
|
336
|
+
for (var i = 0; i < tokens.length; i++) {
|
|
337
|
+
var token = tokens[i];
|
|
338
|
+
if (typeof token === "string") {
|
|
339
|
+
path += token;
|
|
340
|
+
continue;
|
|
341
|
+
}
|
|
342
|
+
var value = data ? data[token.name] : undefined;
|
|
343
|
+
var optional = token.modifier === "?" || token.modifier === "*";
|
|
344
|
+
var repeat = token.modifier === "*" || token.modifier === "+";
|
|
345
|
+
if (Array.isArray(value)) {
|
|
346
|
+
if (!repeat) {
|
|
347
|
+
throw new TypeError("Expected \"".concat(token.name, "\" to not repeat, but got an array"));
|
|
348
|
+
}
|
|
349
|
+
if (value.length === 0) {
|
|
350
|
+
if (optional)
|
|
351
|
+
continue;
|
|
352
|
+
throw new TypeError("Expected \"".concat(token.name, "\" to not be empty"));
|
|
353
|
+
}
|
|
354
|
+
for (var j = 0; j < value.length; j++) {
|
|
355
|
+
var segment = encode(value[j], token);
|
|
356
|
+
if (validate && !matches[i].test(segment)) {
|
|
357
|
+
throw new TypeError("Expected all \"".concat(token.name, "\" to match \"").concat(token.pattern, "\", but got \"").concat(segment, "\""));
|
|
358
|
+
}
|
|
359
|
+
path += token.prefix + segment + token.suffix;
|
|
360
|
+
}
|
|
361
|
+
continue;
|
|
362
|
+
}
|
|
363
|
+
if (typeof value === "string" || typeof value === "number") {
|
|
364
|
+
var segment = encode(String(value), token);
|
|
365
|
+
if (validate && !matches[i].test(segment)) {
|
|
366
|
+
throw new TypeError("Expected \"".concat(token.name, "\" to match \"").concat(token.pattern, "\", but got \"").concat(segment, "\""));
|
|
367
|
+
}
|
|
368
|
+
path += token.prefix + segment + token.suffix;
|
|
369
|
+
continue;
|
|
370
|
+
}
|
|
371
|
+
if (optional)
|
|
372
|
+
continue;
|
|
373
|
+
var typeOfMessage = repeat ? "an array" : "a string";
|
|
374
|
+
throw new TypeError("Expected \"".concat(token.name, "\" to be ").concat(typeOfMessage));
|
|
375
|
+
}
|
|
376
|
+
return path;
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* Escape a regular expression string.
|
|
381
|
+
*/
|
|
382
|
+
function escapeString(str) {
|
|
383
|
+
return str.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1");
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Get the flags for a regexp from the options.
|
|
387
|
+
*/
|
|
388
|
+
function flags(options) {
|
|
389
|
+
return options && options.sensitive ? "" : "i";
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
function getRouteGenerator(segments, addTrailingSlash) {
|
|
393
|
+
const template = segments.map((segment) => {
|
|
394
|
+
return "/" + segment.map((part) => {
|
|
395
|
+
if (part.spread) {
|
|
396
|
+
return `:${part.content.slice(3)}(.*)?`;
|
|
397
|
+
} else if (part.dynamic) {
|
|
398
|
+
return `:${part.content}`;
|
|
399
|
+
} else {
|
|
400
|
+
return part.content.normalize().replace(/\?/g, "%3F").replace(/#/g, "%23").replace(/%5B/g, "[").replace(/%5D/g, "]").replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
401
|
+
}
|
|
402
|
+
}).join("");
|
|
403
|
+
}).join("");
|
|
404
|
+
let trailing = "";
|
|
405
|
+
if (addTrailingSlash === "always" && segments.length) {
|
|
406
|
+
trailing = "/";
|
|
407
|
+
}
|
|
408
|
+
const toPath = compile(template + trailing);
|
|
409
|
+
return toPath;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
function deserializeRouteData(rawRouteData) {
|
|
413
|
+
return {
|
|
414
|
+
route: rawRouteData.route,
|
|
415
|
+
type: rawRouteData.type,
|
|
416
|
+
pattern: new RegExp(rawRouteData.pattern),
|
|
417
|
+
params: rawRouteData.params,
|
|
418
|
+
component: rawRouteData.component,
|
|
419
|
+
generate: getRouteGenerator(rawRouteData.segments, rawRouteData._meta.trailingSlash),
|
|
420
|
+
pathname: rawRouteData.pathname || void 0,
|
|
421
|
+
segments: rawRouteData.segments,
|
|
422
|
+
prerender: rawRouteData.prerender,
|
|
423
|
+
redirect: rawRouteData.redirect,
|
|
424
|
+
redirectRoute: rawRouteData.redirectRoute ? deserializeRouteData(rawRouteData.redirectRoute) : void 0,
|
|
425
|
+
fallbackRoutes: rawRouteData.fallbackRoutes.map((fallback) => {
|
|
426
|
+
return deserializeRouteData(fallback);
|
|
427
|
+
})
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
function deserializeManifest(serializedManifest) {
|
|
432
|
+
const routes = [];
|
|
433
|
+
for (const serializedRoute of serializedManifest.routes) {
|
|
434
|
+
routes.push({
|
|
435
|
+
...serializedRoute,
|
|
436
|
+
routeData: deserializeRouteData(serializedRoute.routeData)
|
|
437
|
+
});
|
|
438
|
+
const route = serializedRoute;
|
|
439
|
+
route.routeData = deserializeRouteData(serializedRoute.routeData);
|
|
440
|
+
}
|
|
441
|
+
const assets = new Set(serializedManifest.assets);
|
|
442
|
+
const componentMetadata = new Map(serializedManifest.componentMetadata);
|
|
443
|
+
const clientDirectives = new Map(serializedManifest.clientDirectives);
|
|
444
|
+
return {
|
|
445
|
+
...serializedManifest,
|
|
446
|
+
assets,
|
|
447
|
+
componentMetadata,
|
|
448
|
+
clientDirectives,
|
|
449
|
+
routes
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
const manifest = deserializeManifest({"adapterName":"@astrojs/node","routes":[{"file":"","links":[],"scripts":[],"styles":[],"routeData":{"type":"endpoint","route":"/_image","pattern":"^\\/_image$","segments":[[{"content":"_image","dynamic":false,"spread":false}]],"params":[],"component":"../../node_modules/.bun/astro@4.0.0+f33040ce8019fdfa/node_modules/astro/dist/assets/endpoint/node.js","pathname":"/_image","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[{"type":"inline","content":".dashboard[data-astro-cid-j7pv25f6]{display:flex;flex-direction:column;gap:1.5rem}.stats-grid[data-astro-cid-j7pv25f6]{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:1rem}.stat-card[data-astro-cid-j7pv25f6]{text-align:center}.stat-label[data-astro-cid-j7pv25f6]{color:var(--color-text-secondary);font-size:.875rem;margin-bottom:.5rem}.stat-value[data-astro-cid-j7pv25f6]{font-size:2rem;font-weight:700;color:var(--color-primary)}.actions-grid[data-astro-cid-j7pv25f6]{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:1rem}.action-card[data-astro-cid-j7pv25f6]{display:flex;flex-direction:column;align-items:center;gap:.5rem;padding:1.5rem;background:var(--color-bg);border:1px solid var(--color-border);border-radius:var(--radius-md);color:var(--color-text);transition:all .15s ease}.action-card[data-astro-cid-j7pv25f6]:hover{border-color:var(--color-primary);background:var(--color-bg-tertiary)}\n"},{"type":"external","src":"/_astro/edit.B4LyOiwH.css"},{"type":"inline","content":".sidebar-header[data-astro-cid-kqx5um5x]{display:flex;align-items:center;justify-content:space-between;padding-bottom:1rem;margin-bottom:1rem;border-bottom:1px solid var(--color-border)}.sidebar-nav[data-astro-cid-kqx5um5x]{display:flex;flex-direction:column;gap:.25rem}.main-header[data-astro-cid-kqx5um5x]{display:flex;align-items:center;justify-content:space-between;margin-bottom:1.5rem;padding-bottom:1rem;border-bottom:1px solid var(--color-border)}.content[data-astro-cid-kqx5um5x]{max-width:1200px}\n"}],"routeData":{"route":"/","type":"page","pattern":"^\\/$","segments":[],"params":[],"component":"src/pages/index.astro","pathname":"/","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[{"type":"external","src":"/_astro/edit.B4LyOiwH.css"},{"type":"inline","content":".sidebar-header[data-astro-cid-kqx5um5x]{display:flex;align-items:center;justify-content:space-between;padding-bottom:1rem;margin-bottom:1rem;border-bottom:1px solid var(--color-border)}.sidebar-nav[data-astro-cid-kqx5um5x]{display:flex;flex-direction:column;gap:.25rem}.main-header[data-astro-cid-kqx5um5x]{display:flex;align-items:center;justify-content:space-between;margin-bottom:1.5rem;padding-bottom:1rem;border-bottom:1px solid var(--color-border)}.content[data-astro-cid-kqx5um5x]{max-width:1200px}\n.settings-page[data-astro-cid-f6czuk7s] .page-header[data-astro-cid-f6czuk7s]{margin-bottom:1rem}.form-grid[data-astro-cid-f6czuk7s]{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:1rem;margin-bottom:1rem}.supports[data-astro-cid-f6czuk7s]{display:flex;flex-wrap:wrap;gap:1rem;margin-bottom:1rem}\n"}],"routeData":{"route":"/settings/post-types","type":"page","pattern":"^\\/settings\\/post-types\\/?$","segments":[[{"content":"settings","dynamic":false,"spread":false}],[{"content":"post-types","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/settings/post-types.astro","pathname":"/settings/post-types","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[{"type":"external","src":"/_astro/edit.B4LyOiwH.css"},{"type":"inline","content":".sidebar-header[data-astro-cid-kqx5um5x]{display:flex;align-items:center;justify-content:space-between;padding-bottom:1rem;margin-bottom:1rem;border-bottom:1px solid var(--color-border)}.sidebar-nav[data-astro-cid-kqx5um5x]{display:flex;flex-direction:column;gap:.25rem}.main-header[data-astro-cid-kqx5um5x]{display:flex;align-items:center;justify-content:space-between;margin-bottom:1.5rem;padding-bottom:1rem;border-bottom:1px solid var(--color-border)}.content[data-astro-cid-kqx5um5x]{max-width:1200px}\n.settings-page[data-astro-cid-fpxil6ue] .page-header[data-astro-cid-fpxil6ue]{margin-bottom:1rem}.form-grid[data-astro-cid-fpxil6ue]{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:1rem;margin-bottom:1rem}\n"}],"routeData":{"route":"/settings/taxonomies","type":"page","pattern":"^\\/settings\\/taxonomies\\/?$","segments":[[{"content":"settings","dynamic":false,"spread":false}],[{"content":"taxonomies","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/settings/taxonomies.astro","pathname":"/settings/taxonomies","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[{"type":"inline","content":".content-page[data-astro-cid-sm7sxu6c]{display:flex;flex-direction:column;gap:1.5rem}.page-header[data-astro-cid-sm7sxu6c]{display:flex;align-items:center;justify-content:space-between;gap:1rem}.header-left[data-astro-cid-sm7sxu6c]{display:flex;gap:.5rem}.header-left[data-astro-cid-sm7sxu6c] .input[data-astro-cid-sm7sxu6c]{width:200px}.pagination[data-astro-cid-sm7sxu6c]{display:flex;align-items:center;justify-content:center;gap:.5rem;padding-top:1rem;margin-top:1rem;border-top:1px solid var(--color-border)}\n"},{"type":"external","src":"/_astro/edit.B4LyOiwH.css"},{"type":"inline","content":".sidebar-header[data-astro-cid-kqx5um5x]{display:flex;align-items:center;justify-content:space-between;padding-bottom:1rem;margin-bottom:1rem;border-bottom:1px solid var(--color-border)}.sidebar-nav[data-astro-cid-kqx5um5x]{display:flex;flex-direction:column;gap:.25rem}.main-header[data-astro-cid-kqx5um5x]{display:flex;align-items:center;justify-content:space-between;margin-bottom:1.5rem;padding-bottom:1rem;border-bottom:1px solid var(--color-border)}.content[data-astro-cid-kqx5um5x]{max-width:1200px}\n"}],"routeData":{"route":"/content","type":"page","pattern":"^\\/content\\/?$","segments":[[{"content":"content","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/content/index.astro","pathname":"/content","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"styles":[{"type":"external","src":"/_astro/edit.B4LyOiwH.css"},{"type":"inline","content":".sidebar-header[data-astro-cid-kqx5um5x]{display:flex;align-items:center;justify-content:space-between;padding-bottom:1rem;margin-bottom:1rem;border-bottom:1px solid var(--color-border)}.sidebar-nav[data-astro-cid-kqx5um5x]{display:flex;flex-direction:column;gap:.25rem}.main-header[data-astro-cid-kqx5um5x]{display:flex;align-items:center;justify-content:space-between;margin-bottom:1.5rem;padding-bottom:1rem;border-bottom:1px solid var(--color-border)}.content[data-astro-cid-kqx5um5x]{max-width:1200px}\n.editor-page[data-astro-cid-yrprbkbh]{max-width:960px}\n"}],"routeData":{"route":"/content/edit","type":"page","pattern":"^\\/content\\/edit\\/?$","segments":[[{"content":"content","dynamic":false,"spread":false}],[{"content":"edit","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/content/edit.astro","pathname":"/content/edit","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.SqllSTyr.js"}],"styles":[{"type":"external","src":"/_astro/edit.B4LyOiwH.css"},{"type":"inline","content":".login-page[data-astro-cid-sgpqyurt]{display:flex;align-items:center;justify-content:center;min-height:100vh;padding:1rem}.login-card[data-astro-cid-sgpqyurt]{width:100%;max-width:400px;background:var(--color-bg-secondary);border:1px solid var(--color-border);border-radius:var(--radius-lg);padding:2rem}.login-header[data-astro-cid-sgpqyurt]{text-align:center;margin-bottom:2rem}.login-header[data-astro-cid-sgpqyurt] h1[data-astro-cid-sgpqyurt]{font-size:1.5rem;margin-bottom:.5rem}.login-header[data-astro-cid-sgpqyurt] p[data-astro-cid-sgpqyurt]{color:var(--color-text-secondary)}.login-form[data-astro-cid-sgpqyurt]{display:flex;flex-direction:column;gap:1rem}.form-group[data-astro-cid-sgpqyurt]{display:flex;flex-direction:column;gap:.5rem}.form-group[data-astro-cid-sgpqyurt] label[data-astro-cid-sgpqyurt]{font-size:.875rem;font-weight:500}.error-message[data-astro-cid-sgpqyurt]{padding:.75rem;background:#ef44441a;border:1px solid var(--color-danger);border-radius:var(--radius-md);color:var(--color-danger);font-size:.875rem}.btn-block[data-astro-cid-sgpqyurt]{width:100%}\n"}],"routeData":{"route":"/login","type":"page","pattern":"^\\/login\\/?$","segments":[[{"content":"login","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/login.astro","pathname":"/login","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}}],"base":"/","trailingSlash":"ignore","compressHTML":true,"componentMetadata":[["/home/judah/projetos/blacklotuscms-v2/apps/admin/src/pages/content/edit.astro",{"propagation":"none","containsHead":true}],["/home/judah/projetos/blacklotuscms-v2/apps/admin/src/pages/content/index.astro",{"propagation":"none","containsHead":true}],["/home/judah/projetos/blacklotuscms-v2/apps/admin/src/pages/index.astro",{"propagation":"none","containsHead":true}],["/home/judah/projetos/blacklotuscms-v2/apps/admin/src/pages/settings/post-types.astro",{"propagation":"none","containsHead":true}],["/home/judah/projetos/blacklotuscms-v2/apps/admin/src/pages/settings/taxonomies.astro",{"propagation":"none","containsHead":true}],["/home/judah/projetos/blacklotuscms-v2/apps/admin/src/pages/login.astro",{"propagation":"none","containsHead":true}]],"renderers":[],"clientDirectives":[["idle","(()=>{var i=t=>{let e=async()=>{await(await t())()};\"requestIdleCallback\"in window?window.requestIdleCallback(e):setTimeout(e,200)};(self.Astro||(self.Astro={})).idle=i;window.dispatchEvent(new Event(\"astro:idle\"));})();"],["load","(()=>{var e=async t=>{await(await t())()};(self.Astro||(self.Astro={})).load=e;window.dispatchEvent(new Event(\"astro:load\"));})();"],["media","(()=>{var s=(i,t)=>{let a=async()=>{await(await i())()};if(t.value){let e=matchMedia(t.value);e.matches?a():e.addEventListener(\"change\",a,{once:!0})}};(self.Astro||(self.Astro={})).media=s;window.dispatchEvent(new Event(\"astro:media\"));})();"],["only","(()=>{var e=async t=>{await(await t())()};(self.Astro||(self.Astro={})).only=e;window.dispatchEvent(new Event(\"astro:only\"));})();"],["visible","(()=>{var r=(i,c,s)=>{let n=async()=>{await(await i())()},t=new IntersectionObserver(e=>{for(let o of e)if(o.isIntersecting){t.disconnect(),n();break}});for(let e of s.children)t.observe(e)};(self.Astro||(self.Astro={})).visible=r;window.dispatchEvent(new Event(\"astro:visible\"));})();"]],"entryModules":{"\u0000@astrojs-ssr-virtual-entry":"entry.mjs","\u0000@astro-renderers":"renderers.mjs","\u0000empty-middleware":"_empty-middleware.mjs","/src/pages/settings/taxonomies.astro":"chunks/pages/taxonomies_B0jngTat.mjs","/src/pages/content/edit.astro":"chunks/pages/edit_DSkfb6lH.mjs","/src/pages/login.astro":"chunks/pages/login_BKgn8hvS.mjs","\u0000@astrojs-manifest":"manifest_BgSBppnI.mjs","\u0000@astro-page:../../node_modules/.bun/astro@4.0.0+f33040ce8019fdfa/node_modules/astro/dist/assets/endpoint/node@_@js":"chunks/node_CZILS-L9.mjs","\u0000@astro-page:src/pages/index@_@astro":"chunks/index_CAPo3ste.mjs","\u0000@astro-page:src/pages/settings/post-types@_@astro":"chunks/post-types_CVELl9a2.mjs","\u0000@astro-page:src/pages/settings/taxonomies@_@astro":"chunks/taxonomies_D8nuzf2R.mjs","\u0000@astro-page:src/pages/content/index@_@astro":"chunks/index_By1s_hvq.mjs","\u0000@astro-page:src/pages/content/edit@_@astro":"chunks/edit_CLlDPSWF.mjs","\u0000@astro-page:src/pages/login@_@astro":"chunks/login_GjNKFqRH.mjs","/home/judah/projetos/blacklotuscms-v2/apps/admin/src/components/apps/settings/PostTypesManager":"_astro/PostTypesManager.w66_1tDh.js","/home/judah/projetos/blacklotuscms-v2/apps/admin/src/components/apps/settings/TaxonomiesManager":"_astro/TaxonomiesManager.Dv_OOCEw.js","/home/judah/projetos/blacklotuscms-v2/apps/admin/src/components/content/ContentEditor":"_astro/ContentEditor.A5N-aCxT.js","/astro/hoisted.js?q=0":"_astro/hoisted.SqllSTyr.js","@astrojs/solid-js/client.js":"_astro/client.CCQ0X2AX.js","astro:scripts/before-hydration.js":""},"assets":["/_astro/edit.B4LyOiwH.css","/_astro/ContentEditor.A5N-aCxT.js","/_astro/PostTypesManager.w66_1tDh.js","/_astro/TaxonomiesManager.Dv_OOCEw.js","/_astro/api.GqKwASBH.js","/_astro/client.CCQ0X2AX.js","/_astro/hoisted.SqllSTyr.js","/_astro/web.D5F0ytYW.js"]});
|
|
454
|
+
|
|
455
|
+
export { AstroIntegrationLogger as A, Logger as L, getEventPrefix as g, levels as l, manifest };
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { generateHydrationScript, renderToStringAsync, renderToString, ssr, createComponent, Suspense, NoHydration } from 'solid-js/web';
|
|
2
|
+
|
|
3
|
+
const contexts = /* @__PURE__ */ new WeakMap();
|
|
4
|
+
function getContext(result) {
|
|
5
|
+
if (contexts.has(result)) {
|
|
6
|
+
return contexts.get(result);
|
|
7
|
+
}
|
|
8
|
+
let ctx = {
|
|
9
|
+
c: 0,
|
|
10
|
+
get id() {
|
|
11
|
+
return "s" + this.c.toString();
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
contexts.set(result, ctx);
|
|
15
|
+
return ctx;
|
|
16
|
+
}
|
|
17
|
+
function incrementId(ctx) {
|
|
18
|
+
let id = ctx.id;
|
|
19
|
+
ctx.c++;
|
|
20
|
+
return id;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const slotName = (str) => str.trim().replace(/[-_]([a-z])/g, (_, w) => w.toUpperCase());
|
|
24
|
+
async function check(Component, props, children) {
|
|
25
|
+
if (typeof Component !== "function")
|
|
26
|
+
return false;
|
|
27
|
+
if (Component.name === "QwikComponent")
|
|
28
|
+
return false;
|
|
29
|
+
const { html } = await renderToStaticMarkup.call(this, Component, props, children, {
|
|
30
|
+
// The purpose of check() is just to validate that this is a Solid component and not
|
|
31
|
+
// React, etc. We should render in sync mode which should skip Suspense boundaries
|
|
32
|
+
// or loading resources like external API calls.
|
|
33
|
+
renderStrategy: "sync"
|
|
34
|
+
});
|
|
35
|
+
return typeof html === "string";
|
|
36
|
+
}
|
|
37
|
+
async function renderToStaticMarkup(Component, props, { default: children, ...slotted }, metadata) {
|
|
38
|
+
const ctx = getContext(this.result);
|
|
39
|
+
const renderId = metadata?.hydrate ? incrementId(ctx) : "";
|
|
40
|
+
const needsHydrate = metadata?.astroStaticSlot ? !!metadata.hydrate : true;
|
|
41
|
+
const tagName = needsHydrate ? "astro-slot" : "astro-static-slot";
|
|
42
|
+
const renderStrategy = metadata?.renderStrategy ?? "async";
|
|
43
|
+
const renderFn = () => {
|
|
44
|
+
const slots = {};
|
|
45
|
+
for (const [key, value] of Object.entries(slotted)) {
|
|
46
|
+
const name = slotName(key);
|
|
47
|
+
slots[name] = ssr(`<${tagName} name="${name}">${value}</${tagName}>`);
|
|
48
|
+
}
|
|
49
|
+
const newProps = {
|
|
50
|
+
...props,
|
|
51
|
+
...slots,
|
|
52
|
+
// In Solid SSR mode, `ssr` creates the expected structure for `children`.
|
|
53
|
+
children: children != null ? ssr(`<${tagName}>${children}</${tagName}>`) : children
|
|
54
|
+
};
|
|
55
|
+
if (renderStrategy === "sync") {
|
|
56
|
+
return createComponent(Component, newProps);
|
|
57
|
+
} else {
|
|
58
|
+
if (needsHydrate) {
|
|
59
|
+
return createComponent(Suspense, {
|
|
60
|
+
get children() {
|
|
61
|
+
return createComponent(Component, newProps);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
} else {
|
|
65
|
+
return createComponent(NoHydration, {
|
|
66
|
+
get children() {
|
|
67
|
+
return createComponent(Suspense, {
|
|
68
|
+
get children() {
|
|
69
|
+
return createComponent(Component, newProps);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
const componentHtml = renderStrategy === "async" ? await renderToStringAsync(renderFn, {
|
|
78
|
+
renderId,
|
|
79
|
+
// New setting since Solid 1.8.4 that fixes an errant hydration event appearing in
|
|
80
|
+
// server only components. Not available in TypeScript types yet.
|
|
81
|
+
// https://github.com/solidjs/solid/issues/1931
|
|
82
|
+
// https://github.com/ryansolid/dom-expressions/commit/e09e255ac725fd59195aa0f3918065d4bd974e6b
|
|
83
|
+
...{ noScripts: !needsHydrate }
|
|
84
|
+
}) : renderToString(renderFn, { renderId });
|
|
85
|
+
return {
|
|
86
|
+
attrs: {
|
|
87
|
+
"data-solid-render-id": renderId
|
|
88
|
+
},
|
|
89
|
+
html: componentHtml
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
var server_default = {
|
|
93
|
+
check,
|
|
94
|
+
renderToStaticMarkup,
|
|
95
|
+
supportsAstroStaticSlot: true,
|
|
96
|
+
renderHydrationScript: () => generateHydrationScript()
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const renderers = [Object.assign({"name":"@astrojs/solid-js","clientEntrypoint":"@astrojs/solid-js/client.js","serverEntrypoint":"@astrojs/solid-js/server.js"}, { ssr: server_default }),];
|
|
100
|
+
|
|
101
|
+
export { renderers };
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@oktis-works/admin",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"bin": {
|
|
6
|
+
"blacklotus-admin": "./bin/admin.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"bin",
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"dev": "astro dev",
|
|
14
|
+
"build": "astro build",
|
|
15
|
+
"preview": "astro preview",
|
|
16
|
+
"start": "astro dev",
|
|
17
|
+
"prepublishOnly": "bun run build",
|
|
18
|
+
"clean": "rm -rf dist .astro tsconfig.tsbuildinfo"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@oktis-works/types": "0.1.0",
|
|
22
|
+
"@oktis-works/validation": "0.1.0",
|
|
23
|
+
"@oktis-works/plugin-sdk": "0.1.0",
|
|
24
|
+
"@oktis-works/ui": "0.1.0",
|
|
25
|
+
"@astrojs/solid-js": "4.0.0",
|
|
26
|
+
"@astrojs/node": "8.0.0",
|
|
27
|
+
"astro": "4.0.0",
|
|
28
|
+
"solid-js": "1.8.0"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"typescript": "5.7.3"
|
|
32
|
+
},
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "https://github.com/blacklotus/blacklotus-cms",
|
|
37
|
+
"directory": "apps/admin"
|
|
38
|
+
},
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public",
|
|
41
|
+
"registry": "https://registry.npmjs.org/"
|
|
42
|
+
}
|
|
43
|
+
}
|