construction-gantt 0.1.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,76 @@
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
+
60
+ ## 0.2.0
61
+
62
+ ### Minor Changes
63
+
64
+ - b59d1fe: Multi-baseline UI: render multiple captured baselines simultaneously for variation-claim delay analysis under NZS 3910 / AS 4000.
65
+
66
+ - New `baselineIndices: ReadonlyArray<BaselineIndex>` prop on `<Gantt>` overlays one phantom ghost row per selected baseline.
67
+ - Existing `baselineIndex` prop continues to work; deprecated, removed at v1.0.
68
+ - Each phantom row in multi-baseline mode carries its own variance pill; single-baseline mode keeps the pill on the live bar (existing behaviour).
69
+ - Per-baseline CSS class `bode-baseline-${N}` for indices 0–10 ships with a default palette; consumers override via higher-specificity rules.
70
+ - Phantom row label includes `baseline.name` (or `Baseline N` fallback) and formatted `capturedAt`.
71
+
72
+ No engine changes (ADR-005 preserved). Render-layer only. Test infrastructure additions: canvas 2D context stub at `vitest.setup.ts` so SVAR mounts under happy-dom.
73
+
3
74
  ## 0.1.0
4
75
 
5
76
  ### Minor Changes
package/LICENSE.md ADDED
@@ -0,0 +1,27 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Rips Cassels
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ ---
24
+
25
+ This software wraps and depends on free SVAR React Gantt (also MIT-licensed). Consumers
26
+ must also accept that license. See https://github.com/svar-widgets/gantt for SVAR's
27
+ terms.