valaxy 0.15.10 → 0.15.11-alpha.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/valaxy.cjs +1 -1
- package/bin/valaxy.mjs +1 -1
- package/client/.vite-ssg-temp/tbbjcbuyn2/CNAME +1 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/PressAlgoliaSearch-2943719f.js +227 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/ValaxyMain-26e77dc6.js +752 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/_...all_-080f97f3.js +31 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/_...all_-5084a1b0.js +42 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/addon-f5fa83e1.js +172 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/best-pratice-0231a551.js +1105 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/client-496183a0.js +286 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/community-1b33ec3b.js +627 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/components-7000ddd3.js +2460 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/deploy-59948619.js +1071 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/docs-26abd7f8.js +490 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/extend-975f8f72.js +1851 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/extend-acd7107b.js +1444 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/faq-62ed7bfd.js +321 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/features-8acbd53d.js +2625 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/gallery-832227a9.js +244 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/gallery-9077df38.js +370 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/getting-started-52c30f03.js +3684 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/hexo-7311896e.js +969 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/hooks-67450cb3.js +517 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/i18n-4cd1bb86.js +4159 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/i18n-e1165bc4.js +676 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/index-002f83fb.js +768 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/index-3dec2b83.js +527 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/index-43565e48.js +424 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/index-5f07432e.js +563 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/index-6024f010.js +3294 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/index-6f0d6ec7.js +202 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/index-78c510e0.js +549 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/index-839c338e.js +4161 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/index-d39a48fd.js +1170 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/index-e633613c.js +1564 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/katex-32f21e80.js +6119 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/logo-bd69f816.js +180 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/markdown-050f3269.js +5895 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/news-ecba2d88.js +278 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/page-d48f3caa.js +752 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/post-ac89eaf5.js +1605 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/route-block-c0a8bdd8.js +4 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/schema-org-f60b7dac.js +477 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/site-6caa6511.js +286 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/style-f415f7fa.css +3742 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/styles-cdaadad2.js +548 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/templates-c97584f2.js +574 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/theme-192f77ef.js +172 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/use-3c036a47.js +669 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/use-851c0307.js +619 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/vite-vue-f91b9792.js +830 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/vscode-bc411e64.js +350 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/why-c98bbe8e.js +1131 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/write-6a43d4d0.js +4963 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/write-6bc2b77c.js +675 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/favicon.svg +33 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/main.mjs +6239 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/valaxy-logo.png +0 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/CNAME +1 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/PressAlgoliaSearch-2943719f.js +227 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/ValaxyMain-26e77dc6.js +752 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/_...all_-080f97f3.js +31 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/_...all_-5084a1b0.js +42 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/addon-f5fa83e1.js +172 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/best-pratice-0231a551.js +1105 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/client-496183a0.js +286 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/community-1b33ec3b.js +627 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/components-7000ddd3.js +2460 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/deploy-59948619.js +1071 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/docs-26abd7f8.js +490 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/extend-975f8f72.js +1851 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/extend-acd7107b.js +1444 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/faq-62ed7bfd.js +321 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/features-8acbd53d.js +2625 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/gallery-832227a9.js +244 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/gallery-9077df38.js +370 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/getting-started-bb7fc0a8.js +3684 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/hexo-7311896e.js +969 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/hooks-67450cb3.js +517 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/i18n-4cd1bb86.js +4159 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/i18n-e1165bc4.js +676 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/index-002f83fb.js +768 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/index-3dec2b83.js +527 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/index-43565e48.js +424 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/index-5f07432e.js +563 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/index-6024f010.js +3294 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/index-6f0d6ec7.js +202 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/index-78c510e0.js +549 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/index-839c338e.js +4161 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/index-d39a48fd.js +1170 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/index-e633613c.js +1564 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/katex-32f21e80.js +6119 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/logo-bd69f816.js +180 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/markdown-abdb17ca.js +5895 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/news-ecba2d88.js +278 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/page-d48f3caa.js +752 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/post-0ed0dfec.js +1605 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/route-block-c0a8bdd8.js +4 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/schema-org-f60b7dac.js +477 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/site-6caa6511.js +286 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/style-f415f7fa.css +3742 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/styles-cdaadad2.js +548 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/templates-c97584f2.js +574 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/theme-192f77ef.js +172 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/use-3c036a47.js +669 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/use-851c0307.js +619 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/vite-vue-f91b9792.js +830 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/vscode-bc411e64.js +350 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/why-c98bbe8e.js +1131 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/write-6a43d4d0.js +4963 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/write-6bc2b77c.js +675 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/favicon.svg +33 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/main.mjs +6239 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/valaxy-logo.png +0 -0
- package/client/App.vue +1 -1
- package/client/components/AppLink.vue +2 -2
- package/client/components/ValaxyMd.vue +1 -1
- package/client/components/ValaxyOverlay.vue +2 -2
- package/client/components/ValaxyPagination.vue +6 -6
- package/client/components/debug/ValaxyDevtools.vue +6 -0
- package/client/composables/dark.ts +39 -0
- package/client/layouts/404.vue +1 -1
- package/client/layouts/layout.vue +2 -2
- package/client/locales/zh-CN.yml +1 -1
- package/client/pages/[...all].vue +2 -0
- package/client/styles/common/transition.scss +1 -0
- package/client/styles/common/view-transition.css +21 -0
- package/dist/chunk-3EJGKTUH.mjs +130 -0
- package/dist/chunk-RDNVTVQ5.cjs +129 -0
- package/dist/{config-29a16f62.d.ts → config-e5704a2c.d.ts} +223 -1
- package/dist/node/cli/index.cjs +1 -0
- package/dist/node/cli/index.mjs +2 -0
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.d.cts +14 -2
- package/dist/node/index.d.ts +14 -2
- package/dist/node/index.mjs +1 -1
- package/dist/types/index.d.cts +3 -220
- package/dist/types/index.d.ts +3 -220
- package/dist/types/index.mjs +1 -1
- package/package.json +19 -18
- package/types/config.ts +6 -0
- package/LICENSE +0 -21
- package/dist/chunk-2EVEFEO4.mjs +0 -130
- package/dist/chunk-BYK2L2MY.cjs +0 -129
- package/dist/node/cli.cjs +0 -1
- package/dist/node/cli.mjs +0 -2
- /package/dist/node/{cli.d.cts → cli/index.d.cts} +0 -0
- /package/dist/node/{cli.d.ts → cli/index.d.ts} +0 -0
|
@@ -0,0 +1,752 @@
|
|
|
1
|
+
import { onMounted, computed, ref, onUpdated, onUnmounted, defineComponent, mergeProps, useSSRContext, unref, watchEffect, h, nextTick, withCtx, openBlock, createBlock, createTextVNode, toDisplayString, createVNode, createCommentVNode, renderSlot } from "vue";
|
|
2
|
+
import { ssrRenderAttrs, ssrInterpolate, ssrRenderComponent, ssrRenderClass, ssrRenderSlot, ssrRenderAttr } from "vue/server-renderer";
|
|
3
|
+
import { d as useSiteConfig, e as useThemeConfig, f as useData, u as useI18n, g as useOutline, h as __unplugin_components_0$2, _ as _export_sfc, i as useFrontmatter, j as useAppStore, o as onContentUpdated, r as runContentUpdated, k as useSidebar, l as useLayout, m as getLocaleTitle, s as scrollTo } from "../main.mjs";
|
|
4
|
+
import "dayjs";
|
|
5
|
+
import "dayjs/locale/zh-cn.js";
|
|
6
|
+
import "body-scroll-lock";
|
|
7
|
+
import { isClient, useScriptTag } from "@vueuse/core";
|
|
8
|
+
import mediumZoom from "medium-zoom";
|
|
9
|
+
import { useHead } from "@unhead/vue";
|
|
10
|
+
import LazyLoad from "vanilla-lazyload";
|
|
11
|
+
import { useRoute } from "vue-router";
|
|
12
|
+
function throttleAndDebounce(fn, delay) {
|
|
13
|
+
let timeout;
|
|
14
|
+
let called = false;
|
|
15
|
+
return () => {
|
|
16
|
+
if (timeout)
|
|
17
|
+
clearTimeout(timeout);
|
|
18
|
+
if (!called) {
|
|
19
|
+
fn();
|
|
20
|
+
called = true;
|
|
21
|
+
setTimeout(() => {
|
|
22
|
+
called = false;
|
|
23
|
+
}, delay);
|
|
24
|
+
} else {
|
|
25
|
+
timeout = setTimeout(fn, delay);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function wrap(el, className) {
|
|
30
|
+
const wrapper = document.createElement("div");
|
|
31
|
+
wrapper.className = className;
|
|
32
|
+
el.parentNode.insertBefore(wrapper, el);
|
|
33
|
+
el.parentNode.removeChild(el);
|
|
34
|
+
wrapper.appendChild(el);
|
|
35
|
+
}
|
|
36
|
+
function wrapTable(container = document) {
|
|
37
|
+
container.querySelectorAll("table").forEach((el) => {
|
|
38
|
+
const container2 = document.createElement("div");
|
|
39
|
+
container2.className = "table-container";
|
|
40
|
+
wrap(el, "table-container");
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function useCopyCode() {
|
|
44
|
+
if (isClient) {
|
|
45
|
+
const timeoutIdMap = /* @__PURE__ */ new WeakMap();
|
|
46
|
+
window.addEventListener("click", (e) => {
|
|
47
|
+
var _a;
|
|
48
|
+
const el = e.target;
|
|
49
|
+
if (el.matches('div[class*="language-"] > button.copy')) {
|
|
50
|
+
const parent = el.parentElement;
|
|
51
|
+
const sibling = (_a = el.nextElementSibling) == null ? void 0 : _a.nextElementSibling;
|
|
52
|
+
if (!parent || !sibling)
|
|
53
|
+
return;
|
|
54
|
+
const isShell = /language-(shellscript|shell|bash|sh|zsh)/.test(
|
|
55
|
+
parent.className
|
|
56
|
+
);
|
|
57
|
+
let text = "";
|
|
58
|
+
sibling.querySelectorAll("span.line:not(.diff.remove)").forEach((node) => text += `${node.textContent || ""}
|
|
59
|
+
`);
|
|
60
|
+
text = text.slice(0, -1);
|
|
61
|
+
if (isShell)
|
|
62
|
+
text = text.replace(/^ *(\$|>) /gm, "").trim();
|
|
63
|
+
copyToClipboard(text).then(() => {
|
|
64
|
+
el.classList.add("copied");
|
|
65
|
+
clearTimeout(timeoutIdMap.get(el));
|
|
66
|
+
const timeoutId = setTimeout(() => {
|
|
67
|
+
el.classList.remove("copied");
|
|
68
|
+
el.blur();
|
|
69
|
+
timeoutIdMap.delete(el);
|
|
70
|
+
}, 2e3);
|
|
71
|
+
timeoutIdMap.set(el, timeoutId);
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
async function copyToClipboard(text) {
|
|
78
|
+
try {
|
|
79
|
+
return navigator.clipboard.writeText(text);
|
|
80
|
+
} catch {
|
|
81
|
+
const element = document.createElement("textarea");
|
|
82
|
+
const previouslyFocusedElement = document.activeElement;
|
|
83
|
+
element.value = text;
|
|
84
|
+
element.setAttribute("readonly", "");
|
|
85
|
+
element.style.contain = "strict";
|
|
86
|
+
element.style.position = "absolute";
|
|
87
|
+
element.style.left = "-9999px";
|
|
88
|
+
element.style.fontSize = "12pt";
|
|
89
|
+
const selection = document.getSelection();
|
|
90
|
+
const originalRange = selection ? selection.rangeCount > 0 && selection.getRangeAt(0) : null;
|
|
91
|
+
document.body.appendChild(element);
|
|
92
|
+
element.select();
|
|
93
|
+
element.selectionStart = 0;
|
|
94
|
+
element.selectionEnd = text.length;
|
|
95
|
+
document.execCommand("copy");
|
|
96
|
+
document.body.removeChild(element);
|
|
97
|
+
if (originalRange) {
|
|
98
|
+
selection.removeAllRanges();
|
|
99
|
+
selection.addRange(originalRange);
|
|
100
|
+
}
|
|
101
|
+
if (previouslyFocusedElement) {
|
|
102
|
+
previouslyFocusedElement.focus();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
function useMediumZoom() {
|
|
107
|
+
const siteConfig = useSiteConfig();
|
|
108
|
+
const mediumZoomConfig = siteConfig.value.mediumZoom;
|
|
109
|
+
onMounted(() => {
|
|
110
|
+
if (mediumZoomConfig.enable) {
|
|
111
|
+
mediumZoom(
|
|
112
|
+
mediumZoomConfig.selector || ".markdown-body img",
|
|
113
|
+
{
|
|
114
|
+
background: "var(--medium-zoom-c-bg, rgba(0, 0, 0, 0.8))",
|
|
115
|
+
...mediumZoomConfig.options
|
|
116
|
+
}
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
function useAplayer() {
|
|
122
|
+
const siteConfig = useSiteConfig();
|
|
123
|
+
const cdnPrefix = computed(() => siteConfig.value.cdn.prefix);
|
|
124
|
+
useHead({
|
|
125
|
+
link: [
|
|
126
|
+
{
|
|
127
|
+
rel: "stylesheet",
|
|
128
|
+
href: `${cdnPrefix.value}aplayer/dist/APlayer.min.css`
|
|
129
|
+
}
|
|
130
|
+
]
|
|
131
|
+
});
|
|
132
|
+
useScriptTag(`${cdnPrefix.value}aplayer/dist/APlayer.min.js`, () => {
|
|
133
|
+
useScriptTag(`${cdnPrefix.value}meting@2/dist/Meting.min.js`);
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
function useCodePen() {
|
|
137
|
+
useHead({
|
|
138
|
+
script: [
|
|
139
|
+
{
|
|
140
|
+
src: "https://static.codepen.io/assets/embed/ei.js",
|
|
141
|
+
async: true
|
|
142
|
+
}
|
|
143
|
+
]
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
function useAside() {
|
|
147
|
+
const isAsideEnabled = ref(true);
|
|
148
|
+
return {
|
|
149
|
+
isAsideEnabled
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
const PAGE_OFFSET = 56;
|
|
153
|
+
const topOffset = 33;
|
|
154
|
+
function useActiveAnchor(container, marker) {
|
|
155
|
+
const { isAsideEnabled } = useAside();
|
|
156
|
+
const onScroll = throttleAndDebounce(setActiveLink, 100);
|
|
157
|
+
let prevActiveLink = null;
|
|
158
|
+
onMounted(() => {
|
|
159
|
+
requestAnimationFrame(setActiveLink);
|
|
160
|
+
window.addEventListener("scroll", onScroll);
|
|
161
|
+
});
|
|
162
|
+
onUpdated(() => {
|
|
163
|
+
activateLink(location.hash);
|
|
164
|
+
});
|
|
165
|
+
onUnmounted(() => {
|
|
166
|
+
window.removeEventListener("scroll", onScroll);
|
|
167
|
+
});
|
|
168
|
+
function setActiveLink() {
|
|
169
|
+
if (!isAsideEnabled.value)
|
|
170
|
+
return;
|
|
171
|
+
const links = [].slice.call(
|
|
172
|
+
container.value.querySelectorAll(".outline-link")
|
|
173
|
+
);
|
|
174
|
+
const anchors = [].slice.call(document.querySelectorAll(".content .header-anchor")).filter((anchor) => {
|
|
175
|
+
return links.some((link) => {
|
|
176
|
+
return link.hash === anchor.hash && anchor.offsetParent !== null;
|
|
177
|
+
});
|
|
178
|
+
});
|
|
179
|
+
const scrollY = window.scrollY;
|
|
180
|
+
const innerHeight = window.innerHeight;
|
|
181
|
+
const offsetHeight = container.value.offsetHeight;
|
|
182
|
+
const isBottom = Math.abs(scrollY + innerHeight - offsetHeight) < 1;
|
|
183
|
+
if (anchors.length && isBottom) {
|
|
184
|
+
activateLink(anchors[anchors.length - 1].hash);
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
for (let i = 0; i < anchors.length; i++) {
|
|
188
|
+
const anchor = anchors[i];
|
|
189
|
+
const nextAnchor = anchors[i + 1];
|
|
190
|
+
const [isActive, hash] = isAnchorActive(i, anchor, nextAnchor);
|
|
191
|
+
if (isActive) {
|
|
192
|
+
activateLink(hash);
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
const checkActiveLinkInViewport = () => {
|
|
198
|
+
const activeLink = prevActiveLink;
|
|
199
|
+
if (!activeLink) {
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
const top = activeLink.getBoundingClientRect().top;
|
|
203
|
+
const bottom = activeLink.getBoundingClientRect().bottom;
|
|
204
|
+
if (top < topOffset || bottom > window.innerHeight - topOffset)
|
|
205
|
+
activeLink.scrollIntoView();
|
|
206
|
+
};
|
|
207
|
+
function activateLink(hash) {
|
|
208
|
+
if (prevActiveLink)
|
|
209
|
+
prevActiveLink.classList.remove("active");
|
|
210
|
+
if (hash == null) {
|
|
211
|
+
prevActiveLink = null;
|
|
212
|
+
} else {
|
|
213
|
+
prevActiveLink = container.value.querySelector(
|
|
214
|
+
`a[href="${decodeURIComponent(hash)}"]`
|
|
215
|
+
);
|
|
216
|
+
}
|
|
217
|
+
const activeLink = prevActiveLink;
|
|
218
|
+
checkActiveLinkInViewport();
|
|
219
|
+
if (activeLink) {
|
|
220
|
+
activeLink.classList.add("active");
|
|
221
|
+
marker.value.style.top = `${activeLink.offsetTop + topOffset}px`;
|
|
222
|
+
marker.value.style.opacity = "1";
|
|
223
|
+
} else {
|
|
224
|
+
marker.value.style.top = `${topOffset}px`;
|
|
225
|
+
marker.value.style.opacity = "0";
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
function getAnchorTop(anchor) {
|
|
230
|
+
return anchor.parentElement.offsetTop - PAGE_OFFSET - 15;
|
|
231
|
+
}
|
|
232
|
+
function isAnchorActive(index, anchor, nextAnchor) {
|
|
233
|
+
const scrollTop = window.scrollY;
|
|
234
|
+
if (index === 0 && scrollTop === 0)
|
|
235
|
+
return [true, null];
|
|
236
|
+
if (scrollTop < getAnchorTop(anchor))
|
|
237
|
+
return [false, null];
|
|
238
|
+
if (!nextAnchor || scrollTop < getAnchorTop(nextAnchor))
|
|
239
|
+
return [true, anchor.hash];
|
|
240
|
+
return [false, null];
|
|
241
|
+
}
|
|
242
|
+
function getKeyMaterial(password) {
|
|
243
|
+
const enc = new TextEncoder();
|
|
244
|
+
return window.crypto.subtle.importKey(
|
|
245
|
+
"raw",
|
|
246
|
+
enc.encode(password),
|
|
247
|
+
"PBKDF2",
|
|
248
|
+
false,
|
|
249
|
+
["deriveBits", "deriveKey"]
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
function getKey(keyMaterial, salt) {
|
|
253
|
+
return window.crypto.subtle.deriveKey(
|
|
254
|
+
{
|
|
255
|
+
name: "PBKDF2",
|
|
256
|
+
salt,
|
|
257
|
+
iterations: 1e5,
|
|
258
|
+
hash: "SHA-256"
|
|
259
|
+
},
|
|
260
|
+
keyMaterial,
|
|
261
|
+
{
|
|
262
|
+
name: "AES-CBC",
|
|
263
|
+
length: 256
|
|
264
|
+
},
|
|
265
|
+
true,
|
|
266
|
+
["encrypt", "decrypt"]
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
function useDecrypt() {
|
|
270
|
+
const siteConfig = useSiteConfig();
|
|
271
|
+
const { encrypt } = siteConfig.value;
|
|
272
|
+
const iv = Uint8Array.from(Object.values(encrypt.iv));
|
|
273
|
+
const salt = Uint8Array.from(Object.values(encrypt.salt));
|
|
274
|
+
return {
|
|
275
|
+
decrypt: async (password, ciphertext) => {
|
|
276
|
+
if (!password)
|
|
277
|
+
return;
|
|
278
|
+
const keyMaterial = await getKeyMaterial(password);
|
|
279
|
+
const key = await getKey(keyMaterial, salt);
|
|
280
|
+
const ciphertextData = Uint8Array.from(ciphertext, (c) => c.charCodeAt(0));
|
|
281
|
+
const decrypted = await window.crypto.subtle.decrypt(
|
|
282
|
+
{
|
|
283
|
+
name: "AES-CBC",
|
|
284
|
+
iv
|
|
285
|
+
},
|
|
286
|
+
key,
|
|
287
|
+
ciphertextData
|
|
288
|
+
);
|
|
289
|
+
return new TextDecoder().decode(decrypted);
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
function useEditLink() {
|
|
294
|
+
const themeConfig = useThemeConfig();
|
|
295
|
+
return computed(() => {
|
|
296
|
+
const { text, pattern } = themeConfig.value.editLink || {};
|
|
297
|
+
const { relativePath } = useData();
|
|
298
|
+
const url = pattern.replace(/:path/g, relativePath);
|
|
299
|
+
return { url, text };
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
303
|
+
__name: "ValaxyOverlay",
|
|
304
|
+
__ssrInlineRender: true,
|
|
305
|
+
props: {
|
|
306
|
+
show: { type: Boolean, default: false }
|
|
307
|
+
},
|
|
308
|
+
setup(__props) {
|
|
309
|
+
return (_ctx, _push, _parent, _attrs) => {
|
|
310
|
+
if (_ctx.show) {
|
|
311
|
+
_push(`<div${ssrRenderAttrs(mergeProps({ class: "va-overlay" }, _attrs))}></div>`);
|
|
312
|
+
} else {
|
|
313
|
+
_push(`<!---->`);
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
});
|
|
318
|
+
const ValaxyOverlay_vue_vue_type_style_index_0_lang = "";
|
|
319
|
+
const _sfc_setup$7 = _sfc_main$7.setup;
|
|
320
|
+
_sfc_main$7.setup = (props, ctx) => {
|
|
321
|
+
const ssrContext = useSSRContext();
|
|
322
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/ValaxyOverlay.vue");
|
|
323
|
+
return _sfc_setup$7 ? _sfc_setup$7(props, ctx) : void 0;
|
|
324
|
+
};
|
|
325
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
326
|
+
__name: "PressOutline",
|
|
327
|
+
__ssrInlineRender: true,
|
|
328
|
+
setup(__props) {
|
|
329
|
+
const { t } = useI18n();
|
|
330
|
+
const container = ref();
|
|
331
|
+
const marker = ref();
|
|
332
|
+
useActiveAnchor(container, marker);
|
|
333
|
+
const { headers, handleClick } = useOutline();
|
|
334
|
+
return (_ctx, _push, _parent, _attrs) => {
|
|
335
|
+
const _component_PressOutlineItem = __unplugin_components_0$2;
|
|
336
|
+
_push(`<div${ssrRenderAttrs(mergeProps({
|
|
337
|
+
style: unref(headers).length ? null : { display: "none" },
|
|
338
|
+
ref_key: "container",
|
|
339
|
+
ref: container
|
|
340
|
+
}, _attrs))} data-v-eb4ac0ae><div class="content" data-v-eb4ac0ae><div class="outline-title" data-v-eb4ac0ae>${ssrInterpolate(unref(t)("theme.outlineTitle"))}</div><div class="outline-marker" data-v-eb4ac0ae></div><nav aria-labelledby="doc-outline-aria-label" data-v-eb4ac0ae><span id="doc-outline-aria-label" class="visually-hidden" data-v-eb4ac0ae> Table of Contents for current page </span>`);
|
|
341
|
+
_push(ssrRenderComponent(_component_PressOutlineItem, {
|
|
342
|
+
class: "va-toc relative z-1 css-i18n-toc",
|
|
343
|
+
headers: unref(headers),
|
|
344
|
+
"on-click": unref(handleClick),
|
|
345
|
+
root: ""
|
|
346
|
+
}, null, _parent));
|
|
347
|
+
_push(`</nav></div></div>`);
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
});
|
|
351
|
+
const PressOutline_vue_vue_type_style_index_0_scoped_eb4ac0ae_lang = "";
|
|
352
|
+
const _sfc_setup$6 = _sfc_main$6.setup;
|
|
353
|
+
_sfc_main$6.setup = (props, ctx) => {
|
|
354
|
+
const ssrContext = useSSRContext();
|
|
355
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../../valaxy-theme-press/components/PressOutline.vue");
|
|
356
|
+
return _sfc_setup$6 ? _sfc_setup$6(props, ctx) : void 0;
|
|
357
|
+
};
|
|
358
|
+
const PressOutline = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-eb4ac0ae"]]);
|
|
359
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
360
|
+
__name: "PressAside",
|
|
361
|
+
__ssrInlineRender: true,
|
|
362
|
+
setup(__props) {
|
|
363
|
+
const frontmatter = useFrontmatter();
|
|
364
|
+
const app = useAppStore();
|
|
365
|
+
return (_ctx, _push, _parent, _attrs) => {
|
|
366
|
+
const _component_ValaxyOverlay = _sfc_main$7;
|
|
367
|
+
_push(`<!--[--><button class="toc-btn shadow-lg fixed press-icon-btn z-99 lt-md:hidden! xl:hidden!" right="5" bottom="24"><div i-ri-file-list-line></div></button>`);
|
|
368
|
+
_push(ssrRenderComponent(_component_ValaxyOverlay, {
|
|
369
|
+
show: unref(app).isRightSidebarOpen,
|
|
370
|
+
onClick: ($event) => unref(app).toggleRightSidebar()
|
|
371
|
+
}, null, _parent));
|
|
372
|
+
_push(`<aside flex="~ col grow" p="l-0 xl:l-8" text="center" z="$" class="${ssrRenderClass([unref(app).isRightSidebarOpen && "open", "press-aside lt-xl:fixed shadow xl:shadow-none xl:hover:shadow-none hover:shadow-lg"])}" bg="$va-c-bg"><div class="aside-curtain"></div><div class="aside-container lt-xl:fixed" flex="~ col"><div class="aside-content overflow-auto" flex="~ col">`);
|
|
373
|
+
if (unref(frontmatter).toc !== false) {
|
|
374
|
+
_push(ssrRenderComponent(PressOutline, null, null, _parent));
|
|
375
|
+
} else {
|
|
376
|
+
_push(`<!---->`);
|
|
377
|
+
}
|
|
378
|
+
_push(`<div class="flex-grow"></div>`);
|
|
379
|
+
if (_ctx.$slots.default) {
|
|
380
|
+
_push(`<div class="custom-container">`);
|
|
381
|
+
ssrRenderSlot(_ctx.$slots, "default", {}, null, _push, _parent);
|
|
382
|
+
_push(`</div>`);
|
|
383
|
+
} else {
|
|
384
|
+
_push(`<!---->`);
|
|
385
|
+
}
|
|
386
|
+
_push(`</div></div></aside><!--]-->`);
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
});
|
|
390
|
+
const PressAside_vue_vue_type_style_index_0_lang = "";
|
|
391
|
+
const _sfc_setup$5 = _sfc_main$5.setup;
|
|
392
|
+
_sfc_main$5.setup = (props, ctx) => {
|
|
393
|
+
const ssrContext = useSSRContext();
|
|
394
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../../valaxy-theme-press/components/PressAside.vue");
|
|
395
|
+
return _sfc_setup$5 ? _sfc_setup$5(props, ctx) : void 0;
|
|
396
|
+
};
|
|
397
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
398
|
+
__name: "PressDocFooterLastUpdated",
|
|
399
|
+
__ssrInlineRender: true,
|
|
400
|
+
setup(__props) {
|
|
401
|
+
const data = useData();
|
|
402
|
+
const date = computed(() => new Date(data.lastUpdated));
|
|
403
|
+
const isoDatetime = computed(() => date.value.toISOString());
|
|
404
|
+
const datetime = ref("");
|
|
405
|
+
onMounted(() => {
|
|
406
|
+
watchEffect(() => {
|
|
407
|
+
datetime.value = date.value.toLocaleString(window.navigator.language);
|
|
408
|
+
});
|
|
409
|
+
});
|
|
410
|
+
const { t } = useI18n();
|
|
411
|
+
return (_ctx, _push, _parent, _attrs) => {
|
|
412
|
+
_push(`<p${ssrRenderAttrs(mergeProps({ class: "press-lastUpdated text-right" }, _attrs))} data-v-199a2fc5>${ssrInterpolate(unref(t)("tooltip.last_updated"))}: <time${ssrRenderAttr("datetime", isoDatetime.value)} data-v-199a2fc5>${ssrInterpolate(datetime.value)}</time></p>`);
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
});
|
|
416
|
+
const PressDocFooterLastUpdated_vue_vue_type_style_index_0_scoped_199a2fc5_lang = "";
|
|
417
|
+
const _sfc_setup$4 = _sfc_main$4.setup;
|
|
418
|
+
_sfc_main$4.setup = (props, ctx) => {
|
|
419
|
+
const ssrContext = useSSRContext();
|
|
420
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../../valaxy-theme-press/components/PressDocFooterLastUpdated.vue");
|
|
421
|
+
return _sfc_setup$4 ? _sfc_setup$4(props, ctx) : void 0;
|
|
422
|
+
};
|
|
423
|
+
const __unplugin_components_0$1 = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-199a2fc5"]]);
|
|
424
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
425
|
+
__name: "PressDocFooter",
|
|
426
|
+
__ssrInlineRender: true,
|
|
427
|
+
setup(__props) {
|
|
428
|
+
const editLink = useEditLink();
|
|
429
|
+
const { t } = useI18n();
|
|
430
|
+
return (_ctx, _push, _parent, _attrs) => {
|
|
431
|
+
const _component_PressDocFooterLastUpdated = __unplugin_components_0$1;
|
|
432
|
+
_push(`<div${ssrRenderAttrs(mergeProps({
|
|
433
|
+
flex: "",
|
|
434
|
+
justify: "between",
|
|
435
|
+
text: "sm"
|
|
436
|
+
}, _attrs))}><a flex items="center" class="decoration-none!"${ssrRenderAttr("href", unref(editLink).url)} target="_blank"><div i-ri-external-link-line></div><span ml-1>${ssrInterpolate(unref(editLink).text || unref(t)("tooltip.edit_this_page"))}</span></a>`);
|
|
437
|
+
_push(ssrRenderComponent(_component_PressDocFooterLastUpdated, null, null, _parent));
|
|
438
|
+
_push(`</div>`);
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
});
|
|
442
|
+
const _sfc_setup$3 = _sfc_main$3.setup;
|
|
443
|
+
_sfc_main$3.setup = (props, ctx) => {
|
|
444
|
+
const ssrContext = useSSRContext();
|
|
445
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../../valaxy-theme-press/components/PressDocFooter.vue");
|
|
446
|
+
return _sfc_setup$3 ? _sfc_setup$3(props, ctx) : void 0;
|
|
447
|
+
};
|
|
448
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
449
|
+
__name: "ValaxyDecrypt",
|
|
450
|
+
__ssrInlineRender: true,
|
|
451
|
+
props: {
|
|
452
|
+
encryptedContent: {}
|
|
453
|
+
},
|
|
454
|
+
setup(__props) {
|
|
455
|
+
const password = ref("");
|
|
456
|
+
const decryptedContent = ref("");
|
|
457
|
+
const hasError = ref(false);
|
|
458
|
+
useDecrypt();
|
|
459
|
+
const ValaxyDeprecatedContent = defineComponent({
|
|
460
|
+
name: "ValaxyDeprecatedContent",
|
|
461
|
+
props: {
|
|
462
|
+
html: String
|
|
463
|
+
},
|
|
464
|
+
render() {
|
|
465
|
+
const content = `<div>${this.html}</div>`;
|
|
466
|
+
return h({
|
|
467
|
+
setup: () => {
|
|
468
|
+
const fm = useFrontmatter();
|
|
469
|
+
return {
|
|
470
|
+
frontmatter: fm
|
|
471
|
+
};
|
|
472
|
+
},
|
|
473
|
+
template: content
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
});
|
|
477
|
+
const hasWarning = ref(false);
|
|
478
|
+
onMounted(() => {
|
|
479
|
+
if (location.protocol !== "https:")
|
|
480
|
+
hasWarning.value = true;
|
|
481
|
+
});
|
|
482
|
+
return (_ctx, _push, _parent, _attrs) => {
|
|
483
|
+
_push(`<div${ssrRenderAttrs(_attrs)}>`);
|
|
484
|
+
if (!decryptedContent.value) {
|
|
485
|
+
_push(`<div w-full pt-14 pb-10><div class="decrypt-password-container w-full sm:w-1/2" flex-center m-auto relative><input${ssrRenderAttr("value", password.value)} w-full border pl-5 pr-11 py-3 rounded hover:shadow transition type="password" placeholder="Enter password" class="${ssrRenderClass(hasError.value && "border-red")}"><div cursor-pointer absolute text-2xl i-ri-arrow-right-circle-line right-3 text-gray hover:text-black></div>`);
|
|
486
|
+
if (hasWarning.value) {
|
|
487
|
+
_push(`<div class="-bottom-6" absolute text-xs op="50"><a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API" target="_blank"><span>Web Crypto API</span></a> Only works in HTTPS </div>`);
|
|
488
|
+
} else {
|
|
489
|
+
_push(`<!---->`);
|
|
490
|
+
}
|
|
491
|
+
_push(`</div></div>`);
|
|
492
|
+
} else {
|
|
493
|
+
_push(`<div>`);
|
|
494
|
+
_push(ssrRenderComponent(unref(ValaxyDeprecatedContent), { html: decryptedContent.value }, null, _parent));
|
|
495
|
+
_push(`<div w-full text-center mt-8><button m-auto class="btn" font-bold> Encrypt Again </button></div></div>`);
|
|
496
|
+
}
|
|
497
|
+
_push(`</div>`);
|
|
498
|
+
};
|
|
499
|
+
}
|
|
500
|
+
});
|
|
501
|
+
const _sfc_setup$2 = _sfc_main$2.setup;
|
|
502
|
+
_sfc_main$2.setup = (props, ctx) => {
|
|
503
|
+
const ssrContext = useSSRContext();
|
|
504
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/ValaxyDecrypt.vue");
|
|
505
|
+
return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
|
|
506
|
+
};
|
|
507
|
+
function createLazyLoadInstance(options = {}) {
|
|
508
|
+
return new LazyLoad({
|
|
509
|
+
elements_selector: ".lazy",
|
|
510
|
+
...options
|
|
511
|
+
});
|
|
512
|
+
}
|
|
513
|
+
function useVanillaLazyLoad() {
|
|
514
|
+
const siteConfig = useSiteConfig();
|
|
515
|
+
if (!siteConfig.value.vanillaLazyload.enable)
|
|
516
|
+
return;
|
|
517
|
+
onMounted(() => {
|
|
518
|
+
createLazyLoadInstance(siteConfig.value.vanillaLazyload);
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
function useCodeGroups() {
|
|
522
|
+
if (isClient) {
|
|
523
|
+
window.addEventListener("click", (e) => {
|
|
524
|
+
var _a;
|
|
525
|
+
const el = e.target;
|
|
526
|
+
if (el.matches(".vp-code-group input")) {
|
|
527
|
+
const group = (_a = el.parentElement) == null ? void 0 : _a.parentElement;
|
|
528
|
+
if (!group)
|
|
529
|
+
return;
|
|
530
|
+
const i = Array.from(group.querySelectorAll("input")).indexOf(el);
|
|
531
|
+
if (i < 0)
|
|
532
|
+
return;
|
|
533
|
+
const blocks = group.querySelector(".blocks");
|
|
534
|
+
if (!blocks)
|
|
535
|
+
return;
|
|
536
|
+
const current = Array.from(blocks.children).find(
|
|
537
|
+
(child) => child.classList.contains("active")
|
|
538
|
+
);
|
|
539
|
+
if (!current)
|
|
540
|
+
return;
|
|
541
|
+
const next = blocks.children[i];
|
|
542
|
+
if (!next || current === next)
|
|
543
|
+
return;
|
|
544
|
+
current.classList.remove("active");
|
|
545
|
+
next.classList.add("active");
|
|
546
|
+
const label = group == null ? void 0 : group.querySelector(`label[for="${el.id}"]`);
|
|
547
|
+
label == null ? void 0 : label.scrollIntoView({ block: "nearest" });
|
|
548
|
+
}
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
553
|
+
__name: "ValaxyMd",
|
|
554
|
+
__ssrInlineRender: true,
|
|
555
|
+
props: {
|
|
556
|
+
frontmatter: {},
|
|
557
|
+
excerpt: {}
|
|
558
|
+
},
|
|
559
|
+
setup(__props) {
|
|
560
|
+
const props = __props;
|
|
561
|
+
const { t } = useI18n();
|
|
562
|
+
const contentRef = ref();
|
|
563
|
+
onContentUpdated(() => {
|
|
564
|
+
wrapTable(contentRef.value);
|
|
565
|
+
});
|
|
566
|
+
onMounted(() => {
|
|
567
|
+
runContentUpdated();
|
|
568
|
+
});
|
|
569
|
+
onUpdated(() => {
|
|
570
|
+
runContentUpdated();
|
|
571
|
+
});
|
|
572
|
+
if (props.frontmatter.aplayer)
|
|
573
|
+
useAplayer();
|
|
574
|
+
if (props.frontmatter.codepen)
|
|
575
|
+
useCodePen();
|
|
576
|
+
useCopyCode();
|
|
577
|
+
useCodeGroups();
|
|
578
|
+
if (typeof props.frontmatter.medium_zoom === "undefined" || props.frontmatter.medium_zoom)
|
|
579
|
+
useMediumZoom();
|
|
580
|
+
useVanillaLazyLoad();
|
|
581
|
+
return (_ctx, _push, _parent, _attrs) => {
|
|
582
|
+
const _component_ValaxyDecrypt = _sfc_main$2;
|
|
583
|
+
if (_ctx.$slots.default) {
|
|
584
|
+
_push(`<article${ssrRenderAttrs(mergeProps({
|
|
585
|
+
class: _ctx.frontmatter.markdown !== false && "markdown-body"
|
|
586
|
+
}, _attrs))}>`);
|
|
587
|
+
if (_ctx.frontmatter.encryptedContent) {
|
|
588
|
+
_push(ssrRenderComponent(_component_ValaxyDecrypt, {
|
|
589
|
+
"encrypted-content": _ctx.frontmatter.encryptedContent
|
|
590
|
+
}, null, _parent));
|
|
591
|
+
} else {
|
|
592
|
+
ssrRenderSlot(_ctx.$slots, "default", {
|
|
593
|
+
ref_key: "contentRef",
|
|
594
|
+
ref: contentRef,
|
|
595
|
+
onVnodeUpdated: unref(runContentUpdated)
|
|
596
|
+
}, null, _push, _parent);
|
|
597
|
+
}
|
|
598
|
+
if (_ctx.frontmatter.url) {
|
|
599
|
+
_push(`<div text="center"><a${ssrRenderAttr("href", _ctx.frontmatter.url)} class="post-link-btn shadow hover:shadow-md" rounded target="_blank" m="b-4">${ssrInterpolate(unref(t)("post.view_link"))}</a></div>`);
|
|
600
|
+
} else {
|
|
601
|
+
_push(`<!---->`);
|
|
602
|
+
}
|
|
603
|
+
if (_ctx.frontmatter.end !== void 0) {
|
|
604
|
+
ssrRenderSlot(_ctx.$slots, "end", {}, () => {
|
|
605
|
+
_push(`<div m="y-4" class="end flex justify-center items-center"><hr class="line inline-flex" w="full" m="!y-2"><span p="x-4" font="bold" class="whitespace-nowrap">${ssrInterpolate(_ctx.frontmatter.end ? "Q.E.D." : "To Be Continued.")}</span><hr class="line inline-flex" w="full" m="!y-2"></div>`);
|
|
606
|
+
}, _push, _parent);
|
|
607
|
+
} else {
|
|
608
|
+
_push(`<!---->`);
|
|
609
|
+
}
|
|
610
|
+
_push(`</article>`);
|
|
611
|
+
} else {
|
|
612
|
+
_push(`<!---->`);
|
|
613
|
+
}
|
|
614
|
+
};
|
|
615
|
+
}
|
|
616
|
+
});
|
|
617
|
+
const ValaxyMd_vue_vue_type_style_index_0_lang = "";
|
|
618
|
+
const _sfc_setup$1 = _sfc_main$1.setup;
|
|
619
|
+
_sfc_main$1.setup = (props, ctx) => {
|
|
620
|
+
const ssrContext = useSSRContext();
|
|
621
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/ValaxyMd.vue");
|
|
622
|
+
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
|
|
623
|
+
};
|
|
624
|
+
const targetPadding = 0;
|
|
625
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
626
|
+
__name: "ValaxyMain",
|
|
627
|
+
__ssrInlineRender: true,
|
|
628
|
+
props: {
|
|
629
|
+
frontmatter: {},
|
|
630
|
+
data: {}
|
|
631
|
+
},
|
|
632
|
+
setup(__props) {
|
|
633
|
+
const siteConfig = useSiteConfig();
|
|
634
|
+
const frontmatter = useFrontmatter();
|
|
635
|
+
const { hasSidebar } = useSidebar();
|
|
636
|
+
const isHome = useLayout("home");
|
|
637
|
+
const layout = useLayout();
|
|
638
|
+
const { locale } = useI18n();
|
|
639
|
+
const localeTitle = computed(() => getLocaleTitle(locale.value, frontmatter.value));
|
|
640
|
+
const route = useRoute();
|
|
641
|
+
nextTick(() => {
|
|
642
|
+
if (route.hash) {
|
|
643
|
+
setTimeout(() => {
|
|
644
|
+
scrollTo(document.body, route.hash, {
|
|
645
|
+
smooth: true,
|
|
646
|
+
targetPadding
|
|
647
|
+
});
|
|
648
|
+
}, 0);
|
|
649
|
+
}
|
|
650
|
+
});
|
|
651
|
+
return (_ctx, _push, _parent, _attrs) => {
|
|
652
|
+
const _component_ValaxyMd = _sfc_main$1;
|
|
653
|
+
const _component_PressDocFooter = _sfc_main$3;
|
|
654
|
+
const _component_PressAside = _sfc_main$5;
|
|
655
|
+
_push(`<main${ssrRenderAttrs(mergeProps({
|
|
656
|
+
class: ["press-main flex", {
|
|
657
|
+
"has-sidebar": unref(hasSidebar) && unref(layout) !== "post"
|
|
658
|
+
}]
|
|
659
|
+
}, _attrs))} data-v-78f2f1db><div w="full" flex="~" class="${ssrRenderClass([{
|
|
660
|
+
"px-6 md:pl-12": unref(hasSidebar),
|
|
661
|
+
"has-aside": !unref(isHome)
|
|
662
|
+
}, "relative"])}" p="t-4" data-v-78f2f1db><div class="container" flex="~ grow" justify="between" data-v-78f2f1db>`);
|
|
663
|
+
ssrRenderSlot(_ctx.$slots, "main", {}, () => {
|
|
664
|
+
_push(`<div w="full" class="${ssrRenderClass([{ "m-auto": !unref(hasSidebar) }, "vp-doc content"])}" flex="~ col grow" p="lt-md:0" data-v-78f2f1db>`);
|
|
665
|
+
ssrRenderSlot(_ctx.$slots, "main-header", {}, null, _push, _parent);
|
|
666
|
+
ssrRenderSlot(_ctx.$slots, "main-header-after", {}, null, _push, _parent);
|
|
667
|
+
ssrRenderSlot(_ctx.$slots, "main-content", {}, () => {
|
|
668
|
+
_push(`<template>`);
|
|
669
|
+
_push(ssrRenderComponent(_component_ValaxyMd, {
|
|
670
|
+
class: "prose mx-auto w-full max-w-4xl",
|
|
671
|
+
frontmatter: unref(frontmatter)
|
|
672
|
+
}, {
|
|
673
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
674
|
+
if (_push2) {
|
|
675
|
+
if (unref(hasSidebar) && !unref(isHome) && unref(frontmatter).title) {
|
|
676
|
+
_push2(`<h1${ssrRenderAttr("id", unref(frontmatter).title)} tabindex="-1" data-v-78f2f1db${_scopeId}>${ssrInterpolate(localeTitle.value)} <a class="header-anchor"${ssrRenderAttr("href", `#${unref(frontmatter).title}`)} aria-hidden="true" data-v-78f2f1db${_scopeId}></a></h1>`);
|
|
677
|
+
} else {
|
|
678
|
+
_push2(`<!---->`);
|
|
679
|
+
}
|
|
680
|
+
ssrRenderSlot(_ctx.$slots, "main-content-md", {}, null, _push2, _parent2, _scopeId);
|
|
681
|
+
ssrRenderSlot(_ctx.$slots, "default", {}, null, _push2, _parent2, _scopeId);
|
|
682
|
+
} else {
|
|
683
|
+
return [
|
|
684
|
+
unref(hasSidebar) && !unref(isHome) && unref(frontmatter).title ? (openBlock(), createBlock("h1", {
|
|
685
|
+
key: 0,
|
|
686
|
+
id: unref(frontmatter).title,
|
|
687
|
+
tabindex: "-1"
|
|
688
|
+
}, [
|
|
689
|
+
createTextVNode(
|
|
690
|
+
toDisplayString(localeTitle.value) + " ",
|
|
691
|
+
1
|
|
692
|
+
/* TEXT */
|
|
693
|
+
),
|
|
694
|
+
createVNode("a", {
|
|
695
|
+
class: "header-anchor",
|
|
696
|
+
href: `#${unref(frontmatter).title}`,
|
|
697
|
+
"aria-hidden": "true"
|
|
698
|
+
}, null, 8, ["href"])
|
|
699
|
+
], 8, ["id"])) : createCommentVNode("v-if", true),
|
|
700
|
+
renderSlot(_ctx.$slots, "main-content-md", {}, void 0, true),
|
|
701
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
702
|
+
];
|
|
703
|
+
}
|
|
704
|
+
}),
|
|
705
|
+
_: 3
|
|
706
|
+
/* FORWARDED */
|
|
707
|
+
}, _parent));
|
|
708
|
+
_push(`</template>`);
|
|
709
|
+
if (!unref(isHome)) {
|
|
710
|
+
_push(ssrRenderComponent(_component_PressDocFooter, {
|
|
711
|
+
class: "pb-8 max-w-4xl",
|
|
712
|
+
w: "full",
|
|
713
|
+
m: "auto"
|
|
714
|
+
}, null, _parent));
|
|
715
|
+
} else {
|
|
716
|
+
_push(`<!---->`);
|
|
717
|
+
}
|
|
718
|
+
ssrRenderSlot(_ctx.$slots, "main-content-after", {}, null, _push, _parent);
|
|
719
|
+
}, _push, _parent);
|
|
720
|
+
_push(`</div>`);
|
|
721
|
+
ssrRenderSlot(_ctx.$slots, "main-nav-before", {}, null, _push, _parent);
|
|
722
|
+
ssrRenderSlot(_ctx.$slots, "main-nav", {}, null, _push, _parent);
|
|
723
|
+
ssrRenderSlot(_ctx.$slots, "main-nav-after", {}, null, _push, _parent);
|
|
724
|
+
if (unref(siteConfig).comment.enable && unref(frontmatter).comment !== false) {
|
|
725
|
+
ssrRenderSlot(_ctx.$slots, "comment", {}, null, _push, _parent);
|
|
726
|
+
} else {
|
|
727
|
+
_push(`<!---->`);
|
|
728
|
+
}
|
|
729
|
+
ssrRenderSlot(_ctx.$slots, "footer", {}, null, _push, _parent);
|
|
730
|
+
}, _push, _parent);
|
|
731
|
+
ssrRenderSlot(_ctx.$slots, "aside", {}, () => {
|
|
732
|
+
if (!unref(isHome)) {
|
|
733
|
+
_push(ssrRenderComponent(_component_PressAside, null, null, _parent));
|
|
734
|
+
} else {
|
|
735
|
+
_push(`<!---->`);
|
|
736
|
+
}
|
|
737
|
+
}, _push, _parent);
|
|
738
|
+
_push(`</div></div></main>`);
|
|
739
|
+
};
|
|
740
|
+
}
|
|
741
|
+
});
|
|
742
|
+
const ValaxyMain_vue_vue_type_style_index_0_scoped_78f2f1db_lang = "";
|
|
743
|
+
const _sfc_setup = _sfc_main.setup;
|
|
744
|
+
_sfc_main.setup = (props, ctx) => {
|
|
745
|
+
const ssrContext = useSSRContext();
|
|
746
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../../valaxy-theme-press/components/ValaxyMain.vue");
|
|
747
|
+
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
|
748
|
+
};
|
|
749
|
+
const __unplugin_components_0 = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-78f2f1db"]]);
|
|
750
|
+
export {
|
|
751
|
+
__unplugin_components_0 as _
|
|
752
|
+
};
|