@gpichot/spectacle-deck 1.1.1 → 1.1.2

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.
Files changed (65) hide show
  1. package/package.json +16 -20
  2. package/dist/package.json +0 -30
  3. package/scripts/bundle.ts +0 -84
  4. package/src/components/CodeStepper/CodeStepper.tsx +0 -223
  5. package/src/components/CodeStepper/code-directives.test.ts +0 -58
  6. package/src/components/CodeStepper/code-directives.ts +0 -129
  7. package/src/components/DocumentationItem.tsx +0 -85
  8. package/src/components/FilePane.tsx +0 -18
  9. package/src/components/HorizontalList.tsx +0 -140
  10. package/src/components/IconBox.tsx +0 -31
  11. package/src/components/Image.tsx +0 -34
  12. package/src/components/ItemsColumn.tsx +0 -56
  13. package/src/components/Timeline.styled.tsx +0 -24
  14. package/src/components/Timeline.tsx +0 -159
  15. package/src/components/map.tsx +0 -115
  16. package/src/components/styled.tsx +0 -73
  17. package/src/front.png +0 -0
  18. package/src/index.tsx +0 -109
  19. package/src/layouts/CenteredLayout.tsx +0 -40
  20. package/src/layouts/Default3Layout.tsx +0 -159
  21. package/src/layouts/MainSectionLayout.tsx +0 -31
  22. package/src/layouts/QuoteLayout.tsx +0 -99
  23. package/src/layouts/SectionLayout.tsx +0 -14
  24. package/src/layouts/SideCodeLayout.tsx +0 -44
  25. package/src/layouts/SideImageLayout.tsx +0 -72
  26. package/src/layouts/SideLayout.tsx +0 -31
  27. package/src/layouts/columns.tsx +0 -56
  28. package/src/layouts/index.tsx +0 -19
  29. package/src/layouts/styled.ts +0 -7
  30. package/src/layouts/utils.ts +0 -65
  31. package/src/node.d.ts +0 -5
  32. package/src/style.d.ts +0 -10
  33. package/src/template.tsx +0 -25
  34. package/src/theme.ts +0 -24
  35. package/test.js +0 -106
  36. package/tsconfig.json +0 -29
  37. /package/{dist/components → components}/CodeStepper/CodeStepper.d.ts +0 -0
  38. /package/{dist/components → components}/CodeStepper/code-directives.d.ts +0 -0
  39. /package/{dist/components → components}/DocumentationItem.d.ts +0 -0
  40. /package/{dist/components → components}/FilePane.d.ts +0 -0
  41. /package/{dist/components → components}/HorizontalList.d.ts +0 -0
  42. /package/{dist/components → components}/IconBox.d.ts +0 -0
  43. /package/{dist/components → components}/Image.d.ts +0 -0
  44. /package/{dist/components → components}/ItemsColumn.d.ts +0 -0
  45. /package/{dist/components → components}/Timeline.d.ts +0 -0
  46. /package/{dist/components → components}/Timeline.styled.d.ts +0 -0
  47. /package/{dist/components → components}/map.d.ts +0 -0
  48. /package/{dist/components → components}/styled.d.ts +0 -0
  49. /package/{dist/index.cjs → index.cjs} +0 -0
  50. /package/{dist/index.d.ts → index.d.ts} +0 -0
  51. /package/{dist/index.mjs → index.mjs} +0 -0
  52. /package/{dist/layouts → layouts}/CenteredLayout.d.ts +0 -0
  53. /package/{dist/layouts → layouts}/Default3Layout.d.ts +0 -0
  54. /package/{dist/layouts → layouts}/MainSectionLayout.d.ts +0 -0
  55. /package/{dist/layouts → layouts}/QuoteLayout.d.ts +0 -0
  56. /package/{dist/layouts → layouts}/SectionLayout.d.ts +0 -0
  57. /package/{dist/layouts → layouts}/SideCodeLayout.d.ts +0 -0
  58. /package/{dist/layouts → layouts}/SideImageLayout.d.ts +0 -0
  59. /package/{dist/layouts → layouts}/SideLayout.d.ts +0 -0
  60. /package/{dist/layouts → layouts}/columns.d.ts +0 -0
  61. /package/{dist/layouts → layouts}/index.d.ts +0 -0
  62. /package/{dist/layouts → layouts}/styled.d.ts +0 -0
  63. /package/{dist/layouts → layouts}/utils.d.ts +0 -0
  64. /package/{dist/template.d.ts → template.d.ts} +0 -0
  65. /package/{dist/theme.d.ts → theme.d.ts} +0 -0
@@ -1,65 +0,0 @@
1
- import React from "react";
2
-
3
- export const Margins = {
4
- vertical: "4rem",
5
- horizontal: "7rem",
6
- horizontalInternal: "2rem",
7
- };
8
-
9
- export function getHeading(children: React.ReactNode) {
10
- const allChild = React.Children.toArray(children);
11
- if (allChild.length === 0) return [null, allChild];
12
- const [candidate, ...rest] = allChild;
13
- if (!React.isValidElement(candidate)) return [null, allChild];
14
- if (["h2", "h3"].includes(candidate.props.originalType)) {
15
- return [candidate, rest];
16
- }
17
- return [null, allChild];
18
- }
19
-
20
- export function getCode(children: React.ReactNode) {
21
- const allChild = React.Children.toArray(children);
22
-
23
- if (allChild.length === 0) return [null, allChild];
24
-
25
- const index = allChild.findIndex((child) => {
26
- if (!React.isValidElement(child)) return false;
27
- return child.props.originalType === "pre";
28
- });
29
-
30
- if (index === -1) return [null, allChild];
31
-
32
- const candidate = allChild[index];
33
- const rest = allChild.filter((_, i) => i !== index);
34
- return [candidate, rest];
35
- }
36
-
37
- export function getMatchingMdxType(children: React.ReactNode, mdxType: string) {
38
- const allChild = React.Children.toArray(children);
39
-
40
- const matchFn = (child: React.ReactNode) => {
41
- if (!React.isValidElement(child)) return false;
42
- if (typeof child.type !== "function") return false;
43
- if ("mdxType" in child.type === false) return false;
44
-
45
- return child.type.mdxType === mdxType;
46
- };
47
-
48
- const matches = allChild.filter(matchFn);
49
-
50
- const rest = allChild.filter((child) => !matchFn(child));
51
-
52
- return [matches, rest];
53
- }
54
-
55
- export function getCodeChildren(children: React.ReactNode) {
56
- const [code, rest] = getCode(children);
57
- if (code) return [code, rest];
58
-
59
- const [codeStepper, rest2] = getMatchingMdxType(children, "CodeStepper");
60
- if (codeStepper.length > 0) return [codeStepper, rest2];
61
-
62
- const [codes, rest3] = getMatchingMdxType(children, "FilePane");
63
-
64
- return [codes, rest3];
65
- }
package/src/node.d.ts DELETED
@@ -1,5 +0,0 @@
1
- interface ImportMeta {
2
- env: {
3
- DEV: boolean;
4
- };
5
- }
package/src/style.d.ts DELETED
@@ -1,10 +0,0 @@
1
- // Typings for .module.scss
2
- declare module "*.module.scss" {
3
- const content: { [className: string]: string };
4
- export default content;
5
- }
6
-
7
- declare module "*.png" {
8
- const content: any;
9
- export default content;
10
- }
package/src/template.tsx DELETED
@@ -1,25 +0,0 @@
1
- import React from "react";
2
-
3
- import { Box, FullScreen } from "spectacle";
4
-
5
- export const template = ({ slideNumber, numberOfSlides }) => {
6
- const percentage = (slideNumber / numberOfSlides) * 100;
7
- return (
8
- <div style={{ position: "absolute", bottom: 0, left: 0, right: 0 }}>
9
- <Box padding="0 0 0.5em 0.7em">
10
- <FullScreen />
11
- </Box>
12
-
13
- <div style={{ width: "100%", height: "4px", background: "#ffffff11" }}>
14
- <div
15
- style={{
16
- width: `${percentage}%`,
17
- height: "2px",
18
- background: "#ffffff77",
19
- transition: "width 0.3s ease",
20
- }}
21
- />
22
- </div>
23
- </div>
24
- );
25
- };
package/src/theme.ts DELETED
@@ -1,24 +0,0 @@
1
- import "@fontsource/bitter/300.css";
2
- import "@fontsource/bitter/400.css";
3
- import "@fontsource/bitter/500.css";
4
- import "@fontsource/bitter/700.css";
5
-
6
- export default {
7
- colors: {
8
- primary: "white",
9
- secondary: "#F49676",
10
- tertiary: "#042F3B",
11
- },
12
- fonts: {
13
- header: 'Bitter, "Helvetica Neue", Helvetica, Arial, sans-serif',
14
- text: 'Bitter, "Helvetica Neue", Helvetica, Arial, sans-serif',
15
- },
16
- fontSizes: {
17
- h1: "48px",
18
- h2: "32px",
19
- h3: "24px",
20
- text: "24px",
21
- monospace: "16px",
22
- },
23
- space: [8, 16, 24],
24
- };
package/test.js DELETED
@@ -1,106 +0,0 @@
1
- import { Timeline, TimelineItem } from "@gpichot/spectacle-deck";
2
-
3
-
4
- import React from 'react';
5
- import {Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs} from "react/jsx-runtime";import {useMDXComponents as _provideComponents} from "@mdx-js/react"
6
-
7
- export default {
8
- metadata: {"author":"Gabriel"},
9
- slides: [{
10
- metadata: {"layout":"mainSection"},
11
- slideComponent: (baseProps) => {
12
- const props = {...baseProps, frontmatter: {"layout":"mainSection"} };
13
- const _components = {
14
- h1: "h1",
15
- strong: "strong",
16
- ..._provideComponents(),
17
- ...props.components
18
- };
19
- const {wrapper: MDXLayout} = _components;
20
- return _jsxs(_components.h1, {
21
- children: ["Hello, ", _jsx(_components.strong, {
22
- children: "world!"
23
- })]
24
- })});
25
- }
26
- },{
27
- metadata: {"layout":"centered"},
28
- slideComponent: (baseProps) => {
29
- const props = {...baseProps, frontmatter: {"layout":"centered"} };
30
- const _components = {
31
- h3: "h3",
32
- p: "p",
33
- strong: "strong",
34
- ..._provideComponents(),
35
- ...props.components
36
- };
37
- const {wrapper: MDXLayout} = _components;
38
- return _jsx(MDXLayout, {...props,
39
- children: [_jsx(_components.h3, {
40
- children: _jsx(_components.strong, {
41
- children: "History"
42
- })
43
- }), "\n", _jsxs(Timeline, {
44
- children: [_jsx(TimelineItem, {
45
- title: "2011",
46
- children: _jsx(_components.p, {
47
- children: "Created by Jordan Walke, a software engineer at Facebook."
48
- })
49
- }), _jsx(TimelineItem, {
50
- title: "May 2013",
51
- children: _jsxs(_components.p, {
52
- children: ["⚛️ ", _jsx(_components.strong, {
53
- children: "React"
54
- }), " is open sourced."]
55
- })
56
- }), _jsx(TimelineItem, {
57
- title: "March 2015",
58
- children: _jsx(_components.p, {
59
- children: "📱 React Native"
60
- })
61
- }), _jsx(TimelineItem, {
62
- title: "Feb 2019",
63
- children: _jsxs(_components.p, {
64
- children: [_jsx(_components.strong, {
65
- children: "v16.8:"
66
- }), " React Hooks 🤘"]
67
- })
68
- }), _jsx(TimelineItem, {
69
- title: "Oct 2020",
70
- children: _jsxs(_components.p, {
71
- children: [_jsx(_components.strong, {
72
- children: "v17"
73
- }), ": 🤷‍♂️"]
74
- })
75
- }), _jsx(TimelineItem, {
76
- title: "March 2022",
77
- children: _jsxs(_components.p, {
78
- children: [_jsx(_components.strong, {
79
- children: "v18:"
80
- }), " Concurrent React"]
81
- })
82
- })]
83
- })]
84
- });
85
- }
86
- },{
87
- metadata: null,
88
- slideComponent: (baseProps) => {
89
- const props = {...baseProps, frontmatter: null };
90
- const _components = {
91
- code: "code",
92
- pre: "pre",
93
- ..._provideComponents(),
94
- ...props.components
95
- };
96
- const {wrapper: MDXLayout} = _components;
97
- return _jsx(MDXLayout, {...props, children: _jsx(_components.pre, {
98
- children: _jsx(_components.code, {
99
- className: "language-jsx",
100
- children: "export default () => <div>Hello, world!</div>;\n"
101
- })
102
- })});
103
- }
104
- }
105
- ]
106
- };
package/tsconfig.json DELETED
@@ -1,29 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- /* Target node 14 */
4
- "module": "ESNext",
5
- "lib": ["ES2020"],
6
- "target": "ES2020",
7
- "skipLibCheck": true,
8
-
9
- /* Transpile with esbuild */
10
- "moduleResolution": "bundler",
11
- "allowSyntheticDefaultImports": true,
12
-
13
- /* Linting */
14
- "strict": true,
15
- "noUnusedLocals": true,
16
- "noFallthroughCasesInSwitch": true,
17
- "useUnknownInCatchVariables": true,
18
-
19
- // Options
20
- "outDir": "dist",
21
- "baseUrl": "./src",
22
- "esModuleInterop": true,
23
- "declaration": true,
24
- "jsx": "react",
25
- "types": ["./src/node.d.ts"]
26
- },
27
- "include": ["src/**/*"],
28
- "files": ["src/style.d.ts"]
29
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes