valaxy-theme-hairy 0.0.7 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,7 +15,7 @@ function isCurrent(title = '') {
15
15
  </script>
16
16
 
17
17
  <template>
18
- <div class="pl-16px text-14px relative overflow-hidden">
18
+ <div class="pl-16px text-14px relative overflow-hidden animate__animated animate__fadeIn">
19
19
  <div class="outline-title">
20
20
  On this Series
21
21
  </div>
@@ -21,7 +21,7 @@ const footerIcon = computed(() => themeConfig.value.footer.icon)
21
21
  </script>
22
22
 
23
23
  <template>
24
- <footer class="va-footer p-4 pb-10" text="center sm" style="color:var(--va-c-text-light)">
24
+ <footer v-if="themeConfig.footer" class="va-footer p-4 pb-10" text="center sm" style="color:var(--va-c-text-light)">
25
25
  <div v-if="themeConfig.footer.beian?.enable && themeConfig.footer.beian.icp" class="beian" m="y-2">
26
26
  <a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener">
27
27
  {{ themeConfig.footer.beian.icp }}
@@ -2,8 +2,8 @@
2
2
  import { computed, provide, useCssVars, useSlots } from 'vue'
3
3
  import { executeOverlay } from 'unoverlay-vue'
4
4
  import type { ImageViewerProps } from 'element-plus/es/components/image-viewer/index'
5
- import type { AtWillNumber } from '@hairy/libcore'
6
- import { atWillToUnit } from '@hairy/libcore'
5
+ import type { AtWillNumber } from '../utils'
6
+ import { atWillToUnit } from '../utils'
7
7
  import HairyImageViewer from './HairyImageViewer.vue'
8
8
 
9
9
  const props = withDefaults(defineProps<{
@@ -32,7 +32,7 @@ function handleClick({ target: el }: Event) {
32
32
  </script>
33
33
 
34
34
  <template>
35
- <div v-show="resolvedHeaders.length" ref="container">
35
+ <div v-show="resolvedHeaders.length" ref="container" class="animate__animated animate__fadeIn">
36
36
  <div class="content">
37
37
  <div class="outline-title">
38
38
  {{ themeConfig.outlineTitle || 'On this page' }}
@@ -11,7 +11,7 @@ const description = computed(() => theme.value.user?.description || config.value
11
11
  </script>
12
12
 
13
13
  <template>
14
- <div class="pt-5">
14
+ <div class="pt-5 animate__animated animate__fadeIn">
15
15
  <div class="flex flex-col items-center">
16
16
  <img class="mx-auto w-40 rounded-full -mx-1px" :src="config.author.avatar" />
17
17
  <div class="leading-loose mt-2">
@@ -1,6 +1,8 @@
1
- import type { ValaxyExtendConfig } from 'valaxy'
1
+ import type { ResolvedValaxyOptions, ValaxyExtendConfig } from 'valaxy'
2
+ import type { HairyTheme } from 'valaxy-theme-hairy'
2
3
 
3
- function addonHairy(): ValaxyExtendConfig {
4
+ function addonHairy(options: ResolvedValaxyOptions<HairyTheme>): ValaxyExtendConfig {
5
+ const safelist = options.config.themeConfig?.nav?.filter(v => v.icon)?.map(v => v.icon || '') || []
4
6
  return {
5
7
  extendMd(ctx) {
6
8
  if (ctx.route.meta.excerpt)
@@ -19,6 +21,9 @@ function addonHairy(): ValaxyExtendConfig {
19
21
  route.meta.layout = 'hairy'
20
22
  },
21
23
  },
24
+ unocss: {
25
+ safelist,
26
+ },
22
27
  }
23
28
  }
24
29
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valaxy-theme-hairy",
3
- "version": "0.0.7",
3
+ "version": "0.0.10",
4
4
  "packageManager": "pnpm@7.5.0",
5
5
  "author": {
6
6
  "email": "wwu710632@gmail.com",
@@ -21,7 +21,6 @@
21
21
  "dependencies": {
22
22
  "@docsearch/css": "^3.1.1",
23
23
  "@docsearch/js": "^3.1.1",
24
- "@hairy/libcore": "^0.3.0",
25
24
  "@hairy/vue-use": "^1.2.0",
26
25
  "@iconify-json/ant-design": "^1.1.3",
27
26
  "@iconify-json/simple-icons": "^1.1.19",
@@ -35,7 +34,7 @@
35
34
  "markdown-toc": "^1.2.0",
36
35
  "reading-time": "^1.5.0",
37
36
  "swiper": "^8.3.1",
38
- "unoverlay-vue": "0.2.1"
37
+ "unoverlay-vue": "0.2.2"
39
38
  },
40
39
  "devDependencies": {
41
40
  "@types/lodash": "^4.14.182",
package/utils/index.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { isNumber, isString } from 'lodash-es'
2
+
1
3
  /**
2
4
  * 跳转到新的页面
3
5
  * @param url 跳转url
@@ -26,3 +28,11 @@ export const toArr = <T>(arr: T[] | T): T[] => {
26
28
  return arr as any
27
29
  else return [arr].filter(Boolean) as any
28
30
  }
31
+
32
+ export type AtWillNumber = string | number
33
+
34
+ export const atWillToUnit = (value: AtWillNumber, unit = 'px') => {
35
+ if (!(isString(value) || isNumber(value)))
36
+ return ''
37
+ return isString(value) && /\D/g.test(value) ? value : value + unit
38
+ }
package/valaxy.config.ts CHANGED
@@ -7,7 +7,7 @@ import addonStatistics from './node/addon-statistics'
7
7
  import addonToc from './node/addon-toc'
8
8
  export default defineTheme<HairyTheme>((options) => {
9
9
  const images = addonImages(options)
10
- const hairy = addonHairy()
10
+ const hairy = addonHairy(options)
11
11
 
12
12
  return {
13
13
  vite: images.vite,
package/dist/index.d.ts DELETED
@@ -1,15 +0,0 @@
1
- import * as valaxy_dist_node from 'valaxy/dist/node';
2
-
3
- interface HairyTheme {
4
- nav?: NavItem[];
5
- }
6
- interface NavItem {
7
- text: string;
8
- icon?: string;
9
- link?: string;
10
- items?: NavItem[];
11
- }
12
-
13
- declare const _default: Promise<valaxy_dist_node.ValaxyThemePlugin | valaxy_dist_node.ThemeConfigFn>;
14
-
15
- export { HairyTheme, NavItem, _default as default };
package/dist/index.js DELETED
@@ -1,40 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // node/index.ts
21
- var node_exports = {};
22
- __export(node_exports, {
23
- default: () => node_default
24
- });
25
- module.exports = __toCommonJS(node_exports);
26
- var import_valaxy = require("valaxy");
27
- var safelist = [
28
- "i-ri-home-line",
29
- "i-ri-github-line"
30
- ];
31
- var node_default = (0, import_valaxy.defineThemePlugin)(() => {
32
- return {
33
- vite: {},
34
- unocss: {
35
- safelist
36
- }
37
- };
38
- });
39
- // Annotate the CommonJS export names for ESM import in node:
40
- 0 && (module.exports = {});
package/dist/index.mjs DELETED
@@ -1,17 +0,0 @@
1
- // node/index.ts
2
- import { defineThemePlugin } from "valaxy";
3
- var safelist = [
4
- "i-ri-home-line",
5
- "i-ri-github-line"
6
- ];
7
- var node_default = defineThemePlugin(() => {
8
- return {
9
- vite: {},
10
- unocss: {
11
- safelist
12
- }
13
- };
14
- });
15
- export {
16
- node_default as default
17
- };