htmlboard 0.1.0 → 0.2.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/README.md CHANGED
@@ -1,9 +1,14 @@
1
- # ✦ HtmlBoard
1
+ <h1>
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/luizcarlos1405/htmlboard/main/brand/logo-dark.svg">
4
+ <img alt="htmlboard" src="https://raw.githubusercontent.com/luizcarlos1405/htmlboard/main/brand/logo-light.svg" height="56">
5
+ </picture>
6
+ </h1>
2
7
 
3
8
  > **Infinite canvas and design explorer for HTML artboards — designed for humans and LLMs.**
4
9
 
5
- [![npm version](https://img.shields.io/npm/v/htmlboard.svg?style=flat-square&color=6366f1)](https://www.npmjs.com/package/htmlboard)
6
- [![license](https://img.shields.io/npm/l/htmlboard.svg?style=flat-square&color=10b981)](LICENSE)
10
+ [![npm version](https://img.shields.io/npm/v/htmlboard.svg?style=flat-square&color=3D9DFF)](https://www.npmjs.com/package/htmlboard)
11
+ [![license](https://img.shields.io/npm/l/htmlboard.svg?style=flat-square&color=48484D)](LICENSE)
7
12
  [![node version](https://img.shields.io/node/v/htmlboard.svg?style=flat-square)](https://nodejs.org)
8
13
  [![zero dependencies](https://img.shields.io/badge/dependencies-0-brightgreen.svg?style=flat-square)](package.json)
9
14
 
@@ -24,15 +29,15 @@ Modern AI agents and developers generate dozens of HTML mockups, layout variatio
24
29
 
25
30
  ## ✨ Features
26
31
 
27
- - 🛸 **Infinite Canvas**: Smoothly pan, zoom (from 5% to 300%), and fly across dozens of artboards with trackpad or mouse.
28
- - ⚡ **Zero Dependencies**: Pure native Node.js ES modules. Runs instantly with `npx htmlboard` without installing heavy packages.
29
- - 🔄 **State-Preserving Live Reload**: Automatically watches files via Server-Sent Events (SSE). When you or an LLM edit an HTML file, the corresponding artboard updates instantly without resetting your canvas pan/zoom position; editing a shared CSS, script or image reloads them all.
30
- - 🔍 **Auto-Discovery**: Point HtmlBoard at any folder. It automatically discovers all HTML files, extracts their titles, classifies them by device type, and renders them onto the canvas.
31
- - 📐 **Declarative Manifest (`designs.json`)**: Optional structured schema to organize artboards into sections, define custom viewports (iPhone, iPad, MacBook, 4K), and attach metadata.
32
- - 📱 **Multi-Device Categories**: One-click filters for Mobile (390×844), Desktop (1280×820), Tablet (768×1024), and Component kits.
33
- - 🎯 **Focus & Zoom-to-Fit**: Instantly center any artboard with a click in the sidebar, or hit <kbd>F</kbd> to fit all designs on screen.
34
- - 🔗 **Deep Links**: The URL follows the focused artboard (`http://localhost:3000/#checkout-b`), so you can share or reload a view of one design.
35
- - ⌨️ **Keyboard-First Workflow**: Full suite of intuitive shortcuts matching design industry standards.
32
+ - 🛸 **Infinite Canvas**: Drag or scroll to move, <kbd>Ctrl</kbd>/<kbd>⌘</kbd> + scroll or pinch to zoom (2% to 800%), with a mouse, a trackpad or a touch screen. Names and section titles stay sharp at any zoom, and the dot grid keeps its spacing.
33
+ - ⚡ **Zero Dependencies**: Pure native Node.js ES modules, fonts included. Runs instantly with `npx htmlboard`, offline too.
34
+ - 🔄 **State-Preserving Live Reload**: The server watches the project and pushes every save (Server-Sent Events). Saving a design reloads its frame; saving a file designs use (a stylesheet, a script, an image, data) reloads just the designs that loaded it; new, removed and renamed designs show up by themselves. Your view never moves.
35
+ - 🔍 **Auto-Discovery**: Point HtmlBoard at any folder. It finds every HTML file, names it after its `<title>`, sizes it from words in its path (mobile, tablet, desktop…) and lays the folders out as rows.
36
+ - 📐 **Declarative Manifest (`designs.json`)**: Optional file to choose the sections, the order, the sizes and the names.
37
+ - 🔎 **Search**: Find designs by name, file, tags or section (case and accents don't matter); the others fade out in place.
38
+ - 🎯 **Focus & Zoom-to-Fit**: Click a design in the list or double-click it on the canvas to fit it, <kbd>Shift</kbd> + <kbd>1</kbd> fits everything, <kbd>←</kbd> <kbd>→</kbd> step through the designs.
39
+ - 🔗 **Deep Links**: The URL follows the selected design (`http://localhost:3000/#checkout-b`), so you can share or reload a view of one design.
40
+ - ⌨️ **Keyboard-First Workflow**: Figma-like shortcuts; <kbd>?</kbd> lists them.
36
41
 
37
42
  ---
38
43
 
@@ -160,7 +165,7 @@ While HtmlBoard automatically discovers HTML files, you can add a `designs.json`
160
165
 
161
166
  Sections are rows (top to bottom) and designs run left to right. A `file` may carry a query string, so one HTML file can show several states. Leave `height` out to let the frame grow with its page. `id` and `category` are derived from the file when left out.
162
167
 
163
- The full form adds ids, descriptions, categories (for the toolbar filters) and searchable tags (`name`/`artboards` are synonyms of `title`/`designs`):
168
+ The full form adds ids, descriptions (shown in the list), categories and tags (searchable); `name`/`artboards` are synonyms of `title`/`designs`:
164
169
 
165
170
  ```json
166
171
  {
@@ -217,16 +222,22 @@ The full form adds ids, descriptions, categories (for the toolbar filters) and s
217
222
 
218
223
  | Shortcut | Action |
219
224
  | :--- | :--- |
220
- | <kbd>Space</kbd> + <kbd>Drag</kbd> | Pan the canvas freely |
221
- | <kbd>Ctrl</kbd> / <kbd>⌘</kbd> + <kbd>Wheel</kbd> | Zoom in/out anchored to cursor |
222
- | <kbd>+</kbd> / <kbd>-</kbd> | Zoom in / Zoom out |
223
- | <kbd>0</kbd> | Reset zoom to 100% |
224
- | <kbd>F</kbd> or <kbd>Shift</kbd> + <kbd>1</kbd> | Fit all artboards in viewport |
225
- | <kbd>/</kbd> or <kbd>⌘</kbd> + <kbd>K</kbd> | Search artboards by title, tag, or path |
226
- | <kbd>[</kbd> or <kbd>]</kbd> | Toggle navigation sidebar |
227
- | <kbd>1</kbd> – <kbd>5</kbd> | Quick filter by device category |
228
- | <kbd>?</kbd> | Show keyboard shortcuts modal |
229
- | <kbd>Esc</kbd> | Close modals or blur search |
225
+ | Drag, <kbd>Space</kbd> + drag | Move around |
226
+ | Scroll (<kbd>Shift</kbd>: sideways) | Move around |
227
+ | <kbd>Ctrl</kbd>/<kbd>⌘</kbd> + scroll, pinch | Zoom, anchored to the pointer |
228
+ | <kbd>+</kbd> / <kbd>−</kbd> | Zoom in / out |
229
+ | <kbd>Shift</kbd> + <kbd>0</kbd> | Zoom to 100% |
230
+ | <kbd>Shift</kbd> + <kbd>1</kbd> | Fit everything (what the search keeps) |
231
+ | <kbd>Shift</kbd> + <kbd>2</kbd>, double-click | Fit the design |
232
+ | <kbd>←</kbd> / <kbd>→</kbd> | Previous / next design |
233
+ | <kbd>Enter</kbd> | Open the selected design on its own |
234
+ | <kbd>/</kbd> | Search (<kbd>Enter</kbd> fits the first match, <kbd>Esc</kbd> clears) |
235
+ | <kbd>R</kbd> | Reload the designs |
236
+ | <kbd>\</kbd> | Show or hide the list |
237
+ | <kbd>?</kbd> | Show the shortcuts |
238
+ | <kbd>Esc</kbd> | Deselect |
239
+
240
+ On the canvas the designs are pictures: the canvas takes every click and scroll, so <kbd>Ctrl</kbd> + scroll never zooms the page itself. Use **Open** (or <kbd>Enter</kbd>) to try a design's links and hover states on its own.
230
241
 
231
242
  ---
232
243
 
@@ -269,15 +280,19 @@ htmlboard/
269
280
  │ ├── index.js # Library entry point & API exports
270
281
  │ ├── server.js # HTTP server, SSE live reload, auto-discovery
271
282
  │ ├── skills.js # `htmlboard skills` installer
272
- │ ├── client/ # The infinite canvas frontend
273
- │ │ ├── index.html # Explorer shell & canvas DOM
274
- │ │ ├── explorer.css # Dark theme styles & canvas grid
275
- │ │ └── explorer.js # Pan/zoom engine, SSE listener, auto-measure
283
+ │ ├── client/ # The canvas
284
+ │ │ ├── index.html # Explorer shell: list, canvas, toolbar, shortcuts
285
+ │ │ ├── explorer.css # Dark chrome, dot grid
286
+ │ │ ├── explorer.js # Layout, pan/zoom, search, live reload
287
+ │ │ ├── favicon.svg, logo.svg, mark.svg
288
+ │ │ └── fonts/ # Inter and Bricolage Grotesque (OFL)
276
289
  │ └── templates/ # Starter scaffold templates
277
290
  │ ├── designs.json # Starter manifest
278
291
  │ └── artboards/ # Sample mobile, desktop, & component screens
279
292
  ├── skills/
280
293
  │ └── htmlboard/ # Agent skill (SKILL.md) copied by `htmlboard skills install`
294
+ ├── brand/ # The logo's files (from design/tools/logo.py)
295
+ ├── design/ # htmlboard's own designs, on its own canvas: `npx htmlboard design --root .`
281
296
  ├── package.json
282
297
  ├── README.md
283
298
  └── LICENSE
@@ -288,3 +303,5 @@ htmlboard/
288
303
  ## 📄 License
289
304
 
290
305
  MIT © Luiz Carlos & Contributors
306
+
307
+ The explorer ships the Inter and Bricolage Grotesque fonts under the SIL Open Font License 1.1 (see `src/client/fonts/`).
package/bin/htmlboard.js CHANGED
@@ -67,7 +67,7 @@ function parseArgs(args) {
67
67
 
68
68
  function showHelp() {
69
69
  console.log(`
70
- HtmlBoard v${pkg.version}
70
+ htmlboard v${pkg.version}
71
71
  Infinite canvas and design explorer for HTML artboards — designed for humans and LLMs
72
72
 
73
73
  Usage:
@@ -82,7 +82,7 @@ Options:
82
82
  shared files outside the designs folder (default: the designs folder)
83
83
  -o, --open Open the explorer automatically in your default browser
84
84
  --init Scaffold starter designs.json and sample artboards in target directory
85
- -v, --version Display HtmlBoard version
85
+ -v, --version Display the version
86
86
  -h, --help Display this help message
87
87
 
88
88
  Examples:
@@ -93,15 +93,12 @@ Examples:
93
93
  htmlboard --init # Initialize starter templates in current folder
94
94
  htmlboard skills install # Add the HtmlBoard skill to this project's agents
95
95
 
96
- Keyboard Shortcuts in Canvas:
97
- Space + Drag Pan canvas
98
- Ctrl/Cmd + Wheel Zoom into focal point
99
- + / - Zoom in / Zoom out
100
- 0 Reset zoom to 100%
101
- F Zoom to fit all artboards
102
- / or Cmd+K Search artboards
103
- [ or ] Toggle navigation sidebar
104
- ? Show shortcuts help dialog
96
+ On the canvas:
97
+ Drag, scroll Move around
98
+ Ctrl/Cmd + scroll Zoom (or pinch)
99
+ Double-click Fit a design (Shift + 1 fits everything)
100
+ / Search
101
+ ? All the shortcuts
105
102
  `);
106
103
  }
107
104
 
@@ -275,8 +272,8 @@ async function main() {
275
272
  });
276
273
 
277
274
  console.log(`
278
- ✦ \x1b[1m\x1b[36mHtmlBoard\x1b[0m \x1b[90mv${pkg.version}\x1b[0m
279
- \x1b[90mInfinite Canvas & Design Explorer for HTML Artboards\x1b[0m
275
+ \x1b[90mhtml\x1b[0m\x1b[1mboard\x1b[0m \x1b[90mv${pkg.version}\x1b[0m
276
+ \x1b[90mInfinite canvas for HTML designs\x1b[0m
280
277
 
281
278
  \x1b[32m➜\x1b[0m \x1b[1mLocal:\x1b[0m \x1b[36m${url}\x1b[0m
282
279
  \x1b[32m➜\x1b[0m \x1b[1mTarget:\x1b[0m \x1b[90m${targetDir}\x1b[0m${rootDir !== targetDir ? `\n \x1b[32m➜\x1b[0m \x1b[1mRoot:\x1b[0m \x1b[90m${rootDir}\x1b[0m` : ''}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "htmlboard",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Infinite canvas and design explorer for HTML artboards — designed for humans and LLMs",
5
5
  "type": "module",
6
6
  "bin": {
@@ -45,6 +45,6 @@
45
45
  "url": "https://github.com/luizcarlos1405/htmlboard/issues"
46
46
  },
47
47
  "engines": {
48
- "node": ">=18.0.0"
48
+ "node": ">=18"
49
49
  }
50
50
  }
@@ -77,16 +77,16 @@ One design per file. Keep each file self-contained so it renders on its own:
77
77
  - Sections are rows, top to bottom; designs run left to right.
78
78
  - `file` is relative to the designs folder and may carry a query string, so one file can show several states.
79
79
  - Omit `height` to let the frame grow to the page's full height (long pages, boards, docs).
80
- - Optional: `description` and `tags` (searchable); `category` for the toolbar filters (`desktop`, `mobile`, `tablet`, `components`; guessed from the path, then the width, when left out); `id` (derived from `file`).
80
+ - Optional: `description` (shown in the list), `tags` and `category` (searchable), `id` (derived from `file`).
81
81
  - `name` and `artboards` are accepted as synonyms of a section's `title` and `designs`.
82
82
 
83
83
  When the project already has a `designs.json`, add every new file to it.
84
84
 
85
85
  ## Live reload
86
86
 
87
- - Saving an artboard's HTML reloads just that frame; the user's pan and zoom stay put.
88
- - Saving `designs.json`, or creating a new HTML file, rebuilds the canvas.
89
- - Saving a shared file (CSS, script, image) reloads every frame.
87
+ - Saving an artboard's HTML reloads just that frame; the user's view stays put.
88
+ - Saving a file artboards use (a stylesheet, a script, an image, data) reloads the artboards that loaded it.
89
+ - Saving `designs.json`, or adding or removing artboards, rebuilds the canvas.
90
90
 
91
91
  ## Working with the user
92
92