@deckio/deck-engine 1.7.5 → 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,217 +1,217 @@
1
- ---
2
- name: deck-add-slide
3
- description: Guide for adding a new slide to a deck project. Use this when asked to create, add, or build a new slide component.
4
- ---
5
-
6
- # Adding a Slide to a Deck Project
7
-
8
- ## A. Slide Component Structure (mandatory skeleton)
9
-
10
- Every slide **must** follow this structure:
11
-
12
- ```jsx
13
- import { BottomBar, Slide } from '@deckio/deck-engine'
14
- import styles from './MyNewSlide.module.css'
15
-
16
- export default function MyNewSlide({ index, project }) {
17
- return (
18
- <Slide index={index} className={styles.myNewSlide}>
19
- {/* 1. Decorative elements — always first */}
20
- <div className="accent-bar" />
21
- <div className={`orb ${styles.orb1}`} />
22
- <div className={`orb ${styles.orb2}`} />
23
-
24
- {/* 2. Content area — vertically centered */}
25
- <div className={`${styles.body} content-frame content-gutter`}>
26
- {/* Slide content */}
27
- </div>
28
-
29
- {/* 3. Footer — always last child */}
30
- <BottomBar text="Project Footer Text" />
31
- </Slide>
32
- )
33
- }
34
- ```
35
-
36
- ### Mandatory elements (in order inside `<Slide>`):
37
-
38
- 1. **`<div className="accent-bar" />`** — Left gradient accent bar. Include on every slide.
39
- 2. **Orbs** — 2–4 `<div className={\`orb ${styles.orbN}\`} />` for ambient background glow.
40
- 3. **Content wrapper** — `<div className="content-frame content-gutter">` constrains width to `1280px` and adds `72px` horizontal padding. **All visible content goes inside this wrapper.**
41
- 4. **`<BottomBar text="..." />`** — Sticky footer, always the last child. The `text` must match the project's convention (check existing slides).
42
-
43
- ### Import paths (standalone project):
44
-
45
- | Resource | Import Path |
46
- |---|---|
47
- | `Slide`, `BottomBar`, `Navigation`, `SlideProvider`, `useSlides` | `'@deckio/deck-engine'` |
48
- | `GenericThankYouSlide` | `'@deckio/deck-engine'` |
49
- | Data / logos | `'../data/<file>'` |
50
-
51
- ---
52
-
53
- ## B. CSS Module Rules
54
-
55
- Create a companion `.module.css` file matching the JSX filename (e.g., `MyNewSlide.module.css`).
56
-
57
- ### Required root class properties
58
-
59
- ```css
60
- .myNewSlide {
61
- background: var(--bg-deep);
62
- flex-direction: column;
63
- padding: 0 0 44px 0;
64
- }
65
- ```
66
-
67
- - `background: var(--bg-deep)` — dark background on every slide
68
- - `flex-direction: column` — global `.slide` sets `display: flex`; this orients content vertically
69
- - `padding: 0 0 44px 0` — reserves space for the 44px BottomBar
70
-
71
- Optional: add `justify-content: center` to vertically center content (cover slides, thank-you slides).
72
-
73
- ### Orb positioning (standard recipe)
74
-
75
- ```css
76
- .orb1 {
77
- width: 420px; height: 420px;
78
- top: -100px; right: -60px;
79
- background: radial-gradient(circle at 40% 40%, var(--accent), var(--blue-glow) 50%, transparent 70%);
80
- }
81
- .orb2 {
82
- width: 320px; height: 320px;
83
- bottom: -40px; right: 100px;
84
- background: radial-gradient(circle at 50% 50%, var(--purple-deep), rgba(110,64,201,0.25) 60%, transparent 75%);
85
- }
86
- ```
87
-
88
- ### Vertical centering body wrapper
89
-
90
- ```css
91
- .body {
92
- position: relative;
93
- z-index: 10;
94
- display: flex;
95
- flex-direction: column;
96
- justify-content: center;
97
- flex: 1;
98
- min-height: 0;
99
- }
100
- ```
101
-
102
- ### Available CSS custom properties
103
-
104
- ```
105
- --bg-deep: #080b10 --surface: #161b22 --border: #30363d
106
- --text: #e6edf3 --text-muted: #8b949e --accent: #58a6ff
107
- --blue-glow: #1f6feb --purple: #bc8cff --purple-deep: #6e40c9
108
- --pink: #f778ba --cyan: #56d4dd --green: #3fb950
109
- --orange: #d29922
110
- ```
111
-
112
- ### Available global CSS classes (no import needed)
113
-
114
- | Class | Purpose |
115
- |---|---|
116
- | `accent-bar` | Left gradient accent bar |
117
- | `orb` | Base decorative orb (absolute, rounded, blur, opacity) |
118
- | `grid-dots` | Dot grid pattern (200×200px) |
119
- | `content-frame` | Width constraint to `1280px`, centered |
120
- | `content-gutter` | `72px` left/right padding |
121
-
122
- ---
123
-
124
- ## C. Typography Conventions
125
-
126
- | Element | Size | Weight | Spacing | Usage |
127
- |---|---|---|---|---|
128
- | `h1` | `clamp(42px, 5vw, 72px)` | 900 | `-2px` | Cover slides only |
129
- | `h2` | `clamp(28px, 3.2vw, 36px)` | 700 | `-0.8px` | Main slide heading |
130
- | `h3` | `16px–20px` | 700 | `-0.3px` | Card titles |
131
- | Subtitle | `17px` | 300–400 | — | `color: var(--text-muted)`, below heading |
132
- | Body text | `13px–14px` | 400 | — | `color: var(--text-muted)` |
133
- | Badge/label | `10px–11px` | 600–700 | `1.5px` | Uppercase, rounded bg |
134
-
135
- ---
136
-
137
- ## D. Content Layout Patterns
138
-
139
- ### Card grid
140
- ```css
141
- .cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
142
- ```
143
-
144
- ### Standard card
145
- ```css
146
- .card {
147
- background: var(--surface);
148
- border: 1px solid var(--border);
149
- border-radius: 16px;
150
- padding: 24px;
151
- overflow: hidden;
152
- transition: transform 0.3s ease, border-color 0.3s ease;
153
- }
154
- .card::before {
155
- content: '';
156
- position: absolute;
157
- top: 0; left: 0; right: 0; height: 3px;
158
- background: linear-gradient(90deg, var(--purple), var(--accent));
159
- opacity: 0.6;
160
- }
161
- ```
162
-
163
- ---
164
-
165
- ## E. Registration in deck.config.js
166
-
167
- After creating the slide files, register the slide in `deck.config.js`:
168
-
169
- 1. **Add an import** at the top: `import MyNewSlide from './src/slides/MyNewSlide.jsx'`
170
- 2. **Add the component** to the `slides` array at the desired position.
171
-
172
- The generic `App.jsx` renders slides from this array, passing `index` as a prop automatically. **You do NOT need to manage index numbers manually** — they are assigned by array position.
173
-
174
- ### Example: adding before ThankYou
175
-
176
- ```js
177
- import MyNewSlide from './src/slides/MyNewSlide.jsx'
178
- // ... other imports
179
-
180
- export default {
181
- // ... metadata
182
- slides: [
183
- CoverSlide,
184
- // ... existing slides
185
- MyNewSlide, // ← insert here
186
- ThankYouSlide, // stays last
187
- ],
188
- }
189
- ```
190
-
191
- ---
192
-
193
- ## F. Anti-Patterns to Avoid
194
-
195
- 1. **Missing `accent-bar`** — include on every slide.
196
- 2. **Missing `content-frame content-gutter`** — content will be full-width without standard margins.
197
- 3. **Missing `BottomBar`** — every slide needs it as the last child.
198
- 4. **String paths for images** — always use `import logo from '../data/...'` (Vite resolves to URL).
199
- 5. **Missing `padding: 0 0 44px 0`** on the slide root CSS class — content will overlap the BottomBar.
200
- 6. **Inconsistent `BottomBar text`** — check existing slides and match their footer text.
201
-
202
- ---
203
-
204
- ## G. Complete Step-by-Step
205
-
206
- 1. **Create** `src/slides/<SlideName>Slide.jsx` following the mandatory skeleton (section A).
207
- 2. **Create** `src/slides/<SlideName>Slide.module.css` with required root properties (section B).
208
- 3. **Register** in `deck.config.js` — add import + add to `slides` array (section E).
209
- 4. **Verify** — the dev server hot-reloads automatically. Navigate to the new slide and check layout.
210
-
211
- ### Quick checklist
212
-
213
- - [ ] Created `<SlideName>Slide.jsx` with Slide, accent-bar, orbs, content-frame, BottomBar
214
- - [ ] Created `<SlideName>Slide.module.css` with `background: var(--bg-deep)`, `flex-direction: column`, `padding: 0 0 44px 0`, body centering wrapper
215
- - [ ] Import added to `deck.config.js`
216
- - [ ] Component added to `slides` array at correct position
217
- - [ ] `BottomBar text` matches project convention
1
+ ---
2
+ name: deck-add-slide
3
+ description: Guide for adding a new slide to a deck project. Use this when asked to create, add, or build a new slide component.
4
+ ---
5
+
6
+ # Adding a Slide to a Deck Project
7
+
8
+ ## A. Slide Component Structure (mandatory skeleton)
9
+
10
+ Every slide **must** follow this structure:
11
+
12
+ ```jsx
13
+ import { BottomBar, Slide } from '@deckio/deck-engine'
14
+ import styles from './MyNewSlide.module.css'
15
+
16
+ export default function MyNewSlide({ index, project }) {
17
+ return (
18
+ <Slide index={index} className={styles.myNewSlide}>
19
+ {/* 1. Decorative elements — always first */}
20
+ <div className="accent-bar" />
21
+ <div className={`orb ${styles.orb1}`} />
22
+ <div className={`orb ${styles.orb2}`} />
23
+
24
+ {/* 2. Content area — vertically centered */}
25
+ <div className={`${styles.body} content-frame content-gutter`}>
26
+ {/* Slide content */}
27
+ </div>
28
+
29
+ {/* 3. Footer — always last child */}
30
+ <BottomBar text="Project Footer Text" />
31
+ </Slide>
32
+ )
33
+ }
34
+ ```
35
+
36
+ ### Mandatory elements (in order inside `<Slide>`):
37
+
38
+ 1. **`<div className="accent-bar" />`** — Left gradient accent bar. Include on every slide.
39
+ 2. **Orbs** — 2–4 `<div className={\`orb ${styles.orbN}\`} />` for ambient background glow.
40
+ 3. **Content wrapper** — `<div className="content-frame content-gutter">` constrains width to `1280px` and adds `72px` horizontal padding. **All visible content goes inside this wrapper.**
41
+ 4. **`<BottomBar text="..." />`** — Sticky footer, always the last child. The `text` must match the project's convention (check existing slides).
42
+
43
+ ### Import paths (standalone project):
44
+
45
+ | Resource | Import Path |
46
+ |---|---|
47
+ | `Slide`, `BottomBar`, `Navigation`, `SlideProvider`, `useSlides` | `'@deckio/deck-engine'` |
48
+ | `GenericThankYouSlide` | `'@deckio/deck-engine'` |
49
+ | Data / logos | `'../data/<file>'` |
50
+
51
+ ---
52
+
53
+ ## B. CSS Module Rules
54
+
55
+ Create a companion `.module.css` file matching the JSX filename (e.g., `MyNewSlide.module.css`).
56
+
57
+ ### Required root class properties
58
+
59
+ ```css
60
+ .myNewSlide {
61
+ background: var(--bg-deep);
62
+ flex-direction: column;
63
+ padding: 0 0 44px 0;
64
+ }
65
+ ```
66
+
67
+ - `background: var(--bg-deep)` — dark background on every slide
68
+ - `flex-direction: column` — global `.slide` sets `display: flex`; this orients content vertically
69
+ - `padding: 0 0 44px 0` — reserves space for the 44px BottomBar
70
+
71
+ Optional: add `justify-content: center` to vertically center content (cover slides, thank-you slides).
72
+
73
+ ### Orb positioning (standard recipe)
74
+
75
+ ```css
76
+ .orb1 {
77
+ width: 420px; height: 420px;
78
+ top: -100px; right: -60px;
79
+ background: radial-gradient(circle at 40% 40%, var(--accent), var(--blue-glow) 50%, transparent 70%);
80
+ }
81
+ .orb2 {
82
+ width: 320px; height: 320px;
83
+ bottom: -40px; right: 100px;
84
+ background: radial-gradient(circle at 50% 50%, var(--purple-deep), rgba(110,64,201,0.25) 60%, transparent 75%);
85
+ }
86
+ ```
87
+
88
+ ### Vertical centering body wrapper
89
+
90
+ ```css
91
+ .body {
92
+ position: relative;
93
+ z-index: 10;
94
+ display: flex;
95
+ flex-direction: column;
96
+ justify-content: center;
97
+ flex: 1;
98
+ min-height: 0;
99
+ }
100
+ ```
101
+
102
+ ### Available CSS custom properties
103
+
104
+ ```
105
+ --bg-deep: #080b10 --surface: #161b22 --border: #30363d
106
+ --text: #e6edf3 --text-muted: #8b949e --accent: #58a6ff
107
+ --blue-glow: #1f6feb --purple: #bc8cff --purple-deep: #6e40c9
108
+ --pink: #f778ba --cyan: #56d4dd --green: #3fb950
109
+ --orange: #d29922
110
+ ```
111
+
112
+ ### Available global CSS classes (no import needed)
113
+
114
+ | Class | Purpose |
115
+ |---|---|
116
+ | `accent-bar` | Left gradient accent bar |
117
+ | `orb` | Base decorative orb (absolute, rounded, blur, opacity) |
118
+ | `grid-dots` | Dot grid pattern (200×200px) |
119
+ | `content-frame` | Width constraint to `1280px`, centered |
120
+ | `content-gutter` | `72px` left/right padding |
121
+
122
+ ---
123
+
124
+ ## C. Typography Conventions
125
+
126
+ | Element | Size | Weight | Spacing | Usage |
127
+ |---|---|---|---|---|
128
+ | `h1` | `clamp(42px, 5vw, 72px)` | 900 | `-2px` | Cover slides only |
129
+ | `h2` | `clamp(28px, 3.2vw, 36px)` | 700 | `-0.8px` | Main slide heading |
130
+ | `h3` | `16px–20px` | 700 | `-0.3px` | Card titles |
131
+ | Subtitle | `17px` | 300–400 | — | `color: var(--text-muted)`, below heading |
132
+ | Body text | `13px–14px` | 400 | — | `color: var(--text-muted)` |
133
+ | Badge/label | `10px–11px` | 600–700 | `1.5px` | Uppercase, rounded bg |
134
+
135
+ ---
136
+
137
+ ## D. Content Layout Patterns
138
+
139
+ ### Card grid
140
+ ```css
141
+ .cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
142
+ ```
143
+
144
+ ### Standard card
145
+ ```css
146
+ .card {
147
+ background: var(--surface);
148
+ border: 1px solid var(--border);
149
+ border-radius: 16px;
150
+ padding: 24px;
151
+ overflow: hidden;
152
+ transition: transform 0.3s ease, border-color 0.3s ease;
153
+ }
154
+ .card::before {
155
+ content: '';
156
+ position: absolute;
157
+ top: 0; left: 0; right: 0; height: 3px;
158
+ background: linear-gradient(90deg, var(--purple), var(--accent));
159
+ opacity: 0.6;
160
+ }
161
+ ```
162
+
163
+ ---
164
+
165
+ ## E. Registration in deck.config.js
166
+
167
+ After creating the slide files, register the slide in `deck.config.js`:
168
+
169
+ 1. **Add an import** at the top: `import MyNewSlide from './src/slides/MyNewSlide.jsx'`
170
+ 2. **Add the component** to the `slides` array at the desired position.
171
+
172
+ The generic `App.jsx` renders slides from this array, passing `index` as a prop automatically. **You do NOT need to manage index numbers manually** — they are assigned by array position.
173
+
174
+ ### Example: adding before ThankYou
175
+
176
+ ```js
177
+ import MyNewSlide from './src/slides/MyNewSlide.jsx'
178
+ // ... other imports
179
+
180
+ export default {
181
+ // ... metadata
182
+ slides: [
183
+ CoverSlide,
184
+ // ... existing slides
185
+ MyNewSlide, // ← insert here
186
+ ThankYouSlide, // stays last
187
+ ],
188
+ }
189
+ ```
190
+
191
+ ---
192
+
193
+ ## F. Anti-Patterns to Avoid
194
+
195
+ 1. **Missing `accent-bar`** — include on every slide.
196
+ 2. **Missing `content-frame content-gutter`** — content will be full-width without standard margins.
197
+ 3. **Missing `BottomBar`** — every slide needs it as the last child.
198
+ 4. **String paths for images** — always use `import logo from '../data/...'` (Vite resolves to URL).
199
+ 5. **Missing `padding: 0 0 44px 0`** on the slide root CSS class — content will overlap the BottomBar.
200
+ 6. **Inconsistent `BottomBar text`** — check existing slides and match their footer text.
201
+
202
+ ---
203
+
204
+ ## G. Complete Step-by-Step
205
+
206
+ 1. **Create** `src/slides/<SlideName>Slide.jsx` following the mandatory skeleton (section A).
207
+ 2. **Create** `src/slides/<SlideName>Slide.module.css` with required root properties (section B).
208
+ 3. **Register** in `deck.config.js` — add import + add to `slides` array (section E).
209
+ 4. **Verify** — the dev server hot-reloads automatically. Navigate to the new slide and check layout.
210
+
211
+ ### Quick checklist
212
+
213
+ - [ ] Created `<SlideName>Slide.jsx` with Slide, accent-bar, orbs, content-frame, BottomBar
214
+ - [ ] Created `<SlideName>Slide.module.css` with `background: var(--bg-deep)`, `flex-direction: column`, `padding: 0 0 44px 0`, body centering wrapper
215
+ - [ ] Import added to `deck.config.js`
216
+ - [ ] Component added to `slides` array at correct position
217
+ - [ ] `BottomBar text` matches project convention
@@ -1,51 +1,51 @@
1
- ---
2
- name: deck-delete-slide
3
- description: Guide for removing a slide from a deck project. Use this when asked to delete, remove, or drop a slide.
4
- ---
5
-
6
- # Removing a Slide from a Deck Project
7
-
8
- ## Step 1: Identify the slide to remove
9
-
10
- Open `deck.config.js` and review the `slides` array to see all slides and their order. If the user didn't specify which slide to remove, list them so the user can choose.
11
-
12
- ## Step 2: Remove from deck.config.js
13
-
14
- 1. **Remove the import statement** for the slide being deleted.
15
- 2. **Remove the component** from the `slides` array.
16
-
17
- No index management is needed — the generic `App.jsx` assigns indexes by array position automatically.
18
-
19
- ## Step 3: Delete the slide files
20
-
21
- Delete from `src/slides/`:
22
-
23
- - `<SlideName>Slide.jsx`
24
- - `<SlideName>Slide.module.css`
25
-
26
- **Do not delete** shared slides from `@deckio/deck-engine` (like `GenericThankYouSlide`) — only remove the import.
27
-
28
- ## Step 4: Check for references
29
-
30
- Search `src/slides/` for any remaining references to the deleted slide:
31
-
32
- - Other slides that import or reference the deleted component
33
- - Data files specific to the deleted slide (if any)
34
- - Remove any orphaned references
35
-
36
- ## Step 5: Verify
37
-
38
- The dev server hot-reloads automatically. Navigate through all slides and confirm:
39
-
40
- - The deleted slide no longer appears
41
- - All remaining slides are navigable (← → arrows, keyboard)
42
- - Progress bar reflects the correct new total
43
- - No console errors
44
-
45
- ## Quick checklist
46
-
47
- - [ ] Removed import from `deck.config.js`
48
- - [ ] Removed component from `slides` array
49
- - [ ] Deleted slide `.jsx` and `.module.css` files
50
- - [ ] No orphaned references to the deleted slide
51
- - [ ] No console errors, all slides navigable
1
+ ---
2
+ name: deck-delete-slide
3
+ description: Guide for removing a slide from a deck project. Use this when asked to delete, remove, or drop a slide.
4
+ ---
5
+
6
+ # Removing a Slide from a Deck Project
7
+
8
+ ## Step 1: Identify the slide to remove
9
+
10
+ Open `deck.config.js` and review the `slides` array to see all slides and their order. If the user didn't specify which slide to remove, list them so the user can choose.
11
+
12
+ ## Step 2: Remove from deck.config.js
13
+
14
+ 1. **Remove the import statement** for the slide being deleted.
15
+ 2. **Remove the component** from the `slides` array.
16
+
17
+ No index management is needed — the generic `App.jsx` assigns indexes by array position automatically.
18
+
19
+ ## Step 3: Delete the slide files
20
+
21
+ Delete from `src/slides/`:
22
+
23
+ - `<SlideName>Slide.jsx`
24
+ - `<SlideName>Slide.module.css`
25
+
26
+ **Do not delete** shared slides from `@deckio/deck-engine` (like `GenericThankYouSlide`) — only remove the import.
27
+
28
+ ## Step 4: Check for references
29
+
30
+ Search `src/slides/` for any remaining references to the deleted slide:
31
+
32
+ - Other slides that import or reference the deleted component
33
+ - Data files specific to the deleted slide (if any)
34
+ - Remove any orphaned references
35
+
36
+ ## Step 5: Verify
37
+
38
+ The dev server hot-reloads automatically. Navigate through all slides and confirm:
39
+
40
+ - The deleted slide no longer appears
41
+ - All remaining slides are navigable (← → arrows, keyboard)
42
+ - Progress bar reflects the correct new total
43
+ - No console errors
44
+
45
+ ## Quick checklist
46
+
47
+ - [ ] Removed import from `deck.config.js`
48
+ - [ ] Removed component from `slides` array
49
+ - [ ] Deleted slide `.jsx` and `.module.css` files
50
+ - [ ] No orphaned references to the deleted slide
51
+ - [ ] No console errors, all slides navigable