unplugin-docubook 1.0.0 → 1.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.
- package/README.md +142 -2
- package/dist/astro.cjs +152 -0
- package/dist/astro.cjs.map +1 -0
- package/dist/astro.js +125 -12
- package/dist/astro.js.map +1 -1
- package/dist/bun.cjs +140 -0
- package/dist/bun.cjs.map +1 -0
- package/dist/bun.js +115 -5
- package/dist/bun.js.map +1 -1
- package/dist/components/index.cjs +829 -0
- package/dist/components/index.cjs.map +1 -0
- package/dist/components/index.js +720 -512
- package/dist/components/index.js.map +1 -1
- package/dist/esbuild.cjs +140 -0
- package/dist/esbuild.cjs.map +1 -0
- package/dist/esbuild.js +115 -5
- package/dist/esbuild.js.map +1 -1
- package/dist/farm.cjs +140 -0
- package/dist/farm.cjs.map +1 -0
- package/dist/farm.js +115 -5
- package/dist/farm.js.map +1 -1
- package/dist/index.cjs +143 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +116 -2
- package/dist/index.js.map +1 -0
- package/dist/next.cjs +140 -0
- package/dist/next.cjs.map +1 -0
- package/dist/next.js +119 -0
- package/dist/next.js.map +1 -0
- package/dist/nuxt.cjs +160 -0
- package/dist/nuxt.cjs.map +1 -0
- package/dist/nuxt.js +134 -16
- package/dist/nuxt.js.map +1 -1
- package/dist/rolldown.cjs +140 -0
- package/dist/rolldown.cjs.map +1 -0
- package/dist/rolldown.js +115 -5
- package/dist/rolldown.js.map +1 -1
- package/dist/rollup.cjs +140 -0
- package/dist/rollup.cjs.map +1 -0
- package/dist/rollup.js +115 -5
- package/dist/rollup.js.map +1 -1
- package/dist/rspack.cjs +140 -0
- package/dist/rspack.cjs.map +1 -0
- package/dist/rspack.js +115 -5
- package/dist/rspack.js.map +1 -1
- package/dist/types.cjs +19 -0
- package/dist/types.cjs.map +1 -0
- package/dist/types.js +1 -1
- package/dist/types.js.map +1 -0
- package/dist/vite.cjs +140 -0
- package/dist/vite.cjs.map +1 -0
- package/dist/vite.js +115 -5
- package/dist/vite.js.map +1 -1
- package/dist/webpack.cjs +140 -0
- package/dist/webpack.cjs.map +1 -0
- package/dist/webpack.js +115 -5
- package/dist/webpack.js.map +1 -1
- package/package.json +92 -33
- package/dist/adapters/next-DNQX7_ln.d.ts +0 -24
- package/dist/adapters/next-DNQX7_ln.d.ts.map +0 -1
- package/dist/adapters/next.js +0 -38
- package/dist/adapters/next.js.map +0 -1
- package/dist/adapters/react-C9Vk6aTD.d.ts +0 -24
- package/dist/adapters/react-C9Vk6aTD.d.ts.map +0 -1
- package/dist/adapters/react.js +0 -39
- package/dist/adapters/react.js.map +0 -1
- package/dist/adapters/svelte-C-dhzdmU.d.ts +0 -19
- package/dist/adapters/svelte-C-dhzdmU.d.ts.map +0 -1
- package/dist/adapters/svelte.js +0 -43
- package/dist/adapters/svelte.js.map +0 -1
- package/dist/adapters/vue-BWv1EZit.d.ts +0 -22
- package/dist/adapters/vue-BWv1EZit.d.ts.map +0 -1
- package/dist/adapters/vue.js +0 -41
- package/dist/adapters/vue.js.map +0 -1
- package/dist/astro-BcckVQ-2.d.ts +0 -19
- package/dist/astro-BcckVQ-2.d.ts.map +0 -1
- package/dist/bun-DYPhytPs.d.ts +0 -7
- package/dist/bun-DYPhytPs.d.ts.map +0 -1
- package/dist/components/index-LWFtIGRd.d.ts +0 -265
- package/dist/components/index-LWFtIGRd.d.ts.map +0 -1
- package/dist/context-BKx0jIwX.js +0 -49
- package/dist/context-BKx0jIwX.js.map +0 -1
- package/dist/esbuild-BD42nX0_.d.ts +0 -8
- package/dist/esbuild-BD42nX0_.d.ts.map +0 -1
- package/dist/farm-C3XYk4nf.d.ts +0 -7
- package/dist/farm-C3XYk4nf.d.ts.map +0 -1
- package/dist/framework/index-98dEoo0g.d.ts +0 -11
- package/dist/framework/index-98dEoo0g.d.ts.map +0 -1
- package/dist/framework/index.js +0 -29
- package/dist/framework/index.js.map +0 -1
- package/dist/index-2f48-Fxc.d.ts +0 -10
- package/dist/index-2f48-Fxc.d.ts.map +0 -1
- package/dist/nuxt-BidHgMAG.d.ts +0 -5
- package/dist/nuxt-BidHgMAG.d.ts.map +0 -1
- package/dist/rolldown-CrcgSKP1.d.ts +0 -8
- package/dist/rolldown-CrcgSKP1.d.ts.map +0 -1
- package/dist/rollup-DDEc1C_K.d.ts +0 -8
- package/dist/rollup-DDEc1C_K.d.ts.map +0 -1
- package/dist/rspack-QbbymFlY.d.ts +0 -7
- package/dist/rspack-QbbymFlY.d.ts.map +0 -1
- package/dist/src-KZV_M01u.js +0 -165
- package/dist/src-KZV_M01u.js.map +0 -1
- package/dist/types-BQhWL5Qs.d.ts +0 -34
- package/dist/types-BQhWL5Qs.d.ts.map +0 -1
- package/dist/types-uxY1cMXO.d.ts +0 -28
- package/dist/types-uxY1cMXO.d.ts.map +0 -1
- package/dist/vite-9CqZQPO-.d.ts +0 -8
- package/dist/vite-9CqZQPO-.d.ts.map +0 -1
- package/dist/webpack-CBuuXltg.d.ts +0 -7
- package/dist/webpack-CBuuXltg.d.ts.map +0 -1
package/dist/components/index.js
CHANGED
|
@@ -1,566 +1,774 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// src/components/react/context.tsx
|
|
34
|
+
import { createContext, useContext } from "react";
|
|
35
|
+
import { jsx } from "react/jsx-runtime";
|
|
36
|
+
var DefaultLink = (_a) => {
|
|
37
|
+
var _b = _a, {
|
|
38
|
+
href,
|
|
39
|
+
children
|
|
40
|
+
} = _b, props = __objRest(_b, [
|
|
41
|
+
"href",
|
|
42
|
+
"children"
|
|
43
|
+
]);
|
|
44
|
+
return /* @__PURE__ */ jsx("a", __spreadProps(__spreadValues({ href }, props), { children }));
|
|
45
|
+
};
|
|
46
|
+
var DefaultImage = (_a) => {
|
|
47
|
+
var _b = _a, {
|
|
48
|
+
src,
|
|
49
|
+
alt
|
|
50
|
+
} = _b, props = __objRest(_b, [
|
|
51
|
+
"src",
|
|
52
|
+
"alt"
|
|
53
|
+
]);
|
|
54
|
+
return /* @__PURE__ */ jsx("img", __spreadValues({ src, alt }, props));
|
|
55
|
+
};
|
|
56
|
+
var defaults = {
|
|
57
|
+
Link: DefaultLink,
|
|
58
|
+
Image: DefaultImage
|
|
59
|
+
};
|
|
60
|
+
var DocuBookContext = createContext(defaults);
|
|
61
|
+
var DocuBookProvider = DocuBookContext.Provider;
|
|
62
|
+
function useDocuBook() {
|
|
63
|
+
return useContext(DocuBookContext);
|
|
64
|
+
}
|
|
7
65
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
66
|
+
// src/components/react/Note.tsx
|
|
67
|
+
import { Info, AlertTriangle, AlertCircle, CheckCircle } from "lucide-react";
|
|
68
|
+
import clsx from "clsx";
|
|
69
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
70
|
+
var noteVariants = {
|
|
71
|
+
note: "bg-blue-50 dark:bg-blue-950/30 border-blue-200 dark:border-blue-800 border-l-blue-500 text-blue-900 dark:text-blue-100",
|
|
72
|
+
danger: "bg-red-50 dark:bg-red-950/30 border-red-200 dark:border-red-800 border-l-red-500 text-red-900 dark:text-red-100",
|
|
73
|
+
warning: "bg-orange-50 dark:bg-orange-950/30 border-orange-200 dark:border-orange-800 border-l-orange-500 text-orange-900 dark:text-orange-100",
|
|
74
|
+
success: "bg-emerald-50 dark:bg-emerald-950/30 border-emerald-200 dark:border-emerald-800 border-l-emerald-500 text-emerald-900 dark:text-emerald-100"
|
|
14
75
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
76
|
+
var iconMap = {
|
|
77
|
+
note: Info,
|
|
78
|
+
danger: AlertCircle,
|
|
79
|
+
warning: AlertTriangle,
|
|
80
|
+
success: CheckCircle
|
|
20
81
|
};
|
|
21
|
-
function Note(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
82
|
+
function Note(_a) {
|
|
83
|
+
var _b = _a, {
|
|
84
|
+
className,
|
|
85
|
+
title = "Note",
|
|
86
|
+
type = "note",
|
|
87
|
+
children
|
|
88
|
+
} = _b, props = __objRest(_b, [
|
|
89
|
+
"className",
|
|
90
|
+
"title",
|
|
91
|
+
"type",
|
|
92
|
+
"children"
|
|
93
|
+
]);
|
|
94
|
+
const Icon = iconMap[type];
|
|
95
|
+
return /* @__PURE__ */ jsxs(
|
|
96
|
+
"div",
|
|
97
|
+
__spreadProps(__spreadValues({
|
|
98
|
+
className: clsx(
|
|
99
|
+
"relative w-full rounded-lg border border-l-4 p-4 mb-4",
|
|
100
|
+
noteVariants[type],
|
|
101
|
+
className
|
|
102
|
+
)
|
|
103
|
+
}, props), {
|
|
104
|
+
children: [
|
|
105
|
+
/* @__PURE__ */ jsx2("div", { className: "absolute left-4 top-4", children: /* @__PURE__ */ jsx2(Icon, { className: "w-5 h-5" }) }),
|
|
106
|
+
/* @__PURE__ */ jsxs("div", { className: "pl-8", children: [
|
|
107
|
+
/* @__PURE__ */ jsx2("h5", { className: "mb-1 font-medium leading-none tracking-tight", children: title }),
|
|
108
|
+
/* @__PURE__ */ jsx2("div", { className: "text-sm opacity-90", children })
|
|
109
|
+
] })
|
|
110
|
+
]
|
|
111
|
+
})
|
|
112
|
+
);
|
|
40
113
|
}
|
|
41
114
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
115
|
+
// src/components/react/Card.tsx
|
|
116
|
+
import * as Icons from "lucide-react";
|
|
117
|
+
import clsx2 from "clsx";
|
|
118
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
119
|
+
var Card = ({ title, icon, href, horizontal, children, className }) => {
|
|
120
|
+
const { Link } = useDocuBook();
|
|
121
|
+
const Icon = icon ? Icons[icon] : null;
|
|
122
|
+
const content = /* @__PURE__ */ jsxs2(
|
|
123
|
+
"div",
|
|
124
|
+
{
|
|
125
|
+
className: clsx2(
|
|
126
|
+
"border rounded-lg shadow-sm p-4 transition-all duration-200",
|
|
127
|
+
"bg-card text-card-foreground border-border",
|
|
128
|
+
"hover:bg-accent/5 hover:border-accent/30",
|
|
129
|
+
"flex gap-2",
|
|
130
|
+
horizontal ? "flex-row items-center gap-1" : "flex-col space-y-1",
|
|
131
|
+
className
|
|
132
|
+
),
|
|
133
|
+
children: [
|
|
134
|
+
Icon && /* @__PURE__ */ jsx3(Icon, { className: "w-5 h-5 text-primary flex-shrink-0" }),
|
|
135
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex-1 min-w-0 my-auto h-full", children: [
|
|
136
|
+
/* @__PURE__ */ jsx3("span", { className: "text-base font-semibold text-foreground", children: title }),
|
|
137
|
+
/* @__PURE__ */ jsx3("div", { className: "text-sm text-muted-foreground -mt-3", children })
|
|
138
|
+
] })
|
|
139
|
+
]
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
return href ? /* @__PURE__ */ jsx3(Link, { className: "no-underline block", href, children: content }) : content;
|
|
65
143
|
};
|
|
66
144
|
|
|
67
|
-
|
|
68
|
-
|
|
145
|
+
// src/components/react/CardGroup.tsx
|
|
146
|
+
import React2 from "react";
|
|
147
|
+
import clsx3 from "clsx";
|
|
148
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
69
149
|
function CardGroup({ children, cols = 2, className }) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
children: cardsArray.map((card, index) => /* @__PURE__ */ jsx("div", { children: card }, index))
|
|
79
|
-
});
|
|
150
|
+
const cardsArray = React2.Children.toArray(children);
|
|
151
|
+
const gridColsClass = {
|
|
152
|
+
1: "grid-cols-1",
|
|
153
|
+
2: "grid-cols-1 sm:grid-cols-2",
|
|
154
|
+
3: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",
|
|
155
|
+
4: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4"
|
|
156
|
+
};
|
|
157
|
+
return /* @__PURE__ */ jsx4("div", { className: clsx3("grid gap-4", gridColsClass[cols] || "grid-cols-1 sm:grid-cols-2", className), children: cardsArray.map((card, index) => /* @__PURE__ */ jsx4("div", { children: card }, index)) });
|
|
80
158
|
}
|
|
81
159
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
*
|
|
86
|
-
|
|
87
|
-
const AccordionGroupContext = createContext({ inGroup: false });
|
|
160
|
+
// src/components/react/Accordion.tsx
|
|
161
|
+
import { useState, useContext as useContext2 } from "react";
|
|
162
|
+
import { ChevronRight } from "lucide-react";
|
|
163
|
+
import * as Icons2 from "lucide-react";
|
|
164
|
+
import clsx4 from "clsx";
|
|
88
165
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
166
|
+
// src/components/react/AccordionContext.tsx
|
|
167
|
+
import { createContext as createContext2 } from "react";
|
|
168
|
+
var AccordionGroupContext = createContext2({
|
|
169
|
+
inGroup: false
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
// src/components/react/Accordion.tsx
|
|
173
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
174
|
+
var Accordion = ({
|
|
175
|
+
title,
|
|
176
|
+
children,
|
|
177
|
+
defaultOpen = false,
|
|
178
|
+
icon
|
|
179
|
+
}) => {
|
|
180
|
+
const groupContext = useContext2(AccordionGroupContext);
|
|
181
|
+
const isInGroup = (groupContext == null ? void 0 : groupContext.inGroup) === true;
|
|
182
|
+
const [isOpen, setIsOpen] = useState(defaultOpen);
|
|
183
|
+
const Icon = icon ? Icons2[icon] : null;
|
|
184
|
+
return /* @__PURE__ */ jsxs3(
|
|
185
|
+
"div",
|
|
186
|
+
{
|
|
187
|
+
className: clsx4(
|
|
188
|
+
!isInGroup && "border rounded-lg shadow-sm",
|
|
189
|
+
isInGroup && "border-b last:border-b-0 border-border"
|
|
190
|
+
),
|
|
191
|
+
children: [
|
|
192
|
+
/* @__PURE__ */ jsxs3(
|
|
193
|
+
"button",
|
|
194
|
+
{
|
|
195
|
+
type: "button",
|
|
196
|
+
onClick: () => setIsOpen(!isOpen),
|
|
197
|
+
className: "flex items-center gap-2 w-full px-4 py-3 transition-colors bg-muted/40 dark:bg-muted/20 hover:bg-muted/70 dark:hover:bg-muted/70 cursor-pointer text-start",
|
|
198
|
+
children: [
|
|
199
|
+
/* @__PURE__ */ jsx5(
|
|
200
|
+
ChevronRight,
|
|
201
|
+
{
|
|
202
|
+
className: clsx4(
|
|
203
|
+
"w-4 h-4 text-muted-foreground transition-transform duration-200 flex-shrink-0",
|
|
204
|
+
isOpen && "rotate-90"
|
|
205
|
+
)
|
|
206
|
+
}
|
|
207
|
+
),
|
|
208
|
+
Icon && /* @__PURE__ */ jsx5(Icon, { className: "text-foreground w-4 h-4 flex-shrink-0" }),
|
|
209
|
+
/* @__PURE__ */ jsx5("h3", { className: "font-medium text-base text-foreground !m-0", children: title })
|
|
210
|
+
]
|
|
211
|
+
}
|
|
212
|
+
),
|
|
213
|
+
isOpen && /* @__PURE__ */ jsx5("div", { className: "px-4 py-3 dark:bg-muted/10 bg-muted/15", children })
|
|
214
|
+
]
|
|
215
|
+
}
|
|
216
|
+
);
|
|
114
217
|
};
|
|
218
|
+
var Accordion_default = Accordion;
|
|
115
219
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
220
|
+
// src/components/react/AccordionGroup.tsx
|
|
221
|
+
import clsx5 from "clsx";
|
|
222
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
223
|
+
var AccordionGroup = ({ children, className }) => {
|
|
224
|
+
return /* @__PURE__ */ jsx6(AccordionGroupContext.Provider, { value: { inGroup: true }, children: /* @__PURE__ */ jsx6(
|
|
225
|
+
"div",
|
|
226
|
+
{
|
|
227
|
+
className: clsx5(
|
|
228
|
+
"border rounded-lg overflow-hidden",
|
|
229
|
+
className
|
|
230
|
+
),
|
|
231
|
+
children
|
|
232
|
+
}
|
|
233
|
+
) });
|
|
126
234
|
};
|
|
235
|
+
var AccordionGroup_default = AccordionGroup;
|
|
127
236
|
|
|
128
|
-
|
|
129
|
-
|
|
237
|
+
// src/components/react/Stepper.tsx
|
|
238
|
+
import { Children } from "react";
|
|
239
|
+
import clsx6 from "clsx";
|
|
240
|
+
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
130
241
|
function Stepper({ children }) {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
242
|
+
const length = Children.count(children);
|
|
243
|
+
return /* @__PURE__ */ jsx7("div", { className: "flex flex-col", children: Children.map(children, (child, index) => /* @__PURE__ */ jsxs4(
|
|
244
|
+
"div",
|
|
245
|
+
{
|
|
246
|
+
className: clsx6(
|
|
247
|
+
"border-l border-gray-200 dark:border-gray-700 pl-9 ml-3 relative",
|
|
248
|
+
index < length - 1 && "pb-5"
|
|
249
|
+
),
|
|
250
|
+
children: [
|
|
251
|
+
/* @__PURE__ */ jsx7("div", { className: "bg-gray-100 dark:bg-gray-800 text-gray-500 dark:text-gray-400 w-8 h-8 text-xs font-medium rounded-md border border-gray-300/50 dark:border-gray-600/50 flex items-center justify-center absolute -left-4 font-mono", children: index + 1 }),
|
|
252
|
+
child
|
|
253
|
+
]
|
|
254
|
+
}
|
|
255
|
+
)) });
|
|
142
256
|
}
|
|
143
|
-
function StepperItem({
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
257
|
+
function StepperItem({
|
|
258
|
+
children,
|
|
259
|
+
title
|
|
260
|
+
}) {
|
|
261
|
+
return /* @__PURE__ */ jsxs4("div", { className: "pt-0.5", children: [
|
|
262
|
+
title && /* @__PURE__ */ jsx7("h4", { className: "mt-0", children: title }),
|
|
263
|
+
/* @__PURE__ */ jsx7("div", { children })
|
|
264
|
+
] });
|
|
151
265
|
}
|
|
152
266
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
267
|
+
// src/components/react/FileTree.tsx
|
|
268
|
+
import React4, { useState as useState2, Children as Children2, isValidElement, cloneElement } from "react";
|
|
269
|
+
import { ChevronRight as ChevronRightIcon, File as FileIcon, Folder as FolderIcon, FolderOpen as FolderOpenIcon } from "lucide-react";
|
|
270
|
+
import clsx7 from "clsx";
|
|
271
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
272
|
+
var FileComponent = ({ name }) => {
|
|
273
|
+
var _a;
|
|
274
|
+
const [isHovered, setIsHovered] = useState2(false);
|
|
275
|
+
const fileExtension = (_a = name.split(".").pop()) == null ? void 0 : _a.toUpperCase();
|
|
276
|
+
return /* @__PURE__ */ jsxs5(
|
|
277
|
+
"div",
|
|
278
|
+
{
|
|
279
|
+
className: clsx7(
|
|
280
|
+
"flex items-center gap-2 py-1.5 pl-7 pr-3 text-sm rounded-md transition-colors duration-150 cursor-default select-none",
|
|
281
|
+
isHovered ? "bg-blue-50 dark:bg-blue-950/20" : "hover:bg-gray-100/50 dark:hover:bg-gray-800/50"
|
|
282
|
+
),
|
|
283
|
+
onMouseEnter: () => setIsHovered(true),
|
|
284
|
+
onMouseLeave: () => setIsHovered(false),
|
|
285
|
+
tabIndex: -1,
|
|
286
|
+
children: [
|
|
287
|
+
/* @__PURE__ */ jsx8(
|
|
288
|
+
FileIcon,
|
|
289
|
+
{
|
|
290
|
+
className: clsx7(
|
|
291
|
+
"flex-shrink-0 transition-colors",
|
|
292
|
+
isHovered ? "text-blue-500" : "text-gray-400 dark:text-gray-500"
|
|
293
|
+
)
|
|
294
|
+
}
|
|
295
|
+
),
|
|
296
|
+
/* @__PURE__ */ jsx8("span", { className: "font-mono text-sm truncate", children: name }),
|
|
297
|
+
isHovered && fileExtension && /* @__PURE__ */ jsx8("span", { className: "ml-auto text-xs text-gray-400/80", children: fileExtension })
|
|
298
|
+
]
|
|
299
|
+
}
|
|
300
|
+
);
|
|
175
301
|
};
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
302
|
+
var FolderComponent = ({ name, children }) => {
|
|
303
|
+
const [isOpen, setIsOpen] = useState2(true);
|
|
304
|
+
const [isHovered, setIsHovered] = useState2(false);
|
|
305
|
+
const hasChildren = React4.Children.count(children) > 0;
|
|
306
|
+
return /* @__PURE__ */ jsxs5("div", { className: "relative", children: [
|
|
307
|
+
/* @__PURE__ */ jsxs5(
|
|
308
|
+
"div",
|
|
309
|
+
{
|
|
310
|
+
className: clsx7(
|
|
311
|
+
"flex items-center gap-2 py-1.5 pl-4 pr-3 rounded-md transition-colors duration-150 select-none",
|
|
312
|
+
isHovered && "bg-gray-100/60 dark:bg-gray-800/60",
|
|
313
|
+
isOpen ? "text-gray-900 dark:text-gray-100" : "text-gray-700 dark:text-gray-300",
|
|
314
|
+
hasChildren ? "cursor-pointer" : "cursor-default"
|
|
315
|
+
),
|
|
316
|
+
onClick: () => hasChildren && setIsOpen(!isOpen),
|
|
317
|
+
onMouseEnter: () => setIsHovered(true),
|
|
318
|
+
onMouseLeave: () => setIsHovered(false),
|
|
319
|
+
tabIndex: -1,
|
|
320
|
+
onKeyDown: (e) => e.preventDefault(),
|
|
321
|
+
children: [
|
|
322
|
+
hasChildren ? /* @__PURE__ */ jsx8(
|
|
323
|
+
ChevronRightIcon,
|
|
324
|
+
{
|
|
325
|
+
className: clsx7(
|
|
326
|
+
"flex-shrink-0 transition-transform duration-200",
|
|
327
|
+
isOpen && "rotate-90",
|
|
328
|
+
isHovered ? "text-gray-600 dark:text-gray-400" : "text-gray-400 dark:text-gray-500"
|
|
329
|
+
)
|
|
330
|
+
}
|
|
331
|
+
) : /* @__PURE__ */ jsx8("div", { className: "w-3.5" }),
|
|
332
|
+
isOpen ? /* @__PURE__ */ jsx8(
|
|
333
|
+
FolderOpenIcon,
|
|
334
|
+
{
|
|
335
|
+
className: clsx7(
|
|
336
|
+
"flex-shrink-0 transition-colors",
|
|
337
|
+
isHovered ? "text-blue-500" : "text-gray-400 dark:text-gray-500"
|
|
338
|
+
)
|
|
339
|
+
}
|
|
340
|
+
) : /* @__PURE__ */ jsx8(
|
|
341
|
+
FolderIcon,
|
|
342
|
+
{
|
|
343
|
+
className: clsx7(
|
|
344
|
+
"flex-shrink-0 transition-colors",
|
|
345
|
+
isHovered ? "text-blue-400" : "text-gray-400/80 dark:text-gray-500/80"
|
|
346
|
+
)
|
|
347
|
+
}
|
|
348
|
+
),
|
|
349
|
+
/* @__PURE__ */ jsx8(
|
|
350
|
+
"span",
|
|
351
|
+
{
|
|
352
|
+
className: clsx7(
|
|
353
|
+
"font-medium transition-colors duration-150",
|
|
354
|
+
isHovered && "text-blue-500"
|
|
355
|
+
),
|
|
356
|
+
children: name
|
|
357
|
+
}
|
|
358
|
+
)
|
|
359
|
+
]
|
|
360
|
+
}
|
|
361
|
+
),
|
|
362
|
+
isOpen && hasChildren && /* @__PURE__ */ jsx8("div", { className: "ml-5 border-l-2 border-gray-200/50 dark:border-gray-700/50 pl-2", children })
|
|
363
|
+
] });
|
|
202
364
|
};
|
|
203
365
|
function Files({ children }) {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
366
|
+
return /* @__PURE__ */ jsx8(
|
|
367
|
+
"div",
|
|
368
|
+
{
|
|
369
|
+
className: "rounded-xl border border-gray-200/20 dark:border-gray-700/20 bg-white/20 dark:bg-gray-900/20 backdrop-blur-sm shadow-sm overflow-hidden transition-all duration-200 hover:shadow-md hover:border-gray-300/60 dark:hover:border-gray-600/60",
|
|
370
|
+
onKeyDown: (e) => e.preventDefault(),
|
|
371
|
+
children: /* @__PURE__ */ jsx8("div", { className: "p-2", children: Children2.map(children, (child, index) => {
|
|
372
|
+
if (isValidElement(child)) {
|
|
373
|
+
return cloneElement(child, { key: index });
|
|
374
|
+
}
|
|
375
|
+
return null;
|
|
376
|
+
}) })
|
|
377
|
+
}
|
|
378
|
+
);
|
|
215
379
|
}
|
|
216
380
|
function Folder({ name, children }) {
|
|
217
|
-
|
|
218
|
-
name,
|
|
219
|
-
children
|
|
220
|
-
});
|
|
381
|
+
return /* @__PURE__ */ jsx8(FolderComponent, { name, children });
|
|
221
382
|
}
|
|
222
383
|
function File({ name }) {
|
|
223
|
-
|
|
384
|
+
return /* @__PURE__ */ jsx8(FileComponent, { name });
|
|
224
385
|
}
|
|
225
386
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
387
|
+
// src/components/react/Kbd.tsx
|
|
388
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
389
|
+
var macKeyMap = {
|
|
390
|
+
command: "\u2318",
|
|
391
|
+
cmd: "\u2318",
|
|
392
|
+
option: "\u2325",
|
|
393
|
+
alt: "\u2325",
|
|
394
|
+
shift: "\u21E7",
|
|
395
|
+
ctrl: "\u2303",
|
|
396
|
+
control: "\u2303",
|
|
397
|
+
tab: "\u21E5",
|
|
398
|
+
caps: "\u21EA",
|
|
399
|
+
enter: "\u23CE",
|
|
400
|
+
return: "\u23CE",
|
|
401
|
+
delete: "\u232B",
|
|
402
|
+
escape: "\u238B",
|
|
403
|
+
esc: "\u238B",
|
|
404
|
+
up: "\u2191",
|
|
405
|
+
down: "\u2193",
|
|
406
|
+
left: "\u2190",
|
|
407
|
+
right: "\u2192",
|
|
408
|
+
space: "\u2423"
|
|
248
409
|
};
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
410
|
+
var windowsKeyMap = {
|
|
411
|
+
command: "Win",
|
|
412
|
+
cmd: "Win",
|
|
413
|
+
option: "Alt",
|
|
414
|
+
alt: "Alt",
|
|
415
|
+
ctrl: "Ctrl",
|
|
416
|
+
control: "Ctrl",
|
|
417
|
+
delete: "Del",
|
|
418
|
+
escape: "Esc",
|
|
419
|
+
esc: "Esc",
|
|
420
|
+
enter: "Enter",
|
|
421
|
+
return: "Enter",
|
|
422
|
+
tab: "Tab",
|
|
423
|
+
caps: "Caps",
|
|
424
|
+
shift: "Shift",
|
|
425
|
+
space: "Space",
|
|
426
|
+
up: "\u2191",
|
|
427
|
+
down: "\u2193",
|
|
428
|
+
left: "\u2190",
|
|
429
|
+
right: "\u2192"
|
|
269
430
|
};
|
|
270
|
-
function Kbd(
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
431
|
+
function Kbd(_a) {
|
|
432
|
+
var _b = _a, { show: keyProp, type = "window", children } = _b, props = __objRest(_b, ["show", "type", "children"]);
|
|
433
|
+
const getKeyDisplay = () => {
|
|
434
|
+
if (!keyProp || typeof keyProp !== "string") return null;
|
|
435
|
+
const lowerKey = keyProp.toLowerCase();
|
|
436
|
+
if (type === "mac") return macKeyMap[lowerKey] || keyProp;
|
|
437
|
+
return windowsKeyMap[lowerKey] || keyProp.charAt(0).toUpperCase() + keyProp.slice(1);
|
|
438
|
+
};
|
|
439
|
+
const renderContent = () => {
|
|
440
|
+
if (children !== void 0 && children !== null && children !== "") return children;
|
|
441
|
+
return getKeyDisplay() || keyProp || "";
|
|
442
|
+
};
|
|
443
|
+
return /* @__PURE__ */ jsx9(
|
|
444
|
+
"kbd",
|
|
445
|
+
__spreadProps(__spreadValues({
|
|
446
|
+
className: "inline-flex items-center justify-center px-2 py-1 mx-0.5 text-xs font-mono font-medium bg-gray-100 dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-md"
|
|
447
|
+
}, props), {
|
|
448
|
+
children: renderContent()
|
|
449
|
+
})
|
|
450
|
+
);
|
|
286
451
|
}
|
|
287
452
|
|
|
288
|
-
|
|
289
|
-
|
|
453
|
+
// src/components/react/Tooltip.tsx
|
|
454
|
+
import { useState as useState3 } from "react";
|
|
455
|
+
import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
290
456
|
function Tooltip({ text, tip }) {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
457
|
+
const [visible, setVisible] = useState3(false);
|
|
458
|
+
return /* @__PURE__ */ jsxs6(
|
|
459
|
+
"span",
|
|
460
|
+
{
|
|
461
|
+
className: "relative inline-flex items-center cursor-help text-blue-600 dark:text-blue-400 hover:text-blue-500 dark:hover:text-blue-300 transition-colors",
|
|
462
|
+
onMouseEnter: () => setVisible(true),
|
|
463
|
+
onMouseLeave: () => setVisible(false),
|
|
464
|
+
children: [
|
|
465
|
+
/* @__PURE__ */ jsx10("span", { className: "border-b border-dashed border-blue-500/60 pb-0.5", children: text }),
|
|
466
|
+
visible && /* @__PURE__ */ jsxs6("span", { className: "absolute bottom-full left-1/2 -translate-x-1/2 mb-3 w-64 bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 text-sm p-3 rounded-md shadow-lg border border-gray-200/50 dark:border-gray-700/50 break-words text-left z-50", children: [
|
|
467
|
+
tip,
|
|
468
|
+
/* @__PURE__ */ jsx10("span", { className: "absolute -bottom-1.5 left-1/2 -translate-x-1/2 w-3 h-3 bg-white dark:bg-gray-800 rotate-45 border-b border-r border-gray-200/50 dark:border-gray-700/50 -z-10" })
|
|
469
|
+
] })
|
|
470
|
+
]
|
|
471
|
+
}
|
|
472
|
+
);
|
|
304
473
|
}
|
|
305
474
|
|
|
306
|
-
|
|
307
|
-
|
|
475
|
+
// src/components/react/Youtube.tsx
|
|
476
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
308
477
|
function Youtube({ videoId, className }) {
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
478
|
+
return /* @__PURE__ */ jsx11("div", { className: `aspect-video w-full ${className || ""}`, children: /* @__PURE__ */ jsx11(
|
|
479
|
+
"iframe",
|
|
480
|
+
{
|
|
481
|
+
src: `https://www.youtube.com/embed/${videoId}?rel=0&modestbranding=1&showinfo=0&autohide=1&controls=1`,
|
|
482
|
+
title: "YouTube video player",
|
|
483
|
+
frameBorder: "0",
|
|
484
|
+
allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",
|
|
485
|
+
allowFullScreen: true,
|
|
486
|
+
className: "w-full h-full rounded-lg"
|
|
487
|
+
}
|
|
488
|
+
) });
|
|
320
489
|
}
|
|
321
490
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
491
|
+
// src/components/react/Button.tsx
|
|
492
|
+
import * as Icons3 from "lucide-react";
|
|
493
|
+
import clsx8 from "clsx";
|
|
494
|
+
import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
495
|
+
var Button = ({
|
|
496
|
+
icon,
|
|
497
|
+
text,
|
|
498
|
+
href,
|
|
499
|
+
target,
|
|
500
|
+
size = "md",
|
|
501
|
+
variation = "primary"
|
|
502
|
+
}) => {
|
|
503
|
+
const { Link } = useDocuBook();
|
|
504
|
+
const baseStyles = "inline-flex items-center justify-center rounded font-medium focus:outline-none transition no-underline";
|
|
505
|
+
const sizeStyles = {
|
|
506
|
+
sm: "px-3 py-1 my-6 text-sm",
|
|
507
|
+
md: "px-4 py-2 my-6 text-base",
|
|
508
|
+
lg: "px-5 py-3 my-6 text-lg"
|
|
509
|
+
};
|
|
510
|
+
const variationStyles = {
|
|
511
|
+
primary: "bg-primary text-white hover:bg-primary/90",
|
|
512
|
+
accent: "bg-accent text-white hover:bg-accent/90",
|
|
513
|
+
outline: "border border-accent text-accent hover:bg-accent/10"
|
|
514
|
+
};
|
|
515
|
+
const Icon = icon ? Icons3[icon] : null;
|
|
516
|
+
return /* @__PURE__ */ jsxs7(
|
|
517
|
+
Link,
|
|
518
|
+
{
|
|
519
|
+
href,
|
|
520
|
+
target,
|
|
521
|
+
rel: target === "_blank" ? "noopener noreferrer" : void 0,
|
|
522
|
+
className: clsx8(baseStyles, sizeStyles[size], variationStyles[variation]),
|
|
523
|
+
children: [
|
|
524
|
+
text && /* @__PURE__ */ jsx12("span", { children: text }),
|
|
525
|
+
Icon && /* @__PURE__ */ jsx12(Icon, { className: "mr-2 h-5 w-5" })
|
|
526
|
+
]
|
|
527
|
+
}
|
|
528
|
+
);
|
|
345
529
|
};
|
|
530
|
+
var Button_default = Button;
|
|
346
531
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
});
|
|
532
|
+
// src/components/react/Link.tsx
|
|
533
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
534
|
+
function DocuLink(_a) {
|
|
535
|
+
var _b = _a, { href } = _b, props = __objRest(_b, ["href"]);
|
|
536
|
+
const { Link } = useDocuBook();
|
|
537
|
+
if (!href) return null;
|
|
538
|
+
return /* @__PURE__ */ jsx13(
|
|
539
|
+
Link,
|
|
540
|
+
__spreadValues({
|
|
541
|
+
href,
|
|
542
|
+
target: "_blank",
|
|
543
|
+
rel: "noopener noreferrer"
|
|
544
|
+
}, props)
|
|
545
|
+
);
|
|
362
546
|
}
|
|
363
547
|
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
548
|
+
// src/components/react/Image.tsx
|
|
549
|
+
import { useState as useState4, useEffect } from "react";
|
|
550
|
+
import { Search, X } from "lucide-react";
|
|
551
|
+
import { Fragment, jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
552
|
+
function DocuImage(_a) {
|
|
553
|
+
var _b = _a, {
|
|
554
|
+
src,
|
|
555
|
+
alt = "alt",
|
|
556
|
+
width = 800,
|
|
557
|
+
height = 350,
|
|
558
|
+
className
|
|
559
|
+
} = _b, props = __objRest(_b, [
|
|
560
|
+
"src",
|
|
561
|
+
"alt",
|
|
562
|
+
"width",
|
|
563
|
+
"height",
|
|
564
|
+
"className"
|
|
565
|
+
]);
|
|
566
|
+
const { Image } = useDocuBook();
|
|
567
|
+
const [isOpen, setIsOpen] = useState4(false);
|
|
568
|
+
useEffect(() => {
|
|
569
|
+
if (isOpen) {
|
|
570
|
+
document.body.style.overflow = "hidden";
|
|
571
|
+
const handleEsc = (e) => {
|
|
572
|
+
if (e.key === "Escape") setIsOpen(false);
|
|
573
|
+
};
|
|
574
|
+
window.addEventListener("keydown", handleEsc);
|
|
575
|
+
return () => {
|
|
576
|
+
document.body.style.overflow = "auto";
|
|
577
|
+
window.removeEventListener("keydown", handleEsc);
|
|
578
|
+
};
|
|
579
|
+
}
|
|
580
|
+
}, [isOpen]);
|
|
581
|
+
if (!src) return null;
|
|
582
|
+
return /* @__PURE__ */ jsxs8(Fragment, { children: [
|
|
583
|
+
/* @__PURE__ */ jsxs8(
|
|
584
|
+
"button",
|
|
585
|
+
{
|
|
586
|
+
type: "button",
|
|
587
|
+
className: "relative group cursor-zoom-in my-6 w-full flex justify-center rounded-lg",
|
|
588
|
+
onClick: () => setIsOpen(true),
|
|
589
|
+
"aria-label": "Zoom image",
|
|
590
|
+
children: [
|
|
591
|
+
/* @__PURE__ */ jsx14("span", { className: "absolute inset-0 bg-black/0 group-hover:bg-black/5 transition-colors z-10 flex items-center justify-center opacity-0 group-hover:opacity-100 rounded-lg", children: /* @__PURE__ */ jsx14(Search, { className: "w-8 h-8 text-white drop-shadow-md" }) }),
|
|
592
|
+
/* @__PURE__ */ jsx14(
|
|
593
|
+
Image,
|
|
594
|
+
__spreadValues({
|
|
595
|
+
src,
|
|
596
|
+
alt,
|
|
597
|
+
width,
|
|
598
|
+
height,
|
|
599
|
+
className: `w-full h-auto rounded-lg transition-transform duration-300 group-hover:scale-[1.01] ${className || ""}`
|
|
600
|
+
}, props)
|
|
601
|
+
)
|
|
602
|
+
]
|
|
603
|
+
}
|
|
604
|
+
),
|
|
605
|
+
isOpen && /* @__PURE__ */ jsxs8(
|
|
606
|
+
"div",
|
|
607
|
+
{
|
|
608
|
+
className: "fixed inset-0 z-[99999] flex items-center justify-center bg-black/90 backdrop-blur-md p-4 md:p-10 cursor-zoom-out",
|
|
609
|
+
onClick: () => setIsOpen(false),
|
|
610
|
+
children: [
|
|
611
|
+
/* @__PURE__ */ jsx14(
|
|
612
|
+
"button",
|
|
613
|
+
{
|
|
614
|
+
className: "absolute top-4 right-4 z-50 p-2 text-white/70 hover:text-white bg-black/20 hover:bg-white/10 rounded-full transition-colors",
|
|
615
|
+
onClick: (e) => {
|
|
616
|
+
e.stopPropagation();
|
|
617
|
+
setIsOpen(false);
|
|
618
|
+
},
|
|
619
|
+
children: /* @__PURE__ */ jsx14(X, { className: "w-6 h-6" })
|
|
620
|
+
}
|
|
621
|
+
),
|
|
622
|
+
/* @__PURE__ */ jsx14("div", { className: "relative max-w-7xl w-full h-full flex items-center justify-center", children: /* @__PURE__ */ jsx14(
|
|
623
|
+
Image,
|
|
624
|
+
{
|
|
625
|
+
src,
|
|
626
|
+
alt,
|
|
627
|
+
width: 1920,
|
|
628
|
+
height: 1080,
|
|
629
|
+
className: "object-contain max-h-[90vh] w-auto h-auto rounded-md shadow-2xl"
|
|
630
|
+
}
|
|
631
|
+
) }),
|
|
632
|
+
alt && alt !== "alt" && /* @__PURE__ */ jsx14("div", { className: "absolute bottom-6 left-1/2 -translate-x-1/2 bg-black/60 text-white px-4 py-2 rounded-full text-sm font-medium backdrop-blur-md border border-white/10", children: alt })
|
|
633
|
+
]
|
|
634
|
+
}
|
|
635
|
+
)
|
|
636
|
+
] });
|
|
431
637
|
}
|
|
432
638
|
|
|
433
|
-
|
|
434
|
-
|
|
639
|
+
// src/components/react/Release.tsx
|
|
640
|
+
import React7 from "react";
|
|
641
|
+
import { Plus, Wrench, Zap, AlertTriangle as AlertTriangle2, XCircle } from "lucide-react";
|
|
642
|
+
import clsx9 from "clsx";
|
|
643
|
+
import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
435
644
|
function Release({ version, title, date, children }) {
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
/* @__PURE__ */ jsx("div", {
|
|
462
|
-
className: "space-y-8",
|
|
463
|
-
children
|
|
464
|
-
})
|
|
465
|
-
]
|
|
466
|
-
});
|
|
645
|
+
return /* @__PURE__ */ jsxs9("div", { className: "mb-16 group", children: [
|
|
646
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-3 mt-6 mb-2", children: [
|
|
647
|
+
/* @__PURE__ */ jsxs9(
|
|
648
|
+
"div",
|
|
649
|
+
{
|
|
650
|
+
id: version,
|
|
651
|
+
className: "inline-flex items-center rounded-full border border-blue-500/20 bg-blue-500/10 px-3 py-1 text-sm font-semibold text-blue-600 dark:text-blue-400 transition-colors hover:bg-blue-500/15 scroll-m-20 backdrop-blur-sm",
|
|
652
|
+
children: [
|
|
653
|
+
"v",
|
|
654
|
+
version
|
|
655
|
+
]
|
|
656
|
+
}
|
|
657
|
+
),
|
|
658
|
+
date && /* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-3 text-sm font-medium text-gray-500 dark:text-gray-400", children: [
|
|
659
|
+
/* @__PURE__ */ jsx15("span", { className: "h-1 w-1 rounded-full bg-gray-400/30" }),
|
|
660
|
+
/* @__PURE__ */ jsx15("time", { dateTime: date, children: new Date(date).toLocaleDateString("en-US", {
|
|
661
|
+
year: "numeric",
|
|
662
|
+
month: "long",
|
|
663
|
+
day: "numeric"
|
|
664
|
+
}) })
|
|
665
|
+
] })
|
|
666
|
+
] }),
|
|
667
|
+
/* @__PURE__ */ jsx15("h3", { className: "text-2xl font-bold text-gray-900/90 dark:text-gray-100/90 mb-6 mt-0", children: title }),
|
|
668
|
+
/* @__PURE__ */ jsx15("div", { className: "space-y-8", children })
|
|
669
|
+
] });
|
|
467
670
|
}
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
671
|
+
var typeConfig = {
|
|
672
|
+
added: {
|
|
673
|
+
label: "Added",
|
|
674
|
+
className: "bg-green-100 dark:bg-green-900/50 text-green-700 dark:text-green-300",
|
|
675
|
+
icon: Plus
|
|
676
|
+
},
|
|
677
|
+
fixed: {
|
|
678
|
+
label: "Fixed",
|
|
679
|
+
className: "bg-yellow-100 dark:bg-yellow-900/50 text-yellow-700 dark:text-yellow-300",
|
|
680
|
+
icon: Wrench
|
|
681
|
+
},
|
|
682
|
+
improved: {
|
|
683
|
+
label: "Improved",
|
|
684
|
+
className: "bg-cyan-100 dark:bg-cyan-900/50 text-cyan-700 dark:text-cyan-300",
|
|
685
|
+
icon: Zap
|
|
686
|
+
},
|
|
687
|
+
deprecated: {
|
|
688
|
+
label: "Deprecated",
|
|
689
|
+
className: "bg-orange-100 dark:bg-orange-900/50 text-orange-700 dark:text-orange-300",
|
|
690
|
+
icon: AlertTriangle2
|
|
691
|
+
},
|
|
692
|
+
removed: {
|
|
693
|
+
label: "Removed",
|
|
694
|
+
className: "bg-pink-100 dark:bg-pink-900/50 text-pink-700 dark:text-pink-300",
|
|
695
|
+
icon: XCircle
|
|
696
|
+
}
|
|
494
697
|
};
|
|
495
698
|
function Changes({ type, children }) {
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
children: React.Children.map(children, (child, index) => {
|
|
509
|
-
return /* @__PURE__ */ jsx("li", {
|
|
510
|
-
className: "leading-relaxed",
|
|
511
|
-
children: typeof child === "string" ? child.trim().replace(/^[-*]\s+/, "") : child
|
|
512
|
-
}, index);
|
|
513
|
-
})
|
|
514
|
-
})]
|
|
515
|
-
});
|
|
699
|
+
const config = typeConfig[type] || typeConfig.added;
|
|
700
|
+
const Icon = config.icon;
|
|
701
|
+
return /* @__PURE__ */ jsxs9("div", { className: "space-y-3 mb-8", children: [
|
|
702
|
+
/* @__PURE__ */ jsx15("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxs9("div", { className: clsx9("px-3 py-1 rounded-full text-sm font-medium flex items-center gap-1.5", config.className), children: [
|
|
703
|
+
/* @__PURE__ */ jsx15(Icon, { className: "w-3.5 h-3.5" }),
|
|
704
|
+
/* @__PURE__ */ jsx15("span", { children: config.label })
|
|
705
|
+
] }) }),
|
|
706
|
+
/* @__PURE__ */ jsx15("ul", { className: "list-none pl-0 space-y-2 text-gray-700 dark:text-gray-300", children: React7.Children.map(children, (child, index) => {
|
|
707
|
+
const processedChild = typeof child === "string" ? child.trim().replace(/^[-*]\s+/, "") : child;
|
|
708
|
+
return /* @__PURE__ */ jsx15("li", { className: "leading-relaxed", children: processedChild }, index);
|
|
709
|
+
}) })
|
|
710
|
+
] });
|
|
516
711
|
}
|
|
517
712
|
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
713
|
+
// src/components/react/Copy.tsx
|
|
714
|
+
import { useState as useState5 } from "react";
|
|
715
|
+
import { Check, Copy as CopyIcon } from "lucide-react";
|
|
716
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
717
|
+
var Copy = ({ content }) => {
|
|
718
|
+
const [isCopied, setIsCopied] = useState5(false);
|
|
719
|
+
async function handleCopy() {
|
|
720
|
+
await navigator.clipboard.writeText(content);
|
|
721
|
+
setIsCopied(true);
|
|
722
|
+
setTimeout(() => {
|
|
723
|
+
setIsCopied(false);
|
|
724
|
+
}, 2e3);
|
|
725
|
+
}
|
|
726
|
+
return /* @__PURE__ */ jsx16(
|
|
727
|
+
"button",
|
|
728
|
+
{
|
|
729
|
+
type: "button",
|
|
730
|
+
className: "inline-flex items-center justify-center px-2 py-1 text-xs font-medium border rounded transition-colors bg-muted hover:bg-muted/70 border-border cursor-copy",
|
|
731
|
+
onClick: handleCopy,
|
|
732
|
+
children: isCopied ? /* @__PURE__ */ jsx16(Check, { className: "w-3 h-3" }) : /* @__PURE__ */ jsx16(CopyIcon, { className: "w-3 h-3" })
|
|
733
|
+
}
|
|
734
|
+
);
|
|
535
735
|
};
|
|
736
|
+
var Copy_default = Copy;
|
|
536
737
|
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
function Pre(
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
!!title && /* @__PURE__ */ jsx("div", {
|
|
549
|
-
className: "flex items-center gap-2 px-4 py-2 text-sm font-medium border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800/50",
|
|
550
|
-
children: /* @__PURE__ */ jsx("span", { children: title })
|
|
551
|
-
}),
|
|
552
|
-
/* @__PURE__ */ jsx("div", {
|
|
553
|
-
className: "overflow-x-auto",
|
|
554
|
-
children: /* @__PURE__ */ jsx("pre", {
|
|
555
|
-
className,
|
|
556
|
-
...restProps,
|
|
557
|
-
children
|
|
558
|
-
})
|
|
559
|
-
})
|
|
560
|
-
]
|
|
561
|
-
});
|
|
738
|
+
// src/components/react/Pre.tsx
|
|
739
|
+
import { jsx as jsx17, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
740
|
+
function Pre(_a) {
|
|
741
|
+
var _b = _a, { children, raw } = _b, rest = __objRest(_b, ["children", "raw"]);
|
|
742
|
+
const _a2 = rest, { "data-title": title, className } = _a2, restProps = __objRest(_a2, ["data-title", "className"]);
|
|
743
|
+
const hasTitle = !!title;
|
|
744
|
+
return /* @__PURE__ */ jsxs10("div", { className: "relative rounded-lg border border-gray-200 dark:border-gray-700 my-4 overflow-hidden", children: [
|
|
745
|
+
/* @__PURE__ */ jsx17("div", { className: "absolute top-2 right-2 z-10", children: raw && /* @__PURE__ */ jsx17(Copy_default, { content: raw }) }),
|
|
746
|
+
hasTitle && /* @__PURE__ */ jsx17("div", { className: "flex items-center gap-2 px-4 py-2 text-sm font-medium border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800/50", children: /* @__PURE__ */ jsx17("span", { children: title }) }),
|
|
747
|
+
/* @__PURE__ */ jsx17("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsx17("pre", __spreadProps(__spreadValues({ className }, restProps), { children })) })
|
|
748
|
+
] });
|
|
562
749
|
}
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
750
|
+
export {
|
|
751
|
+
Accordion_default as Accordion,
|
|
752
|
+
AccordionGroup_default as AccordionGroup,
|
|
753
|
+
Button_default as Button,
|
|
754
|
+
Card,
|
|
755
|
+
CardGroup,
|
|
756
|
+
Changes,
|
|
757
|
+
Copy_default as Copy,
|
|
758
|
+
DocuBookProvider,
|
|
759
|
+
DocuImage,
|
|
760
|
+
DocuLink,
|
|
761
|
+
File,
|
|
762
|
+
Files,
|
|
763
|
+
Folder,
|
|
764
|
+
Kbd,
|
|
765
|
+
Note,
|
|
766
|
+
Pre,
|
|
767
|
+
Release,
|
|
768
|
+
Stepper,
|
|
769
|
+
StepperItem,
|
|
770
|
+
Tooltip,
|
|
771
|
+
Youtube,
|
|
772
|
+
useDocuBook
|
|
773
|
+
};
|
|
566
774
|
//# sourceMappingURL=index.js.map
|