@htmlbricks/hb-stylus-paper 0.66.7 → 0.66.9
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 +47 -0
- package/manifest.json +1 -1
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
## `hb-stylus-paper` — stylus-paper
|
|
2
|
+
|
|
3
|
+
**Category:** inputs
|
|
4
|
+
**Tags:** inputs, drawing
|
|
5
|
+
|
|
6
|
+
### What it does
|
|
7
|
+
|
|
8
|
+
Freehand drawing surface with modes (`draw`, `eraser`, `select`), brush `options`, `background_color` / `pen_color` / `pen_opacity`, and optional `load_draw`, `insert_image`, or `insert_text`. Supports `save_as`, paper `size`, `view` (zoom/pan locks), `goto` page index, and rich events for strokes, selection, history, save, and asset load.
|
|
9
|
+
|
|
10
|
+
### Custom element
|
|
11
|
+
|
|
12
|
+
`hb-stylus-paper`
|
|
13
|
+
|
|
14
|
+
### Attributes (snake_case; use string values in HTML)
|
|
15
|
+
|
|
16
|
+
- `id` (optional), `style` (optional), `draw_id` (optional): strings.
|
|
17
|
+
- `background_color`, `pen_color` (optional): strings (CSS colors).
|
|
18
|
+
- `pen_opacity` (optional): number as string.
|
|
19
|
+
- `mode` (optional): `"eraser"` | `"draw"` | `"select"`.
|
|
20
|
+
- `debug` (optional): `"yes"` | `"no"`.
|
|
21
|
+
- `options` (optional): JSON string — brush options (`size`, `thinning`, `smoothing`, `streamline`, `simulatePressure`, etc.).
|
|
22
|
+
- `load_draw` (optional): JSON string — full save document with `draw`, `size.paperSize`, ids, version.
|
|
23
|
+
- `save_as` (optional): JSON string — `{ name; type: TSaveType }`.
|
|
24
|
+
- `insert_image` (optional): JSON string — `{ name; type; uri?; base64? }`.
|
|
25
|
+
- `insert_text` (optional): JSON string — `{ name; content }`.
|
|
26
|
+
- `size` (optional): JSON string — paper dimensions / `paperSize` enum.
|
|
27
|
+
- `view` (optional): JSON string — `{ lockPan; lockZoom; zoom; pan }`.
|
|
28
|
+
- `goto` (optional): number as string.
|
|
29
|
+
|
|
30
|
+
### Events
|
|
31
|
+
|
|
32
|
+
- `beginStroke`, `startStroke`, `endStroke`: stroke lifecycle with ids, timestamps, geometry, and `draw_id`.
|
|
33
|
+
- `selection`: bounding box and selected strokes.
|
|
34
|
+
- `historyIndex`, `changeIndex`: undo/redo index changes.
|
|
35
|
+
- `save`: full `TSave` payload.
|
|
36
|
+
- `drawLoaded`, `imageLoaded`, `txtLoaded`: load outcomes.
|
|
37
|
+
|
|
38
|
+
### Usage notes
|
|
39
|
+
|
|
40
|
+
- No slots or CSS parts in `extra/docs.ts` for this component.
|
|
41
|
+
- Declared **size** metadata: fullscreen layout.
|
|
42
|
+
|
|
43
|
+
### Minimal HTML example
|
|
44
|
+
|
|
45
|
+
```html
|
|
46
|
+
<hb-stylus-paper mode="draw" pen_color="rgb(0,0,0)" debug="no"></hb-stylus-paper>
|
|
47
|
+
```
|
package/manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@htmlbricks/hb-stylus-paper",
|
|
3
|
-
"version": "0.66.
|
|
3
|
+
"version": "0.66.9",
|
|
4
4
|
"contributors": [],
|
|
5
5
|
"description": "Freehand drawing surface with modes (`draw`, `eraser`, `select`), brush `options`, `background_color` / `pen_color` / `pen_opacity`, and optional `load_draw`, `insert_image`, or `insert_text`. Supports `save_as`, `size`, `view`, `goto`, and events for strokes, selection, history, save, and asset load.",
|
|
6
6
|
"licenses": [
|