@valaxyjs/devtools 0.0.1 → 0.18.0-beta.2
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/dist/client/assets/about-SiRA-rr8.js +11 -0
- package/dist/client/assets/categories-XFPOy2yC.js +11 -0
- package/dist/client/assets/index-51E08Ncj.js +522 -0
- package/dist/client/assets/{index-vPMPXhW9.js → index-8_TdlA6f.js} +304 -658
- package/dist/client/assets/{index-UJyf60Kd.css → index-ZDzLlgt_.css} +5 -1
- package/dist/client/assets/tags-pRAQg_EK.js +11 -0
- package/dist/client/index.html +3 -3
- package/dist/index.cjs +1 -1
- 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 +1 -1
- package/package.json +7 -2
- package/src/client/App.vue +1 -18
- package/src/client/components/PageFrontmatter.vue +15 -0
- package/src/client/components/VDPostList.vue +51 -0
- package/src/client/components.d.ts +2 -0
- package/src/client/composables/app.ts +3 -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 +36 -3
- package/src/client/pages/tags.vue +5 -0
- package/src/client/styles/index.css +4 -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 +3 -0
- package/src/client/vite.config.ts +10 -13
- package/src/node/index.ts +1 -1
- package/uno.config.ts +0 -3
|
@@ -384,4 +384,8 @@ Make elements with the HTML hidden attribute stay hidden by default.
|
|
|
384
384
|
|
|
385
385
|
[hidden] {
|
|
386
386
|
display: none;
|
|
387
|
-
} *,::before,::after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / 0.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: ;}::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / 0.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: ;}.
|
|
387
|
+
} *,::before,::after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / 0.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: ;}::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / 0.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: ;}.i-ri-book-line,[i-ri-book-line=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M3 18.5V5a3 3 0 0 1 3-3h14a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5A3.5 3.5 0 0 1 3 18.5M19 20v-3H6.5a1.5 1.5 0 0 0 0 3zM5 15.337A3.486 3.486 0 0 1 6.5 15H19V4H6a1 1 0 0 0-1 1z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em;}.i-vscode-icons\:file-type-vscode,[i-vscode-icons\:file-type-vscode=""]{background:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='%230065a9' d='m29.01 5.03l-5.766-2.776a1.742 1.742 0 0 0-1.989.338L2.38 19.8a1.166 1.166 0 0 0-.08 1.647c.025.027.05.053.077.077l1.541 1.4a1.165 1.165 0 0 0 1.489.066L28.142 5.75A1.158 1.158 0 0 1 30 6.672v-.067a1.748 1.748 0 0 0-.99-1.575'/%3E%3Cpath fill='%23007acc' d='m29.01 26.97l-5.766 2.777a1.745 1.745 0 0 1-1.989-.338L2.38 12.2a1.166 1.166 0 0 1-.08-1.647c.025-.027.05-.053.077-.077l1.541-1.4A1.165 1.165 0 0 1 5.41 9.01l22.732 17.24A1.158 1.158 0 0 0 30 25.328v.072a1.749 1.749 0 0 1-.99 1.57'/%3E%3Cpath fill='%231f9cf0' d='M23.244 29.747a1.745 1.745 0 0 1-1.989-.338A1.025 1.025 0 0 0 23 28.684V3.316a1.024 1.024 0 0 0-1.749-.724a1.744 1.744 0 0 1 1.989-.339l5.765 2.772A1.748 1.748 0 0 1 30 6.6v18.8a1.748 1.748 0 0 1-.991 1.576Z'/%3E%3C/svg%3E") no-repeat;background-size:100% 100%;background-color:transparent;width:1.2em;height:1.2em;}.ml-2{margin-left:0.5rem;}.h-8{height:2rem;}.h-full{height:100%;}.w-8{width:2rem;}.w-full{width:100%;}.flex,[flex=""],[flex~="\~"]{display:flex;}.inline-flex{display:inline-flex;}.flex-grow{flex-grow:1;}[flex~="col"]{flex-direction:column;}.cursor-pointer{cursor:pointer;}.list-decimal{list-style-type:decimal;}.items-center{align-items:center;}.justify-end{justify-content:flex-end;}.justify-center{justify-content:center;}[overflow~="auto"]{overflow:auto;}.border-b{border-bottom-width:1px;}.bg-gray-100{--un-bg-opacity:1;background-color:rgb(243 244 246 / var(--un-bg-opacity));}.py,[py~="\34 "]{padding-top:1rem;padding-bottom:1rem;}.pl{padding-left:1rem;}.pr,[pr~="\34 "]{padding-right:1rem;}[pl~="\31 2"]{padding-left:3rem;}.text-xs{font-size:0.75rem;line-height:1rem;}.dark [text~="dark\:gray-200"]{--un-text-opacity:1;color:rgb(229 231 235 / var(--un-text-opacity));}.text-blue-500{--un-text-opacity:1;color:rgb(59 130 246 / var(--un-text-opacity));}[text~="gray-700"]{--un-text-opacity:1;color:rgb(55 65 81 / var(--un-text-opacity));}.hover\:text-blue-500:hover{--un-text-opacity:1;color:rgb(59 130 246 / var(--un-text-opacity));}.underline{text-decoration-line:underline;}.shadow{--un-shadow:var(--un-shadow-inset) 0 1px 3px 0 var(--un-shadow-color, rgb(0 0 0 / 0.1)),var(--un-shadow-inset) 0 1px 2px -1px var(--un-shadow-color, rgb(0 0 0 / 0.1));box-shadow:var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow);} html,
|
|
388
|
+
body {
|
|
389
|
+
height: 100%;
|
|
390
|
+
}
|
|
391
|
+
.splitpanes{display:flex;width:100%;height:100%}.splitpanes--vertical{flex-direction:row}.splitpanes--horizontal{flex-direction:column}.splitpanes--dragging *{user-select:none}.splitpanes__pane{width:100%;height:100%;overflow:hidden}.splitpanes--vertical .splitpanes__pane{transition:width .2s ease-out}.splitpanes--horizontal .splitpanes__pane{transition:height .2s ease-out}.splitpanes--dragging .splitpanes__pane{transition:none}.splitpanes__splitter{touch-action:none}.splitpanes--vertical>.splitpanes__splitter{min-width:1px;cursor:col-resize}.splitpanes--horizontal>.splitpanes__splitter{min-height:1px;cursor:row-resize}.splitpanes.default-theme .splitpanes__pane{background-color:#f2f2f2}.splitpanes.default-theme .splitpanes__splitter{background-color:#fff;box-sizing:border-box;position:relative;flex-shrink:0}.splitpanes.default-theme .splitpanes__splitter:before,.splitpanes.default-theme .splitpanes__splitter:after{content:"";position:absolute;top:50%;left:50%;background-color:#00000026;transition:background-color .3s}.splitpanes.default-theme .splitpanes__splitter:hover:before,.splitpanes.default-theme .splitpanes__splitter:hover:after{background-color:#00000040}.splitpanes.default-theme .splitpanes__splitter:first-child{cursor:auto}.default-theme.splitpanes .splitpanes .splitpanes__splitter{z-index:1}.default-theme.splitpanes--vertical>.splitpanes__splitter,.default-theme .splitpanes--vertical>.splitpanes__splitter{width:7px;border-left:1px solid #eee;margin-left:-1px}.default-theme.splitpanes--vertical>.splitpanes__splitter:before,.default-theme.splitpanes--vertical>.splitpanes__splitter:after,.default-theme .splitpanes--vertical>.splitpanes__splitter:before,.default-theme .splitpanes--vertical>.splitpanes__splitter:after{transform:translateY(-50%);width:1px;height:30px}.default-theme.splitpanes--vertical>.splitpanes__splitter:before,.default-theme .splitpanes--vertical>.splitpanes__splitter:before{margin-left:-2px}.default-theme.splitpanes--vertical>.splitpanes__splitter:after,.default-theme .splitpanes--vertical>.splitpanes__splitter:after{margin-left:1px}.default-theme.splitpanes--horizontal>.splitpanes__splitter,.default-theme .splitpanes--horizontal>.splitpanes__splitter{height:7px;border-top:1px solid #eee;margin-top:-1px}.default-theme.splitpanes--horizontal>.splitpanes__splitter:before,.default-theme.splitpanes--horizontal>.splitpanes__splitter:after,.default-theme .splitpanes--horizontal>.splitpanes__splitter:before,.default-theme .splitpanes--horizontal>.splitpanes__splitter:after{transform:translate(-50%);width:30px;height:1px}.default-theme.splitpanes--horizontal>.splitpanes__splitter:before,.default-theme .splitpanes--horizontal>.splitpanes__splitter:before{margin-top:-2px}.default-theme.splitpanes--horizontal>.splitpanes__splitter:after,.default-theme .splitpanes--horizontal>.splitpanes__splitter:after{margin-top:1px}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { _ as _export_sfc, o as openBlock, c as createElementBlock } from './index-8_TdlA6f.js';
|
|
2
|
+
|
|
3
|
+
/* unplugin-vue-components disabled */const _sfc_main = {};
|
|
4
|
+
|
|
5
|
+
function _sfc_render(_ctx, _cache) {
|
|
6
|
+
return (openBlock(), createElementBlock("div", null, " Tags "))
|
|
7
|
+
}
|
|
8
|
+
const tags = /*#__PURE__*/_export_sfc(_sfc_main, [['render',_sfc_render]]);
|
|
9
|
+
/* Injected with object hook! */
|
|
10
|
+
|
|
11
|
+
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-8_TdlA6f.js"></script>
|
|
10
|
+
<link rel="stylesheet" crossorigin href="./assets/index-ZDzLlgt_.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
|
@@ -16,7 +16,7 @@ const DEVTOOLS_CLIENT_FOLDER = node_path.resolve(DIR_DIST, "../dist/client");
|
|
|
16
16
|
const DIR_CLIENT = DEVTOOLS_CLIENT_FOLDER;
|
|
17
17
|
|
|
18
18
|
const NAME = "valaxy:devtools";
|
|
19
|
-
function ValaxyDevtools(options) {
|
|
19
|
+
function ValaxyDevtools(options = {}) {
|
|
20
20
|
let config;
|
|
21
21
|
function configureServer(server) {
|
|
22
22
|
const _print = server.printUrls;
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -8,7 +8,7 @@ const DEVTOOLS_CLIENT_FOLDER = resolve(DIR_DIST, "../dist/client");
|
|
|
8
8
|
const DIR_CLIENT = DEVTOOLS_CLIENT_FOLDER;
|
|
9
9
|
|
|
10
10
|
const NAME = "valaxy:devtools";
|
|
11
|
-
function ValaxyDevtools(options) {
|
|
11
|
+
function ValaxyDevtools(options = {}) {
|
|
12
12
|
let config;
|
|
13
13
|
function configureServer(server) {
|
|
14
14
|
const _print = server.printUrls;
|
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.2",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "https://github.com/YunYouJun/valaxy"
|
|
7
7
|
},
|
|
@@ -22,9 +22,13 @@
|
|
|
22
22
|
"sirv": "^2.0.4"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
+
"@iconify-json/ri": "^1.1.19",
|
|
26
|
+
"@types/splitpanes": "^2.2.6",
|
|
27
|
+
"splitpanes": "^3.1.5",
|
|
25
28
|
"typescript": "^5.3.3",
|
|
26
29
|
"unbuild": "^2.0.0",
|
|
27
|
-
"
|
|
30
|
+
"unplugin-vue-router": "^0.7.0",
|
|
31
|
+
"vite": "^5.1.1"
|
|
28
32
|
},
|
|
29
33
|
"scripts": {
|
|
30
34
|
"build": "rimraf dist && run-s build:*",
|
|
@@ -32,6 +36,7 @@
|
|
|
32
36
|
"build:node": "unbuild",
|
|
33
37
|
"dev": "npm run stub && npm run dev:client",
|
|
34
38
|
"dev:client": "vite build src/client --watch",
|
|
39
|
+
"dev:src": "vite dev src/client",
|
|
35
40
|
"stub": "unbuild --stub",
|
|
36
41
|
"release": "bumpp && npm publish"
|
|
37
42
|
}
|
package/src/client/App.vue
CHANGED
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { onMounted } from 'vue'
|
|
3
|
-
import { isStaticMode } from './utils'
|
|
4
|
-
|
|
5
|
-
onMounted(() => {
|
|
6
|
-
if (isStaticMode)
|
|
7
|
-
document.title = 'Vite Inspect (Production)'
|
|
8
|
-
})
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
1
|
<template>
|
|
12
|
-
<
|
|
13
|
-
<Suspense>
|
|
14
|
-
<RouterView />
|
|
15
|
-
<template #fallback>
|
|
16
|
-
Loading...
|
|
17
|
-
</template>
|
|
18
|
-
</Suspense>
|
|
19
|
-
</main>
|
|
2
|
+
<RouterView />
|
|
20
3
|
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
defineProps<{
|
|
3
|
+
frontmatter?: object
|
|
4
|
+
}>()
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<div>
|
|
9
|
+
<ul v-if="frontmatter">
|
|
10
|
+
<li v-for="(value, key) in frontmatter" :key="key">
|
|
11
|
+
<strong>{{ key }}</strong>: {{ value }}
|
|
12
|
+
</li>
|
|
13
|
+
</ul>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { onMounted, ref } from 'vue'
|
|
3
|
+
import type { Router } from 'vue-router/auto'
|
|
4
|
+
import { getGlobalValaxyProperty, getWindowProperty, openInEditor } from '../utils'
|
|
5
|
+
import { frontmatter } from '../composables/app'
|
|
6
|
+
|
|
7
|
+
const activePath = ref('')
|
|
8
|
+
|
|
9
|
+
const __VUE_DEVTOOLS_ROUTER__ = getWindowProperty('__VUE_DEVTOOLS_ROUTER__') as Router
|
|
10
|
+
__VUE_DEVTOOLS_ROUTER__.beforeEach((to, _from, next) => {
|
|
11
|
+
activePath.value = to.path
|
|
12
|
+
frontmatter.value = getWindowProperty('$frontmatter')
|
|
13
|
+
next()
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
const postList = ref()
|
|
17
|
+
|
|
18
|
+
onMounted(() => {
|
|
19
|
+
postList.value = getGlobalValaxyProperty('postList').value
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
function onClickPost(post: any) {
|
|
23
|
+
__VUE_DEVTOOLS_ROUTER__.push(post.path)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function launchEditor() {
|
|
27
|
+
openInEditor({
|
|
28
|
+
file: getWindowProperty('$pageData').path,
|
|
29
|
+
})
|
|
30
|
+
}
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<template>
|
|
34
|
+
<ul class="h-full" overflow="auto" pl="12" pr="4" py="4">
|
|
35
|
+
{{ activePath }}
|
|
36
|
+
<li v-for="post in postList" :key="post.path" class="list-decimal">
|
|
37
|
+
<div flex>
|
|
38
|
+
<span
|
|
39
|
+
class="inline-flex flex-grow cursor-pointer underline hover:text-blue-500"
|
|
40
|
+
:class="{ 'text-blue-500': activePath === post.path }"
|
|
41
|
+
@click="onClickPost(post)"
|
|
42
|
+
>
|
|
43
|
+
{{ post.title }}
|
|
44
|
+
</span>
|
|
45
|
+
<button class="ml-2 text-xs" @click="launchEditor()">
|
|
46
|
+
<div i-vscode-icons:file-type-vscode />
|
|
47
|
+
</button>
|
|
48
|
+
</div>
|
|
49
|
+
</li>
|
|
50
|
+
</ul>
|
|
51
|
+
</template>
|
|
@@ -7,7 +7,9 @@ export {}
|
|
|
7
7
|
|
|
8
8
|
declare module 'vue' {
|
|
9
9
|
export interface GlobalComponents {
|
|
10
|
+
PageFrontmatter: typeof import('./components/PageFrontmatter.vue')['default']
|
|
10
11
|
RouterLink: typeof import('vue-router')['RouterLink']
|
|
11
12
|
RouterView: typeof import('vue-router')['RouterView']
|
|
13
|
+
VDPostList: typeof import('./components/VDPostList.vue')['default']
|
|
12
14
|
}
|
|
13
15
|
}
|
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')
|
|
@@ -1,5 +1,38 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { Pane, Splitpanes } from 'splitpanes'
|
|
3
|
+
import { onMounted } from 'vue'
|
|
4
|
+
import { getWindowProperty, isStaticMode } from '../utils'
|
|
5
|
+
|
|
6
|
+
import type { BlogWindow } from '../types'
|
|
7
|
+
import { frontmatter } from '../composables/app'
|
|
8
|
+
|
|
9
|
+
onMounted(() => {
|
|
10
|
+
if (isStaticMode)
|
|
11
|
+
document.title = 'Valaxy DevTools (Production)'
|
|
12
|
+
|
|
13
|
+
const $frontmatter = getWindowProperty('$frontmatter') as BlogWindow['$frontmatter']
|
|
14
|
+
if ($frontmatter)
|
|
15
|
+
frontmatter.value = $frontmatter
|
|
16
|
+
})
|
|
17
|
+
</script>
|
|
18
|
+
|
|
1
19
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
20
|
+
<main class="h-full" flex="~ col" text="gray-700 dark:gray-200">
|
|
21
|
+
<div class="w-full border-b shadow flex justify-end">
|
|
22
|
+
<a href="https://valaxy.site" target="_blank" class="bg-gray-100 inline-flex justify-center items-center w-8 h-8">
|
|
23
|
+
<div i-ri-book-line />
|
|
24
|
+
</a>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<div style="height: calc(100% - 32px)" overflow="auto">
|
|
28
|
+
<Splitpanes class="h-full">
|
|
29
|
+
<Pane>
|
|
30
|
+
<VDPostList />
|
|
31
|
+
</Pane>
|
|
32
|
+
<Pane>
|
|
33
|
+
<PageFrontmatter :frontmatter="frontmatter" />
|
|
34
|
+
</Pane>
|
|
35
|
+
</Splitpanes>
|
|
36
|
+
</div>
|
|
37
|
+
</main>
|
|
5
38
|
</template>
|
|
@@ -39,6 +39,10 @@ import type {
|
|
|
39
39
|
|
|
40
40
|
declare module 'vue-router/auto/routes' {
|
|
41
41
|
export interface RouteNamedMap {
|
|
42
|
+
'/': RouteRecordInfo<'/', '/', Record<never, never>, Record<never, never>>,
|
|
43
|
+
'/about': RouteRecordInfo<'/about', '/about', Record<never, never>, Record<never, never>>,
|
|
44
|
+
'/categories': RouteRecordInfo<'/categories', '/categories', Record<never, never>, Record<never, never>>,
|
|
45
|
+
'/tags': RouteRecordInfo<'/tags', '/tags', Record<never, never>, Record<never, never>>,
|
|
42
46
|
}
|
|
43
47
|
}
|
|
44
48
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// import from @vue/devtools-api not work
|
|
2
|
+
import { getAppWindow } from './get'
|
|
3
|
+
|
|
4
|
+
const target = getAppWindow()
|
|
5
|
+
|
|
6
|
+
export interface OpenInEditorOptions {
|
|
7
|
+
file?: string
|
|
8
|
+
line?: number
|
|
9
|
+
column?: number
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function openInEditor(options: OpenInEditorOptions = {}) {
|
|
13
|
+
const { file, line = 0, column = 0 } = options
|
|
14
|
+
if (file) {
|
|
15
|
+
const baseUrl = window.location.origin
|
|
16
|
+
target?.__VUE_INSPECTOR__.openInEditor(baseUrl, file, line, column)
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export function getAppWindow() {
|
|
2
|
+
return window.parent.parent as unknown as {
|
|
3
|
+
__VUE_INSPECTOR__: {
|
|
4
|
+
openInEditor: (baseUrl: string, file: string, line: number, column: number) => void
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* window.parent.parent is the window object of the main app
|
|
11
|
+
*/
|
|
12
|
+
export function getWindowProperty(property: string) {
|
|
13
|
+
return (window.parent.parent as any)[property]
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function getGlobalValaxyProperty(property: string) {
|
|
17
|
+
const $valaxy = (window.parent.parent as any).$valaxy
|
|
18
|
+
return $valaxy[property]
|
|
19
|
+
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { join, resolve } from 'node:path'
|
|
2
2
|
import { defineConfig } from 'vite'
|
|
3
3
|
import Vue from '@vitejs/plugin-vue'
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import VueRouter from 'unplugin-vue-router/vite'
|
|
5
|
+
import VueComponents from 'unplugin-vue-components/vite'
|
|
6
6
|
import Unocss from 'unocss/vite'
|
|
7
|
+
import { unoConfig } from '../../../../uno.config'
|
|
7
8
|
|
|
8
9
|
export default defineConfig({
|
|
9
10
|
base: './',
|
|
@@ -48,22 +49,18 @@ export default defineConfig({
|
|
|
48
49
|
},
|
|
49
50
|
},
|
|
50
51
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
defineModel: true,
|
|
54
|
-
},
|
|
55
|
-
}),
|
|
56
|
-
|
|
57
|
-
Router({
|
|
58
|
-
routesFolder: ['pages'],
|
|
52
|
+
VueRouter({
|
|
53
|
+
routesFolder: join(__dirname, 'pages'),
|
|
59
54
|
dts: join(__dirname, 'typed-routes.d.ts'),
|
|
60
55
|
}),
|
|
61
|
-
|
|
62
|
-
|
|
56
|
+
Vue({
|
|
57
|
+
include: [/\.vue$/, /\.md$/],
|
|
58
|
+
}),
|
|
59
|
+
VueComponents({
|
|
63
60
|
dirs: ['components'],
|
|
64
61
|
dts: join(__dirname, 'components.d.ts'),
|
|
65
62
|
}),
|
|
66
|
-
Unocss(),
|
|
63
|
+
Unocss(unoConfig),
|
|
67
64
|
],
|
|
68
65
|
|
|
69
66
|
optimizeDeps: {
|
package/src/node/index.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type { ValaxyDevtoolsOptions } from './types'
|
|
|
6
6
|
|
|
7
7
|
const NAME = 'valaxy:devtools'
|
|
8
8
|
|
|
9
|
-
export default function ValaxyDevtools(options: ValaxyDevtoolsOptions): Plugin {
|
|
9
|
+
export default function ValaxyDevtools(options: ValaxyDevtoolsOptions = {}): Plugin {
|
|
10
10
|
let config: ResolvedConfig
|
|
11
11
|
|
|
12
12
|
function configureServer(server: ViteDevServer) {
|
package/uno.config.ts
DELETED