vft 0.0.431 → 0.0.433

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.
@@ -3,6 +3,9 @@ export declare const VftMdContainer: import("vft/es/utils").SFCWithInstall<{
3
3
  tocList: {
4
4
  type: import("vue").PropType<string>;
5
5
  };
6
+ scrollDom: {
7
+ type: import("vue").PropType<string>;
8
+ };
6
9
  }>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
7
10
  P: {};
8
11
  B: {};
@@ -14,6 +17,9 @@ export declare const VftMdContainer: import("vft/es/utils").SFCWithInstall<{
14
17
  tocList: {
15
18
  type: import("vue").PropType<string>;
16
19
  };
20
+ scrollDom: {
21
+ type: import("vue").PropType<string>;
22
+ };
17
23
  }>> & Readonly<{}>, {}, {}, {}, {}, {}>;
18
24
  __isFragment?: never;
19
25
  __isTeleport?: never;
@@ -22,6 +28,9 @@ export declare const VftMdContainer: import("vft/es/utils").SFCWithInstall<{
22
28
  tocList: {
23
29
  type: import("vue").PropType<string>;
24
30
  };
31
+ scrollDom: {
32
+ type: import("vue").PropType<string>;
33
+ };
25
34
  }>> & 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 () => {
26
35
  $slots: {
27
36
  default?(_: {}): any;
@@ -1,6 +1,8 @@
1
1
  interface Props {
2
2
  /** 标题目录列表 */
3
3
  tocList?: string;
4
+ /** 滚动 dom 元素 */
5
+ scrollDom?: string;
4
6
  }
5
7
  declare function __VLS_template(): {
6
8
  default?(_: {}): any;
@@ -1,47 +1,48 @@
1
- import { defineComponent as k, getCurrentInstance as N, ref as R, computed as h, onMounted as $, nextTick as A, createElementBlock as u, openBlock as r, normalizeClass as s, unref as e, createBlock as y, createCommentVNode as v, createElementVNode as i, createVNode as c, toDisplayString as C, Fragment as I, renderList as P, withCtx as z, createTextVNode as q, renderSlot as B } from "vue";
2
- import { VftIcon as x } from "../icon/index.js";
3
- import { VftIconText as F } from "../icon-text/index.js";
4
- import { VftMdComment as H } from "../md-comment/index.js";
5
- import { VftSideMenu as J } from "../side-menu/index.js";
6
- import { VftTag as O } from "../tag/index.js";
1
+ import { defineComponent as S, getCurrentInstance as R, ref as $, computed as v, 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 C, createCommentVNode as x, createElementVNode as i, createVNode as m, toDisplayString as _, Fragment as I, renderList as B, withCtx as F, createTextVNode as H, renderSlot as J } from "vue";
2
+ import { VftIcon as k } from "../icon/index.js";
3
+ import { VftIconText as O } from "../icon-text/index.js";
4
+ import { VftMdComment as j } from "../md-comment/index.js";
5
+ import { VftSideMenu as U } from "../side-menu/index.js";
6
+ import { VftTag as Y } from "../tag/index.js";
7
7
  import "@vueuse/core";
8
- import { handleScrollPosition as j, jumpElement as _, getRandomElementForArr as U, isClient as Y } from "@vft/utils";
8
+ import { handleScrollPosition as G, jumpElement as b, getRandomElementForArr as K, isClient as Q } from "@vft/utils";
9
9
  import "../config-provider/hooks/use-global-config.js";
10
- import { primaryColor as G } from "../../utils/ns-cover.js";
11
- import { debounce as K } from "lodash-es";
10
+ import { primaryColor as W } from "../../utils/ns-cover.js";
11
+ import { debounce as X } from "lodash-es";
12
12
  import "../form/index.js";
13
- import { useNamespace as Q } from "../../hooks/use-namespace/index.js";
13
+ import { useNamespace as Z } 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 W } from "@vft/router";
18
- import { useEventListener as X } from "@vft/use";
19
- import { usePhotoSwipe as Z } from "@vft/use/photoswipe";
20
- import { formatToDateTime as ee, getDayTimestamp as te } from "@vft/utils/date";
21
- import { useCopyCode as oe } from "./use/useCopyCode.js";
22
- import { COMP_TYPE as ne } from "./utils.js";
23
- const ie = { class: "info-container" }, ae = {
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";
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 = {
24
24
  key: 0,
25
25
  class: "left"
26
- }, le = { class: "infos" }, re = {
26
+ }, ce = { class: "infos" }, me = {
27
27
  class: "reading",
28
28
  title: "阅读量"
29
- }, se = ["data-path"], ce = k({
29
+ }, de = ["data-path"], ue = S({
30
30
  name: "vft-md-container"
31
- }), Re = /* @__PURE__ */ k({
32
- ...ce,
31
+ }), Pe = /* @__PURE__ */ S({
32
+ ...ue,
33
33
  props: {
34
- tocList: {}
34
+ tocList: {},
35
+ scrollDom: { default: ".layout-content" }
35
36
  },
36
- setup(m) {
37
- const l = Q("md-container"), b = N(), f = R(), d = h(() => m.tocList && m.tocList !== "undefined" ? JSON.parse(m.tocList) : ""), { initPhotoSwipe: T } = Z(`.${l.e("content")} img`);
38
- T(), oe();
39
- const p = b.appContext.config.globalProperties.$router, a = p.currentRoute.value, S = G(), V = Y ? location.pathname : "", { go: D } = W(p);
40
- function w(o) {
41
- D(`/?classify=${o}`);
37
+ setup(s) {
38
+ const l = Z("md-container"), T = R(), f = $(), d = v(() => s.tocList && s.tocList !== "undefined" ? JSON.parse(s.tocList) : ""), { initPhotoSwipe: D } = oe(`.${l.e("content")} img`);
39
+ D(), ae();
40
+ const p = T.appContext.config.globalProperties.$router, a = p.currentRoute.value, L = W(), V = Q ? location.pathname : "", { go: w } = ee(p);
41
+ function E(o) {
42
+ w(`/?classify=${o}`);
42
43
  }
43
- const L = h(() => a.meta.category?.includes("api")), E = K(
44
- () => j({
44
+ const M = v(() => a.meta.category?.includes("api")), g = X(
45
+ () => G({
45
46
  scrollDom: ".layout-content",
46
47
  contentDom: ".header-anchor",
47
48
  selectAttrName: "href",
@@ -53,31 +54,36 @@ const ie = { class: "info-container" }, ae = {
53
54
  }
54
55
  }),
55
56
  100
56
- );
57
- $(() => {
58
- A(() => {
57
+ ), h = (o) => {
58
+ b(`#${o.index}`);
59
+ }, y = () => {
60
+ const o = document.querySelector(s.scrollDom);
61
+ o && o.removeEventListener("scroll", g);
62
+ };
63
+ return A(() => {
64
+ P(() => {
59
65
  setTimeout(() => {
60
- _(encodeURI(a.hash));
66
+ b(encodeURI(a.hash));
61
67
  }), setTimeout(() => {
62
68
  const t = document.querySelector(".layout-content");
63
- t && t.addEventListener("scroll", E);
69
+ t && t.addEventListener("scroll", g);
64
70
  }, 1500);
65
71
  const o = document.querySelectorAll(".item.expand"), n = document.querySelectorAll(
66
72
  "div.language-vue"
67
73
  );
68
74
  for (let t = 0; t < o.length; t++)
69
- X(o[t], "click", () => {
75
+ te(o[t], "click", () => {
70
76
  n[t].offsetHeight === 0 ? (n[t].style.height = "auto", n[t].style.visibility = "visible") : (n[t].style.height = "0px", n[t].style.visibility = "hidden");
71
77
  });
72
78
  });
73
- });
74
- const g = (o) => {
75
- _(`#${o.index}`);
76
- };
77
- return (o, n) => (r(), u("div", {
78
- class: s([e(l).b(), e(l).is("api", L.value)])
79
+ }), q(() => {
80
+ y();
81
+ }), z(() => {
82
+ y();
83
+ }), (o, n) => (r(), u("div", {
84
+ class: c([e(l).b(), e(l).is("api", M.value)])
79
85
  }, [
80
- d.value?.length ? (r(), y(e(J), {
86
+ d.value?.length ? (r(), C(e(U), {
81
87
  key: 0,
82
88
  ref_key: "sideMenuRef",
83
89
  ref: f,
@@ -89,52 +95,50 @@ const ie = { class: "info-container" }, ae = {
89
95
  "unique-opened": !1,
90
96
  "disable-sub-menu-action": "",
91
97
  "attr-mapping": {
92
- index: "slug",
93
- originIndex: "slug",
94
- originChildren: "children"
98
+ index: "slug"
95
99
  },
96
- onSelect: g,
97
- onSubMenuClick: g
98
- }, null, 8, ["default-active", "menus"])) : v("", !0),
100
+ onSelect: h,
101
+ onSubMenuClick: h
102
+ }, null, 8, ["default-active", "menus"])) : x("", !0),
99
103
  i("div", {
100
- class: s(e(l).e("header"))
104
+ class: c(e(l).e("header"))
101
105
  }, [
102
106
  i("h1", {
103
- class: s(e(l).e("title"))
104
- }, C(e(a).meta?.title), 3),
105
- i("div", ie, [
106
- e(a).meta?.category?.length ? (r(), u("div", ae, [
107
- c(e(x), {
107
+ class: c(e(l).e("title"))
108
+ }, _(e(a).meta?.title), 3),
109
+ i("div", re, [
110
+ e(a).meta?.category?.length ? (r(), u("div", se, [
111
+ m(e(k), {
108
112
  size: 14,
109
- color: e(S),
113
+ color: e(L),
110
114
  icon: "icon-category"
111
115
  }, null, 8, ["color"]),
112
- (r(!0), u(I, null, P(e(a).meta?.category, (t, M) => (r(), y(e(O), {
116
+ (r(!0), u(I, null, B(e(a).meta?.category, (t, N) => (r(), C(e(Y), {
113
117
  size: "small",
114
118
  class: "tag",
115
- type: e(U)(e(ne), 1)[0],
116
- key: M,
117
- onClick: (me) => w(t)
119
+ type: e(K)(e(le), 1)[0],
120
+ key: N,
121
+ onClick: (fe) => E(t)
118
122
  }, {
119
- default: z(() => [
120
- q(C(t), 1)
123
+ default: F(() => [
124
+ H(_(t), 1)
121
125
  ]),
122
126
  _: 2
123
127
  }, 1032, ["type", "onClick"]))), 128))
124
- ])) : v("", !0),
125
- i("div", le, [
126
- c(e(F), {
128
+ ])) : x("", !0),
129
+ i("div", ce, [
130
+ m(e(O), {
127
131
  title: "发布时间",
128
132
  icon: "icon-date",
129
133
  size: 12,
130
134
  class: "mr-10px",
131
135
  distance: 5,
132
- text: e(ee)(
133
- (e(a).meta?.date ? new Date(e(a).meta.date).getTime() : (/* @__PURE__ */ new Date()).getTime()) - e(te)()
136
+ text: e(ne)(
137
+ (e(a).meta?.date ? new Date(e(a).meta.date).getTime() : (/* @__PURE__ */ new Date()).getTime()) - e(ie)()
134
138
  )
135
139
  }, null, 8, ["text"]),
136
- i("div", re, [
137
- c(e(x), {
140
+ i("div", me, [
141
+ m(e(k), {
138
142
  icon: "icon-reading",
139
143
  size: 14,
140
144
  class: "mr-5px"
@@ -142,17 +146,17 @@ const ie = { class: "info-container" }, ae = {
142
146
  i("div", {
143
147
  class: "waline-pageview-count lh-1",
144
148
  "data-path": e(V)
145
- }, "0", 8, se)
149
+ }, "0", 8, de)
146
150
  ])
147
151
  ])
148
152
  ])
149
153
  ], 2),
150
154
  i("div", {
151
- class: s(e(l).e("content"))
155
+ class: c(e(l).e("content"))
152
156
  }, [
153
- B(o.$slots, "default")
157
+ J(o.$slots, "default")
154
158
  ], 2),
155
- c(e(H)),
159
+ m(e(j)),
156
160
  n[0] || (n[0] = i("ins", {
157
161
  class: "adsbygoogle",
158
162
  style: { display: "block", "text-align": "center" },
@@ -165,5 +169,5 @@ const ie = { class: "info-container" }, ae = {
165
169
  }
166
170
  });
167
171
  export {
168
- Re as default
172
+ Pe as default
169
173
  };
@@ -1,47 +1,42 @@
1
- import "@vueuse/core";
2
- import "@vft/utils";
3
- import "../config-provider/hooks/use-global-config.js";
4
- import { ref as x, onMounted as v, nextTick as d, unref as r } from "vue";
5
- import "lodash-es";
6
- import "../form/index.js";
7
- import { useDebounceFn as w, useThrottleFn as T } from "@vft/use";
8
- function k(p, c, n) {
9
- const i = x(!1), l = n.props?.dragWidthCfg?.minWidth || 200;
10
- v(() => {
11
- n.props?.dragWidthCfg && d(() => {
12
- w(g, 100)();
1
+ import { useDebounceFn as x, useThrottleFn as v } from "@vft/use";
2
+ import { ref as w, onMounted as T, nextTick as c, unref as r } from "vue";
3
+ function X(l, m, o) {
4
+ const i = w(!1), a = o.props?.dragWidthCfg?.minWidth || 200;
5
+ T(() => {
6
+ o.props?.dragWidthCfg && c(() => {
7
+ x(g, 100)();
13
8
  });
14
9
  });
15
- function f(t) {
16
- const o = r(t);
17
- return o ? Reflect.has(o, "$el") ? r(t)?.$el : r(t) : null;
10
+ function f(e) {
11
+ const n = r(e);
12
+ return n ? Reflect.has(n, "$el") ? r(e)?.$el : r(e) : null;
18
13
  }
19
- function a(t, o, s) {
14
+ function p(e, n, s) {
20
15
  document.onmousemove = function(u) {
21
- let e = t.left + (u.clientX - s);
16
+ let t = e.left + (u.clientX - s);
22
17
  u = u || window.event;
23
- const m = n.props?.dragWidthCfg?.maxWidth || 800, W = r(l);
24
- return e <= W ? void 0 : (e < 0 && (e = 0), e > m && (e = m), t.style.left = e + "px", T(() => {
25
- n.emit("update:width", e + "px");
18
+ const d = o.props?.dragWidthCfg?.maxWidth || 800, W = r(a);
19
+ return t <= W ? void 0 : (t < 0 && (t = 0), t > d && (t = d), e.style.left = t + "px", v(() => {
20
+ o.emit("update:width", t + "px");
26
21
  }, 150)(), !1);
27
22
  };
28
23
  }
29
- function h(t) {
24
+ function h(e) {
30
25
  document.onmouseup = function() {
31
- document.onmousemove = null, document.onmouseup = null, i.value = !0, d(() => {
32
- n.emit("dragWidthEnd"), setTimeout(() => {
26
+ document.onmousemove = null, document.onmouseup = null, i.value = !0, c(() => {
27
+ o.emit("dragWidthEnd"), setTimeout(() => {
33
28
  i.value = !1;
34
- }, 1e3);
35
- }), t.releaseCapture?.();
29
+ }, 100);
30
+ }), e.releaseCapture?.();
36
31
  };
37
32
  }
38
33
  function g() {
39
- const t = f(c);
40
- if (!t) return;
41
- const o = f(p);
42
- o && (t.onmousedown = (s) => {
34
+ const e = f(m);
35
+ if (!e) return;
36
+ const n = f(l);
37
+ n && (e.onmousedown = (s) => {
43
38
  const u = s?.clientX;
44
- return t.left = t.offsetLeft, a(t, o, u), h(t), t.setCapture?.(), !1;
39
+ return e.left = e.offsetLeft, p(e, n, u), h(e), e.setCapture?.(), !1;
45
40
  });
46
41
  }
47
42
  return {
@@ -49,5 +44,5 @@ function k(p, c, n) {
49
44
  };
50
45
  }
51
46
  export {
52
- k as useDragLine
47
+ X as useDragLine
53
48
  };
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  "name": "vft",
3
- "version": "0.0.431",
3
+ "version": "0.0.433",
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.431";
1
+ const o = "0.0.433";
2
2
  export {
3
3
  o as version
4
4
  };
@@ -3,6 +3,9 @@ export declare const VftMdContainer: import("vft/es/utils").SFCWithInstall<{
3
3
  tocList: {
4
4
  type: import("vue").PropType<string>;
5
5
  };
6
+ scrollDom: {
7
+ type: import("vue").PropType<string>;
8
+ };
6
9
  }>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
7
10
  P: {};
8
11
  B: {};
@@ -14,6 +17,9 @@ export declare const VftMdContainer: import("vft/es/utils").SFCWithInstall<{
14
17
  tocList: {
15
18
  type: import("vue").PropType<string>;
16
19
  };
20
+ scrollDom: {
21
+ type: import("vue").PropType<string>;
22
+ };
17
23
  }>> & Readonly<{}>, {}, {}, {}, {}, {}>;
18
24
  __isFragment?: never;
19
25
  __isTeleport?: never;
@@ -22,6 +28,9 @@ export declare const VftMdContainer: import("vft/es/utils").SFCWithInstall<{
22
28
  tocList: {
23
29
  type: import("vue").PropType<string>;
24
30
  };
31
+ scrollDom: {
32
+ type: import("vue").PropType<string>;
33
+ };
25
34
  }>> & 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 () => {
26
35
  $slots: {
27
36
  default?(_: {}): any;
@@ -1,6 +1,8 @@
1
1
  interface Props {
2
2
  /** 标题目录列表 */
3
3
  tocList?: string;
4
+ /** 滚动 dom 元素 */
5
+ scrollDom?: string;
4
6
  }
5
7
  declare function __VLS_template(): {
6
8
  default?(_: {}): any;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),m=require("../icon/index.cjs"),V=require("../icon-text/index.cjs"),_=require("../md-comment/index.cjs"),E=require("../side-menu/index.cjs"),N=require("../tag/index.cjs");require("@vueuse/core");const l=require("@vft/utils");require("../config-provider/hooks/use-global-config.cjs");const b=require("../../utils/ns-cover.cjs"),S=require("lodash-es");require("../form/index.cjs");const T=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"),D=require("@vft/use/photoswipe"),f=require("@vft/utils/date"),w=require("./use/useCopyCode.cjs"),M=require("./utils.cjs"),z={class:"info-container"},L={key:0,class:"left"},I={class:"infos"},P={class:"reading",title:"阅读量"},R=["data-path"],A=e.defineComponent({name:"vft-md-container"}),j=e.defineComponent({...A,props:{tocList:{}},setup(s){const i=T.useNamespace("md-container"),p=e.getCurrentInstance(),c=e.ref(),a=e.computed(()=>s.tocList&&s.tocList!=="undefined"?JSON.parse(s.tocList):""),{initPhotoSwipe:g}=D.usePhotoSwipe(`.${i.e("content")} img`);g(),w.useCopyCode();const u=p.appContext.config.globalProperties.$router,r=u.currentRoute.value,h=b.primaryColor(),y=l.isClient?location.pathname:"",{go:v}=$.useRouterHelper(u);function C(n){v(`/?classify=${n}`)}const q=e.computed(()=>r.meta.category?.includes("api")),x=S.debounce(()=>l.handleScrollPosition({scrollDom:".layout-content",contentDom:".header-anchor",selectAttrName:"href",offset:100,callback:n=>{c.value.menuRef.updateActiveIndex(n.slice(1))}}),100);e.onMounted(()=>{e.nextTick(()=>{setTimeout(()=>{l.jumpElement(encodeURI(r.hash))}),setTimeout(()=>{const t=document.querySelector(".layout-content");t&&t.addEventListener("scroll",x)},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")})})});const d=n=>{l.jumpElement(`#${n.index}`)};return(n,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(i).b(),e.unref(i).is("api",q.value)])},[a.value?.length?(e.openBlock(),e.createBlock(e.unref(E.VftSideMenu),{key:0,ref_key:"sideMenuRef",ref:c,"default-active":a.value[0].slug,class:"toc-side-menu",menus:a.value,"is-fixed-left":!1,"default-openeds-level":"","unique-opened":!1,"disable-sub-menu-action":"","attr-mapping":{index:"slug",originIndex:"slug",originChildren:"children"},onSelect:d,onSubMenuClick:d},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(r).meta?.title),3),e.createElementVNode("div",z,[e.unref(r).meta?.category?.length?(e.openBlock(),e.createElementBlock("div",L,[e.createVNode(e.unref(m.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,k)=>(e.openBlock(),e.createBlock(e.unref(N.VftTag),{size:"small",class:"tag",type:e.unref(l.getRandomElementForArr)(e.unref(M.COMP_TYPE),1)[0],key:k,onClick:O=>C(t)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t),1)]),_:2},1032,["type","onClick"]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",I,[e.createVNode(e.unref(V.VftIconText),{title:"发布时间",icon:"icon-date",size:12,class:"mr-10px",distance:5,text:e.unref(f.formatToDateTime)((e.unref(r).meta?.date?new Date(e.unref(r).meta.date).getTime():new Date().getTime())-e.unref(f.getDayTimestamp)())},null,8,["text"]),e.createElementVNode("div",P,[e.createVNode(e.unref(m.VftIcon),{icon:"icon-reading",size:14,class:"mr-5px"}),e.createElementVNode("div",{class:"waline-pageview-count lh-1","data-path":e.unref(y)},"0",8,R)])])])],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(i).e("content"))},[e.renderSlot(n.$slots,"default")],2),e.createVNode(e.unref(_.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=j;
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"),_=require("../side-menu/index.cjs"),S=require("../tag/index.cjs");require("@vueuse/core");const i=require("@vft/utils");require("../config-provider/hooks/use-global-config.cjs");const b=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"},P={key:0,class:"left"},R={class:"infos"},A={class:"reading",title:"阅读量"},I=["data-path"],j=e.defineComponent({name:"vft-md-container"}),O=e.defineComponent({...j,props:{tocList:{},scrollDom:{default:".layout-content"}},setup(s){const l=D.useNamespace("md-container"),v=e.getCurrentInstance(),c=e.ref(),a=e.computed(()=>s.tocList&&s.tocList!=="undefined"?JSON.parse(s.tocList):""),{initPhotoSwipe:y}=L.usePhotoSwipe(`.${l.e("content")} img`);y(),M.useCopyCode();const u=v.appContext.config.globalProperties.$router,r=u.currentRoute.value,h=b.primaryColor(),C=i.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(()=>i.handleScrollPosition({scrollDom:".layout-content",contentDom:".header-anchor",selectAttrName:"href",offset:100,callback:n=>{c.value.menuRef.updateActiveIndex(n.slice(1))}}),100),m=n=>{i.jumpElement(`#${n.index}`)},f=()=>{const n=document.querySelector(s.scrollDom);n&&n.removeEventListener("scroll",d)};return e.onMounted(()=>{e.nextTick(()=>{setTimeout(()=>{i.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)])},[a.value?.length?(e.openBlock(),e.createBlock(e.unref(_.VftSideMenu),{key:0,ref_key:"sideMenuRef",ref:c,"default-active":a.value[0].slug,class:"toc-side-menu",menus:a.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",P,[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(S.VftTag),{size:"small",class:"tag",type:e.unref(i.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",R,[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",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(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 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@vueuse/core");require("@vft/utils");require("../config-provider/hooks/use-global-config.cjs");const t=require("vue");require("lodash-es");require("../form/index.cjs");const d=require("@vft/use");function v(l,a,r){const i=t.ref(!1),m=r.props?.dragWidthCfg?.minWidth||200;t.onMounted(()=>{r.props?.dragWidthCfg&&t.nextTick(()=>{d.useDebounceFn(h,100)()})});function c(e){const n=t.unref(e);return n?Reflect.has(n,"$el")?t.unref(e)?.$el:t.unref(e):null}function p(e,n,s){document.onmousemove=function(o){let u=e.left+(o.clientX-s);o=o||window.event;const f=r.props?.dragWidthCfg?.maxWidth||800,W=t.unref(m);return u<=W?void 0:(u<0&&(u=0),u>f&&(u=f),e.style.left=u+"px",d.useThrottleFn(()=>{r.emit("update:width",u+"px")},150)(),!1)}}function g(e){document.onmouseup=function(){document.onmousemove=null,document.onmouseup=null,i.value=!0,t.nextTick(()=>{r.emit("dragWidthEnd"),setTimeout(()=>{i.value=!1},1e3)}),e.releaseCapture?.()}}function h(){const e=c(a);if(!e)return;const n=c(l);n&&(e.onmousedown=s=>{const o=s?.clientX;return e.left=e.offsetLeft,p(e,n,o),g(e),e.setCapture?.(),!1})}return{isDraging:i}}exports.useDragLine=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("@vft/use"),t=require("vue");function v(l,a,o){const i=t.ref(!1),m=o.props?.dragWidthCfg?.minWidth||200;t.onMounted(()=>{o.props?.dragWidthCfg&&t.nextTick(()=>{d.useDebounceFn(h,100)()})});function c(e){const u=t.unref(e);return u?Reflect.has(u,"$el")?t.unref(e)?.$el:t.unref(e):null}function p(e,u,s){document.onmousemove=function(r){let n=e.left+(r.clientX-s);r=r||window.event;const f=o.props?.dragWidthCfg?.maxWidth||800,W=t.unref(m);return n<=W?void 0:(n<0&&(n=0),n>f&&(n=f),e.style.left=n+"px",d.useThrottleFn(()=>{o.emit("update:width",n+"px")},150)(),!1)}}function g(e){document.onmouseup=function(){document.onmousemove=null,document.onmouseup=null,i.value=!0,t.nextTick(()=>{o.emit("dragWidthEnd"),setTimeout(()=>{i.value=!1},100)}),e.releaseCapture?.()}}function h(){const e=c(a);if(!e)return;const u=c(l);u&&(e.onmousedown=s=>{const r=s?.clientX;return e.left=e.offsetLeft,p(e,u,r),g(e),e.setCapture?.(),!1})}return{isDraging:i}}exports.useDragLine=v;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.0.431";exports.version=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.0.433";exports.version=e;
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  "name": "vft",
3
- "version": "0.0.431",
3
+ "version": "0.0.433",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "es/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vft",
3
- "version": "0.0.431",
3
+ "version": "0.0.433",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "es/index.js",
@@ -55,11 +55,11 @@
55
55
  "resize-detector": "0.3.0",
56
56
  "sortablejs": "1.15.0",
57
57
  "photoswipe": "5.4.4",
58
- "@vft/constants": "0.0.75",
59
- "@vft/utils": "0.0.144",
60
58
  "@vft/router": "0.0.67",
59
+ "@vft/store": "0.0.57",
60
+ "@vft/constants": "0.0.75",
61
61
  "@vft/directives": "0.0.36",
62
- "@vft/store": "0.0.54",
62
+ "@vft/utils": "0.0.144",
63
63
  "@vft/use": "0.0.89"
64
64
  },
65
65
  "vetur": {