@valaxyjs/devtools 0.0.1 → 0.18.0-beta.3
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/README.md +13 -0
- package/build.config.ts +3 -0
- package/dist/client/assets/_plugin-vue_export-helper-PLawvS9c.js +11 -0
- package/dist/client/assets/about-ElTANHBg.js +12 -0
- package/dist/client/assets/categories-J8DcyOCk.js +12 -0
- package/dist/client/assets/index-Ic8qbUfo.js +4526 -0
- package/dist/client/assets/{index-UJyf60Kd.css → index-NKBWV0hh.css} +9 -1
- package/dist/client/assets/{index-vPMPXhW9.js → index-q944aN_L.js} +331 -646
- package/dist/client/assets/index-xfOC-KHy.css +61 -0
- package/dist/client/assets/tags--GcTVHIk.js +12 -0
- package/dist/client/index.html +3 -3
- package/dist/index.cjs +41 -5
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +38 -5
- package/package.json +13 -2
- package/src/client/App.vue +4 -12
- package/src/client/components/PageFrontmatter.vue +66 -0
- package/src/client/components/PostPanel.vue +22 -0
- package/src/client/components/VDPostCategories.vue +26 -0
- package/src/client/components/VDPostList.vue +31 -0
- package/src/client/components/VDTag.vue +9 -0
- package/src/client/components.d.ts +51 -0
- package/src/client/composables/app.ts +10 -0
- package/src/client/index.html +1 -1
- package/src/client/main.ts +6 -3
- package/src/client/pages/about.vue +5 -0
- package/src/client/pages/categories.vue +5 -0
- package/src/client/pages/index.vue +29 -3
- package/src/client/pages/tags.vue +5 -0
- package/src/client/styles/index.css +8 -0
- package/src/client/typed-routes.d.ts +4 -0
- package/src/client/types/index.ts +3 -0
- package/src/client/utils/api.ts +18 -0
- package/src/client/utils/get.ts +19 -0
- package/src/client/utils/index.ts +4 -0
- package/src/client/utils/init.ts +27 -0
- package/src/client/vite.config.ts +12 -14
- package/src/node/api/index.ts +35 -0
- package/src/node/index.ts +22 -5
- package/uno.config.ts +0 -3
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
.agui-button {
|
|
2
|
+
--border-radius: 2px;
|
|
3
|
+
}
|
|
4
|
+
.agui-button {
|
|
5
|
+
display: inline-flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
padding: 0 6px;
|
|
9
|
+
font-size: 12px;
|
|
10
|
+
appearance: none;
|
|
11
|
+
background: rgb(88, 88, 88) no-repeat center center;
|
|
12
|
+
color: #e6e6e6;
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
border-radius: var(--border-radius);
|
|
15
|
+
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
|
|
16
|
+
}
|
|
17
|
+
.agui-button[data-location=ALONE] {
|
|
18
|
+
border-radius: var(--border-radius);
|
|
19
|
+
}
|
|
20
|
+
.agui-button[data-location=LEFT] {
|
|
21
|
+
border-top-left-radius: var(--border-radius) var(--border-radius);
|
|
22
|
+
border-bottom-left-radius: var(--border-radius) var(--border-radius);
|
|
23
|
+
border-top-right-radius: 0;
|
|
24
|
+
border-bottom-right-radius: 0;
|
|
25
|
+
}
|
|
26
|
+
.agui-button[data-location=RIGHT] {
|
|
27
|
+
border-top-right-radius: var(--border-radius) var(--border-radius);
|
|
28
|
+
border-bottom-right-radius: var(--border-radius) var(--border-radius);
|
|
29
|
+
border-top-left-radius: 0;
|
|
30
|
+
border-bottom-left-radius: 0;
|
|
31
|
+
}
|
|
32
|
+
.agui-button:hover {
|
|
33
|
+
background: rgb(100, 100, 100);
|
|
34
|
+
color: #ffffff;
|
|
35
|
+
}
|
|
36
|
+
.agui-button.pressed, .agui-button:active {
|
|
37
|
+
background-color: #4772b3;
|
|
38
|
+
color: #ffffff;
|
|
39
|
+
}
|
|
40
|
+
.agui-button.mini {
|
|
41
|
+
font-size: 9px;
|
|
42
|
+
}.agui-input {
|
|
43
|
+
--agui-input-c-bg: rgba(42, 42, 42, 1);
|
|
44
|
+
color: var(--agui-c-label);
|
|
45
|
+
background-color: var(--agui-input-c-bg, rgb(42, 42, 42));
|
|
46
|
+
border: 1px solid var(--agui-c-border);
|
|
47
|
+
border-radius: 3px;
|
|
48
|
+
font-size: 13px;
|
|
49
|
+
height: 20px;
|
|
50
|
+
box-sizing: border-box;
|
|
51
|
+
transition: border-color 0.2s ease-in-out;
|
|
52
|
+
}
|
|
53
|
+
.agui-input:focus {
|
|
54
|
+
outline: none;
|
|
55
|
+
border-color: var(--agui-c-active);
|
|
56
|
+
}
|
|
57
|
+
.agui-input:disabled {
|
|
58
|
+
opacity: 0.5;
|
|
59
|
+
color: var(--agui-c-text-3);
|
|
60
|
+
border-color: var(--agui-c-border);
|
|
61
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { _ as _export_sfc } from './_plugin-vue_export-helper-PLawvS9c.js';
|
|
2
|
+
import { a as createElementBlock, o as openBlock } from './index-q944aN_L.js';
|
|
3
|
+
|
|
4
|
+
/* unplugin-vue-components disabled */const _sfc_main = {};
|
|
5
|
+
|
|
6
|
+
function _sfc_render(_ctx, _cache) {
|
|
7
|
+
return (openBlock(), createElementBlock("div", null, " Tags "))
|
|
8
|
+
}
|
|
9
|
+
const tags = /*#__PURE__*/_export_sfc(_sfc_main, [['render',_sfc_render]]);
|
|
10
|
+
/* Injected with object hook! */
|
|
11
|
+
|
|
12
|
+
export { tags as default };
|
package/dist/client/index.html
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
7
|
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
|
|
8
8
|
<title>Valaxy Devtools</title>
|
|
9
|
-
<script type="module" crossorigin src="./assets/index-
|
|
10
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
9
|
+
<script type="module" crossorigin src="./assets/index-q944aN_L.js"></script>
|
|
10
|
+
<link rel="stylesheet" crossorigin href="./assets/index-NKBWV0hh.css">
|
|
11
11
|
</head>
|
|
12
12
|
|
|
13
13
|
<body data-vite-inspect-mode="DEV">
|
|
14
|
-
<div id="app"></div>
|
|
14
|
+
<div id="app" class="h-full"></div>
|
|
15
15
|
<script>
|
|
16
16
|
(function () {
|
|
17
17
|
const prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches
|
package/dist/index.cjs
CHANGED
|
@@ -2,29 +2,63 @@
|
|
|
2
2
|
|
|
3
3
|
const c = require('picocolors');
|
|
4
4
|
const sirv = require('sirv');
|
|
5
|
+
const httpProxyMiddleware = require('http-proxy-middleware');
|
|
5
6
|
const node_path = require('node:path');
|
|
6
7
|
const node_url = require('node:url');
|
|
8
|
+
const bodyParser = require('body-parser');
|
|
9
|
+
const matter = require('gray-matter');
|
|
10
|
+
const fs = require('fs-extra');
|
|
7
11
|
|
|
8
12
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
9
13
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
10
14
|
|
|
11
15
|
const c__default = /*#__PURE__*/_interopDefaultCompat(c);
|
|
12
16
|
const sirv__default = /*#__PURE__*/_interopDefaultCompat(sirv);
|
|
17
|
+
const bodyParser__default = /*#__PURE__*/_interopDefaultCompat(bodyParser);
|
|
18
|
+
const matter__default = /*#__PURE__*/_interopDefaultCompat(matter);
|
|
19
|
+
const fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
|
|
13
20
|
|
|
14
21
|
const DIR_DIST = typeof __dirname !== "undefined" ? __dirname : node_path.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))));
|
|
15
22
|
const DEVTOOLS_CLIENT_FOLDER = node_path.resolve(DIR_DIST, "../dist/client");
|
|
16
23
|
const DIR_CLIENT = DEVTOOLS_CLIENT_FOLDER;
|
|
17
24
|
|
|
25
|
+
const prefix = "/valaxy-devtools-api";
|
|
26
|
+
function registerApi(server, _viteConfig) {
|
|
27
|
+
const app = server.middlewares;
|
|
28
|
+
app.use(bodyParser__default.json());
|
|
29
|
+
app.use(`${prefix}/frontmatter`, async (req, _res) => {
|
|
30
|
+
if (req.method === "POST") {
|
|
31
|
+
const { pageData, frontmatter: newFm } = await req.body;
|
|
32
|
+
const path = pageData.path;
|
|
33
|
+
if (fs__default.existsSync(path)) {
|
|
34
|
+
const rawMd = await fs__default.readFile(path, "utf-8");
|
|
35
|
+
const matterFile = matter__default(rawMd);
|
|
36
|
+
matterFile.data = newFm;
|
|
37
|
+
const newMd = matter__default.stringify(matterFile.content, matterFile.data);
|
|
38
|
+
await fs__default.writeFile(path, newMd);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
18
44
|
const NAME = "valaxy:devtools";
|
|
19
|
-
function ValaxyDevtools(options) {
|
|
45
|
+
function ValaxyDevtools(options = {}) {
|
|
20
46
|
let config;
|
|
21
47
|
function configureServer(server) {
|
|
22
48
|
const _print = server.printUrls;
|
|
23
49
|
const base = (options.base ?? server.config.base) || "/";
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
50
|
+
const devtoolsUrl = `${base}__valaxy_devtools__/`;
|
|
51
|
+
if (undefined?.VITE_DEV_VALAXY_DEVTOOLS === "true") {
|
|
52
|
+
server.middlewares.use(devtoolsUrl, httpProxyMiddleware.createProxyMiddleware({
|
|
53
|
+
target: "http://localhost:5001/#/",
|
|
54
|
+
changeOrigin: true
|
|
55
|
+
}));
|
|
56
|
+
} else {
|
|
57
|
+
server.middlewares.use(devtoolsUrl, sirv__default(DIR_CLIENT, {
|
|
58
|
+
single: true,
|
|
59
|
+
dev: true
|
|
60
|
+
}));
|
|
61
|
+
}
|
|
28
62
|
server.printUrls = () => {
|
|
29
63
|
let host = `${config.server.https ? "https" : "http"}://localhost:${config.server.port || "80"}`;
|
|
30
64
|
const url = server.resolvedUrls?.local[0];
|
|
@@ -40,9 +74,11 @@ function ValaxyDevtools(options) {
|
|
|
40
74
|
const colorUrl = (url2) => c__default.green(url2.replace(/:(\d+)\//, (_, port) => `:${c__default.bold(port)}/`));
|
|
41
75
|
console.log(` ${c__default.green("\u279C")} ${c__default.bold("Inspect")}: ${colorUrl(`${host}${base}__inspect/`)}`);
|
|
42
76
|
};
|
|
77
|
+
registerApi(server);
|
|
43
78
|
}
|
|
44
79
|
const plugin = {
|
|
45
80
|
name: NAME,
|
|
81
|
+
enforce: "pre",
|
|
46
82
|
configResolved(_config) {
|
|
47
83
|
config = _config;
|
|
48
84
|
},
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,22 +1,53 @@
|
|
|
1
1
|
import c from 'picocolors';
|
|
2
2
|
import sirv from 'sirv';
|
|
3
|
+
import { createProxyMiddleware } from 'http-proxy-middleware';
|
|
3
4
|
import { dirname, resolve } from 'node:path';
|
|
4
5
|
import { fileURLToPath } from 'node:url';
|
|
6
|
+
import bodyParser from 'body-parser';
|
|
7
|
+
import matter from 'gray-matter';
|
|
8
|
+
import fs from 'fs-extra';
|
|
5
9
|
|
|
6
10
|
const DIR_DIST = typeof __dirname !== "undefined" ? __dirname : dirname(fileURLToPath(import.meta.url));
|
|
7
11
|
const DEVTOOLS_CLIENT_FOLDER = resolve(DIR_DIST, "../dist/client");
|
|
8
12
|
const DIR_CLIENT = DEVTOOLS_CLIENT_FOLDER;
|
|
9
13
|
|
|
14
|
+
const prefix = "/valaxy-devtools-api";
|
|
15
|
+
function registerApi(server, _viteConfig) {
|
|
16
|
+
const app = server.middlewares;
|
|
17
|
+
app.use(bodyParser.json());
|
|
18
|
+
app.use(`${prefix}/frontmatter`, async (req, _res) => {
|
|
19
|
+
if (req.method === "POST") {
|
|
20
|
+
const { pageData, frontmatter: newFm } = await req.body;
|
|
21
|
+
const path = pageData.path;
|
|
22
|
+
if (fs.existsSync(path)) {
|
|
23
|
+
const rawMd = await fs.readFile(path, "utf-8");
|
|
24
|
+
const matterFile = matter(rawMd);
|
|
25
|
+
matterFile.data = newFm;
|
|
26
|
+
const newMd = matter.stringify(matterFile.content, matterFile.data);
|
|
27
|
+
await fs.writeFile(path, newMd);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
10
33
|
const NAME = "valaxy:devtools";
|
|
11
|
-
function ValaxyDevtools(options) {
|
|
34
|
+
function ValaxyDevtools(options = {}) {
|
|
12
35
|
let config;
|
|
13
36
|
function configureServer(server) {
|
|
14
37
|
const _print = server.printUrls;
|
|
15
38
|
const base = (options.base ?? server.config.base) || "/";
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
39
|
+
const devtoolsUrl = `${base}__valaxy_devtools__/`;
|
|
40
|
+
if (import.meta.env?.VITE_DEV_VALAXY_DEVTOOLS === "true") {
|
|
41
|
+
server.middlewares.use(devtoolsUrl, createProxyMiddleware({
|
|
42
|
+
target: "http://localhost:5001/#/",
|
|
43
|
+
changeOrigin: true
|
|
44
|
+
}));
|
|
45
|
+
} else {
|
|
46
|
+
server.middlewares.use(devtoolsUrl, sirv(DIR_CLIENT, {
|
|
47
|
+
single: true,
|
|
48
|
+
dev: true
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
20
51
|
server.printUrls = () => {
|
|
21
52
|
let host = `${config.server.https ? "https" : "http"}://localhost:${config.server.port || "80"}`;
|
|
22
53
|
const url = server.resolvedUrls?.local[0];
|
|
@@ -32,9 +63,11 @@ function ValaxyDevtools(options) {
|
|
|
32
63
|
const colorUrl = (url2) => c.green(url2.replace(/:(\d+)\//, (_, port) => `:${c.bold(port)}/`));
|
|
33
64
|
console.log(` ${c.green("\u279C")} ${c.bold("Inspect")}: ${colorUrl(`${host}${base}__inspect/`)}`);
|
|
34
65
|
};
|
|
66
|
+
registerApi(server);
|
|
35
67
|
}
|
|
36
68
|
const plugin = {
|
|
37
69
|
name: NAME,
|
|
70
|
+
enforce: "pre",
|
|
38
71
|
configResolved(_config) {
|
|
39
72
|
config = _config;
|
|
40
73
|
},
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@valaxyjs/devtools",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.18.0-beta.3",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "https://github.com/YunYouJun/valaxy"
|
|
7
7
|
},
|
|
@@ -18,13 +18,23 @@
|
|
|
18
18
|
"types": "dist/index.d.ts",
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@rollup/pluginutils": "^5.1.0",
|
|
21
|
+
"axios": "^1.6.7",
|
|
22
|
+
"body-parser": "^1.20.2",
|
|
23
|
+
"http-proxy-middleware": "^2.0.6",
|
|
21
24
|
"picocolors": "^1.0.0",
|
|
22
25
|
"sirv": "^2.0.4"
|
|
23
26
|
},
|
|
24
27
|
"devDependencies": {
|
|
28
|
+
"@advjs/gui": "0.0.5-beta.0",
|
|
29
|
+
"@iconify-json/ri": "^1.1.19",
|
|
30
|
+
"@types/body-parser": "^1.19.5",
|
|
31
|
+
"@types/splitpanes": "^2.2.6",
|
|
32
|
+
"gray-matter": "^4.0.3",
|
|
33
|
+
"splitpanes": "^3.1.5",
|
|
25
34
|
"typescript": "^5.3.3",
|
|
26
35
|
"unbuild": "^2.0.0",
|
|
27
|
-
"
|
|
36
|
+
"unplugin-vue-router": "^0.7.0",
|
|
37
|
+
"vite": "^5.1.1"
|
|
28
38
|
},
|
|
29
39
|
"scripts": {
|
|
30
40
|
"build": "rimraf dist && run-s build:*",
|
|
@@ -32,6 +42,7 @@
|
|
|
32
42
|
"build:node": "unbuild",
|
|
33
43
|
"dev": "npm run stub && npm run dev:client",
|
|
34
44
|
"dev:client": "vite build src/client --watch",
|
|
45
|
+
"dev:src": "vite dev src/client --port 5001",
|
|
35
46
|
"stub": "unbuild --stub",
|
|
36
47
|
"release": "bumpp && npm publish"
|
|
37
48
|
}
|
package/src/client/App.vue
CHANGED
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
<script
|
|
1
|
+
<script lang="ts" setup>
|
|
2
2
|
import { onMounted } from 'vue'
|
|
3
|
-
import {
|
|
3
|
+
import { initDevtoolsClient } from './utils'
|
|
4
4
|
|
|
5
5
|
onMounted(() => {
|
|
6
|
-
|
|
7
|
-
document.title = 'Vite Inspect (Production)'
|
|
6
|
+
initDevtoolsClient()
|
|
8
7
|
})
|
|
9
8
|
</script>
|
|
10
9
|
|
|
11
10
|
<template>
|
|
12
|
-
<
|
|
13
|
-
<Suspense>
|
|
14
|
-
<RouterView />
|
|
15
|
-
<template #fallback>
|
|
16
|
-
Loading...
|
|
17
|
-
</template>
|
|
18
|
-
</Suspense>
|
|
19
|
-
</main>
|
|
11
|
+
<RouterView />
|
|
20
12
|
</template>
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { ref, toRaw } from 'vue'
|
|
3
|
+
import type { PostFrontMatter } from 'valaxy'
|
|
4
|
+
|
|
5
|
+
import axios from 'axios'
|
|
6
|
+
import consola from 'consola'
|
|
7
|
+
import { pageData } from '../composables/app'
|
|
8
|
+
|
|
9
|
+
const props = defineProps<{
|
|
10
|
+
frontmatter: PostFrontMatter
|
|
11
|
+
}>()
|
|
12
|
+
|
|
13
|
+
const newFm = ref<PostFrontMatter>(props.frontmatter)
|
|
14
|
+
async function saveNewFm() {
|
|
15
|
+
// const data = await fetch('/valaxy-devtools-api/frontmatter', {
|
|
16
|
+
// method: 'POST',
|
|
17
|
+
// // body: JSON.stringify(toRaw(newFm.value)),
|
|
18
|
+
// })
|
|
19
|
+
|
|
20
|
+
const res = await axios.post('/valaxy-devtools-api/frontmatter', {
|
|
21
|
+
pageData: pageData.value,
|
|
22
|
+
frontmatter: toRaw(newFm.value),
|
|
23
|
+
})
|
|
24
|
+
if (res)
|
|
25
|
+
consola.success('Frontmatter saved')
|
|
26
|
+
|
|
27
|
+
// console.log(res)
|
|
28
|
+
}
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<div>
|
|
33
|
+
<ul v-if="frontmatter">
|
|
34
|
+
<li v-for="(value, key) in frontmatter" :key="key">
|
|
35
|
+
<strong>{{ key }}</strong>
|
|
36
|
+
<span mr-1>:</span>
|
|
37
|
+
|
|
38
|
+
<template v-if="key === 'tags'">
|
|
39
|
+
<VDTag v-for="tag in value" :key="tag">
|
|
40
|
+
{{ tag }}
|
|
41
|
+
</VDTag>
|
|
42
|
+
</template>
|
|
43
|
+
<template v-else-if="key === 'categories'">
|
|
44
|
+
<VDPostCategories :categories="value" />
|
|
45
|
+
</template>
|
|
46
|
+
<template v-else-if="key === 'encryptedContent'">
|
|
47
|
+
[Encrypted]
|
|
48
|
+
</template>
|
|
49
|
+
<template v-else-if="key === 'partiallyEncryptedContents'">
|
|
50
|
+
[Partially Encrypted]
|
|
51
|
+
</template>
|
|
52
|
+
<template v-else-if="key === 'title'">
|
|
53
|
+
<!-- eslint-disable-next-line vue/no-mutating-props -->
|
|
54
|
+
<AGUIInput v-model="newFm.title" />
|
|
55
|
+
</template>
|
|
56
|
+
<template v-else>
|
|
57
|
+
{{ value }}
|
|
58
|
+
</template>
|
|
59
|
+
</li>
|
|
60
|
+
</ul>
|
|
61
|
+
|
|
62
|
+
<AGUIButton @click="saveNewFm">
|
|
63
|
+
Save Frontmatter
|
|
64
|
+
</AGUIButton>
|
|
65
|
+
</div>
|
|
66
|
+
</template>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { getWindowProperty, openInEditor } from '../utils'
|
|
3
|
+
import { frontmatter } from '../composables/app'
|
|
4
|
+
|
|
5
|
+
function launchEditor() {
|
|
6
|
+
openInEditor({
|
|
7
|
+
file: getWindowProperty('$pageData').path,
|
|
8
|
+
})
|
|
9
|
+
}
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<div p="2">
|
|
14
|
+
<div class="flex" gap="2" py-2>
|
|
15
|
+
<button class="text-xs shadow transition hover:shadow-lg p-2" @click="launchEditor()">
|
|
16
|
+
<div i-vscode-icons:file-type-vscode />
|
|
17
|
+
</button>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<PageFrontmatter v-if="frontmatter" :frontmatter="frontmatter" />
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import type { Post } from 'valaxy'
|
|
3
|
+
|
|
4
|
+
defineProps<{
|
|
5
|
+
categories: Post['categories']
|
|
6
|
+
}>()
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<RouterLink
|
|
11
|
+
:to="{
|
|
12
|
+
path: '/categories',
|
|
13
|
+
query: { category: Array.isArray(categories) ? categories.join('/') : categories },
|
|
14
|
+
}"
|
|
15
|
+
class="post-category transition text-xs hover:(text-blue-500 border-blue-500)"
|
|
16
|
+
px-2 py-1
|
|
17
|
+
border rounded-full
|
|
18
|
+
inline-flex justify-center items-center
|
|
19
|
+
bg="hover:(blue-500 opacity-10)"
|
|
20
|
+
>
|
|
21
|
+
<div m="x-1" inline-flex i-ri-folder-2-line />
|
|
22
|
+
<span>
|
|
23
|
+
{{ Array.isArray(categories) ? categories.join(' > ') : categories }}
|
|
24
|
+
</span>
|
|
25
|
+
</RouterLink>
|
|
26
|
+
</template>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { onMounted, ref } from 'vue'
|
|
3
|
+
import { getGlobalValaxyProperty } from '../utils'
|
|
4
|
+
import { activePath, devtoolsRouter } from '../composables/app'
|
|
5
|
+
|
|
6
|
+
const postList = ref()
|
|
7
|
+
|
|
8
|
+
onMounted(() => {
|
|
9
|
+
postList.value = getGlobalValaxyProperty('postList').value
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
function onClickPost(post: any) {
|
|
13
|
+
devtoolsRouter.value?.push(post.path)
|
|
14
|
+
}
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<ul class="h-full" overflow="auto" pl="12" pr="4" py="4">
|
|
19
|
+
<li v-for="post in postList" :key="post.path" class="list-decimal">
|
|
20
|
+
<div flex>
|
|
21
|
+
<span
|
|
22
|
+
class="inline-flex flex-grow cursor-pointer hover:text-blue-500"
|
|
23
|
+
:class="{ 'text-blue-500 font-bold': activePath === post.path }"
|
|
24
|
+
@click="onClickPost(post)"
|
|
25
|
+
>
|
|
26
|
+
{{ post.title }}
|
|
27
|
+
</span>
|
|
28
|
+
</div>
|
|
29
|
+
</li>
|
|
30
|
+
</ul>
|
|
31
|
+
</template>
|
|
@@ -7,7 +7,58 @@ export {}
|
|
|
7
7
|
|
|
8
8
|
declare module 'vue' {
|
|
9
9
|
export interface GlobalComponents {
|
|
10
|
+
AGUIAccordion: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/accordion/AGUIAccordion.vue')['default']
|
|
11
|
+
AGUIAccordionItem: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/accordion/AGUIAccordionItem.vue')['default']
|
|
12
|
+
AGUIApp: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/AGUIApp.vue')['default']
|
|
13
|
+
AGUIAssetsExplorer: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/explorer/AGUIAssetsExplorer.vue')['default']
|
|
14
|
+
AGUIBreadcrumb: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/breadcrumb/AGUIBreadcrumb.vue')['default']
|
|
15
|
+
AGUIButton: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/button/AGUIButton.vue')['default']
|
|
16
|
+
AGUICheckbox: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/AGUICheckbox.vue')['default']
|
|
17
|
+
AGUIColorPicker: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/AGUIColorPicker.vue')['default']
|
|
18
|
+
AGUIContextMenu: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/context-menu/AGUIContextMenu.vue')['default']
|
|
19
|
+
AGUIContextMenuItem: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/context-menu/AGUIContextMenuItem.vue')['default']
|
|
20
|
+
AGUIDetails: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/AGUIDetails.vue')['default']
|
|
21
|
+
AGUIExplorerControls: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/explorer/AGUIExplorerControls.vue')['default']
|
|
22
|
+
AGUIFileHandler: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/file/AGUIFileHandler.vue')['default']
|
|
23
|
+
AGUIFileItem: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/explorer/AGUIFileItem.vue')['default']
|
|
24
|
+
AGUIFileList: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/explorer/AGUIFileList.vue')['default']
|
|
25
|
+
AGUIForm: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/form/AGUIForm.vue')['default']
|
|
26
|
+
AGUIFormItem: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/form/AGUIFormItem.vue')['default']
|
|
27
|
+
AGUIHr: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/common/AGUIHr.vue')['default']
|
|
28
|
+
AGUIIcon: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/icon/AGUIIcon.vue')['default']
|
|
29
|
+
AGUIIconButton: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/button/AGUIIconButton.vue')['default']
|
|
30
|
+
AGUIInnerInput: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/input/AGUIInnerInput.vue')['default']
|
|
31
|
+
AGUIInput: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/input/AGUIInput.vue')['default']
|
|
32
|
+
AGUIInputNumber: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/input/AGUIInputNumber.vue')['default']
|
|
33
|
+
AGUIInputVector: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/input/AGUIInputVector.vue')['default']
|
|
34
|
+
AGUILayout: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/layout/AGUILayout.vue')['default']
|
|
35
|
+
AGUIMenubar: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/menu/AGUIMenubar.vue')['default']
|
|
36
|
+
AGUIMenubarMenu: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/menu/AGUIMenubarMenu.vue')['default']
|
|
37
|
+
AGUINumberField: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/AGUINumberField.vue')['default']
|
|
38
|
+
AGUINumberSlider: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/AGUINumberSlider.vue')['default']
|
|
39
|
+
AGUIOpenDirectory: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/explorer/AGUIOpenDirectory.vue')['default']
|
|
40
|
+
AGUIOverlay: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/AGUIOverlay.vue')['default']
|
|
41
|
+
AGUIPanel: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/AGUIPanel.vue')['default']
|
|
42
|
+
AGUIPropertiesForm: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/panel/AGUIPropertiesForm.vue')['default']
|
|
43
|
+
AGUIPropertiesPanel: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/panel/AGUIPropertiesPanel.vue')['default']
|
|
44
|
+
AGUIProperty: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/AGUIProperty.vue')['default']
|
|
45
|
+
AGUISelect: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/select/AGUISelect.vue')['default']
|
|
46
|
+
AGUISlider: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/AGUISlider.vue')['default']
|
|
47
|
+
AGUITabPanel: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/tabs/AGUITabPanel.vue')['default']
|
|
48
|
+
AGUITabs: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/tabs/AGUITabs.vue')['default']
|
|
49
|
+
AGUIToast: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/toast/AGUIToast.vue')['default']
|
|
50
|
+
AGUIToggleIcon: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/button/AGUIToggleIcon.vue')['default']
|
|
51
|
+
AGUIToolbar: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/toolbar/AGUIToolbar.vue')['default']
|
|
52
|
+
AGUITree: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/tree/AGUITree.vue')['default']
|
|
53
|
+
AGUITreeNode: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/tree/AGUITreeNode.vue')['default']
|
|
54
|
+
BIconChevronLeft: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/icons/BIconChevronLeft.vue')['default']
|
|
55
|
+
BIconChevronRight: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.5-beta.0_vue@3.4.19/node_modules/@advjs/gui/client/components/icons/BIconChevronRight.vue')['default']
|
|
56
|
+
PageFrontmatter: typeof import('./components/PageFrontmatter.vue')['default']
|
|
57
|
+
PostPanel: typeof import('./components/PostPanel.vue')['default']
|
|
10
58
|
RouterLink: typeof import('vue-router')['RouterLink']
|
|
11
59
|
RouterView: typeof import('vue-router')['RouterView']
|
|
60
|
+
VDPostCategories: typeof import('./components/VDPostCategories.vue')['default']
|
|
61
|
+
VDPostList: typeof import('./components/VDPostList.vue')['default']
|
|
62
|
+
VDTag: typeof import('./components/VDTag.vue')['default']
|
|
12
63
|
}
|
|
13
64
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PageData, PostFrontMatter } from 'valaxy'
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
|
|
4
|
+
import type { Router } from 'vue-router'
|
|
5
|
+
|
|
6
|
+
export const devtoolsRouter = ref<Router>()
|
|
7
|
+
export const activePath = ref('')
|
|
8
|
+
|
|
9
|
+
export const frontmatter = ref<PostFrontMatter>()
|
|
10
|
+
export const pageData = ref<PageData>()
|
package/src/client/index.html
CHANGED
package/src/client/main.ts
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
// register vue composition api globally
|
|
2
2
|
import { createApp } from 'vue'
|
|
3
|
-
import { createRouter, createWebHashHistory } from 'vue-router'
|
|
4
|
-
import { routes } from 'vue-router/auto/routes'
|
|
3
|
+
import { createRouter, createWebHashHistory } from 'vue-router/auto'
|
|
5
4
|
import App from './App.vue'
|
|
6
5
|
|
|
7
6
|
import '@unocss/reset/tailwind.css'
|
|
8
7
|
import 'uno.css'
|
|
9
8
|
|
|
9
|
+
import './styles/index.css'
|
|
10
|
+
import 'splitpanes/dist/splitpanes.css'
|
|
11
|
+
|
|
10
12
|
const app = createApp(App)
|
|
13
|
+
|
|
11
14
|
const router = createRouter({
|
|
12
15
|
history: createWebHashHistory(),
|
|
13
|
-
routes,
|
|
14
16
|
})
|
|
17
|
+
|
|
15
18
|
app.use(router)
|
|
16
19
|
app.mount('#app')
|