@deckio/deck-engine 1.7.6 → 1.7.7

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.
@@ -1,9 +1,9 @@
1
- import styles from './BottomBar.module.css'
2
-
3
- export default function BottomBar({ text }) {
4
- return (
5
- <div className={styles.bar}>
6
- <span>{text || <>GitHub Copilot &nbsp;&middot;&nbsp; Reimagine Software Development</>}</span>
7
- </div>
8
- )
9
- }
1
+ import styles from './BottomBar.module.css'
2
+
3
+ export default function BottomBar({ text }) {
4
+ return (
5
+ <div className={styles.bar}>
6
+ <span>{text || <>GitHub Copilot &nbsp;&middot;&nbsp; Reimagine Software Development</>}</span>
7
+ </div>
8
+ )
9
+ }
@@ -1,17 +1,17 @@
1
- .bar {
2
- position: absolute;
3
- bottom: 0; left: 0; right: 0;
4
- height: 44px;
5
- background: rgba(13,17,23,0.85);
6
- backdrop-filter: blur(12px);
7
- border-top: 1px solid var(--border);
8
- display: flex;
9
- align-items: center;
10
- justify-content: space-between;
11
- padding: 0 40px;
12
- font-size: 11px;
13
- letter-spacing: 2.5px;
14
- text-transform: uppercase;
15
- color: var(--text-muted);
16
- z-index: 100;
17
- }
1
+ .bar {
2
+ position: absolute;
3
+ bottom: 0; left: 0; right: 0;
4
+ height: 44px;
5
+ background: rgba(13,17,23,0.85);
6
+ backdrop-filter: blur(12px);
7
+ border-top: 1px solid var(--border);
8
+ display: flex;
9
+ align-items: center;
10
+ justify-content: space-between;
11
+ padding: 0 40px;
12
+ font-size: 11px;
13
+ letter-spacing: 2.5px;
14
+ text-transform: uppercase;
15
+ color: var(--text-muted);
16
+ z-index: 100;
17
+ }
@@ -1,106 +1,155 @@
1
- import { useSlides } from '../context/SlideContext'
2
- import styles from './Navigation.module.css'
3
- import { useState, useEffect, useRef } from 'react'
4
-
5
- function resolveProp(value, context) {
6
- return typeof value === 'function' ? value(context) : value
7
- }
8
-
9
- export default function Navigation({ pdfPath = null, pdfLabel = 'Deck PDF' }) {
10
- const { current, totalSlides, go, goTo, selectedCustomer, project } = useSlides()
11
- const [hintVisible, setHintVisible] = useState(true)
12
- const [idle, setIdle] = useState(false)
13
- const timerRef = useRef(null)
14
-
15
- useEffect(() => {
16
- const t = setTimeout(() => setHintVisible(false), 5000)
17
- return () => clearTimeout(t)
18
- }, [])
19
-
20
- useEffect(() => {
21
- const resetIdle = () => {
22
- setIdle(false)
23
- clearTimeout(timerRef.current)
24
- timerRef.current = setTimeout(() => setIdle(true), 2000)
25
- }
26
- resetIdle()
27
- window.addEventListener('mousemove', resetIdle)
28
- window.addEventListener('mousedown', resetIdle)
29
- return () => {
30
- window.removeEventListener('mousemove', resetIdle)
31
- window.removeEventListener('mousedown', resetIdle)
32
- clearTimeout(timerRef.current)
33
- }
34
- }, [])
35
-
36
- const progress = ((current + 1) / totalSlides) * 100
37
- const navigationState = { current, totalSlides, selectedCustomer, project }
38
- const resolvedPdfPath = resolveProp(pdfPath, navigationState)
39
- const resolvedPdfLabel = resolveProp(pdfLabel, navigationState) || 'Deck PDF'
40
-
41
- return (
42
- <div className={`${styles.navWrapper} ${idle ? styles.navHidden : ''}`}>
43
- <div className={styles.progressTrack}>
44
- <div className={styles.progressFill} style={{ width: `${progress}%` }} />
45
- </div>
46
-
47
- {current !== 0 && (
48
- <button
49
- className={styles.homeBtn}
50
- onClick={() => goTo(0)}
51
- title="Back to home"
52
- >
53
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
54
- <path d="M3 12l9-9 9 9" />
55
- <path d="M9 21V9h6v12" />
56
- </svg>
57
- </button>
58
- )}
59
-
60
- {resolvedPdfPath && (
61
- <a
62
- className={styles.exportBtn}
63
- href={resolvedPdfPath}
64
- target="_blank"
65
- rel="noopener noreferrer"
66
- title={resolvedPdfLabel}
67
- >
68
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
69
- <path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" />
70
- <polyline points="14 2 14 8 20 8" />
71
- <line x1="16" y1="13" x2="8" y2="13" />
72
- <line x1="16" y1="17" x2="8" y2="17" />
73
- <polyline points="10 9 9 9 8 9" />
74
- </svg>
75
- <span className={styles.exportLabel}>PDF</span>
76
- </a>
77
- )}
78
-
79
- <button
80
- className={`${styles.navBtn} ${styles.prev}`}
81
- disabled={current === 0}
82
- onClick={() => go(-1)}
83
- >
84
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round">
85
- <polyline points="15 18 9 12 15 6" />
86
- </svg>
87
- </button>
88
- <button
89
- className={`${styles.navBtn} ${styles.next}`}
90
- disabled={current === totalSlides - 1}
91
- onClick={() => go(1)}
92
- >
93
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round">
94
- <polyline points="9 6 15 12 9 18" />
95
- </svg>
96
- </button>
97
-
98
- {hintVisible && (
99
- <div className={styles.keyHint}>
100
- <span className={styles.kbd}>&larr;</span>
101
- <span className={styles.kbd}>&rarr;</span> or click arrows to navigate
102
- </div>
103
- )}
104
- </div>
105
- )
106
- }
1
+ import { useSlides } from '../context/SlideContext'
2
+ import styles from './Navigation.module.css'
3
+ import { useState, useEffect, useRef } from 'react'
4
+ import { exportDeckPdf } from './exportDeckPdf.js'
5
+
6
+ function resolveProp(value, context) {
7
+ return typeof value === 'function' ? value(context) : value
8
+ }
9
+
10
+ export default function Navigation({ pdfPath = null, pdfLabel = 'Deck PDF' }) {
11
+ const { current, totalSlides, go, goTo, selectedCustomer, project } = useSlides()
12
+ const [hintVisible, setHintVisible] = useState(true)
13
+ const [idle, setIdle] = useState(false)
14
+ const [isExporting, setIsExporting] = useState(false)
15
+ const [exportStatus, setExportStatus] = useState('PDF')
16
+ const timerRef = useRef(null)
17
+
18
+ useEffect(() => {
19
+ const t = setTimeout(() => setHintVisible(false), 5000)
20
+ return () => clearTimeout(t)
21
+ }, [])
22
+
23
+ useEffect(() => {
24
+ const resetIdle = () => {
25
+ setIdle(false)
26
+ clearTimeout(timerRef.current)
27
+ timerRef.current = setTimeout(() => setIdle(true), 2000)
28
+ }
29
+ resetIdle()
30
+ window.addEventListener('mousemove', resetIdle)
31
+ window.addEventListener('mousedown', resetIdle)
32
+ return () => {
33
+ window.removeEventListener('mousemove', resetIdle)
34
+ window.removeEventListener('mousedown', resetIdle)
35
+ clearTimeout(timerRef.current)
36
+ }
37
+ }, [])
38
+
39
+ const progress = ((current + 1) / totalSlides) * 100
40
+ const navigationState = { current, totalSlides, selectedCustomer, project }
41
+ const resolvedPdfPath = resolveProp(pdfPath, navigationState)
42
+ const resolvedPdfLabel = resolveProp(pdfLabel, navigationState) || 'Deck PDF'
43
+
44
+ async function handleExportClick() {
45
+ if (resolvedPdfPath || isExporting) return
46
+
47
+ setIsExporting(true)
48
+ setExportStatus('Preparing')
49
+
50
+ try {
51
+ await exportDeckPdf({
52
+ current,
53
+ goTo,
54
+ project,
55
+ selectedCustomer,
56
+ totalSlides,
57
+ onProgress: ({ current: slideNumber, total }) => {
58
+ setExportStatus(`${slideNumber}/${total}`)
59
+ },
60
+ })
61
+ setExportStatus('Done')
62
+ } catch (error) {
63
+ console.error('PDF export failed', error)
64
+ setExportStatus('Error')
65
+ } finally {
66
+ window.setTimeout(() => {
67
+ setIsExporting(false)
68
+ setExportStatus('PDF')
69
+ }, 1200)
70
+ }
71
+ }
72
+
73
+ return (
74
+ <div className={`${styles.navWrapper} ${idle ? styles.navHidden : ''}`}>
75
+ <div className={styles.progressTrack}>
76
+ <div className={styles.progressFill} style={{ width: `${progress}%` }} />
77
+ </div>
78
+
79
+ {current !== 0 && (
80
+ <button
81
+ className={styles.homeBtn}
82
+ onClick={() => goTo(0)}
83
+ title="Back to home"
84
+ >
85
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
86
+ <path d="M3 12l9-9 9 9" />
87
+ <path d="M9 21V9h6v12" />
88
+ </svg>
89
+ </button>
90
+ )}
91
+
92
+ {resolvedPdfPath ? (
93
+ <a
94
+ className={styles.exportBtn}
95
+ href={resolvedPdfPath}
96
+ target="_blank"
97
+ rel="noopener noreferrer"
98
+ title={resolvedPdfLabel}
99
+ >
100
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
101
+ <path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" />
102
+ <polyline points="14 2 14 8 20 8" />
103
+ <line x1="16" y1="13" x2="8" y2="13" />
104
+ <line x1="16" y1="17" x2="8" y2="17" />
105
+ <polyline points="10 9 9 9 8 9" />
106
+ </svg>
107
+ <span className={styles.exportLabel}>PDF</span>
108
+ </a>
109
+ ) : (
110
+ <button
111
+ className={`${styles.exportBtn} ${isExporting ? styles.exportBtnBusy : ''}`}
112
+ type="button"
113
+ onClick={handleExportClick}
114
+ disabled={isExporting}
115
+ title={isExporting ? 'Preparing deck PDF' : resolvedPdfLabel}
116
+ >
117
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
118
+ <path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" />
119
+ <polyline points="14 2 14 8 20 8" />
120
+ <path d="M12 12v6" />
121
+ <path d="M9 15l3 3 3-3" />
122
+ <path d="M8 10h8" />
123
+ </svg>
124
+ <span className={styles.exportLabel}>{exportStatus}</span>
125
+ </button>
126
+ )}
127
+
128
+ <button
129
+ className={`${styles.navBtn} ${styles.prev}`}
130
+ disabled={current === 0}
131
+ onClick={() => go(-1)}
132
+ >
133
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round">
134
+ <polyline points="15 18 9 12 15 6" />
135
+ </svg>
136
+ </button>
137
+ <button
138
+ className={`${styles.navBtn} ${styles.next}`}
139
+ disabled={current === totalSlides - 1}
140
+ onClick={() => go(1)}
141
+ >
142
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round">
143
+ <polyline points="9 6 15 12 9 18" />
144
+ </svg>
145
+ </button>
146
+
147
+ {hintVisible && (
148
+ <div className={styles.keyHint}>
149
+ <span className={styles.kbd}>&larr;</span>
150
+ <span className={styles.kbd}>&rarr;</span> or click arrows to navigate
151
+ </div>
152
+ )}
153
+ </div>
154
+ )
155
+ }
@@ -1,145 +1,154 @@
1
- .navWrapper {
2
- transition: opacity 0.4s ease;
3
- opacity: 1;
4
- }
5
-
6
- .navHidden {
7
- opacity: 0;
8
- pointer-events: none;
9
- }
10
-
11
- .progressTrack {
12
- position: fixed;
13
- top: 0; left: 0; right: 0;
14
- height: 3px;
15
- background: rgba(48,54,61,0.6);
16
- z-index: 300;
17
- }
18
-
19
- .progressFill {
20
- height: 100%;
21
- background: linear-gradient(90deg, var(--purple), var(--accent), var(--cyan));
22
- transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
23
- border-radius: 0 2px 2px 0;
24
- box-shadow: 0 0 12px var(--accent);
25
- }
26
-
27
- .homeBtn {
28
- position: fixed;
29
- top: 16px;
30
- left: 20px;
31
- z-index: 200;
32
- width: 36px; height: 36px;
33
- border-radius: 10px;
34
- border: 1px solid var(--border);
35
- background: rgba(22,27,34,0.8);
36
- backdrop-filter: blur(8px);
37
- color: var(--text);
38
- cursor: pointer;
39
- display: flex;
40
- align-items: center;
41
- justify-content: center;
42
- transition: all 0.25s ease;
43
- opacity: 0.45;
44
- }
45
- .homeBtn:hover {
46
- opacity: 1;
47
- border-color: var(--accent);
48
- background: rgba(31,111,235,0.2);
49
- }
50
- .homeBtn svg {
51
- width: 16px; height: 16px;
52
- }
53
-
54
- .exportBtn {
55
- position: fixed;
56
- top: 16px;
57
- right: 20px;
58
- z-index: 200;
59
- height: 36px;
60
- min-width: 36px;
61
- padding: 0 12px;
62
- border-radius: 10px;
63
- border: 1px solid var(--border);
64
- background: rgba(22,27,34,0.8);
65
- backdrop-filter: blur(8px);
66
- color: var(--text);
67
- cursor: pointer;
68
- display: flex;
69
- align-items: center;
70
- justify-content: center;
71
- gap: 6px;
72
- transition: all 0.25s ease;
73
- opacity: 0.45;
74
- text-decoration: none;
75
- font-family: inherit;
76
- }
77
- .exportBtn:hover {
78
- opacity: 1;
79
- border-color: var(--accent);
80
- background: rgba(31,111,235,0.2);
81
- }
82
- .exportBtn svg {
83
- width: 16px; height: 16px;
84
- }
85
- .exportLabel {
86
- font-size: 11px;
87
- font-weight: 600;
88
- letter-spacing: 0.04em;
89
- text-transform: uppercase;
90
- }
91
-
92
- .navBtn {
93
- position: fixed;
94
- top: 50%;
95
- transform: translateY(-50%);
96
- z-index: 200;
97
- width: 48px; height: 48px;
98
- border-radius: 50%;
99
- border: 1px solid var(--border);
100
- background: rgba(22,27,34,0.8);
101
- backdrop-filter: blur(8px);
102
- color: var(--text);
103
- cursor: pointer;
104
- display: flex;
105
- align-items: center;
106
- justify-content: center;
107
- transition: all 0.25s ease;
108
- opacity: 0.5;
109
- }
110
- .navBtn:hover { opacity: 1; border-color: var(--accent); background: rgba(31,111,235,0.2); }
111
- .prev { left: 20px; }
112
- .next { right: 20px; }
113
- .navBtn svg { width: 20px; height: 20px; }
114
- .navBtn:disabled { opacity: 0.15; cursor: default; pointer-events: none; }
115
-
116
- .keyHint {
117
- position: fixed;
118
- bottom: 56px; right: 40px;
119
- z-index: 200;
120
- display: flex;
121
- align-items: center;
122
- gap: 6px;
123
- font-size: 11px;
124
- color: var(--text-muted);
125
- opacity: 0.5;
126
- animation: fadeOut 3s 5s forwards;
127
- }
128
-
129
- @keyframes fadeOut {
130
- to { opacity: 0; }
131
- }
132
-
133
- .kbd {
134
- display: inline-flex;
135
- align-items: center;
136
- justify-content: center;
137
- min-width: 22px; height: 22px;
138
- padding: 0 5px;
139
- border: 1px solid var(--border);
140
- border-radius: 4px;
141
- background: var(--surface);
142
- font-size: 10px;
143
- font-weight: 600;
144
- font-family: inherit;
145
- }
1
+ .navWrapper {
2
+ transition: opacity 0.4s ease;
3
+ opacity: 1;
4
+ }
5
+
6
+ .navHidden {
7
+ opacity: 0;
8
+ pointer-events: none;
9
+ }
10
+
11
+ .progressTrack {
12
+ position: fixed;
13
+ top: 0; left: 0; right: 0;
14
+ height: 3px;
15
+ background: rgba(48,54,61,0.6);
16
+ z-index: 300;
17
+ }
18
+
19
+ .progressFill {
20
+ height: 100%;
21
+ background: linear-gradient(90deg, var(--purple), var(--accent), var(--cyan));
22
+ transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
23
+ border-radius: 0 2px 2px 0;
24
+ box-shadow: 0 0 12px var(--accent);
25
+ }
26
+
27
+ .homeBtn {
28
+ position: fixed;
29
+ top: 16px;
30
+ left: 20px;
31
+ z-index: 200;
32
+ width: 36px; height: 36px;
33
+ border-radius: 10px;
34
+ border: 1px solid var(--border);
35
+ background: rgba(22,27,34,0.8);
36
+ backdrop-filter: blur(8px);
37
+ color: var(--text);
38
+ cursor: pointer;
39
+ display: flex;
40
+ align-items: center;
41
+ justify-content: center;
42
+ transition: all 0.25s ease;
43
+ opacity: 0.45;
44
+ }
45
+ .homeBtn:hover {
46
+ opacity: 1;
47
+ border-color: var(--accent);
48
+ background: rgba(31,111,235,0.2);
49
+ }
50
+ .homeBtn svg {
51
+ width: 16px; height: 16px;
52
+ }
53
+
54
+ .exportBtn {
55
+ position: fixed;
56
+ top: 16px;
57
+ right: 20px;
58
+ z-index: 200;
59
+ height: 36px;
60
+ min-width: 36px;
61
+ padding: 0 12px;
62
+ border-radius: 10px;
63
+ border: 1px solid var(--border);
64
+ background: rgba(22,27,34,0.8);
65
+ backdrop-filter: blur(8px);
66
+ color: var(--text);
67
+ cursor: pointer;
68
+ display: flex;
69
+ align-items: center;
70
+ justify-content: center;
71
+ gap: 6px;
72
+ transition: all 0.25s ease;
73
+ opacity: 0.45;
74
+ text-decoration: none;
75
+ font-family: inherit;
76
+ }
77
+ .exportBtn:disabled {
78
+ cursor: wait;
79
+ }
80
+ .exportBtn:hover {
81
+ opacity: 1;
82
+ border-color: var(--accent);
83
+ background: rgba(31,111,235,0.2);
84
+ }
85
+ .exportBtnBusy {
86
+ opacity: 1;
87
+ border-color: var(--accent);
88
+ background: rgba(31,111,235,0.22);
89
+ box-shadow: 0 0 0 1px rgba(121, 192, 255, 0.18), 0 0 24px rgba(31, 111, 235, 0.18);
90
+ }
91
+ .exportBtn svg {
92
+ width: 16px; height: 16px;
93
+ }
94
+ .exportLabel {
95
+ font-size: 11px;
96
+ font-weight: 600;
97
+ letter-spacing: 0.04em;
98
+ text-transform: uppercase;
99
+ }
100
+
101
+ .navBtn {
102
+ position: fixed;
103
+ top: 50%;
104
+ transform: translateY(-50%);
105
+ z-index: 200;
106
+ width: 48px; height: 48px;
107
+ border-radius: 50%;
108
+ border: 1px solid var(--border);
109
+ background: rgba(22,27,34,0.8);
110
+ backdrop-filter: blur(8px);
111
+ color: var(--text);
112
+ cursor: pointer;
113
+ display: flex;
114
+ align-items: center;
115
+ justify-content: center;
116
+ transition: all 0.25s ease;
117
+ opacity: 0.5;
118
+ }
119
+ .navBtn:hover { opacity: 1; border-color: var(--accent); background: rgba(31,111,235,0.2); }
120
+ .prev { left: 20px; }
121
+ .next { right: 20px; }
122
+ .navBtn svg { width: 20px; height: 20px; }
123
+ .navBtn:disabled { opacity: 0.15; cursor: default; pointer-events: none; }
124
+
125
+ .keyHint {
126
+ position: fixed;
127
+ bottom: 56px; right: 40px;
128
+ z-index: 200;
129
+ display: flex;
130
+ align-items: center;
131
+ gap: 6px;
132
+ font-size: 11px;
133
+ color: var(--text-muted);
134
+ opacity: 0.5;
135
+ animation: fadeOut 3s 5s forwards;
136
+ }
137
+
138
+ @keyframes fadeOut {
139
+ to { opacity: 0; }
140
+ }
141
+
142
+ .kbd {
143
+ display: inline-flex;
144
+ align-items: center;
145
+ justify-content: center;
146
+ min-width: 22px; height: 22px;
147
+ padding: 0 5px;
148
+ border: 1px solid var(--border);
149
+ border-radius: 4px;
150
+ background: var(--surface);
151
+ font-size: 10px;
152
+ font-weight: 600;
153
+ font-family: inherit;
154
+ }
@@ -1,15 +1,15 @@
1
- import { useSlides } from '../context/SlideContext'
2
-
3
- export default function Slide({ index, className = '', children }) {
4
- const { current } = useSlides()
5
-
6
- let stateClass = ''
7
- if (index === current) stateClass = 'active'
8
- else if (index < current) stateClass = 'exit-left'
9
-
10
- return (
11
- <div className={`slide ${stateClass} ${className}`} data-slide={index}>
12
- {children}
13
- </div>
14
- )
15
- }
1
+ import { useSlides } from '../context/SlideContext'
2
+
3
+ export default function Slide({ index, className = '', children }) {
4
+ const { current } = useSlides()
5
+
6
+ let stateClass = ''
7
+ if (index === current) stateClass = 'active'
8
+ else if (index < current) stateClass = 'exit-left'
9
+
10
+ return (
11
+ <div className={`slide ${stateClass} ${className}`} data-slide={index}>
12
+ {children}
13
+ </div>
14
+ )
15
+ }