@gpichot/spectacle-deck 1.5.0 → 1.6.0
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 +43 -34
- package/index.mjs +42 -33
- package/layouts/FullImageLayout.d.ts +2 -2
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -61,8 +61,8 @@ __export(src_exports, {
|
|
|
61
61
|
noneTransition: () => noneTransition,
|
|
62
62
|
resolveTransition: () => resolveTransition
|
|
63
63
|
});
|
|
64
|
-
var
|
|
65
|
-
var
|
|
64
|
+
var import_react16 = require("@mdx-js/react");
|
|
65
|
+
var import_react17 = __toESM(require("react"));
|
|
66
66
|
var import_spectacle11 = require("spectacle");
|
|
67
67
|
var import_styled_components20 = require("styled-components");
|
|
68
68
|
|
|
@@ -528,6 +528,11 @@ var HeadingTwo = import_styled_components2.default.h2`
|
|
|
528
528
|
font-family: Bitter, \"Helvetica Neue\", Helvetica, Arial, sans-serif;
|
|
529
529
|
font-size: 55px;
|
|
530
530
|
font-weight: 400;
|
|
531
|
+
|
|
532
|
+
strong {
|
|
533
|
+
color: var(--color-secondary);
|
|
534
|
+
font-weight: 500;
|
|
535
|
+
}
|
|
531
536
|
`;
|
|
532
537
|
var HeadingThree = import_styled_components2.default.h3`
|
|
533
538
|
font-family: Bitter, \"Helvetica Neue\", Helvetica, Arial, sans-serif;
|
|
@@ -1066,6 +1071,7 @@ var Default3Layout = ({
|
|
|
1066
1071
|
};
|
|
1067
1072
|
|
|
1068
1073
|
// src/layouts/FullImageLayout.tsx
|
|
1074
|
+
var import_react7 = __toESM(require("react"));
|
|
1069
1075
|
var import_styled_components6 = __toESM(require("styled-components"));
|
|
1070
1076
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1071
1077
|
var Overlay = import_styled_components6.default.div`
|
|
@@ -1092,6 +1098,9 @@ function FullImageLayout({
|
|
|
1092
1098
|
position = "bottom",
|
|
1093
1099
|
dim = 0.4
|
|
1094
1100
|
}) {
|
|
1101
|
+
const [images, rest] = getMatchingMdxType(children, "Image");
|
|
1102
|
+
const firstImage = images[0];
|
|
1103
|
+
const backgroundImage = image || (import_react7.default.isValidElement(firstImage) ? firstImage.props.src : void 0);
|
|
1095
1104
|
const justifyMap = {
|
|
1096
1105
|
top: "flex-start",
|
|
1097
1106
|
center: "center",
|
|
@@ -1111,7 +1120,7 @@ function FullImageLayout({
|
|
|
1111
1120
|
style: {
|
|
1112
1121
|
position: "absolute",
|
|
1113
1122
|
inset: 0,
|
|
1114
|
-
backgroundImage: `url(${
|
|
1123
|
+
backgroundImage: backgroundImage ? `url(${backgroundImage})` : void 0,
|
|
1115
1124
|
backgroundSize: "cover",
|
|
1116
1125
|
backgroundPosition: "center"
|
|
1117
1126
|
}
|
|
@@ -1127,7 +1136,7 @@ function FullImageLayout({
|
|
|
1127
1136
|
}
|
|
1128
1137
|
}
|
|
1129
1138
|
),
|
|
1130
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Overlay, { style: { justifyContent: justifyMap[position] }, children })
|
|
1139
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Overlay, { style: { justifyContent: justifyMap[position] }, children: firstImage ? rest : children })
|
|
1131
1140
|
]
|
|
1132
1141
|
}
|
|
1133
1142
|
);
|
|
@@ -1281,7 +1290,7 @@ var SectionLayout = import_styled_components8.default.div`
|
|
|
1281
1290
|
var import_styled_components10 = __toESM(require("styled-components"));
|
|
1282
1291
|
|
|
1283
1292
|
// src/layouts/columns.tsx
|
|
1284
|
-
var
|
|
1293
|
+
var import_react8 = __toESM(require("react"));
|
|
1285
1294
|
var import_styled_components9 = __toESM(require("styled-components"));
|
|
1286
1295
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1287
1296
|
var DivWithHeading = import_styled_components9.default.div`
|
|
@@ -1307,7 +1316,7 @@ function ColumnsLayout({
|
|
|
1307
1316
|
children,
|
|
1308
1317
|
reverse
|
|
1309
1318
|
}) {
|
|
1310
|
-
const childrenArray =
|
|
1319
|
+
const childrenArray = import_react8.default.Children.toArray(children);
|
|
1311
1320
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1312
1321
|
ColumnsContainer,
|
|
1313
1322
|
{
|
|
@@ -1636,11 +1645,11 @@ __reExport(src_exports, require("spectacle"));
|
|
|
1636
1645
|
var import_web = require("@react-spring/web");
|
|
1637
1646
|
|
|
1638
1647
|
// src/components/animations/useInView.ts
|
|
1639
|
-
var
|
|
1648
|
+
var import_react9 = __toESM(require("react"));
|
|
1640
1649
|
function useInView() {
|
|
1641
|
-
const ref =
|
|
1642
|
-
const [isInView, setIsInView] =
|
|
1643
|
-
|
|
1650
|
+
const ref = import_react9.default.useRef(null);
|
|
1651
|
+
const [isInView, setIsInView] = import_react9.default.useState(false);
|
|
1652
|
+
import_react9.default.useEffect(() => {
|
|
1644
1653
|
const el = ref.current;
|
|
1645
1654
|
if (!el) return;
|
|
1646
1655
|
const observer = new IntersectionObserver(
|
|
@@ -1838,7 +1847,7 @@ function Spotlight({
|
|
|
1838
1847
|
|
|
1839
1848
|
// src/components/animations/StaggerChildren.tsx
|
|
1840
1849
|
var import_web5 = require("@react-spring/web");
|
|
1841
|
-
var
|
|
1850
|
+
var import_react10 = __toESM(require("react"));
|
|
1842
1851
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1843
1852
|
function StaggerChildren({
|
|
1844
1853
|
children,
|
|
@@ -1849,7 +1858,7 @@ function StaggerChildren({
|
|
|
1849
1858
|
distance = 20
|
|
1850
1859
|
}) {
|
|
1851
1860
|
const [ref, isInView] = useInView();
|
|
1852
|
-
const items =
|
|
1861
|
+
const items = import_react10.default.Children.toArray(children);
|
|
1853
1862
|
const translateMap = {
|
|
1854
1863
|
up: `translateY(${distance}px)`,
|
|
1855
1864
|
down: `translateY(-${distance}px)`,
|
|
@@ -1870,14 +1879,14 @@ function StaggerChildren({
|
|
|
1870
1879
|
}
|
|
1871
1880
|
|
|
1872
1881
|
// src/components/animations/TypeWriter.tsx
|
|
1873
|
-
var
|
|
1882
|
+
var import_react11 = __toESM(require("react"));
|
|
1874
1883
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1875
1884
|
function extractText(node) {
|
|
1876
1885
|
if (typeof node === "string") return node;
|
|
1877
1886
|
if (typeof node === "number") return String(node);
|
|
1878
1887
|
if (!node) return "";
|
|
1879
1888
|
if (Array.isArray(node)) return node.map(extractText).join("");
|
|
1880
|
-
if (
|
|
1889
|
+
if (import_react11.default.isValidElement(node)) {
|
|
1881
1890
|
const props = node.props;
|
|
1882
1891
|
return extractText(props.children);
|
|
1883
1892
|
}
|
|
@@ -1891,9 +1900,9 @@ function TypeWriter({
|
|
|
1891
1900
|
}) {
|
|
1892
1901
|
const text = extractText(children);
|
|
1893
1902
|
const [ref, isInView] = useInView();
|
|
1894
|
-
const [displayed, setDisplayed] =
|
|
1895
|
-
const [done, setDone] =
|
|
1896
|
-
|
|
1903
|
+
const [displayed, setDisplayed] = import_react11.default.useState("");
|
|
1904
|
+
const [done, setDone] = import_react11.default.useState(false);
|
|
1905
|
+
import_react11.default.useEffect(() => {
|
|
1897
1906
|
if (!isInView) return;
|
|
1898
1907
|
let index = 0;
|
|
1899
1908
|
setDisplayed("");
|
|
@@ -1992,14 +2001,14 @@ function DocItem({ label, link }) {
|
|
|
1992
2001
|
}
|
|
1993
2002
|
|
|
1994
2003
|
// src/components/FilePane.tsx
|
|
1995
|
-
var
|
|
2004
|
+
var import_react12 = __toESM(require("react"));
|
|
1996
2005
|
function FilePane({
|
|
1997
2006
|
name,
|
|
1998
2007
|
children,
|
|
1999
2008
|
priority,
|
|
2000
2009
|
...divProps
|
|
2001
2010
|
}) {
|
|
2002
|
-
return
|
|
2011
|
+
return import_react12.default.isValidElement(children) ? import_react12.default.cloneElement(children, {
|
|
2003
2012
|
// @ts-expect-error cloning
|
|
2004
2013
|
priority,
|
|
2005
2014
|
name
|
|
@@ -2009,7 +2018,7 @@ FilePane.mdxType = "FilePane";
|
|
|
2009
2018
|
|
|
2010
2019
|
// src/components/HorizontalList.tsx
|
|
2011
2020
|
var import_web6 = require("@react-spring/web");
|
|
2012
|
-
var
|
|
2021
|
+
var import_react13 = __toESM(require("react"));
|
|
2013
2022
|
var import_spectacle8 = require("spectacle");
|
|
2014
2023
|
var import_styled_components15 = __toESM(require("styled-components"));
|
|
2015
2024
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
@@ -2021,7 +2030,7 @@ function HorizontalList({
|
|
|
2021
2030
|
children,
|
|
2022
2031
|
columns = 3
|
|
2023
2032
|
}) {
|
|
2024
|
-
const items =
|
|
2033
|
+
const items = import_react13.default.Children.toArray(children);
|
|
2025
2034
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_spectacle8.Stepper, { values: items, children: (_, step) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2026
2035
|
Container,
|
|
2027
2036
|
{
|
|
@@ -2029,10 +2038,10 @@ function HorizontalList({
|
|
|
2029
2038
|
gridTemplateColumns: `repeat(${columns}, 1fr)`
|
|
2030
2039
|
},
|
|
2031
2040
|
children: items.map((item, k) => {
|
|
2032
|
-
if (!
|
|
2041
|
+
if (!import_react13.default.isValidElement(item)) {
|
|
2033
2042
|
return item;
|
|
2034
2043
|
}
|
|
2035
|
-
return
|
|
2044
|
+
return import_react13.default.cloneElement(item, {
|
|
2036
2045
|
// @ts-expect-error cloning
|
|
2037
2046
|
position: k + 1,
|
|
2038
2047
|
isVisible: k <= step,
|
|
@@ -2170,13 +2179,13 @@ function IconBox({
|
|
|
2170
2179
|
|
|
2171
2180
|
// src/components/ItemsColumn.tsx
|
|
2172
2181
|
var import_web7 = require("@react-spring/web");
|
|
2173
|
-
var
|
|
2182
|
+
var import_react14 = __toESM(require("react"));
|
|
2174
2183
|
var import_spectacle9 = require("spectacle");
|
|
2175
2184
|
var import_styled_components17 = __toESM(require("styled-components"));
|
|
2176
2185
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2177
2186
|
function ItemsColumn(divProps) {
|
|
2178
2187
|
const { style: style2, children, ...props } = divProps;
|
|
2179
|
-
const childrenArray =
|
|
2188
|
+
const childrenArray = import_react14.default.Children.toArray(children);
|
|
2180
2189
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_spectacle9.Stepper, { values: childrenArray, children: (_value, step) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2181
2190
|
"div",
|
|
2182
2191
|
{
|
|
@@ -2192,7 +2201,7 @@ function ItemsColumn(divProps) {
|
|
|
2192
2201
|
...props,
|
|
2193
2202
|
children: childrenArray.map((child, index) => {
|
|
2194
2203
|
const isVisible = index <= step;
|
|
2195
|
-
if (!
|
|
2204
|
+
if (!import_react14.default.isValidElement(child)) {
|
|
2196
2205
|
return child;
|
|
2197
2206
|
}
|
|
2198
2207
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ItemColumnWrapper, { isVisible, children: child }, index);
|
|
@@ -2218,7 +2227,7 @@ function ItemColumnWrapper({
|
|
|
2218
2227
|
|
|
2219
2228
|
// src/components/Timeline.tsx
|
|
2220
2229
|
var import_web8 = require("@react-spring/web");
|
|
2221
|
-
var
|
|
2230
|
+
var import_react15 = __toESM(require("react"));
|
|
2222
2231
|
var import_spectacle10 = require("spectacle");
|
|
2223
2232
|
var import_styled_components19 = __toESM(require("styled-components"));
|
|
2224
2233
|
|
|
@@ -2292,7 +2301,7 @@ var style = {
|
|
|
2292
2301
|
alignItems: "center"
|
|
2293
2302
|
};
|
|
2294
2303
|
function Timeline(props) {
|
|
2295
|
-
const children =
|
|
2304
|
+
const children = import_react15.default.Children.toArray(props.children);
|
|
2296
2305
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2297
2306
|
import_spectacle10.Stepper,
|
|
2298
2307
|
{
|
|
@@ -2302,10 +2311,10 @@ function Timeline(props) {
|
|
|
2302
2311
|
inactiveStyle: style,
|
|
2303
2312
|
children: (_value, step) => {
|
|
2304
2313
|
return children.map((child, index) => {
|
|
2305
|
-
if (!
|
|
2314
|
+
if (!import_react15.default.isValidElement(child)) {
|
|
2306
2315
|
return child;
|
|
2307
2316
|
}
|
|
2308
|
-
return
|
|
2317
|
+
return import_react15.default.cloneElement(child, {
|
|
2309
2318
|
// @ts-expect-error cloning
|
|
2310
2319
|
isPhantom: step < index,
|
|
2311
2320
|
isLast: step === index
|
|
@@ -2401,10 +2410,10 @@ function Deck({
|
|
|
2401
2410
|
layouts: layouts2 = layouts_default,
|
|
2402
2411
|
transition
|
|
2403
2412
|
}) {
|
|
2404
|
-
|
|
2413
|
+
import_react17.default.useEffect(() => {
|
|
2405
2414
|
document.title = deck.metadata.title || "Untitled";
|
|
2406
2415
|
}, [deck.metadata.title]);
|
|
2407
|
-
const mergedTheme =
|
|
2416
|
+
const mergedTheme = import_react17.default.useMemo(() => {
|
|
2408
2417
|
const fonts = {
|
|
2409
2418
|
...theme_default.fonts,
|
|
2410
2419
|
...theme.themeTokens.fonts ?? {}
|
|
@@ -2415,7 +2424,7 @@ function Deck({
|
|
|
2415
2424
|
fonts
|
|
2416
2425
|
};
|
|
2417
2426
|
}, [theme]);
|
|
2418
|
-
const GlobalStyle =
|
|
2427
|
+
const GlobalStyle = import_react17.default.useMemo(() => {
|
|
2419
2428
|
const cssVariables = createCssVariables(theme.themeTokens.colors);
|
|
2420
2429
|
return import_styled_components20.createGlobalStyle`
|
|
2421
2430
|
:root {
|
|
@@ -2424,7 +2433,7 @@ function Deck({
|
|
|
2424
2433
|
}
|
|
2425
2434
|
`;
|
|
2426
2435
|
}, [theme, mergedTheme]);
|
|
2427
|
-
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2436
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react17.default.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(PestacleProvider, { layouts: layouts2, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_react16.MDXProvider, { components: componentsMap2, children: [
|
|
2428
2437
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(GlobalStyle, {}),
|
|
2429
2438
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2430
2439
|
import_spectacle11.Deck,
|
package/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/index.tsx
|
|
2
2
|
import { MDXProvider } from "@mdx-js/react";
|
|
3
|
-
import
|
|
3
|
+
import React16 from "react";
|
|
4
4
|
import { Slide, Deck as SpectacleDeck } from "spectacle";
|
|
5
5
|
import { createGlobalStyle } from "styled-components";
|
|
6
6
|
|
|
@@ -470,6 +470,11 @@ var HeadingTwo = styled2.h2`
|
|
|
470
470
|
font-family: Bitter, \"Helvetica Neue\", Helvetica, Arial, sans-serif;
|
|
471
471
|
font-size: 55px;
|
|
472
472
|
font-weight: 400;
|
|
473
|
+
|
|
474
|
+
strong {
|
|
475
|
+
color: var(--color-secondary);
|
|
476
|
+
font-weight: 500;
|
|
477
|
+
}
|
|
473
478
|
`;
|
|
474
479
|
var HeadingThree = styled2.h3`
|
|
475
480
|
font-family: Bitter, \"Helvetica Neue\", Helvetica, Arial, sans-serif;
|
|
@@ -1008,6 +1013,7 @@ var Default3Layout = ({
|
|
|
1008
1013
|
};
|
|
1009
1014
|
|
|
1010
1015
|
// src/layouts/FullImageLayout.tsx
|
|
1016
|
+
import React7 from "react";
|
|
1011
1017
|
import styled6 from "styled-components";
|
|
1012
1018
|
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1013
1019
|
var Overlay = styled6.div`
|
|
@@ -1034,6 +1040,9 @@ function FullImageLayout({
|
|
|
1034
1040
|
position = "bottom",
|
|
1035
1041
|
dim = 0.4
|
|
1036
1042
|
}) {
|
|
1043
|
+
const [images, rest] = getMatchingMdxType(children, "Image");
|
|
1044
|
+
const firstImage = images[0];
|
|
1045
|
+
const backgroundImage = image || (React7.isValidElement(firstImage) ? firstImage.props.src : void 0);
|
|
1037
1046
|
const justifyMap = {
|
|
1038
1047
|
top: "flex-start",
|
|
1039
1048
|
center: "center",
|
|
@@ -1053,7 +1062,7 @@ function FullImageLayout({
|
|
|
1053
1062
|
style: {
|
|
1054
1063
|
position: "absolute",
|
|
1055
1064
|
inset: 0,
|
|
1056
|
-
backgroundImage: `url(${
|
|
1065
|
+
backgroundImage: backgroundImage ? `url(${backgroundImage})` : void 0,
|
|
1057
1066
|
backgroundSize: "cover",
|
|
1058
1067
|
backgroundPosition: "center"
|
|
1059
1068
|
}
|
|
@@ -1069,7 +1078,7 @@ function FullImageLayout({
|
|
|
1069
1078
|
}
|
|
1070
1079
|
}
|
|
1071
1080
|
),
|
|
1072
|
-
/* @__PURE__ */ jsx10(Overlay, { style: { justifyContent: justifyMap[position] }, children })
|
|
1081
|
+
/* @__PURE__ */ jsx10(Overlay, { style: { justifyContent: justifyMap[position] }, children: firstImage ? rest : children })
|
|
1073
1082
|
]
|
|
1074
1083
|
}
|
|
1075
1084
|
);
|
|
@@ -1223,7 +1232,7 @@ var SectionLayout = styled8.div`
|
|
|
1223
1232
|
import styled10 from "styled-components";
|
|
1224
1233
|
|
|
1225
1234
|
// src/layouts/columns.tsx
|
|
1226
|
-
import
|
|
1235
|
+
import React8 from "react";
|
|
1227
1236
|
import styled9 from "styled-components";
|
|
1228
1237
|
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1229
1238
|
var DivWithHeading = styled9.div`
|
|
@@ -1249,7 +1258,7 @@ function ColumnsLayout({
|
|
|
1249
1258
|
children,
|
|
1250
1259
|
reverse
|
|
1251
1260
|
}) {
|
|
1252
|
-
const childrenArray =
|
|
1261
|
+
const childrenArray = React8.Children.toArray(children);
|
|
1253
1262
|
return /* @__PURE__ */ jsx13(
|
|
1254
1263
|
ColumnsContainer,
|
|
1255
1264
|
{
|
|
@@ -1581,11 +1590,11 @@ export * from "spectacle";
|
|
|
1581
1590
|
import { animated, useSpring } from "@react-spring/web";
|
|
1582
1591
|
|
|
1583
1592
|
// src/components/animations/useInView.ts
|
|
1584
|
-
import
|
|
1593
|
+
import React9 from "react";
|
|
1585
1594
|
function useInView() {
|
|
1586
|
-
const ref =
|
|
1587
|
-
const [isInView, setIsInView] =
|
|
1588
|
-
|
|
1595
|
+
const ref = React9.useRef(null);
|
|
1596
|
+
const [isInView, setIsInView] = React9.useState(false);
|
|
1597
|
+
React9.useEffect(() => {
|
|
1589
1598
|
const el = ref.current;
|
|
1590
1599
|
if (!el) return;
|
|
1591
1600
|
const observer = new IntersectionObserver(
|
|
@@ -1783,7 +1792,7 @@ function Spotlight({
|
|
|
1783
1792
|
|
|
1784
1793
|
// src/components/animations/StaggerChildren.tsx
|
|
1785
1794
|
import { animated as animated5, useSprings } from "@react-spring/web";
|
|
1786
|
-
import
|
|
1795
|
+
import React10 from "react";
|
|
1787
1796
|
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1788
1797
|
function StaggerChildren({
|
|
1789
1798
|
children,
|
|
@@ -1794,7 +1803,7 @@ function StaggerChildren({
|
|
|
1794
1803
|
distance = 20
|
|
1795
1804
|
}) {
|
|
1796
1805
|
const [ref, isInView] = useInView();
|
|
1797
|
-
const items =
|
|
1806
|
+
const items = React10.Children.toArray(children);
|
|
1798
1807
|
const translateMap = {
|
|
1799
1808
|
up: `translateY(${distance}px)`,
|
|
1800
1809
|
down: `translateY(-${distance}px)`,
|
|
@@ -1815,14 +1824,14 @@ function StaggerChildren({
|
|
|
1815
1824
|
}
|
|
1816
1825
|
|
|
1817
1826
|
// src/components/animations/TypeWriter.tsx
|
|
1818
|
-
import
|
|
1827
|
+
import React11 from "react";
|
|
1819
1828
|
import { jsx as jsx26, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1820
1829
|
function extractText(node) {
|
|
1821
1830
|
if (typeof node === "string") return node;
|
|
1822
1831
|
if (typeof node === "number") return String(node);
|
|
1823
1832
|
if (!node) return "";
|
|
1824
1833
|
if (Array.isArray(node)) return node.map(extractText).join("");
|
|
1825
|
-
if (
|
|
1834
|
+
if (React11.isValidElement(node)) {
|
|
1826
1835
|
const props = node.props;
|
|
1827
1836
|
return extractText(props.children);
|
|
1828
1837
|
}
|
|
@@ -1836,9 +1845,9 @@ function TypeWriter({
|
|
|
1836
1845
|
}) {
|
|
1837
1846
|
const text = extractText(children);
|
|
1838
1847
|
const [ref, isInView] = useInView();
|
|
1839
|
-
const [displayed, setDisplayed] =
|
|
1840
|
-
const [done, setDone] =
|
|
1841
|
-
|
|
1848
|
+
const [displayed, setDisplayed] = React11.useState("");
|
|
1849
|
+
const [done, setDone] = React11.useState(false);
|
|
1850
|
+
React11.useEffect(() => {
|
|
1842
1851
|
if (!isInView) return;
|
|
1843
1852
|
let index = 0;
|
|
1844
1853
|
setDisplayed("");
|
|
@@ -1937,14 +1946,14 @@ function DocItem({ label, link }) {
|
|
|
1937
1946
|
}
|
|
1938
1947
|
|
|
1939
1948
|
// src/components/FilePane.tsx
|
|
1940
|
-
import
|
|
1949
|
+
import React12 from "react";
|
|
1941
1950
|
function FilePane({
|
|
1942
1951
|
name,
|
|
1943
1952
|
children,
|
|
1944
1953
|
priority,
|
|
1945
1954
|
...divProps
|
|
1946
1955
|
}) {
|
|
1947
|
-
return
|
|
1956
|
+
return React12.isValidElement(children) ? React12.cloneElement(children, {
|
|
1948
1957
|
// @ts-expect-error cloning
|
|
1949
1958
|
priority,
|
|
1950
1959
|
name
|
|
@@ -1954,7 +1963,7 @@ FilePane.mdxType = "FilePane";
|
|
|
1954
1963
|
|
|
1955
1964
|
// src/components/HorizontalList.tsx
|
|
1956
1965
|
import { animated as animated6, useSpring as useSpring5 } from "@react-spring/web";
|
|
1957
|
-
import
|
|
1966
|
+
import React13 from "react";
|
|
1958
1967
|
import { Stepper as Stepper2 } from "spectacle";
|
|
1959
1968
|
import styled15 from "styled-components";
|
|
1960
1969
|
import { jsx as jsx28, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
@@ -1966,7 +1975,7 @@ function HorizontalList({
|
|
|
1966
1975
|
children,
|
|
1967
1976
|
columns = 3
|
|
1968
1977
|
}) {
|
|
1969
|
-
const items =
|
|
1978
|
+
const items = React13.Children.toArray(children);
|
|
1970
1979
|
return /* @__PURE__ */ jsx28(Stepper2, { values: items, children: (_, step) => /* @__PURE__ */ jsx28(
|
|
1971
1980
|
Container,
|
|
1972
1981
|
{
|
|
@@ -1974,10 +1983,10 @@ function HorizontalList({
|
|
|
1974
1983
|
gridTemplateColumns: `repeat(${columns}, 1fr)`
|
|
1975
1984
|
},
|
|
1976
1985
|
children: items.map((item, k) => {
|
|
1977
|
-
if (!
|
|
1986
|
+
if (!React13.isValidElement(item)) {
|
|
1978
1987
|
return item;
|
|
1979
1988
|
}
|
|
1980
|
-
return
|
|
1989
|
+
return React13.cloneElement(item, {
|
|
1981
1990
|
// @ts-expect-error cloning
|
|
1982
1991
|
position: k + 1,
|
|
1983
1992
|
isVisible: k <= step,
|
|
@@ -2115,13 +2124,13 @@ function IconBox({
|
|
|
2115
2124
|
|
|
2116
2125
|
// src/components/ItemsColumn.tsx
|
|
2117
2126
|
import { animated as animated7, useSpring as useSpring6 } from "@react-spring/web";
|
|
2118
|
-
import
|
|
2127
|
+
import React14 from "react";
|
|
2119
2128
|
import { Stepper as Stepper3 } from "spectacle";
|
|
2120
2129
|
import styled17 from "styled-components";
|
|
2121
2130
|
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
2122
2131
|
function ItemsColumn(divProps) {
|
|
2123
2132
|
const { style: style2, children, ...props } = divProps;
|
|
2124
|
-
const childrenArray =
|
|
2133
|
+
const childrenArray = React14.Children.toArray(children);
|
|
2125
2134
|
return /* @__PURE__ */ jsx30(Stepper3, { values: childrenArray, children: (_value, step) => /* @__PURE__ */ jsx30(
|
|
2126
2135
|
"div",
|
|
2127
2136
|
{
|
|
@@ -2137,7 +2146,7 @@ function ItemsColumn(divProps) {
|
|
|
2137
2146
|
...props,
|
|
2138
2147
|
children: childrenArray.map((child, index) => {
|
|
2139
2148
|
const isVisible = index <= step;
|
|
2140
|
-
if (!
|
|
2149
|
+
if (!React14.isValidElement(child)) {
|
|
2141
2150
|
return child;
|
|
2142
2151
|
}
|
|
2143
2152
|
return /* @__PURE__ */ jsx30(ItemColumnWrapper, { isVisible, children: child }, index);
|
|
@@ -2163,7 +2172,7 @@ function ItemColumnWrapper({
|
|
|
2163
2172
|
|
|
2164
2173
|
// src/components/Timeline.tsx
|
|
2165
2174
|
import { animated as animated8, useSpring as useSpring7 } from "@react-spring/web";
|
|
2166
|
-
import
|
|
2175
|
+
import React15 from "react";
|
|
2167
2176
|
import { Stepper as Stepper4 } from "spectacle";
|
|
2168
2177
|
import styled19 from "styled-components";
|
|
2169
2178
|
|
|
@@ -2237,7 +2246,7 @@ var style = {
|
|
|
2237
2246
|
alignItems: "center"
|
|
2238
2247
|
};
|
|
2239
2248
|
function Timeline(props) {
|
|
2240
|
-
const children =
|
|
2249
|
+
const children = React15.Children.toArray(props.children);
|
|
2241
2250
|
return /* @__PURE__ */ jsx31(
|
|
2242
2251
|
Stepper4,
|
|
2243
2252
|
{
|
|
@@ -2247,10 +2256,10 @@ function Timeline(props) {
|
|
|
2247
2256
|
inactiveStyle: style,
|
|
2248
2257
|
children: (_value, step) => {
|
|
2249
2258
|
return children.map((child, index) => {
|
|
2250
|
-
if (!
|
|
2259
|
+
if (!React15.isValidElement(child)) {
|
|
2251
2260
|
return child;
|
|
2252
2261
|
}
|
|
2253
|
-
return
|
|
2262
|
+
return React15.cloneElement(child, {
|
|
2254
2263
|
// @ts-expect-error cloning
|
|
2255
2264
|
isPhantom: step < index,
|
|
2256
2265
|
isLast: step === index
|
|
@@ -2346,10 +2355,10 @@ function Deck({
|
|
|
2346
2355
|
layouts: layouts2 = layouts_default,
|
|
2347
2356
|
transition
|
|
2348
2357
|
}) {
|
|
2349
|
-
|
|
2358
|
+
React16.useEffect(() => {
|
|
2350
2359
|
document.title = deck.metadata.title || "Untitled";
|
|
2351
2360
|
}, [deck.metadata.title]);
|
|
2352
|
-
const mergedTheme =
|
|
2361
|
+
const mergedTheme = React16.useMemo(() => {
|
|
2353
2362
|
const fonts = {
|
|
2354
2363
|
...theme_default.fonts,
|
|
2355
2364
|
...theme.themeTokens.fonts ?? {}
|
|
@@ -2360,7 +2369,7 @@ function Deck({
|
|
|
2360
2369
|
fonts
|
|
2361
2370
|
};
|
|
2362
2371
|
}, [theme]);
|
|
2363
|
-
const GlobalStyle =
|
|
2372
|
+
const GlobalStyle = React16.useMemo(() => {
|
|
2364
2373
|
const cssVariables = createCssVariables(theme.themeTokens.colors);
|
|
2365
2374
|
return createGlobalStyle`
|
|
2366
2375
|
:root {
|
|
@@ -2369,7 +2378,7 @@ function Deck({
|
|
|
2369
2378
|
}
|
|
2370
2379
|
`;
|
|
2371
2380
|
}, [theme, mergedTheme]);
|
|
2372
|
-
return /* @__PURE__ */ jsx32(
|
|
2381
|
+
return /* @__PURE__ */ jsx32(React16.StrictMode, { children: /* @__PURE__ */ jsx32(PestacleProvider, { layouts: layouts2, children: /* @__PURE__ */ jsxs22(MDXProvider, { components: componentsMap2, children: [
|
|
2373
2382
|
/* @__PURE__ */ jsx32(GlobalStyle, {}),
|
|
2374
2383
|
/* @__PURE__ */ jsx32(
|
|
2375
2384
|
SpectacleDeck,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
2
|
export declare function FullImageLayout({ children, image, position, dim, }: {
|
|
3
3
|
children: React.ReactNode;
|
|
4
|
-
image
|
|
4
|
+
image?: string;
|
|
5
5
|
position?: "center" | "bottom" | "top";
|
|
6
6
|
dim?: number;
|
|
7
7
|
}): import("react/jsx-runtime").JSX.Element;
|