@xyd-js/framework 0.1.0-xyd.3 → 0.1.0-xyd.5
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/dist/react.js +84 -1371
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +84 -1371
- package/dist/react.mjs.map +1 -1
- package/package.json +9 -9
package/dist/react.mjs
CHANGED
|
@@ -1,1248 +1,18 @@
|
|
|
1
1
|
// packages/react/components/index.tsx
|
|
2
|
-
import
|
|
2
|
+
import React5, { isValidElement } from "react";
|
|
3
3
|
import { useLocation as useLocation3 } from "react-router";
|
|
4
4
|
import { Toc, SubNav, UISidebar as UISidebar2 } from "@xyd-js/ui";
|
|
5
|
-
|
|
6
|
-
// ../xyd-components/dist/index-C0sBj-Rt.js
|
|
7
|
-
import e, { useRef as t } from "react";
|
|
8
|
-
var n = "hutvd2b";
|
|
9
|
-
var a = "hg9oorb";
|
|
10
|
-
var r = "h6jev6x";
|
|
11
|
-
var l = "i1uvewli";
|
|
12
|
-
function c(t5) {
|
|
13
|
-
var c2 = t5.children, o3 = t5.size, i3 = void 0 === o3 ? "sm" : o3, s2 = t5.kind, d3 = void 0 === s2 ? "warning" : s2;
|
|
14
|
-
return e.createElement("div", { className: "\n ".concat(n, "\n \n ").concat("sm" === i3 && r, "\n \n ").concat("warning" === d3 && a, "\n ") }, e.createElement("span", { className: l }, c2));
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// ../xyd-components/dist/tslib.es6-nZyJ5rcw.js
|
|
18
|
-
function t2(t5, n4) {
|
|
19
|
-
var e3 = {};
|
|
20
|
-
for (var r4 in t5) Object.prototype.hasOwnProperty.call(t5, r4) && n4.indexOf(r4) < 0 && (e3[r4] = t5[r4]);
|
|
21
|
-
if (null != t5 && "function" == typeof Object.getOwnPropertySymbols) {
|
|
22
|
-
var o3 = 0;
|
|
23
|
-
for (r4 = Object.getOwnPropertySymbols(t5); o3 < r4.length; o3++) n4.indexOf(r4[o3]) < 0 && Object.prototype.propertyIsEnumerable.call(t5, r4[o3]) && (e3[r4[o3]] = t5[r4[o3]]);
|
|
24
|
-
}
|
|
25
|
-
return e3;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// ../xyd-components/dist/writer.js
|
|
29
|
-
import r3, { Fragment as n3 } from "react";
|
|
30
|
-
|
|
31
|
-
// ../../node_modules/.pnpm/@radix-ui+react-icons@1.3.2_react@18.3.1/node_modules/@radix-ui/react-icons/dist/react-icons.esm.js
|
|
32
|
-
import { forwardRef, createElement } from "react";
|
|
33
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
34
|
-
if (source == null) return {};
|
|
35
|
-
var target = {};
|
|
36
|
-
var sourceKeys = Object.keys(source);
|
|
37
|
-
var key, i3;
|
|
38
|
-
for (i3 = 0; i3 < sourceKeys.length; i3++) {
|
|
39
|
-
key = sourceKeys[i3];
|
|
40
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
41
|
-
target[key] = source[key];
|
|
42
|
-
}
|
|
43
|
-
return target;
|
|
44
|
-
}
|
|
45
|
-
var _excluded$f = ["color"];
|
|
46
|
-
var ArrowLeftIcon = /* @__PURE__ */ forwardRef(function(_ref, forwardedRef) {
|
|
47
|
-
var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, props = _objectWithoutPropertiesLoose(_ref, _excluded$f);
|
|
48
|
-
return createElement("svg", Object.assign({
|
|
49
|
-
width: "15",
|
|
50
|
-
height: "15",
|
|
51
|
-
viewBox: "0 0 15 15",
|
|
52
|
-
fill: "none",
|
|
53
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
54
|
-
}, props, {
|
|
55
|
-
ref: forwardedRef
|
|
56
|
-
}), createElement("path", {
|
|
57
|
-
d: "M6.85355 3.14645C7.04882 3.34171 7.04882 3.65829 6.85355 3.85355L3.70711 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H3.70711L6.85355 11.1464C7.04882 11.3417 7.04882 11.6583 6.85355 11.8536C6.65829 12.0488 6.34171 12.0488 6.14645 11.8536L2.14645 7.85355C1.95118 7.65829 1.95118 7.34171 2.14645 7.14645L6.14645 3.14645C6.34171 2.95118 6.65829 2.95118 6.85355 3.14645Z",
|
|
58
|
-
fill: color,
|
|
59
|
-
fillRule: "evenodd",
|
|
60
|
-
clipRule: "evenodd"
|
|
61
|
-
}));
|
|
62
|
-
});
|
|
63
|
-
var _excluded$g = ["color"];
|
|
64
|
-
var ArrowRightIcon = /* @__PURE__ */ forwardRef(function(_ref, forwardedRef) {
|
|
65
|
-
var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, props = _objectWithoutPropertiesLoose(_ref, _excluded$g);
|
|
66
|
-
return createElement("svg", Object.assign({
|
|
67
|
-
width: "15",
|
|
68
|
-
height: "15",
|
|
69
|
-
viewBox: "0 0 15 15",
|
|
70
|
-
fill: "none",
|
|
71
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
72
|
-
}, props, {
|
|
73
|
-
ref: forwardedRef
|
|
74
|
-
}), createElement("path", {
|
|
75
|
-
d: "M8.14645 3.14645C8.34171 2.95118 8.65829 2.95118 8.85355 3.14645L12.8536 7.14645C13.0488 7.34171 13.0488 7.65829 12.8536 7.85355L8.85355 11.8536C8.65829 12.0488 8.34171 12.0488 8.14645 11.8536C7.95118 11.6583 7.95118 11.3417 8.14645 11.1464L11.2929 8H2.5C2.22386 8 2 7.77614 2 7.5C2 7.22386 2.22386 7 2.5 7H11.2929L8.14645 3.85355C7.95118 3.65829 7.95118 3.34171 8.14645 3.14645Z",
|
|
76
|
-
fill: color,
|
|
77
|
-
fillRule: "evenodd",
|
|
78
|
-
clipRule: "evenodd"
|
|
79
|
-
}));
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
// ../xyd-components/dist/UnderlineNav-rNUvd4IV.js
|
|
83
|
-
import e2, { useState as t4, useRef as a2, useEffect as n2 } from "react";
|
|
84
|
-
|
|
85
|
-
// ../xyd-components/dist/_rollupPluginBabelHelpers-DOmTa7nq.js
|
|
86
|
-
function t3(t5, r4) {
|
|
87
|
-
(null == r4 || r4 > t5.length) && (r4 = t5.length);
|
|
88
|
-
for (var e3 = 0, n4 = Array(r4); e3 < r4; e3++) n4[e3] = t5[e3];
|
|
89
|
-
return n4;
|
|
90
|
-
}
|
|
91
|
-
function r2(t5) {
|
|
92
|
-
if (Array.isArray(t5)) return t5;
|
|
93
|
-
}
|
|
94
|
-
function u() {
|
|
95
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
96
|
-
}
|
|
97
|
-
function h(t5, e3) {
|
|
98
|
-
return r2(t5) || function(t6, r4) {
|
|
99
|
-
var e4 = null == t6 ? null : "undefined" != typeof Symbol && t6[Symbol.iterator] || t6["@@iterator"];
|
|
100
|
-
if (null != e4) {
|
|
101
|
-
var n4, o3, i3, a3, u4 = [], c2 = true, f2 = false;
|
|
102
|
-
try {
|
|
103
|
-
if (i3 = (e4 = e4.call(t6)).next, 0 === r4) {
|
|
104
|
-
if (Object(e4) !== e4) return;
|
|
105
|
-
c2 = false;
|
|
106
|
-
} else for (; !(c2 = (n4 = i3.call(e4)).done) && (u4.push(n4.value), u4.length !== r4); c2 = true) ;
|
|
107
|
-
} catch (t7) {
|
|
108
|
-
f2 = true, o3 = t7;
|
|
109
|
-
} finally {
|
|
110
|
-
try {
|
|
111
|
-
if (!c2 && null != e4.return && (a3 = e4.return(), Object(a3) !== a3)) return;
|
|
112
|
-
} finally {
|
|
113
|
-
if (f2) throw o3;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
return u4;
|
|
117
|
-
}
|
|
118
|
-
}(t5, e3) || d(t5, e3) || u();
|
|
119
|
-
}
|
|
120
|
-
function d(r4, e3) {
|
|
121
|
-
if (r4) {
|
|
122
|
-
if ("string" == typeof r4) return t3(r4, e3);
|
|
123
|
-
var n4 = {}.toString.call(r4).slice(8, -1);
|
|
124
|
-
return "Object" === n4 && r4.constructor && (n4 = r4.constructor.name), "Map" === n4 || "Set" === n4 ? Array.from(r4) : "Arguments" === n4 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n4) ? t3(r4, e3) : void 0;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// ../../node_modules/.pnpm/@radix-ui+react-tabs@1.1.2_@types+react-dom@18.3.5_@types+react@18.3.18__@types+react@18.3.18_qsyrobternj736o5ex7scdd3r4/node_modules/@radix-ui/react-tabs/dist/index.mjs
|
|
129
|
-
import * as React13 from "react";
|
|
130
|
-
|
|
131
|
-
// ../../node_modules/.pnpm/@radix-ui+primitive@1.1.1/node_modules/@radix-ui/primitive/dist/index.mjs
|
|
132
|
-
function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
133
|
-
return function handleEvent(event) {
|
|
134
|
-
originalEventHandler == null ? void 0 : originalEventHandler(event);
|
|
135
|
-
if (checkForDefaultPrevented === false || !event.defaultPrevented) {
|
|
136
|
-
return ourEventHandler == null ? void 0 : ourEventHandler(event);
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
// ../../node_modules/.pnpm/@radix-ui+react-context@1.1.1_@types+react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-context/dist/index.mjs
|
|
142
|
-
import * as React from "react";
|
|
143
|
-
import { jsx } from "react/jsx-runtime";
|
|
144
|
-
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
145
|
-
let defaultContexts = [];
|
|
146
|
-
function createContext32(rootComponentName, defaultContext) {
|
|
147
|
-
const BaseContext = React.createContext(defaultContext);
|
|
148
|
-
const index = defaultContexts.length;
|
|
149
|
-
defaultContexts = [...defaultContexts, defaultContext];
|
|
150
|
-
const Provider = (props) => {
|
|
151
|
-
var _a;
|
|
152
|
-
const { scope, children, ...context } = props;
|
|
153
|
-
const Context = ((_a = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a[index]) || BaseContext;
|
|
154
|
-
const value = React.useMemo(() => context, Object.values(context));
|
|
155
|
-
return /* @__PURE__ */ jsx(Context.Provider, { value, children });
|
|
156
|
-
};
|
|
157
|
-
Provider.displayName = rootComponentName + "Provider";
|
|
158
|
-
function useContext22(consumerName, scope) {
|
|
159
|
-
var _a;
|
|
160
|
-
const Context = ((_a = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a[index]) || BaseContext;
|
|
161
|
-
const context = React.useContext(Context);
|
|
162
|
-
if (context) return context;
|
|
163
|
-
if (defaultContext !== void 0) return defaultContext;
|
|
164
|
-
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
165
|
-
}
|
|
166
|
-
return [Provider, useContext22];
|
|
167
|
-
}
|
|
168
|
-
const createScope = () => {
|
|
169
|
-
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
170
|
-
return React.createContext(defaultContext);
|
|
171
|
-
});
|
|
172
|
-
return function useScope(scope) {
|
|
173
|
-
const contexts = (scope == null ? void 0 : scope[scopeName]) || scopeContexts;
|
|
174
|
-
return React.useMemo(
|
|
175
|
-
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
176
|
-
[scope, contexts]
|
|
177
|
-
);
|
|
178
|
-
};
|
|
179
|
-
};
|
|
180
|
-
createScope.scopeName = scopeName;
|
|
181
|
-
return [createContext32, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
182
|
-
}
|
|
183
|
-
function composeContextScopes(...scopes) {
|
|
184
|
-
const baseScope = scopes[0];
|
|
185
|
-
if (scopes.length === 1) return baseScope;
|
|
186
|
-
const createScope = () => {
|
|
187
|
-
const scopeHooks = scopes.map((createScope2) => ({
|
|
188
|
-
useScope: createScope2(),
|
|
189
|
-
scopeName: createScope2.scopeName
|
|
190
|
-
}));
|
|
191
|
-
return function useComposedScopes(overrideScopes) {
|
|
192
|
-
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
193
|
-
const scopeProps = useScope(overrideScopes);
|
|
194
|
-
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
195
|
-
return { ...nextScopes2, ...currentScope };
|
|
196
|
-
}, {});
|
|
197
|
-
return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
198
|
-
};
|
|
199
|
-
};
|
|
200
|
-
createScope.scopeName = baseScope.scopeName;
|
|
201
|
-
return createScope;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
// ../../node_modules/.pnpm/@radix-ui+react-roving-focus@1.1.1_@types+react-dom@18.3.5_@types+react@18.3.18__@types+react_bkbd3syfptkiebtjifbhjosaba/node_modules/@radix-ui/react-roving-focus/dist/index.mjs
|
|
205
|
-
import * as React11 from "react";
|
|
206
|
-
|
|
207
|
-
// ../../node_modules/.pnpm/@radix-ui+react-collection@1.1.1_@types+react-dom@18.3.5_@types+react@18.3.18__@types+react@1_du3umibpgknzrmwryvhzp3lgou/node_modules/@radix-ui/react-collection/dist/index.mjs
|
|
208
|
-
import React4 from "react";
|
|
209
|
-
|
|
210
|
-
// ../../node_modules/.pnpm/@radix-ui+react-compose-refs@1.1.1_@types+react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
|
|
211
|
-
import * as React2 from "react";
|
|
212
|
-
function setRef(ref, value) {
|
|
213
|
-
if (typeof ref === "function") {
|
|
214
|
-
return ref(value);
|
|
215
|
-
} else if (ref !== null && ref !== void 0) {
|
|
216
|
-
ref.current = value;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
function composeRefs(...refs) {
|
|
220
|
-
return (node) => {
|
|
221
|
-
let hasCleanup = false;
|
|
222
|
-
const cleanups = refs.map((ref) => {
|
|
223
|
-
const cleanup = setRef(ref, node);
|
|
224
|
-
if (!hasCleanup && typeof cleanup == "function") {
|
|
225
|
-
hasCleanup = true;
|
|
226
|
-
}
|
|
227
|
-
return cleanup;
|
|
228
|
-
});
|
|
229
|
-
if (hasCleanup) {
|
|
230
|
-
return () => {
|
|
231
|
-
for (let i3 = 0; i3 < cleanups.length; i3++) {
|
|
232
|
-
const cleanup = cleanups[i3];
|
|
233
|
-
if (typeof cleanup == "function") {
|
|
234
|
-
cleanup();
|
|
235
|
-
} else {
|
|
236
|
-
setRef(refs[i3], null);
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
};
|
|
242
|
-
}
|
|
243
|
-
function useComposedRefs(...refs) {
|
|
244
|
-
return React2.useCallback(composeRefs(...refs), refs);
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
// ../../node_modules/.pnpm/@radix-ui+react-slot@1.1.1_@types+react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
248
|
-
import * as React3 from "react";
|
|
249
|
-
import { Fragment, jsx as jsx2 } from "react/jsx-runtime";
|
|
250
|
-
var Slot = React3.forwardRef((props, forwardedRef) => {
|
|
251
|
-
const { children, ...slotProps } = props;
|
|
252
|
-
const childrenArray = React3.Children.toArray(children);
|
|
253
|
-
const slottable = childrenArray.find(isSlottable);
|
|
254
|
-
if (slottable) {
|
|
255
|
-
const newElement = slottable.props.children;
|
|
256
|
-
const newChildren = childrenArray.map((child) => {
|
|
257
|
-
if (child === slottable) {
|
|
258
|
-
if (React3.Children.count(newElement) > 1) return React3.Children.only(null);
|
|
259
|
-
return React3.isValidElement(newElement) ? newElement.props.children : null;
|
|
260
|
-
} else {
|
|
261
|
-
return child;
|
|
262
|
-
}
|
|
263
|
-
});
|
|
264
|
-
return /* @__PURE__ */ jsx2(SlotClone, { ...slotProps, ref: forwardedRef, children: React3.isValidElement(newElement) ? React3.cloneElement(newElement, void 0, newChildren) : null });
|
|
265
|
-
}
|
|
266
|
-
return /* @__PURE__ */ jsx2(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
267
|
-
});
|
|
268
|
-
Slot.displayName = "Slot";
|
|
269
|
-
var SlotClone = React3.forwardRef((props, forwardedRef) => {
|
|
270
|
-
const { children, ...slotProps } = props;
|
|
271
|
-
if (React3.isValidElement(children)) {
|
|
272
|
-
const childrenRef = getElementRef(children);
|
|
273
|
-
return React3.cloneElement(children, {
|
|
274
|
-
...mergeProps(slotProps, children.props),
|
|
275
|
-
// @ts-ignore
|
|
276
|
-
ref: forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
return React3.Children.count(children) > 1 ? React3.Children.only(null) : null;
|
|
280
|
-
});
|
|
281
|
-
SlotClone.displayName = "SlotClone";
|
|
282
|
-
var Slottable = ({ children }) => {
|
|
283
|
-
return /* @__PURE__ */ jsx2(Fragment, { children });
|
|
284
|
-
};
|
|
285
|
-
function isSlottable(child) {
|
|
286
|
-
return React3.isValidElement(child) && child.type === Slottable;
|
|
287
|
-
}
|
|
288
|
-
function mergeProps(slotProps, childProps) {
|
|
289
|
-
const overrideProps = { ...childProps };
|
|
290
|
-
for (const propName in childProps) {
|
|
291
|
-
const slotPropValue = slotProps[propName];
|
|
292
|
-
const childPropValue = childProps[propName];
|
|
293
|
-
const isHandler = /^on[A-Z]/.test(propName);
|
|
294
|
-
if (isHandler) {
|
|
295
|
-
if (slotPropValue && childPropValue) {
|
|
296
|
-
overrideProps[propName] = (...args) => {
|
|
297
|
-
childPropValue(...args);
|
|
298
|
-
slotPropValue(...args);
|
|
299
|
-
};
|
|
300
|
-
} else if (slotPropValue) {
|
|
301
|
-
overrideProps[propName] = slotPropValue;
|
|
302
|
-
}
|
|
303
|
-
} else if (propName === "style") {
|
|
304
|
-
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
305
|
-
} else if (propName === "className") {
|
|
306
|
-
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
return { ...slotProps, ...overrideProps };
|
|
310
|
-
}
|
|
311
|
-
function getElementRef(element) {
|
|
312
|
-
var _a, _b;
|
|
313
|
-
let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
|
|
314
|
-
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
315
|
-
if (mayWarn) {
|
|
316
|
-
return element.ref;
|
|
317
|
-
}
|
|
318
|
-
getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b.get;
|
|
319
|
-
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
320
|
-
if (mayWarn) {
|
|
321
|
-
return element.props.ref;
|
|
322
|
-
}
|
|
323
|
-
return element.props.ref || element.ref;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
// ../../node_modules/.pnpm/@radix-ui+react-collection@1.1.1_@types+react-dom@18.3.5_@types+react@18.3.18__@types+react@1_du3umibpgknzrmwryvhzp3lgou/node_modules/@radix-ui/react-collection/dist/index.mjs
|
|
327
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
328
|
-
function createCollection(name) {
|
|
329
|
-
const PROVIDER_NAME = name + "CollectionProvider";
|
|
330
|
-
const [createCollectionContext, createCollectionScope2] = createContextScope(PROVIDER_NAME);
|
|
331
|
-
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(
|
|
332
|
-
PROVIDER_NAME,
|
|
333
|
-
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
334
|
-
);
|
|
335
|
-
const CollectionProvider = (props) => {
|
|
336
|
-
const { scope, children } = props;
|
|
337
|
-
const ref = React4.useRef(null);
|
|
338
|
-
const itemMap = React4.useRef(/* @__PURE__ */ new Map()).current;
|
|
339
|
-
return /* @__PURE__ */ jsx3(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
|
|
340
|
-
};
|
|
341
|
-
CollectionProvider.displayName = PROVIDER_NAME;
|
|
342
|
-
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
343
|
-
const CollectionSlot = React4.forwardRef(
|
|
344
|
-
(props, forwardedRef) => {
|
|
345
|
-
const { scope, children } = props;
|
|
346
|
-
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
347
|
-
const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);
|
|
348
|
-
return /* @__PURE__ */ jsx3(Slot, { ref: composedRefs, children });
|
|
349
|
-
}
|
|
350
|
-
);
|
|
351
|
-
CollectionSlot.displayName = COLLECTION_SLOT_NAME;
|
|
352
|
-
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
353
|
-
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
354
|
-
const CollectionItemSlot = React4.forwardRef(
|
|
355
|
-
(props, forwardedRef) => {
|
|
356
|
-
const { scope, children, ...itemData } = props;
|
|
357
|
-
const ref = React4.useRef(null);
|
|
358
|
-
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
359
|
-
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
360
|
-
React4.useEffect(() => {
|
|
361
|
-
context.itemMap.set(ref, { ref, ...itemData });
|
|
362
|
-
return () => void context.itemMap.delete(ref);
|
|
363
|
-
});
|
|
364
|
-
return /* @__PURE__ */ jsx3(Slot, { ...{ [ITEM_DATA_ATTR]: "" }, ref: composedRefs, children });
|
|
365
|
-
}
|
|
366
|
-
);
|
|
367
|
-
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
368
|
-
function useCollection2(scope) {
|
|
369
|
-
const context = useCollectionContext(name + "CollectionConsumer", scope);
|
|
370
|
-
const getItems = React4.useCallback(() => {
|
|
371
|
-
const collectionNode = context.collectionRef.current;
|
|
372
|
-
if (!collectionNode) return [];
|
|
373
|
-
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
|
374
|
-
const items = Array.from(context.itemMap.values());
|
|
375
|
-
const orderedItems = items.sort(
|
|
376
|
-
(a3, b2) => orderedNodes.indexOf(a3.ref.current) - orderedNodes.indexOf(b2.ref.current)
|
|
377
|
-
);
|
|
378
|
-
return orderedItems;
|
|
379
|
-
}, [context.collectionRef, context.itemMap]);
|
|
380
|
-
return getItems;
|
|
381
|
-
}
|
|
382
|
-
return [
|
|
383
|
-
{ Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },
|
|
384
|
-
useCollection2,
|
|
385
|
-
createCollectionScope2
|
|
386
|
-
];
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
// ../../node_modules/.pnpm/@radix-ui+react-id@1.1.0_@types+react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-id/dist/index.mjs
|
|
390
|
-
import * as React6 from "react";
|
|
391
|
-
|
|
392
|
-
// ../../node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.1.0_@types+react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
|
|
393
|
-
import * as React5 from "react";
|
|
394
|
-
var useLayoutEffect2 = Boolean(globalThis == null ? void 0 : globalThis.document) ? React5.useLayoutEffect : () => {
|
|
395
|
-
};
|
|
396
|
-
|
|
397
|
-
// ../../node_modules/.pnpm/@radix-ui+react-id@1.1.0_@types+react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-id/dist/index.mjs
|
|
398
|
-
var useReactId = React6["useId".toString()] || (() => void 0);
|
|
399
|
-
var count = 0;
|
|
400
|
-
function useId(deterministicId) {
|
|
401
|
-
const [id, setId] = React6.useState(useReactId());
|
|
402
|
-
useLayoutEffect2(() => {
|
|
403
|
-
if (!deterministicId) setId((reactId) => reactId ?? String(count++));
|
|
404
|
-
}, [deterministicId]);
|
|
405
|
-
return deterministicId || (id ? `radix-${id}` : "");
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
// ../../node_modules/.pnpm/@radix-ui+react-primitive@2.0.1_@types+react-dom@18.3.5_@types+react@18.3.18__@types+react@18_sspjpiczol7qxzbuuyfihuep4u/node_modules/@radix-ui/react-primitive/dist/index.mjs
|
|
409
|
-
import * as React7 from "react";
|
|
410
|
-
import * as ReactDOM from "react-dom";
|
|
411
|
-
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
412
|
-
var NODES = [
|
|
413
|
-
"a",
|
|
414
|
-
"button",
|
|
415
|
-
"div",
|
|
416
|
-
"form",
|
|
417
|
-
"h2",
|
|
418
|
-
"h3",
|
|
419
|
-
"img",
|
|
420
|
-
"input",
|
|
421
|
-
"label",
|
|
422
|
-
"li",
|
|
423
|
-
"nav",
|
|
424
|
-
"ol",
|
|
425
|
-
"p",
|
|
426
|
-
"span",
|
|
427
|
-
"svg",
|
|
428
|
-
"ul"
|
|
429
|
-
];
|
|
430
|
-
var Primitive = NODES.reduce((primitive, node) => {
|
|
431
|
-
const Node = React7.forwardRef((props, forwardedRef) => {
|
|
432
|
-
const { asChild, ...primitiveProps } = props;
|
|
433
|
-
const Comp = asChild ? Slot : node;
|
|
434
|
-
if (typeof window !== "undefined") {
|
|
435
|
-
window[Symbol.for("radix-ui")] = true;
|
|
436
|
-
}
|
|
437
|
-
return /* @__PURE__ */ jsx4(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
438
|
-
});
|
|
439
|
-
Node.displayName = `Primitive.${node}`;
|
|
440
|
-
return { ...primitive, [node]: Node };
|
|
441
|
-
}, {});
|
|
442
|
-
|
|
443
|
-
// ../../node_modules/.pnpm/@radix-ui+react-use-callback-ref@1.1.0_@types+react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
|
|
444
|
-
import * as React8 from "react";
|
|
445
|
-
function useCallbackRef(callback) {
|
|
446
|
-
const callbackRef = React8.useRef(callback);
|
|
447
|
-
React8.useEffect(() => {
|
|
448
|
-
callbackRef.current = callback;
|
|
449
|
-
});
|
|
450
|
-
return React8.useMemo(() => (...args) => {
|
|
451
|
-
var _a;
|
|
452
|
-
return (_a = callbackRef.current) == null ? void 0 : _a.call(callbackRef, ...args);
|
|
453
|
-
}, []);
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
// ../../node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.1.0_@types+react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
|
|
457
|
-
import * as React9 from "react";
|
|
458
|
-
function useControllableState({
|
|
459
|
-
prop,
|
|
460
|
-
defaultProp,
|
|
461
|
-
onChange = () => {
|
|
462
|
-
}
|
|
463
|
-
}) {
|
|
464
|
-
const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({ defaultProp, onChange });
|
|
465
|
-
const isControlled = prop !== void 0;
|
|
466
|
-
const value = isControlled ? prop : uncontrolledProp;
|
|
467
|
-
const handleChange = useCallbackRef(onChange);
|
|
468
|
-
const setValue = React9.useCallback(
|
|
469
|
-
(nextValue) => {
|
|
470
|
-
if (isControlled) {
|
|
471
|
-
const setter = nextValue;
|
|
472
|
-
const value2 = typeof nextValue === "function" ? setter(prop) : nextValue;
|
|
473
|
-
if (value2 !== prop) handleChange(value2);
|
|
474
|
-
} else {
|
|
475
|
-
setUncontrolledProp(nextValue);
|
|
476
|
-
}
|
|
477
|
-
},
|
|
478
|
-
[isControlled, prop, setUncontrolledProp, handleChange]
|
|
479
|
-
);
|
|
480
|
-
return [value, setValue];
|
|
481
|
-
}
|
|
482
|
-
function useUncontrolledState({
|
|
483
|
-
defaultProp,
|
|
484
|
-
onChange
|
|
485
|
-
}) {
|
|
486
|
-
const uncontrolledState = React9.useState(defaultProp);
|
|
487
|
-
const [value] = uncontrolledState;
|
|
488
|
-
const prevValueRef = React9.useRef(value);
|
|
489
|
-
const handleChange = useCallbackRef(onChange);
|
|
490
|
-
React9.useEffect(() => {
|
|
491
|
-
if (prevValueRef.current !== value) {
|
|
492
|
-
handleChange(value);
|
|
493
|
-
prevValueRef.current = value;
|
|
494
|
-
}
|
|
495
|
-
}, [value, prevValueRef, handleChange]);
|
|
496
|
-
return uncontrolledState;
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
// ../../node_modules/.pnpm/@radix-ui+react-direction@1.1.0_@types+react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-direction/dist/index.mjs
|
|
500
|
-
import * as React10 from "react";
|
|
501
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
502
|
-
var DirectionContext = React10.createContext(void 0);
|
|
503
|
-
function useDirection(localDir) {
|
|
504
|
-
const globalDir = React10.useContext(DirectionContext);
|
|
505
|
-
return localDir || globalDir || "ltr";
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
// ../../node_modules/.pnpm/@radix-ui+react-roving-focus@1.1.1_@types+react-dom@18.3.5_@types+react@18.3.18__@types+react_bkbd3syfptkiebtjifbhjosaba/node_modules/@radix-ui/react-roving-focus/dist/index.mjs
|
|
509
|
-
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
510
|
-
var ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus";
|
|
511
|
-
var EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
512
|
-
var GROUP_NAME = "RovingFocusGroup";
|
|
513
|
-
var [Collection, useCollection, createCollectionScope] = createCollection(GROUP_NAME);
|
|
514
|
-
var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(
|
|
515
|
-
GROUP_NAME,
|
|
516
|
-
[createCollectionScope]
|
|
517
|
-
);
|
|
518
|
-
var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);
|
|
519
|
-
var RovingFocusGroup = React11.forwardRef(
|
|
520
|
-
(props, forwardedRef) => {
|
|
521
|
-
return /* @__PURE__ */ jsx6(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx6(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx6(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });
|
|
522
|
-
}
|
|
523
|
-
);
|
|
524
|
-
RovingFocusGroup.displayName = GROUP_NAME;
|
|
525
|
-
var RovingFocusGroupImpl = React11.forwardRef((props, forwardedRef) => {
|
|
526
|
-
const {
|
|
527
|
-
__scopeRovingFocusGroup,
|
|
528
|
-
orientation,
|
|
529
|
-
loop = false,
|
|
530
|
-
dir,
|
|
531
|
-
currentTabStopId: currentTabStopIdProp,
|
|
532
|
-
defaultCurrentTabStopId,
|
|
533
|
-
onCurrentTabStopIdChange,
|
|
534
|
-
onEntryFocus,
|
|
535
|
-
preventScrollOnEntryFocus = false,
|
|
536
|
-
...groupProps
|
|
537
|
-
} = props;
|
|
538
|
-
const ref = React11.useRef(null);
|
|
539
|
-
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
540
|
-
const direction = useDirection(dir);
|
|
541
|
-
const [currentTabStopId = null, setCurrentTabStopId] = useControllableState({
|
|
542
|
-
prop: currentTabStopIdProp,
|
|
543
|
-
defaultProp: defaultCurrentTabStopId,
|
|
544
|
-
onChange: onCurrentTabStopIdChange
|
|
545
|
-
});
|
|
546
|
-
const [isTabbingBackOut, setIsTabbingBackOut] = React11.useState(false);
|
|
547
|
-
const handleEntryFocus = useCallbackRef(onEntryFocus);
|
|
548
|
-
const getItems = useCollection(__scopeRovingFocusGroup);
|
|
549
|
-
const isClickFocusRef = React11.useRef(false);
|
|
550
|
-
const [focusableItemsCount, setFocusableItemsCount] = React11.useState(0);
|
|
551
|
-
React11.useEffect(() => {
|
|
552
|
-
const node = ref.current;
|
|
553
|
-
if (node) {
|
|
554
|
-
node.addEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
555
|
-
return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
556
|
-
}
|
|
557
|
-
}, [handleEntryFocus]);
|
|
558
|
-
return /* @__PURE__ */ jsx6(
|
|
559
|
-
RovingFocusProvider,
|
|
560
|
-
{
|
|
561
|
-
scope: __scopeRovingFocusGroup,
|
|
562
|
-
orientation,
|
|
563
|
-
dir: direction,
|
|
564
|
-
loop,
|
|
565
|
-
currentTabStopId,
|
|
566
|
-
onItemFocus: React11.useCallback(
|
|
567
|
-
(tabStopId) => setCurrentTabStopId(tabStopId),
|
|
568
|
-
[setCurrentTabStopId]
|
|
569
|
-
),
|
|
570
|
-
onItemShiftTab: React11.useCallback(() => setIsTabbingBackOut(true), []),
|
|
571
|
-
onFocusableItemAdd: React11.useCallback(
|
|
572
|
-
() => setFocusableItemsCount((prevCount) => prevCount + 1),
|
|
573
|
-
[]
|
|
574
|
-
),
|
|
575
|
-
onFocusableItemRemove: React11.useCallback(
|
|
576
|
-
() => setFocusableItemsCount((prevCount) => prevCount - 1),
|
|
577
|
-
[]
|
|
578
|
-
),
|
|
579
|
-
children: /* @__PURE__ */ jsx6(
|
|
580
|
-
Primitive.div,
|
|
581
|
-
{
|
|
582
|
-
tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
|
|
583
|
-
"data-orientation": orientation,
|
|
584
|
-
...groupProps,
|
|
585
|
-
ref: composedRefs,
|
|
586
|
-
style: { outline: "none", ...props.style },
|
|
587
|
-
onMouseDown: composeEventHandlers(props.onMouseDown, () => {
|
|
588
|
-
isClickFocusRef.current = true;
|
|
589
|
-
}),
|
|
590
|
-
onFocus: composeEventHandlers(props.onFocus, (event) => {
|
|
591
|
-
const isKeyboardFocus = !isClickFocusRef.current;
|
|
592
|
-
if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {
|
|
593
|
-
const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);
|
|
594
|
-
event.currentTarget.dispatchEvent(entryFocusEvent);
|
|
595
|
-
if (!entryFocusEvent.defaultPrevented) {
|
|
596
|
-
const items = getItems().filter((item) => item.focusable);
|
|
597
|
-
const activeItem = items.find((item) => item.active);
|
|
598
|
-
const currentItem = items.find((item) => item.id === currentTabStopId);
|
|
599
|
-
const candidateItems = [activeItem, currentItem, ...items].filter(
|
|
600
|
-
Boolean
|
|
601
|
-
);
|
|
602
|
-
const candidateNodes = candidateItems.map((item) => item.ref.current);
|
|
603
|
-
focusFirst(candidateNodes, preventScrollOnEntryFocus);
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
isClickFocusRef.current = false;
|
|
607
|
-
}),
|
|
608
|
-
onBlur: composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false))
|
|
609
|
-
}
|
|
610
|
-
)
|
|
611
|
-
}
|
|
612
|
-
);
|
|
613
|
-
});
|
|
614
|
-
var ITEM_NAME = "RovingFocusGroupItem";
|
|
615
|
-
var RovingFocusGroupItem = React11.forwardRef(
|
|
616
|
-
(props, forwardedRef) => {
|
|
617
|
-
const {
|
|
618
|
-
__scopeRovingFocusGroup,
|
|
619
|
-
focusable = true,
|
|
620
|
-
active = false,
|
|
621
|
-
tabStopId,
|
|
622
|
-
...itemProps
|
|
623
|
-
} = props;
|
|
624
|
-
const autoId = useId();
|
|
625
|
-
const id = tabStopId || autoId;
|
|
626
|
-
const context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup);
|
|
627
|
-
const isCurrentTabStop = context.currentTabStopId === id;
|
|
628
|
-
const getItems = useCollection(__scopeRovingFocusGroup);
|
|
629
|
-
const { onFocusableItemAdd, onFocusableItemRemove } = context;
|
|
630
|
-
React11.useEffect(() => {
|
|
631
|
-
if (focusable) {
|
|
632
|
-
onFocusableItemAdd();
|
|
633
|
-
return () => onFocusableItemRemove();
|
|
634
|
-
}
|
|
635
|
-
}, [focusable, onFocusableItemAdd, onFocusableItemRemove]);
|
|
636
|
-
return /* @__PURE__ */ jsx6(
|
|
637
|
-
Collection.ItemSlot,
|
|
638
|
-
{
|
|
639
|
-
scope: __scopeRovingFocusGroup,
|
|
640
|
-
id,
|
|
641
|
-
focusable,
|
|
642
|
-
active,
|
|
643
|
-
children: /* @__PURE__ */ jsx6(
|
|
644
|
-
Primitive.span,
|
|
645
|
-
{
|
|
646
|
-
tabIndex: isCurrentTabStop ? 0 : -1,
|
|
647
|
-
"data-orientation": context.orientation,
|
|
648
|
-
...itemProps,
|
|
649
|
-
ref: forwardedRef,
|
|
650
|
-
onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {
|
|
651
|
-
if (!focusable) event.preventDefault();
|
|
652
|
-
else context.onItemFocus(id);
|
|
653
|
-
}),
|
|
654
|
-
onFocus: composeEventHandlers(props.onFocus, () => context.onItemFocus(id)),
|
|
655
|
-
onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
|
|
656
|
-
if (event.key === "Tab" && event.shiftKey) {
|
|
657
|
-
context.onItemShiftTab();
|
|
658
|
-
return;
|
|
659
|
-
}
|
|
660
|
-
if (event.target !== event.currentTarget) return;
|
|
661
|
-
const focusIntent = getFocusIntent(event, context.orientation, context.dir);
|
|
662
|
-
if (focusIntent !== void 0) {
|
|
663
|
-
if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;
|
|
664
|
-
event.preventDefault();
|
|
665
|
-
const items = getItems().filter((item) => item.focusable);
|
|
666
|
-
let candidateNodes = items.map((item) => item.ref.current);
|
|
667
|
-
if (focusIntent === "last") candidateNodes.reverse();
|
|
668
|
-
else if (focusIntent === "prev" || focusIntent === "next") {
|
|
669
|
-
if (focusIntent === "prev") candidateNodes.reverse();
|
|
670
|
-
const currentIndex = candidateNodes.indexOf(event.currentTarget);
|
|
671
|
-
candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);
|
|
672
|
-
}
|
|
673
|
-
setTimeout(() => focusFirst(candidateNodes));
|
|
674
|
-
}
|
|
675
|
-
})
|
|
676
|
-
}
|
|
677
|
-
)
|
|
678
|
-
}
|
|
679
|
-
);
|
|
680
|
-
}
|
|
681
|
-
);
|
|
682
|
-
RovingFocusGroupItem.displayName = ITEM_NAME;
|
|
683
|
-
var MAP_KEY_TO_FOCUS_INTENT = {
|
|
684
|
-
ArrowLeft: "prev",
|
|
685
|
-
ArrowUp: "prev",
|
|
686
|
-
ArrowRight: "next",
|
|
687
|
-
ArrowDown: "next",
|
|
688
|
-
PageUp: "first",
|
|
689
|
-
Home: "first",
|
|
690
|
-
PageDown: "last",
|
|
691
|
-
End: "last"
|
|
692
|
-
};
|
|
693
|
-
function getDirectionAwareKey(key, dir) {
|
|
694
|
-
if (dir !== "rtl") return key;
|
|
695
|
-
return key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key;
|
|
696
|
-
}
|
|
697
|
-
function getFocusIntent(event, orientation, dir) {
|
|
698
|
-
const key = getDirectionAwareKey(event.key, dir);
|
|
699
|
-
if (orientation === "vertical" && ["ArrowLeft", "ArrowRight"].includes(key)) return void 0;
|
|
700
|
-
if (orientation === "horizontal" && ["ArrowUp", "ArrowDown"].includes(key)) return void 0;
|
|
701
|
-
return MAP_KEY_TO_FOCUS_INTENT[key];
|
|
702
|
-
}
|
|
703
|
-
function focusFirst(candidates, preventScroll = false) {
|
|
704
|
-
const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
|
|
705
|
-
for (const candidate of candidates) {
|
|
706
|
-
if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
707
|
-
candidate.focus({ preventScroll });
|
|
708
|
-
if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
709
|
-
}
|
|
710
|
-
}
|
|
711
|
-
function wrapArray(array, startIndex) {
|
|
712
|
-
return array.map((_2, index) => array[(startIndex + index) % array.length]);
|
|
713
|
-
}
|
|
714
|
-
var Root = RovingFocusGroup;
|
|
715
|
-
var Item = RovingFocusGroupItem;
|
|
716
|
-
|
|
717
|
-
// ../../node_modules/.pnpm/@radix-ui+react-presence@1.1.2_@types+react-dom@18.3.5_@types+react@18.3.18__@types+react@18._pqwkltkxenlrsgmgun6icjiigu/node_modules/@radix-ui/react-presence/dist/index.mjs
|
|
718
|
-
import * as React22 from "react";
|
|
719
|
-
import * as React12 from "react";
|
|
720
|
-
function useStateMachine(initialState, machine) {
|
|
721
|
-
return React12.useReducer((state, event) => {
|
|
722
|
-
const nextState = machine[state][event];
|
|
723
|
-
return nextState ?? state;
|
|
724
|
-
}, initialState);
|
|
725
|
-
}
|
|
726
|
-
var Presence = (props) => {
|
|
727
|
-
const { present, children } = props;
|
|
728
|
-
const presence = usePresence(present);
|
|
729
|
-
const child = typeof children === "function" ? children({ present: presence.isPresent }) : React22.Children.only(children);
|
|
730
|
-
const ref = useComposedRefs(presence.ref, getElementRef2(child));
|
|
731
|
-
const forceMount = typeof children === "function";
|
|
732
|
-
return forceMount || presence.isPresent ? React22.cloneElement(child, { ref }) : null;
|
|
733
|
-
};
|
|
734
|
-
Presence.displayName = "Presence";
|
|
735
|
-
function usePresence(present) {
|
|
736
|
-
const [node, setNode] = React22.useState();
|
|
737
|
-
const stylesRef = React22.useRef({});
|
|
738
|
-
const prevPresentRef = React22.useRef(present);
|
|
739
|
-
const prevAnimationNameRef = React22.useRef("none");
|
|
740
|
-
const initialState = present ? "mounted" : "unmounted";
|
|
741
|
-
const [state, send] = useStateMachine(initialState, {
|
|
742
|
-
mounted: {
|
|
743
|
-
UNMOUNT: "unmounted",
|
|
744
|
-
ANIMATION_OUT: "unmountSuspended"
|
|
745
|
-
},
|
|
746
|
-
unmountSuspended: {
|
|
747
|
-
MOUNT: "mounted",
|
|
748
|
-
ANIMATION_END: "unmounted"
|
|
749
|
-
},
|
|
750
|
-
unmounted: {
|
|
751
|
-
MOUNT: "mounted"
|
|
752
|
-
}
|
|
753
|
-
});
|
|
754
|
-
React22.useEffect(() => {
|
|
755
|
-
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
756
|
-
prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
|
|
757
|
-
}, [state]);
|
|
758
|
-
useLayoutEffect2(() => {
|
|
759
|
-
const styles = stylesRef.current;
|
|
760
|
-
const wasPresent = prevPresentRef.current;
|
|
761
|
-
const hasPresentChanged = wasPresent !== present;
|
|
762
|
-
if (hasPresentChanged) {
|
|
763
|
-
const prevAnimationName = prevAnimationNameRef.current;
|
|
764
|
-
const currentAnimationName = getAnimationName(styles);
|
|
765
|
-
if (present) {
|
|
766
|
-
send("MOUNT");
|
|
767
|
-
} else if (currentAnimationName === "none" || (styles == null ? void 0 : styles.display) === "none") {
|
|
768
|
-
send("UNMOUNT");
|
|
769
|
-
} else {
|
|
770
|
-
const isAnimating = prevAnimationName !== currentAnimationName;
|
|
771
|
-
if (wasPresent && isAnimating) {
|
|
772
|
-
send("ANIMATION_OUT");
|
|
773
|
-
} else {
|
|
774
|
-
send("UNMOUNT");
|
|
775
|
-
}
|
|
776
|
-
}
|
|
777
|
-
prevPresentRef.current = present;
|
|
778
|
-
}
|
|
779
|
-
}, [present, send]);
|
|
780
|
-
useLayoutEffect2(() => {
|
|
781
|
-
if (node) {
|
|
782
|
-
let timeoutId;
|
|
783
|
-
const ownerWindow = node.ownerDocument.defaultView ?? window;
|
|
784
|
-
const handleAnimationEnd = (event) => {
|
|
785
|
-
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
786
|
-
const isCurrentAnimation = currentAnimationName.includes(event.animationName);
|
|
787
|
-
if (event.target === node && isCurrentAnimation) {
|
|
788
|
-
send("ANIMATION_END");
|
|
789
|
-
if (!prevPresentRef.current) {
|
|
790
|
-
const currentFillMode = node.style.animationFillMode;
|
|
791
|
-
node.style.animationFillMode = "forwards";
|
|
792
|
-
timeoutId = ownerWindow.setTimeout(() => {
|
|
793
|
-
if (node.style.animationFillMode === "forwards") {
|
|
794
|
-
node.style.animationFillMode = currentFillMode;
|
|
795
|
-
}
|
|
796
|
-
});
|
|
797
|
-
}
|
|
798
|
-
}
|
|
799
|
-
};
|
|
800
|
-
const handleAnimationStart = (event) => {
|
|
801
|
-
if (event.target === node) {
|
|
802
|
-
prevAnimationNameRef.current = getAnimationName(stylesRef.current);
|
|
803
|
-
}
|
|
804
|
-
};
|
|
805
|
-
node.addEventListener("animationstart", handleAnimationStart);
|
|
806
|
-
node.addEventListener("animationcancel", handleAnimationEnd);
|
|
807
|
-
node.addEventListener("animationend", handleAnimationEnd);
|
|
808
|
-
return () => {
|
|
809
|
-
ownerWindow.clearTimeout(timeoutId);
|
|
810
|
-
node.removeEventListener("animationstart", handleAnimationStart);
|
|
811
|
-
node.removeEventListener("animationcancel", handleAnimationEnd);
|
|
812
|
-
node.removeEventListener("animationend", handleAnimationEnd);
|
|
813
|
-
};
|
|
814
|
-
} else {
|
|
815
|
-
send("ANIMATION_END");
|
|
816
|
-
}
|
|
817
|
-
}, [node, send]);
|
|
818
|
-
return {
|
|
819
|
-
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
|
820
|
-
ref: React22.useCallback((node2) => {
|
|
821
|
-
if (node2) stylesRef.current = getComputedStyle(node2);
|
|
822
|
-
setNode(node2);
|
|
823
|
-
}, [])
|
|
824
|
-
};
|
|
825
|
-
}
|
|
826
|
-
function getAnimationName(styles) {
|
|
827
|
-
return (styles == null ? void 0 : styles.animationName) || "none";
|
|
828
|
-
}
|
|
829
|
-
function getElementRef2(element) {
|
|
830
|
-
var _a, _b;
|
|
831
|
-
let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
|
|
832
|
-
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
833
|
-
if (mayWarn) {
|
|
834
|
-
return element.ref;
|
|
835
|
-
}
|
|
836
|
-
getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b.get;
|
|
837
|
-
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
838
|
-
if (mayWarn) {
|
|
839
|
-
return element.props.ref;
|
|
840
|
-
}
|
|
841
|
-
return element.props.ref || element.ref;
|
|
842
|
-
}
|
|
843
|
-
|
|
844
|
-
// ../../node_modules/.pnpm/@radix-ui+react-tabs@1.1.2_@types+react-dom@18.3.5_@types+react@18.3.18__@types+react@18.3.18_qsyrobternj736o5ex7scdd3r4/node_modules/@radix-ui/react-tabs/dist/index.mjs
|
|
845
|
-
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
846
|
-
var TABS_NAME = "Tabs";
|
|
847
|
-
var [createTabsContext, createTabsScope] = createContextScope(TABS_NAME, [
|
|
848
|
-
createRovingFocusGroupScope
|
|
849
|
-
]);
|
|
850
|
-
var useRovingFocusGroupScope = createRovingFocusGroupScope();
|
|
851
|
-
var [TabsProvider, useTabsContext] = createTabsContext(TABS_NAME);
|
|
852
|
-
var Tabs = React13.forwardRef(
|
|
853
|
-
(props, forwardedRef) => {
|
|
854
|
-
const {
|
|
855
|
-
__scopeTabs,
|
|
856
|
-
value: valueProp,
|
|
857
|
-
onValueChange,
|
|
858
|
-
defaultValue,
|
|
859
|
-
orientation = "horizontal",
|
|
860
|
-
dir,
|
|
861
|
-
activationMode = "automatic",
|
|
862
|
-
...tabsProps
|
|
863
|
-
} = props;
|
|
864
|
-
const direction = useDirection(dir);
|
|
865
|
-
const [value, setValue] = useControllableState({
|
|
866
|
-
prop: valueProp,
|
|
867
|
-
onChange: onValueChange,
|
|
868
|
-
defaultProp: defaultValue
|
|
869
|
-
});
|
|
870
|
-
return /* @__PURE__ */ jsx7(
|
|
871
|
-
TabsProvider,
|
|
872
|
-
{
|
|
873
|
-
scope: __scopeTabs,
|
|
874
|
-
baseId: useId(),
|
|
875
|
-
value,
|
|
876
|
-
onValueChange: setValue,
|
|
877
|
-
orientation,
|
|
878
|
-
dir: direction,
|
|
879
|
-
activationMode,
|
|
880
|
-
children: /* @__PURE__ */ jsx7(
|
|
881
|
-
Primitive.div,
|
|
882
|
-
{
|
|
883
|
-
dir: direction,
|
|
884
|
-
"data-orientation": orientation,
|
|
885
|
-
...tabsProps,
|
|
886
|
-
ref: forwardedRef
|
|
887
|
-
}
|
|
888
|
-
)
|
|
889
|
-
}
|
|
890
|
-
);
|
|
891
|
-
}
|
|
892
|
-
);
|
|
893
|
-
Tabs.displayName = TABS_NAME;
|
|
894
|
-
var TAB_LIST_NAME = "TabsList";
|
|
895
|
-
var TabsList = React13.forwardRef(
|
|
896
|
-
(props, forwardedRef) => {
|
|
897
|
-
const { __scopeTabs, loop = true, ...listProps } = props;
|
|
898
|
-
const context = useTabsContext(TAB_LIST_NAME, __scopeTabs);
|
|
899
|
-
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeTabs);
|
|
900
|
-
return /* @__PURE__ */ jsx7(
|
|
901
|
-
Root,
|
|
902
|
-
{
|
|
903
|
-
asChild: true,
|
|
904
|
-
...rovingFocusGroupScope,
|
|
905
|
-
orientation: context.orientation,
|
|
906
|
-
dir: context.dir,
|
|
907
|
-
loop,
|
|
908
|
-
children: /* @__PURE__ */ jsx7(
|
|
909
|
-
Primitive.div,
|
|
910
|
-
{
|
|
911
|
-
role: "tablist",
|
|
912
|
-
"aria-orientation": context.orientation,
|
|
913
|
-
...listProps,
|
|
914
|
-
ref: forwardedRef
|
|
915
|
-
}
|
|
916
|
-
)
|
|
917
|
-
}
|
|
918
|
-
);
|
|
919
|
-
}
|
|
920
|
-
);
|
|
921
|
-
TabsList.displayName = TAB_LIST_NAME;
|
|
922
|
-
var TRIGGER_NAME = "TabsTrigger";
|
|
923
|
-
var TabsTrigger = React13.forwardRef(
|
|
924
|
-
(props, forwardedRef) => {
|
|
925
|
-
const { __scopeTabs, value, disabled = false, ...triggerProps } = props;
|
|
926
|
-
const context = useTabsContext(TRIGGER_NAME, __scopeTabs);
|
|
927
|
-
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeTabs);
|
|
928
|
-
const triggerId = makeTriggerId(context.baseId, value);
|
|
929
|
-
const contentId = makeContentId(context.baseId, value);
|
|
930
|
-
const isSelected = value === context.value;
|
|
931
|
-
return /* @__PURE__ */ jsx7(
|
|
932
|
-
Item,
|
|
933
|
-
{
|
|
934
|
-
asChild: true,
|
|
935
|
-
...rovingFocusGroupScope,
|
|
936
|
-
focusable: !disabled,
|
|
937
|
-
active: isSelected,
|
|
938
|
-
children: /* @__PURE__ */ jsx7(
|
|
939
|
-
Primitive.button,
|
|
940
|
-
{
|
|
941
|
-
type: "button",
|
|
942
|
-
role: "tab",
|
|
943
|
-
"aria-selected": isSelected,
|
|
944
|
-
"aria-controls": contentId,
|
|
945
|
-
"data-state": isSelected ? "active" : "inactive",
|
|
946
|
-
"data-disabled": disabled ? "" : void 0,
|
|
947
|
-
disabled,
|
|
948
|
-
id: triggerId,
|
|
949
|
-
...triggerProps,
|
|
950
|
-
ref: forwardedRef,
|
|
951
|
-
onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {
|
|
952
|
-
if (!disabled && event.button === 0 && event.ctrlKey === false) {
|
|
953
|
-
context.onValueChange(value);
|
|
954
|
-
} else {
|
|
955
|
-
event.preventDefault();
|
|
956
|
-
}
|
|
957
|
-
}),
|
|
958
|
-
onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
|
|
959
|
-
if ([" ", "Enter"].includes(event.key)) context.onValueChange(value);
|
|
960
|
-
}),
|
|
961
|
-
onFocus: composeEventHandlers(props.onFocus, () => {
|
|
962
|
-
const isAutomaticActivation = context.activationMode !== "manual";
|
|
963
|
-
if (!isSelected && !disabled && isAutomaticActivation) {
|
|
964
|
-
context.onValueChange(value);
|
|
965
|
-
}
|
|
966
|
-
})
|
|
967
|
-
}
|
|
968
|
-
)
|
|
969
|
-
}
|
|
970
|
-
);
|
|
971
|
-
}
|
|
972
|
-
);
|
|
973
|
-
TabsTrigger.displayName = TRIGGER_NAME;
|
|
974
|
-
var CONTENT_NAME = "TabsContent";
|
|
975
|
-
var TabsContent = React13.forwardRef(
|
|
976
|
-
(props, forwardedRef) => {
|
|
977
|
-
const { __scopeTabs, value, forceMount, children, ...contentProps } = props;
|
|
978
|
-
const context = useTabsContext(CONTENT_NAME, __scopeTabs);
|
|
979
|
-
const triggerId = makeTriggerId(context.baseId, value);
|
|
980
|
-
const contentId = makeContentId(context.baseId, value);
|
|
981
|
-
const isSelected = value === context.value;
|
|
982
|
-
const isMountAnimationPreventedRef = React13.useRef(isSelected);
|
|
983
|
-
React13.useEffect(() => {
|
|
984
|
-
const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);
|
|
985
|
-
return () => cancelAnimationFrame(rAF);
|
|
986
|
-
}, []);
|
|
987
|
-
return /* @__PURE__ */ jsx7(Presence, { present: forceMount || isSelected, children: ({ present }) => /* @__PURE__ */ jsx7(
|
|
988
|
-
Primitive.div,
|
|
989
|
-
{
|
|
990
|
-
"data-state": isSelected ? "active" : "inactive",
|
|
991
|
-
"data-orientation": context.orientation,
|
|
992
|
-
role: "tabpanel",
|
|
993
|
-
"aria-labelledby": triggerId,
|
|
994
|
-
hidden: !present,
|
|
995
|
-
id: contentId,
|
|
996
|
-
tabIndex: 0,
|
|
997
|
-
...contentProps,
|
|
998
|
-
ref: forwardedRef,
|
|
999
|
-
style: {
|
|
1000
|
-
...props.style,
|
|
1001
|
-
animationDuration: isMountAnimationPreventedRef.current ? "0s" : void 0
|
|
1002
|
-
},
|
|
1003
|
-
children: present && children
|
|
1004
|
-
}
|
|
1005
|
-
) });
|
|
1006
|
-
}
|
|
1007
|
-
);
|
|
1008
|
-
TabsContent.displayName = CONTENT_NAME;
|
|
1009
|
-
function makeTriggerId(baseId, value) {
|
|
1010
|
-
return `${baseId}-trigger-${value}`;
|
|
1011
|
-
}
|
|
1012
|
-
function makeContentId(baseId, value) {
|
|
1013
|
-
return `${baseId}-content-${value}`;
|
|
1014
|
-
}
|
|
1015
|
-
var Root2 = Tabs;
|
|
1016
|
-
var List = TabsList;
|
|
1017
|
-
var Trigger = TabsTrigger;
|
|
1018
|
-
var Content = TabsContent;
|
|
1019
|
-
|
|
1020
|
-
// ../../node_modules/.pnpm/lucide-react@0.447.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
1021
|
-
import { forwardRef as forwardRef7, createElement as createElement3 } from "react";
|
|
1022
|
-
|
|
1023
|
-
// ../../node_modules/.pnpm/lucide-react@0.447.0_react@18.3.1/node_modules/lucide-react/dist/esm/shared/src/utils.js
|
|
1024
|
-
var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
1025
|
-
var mergeClasses = (...classes) => classes.filter((className, index, array) => {
|
|
1026
|
-
return Boolean(className) && array.indexOf(className) === index;
|
|
1027
|
-
}).join(" ");
|
|
1028
|
-
|
|
1029
|
-
// ../../node_modules/.pnpm/lucide-react@0.447.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
|
|
1030
|
-
import { forwardRef as forwardRef6, createElement as createElement2 } from "react";
|
|
1031
|
-
|
|
1032
|
-
// ../../node_modules/.pnpm/lucide-react@0.447.0_react@18.3.1/node_modules/lucide-react/dist/esm/defaultAttributes.js
|
|
1033
|
-
var defaultAttributes = {
|
|
1034
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1035
|
-
width: 24,
|
|
1036
|
-
height: 24,
|
|
1037
|
-
viewBox: "0 0 24 24",
|
|
1038
|
-
fill: "none",
|
|
1039
|
-
stroke: "currentColor",
|
|
1040
|
-
strokeWidth: 2,
|
|
1041
|
-
strokeLinecap: "round",
|
|
1042
|
-
strokeLinejoin: "round"
|
|
1043
|
-
};
|
|
1044
|
-
|
|
1045
|
-
// ../../node_modules/.pnpm/lucide-react@0.447.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
|
|
1046
|
-
var Icon = forwardRef6(
|
|
1047
|
-
({
|
|
1048
|
-
color = "currentColor",
|
|
1049
|
-
size = 24,
|
|
1050
|
-
strokeWidth = 2,
|
|
1051
|
-
absoluteStrokeWidth,
|
|
1052
|
-
className = "",
|
|
1053
|
-
children,
|
|
1054
|
-
iconNode,
|
|
1055
|
-
...rest
|
|
1056
|
-
}, ref) => {
|
|
1057
|
-
return createElement2(
|
|
1058
|
-
"svg",
|
|
1059
|
-
{
|
|
1060
|
-
ref,
|
|
1061
|
-
...defaultAttributes,
|
|
1062
|
-
width: size,
|
|
1063
|
-
height: size,
|
|
1064
|
-
stroke: color,
|
|
1065
|
-
strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
|
|
1066
|
-
className: mergeClasses("lucide", className),
|
|
1067
|
-
...rest
|
|
1068
|
-
},
|
|
1069
|
-
[
|
|
1070
|
-
...iconNode.map(([tag, attrs]) => createElement2(tag, attrs)),
|
|
1071
|
-
...Array.isArray(children) ? children : [children]
|
|
1072
|
-
]
|
|
1073
|
-
);
|
|
1074
|
-
}
|
|
1075
|
-
);
|
|
1076
|
-
|
|
1077
|
-
// ../../node_modules/.pnpm/lucide-react@0.447.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
1078
|
-
var createLucideIcon = (iconName, iconNode) => {
|
|
1079
|
-
const Component = forwardRef7(
|
|
1080
|
-
({ className, ...props }, ref) => createElement3(Icon, {
|
|
1081
|
-
ref,
|
|
1082
|
-
iconNode,
|
|
1083
|
-
className: mergeClasses(`lucide-${toKebabCase(iconName)}`, className),
|
|
1084
|
-
...props
|
|
1085
|
-
})
|
|
1086
|
-
);
|
|
1087
|
-
Component.displayName = `${iconName}`;
|
|
1088
|
-
return Component;
|
|
1089
|
-
};
|
|
1090
|
-
|
|
1091
|
-
// ../../node_modules/.pnpm/lucide-react@0.447.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/chevron-left.js
|
|
1092
|
-
var ChevronLeft = createLucideIcon("ChevronLeft", [
|
|
1093
|
-
["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]
|
|
1094
|
-
]);
|
|
1095
|
-
|
|
1096
|
-
// ../../node_modules/.pnpm/lucide-react@0.447.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/chevron-right.js
|
|
1097
|
-
var ChevronRight = createLucideIcon("ChevronRight", [
|
|
1098
|
-
["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]
|
|
1099
|
-
]);
|
|
1100
|
-
|
|
1101
|
-
// ../xyd-components/dist/UnderlineNav-rNUvd4IV.js
|
|
1102
|
-
var s = "hh34a3o";
|
|
1103
|
-
var m = "hilz89t";
|
|
1104
|
-
var o = "h1rnhmpa";
|
|
1105
|
-
var u2 = "lajci2p";
|
|
1106
|
-
var d2 = "iezrce7";
|
|
1107
|
-
var v = "i1vhi0b8";
|
|
1108
|
-
var h2 = "i1m2lps9";
|
|
1109
|
-
var f = "r1new93p";
|
|
1110
|
-
var E = "t1u3d3ty";
|
|
1111
|
-
var N = "t4udf3g";
|
|
1112
|
-
var p = "t1icpluq";
|
|
1113
|
-
var b = "badgd67";
|
|
1114
|
-
var g = "bcjznmh";
|
|
1115
|
-
var w = "p13ekkiz";
|
|
1116
|
-
var C = "h15733ml";
|
|
1117
|
-
function k(t5) {
|
|
1118
|
-
var a3 = t5.children, n4 = t5.href, r4 = t5.icon, c2 = t5.title, l2 = t5.kind, i3 = t5.size;
|
|
1119
|
-
return e2.createElement("div", { className: "\n ".concat(s, "\n ").concat("secondary" === l2 && m, "\n ").concat("secondary" === l2 && "md" == i3 && o, "\n ") }, e2.createElement("a", { className: u2, href: n4 }, e2.createElement("div", { className: "\n ".concat(d2, "\n ").concat("secondary" === l2 && v, "\n ") }, r4 && e2.createElement("div", { className: h2 }, r4), e2.createElement("div", { className: f }, e2.createElement("div", { className: E }, e2.createElement("div", { className: "\n ".concat(E, " \n ").concat(N, "\n ").concat("md" == i3 && p, "\n ") }, c2), e2.createElement(z, null)), e2.createElement("div", { className: "\n ".concat(b, "\n ").concat("md" == i3 && g, "\n ") }, a3)))));
|
|
1120
|
-
}
|
|
1121
|
-
function z() {
|
|
1122
|
-
return e2.createElement("div", { "data-pointer": "true", className: w }, e2.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, fill: "currentColor", viewBox: "0 0 24 24" }, e2.createElement("path", { fillRule: "evenodd", d: "M9.293 7.293a1 1 0 0 1 1.414 0l4 4a1 1 0 0 1 0 1.414l-4 4a1 1 0 0 1-1.414-1.414L12.586 12 9.293 8.707a1 1 0 0 1 0-1.414Z", clipRule: "evenodd" })));
|
|
1123
|
-
}
|
|
1124
|
-
k.List = function(t5) {
|
|
1125
|
-
var a3 = t5.children;
|
|
1126
|
-
return e2.createElement("div", { className: C }, a3);
|
|
1127
|
-
};
|
|
1128
|
-
var x = "h3kfd8c";
|
|
1129
|
-
var L = "l1et872q";
|
|
1130
|
-
function y(t5) {
|
|
1131
|
-
var a3 = t5.children;
|
|
1132
|
-
return e2.createElement("ol", { className: x }, a3);
|
|
1133
|
-
}
|
|
1134
|
-
y.Item = function(t5) {
|
|
1135
|
-
var a3 = t5.children;
|
|
1136
|
-
return e2.createElement("li", { className: L }, a3);
|
|
1137
|
-
};
|
|
1138
|
-
var T = "h14vj3ri";
|
|
1139
|
-
var j = "t1l6tz9b";
|
|
1140
|
-
var R = "thzxr0l";
|
|
1141
|
-
var B = "t1g1altt";
|
|
1142
|
-
function I(t5) {
|
|
1143
|
-
var a3 = t5.children;
|
|
1144
|
-
return e2.createElement("table", { className: T }, a3);
|
|
1145
|
-
}
|
|
1146
|
-
I.Th = function(t5) {
|
|
1147
|
-
var a3 = t5.children;
|
|
1148
|
-
return e2.createElement("th", { className: j }, a3);
|
|
1149
|
-
}, I.Tr = function(t5) {
|
|
1150
|
-
var a3 = t5.children;
|
|
1151
|
-
return e2.createElement("tr", { className: R }, a3);
|
|
1152
|
-
}, I.Td = function(t5) {
|
|
1153
|
-
var a3 = t5.children;
|
|
1154
|
-
return e2.createElement("td", { className: B }, a3);
|
|
1155
|
-
};
|
|
1156
|
-
var q = "hh8vcxa";
|
|
1157
|
-
var S = "b2p5907";
|
|
1158
|
-
var V = "coeb6fw";
|
|
1159
|
-
var W = "h196u2m6";
|
|
1160
|
-
var _ = "i1hlflsk";
|
|
1161
|
-
var G = "hownbu8";
|
|
1162
|
-
var H = "cuwerl2";
|
|
1163
|
-
var M = "hlivi01";
|
|
1164
|
-
function P(s2) {
|
|
1165
|
-
var m3 = s2.children, o3 = s2.items, u4 = s2.tabIndex, d3 = t4(false), v3 = h(d3, 2), h4 = v3[0], f2 = v3[1], E4 = t4(false), N3 = h(E4, 2), p3 = N3[0], b2 = N3[1], g2 = a2(null), w3 = t4(o3[u4 || 0] || ""), C2 = h(w3, 2), k2 = C2[0], z2 = C2[1], x3 = function() {
|
|
1166
|
-
if (g2.current) {
|
|
1167
|
-
var e3 = g2.current, t5 = e3.scrollLeft, a3 = e3.scrollWidth, n4 = e3.clientWidth;
|
|
1168
|
-
f2(t5 > 0), b2(t5 < a3 - n4);
|
|
1169
|
-
}
|
|
1170
|
-
};
|
|
1171
|
-
n2(function() {
|
|
1172
|
-
return x3(), window.addEventListener("resize", x3), function() {
|
|
1173
|
-
return window.removeEventListener("resize", x3);
|
|
1174
|
-
};
|
|
1175
|
-
}, []);
|
|
1176
|
-
var L2 = function(e3) {
|
|
1177
|
-
if (g2.current) {
|
|
1178
|
-
var t5 = "left" === e3 ? -200 : 200;
|
|
1179
|
-
g2.current.scrollBy({ left: t5, behavior: "smooth" });
|
|
1180
|
-
}
|
|
1181
|
-
};
|
|
1182
|
-
return e2.createElement(Root2, { asChild: true, value: k2, onValueChange: z2 }, e2.createElement("div", { className: q }, e2.createElement("div", { className: S }, h4 && e2.createElement("button", { onClick: function() {
|
|
1183
|
-
return L2("left");
|
|
1184
|
-
}, className: W }, e2.createElement(ChevronLeft, { className: _ })), e2.createElement("div", { ref: g2, onScroll: x3, className: G }, e2.createElement("div", { className: H }, e2.createElement(List, null, o3.map(function(t5, a3) {
|
|
1185
|
-
return e2.createElement(U, { key: a3, value: t5 }, t5);
|
|
1186
|
-
})))), p3 && e2.createElement("button", { onClick: function() {
|
|
1187
|
-
return L2("right");
|
|
1188
|
-
}, className: W }, e2.createElement(ChevronRight, { className: _ }))), e2.createElement("div", { className: V }, m3)));
|
|
1189
|
-
}
|
|
1190
|
-
function U(t5) {
|
|
1191
|
-
var a3 = t5.children, n4 = t5.value;
|
|
1192
|
-
return e2.createElement(Trigger, { asChild: true, value: n4 }, e2.createElement("button", { className: "".concat(M) }, a3));
|
|
1193
|
-
}
|
|
1194
|
-
P.Content = function(t5) {
|
|
1195
|
-
var a3 = t5.children, n4 = t5.value;
|
|
1196
|
-
return e2.createElement(Content, { asChild: true, value: n4 }, a3);
|
|
1197
|
-
};
|
|
1198
|
-
var Z = "h1bta36o";
|
|
1199
|
-
var A = "uxs4bf1";
|
|
1200
|
-
var D = "ifn7ecb";
|
|
1201
|
-
var F = "i441kmn";
|
|
1202
|
-
function J(t5) {
|
|
1203
|
-
var a3 = t5.children, n4 = t5.value, r4 = t5.onChange;
|
|
1204
|
-
return e2.createElement(Root2, { asChild: true, value: n4, onValueChange: r4 }, e2.createElement("nav", { className: Z }, e2.createElement(List, { asChild: true }, e2.createElement("ul", { className: A }, a3))));
|
|
1205
|
-
}
|
|
1206
|
-
J.Item = function(t5) {
|
|
1207
|
-
var a3 = t5.children, n4 = t5.value, r4 = t5.href;
|
|
1208
|
-
return e2.createElement(Trigger, { asChild: true, value: n4 }, e2.createElement("li", { className: D }, e2.createElement("a", { href: r4, className: "".concat(F) }, a3)));
|
|
1209
|
-
};
|
|
1210
|
-
|
|
1211
|
-
// ../xyd-components/dist/writer.js
|
|
1212
|
-
var i2 = "hwgsk4h";
|
|
1213
|
-
var m2 = "i1b95bxl";
|
|
1214
|
-
var o2 = "i1a3fa93";
|
|
1215
|
-
var u3 = "i1dl7ywj";
|
|
1216
|
-
function h3(e3) {
|
|
1217
|
-
var a3 = e3.children, n4 = t2(e3, ["children"]);
|
|
1218
|
-
return r3.createElement("a", Object.assign({}, n4), a3);
|
|
1219
|
-
}
|
|
1220
|
-
function p2(e3) {
|
|
1221
|
-
return r3.createElement("div", { className: i2 }, e3.items.map(function(t5, a3) {
|
|
1222
|
-
var s2 = a3 === e3.items.length - 1;
|
|
1223
|
-
return r3.createElement(n3, { key: t5.href + t5.title }, a3 > 0 && r3.createElement(ArrowRightIcon, { className: m2 }), r3.createElement("div", { className: "\n ".concat(o2, "\n ").concat(s2 && u3, "\n "), title: t5.title }, t5.href && !s2 ? r3.createElement(h3, { href: t5.href }, t5.title) : t5.title));
|
|
1224
|
-
}));
|
|
1225
|
-
}
|
|
1226
|
-
var v2 = "h1xhrk1";
|
|
1227
|
-
var E3 = "l1elq7ab";
|
|
1228
|
-
var x2 = "i1mmatje";
|
|
1229
|
-
function N2(e3) {
|
|
1230
|
-
var a3 = e3.children, n4 = t2(e3, ["children"]);
|
|
1231
|
-
return r3.createElement("a", Object.assign({}, n4), a3);
|
|
1232
|
-
}
|
|
1233
|
-
function j2(e3) {
|
|
1234
|
-
return r3.createElement("div", { className: v2 }, e3.prev ? r3.createElement(N2, { href: e3.prev.href, title: e3.prev.title, className: E3 }, r3.createElement(ArrowLeftIcon, { className: x2 }), e3.prev.title) : r3.createElement("div", null), e3.next && r3.createElement(N2, { href: e3.next.href, title: e3.next.title, className: E3 }, e3.next.title, r3.createElement(ArrowRightIcon, { className: x2 })));
|
|
1235
|
-
}
|
|
5
|
+
import { Breadcrumbs, NavLinks } from "@xyd-js/components/writer";
|
|
1236
6
|
|
|
1237
7
|
// packages/react/contexts/framework.tsx
|
|
1238
|
-
import
|
|
8
|
+
import React, { createContext, useContext } from "react";
|
|
1239
9
|
var framework = {
|
|
1240
10
|
settings: {},
|
|
1241
11
|
sidebarGroups: []
|
|
1242
12
|
};
|
|
1243
|
-
var FrameworkContext =
|
|
13
|
+
var FrameworkContext = createContext(framework);
|
|
1244
14
|
function Framework(props) {
|
|
1245
|
-
return /* @__PURE__ */
|
|
15
|
+
return /* @__PURE__ */ React.createElement(FrameworkContext.Provider, { value: {
|
|
1246
16
|
settings: props.settings,
|
|
1247
17
|
sidebarGroups: props.sidebarGroups,
|
|
1248
18
|
toc: props.toc,
|
|
@@ -1251,40 +21,40 @@ function Framework(props) {
|
|
|
1251
21
|
} }, props.children);
|
|
1252
22
|
}
|
|
1253
23
|
function useSidebarGroups() {
|
|
1254
|
-
const ctx =
|
|
24
|
+
const ctx = useContext(FrameworkContext);
|
|
1255
25
|
return ctx.sidebarGroups;
|
|
1256
26
|
}
|
|
1257
27
|
function useSettings() {
|
|
1258
|
-
const ctx =
|
|
28
|
+
const ctx = useContext(FrameworkContext);
|
|
1259
29
|
return ctx.settings;
|
|
1260
30
|
}
|
|
1261
31
|
function useToC() {
|
|
1262
|
-
const ctx =
|
|
32
|
+
const ctx = useContext(FrameworkContext);
|
|
1263
33
|
return ctx.toc;
|
|
1264
34
|
}
|
|
1265
35
|
function useBreadcrumbs() {
|
|
1266
|
-
const ctx =
|
|
36
|
+
const ctx = useContext(FrameworkContext);
|
|
1267
37
|
return ctx.breadcrumbs;
|
|
1268
38
|
}
|
|
1269
39
|
function useNavLinks() {
|
|
1270
|
-
const ctx =
|
|
40
|
+
const ctx = useContext(FrameworkContext);
|
|
1271
41
|
return ctx.navlinks;
|
|
1272
42
|
}
|
|
1273
43
|
|
|
1274
44
|
// packages/react/components/sidebar/sidebar-group.tsx
|
|
1275
|
-
import
|
|
45
|
+
import React2, { createContext as createContext3, useContext as useContext2, useEffect, useState } from "react";
|
|
1276
46
|
import { useLocation } from "react-router";
|
|
1277
47
|
|
|
1278
48
|
// packages/react/contexts/ui.tsx
|
|
1279
|
-
import { createContext as
|
|
1280
|
-
var UIContext =
|
|
49
|
+
import { createContext as createContext2 } from "react";
|
|
50
|
+
var UIContext = createContext2({
|
|
1281
51
|
href: "",
|
|
1282
|
-
setHref: (
|
|
52
|
+
setHref: (v) => {
|
|
1283
53
|
}
|
|
1284
54
|
});
|
|
1285
55
|
|
|
1286
56
|
// packages/react/components/sidebar/sidebar-group.tsx
|
|
1287
|
-
var groupContext =
|
|
57
|
+
var groupContext = createContext3({
|
|
1288
58
|
active: () => [false, () => {
|
|
1289
59
|
}],
|
|
1290
60
|
onClick: () => null
|
|
@@ -1303,13 +73,13 @@ function FwSidebarGroupContext({
|
|
|
1303
73
|
groupBehaviour = useDefaultBehaviour(initialActiveItems);
|
|
1304
74
|
}
|
|
1305
75
|
const location = useLocation();
|
|
1306
|
-
const [href, setHref] =
|
|
1307
|
-
return /* @__PURE__ */
|
|
76
|
+
const [href, setHref] = useState(location.pathname);
|
|
77
|
+
return /* @__PURE__ */ React2.createElement(UIContext.Provider, { value: {
|
|
1308
78
|
href,
|
|
1309
79
|
setHref: (value) => {
|
|
1310
80
|
setHref(value);
|
|
1311
81
|
}
|
|
1312
|
-
} }, /* @__PURE__ */
|
|
82
|
+
} }, /* @__PURE__ */ React2.createElement(groupContext.Provider, { value: {
|
|
1313
83
|
active: groupBehaviour,
|
|
1314
84
|
onClick: clientSideRouting ? (event, item) => {
|
|
1315
85
|
setHref(item.href);
|
|
@@ -1318,7 +88,7 @@ function FwSidebarGroupContext({
|
|
|
1318
88
|
} }, children));
|
|
1319
89
|
}
|
|
1320
90
|
function useGroup() {
|
|
1321
|
-
return
|
|
91
|
+
return useContext2(groupContext);
|
|
1322
92
|
}
|
|
1323
93
|
function getLastValue(set) {
|
|
1324
94
|
let value;
|
|
@@ -1334,13 +104,13 @@ function stringify(item) {
|
|
|
1334
104
|
});
|
|
1335
105
|
}
|
|
1336
106
|
function recursiveSearch(items, href, levels = []) {
|
|
1337
|
-
for (let
|
|
1338
|
-
const item = items[
|
|
107
|
+
for (let i = 0; i < items.length; i++) {
|
|
108
|
+
const item = items[i];
|
|
1339
109
|
if (item.href === href) {
|
|
1340
|
-
return [...levels,
|
|
110
|
+
return [...levels, i];
|
|
1341
111
|
}
|
|
1342
112
|
if (item.items) {
|
|
1343
|
-
const result = recursiveSearch(item.items, href, [...levels,
|
|
113
|
+
const result = recursiveSearch(item.items, href, [...levels, i]);
|
|
1344
114
|
if (result) {
|
|
1345
115
|
return result;
|
|
1346
116
|
}
|
|
@@ -1365,9 +135,9 @@ function calcActive(groups, url) {
|
|
|
1365
135
|
}
|
|
1366
136
|
function useDefaultBehaviour(initialActiveItems) {
|
|
1367
137
|
const groups = useSidebarGroups();
|
|
1368
|
-
const [weakSet] =
|
|
1369
|
-
const [, setForceUpdate] =
|
|
1370
|
-
|
|
138
|
+
const [weakSet] = useState(() => new Set(initialActiveItems.map((item) => stringify(item))));
|
|
139
|
+
const [, setForceUpdate] = useState(0);
|
|
140
|
+
useEffect(() => {
|
|
1371
141
|
window.addEventListener("xyd.history.pushState", (event) => {
|
|
1372
142
|
var _a;
|
|
1373
143
|
const url = (_a = event.detail) == null ? void 0 : _a.url;
|
|
@@ -1405,9 +175,9 @@ function useDefaultBehaviour(initialActiveItems) {
|
|
|
1405
175
|
];
|
|
1406
176
|
}
|
|
1407
177
|
function useOnePathBehaviour(initialActiveItems) {
|
|
1408
|
-
const [weakSet] =
|
|
1409
|
-
const [lastLevel, setLastLevel] =
|
|
1410
|
-
const [, setForceUpdate] =
|
|
178
|
+
const [weakSet] = useState(() => new Set(initialActiveItems.map((item) => stringify(item))));
|
|
179
|
+
const [lastLevel, setLastLevel] = useState(false);
|
|
180
|
+
const [, setForceUpdate] = useState(0);
|
|
1411
181
|
const forceUpdate = () => setForceUpdate((prev) => prev + 1);
|
|
1412
182
|
const addItem = (item) => {
|
|
1413
183
|
weakSet.add(stringify(item));
|
|
@@ -1441,8 +211,8 @@ function useOnePathBehaviour(initialActiveItems) {
|
|
|
1441
211
|
if ((item.level || 0) > (lastLevel || 0) || lastLevel == false) {
|
|
1442
212
|
addItem(item);
|
|
1443
213
|
} else {
|
|
1444
|
-
const
|
|
1445
|
-
deleteItem(JSON.parse(
|
|
214
|
+
const v = getLastValue(weakSet);
|
|
215
|
+
deleteItem(JSON.parse(v));
|
|
1446
216
|
addItem(item);
|
|
1447
217
|
}
|
|
1448
218
|
}
|
|
@@ -1457,10 +227,11 @@ function scrollToDataSlug(event, item) {
|
|
|
1457
227
|
}
|
|
1458
228
|
|
|
1459
229
|
// packages/react/components/sidebar/sidebar.tsx
|
|
1460
|
-
import
|
|
230
|
+
import React3 from "react";
|
|
231
|
+
import { Badge } from "@xyd-js/components/writer";
|
|
1461
232
|
import { UISidebar } from "@xyd-js/ui";
|
|
1462
233
|
function FwSidebarItemGroup(props) {
|
|
1463
|
-
return /* @__PURE__ */
|
|
234
|
+
return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(UISidebar.ItemHeader, null, props.group), props.items.map((item, index) => /* @__PURE__ */ React3.createElement(
|
|
1464
235
|
FwSidebarItem,
|
|
1465
236
|
{
|
|
1466
237
|
key: index + item.href,
|
|
@@ -1475,7 +246,7 @@ function FwSidebarItemGroup(props) {
|
|
|
1475
246
|
var components = {
|
|
1476
247
|
Frontmatter: {
|
|
1477
248
|
// TODO: css
|
|
1478
|
-
Title: ({ children }) => /* @__PURE__ */
|
|
249
|
+
Title: ({ children }) => /* @__PURE__ */ React3.createElement("div", { style: {
|
|
1479
250
|
display: "flex",
|
|
1480
251
|
alignItems: "center",
|
|
1481
252
|
justifyContent: "space-between",
|
|
@@ -1483,16 +254,16 @@ var components = {
|
|
|
1483
254
|
gap: "10px"
|
|
1484
255
|
} }, children)
|
|
1485
256
|
},
|
|
1486
|
-
Badge: ({ children }) => /* @__PURE__ */
|
|
257
|
+
Badge: ({ children }) => /* @__PURE__ */ React3.createElement(Badge, null, children)
|
|
1487
258
|
};
|
|
1488
259
|
function mdxExport(code, components2) {
|
|
1489
260
|
const scope = {
|
|
1490
|
-
Fragment:
|
|
1491
|
-
jsxs:
|
|
1492
|
-
jsx:
|
|
1493
|
-
jsxDEV:
|
|
1494
|
-
_jsxs:
|
|
1495
|
-
_jsx:
|
|
261
|
+
Fragment: React3.Fragment,
|
|
262
|
+
jsxs: React3.createElement,
|
|
263
|
+
jsx: React3.createElement,
|
|
264
|
+
jsxDEV: React3.createElement,
|
|
265
|
+
_jsxs: React3.createElement,
|
|
266
|
+
_jsx: React3.createElement,
|
|
1496
267
|
...components2
|
|
1497
268
|
};
|
|
1498
269
|
const fn = new Function(...Object.keys(scope), `return ${code}`);
|
|
@@ -1513,7 +284,7 @@ function FwSidebarItem(props) {
|
|
|
1513
284
|
} else {
|
|
1514
285
|
Title = () => props.title;
|
|
1515
286
|
}
|
|
1516
|
-
return /* @__PURE__ */
|
|
287
|
+
return /* @__PURE__ */ React3.createElement(
|
|
1517
288
|
UISidebar.Item,
|
|
1518
289
|
{
|
|
1519
290
|
button: !!((_a = props.items) == null ? void 0 : _a.length),
|
|
@@ -1523,8 +294,8 @@ function FwSidebarItem(props) {
|
|
|
1523
294
|
setActive();
|
|
1524
295
|
}
|
|
1525
296
|
},
|
|
1526
|
-
/* @__PURE__ */
|
|
1527
|
-
((_b = props.items) == null ? void 0 : _b.length) && /* @__PURE__ */
|
|
297
|
+
/* @__PURE__ */ React3.createElement(Title, null),
|
|
298
|
+
((_b = props.items) == null ? void 0 : _b.length) && /* @__PURE__ */ React3.createElement(UISidebar.SubTree, { isOpen: isActive }, /* @__PURE__ */ React3.createElement(React3.Fragment, null, (_c = props.items) == null ? void 0 : _c.map((item, index) => /* @__PURE__ */ React3.createElement(
|
|
1528
299
|
FwSidebarItem,
|
|
1529
300
|
{
|
|
1530
301
|
key: index + item.href,
|
|
@@ -1542,25 +313,25 @@ function FwSidebarItem(props) {
|
|
|
1542
313
|
import { Nav } from "@xyd-js/ui";
|
|
1543
314
|
|
|
1544
315
|
// packages/react/utils/manualHydration.ts
|
|
1545
|
-
import
|
|
316
|
+
import React4 from "react";
|
|
1546
317
|
function manualHydration(obj, key = 0) {
|
|
1547
318
|
if (typeof obj !== "object" || obj === null) {
|
|
1548
|
-
return
|
|
319
|
+
return React4.createElement(React4.Fragment, { key });
|
|
1549
320
|
}
|
|
1550
321
|
const { type, props } = obj || {};
|
|
1551
322
|
if (typeof type !== "string" && typeof type !== "function") {
|
|
1552
|
-
return
|
|
323
|
+
return React4.createElement(React4.Fragment, { key });
|
|
1553
324
|
}
|
|
1554
325
|
let children = [];
|
|
1555
326
|
if (props == null ? void 0 : props.children) {
|
|
1556
327
|
if (Array.isArray(props.children)) {
|
|
1557
|
-
children = props.children.map((child,
|
|
328
|
+
children = props.children.map((child, i) => manualHydration(child, key + i)) || [];
|
|
1558
329
|
} else {
|
|
1559
330
|
children = [manualHydration(props.children, key)];
|
|
1560
331
|
}
|
|
1561
332
|
}
|
|
1562
333
|
const elementProps = { ...props, children, key };
|
|
1563
|
-
return
|
|
334
|
+
return React4.createElement(type, elementProps);
|
|
1564
335
|
}
|
|
1565
336
|
|
|
1566
337
|
// packages/react/hooks/useMatchedNav.tsx
|
|
@@ -1589,8 +360,8 @@ function useMatchedSubNav() {
|
|
|
1589
360
|
function FwNavLogo() {
|
|
1590
361
|
var _a, _b, _c;
|
|
1591
362
|
const settings = useSettings();
|
|
1592
|
-
const logo =
|
|
1593
|
-
return /* @__PURE__ */
|
|
363
|
+
const logo = isValidElement((_a = settings == null ? void 0 : settings.styling) == null ? void 0 : _a.logo) ? (_b = settings == null ? void 0 : settings.styling) == null ? void 0 : _b.logo : manualHydration((_c = settings == null ? void 0 : settings.styling) == null ? void 0 : _c.logo);
|
|
364
|
+
return /* @__PURE__ */ React5.createElement("a", { href: "/" }, logo);
|
|
1594
365
|
}
|
|
1595
366
|
function FwNav({ kind }) {
|
|
1596
367
|
var _a, _b, _c;
|
|
@@ -1599,17 +370,17 @@ function FwNav({ kind }) {
|
|
|
1599
370
|
const settings = useSettings();
|
|
1600
371
|
const headers = matchedSubnav ? matchedSubnav == null ? void 0 : matchedSubnav.items : (_a = settings == null ? void 0 : settings.structure) == null ? void 0 : _a.header;
|
|
1601
372
|
const active = headers == null ? void 0 : headers.find((item) => location.pathname.startsWith(item.url || ""));
|
|
1602
|
-
return /* @__PURE__ */
|
|
373
|
+
return /* @__PURE__ */ React5.createElement(
|
|
1603
374
|
Nav,
|
|
1604
375
|
{
|
|
1605
376
|
value: (active == null ? void 0 : active.url) || "",
|
|
1606
377
|
kind,
|
|
1607
|
-
logo: /* @__PURE__ */
|
|
378
|
+
logo: /* @__PURE__ */ React5.createElement(FwNavLogo, null),
|
|
1608
379
|
onChange: () => {
|
|
1609
380
|
}
|
|
1610
381
|
},
|
|
1611
382
|
(_c = (_b = settings == null ? void 0 : settings.structure) == null ? void 0 : _b.header) == null ? void 0 : _c.map((item, index) => {
|
|
1612
|
-
return /* @__PURE__ */
|
|
383
|
+
return /* @__PURE__ */ React5.createElement(
|
|
1613
384
|
Nav.Item,
|
|
1614
385
|
{
|
|
1615
386
|
key: index + (item.url || "") + item.name,
|
|
@@ -1628,7 +399,7 @@ function FwSubNav() {
|
|
|
1628
399
|
return null;
|
|
1629
400
|
}
|
|
1630
401
|
const active = matchedSubnav == null ? void 0 : matchedSubnav.items.findLast((item) => location.pathname.startsWith(item.url || ""));
|
|
1631
|
-
return /* @__PURE__ */
|
|
402
|
+
return /* @__PURE__ */ React5.createElement(
|
|
1632
403
|
SubNav,
|
|
1633
404
|
{
|
|
1634
405
|
title: (matchedSubnav == null ? void 0 : matchedSubnav.name) || "",
|
|
@@ -1637,18 +408,18 @@ function FwSubNav() {
|
|
|
1637
408
|
}
|
|
1638
409
|
},
|
|
1639
410
|
matchedSubnav == null ? void 0 : matchedSubnav.items.map((item, index) => {
|
|
1640
|
-
return /* @__PURE__ */
|
|
411
|
+
return /* @__PURE__ */ React5.createElement(SubNav.Item, { value: item.url || "", href: item.url }, item.name);
|
|
1641
412
|
})
|
|
1642
413
|
);
|
|
1643
414
|
}
|
|
1644
415
|
function recursiveSearch2(items, href, levels = []) {
|
|
1645
|
-
for (let
|
|
1646
|
-
const item = items[
|
|
416
|
+
for (let i = 0; i < items.length; i++) {
|
|
417
|
+
const item = items[i];
|
|
1647
418
|
if (item.href === href) {
|
|
1648
|
-
return [...levels,
|
|
419
|
+
return [...levels, i];
|
|
1649
420
|
}
|
|
1650
421
|
if (item.items) {
|
|
1651
|
-
const result = recursiveSearch2(item.items, href, [...levels,
|
|
422
|
+
const result = recursiveSearch2(item.items, href, [...levels, i]);
|
|
1652
423
|
if (result) {
|
|
1653
424
|
return result;
|
|
1654
425
|
}
|
|
@@ -1665,19 +436,19 @@ function FwSidebarGroups(props) {
|
|
|
1665
436
|
if (typeof anchor.icon === "string") {
|
|
1666
437
|
switch (anchor.icon) {
|
|
1667
438
|
case "icon-cookbook": {
|
|
1668
|
-
icon = /* @__PURE__ */
|
|
439
|
+
icon = /* @__PURE__ */ React5.createElement(IconCookbook, null);
|
|
1669
440
|
break;
|
|
1670
441
|
}
|
|
1671
442
|
case "icon-community": {
|
|
1672
|
-
icon = /* @__PURE__ */
|
|
443
|
+
icon = /* @__PURE__ */ React5.createElement(IconCommunity, null);
|
|
1673
444
|
break;
|
|
1674
445
|
}
|
|
1675
446
|
case "icon-marketplace": {
|
|
1676
|
-
icon = /* @__PURE__ */
|
|
447
|
+
icon = /* @__PURE__ */ React5.createElement(IconMarketplace, null);
|
|
1677
448
|
break;
|
|
1678
449
|
}
|
|
1679
450
|
case "icon-sdk": {
|
|
1680
|
-
icon = /* @__PURE__ */
|
|
451
|
+
icon = /* @__PURE__ */ React5.createElement(IconSDK, null);
|
|
1681
452
|
break;
|
|
1682
453
|
}
|
|
1683
454
|
default: {
|
|
@@ -1685,9 +456,9 @@ function FwSidebarGroups(props) {
|
|
|
1685
456
|
}
|
|
1686
457
|
}
|
|
1687
458
|
} else {
|
|
1688
|
-
icon =
|
|
459
|
+
icon = isValidElement(anchor.icon) ? anchor.icon : manualHydration(anchor.icon);
|
|
1689
460
|
}
|
|
1690
|
-
return /* @__PURE__ */
|
|
461
|
+
return /* @__PURE__ */ React5.createElement(UISidebar2.FooterItem, { href: anchor.url, icon }, anchor.name);
|
|
1691
462
|
});
|
|
1692
463
|
const location = useLocation3();
|
|
1693
464
|
const initialActiveItems = [];
|
|
@@ -1700,14 +471,14 @@ function FwSidebarGroups(props) {
|
|
|
1700
471
|
}, group.items);
|
|
1701
472
|
return group;
|
|
1702
473
|
});
|
|
1703
|
-
return /* @__PURE__ */
|
|
474
|
+
return /* @__PURE__ */ React5.createElement(
|
|
1704
475
|
FwSidebarGroupContext,
|
|
1705
476
|
{
|
|
1706
477
|
onePathBehaviour: props.onePathBehaviour,
|
|
1707
478
|
clientSideRouting: props.clientSideRouting,
|
|
1708
479
|
initialActiveItems
|
|
1709
480
|
},
|
|
1710
|
-
/* @__PURE__ */
|
|
481
|
+
/* @__PURE__ */ React5.createElement(UISidebar2, { footerItems: footerItems && footerItems }, groups == null ? void 0 : groups.map((group, index) => /* @__PURE__ */ React5.createElement(
|
|
1711
482
|
FwSidebarItemGroup,
|
|
1712
483
|
{
|
|
1713
484
|
key: index + group.group,
|
|
@@ -1739,7 +510,7 @@ function FwToc() {
|
|
|
1739
510
|
const tocFinal = flatToc.filter((item) => item.depth === 2);
|
|
1740
511
|
const location = useLocation3();
|
|
1741
512
|
const defaultValue = location.hash ? location.hash.replace("#", "") : (_a = tocFinal[0]) == null ? void 0 : _a.value;
|
|
1742
|
-
return /* @__PURE__ */
|
|
513
|
+
return /* @__PURE__ */ React5.createElement(Toc, { defaultValue }, tocFinal.map((item, index) => /* @__PURE__ */ React5.createElement(
|
|
1743
514
|
Toc.Item,
|
|
1744
515
|
{
|
|
1745
516
|
key: index + item.value + item.depth,
|
|
@@ -1750,8 +521,8 @@ function FwToc() {
|
|
|
1750
521
|
}
|
|
1751
522
|
function FwBreadcrumbs() {
|
|
1752
523
|
const breadcrumbs = useBreadcrumbs();
|
|
1753
|
-
return /* @__PURE__ */
|
|
1754
|
-
|
|
524
|
+
return /* @__PURE__ */ React5.createElement(
|
|
525
|
+
Breadcrumbs,
|
|
1755
526
|
{
|
|
1756
527
|
items: breadcrumbs || []
|
|
1757
528
|
}
|
|
@@ -1764,8 +535,8 @@ function FwNavLinks() {
|
|
|
1764
535
|
return null;
|
|
1765
536
|
}
|
|
1766
537
|
if ((navlinks == null ? void 0 : navlinks.prev) || (navlinks == null ? void 0 : navlinks.next)) {
|
|
1767
|
-
return /* @__PURE__ */
|
|
1768
|
-
|
|
538
|
+
return /* @__PURE__ */ React5.createElement(
|
|
539
|
+
NavLinks,
|
|
1769
540
|
{
|
|
1770
541
|
prev: navlinks.prev,
|
|
1771
542
|
next: navlinks.next
|
|
@@ -1775,7 +546,7 @@ function FwNavLinks() {
|
|
|
1775
546
|
return null;
|
|
1776
547
|
}
|
|
1777
548
|
function IconCookbook() {
|
|
1778
|
-
return /* @__PURE__ */
|
|
549
|
+
return /* @__PURE__ */ React5.createElement(
|
|
1779
550
|
"svg",
|
|
1780
551
|
{
|
|
1781
552
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1783,7 +554,7 @@ function IconCookbook() {
|
|
|
1783
554
|
width: "1em",
|
|
1784
555
|
height: "1em"
|
|
1785
556
|
},
|
|
1786
|
-
/* @__PURE__ */
|
|
557
|
+
/* @__PURE__ */ React5.createElement(
|
|
1787
558
|
"path",
|
|
1788
559
|
{
|
|
1789
560
|
fillRule: "evenodd",
|
|
@@ -1794,7 +565,7 @@ function IconCookbook() {
|
|
|
1794
565
|
);
|
|
1795
566
|
}
|
|
1796
567
|
function IconCommunity() {
|
|
1797
|
-
return /* @__PURE__ */
|
|
568
|
+
return /* @__PURE__ */ React5.createElement(
|
|
1798
569
|
"svg",
|
|
1799
570
|
{
|
|
1800
571
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1803,7 +574,7 @@ function IconCommunity() {
|
|
|
1803
574
|
width: "1em",
|
|
1804
575
|
height: "1em"
|
|
1805
576
|
},
|
|
1806
|
-
/* @__PURE__ */
|
|
577
|
+
/* @__PURE__ */ React5.createElement(
|
|
1807
578
|
"path",
|
|
1808
579
|
{
|
|
1809
580
|
fillRule: "evenodd",
|
|
@@ -1814,7 +585,7 @@ function IconCommunity() {
|
|
|
1814
585
|
);
|
|
1815
586
|
}
|
|
1816
587
|
function IconMarketplace() {
|
|
1817
|
-
return /* @__PURE__ */
|
|
588
|
+
return /* @__PURE__ */ React5.createElement(
|
|
1818
589
|
"svg",
|
|
1819
590
|
{
|
|
1820
591
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1823,7 +594,7 @@ function IconMarketplace() {
|
|
|
1823
594
|
width: "1em",
|
|
1824
595
|
height: "1em"
|
|
1825
596
|
},
|
|
1826
|
-
/* @__PURE__ */
|
|
597
|
+
/* @__PURE__ */ React5.createElement(
|
|
1827
598
|
"path",
|
|
1828
599
|
{
|
|
1829
600
|
"fill-rule": "evenodd",
|
|
@@ -1831,7 +602,7 @@ function IconMarketplace() {
|
|
|
1831
602
|
d: "M3.78163 3.28449C3.8768 2.96725 4.16879 2.75 4.5 2.75H19.5C19.8312 2.75 20.1232 2.96725 20.2184 3.28449L21.7184 8.28449C21.7393 8.3544 21.75 8.42701 21.75 8.5C21.75 10.5711 20.0711 12.25 18 12.25C16.7733 12.25 15.6842 11.661 15 10.7504C14.3158 11.661 13.2267 12.25 12 12.25C10.7733 12.25 9.68417 11.661 9 10.7504C8.31583 11.661 7.2267 12.25 6 12.25C3.92893 12.25 2.25 10.5711 2.25 8.5C2.25 8.42701 2.26066 8.3544 2.28163 8.28449L3.78163 3.28449ZM9.75 8.5C9.75 9.74264 10.7574 10.75 12 10.75C13.2426 10.75 14.25 9.74264 14.25 8.5C14.25 8.08579 14.5858 7.75 15 7.75C15.4142 7.75 15.75 8.08579 15.75 8.5C15.75 9.74264 16.7574 10.75 18 10.75C19.2083 10.75 20.1942 9.79754 20.2477 8.60244L18.942 4.25H5.05802L3.75229 8.60244C3.80584 9.79753 4.79169 10.75 6 10.75C7.24264 10.75 8.25 9.74264 8.25 8.5C8.25 8.08579 8.58579 7.75 9 7.75C9.41421 7.75 9.75 8.08579 9.75 8.5Z"
|
|
1832
603
|
}
|
|
1833
604
|
),
|
|
1834
|
-
/* @__PURE__ */
|
|
605
|
+
/* @__PURE__ */ React5.createElement(
|
|
1835
606
|
"path",
|
|
1836
607
|
{
|
|
1837
608
|
"fill-rule": "evenodd",
|
|
@@ -1839,7 +610,7 @@ function IconMarketplace() {
|
|
|
1839
610
|
d: "M4 10.25C4.41421 10.25 4.75 10.5858 4.75 11V19.75H6.5C6.91421 19.75 7.25 20.0858 7.25 20.5C7.25 20.9142 6.91421 21.25 6.5 21.25H4C3.58579 21.25 3.25 20.9142 3.25 20.5V11C3.25 10.5858 3.58579 10.25 4 10.25ZM20 10.25C20.4142 10.25 20.75 10.5858 20.75 11V20.5C20.75 20.9142 20.4142 21.25 20 21.25H10.5C10.0858 21.25 9.75 20.9142 9.75 20.5C9.75 20.0858 10.0858 19.75 10.5 19.75H19.25V11C19.25 10.5858 19.5858 10.25 20 10.25Z"
|
|
1840
611
|
}
|
|
1841
612
|
),
|
|
1842
|
-
/* @__PURE__ */
|
|
613
|
+
/* @__PURE__ */ React5.createElement(
|
|
1843
614
|
"path",
|
|
1844
615
|
{
|
|
1845
616
|
d: "M12.003 19C11.31 18.9996 10.6384 18.7598 10.102 18.3213C9.56564 17.8829 9.19745 17.2726 9.05983 16.594C8.92222 15.9154 9.02364 15.2101 9.34693 14.5976C9.67022 13.9852 10.1955 13.5032 10.8337 13.2333C11.5673 12.9262 12.393 12.9221 13.1296 13.2222C13.8661 13.5222 14.4536 14.1018 14.7631 14.8338C15.0727 15.5659 15.0791 16.3907 14.7808 17.1274C14.4827 17.8642 13.9042 18.4527 13.1724 18.7641C12.8025 18.9205 12.4047 19.0007 12.003 19ZM11.1458 14.7215C11.1124 14.7215 11.0803 14.7348 11.0567 14.7584C11.0331 14.782 11.0198 14.8141 11.0198 14.8475V17.1923C11.0198 17.2258 11.0331 17.2578 11.0567 17.2814C11.0803 17.305 11.1124 17.3183 11.1458 17.3183C11.1671 17.3183 11.188 17.3128 11.2065 17.3024L13.3399 16.13C13.3597 16.1192 13.3761 16.1032 13.3876 16.0838C13.3991 16.0644 13.4052 16.0423 13.4052 16.0197C13.4052 15.9972 13.3991 15.9751 13.3876 15.9557C13.3761 15.9362 13.3597 15.9203 13.3399 15.9094L11.2063 14.7373C11.1879 14.727 11.1671 14.7215 11.1458 14.7215Z"
|
|
@@ -1848,7 +619,7 @@ function IconMarketplace() {
|
|
|
1848
619
|
);
|
|
1849
620
|
}
|
|
1850
621
|
function IconSDK() {
|
|
1851
|
-
return /* @__PURE__ */
|
|
622
|
+
return /* @__PURE__ */ React5.createElement(
|
|
1852
623
|
"svg",
|
|
1853
624
|
{
|
|
1854
625
|
viewBox: "0 0 15 15",
|
|
@@ -1856,7 +627,7 @@ function IconSDK() {
|
|
|
1856
627
|
width: "1em",
|
|
1857
628
|
height: "1em"
|
|
1858
629
|
},
|
|
1859
|
-
/* @__PURE__ */
|
|
630
|
+
/* @__PURE__ */ React5.createElement(
|
|
1860
631
|
"path",
|
|
1861
632
|
{
|
|
1862
633
|
d: "M7.28856 0.796908C7.42258 0.734364 7.57742 0.734364 7.71144 0.796908L13.7114 3.59691C13.8875 3.67906 14 3.85574 14 4.05V10.95C14 11.1443 13.8875 11.3209 13.7114 11.4031L7.71144 14.2031C7.57742 14.2656 7.42258 14.2656 7.28856 14.2031L1.28856 11.4031C1.11252 11.3209 1 11.1443 1 10.95V4.05C1 3.85574 1.11252 3.67906 1.28856 3.59691L7.28856 0.796908ZM2 4.80578L7 6.93078V12.9649L2 10.6316V4.80578ZM8 12.9649L13 10.6316V4.80578L8 6.93078V12.9649ZM7.5 6.05672L12.2719 4.02866L7.5 1.80176L2.72809 4.02866L7.5 6.05672Z",
|
|
@@ -1877,62 +648,4 @@ export {
|
|
|
1877
648
|
FwToc,
|
|
1878
649
|
useMatchedSubNav
|
|
1879
650
|
};
|
|
1880
|
-
/*! Bundled license information:
|
|
1881
|
-
|
|
1882
|
-
lucide-react/dist/esm/shared/src/utils.js:
|
|
1883
|
-
(**
|
|
1884
|
-
* @license lucide-react v0.447.0 - ISC
|
|
1885
|
-
*
|
|
1886
|
-
* This source code is licensed under the ISC license.
|
|
1887
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
1888
|
-
*)
|
|
1889
|
-
|
|
1890
|
-
lucide-react/dist/esm/defaultAttributes.js:
|
|
1891
|
-
(**
|
|
1892
|
-
* @license lucide-react v0.447.0 - ISC
|
|
1893
|
-
*
|
|
1894
|
-
* This source code is licensed under the ISC license.
|
|
1895
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
1896
|
-
*)
|
|
1897
|
-
|
|
1898
|
-
lucide-react/dist/esm/Icon.js:
|
|
1899
|
-
(**
|
|
1900
|
-
* @license lucide-react v0.447.0 - ISC
|
|
1901
|
-
*
|
|
1902
|
-
* This source code is licensed under the ISC license.
|
|
1903
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
1904
|
-
*)
|
|
1905
|
-
|
|
1906
|
-
lucide-react/dist/esm/createLucideIcon.js:
|
|
1907
|
-
(**
|
|
1908
|
-
* @license lucide-react v0.447.0 - ISC
|
|
1909
|
-
*
|
|
1910
|
-
* This source code is licensed under the ISC license.
|
|
1911
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
1912
|
-
*)
|
|
1913
|
-
|
|
1914
|
-
lucide-react/dist/esm/icons/chevron-left.js:
|
|
1915
|
-
(**
|
|
1916
|
-
* @license lucide-react v0.447.0 - ISC
|
|
1917
|
-
*
|
|
1918
|
-
* This source code is licensed under the ISC license.
|
|
1919
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
1920
|
-
*)
|
|
1921
|
-
|
|
1922
|
-
lucide-react/dist/esm/icons/chevron-right.js:
|
|
1923
|
-
(**
|
|
1924
|
-
* @license lucide-react v0.447.0 - ISC
|
|
1925
|
-
*
|
|
1926
|
-
* This source code is licensed under the ISC license.
|
|
1927
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
1928
|
-
*)
|
|
1929
|
-
|
|
1930
|
-
lucide-react/dist/esm/lucide-react.js:
|
|
1931
|
-
(**
|
|
1932
|
-
* @license lucide-react v0.447.0 - ISC
|
|
1933
|
-
*
|
|
1934
|
-
* This source code is licensed under the ISC license.
|
|
1935
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
1936
|
-
*)
|
|
1937
|
-
*/
|
|
1938
651
|
//# sourceMappingURL=react.mjs.map
|