style: lint fix
This commit is contained in:
parent
003ef01a57
commit
e86b8d81df
@ -1,3 +1,4 @@
|
||||
import type { File, ResolvedData } from './types.js'
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
import process from 'node:process'
|
||||
@ -6,7 +7,6 @@ import { DeployType, Mode } from './constants.js'
|
||||
import { createPackageJson } from './packageJson.js'
|
||||
import { createRender } from './render.js'
|
||||
import { getTemplate, readFiles, readJsonFile, writeFiles } from './utils/index.js'
|
||||
import type { File, ResolvedData } from './types.js'
|
||||
|
||||
export async function generate(mode: Mode, data: ResolvedData): Promise<void> {
|
||||
const cwd = process.cwd()
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import type { Langs, Locale } from '../types.js'
|
||||
import { en } from './en.js'
|
||||
import { zh } from './zh.js'
|
||||
import type { Langs, Locale } from '../types.js'
|
||||
|
||||
export const locales: Record<Langs, Locale> = {
|
||||
'zh-CN': zh,
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import type { File, ResolvedData } from './types.js'
|
||||
import { kebabCase } from '@pengzhanbo/utils'
|
||||
import { execaCommand } from 'execa'
|
||||
import { Mode } from './constants.js'
|
||||
import { getDependenciesVersion, readJsonFile, resolve } from './utils/index.js'
|
||||
import type { File, ResolvedData } from './types.js'
|
||||
|
||||
export async function createPackageJson(
|
||||
mode: Mode,
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import type { Bundler, Langs, Options, PromptResult } from './types.js'
|
||||
import { createRequire } from 'node:module'
|
||||
import process from 'node:process'
|
||||
import { cancel, confirm, group, select, text } from '@clack/prompts'
|
||||
import { bundlerOptions, deployOptions, DeployType, languageOptions, Mode } from './constants.js'
|
||||
import { setLang, t } from './translate.js'
|
||||
import type { Bundler, Langs, Options, PromptResult } from './types.js'
|
||||
|
||||
const require = createRequire(process.cwd())
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import type { ResolvedData } from './types.js'
|
||||
import { kebabCase } from '@pengzhanbo/utils'
|
||||
import handlebars from 'handlebars'
|
||||
import type { ResolvedData } from './types.js'
|
||||
|
||||
export interface RenderData extends ResolvedData {
|
||||
name: string
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import type { PromptResult, ResolvedData } from './types.js'
|
||||
import path from 'node:path'
|
||||
import process from 'node:process'
|
||||
import { intro, outro, spinner } from '@clack/prompts'
|
||||
@ -8,7 +9,6 @@ import { generate } from './generate.js'
|
||||
import { prompt } from './prompt.js'
|
||||
import { t } from './translate.js'
|
||||
import { getPackageManager } from './utils/index.js'
|
||||
import type { PromptResult, ResolvedData } from './types.js'
|
||||
|
||||
export async function run(mode: Mode, root?: string) {
|
||||
intro(colors.cyan('Welcome to VuePress and vuepress-theme-plume !'))
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { locales } from './locales/index.js'
|
||||
import type { Langs, Locale } from './types.js'
|
||||
import { locales } from './locales/index.js'
|
||||
|
||||
function createTranslate(lang?: Langs) {
|
||||
let current: Langs = lang || 'en-US'
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import type { File } from '../types.js'
|
||||
import fs from 'node:fs/promises'
|
||||
import path from 'node:path'
|
||||
import type { File } from '../types.js'
|
||||
|
||||
export async function readFiles(root: string): Promise<File[]> {
|
||||
const filepaths = await fs.readdir(root, { recursive: true })
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import process from 'node:process'
|
||||
import type { PackageManager } from '../types.js'
|
||||
import process from 'node:process'
|
||||
|
||||
export function getPackageManager(): PackageManager {
|
||||
const name = process.env?.npm_config_user_agent || 'npm'
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import type { Theme } from 'vuepress'
|
||||
import process from 'node:process'
|
||||
import { plumeTheme } from 'vuepress-theme-plume'
|
||||
import type { Theme } from 'vuepress'
|
||||
|
||||
export const theme: Theme = plumeTheme({
|
||||
hostname: process.env.SITE_HOST || 'https://plume.pengzhanbo.cn',
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, watch } from 'vue'
|
||||
import type { PlumeThemeHomeHeroTintPlate } from 'vuepress-theme-plume/client'
|
||||
import { computed, watch } from 'vue'
|
||||
import InputRange from './InputRange.vue'
|
||||
|
||||
const min = 20
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import type { PlumeThemeHomeHeroTintPlate } from 'vuepress-theme-plume/client'
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import VPHomeHero from 'vuepress-theme-plume/components/Home/VPHomeHero.vue'
|
||||
import { useDarkMode } from 'vuepress-theme-plume/composables'
|
||||
import type { PlumeThemeHomeHeroTintPlate } from 'vuepress-theme-plume/client'
|
||||
import CodeViewer from './CodeViewer.vue'
|
||||
import CustomTintPlate from './CustomTintPlate.vue'
|
||||
import DemoWrapper from './DemoWrapper.vue'
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { defineClientConfig } from 'vuepress/client'
|
||||
import type { ClientConfig } from 'vuepress/client'
|
||||
import { defineClientConfig } from 'vuepress/client'
|
||||
import { Content } from './components/Content.js'
|
||||
|
||||
export default defineClientConfig({
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { getDirname, path } from 'vuepress/utils'
|
||||
import type { Plugin } from 'vuepress/core'
|
||||
import { getDirname, path } from 'vuepress/utils'
|
||||
|
||||
const __dirname = getDirname(import.meta.url)
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { getDirname, path } from 'vuepress/utils'
|
||||
import type { Plugin } from 'vuepress/core'
|
||||
import { getDirname, path } from 'vuepress/utils'
|
||||
|
||||
export function fontsPlugin(): Plugin {
|
||||
return {
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import type { HighlighterCore } from 'shiki/core'
|
||||
import editorData from '@internal/md-power/replEditorData'
|
||||
import { getHighlighterCore } from 'shiki/core'
|
||||
import { onMounted, onUnmounted, ref, shallowRef, watch } from 'vue'
|
||||
import type { HighlighterCore } from 'shiki/core'
|
||||
import { resolveCodeInfo } from '../composables/codeRepl.js'
|
||||
|
||||
let highlighter: HighlighterCore | null = null
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import type { CodeSandboxTokenMeta } from '../../shared/index.js'
|
||||
import { computed } from 'vue'
|
||||
|
||||
const props = defineProps<CodeSandboxTokenMeta>()
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import type { PDFTokenMeta } from '../../shared/index.js'
|
||||
import { onMounted, toRefs } from 'vue'
|
||||
import { usePDF } from '../composables/pdf.js'
|
||||
import { useSize } from '../composables/size.js'
|
||||
import type { PDFTokenMeta } from '../../shared/index.js'
|
||||
|
||||
const props = defineProps<PDFTokenMeta>()
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
import type { PlotOptions } from '../../shared/index.js'
|
||||
import { onClickOutside, useMediaQuery } from '@vueuse/core'
|
||||
import { computed, ref, shallowRef } from 'vue'
|
||||
import { usePageFrontmatter } from 'vuepress/client'
|
||||
import { pluginOptions } from '../options.js'
|
||||
import type { PlotOptions } from '../../shared/index.js'
|
||||
|
||||
const props = defineProps<Omit<PlotOptions, 'tag'>>()
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { ReplitTokenMeta } from '../../shared/index.js'
|
||||
import { computed, getCurrentInstance, ref } from 'vue'
|
||||
import Loading from './Loading.vue'
|
||||
import type { ReplitTokenMeta } from '../../shared/index.js'
|
||||
|
||||
const props = defineProps<ReplitTokenMeta>()
|
||||
|
||||
|
||||
@ -11,11 +11,11 @@
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import type { PDFEmbedType, PDFTokenMeta } from '../../shared/index.js'
|
||||
import { withBase } from 'vuepress/client'
|
||||
import { ensureEndingSlash, isLinkHttp } from 'vuepress/shared'
|
||||
import { pluginOptions } from '../options.js'
|
||||
import { checkIsiPad, checkIsMobile, checkIsSafari } from '../utils/is.js'
|
||||
import type { PDFEmbedType, PDFTokenMeta } from '../../shared/index.js'
|
||||
|
||||
function queryStringify(options: PDFTokenMeta): string {
|
||||
const { page, noToolbar, zoom } = options
|
||||
|
||||
@ -11,11 +11,11 @@
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import { useEventListener } from '@vueuse/core'
|
||||
import { computed, isRef, onMounted, ref, shallowRef, toValue, watch } from 'vue'
|
||||
import type { MaybeRef } from '@vueuse/core'
|
||||
import type { Ref, ShallowRef, ToRefs } from 'vue'
|
||||
import type { SizeOptions } from '../../shared/index.js'
|
||||
import { useEventListener } from '@vueuse/core'
|
||||
import { computed, isRef, onMounted, ref, shallowRef, toValue, watch } from 'vue'
|
||||
|
||||
export interface SizeInfo<T extends HTMLElement> {
|
||||
el: ShallowRef<T | undefined>
|
||||
|
||||
@ -2,13 +2,13 @@
|
||||
* @[caniuse embed{1,2,3,4}](feature_name)
|
||||
* @[caniuse image](feature_name)
|
||||
*/
|
||||
import container from 'markdown-it-container'
|
||||
import { customAlphabet } from 'nanoid'
|
||||
import type { PluginWithOptions } from 'markdown-it'
|
||||
import type MarkdownIt from 'markdown-it'
|
||||
import type Token from 'markdown-it/lib/token.mjs'
|
||||
import { createRuleBlock } from '../utils/createRuleBlock.js'
|
||||
import type { CanIUseMode, CanIUseOptions, CanIUseTokenMeta } from '../../shared/index.js'
|
||||
import container from 'markdown-it-container'
|
||||
import { customAlphabet } from 'nanoid'
|
||||
import { createRuleBlock } from '../utils/createRuleBlock.js'
|
||||
|
||||
const nanoid = customAlphabet('abcdefghijklmnopqrstuvwxyz', 5)
|
||||
const UNDERLINE_RE = /_+/g
|
||||
|
||||
@ -4,10 +4,10 @@
|
||||
* @[codesanbox title="xxx" layout="Editor+Preview" height="500px" navbar="false" console="false"](id#filepath)
|
||||
*/
|
||||
import type { PluginWithOptions } from 'markdown-it'
|
||||
import type { CodeSandboxTokenMeta } from '../../shared/index.js'
|
||||
import { createRuleBlock } from '../utils/createRuleBlock.js'
|
||||
import { parseRect } from '../utils/parseRect.js'
|
||||
import { resolveAttrs } from '../utils/resolveAttrs.js'
|
||||
import type { CodeSandboxTokenMeta } from '../../shared/index.js'
|
||||
|
||||
export const codeSandboxPlugin: PluginWithOptions<never> = (md) => {
|
||||
createRuleBlock<CodeSandboxTokenMeta>(md, {
|
||||
|
||||
@ -4,10 +4,10 @@
|
||||
* @[codepen preview editable title="" height="400px" tab="css,result" theme="dark"](user/slash)
|
||||
*/
|
||||
import type { PluginWithOptions } from 'markdown-it'
|
||||
import type { CodepenTokenMeta } from '../../shared/index.js'
|
||||
import { createRuleBlock } from '../utils/createRuleBlock.js'
|
||||
import { parseRect } from '../utils/parseRect.js'
|
||||
import { resolveAttrs } from '../utils/resolveAttrs.js'
|
||||
import type { CodepenTokenMeta } from '../../shared/index.js'
|
||||
|
||||
const CODEPEN_LINK = 'https://codepen.io/'
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import container from 'markdown-it-container'
|
||||
import type Token from 'markdown-it/lib/token.mjs'
|
||||
import type { Markdown } from 'vuepress/markdown'
|
||||
import container from 'markdown-it-container'
|
||||
import { getFileIcon } from './findIcon.js'
|
||||
import { resolveTreeNodeInfo, updateInlineToken } from './resolveTreeNodeInfo.js'
|
||||
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
import type { RenderRule } from 'markdown-it/lib/renderer.mjs'
|
||||
import type { App } from 'vuepress'
|
||||
import type { Markdown, MarkdownEnv } from 'vuepress/markdown'
|
||||
import { Buffer } from 'node:buffer'
|
||||
import http from 'node:https'
|
||||
import { URL } from 'node:url'
|
||||
import { isLinkExternal, isLinkHttp } from '@vuepress/helper'
|
||||
import imageSize from 'image-size'
|
||||
import { fs, path } from 'vuepress/utils'
|
||||
import type { RenderRule } from 'markdown-it/lib/renderer.mjs'
|
||||
import type { App } from 'vuepress'
|
||||
import type { Markdown, MarkdownEnv } from 'vuepress/markdown'
|
||||
import { resolveAttrs } from '../utils/resolveAttrs.js'
|
||||
|
||||
interface ImgSize {
|
||||
|
||||
@ -3,10 +3,10 @@
|
||||
* @[jsfiddle theme="dark" tab="js,css,html,result"](user/id)
|
||||
*/
|
||||
import type { PluginWithOptions } from 'markdown-it'
|
||||
import type { JSFiddleTokenMeta } from '../../shared/index.js'
|
||||
import { createRuleBlock } from '../utils/createRuleBlock.js'
|
||||
import { parseRect } from '../utils/parseRect.js'
|
||||
import { resolveAttrs } from '../utils/resolveAttrs.js'
|
||||
import type { JSFiddleTokenMeta } from '../../shared/index.js'
|
||||
|
||||
export const jsfiddlePlugin: PluginWithOptions<never> = (md) => {
|
||||
createRuleBlock<JSFiddleTokenMeta>(md, {
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import container from 'markdown-it-container'
|
||||
import { fs, getDirname, path } from 'vuepress/utils'
|
||||
import type markdownIt from 'markdown-it'
|
||||
import type Token from 'markdown-it/lib/token.mjs'
|
||||
import type { App } from 'vuepress/core'
|
||||
import type { ReplEditorData, ReplOptions } from '../../shared/index.js'
|
||||
import container from 'markdown-it-container'
|
||||
import { fs, getDirname, path } from 'vuepress/utils'
|
||||
|
||||
const RE_INFO = /^(#editable)?(.*)$/
|
||||
|
||||
|
||||
@ -3,12 +3,12 @@
|
||||
* @[pdf 1](/xxx)
|
||||
* @[pdf 1 no-toolbar width="100%" height="600px" zoom="1" ratio="1:1"](/xxx)
|
||||
*/
|
||||
import { path } from 'vuepress/utils'
|
||||
import type { PluginWithOptions } from 'markdown-it'
|
||||
import type { PDFTokenMeta } from '../../shared/index.js'
|
||||
import { path } from 'vuepress/utils'
|
||||
import { createRuleBlock } from '../utils/createRuleBlock.js'
|
||||
import { parseRect } from '../utils/parseRect.js'
|
||||
import { resolveAttrs } from '../utils/resolveAttrs.js'
|
||||
import type { PDFTokenMeta } from '../../shared/index.js'
|
||||
|
||||
export const pdfPlugin: PluginWithOptions<never> = (md) => {
|
||||
createRuleBlock<PDFTokenMeta>(md, {
|
||||
|
||||
@ -4,10 +4,10 @@
|
||||
* @[replit title="" height="400px" width="100%" theme="dark"](user/repl-name)
|
||||
*/
|
||||
import type { PluginWithOptions } from 'markdown-it'
|
||||
import type { ReplitTokenMeta } from '../../shared/index.js'
|
||||
import { createRuleBlock } from '../utils/createRuleBlock.js'
|
||||
import { parseRect } from '../utils/parseRect.js'
|
||||
import { resolveAttrs } from '../utils/resolveAttrs.js'
|
||||
import type { ReplitTokenMeta } from '../../shared/index.js'
|
||||
|
||||
export const replitPlugin: PluginWithOptions<never> = (md) => {
|
||||
createRuleBlock<ReplitTokenMeta>(md, {
|
||||
|
||||
@ -4,13 +4,13 @@
|
||||
* @[bilibili](bid aid cid)
|
||||
* @[bilibili p1 autoplay time=1](aid cid)
|
||||
*/
|
||||
import { URLSearchParams } from 'node:url'
|
||||
import type { PluginWithOptions } from 'markdown-it'
|
||||
import type { BilibiliTokenMeta } from '../../../shared/index.js'
|
||||
import { URLSearchParams } from 'node:url'
|
||||
import { createRuleBlock } from '../../utils/createRuleBlock.js'
|
||||
import { parseRect } from '../../utils/parseRect.js'
|
||||
import { resolveAttrs } from '../../utils/resolveAttrs.js'
|
||||
import { timeToSeconds } from '../../utils/timeToSeconds.js'
|
||||
import type { BilibiliTokenMeta } from '../../../shared/index.js'
|
||||
|
||||
const BILIBILI_LINK = 'https://player.bilibili.com/player.html'
|
||||
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
/**
|
||||
* @[youtube](id)
|
||||
*/
|
||||
import { URLSearchParams } from 'node:url'
|
||||
import type { PluginWithOptions } from 'markdown-it'
|
||||
import type { YoutubeTokenMeta } from '../../../shared/index.js'
|
||||
import { URLSearchParams } from 'node:url'
|
||||
import { createRuleBlock } from '../../utils/createRuleBlock.js'
|
||||
import { parseRect } from '../../utils/parseRect.js'
|
||||
import { resolveAttrs } from '../../utils/resolveAttrs.js'
|
||||
import { timeToSeconds } from '../../utils/timeToSeconds.js'
|
||||
import type { YoutubeTokenMeta } from '../../../shared/index.js'
|
||||
|
||||
const YOUTUBE_LINK = 'https://www.youtube.com/embed/'
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import { addViteOptimizeDepsInclude } from '@vuepress/helper'
|
||||
import type MarkdownIt from 'markdown-it'
|
||||
import type { Plugin } from 'vuepress/core'
|
||||
import type { CanIUseOptions, MarkdownPowerPluginOptions } from '../shared/index.js'
|
||||
import { addViteOptimizeDepsInclude } from '@vuepress/helper'
|
||||
import { caniusePlugin, legacyCaniuse } from './features/caniuse.js'
|
||||
import { codepenPlugin } from './features/codepen.js'
|
||||
import { codeSandboxPlugin } from './features/codeSandbox.js'
|
||||
@ -15,7 +16,6 @@ import { replitPlugin } from './features/replit.js'
|
||||
import { bilibiliPlugin } from './features/video/bilibili.js'
|
||||
import { youtubePlugin } from './features/video/youtube.js'
|
||||
import { prepareConfigFile } from './prepareConfigFile.js'
|
||||
import type { CanIUseOptions, MarkdownPowerPluginOptions } from '../shared/index.js'
|
||||
|
||||
export function markdownPowerPlugin(options: MarkdownPowerPluginOptions = {}): Plugin {
|
||||
return (app) => {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { ensureEndingSlash } from '@vuepress/helper'
|
||||
import { getDirname, path } from 'vuepress/utils'
|
||||
import type { App } from 'vuepress/core'
|
||||
import type { MarkdownPowerPluginOptions } from '../shared/index.js'
|
||||
import { ensureEndingSlash } from '@vuepress/helper'
|
||||
import { getDirname, path } from 'vuepress/utils'
|
||||
|
||||
const { url: filepath } = import.meta
|
||||
const __dirname = getDirname(filepath)
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import type { SearchBoxLocales, SearchOptions } from '../../shared/index.js'
|
||||
import { onKeyStroke } from '@vueuse/core'
|
||||
import {
|
||||
defineAsyncComponent,
|
||||
ref,
|
||||
} from 'vue'
|
||||
import SearchButton from './SearchButton.vue'
|
||||
import type { SearchBoxLocales, SearchOptions } from '../../shared/index.js'
|
||||
|
||||
defineProps<{
|
||||
locales: SearchBoxLocales
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import type { SearchBoxLocales, SearchOptions } from '../../shared/index.js'
|
||||
import {
|
||||
computedAsync,
|
||||
debouncedWatch,
|
||||
@ -28,7 +29,6 @@ import { LRUCache } from '../utils/index.js'
|
||||
import BackIcon from './icons/BackIcon.vue'
|
||||
import ClearIcon from './icons/ClearIcon.vue'
|
||||
import SearchIcon from './icons/SearchIcon.vue'
|
||||
import type { SearchBoxLocales, SearchOptions } from '../../shared/index.js'
|
||||
|
||||
const props = defineProps<{
|
||||
locales: SearchBoxLocales
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import type { SearchBoxLocales } from '../../shared/index.js'
|
||||
import { toRef } from 'vue'
|
||||
import { useLocale } from '../composables/index.js'
|
||||
import type { SearchBoxLocales } from '../../shared/index.js'
|
||||
|
||||
const props = defineProps<{
|
||||
locales: SearchBoxLocales
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { computed, toRef } from 'vue'
|
||||
import { useRouteLocale } from 'vuepress/client'
|
||||
import type { MaybeRef } from 'vue'
|
||||
import type { SearchBoxLocales } from '../../shared/index.js'
|
||||
import { computed, toRef } from 'vue'
|
||||
import { useRouteLocale } from 'vuepress/client'
|
||||
|
||||
const defaultLocales: SearchBoxLocales = {
|
||||
'/': {
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import type { ClientConfig } from 'vuepress/client'
|
||||
import type { SearchBoxLocales, SearchOptions } from '../shared/index.js'
|
||||
import { h } from 'vue'
|
||||
import { defineClientConfig } from 'vuepress/client'
|
||||
import type { ClientConfig } from 'vuepress/client'
|
||||
import Search from './components/Search.vue'
|
||||
import type { SearchBoxLocales, SearchOptions } from '../shared/index.js'
|
||||
|
||||
declare const __SEARCH_LOCALES__: SearchBoxLocales
|
||||
declare const __SEARCH_OPTIONS__: SearchOptions
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import type { App, Page } from 'vuepress/core'
|
||||
import type { SearchOptions, SearchPluginOptions } from '../shared/index.js'
|
||||
import MiniSearch from 'minisearch'
|
||||
import pMap from 'p-map'
|
||||
import { colors, logger } from 'vuepress/utils'
|
||||
import type { App, Page } from 'vuepress/core'
|
||||
import type { SearchOptions, SearchPluginOptions } from '../shared/index.js'
|
||||
|
||||
export interface SearchIndexOptions {
|
||||
app: App
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import type { Plugin } from 'vuepress/core'
|
||||
import type { SearchPluginOptions } from '../shared/index.js'
|
||||
import { addViteOptimizeDepsInclude } from '@vuepress/helper'
|
||||
import chokidar from 'chokidar'
|
||||
import { getDirname, path } from 'vuepress/utils'
|
||||
import type { Plugin } from 'vuepress/core'
|
||||
import { onSearchIndexRemoved, onSearchIndexUpdated, prepareSearchIndex } from './prepareSearchIndex.js'
|
||||
import type { SearchPluginOptions } from '../shared/index.js'
|
||||
|
||||
const __dirname = getDirname(import.meta.url)
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import FloatingVue, { recomputeAllPoppers } from 'floating-vue'
|
||||
import type { App } from 'vue'
|
||||
import FloatingVue, { recomputeAllPoppers } from 'floating-vue'
|
||||
import 'floating-vue/dist/style.css'
|
||||
|
||||
const isMobile = typeof navigator !== 'undefined' && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import type { App } from 'vuepress'
|
||||
import type { Markdown, MarkdownEnv } from 'vuepress/markdown'
|
||||
import { createCopyCodeButtonRender } from './createCopyCodeButtonRender.js'
|
||||
import type { CopyCodeOptions } from '../types.js'
|
||||
import { createCopyCodeButtonRender } from './createCopyCodeButtonRender.js'
|
||||
|
||||
/**
|
||||
* This plugin should work after `preWrapperPlugin`,
|
||||
|
||||
@ -1,15 +1,15 @@
|
||||
import type { App, LocaleConfig } from 'vuepress'
|
||||
import type {
|
||||
CopyCodeLocaleOptions,
|
||||
CopyCodeOptions,
|
||||
} from '../types.js'
|
||||
import {
|
||||
getLocalePaths,
|
||||
getRootLangPath,
|
||||
isPlainObject,
|
||||
} from '@vuepress/helper'
|
||||
import { ensureLeadingSlash, resolveLocalePath } from 'vuepress/shared'
|
||||
import type { App, LocaleConfig } from 'vuepress'
|
||||
import { copyCodeButtonLocales } from './copyCodeButtonLocales.js'
|
||||
import type {
|
||||
CopyCodeLocaleOptions,
|
||||
CopyCodeOptions,
|
||||
} from '../types.js'
|
||||
|
||||
export function createCopyCodeButtonRender(app: App, options?: boolean | CopyCodeOptions): ((filePathRelative: string) => string) | null {
|
||||
if (options === false)
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import type { HighlighterOptions, ThemeOptions } from '../types.js'
|
||||
import { customAlphabet } from 'nanoid'
|
||||
import { bundledLanguages, createHighlighter } from 'shiki'
|
||||
import { logger } from 'vuepress/utils'
|
||||
import { getLanguage } from './getLanguage.js'
|
||||
import { baseTransformers, getInlineTransformers } from './transformers.js'
|
||||
import type { HighlighterOptions, ThemeOptions } from '../types.js'
|
||||
|
||||
const nanoid = customAlphabet('abcdefghijklmnopqrstuvwxyz', 10)
|
||||
const mustacheRE = /\{\{.*?\}\}/g
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
import type { ShikiTransformer } from 'shiki'
|
||||
import type { WhitespacePosition } from '../utils/index.js'
|
||||
import {
|
||||
transformerCompactLineOptions,
|
||||
transformerNotationDiff,
|
||||
@ -9,10 +11,8 @@ import {
|
||||
transformerRenderWhitespace,
|
||||
} from '@shikijs/transformers'
|
||||
import { addClassToHast } from 'shiki'
|
||||
import type { ShikiTransformer } from 'shiki'
|
||||
import { defaultHoverInfoProcessor, transformerTwoslash } from '../twoslash/rendererTransformer.js'
|
||||
import { attrsToLines, resolveWhitespacePosition } from '../utils/index.js'
|
||||
import type { WhitespacePosition } from '../utils/index.js'
|
||||
|
||||
const decorationsRE = /^\/\/ @decorations:(.*)\n/
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
// markdown-it plugin for generating line numbers.
|
||||
// v-pre block logic is in `../highlight.ts`
|
||||
import type { Markdown } from 'vuepress/markdown'
|
||||
import { resolveAttr, resolveLanguage } from '../utils/index.js'
|
||||
import type { PreWrapperOptions } from '../types.js'
|
||||
import { resolveAttr, resolveLanguage } from '../utils/index.js'
|
||||
|
||||
export function preWrapperPlugin(
|
||||
md: Markdown,
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import type { App } from 'vuepress'
|
||||
import { ensureEndingSlash } from '@vuepress/helper'
|
||||
import { getDirname, path } from 'vuepress/utils'
|
||||
import type { App } from 'vuepress'
|
||||
|
||||
const __dirname = getDirname(import.meta.url)
|
||||
|
||||
|
||||
@ -1,5 +1,11 @@
|
||||
import { isPlainObject } from 'vuepress/shared'
|
||||
import type { Plugin } from 'vuepress/core'
|
||||
import type {
|
||||
CopyCodeOptions,
|
||||
HighlighterOptions,
|
||||
LineNumberOptions,
|
||||
PreWrapperOptions,
|
||||
} from './types.js'
|
||||
import { isPlainObject } from 'vuepress/shared'
|
||||
import { copyCodeButtonPlugin } from './copy-code-button/index.js'
|
||||
import { highlight } from './highlight/index.js'
|
||||
import {
|
||||
@ -9,12 +15,6 @@ import {
|
||||
preWrapperPlugin,
|
||||
} from './markdown/index.js'
|
||||
import { prepareClientConfigFile } from './prepareClientConfigFile.js'
|
||||
import type {
|
||||
CopyCodeOptions,
|
||||
HighlighterOptions,
|
||||
LineNumberOptions,
|
||||
PreWrapperOptions,
|
||||
} from './types.js'
|
||||
|
||||
export interface ShikiPluginOptions
|
||||
extends HighlighterOptions, LineNumberOptions, PreWrapperOptions {
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import type { RendererRichOptions, TwoslashRenderer } from '@shikijs/twoslash'
|
||||
import type { Element, ElementContent, Text } from 'hast'
|
||||
import type { ShikiTransformerContextCommon } from 'shiki'
|
||||
import { defaultHoverInfoProcessor, rendererRich } from '@shikijs/twoslash'
|
||||
import { fromMarkdown } from 'mdast-util-from-markdown'
|
||||
import { gfmFromMarkdown } from 'mdast-util-gfm'
|
||||
import { defaultHandlers, toHast } from 'mdast-util-to-hast'
|
||||
import type { RendererRichOptions, TwoslashRenderer } from '@shikijs/twoslash'
|
||||
import type { Element, ElementContent, Text } from 'hast'
|
||||
import type { ShikiTransformerContextCommon } from 'shiki'
|
||||
|
||||
export { defaultHoverInfoProcessor }
|
||||
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
import type { TransformerTwoslashOptions } from '@shikijs/twoslash/core'
|
||||
import type { ShikiTransformer } from 'shiki'
|
||||
import type { VueSpecificOptions } from 'twoslash-vue'
|
||||
import type { TwoslashFloatingVueRendererOptions } from './renderer-floating-vue.js'
|
||||
import process from 'node:process'
|
||||
import { createTransformerFactory } from '@shikijs/twoslash/core'
|
||||
import { removeTwoslashNotations } from 'twoslash'
|
||||
import { createTwoslasher } from 'twoslash-vue'
|
||||
import type { TransformerTwoslashOptions } from '@shikijs/twoslash/core'
|
||||
import type { ShikiTransformer } from 'shiki'
|
||||
import type { VueSpecificOptions } from 'twoslash-vue'
|
||||
import { rendererFloatingVue } from './renderer-floating-vue.js'
|
||||
import type { TwoslashFloatingVueRendererOptions } from './renderer-floating-vue.js'
|
||||
|
||||
export * from './renderer-floating-vue.js'
|
||||
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
import type { PlumeThemeProfile } from '../../../shared/index.js'
|
||||
import VPSocialLinks from '@theme/VPSocialLinks.vue'
|
||||
import { computed } from 'vue'
|
||||
import { withBase } from 'vuepress/client'
|
||||
import { isLinkHttp } from 'vuepress/shared'
|
||||
import { useData } from '../../composables/index.js'
|
||||
import type { PlumeThemeProfile } from '../../../shared/index.js'
|
||||
|
||||
const { theme } = useData()
|
||||
const profile = computed(() =>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import type { BlogCategoryItem, BlogCategoryItemWithPost } from '../../composables/index.js'
|
||||
import VPCategoriesGroup from '@theme/Blog/VPCategoriesGroup.vue'
|
||||
import VPLink from '@theme/VPLink.vue'
|
||||
import type { BlogCategoryItem, BlogCategoryItemWithPost } from '../../composables/index.js'
|
||||
|
||||
defineProps<{
|
||||
items: (BlogCategoryItem | BlogCategoryItemWithPost)[]
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import type { BlogCategoryItem } from '../../composables/index.js'
|
||||
import VPCategories from '@theme/Blog/VPCategories.vue'
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
import { useRoute } from 'vuepress/client'
|
||||
import type { BlogCategoryItem } from '../../composables/index.js'
|
||||
|
||||
const props = defineProps<{
|
||||
item: BlogCategoryItem
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
<script lang="ts" setup>
|
||||
import type { BlogPostCover, PlumeThemeBlogPostItem } from '../../../shared/index.js'
|
||||
import VPLink from '@theme/VPLink.vue'
|
||||
import { useMediaQuery } from '@vueuse/core'
|
||||
import { computed } from 'vue'
|
||||
import { useData, useInternalLink, useTagColors } from '../../composables/index.js'
|
||||
import type { BlogPostCover, PlumeThemeBlogPostItem } from '../../../shared/index.js'
|
||||
|
||||
const props = defineProps<{
|
||||
post: PlumeThemeBlogPostItem
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import type { Component } from 'vue'
|
||||
import VPBlog from '@theme/Blog/VPBlog.vue'
|
||||
import VPHomeBanner from '@theme/Home/VPHomeBanner.vue'
|
||||
import VPHomeCustom from '@theme/Home/VPHomeCustom.vue'
|
||||
@ -7,7 +8,6 @@ import VPHomeHero from '@theme/Home/VPHomeHero.vue'
|
||||
import VPHomeProfile from '@theme/Home/VPHomeProfile.vue'
|
||||
import VPHomeTextImage from '@theme/Home/VPHomeTextImage.vue'
|
||||
import { computed, h, nextTick, onUnmounted, resolveComponent, watch } from 'vue'
|
||||
import type { Component } from 'vue'
|
||||
import { useData } from '../../composables/index.js'
|
||||
|
||||
const slots = defineSlots<{
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
import type { PlumeThemeHomeBanner } from '../../../shared/index.js'
|
||||
import VPButton from '@theme/VPButton.vue'
|
||||
import { computed } from 'vue'
|
||||
import { withBase } from 'vuepress/client'
|
||||
import { isLinkHttp } from 'vuepress/shared'
|
||||
import { useData } from '../../composables/index.js'
|
||||
import type { PlumeThemeHomeBanner } from '../../../shared/index.js'
|
||||
|
||||
const props = defineProps<PlumeThemeHomeBanner>()
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
import type { PlumeHomeConfigBase } from '../../../shared/index.js'
|
||||
import { computed, normalizeClass } from 'vue'
|
||||
import { withBase } from 'vuepress/client'
|
||||
import { isLinkHttp } from 'vuepress/shared'
|
||||
import { useDarkMode } from '../../composables/index.js'
|
||||
import type { PlumeHomeConfigBase } from '../../../shared/index.js'
|
||||
|
||||
const props = defineProps<PlumeHomeConfigBase & {
|
||||
containerClass?: any
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { PlumeThemeHomeCustom } from '../../../shared/index.js'
|
||||
import VPHomeBox from '@theme/Home/VPHomeBox.vue'
|
||||
import { Content } from 'vuepress/client'
|
||||
import type { PlumeThemeHomeCustom } from '../../../shared/index.js'
|
||||
|
||||
const props = defineProps<PlumeThemeHomeCustom>()
|
||||
</script>
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
import type { PlumeThemeHomeFeature } from '../../../shared/index.js'
|
||||
import VPIcon from '@theme/VPIcon.vue'
|
||||
import VPImage from '@theme/VPImage.vue'
|
||||
import VPLink from '@theme/VPLink.vue'
|
||||
import { isLinkAbsolute, isLinkHttp } from '@vuepress/helper/client'
|
||||
import { computed } from 'vue'
|
||||
import type { PlumeThemeHomeFeature } from '../../../shared/index.js'
|
||||
|
||||
const props = defineProps<PlumeThemeHomeFeature>()
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import type { PlumeThemeHomeFeatures } from '../../../shared/index.js'
|
||||
import VPHomeBox from '@theme/Home/VPHomeBox.vue'
|
||||
import VPHomeFeature from '@theme/Home/VPHomeFeature.vue'
|
||||
import { computed } from 'vue'
|
||||
import type { PlumeThemeHomeFeatures } from '../../../shared/index.js'
|
||||
|
||||
const props = defineProps<PlumeThemeHomeFeatures>()
|
||||
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
import type { PlumeThemeHomeHero } from '../../../shared/index.js'
|
||||
import VPButton from '@theme/VPButton.vue'
|
||||
import { computed, ref } from 'vue'
|
||||
import { withBase } from 'vuepress/client'
|
||||
import { isLinkHttp } from 'vuepress/shared'
|
||||
import { useData, useHomeHeroTintPlate } from '../../composables/index.js'
|
||||
import type { PlumeThemeHomeHero } from '../../../shared/index.js'
|
||||
|
||||
const props = defineProps<PlumeThemeHomeHero>()
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
import type { PlumeThemeHomeProfile } from '../../../shared/index.js'
|
||||
import VPHomeBox from '@theme/Home/VPHomeBox.vue'
|
||||
import VPImage from '@theme/VPImage.vue'
|
||||
import { computed } from 'vue'
|
||||
import { useData } from '../../composables/index.js'
|
||||
import type { PlumeThemeHomeProfile } from '../../../shared/index.js'
|
||||
|
||||
const props = defineProps<PlumeThemeHomeProfile>()
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import type { PlumeThemeHomeTextImage } from '../../../shared/index.js'
|
||||
import VPHomeBox from '@theme/Home/VPHomeBox.vue'
|
||||
import VPImage from '@theme/VPImage.vue'
|
||||
import { computed } from 'vue'
|
||||
import type { PlumeThemeHomeTextImage } from '../../../shared/index.js'
|
||||
|
||||
const props = defineProps<PlumeThemeHomeTextImage>()
|
||||
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
<script lang="ts" setup>
|
||||
import type {
|
||||
ResolvedNavItem,
|
||||
ResolvedNavItemWithChildren,
|
||||
} from '../../../shared/index.js'
|
||||
import VPFlyout from '@theme/VPFlyout.vue'
|
||||
import { computed } from 'vue'
|
||||
import { resolveRouteFullPath } from 'vuepress/client'
|
||||
import { useData } from '../../composables/index.js'
|
||||
import { isActive } from '../../utils/index.js'
|
||||
import type {
|
||||
ResolvedNavItem,
|
||||
ResolvedNavItemWithChildren,
|
||||
} from '../../../shared/index.js'
|
||||
|
||||
const props = defineProps<{
|
||||
item: ResolvedNavItemWithChildren
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
<script lang="ts" setup>
|
||||
import type { ResolvedNavItemWithLink } from '../../../shared/index.js'
|
||||
import VPIcon from '@theme/VPIcon.vue'
|
||||
import VPLink from '@theme/VPLink.vue'
|
||||
import { resolveRouteFullPath } from 'vuepress/client'
|
||||
import { useData } from '../../composables/index.js'
|
||||
import { isActive } from '../../utils/index.js'
|
||||
import type { ResolvedNavItemWithLink } from '../../../shared/index.js'
|
||||
|
||||
defineProps<{
|
||||
item: ResolvedNavItemWithLink
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
<script lang="ts" setup>
|
||||
import type { ThemeIcon } from '../../../shared/index.js'
|
||||
import VPNavScreenMenuGroupLink from '@theme/Nav/VPNavScreenMenuGroupLink.vue'
|
||||
import VPNavScreenMenuGroupSection from '@theme/Nav/VPNavScreenMenuGroupSection.vue'
|
||||
import VPIcon from '@theme/VPIcon.vue'
|
||||
import { computed, ref } from 'vue'
|
||||
import type { ThemeIcon } from '../../../shared/index.js'
|
||||
|
||||
const props = defineProps<{
|
||||
text: string
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
<script lang="ts" setup>
|
||||
import type { ResolvedNavItemWithLink } from '../../../shared/index.js'
|
||||
import VPIcon from '@theme/VPIcon.vue'
|
||||
import VPLink from '@theme/VPLink.vue'
|
||||
import { inject } from 'vue'
|
||||
import type { ResolvedNavItemWithLink } from '../../../shared/index.js'
|
||||
|
||||
defineProps<{
|
||||
item: ResolvedNavItemWithLink
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import type { NavItemWithLink, ThemeIcon } from '../../../shared/index.js'
|
||||
import VPNavScreenMenuGroupLink from '@theme/Nav/VPNavScreenMenuGroupLink.vue'
|
||||
import VPIcon from '@theme/VPIcon.vue'
|
||||
import type { NavItemWithLink, ThemeIcon } from '../../../shared/index.js'
|
||||
|
||||
defineProps<{
|
||||
icon?: ThemeIcon
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
<script lang="ts" setup>
|
||||
import type { ResolvedNavItemWithLink } from '../../../shared/index.js'
|
||||
import VPIcon from '@theme/VPIcon.vue'
|
||||
import VPLink from '@theme/VPLink.vue'
|
||||
import { inject } from 'vue'
|
||||
import type { ResolvedNavItemWithLink } from '../../../shared/index.js'
|
||||
|
||||
defineProps<{
|
||||
item: ResolvedNavItemWithLink
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import type { ResolvedSidebarItem } from '../../shared/index.js'
|
||||
import VPLink from '@theme/VPLink.vue'
|
||||
import { computed } from 'vue'
|
||||
import {
|
||||
@ -7,7 +8,6 @@ import {
|
||||
useInternalLink,
|
||||
useSidebarData,
|
||||
} from '../composables/index.js'
|
||||
import type { ResolvedSidebarItem } from '../../shared/index.js'
|
||||
|
||||
interface Breadcrumb {
|
||||
text: string
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import VPFriendsItem from '@theme/VPFriendsItem.vue'
|
||||
import type { FriendGroup } from '../../shared/index.js'
|
||||
import VPFriendsItem from '@theme/VPFriendsItem.vue'
|
||||
|
||||
defineProps<{
|
||||
group: FriendGroup
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
<script lang="ts" setup>
|
||||
import type { FriendsItem } from '../../shared/index'
|
||||
import VPLink from '@theme/VPLink.vue'
|
||||
import { isPlainObject } from '@vuepress/helper/client'
|
||||
import { computed } from 'vue'
|
||||
import { useDarkMode } from '../composables/index.js'
|
||||
import VPSocialLinks from './VPSocialLinks.vue'
|
||||
import type { FriendsItem } from '../../shared/index'
|
||||
|
||||
const props = defineProps<{
|
||||
friend: FriendsItem
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
<script lang="ts" setup>
|
||||
import type { IconifyIcon } from '@iconify/vue/offline'
|
||||
import { loadIcon } from '@iconify/vue'
|
||||
import { Icon as OfflineIcon } from '@iconify/vue/offline'
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import type { IconifyIcon } from '@iconify/vue/offline'
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import { withBase } from 'vuepress/client'
|
||||
import type { ThemeImage } from '../../shared/index.js'
|
||||
import { withBase } from 'vuepress/client'
|
||||
|
||||
defineProps<{
|
||||
image: ThemeImage
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
import type { MenuItem } from '../composables/index.js'
|
||||
import VPDocOutlineItem from '@theme/VPDocOutlineItem.vue'
|
||||
import { onClickOutside } from '@vueuse/core'
|
||||
import { nextTick, ref, watch } from 'vue'
|
||||
import { useData } from '../composables/index.js'
|
||||
import type { MenuItem } from '../composables/index.js'
|
||||
|
||||
const props = defineProps<{
|
||||
headers: MenuItem[]
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { ResolvedSidebarItem } from '../../shared/index.js'
|
||||
import VPSidebarItem from '@theme/VPSidebarItem.vue'
|
||||
import { onBeforeUnmount, onMounted, ref } from 'vue'
|
||||
import type { ResolvedSidebarItem } from '../../shared/index.js'
|
||||
|
||||
defineProps<{
|
||||
items: ResolvedSidebarItem[]
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
import type { ResolvedSidebarItem } from '../../shared/index.js'
|
||||
import VPIcon from '@theme/VPIcon.vue'
|
||||
import VPLink from '@theme/VPLink.vue'
|
||||
import { computed } from 'vue'
|
||||
import { useSidebarControl } from '../composables/index.js'
|
||||
import type { ResolvedSidebarItem } from '../../shared/index.js'
|
||||
|
||||
const props = defineProps<{
|
||||
item: ResolvedSidebarItem
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import { computed } from 'vue'
|
||||
import type { SocialLinkIcon } from '../../shared/index.js'
|
||||
import { computed } from 'vue'
|
||||
|
||||
const props = defineProps<{
|
||||
icon: SocialLinkIcon
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import VPSocialLink from '@theme/VPSocialLink.vue'
|
||||
import type { SocialLink as SocialLinkType } from '../../shared/index.js'
|
||||
import VPSocialLink from '@theme/VPSocialLink.vue'
|
||||
|
||||
defineProps<{
|
||||
links: SocialLinkType[]
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import type { PlumeThemeBlogPostItem } from '../../shared/index.js'
|
||||
import { computed } from 'vue'
|
||||
import { useLocalePostList } from './blog-data.js'
|
||||
import type { PlumeThemeBlogPostItem } from '../../shared/index.js'
|
||||
|
||||
export type ShortPostItem = Pick<PlumeThemeBlogPostItem, 'title' | 'path' | 'createTime'>
|
||||
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import type { Ref } from 'vue'
|
||||
import type { PlumeThemeBlogPostData } from '../../shared/index.js'
|
||||
import {
|
||||
blogPostData as blogPostDataRaw,
|
||||
} from '@internal/blogData'
|
||||
import { computed, ref } from 'vue'
|
||||
import { usePageLang } from 'vuepress/client'
|
||||
import type { Ref } from 'vue'
|
||||
import type { PlumeThemeBlogPostData } from '../../shared/index.js'
|
||||
|
||||
export type BlogDataRef = Ref<PlumeThemeBlogPostData>
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import type { PlumeThemeBlogPostItem } from '../../shared/index.js'
|
||||
import { useMediaQuery } from '@vueuse/core'
|
||||
import { computed, type Ref } from 'vue'
|
||||
import { useLocalePostList } from './blog-data.js'
|
||||
import { useData } from './data.js'
|
||||
import { useRouteQuery } from './route-query.js'
|
||||
import type { PlumeThemeBlogPostItem } from '../../shared/index.js'
|
||||
|
||||
const DEFAULT_PER_PAGE = 15
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import type { PlumeThemeBlogPostItem } from '../../shared/index.js'
|
||||
import { computed } from 'vue'
|
||||
import { toArray } from '../utils/index.js'
|
||||
import { useLocalePostList } from './blog-data.js'
|
||||
import { useRouteQuery } from './route-query.js'
|
||||
import { useTagColors } from './tag-colors.js'
|
||||
import type { PlumeThemeBlogPostItem } from '../../shared/index.js'
|
||||
|
||||
type ShortPostItem = Pick<PlumeThemeBlogPostItem, 'title' | 'path' | 'createTime'>
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { computed } from 'vue'
|
||||
import type { ComputedRef } from 'vue'
|
||||
import { computed } from 'vue'
|
||||
import { useData } from '../composables/data.js'
|
||||
import { toArray } from '../utils/index.js'
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import type { App, InjectionKey, Ref } from 'vue'
|
||||
import { useDark } from '@vueuse/core'
|
||||
import { inject, ref } from 'vue'
|
||||
import type { App, InjectionKey, Ref } from 'vue'
|
||||
import { useThemeData } from './theme-data.js'
|
||||
|
||||
type DarkModeRef = Ref<boolean>
|
||||
|
||||
@ -1,17 +1,9 @@
|
||||
import {
|
||||
usePageData,
|
||||
usePageFrontmatter,
|
||||
usePageLang,
|
||||
useSiteLocaleData,
|
||||
} from 'vuepress/client'
|
||||
import type { Ref } from 'vue'
|
||||
import type {
|
||||
PageDataRef,
|
||||
PageFrontmatterRef,
|
||||
SiteLocaleDataRef,
|
||||
} from 'vuepress/client'
|
||||
import { useDarkMode } from './dark-mode.js'
|
||||
import { useThemeLocaleData } from './theme-data.js'
|
||||
import type {
|
||||
PlumeThemeFriendsFrontmatter,
|
||||
PlumeThemeHomeFrontmatter,
|
||||
@ -21,6 +13,14 @@ import type {
|
||||
PlumeThemePostFrontmatter,
|
||||
} from '../../shared/index.js'
|
||||
import type { ThemeLocaleDataRef } from './theme-data.js'
|
||||
import {
|
||||
usePageData,
|
||||
usePageFrontmatter,
|
||||
usePageLang,
|
||||
useSiteLocaleData,
|
||||
} from 'vuepress/client'
|
||||
import { useDarkMode } from './dark-mode.js'
|
||||
import { useThemeLocaleData } from './theme-data.js'
|
||||
|
||||
type FrontmatterType = 'home' | 'post' | 'friends' | 'page'
|
||||
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import { computed } from 'vue'
|
||||
import type { ComputedRef } from 'vue'
|
||||
import { useData } from '../composables/data.js'
|
||||
import { resolveEditLink } from '../utils/index.js'
|
||||
import type {
|
||||
NavItemWithLink,
|
||||
} from '../../shared/index.js'
|
||||
import { computed } from 'vue'
|
||||
import { useData } from '../composables/data.js'
|
||||
import { resolveEditLink } from '../utils/index.js'
|
||||
|
||||
export function useEditLink(): ComputedRef<null | NavItemWithLink> {
|
||||
const { theme, page, frontmatter } = useData()
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import type { Ref } from 'vue'
|
||||
import { encrypt as rawEncrypt } from '@internal/encrypt'
|
||||
import { ref } from 'vue'
|
||||
import type { Ref } from 'vue'
|
||||
|
||||
export type EncryptConfig = readonly [
|
||||
boolean, // global
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import type { InjectionKey, Ref } from 'vue'
|
||||
import { hasOwn, useSessionStorage } from '@vueuse/core'
|
||||
import { compare, genSaltSync } from 'bcrypt-ts/browser'
|
||||
import { computed, inject, provide } from 'vue'
|
||||
import { useRoute } from 'vuepress/client'
|
||||
import type { InjectionKey, Ref } from 'vue'
|
||||
import { useData } from './data.js'
|
||||
import { type EncryptDataRule, useEncryptData } from './encrypt-data.js'
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { onUnmounted, readonly, ref, watch } from 'vue'
|
||||
import type { Ref } from 'vue'
|
||||
import { onUnmounted, readonly, ref, watch } from 'vue'
|
||||
import { inBrowser } from '../utils/index.js'
|
||||
|
||||
interface UseFlyoutOptions {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { computed, onMounted, onUnmounted } from 'vue'
|
||||
import type { Ref } from 'vue'
|
||||
import { useDarkMode } from './dark-mode.js'
|
||||
import type { PlumeThemeHomeHero } from '../../shared/index.js'
|
||||
import { computed, onMounted, onUnmounted } from 'vue'
|
||||
import { useDarkMode } from './dark-mode.js'
|
||||
|
||||
export interface TintPlate {
|
||||
r: { value: number, offset: number }
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import type { Ref } from 'vue'
|
||||
import { icons } from '@internal/iconify'
|
||||
import { ref } from 'vue'
|
||||
import type { Ref } from 'vue'
|
||||
|
||||
type IconsData = Record<string, string>
|
||||
type IconsDataRef = Ref<IconsData>
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import type { PresetLocale } from '../../shared/index.js'
|
||||
import { computed } from 'vue'
|
||||
import { useRouteLocale } from 'vuepress/client'
|
||||
import { useData } from './data.js'
|
||||
import { getPresetLocaleData } from './preset-locales.js'
|
||||
import type { PresetLocale } from '../../shared/index.js'
|
||||
|
||||
export interface InternalLink {
|
||||
text: string
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import { useRoute } from 'vuepress/client'
|
||||
import type { Ref } from 'vue'
|
||||
import { normalizeLink, resolveNavLink } from '../utils/index.js'
|
||||
|
||||
import { useData } from './data.js'
|
||||
import type {
|
||||
NavItem,
|
||||
ResolvedNavItem,
|
||||
ResolvedNavItemWithLink,
|
||||
} from '../../shared/index.js'
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import { useRoute } from 'vuepress/client'
|
||||
|
||||
import { normalizeLink, resolveNavLink } from '../utils/index.js'
|
||||
import { useData } from './data.js'
|
||||
|
||||
export function useNavbarData(): Ref<ResolvedNavItem[]> {
|
||||
const { theme } = useData()
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import type { InjectionKey, Ref } from 'vue'
|
||||
import type { ThemeOutline } from '../../shared/index.js'
|
||||
import { onContentUpdated } from '@vuepress-plume/plugin-content-update/client'
|
||||
import { inject, onMounted, onUnmounted, onUpdated, provide, ref } from 'vue'
|
||||
import type { InjectionKey, Ref } from 'vue'
|
||||
import { throttleAndDebounce } from '../utils/index.js'
|
||||
import { useAside } from './aside.js'
|
||||
import { useData } from './data.js'
|
||||
import type { ThemeOutline } from '../../shared/index.js'
|
||||
|
||||
export interface Header {
|
||||
/**
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
import type { Ref } from 'vue'
|
||||
import type { NavItemWithLink, PlumeThemeBlogPostItem, SidebarItem } from '../../shared/index.js'
|
||||
import { computed } from 'vue'
|
||||
import { resolveRouteFullPath, usePageLang, useRoute } from 'vuepress/client'
|
||||
import { isPlainObject, isString } from 'vuepress/shared'
|
||||
import type { Ref } from 'vue'
|
||||
import { resolveNavLink } from '../utils/index.js'
|
||||
import { usePostList } from './blog-data.js'
|
||||
import { useData } from './data.js'
|
||||
import { useBlogPageData } from './page.js'
|
||||
import { useSidebar } from './sidebar.js'
|
||||
import type { NavItemWithLink, PlumeThemeBlogPostItem, SidebarItem } from '../../shared/index.js'
|
||||
|
||||
export function usePrevNext() {
|
||||
const route = useRoute()
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import type { MaybeRef, MaybeRefOrGetter, Ref } from 'vue'
|
||||
import type { RouteParamValueRaw, Router } from 'vue-router'
|
||||
import { tryOnScopeDispose } from '@vueuse/core'
|
||||
import { customRef, nextTick, toValue, watch } from 'vue'
|
||||
import { useRoute, useRouter } from 'vuepress/client'
|
||||
import type { MaybeRef, MaybeRefOrGetter, Ref } from 'vue'
|
||||
import type { RouteParamValueRaw, Router } from 'vue-router'
|
||||
|
||||
export type RouteQueryValueRaw = RouteParamValueRaw | string[]
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { nextTick } from 'vue'
|
||||
import type { Router } from 'vuepress/client'
|
||||
import { nextTick } from 'vue'
|
||||
import { inBrowser } from '../utils/index.js'
|
||||
import { useScrollPromise } from './scroll-promise.js'
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user