vft 0.0.476 → 0.0.478

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.
@@ -1,7 +1,7 @@
1
1
  import { keysOf as f } from "@vft/utils";
2
2
  import "@vueuse/core";
3
3
  import { debugWarn as v } from "../../../utils/error.js";
4
- import { ref as g, getCurrentInstance as l, computed as i, unref as p, provide as C, inject as x } from "vue";
4
+ import { getCurrentInstance as l, computed as i, unref as p, provide as g, ref as C, inject as x } from "vue";
5
5
  import "lodash-es";
6
6
  import "../../form/index.js";
7
7
  import { namespaceContextKey as I, useNamespace as b, defaultNamespace as y } from "../../../hooks/use-namespace/index.js";
@@ -9,7 +9,7 @@ import "../../../hooks/use-model-toggle/index.js";
9
9
  import "@popperjs/core";
10
10
  import { zIndexContextKey as G, useZIndex as z, defaultInitialZIndex as K } from "../../../hooks/use-z-index/index.js";
11
11
  import { configProviderContextKey as m } from "../constants.js";
12
- const a = g();
12
+ const a = C();
13
13
  function d(o, e = void 0) {
14
14
  const n = l() ? x(m, a) : a;
15
15
  return o ? i(() => n?.value?.[o] ?? e) : n;
@@ -27,7 +27,7 @@ function B(o) {
27
27
  };
28
28
  }
29
29
  const S = (o, e, n = !1) => {
30
- const t = !!l(), r = t ? d() : void 0, u = e?.provide ?? (t ? C : void 0);
30
+ const t = !!l(), r = t ? d() : void 0, u = e?.provide ?? (t ? g : void 0);
31
31
  if (!u) {
32
32
  v(
33
33
  "provideGlobalConfig",
@@ -1,4 +1,4 @@
1
- import { defineComponent as C, computed as o, createElementBlock as f, openBlock as l, normalizeStyle as k, normalizeClass as S, unref as r, createBlock as s, createCommentVNode as y, mergeProps as u, normalizeProps as b, toDisplayString as I } from "vue";
1
+ import { defineComponent as C, computed as o, createElementBlock as f, openBlock as l, normalizeStyle as k, normalizeClass as S, unref as r, createBlock as c, createCommentVNode as y, mergeProps as s, normalizeProps as b, toDisplayString as I } from "vue";
2
2
  import { VftClampTooltip as w } from "../clamp-tooltip/index.js";
3
3
  import { VftIcon as h } from "../icon/index.js";
4
4
  import "@vueuse/core";
@@ -33,21 +33,21 @@ const j = { key: 2 }, N = C({
33
33
  useClamp: { type: Boolean }
34
34
  },
35
35
  setup(e) {
36
- const m = V("icon-text"), i = o(() => e.hoverColor || e.color), n = o(() => H(e.icon, "icon", { size: e.size, color: e.color })), v = o(() => e.direction === "col"), d = o(() => {
36
+ const u = V("icon-text"), i = o(() => e.hoverColor || e.color), n = o(() => H(e.icon, "icon", { size: e.size, color: e.color })), m = o(() => e.direction === "col"), v = o(() => {
37
37
  const t = g(e.distance);
38
- return v.value ? e.reverse ? { marginTop: t } : { marginBottom: t } : e.reverse ? { marginLeft: t } : { marginRight: t };
39
- }), a = o(() => L(e.size)), c = o(() => a.value < 12), x = o(() => a.value && c.value ? { transform: `scale(${a.value / 12})` } : {}), z = o(() => {
38
+ return m.value ? e.reverse ? { marginTop: t } : { marginBottom: t } : e.reverse ? { marginLeft: t } : { marginRight: t };
39
+ }), a = o(() => L(e.size)), d = o(() => a.value < 12), x = o(() => a.value && d.value ? { transform: `scale(${a.value / 12})` } : {}), z = o(() => {
40
40
  const t = O(
41
41
  {
42
42
  cursor: e.pointer ? "pointer" : void 0,
43
43
  color: e.color,
44
44
  "hover-color": e.hoverColor ? i.value : void 0,
45
- fontSize: c.value ? "12px" : g(e.size)
45
+ fontSize: g(e.size)
46
46
  },
47
47
  "icon-text"
48
48
  );
49
49
  return {
50
- ...c.value && e.adjustOrigin ? { transformOrigin: "left top" } : {},
50
+ ...d.value && e.adjustOrigin ? { transformOrigin: "left top" } : {},
51
51
  ...t,
52
52
  ...x.value
53
53
  };
@@ -59,19 +59,19 @@ const j = { key: 2 }, N = C({
59
59
  }));
60
60
  return (t, T) => (l(), f("span", {
61
61
  class: S([
62
- r(m).b(),
63
- r(m).is("col", v.value),
62
+ r(u).b(),
63
+ r(u).is("col", m.value),
64
64
  { "disable-icon-hover": e.disableIconHover }
65
65
  ]),
66
66
  style: k(z.value)
67
67
  }, [
68
- !e.reverse && n.value?.icon ? (l(), s(r(h), u({ key: 0 }, n.value, {
68
+ !e.reverse && n.value?.icon ? (l(), c(r(h), s({ key: 0 }, n.value, {
69
69
  "hover-color": e.hoverColor && !e.disableIconHover ? i.value : void 0,
70
- style: d.value
70
+ style: v.value
71
71
  }), null, 16, ["hover-color", "style"])) : y("", !0),
72
- e.useClamp ? (l(), s(r(w), b(u({ key: 1 }, B.value)), null, 16)) : (l(), f("span", j, I(e.text), 1)),
73
- e.reverse && n.value?.icon ? (l(), s(r(h), u({ key: 3 }, n.value, {
74
- style: d.value,
72
+ e.useClamp ? (l(), c(r(w), b(s({ key: 1 }, B.value)), null, 16)) : (l(), f("span", j, I(e.text), 1)),
73
+ e.reverse && n.value?.icon ? (l(), c(r(h), s({ key: 3 }, n.value, {
74
+ style: v.value,
75
75
  "hover-color": e.hoverColor && !e.disableIconHover ? i.value : void 0
76
76
  }), null, 16, ["style", "hover-color"])) : y("", !0)
77
77
  ], 6));
@@ -1,14 +1,14 @@
1
- import { defineComponent as n, ref as t, onMounted as u, nextTick as a, createElementBlock as _, openBlock as w, normalizeClass as v, unref as g } from "vue";
1
+ import { defineComponent as n, ref as a, onMounted as u, nextTick as t, createElementBlock as w, openBlock as _, normalizeClass as v, unref as g } from "vue";
2
2
  import "@vueuse/core";
3
3
  import "@vft/utils";
4
4
  import "../config-provider/hooks/use-global-config.js";
5
5
  import "lodash-es";
6
6
  import "../form/index.js";
7
- import { useNamespace as h } from "../../hooks/use-namespace/index.js";
7
+ import { useNamespace as b } from "../../hooks/use-namespace/index.js";
8
8
  import "../../hooks/use-model-toggle/index.js";
9
9
  import "@popperjs/core";
10
10
  import "../../hooks/use-z-index/index.js";
11
- const b = ["src"], k = n({
11
+ const h = ["src"], k = n({
12
12
  name: "vft-iframe-page"
13
13
  }), I = /* @__PURE__ */ n({
14
14
  ...k,
@@ -16,37 +16,37 @@ const b = ["src"], k = n({
16
16
  frameSrc: {}
17
17
  },
18
18
  emits: ["loaded"],
19
- setup(i, { expose: s, emit: l }) {
20
- const m = l, c = h("iframe-page"), e = t(), o = t(!0), r = () => {
21
- a(() => {
22
- o.value = !1, m("loaded");
19
+ setup(l, { expose: s, emit: i }) {
20
+ const c = i, m = b("iframe-page"), e = a(), o = a(!0), r = () => {
21
+ t(() => {
22
+ o.value = !1, c("loaded");
23
23
  });
24
- }, f = () => {
25
- r();
26
24
  }, p = () => {
25
+ r();
26
+ }, f = () => {
27
27
  if (!e.value) return;
28
28
  e.value?.contentDocument?.readyState === "complete" && setTimeout(() => {
29
29
  r();
30
30
  }, 1e3);
31
31
  };
32
32
  return u(() => {
33
- o.value = !0, a(() => {
34
- p();
33
+ o.value = !0, t(() => {
34
+ f();
35
35
  });
36
36
  }), s({
37
37
  isLoading: o
38
- }), (d, x) => (w(), _("iframe", {
38
+ }), (d, x) => (_(), w("iframe", {
39
39
  ref_key: "iframeRef",
40
40
  ref: e,
41
- sandbox: "allow-scripts allow-popups allow-same-origin allow-top-navigation allow-modals allow-forms allow-top-navigation-by-user-activation",
41
+ sandbox: "allow-scripts allow-storage-access-by-user-activation allow-presentation allow-pointer-lock allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-downloads allow-top-navigation allow-modals allow-forms allow-top-navigation-by-user-activation",
42
42
  referrerPolicy: "no-referrer-when-downgrade",
43
43
  frameborder: "0",
44
44
  style: { border: "none", outline: "none" },
45
- class: v(g(c).b()),
46
- src: i.frameSrc,
45
+ class: v(g(m).b()),
46
+ src: l.frameSrc,
47
47
  onLoad: r,
48
- onError: f
49
- }, null, 42, b));
48
+ onError: p
49
+ }, null, 42, h));
50
50
  }
51
51
  });
52
52
  export {
@@ -6,6 +6,9 @@ export declare const VftMdContainer: import("vft/es/utils").SFCWithInstall<{
6
6
  scrollDom: {
7
7
  type: import("vue").PropType<string>;
8
8
  };
9
+ showComment: {
10
+ type: import("vue").PropType<boolean>;
11
+ };
9
12
  }>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
10
13
  P: {};
11
14
  B: {};
@@ -20,6 +23,9 @@ export declare const VftMdContainer: import("vft/es/utils").SFCWithInstall<{
20
23
  scrollDom: {
21
24
  type: import("vue").PropType<string>;
22
25
  };
26
+ showComment: {
27
+ type: import("vue").PropType<boolean>;
28
+ };
23
29
  }>> & Readonly<{}>, {}, {}, {}, {}, {}>;
24
30
  __isFragment?: never;
25
31
  __isTeleport?: never;
@@ -31,6 +37,9 @@ export declare const VftMdContainer: import("vft/es/utils").SFCWithInstall<{
31
37
  scrollDom: {
32
38
  type: import("vue").PropType<string>;
33
39
  };
40
+ showComment: {
41
+ type: import("vue").PropType<boolean>;
42
+ };
34
43
  }>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
35
44
  $slots: {
36
45
  default?(_: {}): any;
@@ -3,6 +3,8 @@ interface Props {
3
3
  tocList?: string;
4
4
  /** 滚动 dom 元素 */
5
5
  scrollDom?: string;
6
+ /** 展示评论 */
7
+ showComment?: boolean;
6
8
  }
7
9
  declare function __VLS_template(): {
8
10
  default?(_: {}): any;
@@ -1,90 +1,91 @@
1
- import { defineComponent as T, getCurrentInstance as N, ref as $, computed as y, onMounted as P, nextTick as q, onDeactivated as z, onBeforeMount as A, createElementBlock as f, openBlock as s, normalizeClass as c, unref as e, createBlock as C, createCommentVNode as x, createElementVNode as i, createVNode as m, toDisplayString as k, Fragment as I, renderList as B, withCtx as F, createTextVNode as H, renderSlot as J } from "vue";
1
+ import { defineComponent as S, getCurrentInstance as $, ref as N, computed as x, onMounted as A, nextTick as P, onDeactivated as q, onBeforeMount as z, createElementBlock as u, openBlock as r, normalizeClass as c, unref as e, createBlock as f, createCommentVNode as p, createElementVNode as l, toDisplayString as k, createVNode as g, Fragment as B, renderList as I, withCtx as O, createTextVNode as F, renderSlot as H } from "vue";
2
2
  import { VftIcon as b } from "../icon/index.js";
3
- import { VftIconText as O } from "../icon-text/index.js";
3
+ import { VftIconText as J } from "../icon-text/index.js";
4
4
  import { VftMdComment as j } from "../md-comment/index.js";
5
5
  import { VftSideMenu as U } from "../side-menu/index.js";
6
6
  import { VftTag as Y } from "../tag/index.js";
7
7
  import "@vueuse/core";
8
- import { handleScrollPosition as G, jumpElement as S, getRandomElementForArr as K, isClient as Q } from "@vft/utils";
8
+ import { handleScrollPosition as G, getAdaptiveOffset as K, jumpElement as D, getRandomElementForArr as Q, isClient as W } from "@vft/utils";
9
9
  import "../config-provider/hooks/use-global-config.js";
10
- import { primaryColor as W } from "../../utils/ns-cover.js";
11
- import { debounce as X } from "lodash-es";
10
+ import { primaryColor as X } from "../../utils/ns-cover.js";
11
+ import { debounce as Z } from "lodash-es";
12
12
  import "../form/index.js";
13
- import { useNamespace as Z } from "../../hooks/use-namespace/index.js";
13
+ import { useNamespace as ee } from "../../hooks/use-namespace/index.js";
14
14
  import "../../hooks/use-model-toggle/index.js";
15
15
  import "@popperjs/core";
16
16
  import "../../hooks/use-z-index/index.js";
17
- import { useRouterHelper as ee } from "@vft/router";
18
- import { useEventListener as te } from "@vft/use";
19
- import { usePhotoSwipe as oe } from "@vft/use/photoswipe";
20
- import { formatToDateTime as ne, getDayTimestamp as ie } from "@vft/utils/date";
17
+ import { useRouterHelper as te } from "@vft/router";
18
+ import { useEventListener as oe } from "@vft/use";
19
+ import { usePhotoSwipe as ne } from "@vft/use/photoswipe";
20
+ import { formatToDateTime as ie, getDayTimestamp as le } from "@vft/utils/date";
21
21
  import { useCopyCode as ae } from "./use/useCopyCode.js";
22
- import { COMP_TYPE as le } from "./utils.js";
23
- const re = { class: "info-container" }, se = {
22
+ import { COMP_TYPE as se } from "./utils.js";
23
+ const re = { class: "info-container" }, ce = {
24
24
  key: 0,
25
25
  class: "left"
26
- }, ce = { class: "infos" }, me = {
26
+ }, me = { class: "infos" }, de = {
27
27
  class: "reading",
28
28
  title: "阅读量"
29
- }, ue = ["data-path"], de = T({
29
+ }, ue = ["data-path"], fe = S({
30
30
  name: "vft-md-container"
31
- }), qe = /* @__PURE__ */ T({
32
- ...de,
31
+ }), qe = /* @__PURE__ */ S({
32
+ ...fe,
33
33
  props: {
34
34
  tocList: {},
35
- scrollDom: { default: ".layout-content" }
35
+ scrollDom: { default: ".layout-content" },
36
+ showComment: { type: Boolean, default: !0 }
36
37
  },
37
- setup(r) {
38
- const l = Z("md-container"), _ = N(), u = $(), d = y(() => r.tocList && r.tocList !== "undefined" ? JSON.parse(r.tocList) : ""), { initPhotoSwipe: D } = oe(`.${l.e("content")} img`);
39
- D(), ae();
40
- const p = _.appContext.config.globalProperties.$router, a = p.currentRoute.value, L = W(), V = Q ? location.pathname : "", { go: w } = ee(p);
38
+ setup(a) {
39
+ const s = ee("md-container"), T = $(), m = N(), d = x(() => a.tocList && a.tocList !== "undefined" ? JSON.parse(a.tocList) : ""), { initPhotoSwipe: w } = ne(`.${s.e("content")} img`);
40
+ w(), ae();
41
+ const h = T.appContext.config.globalProperties.$router, n = h.currentRoute.value, L = X(), V = W ? location.pathname : "", { go: _ } = te(h);
41
42
  function E(o) {
42
- w(`/?classify=${o}`);
43
+ _(`/?classify=${o}`);
43
44
  }
44
- const M = y(() => a.meta.category?.includes("api")), g = X(
45
+ const M = x(() => n.meta.category?.includes("api")), v = Z(
45
46
  () => G({
46
- scrollDom: ".layout-content",
47
+ scrollDom: a.scrollDom,
47
48
  contentDom: ".header-anchor",
48
49
  selectAttrName: "href",
49
- offset: 130,
50
+ offset: K(210, 1920, 1500, 1920),
50
51
  callback: (o) => {
51
- u.value?.menuRef && (u.value.menuRef.activeIndex = o.slice(1));
52
+ m.value?.menuRef && (m.value.menuRef.activeIndex = o.slice(1));
52
53
  }
53
54
  }),
54
55
  100
55
- ), h = (o) => {
56
- S(`#${o.index}`, r.scrollDom, 120);
57
- }, v = () => {
58
- const o = document.querySelector(r.scrollDom);
59
- o && o.removeEventListener("scroll", g);
56
+ ), y = (o) => {
57
+ D(`[id="${o.index}"]`, a.scrollDom, 120);
58
+ }, C = () => {
59
+ const o = document.querySelector(a.scrollDom);
60
+ o && o.removeEventListener("scroll", v);
60
61
  };
61
- return P(() => {
62
- q(() => {
62
+ return A(() => {
63
+ P(() => {
63
64
  setTimeout(() => {
64
- S(encodeURI(a.hash));
65
+ n.hash && D(`[id="${encodeURI(n.hash).slice(1)}"]`);
65
66
  }), setTimeout(() => {
66
67
  const t = document.querySelector(".layout-content");
67
- t && t.addEventListener("scroll", g);
68
+ t && t.addEventListener("scroll", v);
68
69
  }, 1500);
69
- const o = document.querySelectorAll(".item.expand"), n = document.querySelectorAll(
70
+ const o = document.querySelectorAll(".item.expand"), i = document.querySelectorAll(
70
71
  "div.language-vue"
71
72
  );
72
73
  for (let t = 0; t < o.length; t++)
73
- te(o[t], "click", () => {
74
- n[t].offsetHeight === 0 ? (n[t].style.height = "auto", n[t].style.visibility = "visible") : (n[t].style.height = "0px", n[t].style.visibility = "hidden");
74
+ oe(o[t], "click", () => {
75
+ i[t].offsetHeight === 0 ? (i[t].style.height = "auto", i[t].style.visibility = "visible") : (i[t].style.height = "0px", i[t].style.visibility = "hidden");
75
76
  });
76
77
  });
78
+ }), q(() => {
79
+ C();
77
80
  }), z(() => {
78
- v();
79
- }), A(() => {
80
- v();
81
- }), (o, n) => (s(), f("div", {
82
- class: c([e(l).b(), e(l).is("api", M.value)])
81
+ C();
82
+ }), (o, i) => (r(), u("div", {
83
+ class: c([e(s).b(), e(s).is("api", M.value)])
83
84
  }, [
84
- d.value?.length ? (s(), C(e(U), {
85
+ d.value?.length ? (r(), f(e(U), {
85
86
  key: 0,
86
87
  ref_key: "sideMenuRef",
87
- ref: u,
88
+ ref: m,
88
89
  "default-active": d.value[0].slug,
89
90
  class: "toc-side-menu",
90
91
  menus: d.value,
@@ -95,53 +96,53 @@ const re = { class: "info-container" }, se = {
95
96
  "attr-mapping": {
96
97
  index: "slug"
97
98
  },
98
- onSelect: h,
99
- onSubMenuClick: h
100
- }, null, 8, ["default-active", "menus"])) : x("", !0),
101
- i("div", {
102
- class: c(e(l).e("header"))
99
+ onSelect: y,
100
+ onSubMenuClick: y
101
+ }, null, 8, ["default-active", "menus"])) : p("", !0),
102
+ l("div", {
103
+ class: c(e(s).e("header"))
103
104
  }, [
104
- i("h1", {
105
- class: c(e(l).e("title"))
106
- }, k(e(a).meta?.title), 3),
107
- i("div", re, [
108
- e(a).meta?.category?.length ? (s(), f("div", se, [
109
- m(e(b), {
105
+ l("h1", {
106
+ class: c(e(s).e("title"))
107
+ }, k(e(n).meta?.title), 3),
108
+ l("div", re, [
109
+ e(n).meta?.category?.length ? (r(), u("div", ce, [
110
+ g(e(b), {
110
111
  size: 14,
111
112
  color: e(L),
112
113
  icon: "icon-category"
113
114
  }, null, 8, ["color"]),
114
- (s(!0), f(I, null, B(e(a).meta?.category, (t, R) => (s(), C(e(Y), {
115
+ (r(!0), u(B, null, I(e(n).meta?.category, (t, R) => (r(), f(e(Y), {
115
116
  size: "small",
116
117
  class: "tag",
117
- type: e(K)(e(le), 1)[0],
118
+ type: e(Q)(e(se), 1)[0],
118
119
  key: R,
119
- onClick: (fe) => E(t)
120
+ onClick: (pe) => E(t)
120
121
  }, {
121
- default: F(() => [
122
- H(k(t), 1)
122
+ default: O(() => [
123
+ F(k(t), 1)
123
124
  ]),
124
125
  _: 2
125
126
  }, 1032, ["type", "onClick"]))), 128))
126
- ])) : x("", !0),
127
- i("div", ce, [
128
- m(e(O), {
127
+ ])) : p("", !0),
128
+ l("div", me, [
129
+ g(e(J), {
129
130
  title: "发布时间",
130
131
  icon: "icon-date",
131
132
  size: 12,
132
133
  class: "mr-10px",
133
134
  distance: 5,
134
- text: e(ne)(
135
- (e(a).meta?.date ? new Date(e(a).meta.date).getTime() : (/* @__PURE__ */ new Date()).getTime()) - e(ie)()
135
+ text: e(ie)(
136
+ (e(n).meta?.date ? new Date(e(n).meta.date).getTime() : (/* @__PURE__ */ new Date()).getTime()) - e(le)()
136
137
  )
137
138
  }, null, 8, ["text"]),
138
- i("div", me, [
139
- m(e(b), {
139
+ l("div", de, [
140
+ g(e(b), {
140
141
  icon: "icon-reading",
141
142
  size: 14,
142
143
  class: "mr-5px"
143
144
  }),
144
- i("div", {
145
+ l("div", {
145
146
  class: "waline-pageview-count lh-1",
146
147
  "data-path": e(V)
147
148
  }, "0", 8, ue)
@@ -149,13 +150,13 @@ const re = { class: "info-container" }, se = {
149
150
  ])
150
151
  ])
151
152
  ], 2),
152
- i("div", {
153
- class: c(e(l).e("content"))
153
+ l("div", {
154
+ class: c(e(s).e("content"))
154
155
  }, [
155
- J(o.$slots, "default")
156
+ H(o.$slots, "default")
156
157
  ], 2),
157
- m(e(j)),
158
- n[0] || (n[0] = i("ins", {
158
+ a.showComment ? (r(), f(e(j), { key: 1 })) : p("", !0),
159
+ i[0] || (i[0] = l("ins", {
159
160
  class: "adsbygoogle",
160
161
  style: { display: "block", "text-align": "center" },
161
162
  "data-ad-layout": "in-article",
@@ -32,7 +32,7 @@ const k = ({ title: t, level: e, slug: l }) => o(
32
32
  ])
33
33
  ) : null;
34
34
  function y(t, e) {
35
- t.preventDefault(), h("#" + e);
35
+ t.preventDefault(), h(`[id="${e}"]`);
36
36
  }
37
37
  const A = v({
38
38
  props: {
@@ -68,15 +68,15 @@ const A = v({
68
68
  `#toc a.toc-link[href$="${n}"]`
69
69
  );
70
70
  if (!p) return;
71
- const { top: i, height: m } = e.value.getBoundingClientRect(), { top: s, height: d } = p.getBoundingClientRect();
72
- s < i ? u(e.value.scrollTop + s - i) : s + d > i + m && u(
73
- e.value.scrollTop + s + d - i - m
71
+ const { top: i, height: d } = e.value.getBoundingClientRect(), { top: s, height: m } = p.getBoundingClientRect();
72
+ s < i ? u(e.value.scrollTop + s - i) : s + m > i + d && u(
73
+ e.value.scrollTop + s + m - i - d
74
74
  );
75
75
  }
76
76
  }
77
77
  );
78
78
  }), () => {
79
- const n = t.items.length ? a(t.items, t.headerDepth, r.value) : a([], t.headerDepth, r.value);
79
+ const n = t.items.length ? a(t.items, t.headerDepth, r.value) || [] : a([], t.headerDepth, r.value) || null;
80
80
  return n ? o("div", { class: "toc-place-holder" }, [
81
81
  o("aside", { id: "toc" }, [
82
82
  o("div", { class: "toc-header" }, ["此页内容"]),
@@ -2,14 +2,14 @@ import "@vueuse/core";
2
2
  import { isNumber as m, isClient as p } from "@vft/utils";
3
3
  import { debugWarn as l } from "../../utils/error.js";
4
4
  import "../../components/config-provider/hooks/use-global-config.js";
5
- import { ref as v, getCurrentInstance as i, inject as e, computed as c, unref as Z } from "vue";
5
+ import { getCurrentInstance as i, inject as e, computed as c, unref as v, ref as Z } from "vue";
6
6
  import "lodash-es";
7
7
  import "../../components/form/index.js";
8
8
  const s = {
9
9
  current: 0
10
- }, u = v(0), f = 2e3, d = Symbol("vftZIndexContextKey"), y = Symbol("zIndexContextKey"), K = (I) => {
10
+ }, u = Z(0), f = 2e3, d = Symbol("vftZIndexContextKey"), y = Symbol("zIndexContextKey"), K = (I) => {
11
11
  const n = i() ? e(d, s) : s, x = I || (i() ? e(y, void 0) : void 0), t = c(() => {
12
- const r = Z(x);
12
+ const r = v(x);
13
13
  return m(r) ? r : f;
14
14
  }), o = c(() => t.value + u.value), a = () => (n.current++, u.value = n.current, o.value);
15
15
  return !p && !e(d) && l(
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  "name": "vft",
3
- "version": "0.0.476",
3
+ "version": "0.0.478",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "es/index.js",
@@ -1,4 +1,4 @@
1
- const o = "0.0.476";
1
+ const o = "0.0.478";
2
2
  export {
3
3
  o as version
4
4
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("../clamp-tooltip/index.cjs"),s=require("../icon/index.cjs");require("@vueuse/core");const v=require("@vft/utils"),d=require("../../utils/helper.cjs"),C=require("../../utils/ns-cover.cjs");require("lodash-es");require("../form/index.cjs");const B=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const x={key:2},k=e.defineComponent({name:"vft-icon-text"}),q=e.defineComponent({...k,props:{text:{},icon:{},color:{},hoverColor:{},disableIconHover:{type:Boolean},distance:{default:3},reverse:{type:Boolean},size:{},direction:{default:"row"},pointer:{type:Boolean},adjustOrigin:{type:Boolean,default:!0},maxLines:{},showTooltip:{type:Boolean},clampTooltipCfg:{},useClamp:{type:Boolean}},setup(o){const c=B.useNamespace("icon-text"),r=e.computed(()=>o.hoverColor||o.color),n=e.computed(()=>v.singleAttrToObj(o.icon,"icon",{size:o.size,color:o.color})),a=e.computed(()=>o.direction==="col"),u=e.computed(()=>{const t=d.addUnit(o.distance);return a.value?o.reverse?{marginTop:t}:{marginBottom:t}:o.reverse?{marginLeft:t}:{marginRight:t}}),l=e.computed(()=>v.removeUnit(o.size)),i=e.computed(()=>l.value<12),m=e.computed(()=>l.value&&i.value?{transform:`scale(${l.value/12})`}:{}),f=e.computed(()=>{const t=C.generateCssVars({cursor:o.pointer?"pointer":void 0,color:o.color,"hover-color":o.hoverColor?r.value:void 0,fontSize:i.value?"12px":d.addUnit(o.size)},"icon-text");return{...i.value&&o.adjustOrigin?{transformOrigin:"left top"}:{},...t,...m.value}}),y=e.computed(()=>({text:o.text,maxLines:o.maxLines,showTooltip:o.showTooltip,...o.clampTooltipCfg}));return(t,g)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass([e.unref(c).b(),e.unref(c).is("col",a.value),{"disable-icon-hover":o.disableIconHover}]),style:e.normalizeStyle(f.value)},[!o.reverse&&n.value?.icon?(e.openBlock(),e.createBlock(e.unref(s.VftIcon),e.mergeProps({key:0},n.value,{"hover-color":o.hoverColor&&!o.disableIconHover?r.value:void 0,style:u.value}),null,16,["hover-color","style"])):e.createCommentVNode("",!0),o.useClamp?(e.openBlock(),e.createBlock(e.unref(h.VftClampTooltip),e.normalizeProps(e.mergeProps({key:1},y.value)),null,16)):(e.openBlock(),e.createElementBlock("span",x,e.toDisplayString(o.text),1)),o.reverse&&n.value?.icon?(e.openBlock(),e.createBlock(e.unref(s.VftIcon),e.mergeProps({key:3},n.value,{style:u.value,"hover-color":o.hoverColor&&!o.disableIconHover?r.value:void 0}),null,16,["style","hover-color"])):e.createCommentVNode("",!0)],6))}});exports.default=q;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("../clamp-tooltip/index.cjs"),s=require("../icon/index.cjs");require("@vueuse/core");const v=require("@vft/utils"),d=require("../../utils/helper.cjs"),C=require("../../utils/ns-cover.cjs");require("lodash-es");require("../form/index.cjs");const B=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const k={key:2},x=e.defineComponent({name:"vft-icon-text"}),q=e.defineComponent({...x,props:{text:{},icon:{},color:{},hoverColor:{},disableIconHover:{type:Boolean},distance:{default:3},reverse:{type:Boolean},size:{},direction:{default:"row"},pointer:{type:Boolean},adjustOrigin:{type:Boolean,default:!0},maxLines:{},showTooltip:{type:Boolean},clampTooltipCfg:{},useClamp:{type:Boolean}},setup(o){const i=B.useNamespace("icon-text"),r=e.computed(()=>o.hoverColor||o.color),n=e.computed(()=>v.singleAttrToObj(o.icon,"icon",{size:o.size,color:o.color})),c=e.computed(()=>o.direction==="col"),a=e.computed(()=>{const t=d.addUnit(o.distance);return c.value?o.reverse?{marginTop:t}:{marginBottom:t}:o.reverse?{marginLeft:t}:{marginRight:t}}),l=e.computed(()=>v.removeUnit(o.size)),u=e.computed(()=>l.value<12),m=e.computed(()=>l.value&&u.value?{transform:`scale(${l.value/12})`}:{}),f=e.computed(()=>{const t=C.generateCssVars({cursor:o.pointer?"pointer":void 0,color:o.color,"hover-color":o.hoverColor?r.value:void 0,fontSize:d.addUnit(o.size)},"icon-text");return{...u.value&&o.adjustOrigin?{transformOrigin:"left top"}:{},...t,...m.value}}),y=e.computed(()=>({text:o.text,maxLines:o.maxLines,showTooltip:o.showTooltip,...o.clampTooltipCfg}));return(t,g)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass([e.unref(i).b(),e.unref(i).is("col",c.value),{"disable-icon-hover":o.disableIconHover}]),style:e.normalizeStyle(f.value)},[!o.reverse&&n.value?.icon?(e.openBlock(),e.createBlock(e.unref(s.VftIcon),e.mergeProps({key:0},n.value,{"hover-color":o.hoverColor&&!o.disableIconHover?r.value:void 0,style:a.value}),null,16,["hover-color","style"])):e.createCommentVNode("",!0),o.useClamp?(e.openBlock(),e.createBlock(e.unref(h.VftClampTooltip),e.normalizeProps(e.mergeProps({key:1},y.value)),null,16)):(e.openBlock(),e.createElementBlock("span",k,e.toDisplayString(o.text),1)),o.reverse&&n.value?.icon?(e.openBlock(),e.createBlock(e.unref(s.VftIcon),e.mergeProps({key:3},n.value,{style:a.value,"hover-color":o.hoverColor&&!o.disableIconHover?r.value:void 0}),null,16,["style","hover-color"])):e.createCommentVNode("",!0)],6))}});exports.default=q;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("@vueuse/core");require("@vft/utils");require("../config-provider/hooks/use-global-config.cjs");require("lodash-es");require("../form/index.cjs");const d=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const m=["src"],p=e.defineComponent({name:"vft-iframe-page"}),_=e.defineComponent({...p,props:{frameSrc:{}},emits:["loaded"],setup(a,{expose:t,emit:i}){const s=i,l=d.useNamespace("iframe-page"),r=e.ref(),o=e.ref(!0),n=()=>{e.nextTick(()=>{o.value=!1,s("loaded")})},c=()=>{n()},u=()=>{if(!r.value)return;r.value?.contentDocument?.readyState==="complete"&&setTimeout(()=>{n()},1e3)};return e.onMounted(()=>{o.value=!0,e.nextTick(()=>{u()})}),t({isLoading:o}),(f,v)=>(e.openBlock(),e.createElementBlock("iframe",{ref_key:"iframeRef",ref:r,sandbox:"allow-scripts allow-popups allow-same-origin allow-top-navigation allow-modals allow-forms allow-top-navigation-by-user-activation",referrerPolicy:"no-referrer-when-downgrade",frameborder:"0",style:{border:"none",outline:"none"},class:e.normalizeClass(e.unref(l).b()),src:a.frameSrc,onLoad:n,onError:c},null,42,m))}});exports.default=_;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("@vueuse/core");require("@vft/utils");require("../config-provider/hooks/use-global-config.cjs");require("lodash-es");require("../form/index.cjs");const f=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const m=["src"],p=e.defineComponent({name:"vft-iframe-page"}),w=e.defineComponent({...p,props:{frameSrc:{}},emits:["loaded"],setup(n,{expose:t,emit:l}){const s=l,i=f.useNamespace("iframe-page"),o=e.ref(),r=e.ref(!0),a=()=>{e.nextTick(()=>{r.value=!1,s("loaded")})},c=()=>{a()},u=()=>{if(!o.value)return;o.value?.contentDocument?.readyState==="complete"&&setTimeout(()=>{a()},1e3)};return e.onMounted(()=>{r.value=!0,e.nextTick(()=>{u()})}),t({isLoading:r}),(d,_)=>(e.openBlock(),e.createElementBlock("iframe",{ref_key:"iframeRef",ref:o,sandbox:"allow-scripts allow-storage-access-by-user-activation allow-presentation allow-pointer-lock allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-downloads allow-top-navigation allow-modals allow-forms allow-top-navigation-by-user-activation",referrerPolicy:"no-referrer-when-downgrade",frameborder:"0",style:{border:"none",outline:"none"},class:e.normalizeClass(e.unref(i).b()),src:n.frameSrc,onLoad:a,onError:c},null,42,m))}});exports.default=w;
@@ -6,6 +6,9 @@ export declare const VftMdContainer: import("vft/es/utils").SFCWithInstall<{
6
6
  scrollDom: {
7
7
  type: import("vue").PropType<string>;
8
8
  };
9
+ showComment: {
10
+ type: import("vue").PropType<boolean>;
11
+ };
9
12
  }>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
10
13
  P: {};
11
14
  B: {};
@@ -20,6 +23,9 @@ export declare const VftMdContainer: import("vft/es/utils").SFCWithInstall<{
20
23
  scrollDom: {
21
24
  type: import("vue").PropType<string>;
22
25
  };
26
+ showComment: {
27
+ type: import("vue").PropType<boolean>;
28
+ };
23
29
  }>> & Readonly<{}>, {}, {}, {}, {}, {}>;
24
30
  __isFragment?: never;
25
31
  __isTeleport?: never;
@@ -31,6 +37,9 @@ export declare const VftMdContainer: import("vft/es/utils").SFCWithInstall<{
31
37
  scrollDom: {
32
38
  type: import("vue").PropType<string>;
33
39
  };
40
+ showComment: {
41
+ type: import("vue").PropType<boolean>;
42
+ };
34
43
  }>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
35
44
  $slots: {
36
45
  default?(_: {}): any;
@@ -3,6 +3,8 @@ interface Props {
3
3
  tocList?: string;
4
4
  /** 滚动 dom 元素 */
5
5
  scrollDom?: string;
6
+ /** 展示评论 */
7
+ showComment?: boolean;
6
8
  }
7
9
  declare function __VLS_template(): {
8
10
  default?(_: {}): any;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),p=require("../icon/index.cjs"),E=require("../icon-text/index.cjs"),N=require("../md-comment/index.cjs"),S=require("../side-menu/index.cjs"),b=require("../tag/index.cjs");require("@vueuse/core");const s=require("@vft/utils");require("../config-provider/hooks/use-global-config.cjs");const _=require("../../utils/ns-cover.cjs"),T=require("lodash-es");require("../form/index.cjs");const D=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const $=require("@vft/router"),B=require("@vft/use"),L=require("@vft/use/photoswipe"),g=require("@vft/utils/date"),M=require("./use/useCopyCode.cjs"),w=require("./utils.cjs"),z={class:"info-container"},R={key:0,class:"left"},P={class:"infos"},I={class:"reading",title:"阅读量"},A=["data-path"],j=e.defineComponent({name:"vft-md-container"}),O=e.defineComponent({...j,props:{tocList:{},scrollDom:{default:".layout-content"}},setup(i){const l=D.useNamespace("md-container"),v=e.getCurrentInstance(),a=e.ref(),c=e.computed(()=>i.tocList&&i.tocList!=="undefined"?JSON.parse(i.tocList):""),{initPhotoSwipe:y}=L.usePhotoSwipe(`.${l.e("content")} img`);y(),M.useCopyCode();const u=v.appContext.config.globalProperties.$router,r=u.currentRoute.value,h=_.primaryColor(),C=s.isClient?location.pathname:"",{go:q}=$.useRouterHelper(u);function k(n){q(`/?classify=${n}`)}const x=e.computed(()=>r.meta.category?.includes("api")),d=T.debounce(()=>s.handleScrollPosition({scrollDom:".layout-content",contentDom:".header-anchor",selectAttrName:"href",offset:130,callback:n=>{a.value?.menuRef&&(a.value.menuRef.activeIndex=n.slice(1))}}),100),m=n=>{s.jumpElement(`#${n.index}`,i.scrollDom,120)},f=()=>{const n=document.querySelector(i.scrollDom);n&&n.removeEventListener("scroll",d)};return e.onMounted(()=>{e.nextTick(()=>{setTimeout(()=>{s.jumpElement(encodeURI(r.hash))}),setTimeout(()=>{const t=document.querySelector(".layout-content");t&&t.addEventListener("scroll",d)},1500);const n=document.querySelectorAll(".item.expand"),o=document.querySelectorAll("div.language-vue");for(let t=0;t<n.length;t++)B.useEventListener(n[t],"click",()=>{o[t].offsetHeight===0?(o[t].style.height="auto",o[t].style.visibility="visible"):(o[t].style.height="0px",o[t].style.visibility="hidden")})})}),e.onDeactivated(()=>{f()}),e.onBeforeMount(()=>{f()}),(n,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(l).b(),e.unref(l).is("api",x.value)])},[c.value?.length?(e.openBlock(),e.createBlock(e.unref(S.VftSideMenu),{key:0,ref_key:"sideMenuRef",ref:a,"default-active":c.value[0].slug,class:"toc-side-menu",menus:c.value,"is-fixed-left":!1,"default-openeds-level":"","unique-opened":!1,"disable-sub-menu-action":"","attr-mapping":{index:"slug"},onSelect:m,onSubMenuClick:m},null,8,["default-active","menus"])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(l).e("header"))},[e.createElementVNode("h1",{class:e.normalizeClass(e.unref(l).e("title"))},e.toDisplayString(e.unref(r).meta?.title),3),e.createElementVNode("div",z,[e.unref(r).meta?.category?.length?(e.openBlock(),e.createElementBlock("div",R,[e.createVNode(e.unref(p.VftIcon),{size:14,color:e.unref(h),icon:"icon-category"},null,8,["color"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r).meta?.category,(t,V)=>(e.openBlock(),e.createBlock(e.unref(b.VftTag),{size:"small",class:"tag",type:e.unref(s.getRandomElementForArr)(e.unref(w.COMP_TYPE),1)[0],key:V,onClick:F=>k(t)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t),1)]),_:2},1032,["type","onClick"]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",P,[e.createVNode(e.unref(E.VftIconText),{title:"发布时间",icon:"icon-date",size:12,class:"mr-10px",distance:5,text:e.unref(g.formatToDateTime)((e.unref(r).meta?.date?new Date(e.unref(r).meta.date).getTime():new Date().getTime())-e.unref(g.getDayTimestamp)())},null,8,["text"]),e.createElementVNode("div",I,[e.createVNode(e.unref(p.VftIcon),{icon:"icon-reading",size:14,class:"mr-5px"}),e.createElementVNode("div",{class:"waline-pageview-count lh-1","data-path":e.unref(C)},"0",8,A)])])])],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(l).e("content"))},[e.renderSlot(n.$slots,"default")],2),e.createVNode(e.unref(N.VftMdComment)),o[0]||(o[0]=e.createElementVNode("ins",{class:"adsbygoogle",style:{display:"block","text-align":"center"},"data-ad-layout":"in-article","data-ad-format":"fluid","data-ad-client":"ca-pub-4046301015031382","data-ad-slot":"6525439078"},null,-1))],2))}});exports.default=O;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),p=require("../icon/index.cjs"),E=require("../icon-text/index.cjs"),N=require("../md-comment/index.cjs"),S=require("../side-menu/index.cjs"),b=require("../tag/index.cjs");require("@vueuse/core");const s=require("@vft/utils");require("../config-provider/hooks/use-global-config.cjs");const D=require("../../utils/ns-cover.cjs"),T=require("lodash-es");require("../form/index.cjs");const B=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const $=require("@vft/router"),_=require("@vft/use"),w=require("@vft/use/photoswipe"),g=require("@vft/utils/date"),L=require("./use/useCopyCode.cjs"),M=require("./utils.cjs"),z={class:"info-container"},R={key:0,class:"left"},P={class:"infos"},A={class:"reading",title:"阅读量"},I=["data-path"],O=e.defineComponent({name:"vft-md-container"}),j=e.defineComponent({...O,props:{tocList:{},scrollDom:{default:".layout-content"},showComment:{type:Boolean,default:!0}},setup(l){const i=B.useNamespace("md-container"),h=e.getCurrentInstance(),a=e.ref(),c=e.computed(()=>l.tocList&&l.tocList!=="undefined"?JSON.parse(l.tocList):""),{initPhotoSwipe:v}=w.usePhotoSwipe(`.${i.e("content")} img`);v(),L.useCopyCode();const u=h.appContext.config.globalProperties.$router,o=u.currentRoute.value,y=D.primaryColor(),C=s.isClient?location.pathname:"",{go:q}=$.useRouterHelper(u);function k(n){q(`/?classify=${n}`)}const x=e.computed(()=>o.meta.category?.includes("api")),d=T.debounce(()=>s.handleScrollPosition({scrollDom:l.scrollDom,contentDom:".header-anchor",selectAttrName:"href",offset:s.getAdaptiveOffset(210,1920,1500,1920),callback:n=>{a.value?.menuRef&&(a.value.menuRef.activeIndex=n.slice(1))}}),100),m=n=>{s.jumpElement(`[id="${n.index}"]`,l.scrollDom,120)},f=()=>{const n=document.querySelector(l.scrollDom);n&&n.removeEventListener("scroll",d)};return e.onMounted(()=>{e.nextTick(()=>{setTimeout(()=>{o.hash&&s.jumpElement(`[id="${encodeURI(o.hash).slice(1)}"]`)}),setTimeout(()=>{const t=document.querySelector(".layout-content");t&&t.addEventListener("scroll",d)},1500);const n=document.querySelectorAll(".item.expand"),r=document.querySelectorAll("div.language-vue");for(let t=0;t<n.length;t++)_.useEventListener(n[t],"click",()=>{r[t].offsetHeight===0?(r[t].style.height="auto",r[t].style.visibility="visible"):(r[t].style.height="0px",r[t].style.visibility="hidden")})})}),e.onDeactivated(()=>{f()}),e.onBeforeMount(()=>{f()}),(n,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(i).b(),e.unref(i).is("api",x.value)])},[c.value?.length?(e.openBlock(),e.createBlock(e.unref(S.VftSideMenu),{key:0,ref_key:"sideMenuRef",ref:a,"default-active":c.value[0].slug,class:"toc-side-menu",menus:c.value,"is-fixed-left":!1,"default-openeds-level":"","unique-opened":!1,"disable-sub-menu-action":"","attr-mapping":{index:"slug"},onSelect:m,onSubMenuClick:m},null,8,["default-active","menus"])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(i).e("header"))},[e.createElementVNode("h1",{class:e.normalizeClass(e.unref(i).e("title"))},e.toDisplayString(e.unref(o).meta?.title),3),e.createElementVNode("div",z,[e.unref(o).meta?.category?.length?(e.openBlock(),e.createElementBlock("div",R,[e.createVNode(e.unref(p.VftIcon),{size:14,color:e.unref(y),icon:"icon-category"},null,8,["color"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o).meta?.category,(t,V)=>(e.openBlock(),e.createBlock(e.unref(b.VftTag),{size:"small",class:"tag",type:e.unref(s.getRandomElementForArr)(e.unref(M.COMP_TYPE),1)[0],key:V,onClick:F=>k(t)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t),1)]),_:2},1032,["type","onClick"]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",P,[e.createVNode(e.unref(E.VftIconText),{title:"发布时间",icon:"icon-date",size:12,class:"mr-10px",distance:5,text:e.unref(g.formatToDateTime)((e.unref(o).meta?.date?new Date(e.unref(o).meta.date).getTime():new Date().getTime())-e.unref(g.getDayTimestamp)())},null,8,["text"]),e.createElementVNode("div",A,[e.createVNode(e.unref(p.VftIcon),{icon:"icon-reading",size:14,class:"mr-5px"}),e.createElementVNode("div",{class:"waline-pageview-count lh-1","data-path":e.unref(C)},"0",8,I)])])])],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(i).e("content"))},[e.renderSlot(n.$slots,"default")],2),l.showComment?(e.openBlock(),e.createBlock(e.unref(N.VftMdComment),{key:1})):e.createCommentVNode("",!0),r[0]||(r[0]=e.createElementVNode("ins",{class:"adsbygoogle",style:{display:"block","text-align":"center"},"data-ad-layout":"in-article","data-ad-format":"fluid","data-ad-client":"ca-pub-4046301015031382","data-ad-slot":"6525439078"},null,-1))],2))}});exports.default=j;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("@vft/utils"),t=require("vue"),m=require("./utils.cjs"),g=({title:o,level:e,slug:l})=>t.h("a",{href:`#${l}`,class:["toc-link",`level${e}`]},o),s=(o,e,l)=>o.length&&e>0?t.h("ul",{class:"toc-list"},o.map(c=>[t.h("li",{class:["toc-item",{active:m.isActiveLink(l,`#${decodeURIComponent(c.slug)}`)}],onClick:r=>f(r,c.slug)},g(c)),s(c.children,e-1,l)])):null;function f(o,e){o.preventDefault(),p.jumpElement("#"+e)}const T=t.defineComponent({props:{items:{type:Array,default:()=>[]},headerDepth:{type:Number,default:2}},setup(o){const e=t.ref(),c=t.getCurrentInstance().appContext.config.globalProperties.$router,r=t.computed(()=>c.currentRoute.value),a=n=>{e.value?.scrollTo({top:n,behavior:"smooth"})};return t.onMounted(()=>{t.watch(()=>r.value.hash,n=>{if(e.value){const h=document.querySelector(`#toc a.toc-link[href$="${n}"]`);if(!h)return;const{top:u,height:d}=e.value.getBoundingClientRect(),{top:i,height:v}=h.getBoundingClientRect();i<u?a(e.value.scrollTop+i-u):i+v>u+d&&a(e.value.scrollTop+i+v-u-d)}})}),()=>{const n=o.items.length?s(o.items,o.headerDepth,r.value):s([],o.headerDepth,r.value);return n?t.h("div",{class:"toc-place-holder"},[t.h("aside",{id:"toc"},[t.h("div",{class:"toc-header"},["此页内容"]),t.h("div",{class:"toc-wrapper",ref:e},[n])])]):null}}});exports.default=T;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("@vft/utils"),t=require("vue"),m=require("./utils.cjs"),g=({title:o,level:e,slug:l})=>t.h("a",{href:`#${l}`,class:["toc-link",`level${e}`]},o),s=(o,e,l)=>o.length&&e>0?t.h("ul",{class:"toc-list"},o.map(c=>[t.h("li",{class:["toc-item",{active:m.isActiveLink(l,`#${decodeURIComponent(c.slug)}`)}],onClick:r=>f(r,c.slug)},g(c)),s(c.children,e-1,l)])):null;function f(o,e){o.preventDefault(),p.jumpElement(`[id="${e}"]`)}const T=t.defineComponent({props:{items:{type:Array,default:()=>[]},headerDepth:{type:Number,default:2}},setup(o){const e=t.ref(),c=t.getCurrentInstance().appContext.config.globalProperties.$router,r=t.computed(()=>c.currentRoute.value),a=n=>{e.value?.scrollTo({top:n,behavior:"smooth"})};return t.onMounted(()=>{t.watch(()=>r.value.hash,n=>{if(e.value){const h=document.querySelector(`#toc a.toc-link[href$="${n}"]`);if(!h)return;const{top:i,height:d}=e.value.getBoundingClientRect(),{top:u,height:v}=h.getBoundingClientRect();u<i?a(e.value.scrollTop+u-i):u+v>i+d&&a(e.value.scrollTop+u+v-i-d)}})}),()=>{const n=o.items.length?s(o.items,o.headerDepth,r.value)||[]:s([],o.headerDepth,r.value)||null;return n?t.h("div",{class:"toc-place-holder"},[t.h("aside",{id:"toc"},[t.h("div",{class:"toc-header"},["此页内容"]),t.h("div",{class:"toc-wrapper",ref:e},[n])])]):null}}});exports.default=T;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.0.476";exports.version=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.0.478";exports.version=e;