@valaxyjs/devtools 0.22.4 → 0.22.5-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +13 -0
  2. package/dist/client/assets/{about-DG1GsLHQ.js → about-YZW2X-7U.js} +1 -2
  3. package/dist/client/assets/{categories-Bm7oRFJy.js → categories-DjKct1de.js} +1 -2
  4. package/dist/client/assets/en-DQc-k8eq.js +13 -0
  5. package/dist/client/assets/index-60_bCGDF.css +428 -0
  6. package/dist/client/assets/index-B_Bc_zX6.js +8909 -0
  7. package/dist/client/assets/index-Clg7HLhF.js +22396 -0
  8. package/dist/client/assets/index-DKnSvpEK.css +7 -0
  9. package/dist/client/assets/{migration-CLNK0vJL.js → migration-BXXS7zuk.js} +2 -2
  10. package/dist/client/assets/{splitpanes.es-C0nkbxNz.js → splitpanes.es-B_iwNZlc.js} +1 -1
  11. package/dist/client/assets/{tags-hRXnGE0o.js → tags-DyKgUFNV.js} +1 -2
  12. package/dist/client/assets/zh-CN-DrQHTX9V.js +32 -0
  13. package/dist/client/index.html +2 -2
  14. package/dist/index.d.mts +6 -1
  15. package/dist/index.d.ts +6 -1
  16. package/dist/index.mjs +100 -37
  17. package/package.json +21 -5
  18. package/rpc.d.ts +21 -0
  19. package/build.config.ts +0 -20
  20. package/dist/client/assets/_plugin-vue_export-helper-DgDhiqFL.js +0 -11
  21. package/dist/client/assets/index-BsE069b2.css +0 -61
  22. package/dist/client/assets/index-CGiiZwdq.css +0 -396
  23. package/dist/client/assets/index-DERgnaDy.js +0 -8572
  24. package/dist/client/assets/index-DjRUnZlz.js +0 -830
  25. package/src/client/App.vue +0 -20
  26. package/src/client/components/PageFrontmatter.vue +0 -67
  27. package/src/client/components/PostPanel.vue +0 -22
  28. package/src/client/components/VDHeader.vue +0 -57
  29. package/src/client/components/VDPostCategories.vue +0 -26
  30. package/src/client/components/VDPostList.vue +0 -31
  31. package/src/client/components/VDTag.vue +0 -9
  32. package/src/client/components.d.ts +0 -66
  33. package/src/client/composables/app.ts +0 -10
  34. package/src/client/index.html +0 -32
  35. package/src/client/main.ts +0 -37
  36. package/src/client/pages/about.vue +0 -5
  37. package/src/client/pages/categories.vue +0 -5
  38. package/src/client/pages/index.vue +0 -21
  39. package/src/client/pages/migration.vue +0 -73
  40. package/src/client/pages/tags.vue +0 -5
  41. package/src/client/shims.d.ts +0 -12
  42. package/src/client/styles/index.css +0 -8
  43. package/src/client/typed-routes.d.ts +0 -27
  44. package/src/client/types/index.ts +0 -3
  45. package/src/client/utils/api.ts +0 -18
  46. package/src/client/utils/get.ts +0 -25
  47. package/src/client/utils/index.ts +0 -5
  48. package/src/client/utils/init.ts +0 -27
  49. package/src/client/vite.config.ts +0 -87
  50. package/src/dir.ts +0 -10
  51. package/src/index.ts +0 -2
  52. package/src/node/README.md +0 -3
  53. package/src/node/api/index.ts +0 -82
  54. package/src/node/index.ts +0 -74
  55. package/src/node/types.ts +0 -4
  56. package/tsconfig.json +0 -26
@@ -1,830 +0,0 @@
1
- import { g as getAppWindow, d as defineComponent, c as computed, o as openBlock, a as createElementBlock, n as normalizeClass, b as createCommentVNode, r as renderSlot, e as ref, f as onMounted, h as createBaseVNode, i as resolveComponent, j as createBlock, w as withCtx, t as toDisplayString, F as Fragment, k as renderList, l as createTextVNode, m as createVNode, p as activePath, q as pageData, s as toRaw, u as unref, v as frontmatter, x as getWindowProperty, y as getGlobalValaxyProperty, z as devtoolsRouter, A as isStaticMode } from './index-DERgnaDy.js';
2
- import { _ as _export_sfc } from './_plugin-vue_export-helper-DgDhiqFL.js';
3
- import { a as axios, g, M } from './splitpanes.es-C0nkbxNz.js';
4
-
5
- const target = getAppWindow();
6
- function openInEditor(options = {}) {
7
- const { file, line = 0, column = 0 } = options;
8
- if (file) {
9
- const baseUrl = window.location.origin;
10
- target?.__VUE_INSPECTOR__.openInEditor(baseUrl, file, line, column);
11
- }
12
- }
13
-
14
- /* Injected with object hook! */
15
-
16
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
17
- __name: "AGUIButton",
18
- props: {
19
- icon: {},
20
- size: {}
21
- },
22
- setup(__props) {
23
- const props = __props;
24
- const classes = computed(() => {
25
- const cls = [];
26
- if (props.size)
27
- cls.push(props.size);
28
- return cls;
29
- });
30
- return (_ctx, _cache) => {
31
- return openBlock(), createElementBlock("button", {
32
- class: normalizeClass([classes.value, "agui-button"])
33
- }, [
34
- _ctx.icon ? (openBlock(), createElementBlock("div", {
35
- key: 0,
36
- class: normalizeClass(["mr-1 inline-flex", _ctx.icon])
37
- }, null, 2)) : createCommentVNode("", true),
38
- renderSlot(_ctx.$slots, "default")
39
- ], 2);
40
- };
41
- }
42
- });
43
-
44
- /* Injected with object hook! */
45
-
46
- /* Injected with object hook! */
47
-
48
- const _hoisted_1$4 = {
49
- key: 0,
50
- class: "relative flex"
51
- };
52
- const _hoisted_2$2 = {
53
- key: 0,
54
- class: "absolute"
55
- };
56
- const _hoisted_3$1 = { class: "absolute left-1 h-full flex items-center justify-center text-xs op-60" };
57
- const _hoisted_4 = ["value", "placeholder", "autofocus"];
58
- const _hoisted_5 = ["value", "placeholder"];
59
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
60
- __name: "AGUIInput",
61
- props: {
62
- autofocus: { type: Boolean },
63
- className: {},
64
- prefixIcon: {},
65
- modelValue: {},
66
- placeholder: {}
67
- },
68
- emits: ["update:modelValue"],
69
- setup(__props, { emit: __emit }) {
70
- const props = __props;
71
- const emit = __emit;
72
- function updateModelValue(event) {
73
- const val = event.target?.value || "";
74
- emit("update:modelValue", val);
75
- }
76
- const inputRef = ref();
77
- onMounted(async () => {
78
- if (props.autofocus) {
79
- setTimeout(() => {
80
- inputRef.value?.focus();
81
- }, 1);
82
- }
83
- });
84
- return (_ctx, _cache) => {
85
- return _ctx.prefixIcon ? (openBlock(), createElementBlock("div", _hoisted_1$4, [
86
- _ctx.$slots.prefix ? (openBlock(), createElementBlock("div", _hoisted_2$2, [
87
- renderSlot(_ctx.$slots, "prefix")
88
- ])) : createCommentVNode("", true),
89
- createBaseVNode("div", _hoisted_3$1, [
90
- _ctx.prefixIcon ? (openBlock(), createElementBlock("div", {
91
- key: 0,
92
- class: normalizeClass(_ctx.prefixIcon)
93
- }, null, 2)) : createCommentVNode("", true)
94
- ]),
95
- createBaseVNode("input", {
96
- ref_key: "inputRef",
97
- ref: inputRef,
98
- class: normalizeClass(["agui-input w-full px-1 shadow shadow-inset", {
99
- "pl-5": _ctx.prefixIcon,
100
- [_ctx.className || ""]: true
101
- }]),
102
- value: _ctx.modelValue,
103
- placeholder: _ctx.placeholder,
104
- autofocus: _ctx.autofocus,
105
- onInput: updateModelValue
106
- }, null, 42, _hoisted_4)
107
- ])) : (openBlock(), createElementBlock("input", {
108
- key: 1,
109
- class: "agui-input w-full px-1 shadow shadow-inset",
110
- value: _ctx.modelValue,
111
- placeholder: _ctx.placeholder,
112
- onInput: updateModelValue
113
- }, null, 40, _hoisted_5));
114
- };
115
- }
116
- });
117
-
118
- /* Injected with object hook! */
119
-
120
- /* Injected with object hook! */
121
-
122
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
123
- __name: "VDPostCategories",
124
- props: {
125
- categories: {}
126
- },
127
- setup(__props) {
128
- return (_ctx, _cache) => {
129
- const _component_RouterLink = resolveComponent("RouterLink");
130
- return openBlock(), createBlock(_component_RouterLink, {
131
- to: {
132
- path: "/categories",
133
- query: { category: Array.isArray(_ctx.categories) ? _ctx.categories.join("/") : _ctx.categories }
134
- },
135
- class: "post-category transition text-xs hover:(text-blue-500 border-blue-500)",
136
- "px-2": "",
137
- "py-1": "",
138
- border: "",
139
- "rounded-full": "",
140
- "inline-flex": "",
141
- "justify-center": "",
142
- "items-center": "",
143
- bg: "hover:(blue-500 opacity-10)"
144
- }, {
145
- default: withCtx(() => [
146
- _cache[0] || (_cache[0] = createBaseVNode("div", {
147
- m: "x-1",
148
- "inline-flex": "",
149
- "i-ri-folder-2-line": ""
150
- }, null, -1)),
151
- createBaseVNode("span", null, toDisplayString(Array.isArray(_ctx.categories) ? _ctx.categories.join(" > ") : _ctx.categories), 1)
152
- ]),
153
- _: 1
154
- }, 8, ["to"]);
155
- };
156
- }
157
- });
158
-
159
- /* Injected with object hook! */
160
-
161
- /* unplugin-vue-components disabled */const _sfc_main$4 = {};
162
-
163
- const _hoisted_1$3 = {
164
- class: "vd-tag inline-flex shadow border rounded text-xs",
165
- p: "x-2 y-1"
166
- };
167
-
168
- function _sfc_render(_ctx, _cache) {
169
- return (openBlock(), createElementBlock("div", _hoisted_1$3, [
170
- renderSlot(_ctx.$slots, "default")
171
- ]))
172
- }
173
- const __unplugin_components_0 = /*#__PURE__*/_export_sfc(_sfc_main$4, [['render',_sfc_render]]);
174
- /* Injected with object hook! */
175
-
176
- const LogLevels = {
177
- silent: Number.NEGATIVE_INFINITY,
178
- fatal: 0,
179
- error: 0,
180
- warn: 1,
181
- log: 2,
182
- info: 3,
183
- success: 3,
184
- fail: 3,
185
- ready: 3,
186
- start: 3,
187
- box: 3,
188
- debug: 4,
189
- trace: 5,
190
- verbose: Number.POSITIVE_INFINITY
191
- };
192
- const LogTypes = {
193
- // Silent
194
- silent: {
195
- level: -1
196
- },
197
- // Level 0
198
- fatal: {
199
- level: LogLevels.fatal
200
- },
201
- error: {
202
- level: LogLevels.error
203
- },
204
- // Level 1
205
- warn: {
206
- level: LogLevels.warn
207
- },
208
- // Level 2
209
- log: {
210
- level: LogLevels.log
211
- },
212
- // Level 3
213
- info: {
214
- level: LogLevels.info
215
- },
216
- success: {
217
- level: LogLevels.success
218
- },
219
- fail: {
220
- level: LogLevels.fail
221
- },
222
- ready: {
223
- level: LogLevels.info
224
- },
225
- start: {
226
- level: LogLevels.info
227
- },
228
- box: {
229
- level: LogLevels.info
230
- },
231
- // Level 4
232
- debug: {
233
- level: LogLevels.debug
234
- },
235
- // Level 5
236
- trace: {
237
- level: LogLevels.trace
238
- },
239
- // Verbose
240
- verbose: {
241
- level: LogLevels.verbose
242
- }
243
- };
244
-
245
- function isObject(value) {
246
- return value !== null && typeof value === "object";
247
- }
248
- function _defu(baseObject, defaults, namespace = ".", merger) {
249
- if (!isObject(defaults)) {
250
- return _defu(baseObject, {}, namespace);
251
- }
252
- const object = Object.assign({}, defaults);
253
- for (const key in baseObject) {
254
- if (key === "__proto__" || key === "constructor") {
255
- continue;
256
- }
257
- const value = baseObject[key];
258
- if (value === null || value === void 0) {
259
- continue;
260
- }
261
- if (Array.isArray(value) && Array.isArray(object[key])) {
262
- object[key] = [...value, ...object[key]];
263
- } else if (isObject(value) && isObject(object[key])) {
264
- object[key] = _defu(
265
- value,
266
- object[key],
267
- (namespace ? `${namespace}.` : "") + key.toString());
268
- } else {
269
- object[key] = value;
270
- }
271
- }
272
- return object;
273
- }
274
- function createDefu(merger) {
275
- return (...arguments_) => (
276
- // eslint-disable-next-line unicorn/no-array-reduce
277
- arguments_.reduce((p, c) => _defu(p, c, ""), {})
278
- );
279
- }
280
- const defu = createDefu();
281
-
282
- function isPlainObject(obj) {
283
- return Object.prototype.toString.call(obj) === "[object Object]";
284
- }
285
- function isLogObj(arg) {
286
- if (!isPlainObject(arg)) {
287
- return false;
288
- }
289
- if (!arg.message && !arg.args) {
290
- return false;
291
- }
292
- if (arg.stack) {
293
- return false;
294
- }
295
- return true;
296
- }
297
-
298
- let paused = false;
299
- const queue = [];
300
- class Consola {
301
- constructor(options = {}) {
302
- const types = options.types || LogTypes;
303
- this.options = defu(
304
- {
305
- ...options,
306
- defaults: { ...options.defaults },
307
- level: _normalizeLogLevel(options.level, types),
308
- reporters: [...options.reporters || []]
309
- },
310
- {
311
- types: LogTypes,
312
- throttle: 1e3,
313
- throttleMin: 5,
314
- formatOptions: {
315
- date: true,
316
- colors: false,
317
- compact: true
318
- }
319
- }
320
- );
321
- for (const type in types) {
322
- const defaults = {
323
- type,
324
- ...this.options.defaults,
325
- ...types[type]
326
- };
327
- this[type] = this._wrapLogFn(defaults);
328
- this[type].raw = this._wrapLogFn(
329
- defaults,
330
- true
331
- );
332
- }
333
- if (this.options.mockFn) {
334
- this.mockTypes();
335
- }
336
- this._lastLog = {};
337
- }
338
- get level() {
339
- return this.options.level;
340
- }
341
- set level(level) {
342
- this.options.level = _normalizeLogLevel(
343
- level,
344
- this.options.types,
345
- this.options.level
346
- );
347
- }
348
- prompt(message, opts) {
349
- if (!this.options.prompt) {
350
- throw new Error("prompt is not supported!");
351
- }
352
- return this.options.prompt(message, opts);
353
- }
354
- create(options) {
355
- const instance = new Consola({
356
- ...this.options,
357
- ...options
358
- });
359
- if (this._mockFn) {
360
- instance.mockTypes(this._mockFn);
361
- }
362
- return instance;
363
- }
364
- withDefaults(defaults) {
365
- return this.create({
366
- ...this.options,
367
- defaults: {
368
- ...this.options.defaults,
369
- ...defaults
370
- }
371
- });
372
- }
373
- withTag(tag) {
374
- return this.withDefaults({
375
- tag: this.options.defaults.tag ? this.options.defaults.tag + ":" + tag : tag
376
- });
377
- }
378
- addReporter(reporter) {
379
- this.options.reporters.push(reporter);
380
- return this;
381
- }
382
- removeReporter(reporter) {
383
- if (reporter) {
384
- const i = this.options.reporters.indexOf(reporter);
385
- if (i >= 0) {
386
- return this.options.reporters.splice(i, 1);
387
- }
388
- } else {
389
- this.options.reporters.splice(0);
390
- }
391
- return this;
392
- }
393
- setReporters(reporters) {
394
- this.options.reporters = Array.isArray(reporters) ? reporters : [reporters];
395
- return this;
396
- }
397
- wrapAll() {
398
- this.wrapConsole();
399
- this.wrapStd();
400
- }
401
- restoreAll() {
402
- this.restoreConsole();
403
- this.restoreStd();
404
- }
405
- wrapConsole() {
406
- for (const type in this.options.types) {
407
- if (!console["__" + type]) {
408
- console["__" + type] = console[type];
409
- }
410
- console[type] = this[type].raw;
411
- }
412
- }
413
- restoreConsole() {
414
- for (const type in this.options.types) {
415
- if (console["__" + type]) {
416
- console[type] = console["__" + type];
417
- delete console["__" + type];
418
- }
419
- }
420
- }
421
- wrapStd() {
422
- this._wrapStream(this.options.stdout, "log");
423
- this._wrapStream(this.options.stderr, "log");
424
- }
425
- _wrapStream(stream, type) {
426
- if (!stream) {
427
- return;
428
- }
429
- if (!stream.__write) {
430
- stream.__write = stream.write;
431
- }
432
- stream.write = (data) => {
433
- this[type].raw(String(data).trim());
434
- };
435
- }
436
- restoreStd() {
437
- this._restoreStream(this.options.stdout);
438
- this._restoreStream(this.options.stderr);
439
- }
440
- _restoreStream(stream) {
441
- if (!stream) {
442
- return;
443
- }
444
- if (stream.__write) {
445
- stream.write = stream.__write;
446
- delete stream.__write;
447
- }
448
- }
449
- pauseLogs() {
450
- paused = true;
451
- }
452
- resumeLogs() {
453
- paused = false;
454
- const _queue = queue.splice(0);
455
- for (const item of _queue) {
456
- item[0]._logFn(item[1], item[2]);
457
- }
458
- }
459
- mockTypes(mockFn) {
460
- const _mockFn = mockFn || this.options.mockFn;
461
- this._mockFn = _mockFn;
462
- if (typeof _mockFn !== "function") {
463
- return;
464
- }
465
- for (const type in this.options.types) {
466
- this[type] = _mockFn(type, this.options.types[type]) || this[type];
467
- this[type].raw = this[type];
468
- }
469
- }
470
- _wrapLogFn(defaults, isRaw) {
471
- return (...args) => {
472
- if (paused) {
473
- queue.push([this, defaults, args, isRaw]);
474
- return;
475
- }
476
- return this._logFn(defaults, args, isRaw);
477
- };
478
- }
479
- _logFn(defaults, args, isRaw) {
480
- if ((defaults.level || 0) > this.level) {
481
- return false;
482
- }
483
- const logObj = {
484
- date: /* @__PURE__ */ new Date(),
485
- args: [],
486
- ...defaults,
487
- level: _normalizeLogLevel(defaults.level, this.options.types)
488
- };
489
- if (!isRaw && args.length === 1 && isLogObj(args[0])) {
490
- Object.assign(logObj, args[0]);
491
- } else {
492
- logObj.args = [...args];
493
- }
494
- if (logObj.message) {
495
- logObj.args.unshift(logObj.message);
496
- delete logObj.message;
497
- }
498
- if (logObj.additional) {
499
- if (!Array.isArray(logObj.additional)) {
500
- logObj.additional = logObj.additional.split("\n");
501
- }
502
- logObj.args.push("\n" + logObj.additional.join("\n"));
503
- delete logObj.additional;
504
- }
505
- logObj.type = typeof logObj.type === "string" ? logObj.type.toLowerCase() : "log";
506
- logObj.tag = typeof logObj.tag === "string" ? logObj.tag : "";
507
- const resolveLog = (newLog = false) => {
508
- const repeated = (this._lastLog.count || 0) - this.options.throttleMin;
509
- if (this._lastLog.object && repeated > 0) {
510
- const args2 = [...this._lastLog.object.args];
511
- if (repeated > 1) {
512
- args2.push(`(repeated ${repeated} times)`);
513
- }
514
- this._log({ ...this._lastLog.object, args: args2 });
515
- this._lastLog.count = 1;
516
- }
517
- if (newLog) {
518
- this._lastLog.object = logObj;
519
- this._log(logObj);
520
- }
521
- };
522
- clearTimeout(this._lastLog.timeout);
523
- const diffTime = this._lastLog.time && logObj.date ? logObj.date.getTime() - this._lastLog.time.getTime() : 0;
524
- this._lastLog.time = logObj.date;
525
- if (diffTime < this.options.throttle) {
526
- try {
527
- const serializedLog = JSON.stringify([
528
- logObj.type,
529
- logObj.tag,
530
- logObj.args
531
- ]);
532
- const isSameLog = this._lastLog.serialized === serializedLog;
533
- this._lastLog.serialized = serializedLog;
534
- if (isSameLog) {
535
- this._lastLog.count = (this._lastLog.count || 0) + 1;
536
- if (this._lastLog.count > this.options.throttleMin) {
537
- this._lastLog.timeout = setTimeout(
538
- resolveLog,
539
- this.options.throttle
540
- );
541
- return;
542
- }
543
- }
544
- } catch {
545
- }
546
- }
547
- resolveLog(true);
548
- }
549
- _log(logObj) {
550
- for (const reporter of this.options.reporters) {
551
- reporter.log(logObj, {
552
- options: this.options
553
- });
554
- }
555
- }
556
- }
557
- function _normalizeLogLevel(input, types = {}, defaultLevel = 3) {
558
- if (input === void 0) {
559
- return defaultLevel;
560
- }
561
- if (typeof input === "number") {
562
- return input;
563
- }
564
- if (types[input] && types[input].level !== void 0) {
565
- return types[input].level;
566
- }
567
- return defaultLevel;
568
- }
569
- Consola.prototype.add = Consola.prototype.addReporter;
570
- Consola.prototype.remove = Consola.prototype.removeReporter;
571
- Consola.prototype.clear = Consola.prototype.removeReporter;
572
- Consola.prototype.withScope = Consola.prototype.withTag;
573
- Consola.prototype.mock = Consola.prototype.mockTypes;
574
- Consola.prototype.pause = Consola.prototype.pauseLogs;
575
- Consola.prototype.resume = Consola.prototype.resumeLogs;
576
- function createConsola$1(options = {}) {
577
- return new Consola(options);
578
- }
579
-
580
- /* Injected with object hook! */
581
-
582
- class BrowserReporter {
583
- constructor(options) {
584
- this.options = { ...options };
585
- this.defaultColor = "#7f8c8d";
586
- this.levelColorMap = {
587
- 0: "#c0392b",
588
- // Red
589
- 1: "#f39c12",
590
- // Yellow
591
- 3: "#00BCD4"
592
- // Cyan
593
- };
594
- this.typeColorMap = {
595
- success: "#2ecc71"
596
- // Green
597
- };
598
- }
599
- _getLogFn(level) {
600
- if (level < 1) {
601
- return console.__error || console.error;
602
- }
603
- if (level === 1) {
604
- return console.__warn || console.warn;
605
- }
606
- return console.__log || console.log;
607
- }
608
- log(logObj) {
609
- const consoleLogFn = this._getLogFn(logObj.level);
610
- const type = logObj.type === "log" ? "" : logObj.type;
611
- const tag = logObj.tag || "";
612
- const color = this.typeColorMap[logObj.type] || this.levelColorMap[logObj.level] || this.defaultColor;
613
- const style = `
614
- background: ${color};
615
- border-radius: 0.5em;
616
- color: white;
617
- font-weight: bold;
618
- padding: 2px 0.5em;
619
- `;
620
- const badge = `%c${[tag, type].filter(Boolean).join(":")}`;
621
- if (typeof logObj.args[0] === "string") {
622
- consoleLogFn(
623
- `${badge}%c ${logObj.args[0]}`,
624
- style,
625
- // Empty string as style resets to default console style
626
- "",
627
- ...logObj.args.slice(1)
628
- );
629
- } else {
630
- consoleLogFn(badge, style, ...logObj.args);
631
- }
632
- }
633
- }
634
-
635
- function createConsola(options = {}) {
636
- const consola2 = createConsola$1({
637
- reporters: options.reporters || [new BrowserReporter({})],
638
- prompt(message, options2 = {}) {
639
- if (options2.type === "confirm") {
640
- return Promise.resolve(confirm(message));
641
- }
642
- return Promise.resolve(prompt(message));
643
- },
644
- ...options
645
- });
646
- return consola2;
647
- }
648
- const consola = createConsola();
649
-
650
- /* Injected with object hook! */
651
-
652
- const _hoisted_1$2 = { key: 0 };
653
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
654
- __name: "PageFrontmatter",
655
- props: {
656
- frontmatter: {}
657
- },
658
- setup(__props) {
659
- const props = __props;
660
- const newFm = ref(props.frontmatter);
661
- async function saveNewFm() {
662
- const res = await axios.post("/valaxy-devtools-api/frontmatter", {
663
- path: activePath.value,
664
- pageData: pageData.value,
665
- frontmatter: toRaw(newFm.value)
666
- });
667
- if (res)
668
- consola.success("Frontmatter saved");
669
- }
670
- return (_ctx, _cache) => {
671
- const _component_VDTag = __unplugin_components_0;
672
- const _component_VDPostCategories = _sfc_main$5;
673
- const _component_AGUIInput = _sfc_main$6;
674
- const _component_AGUIButton = _sfc_main$7;
675
- return openBlock(), createElementBlock("div", null, [
676
- _ctx.frontmatter ? (openBlock(), createElementBlock("ul", _hoisted_1$2, [
677
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.frontmatter, (value, key) => {
678
- return openBlock(), createElementBlock("li", { key }, [
679
- createBaseVNode("strong", null, toDisplayString(key), 1),
680
- _cache[1] || (_cache[1] = createBaseVNode("span", { "mr-1": "" }, ":", -1)),
681
- key === "tags" ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(value, (tag) => {
682
- return openBlock(), createBlock(_component_VDTag, { key: tag }, {
683
- default: withCtx(() => [
684
- createTextVNode(toDisplayString(tag), 1)
685
- ]),
686
- _: 2
687
- }, 1024);
688
- }), 128)) : key === "categories" ? (openBlock(), createBlock(_component_VDPostCategories, {
689
- key: 1,
690
- categories: value
691
- }, null, 8, ["categories"])) : key === "encryptedContent" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
692
- createTextVNode(" [Encrypted] ")
693
- ], 64)) : key === "partiallyEncryptedContents" ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
694
- createTextVNode(" [Partially Encrypted] ")
695
- ], 64)) : key === "title" ? (openBlock(), createBlock(_component_AGUIInput, {
696
- key: 4,
697
- modelValue: newFm.value.title,
698
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => newFm.value.title = $event)
699
- }, null, 8, ["modelValue"])) : (openBlock(), createElementBlock(Fragment, { key: 5 }, [
700
- createTextVNode(toDisplayString(value), 1)
701
- ], 64))
702
- ]);
703
- }), 128))
704
- ])) : createCommentVNode("", true),
705
- createVNode(_component_AGUIButton, { onClick: saveNewFm }, {
706
- default: withCtx(() => _cache[2] || (_cache[2] = [
707
- createTextVNode(" Save Frontmatter ")
708
- ])),
709
- _: 1
710
- })
711
- ]);
712
- };
713
- }
714
- });
715
-
716
- /* Injected with object hook! */
717
-
718
- const _hoisted_1$1 = { p: "2" };
719
- const _hoisted_2$1 = {
720
- class: "flex",
721
- gap: "2",
722
- "py-2": ""
723
- };
724
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
725
- __name: "PostPanel",
726
- setup(__props) {
727
- function launchEditor() {
728
- openInEditor({
729
- file: getWindowProperty("$pageData").path
730
- });
731
- }
732
- return (_ctx, _cache) => {
733
- const _component_PageFrontmatter = _sfc_main$3;
734
- return openBlock(), createElementBlock("div", _hoisted_1$1, [
735
- createBaseVNode("div", _hoisted_2$1, [
736
- createBaseVNode("button", {
737
- class: "text-xs shadow transition hover:shadow-lg p-2",
738
- onClick: _cache[0] || (_cache[0] = ($event) => launchEditor())
739
- }, _cache[1] || (_cache[1] = [
740
- createBaseVNode("div", { "i-vscode-icons:file-type-vscode": "" }, null, -1)
741
- ]))
742
- ]),
743
- unref(frontmatter) ? (openBlock(), createBlock(_component_PageFrontmatter, {
744
- key: 0,
745
- frontmatter: unref(frontmatter)
746
- }, null, 8, ["frontmatter"])) : createCommentVNode("", true)
747
- ]);
748
- };
749
- }
750
- });
751
-
752
- /* Injected with object hook! */
753
-
754
- const _hoisted_1 = {
755
- class: "h-full",
756
- overflow: "auto",
757
- pl: "12",
758
- pr: "4",
759
- py: "4"
760
- };
761
- const _hoisted_2 = { flex: "" };
762
- const _hoisted_3 = ["onClick"];
763
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
764
- __name: "VDPostList",
765
- setup(__props) {
766
- const postList = ref();
767
- onMounted(() => {
768
- postList.value = getGlobalValaxyProperty("postList").value;
769
- });
770
- function onClickPost(post) {
771
- devtoolsRouter.value?.push(post.path);
772
- }
773
- return (_ctx, _cache) => {
774
- return openBlock(), createElementBlock("ul", _hoisted_1, [
775
- (openBlock(true), createElementBlock(Fragment, null, renderList(postList.value, (post) => {
776
- return openBlock(), createElementBlock("li", {
777
- key: post.path,
778
- class: "list-decimal"
779
- }, [
780
- createBaseVNode("div", _hoisted_2, [
781
- createBaseVNode("span", {
782
- class: normalizeClass(["inline-flex flex-grow cursor-pointer hover:text-blue-500 text-xs", { "text-blue-500": unref(activePath) === post.path }]),
783
- onClick: ($event) => onClickPost(post)
784
- }, toDisplayString(post.title), 11, _hoisted_3)
785
- ])
786
- ]);
787
- }), 128))
788
- ]);
789
- };
790
- }
791
- });
792
-
793
- /* Injected with object hook! */
794
-
795
- const _sfc_main = /* @__PURE__ */ defineComponent({
796
- __name: "index",
797
- setup(__props) {
798
- onMounted(() => {
799
- if (isStaticMode)
800
- document.title = "Valaxy DevTools (Production)";
801
- });
802
- return (_ctx, _cache) => {
803
- const _component_VDPostList = _sfc_main$1;
804
- const _component_PostPanel = _sfc_main$2;
805
- return openBlock(), createBlock(unref(M), { class: "h-full" }, {
806
- default: withCtx(() => [
807
- createVNode(unref(g), null, {
808
- default: withCtx(() => [
809
- createVNode(_component_VDPostList)
810
- ]),
811
- _: 1
812
- }),
813
- createVNode(unref(g), null, {
814
- default: withCtx(() => [
815
- createVNode(_component_PostPanel)
816
- ]),
817
- _: 1
818
- })
819
- ]),
820
- _: 1
821
- });
822
- };
823
- }
824
- });
825
-
826
- /* Injected with object hook! */
827
-
828
- /* Injected with object hook! */
829
-
830
- export { _sfc_main as default };