sketchmark 1.0.3 → 1.1.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
@@ -363,22 +363,34 @@ a --> b label="HTTPS" stroke="#cc0000" stroke-width=2 color="#aa0000" font-size=
363
363
 
364
364
  ---
365
365
 
366
- ## Groups
367
-
368
- Groups visually contain one or more nodes, tables, or nested groups.
369
-
370
- ```
371
- group <id> [label="..."] [layout=row|column|grid] [gap=N] [padding=N]
372
- [columns=N] [align=start|center|end]
373
- [justify=start|center|end|space-between|space-around]
374
- [theme=...] [fill="..."] [stroke="..."] [width=N] [height=N]
375
- {
376
- box a label="Node A"
377
- box b label="Node B"
378
- # nested groups allowed:
379
- group inner label="Inner Group" layout=row { box c label="C" }
380
- }
381
- ```
366
+ ## Groups
367
+
368
+ Groups visually contain one or more nodes, tables, charts, markdown blocks,
369
+ or other groups by referencing their ids with `items=[...]`.
370
+
371
+ ```
372
+ box a label="Node A"
373
+ box b label="Node B"
374
+ box c label="Node C"
375
+
376
+ group inner label="Inner Group" layout=row items=[c]
377
+ group outer label="Outer Group" layout=column items=[a,b,inner]
378
+ ```
379
+
380
+ General form:
381
+
382
+ ```
383
+ group <id> [label="..."] [layout=row|column|grid] [gap=N] [padding=N]
384
+ [columns=N] [align=start|center|end]
385
+ [justify=start|center|end|space-between|space-around]
386
+ [theme=...] [fill="..."] [stroke="..."] [width=N] [height=N]
387
+ [items=[id1,id2,...]]
388
+ ```
389
+
390
+ - Groups are always declared at the top level.
391
+ - `items` order is the visual child order.
392
+ - Nested groups are created by referencing another group id from `items=[...]`.
393
+ - All authored nodes, groups, tables, charts, and markdown blocks must have explicit ids.
382
394
 
383
395
  ### Group Properties
384
396
 
@@ -400,14 +412,13 @@ group <id> [label="..."] [layout=row|column|grid] [gap=N] [padding=N]
400
412
 
401
413
  #### `bare` keyword
402
414
 
403
- `bare` is an alias for a group with no visible border or fill:
404
-
405
- ```
406
- bare myContainer {
407
- box a label="Floating A"
408
- box b label="Floating B"
409
- }
410
- ```
415
+ `bare` is an alias for a group with no visible border or fill:
416
+
417
+ ```
418
+ box a label="Floating A"
419
+ box b label="Floating B"
420
+ bare myContainer layout=row items=[a,b]
421
+ ```
411
422
 
412
423
  ---
413
424
 
@@ -534,9 +545,9 @@ theme muted fill="#f5f5f5" stroke="#999999" color="#444444"
534
545
 
535
546
  box client label="Client" theme=primary
536
547
  box server label="Server" theme=warning
537
- cylinder db label="DB" theme=success
538
- group services label="Services" theme=muted { ... }
539
- ```
548
+ cylinder db label="DB" theme=success
549
+ group services label="Services" theme=muted items=[client,server,db]
550
+ ```
540
551
 
541
552
  ---
542
553
 
@@ -1062,8 +1073,8 @@ exportHTML(instance.svg, dslSource, { filename: 'diagram.html' });
1062
1073
  | `<-->` | Edge | `a <--> b` |
1063
1074
  | `--` | Edge | `a -- b` |
1064
1075
  | `---` | Edge | `a --- b` |
1065
- | `group` | Group | `group myGroup label="Services" layout=column { ... }` |
1066
- | `bare` | Group | `bare myWrap { ... }` |
1076
+ | `group` | Group | `group myGroup label="Services" layout=column items=[api,db]` |
1077
+ | `bare` | Group | `bare myWrap layout=row items=[a,b]` |
1067
1078
  | `table` | Table | `table myTable label="Users" { header Name Age }` |
1068
1079
  | `bar-chart` | Chart | `bar-chart sales label="Sales" data [...]` |
1069
1080
  | `line-chart` | Chart | `line-chart trend data [...]` |