waygraph 0.13.0 → 0.13.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.
package/dist/cli.js CHANGED
@@ -552,6 +552,9 @@ const RING_CSS =
552
552
  "#wg-todos .wg-todo-done{color:#6ee7b7;text-decoration:line-through;opacity:.85;}" +
553
553
  "#wg-todos .wg-todo-current{color:#fff;}" +
554
554
  "#wg-todos .wg-todo-pending{color:#9a7ad1;}" +
555
+ "#wg-todos[data-wg-todo-style=bullets] .wg-todo-pending," +
556
+ "#wg-todos[data-wg-todo-style=bullets] .wg-todo-current{color:#e8dcff;}" +
557
+ "#wg-todos[data-wg-todo-style=bullets] .wg-todo-mark{color:#c9a6ff;}" +
555
558
  "#wg-progress{height:4px;background:#2a1650;border-radius:2px;margin:0 0 12px;overflow:hidden;}" +
556
559
  "#wg-progress-bar{height:100%;background:#7C3AED;border-radius:2px;transition:width .3s ease;}" +
557
560
  // A real tab bar for episodes - the currently-active episode reads as
@@ -1196,21 +1199,39 @@ async function installOverlay(page, title) {
1196
1199
  return id ? ' data-wg-todo-item="' + esc(id) + '"' : "";
1197
1200
  };
1198
1201
  const renderItems = (items, style) => {
1199
- const st = style === "checklist" ? "checklist" : "sequential";
1202
+ const rawStyle = String(style || "sequential").toLowerCase();
1203
+ const st =
1204
+ rawStyle === "checklist"
1205
+ ? "checklist"
1206
+ : rawStyle === "bullets" ||
1207
+ rawStyle === "bullet" ||
1208
+ rawStyle === "list" ||
1209
+ rawStyle === "ul" ||
1210
+ rawStyle === "points" ||
1211
+ rawStyle === "plain"
1212
+ ? "bullets"
1213
+ : "sequential";
1200
1214
  return (
1201
1215
  '<ul id="wg-todos" data-wg-todo-style="' +
1202
1216
  st +
1203
1217
  '">' +
1204
1218
  (items || [])
1205
1219
  .map((t) => {
1206
- const cls = t.current
1207
- ? "wg-todo-current"
1208
- : t.done
1209
- ? "wg-todo-done"
1210
- : "wg-todo-pending";
1220
+ const cls =
1221
+ st === "bullets"
1222
+ ? t.done
1223
+ ? "wg-todo-done"
1224
+ : "wg-todo-pending"
1225
+ : t.current
1226
+ ? "wg-todo-current"
1227
+ : t.done
1228
+ ? "wg-todo-done"
1229
+ : "wg-todo-pending";
1211
1230
  let mark;
1212
1231
  if (st === "checklist") {
1213
1232
  mark = t.done ? "\u2611" : "\u2610";
1233
+ } else if (st === "bullets") {
1234
+ mark = "\u2022";
1214
1235
  } else {
1215
1236
  mark = t.done ? "\u2713" : t.current ? "\u2192" : "\u25CB";
1216
1237
  }
@@ -51,8 +51,9 @@ export type WaygraphTodoInput = string | WaygraphTodoItem;
51
51
  * Dock list presentation:
52
52
  * - `sequential` - arrow on current, strike done (demo walkthrough)
53
53
  * - `checklist` - checkbox done/pending only (no current arrow; independent checks)
54
+ * - `bullets` - flat bullet list (no arrow/checkbox; open notes / trimmed dock)
54
55
  */
55
- export type TodoListStyle = "sequential" | "checklist";
56
+ export type TodoListStyle = "sequential" | "checklist" | "bullets";
56
57
  /** One titled group in the floating todo dock (FR / Scenarios / ACs, etc.). */
57
58
  export type WaygraphTodoGroupInput = {
58
59
  /** Stable group id -> `data-wg-todo-group`. */
@@ -99,7 +100,7 @@ export type StubPhaseFixtures = {
99
100
  * (e.g. Mailhog -> back to app and still find the checklist).
100
101
  */
101
102
  todoId?: string;
102
- /** `sequential` (default) or `checklist`. */
103
+ /** `sequential` (default), `checklist`, or `bullets`. */
103
104
  todoStyle?: TodoListStyle;
104
105
  /** Multiple titled lists (FR / Scenarios / ACs). Wins over bare todos when set. */
105
106
  todoGroups?: readonly WaygraphTodoGroupInput[];
@@ -280,8 +281,8 @@ export type StubCtx<Out extends Checkpoint<string> = Checkpoint<string>> = {
280
281
  */
281
282
  todoId(id: string): void;
282
283
  /**
283
- * Dock presentation: `sequential` (arrow walkthrough) or `checklist`
284
- * (independent checkboxes, no current arrow).
284
+ * Dock presentation: `sequential` (arrow walkthrough), `checklist`
285
+ * (independent checkboxes), or `bullets` (flat • list, no progress marks).
285
286
  */
286
287
  todoStyle(style: TodoListStyle): void;
287
288
  /**
@@ -510,7 +511,8 @@ export declare function normalizeTodoPos(raw: unknown): "left" | "right" | undef
510
511
  export declare function normalizeTodoStyle(raw: unknown): TodoListStyle | undefined;
511
512
  /**
512
513
  * Normalize checklist rows; apply todoIndex for sequential done/current.
513
- * In checklist mode, todoIndex is ignored unless items omit explicit done.
514
+ * In checklist / bullets mode, todoIndex is ignored unless items omit explicit done
515
+ * (bullets never auto-mark current).
514
516
  */
515
517
  export declare function normalizeTodos(todos: readonly WaygraphTodoInput[] | undefined, todoIndex?: number, style?: TodoListStyle): WaygraphTodoItem[];
516
518
  /** Build the floating dock from bag / phase fields. */
@@ -540,13 +542,13 @@ export declare function applyTodoPhase(prev: TodoDockState | undefined, phase: {
540
542
  sync: "set" | "clear" | "keep";
541
543
  };
542
544
  /**
543
- * Advance every sequential group to `index` (capped). Checklist groups unchanged.
545
+ * Advance every sequential group to `index` (capped). Checklist / bullets unchanged.
544
546
  * Used while cycling rings / fill/click stubs so the walkthrough moves.
545
547
  */
546
548
  export declare function advanceTodoDock(dock: TodoDockState | undefined, index: number): TodoDockState | undefined;
547
549
  /**
548
550
  * Mark sequential groups complete (all done, none current) - e.g. end of step.
549
- * Checklist groups keep explicit done flags.
551
+ * Checklist / bullets groups keep explicit done flags.
550
552
  */
551
553
  export declare function completeSequentialTodoDock(dock: TodoDockState | undefined): TodoDockState | undefined;
552
554
  /**
@@ -495,11 +495,20 @@ export function normalizeTodoStyle(raw) {
495
495
  return "sequential";
496
496
  if (s === "checklist" || s === "check" || s === "checks" || s === "box")
497
497
  return "checklist";
498
+ if (s === "bullets" ||
499
+ s === "bullet" ||
500
+ s === "list" ||
501
+ s === "ul" ||
502
+ s === "points" ||
503
+ s === "plain") {
504
+ return "bullets";
505
+ }
498
506
  return undefined;
499
507
  }
500
508
  /**
501
509
  * Normalize checklist rows; apply todoIndex for sequential done/current.
502
- * In checklist mode, todoIndex is ignored unless items omit explicit done.
510
+ * In checklist / bullets mode, todoIndex is ignored unless items omit explicit done
511
+ * (bullets never auto-mark current).
503
512
  */
504
513
  export function normalizeTodos(todos, todoIndex, style = "sequential") {
505
514
  if (!todos || todos.length === 0)
@@ -523,6 +532,11 @@ export function normalizeTodos(todos, todoIndex, style = "sequential") {
523
532
  item.current = false;
524
533
  return item;
525
534
  }
535
+ if (style === "bullets") {
536
+ // Flat list: no walkthrough current; keep explicit done if authored.
537
+ item.current = false;
538
+ return item;
539
+ }
526
540
  if (idx !== undefined) {
527
541
  if (item.done === undefined)
528
542
  item.done = i < idx;
@@ -606,7 +620,7 @@ export function applyTodoPhase(prev, phase) {
606
620
  return { dock: prev, sync: "keep" };
607
621
  }
608
622
  /**
609
- * Advance every sequential group to `index` (capped). Checklist groups unchanged.
623
+ * Advance every sequential group to `index` (capped). Checklist / bullets unchanged.
610
624
  * Used while cycling rings / fill/click stubs so the walkthrough moves.
611
625
  */
612
626
  export function advanceTodoDock(dock, index) {
@@ -636,7 +650,7 @@ export function advanceTodoDock(dock, index) {
636
650
  }
637
651
  /**
638
652
  * Mark sequential groups complete (all done, none current) - e.g. end of step.
639
- * Checklist groups keep explicit done flags.
653
+ * Checklist / bullets groups keep explicit done flags.
640
654
  */
641
655
  export function completeSequentialTodoDock(dock) {
642
656
  if (!dock)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waygraph",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
4
4
  "type": "module",
5
5
  "description": "A typed graph of reusable Blocks for driving a browser through E2E flows.",
6
6
  "license": "MIT",