sketchmark 0.2.5 → 0.2.6

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 (2) hide show
  1. package/README.md +58 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -29,6 +29,7 @@ end
29
29
  - [DSL Reference](#dsl-reference)
30
30
  - [Diagram Header](#diagram-header)
31
31
  - [Node Shapes](#node-shapes)
32
+ - [Icons](#icon-shape)
32
33
  - [Edges](#edges)
33
34
  - [Groups](#groups)
34
35
  - [Bare Groups](#bare-groups)
@@ -37,6 +38,7 @@ end
37
38
  - [Charts](#charts)
38
39
  - [Markdown Blocks](#markdown-blocks)
39
40
  - [Themes](#themes)
41
+ - [Style Directive](#style-directive)
40
42
  - [Typography](#typography)
41
43
  - [Animation Steps](#animation-steps)
42
44
  - [Layout System](#layout-system)
@@ -127,11 +129,15 @@ end
127
129
  | Keyword | Example | Description |
128
130
  |---|---|---|
129
131
  | `title` | `title label="My Diagram"` | Title shown above the diagram |
132
+ | `description` | `description "A brief summary"` | Diagram description (metadata) |
130
133
  | `layout` | `layout row` | Root layout direction: `row`, `column`, `grid` |
131
134
  | `config gap` | `config gap=60` | Gap between root-level items (default: 80) |
132
135
  | `config margin` | `config margin=40` | Outer canvas margin (default: 60) |
133
136
  | `config theme` | `config theme=ocean` | Global palette (see [Theme Palettes](#theme-palettes)) |
134
137
  | `config font` | `config font=caveat` | Diagram-wide font (see [Font System](#font-system)) |
138
+ | `config title-color` | `config title-color=#333` | Title text color |
139
+ | `config title-size` | `config title-size=20` | Title font size in px |
140
+ | `config title-weight` | `config title-weight=700` | Title font weight |
135
141
 
136
142
  ---
137
143
 
@@ -147,6 +153,7 @@ cylinder id label="..."
147
153
  parallelogram id label="..."
148
154
  text id label="..."
149
155
  image id label="..." url="https://..."
156
+ icon id label="..." name="prefix:name"
150
157
  ```
151
158
 
152
159
  **Common properties:**
@@ -159,6 +166,9 @@ image id label="..." url="https://..."
159
166
  | `height` | `height=55` | Override auto-height in px |
160
167
  | `fill` | `fill="#e8f4ff"` | Background fill color |
161
168
  | `stroke` | `stroke="#0044cc"` | Border color |
169
+ | `stroke-width` | `stroke-width=2` | Border thickness in px |
170
+ | `stroke-dash` | `stroke-dash=5,3` | Dashed border pattern (dash, gap) |
171
+ | `opacity` | `opacity=0.5` | Element opacity (0 to 1) |
162
172
  | `color` | `color="#003399"` | Text color |
163
173
  | `font` | `font=caveat` | Font family or built-in name |
164
174
  | `font-size` | `font-size=12` | Label font size in px |
@@ -170,7 +180,9 @@ image id label="..." url="https://..."
170
180
 
171
181
  > **`text` shape:** No border or background. Long labels auto word-wrap. Use `width=` to control the wrap width.
172
182
 
173
- > **`image` shape:** Renders an image clipped to a rounded rect. Requires `url=` property.
183
+ > **`image` shape:** Renders an image clipped to a rounded rect. Requires `url=` property. Label and border only shown when explicitly set.
184
+
185
+ > **`icon` shape:** Renders an icon from [Iconify](https://iconify.design/) (200,000+ open source icons). Requires `name=` property in `prefix:name` format (e.g. `mdi:database`). Defaults to `mdi` prefix if omitted. Use `color=` to tint the icon. Label and border only shown when explicitly set. Default size: 48x48.
174
186
 
175
187
  **Example:**
176
188
  ```
@@ -178,11 +190,42 @@ box gateway label="API Gateway" theme=warning width=150 height=55
178
190
  circle user label="User" fill="#e8f4ff" stroke="#0044cc" color="#003399"
179
191
  cylinder db label="PostgreSQL" theme=success width=140 height=65
180
192
  image logo label="Logo" url="https://example.com/logo.png" width=80 height=80
193
+ icon db label="Database" name="mdi:database" color="#1976D2"
194
+ icon cloud name="mdi:cloud" width=64 height=64
181
195
  text caption label="This auto-wraps across multiple lines." width=300
182
196
  ```
183
197
 
184
198
  ---
185
199
 
200
+ ### Icon Shape
201
+
202
+ Render any of 200,000+ open source vector icons from [Iconify](https://iconify.design/).
203
+
204
+ ```
205
+ icon id [label="..."] name="prefix:name" [color="#hex"] [width=N] [height=N]
206
+ ```
207
+
208
+ | Property | Example | Description |
209
+ |---|---|---|
210
+ | `name` | `name="mdi:database"` | Icon identifier in `prefix:name` format. Defaults to `mdi` prefix if omitted |
211
+ | `color` | `color="#1976D2"` | Icon tint color |
212
+ | `stroke` | `stroke="#333"` | Optional border (not shown by default) |
213
+ | `label` | `label="DB"` | Optional label (not shown by default) |
214
+ | `width` | `width=64` | Icon width (default: 48) |
215
+ | `height` | `height=64` | Icon height (default: 48) |
216
+
217
+ Browse available icons at [icon-sets.iconify.design](https://icon-sets.iconify.design/). Common prefixes: `mdi` (Material Design), `lucide`, `heroicons`, `tabler`, `ph` (Phosphor), `ri` (Remix), `carbon`.
218
+
219
+ **Example:**
220
+ ```
221
+ icon db label="Database" name="mdi:database" color="#1976D2"
222
+ icon cloud label="Cloud" name="mdi:cloud-outline" color="#FF9800" width=64 height=64
223
+ icon lock name="mdi:lock" color="#E53935"
224
+ icon user name="lucide:user"
225
+ ```
226
+
227
+ ---
228
+
186
229
  ### Edges
187
230
 
188
231
  ```
@@ -483,6 +526,19 @@ Apply to any element: `box a theme=primary`, `group g theme=muted`, `note n them
483
526
 
484
527
  ---
485
528
 
529
+ ### Style Directive
530
+
531
+ Apply styles to any element after it's defined, by targeting its id:
532
+
533
+ ```
534
+ box a label="Hello"
535
+ style a fill="#ff0000" stroke="#cc0000" font-size=16
536
+ ```
537
+
538
+ This merges with any existing styles on the element. Useful for separating layout from styling.
539
+
540
+ ---
541
+
486
542
  ### Typography
487
543
 
488
544
  Typography properties work on all text-bearing elements.
@@ -540,6 +596,7 @@ All actions work on **all element types** — nodes, groups, tables, notes, char
540
596
  | Option | Description |
541
597
  |---|---|
542
598
  | `duration=600` | Animation duration in ms |
599
+ | `delay=100` | Delay before animation starts in ms |
543
600
  | `dx=100` | X offset for `move` |
544
601
  | `dy=-80` | Y offset for `move` |
545
602
  | `factor=1.5` | Scale multiplier |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sketchmark",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "A plain-text DSL for hand-drawn diagrams. Write boxes, edges, and groups as code — renders sketchy SVG/Canvas via rough.js with a built-in step-by-step animation system.",
5
5
  "keywords": [
6
6
  "diagram",