@spark-apps/quickpeek 1.0.1 → 1.1.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.
Files changed (54) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +200 -101
  3. package/dist/assets/qp.wm +0 -0
  4. package/dist/highlight.css +15 -0
  5. package/dist/qp.js +6143 -0
  6. package/package.json +64 -46
  7. package/dist/api-client.d.ts +0 -61
  8. package/dist/api-client.d.ts.map +0 -1
  9. package/dist/api-client.js +0 -180
  10. package/dist/api-client.js.map +0 -1
  11. package/dist/config.d.ts +0 -69
  12. package/dist/config.d.ts.map +0 -1
  13. package/dist/config.js +0 -43
  14. package/dist/config.js.map +0 -1
  15. package/dist/crawl.d.ts +0 -18
  16. package/dist/crawl.d.ts.map +0 -1
  17. package/dist/crawl.js +0 -175
  18. package/dist/crawl.js.map +0 -1
  19. package/dist/cursor.d.ts +0 -6
  20. package/dist/cursor.d.ts.map +0 -1
  21. package/dist/cursor.js +0 -6
  22. package/dist/cursor.js.map +0 -1
  23. package/dist/ffmpeg.d.ts +0 -50
  24. package/dist/ffmpeg.d.ts.map +0 -1
  25. package/dist/ffmpeg.js +0 -224
  26. package/dist/ffmpeg.js.map +0 -1
  27. package/dist/index.d.ts +0 -15
  28. package/dist/index.d.ts.map +0 -1
  29. package/dist/index.js +0 -26
  30. package/dist/index.js.map +0 -1
  31. package/dist/prompts.d.ts +0 -13
  32. package/dist/prompts.d.ts.map +0 -1
  33. package/dist/prompts.js +0 -91
  34. package/dist/prompts.js.map +0 -1
  35. package/dist/styles.d.ts +0 -16
  36. package/dist/styles.d.ts.map +0 -1
  37. package/dist/styles.js +0 -66
  38. package/dist/styles.js.map +0 -1
  39. package/dist/tts.d.ts +0 -64
  40. package/dist/tts.d.ts.map +0 -1
  41. package/dist/tts.js +0 -236
  42. package/dist/tts.js.map +0 -1
  43. package/dist/utils.d.ts +0 -25
  44. package/dist/utils.d.ts.map +0 -1
  45. package/dist/utils.js +0 -106
  46. package/dist/utils.js.map +0 -1
  47. package/dist/voices.d.ts +0 -2
  48. package/dist/voices.d.ts.map +0 -1
  49. package/dist/voices.js +0 -73
  50. package/dist/voices.js.map +0 -1
  51. package/dist/watermark.d.ts +0 -27
  52. package/dist/watermark.d.ts.map +0 -1
  53. package/dist/watermark.js +0 -57
  54. package/dist/watermark.js.map +0 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Spark Apps
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,101 +1,200 @@
1
- <div align="center">
2
-
3
- # QuickPeek Core
4
-
5
- **Core library for QuickPeek - AI-powered demo video generation**
6
-
7
- [![npm](https://img.shields.io/npm/v/@spark-apps/quickpeek?style=flat-square&logo=npm&logoColor=white&color=crimson)](https://www.npmjs.com/package/@spark-apps/quickpeek)
8
- [![MIT](https://img.shields.io/badge/License-MIT-blueviolet?style=flat-square)](../../LICENSE)
9
-
10
- </div>
11
-
12
- ---
13
-
14
- ## Installation
15
-
16
- ```bash
17
- npm install @spark-apps/quickpeek
18
- ```
19
-
20
- ## Overview
21
-
22
- This is the core library used by [`@spark-apps/quickpeek-cli`](https://www.npmjs.com/package/@spark-apps/quickpeek-cli). It provides:
23
-
24
- - **API Client** - Communication with QuickPeek backend for AI planning
25
- - **TTS Engine** - Text-to-speech via Edge TTS (60+ languages)
26
- - **FFmpeg Wrapper** - Video composition, watermarks, effects
27
- - **Prompt Builder** - System and user prompts for AI planning
28
- - **Web Crawler** - Page analysis for demo planning
29
- - **Utilities** - Caption styling, ASS subtitle generation, config management
30
-
31
- ## Usage
32
-
33
- ```typescript
34
- import {
35
- callAI,
36
- generateVoiceover,
37
- composeVideo,
38
- crawlPage,
39
- buildSystemPrompt,
40
- buildUserPrompt,
41
- DEFAULT_CONFIG,
42
- VERSION,
43
- } from '@spark-apps/quickpeek';
44
-
45
- // Crawl a page for interactive elements
46
- const { title, elements } = await crawlPage('https://example.com');
47
-
48
- // Generate AI demo plan
49
- const systemPrompt = buildSystemPrompt(8);
50
- const userPrompt = buildUserPrompt(url, title, elements, 'English', 'A todo app', 8);
51
- const result = await callAI(systemPrompt, userPrompt, 'user@email.com');
52
-
53
- // Generate voiceover
54
- const { voiceoverPath, stepAudio } = await generateVoiceover(
55
- steps,
56
- config,
57
- workDir,
58
- outputDir,
59
- logError,
60
- task,
61
- info
62
- );
63
-
64
- // Compose final video
65
- await composeVideo({
66
- videoPath,
67
- assPath,
68
- outputPath,
69
- voiceoverPath,
70
- musicPath,
71
- // ... options
72
- });
73
- ```
74
-
75
- ## Exports
76
-
77
- | Module | Description |
78
- |--------|-------------|
79
- | `api-client` | Backend API communication |
80
- | `tts` | Text-to-speech generation |
81
- | `ffmpeg` | Video composition |
82
- | `prompts` | AI prompt templates |
83
- | `crawl` | Web page analysis |
84
- | `config` | Default configuration |
85
- | `utils` | ASS subtitles, color conversion |
86
- | `voices` | Voice mappings for 60+ languages |
87
- | `styles` | Caption styling |
88
- | `cursor` | Custom cursor CSS/JS |
89
- | `watermark` | Watermark generation |
90
-
91
- ## Related Packages
92
-
93
- - [`@spark-apps/quickpeek-cli`](https://www.npmjs.com/package/@spark-apps/quickpeek-cli) - CLI tool
94
-
95
- ---
96
-
97
- <div align="center">
98
-
99
- MIT License - Made with ☕ by [Spark Apps](https://github.com/muammar-yacoob)
100
-
101
- </div>
1
+ [license-link]: ./LICENSE
2
+ [privacy-link]: ./PRIVACY.md
3
+ [discord-link]: https://discord.gg/5skXfKRytR
4
+ [stars-link]: ../../stargazers
5
+ [issues-link]: ../../issues
6
+
7
+ <div align="center">
8
+
9
+ <img src=imgs/logo.png>
10
+
11
+ **Demo videos for your web app with AI**
12
+
13
+ *Because Tutorial Videos are Overrated!*
14
+
15
+ [![npm](https://img.shields.io/npm/v/@spark-apps/quickpeek?style=flat-square&logo=npm&logoColor=white&color=crimson)](https://www.npmjs.com/package/@spark-apps/quickpeek)
16
+ [![MIT](https://img.shields.io/badge/License-MIT-blueviolet?style=flat-square)][license-link]
17
+ [![Discord](https://img.shields.io/badge/Discord-Join-5865F2?style=flat-square&logo=discord&logoColor=white)][discord-link]
18
+ [![GitHub Stars](https://img.shields.io/github/stars/muammar-yacoob/quickpeek?style=flat-square)][stars-link]
19
+
20
+ </div>
21
+
22
+ ---
23
+
24
+ ## Quick Start
25
+
26
+ ```bash
27
+ npm install -g @spark-apps/quickpeek
28
+ qp localhost:3000
29
+ ```
30
+
31
+ **Requirements:** [ffmpeg](https://ffmpeg.org/download.html), [Groq API key](https://console.groq.com/keys) (free)
32
+
33
+ ## Features
34
+
35
+ | Feature | Description |
36
+ |---------|-------------|
37
+ | **AI Planning** | Groq AI analyzes your app and generates demo steps |
38
+ | **Script Mode** | Provide your own narration script, AI maps it to UI actions |
39
+ | **Capture Mode** | Record your own interactions → replayable plan.json |
40
+ | **Voice Over** | Free Edge TTS narration in 60+ languages |
41
+ | **Karaoke Captions** | Word-by-word highlighted subtitles |
42
+ | **Background Music** | Optional music with fade in/out |
43
+ | **Smart Zoom** | Per-step zoom for focused demos |
44
+ | **Chrome Extensions** | Record demos for Chrome extensions |
45
+
46
+ ## Examples
47
+
48
+ ### Basic — AI generates the plan
49
+
50
+ ```bash
51
+ qp localhost:3000
52
+ ```
53
+
54
+ ### Script mode — you write the narration
55
+
56
+ ```bash
57
+ qp localhost:3000 --script narration.txt
58
+ ```
59
+
60
+ Script file format (one caption per line, `#` for comments):
61
+
62
+ ```
63
+ # My app demo
64
+ We start on the dashboard — your main workspace.
65
+ Let's search for a customer by typing their name.
66
+ Click the result to open their profile.
67
+ ```
68
+
69
+ ### Capture mode — record your own interactions
70
+
71
+ ```bash
72
+ qp capture localhost:3000
73
+ ```
74
+
75
+ Browse the app freely, press Enter when done. QuickPeek converts your clicks, typing, and scrolls into a `plan.json` that can be replayed as a polished video.
76
+
77
+ ### With options
78
+
79
+ ```bash
80
+ qp localhost:3000 lang=es -d "A todo app for managing daily tasks"
81
+ ```
82
+
83
+ ### Chrome Extensions
84
+
85
+ Record demos for Chrome extensions using the `chrome:` prefix:
86
+
87
+ ```bash
88
+ qp chrome:your-extension-id
89
+ ```
90
+
91
+ QuickPeek will automatically:
92
+ 1. Find the extension in your Chrome installation
93
+ 2. Load and analyze the extension popup UI
94
+ 3. Generate a demo plan with AI
95
+
96
+ The popup URL is detected from the extension's manifest.
97
+
98
+ | Option | Description |
99
+ |--------|-------------|
100
+ | `lang` | Voice language (en, es, ar, zh...) |
101
+ | `-d, --description` | App description to guide AI |
102
+ | `-s, --script` | Path to narration script file |
103
+ | `video.width/height` | Resolution (default: 1080x1920) |
104
+ | `video.quality` | Quality 0-1 (default: 0.5) |
105
+ | `music.path` | Background music file |
106
+ | `music.volume` | Music volume 0-1 (default: 0.3) |
107
+ | `output.dir` | Output directory (default: ./demo) |
108
+
109
+ Config is auto-generated on first run. Edit `quickpeek.config.json` to customize.
110
+
111
+ <details>
112
+ <summary><strong>Supported Languages</strong></summary>
113
+
114
+ | Code | Language | Code | Language |
115
+ |------|----------|------|----------|
116
+ | `en` | English | `ar` | Arabic |
117
+ | `es` | Spanish | `fr` | French |
118
+ | `de` | German | `zh` | Chinese |
119
+ | `ja` | Japanese | `ko` | Korean |
120
+ | `pt` | Portuguese | `hi` | Hindi |
121
+ | `it` | Italian | `ru` | Russian |
122
+
123
+ See `src/voices.ts` for all 60+ supported languages.
124
+
125
+ </details>
126
+
127
+ <details>
128
+ <summary><strong>Caption Style</strong></summary>
129
+
130
+ Edit `captions.css` (auto-generated) to customize:
131
+
132
+ ![Classic Yellow](imgs/caption-classic.png)
133
+
134
+ ```css
135
+ .caption {
136
+ font-family: Arial, sans-serif;
137
+ -webkit-text-stroke: 3px #000000;
138
+ }
139
+ .caption .regular {
140
+ font-size: 56px;
141
+ color: #FFFFFF;
142
+ }
143
+ .caption .highlight {
144
+ font-size: 64px;
145
+ color: #FFFF00;
146
+ }
147
+ ```
148
+
149
+ </details>
150
+
151
+ ## Plan Actions
152
+
153
+ Edit `demo/plan.json` to customize your demo. Each step uses one of these actions:
154
+
155
+ | Action | Target | Value | Description |
156
+ |--------|--------|-------|-------------|
157
+ | `wait` | - | - | Pause for narration (intro/outro) |
158
+ | `click` | `"button text"` | - | Click button/link |
159
+ | `click-N` | `"button text"` | - | Click N times (e.g., `click-2`, `click-3`) |
160
+ | `type` | `input[name="field"]` | `"text to type"` | Type into input field |
161
+ | `upload` | `input[type="file"]` | `"path/to/file"` | Upload file to form |
162
+ | `select` | `select[name="field"]` | `"option text"` | Select dropdown option |
163
+ | `check` | `input[type="checkbox"]` | - | Toggle checkbox |
164
+ | `drag` | `input[type="range"]` | `"0"`-`"100"` | Drag slider to value |
165
+ | `drag` | `canvas` | `"around"` | Full 360° rotation (returns to start) |
166
+ | `drag` | `canvas` | `"rotate"` | Rotate ~270° (stays at new angle) |
167
+ | `drag` | `canvas` | `"rotate:90"` | Rotate specific angle (circular) |
168
+ | `drag` | `canvas` | `"rotate:x-90"` | Rotate on X axis (horizontal drag) |
169
+ | `drag` | `canvas` | `"rotate:y45"` | Rotate on Y axis (vertical drag) |
170
+ | `drag` | - | `"left"` `"right"` `"up"` `"down"` | Directional drag |
171
+ | `scroll` | - | `"up"` `"down"` `"bottom"` | Scroll page |
172
+ | `scroll` | - | `"-10"` to `"10"` | Zoom camera (negative=out, positive=in) |
173
+ | `media` | `"scale"` or `"center"` | `"path/to/file"` | Display image/video fullscreen |
174
+ | `showDownload` | - | - | Show the last downloaded file |
175
+
176
+ **Target shortcuts:** For buttons and links, use simplified text like `"download"` or `"extract frame"` instead of CSS selectors.
177
+
178
+ ## Output
179
+
180
+ | File | Description |
181
+ |------|-------------|
182
+ | `demo/demo.mp4` | Final video |
183
+ | `demo/plan.json` | Editable script (re-run to apply changes) |
184
+
185
+ ## 🌱 Support & Contributions
186
+
187
+ ⭐ **Star the repo** & I power up like Mario 🍄
188
+ ☕ **Devs run on coffee** - [Buy me one?][coffee-link]
189
+ 💖 **Sponsor** [Your support][stars-link] helps maintain and improve the tool<br>
190
+ 💰 **Crypto tips welcome** - [Tip in crypto](https://tip.md/muammar-yacoob)
191
+ 🤝 **Contributions are welcome** - [🍴 Fork][fork-link], improve, PR!
192
+ 🎥 **Need help?** <img src="https://img.icons8.com/color/20/youtube-play.png" alt="YouTube" width="20" height="20" style="vertical-align: middle;"> [Setup Tutorial][vid-link] • <img src="https://img.icons8.com/color/20/discord--v2.png" alt="Discord" width="20" height="20" style="vertical-align: middle;"> [Join Discord][discord-link]
193
+
194
+ <div align="center">
195
+
196
+ ---
197
+
198
+ MIT License - Made with ☕ by [Spark Apps](https://github.com/muammar-yacoob)
199
+
200
+ </div>
Binary file
@@ -0,0 +1,15 @@
1
+ #qp-highlight-overlay {
2
+ position: fixed;
3
+ inset: 0;
4
+ background: rgba(0, 0, 0, 0.5);
5
+ z-index: 999998;
6
+ pointer-events: none;
7
+ }
8
+
9
+ [data-qp-highlight] {
10
+ position: relative !important;
11
+ z-index: 999999 !important;
12
+ outline: 3px solid #ffd700 !important;
13
+ outline-offset: 2px !important;
14
+ border-radius: 8px !important;
15
+ }