construction-gantt 0.2.0 → 0.3.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/CHANGELOG.md CHANGED
@@ -1,5 +1,62 @@
1
1
  # construction-gantt
2
2
 
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - ## v0.3 — UX editing layer + construction-vertical extensions
8
+
9
+ ### Inline editing (`editMode` prop)
10
+
11
+ New `editMode` prop on `<Gantt>` gates interactive editing. When `true`:
12
+
13
+ - Click any grid cell (name, start, end, duration, progress, scheduleMode) to edit inline. Enter/Tab commits; Escape cancels; blur commits.
14
+ - `onTaskEdit(id, patch)` callback fires with only the changed field. Consumer applies via `useEditableProject` or own state.
15
+ - Summary task date/duration cells are read-only (engine-derived).
16
+ - `DEFAULT_EDIT_COLUMNS` (name 220px, start 100px, end 100px, duration 60px, progress 50px) used automatically when `editMode=true` and no `columns` prop is supplied.
17
+
18
+ ### Live CPM preview while editing
19
+
20
+ While a timing field is dirty (not yet committed), the engine runs a debounced (80ms) speculative CPM pass. Downstream tasks that would shift are rendered as blue dashed ghost bars alongside their solid live bars. Preview clears on commit or Escape. `name` / `progress` / `scheduleMode` edits skip the CPM pass (no cascade).
21
+
22
+ ### Drag-to-link dependency creation (`onLinkCreate` callback)
23
+
24
+ Hover a task bar in `editMode` to reveal a drag handle at the right edge. Drag to a target bar; a dashed SVG line follows the cursor. Drop fires `onLinkCreate(source, target, 'FS')`. Invalid targets (self, summary, duplicate link, phantom rows) are silently rejected.
25
+
26
+ ### Link deletion (`onLinkDelete` callback)
27
+
28
+ In `editMode`, clicking a rendered dependency arrow fires `onLinkDelete(linkId)`.
29
+
30
+ ### Editing command model (`useEditableProject`)
31
+
32
+ `useEditableProject(project)` returns `{ enqueue, commit, undo, redo, canUndo, canRedo, draft }` — a command-pattern draft layer with full undo/redo. Ten built-in factory functions: `updateTask`, `createTask`, `deleteTask`, `renameTask`, `setTaskStart`, `setTaskDuration`, `setTaskProgress`, `linkTasks`, `deleteLink`, `updateLink`.
33
+
34
+ ### Multi-baseline UI (`baselineIndices` prop)
35
+
36
+ `baselineIndices?: ReadonlyArray<BaselineIndex>` overlays multiple baseline snapshots as phantom ghost rows beneath each live task. Each phantom row carries its own variance pill (+Nd/−Nd). Per-baseline colour palette (up to 11 baselines). `baselineIndex` kept as a deprecated single-index alias.
37
+
38
+ ### NZ public holidays calendar
39
+
40
+ `nzPublicHolidays(year, region)` + `nzDefaultCalendar(options)` — all 13 statutory NZ regions, Matariki dates per Te Kāhui o Matariki Public Holiday Act 2022, Canterbury Show Day from employment.govt.nz year-by-year, pre-seeded 2022–2052.
41
+
42
+ ### MSPDI constraint + hierarchy preservation
43
+
44
+ `ConstraintDate` round-trips through MSPDI parse/serialize. `OutlineLevel`-based parent derivation from flat MSPDI task lists. `PercentComplete` emission added.
45
+
46
+ ### New public API exports
47
+
48
+ `TaskEditPatch`, `EditableField` — needed for typing `onTaskEdit` callbacks in consuming apps.
49
+
50
+ ### New `GanttProps`
51
+
52
+ ```ts
53
+ editMode?: boolean;
54
+ onTaskEdit?: (id: TaskId, patch: TaskEditPatch) => void;
55
+ onLinkCreate?: (source: TaskId, target: TaskId, type: DependencyType) => void;
56
+ onLinkDelete?: (linkId: LinkId) => void;
57
+ baselineIndices?: ReadonlyArray<BaselineIndex>;
58
+ ```
59
+
3
60
  ## 0.2.0
4
61
 
5
62
  ### Minor Changes