spicykatsu 0.0.1 → 0.0.2

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,19 +1,14 @@
1
- import { openBlock as o, createElementBlock as l, normalizeClass as d, toDisplayString as a, createCommentVNode as s, createTextVNode as r, renderSlot as u } from "vue";
2
- const f = (t, n) => {
3
- const e = t.__vccOpts || t;
4
- for (const [i, c] of n)
5
- e[i] = c;
6
- return e;
7
- }, m = ["disabled"], y = {
1
+ import { openBlock as n, createElementBlock as o, normalizeClass as f, normalizeStyle as b, toDisplayString as c, createCommentVNode as r, createElementVNode as m, renderSlot as v, ref as g, withDirectives as k, vModelText as C, mergeProps as B, withKeys as x, withModifiers as $, createBlock as V, Transition as I, withCtx as w } from "vue";
2
+ const T = ["disabled"], A = {
8
3
  key: 0,
9
4
  class: "spicyBtnIcon"
10
- }, b = {
5
+ }, D = {
11
6
  __name: "SpicyBtn",
12
7
  props: {
13
8
  variant: {
14
9
  type: String,
15
10
  default: "filled",
16
- validator: (t) => ["outlined", "filled"].includes(t)
11
+ validator: (e) => ["outlined", "filled"].includes(e)
17
12
  },
18
13
  disabled: {
19
14
  type: Boolean,
@@ -23,24 +18,175 @@ const f = (t, n) => {
23
18
  type: String,
24
19
  default: "Button"
25
20
  },
26
- icon: String
21
+ icon: String,
22
+ color: String,
23
+ textColor: String,
24
+ hoverColor: String,
25
+ borderColor: String,
26
+ // Custom color for the button border (if outlined variant)
27
+ fontSize: {
28
+ type: [Number, String],
29
+ default: 14
30
+ },
31
+ fontWeight: {
32
+ type: [Number, String],
33
+ default: 500
34
+ }
27
35
  },
28
36
  emits: ["click"],
29
- setup(t, { emit: n }) {
30
- const e = n, i = () => {
31
- e("click");
37
+ setup(e, { emit: i }) {
38
+ return (t, l) => (n(), o("button", {
39
+ class: f(["spicyBtn", { outlined: e.variant === "outlined", disabled: e.disabled }]),
40
+ style: b({ "--color": e.color, "--textColor": e.textColor, "--hoverColor": e.hoverColor }),
41
+ disabled: e.disabled,
42
+ onClick: l[0] || (l[0] = (...a) => t.onClick && t.onClick(...a))
43
+ }, [
44
+ e.icon ? (n(), o("span", A, c(e.icon), 1)) : r("", !0),
45
+ m("span", null, c(e.text), 1),
46
+ v(t.$slots, "default")
47
+ ], 14, T));
48
+ }
49
+ }, N = ["placeholder"], z = {
50
+ key: 0,
51
+ class: "spicyInputError"
52
+ }, W = {
53
+ __name: "SpicyLabel",
54
+ props: {
55
+ value: {
56
+ type: String,
57
+ default: ""
58
+ },
59
+ placeholder: {
60
+ type: String,
61
+ default: ""
62
+ },
63
+ label: {
64
+ type: String,
65
+ default: "Label"
66
+ },
67
+ error: {
68
+ type: String,
69
+ default: ""
70
+ },
71
+ variant: {
72
+ type: String,
73
+ default: "filled",
74
+ validator: (e) => ["outlined", "filled"].includes(e)
75
+ }
76
+ },
77
+ setup(e) {
78
+ const i = e, t = `spicyInput-${d()}`, l = g(i.value), a = g(!1);
79
+ function d() {
80
+ const s = "0123456789abcdefghijklmnopqrstuvwxyz";
81
+ let u = "";
82
+ for (let y = 0; y < 6; y++)
83
+ u += s.charAt(Math.floor(Math.random() * s.length));
84
+ return u;
85
+ }
86
+ const h = (s) => {
87
+ l.value = s.target.value;
88
+ }, p = () => {
89
+ a.value = !1;
90
+ }, S = () => {
91
+ a.value = !0;
32
92
  };
33
- return (c, k) => (o(), l("button", {
34
- class: d(["spicyBtn", { outlined: t.variant === "outlined", disabled: t.disabled }]),
35
- disabled: t.disabled,
36
- onClick: i
93
+ return (s, u) => (n(), o("div", {
94
+ class: f(["spicyInputWrapper", [e.variant, { hasValue: l.value || e.value, hasFocus: a.value, hasError: e.error }]])
37
95
  }, [
38
- t.icon ? (o(), l("span", y, a(t.icon), 1)) : s("", !0),
39
- r(" " + a(t.text) + " ", 1),
40
- u(c.$slots, "default", {}, void 0, !0)
41
- ], 10, m));
96
+ m("label", {
97
+ class: "spicyInputLabel",
98
+ for: t
99
+ }, c(e.label), 1),
100
+ k(m("input", {
101
+ id: t,
102
+ class: f(["spicyInput", e.variant]),
103
+ "onUpdate:modelValue": u[0] || (u[0] = (y) => l.value = y),
104
+ placeholder: e.placeholder,
105
+ onInput: h,
106
+ onBlur: p,
107
+ onFocus: S
108
+ }, null, 42, N), [
109
+ [C, l.value]
110
+ ]),
111
+ v(s.$slots, "default"),
112
+ e.error ? (n(), o("span", z, c(e.error), 1)) : r("", !0)
113
+ ], 2));
114
+ }
115
+ }, E = ["aria-checked", "onKeydown"], F = /* @__PURE__ */ m("div", { class: "spicyToggleKnob" }, null, -1), K = [
116
+ F
117
+ ], j = {
118
+ __name: "SpicyToggle",
119
+ props: {
120
+ modelValue: Boolean
121
+ },
122
+ emits: ["update:modelValue"],
123
+ setup(e, { emit: i }) {
124
+ const t = e, l = i, a = () => {
125
+ l("update:modelValue", !t.modelValue);
126
+ };
127
+ return (d, h) => (n(), o("div", B({
128
+ class: ["spicyToggle", { "is-active": e.modelValue }],
129
+ onClick: a,
130
+ role: "switch",
131
+ "aria-checked": e.modelValue.toString(),
132
+ tabindex: "0",
133
+ onKeydown: x($(a, ["prevent"]), ["space"])
134
+ }, d.$attrs), K, 16, E));
135
+ }
136
+ }, L = {
137
+ key: 0,
138
+ class: "spicyAlertIcon"
139
+ }, M = { key: 1 }, q = {
140
+ __name: "SpicyAlert",
141
+ props: {
142
+ variant: {
143
+ type: String,
144
+ default: "info",
145
+ validator: (e) => ["info", "success", "warning", "error", "custom"].includes(e)
146
+ },
147
+ text: {
148
+ type: String,
149
+ default: ""
150
+ },
151
+ icon: String,
152
+ iconOnly: Boolean,
153
+ closable: {
154
+ type: Boolean,
155
+ default: !1
156
+ },
157
+ autoClose: {
158
+ type: Number,
159
+ default: 0
160
+ }
161
+ },
162
+ setup(e) {
163
+ const i = e, t = g(!0), l = () => {
164
+ t.value = !1;
165
+ };
166
+ return i.autoClose > 0 && setTimeout(() => {
167
+ t.value = !1;
168
+ }, i.autoClose), (a, d) => (n(), V(I, { name: "fade" }, {
169
+ default: w(() => [
170
+ t.value ? (n(), o("div", {
171
+ key: 0,
172
+ class: f(["spicyAlert", e.variant])
173
+ }, [
174
+ e.iconOnly || e.text ? (n(), o("span", L, c(e.icon), 1)) : r("", !0),
175
+ !e.iconOnly && e.text ? (n(), o("span", M, c(e.text), 1)) : r("", !0),
176
+ e.closable ? (n(), o("button", {
177
+ key: 2,
178
+ class: "closeButton",
179
+ onClick: l
180
+ }, "×")) : r("", !0)
181
+ ], 2)) : r("", !0)
182
+ ]),
183
+ _: 1
184
+ }));
42
185
  }
43
- }, B = /* @__PURE__ */ f(b, [["__scopeId", "data-v-a0b5d4cb"]]);
186
+ };
44
187
  export {
45
- B as SpicyBtn
188
+ q as SpicyAlert,
189
+ D as SpicyBtn,
190
+ W as SpicyLabel,
191
+ j as SpicyToggle
46
192
  };
@@ -1 +1 @@
1
- (function(n,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(n=typeof globalThis<"u"?globalThis:n||self,e(n.SpicyKatsu={},n.Vue))})(this,function(n,e){"use strict";const l=(t,o)=>{const i=t.__vccOpts||t;for(const[c,d]of o)i[c]=d;return i},s=["disabled"],a={key:0,class:"spicyBtnIcon"},r=l({__name:"SpicyBtn",props:{variant:{type:String,default:"filled",validator:t=>["outlined","filled"].includes(t)},disabled:{type:Boolean,default:!1},text:{type:String,default:"Button"},icon:String},emits:["click"],setup(t,{emit:o}){const i=o,c=()=>{i("click")};return(d,u)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["spicyBtn",{outlined:t.variant==="outlined",disabled:t.disabled}]),disabled:t.disabled,onClick:c},[t.icon?(e.openBlock(),e.createElementBlock("span",a,e.toDisplayString(t.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.text)+" ",1),e.renderSlot(d.$slots,"default",{},void 0,!0)],10,s))}},[["__scopeId","data-v-a0b5d4cb"]]);n.SpicyBtn=r,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
1
+ (function(o,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(o=typeof globalThis<"u"?globalThis:o||self,e(o.SpicyKatsu={},o.Vue))})(this,function(o,e){"use strict";const m=["disabled"],y={key:0,class:"spicyBtnIcon"},f={__name:"SpicyBtn",props:{variant:{type:String,default:"filled",validator:t=>["outlined","filled"].includes(t)},disabled:{type:Boolean,default:!1},text:{type:String,default:"Button"},icon:String,color:String,textColor:String,hoverColor:String,borderColor:String,fontSize:{type:[Number,String],default:14},fontWeight:{type:[Number,String],default:500}},emits:["click"],setup(t,{emit:i}){return(l,n)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["spicyBtn",{outlined:t.variant==="outlined",disabled:t.disabled}]),style:e.normalizeStyle({"--color":t.color,"--textColor":t.textColor,"--hoverColor":t.hoverColor}),disabled:t.disabled,onClick:n[0]||(n[0]=(...a)=>l.onClick&&l.onClick(...a))},[t.icon?(e.openBlock(),e.createElementBlock("span",y,e.toDisplayString(t.icon),1)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(t.text),1),e.renderSlot(l.$slots,"default")],14,m))}},p=["placeholder"],g={key:0,class:"spicyInputError"},h={__name:"SpicyLabel",props:{value:{type:String,default:""},placeholder:{type:String,default:""},label:{type:String,default:"Label"},error:{type:String,default:""},variant:{type:String,default:"filled",validator:t=>["outlined","filled"].includes(t)}},setup(t){const i=t,l=`spicyInput-${s()}`,n=e.ref(i.value),a=e.ref(!1);function s(){const c="0123456789abcdefghijklmnopqrstuvwxyz";let r="";for(let d=0;d<6;d++)r+=c.charAt(Math.floor(Math.random()*c.length));return r}const u=c=>{n.value=c.target.value},E=()=>{a.value=!1},$=()=>{a.value=!0};return(c,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["spicyInputWrapper",[t.variant,{hasValue:n.value||t.value,hasFocus:a.value,hasError:t.error}]])},[e.createElementVNode("label",{class:"spicyInputLabel",for:l},e.toDisplayString(t.label),1),e.withDirectives(e.createElementVNode("input",{id:l,class:e.normalizeClass(["spicyInput",t.variant]),"onUpdate:modelValue":r[0]||(r[0]=d=>n.value=d),placeholder:t.placeholder,onInput:u,onBlur:E,onFocus:$},null,42,p),[[e.vModelText,n.value]]),e.renderSlot(c.$slots,"default"),t.error?(e.openBlock(),e.createElementBlock("span",g,e.toDisplayString(t.error),1)):e.createCommentVNode("",!0)],2))}},S=["aria-checked","onKeydown"],k=[e.createElementVNode("div",{class:"spicyToggleKnob"},null,-1)],B={__name:"SpicyToggle",props:{modelValue:Boolean},emits:["update:modelValue"],setup(t,{emit:i}){const l=t,n=i,a=()=>{n("update:modelValue",!l.modelValue)};return(s,u)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:["spicyToggle",{"is-active":t.modelValue}],onClick:a,role:"switch","aria-checked":t.modelValue.toString(),tabindex:"0",onKeydown:e.withKeys(e.withModifiers(a,["prevent"]),["space"])},s.$attrs),k,16,S))}},b={key:0,class:"spicyAlertIcon"},C={key:1},V={__name:"SpicyAlert",props:{variant:{type:String,default:"info",validator:t=>["info","success","warning","error","custom"].includes(t)},text:{type:String,default:""},icon:String,iconOnly:Boolean,closable:{type:Boolean,default:!1},autoClose:{type:Number,default:0}},setup(t){const i=t,l=e.ref(!0),n=()=>{l.value=!1};return i.autoClose>0&&setTimeout(()=>{l.value=!1},i.autoClose),(a,s)=>(e.openBlock(),e.createBlock(e.Transition,{name:"fade"},{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["spicyAlert",t.variant])},[t.iconOnly||t.text?(e.openBlock(),e.createElementBlock("span",b,e.toDisplayString(t.icon),1)):e.createCommentVNode("",!0),!t.iconOnly&&t.text?(e.openBlock(),e.createElementBlock("span",C,e.toDisplayString(t.text),1)):e.createCommentVNode("",!0),t.closable?(e.openBlock(),e.createElementBlock("button",{key:2,class:"closeButton",onClick:n},"×")):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)]),_:1}))}};o.SpicyAlert=V,o.SpicyBtn=f,o.SpicyLabel=h,o.SpicyToggle=B,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .spicyBtn[data-v-a0b5d4cb]{padding:8px 16px;background-color:#424242;border:none;border-radius:4px;color:#fff;cursor:pointer;font-size:14px;font-weight:500;text-transform:uppercase;transition:background-color .3s}.spicyBtn.outlined[data-v-a0b5d4cb]{background-color:transparent;border:2px solid #424242;color:#424242}.spicyBtn.disabled[data-v-a0b5d4cb]{opacity:.5;cursor:not-allowed}.spicyBtn[data-v-a0b5d4cb]:hover:not(.disabled){background-color:#616161}.spicyBtn.outlined[data-v-a0b5d4cb]:hover:not(.disabled){background-color:#424242;color:#fff}.spicyBtnIcon[data-v-a0b5d4cb]{margin-right:6px}
1
+ .spicyBtn{padding:8px 16px;background-color:var(--color, var(--primaryColor));border:none;border-radius:4px;color:var(--textColor);cursor:pointer;font-size:14px;font-weight:500;text-transform:uppercase;transition:background-color .25s}.spicyBtn.outlined{background-color:transparent;border:2px solid var(--borderColor);color:#424242}.spicyBtn.disabled{opacity:.5;cursor:not-allowed}.spicyBtn:hover:not(.disabled){background-color:#616161}.spicyBtn.outlined:hover:not(.disabled){background-color:#424242;color:var(--textColor)}.spicyBtnIcon{margin-right:6px}.spicyInputWrapper{display:flex;flex-direction:column;position:relative}.spicyInputLabel{position:absolute;top:12px;left:16px;color:var(--textColor);transition:top .25s,font-size .25s,color .25s;pointer-events:none;font-size:18px;background-color:transparent}.spicyInput{padding:20px 16px 8px;border:none;border-bottom:1px solid var(--borderColor);font-size:16px;width:100%;box-sizing:border-box;transition:border-color .25s;background-color:transparent;color:var(--textColor)}.spicyInputWrapper .spicyInput:focus{outline:none;border-color:var(--labelFocus)}.outlined .spicyInput{border:1px solid var(--borderColor);border-radius:4px}.filled .spicyInput{border:none;border-bottom:1px solid var(--borderColor)}.hasValue .spicyInputLabel,.hasFocus .spicyInputLabel{top:-16px;font-size:16px;color:var(--labelFocus);font-weight:700}.hasError .spicyInput{border-color:red}.spicyInputError{color:red;font-size:12px;margin-top:4px}.spicyToggle{width:50px;height:24px;background-color:var(--borderColor);border-radius:30px;cursor:pointer;padding:2px;transition:background-color .2s;display:inline-flex;align-items:center}.spicyToggle.is-active{background-color:var(--primaryColor)}.spicyToggleKnob{width:20px;height:20px;background-color:#fff;border-radius:50%;transition:transform .2s;box-shadow:0 2px 4px #0003}.spicyToggle.is-active .spicyToggleKnob{transform:translate(26px)}.spicyToggle:focus{outline:none;box-shadow:0 0 0 2px #5e138180}.fade-enter-active,.fade-leave-active{transition:opacity .5s}.fade-enter,.fade-leave-to{opacity:0}.spicyAlert{display:flex;align-items:center;padding:12px;border-radius:4px;margin-bottom:12px}.info{background-color:#e0e0e0;color:#333}.success{background-color:#d4edda;color:#155724}.warning{background-color:#fff3cd;color:#856404}.error{background-color:#ffbdc2;color:#911f2a}.spicyAlertIcon{margin-right:8px}.closeButton{margin-left:auto;background:none;border:none;cursor:pointer}:root{--primaryColor: #5e1381;--primaryColorHover: #811faf;--errorColor: #ff0000;--borderColor: #ccc;--textColor: #ddd;--disabledOpacity: .5;--labelFocus: var(--primaryColor);--fontFamily: "Helvetica Neue", Helvetica, Arial, sans-serif;--fontSize: 14px;--fontWeight: 500;--borderWidth: 2px;--borderRadius: 4px}.spicyText{color:var(--textColor);font-family:var(--fontFamily);font-size:var(--fontSize);font-weight:var(--fontWeight)}
package/package.json CHANGED
@@ -1,30 +1,28 @@
1
- {
2
- "name": "spicykatsu",
3
- "description": "Comp Library for Vue",
4
- "license": "MIT",
5
- "author": "Sato",
6
- "private": false,
7
- "version": "0.0.1",
8
- "type": "module",
9
- "main": "dist/spicykatsu.es.js",
10
- "scripts": {
11
- "dev": "vite",
12
- "build": "vue-tsc && vite build",
13
- "preview": "vite preview",
14
- "docs:dev": "vitepress dev docs",
15
- "test": "jest"
16
- },
17
- "dependencies": {
18
- "vue": "^3.4.21"
19
- },
20
- "devDependencies": {
21
- "@vitejs/plugin-vue": "^5.0.4",
22
- "@types/jest": "^29.5.12",
23
- "@vue/test-utils": "^2.4.5",
24
- "@vue/vue3-jest": "^29.2.6",
25
- "typescript": "^5.2.2",
26
- "vite": "^5.2.0",
27
- "vitepress": "^1.0.1",
28
- "vue-tsc": "^2.0.6"
29
- }
30
- }
1
+ {
2
+ "name": "spicykatsu",
3
+ "description": "Comp Library for Vue",
4
+ "license": "MIT",
5
+ "author": "Sato",
6
+ "private": false,
7
+ "version": "0.0.2",
8
+ "files": ["dist/", "package.json", "README.md"],
9
+ "type": "module",
10
+ "main": "dist/spicykatsu.es.js",
11
+ "scripts": {
12
+ "dev": "vite",
13
+ "build": "vue-tsc && vite build",
14
+ "preview": "vite preview",
15
+ "docs:dev": "vitepress dev docs",
16
+ "test": "jest"
17
+ },
18
+ "dependencies": {
19
+ "vue": "^3.4.21"
20
+ },
21
+ "devDependencies": {
22
+ "@vitejs/plugin-vue": "^5.0.4",
23
+ "typescript": "^5.2.2",
24
+ "vite": "^5.2.0",
25
+ "vitepress": "^1.0.1",
26
+ "vue-tsc": "^2.0.6"
27
+ }
28
+ }
@@ -1,3 +0,0 @@
1
- {
2
- "recommendations": ["Vue.volar"]
3
- }
@@ -1,269 +0,0 @@
1
- import {
2
- useMediaQuery
3
- } from "./chunk-4I4JYJZN.js";
4
- import {
5
- computed,
6
- ref,
7
- shallowRef,
8
- watch
9
- } from "./chunk-CKQ4TNQ3.js";
10
-
11
- // node_modules/vitepress/dist/client/theme-default/index.js
12
- import "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/styles/fonts.css";
13
-
14
- // node_modules/vitepress/dist/client/theme-default/without-fonts.js
15
- import "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/styles/vars.css";
16
- import "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/styles/base.css";
17
- import "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/styles/icons.css";
18
- import "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/styles/utils.css";
19
- import "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/styles/components/custom-block.css";
20
- import "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/styles/components/vp-code.css";
21
- import "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/styles/components/vp-code-group.css";
22
- import "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/styles/components/vp-doc.css";
23
- import "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/styles/components/vp-sponsor.css";
24
- import VPBadge from "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/components/VPBadge.vue";
25
- import Layout from "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/Layout.vue";
26
- import { default as default2 } from "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/components/VPBadge.vue";
27
- import { default as default3 } from "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/components/VPImage.vue";
28
- import { default as default4 } from "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/components/VPButton.vue";
29
- import { default as default5 } from "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/components/VPHomeHero.vue";
30
- import { default as default6 } from "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/components/VPHomeFeatures.vue";
31
- import { default as default7 } from "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/components/VPHomeSponsors.vue";
32
- import { default as default8 } from "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/components/VPDocAsideSponsors.vue";
33
- import { default as default9 } from "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/components/VPSponsors.vue";
34
- import { default as default10 } from "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/components/VPTeamPage.vue";
35
- import { default as default11 } from "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/components/VPTeamPageTitle.vue";
36
- import { default as default12 } from "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/components/VPTeamPageSection.vue";
37
- import { default as default13 } from "X:/Repo/NodeNPM/SpicyKatsu/node_modules/vitepress/dist/client/theme-default/components/VPTeamMembers.vue";
38
-
39
- // node_modules/vitepress/dist/client/shared.js
40
- var inBrowser = typeof document !== "undefined";
41
-
42
- // node_modules/vitepress/dist/client/theme-default/support/utils.js
43
- import { withBase } from "vitepress";
44
-
45
- // node_modules/vitepress/dist/client/theme-default/composables/data.js
46
- import { useData as useData$ } from "vitepress";
47
- var useData = useData$;
48
-
49
- // node_modules/vitepress/dist/client/theme-default/support/utils.js
50
- function ensureStartingSlash(path) {
51
- return /^\//.test(path) ? path : `/${path}`;
52
- }
53
-
54
- // node_modules/vitepress/dist/client/theme-default/support/sidebar.js
55
- function getSidebar(_sidebar, path) {
56
- if (Array.isArray(_sidebar))
57
- return addBase(_sidebar);
58
- if (_sidebar == null)
59
- return [];
60
- path = ensureStartingSlash(path);
61
- const dir = Object.keys(_sidebar).sort((a, b) => {
62
- return b.split("/").length - a.split("/").length;
63
- }).find((dir2) => {
64
- return path.startsWith(ensureStartingSlash(dir2));
65
- });
66
- const sidebar = dir ? _sidebar[dir] : [];
67
- return Array.isArray(sidebar) ? addBase(sidebar) : addBase(sidebar.items, sidebar.base);
68
- }
69
- function getSidebarGroups(sidebar) {
70
- const groups = [];
71
- let lastGroupIndex = 0;
72
- for (const index in sidebar) {
73
- const item = sidebar[index];
74
- if (item.items) {
75
- lastGroupIndex = groups.push(item);
76
- continue;
77
- }
78
- if (!groups[lastGroupIndex]) {
79
- groups.push({ items: [] });
80
- }
81
- groups[lastGroupIndex].items.push(item);
82
- }
83
- return groups;
84
- }
85
- function addBase(items, _base) {
86
- return [...items].map((_item) => {
87
- const item = { ..._item };
88
- const base = item.base || _base;
89
- if (base && item.link)
90
- item.link = base + item.link;
91
- if (item.items)
92
- item.items = addBase(item.items, base);
93
- return item;
94
- });
95
- }
96
-
97
- // node_modules/vitepress/dist/client/theme-default/composables/hash.js
98
- var hashRef = ref(inBrowser ? location.hash : "");
99
- if (inBrowser) {
100
- window.addEventListener("hashchange", () => {
101
- hashRef.value = location.hash;
102
- });
103
- }
104
-
105
- // node_modules/vitepress/dist/client/theme-default/composables/sidebar.js
106
- function useSidebar() {
107
- const { frontmatter, page, theme: theme2 } = useData();
108
- const is960 = useMediaQuery("(min-width: 960px)");
109
- const isOpen = ref(false);
110
- const _sidebar = computed(() => {
111
- const sidebarConfig = theme2.value.sidebar;
112
- const relativePath = page.value.relativePath;
113
- return sidebarConfig ? getSidebar(sidebarConfig, relativePath) : [];
114
- });
115
- const sidebar = ref(_sidebar.value);
116
- watch(_sidebar, (next, prev) => {
117
- if (JSON.stringify(next) !== JSON.stringify(prev))
118
- sidebar.value = _sidebar.value;
119
- });
120
- const hasSidebar = computed(() => {
121
- return frontmatter.value.sidebar !== false && sidebar.value.length > 0 && frontmatter.value.layout !== "home";
122
- });
123
- const leftAside = computed(() => {
124
- if (hasAside)
125
- return frontmatter.value.aside == null ? theme2.value.aside === "left" : frontmatter.value.aside === "left";
126
- return false;
127
- });
128
- const hasAside = computed(() => {
129
- if (frontmatter.value.layout === "home")
130
- return false;
131
- if (frontmatter.value.aside != null)
132
- return !!frontmatter.value.aside;
133
- return theme2.value.aside !== false;
134
- });
135
- const isSidebarEnabled = computed(() => hasSidebar.value && is960.value);
136
- const sidebarGroups = computed(() => {
137
- return hasSidebar.value ? getSidebarGroups(sidebar.value) : [];
138
- });
139
- function open() {
140
- isOpen.value = true;
141
- }
142
- function close() {
143
- isOpen.value = false;
144
- }
145
- function toggle() {
146
- isOpen.value ? close() : open();
147
- }
148
- return {
149
- isOpen,
150
- sidebar,
151
- sidebarGroups,
152
- hasSidebar,
153
- hasAside,
154
- leftAside,
155
- isSidebarEnabled,
156
- open,
157
- close,
158
- toggle
159
- };
160
- }
161
-
162
- // node_modules/vitepress/dist/client/theme-default/composables/local-nav.js
163
- import { onContentUpdated } from "vitepress";
164
-
165
- // node_modules/vitepress/dist/client/theme-default/composables/outline.js
166
- import { getScrollOffset } from "vitepress";
167
- var resolvedHeaders = [];
168
- function getHeaders(range) {
169
- const headers = [
170
- ...document.querySelectorAll(".VPDoc :where(h1,h2,h3,h4,h5,h6)")
171
- ].filter((el) => el.id && el.hasChildNodes()).map((el) => {
172
- const level = Number(el.tagName[1]);
173
- return {
174
- element: el,
175
- title: serializeHeader(el),
176
- link: "#" + el.id,
177
- level
178
- };
179
- });
180
- return resolveHeaders(headers, range);
181
- }
182
- function serializeHeader(h) {
183
- let ret = "";
184
- for (const node of h.childNodes) {
185
- if (node.nodeType === 1) {
186
- if (node.classList.contains("VPBadge") || node.classList.contains("header-anchor") || node.classList.contains("ignore-header")) {
187
- continue;
188
- }
189
- ret += node.textContent;
190
- } else if (node.nodeType === 3) {
191
- ret += node.textContent;
192
- }
193
- }
194
- return ret.trim();
195
- }
196
- function resolveHeaders(headers, range) {
197
- if (range === false) {
198
- return [];
199
- }
200
- const levelsRange = (typeof range === "object" && !Array.isArray(range) ? range.level : range) || 2;
201
- const [high, low] = typeof levelsRange === "number" ? [levelsRange, levelsRange] : levelsRange === "deep" ? [2, 6] : levelsRange;
202
- headers = headers.filter((h) => h.level >= high && h.level <= low);
203
- resolvedHeaders.length = 0;
204
- for (const { element, link } of headers) {
205
- resolvedHeaders.push({ element, link });
206
- }
207
- const ret = [];
208
- outer:
209
- for (let i = 0; i < headers.length; i++) {
210
- const cur = headers[i];
211
- if (i === 0) {
212
- ret.push(cur);
213
- } else {
214
- for (let j = i - 1; j >= 0; j--) {
215
- const prev = headers[j];
216
- if (prev.level < cur.level) {
217
- ;
218
- (prev.children || (prev.children = [])).push(cur);
219
- continue outer;
220
- }
221
- }
222
- ret.push(cur);
223
- }
224
- }
225
- return ret;
226
- }
227
-
228
- // node_modules/vitepress/dist/client/theme-default/composables/local-nav.js
229
- function useLocalNav() {
230
- const { theme: theme2, frontmatter } = useData();
231
- const headers = shallowRef([]);
232
- const hasLocalNav = computed(() => {
233
- return headers.value.length > 0;
234
- });
235
- onContentUpdated(() => {
236
- headers.value = getHeaders(frontmatter.value.outline ?? theme2.value.outline);
237
- });
238
- return {
239
- headers,
240
- hasLocalNav
241
- };
242
- }
243
-
244
- // node_modules/vitepress/dist/client/theme-default/without-fonts.js
245
- var theme = {
246
- Layout,
247
- enhanceApp: ({ app }) => {
248
- app.component("Badge", VPBadge);
249
- }
250
- };
251
- var without_fonts_default = theme;
252
- export {
253
- default2 as VPBadge,
254
- default4 as VPButton,
255
- default8 as VPDocAsideSponsors,
256
- default6 as VPHomeFeatures,
257
- default5 as VPHomeHero,
258
- default7 as VPHomeSponsors,
259
- default3 as VPImage,
260
- default9 as VPSponsors,
261
- default13 as VPTeamMembers,
262
- default10 as VPTeamPage,
263
- default12 as VPTeamPageSection,
264
- default11 as VPTeamPageTitle,
265
- without_fonts_default as default,
266
- useLocalNav,
267
- useSidebar
268
- };
269
- //# sourceMappingURL=@theme_index.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../node_modules/vitepress/dist/client/theme-default/index.js", "../../../../node_modules/vitepress/dist/client/theme-default/without-fonts.js", "../../../../node_modules/vitepress/dist/client/shared.js", "../../../../node_modules/vitepress/dist/client/theme-default/support/utils.js", "../../../../node_modules/vitepress/dist/client/theme-default/composables/data.js", "../../../../node_modules/vitepress/dist/client/theme-default/support/sidebar.js", "../../../../node_modules/vitepress/dist/client/theme-default/composables/hash.js", "../../../../node_modules/vitepress/dist/client/theme-default/composables/sidebar.js", "../../../../node_modules/vitepress/dist/client/theme-default/composables/local-nav.js", "../../../../node_modules/vitepress/dist/client/theme-default/composables/outline.js"],
4
- "sourcesContent": ["import './styles/fonts.css';\nexport * from './without-fonts';\nexport { default as default } from './without-fonts';\n", "import './styles/vars.css';\nimport './styles/base.css';\nimport './styles/icons.css';\nimport './styles/utils.css';\nimport './styles/components/custom-block.css';\nimport './styles/components/vp-code.css';\nimport './styles/components/vp-code-group.css';\nimport './styles/components/vp-doc.css';\nimport './styles/components/vp-sponsor.css';\nimport VPBadge from './components/VPBadge.vue';\nimport Layout from './Layout.vue';\nexport { default as VPBadge } from './components/VPBadge.vue';\nexport { default as VPImage } from './components/VPImage.vue';\nexport { default as VPButton } from './components/VPButton.vue';\nexport { default as VPHomeHero } from './components/VPHomeHero.vue';\nexport { default as VPHomeFeatures } from './components/VPHomeFeatures.vue';\nexport { default as VPHomeSponsors } from './components/VPHomeSponsors.vue';\nexport { default as VPDocAsideSponsors } from './components/VPDocAsideSponsors.vue';\nexport { default as VPSponsors } from './components/VPSponsors.vue';\nexport { default as VPTeamPage } from './components/VPTeamPage.vue';\nexport { default as VPTeamPageTitle } from './components/VPTeamPageTitle.vue';\nexport { default as VPTeamPageSection } from './components/VPTeamPageSection.vue';\nexport { default as VPTeamMembers } from './components/VPTeamMembers.vue';\nexport { useSidebar } from './composables/sidebar';\nexport { useLocalNav } from './composables/local-nav';\nconst theme = {\n Layout,\n enhanceApp: ({ app }) => {\n app.component('Badge', VPBadge);\n }\n};\nexport default theme;\n", "export const EXTERNAL_URL_RE = /^(?:[a-z]+:|\\/\\/)/i;\nexport const APPEARANCE_KEY = 'vitepress-theme-appearance';\nconst HASH_RE = /#.*$/;\nconst HASH_OR_QUERY_RE = /[?#].*$/;\nconst INDEX_OR_EXT_RE = /(?:(^|\\/)index)?\\.(?:md|html)$/;\nexport const inBrowser = typeof document !== 'undefined';\nexport const notFoundPageData = {\n relativePath: '',\n filePath: '',\n title: '404',\n description: 'Not Found',\n headers: [],\n frontmatter: { sidebar: false, layout: 'page' },\n lastUpdated: 0,\n isNotFound: true\n};\nexport function isActive(currentPath, matchPath, asRegex = false) {\n if (matchPath === undefined) {\n return false;\n }\n currentPath = normalize(`/${currentPath}`);\n if (asRegex) {\n return new RegExp(matchPath).test(currentPath);\n }\n if (normalize(matchPath) !== currentPath) {\n return false;\n }\n const hashMatch = matchPath.match(HASH_RE);\n if (hashMatch) {\n return (inBrowser ? location.hash : '') === hashMatch[0];\n }\n return true;\n}\nfunction normalize(path) {\n return decodeURI(path)\n .replace(HASH_OR_QUERY_RE, '')\n .replace(INDEX_OR_EXT_RE, '$1');\n}\nexport function isExternal(path) {\n return EXTERNAL_URL_RE.test(path);\n}\n/**\n * this merges the locales data to the main data by the route\n */\nexport function resolveSiteDataByRoute(siteData, relativePath) {\n const localeIndex = Object.keys(siteData.locales).find((key) => key !== 'root' &&\n !isExternal(key) &&\n isActive(relativePath, `/${key}/`, true)) || 'root';\n return Object.assign({}, siteData, {\n localeIndex,\n lang: siteData.locales[localeIndex]?.lang ?? siteData.lang,\n dir: siteData.locales[localeIndex]?.dir ?? siteData.dir,\n title: siteData.locales[localeIndex]?.title ?? siteData.title,\n titleTemplate: siteData.locales[localeIndex]?.titleTemplate ?? siteData.titleTemplate,\n description: siteData.locales[localeIndex]?.description ?? siteData.description,\n head: mergeHead(siteData.head, siteData.locales[localeIndex]?.head ?? []),\n themeConfig: {\n ...siteData.themeConfig,\n ...siteData.locales[localeIndex]?.themeConfig\n }\n });\n}\n/**\n * Create the page title string based on config.\n */\nexport function createTitle(siteData, pageData) {\n const title = pageData.title || siteData.title;\n const template = pageData.titleTemplate ?? siteData.titleTemplate;\n if (typeof template === 'string' && template.includes(':title')) {\n return template.replace(/:title/g, title);\n }\n const templateString = createTitleTemplate(siteData.title, template);\n if (title === templateString.slice(3)) {\n return title;\n }\n return `${title}${templateString}`;\n}\nfunction createTitleTemplate(siteTitle, template) {\n if (template === false) {\n return '';\n }\n if (template === true || template === undefined) {\n return ` | ${siteTitle}`;\n }\n if (siteTitle === template) {\n return '';\n }\n return ` | ${template}`;\n}\nfunction hasTag(head, tag) {\n const [tagType, tagAttrs] = tag;\n if (tagType !== 'meta')\n return false;\n const keyAttr = Object.entries(tagAttrs)[0]; // First key\n if (keyAttr == null)\n return false;\n return head.some(([type, attrs]) => type === tagType && attrs[keyAttr[0]] === keyAttr[1]);\n}\nexport function mergeHead(prev, curr) {\n return [...prev.filter((tagAttrs) => !hasTag(curr, tagAttrs)), ...curr];\n}\n// https://github.com/rollup/rollup/blob/fec513270c6ac350072425cc045db367656c623b/src/utils/sanitizeFileName.ts\nconst INVALID_CHAR_REGEX = /[\\u0000-\\u001F\"#$&*+,:;<=>?[\\]^`{|}\\u007F]/g;\nconst DRIVE_LETTER_REGEX = /^[a-z]:/i;\nexport function sanitizeFileName(name) {\n const match = DRIVE_LETTER_REGEX.exec(name);\n const driveLetter = match ? match[0] : '';\n return (driveLetter +\n name\n .slice(driveLetter.length)\n .replace(INVALID_CHAR_REGEX, '_')\n .replace(/(^|\\/)_+(?=[^/]*$)/, '$1'));\n}\nexport function slash(p) {\n return p.replace(/\\\\/g, '/');\n}\nconst KNOWN_EXTENSIONS = new Set();\nexport function treatAsHtml(filename) {\n if (KNOWN_EXTENSIONS.size === 0) {\n const extraExts = (typeof process === 'object' && process.env?.VITE_EXTRA_EXTENSIONS) ||\n import.meta.env?.VITE_EXTRA_EXTENSIONS ||\n '';\n ('3g2,3gp,aac,ai,apng,au,avif,bin,bmp,cer,class,conf,crl,css,csv,dll,' +\n 'doc,eps,epub,exe,gif,gz,ics,ief,jar,jpe,jpeg,jpg,js,json,jsonld,m4a,' +\n 'man,mid,midi,mjs,mov,mp2,mp3,mp4,mpe,mpeg,mpg,mpp,oga,ogg,ogv,ogx,' +\n 'opus,otf,p10,p7c,p7m,p7s,pdf,png,ps,qt,roff,rtf,rtx,ser,svg,t,tif,' +\n 'tiff,tr,ts,tsv,ttf,txt,vtt,wav,weba,webm,webp,woff,woff2,xhtml,xml,' +\n 'yaml,yml,zip' +\n (extraExts && typeof extraExts === 'string' ? ',' + extraExts : ''))\n .split(',')\n .forEach((ext) => KNOWN_EXTENSIONS.add(ext));\n }\n const ext = filename.split('.').pop();\n return ext == null || !KNOWN_EXTENSIONS.has(ext.toLowerCase());\n}\n// https://github.com/sindresorhus/escape-string-regexp/blob/ba9a4473850cb367936417e97f1f2191b7cc67dd/index.js\nexport function escapeRegExp(str) {\n return str.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&').replace(/-/g, '\\\\x2d');\n}\n", "import { withBase } from 'vitepress';\nimport { useData } from '../composables/data';\nimport { isExternal, treatAsHtml } from '../../shared';\nexport function throttleAndDebounce(fn, delay) {\n let timeoutId;\n let called = false;\n return () => {\n if (timeoutId)\n clearTimeout(timeoutId);\n if (!called) {\n fn();\n (called = true) && setTimeout(() => (called = false), delay);\n }\n else\n timeoutId = setTimeout(fn, delay);\n };\n}\nexport function ensureStartingSlash(path) {\n return /^\\//.test(path) ? path : `/${path}`;\n}\nexport function normalizeLink(url) {\n const { pathname, search, hash, protocol } = new URL(url, 'http://a.com');\n if (isExternal(url) ||\n url.startsWith('#') ||\n !protocol.startsWith('http') ||\n !treatAsHtml(pathname))\n return url;\n const { site } = useData();\n const normalizedPath = pathname.endsWith('/') || pathname.endsWith('.html')\n ? url\n : url.replace(/(?:(^\\.+)\\/)?.*$/, `$1${pathname.replace(/(\\.md)?$/, site.value.cleanUrls ? '' : '.html')}${search}${hash}`);\n return withBase(normalizedPath);\n}\n", "import { useData as useData$ } from 'vitepress';\nexport const useData = useData$;\n", "import { ensureStartingSlash } from './utils';\nimport { isActive } from '../../shared';\n/**\n * Get the `Sidebar` from sidebar option. This method will ensure to get correct\n * sidebar config from `MultiSideBarConfig` with various path combinations such\n * as matching `guide/` and `/guide/`. If no matching config was found, it will\n * return empty array.\n */\nexport function getSidebar(_sidebar, path) {\n if (Array.isArray(_sidebar))\n return addBase(_sidebar);\n if (_sidebar == null)\n return [];\n path = ensureStartingSlash(path);\n const dir = Object.keys(_sidebar)\n .sort((a, b) => {\n return b.split('/').length - a.split('/').length;\n })\n .find((dir) => {\n // make sure the multi sidebar key starts with slash too\n return path.startsWith(ensureStartingSlash(dir));\n });\n const sidebar = dir ? _sidebar[dir] : [];\n return Array.isArray(sidebar)\n ? addBase(sidebar)\n : addBase(sidebar.items, sidebar.base);\n}\n/**\n * Get or generate sidebar group from the given sidebar items.\n */\nexport function getSidebarGroups(sidebar) {\n const groups = [];\n let lastGroupIndex = 0;\n for (const index in sidebar) {\n const item = sidebar[index];\n if (item.items) {\n lastGroupIndex = groups.push(item);\n continue;\n }\n if (!groups[lastGroupIndex]) {\n groups.push({ items: [] });\n }\n groups[lastGroupIndex].items.push(item);\n }\n return groups;\n}\nexport function getFlatSideBarLinks(sidebar) {\n const links = [];\n function recursivelyExtractLinks(items) {\n for (const item of items) {\n if (item.text && item.link) {\n links.push({\n text: item.text,\n link: item.link,\n docFooterText: item.docFooterText\n });\n }\n if (item.items) {\n recursivelyExtractLinks(item.items);\n }\n }\n }\n recursivelyExtractLinks(sidebar);\n return links;\n}\n/**\n * Check if the given sidebar item contains any active link.\n */\nexport function hasActiveLink(path, items) {\n if (Array.isArray(items)) {\n return items.some((item) => hasActiveLink(path, item));\n }\n return isActive(path, items.link)\n ? true\n : items.items\n ? hasActiveLink(path, items.items)\n : false;\n}\nfunction addBase(items, _base) {\n return [...items].map((_item) => {\n const item = { ..._item };\n const base = item.base || _base;\n if (base && item.link)\n item.link = base + item.link;\n if (item.items)\n item.items = addBase(item.items, base);\n return item;\n });\n}\n", "import { inBrowser } from '../../shared';\nimport { ref } from 'vue';\nconst hashRef = ref(inBrowser ? location.hash : '');\nif (inBrowser) {\n window.addEventListener('hashchange', () => {\n hashRef.value = location.hash;\n });\n}\nexport { hashRef };\n", "import { useMediaQuery } from '@vueuse/core';\nimport { computed, onMounted, onUnmounted, ref, watch, watchEffect, watchPostEffect } from 'vue';\nimport { isActive } from '../../shared';\nimport { hasActiveLink as containsActiveLink, getSidebar, getSidebarGroups } from '../support/sidebar';\nimport { useData } from './data';\nimport { hashRef } from './hash';\nexport function useSidebar() {\n const { frontmatter, page, theme } = useData();\n const is960 = useMediaQuery('(min-width: 960px)');\n const isOpen = ref(false);\n const _sidebar = computed(() => {\n const sidebarConfig = theme.value.sidebar;\n const relativePath = page.value.relativePath;\n return sidebarConfig ? getSidebar(sidebarConfig, relativePath) : [];\n });\n const sidebar = ref(_sidebar.value);\n watch(_sidebar, (next, prev) => {\n if (JSON.stringify(next) !== JSON.stringify(prev))\n sidebar.value = _sidebar.value;\n });\n const hasSidebar = computed(() => {\n return (frontmatter.value.sidebar !== false &&\n sidebar.value.length > 0 &&\n frontmatter.value.layout !== 'home');\n });\n const leftAside = computed(() => {\n if (hasAside)\n return frontmatter.value.aside == null\n ? theme.value.aside === 'left'\n : frontmatter.value.aside === 'left';\n return false;\n });\n const hasAside = computed(() => {\n if (frontmatter.value.layout === 'home')\n return false;\n if (frontmatter.value.aside != null)\n return !!frontmatter.value.aside;\n return theme.value.aside !== false;\n });\n const isSidebarEnabled = computed(() => hasSidebar.value && is960.value);\n const sidebarGroups = computed(() => {\n return hasSidebar.value ? getSidebarGroups(sidebar.value) : [];\n });\n function open() {\n isOpen.value = true;\n }\n function close() {\n isOpen.value = false;\n }\n function toggle() {\n isOpen.value ? close() : open();\n }\n return {\n isOpen,\n sidebar,\n sidebarGroups,\n hasSidebar,\n hasAside,\n leftAside,\n isSidebarEnabled,\n open,\n close,\n toggle\n };\n}\n/**\n * a11y: cache the element that opened the Sidebar (the menu button) then\n * focus that button again when Menu is closed with Escape key.\n */\nexport function useCloseSidebarOnEscape(isOpen, close) {\n let triggerElement;\n watchEffect(() => {\n triggerElement = isOpen.value\n ? document.activeElement\n : undefined;\n });\n onMounted(() => {\n window.addEventListener('keyup', onEscape);\n });\n onUnmounted(() => {\n window.removeEventListener('keyup', onEscape);\n });\n function onEscape(e) {\n if (e.key === 'Escape' && isOpen.value) {\n close();\n triggerElement?.focus();\n }\n }\n}\nexport function useSidebarControl(item) {\n const { page } = useData();\n const collapsed = ref(false);\n const collapsible = computed(() => {\n return item.value.collapsed != null;\n });\n const isLink = computed(() => {\n return !!item.value.link;\n });\n const isActiveLink = ref(false);\n const updateIsActiveLink = () => {\n isActiveLink.value = isActive(page.value.relativePath, item.value.link);\n };\n watch([page, item, hashRef], updateIsActiveLink);\n onMounted(updateIsActiveLink);\n const hasActiveLink = computed(() => {\n if (isActiveLink.value) {\n return true;\n }\n return item.value.items\n ? containsActiveLink(page.value.relativePath, item.value.items)\n : false;\n });\n const hasChildren = computed(() => {\n return !!(item.value.items && item.value.items.length);\n });\n watchEffect(() => {\n collapsed.value = !!(collapsible.value && item.value.collapsed);\n });\n watchPostEffect(() => {\n ;\n (isActiveLink.value || hasActiveLink.value) && (collapsed.value = false);\n });\n function toggle() {\n if (collapsible.value) {\n collapsed.value = !collapsed.value;\n }\n }\n return {\n collapsed,\n collapsible,\n isLink,\n isActiveLink,\n hasActiveLink,\n hasChildren,\n toggle\n };\n}\n", "import { onContentUpdated } from 'vitepress';\nimport { computed, shallowRef } from 'vue';\nimport { getHeaders } from '../composables/outline';\nimport { useData } from './data';\nexport function useLocalNav() {\n const { theme, frontmatter } = useData();\n const headers = shallowRef([]);\n const hasLocalNav = computed(() => {\n return headers.value.length > 0;\n });\n onContentUpdated(() => {\n headers.value = getHeaders(frontmatter.value.outline ?? theme.value.outline);\n });\n return {\n headers,\n hasLocalNav\n };\n}\n", "import { getScrollOffset } from 'vitepress';\nimport { onMounted, onUnmounted, onUpdated } from 'vue';\nimport { throttleAndDebounce } from '../support/utils';\nimport { useAside } from './aside';\n// cached list of anchor elements from resolveHeaders\nconst resolvedHeaders = [];\nexport function resolveTitle(theme) {\n return ((typeof theme.outline === 'object' &&\n !Array.isArray(theme.outline) &&\n theme.outline.label) ||\n theme.outlineTitle ||\n 'On this page');\n}\nexport function getHeaders(range) {\n const headers = [\n ...document.querySelectorAll('.VPDoc :where(h1,h2,h3,h4,h5,h6)')\n ]\n .filter((el) => el.id && el.hasChildNodes())\n .map((el) => {\n const level = Number(el.tagName[1]);\n return {\n element: el,\n title: serializeHeader(el),\n link: '#' + el.id,\n level\n };\n });\n return resolveHeaders(headers, range);\n}\nfunction serializeHeader(h) {\n let ret = '';\n for (const node of h.childNodes) {\n if (node.nodeType === 1) {\n if (node.classList.contains('VPBadge') ||\n node.classList.contains('header-anchor') ||\n node.classList.contains('ignore-header')) {\n continue;\n }\n ret += node.textContent;\n }\n else if (node.nodeType === 3) {\n ret += node.textContent;\n }\n }\n return ret.trim();\n}\nexport function resolveHeaders(headers, range) {\n if (range === false) {\n return [];\n }\n const levelsRange = (typeof range === 'object' && !Array.isArray(range)\n ? range.level\n : range) || 2;\n const [high, low] = typeof levelsRange === 'number'\n ? [levelsRange, levelsRange]\n : levelsRange === 'deep'\n ? [2, 6]\n : levelsRange;\n headers = headers.filter((h) => h.level >= high && h.level <= low);\n // clear previous caches\n resolvedHeaders.length = 0;\n // update global header list for active link rendering\n for (const { element, link } of headers) {\n resolvedHeaders.push({ element, link });\n }\n const ret = [];\n outer: for (let i = 0; i < headers.length; i++) {\n const cur = headers[i];\n if (i === 0) {\n ret.push(cur);\n }\n else {\n for (let j = i - 1; j >= 0; j--) {\n const prev = headers[j];\n if (prev.level < cur.level) {\n ;\n (prev.children || (prev.children = [])).push(cur);\n continue outer;\n }\n }\n ret.push(cur);\n }\n }\n return ret;\n}\nexport function useActiveAnchor(container, marker) {\n const { isAsideEnabled } = useAside();\n const onScroll = throttleAndDebounce(setActiveLink, 100);\n let prevActiveLink = null;\n onMounted(() => {\n requestAnimationFrame(setActiveLink);\n window.addEventListener('scroll', onScroll);\n });\n onUpdated(() => {\n // sidebar update means a route change\n activateLink(location.hash);\n });\n onUnmounted(() => {\n window.removeEventListener('scroll', onScroll);\n });\n function setActiveLink() {\n if (!isAsideEnabled.value) {\n return;\n }\n const scrollY = window.scrollY;\n const innerHeight = window.innerHeight;\n const offsetHeight = document.body.offsetHeight;\n const isBottom = Math.abs(scrollY + innerHeight - offsetHeight) < 1;\n // resolvedHeaders may be repositioned, hidden or fix positioned\n const headers = resolvedHeaders\n .map(({ element, link }) => ({\n link,\n top: getAbsoluteTop(element)\n }))\n .filter(({ top }) => !Number.isNaN(top))\n .sort((a, b) => a.top - b.top);\n // no headers available for active link\n if (!headers.length) {\n activateLink(null);\n return;\n }\n // page top\n if (scrollY < 1) {\n activateLink(null);\n return;\n }\n // page bottom - highlight last link\n if (isBottom) {\n activateLink(headers[headers.length - 1].link);\n return;\n }\n // find the last header above the top of viewport\n let activeLink = null;\n for (const { link, top } of headers) {\n if (top > scrollY + getScrollOffset() + 4) {\n break;\n }\n activeLink = link;\n }\n activateLink(activeLink);\n }\n function activateLink(hash) {\n if (prevActiveLink) {\n prevActiveLink.classList.remove('active');\n }\n if (hash == null) {\n prevActiveLink = null;\n }\n else {\n prevActiveLink = container.value.querySelector(`a[href=\"${decodeURIComponent(hash)}\"]`);\n }\n const activeLink = prevActiveLink;\n if (activeLink) {\n activeLink.classList.add('active');\n marker.value.style.top = activeLink.offsetTop + 39 + 'px';\n marker.value.style.opacity = '1';\n }\n else {\n marker.value.style.top = '33px';\n marker.value.style.opacity = '0';\n }\n }\n}\nfunction getAbsoluteTop(element) {\n let offsetTop = 0;\n while (element !== document.body) {\n if (element === null) {\n // child element is:\n // - not attached to the DOM (display: none)\n // - set to fixed position (not scrollable)\n // - body or html element (null offsetParent)\n return NaN;\n }\n offsetTop += element.offsetTop;\n element = element.offsetParent;\n }\n return offsetTop;\n}\n"],
5
- "mappings": ";;;;;;;;;;;AAAA,OAAO;;;ACAP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO,aAAa;AACpB,OAAO,YAAY;AACnB,SAAoB,WAAXA,gBAA0B;AACnC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