@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.js
CHANGED
|
@@ -41,1250 +41,20 @@ __export(react_exports, {
|
|
|
41
41
|
module.exports = __toCommonJS(react_exports);
|
|
42
42
|
|
|
43
43
|
// packages/react/components/index.tsx
|
|
44
|
-
var
|
|
44
|
+
var import_react6 = __toESM(require("react"));
|
|
45
45
|
var import_react_router3 = require("react-router");
|
|
46
46
|
var import_ui3 = require("@xyd-js/ui");
|
|
47
|
-
|
|
48
|
-
// ../xyd-components/dist/index-C0sBj-Rt.js
|
|
49
|
-
var import_react = __toESM(require("react"), 1);
|
|
50
|
-
var n = "hutvd2b";
|
|
51
|
-
var a = "hg9oorb";
|
|
52
|
-
var r = "h6jev6x";
|
|
53
|
-
var l = "i1uvewli";
|
|
54
|
-
function c(t5) {
|
|
55
|
-
var c2 = t5.children, o3 = t5.size, i3 = void 0 === o3 ? "sm" : o3, s2 = t5.kind, d3 = void 0 === s2 ? "warning" : s2;
|
|
56
|
-
return import_react.default.createElement("div", { className: "\n ".concat(n, "\n \n ").concat("sm" === i3 && r, "\n \n ").concat("warning" === d3 && a, "\n ") }, import_react.default.createElement("span", { className: l }, c2));
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// ../xyd-components/dist/tslib.es6-nZyJ5rcw.js
|
|
60
|
-
function t2(t5, n4) {
|
|
61
|
-
var e3 = {};
|
|
62
|
-
for (var r4 in t5) Object.prototype.hasOwnProperty.call(t5, r4) && n4.indexOf(r4) < 0 && (e3[r4] = t5[r4]);
|
|
63
|
-
if (null != t5 && "function" == typeof Object.getOwnPropertySymbols) {
|
|
64
|
-
var o3 = 0;
|
|
65
|
-
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]]);
|
|
66
|
-
}
|
|
67
|
-
return e3;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// ../xyd-components/dist/writer.js
|
|
71
|
-
var import_react7 = __toESM(require("react"), 1);
|
|
72
|
-
|
|
73
|
-
// ../../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
|
|
74
|
-
var import_react2 = require("react");
|
|
75
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
76
|
-
if (source == null) return {};
|
|
77
|
-
var target = {};
|
|
78
|
-
var sourceKeys = Object.keys(source);
|
|
79
|
-
var key, i3;
|
|
80
|
-
for (i3 = 0; i3 < sourceKeys.length; i3++) {
|
|
81
|
-
key = sourceKeys[i3];
|
|
82
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
83
|
-
target[key] = source[key];
|
|
84
|
-
}
|
|
85
|
-
return target;
|
|
86
|
-
}
|
|
87
|
-
var _excluded$f = ["color"];
|
|
88
|
-
var ArrowLeftIcon = /* @__PURE__ */ (0, import_react2.forwardRef)(function(_ref, forwardedRef) {
|
|
89
|
-
var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, props = _objectWithoutPropertiesLoose(_ref, _excluded$f);
|
|
90
|
-
return (0, import_react2.createElement)("svg", Object.assign({
|
|
91
|
-
width: "15",
|
|
92
|
-
height: "15",
|
|
93
|
-
viewBox: "0 0 15 15",
|
|
94
|
-
fill: "none",
|
|
95
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
96
|
-
}, props, {
|
|
97
|
-
ref: forwardedRef
|
|
98
|
-
}), (0, import_react2.createElement)("path", {
|
|
99
|
-
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",
|
|
100
|
-
fill: color,
|
|
101
|
-
fillRule: "evenodd",
|
|
102
|
-
clipRule: "evenodd"
|
|
103
|
-
}));
|
|
104
|
-
});
|
|
105
|
-
var _excluded$g = ["color"];
|
|
106
|
-
var ArrowRightIcon = /* @__PURE__ */ (0, import_react2.forwardRef)(function(_ref, forwardedRef) {
|
|
107
|
-
var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, props = _objectWithoutPropertiesLoose(_ref, _excluded$g);
|
|
108
|
-
return (0, import_react2.createElement)("svg", Object.assign({
|
|
109
|
-
width: "15",
|
|
110
|
-
height: "15",
|
|
111
|
-
viewBox: "0 0 15 15",
|
|
112
|
-
fill: "none",
|
|
113
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
114
|
-
}, props, {
|
|
115
|
-
ref: forwardedRef
|
|
116
|
-
}), (0, import_react2.createElement)("path", {
|
|
117
|
-
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",
|
|
118
|
-
fill: color,
|
|
119
|
-
fillRule: "evenodd",
|
|
120
|
-
clipRule: "evenodd"
|
|
121
|
-
}));
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
// ../xyd-components/dist/UnderlineNav-rNUvd4IV.js
|
|
125
|
-
var import_react6 = __toESM(require("react"), 1);
|
|
126
|
-
|
|
127
|
-
// ../xyd-components/dist/_rollupPluginBabelHelpers-DOmTa7nq.js
|
|
128
|
-
function t3(t5, r4) {
|
|
129
|
-
(null == r4 || r4 > t5.length) && (r4 = t5.length);
|
|
130
|
-
for (var e3 = 0, n4 = Array(r4); e3 < r4; e3++) n4[e3] = t5[e3];
|
|
131
|
-
return n4;
|
|
132
|
-
}
|
|
133
|
-
function r2(t5) {
|
|
134
|
-
if (Array.isArray(t5)) return t5;
|
|
135
|
-
}
|
|
136
|
-
function u() {
|
|
137
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
138
|
-
}
|
|
139
|
-
function h(t5, e3) {
|
|
140
|
-
return r2(t5) || function(t6, r4) {
|
|
141
|
-
var e4 = null == t6 ? null : "undefined" != typeof Symbol && t6[Symbol.iterator] || t6["@@iterator"];
|
|
142
|
-
if (null != e4) {
|
|
143
|
-
var n4, o3, i3, a3, u4 = [], c2 = true, f2 = false;
|
|
144
|
-
try {
|
|
145
|
-
if (i3 = (e4 = e4.call(t6)).next, 0 === r4) {
|
|
146
|
-
if (Object(e4) !== e4) return;
|
|
147
|
-
c2 = false;
|
|
148
|
-
} else for (; !(c2 = (n4 = i3.call(e4)).done) && (u4.push(n4.value), u4.length !== r4); c2 = true) ;
|
|
149
|
-
} catch (t7) {
|
|
150
|
-
f2 = true, o3 = t7;
|
|
151
|
-
} finally {
|
|
152
|
-
try {
|
|
153
|
-
if (!c2 && null != e4.return && (a3 = e4.return(), Object(a3) !== a3)) return;
|
|
154
|
-
} finally {
|
|
155
|
-
if (f2) throw o3;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
return u4;
|
|
159
|
-
}
|
|
160
|
-
}(t5, e3) || d(t5, e3) || u();
|
|
161
|
-
}
|
|
162
|
-
function d(r4, e3) {
|
|
163
|
-
if (r4) {
|
|
164
|
-
if ("string" == typeof r4) return t3(r4, e3);
|
|
165
|
-
var n4 = {}.toString.call(r4).slice(8, -1);
|
|
166
|
-
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;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
// ../../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
|
|
171
|
-
var React13 = __toESM(require("react"), 1);
|
|
172
|
-
|
|
173
|
-
// ../../node_modules/.pnpm/@radix-ui+primitive@1.1.1/node_modules/@radix-ui/primitive/dist/index.mjs
|
|
174
|
-
function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
175
|
-
return function handleEvent(event) {
|
|
176
|
-
originalEventHandler == null ? void 0 : originalEventHandler(event);
|
|
177
|
-
if (checkForDefaultPrevented === false || !event.defaultPrevented) {
|
|
178
|
-
return ourEventHandler == null ? void 0 : ourEventHandler(event);
|
|
179
|
-
}
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
// ../../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
|
|
184
|
-
var React = __toESM(require("react"), 1);
|
|
185
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
186
|
-
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
187
|
-
let defaultContexts = [];
|
|
188
|
-
function createContext32(rootComponentName, defaultContext) {
|
|
189
|
-
const BaseContext = React.createContext(defaultContext);
|
|
190
|
-
const index = defaultContexts.length;
|
|
191
|
-
defaultContexts = [...defaultContexts, defaultContext];
|
|
192
|
-
const Provider = (props) => {
|
|
193
|
-
var _a;
|
|
194
|
-
const { scope, children, ...context } = props;
|
|
195
|
-
const Context = ((_a = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a[index]) || BaseContext;
|
|
196
|
-
const value = React.useMemo(() => context, Object.values(context));
|
|
197
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Context.Provider, { value, children });
|
|
198
|
-
};
|
|
199
|
-
Provider.displayName = rootComponentName + "Provider";
|
|
200
|
-
function useContext22(consumerName, scope) {
|
|
201
|
-
var _a;
|
|
202
|
-
const Context = ((_a = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a[index]) || BaseContext;
|
|
203
|
-
const context = React.useContext(Context);
|
|
204
|
-
if (context) return context;
|
|
205
|
-
if (defaultContext !== void 0) return defaultContext;
|
|
206
|
-
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
207
|
-
}
|
|
208
|
-
return [Provider, useContext22];
|
|
209
|
-
}
|
|
210
|
-
const createScope = () => {
|
|
211
|
-
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
212
|
-
return React.createContext(defaultContext);
|
|
213
|
-
});
|
|
214
|
-
return function useScope(scope) {
|
|
215
|
-
const contexts = (scope == null ? void 0 : scope[scopeName]) || scopeContexts;
|
|
216
|
-
return React.useMemo(
|
|
217
|
-
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
218
|
-
[scope, contexts]
|
|
219
|
-
);
|
|
220
|
-
};
|
|
221
|
-
};
|
|
222
|
-
createScope.scopeName = scopeName;
|
|
223
|
-
return [createContext32, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
224
|
-
}
|
|
225
|
-
function composeContextScopes(...scopes) {
|
|
226
|
-
const baseScope = scopes[0];
|
|
227
|
-
if (scopes.length === 1) return baseScope;
|
|
228
|
-
const createScope = () => {
|
|
229
|
-
const scopeHooks = scopes.map((createScope2) => ({
|
|
230
|
-
useScope: createScope2(),
|
|
231
|
-
scopeName: createScope2.scopeName
|
|
232
|
-
}));
|
|
233
|
-
return function useComposedScopes(overrideScopes) {
|
|
234
|
-
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
235
|
-
const scopeProps = useScope(overrideScopes);
|
|
236
|
-
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
237
|
-
return { ...nextScopes2, ...currentScope };
|
|
238
|
-
}, {});
|
|
239
|
-
return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
240
|
-
};
|
|
241
|
-
};
|
|
242
|
-
createScope.scopeName = baseScope.scopeName;
|
|
243
|
-
return createScope;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
// ../../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
|
|
247
|
-
var React11 = __toESM(require("react"), 1);
|
|
248
|
-
|
|
249
|
-
// ../../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
|
|
250
|
-
var import_react3 = __toESM(require("react"), 1);
|
|
251
|
-
|
|
252
|
-
// ../../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
|
|
253
|
-
var React2 = __toESM(require("react"), 1);
|
|
254
|
-
function setRef(ref, value) {
|
|
255
|
-
if (typeof ref === "function") {
|
|
256
|
-
return ref(value);
|
|
257
|
-
} else if (ref !== null && ref !== void 0) {
|
|
258
|
-
ref.current = value;
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
function composeRefs(...refs) {
|
|
262
|
-
return (node) => {
|
|
263
|
-
let hasCleanup = false;
|
|
264
|
-
const cleanups = refs.map((ref) => {
|
|
265
|
-
const cleanup = setRef(ref, node);
|
|
266
|
-
if (!hasCleanup && typeof cleanup == "function") {
|
|
267
|
-
hasCleanup = true;
|
|
268
|
-
}
|
|
269
|
-
return cleanup;
|
|
270
|
-
});
|
|
271
|
-
if (hasCleanup) {
|
|
272
|
-
return () => {
|
|
273
|
-
for (let i3 = 0; i3 < cleanups.length; i3++) {
|
|
274
|
-
const cleanup = cleanups[i3];
|
|
275
|
-
if (typeof cleanup == "function") {
|
|
276
|
-
cleanup();
|
|
277
|
-
} else {
|
|
278
|
-
setRef(refs[i3], null);
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
};
|
|
282
|
-
}
|
|
283
|
-
};
|
|
284
|
-
}
|
|
285
|
-
function useComposedRefs(...refs) {
|
|
286
|
-
return React2.useCallback(composeRefs(...refs), refs);
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
// ../../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
|
|
290
|
-
var React3 = __toESM(require("react"), 1);
|
|
291
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
292
|
-
var Slot = React3.forwardRef((props, forwardedRef) => {
|
|
293
|
-
const { children, ...slotProps } = props;
|
|
294
|
-
const childrenArray = React3.Children.toArray(children);
|
|
295
|
-
const slottable = childrenArray.find(isSlottable);
|
|
296
|
-
if (slottable) {
|
|
297
|
-
const newElement = slottable.props.children;
|
|
298
|
-
const newChildren = childrenArray.map((child) => {
|
|
299
|
-
if (child === slottable) {
|
|
300
|
-
if (React3.Children.count(newElement) > 1) return React3.Children.only(null);
|
|
301
|
-
return React3.isValidElement(newElement) ? newElement.props.children : null;
|
|
302
|
-
} else {
|
|
303
|
-
return child;
|
|
304
|
-
}
|
|
305
|
-
});
|
|
306
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children: React3.isValidElement(newElement) ? React3.cloneElement(newElement, void 0, newChildren) : null });
|
|
307
|
-
}
|
|
308
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
309
|
-
});
|
|
310
|
-
Slot.displayName = "Slot";
|
|
311
|
-
var SlotClone = React3.forwardRef((props, forwardedRef) => {
|
|
312
|
-
const { children, ...slotProps } = props;
|
|
313
|
-
if (React3.isValidElement(children)) {
|
|
314
|
-
const childrenRef = getElementRef(children);
|
|
315
|
-
return React3.cloneElement(children, {
|
|
316
|
-
...mergeProps(slotProps, children.props),
|
|
317
|
-
// @ts-ignore
|
|
318
|
-
ref: forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef
|
|
319
|
-
});
|
|
320
|
-
}
|
|
321
|
-
return React3.Children.count(children) > 1 ? React3.Children.only(null) : null;
|
|
322
|
-
});
|
|
323
|
-
SlotClone.displayName = "SlotClone";
|
|
324
|
-
var Slottable = ({ children }) => {
|
|
325
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children });
|
|
326
|
-
};
|
|
327
|
-
function isSlottable(child) {
|
|
328
|
-
return React3.isValidElement(child) && child.type === Slottable;
|
|
329
|
-
}
|
|
330
|
-
function mergeProps(slotProps, childProps) {
|
|
331
|
-
const overrideProps = { ...childProps };
|
|
332
|
-
for (const propName in childProps) {
|
|
333
|
-
const slotPropValue = slotProps[propName];
|
|
334
|
-
const childPropValue = childProps[propName];
|
|
335
|
-
const isHandler = /^on[A-Z]/.test(propName);
|
|
336
|
-
if (isHandler) {
|
|
337
|
-
if (slotPropValue && childPropValue) {
|
|
338
|
-
overrideProps[propName] = (...args) => {
|
|
339
|
-
childPropValue(...args);
|
|
340
|
-
slotPropValue(...args);
|
|
341
|
-
};
|
|
342
|
-
} else if (slotPropValue) {
|
|
343
|
-
overrideProps[propName] = slotPropValue;
|
|
344
|
-
}
|
|
345
|
-
} else if (propName === "style") {
|
|
346
|
-
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
347
|
-
} else if (propName === "className") {
|
|
348
|
-
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
return { ...slotProps, ...overrideProps };
|
|
352
|
-
}
|
|
353
|
-
function getElementRef(element) {
|
|
354
|
-
var _a, _b;
|
|
355
|
-
let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
|
|
356
|
-
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
357
|
-
if (mayWarn) {
|
|
358
|
-
return element.ref;
|
|
359
|
-
}
|
|
360
|
-
getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b.get;
|
|
361
|
-
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
362
|
-
if (mayWarn) {
|
|
363
|
-
return element.props.ref;
|
|
364
|
-
}
|
|
365
|
-
return element.props.ref || element.ref;
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
// ../../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
|
|
369
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
370
|
-
function createCollection(name) {
|
|
371
|
-
const PROVIDER_NAME = name + "CollectionProvider";
|
|
372
|
-
const [createCollectionContext, createCollectionScope2] = createContextScope(PROVIDER_NAME);
|
|
373
|
-
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(
|
|
374
|
-
PROVIDER_NAME,
|
|
375
|
-
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
376
|
-
);
|
|
377
|
-
const CollectionProvider = (props) => {
|
|
378
|
-
const { scope, children } = props;
|
|
379
|
-
const ref = import_react3.default.useRef(null);
|
|
380
|
-
const itemMap = import_react3.default.useRef(/* @__PURE__ */ new Map()).current;
|
|
381
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
|
|
382
|
-
};
|
|
383
|
-
CollectionProvider.displayName = PROVIDER_NAME;
|
|
384
|
-
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
385
|
-
const CollectionSlot = import_react3.default.forwardRef(
|
|
386
|
-
(props, forwardedRef) => {
|
|
387
|
-
const { scope, children } = props;
|
|
388
|
-
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
389
|
-
const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);
|
|
390
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Slot, { ref: composedRefs, children });
|
|
391
|
-
}
|
|
392
|
-
);
|
|
393
|
-
CollectionSlot.displayName = COLLECTION_SLOT_NAME;
|
|
394
|
-
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
395
|
-
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
396
|
-
const CollectionItemSlot = import_react3.default.forwardRef(
|
|
397
|
-
(props, forwardedRef) => {
|
|
398
|
-
const { scope, children, ...itemData } = props;
|
|
399
|
-
const ref = import_react3.default.useRef(null);
|
|
400
|
-
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
401
|
-
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
402
|
-
import_react3.default.useEffect(() => {
|
|
403
|
-
context.itemMap.set(ref, { ref, ...itemData });
|
|
404
|
-
return () => void context.itemMap.delete(ref);
|
|
405
|
-
});
|
|
406
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Slot, { ...{ [ITEM_DATA_ATTR]: "" }, ref: composedRefs, children });
|
|
407
|
-
}
|
|
408
|
-
);
|
|
409
|
-
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
410
|
-
function useCollection2(scope) {
|
|
411
|
-
const context = useCollectionContext(name + "CollectionConsumer", scope);
|
|
412
|
-
const getItems = import_react3.default.useCallback(() => {
|
|
413
|
-
const collectionNode = context.collectionRef.current;
|
|
414
|
-
if (!collectionNode) return [];
|
|
415
|
-
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
|
416
|
-
const items = Array.from(context.itemMap.values());
|
|
417
|
-
const orderedItems = items.sort(
|
|
418
|
-
(a3, b2) => orderedNodes.indexOf(a3.ref.current) - orderedNodes.indexOf(b2.ref.current)
|
|
419
|
-
);
|
|
420
|
-
return orderedItems;
|
|
421
|
-
}, [context.collectionRef, context.itemMap]);
|
|
422
|
-
return getItems;
|
|
423
|
-
}
|
|
424
|
-
return [
|
|
425
|
-
{ Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },
|
|
426
|
-
useCollection2,
|
|
427
|
-
createCollectionScope2
|
|
428
|
-
];
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
// ../../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
|
|
432
|
-
var React6 = __toESM(require("react"), 1);
|
|
433
|
-
|
|
434
|
-
// ../../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
|
|
435
|
-
var React5 = __toESM(require("react"), 1);
|
|
436
|
-
var useLayoutEffect2 = Boolean(globalThis == null ? void 0 : globalThis.document) ? React5.useLayoutEffect : () => {
|
|
437
|
-
};
|
|
438
|
-
|
|
439
|
-
// ../../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
|
|
440
|
-
var useReactId = React6["useId".toString()] || (() => void 0);
|
|
441
|
-
var count = 0;
|
|
442
|
-
function useId(deterministicId) {
|
|
443
|
-
const [id, setId] = React6.useState(useReactId());
|
|
444
|
-
useLayoutEffect2(() => {
|
|
445
|
-
if (!deterministicId) setId((reactId) => reactId ?? String(count++));
|
|
446
|
-
}, [deterministicId]);
|
|
447
|
-
return deterministicId || (id ? `radix-${id}` : "");
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
// ../../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
|
|
451
|
-
var React7 = __toESM(require("react"), 1);
|
|
452
|
-
var ReactDOM = __toESM(require("react-dom"), 1);
|
|
453
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
454
|
-
var NODES = [
|
|
455
|
-
"a",
|
|
456
|
-
"button",
|
|
457
|
-
"div",
|
|
458
|
-
"form",
|
|
459
|
-
"h2",
|
|
460
|
-
"h3",
|
|
461
|
-
"img",
|
|
462
|
-
"input",
|
|
463
|
-
"label",
|
|
464
|
-
"li",
|
|
465
|
-
"nav",
|
|
466
|
-
"ol",
|
|
467
|
-
"p",
|
|
468
|
-
"span",
|
|
469
|
-
"svg",
|
|
470
|
-
"ul"
|
|
471
|
-
];
|
|
472
|
-
var Primitive = NODES.reduce((primitive, node) => {
|
|
473
|
-
const Node = React7.forwardRef((props, forwardedRef) => {
|
|
474
|
-
const { asChild, ...primitiveProps } = props;
|
|
475
|
-
const Comp = asChild ? Slot : node;
|
|
476
|
-
if (typeof window !== "undefined") {
|
|
477
|
-
window[Symbol.for("radix-ui")] = true;
|
|
478
|
-
}
|
|
479
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
480
|
-
});
|
|
481
|
-
Node.displayName = `Primitive.${node}`;
|
|
482
|
-
return { ...primitive, [node]: Node };
|
|
483
|
-
}, {});
|
|
484
|
-
|
|
485
|
-
// ../../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
|
|
486
|
-
var React8 = __toESM(require("react"), 1);
|
|
487
|
-
function useCallbackRef(callback) {
|
|
488
|
-
const callbackRef = React8.useRef(callback);
|
|
489
|
-
React8.useEffect(() => {
|
|
490
|
-
callbackRef.current = callback;
|
|
491
|
-
});
|
|
492
|
-
return React8.useMemo(() => (...args) => {
|
|
493
|
-
var _a;
|
|
494
|
-
return (_a = callbackRef.current) == null ? void 0 : _a.call(callbackRef, ...args);
|
|
495
|
-
}, []);
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
// ../../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
|
|
499
|
-
var React9 = __toESM(require("react"), 1);
|
|
500
|
-
function useControllableState({
|
|
501
|
-
prop,
|
|
502
|
-
defaultProp,
|
|
503
|
-
onChange = () => {
|
|
504
|
-
}
|
|
505
|
-
}) {
|
|
506
|
-
const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({ defaultProp, onChange });
|
|
507
|
-
const isControlled = prop !== void 0;
|
|
508
|
-
const value = isControlled ? prop : uncontrolledProp;
|
|
509
|
-
const handleChange = useCallbackRef(onChange);
|
|
510
|
-
const setValue = React9.useCallback(
|
|
511
|
-
(nextValue) => {
|
|
512
|
-
if (isControlled) {
|
|
513
|
-
const setter = nextValue;
|
|
514
|
-
const value2 = typeof nextValue === "function" ? setter(prop) : nextValue;
|
|
515
|
-
if (value2 !== prop) handleChange(value2);
|
|
516
|
-
} else {
|
|
517
|
-
setUncontrolledProp(nextValue);
|
|
518
|
-
}
|
|
519
|
-
},
|
|
520
|
-
[isControlled, prop, setUncontrolledProp, handleChange]
|
|
521
|
-
);
|
|
522
|
-
return [value, setValue];
|
|
523
|
-
}
|
|
524
|
-
function useUncontrolledState({
|
|
525
|
-
defaultProp,
|
|
526
|
-
onChange
|
|
527
|
-
}) {
|
|
528
|
-
const uncontrolledState = React9.useState(defaultProp);
|
|
529
|
-
const [value] = uncontrolledState;
|
|
530
|
-
const prevValueRef = React9.useRef(value);
|
|
531
|
-
const handleChange = useCallbackRef(onChange);
|
|
532
|
-
React9.useEffect(() => {
|
|
533
|
-
if (prevValueRef.current !== value) {
|
|
534
|
-
handleChange(value);
|
|
535
|
-
prevValueRef.current = value;
|
|
536
|
-
}
|
|
537
|
-
}, [value, prevValueRef, handleChange]);
|
|
538
|
-
return uncontrolledState;
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
// ../../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
|
|
542
|
-
var React10 = __toESM(require("react"), 1);
|
|
543
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
544
|
-
var DirectionContext = React10.createContext(void 0);
|
|
545
|
-
function useDirection(localDir) {
|
|
546
|
-
const globalDir = React10.useContext(DirectionContext);
|
|
547
|
-
return localDir || globalDir || "ltr";
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
// ../../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
|
|
551
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
552
|
-
var ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus";
|
|
553
|
-
var EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
554
|
-
var GROUP_NAME = "RovingFocusGroup";
|
|
555
|
-
var [Collection, useCollection, createCollectionScope] = createCollection(GROUP_NAME);
|
|
556
|
-
var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(
|
|
557
|
-
GROUP_NAME,
|
|
558
|
-
[createCollectionScope]
|
|
559
|
-
);
|
|
560
|
-
var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);
|
|
561
|
-
var RovingFocusGroup = React11.forwardRef(
|
|
562
|
-
(props, forwardedRef) => {
|
|
563
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });
|
|
564
|
-
}
|
|
565
|
-
);
|
|
566
|
-
RovingFocusGroup.displayName = GROUP_NAME;
|
|
567
|
-
var RovingFocusGroupImpl = React11.forwardRef((props, forwardedRef) => {
|
|
568
|
-
const {
|
|
569
|
-
__scopeRovingFocusGroup,
|
|
570
|
-
orientation,
|
|
571
|
-
loop = false,
|
|
572
|
-
dir,
|
|
573
|
-
currentTabStopId: currentTabStopIdProp,
|
|
574
|
-
defaultCurrentTabStopId,
|
|
575
|
-
onCurrentTabStopIdChange,
|
|
576
|
-
onEntryFocus,
|
|
577
|
-
preventScrollOnEntryFocus = false,
|
|
578
|
-
...groupProps
|
|
579
|
-
} = props;
|
|
580
|
-
const ref = React11.useRef(null);
|
|
581
|
-
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
582
|
-
const direction = useDirection(dir);
|
|
583
|
-
const [currentTabStopId = null, setCurrentTabStopId] = useControllableState({
|
|
584
|
-
prop: currentTabStopIdProp,
|
|
585
|
-
defaultProp: defaultCurrentTabStopId,
|
|
586
|
-
onChange: onCurrentTabStopIdChange
|
|
587
|
-
});
|
|
588
|
-
const [isTabbingBackOut, setIsTabbingBackOut] = React11.useState(false);
|
|
589
|
-
const handleEntryFocus = useCallbackRef(onEntryFocus);
|
|
590
|
-
const getItems = useCollection(__scopeRovingFocusGroup);
|
|
591
|
-
const isClickFocusRef = React11.useRef(false);
|
|
592
|
-
const [focusableItemsCount, setFocusableItemsCount] = React11.useState(0);
|
|
593
|
-
React11.useEffect(() => {
|
|
594
|
-
const node = ref.current;
|
|
595
|
-
if (node) {
|
|
596
|
-
node.addEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
597
|
-
return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
598
|
-
}
|
|
599
|
-
}, [handleEntryFocus]);
|
|
600
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
601
|
-
RovingFocusProvider,
|
|
602
|
-
{
|
|
603
|
-
scope: __scopeRovingFocusGroup,
|
|
604
|
-
orientation,
|
|
605
|
-
dir: direction,
|
|
606
|
-
loop,
|
|
607
|
-
currentTabStopId,
|
|
608
|
-
onItemFocus: React11.useCallback(
|
|
609
|
-
(tabStopId) => setCurrentTabStopId(tabStopId),
|
|
610
|
-
[setCurrentTabStopId]
|
|
611
|
-
),
|
|
612
|
-
onItemShiftTab: React11.useCallback(() => setIsTabbingBackOut(true), []),
|
|
613
|
-
onFocusableItemAdd: React11.useCallback(
|
|
614
|
-
() => setFocusableItemsCount((prevCount) => prevCount + 1),
|
|
615
|
-
[]
|
|
616
|
-
),
|
|
617
|
-
onFocusableItemRemove: React11.useCallback(
|
|
618
|
-
() => setFocusableItemsCount((prevCount) => prevCount - 1),
|
|
619
|
-
[]
|
|
620
|
-
),
|
|
621
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
622
|
-
Primitive.div,
|
|
623
|
-
{
|
|
624
|
-
tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
|
|
625
|
-
"data-orientation": orientation,
|
|
626
|
-
...groupProps,
|
|
627
|
-
ref: composedRefs,
|
|
628
|
-
style: { outline: "none", ...props.style },
|
|
629
|
-
onMouseDown: composeEventHandlers(props.onMouseDown, () => {
|
|
630
|
-
isClickFocusRef.current = true;
|
|
631
|
-
}),
|
|
632
|
-
onFocus: composeEventHandlers(props.onFocus, (event) => {
|
|
633
|
-
const isKeyboardFocus = !isClickFocusRef.current;
|
|
634
|
-
if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {
|
|
635
|
-
const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);
|
|
636
|
-
event.currentTarget.dispatchEvent(entryFocusEvent);
|
|
637
|
-
if (!entryFocusEvent.defaultPrevented) {
|
|
638
|
-
const items = getItems().filter((item) => item.focusable);
|
|
639
|
-
const activeItem = items.find((item) => item.active);
|
|
640
|
-
const currentItem = items.find((item) => item.id === currentTabStopId);
|
|
641
|
-
const candidateItems = [activeItem, currentItem, ...items].filter(
|
|
642
|
-
Boolean
|
|
643
|
-
);
|
|
644
|
-
const candidateNodes = candidateItems.map((item) => item.ref.current);
|
|
645
|
-
focusFirst(candidateNodes, preventScrollOnEntryFocus);
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
isClickFocusRef.current = false;
|
|
649
|
-
}),
|
|
650
|
-
onBlur: composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false))
|
|
651
|
-
}
|
|
652
|
-
)
|
|
653
|
-
}
|
|
654
|
-
);
|
|
655
|
-
});
|
|
656
|
-
var ITEM_NAME = "RovingFocusGroupItem";
|
|
657
|
-
var RovingFocusGroupItem = React11.forwardRef(
|
|
658
|
-
(props, forwardedRef) => {
|
|
659
|
-
const {
|
|
660
|
-
__scopeRovingFocusGroup,
|
|
661
|
-
focusable = true,
|
|
662
|
-
active = false,
|
|
663
|
-
tabStopId,
|
|
664
|
-
...itemProps
|
|
665
|
-
} = props;
|
|
666
|
-
const autoId = useId();
|
|
667
|
-
const id = tabStopId || autoId;
|
|
668
|
-
const context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup);
|
|
669
|
-
const isCurrentTabStop = context.currentTabStopId === id;
|
|
670
|
-
const getItems = useCollection(__scopeRovingFocusGroup);
|
|
671
|
-
const { onFocusableItemAdd, onFocusableItemRemove } = context;
|
|
672
|
-
React11.useEffect(() => {
|
|
673
|
-
if (focusable) {
|
|
674
|
-
onFocusableItemAdd();
|
|
675
|
-
return () => onFocusableItemRemove();
|
|
676
|
-
}
|
|
677
|
-
}, [focusable, onFocusableItemAdd, onFocusableItemRemove]);
|
|
678
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
679
|
-
Collection.ItemSlot,
|
|
680
|
-
{
|
|
681
|
-
scope: __scopeRovingFocusGroup,
|
|
682
|
-
id,
|
|
683
|
-
focusable,
|
|
684
|
-
active,
|
|
685
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
686
|
-
Primitive.span,
|
|
687
|
-
{
|
|
688
|
-
tabIndex: isCurrentTabStop ? 0 : -1,
|
|
689
|
-
"data-orientation": context.orientation,
|
|
690
|
-
...itemProps,
|
|
691
|
-
ref: forwardedRef,
|
|
692
|
-
onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {
|
|
693
|
-
if (!focusable) event.preventDefault();
|
|
694
|
-
else context.onItemFocus(id);
|
|
695
|
-
}),
|
|
696
|
-
onFocus: composeEventHandlers(props.onFocus, () => context.onItemFocus(id)),
|
|
697
|
-
onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
|
|
698
|
-
if (event.key === "Tab" && event.shiftKey) {
|
|
699
|
-
context.onItemShiftTab();
|
|
700
|
-
return;
|
|
701
|
-
}
|
|
702
|
-
if (event.target !== event.currentTarget) return;
|
|
703
|
-
const focusIntent = getFocusIntent(event, context.orientation, context.dir);
|
|
704
|
-
if (focusIntent !== void 0) {
|
|
705
|
-
if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;
|
|
706
|
-
event.preventDefault();
|
|
707
|
-
const items = getItems().filter((item) => item.focusable);
|
|
708
|
-
let candidateNodes = items.map((item) => item.ref.current);
|
|
709
|
-
if (focusIntent === "last") candidateNodes.reverse();
|
|
710
|
-
else if (focusIntent === "prev" || focusIntent === "next") {
|
|
711
|
-
if (focusIntent === "prev") candidateNodes.reverse();
|
|
712
|
-
const currentIndex = candidateNodes.indexOf(event.currentTarget);
|
|
713
|
-
candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);
|
|
714
|
-
}
|
|
715
|
-
setTimeout(() => focusFirst(candidateNodes));
|
|
716
|
-
}
|
|
717
|
-
})
|
|
718
|
-
}
|
|
719
|
-
)
|
|
720
|
-
}
|
|
721
|
-
);
|
|
722
|
-
}
|
|
723
|
-
);
|
|
724
|
-
RovingFocusGroupItem.displayName = ITEM_NAME;
|
|
725
|
-
var MAP_KEY_TO_FOCUS_INTENT = {
|
|
726
|
-
ArrowLeft: "prev",
|
|
727
|
-
ArrowUp: "prev",
|
|
728
|
-
ArrowRight: "next",
|
|
729
|
-
ArrowDown: "next",
|
|
730
|
-
PageUp: "first",
|
|
731
|
-
Home: "first",
|
|
732
|
-
PageDown: "last",
|
|
733
|
-
End: "last"
|
|
734
|
-
};
|
|
735
|
-
function getDirectionAwareKey(key, dir) {
|
|
736
|
-
if (dir !== "rtl") return key;
|
|
737
|
-
return key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key;
|
|
738
|
-
}
|
|
739
|
-
function getFocusIntent(event, orientation, dir) {
|
|
740
|
-
const key = getDirectionAwareKey(event.key, dir);
|
|
741
|
-
if (orientation === "vertical" && ["ArrowLeft", "ArrowRight"].includes(key)) return void 0;
|
|
742
|
-
if (orientation === "horizontal" && ["ArrowUp", "ArrowDown"].includes(key)) return void 0;
|
|
743
|
-
return MAP_KEY_TO_FOCUS_INTENT[key];
|
|
744
|
-
}
|
|
745
|
-
function focusFirst(candidates, preventScroll = false) {
|
|
746
|
-
const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
|
|
747
|
-
for (const candidate of candidates) {
|
|
748
|
-
if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
749
|
-
candidate.focus({ preventScroll });
|
|
750
|
-
if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
751
|
-
}
|
|
752
|
-
}
|
|
753
|
-
function wrapArray(array, startIndex) {
|
|
754
|
-
return array.map((_2, index) => array[(startIndex + index) % array.length]);
|
|
755
|
-
}
|
|
756
|
-
var Root = RovingFocusGroup;
|
|
757
|
-
var Item = RovingFocusGroupItem;
|
|
758
|
-
|
|
759
|
-
// ../../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
|
|
760
|
-
var React22 = __toESM(require("react"), 1);
|
|
761
|
-
var React12 = __toESM(require("react"), 1);
|
|
762
|
-
function useStateMachine(initialState, machine) {
|
|
763
|
-
return React12.useReducer((state, event) => {
|
|
764
|
-
const nextState = machine[state][event];
|
|
765
|
-
return nextState ?? state;
|
|
766
|
-
}, initialState);
|
|
767
|
-
}
|
|
768
|
-
var Presence = (props) => {
|
|
769
|
-
const { present, children } = props;
|
|
770
|
-
const presence = usePresence(present);
|
|
771
|
-
const child = typeof children === "function" ? children({ present: presence.isPresent }) : React22.Children.only(children);
|
|
772
|
-
const ref = useComposedRefs(presence.ref, getElementRef2(child));
|
|
773
|
-
const forceMount = typeof children === "function";
|
|
774
|
-
return forceMount || presence.isPresent ? React22.cloneElement(child, { ref }) : null;
|
|
775
|
-
};
|
|
776
|
-
Presence.displayName = "Presence";
|
|
777
|
-
function usePresence(present) {
|
|
778
|
-
const [node, setNode] = React22.useState();
|
|
779
|
-
const stylesRef = React22.useRef({});
|
|
780
|
-
const prevPresentRef = React22.useRef(present);
|
|
781
|
-
const prevAnimationNameRef = React22.useRef("none");
|
|
782
|
-
const initialState = present ? "mounted" : "unmounted";
|
|
783
|
-
const [state, send] = useStateMachine(initialState, {
|
|
784
|
-
mounted: {
|
|
785
|
-
UNMOUNT: "unmounted",
|
|
786
|
-
ANIMATION_OUT: "unmountSuspended"
|
|
787
|
-
},
|
|
788
|
-
unmountSuspended: {
|
|
789
|
-
MOUNT: "mounted",
|
|
790
|
-
ANIMATION_END: "unmounted"
|
|
791
|
-
},
|
|
792
|
-
unmounted: {
|
|
793
|
-
MOUNT: "mounted"
|
|
794
|
-
}
|
|
795
|
-
});
|
|
796
|
-
React22.useEffect(() => {
|
|
797
|
-
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
798
|
-
prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
|
|
799
|
-
}, [state]);
|
|
800
|
-
useLayoutEffect2(() => {
|
|
801
|
-
const styles = stylesRef.current;
|
|
802
|
-
const wasPresent = prevPresentRef.current;
|
|
803
|
-
const hasPresentChanged = wasPresent !== present;
|
|
804
|
-
if (hasPresentChanged) {
|
|
805
|
-
const prevAnimationName = prevAnimationNameRef.current;
|
|
806
|
-
const currentAnimationName = getAnimationName(styles);
|
|
807
|
-
if (present) {
|
|
808
|
-
send("MOUNT");
|
|
809
|
-
} else if (currentAnimationName === "none" || (styles == null ? void 0 : styles.display) === "none") {
|
|
810
|
-
send("UNMOUNT");
|
|
811
|
-
} else {
|
|
812
|
-
const isAnimating = prevAnimationName !== currentAnimationName;
|
|
813
|
-
if (wasPresent && isAnimating) {
|
|
814
|
-
send("ANIMATION_OUT");
|
|
815
|
-
} else {
|
|
816
|
-
send("UNMOUNT");
|
|
817
|
-
}
|
|
818
|
-
}
|
|
819
|
-
prevPresentRef.current = present;
|
|
820
|
-
}
|
|
821
|
-
}, [present, send]);
|
|
822
|
-
useLayoutEffect2(() => {
|
|
823
|
-
if (node) {
|
|
824
|
-
let timeoutId;
|
|
825
|
-
const ownerWindow = node.ownerDocument.defaultView ?? window;
|
|
826
|
-
const handleAnimationEnd = (event) => {
|
|
827
|
-
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
828
|
-
const isCurrentAnimation = currentAnimationName.includes(event.animationName);
|
|
829
|
-
if (event.target === node && isCurrentAnimation) {
|
|
830
|
-
send("ANIMATION_END");
|
|
831
|
-
if (!prevPresentRef.current) {
|
|
832
|
-
const currentFillMode = node.style.animationFillMode;
|
|
833
|
-
node.style.animationFillMode = "forwards";
|
|
834
|
-
timeoutId = ownerWindow.setTimeout(() => {
|
|
835
|
-
if (node.style.animationFillMode === "forwards") {
|
|
836
|
-
node.style.animationFillMode = currentFillMode;
|
|
837
|
-
}
|
|
838
|
-
});
|
|
839
|
-
}
|
|
840
|
-
}
|
|
841
|
-
};
|
|
842
|
-
const handleAnimationStart = (event) => {
|
|
843
|
-
if (event.target === node) {
|
|
844
|
-
prevAnimationNameRef.current = getAnimationName(stylesRef.current);
|
|
845
|
-
}
|
|
846
|
-
};
|
|
847
|
-
node.addEventListener("animationstart", handleAnimationStart);
|
|
848
|
-
node.addEventListener("animationcancel", handleAnimationEnd);
|
|
849
|
-
node.addEventListener("animationend", handleAnimationEnd);
|
|
850
|
-
return () => {
|
|
851
|
-
ownerWindow.clearTimeout(timeoutId);
|
|
852
|
-
node.removeEventListener("animationstart", handleAnimationStart);
|
|
853
|
-
node.removeEventListener("animationcancel", handleAnimationEnd);
|
|
854
|
-
node.removeEventListener("animationend", handleAnimationEnd);
|
|
855
|
-
};
|
|
856
|
-
} else {
|
|
857
|
-
send("ANIMATION_END");
|
|
858
|
-
}
|
|
859
|
-
}, [node, send]);
|
|
860
|
-
return {
|
|
861
|
-
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
|
862
|
-
ref: React22.useCallback((node2) => {
|
|
863
|
-
if (node2) stylesRef.current = getComputedStyle(node2);
|
|
864
|
-
setNode(node2);
|
|
865
|
-
}, [])
|
|
866
|
-
};
|
|
867
|
-
}
|
|
868
|
-
function getAnimationName(styles) {
|
|
869
|
-
return (styles == null ? void 0 : styles.animationName) || "none";
|
|
870
|
-
}
|
|
871
|
-
function getElementRef2(element) {
|
|
872
|
-
var _a, _b;
|
|
873
|
-
let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
|
|
874
|
-
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
875
|
-
if (mayWarn) {
|
|
876
|
-
return element.ref;
|
|
877
|
-
}
|
|
878
|
-
getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b.get;
|
|
879
|
-
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
880
|
-
if (mayWarn) {
|
|
881
|
-
return element.props.ref;
|
|
882
|
-
}
|
|
883
|
-
return element.props.ref || element.ref;
|
|
884
|
-
}
|
|
885
|
-
|
|
886
|
-
// ../../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
|
|
887
|
-
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
888
|
-
var TABS_NAME = "Tabs";
|
|
889
|
-
var [createTabsContext, createTabsScope] = createContextScope(TABS_NAME, [
|
|
890
|
-
createRovingFocusGroupScope
|
|
891
|
-
]);
|
|
892
|
-
var useRovingFocusGroupScope = createRovingFocusGroupScope();
|
|
893
|
-
var [TabsProvider, useTabsContext] = createTabsContext(TABS_NAME);
|
|
894
|
-
var Tabs = React13.forwardRef(
|
|
895
|
-
(props, forwardedRef) => {
|
|
896
|
-
const {
|
|
897
|
-
__scopeTabs,
|
|
898
|
-
value: valueProp,
|
|
899
|
-
onValueChange,
|
|
900
|
-
defaultValue,
|
|
901
|
-
orientation = "horizontal",
|
|
902
|
-
dir,
|
|
903
|
-
activationMode = "automatic",
|
|
904
|
-
...tabsProps
|
|
905
|
-
} = props;
|
|
906
|
-
const direction = useDirection(dir);
|
|
907
|
-
const [value, setValue] = useControllableState({
|
|
908
|
-
prop: valueProp,
|
|
909
|
-
onChange: onValueChange,
|
|
910
|
-
defaultProp: defaultValue
|
|
911
|
-
});
|
|
912
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
913
|
-
TabsProvider,
|
|
914
|
-
{
|
|
915
|
-
scope: __scopeTabs,
|
|
916
|
-
baseId: useId(),
|
|
917
|
-
value,
|
|
918
|
-
onValueChange: setValue,
|
|
919
|
-
orientation,
|
|
920
|
-
dir: direction,
|
|
921
|
-
activationMode,
|
|
922
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
923
|
-
Primitive.div,
|
|
924
|
-
{
|
|
925
|
-
dir: direction,
|
|
926
|
-
"data-orientation": orientation,
|
|
927
|
-
...tabsProps,
|
|
928
|
-
ref: forwardedRef
|
|
929
|
-
}
|
|
930
|
-
)
|
|
931
|
-
}
|
|
932
|
-
);
|
|
933
|
-
}
|
|
934
|
-
);
|
|
935
|
-
Tabs.displayName = TABS_NAME;
|
|
936
|
-
var TAB_LIST_NAME = "TabsList";
|
|
937
|
-
var TabsList = React13.forwardRef(
|
|
938
|
-
(props, forwardedRef) => {
|
|
939
|
-
const { __scopeTabs, loop = true, ...listProps } = props;
|
|
940
|
-
const context = useTabsContext(TAB_LIST_NAME, __scopeTabs);
|
|
941
|
-
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeTabs);
|
|
942
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
943
|
-
Root,
|
|
944
|
-
{
|
|
945
|
-
asChild: true,
|
|
946
|
-
...rovingFocusGroupScope,
|
|
947
|
-
orientation: context.orientation,
|
|
948
|
-
dir: context.dir,
|
|
949
|
-
loop,
|
|
950
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
951
|
-
Primitive.div,
|
|
952
|
-
{
|
|
953
|
-
role: "tablist",
|
|
954
|
-
"aria-orientation": context.orientation,
|
|
955
|
-
...listProps,
|
|
956
|
-
ref: forwardedRef
|
|
957
|
-
}
|
|
958
|
-
)
|
|
959
|
-
}
|
|
960
|
-
);
|
|
961
|
-
}
|
|
962
|
-
);
|
|
963
|
-
TabsList.displayName = TAB_LIST_NAME;
|
|
964
|
-
var TRIGGER_NAME = "TabsTrigger";
|
|
965
|
-
var TabsTrigger = React13.forwardRef(
|
|
966
|
-
(props, forwardedRef) => {
|
|
967
|
-
const { __scopeTabs, value, disabled = false, ...triggerProps } = props;
|
|
968
|
-
const context = useTabsContext(TRIGGER_NAME, __scopeTabs);
|
|
969
|
-
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeTabs);
|
|
970
|
-
const triggerId = makeTriggerId(context.baseId, value);
|
|
971
|
-
const contentId = makeContentId(context.baseId, value);
|
|
972
|
-
const isSelected = value === context.value;
|
|
973
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
974
|
-
Item,
|
|
975
|
-
{
|
|
976
|
-
asChild: true,
|
|
977
|
-
...rovingFocusGroupScope,
|
|
978
|
-
focusable: !disabled,
|
|
979
|
-
active: isSelected,
|
|
980
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
981
|
-
Primitive.button,
|
|
982
|
-
{
|
|
983
|
-
type: "button",
|
|
984
|
-
role: "tab",
|
|
985
|
-
"aria-selected": isSelected,
|
|
986
|
-
"aria-controls": contentId,
|
|
987
|
-
"data-state": isSelected ? "active" : "inactive",
|
|
988
|
-
"data-disabled": disabled ? "" : void 0,
|
|
989
|
-
disabled,
|
|
990
|
-
id: triggerId,
|
|
991
|
-
...triggerProps,
|
|
992
|
-
ref: forwardedRef,
|
|
993
|
-
onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {
|
|
994
|
-
if (!disabled && event.button === 0 && event.ctrlKey === false) {
|
|
995
|
-
context.onValueChange(value);
|
|
996
|
-
} else {
|
|
997
|
-
event.preventDefault();
|
|
998
|
-
}
|
|
999
|
-
}),
|
|
1000
|
-
onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
|
|
1001
|
-
if ([" ", "Enter"].includes(event.key)) context.onValueChange(value);
|
|
1002
|
-
}),
|
|
1003
|
-
onFocus: composeEventHandlers(props.onFocus, () => {
|
|
1004
|
-
const isAutomaticActivation = context.activationMode !== "manual";
|
|
1005
|
-
if (!isSelected && !disabled && isAutomaticActivation) {
|
|
1006
|
-
context.onValueChange(value);
|
|
1007
|
-
}
|
|
1008
|
-
})
|
|
1009
|
-
}
|
|
1010
|
-
)
|
|
1011
|
-
}
|
|
1012
|
-
);
|
|
1013
|
-
}
|
|
1014
|
-
);
|
|
1015
|
-
TabsTrigger.displayName = TRIGGER_NAME;
|
|
1016
|
-
var CONTENT_NAME = "TabsContent";
|
|
1017
|
-
var TabsContent = React13.forwardRef(
|
|
1018
|
-
(props, forwardedRef) => {
|
|
1019
|
-
const { __scopeTabs, value, forceMount, children, ...contentProps } = props;
|
|
1020
|
-
const context = useTabsContext(CONTENT_NAME, __scopeTabs);
|
|
1021
|
-
const triggerId = makeTriggerId(context.baseId, value);
|
|
1022
|
-
const contentId = makeContentId(context.baseId, value);
|
|
1023
|
-
const isSelected = value === context.value;
|
|
1024
|
-
const isMountAnimationPreventedRef = React13.useRef(isSelected);
|
|
1025
|
-
React13.useEffect(() => {
|
|
1026
|
-
const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);
|
|
1027
|
-
return () => cancelAnimationFrame(rAF);
|
|
1028
|
-
}, []);
|
|
1029
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Presence, { present: forceMount || isSelected, children: ({ present }) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1030
|
-
Primitive.div,
|
|
1031
|
-
{
|
|
1032
|
-
"data-state": isSelected ? "active" : "inactive",
|
|
1033
|
-
"data-orientation": context.orientation,
|
|
1034
|
-
role: "tabpanel",
|
|
1035
|
-
"aria-labelledby": triggerId,
|
|
1036
|
-
hidden: !present,
|
|
1037
|
-
id: contentId,
|
|
1038
|
-
tabIndex: 0,
|
|
1039
|
-
...contentProps,
|
|
1040
|
-
ref: forwardedRef,
|
|
1041
|
-
style: {
|
|
1042
|
-
...props.style,
|
|
1043
|
-
animationDuration: isMountAnimationPreventedRef.current ? "0s" : void 0
|
|
1044
|
-
},
|
|
1045
|
-
children: present && children
|
|
1046
|
-
}
|
|
1047
|
-
) });
|
|
1048
|
-
}
|
|
1049
|
-
);
|
|
1050
|
-
TabsContent.displayName = CONTENT_NAME;
|
|
1051
|
-
function makeTriggerId(baseId, value) {
|
|
1052
|
-
return `${baseId}-trigger-${value}`;
|
|
1053
|
-
}
|
|
1054
|
-
function makeContentId(baseId, value) {
|
|
1055
|
-
return `${baseId}-content-${value}`;
|
|
1056
|
-
}
|
|
1057
|
-
var Root2 = Tabs;
|
|
1058
|
-
var List = TabsList;
|
|
1059
|
-
var Trigger = TabsTrigger;
|
|
1060
|
-
var Content = TabsContent;
|
|
1061
|
-
|
|
1062
|
-
// ../../node_modules/.pnpm/lucide-react@0.447.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
1063
|
-
var import_react5 = require("react");
|
|
1064
|
-
|
|
1065
|
-
// ../../node_modules/.pnpm/lucide-react@0.447.0_react@18.3.1/node_modules/lucide-react/dist/esm/shared/src/utils.js
|
|
1066
|
-
var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
1067
|
-
var mergeClasses = (...classes) => classes.filter((className, index, array) => {
|
|
1068
|
-
return Boolean(className) && array.indexOf(className) === index;
|
|
1069
|
-
}).join(" ");
|
|
1070
|
-
|
|
1071
|
-
// ../../node_modules/.pnpm/lucide-react@0.447.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
|
|
1072
|
-
var import_react4 = require("react");
|
|
1073
|
-
|
|
1074
|
-
// ../../node_modules/.pnpm/lucide-react@0.447.0_react@18.3.1/node_modules/lucide-react/dist/esm/defaultAttributes.js
|
|
1075
|
-
var defaultAttributes = {
|
|
1076
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1077
|
-
width: 24,
|
|
1078
|
-
height: 24,
|
|
1079
|
-
viewBox: "0 0 24 24",
|
|
1080
|
-
fill: "none",
|
|
1081
|
-
stroke: "currentColor",
|
|
1082
|
-
strokeWidth: 2,
|
|
1083
|
-
strokeLinecap: "round",
|
|
1084
|
-
strokeLinejoin: "round"
|
|
1085
|
-
};
|
|
1086
|
-
|
|
1087
|
-
// ../../node_modules/.pnpm/lucide-react@0.447.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
|
|
1088
|
-
var Icon = (0, import_react4.forwardRef)(
|
|
1089
|
-
({
|
|
1090
|
-
color = "currentColor",
|
|
1091
|
-
size = 24,
|
|
1092
|
-
strokeWidth = 2,
|
|
1093
|
-
absoluteStrokeWidth,
|
|
1094
|
-
className = "",
|
|
1095
|
-
children,
|
|
1096
|
-
iconNode,
|
|
1097
|
-
...rest
|
|
1098
|
-
}, ref) => {
|
|
1099
|
-
return (0, import_react4.createElement)(
|
|
1100
|
-
"svg",
|
|
1101
|
-
{
|
|
1102
|
-
ref,
|
|
1103
|
-
...defaultAttributes,
|
|
1104
|
-
width: size,
|
|
1105
|
-
height: size,
|
|
1106
|
-
stroke: color,
|
|
1107
|
-
strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
|
|
1108
|
-
className: mergeClasses("lucide", className),
|
|
1109
|
-
...rest
|
|
1110
|
-
},
|
|
1111
|
-
[
|
|
1112
|
-
...iconNode.map(([tag, attrs]) => (0, import_react4.createElement)(tag, attrs)),
|
|
1113
|
-
...Array.isArray(children) ? children : [children]
|
|
1114
|
-
]
|
|
1115
|
-
);
|
|
1116
|
-
}
|
|
1117
|
-
);
|
|
1118
|
-
|
|
1119
|
-
// ../../node_modules/.pnpm/lucide-react@0.447.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
1120
|
-
var createLucideIcon = (iconName, iconNode) => {
|
|
1121
|
-
const Component = (0, import_react5.forwardRef)(
|
|
1122
|
-
({ className, ...props }, ref) => (0, import_react5.createElement)(Icon, {
|
|
1123
|
-
ref,
|
|
1124
|
-
iconNode,
|
|
1125
|
-
className: mergeClasses(`lucide-${toKebabCase(iconName)}`, className),
|
|
1126
|
-
...props
|
|
1127
|
-
})
|
|
1128
|
-
);
|
|
1129
|
-
Component.displayName = `${iconName}`;
|
|
1130
|
-
return Component;
|
|
1131
|
-
};
|
|
1132
|
-
|
|
1133
|
-
// ../../node_modules/.pnpm/lucide-react@0.447.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/chevron-left.js
|
|
1134
|
-
var ChevronLeft = createLucideIcon("ChevronLeft", [
|
|
1135
|
-
["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]
|
|
1136
|
-
]);
|
|
1137
|
-
|
|
1138
|
-
// ../../node_modules/.pnpm/lucide-react@0.447.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/chevron-right.js
|
|
1139
|
-
var ChevronRight = createLucideIcon("ChevronRight", [
|
|
1140
|
-
["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]
|
|
1141
|
-
]);
|
|
1142
|
-
|
|
1143
|
-
// ../xyd-components/dist/UnderlineNav-rNUvd4IV.js
|
|
1144
|
-
var s = "hh34a3o";
|
|
1145
|
-
var m = "hilz89t";
|
|
1146
|
-
var o = "h1rnhmpa";
|
|
1147
|
-
var u2 = "lajci2p";
|
|
1148
|
-
var d2 = "iezrce7";
|
|
1149
|
-
var v = "i1vhi0b8";
|
|
1150
|
-
var h2 = "i1m2lps9";
|
|
1151
|
-
var f = "r1new93p";
|
|
1152
|
-
var E = "t1u3d3ty";
|
|
1153
|
-
var N = "t4udf3g";
|
|
1154
|
-
var p = "t1icpluq";
|
|
1155
|
-
var b = "badgd67";
|
|
1156
|
-
var g = "bcjznmh";
|
|
1157
|
-
var w = "p13ekkiz";
|
|
1158
|
-
var C = "h15733ml";
|
|
1159
|
-
function k(t5) {
|
|
1160
|
-
var a3 = t5.children, n4 = t5.href, r4 = t5.icon, c2 = t5.title, l2 = t5.kind, i3 = t5.size;
|
|
1161
|
-
return import_react6.default.createElement("div", { className: "\n ".concat(s, "\n ").concat("secondary" === l2 && m, "\n ").concat("secondary" === l2 && "md" == i3 && o, "\n ") }, import_react6.default.createElement("a", { className: u2, href: n4 }, import_react6.default.createElement("div", { className: "\n ".concat(d2, "\n ").concat("secondary" === l2 && v, "\n ") }, r4 && import_react6.default.createElement("div", { className: h2 }, r4), import_react6.default.createElement("div", { className: f }, import_react6.default.createElement("div", { className: E }, import_react6.default.createElement("div", { className: "\n ".concat(E, " \n ").concat(N, "\n ").concat("md" == i3 && p, "\n ") }, c2), import_react6.default.createElement(z, null)), import_react6.default.createElement("div", { className: "\n ".concat(b, "\n ").concat("md" == i3 && g, "\n ") }, a3)))));
|
|
1162
|
-
}
|
|
1163
|
-
function z() {
|
|
1164
|
-
return import_react6.default.createElement("div", { "data-pointer": "true", className: w }, import_react6.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, fill: "currentColor", viewBox: "0 0 24 24" }, import_react6.default.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" })));
|
|
1165
|
-
}
|
|
1166
|
-
k.List = function(t5) {
|
|
1167
|
-
var a3 = t5.children;
|
|
1168
|
-
return import_react6.default.createElement("div", { className: C }, a3);
|
|
1169
|
-
};
|
|
1170
|
-
var x = "h3kfd8c";
|
|
1171
|
-
var L = "l1et872q";
|
|
1172
|
-
function y(t5) {
|
|
1173
|
-
var a3 = t5.children;
|
|
1174
|
-
return import_react6.default.createElement("ol", { className: x }, a3);
|
|
1175
|
-
}
|
|
1176
|
-
y.Item = function(t5) {
|
|
1177
|
-
var a3 = t5.children;
|
|
1178
|
-
return import_react6.default.createElement("li", { className: L }, a3);
|
|
1179
|
-
};
|
|
1180
|
-
var T = "h14vj3ri";
|
|
1181
|
-
var j = "t1l6tz9b";
|
|
1182
|
-
var R = "thzxr0l";
|
|
1183
|
-
var B = "t1g1altt";
|
|
1184
|
-
function I(t5) {
|
|
1185
|
-
var a3 = t5.children;
|
|
1186
|
-
return import_react6.default.createElement("table", { className: T }, a3);
|
|
1187
|
-
}
|
|
1188
|
-
I.Th = function(t5) {
|
|
1189
|
-
var a3 = t5.children;
|
|
1190
|
-
return import_react6.default.createElement("th", { className: j }, a3);
|
|
1191
|
-
}, I.Tr = function(t5) {
|
|
1192
|
-
var a3 = t5.children;
|
|
1193
|
-
return import_react6.default.createElement("tr", { className: R }, a3);
|
|
1194
|
-
}, I.Td = function(t5) {
|
|
1195
|
-
var a3 = t5.children;
|
|
1196
|
-
return import_react6.default.createElement("td", { className: B }, a3);
|
|
1197
|
-
};
|
|
1198
|
-
var q = "hh8vcxa";
|
|
1199
|
-
var S = "b2p5907";
|
|
1200
|
-
var V = "coeb6fw";
|
|
1201
|
-
var W = "h196u2m6";
|
|
1202
|
-
var _ = "i1hlflsk";
|
|
1203
|
-
var G = "hownbu8";
|
|
1204
|
-
var H = "cuwerl2";
|
|
1205
|
-
var M = "hlivi01";
|
|
1206
|
-
function P(s2) {
|
|
1207
|
-
var m3 = s2.children, o3 = s2.items, u4 = s2.tabIndex, d3 = (0, import_react6.useState)(false), v3 = h(d3, 2), h4 = v3[0], f2 = v3[1], E4 = (0, import_react6.useState)(false), N3 = h(E4, 2), p3 = N3[0], b2 = N3[1], g2 = (0, import_react6.useRef)(null), w3 = (0, import_react6.useState)(o3[u4 || 0] || ""), C2 = h(w3, 2), k2 = C2[0], z2 = C2[1], x3 = function() {
|
|
1208
|
-
if (g2.current) {
|
|
1209
|
-
var e3 = g2.current, t5 = e3.scrollLeft, a3 = e3.scrollWidth, n4 = e3.clientWidth;
|
|
1210
|
-
f2(t5 > 0), b2(t5 < a3 - n4);
|
|
1211
|
-
}
|
|
1212
|
-
};
|
|
1213
|
-
(0, import_react6.useEffect)(function() {
|
|
1214
|
-
return x3(), window.addEventListener("resize", x3), function() {
|
|
1215
|
-
return window.removeEventListener("resize", x3);
|
|
1216
|
-
};
|
|
1217
|
-
}, []);
|
|
1218
|
-
var L2 = function(e3) {
|
|
1219
|
-
if (g2.current) {
|
|
1220
|
-
var t5 = "left" === e3 ? -200 : 200;
|
|
1221
|
-
g2.current.scrollBy({ left: t5, behavior: "smooth" });
|
|
1222
|
-
}
|
|
1223
|
-
};
|
|
1224
|
-
return import_react6.default.createElement(Root2, { asChild: true, value: k2, onValueChange: z2 }, import_react6.default.createElement("div", { className: q }, import_react6.default.createElement("div", { className: S }, h4 && import_react6.default.createElement("button", { onClick: function() {
|
|
1225
|
-
return L2("left");
|
|
1226
|
-
}, className: W }, import_react6.default.createElement(ChevronLeft, { className: _ })), import_react6.default.createElement("div", { ref: g2, onScroll: x3, className: G }, import_react6.default.createElement("div", { className: H }, import_react6.default.createElement(List, null, o3.map(function(t5, a3) {
|
|
1227
|
-
return import_react6.default.createElement(U, { key: a3, value: t5 }, t5);
|
|
1228
|
-
})))), p3 && import_react6.default.createElement("button", { onClick: function() {
|
|
1229
|
-
return L2("right");
|
|
1230
|
-
}, className: W }, import_react6.default.createElement(ChevronRight, { className: _ }))), import_react6.default.createElement("div", { className: V }, m3)));
|
|
1231
|
-
}
|
|
1232
|
-
function U(t5) {
|
|
1233
|
-
var a3 = t5.children, n4 = t5.value;
|
|
1234
|
-
return import_react6.default.createElement(Trigger, { asChild: true, value: n4 }, import_react6.default.createElement("button", { className: "".concat(M) }, a3));
|
|
1235
|
-
}
|
|
1236
|
-
P.Content = function(t5) {
|
|
1237
|
-
var a3 = t5.children, n4 = t5.value;
|
|
1238
|
-
return import_react6.default.createElement(Content, { asChild: true, value: n4 }, a3);
|
|
1239
|
-
};
|
|
1240
|
-
var Z = "h1bta36o";
|
|
1241
|
-
var A = "uxs4bf1";
|
|
1242
|
-
var D = "ifn7ecb";
|
|
1243
|
-
var F = "i441kmn";
|
|
1244
|
-
function J(t5) {
|
|
1245
|
-
var a3 = t5.children, n4 = t5.value, r4 = t5.onChange;
|
|
1246
|
-
return import_react6.default.createElement(Root2, { asChild: true, value: n4, onValueChange: r4 }, import_react6.default.createElement("nav", { className: Z }, import_react6.default.createElement(List, { asChild: true }, import_react6.default.createElement("ul", { className: A }, a3))));
|
|
1247
|
-
}
|
|
1248
|
-
J.Item = function(t5) {
|
|
1249
|
-
var a3 = t5.children, n4 = t5.value, r4 = t5.href;
|
|
1250
|
-
return import_react6.default.createElement(Trigger, { asChild: true, value: n4 }, import_react6.default.createElement("li", { className: D }, import_react6.default.createElement("a", { href: r4, className: "".concat(F) }, a3)));
|
|
1251
|
-
};
|
|
1252
|
-
|
|
1253
|
-
// ../xyd-components/dist/writer.js
|
|
1254
|
-
var i2 = "hwgsk4h";
|
|
1255
|
-
var m2 = "i1b95bxl";
|
|
1256
|
-
var o2 = "i1a3fa93";
|
|
1257
|
-
var u3 = "i1dl7ywj";
|
|
1258
|
-
function h3(e3) {
|
|
1259
|
-
var a3 = e3.children, n4 = t2(e3, ["children"]);
|
|
1260
|
-
return import_react7.default.createElement("a", Object.assign({}, n4), a3);
|
|
1261
|
-
}
|
|
1262
|
-
function p2(e3) {
|
|
1263
|
-
return import_react7.default.createElement("div", { className: i2 }, e3.items.map(function(t5, a3) {
|
|
1264
|
-
var s2 = a3 === e3.items.length - 1;
|
|
1265
|
-
return import_react7.default.createElement(import_react7.Fragment, { key: t5.href + t5.title }, a3 > 0 && import_react7.default.createElement(ArrowRightIcon, { className: m2 }), import_react7.default.createElement("div", { className: "\n ".concat(o2, "\n ").concat(s2 && u3, "\n "), title: t5.title }, t5.href && !s2 ? import_react7.default.createElement(h3, { href: t5.href }, t5.title) : t5.title));
|
|
1266
|
-
}));
|
|
1267
|
-
}
|
|
1268
|
-
var v2 = "h1xhrk1";
|
|
1269
|
-
var E3 = "l1elq7ab";
|
|
1270
|
-
var x2 = "i1mmatje";
|
|
1271
|
-
function N2(e3) {
|
|
1272
|
-
var a3 = e3.children, n4 = t2(e3, ["children"]);
|
|
1273
|
-
return import_react7.default.createElement("a", Object.assign({}, n4), a3);
|
|
1274
|
-
}
|
|
1275
|
-
function j2(e3) {
|
|
1276
|
-
return import_react7.default.createElement("div", { className: v2 }, e3.prev ? import_react7.default.createElement(N2, { href: e3.prev.href, title: e3.prev.title, className: E3 }, import_react7.default.createElement(ArrowLeftIcon, { className: x2 }), e3.prev.title) : import_react7.default.createElement("div", null), e3.next && import_react7.default.createElement(N2, { href: e3.next.href, title: e3.next.title, className: E3 }, e3.next.title, import_react7.default.createElement(ArrowRightIcon, { className: x2 })));
|
|
1277
|
-
}
|
|
47
|
+
var import_writer2 = require("@xyd-js/components/writer");
|
|
1278
48
|
|
|
1279
49
|
// packages/react/contexts/framework.tsx
|
|
1280
|
-
var
|
|
50
|
+
var import_react = __toESM(require("react"));
|
|
1281
51
|
var framework = {
|
|
1282
52
|
settings: {},
|
|
1283
53
|
sidebarGroups: []
|
|
1284
54
|
};
|
|
1285
|
-
var FrameworkContext = (0,
|
|
55
|
+
var FrameworkContext = (0, import_react.createContext)(framework);
|
|
1286
56
|
function Framework(props) {
|
|
1287
|
-
return /* @__PURE__ */
|
|
57
|
+
return /* @__PURE__ */ import_react.default.createElement(FrameworkContext.Provider, { value: {
|
|
1288
58
|
settings: props.settings,
|
|
1289
59
|
sidebarGroups: props.sidebarGroups,
|
|
1290
60
|
toc: props.toc,
|
|
@@ -1293,40 +63,40 @@ function Framework(props) {
|
|
|
1293
63
|
} }, props.children);
|
|
1294
64
|
}
|
|
1295
65
|
function useSidebarGroups() {
|
|
1296
|
-
const ctx = (0,
|
|
66
|
+
const ctx = (0, import_react.useContext)(FrameworkContext);
|
|
1297
67
|
return ctx.sidebarGroups;
|
|
1298
68
|
}
|
|
1299
69
|
function useSettings() {
|
|
1300
|
-
const ctx = (0,
|
|
70
|
+
const ctx = (0, import_react.useContext)(FrameworkContext);
|
|
1301
71
|
return ctx.settings;
|
|
1302
72
|
}
|
|
1303
73
|
function useToC() {
|
|
1304
|
-
const ctx = (0,
|
|
74
|
+
const ctx = (0, import_react.useContext)(FrameworkContext);
|
|
1305
75
|
return ctx.toc;
|
|
1306
76
|
}
|
|
1307
77
|
function useBreadcrumbs() {
|
|
1308
|
-
const ctx = (0,
|
|
78
|
+
const ctx = (0, import_react.useContext)(FrameworkContext);
|
|
1309
79
|
return ctx.breadcrumbs;
|
|
1310
80
|
}
|
|
1311
81
|
function useNavLinks() {
|
|
1312
|
-
const ctx = (0,
|
|
82
|
+
const ctx = (0, import_react.useContext)(FrameworkContext);
|
|
1313
83
|
return ctx.navlinks;
|
|
1314
84
|
}
|
|
1315
85
|
|
|
1316
86
|
// packages/react/components/sidebar/sidebar-group.tsx
|
|
1317
|
-
var
|
|
87
|
+
var import_react3 = __toESM(require("react"));
|
|
1318
88
|
var import_react_router = require("react-router");
|
|
1319
89
|
|
|
1320
90
|
// packages/react/contexts/ui.tsx
|
|
1321
|
-
var
|
|
1322
|
-
var UIContext = (0,
|
|
91
|
+
var import_react2 = require("react");
|
|
92
|
+
var UIContext = (0, import_react2.createContext)({
|
|
1323
93
|
href: "",
|
|
1324
|
-
setHref: (
|
|
94
|
+
setHref: (v) => {
|
|
1325
95
|
}
|
|
1326
96
|
});
|
|
1327
97
|
|
|
1328
98
|
// packages/react/components/sidebar/sidebar-group.tsx
|
|
1329
|
-
var groupContext = (0,
|
|
99
|
+
var groupContext = (0, import_react3.createContext)({
|
|
1330
100
|
active: () => [false, () => {
|
|
1331
101
|
}],
|
|
1332
102
|
onClick: () => null
|
|
@@ -1345,13 +115,13 @@ function FwSidebarGroupContext({
|
|
|
1345
115
|
groupBehaviour = useDefaultBehaviour(initialActiveItems);
|
|
1346
116
|
}
|
|
1347
117
|
const location = (0, import_react_router.useLocation)();
|
|
1348
|
-
const [href, setHref] = (0,
|
|
1349
|
-
return /* @__PURE__ */
|
|
118
|
+
const [href, setHref] = (0, import_react3.useState)(location.pathname);
|
|
119
|
+
return /* @__PURE__ */ import_react3.default.createElement(UIContext.Provider, { value: {
|
|
1350
120
|
href,
|
|
1351
121
|
setHref: (value) => {
|
|
1352
122
|
setHref(value);
|
|
1353
123
|
}
|
|
1354
|
-
} }, /* @__PURE__ */
|
|
124
|
+
} }, /* @__PURE__ */ import_react3.default.createElement(groupContext.Provider, { value: {
|
|
1355
125
|
active: groupBehaviour,
|
|
1356
126
|
onClick: clientSideRouting ? (event, item) => {
|
|
1357
127
|
setHref(item.href);
|
|
@@ -1360,7 +130,7 @@ function FwSidebarGroupContext({
|
|
|
1360
130
|
} }, children));
|
|
1361
131
|
}
|
|
1362
132
|
function useGroup() {
|
|
1363
|
-
return (0,
|
|
133
|
+
return (0, import_react3.useContext)(groupContext);
|
|
1364
134
|
}
|
|
1365
135
|
function getLastValue(set) {
|
|
1366
136
|
let value;
|
|
@@ -1376,13 +146,13 @@ function stringify(item) {
|
|
|
1376
146
|
});
|
|
1377
147
|
}
|
|
1378
148
|
function recursiveSearch(items, href, levels = []) {
|
|
1379
|
-
for (let
|
|
1380
|
-
const item = items[
|
|
149
|
+
for (let i = 0; i < items.length; i++) {
|
|
150
|
+
const item = items[i];
|
|
1381
151
|
if (item.href === href) {
|
|
1382
|
-
return [...levels,
|
|
152
|
+
return [...levels, i];
|
|
1383
153
|
}
|
|
1384
154
|
if (item.items) {
|
|
1385
|
-
const result = recursiveSearch(item.items, href, [...levels,
|
|
155
|
+
const result = recursiveSearch(item.items, href, [...levels, i]);
|
|
1386
156
|
if (result) {
|
|
1387
157
|
return result;
|
|
1388
158
|
}
|
|
@@ -1407,9 +177,9 @@ function calcActive(groups, url) {
|
|
|
1407
177
|
}
|
|
1408
178
|
function useDefaultBehaviour(initialActiveItems) {
|
|
1409
179
|
const groups = useSidebarGroups();
|
|
1410
|
-
const [weakSet] = (0,
|
|
1411
|
-
const [, setForceUpdate] = (0,
|
|
1412
|
-
(0,
|
|
180
|
+
const [weakSet] = (0, import_react3.useState)(() => new Set(initialActiveItems.map((item) => stringify(item))));
|
|
181
|
+
const [, setForceUpdate] = (0, import_react3.useState)(0);
|
|
182
|
+
(0, import_react3.useEffect)(() => {
|
|
1413
183
|
window.addEventListener("xyd.history.pushState", (event) => {
|
|
1414
184
|
var _a;
|
|
1415
185
|
const url = (_a = event.detail) == null ? void 0 : _a.url;
|
|
@@ -1447,9 +217,9 @@ function useDefaultBehaviour(initialActiveItems) {
|
|
|
1447
217
|
];
|
|
1448
218
|
}
|
|
1449
219
|
function useOnePathBehaviour(initialActiveItems) {
|
|
1450
|
-
const [weakSet] = (0,
|
|
1451
|
-
const [lastLevel, setLastLevel] = (0,
|
|
1452
|
-
const [, setForceUpdate] = (0,
|
|
220
|
+
const [weakSet] = (0, import_react3.useState)(() => new Set(initialActiveItems.map((item) => stringify(item))));
|
|
221
|
+
const [lastLevel, setLastLevel] = (0, import_react3.useState)(false);
|
|
222
|
+
const [, setForceUpdate] = (0, import_react3.useState)(0);
|
|
1453
223
|
const forceUpdate = () => setForceUpdate((prev) => prev + 1);
|
|
1454
224
|
const addItem = (item) => {
|
|
1455
225
|
weakSet.add(stringify(item));
|
|
@@ -1483,8 +253,8 @@ function useOnePathBehaviour(initialActiveItems) {
|
|
|
1483
253
|
if ((item.level || 0) > (lastLevel || 0) || lastLevel == false) {
|
|
1484
254
|
addItem(item);
|
|
1485
255
|
} else {
|
|
1486
|
-
const
|
|
1487
|
-
deleteItem(JSON.parse(
|
|
256
|
+
const v = getLastValue(weakSet);
|
|
257
|
+
deleteItem(JSON.parse(v));
|
|
1488
258
|
addItem(item);
|
|
1489
259
|
}
|
|
1490
260
|
}
|
|
@@ -1499,10 +269,11 @@ function scrollToDataSlug(event, item) {
|
|
|
1499
269
|
}
|
|
1500
270
|
|
|
1501
271
|
// packages/react/components/sidebar/sidebar.tsx
|
|
1502
|
-
var
|
|
272
|
+
var import_react4 = __toESM(require("react"));
|
|
273
|
+
var import_writer = require("@xyd-js/components/writer");
|
|
1503
274
|
var import_ui2 = require("@xyd-js/ui");
|
|
1504
275
|
function FwSidebarItemGroup(props) {
|
|
1505
|
-
return /* @__PURE__ */
|
|
276
|
+
return /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, /* @__PURE__ */ import_react4.default.createElement(import_ui2.UISidebar.ItemHeader, null, props.group), props.items.map((item, index) => /* @__PURE__ */ import_react4.default.createElement(
|
|
1506
277
|
FwSidebarItem,
|
|
1507
278
|
{
|
|
1508
279
|
key: index + item.href,
|
|
@@ -1517,7 +288,7 @@ function FwSidebarItemGroup(props) {
|
|
|
1517
288
|
var components = {
|
|
1518
289
|
Frontmatter: {
|
|
1519
290
|
// TODO: css
|
|
1520
|
-
Title: ({ children }) => /* @__PURE__ */
|
|
291
|
+
Title: ({ children }) => /* @__PURE__ */ import_react4.default.createElement("div", { style: {
|
|
1521
292
|
display: "flex",
|
|
1522
293
|
alignItems: "center",
|
|
1523
294
|
justifyContent: "space-between",
|
|
@@ -1525,16 +296,16 @@ var components = {
|
|
|
1525
296
|
gap: "10px"
|
|
1526
297
|
} }, children)
|
|
1527
298
|
},
|
|
1528
|
-
Badge: ({ children }) => /* @__PURE__ */
|
|
299
|
+
Badge: ({ children }) => /* @__PURE__ */ import_react4.default.createElement(import_writer.Badge, null, children)
|
|
1529
300
|
};
|
|
1530
301
|
function mdxExport(code, components2) {
|
|
1531
302
|
const scope = {
|
|
1532
|
-
Fragment:
|
|
1533
|
-
jsxs:
|
|
1534
|
-
jsx:
|
|
1535
|
-
jsxDEV:
|
|
1536
|
-
_jsxs:
|
|
1537
|
-
_jsx:
|
|
303
|
+
Fragment: import_react4.default.Fragment,
|
|
304
|
+
jsxs: import_react4.default.createElement,
|
|
305
|
+
jsx: import_react4.default.createElement,
|
|
306
|
+
jsxDEV: import_react4.default.createElement,
|
|
307
|
+
_jsxs: import_react4.default.createElement,
|
|
308
|
+
_jsx: import_react4.default.createElement,
|
|
1538
309
|
...components2
|
|
1539
310
|
};
|
|
1540
311
|
const fn = new Function(...Object.keys(scope), `return ${code}`);
|
|
@@ -1555,7 +326,7 @@ function FwSidebarItem(props) {
|
|
|
1555
326
|
} else {
|
|
1556
327
|
Title = () => props.title;
|
|
1557
328
|
}
|
|
1558
|
-
return /* @__PURE__ */
|
|
329
|
+
return /* @__PURE__ */ import_react4.default.createElement(
|
|
1559
330
|
import_ui2.UISidebar.Item,
|
|
1560
331
|
{
|
|
1561
332
|
button: !!((_a = props.items) == null ? void 0 : _a.length),
|
|
@@ -1565,8 +336,8 @@ function FwSidebarItem(props) {
|
|
|
1565
336
|
setActive();
|
|
1566
337
|
}
|
|
1567
338
|
},
|
|
1568
|
-
/* @__PURE__ */
|
|
1569
|
-
((_b = props.items) == null ? void 0 : _b.length) && /* @__PURE__ */
|
|
339
|
+
/* @__PURE__ */ import_react4.default.createElement(Title, null),
|
|
340
|
+
((_b = props.items) == null ? void 0 : _b.length) && /* @__PURE__ */ import_react4.default.createElement(import_ui2.UISidebar.SubTree, { isOpen: isActive }, /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, (_c = props.items) == null ? void 0 : _c.map((item, index) => /* @__PURE__ */ import_react4.default.createElement(
|
|
1570
341
|
FwSidebarItem,
|
|
1571
342
|
{
|
|
1572
343
|
key: index + item.href,
|
|
@@ -1584,25 +355,25 @@ function FwSidebarItem(props) {
|
|
|
1584
355
|
var import_ui4 = require("@xyd-js/ui");
|
|
1585
356
|
|
|
1586
357
|
// packages/react/utils/manualHydration.ts
|
|
1587
|
-
var
|
|
358
|
+
var import_react5 = __toESM(require("react"));
|
|
1588
359
|
function manualHydration(obj, key = 0) {
|
|
1589
360
|
if (typeof obj !== "object" || obj === null) {
|
|
1590
|
-
return
|
|
361
|
+
return import_react5.default.createElement(import_react5.default.Fragment, { key });
|
|
1591
362
|
}
|
|
1592
363
|
const { type, props } = obj || {};
|
|
1593
364
|
if (typeof type !== "string" && typeof type !== "function") {
|
|
1594
|
-
return
|
|
365
|
+
return import_react5.default.createElement(import_react5.default.Fragment, { key });
|
|
1595
366
|
}
|
|
1596
367
|
let children = [];
|
|
1597
368
|
if (props == null ? void 0 : props.children) {
|
|
1598
369
|
if (Array.isArray(props.children)) {
|
|
1599
|
-
children = props.children.map((child,
|
|
370
|
+
children = props.children.map((child, i) => manualHydration(child, key + i)) || [];
|
|
1600
371
|
} else {
|
|
1601
372
|
children = [manualHydration(props.children, key)];
|
|
1602
373
|
}
|
|
1603
374
|
}
|
|
1604
375
|
const elementProps = { ...props, children, key };
|
|
1605
|
-
return
|
|
376
|
+
return import_react5.default.createElement(type, elementProps);
|
|
1606
377
|
}
|
|
1607
378
|
|
|
1608
379
|
// packages/react/hooks/useMatchedNav.tsx
|
|
@@ -1631,8 +402,8 @@ function useMatchedSubNav() {
|
|
|
1631
402
|
function FwNavLogo() {
|
|
1632
403
|
var _a, _b, _c;
|
|
1633
404
|
const settings = useSettings();
|
|
1634
|
-
const logo = (0,
|
|
1635
|
-
return /* @__PURE__ */
|
|
405
|
+
const logo = (0, import_react6.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);
|
|
406
|
+
return /* @__PURE__ */ import_react6.default.createElement("a", { href: "/" }, logo);
|
|
1636
407
|
}
|
|
1637
408
|
function FwNav({ kind }) {
|
|
1638
409
|
var _a, _b, _c;
|
|
@@ -1641,17 +412,17 @@ function FwNav({ kind }) {
|
|
|
1641
412
|
const settings = useSettings();
|
|
1642
413
|
const headers = matchedSubnav ? matchedSubnav == null ? void 0 : matchedSubnav.items : (_a = settings == null ? void 0 : settings.structure) == null ? void 0 : _a.header;
|
|
1643
414
|
const active = headers == null ? void 0 : headers.find((item) => location.pathname.startsWith(item.url || ""));
|
|
1644
|
-
return /* @__PURE__ */
|
|
415
|
+
return /* @__PURE__ */ import_react6.default.createElement(
|
|
1645
416
|
import_ui4.Nav,
|
|
1646
417
|
{
|
|
1647
418
|
value: (active == null ? void 0 : active.url) || "",
|
|
1648
419
|
kind,
|
|
1649
|
-
logo: /* @__PURE__ */
|
|
420
|
+
logo: /* @__PURE__ */ import_react6.default.createElement(FwNavLogo, null),
|
|
1650
421
|
onChange: () => {
|
|
1651
422
|
}
|
|
1652
423
|
},
|
|
1653
424
|
(_c = (_b = settings == null ? void 0 : settings.structure) == null ? void 0 : _b.header) == null ? void 0 : _c.map((item, index) => {
|
|
1654
|
-
return /* @__PURE__ */
|
|
425
|
+
return /* @__PURE__ */ import_react6.default.createElement(
|
|
1655
426
|
import_ui4.Nav.Item,
|
|
1656
427
|
{
|
|
1657
428
|
key: index + (item.url || "") + item.name,
|
|
@@ -1670,7 +441,7 @@ function FwSubNav() {
|
|
|
1670
441
|
return null;
|
|
1671
442
|
}
|
|
1672
443
|
const active = matchedSubnav == null ? void 0 : matchedSubnav.items.findLast((item) => location.pathname.startsWith(item.url || ""));
|
|
1673
|
-
return /* @__PURE__ */
|
|
444
|
+
return /* @__PURE__ */ import_react6.default.createElement(
|
|
1674
445
|
import_ui3.SubNav,
|
|
1675
446
|
{
|
|
1676
447
|
title: (matchedSubnav == null ? void 0 : matchedSubnav.name) || "",
|
|
@@ -1679,18 +450,18 @@ function FwSubNav() {
|
|
|
1679
450
|
}
|
|
1680
451
|
},
|
|
1681
452
|
matchedSubnav == null ? void 0 : matchedSubnav.items.map((item, index) => {
|
|
1682
|
-
return /* @__PURE__ */
|
|
453
|
+
return /* @__PURE__ */ import_react6.default.createElement(import_ui3.SubNav.Item, { value: item.url || "", href: item.url }, item.name);
|
|
1683
454
|
})
|
|
1684
455
|
);
|
|
1685
456
|
}
|
|
1686
457
|
function recursiveSearch2(items, href, levels = []) {
|
|
1687
|
-
for (let
|
|
1688
|
-
const item = items[
|
|
458
|
+
for (let i = 0; i < items.length; i++) {
|
|
459
|
+
const item = items[i];
|
|
1689
460
|
if (item.href === href) {
|
|
1690
|
-
return [...levels,
|
|
461
|
+
return [...levels, i];
|
|
1691
462
|
}
|
|
1692
463
|
if (item.items) {
|
|
1693
|
-
const result = recursiveSearch2(item.items, href, [...levels,
|
|
464
|
+
const result = recursiveSearch2(item.items, href, [...levels, i]);
|
|
1694
465
|
if (result) {
|
|
1695
466
|
return result;
|
|
1696
467
|
}
|
|
@@ -1707,19 +478,19 @@ function FwSidebarGroups(props) {
|
|
|
1707
478
|
if (typeof anchor.icon === "string") {
|
|
1708
479
|
switch (anchor.icon) {
|
|
1709
480
|
case "icon-cookbook": {
|
|
1710
|
-
icon = /* @__PURE__ */
|
|
481
|
+
icon = /* @__PURE__ */ import_react6.default.createElement(IconCookbook, null);
|
|
1711
482
|
break;
|
|
1712
483
|
}
|
|
1713
484
|
case "icon-community": {
|
|
1714
|
-
icon = /* @__PURE__ */
|
|
485
|
+
icon = /* @__PURE__ */ import_react6.default.createElement(IconCommunity, null);
|
|
1715
486
|
break;
|
|
1716
487
|
}
|
|
1717
488
|
case "icon-marketplace": {
|
|
1718
|
-
icon = /* @__PURE__ */
|
|
489
|
+
icon = /* @__PURE__ */ import_react6.default.createElement(IconMarketplace, null);
|
|
1719
490
|
break;
|
|
1720
491
|
}
|
|
1721
492
|
case "icon-sdk": {
|
|
1722
|
-
icon = /* @__PURE__ */
|
|
493
|
+
icon = /* @__PURE__ */ import_react6.default.createElement(IconSDK, null);
|
|
1723
494
|
break;
|
|
1724
495
|
}
|
|
1725
496
|
default: {
|
|
@@ -1727,9 +498,9 @@ function FwSidebarGroups(props) {
|
|
|
1727
498
|
}
|
|
1728
499
|
}
|
|
1729
500
|
} else {
|
|
1730
|
-
icon = (0,
|
|
501
|
+
icon = (0, import_react6.isValidElement)(anchor.icon) ? anchor.icon : manualHydration(anchor.icon);
|
|
1731
502
|
}
|
|
1732
|
-
return /* @__PURE__ */
|
|
503
|
+
return /* @__PURE__ */ import_react6.default.createElement(import_ui3.UISidebar.FooterItem, { href: anchor.url, icon }, anchor.name);
|
|
1733
504
|
});
|
|
1734
505
|
const location = (0, import_react_router3.useLocation)();
|
|
1735
506
|
const initialActiveItems = [];
|
|
@@ -1742,14 +513,14 @@ function FwSidebarGroups(props) {
|
|
|
1742
513
|
}, group.items);
|
|
1743
514
|
return group;
|
|
1744
515
|
});
|
|
1745
|
-
return /* @__PURE__ */
|
|
516
|
+
return /* @__PURE__ */ import_react6.default.createElement(
|
|
1746
517
|
FwSidebarGroupContext,
|
|
1747
518
|
{
|
|
1748
519
|
onePathBehaviour: props.onePathBehaviour,
|
|
1749
520
|
clientSideRouting: props.clientSideRouting,
|
|
1750
521
|
initialActiveItems
|
|
1751
522
|
},
|
|
1752
|
-
/* @__PURE__ */
|
|
523
|
+
/* @__PURE__ */ import_react6.default.createElement(import_ui3.UISidebar, { footerItems: footerItems && footerItems }, groups == null ? void 0 : groups.map((group, index) => /* @__PURE__ */ import_react6.default.createElement(
|
|
1753
524
|
FwSidebarItemGroup,
|
|
1754
525
|
{
|
|
1755
526
|
key: index + group.group,
|
|
@@ -1781,7 +552,7 @@ function FwToc() {
|
|
|
1781
552
|
const tocFinal = flatToc.filter((item) => item.depth === 2);
|
|
1782
553
|
const location = (0, import_react_router3.useLocation)();
|
|
1783
554
|
const defaultValue = location.hash ? location.hash.replace("#", "") : (_a = tocFinal[0]) == null ? void 0 : _a.value;
|
|
1784
|
-
return /* @__PURE__ */
|
|
555
|
+
return /* @__PURE__ */ import_react6.default.createElement(import_ui3.Toc, { defaultValue }, tocFinal.map((item, index) => /* @__PURE__ */ import_react6.default.createElement(
|
|
1785
556
|
import_ui3.Toc.Item,
|
|
1786
557
|
{
|
|
1787
558
|
key: index + item.value + item.depth,
|
|
@@ -1792,8 +563,8 @@ function FwToc() {
|
|
|
1792
563
|
}
|
|
1793
564
|
function FwBreadcrumbs() {
|
|
1794
565
|
const breadcrumbs = useBreadcrumbs();
|
|
1795
|
-
return /* @__PURE__ */
|
|
1796
|
-
|
|
566
|
+
return /* @__PURE__ */ import_react6.default.createElement(
|
|
567
|
+
import_writer2.Breadcrumbs,
|
|
1797
568
|
{
|
|
1798
569
|
items: breadcrumbs || []
|
|
1799
570
|
}
|
|
@@ -1806,8 +577,8 @@ function FwNavLinks() {
|
|
|
1806
577
|
return null;
|
|
1807
578
|
}
|
|
1808
579
|
if ((navlinks == null ? void 0 : navlinks.prev) || (navlinks == null ? void 0 : navlinks.next)) {
|
|
1809
|
-
return /* @__PURE__ */
|
|
1810
|
-
|
|
580
|
+
return /* @__PURE__ */ import_react6.default.createElement(
|
|
581
|
+
import_writer2.NavLinks,
|
|
1811
582
|
{
|
|
1812
583
|
prev: navlinks.prev,
|
|
1813
584
|
next: navlinks.next
|
|
@@ -1817,7 +588,7 @@ function FwNavLinks() {
|
|
|
1817
588
|
return null;
|
|
1818
589
|
}
|
|
1819
590
|
function IconCookbook() {
|
|
1820
|
-
return /* @__PURE__ */
|
|
591
|
+
return /* @__PURE__ */ import_react6.default.createElement(
|
|
1821
592
|
"svg",
|
|
1822
593
|
{
|
|
1823
594
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1825,7 +596,7 @@ function IconCookbook() {
|
|
|
1825
596
|
width: "1em",
|
|
1826
597
|
height: "1em"
|
|
1827
598
|
},
|
|
1828
|
-
/* @__PURE__ */
|
|
599
|
+
/* @__PURE__ */ import_react6.default.createElement(
|
|
1829
600
|
"path",
|
|
1830
601
|
{
|
|
1831
602
|
fillRule: "evenodd",
|
|
@@ -1836,7 +607,7 @@ function IconCookbook() {
|
|
|
1836
607
|
);
|
|
1837
608
|
}
|
|
1838
609
|
function IconCommunity() {
|
|
1839
|
-
return /* @__PURE__ */
|
|
610
|
+
return /* @__PURE__ */ import_react6.default.createElement(
|
|
1840
611
|
"svg",
|
|
1841
612
|
{
|
|
1842
613
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1845,7 +616,7 @@ function IconCommunity() {
|
|
|
1845
616
|
width: "1em",
|
|
1846
617
|
height: "1em"
|
|
1847
618
|
},
|
|
1848
|
-
/* @__PURE__ */
|
|
619
|
+
/* @__PURE__ */ import_react6.default.createElement(
|
|
1849
620
|
"path",
|
|
1850
621
|
{
|
|
1851
622
|
fillRule: "evenodd",
|
|
@@ -1856,7 +627,7 @@ function IconCommunity() {
|
|
|
1856
627
|
);
|
|
1857
628
|
}
|
|
1858
629
|
function IconMarketplace() {
|
|
1859
|
-
return /* @__PURE__ */
|
|
630
|
+
return /* @__PURE__ */ import_react6.default.createElement(
|
|
1860
631
|
"svg",
|
|
1861
632
|
{
|
|
1862
633
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1865,7 +636,7 @@ function IconMarketplace() {
|
|
|
1865
636
|
width: "1em",
|
|
1866
637
|
height: "1em"
|
|
1867
638
|
},
|
|
1868
|
-
/* @__PURE__ */
|
|
639
|
+
/* @__PURE__ */ import_react6.default.createElement(
|
|
1869
640
|
"path",
|
|
1870
641
|
{
|
|
1871
642
|
"fill-rule": "evenodd",
|
|
@@ -1873,7 +644,7 @@ function IconMarketplace() {
|
|
|
1873
644
|
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"
|
|
1874
645
|
}
|
|
1875
646
|
),
|
|
1876
|
-
/* @__PURE__ */
|
|
647
|
+
/* @__PURE__ */ import_react6.default.createElement(
|
|
1877
648
|
"path",
|
|
1878
649
|
{
|
|
1879
650
|
"fill-rule": "evenodd",
|
|
@@ -1881,7 +652,7 @@ function IconMarketplace() {
|
|
|
1881
652
|
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"
|
|
1882
653
|
}
|
|
1883
654
|
),
|
|
1884
|
-
/* @__PURE__ */
|
|
655
|
+
/* @__PURE__ */ import_react6.default.createElement(
|
|
1885
656
|
"path",
|
|
1886
657
|
{
|
|
1887
658
|
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"
|
|
@@ -1890,7 +661,7 @@ function IconMarketplace() {
|
|
|
1890
661
|
);
|
|
1891
662
|
}
|
|
1892
663
|
function IconSDK() {
|
|
1893
|
-
return /* @__PURE__ */
|
|
664
|
+
return /* @__PURE__ */ import_react6.default.createElement(
|
|
1894
665
|
"svg",
|
|
1895
666
|
{
|
|
1896
667
|
viewBox: "0 0 15 15",
|
|
@@ -1898,7 +669,7 @@ function IconSDK() {
|
|
|
1898
669
|
width: "1em",
|
|
1899
670
|
height: "1em"
|
|
1900
671
|
},
|
|
1901
|
-
/* @__PURE__ */
|
|
672
|
+
/* @__PURE__ */ import_react6.default.createElement(
|
|
1902
673
|
"path",
|
|
1903
674
|
{
|
|
1904
675
|
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",
|
|
@@ -1920,62 +691,4 @@ function IconSDK() {
|
|
|
1920
691
|
FwToc,
|
|
1921
692
|
useMatchedSubNav
|
|
1922
693
|
});
|
|
1923
|
-
/*! Bundled license information:
|
|
1924
|
-
|
|
1925
|
-
lucide-react/dist/esm/shared/src/utils.js:
|
|
1926
|
-
(**
|
|
1927
|
-
* @license lucide-react v0.447.0 - ISC
|
|
1928
|
-
*
|
|
1929
|
-
* This source code is licensed under the ISC license.
|
|
1930
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
1931
|
-
*)
|
|
1932
|
-
|
|
1933
|
-
lucide-react/dist/esm/defaultAttributes.js:
|
|
1934
|
-
(**
|
|
1935
|
-
* @license lucide-react v0.447.0 - ISC
|
|
1936
|
-
*
|
|
1937
|
-
* This source code is licensed under the ISC license.
|
|
1938
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
1939
|
-
*)
|
|
1940
|
-
|
|
1941
|
-
lucide-react/dist/esm/Icon.js:
|
|
1942
|
-
(**
|
|
1943
|
-
* @license lucide-react v0.447.0 - ISC
|
|
1944
|
-
*
|
|
1945
|
-
* This source code is licensed under the ISC license.
|
|
1946
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
1947
|
-
*)
|
|
1948
|
-
|
|
1949
|
-
lucide-react/dist/esm/createLucideIcon.js:
|
|
1950
|
-
(**
|
|
1951
|
-
* @license lucide-react v0.447.0 - ISC
|
|
1952
|
-
*
|
|
1953
|
-
* This source code is licensed under the ISC license.
|
|
1954
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
1955
|
-
*)
|
|
1956
|
-
|
|
1957
|
-
lucide-react/dist/esm/icons/chevron-left.js:
|
|
1958
|
-
(**
|
|
1959
|
-
* @license lucide-react v0.447.0 - ISC
|
|
1960
|
-
*
|
|
1961
|
-
* This source code is licensed under the ISC license.
|
|
1962
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
1963
|
-
*)
|
|
1964
|
-
|
|
1965
|
-
lucide-react/dist/esm/icons/chevron-right.js:
|
|
1966
|
-
(**
|
|
1967
|
-
* @license lucide-react v0.447.0 - ISC
|
|
1968
|
-
*
|
|
1969
|
-
* This source code is licensed under the ISC license.
|
|
1970
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
1971
|
-
*)
|
|
1972
|
-
|
|
1973
|
-
lucide-react/dist/esm/lucide-react.js:
|
|
1974
|
-
(**
|
|
1975
|
-
* @license lucide-react v0.447.0 - ISC
|
|
1976
|
-
*
|
|
1977
|
-
* This source code is licensed under the ISC license.
|
|
1978
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
1979
|
-
*)
|
|
1980
|
-
*/
|
|
1981
694
|
//# sourceMappingURL=react.js.map
|