timvir 0.2.38 → 0.2.39
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/CHANGELOG.md +9 -0
- package/blocks/Arbitrary/index.js +46 -37
- package/blocks/Arbitrary/samples/basic.d.ts +1 -1
- package/blocks/Code/index.js +56 -48
- package/blocks/Code/samples/basic.d.ts +1 -1
- package/blocks/Code/samples/toggle.d.ts +1 -2
- package/blocks/Code/styles.css +3 -3
- package/blocks/ColorBar/index.js +33 -29
- package/blocks/ColorBar/samples/basic.d.ts +1 -2
- package/blocks/ColorBook/index.js +29 -26
- package/blocks/ColorBook/samples/basic.d.ts +1 -2
- package/blocks/Cover/index.js +18 -18
- package/blocks/Cover/samples/basic.d.ts +1 -2
- package/blocks/Exhibit/index.js +16 -12
- package/blocks/Exhibit/samples/basic.d.ts +1 -2
- package/blocks/Exhibit/samples/bleed.d.ts +1 -1
- package/blocks/Exhibit/samples/usage.d.ts +1 -2
- package/blocks/Exhibit/styles.css +1 -1
- package/blocks/Font/index.js +67 -56
- package/blocks/Font/samples/basic.d.ts +1 -1
- package/blocks/Font/samples/timvir/body1.d.ts +1 -1
- package/blocks/Font/samples/timvir/caption.d.ts +1 -1
- package/blocks/Font/samples/timvir/h1.d.ts +1 -1
- package/blocks/Font/samples/timvir/h2.d.ts +1 -1
- package/blocks/Font/samples/timvir/h3.d.ts +1 -1
- package/blocks/Font/samples/timvir/h4.d.ts +1 -1
- package/blocks/Grid/index.js +5 -3
- package/blocks/Grid/samples/basic.d.ts +1 -2
- package/blocks/Icon/index.js +72 -61
- package/blocks/Icon/internal/Canvas.d.ts +1 -1
- package/blocks/Icon/samples/basic.d.ts +1 -2
- package/blocks/Icon/types.d.ts +3 -2
- package/blocks/Message/index.js +21 -17
- package/blocks/Message/samples/basic.d.ts +1 -1
- package/blocks/Swatch/index.js +22 -13
- package/blocks/Swatch/samples/basic.d.ts +1 -2
- package/blocks/Viewport/index.js +206 -190
- package/blocks/Viewport/internal/Caption.d.ts +1 -1
- package/blocks/Viewport/internal/Handle.d.ts +1 -1
- package/blocks/Viewport/internal/Ruler.d.ts +1 -2
- package/blocks/Viewport/samples/basic.d.ts +1 -2
- package/blocks/WebLink/index.js +34 -23
- package/blocks/WebLink/samples/basic.d.ts +1 -1
- package/blocks/WebLink/styles.css +1 -1
- package/blocks/styles.css +5 -5
- package/builtins/index.d.ts +1 -0
- package/builtins/index.js +37 -27
- package/builtins/styles.css +13 -0
- package/core/components/Commands/Commands.d.ts +1 -3
- package/core/components/Commands/internal/Action.d.ts +1 -1
- package/core/components/Commands/internal/Dialog.d.ts +1 -2
- package/core/components/Commands/internal/index.d.ts +0 -1
- package/core/components/Footer/samples/basic.d.ts +1 -1
- package/core/components/NavigationFooter/samples/basic.d.ts +1 -1
- package/core/components/Page/internal/Section.d.ts +1 -2
- package/core/components/Page/internal/Sidebar.d.ts +1 -1
- package/core/components/Page/internal/SidebarItem.d.ts +1 -2
- package/core/components/Page/internal/index.d.ts +0 -1
- package/core/components/Page/samples/basic.d.ts +1 -2
- package/core/components/Page/samples/layout.d.ts +1 -2
- package/core/index.js +363 -297
- package/core/layout.d.ts +0 -1
- package/core/theme/detector.js +1 -1
- package/knip.config.d.ts +5 -0
- package/package.json +1 -1
- package/search/Search/samples/basic.d.ts +1 -2
- package/search/SearchBoxInput/samples/basic.d.ts +1 -2
- package/search/SearchBoxListItem/samples/basic.d.ts +1 -2
- package/search/index.js +96 -81
- package/search/styles.css +3 -3
- package/styles.css +21 -8
package/core/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import { pipe, filter, subscribe } from 'wonka';
|
|
|
3
3
|
import { useContext, Provider } from 'timvir/context';
|
|
4
4
|
export { useContext } from 'timvir/context';
|
|
5
5
|
import * as React from 'react';
|
|
6
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
6
7
|
import { MDXProvider } from '@mdx-js/react';
|
|
7
8
|
import { useHotkeys } from 'react-hotkeys-hook';
|
|
8
9
|
import { makeBus } from 'timvir/bus';
|
|
@@ -55,37 +56,46 @@ function Footer(props, ref) {
|
|
|
55
56
|
links,
|
|
56
57
|
...rest
|
|
57
58
|
} = props;
|
|
58
|
-
return /*#__PURE__*/
|
|
59
|
+
return /*#__PURE__*/jsxs(Root$3, {
|
|
59
60
|
ref: ref,
|
|
60
61
|
className: cx_default(className, classes$7.root),
|
|
61
|
-
...rest
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
62
|
+
...rest,
|
|
63
|
+
children: [links && /*#__PURE__*/jsx("div", {
|
|
64
|
+
className: grid,
|
|
65
|
+
children: /*#__PURE__*/jsx("div", {
|
|
66
|
+
className: classes$7.linkGroups,
|
|
67
|
+
children: links.map(({
|
|
68
|
+
group,
|
|
69
|
+
items
|
|
70
|
+
}, i) => /*#__PURE__*/jsxs("div", {
|
|
71
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
72
|
+
className: classes$7.linkGroupTitle,
|
|
73
|
+
children: group
|
|
74
|
+
}), /*#__PURE__*/jsx("div", {
|
|
75
|
+
children: items.map(({
|
|
76
|
+
label,
|
|
77
|
+
href
|
|
78
|
+
}, j) => /*#__PURE__*/jsx("a", {
|
|
79
|
+
href: href,
|
|
80
|
+
className: classes$7.link,
|
|
81
|
+
children: label
|
|
82
|
+
}, j))
|
|
83
|
+
})]
|
|
84
|
+
}, i))
|
|
85
|
+
})
|
|
86
|
+
}), /*#__PURE__*/jsx("div", {
|
|
87
|
+
className: cx_default(grid, classes$7.meta),
|
|
88
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
89
|
+
style: {
|
|
90
|
+
marginBottom: 0
|
|
91
|
+
},
|
|
92
|
+
children: ["Built with ", /*#__PURE__*/jsx("a", {
|
|
93
|
+
href: "https://timvir.vercel.app",
|
|
94
|
+
children: "Timvir"
|
|
95
|
+
})]
|
|
96
|
+
})
|
|
97
|
+
})]
|
|
98
|
+
});
|
|
89
99
|
}
|
|
90
100
|
var Footer$1 = /*#__PURE__*/React.forwardRef(Footer);
|
|
91
101
|
const classes$7 = {
|
|
@@ -104,28 +114,32 @@ function Action(props) {
|
|
|
104
114
|
label,
|
|
105
115
|
...rest
|
|
106
116
|
} = props;
|
|
107
|
-
return /*#__PURE__*/
|
|
117
|
+
return /*#__PURE__*/jsxs(Root$2, {
|
|
108
118
|
className: classes$6.root,
|
|
109
|
-
...rest
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
119
|
+
...rest,
|
|
120
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
121
|
+
className: classes$6.icon,
|
|
122
|
+
children: /*#__PURE__*/jsxs("svg", {
|
|
123
|
+
viewBox: "0 0 24 24",
|
|
124
|
+
fill: "none",
|
|
125
|
+
stroke: "currentColor",
|
|
126
|
+
strokeWidth: "2",
|
|
127
|
+
strokeLinecap: "round",
|
|
128
|
+
strokeLinejoin: "round",
|
|
129
|
+
children: [/*#__PURE__*/jsx("line", {
|
|
130
|
+
x1: "5",
|
|
131
|
+
y1: "12",
|
|
132
|
+
x2: "19",
|
|
133
|
+
y2: "12"
|
|
134
|
+
}), /*#__PURE__*/jsx("polyline", {
|
|
135
|
+
points: "12 5 19 12 12 19"
|
|
136
|
+
})]
|
|
137
|
+
})
|
|
138
|
+
}), /*#__PURE__*/jsx("div", {
|
|
139
|
+
className: classes$6.label,
|
|
140
|
+
children: label
|
|
141
|
+
})]
|
|
142
|
+
});
|
|
129
143
|
}
|
|
130
144
|
const classes$6 = {
|
|
131
145
|
root: "ru1mblv",
|
|
@@ -172,7 +186,7 @@ function Dialog(props) {
|
|
|
172
186
|
onDispose?.();
|
|
173
187
|
}, 200);
|
|
174
188
|
}
|
|
175
|
-
}, [open]);
|
|
189
|
+
}, [open, onDispose]);
|
|
176
190
|
React.useEffect(() => {
|
|
177
191
|
(async () => {
|
|
178
192
|
const {
|
|
@@ -183,40 +197,46 @@ function Dialog(props) {
|
|
|
183
197
|
commands: edges
|
|
184
198
|
}));
|
|
185
199
|
})();
|
|
186
|
-
}, [state.query]);
|
|
187
|
-
return /*#__PURE__*/
|
|
200
|
+
}, [toc, state.query]);
|
|
201
|
+
return /*#__PURE__*/jsxs("div", {
|
|
188
202
|
className: classes$5.root,
|
|
189
203
|
style: state.style,
|
|
190
|
-
...rest
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
204
|
+
...rest,
|
|
205
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
206
|
+
className: classes$5.context,
|
|
207
|
+
children: "Context"
|
|
208
|
+
}), /*#__PURE__*/jsx("div", {
|
|
209
|
+
className: classes$5.prompt,
|
|
210
|
+
children: /*#__PURE__*/jsx("input", {
|
|
211
|
+
autoFocus: true,
|
|
212
|
+
placeholder: "Type a command or search\u2026",
|
|
213
|
+
value: state.query,
|
|
214
|
+
onChange: ev => {
|
|
215
|
+
const query = ev.currentTarget.value;
|
|
216
|
+
setState(state => ({
|
|
217
|
+
...state,
|
|
218
|
+
query
|
|
219
|
+
}));
|
|
220
|
+
}
|
|
221
|
+
})
|
|
222
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
223
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
224
|
+
className: classes$5.subheader,
|
|
225
|
+
children: "Pages"
|
|
226
|
+
}), /*#__PURE__*/jsx("div", {
|
|
227
|
+
className: classes$5.commands,
|
|
228
|
+
children: state.commands.map(({
|
|
229
|
+
node
|
|
230
|
+
}, index) => /*#__PURE__*/jsx(Action, {
|
|
231
|
+
label: node.label,
|
|
232
|
+
onClick: () => {
|
|
233
|
+
onClose?.();
|
|
234
|
+
window.location.href = node.path;
|
|
235
|
+
}
|
|
236
|
+
}, index))
|
|
237
|
+
})]
|
|
238
|
+
})]
|
|
239
|
+
});
|
|
220
240
|
}
|
|
221
241
|
const classes$5 = {
|
|
222
242
|
root: "r1fo6voy",
|
|
@@ -226,7 +246,7 @@ const classes$5 = {
|
|
|
226
246
|
commands: "cchvluj"
|
|
227
247
|
};
|
|
228
248
|
|
|
229
|
-
function Commands(
|
|
249
|
+
function Commands() {
|
|
230
250
|
const [state, setState] = React.useState({
|
|
231
251
|
/**
|
|
232
252
|
* Whether the command palette should be open or not. The command palette is
|
|
@@ -247,17 +267,18 @@ function Commands(props) {
|
|
|
247
267
|
if (!state.dialog) {
|
|
248
268
|
const containerElement = document.createElement("div");
|
|
249
269
|
document.body.appendChild(containerElement);
|
|
250
|
-
const reactPortal = /*#__PURE__*/ReactDOM.createPortal(/*#__PURE__*/
|
|
270
|
+
const reactPortal = /*#__PURE__*/ReactDOM.createPortal(/*#__PURE__*/jsx("div", {
|
|
251
271
|
className: classes$4.root,
|
|
252
272
|
onClick: ev => {
|
|
253
273
|
if (ev.target === ev.currentTarget) {
|
|
254
274
|
close();
|
|
255
275
|
}
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
276
|
+
},
|
|
277
|
+
children: /*#__PURE__*/jsx(Dialog, {
|
|
278
|
+
open: true,
|
|
279
|
+
onClose: close
|
|
280
|
+
})
|
|
281
|
+
}), containerElement);
|
|
261
282
|
return {
|
|
262
283
|
containerElement,
|
|
263
284
|
reactPortal
|
|
@@ -265,17 +286,18 @@ function Commands(props) {
|
|
|
265
286
|
} else {
|
|
266
287
|
return {
|
|
267
288
|
containerElement: state.dialog.containerElement,
|
|
268
|
-
reactPortal: /*#__PURE__*/ReactDOM.createPortal(/*#__PURE__*/
|
|
289
|
+
reactPortal: /*#__PURE__*/ReactDOM.createPortal(/*#__PURE__*/jsx("div", {
|
|
269
290
|
className: classes$4.root,
|
|
270
291
|
onClick: ev => {
|
|
271
292
|
if (ev.target === ev.currentTarget) {
|
|
272
293
|
close();
|
|
273
294
|
}
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
295
|
+
},
|
|
296
|
+
children: /*#__PURE__*/jsx(Dialog, {
|
|
297
|
+
open: true,
|
|
298
|
+
onClose: close
|
|
299
|
+
})
|
|
300
|
+
}), state.dialog.containerElement)
|
|
279
301
|
};
|
|
280
302
|
}
|
|
281
303
|
})()
|
|
@@ -288,23 +310,24 @@ function Commands(props) {
|
|
|
288
310
|
if (state.dialog) {
|
|
289
311
|
return {
|
|
290
312
|
containerElement: state.dialog.containerElement,
|
|
291
|
-
reactPortal: /*#__PURE__*/ReactDOM.createPortal(/*#__PURE__*/
|
|
292
|
-
className: classes$4.root
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
313
|
+
reactPortal: /*#__PURE__*/ReactDOM.createPortal(/*#__PURE__*/jsx("div", {
|
|
314
|
+
className: classes$4.root,
|
|
315
|
+
children: /*#__PURE__*/jsx(Dialog, {
|
|
316
|
+
onDispose: () => {
|
|
317
|
+
setState({
|
|
318
|
+
open: state.open,
|
|
319
|
+
dialog: (() => {
|
|
320
|
+
if (!state.open && state.dialog) {
|
|
321
|
+
document.body.removeChild(state.dialog.containerElement);
|
|
322
|
+
return null;
|
|
323
|
+
} else {
|
|
324
|
+
return state.dialog;
|
|
325
|
+
}
|
|
326
|
+
})()
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
})
|
|
330
|
+
}), state.dialog.containerElement)
|
|
308
331
|
};
|
|
309
332
|
} else {
|
|
310
333
|
return state.dialog;
|
|
@@ -359,29 +382,43 @@ function NavigationFooter(props, ref) {
|
|
|
359
382
|
className,
|
|
360
383
|
...rest
|
|
361
384
|
} = props;
|
|
362
|
-
return /*#__PURE__*/
|
|
385
|
+
return /*#__PURE__*/jsx(Root$1, {
|
|
363
386
|
ref: ref,
|
|
364
387
|
...rest,
|
|
365
|
-
className: cx_default(className, classes$3.root)
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
388
|
+
className: cx_default(className, classes$3.root),
|
|
389
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
390
|
+
className: "de625n1",
|
|
391
|
+
children: [prev && /*#__PURE__*/jsxs(Link, {
|
|
392
|
+
href: prev.href,
|
|
393
|
+
className: "l19gj27w",
|
|
394
|
+
children: [/*#__PURE__*/jsxs(Context, {
|
|
395
|
+
children: [/*#__PURE__*/jsx(Icons.ChevronLeft, {}), " Previous"]
|
|
396
|
+
}), /*#__PURE__*/jsx(Label, {
|
|
397
|
+
children: prev.label
|
|
398
|
+
})]
|
|
399
|
+
}), next && /*#__PURE__*/jsx(Link, {
|
|
400
|
+
href: next.href,
|
|
401
|
+
className: "l15ohs1l",
|
|
402
|
+
children: /*#__PURE__*/jsxs(Fragment, {
|
|
403
|
+
children: [/*#__PURE__*/jsxs(Context, {
|
|
404
|
+
children: ["Next ", /*#__PURE__*/jsx(Icons.ChevronRight, {})]
|
|
405
|
+
}), /*#__PURE__*/jsx(Label, {
|
|
406
|
+
children: next.label
|
|
407
|
+
})]
|
|
408
|
+
})
|
|
409
|
+
})]
|
|
410
|
+
})
|
|
411
|
+
});
|
|
375
412
|
}
|
|
376
413
|
var NavigationFooter$1 = /*#__PURE__*/React.forwardRef(NavigationFooter);
|
|
377
414
|
function Label(props) {
|
|
378
|
-
return /*#__PURE__*/
|
|
415
|
+
return /*#__PURE__*/jsx("div", {
|
|
379
416
|
className: "dczrd9z",
|
|
380
417
|
...props
|
|
381
418
|
});
|
|
382
419
|
}
|
|
383
420
|
function Context(props) {
|
|
384
|
-
return /*#__PURE__*/
|
|
421
|
+
return /*#__PURE__*/jsx("div", {
|
|
385
422
|
className: "difnzb8",
|
|
386
423
|
...props
|
|
387
424
|
});
|
|
@@ -403,36 +440,41 @@ function SidebarItem(props) {
|
|
|
403
440
|
location,
|
|
404
441
|
Link
|
|
405
442
|
} = useContext();
|
|
406
|
-
const icon = children.length === 0 ? null : /*#__PURE__*/
|
|
443
|
+
const icon = children.length === 0 ? null : /*#__PURE__*/jsx(Icons.ChevronRight, {
|
|
407
444
|
className: classes$2.icon,
|
|
408
445
|
style: {
|
|
409
446
|
transform: active ? "rotate(90deg)" : "rotate(0deg)"
|
|
410
447
|
},
|
|
411
448
|
size: 16
|
|
412
449
|
});
|
|
413
|
-
return /*#__PURE__*/
|
|
450
|
+
return /*#__PURE__*/jsx("div", {
|
|
414
451
|
className: classes$2.root,
|
|
415
|
-
"data-active": location.asPath.replace(/#.*$/, "") === path
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
452
|
+
"data-active": location.asPath.replace(/#.*$/, "") === path,
|
|
453
|
+
children: path ? /*#__PURE__*/jsxs(Link, {
|
|
454
|
+
href: path,
|
|
455
|
+
style: {
|
|
456
|
+
marginLeft: depth * 16
|
|
457
|
+
},
|
|
458
|
+
children: [props.icon ? /*#__PURE__*/React.cloneElement(props.icon, {
|
|
459
|
+
className: classes$2.icn
|
|
460
|
+
}) : null, /*#__PURE__*/jsx("span", {
|
|
461
|
+
className: classes$2.label,
|
|
462
|
+
children: label
|
|
463
|
+
}), icon]
|
|
464
|
+
}) : /*#__PURE__*/jsxs("a", {
|
|
465
|
+
style: {
|
|
466
|
+
marginLeft: depth * 16
|
|
467
|
+
},
|
|
468
|
+
href: "#",
|
|
469
|
+
onClick: () => setActive(x => !x),
|
|
470
|
+
children: [props.icon ? /*#__PURE__*/React.cloneElement(props.icon, {
|
|
471
|
+
className: classes$2.icn
|
|
472
|
+
}) : null, /*#__PURE__*/jsx("span", {
|
|
473
|
+
className: classes$2.label,
|
|
474
|
+
children: label
|
|
475
|
+
}), icon]
|
|
476
|
+
})
|
|
477
|
+
});
|
|
436
478
|
}
|
|
437
479
|
const classes$2 = {
|
|
438
480
|
root: "r28qe6v",
|
|
@@ -466,17 +508,19 @@ function Section(props) {
|
|
|
466
508
|
setActive(true);
|
|
467
509
|
}
|
|
468
510
|
}, [path, location.asPath]);
|
|
469
|
-
return /*#__PURE__*/
|
|
470
|
-
className: classes$1.root
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
511
|
+
return /*#__PURE__*/jsxs("section", {
|
|
512
|
+
className: classes$1.root,
|
|
513
|
+
children: [/*#__PURE__*/jsx(SidebarItem, {
|
|
514
|
+
...props,
|
|
515
|
+
active: active,
|
|
516
|
+
setActive: setActive
|
|
517
|
+
}), active && children.length > 0 && /*#__PURE__*/jsx("div", {
|
|
518
|
+
children: children.map((c, i) => /*#__PURE__*/jsx(Section, {
|
|
519
|
+
depth: depth + 1,
|
|
520
|
+
...c
|
|
521
|
+
}, i))
|
|
522
|
+
})]
|
|
523
|
+
});
|
|
480
524
|
}
|
|
481
525
|
const classes$1 = {
|
|
482
526
|
root: "ruyt2hq"
|
|
@@ -505,50 +549,62 @@ function Sidebar(props) {
|
|
|
505
549
|
}
|
|
506
550
|
}
|
|
507
551
|
}(toc);
|
|
508
|
-
return /*#__PURE__*/
|
|
552
|
+
return /*#__PURE__*/jsxs("nav", {
|
|
509
553
|
className: cx_default(className, classes.root),
|
|
510
|
-
...rest
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
554
|
+
...rest,
|
|
555
|
+
children: [/*#__PURE__*/jsxs("header", {
|
|
556
|
+
className: "h17eoe18",
|
|
557
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
558
|
+
className: "d1mgn6rc",
|
|
559
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
560
|
+
className: "d7bx8iu",
|
|
561
|
+
children: "Timvir"
|
|
562
|
+
}), /*#__PURE__*/jsx("div", {
|
|
563
|
+
className: "d119ou0k"
|
|
564
|
+
}), /*#__PURE__*/jsx("div", {
|
|
565
|
+
children: "Docs"
|
|
566
|
+
})]
|
|
567
|
+
}), search && /*#__PURE__*/jsx("div", {
|
|
568
|
+
className: cx_default("d1f74255"),
|
|
569
|
+
children: /*#__PURE__*/jsx(Search, {
|
|
570
|
+
...search
|
|
571
|
+
})
|
|
572
|
+
})]
|
|
573
|
+
}), /*#__PURE__*/jsxs("label", {
|
|
574
|
+
htmlFor: "menu",
|
|
575
|
+
className: "l5l3c45",
|
|
576
|
+
children: [node?.icon ? /*#__PURE__*/React.cloneElement(node.icon, {
|
|
577
|
+
className: "c15ju3pv"
|
|
578
|
+
}) : null, /*#__PURE__*/jsx("span", {
|
|
579
|
+
children: node?.label ?? "Menu"
|
|
580
|
+
}), /*#__PURE__*/jsx(Icons.Menu, {
|
|
581
|
+
size: 16,
|
|
582
|
+
className: "s2bwnbz"
|
|
583
|
+
})]
|
|
584
|
+
}), /*#__PURE__*/jsx("input", {
|
|
585
|
+
type: "checkbox",
|
|
586
|
+
id: "menu",
|
|
587
|
+
className: "iu06l76",
|
|
588
|
+
onChange: ev => {
|
|
589
|
+
document.body.classList.toggle(classes.scrollLock, ev.currentTarget.checked);
|
|
590
|
+
}
|
|
591
|
+
}), /*#__PURE__*/jsx("div", {
|
|
592
|
+
className: classes.content,
|
|
593
|
+
children: /*#__PURE__*/jsx("div", {
|
|
594
|
+
className: classes.sections,
|
|
595
|
+
children: /*#__PURE__*/jsx("div", {
|
|
596
|
+
className: classes.nav,
|
|
597
|
+
onClick: () => {
|
|
598
|
+
document.body.classList.remove(classes.scrollLock);
|
|
599
|
+
},
|
|
600
|
+
children: toc.map((c, i) => /*#__PURE__*/jsx(Section, {
|
|
601
|
+
depth: 0,
|
|
602
|
+
...c
|
|
603
|
+
}, i))
|
|
604
|
+
})
|
|
605
|
+
})
|
|
606
|
+
})]
|
|
607
|
+
});
|
|
552
608
|
}
|
|
553
609
|
const classes = {
|
|
554
610
|
scrollLock: "s56darb",
|
|
@@ -562,22 +618,25 @@ function Search(props) {
|
|
|
562
618
|
open,
|
|
563
619
|
label
|
|
564
620
|
} = props;
|
|
565
|
-
return /*#__PURE__*/
|
|
566
|
-
className: "da95449"
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
621
|
+
return /*#__PURE__*/jsx("div", {
|
|
622
|
+
className: "da95449",
|
|
623
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
624
|
+
role: "button",
|
|
625
|
+
className: "d1au8wkb",
|
|
626
|
+
onClick: open,
|
|
627
|
+
children: [/*#__PURE__*/jsx("svg", {
|
|
628
|
+
x: "0px",
|
|
629
|
+
y: "0px",
|
|
630
|
+
width: "12px",
|
|
631
|
+
height: "12px",
|
|
632
|
+
viewBox: "0 0 12 12",
|
|
633
|
+
children: /*#__PURE__*/jsx("path", {
|
|
634
|
+
d: "M11.707 10.293l-2.54-2.54a5.015 5.015 0 10-1.414 1.414l2.54 2.54a1 1 0 001.414-1.414zM2 5a3 3 0 113 3 3 3 0 01-3-3z",
|
|
635
|
+
fill: "currentColor"
|
|
636
|
+
})
|
|
637
|
+
}), label || "Search docs"]
|
|
638
|
+
})
|
|
639
|
+
});
|
|
581
640
|
}
|
|
582
641
|
|
|
583
642
|
/**
|
|
@@ -629,84 +688,91 @@ function Page(props, ref) {
|
|
|
629
688
|
}, {
|
|
630
689
|
enableOnFormTags: true
|
|
631
690
|
});
|
|
632
|
-
return /*#__PURE__*/
|
|
633
|
-
value: context
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
}
|
|
651
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
652
|
-
className: "dxk1fgw"
|
|
653
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
654
|
-
className: grid
|
|
655
|
-
}, /*#__PURE__*/React.createElement(MDXProvider, {
|
|
656
|
-
components: {
|
|
657
|
-
...mdxComponentsBase,
|
|
658
|
-
...mdxComponents
|
|
659
|
-
}
|
|
660
|
-
}, children)), /*#__PURE__*/React.createElement("div", {
|
|
661
|
-
className: "d2srpki"
|
|
662
|
-
}, (() => {
|
|
663
|
-
function flatten(n, parents) {
|
|
664
|
-
let ret = [];
|
|
665
|
-
if (n.path) {
|
|
666
|
-
ret.push({
|
|
667
|
-
parents,
|
|
668
|
-
label: n.label,
|
|
669
|
-
path: n.path
|
|
670
|
-
});
|
|
671
|
-
}
|
|
672
|
-
if (n.children) {
|
|
673
|
-
ret = [...ret, ...n.children.flatMap(c => flatten(c, [...parents, n]))];
|
|
674
|
-
}
|
|
675
|
-
return ret;
|
|
676
|
-
}
|
|
677
|
-
const items = toc.flatMap(n => flatten(n, []));
|
|
678
|
-
const index = items.findIndex(v => v.path === location.asPath.replace(/#.*/, ""));
|
|
679
|
-
if (index === -1) {
|
|
680
|
-
return null;
|
|
681
|
-
}
|
|
682
|
-
function toLink(index) {
|
|
683
|
-
const item = items[index];
|
|
684
|
-
if (item === undefined) {
|
|
685
|
-
return undefined;
|
|
686
|
-
} else {
|
|
687
|
-
return {
|
|
688
|
-
href: item.path,
|
|
689
|
-
label: item.label,
|
|
690
|
-
context: item.parents.map(x => x.label).join(" / ")
|
|
691
|
-
};
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
695
|
-
className: "d1hkiw6l"
|
|
696
|
-
}, /*#__PURE__*/React.createElement(NavigationFooter$1, {
|
|
697
|
-
prev: toLink(index - 1),
|
|
698
|
-
next: toLink(index + 1)
|
|
699
|
-
}));
|
|
700
|
-
})(), Footer && /*#__PURE__*/React.createElement(Footer, null))), search && /*#__PURE__*/React.createElement(search.Component, {
|
|
701
|
-
...state.search,
|
|
702
|
-
onClose: () => {
|
|
703
|
-
setState({
|
|
704
|
-
search: {
|
|
705
|
-
open: false
|
|
691
|
+
return /*#__PURE__*/jsxs(Provider, {
|
|
692
|
+
value: context,
|
|
693
|
+
children: [/*#__PURE__*/jsxs(Root, {
|
|
694
|
+
ref: ref,
|
|
695
|
+
...rest,
|
|
696
|
+
className: cx_default(className, theme, "rfhjyp1"),
|
|
697
|
+
children: [/*#__PURE__*/jsx(Sidebar, {
|
|
698
|
+
className: "s1pp8z35",
|
|
699
|
+
toc: toc,
|
|
700
|
+
search: search && {
|
|
701
|
+
open: () => {
|
|
702
|
+
setState({
|
|
703
|
+
search: {
|
|
704
|
+
open: true
|
|
705
|
+
}
|
|
706
|
+
});
|
|
707
|
+
},
|
|
708
|
+
...search
|
|
706
709
|
}
|
|
707
|
-
})
|
|
708
|
-
|
|
709
|
-
|
|
710
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
711
|
+
className: "dxk1fgw",
|
|
712
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
713
|
+
className: grid,
|
|
714
|
+
children: /*#__PURE__*/jsx(MDXProvider, {
|
|
715
|
+
components: {
|
|
716
|
+
...mdxComponentsBase,
|
|
717
|
+
...mdxComponents
|
|
718
|
+
},
|
|
719
|
+
children: children
|
|
720
|
+
})
|
|
721
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
722
|
+
className: "d2srpki",
|
|
723
|
+
children: [(() => {
|
|
724
|
+
function flatten(n, parents) {
|
|
725
|
+
let ret = [];
|
|
726
|
+
if (n.path) {
|
|
727
|
+
ret.push({
|
|
728
|
+
parents,
|
|
729
|
+
label: n.label,
|
|
730
|
+
path: n.path
|
|
731
|
+
});
|
|
732
|
+
}
|
|
733
|
+
if (n.children) {
|
|
734
|
+
ret = [...ret, ...n.children.flatMap(c => flatten(c, [...parents, n]))];
|
|
735
|
+
}
|
|
736
|
+
return ret;
|
|
737
|
+
}
|
|
738
|
+
const items = toc.flatMap(n => flatten(n, []));
|
|
739
|
+
const index = items.findIndex(v => v.path === location.asPath.replace(/#.*/, ""));
|
|
740
|
+
if (index === -1) {
|
|
741
|
+
return null;
|
|
742
|
+
}
|
|
743
|
+
function toLink(index) {
|
|
744
|
+
const item = items[index];
|
|
745
|
+
if (item === undefined) {
|
|
746
|
+
return undefined;
|
|
747
|
+
} else {
|
|
748
|
+
return {
|
|
749
|
+
href: item.path,
|
|
750
|
+
label: item.label,
|
|
751
|
+
context: item.parents.map(x => x.label).join(" / ")
|
|
752
|
+
};
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
return /*#__PURE__*/jsx("div", {
|
|
756
|
+
className: "d1hkiw6l",
|
|
757
|
+
children: /*#__PURE__*/jsx(NavigationFooter$1, {
|
|
758
|
+
prev: toLink(index - 1),
|
|
759
|
+
next: toLink(index + 1)
|
|
760
|
+
})
|
|
761
|
+
});
|
|
762
|
+
})(), Footer && /*#__PURE__*/jsx(Footer, {})]
|
|
763
|
+
})]
|
|
764
|
+
}), search && /*#__PURE__*/jsx(search.Component, {
|
|
765
|
+
...state.search,
|
|
766
|
+
onClose: () => {
|
|
767
|
+
setState({
|
|
768
|
+
search: {
|
|
769
|
+
open: false
|
|
770
|
+
}
|
|
771
|
+
});
|
|
772
|
+
}
|
|
773
|
+
})]
|
|
774
|
+
}), /*#__PURE__*/jsx(Commands, {})]
|
|
775
|
+
});
|
|
710
776
|
}
|
|
711
777
|
var Page$1 = /*#__PURE__*/React.forwardRef(Page);
|
|
712
778
|
|
|
@@ -746,7 +812,7 @@ function useBlock(props) {
|
|
|
746
812
|
});
|
|
747
813
|
}
|
|
748
814
|
}
|
|
749
|
-
})).unsubscribe, [mailbox]);
|
|
815
|
+
})).unsubscribe, [mailbox, state.overrides]);
|
|
750
816
|
return {
|
|
751
817
|
bus,
|
|
752
818
|
mailbox,
|