@gpichot/spectacle-deck 1.0.0 → 1.0.1
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/index.cjs +106 -137
- package/index.mjs +106 -137
- package/package.json +2 -1
package/index.mjs
CHANGED
|
@@ -1,41 +1,10 @@
|
|
|
1
1
|
// src/index.tsx
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
// ../../node_modules/.pnpm/@mdx-js+react@3.0.0_@types+react@18.2.34/node_modules/@mdx-js/react/lib/index.js
|
|
5
|
-
import React from "react";
|
|
6
|
-
var emptyComponents = {};
|
|
7
|
-
var MDXContext = React.createContext(emptyComponents);
|
|
8
|
-
function useMDXComponents(components) {
|
|
9
|
-
const contextComponents = React.useContext(MDXContext);
|
|
10
|
-
return React.useMemo(
|
|
11
|
-
function() {
|
|
12
|
-
if (typeof components === "function") {
|
|
13
|
-
return components(contextComponents);
|
|
14
|
-
}
|
|
15
|
-
return { ...contextComponents, ...components };
|
|
16
|
-
},
|
|
17
|
-
[contextComponents, components]
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
function MDXProvider(props) {
|
|
21
|
-
let allComponents;
|
|
22
|
-
if (props.disableParentContext) {
|
|
23
|
-
allComponents = typeof props.components === "function" ? props.components(emptyComponents) : props.components || emptyComponents;
|
|
24
|
-
} else {
|
|
25
|
-
allComponents = useMDXComponents(props.components);
|
|
26
|
-
}
|
|
27
|
-
return React.createElement(
|
|
28
|
-
MDXContext.Provider,
|
|
29
|
-
{ value: allComponents },
|
|
30
|
-
props.children
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// src/index.tsx
|
|
2
|
+
import React17 from "react";
|
|
3
|
+
import { MDXProvider } from "@mdx-js/react";
|
|
35
4
|
import { Deck as SpectacleDeck, Slide } from "spectacle";
|
|
36
5
|
|
|
37
6
|
// src/layouts/MainSectionLayout.tsx
|
|
38
|
-
import
|
|
7
|
+
import React from "react";
|
|
39
8
|
import { FlexBox } from "spectacle";
|
|
40
9
|
|
|
41
10
|
// src/front.png
|
|
@@ -45,7 +14,7 @@ var front_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA2QAAAfPCAYAA
|
|
|
45
14
|
var MainSectionLayout = ({
|
|
46
15
|
children
|
|
47
16
|
}) => {
|
|
48
|
-
return /* @__PURE__ */
|
|
17
|
+
return /* @__PURE__ */ React.createElement(
|
|
49
18
|
FlexBox,
|
|
50
19
|
{
|
|
51
20
|
height: "100%",
|
|
@@ -59,8 +28,8 @@ var MainSectionLayout = ({
|
|
|
59
28
|
bottom: 0
|
|
60
29
|
}
|
|
61
30
|
},
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
/* @__PURE__ */
|
|
31
|
+
/* @__PURE__ */ React.createElement("div", { style: { paddingLeft: "8rem", flex: 1 } }, children),
|
|
32
|
+
/* @__PURE__ */ React.createElement("div", { style: { flex: "0 0", height: "100%", paddingLeft: "5rem" } }, /* @__PURE__ */ React.createElement("img", { src: front_default, alt: "Front", style: { height: "100%" } }))
|
|
64
33
|
);
|
|
65
34
|
};
|
|
66
35
|
|
|
@@ -80,10 +49,10 @@ var SectionLayout = styled.div`
|
|
|
80
49
|
`;
|
|
81
50
|
|
|
82
51
|
// src/layouts/SideCodeLayout.tsx
|
|
83
|
-
import
|
|
52
|
+
import React4 from "react";
|
|
84
53
|
|
|
85
54
|
// src/layouts/columns.tsx
|
|
86
|
-
import
|
|
55
|
+
import React2 from "react";
|
|
87
56
|
import styled2 from "styled-components";
|
|
88
57
|
var DivWithHeading = styled2.div`
|
|
89
58
|
h2 {
|
|
@@ -108,15 +77,15 @@ function ColumnsLayout({
|
|
|
108
77
|
children,
|
|
109
78
|
reverse
|
|
110
79
|
}) {
|
|
111
|
-
const childrenArray =
|
|
112
|
-
return /* @__PURE__ */
|
|
80
|
+
const childrenArray = React2.Children.toArray(children);
|
|
81
|
+
return /* @__PURE__ */ React2.createElement(
|
|
113
82
|
ColumnsContainer,
|
|
114
83
|
{
|
|
115
84
|
style: {
|
|
116
85
|
flexDirection: reverse ? "row-reverse" : "row"
|
|
117
86
|
}
|
|
118
87
|
},
|
|
119
|
-
childrenArray.map((child, i) => /* @__PURE__ */
|
|
88
|
+
childrenArray.map((child, i) => /* @__PURE__ */ React2.createElement(
|
|
120
89
|
"div",
|
|
121
90
|
{
|
|
122
91
|
key: i,
|
|
@@ -135,18 +104,18 @@ function ColumnsLayout({
|
|
|
135
104
|
}
|
|
136
105
|
|
|
137
106
|
// src/layouts/utils.ts
|
|
138
|
-
import
|
|
107
|
+
import React3 from "react";
|
|
139
108
|
var Margins = {
|
|
140
109
|
vertical: "4rem",
|
|
141
110
|
horizontal: "7rem",
|
|
142
111
|
horizontalInternal: "2rem"
|
|
143
112
|
};
|
|
144
113
|
function getCode(children) {
|
|
145
|
-
const allChild =
|
|
114
|
+
const allChild = React3.Children.toArray(children);
|
|
146
115
|
if (allChild.length === 0)
|
|
147
116
|
return [null, allChild];
|
|
148
117
|
const index = allChild.findIndex((child) => {
|
|
149
|
-
if (!
|
|
118
|
+
if (!React3.isValidElement(child))
|
|
150
119
|
return false;
|
|
151
120
|
return child.props.originalType === "pre";
|
|
152
121
|
});
|
|
@@ -157,9 +126,9 @@ function getCode(children) {
|
|
|
157
126
|
return [candidate, rest];
|
|
158
127
|
}
|
|
159
128
|
function getMatchingMdxType(children, mdxType) {
|
|
160
|
-
const allChild =
|
|
129
|
+
const allChild = React3.Children.toArray(children);
|
|
161
130
|
const matchFn = (child) => {
|
|
162
|
-
if (!
|
|
131
|
+
if (!React3.isValidElement(child))
|
|
163
132
|
return false;
|
|
164
133
|
if (typeof child.type !== "function")
|
|
165
134
|
return false;
|
|
@@ -194,7 +163,7 @@ function SidedCodeLayout({
|
|
|
194
163
|
position = "right"
|
|
195
164
|
}) {
|
|
196
165
|
const [code, rest] = getCodeChildren(children);
|
|
197
|
-
return /* @__PURE__ */
|
|
166
|
+
return /* @__PURE__ */ React4.createElement(ColumnsLayout, { reverse: position === "left" }, /* @__PURE__ */ React4.createElement(
|
|
198
167
|
"div",
|
|
199
168
|
{
|
|
200
169
|
style: {
|
|
@@ -203,7 +172,7 @@ function SidedCodeLayout({
|
|
|
203
172
|
}
|
|
204
173
|
},
|
|
205
174
|
rest
|
|
206
|
-
), /* @__PURE__ */
|
|
175
|
+
), /* @__PURE__ */ React4.createElement(
|
|
207
176
|
CodeSide,
|
|
208
177
|
{
|
|
209
178
|
style: {
|
|
@@ -219,11 +188,11 @@ function SidedCodeLayout({
|
|
|
219
188
|
}
|
|
220
189
|
|
|
221
190
|
// src/layouts/SideImageLayout.tsx
|
|
222
|
-
import
|
|
191
|
+
import React6 from "react";
|
|
223
192
|
import styled5 from "styled-components";
|
|
224
193
|
|
|
225
194
|
// src/components/Image.tsx
|
|
226
|
-
import
|
|
195
|
+
import React5 from "react";
|
|
227
196
|
|
|
228
197
|
// src/layouts/styled.ts
|
|
229
198
|
import styled4 from "styled-components";
|
|
@@ -237,7 +206,7 @@ var SVGObject = styled4.object`
|
|
|
237
206
|
function Image(props) {
|
|
238
207
|
const { src, height } = props;
|
|
239
208
|
if (!(src == null ? void 0 : src.endsWith(".svg"))) {
|
|
240
|
-
return /* @__PURE__ */
|
|
209
|
+
return /* @__PURE__ */ React5.createElement(
|
|
241
210
|
"img",
|
|
242
211
|
{
|
|
243
212
|
src,
|
|
@@ -250,7 +219,7 @@ function Image(props) {
|
|
|
250
219
|
}
|
|
251
220
|
);
|
|
252
221
|
}
|
|
253
|
-
return /* @__PURE__ */
|
|
222
|
+
return /* @__PURE__ */ React5.createElement(
|
|
254
223
|
SVGObject,
|
|
255
224
|
{
|
|
256
225
|
type: "image/svg+xml",
|
|
@@ -287,7 +256,7 @@ var SidedImageLayout = ({
|
|
|
287
256
|
console.error("No image provided for SidedImageLayout");
|
|
288
257
|
return null;
|
|
289
258
|
}
|
|
290
|
-
return /* @__PURE__ */
|
|
259
|
+
return /* @__PURE__ */ React6.createElement(
|
|
291
260
|
DivWithHeading2,
|
|
292
261
|
{
|
|
293
262
|
style: {
|
|
@@ -300,7 +269,7 @@ var SidedImageLayout = ({
|
|
|
300
269
|
top: 0
|
|
301
270
|
}
|
|
302
271
|
},
|
|
303
|
-
/* @__PURE__ */
|
|
272
|
+
/* @__PURE__ */ React6.createElement(
|
|
304
273
|
"div",
|
|
305
274
|
{
|
|
306
275
|
style: {
|
|
@@ -313,7 +282,7 @@ var SidedImageLayout = ({
|
|
|
313
282
|
},
|
|
314
283
|
rest
|
|
315
284
|
),
|
|
316
|
-
/* @__PURE__ */
|
|
285
|
+
/* @__PURE__ */ React6.createElement(
|
|
317
286
|
"div",
|
|
318
287
|
{
|
|
319
288
|
style: {
|
|
@@ -325,19 +294,19 @@ var SidedImageLayout = ({
|
|
|
325
294
|
backgroundColor: "white"
|
|
326
295
|
}
|
|
327
296
|
},
|
|
328
|
-
component || /* @__PURE__ */
|
|
297
|
+
component || /* @__PURE__ */ React6.createElement(Image, { src: image })
|
|
329
298
|
)
|
|
330
299
|
);
|
|
331
300
|
};
|
|
332
301
|
|
|
333
302
|
// src/layouts/SideLayout.tsx
|
|
334
|
-
import
|
|
303
|
+
import React7 from "react";
|
|
335
304
|
function SideLayout({
|
|
336
305
|
children,
|
|
337
306
|
position = "right"
|
|
338
307
|
}) {
|
|
339
308
|
const [side, rest] = getMatchingMdxType(children, "Side");
|
|
340
|
-
return /* @__PURE__ */
|
|
309
|
+
return /* @__PURE__ */ React7.createElement(ColumnsLayout, { reverse: position === "left" }, /* @__PURE__ */ React7.createElement("div", { style: { marginLeft: Margins.horizontal } }, rest), /* @__PURE__ */ React7.createElement(
|
|
341
310
|
"div",
|
|
342
311
|
{
|
|
343
312
|
style: {
|
|
@@ -389,11 +358,11 @@ var theme_default = {
|
|
|
389
358
|
};
|
|
390
359
|
|
|
391
360
|
// src/template.tsx
|
|
392
|
-
import
|
|
361
|
+
import React8 from "react";
|
|
393
362
|
import { Box, FullScreen } from "spectacle";
|
|
394
363
|
var template = ({ slideNumber, numberOfSlides }) => {
|
|
395
364
|
const percentage = slideNumber / numberOfSlides * 100;
|
|
396
|
-
return /* @__PURE__ */
|
|
365
|
+
return /* @__PURE__ */ React8.createElement("div", { style: { position: "absolute", bottom: 0, left: 0, right: 0 } }, /* @__PURE__ */ React8.createElement(Box, { padding: "0 0 0.5em 0.7em" }, /* @__PURE__ */ React8.createElement(FullScreen, null)), /* @__PURE__ */ React8.createElement("div", { style: { width: "100%", height: "4px", background: "#ffffff11" } }, /* @__PURE__ */ React8.createElement(
|
|
397
366
|
"div",
|
|
398
367
|
{
|
|
399
368
|
style: {
|
|
@@ -407,11 +376,11 @@ var template = ({ slideNumber, numberOfSlides }) => {
|
|
|
407
376
|
};
|
|
408
377
|
|
|
409
378
|
// src/components/map.tsx
|
|
410
|
-
import
|
|
379
|
+
import React11 from "react";
|
|
411
380
|
import { mdxComponentMap } from "spectacle";
|
|
412
381
|
|
|
413
382
|
// src/components/styled.tsx
|
|
414
|
-
import
|
|
383
|
+
import React9 from "react";
|
|
415
384
|
import {
|
|
416
385
|
Link as SpectacleLink,
|
|
417
386
|
Image as SpectacleImage,
|
|
@@ -424,7 +393,7 @@ var StyledImage = styled6(SpectacleImage)`
|
|
|
424
393
|
max-height: 30vh;
|
|
425
394
|
max-width: 70vw;
|
|
426
395
|
`;
|
|
427
|
-
var Image2 = (props) => /* @__PURE__ */
|
|
396
|
+
var Image2 = (props) => /* @__PURE__ */ React9.createElement(FlexBox2, { margin: "0 0", padding: "0 0" }, /* @__PURE__ */ React9.createElement(StyledImage, { ...props }));
|
|
428
397
|
var CustomHeading = styled6(Heading)`
|
|
429
398
|
strong {
|
|
430
399
|
color: #f49676;
|
|
@@ -469,7 +438,7 @@ var HeadingThree = styled6.h3`
|
|
|
469
438
|
`;
|
|
470
439
|
|
|
471
440
|
// src/components/CodeStepper/CodeStepper.tsx
|
|
472
|
-
import
|
|
441
|
+
import React10 from "react";
|
|
473
442
|
import ReactIs from "react-is";
|
|
474
443
|
import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
|
|
475
444
|
import gruvboxDark from "react-syntax-highlighter/dist/cjs/styles/prism/gruvbox-dark";
|
|
@@ -559,7 +528,7 @@ var CodeContainer = styled7.div`
|
|
|
559
528
|
}
|
|
560
529
|
`;
|
|
561
530
|
function useCodeSteps(code) {
|
|
562
|
-
return
|
|
531
|
+
return React10.useMemo(() => {
|
|
563
532
|
const prefixes = code.match(/(?:\/\/|<!--) @.*\n/g) || [];
|
|
564
533
|
const prefixesLength = prefixes.reduce(
|
|
565
534
|
(acc, prefix) => acc + prefix.length,
|
|
@@ -579,8 +548,8 @@ function useCodeSteps(code) {
|
|
|
579
548
|
}, [code]);
|
|
580
549
|
}
|
|
581
550
|
function getCodeDetails(children) {
|
|
582
|
-
const child =
|
|
583
|
-
if (!
|
|
551
|
+
const child = React10.Children.toArray(children)[0];
|
|
552
|
+
if (!React10.isValidElement(child)) {
|
|
584
553
|
return {
|
|
585
554
|
language: "",
|
|
586
555
|
code: ReactIs.isFragment(child) ? "" : String(child || "")
|
|
@@ -598,7 +567,7 @@ function CodeWrapper({
|
|
|
598
567
|
hasName,
|
|
599
568
|
children
|
|
600
569
|
}) {
|
|
601
|
-
return /* @__PURE__ */
|
|
570
|
+
return /* @__PURE__ */ React10.createElement(
|
|
602
571
|
"div",
|
|
603
572
|
{
|
|
604
573
|
style: {
|
|
@@ -608,7 +577,7 @@ function CodeWrapper({
|
|
|
608
577
|
borderRadius: "4px"
|
|
609
578
|
}
|
|
610
579
|
},
|
|
611
|
-
name && /* @__PURE__ */
|
|
580
|
+
name && /* @__PURE__ */ React10.createElement(
|
|
612
581
|
"span",
|
|
613
582
|
{
|
|
614
583
|
style: {
|
|
@@ -625,7 +594,7 @@ function CodeWrapper({
|
|
|
625
594
|
name
|
|
626
595
|
),
|
|
627
596
|
children,
|
|
628
|
-
hasName && /* @__PURE__ */
|
|
597
|
+
hasName && /* @__PURE__ */ React10.createElement(
|
|
629
598
|
"span",
|
|
630
599
|
{
|
|
631
600
|
style: {
|
|
@@ -640,7 +609,7 @@ function CodeWrapper({
|
|
|
640
609
|
fontStyle: "italic"
|
|
641
610
|
}
|
|
642
611
|
},
|
|
643
|
-
stepName || /* @__PURE__ */
|
|
612
|
+
stepName || /* @__PURE__ */ React10.createElement("span", { style: { visibility: "hidden" } }, "Step")
|
|
644
613
|
)
|
|
645
614
|
);
|
|
646
615
|
}
|
|
@@ -649,7 +618,7 @@ function CodeStepper({
|
|
|
649
618
|
name,
|
|
650
619
|
...props
|
|
651
620
|
}) {
|
|
652
|
-
const { language, code } =
|
|
621
|
+
const { language, code } = React10.useMemo(() => {
|
|
653
622
|
return getCodeDetails(props.children);
|
|
654
623
|
}, [props.children]);
|
|
655
624
|
const {
|
|
@@ -659,21 +628,21 @@ function CodeStepper({
|
|
|
659
628
|
hasSteps,
|
|
660
629
|
hasName
|
|
661
630
|
} = useCodeSteps(code);
|
|
662
|
-
return /* @__PURE__ */
|
|
631
|
+
return /* @__PURE__ */ React10.createElement(CodeContainer, null, import.meta.env.DEV && Boolean(prefixes == null ? void 0 : prefixes.length) && /* @__PURE__ */ React10.createElement("div", { style: { position: "absolute", top: 0, opacity: 0.5, left: 0 } }, /* @__PURE__ */ React10.createElement(Highlighter, { language, style: gruvboxDark }, prefixes.join(""))), /* @__PURE__ */ React10.createElement(
|
|
663
632
|
Stepper,
|
|
664
633
|
{
|
|
665
634
|
values: steps,
|
|
666
635
|
alwaysVisible: !hasSteps,
|
|
667
636
|
priority: priority ? priority + 1 : void 0
|
|
668
637
|
},
|
|
669
|
-
(step, _, isActive) => /* @__PURE__ */
|
|
638
|
+
(step, _, isActive) => /* @__PURE__ */ React10.createElement(
|
|
670
639
|
CodeWrapper,
|
|
671
640
|
{
|
|
672
641
|
name,
|
|
673
642
|
stepName: step == null ? void 0 : step.name,
|
|
674
643
|
hasName
|
|
675
644
|
},
|
|
676
|
-
/* @__PURE__ */
|
|
645
|
+
/* @__PURE__ */ React10.createElement(
|
|
677
646
|
Highlighter,
|
|
678
647
|
{
|
|
679
648
|
language,
|
|
@@ -723,7 +692,7 @@ CodeStepper.mdxType = "CodeStepper";
|
|
|
723
692
|
// src/components/map.tsx
|
|
724
693
|
var componentsMap = {
|
|
725
694
|
...mdxComponentMap,
|
|
726
|
-
inlineCode: (props) => /* @__PURE__ */
|
|
695
|
+
inlineCode: (props) => /* @__PURE__ */ React11.createElement(
|
|
727
696
|
InlineCode,
|
|
728
697
|
{
|
|
729
698
|
...props,
|
|
@@ -733,7 +702,7 @@ var componentsMap = {
|
|
|
733
702
|
}
|
|
734
703
|
}
|
|
735
704
|
),
|
|
736
|
-
table: (props) => /* @__PURE__ */
|
|
705
|
+
table: (props) => /* @__PURE__ */ React11.createElement(
|
|
737
706
|
"table",
|
|
738
707
|
{
|
|
739
708
|
...props,
|
|
@@ -744,7 +713,7 @@ var componentsMap = {
|
|
|
744
713
|
}
|
|
745
714
|
}
|
|
746
715
|
),
|
|
747
|
-
tr: (props) => /* @__PURE__ */
|
|
716
|
+
tr: (props) => /* @__PURE__ */ React11.createElement(
|
|
748
717
|
"tr",
|
|
749
718
|
{
|
|
750
719
|
...props,
|
|
@@ -756,7 +725,7 @@ var componentsMap = {
|
|
|
756
725
|
}
|
|
757
726
|
}
|
|
758
727
|
),
|
|
759
|
-
td: (props) => /* @__PURE__ */
|
|
728
|
+
td: (props) => /* @__PURE__ */ React11.createElement(
|
|
760
729
|
"td",
|
|
761
730
|
{
|
|
762
731
|
...props,
|
|
@@ -769,7 +738,7 @@ var componentsMap = {
|
|
|
769
738
|
}
|
|
770
739
|
}
|
|
771
740
|
),
|
|
772
|
-
h1: (props) => /* @__PURE__ */
|
|
741
|
+
h1: (props) => /* @__PURE__ */ React11.createElement(
|
|
773
742
|
CustomHeading,
|
|
774
743
|
{
|
|
775
744
|
fontSize: "h1",
|
|
@@ -784,15 +753,15 @@ var componentsMap = {
|
|
|
784
753
|
},
|
|
785
754
|
props.children
|
|
786
755
|
),
|
|
787
|
-
h2: (props) => /* @__PURE__ */
|
|
788
|
-
h3: (props) => /* @__PURE__ */
|
|
789
|
-
img: (props) => /* @__PURE__ */
|
|
756
|
+
h2: (props) => /* @__PURE__ */ React11.createElement(HeadingTwo, null, props.children),
|
|
757
|
+
h3: (props) => /* @__PURE__ */ React11.createElement(HeadingThree, { ...props }),
|
|
758
|
+
img: (props) => /* @__PURE__ */ React11.createElement(Image2, { ...props }),
|
|
790
759
|
pre: CodeStepper,
|
|
791
|
-
li: (props) => /* @__PURE__ */
|
|
792
|
-
Side: (props) => /* @__PURE__ */
|
|
760
|
+
li: (props) => /* @__PURE__ */ React11.createElement("li", { ...props, style: { margin: "24px 0" } }),
|
|
761
|
+
Side: (props) => /* @__PURE__ */ React11.createElement("div", { ...props }),
|
|
793
762
|
p: (props) => {
|
|
794
763
|
const Text = mdxComponentMap.p;
|
|
795
|
-
return /* @__PURE__ */
|
|
764
|
+
return /* @__PURE__ */ React11.createElement(
|
|
796
765
|
Text,
|
|
797
766
|
{
|
|
798
767
|
style: { margin: "8px 0", padding: "8px 0", lineHeight: "2rem" },
|
|
@@ -800,10 +769,10 @@ var componentsMap = {
|
|
|
800
769
|
}
|
|
801
770
|
);
|
|
802
771
|
},
|
|
803
|
-
blockquote: (props) => /* @__PURE__ */
|
|
772
|
+
blockquote: (props) => /* @__PURE__ */ React11.createElement(CustomQuote, { ...props }),
|
|
804
773
|
a: ({ children, ...props }) => {
|
|
805
774
|
const domain = new URL(props.href || "").hostname;
|
|
806
|
-
return /* @__PURE__ */
|
|
775
|
+
return /* @__PURE__ */ React11.createElement("a", { ...props, style: { color: "#f49676", textDecoration: "none" } }, children, " ", /* @__PURE__ */ React11.createElement(
|
|
807
776
|
"small",
|
|
808
777
|
{
|
|
809
778
|
style: {
|
|
@@ -819,14 +788,14 @@ var componentsMap = {
|
|
|
819
788
|
var map_default = componentsMap;
|
|
820
789
|
|
|
821
790
|
// src/components/FilePane.tsx
|
|
822
|
-
import
|
|
791
|
+
import React12 from "react";
|
|
823
792
|
function FilePane({
|
|
824
793
|
name,
|
|
825
794
|
children,
|
|
826
795
|
priority,
|
|
827
796
|
...divProps
|
|
828
797
|
}) {
|
|
829
|
-
return
|
|
798
|
+
return React12.isValidElement(children) ? React12.cloneElement(children, {
|
|
830
799
|
// @ts-expect-error cloning
|
|
831
800
|
priority,
|
|
832
801
|
name
|
|
@@ -835,14 +804,14 @@ function FilePane({
|
|
|
835
804
|
FilePane.mdxType = "FilePane";
|
|
836
805
|
|
|
837
806
|
// src/components/ItemsColumn.tsx
|
|
838
|
-
import
|
|
807
|
+
import React13 from "react";
|
|
839
808
|
import { Stepper as Stepper2 } from "spectacle";
|
|
840
809
|
import styled8 from "styled-components";
|
|
841
810
|
import { useSpring, animated } from "react-spring";
|
|
842
811
|
function ItemsColumn(divProps) {
|
|
843
812
|
const { style, children, ...props } = divProps;
|
|
844
|
-
const childrenArray =
|
|
845
|
-
return /* @__PURE__ */
|
|
813
|
+
const childrenArray = React13.Children.toArray(children);
|
|
814
|
+
return /* @__PURE__ */ React13.createElement(Stepper2, { values: childrenArray }, (value, step) => /* @__PURE__ */ React13.createElement(
|
|
846
815
|
"div",
|
|
847
816
|
{
|
|
848
817
|
style: {
|
|
@@ -856,10 +825,10 @@ function ItemsColumn(divProps) {
|
|
|
856
825
|
},
|
|
857
826
|
childrenArray.map((child, index) => {
|
|
858
827
|
const isVisible = index <= step;
|
|
859
|
-
if (!
|
|
828
|
+
if (!React13.isValidElement(child)) {
|
|
860
829
|
return child;
|
|
861
830
|
}
|
|
862
|
-
return /* @__PURE__ */
|
|
831
|
+
return /* @__PURE__ */ React13.createElement(ItemColumnWrapper, { key: index, isVisible }, child);
|
|
863
832
|
})
|
|
864
833
|
));
|
|
865
834
|
}
|
|
@@ -874,11 +843,11 @@ function ItemColumnWrapper({
|
|
|
874
843
|
...props
|
|
875
844
|
}) {
|
|
876
845
|
const styles = useSpring({ opacity: isVisible ? 1 : 0 });
|
|
877
|
-
return /* @__PURE__ */
|
|
846
|
+
return /* @__PURE__ */ React13.createElement(ItemColumnWrapperStyled, { style: styles, ...props }, children);
|
|
878
847
|
}
|
|
879
848
|
|
|
880
849
|
// src/components/HorizontalList.tsx
|
|
881
|
-
import
|
|
850
|
+
import React14 from "react";
|
|
882
851
|
import { animated as animated2, useSpring as useSpring2 } from "react-spring";
|
|
883
852
|
import { Stepper as Stepper3 } from "spectacle";
|
|
884
853
|
import styled9 from "styled-components";
|
|
@@ -890,8 +859,8 @@ function HorizontalList({
|
|
|
890
859
|
children,
|
|
891
860
|
columns = 3
|
|
892
861
|
}) {
|
|
893
|
-
const items =
|
|
894
|
-
return /* @__PURE__ */
|
|
862
|
+
const items = React14.Children.toArray(children);
|
|
863
|
+
return /* @__PURE__ */ React14.createElement(Stepper3, { values: items }, (_, step) => /* @__PURE__ */ React14.createElement(
|
|
895
864
|
Container,
|
|
896
865
|
{
|
|
897
866
|
style: {
|
|
@@ -899,10 +868,10 @@ function HorizontalList({
|
|
|
899
868
|
}
|
|
900
869
|
},
|
|
901
870
|
items.map((item, k) => {
|
|
902
|
-
if (!
|
|
871
|
+
if (!React14.isValidElement(item)) {
|
|
903
872
|
return item;
|
|
904
873
|
}
|
|
905
|
-
return
|
|
874
|
+
return React14.cloneElement(item, {
|
|
906
875
|
// @ts-expect-error cloning
|
|
907
876
|
position: k + 1,
|
|
908
877
|
isVisible: k <= step,
|
|
@@ -912,12 +881,12 @@ function HorizontalList({
|
|
|
912
881
|
));
|
|
913
882
|
}
|
|
914
883
|
function Pill({ position }) {
|
|
915
|
-
return /* @__PURE__ */
|
|
884
|
+
return /* @__PURE__ */ React14.createElement(
|
|
916
885
|
"div",
|
|
917
886
|
{
|
|
918
887
|
style: { width: 48, transform: "translate(-25%, -25%)", opacity: 0.9 }
|
|
919
888
|
},
|
|
920
|
-
/* @__PURE__ */
|
|
889
|
+
/* @__PURE__ */ React14.createElement(
|
|
921
890
|
"svg",
|
|
922
891
|
{
|
|
923
892
|
width: "48",
|
|
@@ -926,14 +895,14 @@ function Pill({ position }) {
|
|
|
926
895
|
fill: "none",
|
|
927
896
|
xmlns: "http://www.w3.org/2000/svg"
|
|
928
897
|
},
|
|
929
|
-
/* @__PURE__ */
|
|
898
|
+
/* @__PURE__ */ React14.createElement(
|
|
930
899
|
"path",
|
|
931
900
|
{
|
|
932
901
|
d: "M8.64717 20L0 15.0094V5.00134L8.64717 0L17.289 5.00134V15.0094L8.64717 20ZM1.48222 14.141L8.64717 18.2846L15.8068 14.141V5.85902L8.64717 1.71536L1.48222 5.85902V14.141Z",
|
|
933
902
|
fill: "#ffffff"
|
|
934
903
|
}
|
|
935
904
|
),
|
|
936
|
-
/* @__PURE__ */
|
|
905
|
+
/* @__PURE__ */ React14.createElement(
|
|
937
906
|
"text",
|
|
938
907
|
{
|
|
939
908
|
x: "9",
|
|
@@ -945,7 +914,7 @@ function Pill({ position }) {
|
|
|
945
914
|
},
|
|
946
915
|
position
|
|
947
916
|
),
|
|
948
|
-
/* @__PURE__ */
|
|
917
|
+
/* @__PURE__ */ React14.createElement(
|
|
949
918
|
"path",
|
|
950
919
|
{
|
|
951
920
|
d: "M 8.758 16.01 L 3.549 13.004 L 3.549 6.975 L 8.758 3.963 L 13.964 6.975 L 13.964 13.004 L 8.758 16.01 Z",
|
|
@@ -998,11 +967,11 @@ function HorizontalListItem({
|
|
|
998
967
|
const opacityStyles = useSpring2({
|
|
999
968
|
opacity: getItemOpacity({ isVisible, isLast })
|
|
1000
969
|
});
|
|
1001
|
-
return /* @__PURE__ */
|
|
970
|
+
return /* @__PURE__ */ React14.createElement(Item, { style: opacityStyles }, /* @__PURE__ */ React14.createElement(ItemHead, null, /* @__PURE__ */ React14.createElement(Pill, { position }), /* @__PURE__ */ React14.createElement("p", null, title)), /* @__PURE__ */ React14.createElement(ItemContent, null, children));
|
|
1002
971
|
}
|
|
1003
972
|
|
|
1004
973
|
// src/components/Timeline.tsx
|
|
1005
|
-
import
|
|
974
|
+
import React15 from "react";
|
|
1006
975
|
import { animated as animated3, useSpring as useSpring3 } from "react-spring";
|
|
1007
976
|
import classnames from "classnames";
|
|
1008
977
|
import { Stepper as Stepper4 } from "spectacle";
|
|
@@ -1012,13 +981,13 @@ var Timeline_module_default = {};
|
|
|
1012
981
|
|
|
1013
982
|
// src/components/Timeline.tsx
|
|
1014
983
|
function Timeline(props) {
|
|
1015
|
-
const children =
|
|
1016
|
-
return /* @__PURE__ */
|
|
984
|
+
const children = React15.Children.toArray(props.children);
|
|
985
|
+
return /* @__PURE__ */ React15.createElement(Stepper4, { ...props, values: children, className: Timeline_module_default["timeline"] }, (value, step) => {
|
|
1017
986
|
return children.map((child, index) => {
|
|
1018
|
-
if (!
|
|
987
|
+
if (!React15.isValidElement(child)) {
|
|
1019
988
|
return child;
|
|
1020
989
|
}
|
|
1021
|
-
return
|
|
990
|
+
return React15.cloneElement(child, {
|
|
1022
991
|
// @ts-expect-error cloning
|
|
1023
992
|
isPhantom: step < index,
|
|
1024
993
|
isLast: step === index
|
|
@@ -1045,7 +1014,7 @@ function TimelineItem(props) {
|
|
|
1045
1014
|
opacity: getItemOpacity2({ isPhantom, isLast })
|
|
1046
1015
|
});
|
|
1047
1016
|
const colorStyles = useSpring3({ opacity: isPhantom || isLast ? 1 : 0.15 });
|
|
1048
|
-
return /* @__PURE__ */
|
|
1017
|
+
return /* @__PURE__ */ React15.createElement(
|
|
1049
1018
|
animated3.div,
|
|
1050
1019
|
{
|
|
1051
1020
|
...rest,
|
|
@@ -1054,7 +1023,7 @@ function TimelineItem(props) {
|
|
|
1054
1023
|
...appearStyles
|
|
1055
1024
|
}
|
|
1056
1025
|
},
|
|
1057
|
-
/* @__PURE__ */
|
|
1026
|
+
/* @__PURE__ */ React15.createElement(
|
|
1058
1027
|
"div",
|
|
1059
1028
|
{
|
|
1060
1029
|
className: classnames(
|
|
@@ -1062,21 +1031,21 @@ function TimelineItem(props) {
|
|
|
1062
1031
|
Timeline_module_default["timelineItemContentPhantom"]
|
|
1063
1032
|
)
|
|
1064
1033
|
},
|
|
1065
|
-
/* @__PURE__ */
|
|
1066
|
-
/* @__PURE__ */
|
|
1034
|
+
/* @__PURE__ */ React15.createElement("div", { className: Timeline_module_default["timelineItemTitle"] }, title),
|
|
1035
|
+
/* @__PURE__ */ React15.createElement("div", { className: Timeline_module_default["timelineItemBody"] }, children)
|
|
1067
1036
|
),
|
|
1068
|
-
/* @__PURE__ */
|
|
1037
|
+
/* @__PURE__ */ React15.createElement(animated3.div, { className: Timeline_module_default["timelineItemGuide"], style: colorStyles }, /* @__PURE__ */ React15.createElement(Hexagon, null), /* @__PURE__ */ React15.createElement(
|
|
1069
1038
|
animated3.div,
|
|
1070
1039
|
{
|
|
1071
1040
|
className: Timeline_module_default["timelineItemGuideLine"],
|
|
1072
1041
|
style: guideLineProps
|
|
1073
1042
|
}
|
|
1074
1043
|
)),
|
|
1075
|
-
/* @__PURE__ */
|
|
1044
|
+
/* @__PURE__ */ React15.createElement("div", { className: Timeline_module_default["timelineItemContent"] }, /* @__PURE__ */ React15.createElement("div", { className: Timeline_module_default["timelineItemTitle"] }, title), /* @__PURE__ */ React15.createElement("div", { className: Timeline_module_default["timelineItemBody"] }, children))
|
|
1076
1045
|
);
|
|
1077
1046
|
}
|
|
1078
1047
|
function Hexagon() {
|
|
1079
|
-
return /* @__PURE__ */
|
|
1048
|
+
return /* @__PURE__ */ React15.createElement(
|
|
1080
1049
|
"svg",
|
|
1081
1050
|
{
|
|
1082
1051
|
width: "18",
|
|
@@ -1085,14 +1054,14 @@ function Hexagon() {
|
|
|
1085
1054
|
fill: "none",
|
|
1086
1055
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1087
1056
|
},
|
|
1088
|
-
/* @__PURE__ */
|
|
1057
|
+
/* @__PURE__ */ React15.createElement(
|
|
1089
1058
|
"path",
|
|
1090
1059
|
{
|
|
1091
1060
|
d: "M8.64717 20L0 15.0094V5.00134L8.64717 0L17.289 5.00134V15.0094L8.64717 20ZM1.48222 14.141L8.64717 18.2846L15.8068 14.141V5.85902L8.64717 1.71536L1.48222 5.85902V14.141Z",
|
|
1092
1061
|
fill: "#F49676"
|
|
1093
1062
|
}
|
|
1094
1063
|
),
|
|
1095
|
-
/* @__PURE__ */
|
|
1064
|
+
/* @__PURE__ */ React15.createElement(
|
|
1096
1065
|
"path",
|
|
1097
1066
|
{
|
|
1098
1067
|
d: "M 8.758 16.01 L 3.549 13.004 L 3.549 6.975 L 8.758 3.963 L 13.964 6.975 L 13.964 13.004 L 8.758 16.01 Z",
|
|
@@ -1103,7 +1072,7 @@ function Hexagon() {
|
|
|
1103
1072
|
}
|
|
1104
1073
|
|
|
1105
1074
|
// src/components/IconBox.tsx
|
|
1106
|
-
import
|
|
1075
|
+
import React16 from "react";
|
|
1107
1076
|
import styled10 from "styled-components";
|
|
1108
1077
|
var IconBoxContent = styled10.div`
|
|
1109
1078
|
* {
|
|
@@ -1115,7 +1084,7 @@ function IconBox({
|
|
|
1115
1084
|
children,
|
|
1116
1085
|
icon
|
|
1117
1086
|
}) {
|
|
1118
|
-
return /* @__PURE__ */
|
|
1087
|
+
return /* @__PURE__ */ React16.createElement(
|
|
1119
1088
|
"div",
|
|
1120
1089
|
{
|
|
1121
1090
|
style: {
|
|
@@ -1125,14 +1094,14 @@ function IconBox({
|
|
|
1125
1094
|
padding: "1rem 0"
|
|
1126
1095
|
}
|
|
1127
1096
|
},
|
|
1128
|
-
/* @__PURE__ */
|
|
1129
|
-
/* @__PURE__ */
|
|
1097
|
+
/* @__PURE__ */ React16.createElement("div", { style: { fontSize: 60 } }, icon),
|
|
1098
|
+
/* @__PURE__ */ React16.createElement(IconBoxContent, null, children)
|
|
1130
1099
|
);
|
|
1131
1100
|
}
|
|
1132
1101
|
|
|
1133
1102
|
// src/index.tsx
|
|
1134
1103
|
function PassThrough({ children }) {
|
|
1135
|
-
return /* @__PURE__ */
|
|
1104
|
+
return /* @__PURE__ */ React17.createElement(React17.Fragment, null, children);
|
|
1136
1105
|
}
|
|
1137
1106
|
function Layout({
|
|
1138
1107
|
children,
|
|
@@ -1144,37 +1113,37 @@ function Layout({
|
|
|
1144
1113
|
console.warn(`Layout ${layout} not found`);
|
|
1145
1114
|
}
|
|
1146
1115
|
if (Layout2) {
|
|
1147
|
-
return /* @__PURE__ */
|
|
1116
|
+
return /* @__PURE__ */ React17.createElement(Layout2, { ...frontmatter }, children);
|
|
1148
1117
|
}
|
|
1149
|
-
return /* @__PURE__ */
|
|
1118
|
+
return /* @__PURE__ */ React17.createElement(React17.Fragment, null, children);
|
|
1150
1119
|
}
|
|
1151
1120
|
var componentsMap2 = {
|
|
1152
1121
|
...map_default,
|
|
1153
1122
|
wrapper: Layout
|
|
1154
1123
|
};
|
|
1155
1124
|
function Deck({ deck }) {
|
|
1156
|
-
|
|
1125
|
+
React17.useEffect(() => {
|
|
1157
1126
|
document.title = deck.metadata.title || "Untitled";
|
|
1158
1127
|
}, [deck.metadata.title]);
|
|
1159
|
-
return /* @__PURE__ */
|
|
1128
|
+
return /* @__PURE__ */ React17.createElement(React17.StrictMode, null, /* @__PURE__ */ React17.createElement(MDXProvider, { components: componentsMap2 }, /* @__PURE__ */ React17.createElement(SpectacleDeck, { theme: theme_default, template }, deck.slides.map((slide, i) => {
|
|
1160
1129
|
const Component = slide.slideComponent;
|
|
1161
|
-
return /* @__PURE__ */
|
|
1130
|
+
return /* @__PURE__ */ React17.createElement(Slide, { key: i }, /* @__PURE__ */ React17.createElement(Component, null));
|
|
1162
1131
|
}))));
|
|
1163
1132
|
}
|
|
1164
1133
|
function Danger({ children }) {
|
|
1165
|
-
return /* @__PURE__ */
|
|
1134
|
+
return /* @__PURE__ */ React17.createElement("div", { style: { color: "red" } }, children);
|
|
1166
1135
|
}
|
|
1167
1136
|
function Doc({ children }) {
|
|
1168
|
-
return /* @__PURE__ */
|
|
1137
|
+
return /* @__PURE__ */ React17.createElement("div", { style: { color: "blue" } }, children);
|
|
1169
1138
|
}
|
|
1170
1139
|
function Information({ children }) {
|
|
1171
|
-
return /* @__PURE__ */
|
|
1140
|
+
return /* @__PURE__ */ React17.createElement("div", { style: { color: "orange" } }, children);
|
|
1172
1141
|
}
|
|
1173
1142
|
function Success({ children }) {
|
|
1174
|
-
return /* @__PURE__ */
|
|
1143
|
+
return /* @__PURE__ */ React17.createElement("div", { style: { color: "green" } }, children);
|
|
1175
1144
|
}
|
|
1176
1145
|
function Side({ children }) {
|
|
1177
|
-
return /* @__PURE__ */
|
|
1146
|
+
return /* @__PURE__ */ React17.createElement("div", null, children);
|
|
1178
1147
|
}
|
|
1179
1148
|
Side.mdxType = "Side";
|
|
1180
1149
|
export {
|