@umriss-ui/schedule 0.48.0 → 0.49.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 +13 -0
- package/README.md +3 -3
- package/dist/schedule.js +105 -101
- package/docs/llms-full.md +19 -19
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -18,6 +18,19 @@ moves from here under the rule above.
|
|
|
18
18
|
|
|
19
19
|
---
|
|
20
20
|
|
|
21
|
+
## 0.49.0 – The second shakedown: lists that shrink, a flood that scrolls, five things the table lacked (Oct. 2026)
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
|
|
25
|
+
- **The week bands follow the formats' `weekStart`**: a Sunday-first locale sees its weeks open on Sunday; the default formats keep Monday.
|
|
26
|
+
- In development, a subtask whose `from`/`to` are strings, Dates or seconds warns once, naming the expected milliseconds.
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
|
|
30
|
+
- **`Dependencies` placed before `Subtasks`** (the README's own order) no longer warns that a drawn dependency is left out.
|
|
31
|
+
- **The plot is named "<label>, plot"**, so a screen reader no longer hears the figure's name twice.
|
|
32
|
+
- **README links resolve on npm**: links to files the package does not ship point to the repository on GitHub.
|
|
33
|
+
|
|
21
34
|
## 0.48.0 – Released in step with core (Oct. 2026)
|
|
22
35
|
|
|
23
36
|
No change of its own; the number moves with core's touch scale, now an opt-in (ADR-0079): a `md` control of core stays 32 px under a finger unless the application imports `@umriss-ui/core/touch-scale.css`.
|
package/README.md
CHANGED
|
@@ -231,14 +231,14 @@ Done from this list: **blocked time** per lane and **milestones**.
|
|
|
231
231
|
**Dependency**, **Violated dependency**, **Blocked time**, **Milestone**, **Lane header**, **Lane group**,
|
|
232
232
|
**Miniature**, **Intent**, **Ghost** — stands in the workspace's
|
|
233
233
|
`CONTEXT.md`, section "The schedule".
|
|
234
|
-
* [`../../docs/design-language.md`](
|
|
234
|
+
* [`../../docs/design-language.md`](https://github.com/romanhaendler/umriss-ui/blob/main/docs/design-language.md) — the design
|
|
235
235
|
language all five packages share.
|
|
236
236
|
|
|
237
237
|
## Testing
|
|
238
238
|
|
|
239
239
|
Tested under Vitest 5 and Jest 30 on jsdom. A schedule draws with core and charts, so it needs the
|
|
240
|
-
runner lines and the setup file of [`@umriss-ui/core`'s Testing section](
|
|
241
|
-
and the setup file of [`@umriss-ui/charts`'](
|
|
240
|
+
runner lines and the setup file of [`@umriss-ui/core`'s Testing section](https://github.com/romanhaendler/umriss-ui/blob/main/packages/core/README.md#testing)
|
|
241
|
+
and the setup file of [`@umriss-ui/charts`'](https://github.com/romanhaendler/umriss-ui/blob/main/packages/charts/README.md#testing), one file after the other
|
|
242
242
|
in your `umriss.setup.js`. `check:dist` runs a test of the installed schedule (a lane with a bar)
|
|
243
243
|
with exactly those files.
|
|
244
244
|
|
package/dist/schedule.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "./schedule.css";
|
|
3
3
|
import { localOffset as je, toWorkingTimeClamped as V, calendarFrom as Tt, toWallClock as qt, MINUTE as Z, DAY as J, timeStep as _s, workingTimeTicks as Os, inDoubledHour as Fs, HOUR as jt, LinearScale as $s, resolveColours as Es, removedIntervals as Bs, subscribeTheme as xs } from "@umriss-ui/charts";
|
|
4
|
-
import { useContext as Zt, useEffect as Y, createContext as Ze, useRef as W, useId as Je, useState as ht, useLayoutEffect as yt, useImperativeHandle as Ns, useSyncExternalStore as Jt, useMemo as U, createElement as
|
|
5
|
-
import { jsxs as E, Fragment as
|
|
6
|
-
import { zoneFields as Qe, zoneInstant as Kt, useWording as mt, useFormats as St, useTimeZoneLabel as
|
|
4
|
+
import { useContext as Zt, useEffect as Y, createContext as Ze, useRef as W, useId as Je, useState as ht, useLayoutEffect as yt, useImperativeHandle as Ns, useSyncExternalStore as Jt, useMemo as U, createElement as Ps } from "react";
|
|
5
|
+
import { jsxs as E, Fragment as ot, jsx as p } from "react/jsx-runtime";
|
|
6
|
+
import { zoneFields as Qe, zoneInstant as Kt, useWording as mt, useFormats as St, useTimeZoneLabel as Rs, Skeleton as Gs, AngleGlyph as Hs, VisuallyHidden as Le, createLongPress as Ks, zoneDayStart as Ys } from "@umriss-ui/core";
|
|
7
7
|
function Q(s) {
|
|
8
8
|
return { from: s.from - (s.leadIn ?? 0), to: s.to + (s.leadOut ?? 0) };
|
|
9
9
|
}
|
|
@@ -171,7 +171,7 @@ function qs(s) {
|
|
|
171
171
|
function Lt(s, t) {
|
|
172
172
|
ie(s, t, (e, n) => e.registerLayer(n), (e, n, i) => e.updateLayer(n, i), (e, n) => e.unregisterLayer(n));
|
|
173
173
|
}
|
|
174
|
-
const ns = 24, js = 4, Zs = 3,
|
|
174
|
+
const ns = 24, js = 4, Zs = 3, Pt = 4;
|
|
175
175
|
function Ae(s) {
|
|
176
176
|
const { lanes: t, groups: e, collapsed: n, laneHeight: i, headHeight: o = ns } = s, a = new Map(e.map((b) => [b.id, b])), r = (b) => b !== void 0 && a.has(b) ? b : void 0, l = /* @__PURE__ */ new Map(), d = (b) => {
|
|
177
177
|
const S = [];
|
|
@@ -193,13 +193,13 @@ function Ae(s) {
|
|
|
193
193
|
let k = [], f = null, v = 0;
|
|
194
194
|
const C = (b) => (c.push({ ...b, top: v }), v += b.height, c.length - 1), A = (b) => b.find((S) => n.has(S)), M = () => {
|
|
195
195
|
if (f === null) return;
|
|
196
|
-
const { row: b, lanes: S } = f, I = c[b], F = Math.max(I.height, S.length * js + 2 *
|
|
196
|
+
const { row: b, lanes: S } = f, I = c[b], F = Math.max(I.height, S.length * js + 2 * Pt);
|
|
197
197
|
c[b] = { ...I, height: F }, v += F - I.height;
|
|
198
|
-
const O = F - 2 *
|
|
198
|
+
const O = F - 2 * Pt, R = Math.max(Zs, Math.floor(O / S.length));
|
|
199
199
|
S.forEach((q, gt) => {
|
|
200
200
|
const kt = h.get(q) ?? [];
|
|
201
201
|
m.set(q, {
|
|
202
|
-
top: I.top +
|
|
202
|
+
top: I.top + Pt + gt * R,
|
|
203
203
|
height: R,
|
|
204
204
|
miniature: !0,
|
|
205
205
|
group: kt[kt.length - 1]
|
|
@@ -255,7 +255,7 @@ function Js(s, t) {
|
|
|
255
255
|
for (const n of s) t.has(n) || e.add(n);
|
|
256
256
|
return e;
|
|
257
257
|
}
|
|
258
|
-
function
|
|
258
|
+
function at(s, t) {
|
|
259
259
|
if (t < 0 || t >= s.height) return null;
|
|
260
260
|
let e = 0, n = s.rows.length - 1;
|
|
261
261
|
for (; e <= n; ) {
|
|
@@ -270,7 +270,7 @@ function oe(s, t) {
|
|
|
270
270
|
return s.slots.get(t) ?? null;
|
|
271
271
|
}
|
|
272
272
|
function Qs(s, t) {
|
|
273
|
-
const e =
|
|
273
|
+
const e = at(s, t);
|
|
274
274
|
if (e === null) return null;
|
|
275
275
|
if (e.kind === "lane") return e.lane ?? null;
|
|
276
276
|
if (e.kind === "groupHead") return null;
|
|
@@ -279,7 +279,7 @@ function Qs(s, t) {
|
|
|
279
279
|
return null;
|
|
280
280
|
}
|
|
281
281
|
const tn = 6, is = 3, dt = 2, De = 3, _e = 3;
|
|
282
|
-
function
|
|
282
|
+
function x(s, t) {
|
|
283
283
|
return Math.round(s.scale.toPx(V(t, s.calendar)));
|
|
284
284
|
}
|
|
285
285
|
function tt(s, t) {
|
|
@@ -288,7 +288,7 @@ function tt(s, t) {
|
|
|
288
288
|
}
|
|
289
289
|
function ae(s, t) {
|
|
290
290
|
const e = tt(s, t.lane);
|
|
291
|
-
return e === null ? null : { x:
|
|
291
|
+
return e === null ? null : { x: x(s, t.at), y: e.top + e.height / 2, half: Math.max(2, Math.min(7, e.height * 0.3)) };
|
|
292
292
|
}
|
|
293
293
|
function Oe(s, t) {
|
|
294
294
|
return Qs(s.rows, t + s.scrollY);
|
|
@@ -301,10 +301,10 @@ function os(s, t, e, n) {
|
|
|
301
301
|
depth: n,
|
|
302
302
|
y: r + (e.miniature ? 0 : Math.min(n, _e) * De),
|
|
303
303
|
height: a,
|
|
304
|
-
outerFrom:
|
|
305
|
-
mainFrom:
|
|
306
|
-
mainTo:
|
|
307
|
-
outerTo:
|
|
304
|
+
outerFrom: x(s, l.from),
|
|
305
|
+
mainFrom: x(s, t.from),
|
|
306
|
+
mainTo: x(s, t.to),
|
|
307
|
+
outerTo: x(s, l.to)
|
|
308
308
|
};
|
|
309
309
|
}
|
|
310
310
|
function as(s, t, e) {
|
|
@@ -338,7 +338,7 @@ function Fe(s, t, e) {
|
|
|
338
338
|
return s === "centre" || e.y === t.y ? n : Math.round(e.y > t.y ? t.y + t.height - 1 : t.y + 1);
|
|
339
339
|
}
|
|
340
340
|
function Vt(s, t, e, n, i) {
|
|
341
|
-
const o = t.route ?? i.route, a = t.attach ?? i.attach, r = t.ends ?? i.ends, l =
|
|
341
|
+
const o = t.route ?? i.route, a = t.attach ?? i.attach, r = t.ends ?? i.ends, l = x(s, Qt(t, e.subtask)), d = x(s, te(t, n.subtask)), h = Fe(a, e, n), c = Fe(a, n, e);
|
|
342
342
|
if (o === "straight")
|
|
343
343
|
return { dependency: t, kind: o, ends: r, x1: l, y1: h, x2: d, y2: c, c1x: l, c2x: d, points: [l, h, d, c] };
|
|
344
344
|
if (o === "orthogonal") {
|
|
@@ -391,12 +391,12 @@ function un(s, t = rs, e) {
|
|
|
391
391
|
}
|
|
392
392
|
return o;
|
|
393
393
|
}
|
|
394
|
-
const
|
|
394
|
+
const Rt = [1, 2, 7, 14, 28];
|
|
395
395
|
function fn(s, t) {
|
|
396
|
-
return
|
|
396
|
+
return Rt.find((e) => e * s >= t) ?? Rt[Rt.length - 1];
|
|
397
397
|
}
|
|
398
|
-
function Gt(s, t, e) {
|
|
399
|
-
return ((Math.round((s - je(s, e)) / J) -
|
|
398
|
+
function Gt(s, t, e, n = 1) {
|
|
399
|
+
return ((Math.round((s - je(s, e)) / J) - 3 - n) % t + t) % t === 0;
|
|
400
400
|
}
|
|
401
401
|
function j(s, t) {
|
|
402
402
|
const e = s.time(new Date(t), !1);
|
|
@@ -595,12 +595,12 @@ class gn {
|
|
|
595
595
|
aim at. Hover, the tooltip and selection do read a strip - they cost
|
|
596
596
|
nothing if they are a pixel out. */
|
|
597
597
|
dropLaneIdAt(t) {
|
|
598
|
-
const e =
|
|
598
|
+
const e = at(this.rows, t + this.scrollY);
|
|
599
599
|
return e === null || e.kind !== "lane" ? null : e.lane ?? null;
|
|
600
600
|
}
|
|
601
601
|
/** The folded group a y lies over, or null. */
|
|
602
602
|
foldedGroupAt(t) {
|
|
603
|
-
const e =
|
|
603
|
+
const e = at(this.rows, t + this.scrollY);
|
|
604
604
|
return e !== null && e.kind === "miniature" ? e.group ?? null : null;
|
|
605
605
|
}
|
|
606
606
|
/** Pans by pixels. Says what moved: the span through time, the lanes, or
|
|
@@ -618,7 +618,7 @@ class gn {
|
|
|
618
618
|
return this.domain = mn(this.domain, i, e, this.options.zoomLimits), n[0] !== this.domain[0] || n[1] !== this.domain[1];
|
|
619
619
|
}
|
|
620
620
|
}
|
|
621
|
-
const kn = "_root_9ariw_4 _text_18806_22", wn = "_corner_9ariw_19", vn = "_zoneLabel_9ariw_24", yn = "_dayBand_9ariw_43", bn = "_headers_9ariw_48", Mn = "_plot_9ariw_53", Tn = "_cornerBottom_9ariw_58", Sn = "_tickBand_9ariw_63", In = "_dataKey_9ariw_69", Ln = "_dataPanel_9ariw_100", Cn = "_dataTable_9ariw_119", An = "_day_9ariw_43", Dn = "_dayLabel_9ariw_179", _n = "_tick_9ariw_63", On = "_tickLabel_9ariw_200", Fn = "_header_9ariw_48", $n = "_headerLabel_9ariw_229", En = "_headerCount_9ariw_265", Bn = "_chevron_9ariw_274", xn = "_focusRing_9ariw_372", Nn = "_layer_9ariw_390",
|
|
621
|
+
const kn = "_root_9ariw_4 _text_18806_22", wn = "_corner_9ariw_19", vn = "_zoneLabel_9ariw_24", yn = "_dayBand_9ariw_43", bn = "_headers_9ariw_48", Mn = "_plot_9ariw_53", Tn = "_cornerBottom_9ariw_58", Sn = "_tickBand_9ariw_63", In = "_dataKey_9ariw_69", Ln = "_dataPanel_9ariw_100", Cn = "_dataTable_9ariw_119", An = "_day_9ariw_43", Dn = "_dayLabel_9ariw_179", _n = "_tick_9ariw_63", On = "_tickLabel_9ariw_200", Fn = "_header_9ariw_48", $n = "_headerLabel_9ariw_229", En = "_headerCount_9ariw_265", Bn = "_chevron_9ariw_274", xn = "_focusRing_9ariw_372", Nn = "_layer_9ariw_390", Pn = "_grip_9ariw_417", Rn = "_ghostLabel_9ariw_427", Gn = "_finding_9ariw_440", Hn = "_refusal_9ariw_448", Kn = "_tooltip_9ariw_452", Yn = "_tooltipHead_9ariw_471", Vn = "_tooltipTimes_9ariw_476", zn = "_now_9ariw_485", Wn = "_barLabel_9ariw_499", Un = "_barLabelText_9ariw_512", g = {
|
|
622
622
|
root: kn,
|
|
623
623
|
corner: wn,
|
|
624
624
|
zoneLabel: vn,
|
|
@@ -640,8 +640,8 @@ const kn = "_root_9ariw_4 _text_18806_22", wn = "_corner_9ariw_19", vn = "_zoneL
|
|
|
640
640
|
chevron: Bn,
|
|
641
641
|
focusRing: xn,
|
|
642
642
|
layer: Nn,
|
|
643
|
-
grip:
|
|
644
|
-
ghostLabel:
|
|
643
|
+
grip: Pn,
|
|
644
|
+
ghostLabel: Rn,
|
|
645
645
|
finding: Gn,
|
|
646
646
|
refusal: Hn,
|
|
647
647
|
tooltip: Kn,
|
|
@@ -669,14 +669,14 @@ function Xn({ target: s, lane: t }) {
|
|
|
669
669
|
...s.violatedDependencies.map((f) => n.scheduleViolatedBy(i(f.shortBy))),
|
|
670
670
|
...s.blocked.map((f) => n.scheduleInBlockedTime(f.label))
|
|
671
671
|
];
|
|
672
|
-
return /* @__PURE__ */ E(
|
|
672
|
+
return /* @__PURE__ */ E(ot, { children: [
|
|
673
673
|
t,
|
|
674
674
|
`, ${k.join(", ")}`
|
|
675
675
|
] });
|
|
676
676
|
}
|
|
677
677
|
if (s.kind === "milestone") {
|
|
678
678
|
const { milestone: c } = s;
|
|
679
|
-
return /* @__PURE__ */ E(
|
|
679
|
+
return /* @__PURE__ */ E(ot, { children: [
|
|
680
680
|
t,
|
|
681
681
|
`, ${n.scheduleMilestone(c.label ?? c.id)}, ${e.dateShort(new Date(c.at))} ${o(c.at)}`
|
|
682
682
|
] });
|
|
@@ -693,7 +693,7 @@ function qn({ target: s }) {
|
|
|
693
693
|
const t = St(), e = mt(), n = (h) => j(t, h), i = re();
|
|
694
694
|
if (s.kind === "subtask") {
|
|
695
695
|
const { subtask: h, task: c } = s;
|
|
696
|
-
return /* @__PURE__ */ E(
|
|
696
|
+
return /* @__PURE__ */ E(ot, { children: [
|
|
697
697
|
/* @__PURE__ */ p("span", { className: g.tooltipHead, children: c?.name ?? h.task }),
|
|
698
698
|
/* @__PURE__ */ p("span", { children: h.name ?? h.id }),
|
|
699
699
|
/* @__PURE__ */ p("span", { className: g.tooltipTimes, children: e.scheduleGhostTimes(n(h.from), n(h.to)) }),
|
|
@@ -706,13 +706,13 @@ function qn({ target: s }) {
|
|
|
706
706
|
}
|
|
707
707
|
if (s.kind === "milestone") {
|
|
708
708
|
const { milestone: h } = s;
|
|
709
|
-
return /* @__PURE__ */ E(
|
|
709
|
+
return /* @__PURE__ */ E(ot, { children: [
|
|
710
710
|
/* @__PURE__ */ p("span", { className: g.tooltipHead, children: e.scheduleMilestone(h.label ?? h.id) }),
|
|
711
711
|
/* @__PURE__ */ p("span", { className: g.tooltipTimes, children: `${t.dateShort(new Date(h.at))} ${n(h.at)}` })
|
|
712
712
|
] });
|
|
713
713
|
}
|
|
714
714
|
const { dependency: o, task: a, from: r, to: l, violated: d } = s;
|
|
715
|
-
return /* @__PURE__ */ E(
|
|
715
|
+
return /* @__PURE__ */ E(ot, { children: [
|
|
716
716
|
/* @__PURE__ */ p("span", { className: g.tooltipHead, children: a?.name ?? a?.id ?? o.id }),
|
|
717
717
|
/* @__PURE__ */ p("span", { children: e.scheduleRoute(r?.name ?? o.from, l?.name ?? o.to) }),
|
|
718
718
|
/* @__PURE__ */ p("span", { children: `${e.scheduleDependency} ${i(o.lag)}` }),
|
|
@@ -751,7 +751,7 @@ function ei(s) {
|
|
|
751
751
|
style: kt,
|
|
752
752
|
children: ws,
|
|
753
753
|
...vs
|
|
754
|
-
} = s, de = { "aria-label": n, "aria-labelledby": i }, Ct = Je(), At = `${Ct}-summary`, Dt = W(null), he = W(null), ce = W(null), ue = W(null),
|
|
754
|
+
} = s, de = { "aria-label": n, "aria-labelledby": i }, Ct = Je(), At = `${Ct}-summary`, Dt = W(null), he = W(null), ce = W(null), ue = W(null), N = St(), B = mt(), rt = N.timeZone, wt = Rs(), fe = h?.min ?? $e.min, me = h?.max ?? $e.max, pe = typeof c == "object" ? c.step : null, ge = typeof c == "object" ? c.offset : null, ke = typeof c == "object" ? null : c, [ys, bs] = ht(() => Date.now());
|
|
755
755
|
Y(() => {
|
|
756
756
|
if (R !== !0) return;
|
|
757
757
|
const u = setInterval(() => bs(Date.now()), Z);
|
|
@@ -760,8 +760,8 @@ function ei(s) {
|
|
|
760
760
|
const we = R === !0 ? ys : typeof R == "number" ? R : null;
|
|
761
761
|
yt(() => {
|
|
762
762
|
const u = ke ?? { step: pe ?? 0, offset: ge ?? 0 };
|
|
763
|
-
e.setOptions({ laneHeight: r, calendar: d, zoomLimits: { min: fe, max: me }, snap: u, intents: m, now: we, timeZone:
|
|
764
|
-
}, [e, r, d, fe, me, ke, pe, ge, m, we,
|
|
763
|
+
e.setOptions({ laneHeight: r, calendar: d, zoomLimits: { min: fe, max: me }, snap: u, intents: m, now: we, timeZone: rt, route: b, attach: S, ends: I });
|
|
764
|
+
}, [e, r, d, fe, me, ke, pe, ge, m, we, rt, b, S, I]), Y(() => {
|
|
765
765
|
e.setHandlers({ onIntent: k, canMoveTo: f, onInteraction: v, onSelectedTaskChange: A });
|
|
766
766
|
}, [e, k, f, v, A]), Ns(t, () => Dt.current, []), Y(() => {
|
|
767
767
|
e.setLoading(q);
|
|
@@ -780,12 +780,12 @@ function ei(s) {
|
|
|
780
780
|
Nt !== void 0 && e.resize(Nt.width, Nt.height);
|
|
781
781
|
});
|
|
782
782
|
_.observe(y);
|
|
783
|
-
const
|
|
784
|
-
|
|
785
|
-
const
|
|
786
|
-
|
|
787
|
-
const
|
|
788
|
-
|
|
783
|
+
const P = document.createElement("div");
|
|
784
|
+
P.setAttribute("aria-hidden", "true"), P.style.cssText = "position:absolute;visibility:hidden;pointer-events:none;width:1rem;height:0", u.appendChild(P);
|
|
785
|
+
const H = () => e.setFontScale(ln(parseFloat(getComputedStyle(P).width)));
|
|
786
|
+
H();
|
|
787
|
+
const K = new ResizeObserver(H);
|
|
788
|
+
K.observe(P);
|
|
789
789
|
const st = (z) => e.wheel(z);
|
|
790
790
|
u.addEventListener("wheel", st, { passive: !1 });
|
|
791
791
|
const Se = (z) => e.touchMove(z);
|
|
@@ -794,13 +794,13 @@ function ei(s) {
|
|
|
794
794
|
z.key === "Escape" && e.cancelEdit() && z.preventDefault();
|
|
795
795
|
};
|
|
796
796
|
return window.addEventListener("keydown", Ie), () => {
|
|
797
|
-
window.removeEventListener("keydown", Ie), u.removeEventListener("wheel", st), u.removeEventListener("touchmove", Se), _.disconnect(),
|
|
797
|
+
window.removeEventListener("keydown", Ie), u.removeEventListener("wheel", st), u.removeEventListener("touchmove", Se), _.disconnect(), K.disconnect(), P.remove(), e.unbind();
|
|
798
798
|
};
|
|
799
799
|
}, [e]);
|
|
800
|
-
const w = Jt(e.subscribe, e.getSnapshot, e.getServerSnapshot), { fontScale:
|
|
800
|
+
const w = Jt(e.subscribe, e.getSnapshot, e.getServerSnapshot), { fontScale: lt } = w, _t = Jn * lt, Ms = Qn * lt, Ts = ti * lt, Ss = (u, y) => {
|
|
801
801
|
const L = new Date(u);
|
|
802
|
-
return y >= Ts ?
|
|
803
|
-
}, Is = w.days.reduce((u, y) => Math.max(u, y.width), 0), et = fn(Is, _t), ve = w.step >= J ? et : 1, ye = w.dataTable?.open === !0, T = w.ghost,
|
|
802
|
+
return y >= Ts ? N.dateLong(L) : y >= Ms ? N.date(L) : y >= _t ? N.dateShort(L) : "";
|
|
803
|
+
}, Is = w.days.reduce((u, y) => Math.max(u, y.width), 0), et = fn(Is, _t), ve = w.step >= J ? et : 1, ye = w.dataTable?.open === !0, T = w.ghost, G = w.spoken, Ot = w.summary, vt = (u) => `${N.dateShort(new Date(u))} ${j(N, u)}`, Ft = (u) => `${Ct}-row-${encodeURIComponent(u.key)}`, Ls = U(() => {
|
|
804
804
|
const u = /* @__PURE__ */ new Map();
|
|
805
805
|
for (const y of w.headers)
|
|
806
806
|
for (const L of y.within)
|
|
@@ -814,14 +814,14 @@ function ei(s) {
|
|
|
814
814
|
const L = () => {
|
|
815
815
|
if (!y) return;
|
|
816
816
|
const _ = [...u.querySelectorAll("[data-lane-count]")];
|
|
817
|
-
for (const
|
|
818
|
-
const
|
|
819
|
-
const
|
|
820
|
-
if (!(
|
|
821
|
-
const st = parseFloat(getComputedStyle(
|
|
822
|
-
return
|
|
817
|
+
for (const H of _) H.hidden = !1;
|
|
818
|
+
const P = _.some((H) => {
|
|
819
|
+
const K = H.previousElementSibling;
|
|
820
|
+
if (!(K instanceof HTMLElement)) return !1;
|
|
821
|
+
const st = parseFloat(getComputedStyle(K).lineHeight);
|
|
822
|
+
return K.scrollWidth > K.clientWidth || K.clientHeight > st * 1.5;
|
|
823
823
|
});
|
|
824
|
-
for (const
|
|
824
|
+
for (const H of _) H.hidden = P;
|
|
825
825
|
};
|
|
826
826
|
L(), document.fonts?.ready.then(L);
|
|
827
827
|
const $ = new ResizeObserver(L);
|
|
@@ -846,9 +846,9 @@ function ei(s) {
|
|
|
846
846
|
return yt(() => {
|
|
847
847
|
const u = Te.current;
|
|
848
848
|
if (X === null || u === null) return;
|
|
849
|
-
const y = 12, L = (D, _,
|
|
850
|
-
const
|
|
851
|
-
return Math.max(4, Math.min(st,
|
|
849
|
+
const y = 12, L = (D, _, P) => {
|
|
850
|
+
const H = D + y, K = D - y - _, st = H + _ <= P - 4 || K < 4 ? H : K;
|
|
851
|
+
return Math.max(4, Math.min(st, P - _ - 4));
|
|
852
852
|
}, $ = {
|
|
853
853
|
x: L(X.x, u.offsetWidth, w.width),
|
|
854
854
|
y: L(X.y, u.offsetHeight, w.height),
|
|
@@ -868,11 +868,11 @@ function ei(s) {
|
|
|
868
868
|
children: [
|
|
869
869
|
/* @__PURE__ */ p("div", { className: g.corner, children: wt !== null && /* @__PURE__ */ p("span", { className: g.zoneLabel, "data-schedule-overlay": "zone label", children: wt }) }),
|
|
870
870
|
/* @__PURE__ */ p("div", { className: g.dayBand, "aria-hidden": "true", "data-schedule-days": "", "data-schedule-clip": "day band", children: w.days.map((u, y) => {
|
|
871
|
-
const L = et === 1 || y === 0 || Gt(u.start, et,
|
|
871
|
+
const L = et === 1 || y === 0 || Gt(u.start, et, rt, N.weekStart), $ = et === 1 ? u.x + u.width : w.days.slice(y + 1).find((P) => Gt(P.start, et, rt, N.weekStart))?.x ?? w.width, D = Math.max(0, -u.x), _ = Math.min($, w.width) - Math.max(u.x, 0);
|
|
872
872
|
return /* @__PURE__ */ p("span", { className: g.day, style: { left: `${u.x}px`, width: `${L ? $ - u.x : u.width}px` }, children: /* @__PURE__ */ p("span", { className: g.dayLabel, "data-schedule-overlay": "day label", style: { marginLeft: `${D}px` }, children: L ? Ss(u.start, et === 1 ? _ : Math.min(_, _t)) : "" }) }, u.start);
|
|
873
873
|
}) }),
|
|
874
874
|
/* @__PURE__ */ p("div", { ref: be, className: g.headers, "data-schedule-headers": "", inert: ye || void 0, children: /* @__PURE__ */ E("div", { className: g.headerRun, style: { transform: `translateY(${-w.scrollY}px)` }, children: [
|
|
875
|
-
q && w.headers.length === 0 && Array.from({ length: Math.floor(w.height / Math.round(r *
|
|
875
|
+
q && w.headers.length === 0 && Array.from({ length: Math.floor(w.height / Math.round(r * lt)) }, (u, y) => /* @__PURE__ */ p("div", { className: g.header, style: { height: `${Math.round(r * lt)}px` }, children: /* @__PURE__ */ p(Gs, { width: "60%" }) }, y)),
|
|
876
876
|
w.headers.map((u) => /* @__PURE__ */ E(
|
|
877
877
|
"div",
|
|
878
878
|
{
|
|
@@ -893,13 +893,13 @@ function ei(s) {
|
|
|
893
893
|
"data-schedule-overlay": "fold control",
|
|
894
894
|
"aria-expanded": u.collapsed === !1,
|
|
895
895
|
"aria-controls": (Ls.get(u.group) ?? [Ft(u)]).join(" "),
|
|
896
|
-
"aria-label": `${u.collapsed === !0 ?
|
|
896
|
+
"aria-label": `${u.collapsed === !0 ? B.scheduleUnfoldGroup : B.scheduleFoldGroup}: ${typeof u.label == "string" ? u.label : u.group}`,
|
|
897
897
|
onClick: () => e.toggleGroup(u.group),
|
|
898
898
|
children: /* @__PURE__ */ p(Hs, { size: 9, "data-open": u.collapsed === !1 ? "" : void 0 })
|
|
899
899
|
}
|
|
900
900
|
),
|
|
901
901
|
/* @__PURE__ */ p("span", { className: g.headerLabel, "data-schedule-overlay": "header label", children: u.label }),
|
|
902
|
-
u.kind !== "lane" && /* @__PURE__ */ p("span", { className: g.headerCount, "data-schedule-overlay": "lane count", "data-lane-count": u.lanes, children:
|
|
902
|
+
u.kind !== "lane" && /* @__PURE__ */ p("span", { className: g.headerCount, "data-schedule-overlay": "lane count", "data-lane-count": u.lanes, children: B.scheduleLaneCount(u.lanes) })
|
|
903
903
|
]
|
|
904
904
|
},
|
|
905
905
|
u.key
|
|
@@ -918,8 +918,9 @@ function ei(s) {
|
|
|
918
918
|
"data-stale": w.loading && w.headers.length > 0 || void 0,
|
|
919
919
|
tabIndex: 0,
|
|
920
920
|
role: "application",
|
|
921
|
-
"aria-roledescription":
|
|
921
|
+
"aria-roledescription": B.scheduleRoleDescription,
|
|
922
922
|
...de,
|
|
923
|
+
"aria-label": n === void 0 ? void 0 : B.schedulePlotName(n),
|
|
923
924
|
"aria-describedby": o ? `${At} ${o}` : At,
|
|
924
925
|
onKeyDown: (u) => {
|
|
925
926
|
e.key(u.nativeEvent) && u.preventDefault();
|
|
@@ -997,11 +998,11 @@ function ei(s) {
|
|
|
997
998
|
visibility: $t.at === Et ? void 0 : "hidden"
|
|
998
999
|
},
|
|
999
1000
|
children: [
|
|
1000
|
-
|
|
1001
|
-
T.refused && /* @__PURE__ */ p("span", { className: g.refusal, children:
|
|
1002
|
-
T.blocked && /* @__PURE__ */ p("span", { className: g.refusal, children:
|
|
1003
|
-
T.overlap && /* @__PURE__ */ p("span", { className: g.finding, children:
|
|
1004
|
-
T.violated && /* @__PURE__ */ p("span", { className: g.finding, children:
|
|
1001
|
+
B.scheduleGhostTimes(j(N, T.from), j(N, T.to)),
|
|
1002
|
+
T.refused && /* @__PURE__ */ p("span", { className: g.refusal, children: B.scheduleLaneRefused }),
|
|
1003
|
+
T.blocked && /* @__PURE__ */ p("span", { className: g.refusal, children: B.scheduleBlockedTime }),
|
|
1004
|
+
T.overlap && /* @__PURE__ */ p("span", { className: g.finding, children: B.scheduleOverlap }),
|
|
1005
|
+
T.violated && /* @__PURE__ */ p("span", { className: g.finding, children: B.scheduleViolatedDependency })
|
|
1005
1006
|
]
|
|
1006
1007
|
}
|
|
1007
1008
|
),
|
|
@@ -1012,20 +1013,20 @@ function ei(s) {
|
|
|
1012
1013
|
/* @__PURE__ */ p("div", { className: `${g.corner} ${g.cornerBottom}` }),
|
|
1013
1014
|
/* @__PURE__ */ E("div", { className: g.tickBand, "aria-hidden": "true", "data-schedule-ticks": "", "data-schedule-clip": "time band", children: [
|
|
1014
1015
|
w.now !== null && /* @__PURE__ */ p("span", { className: g.now, "data-now": "", "data-schedule-overlay": "now mark", style: { left: `${w.now}px` } }),
|
|
1015
|
-
w.ticks.map((u) => /* @__PURE__ */ p("span", { className: g.tick, style: { left: `${u.x}px` }, children: u.x >= Ee && u.x <= w.width - Ee && (ve === 1 || Gt(u.wallClock, ve,
|
|
1016
|
+
w.ticks.map((u) => /* @__PURE__ */ p("span", { className: g.tick, style: { left: `${u.x}px` }, children: u.x >= Ee && u.x <= w.width - Ee && (ve === 1 || Gt(u.wallClock, ve, rt, N.weekStart)) && /* @__PURE__ */ p("span", { className: g.tickLabel, "data-schedule-overlay": "time label", children: w.step >= J ? N.dateShort(new Date(u.wallClock)) : j(N, u.wallClock) }) }, u.wallClock))
|
|
1016
1017
|
] }),
|
|
1017
1018
|
/* @__PURE__ */ E(Le, { "aria-live": "polite", children: [
|
|
1018
|
-
|
|
1019
|
-
|
|
1019
|
+
G?.span !== void 0 && /* @__PURE__ */ p("span", { children: B.scheduleVisibleRange(vt(G.span[0]), vt(G.span[1])) }, G.count),
|
|
1020
|
+
G !== null && G.target !== null && /* @__PURE__ */ p(
|
|
1020
1021
|
Xn,
|
|
1021
1022
|
{
|
|
1022
|
-
target:
|
|
1023
|
-
lane:
|
|
1023
|
+
target: G.target,
|
|
1024
|
+
lane: G.lane === null ? null : e.data.lanes.find((u) => u.id === G.lane)?.label ?? G.lane
|
|
1024
1025
|
},
|
|
1025
|
-
|
|
1026
|
+
G.count
|
|
1026
1027
|
)
|
|
1027
1028
|
] }),
|
|
1028
|
-
/* @__PURE__ */ p(Le, { id: At, children: w === e.getServerSnapshot() ?
|
|
1029
|
+
/* @__PURE__ */ p(Le, { id: At, children: w === e.getServerSnapshot() ? B.scheduleKeyHelp : `${B.scheduleSummary({ ...Ot, from: vt(Ot.from), to: vt(Ot.to) })}${wt === null ? "" : ` ${wt}.`} ${B.scheduleKeyHelp}` }),
|
|
1029
1030
|
ws
|
|
1030
1031
|
]
|
|
1031
1032
|
}
|
|
@@ -1085,7 +1086,7 @@ function ni() {
|
|
|
1085
1086
|
}) })
|
|
1086
1087
|
] });
|
|
1087
1088
|
}
|
|
1088
|
-
return /* @__PURE__ */ E(
|
|
1089
|
+
return /* @__PURE__ */ E(ot, { children: [
|
|
1089
1090
|
/* @__PURE__ */ p(
|
|
1090
1091
|
"button",
|
|
1091
1092
|
{
|
|
@@ -1137,7 +1138,7 @@ function ci() {
|
|
|
1137
1138
|
}
|
|
1138
1139
|
}
|
|
1139
1140
|
const hs = ci(), Be = /* @__PURE__ */ new Set();
|
|
1140
|
-
function
|
|
1141
|
+
function nt(s, t) {
|
|
1141
1142
|
!hs || Be.has(s) || (Be.add(s), console.warn(`@umriss-ui/schedule: ${t}`));
|
|
1142
1143
|
}
|
|
1143
1144
|
class ui {
|
|
@@ -1224,24 +1225,27 @@ class ui {
|
|
|
1224
1225
|
const t = (i, o) => {
|
|
1225
1226
|
const a = /* @__PURE__ */ new Set();
|
|
1226
1227
|
for (const r of o)
|
|
1227
|
-
a.has(r) &&
|
|
1228
|
+
a.has(r) && nt(`twice:${i}:${r}`, `the ${i} id "${r}" stands twice; give each ${i} an id of its own, or only the first is found.`), a.add(r);
|
|
1228
1229
|
};
|
|
1229
1230
|
t("subtask", this.subtasks.map((i) => i.id)), t("dependency", this.dependencies.map((i) => i.id)), t("lane", this.lanes.map((i) => i.id));
|
|
1230
|
-
for (const i of this.subtasks)
|
|
1231
|
-
|
|
1231
|
+
for (const i of this.subtasks) {
|
|
1232
|
+
const o = (a) => typeof a != "number" || a !== 0 && Math.abs(a) < 1e11;
|
|
1233
|
+
(o(i.from) || o(i.to)) && nt(`ms:${i.id}`, `subtask "${i.id}" has from: ${String(i.from)}, to: ${String(i.to)}, which are not times in milliseconds since 1970 (as Date.getTime() gives); a string, a Date or seconds are not drawn. Pass date.getTime().`), i.to > i.from || nt(`span:${i.id}`, `subtask "${i.id}" does not end after it starts (from ${i.from}, to ${i.to}); a point in time is a Milestone, and a span with no length is drawn as a hairline.`);
|
|
1234
|
+
}
|
|
1232
1235
|
for (const i of this.layers) {
|
|
1233
1236
|
if (i.kind !== "subtasks" || i.tasks.length === 0) continue;
|
|
1234
1237
|
const o = new Set(i.tasks.map((a) => a.id));
|
|
1235
1238
|
for (const a of i.data)
|
|
1236
|
-
o.has(a.task) ||
|
|
1239
|
+
o.has(a.task) || nt(`task:${a.id}`, `subtask "${a.id}" names the task "${a.task}", which is not among the tasks of its Subtasks layer; it is drawn muted. Add the task, or correct the subtask's task.`);
|
|
1237
1240
|
}
|
|
1238
|
-
|
|
1239
|
-
for (const
|
|
1240
|
-
|
|
1241
|
+
if (this.subtasks.length > 0)
|
|
1242
|
+
for (const i of this.dependencies)
|
|
1243
|
+
for (const o of [i.from, i.to])
|
|
1244
|
+
this.subtaskById.has(o) || nt(`end:${i.id}:${o}`, `dependency "${i.id}" names the subtask "${o}", and no subtask has that id; the dependency is left out.`);
|
|
1241
1245
|
if (this.lanes.length === 0) return;
|
|
1242
1246
|
const e = new Set(this.lanes.map((i) => i.id)), n = (i, o) => {
|
|
1243
1247
|
for (const { id: a, lane: r } of o)
|
|
1244
|
-
e.has(r) ||
|
|
1248
|
+
e.has(r) || nt(`lane:${i}:${a}`, `${i} "${a}" is on the lane "${r}", which no Lane declares; it is left out. Declare <Lane id="${r}" />.`);
|
|
1245
1249
|
};
|
|
1246
1250
|
n("subtask", this.subtasks), n("milestone", this.milestones), n("blocked time", this.blocked);
|
|
1247
1251
|
}
|
|
@@ -1294,9 +1298,9 @@ function pi(s, t, e) {
|
|
|
1294
1298
|
if (a === void 0) continue;
|
|
1295
1299
|
const r = tt(e, a.lane);
|
|
1296
1300
|
if (r === null || !r.miniature) continue;
|
|
1297
|
-
const l =
|
|
1301
|
+
const l = at(e.rows, r.top + e.scrollY);
|
|
1298
1302
|
if (l === null) continue;
|
|
1299
|
-
const d =
|
|
1303
|
+
const d = x(e, i.arrival), h = Math.max(d + 2, x(e, i.arrival + i.shortBy));
|
|
1300
1304
|
Wt(s, t, d, h, l.top - e.scrollY + 1, 3);
|
|
1301
1305
|
}
|
|
1302
1306
|
}
|
|
@@ -1310,15 +1314,15 @@ function Wt(s, t, e, n, i, o) {
|
|
|
1310
1314
|
function gi(s, t, e, n) {
|
|
1311
1315
|
const i = tt(e, n.lane);
|
|
1312
1316
|
if (i === null || i.top + i.height < 0 || i.top > t.view.height) return;
|
|
1313
|
-
const o = Math.max(0,
|
|
1317
|
+
const o = Math.max(0, x(e, n.from)), a = Math.min(t.view.width, x(e, n.to));
|
|
1314
1318
|
a <= o || (s.globalAlpha = 0.1, s.fillStyle = t.colours.muted, s.fillRect(o, i.top, a - o, i.height), s.globalAlpha = 1, cs(s, o, i.top, a - o, i.height, t.colours.muted));
|
|
1315
1319
|
}
|
|
1316
1320
|
function Ut(s, t, e, n) {
|
|
1317
1321
|
const i = tt(e, n.lane);
|
|
1318
1322
|
if (i === null) return;
|
|
1319
|
-
const o =
|
|
1323
|
+
const o = x(e, n.from), a = Math.max(o + 2, x(e, n.to));
|
|
1320
1324
|
if (s.fillStyle = t.colours.alarm, s.globalAlpha = 0.14, s.fillRect(o, i.top + 1, a - o, Math.max(1, i.height - 2)), s.globalAlpha = 1, Wt(s, t, o, a, i.top + 1, Math.min(3, Math.max(1, i.height - 1))), i.miniature) {
|
|
1321
|
-
const r =
|
|
1325
|
+
const r = at(e.rows, i.top + e.scrollY);
|
|
1322
1326
|
r !== null && Wt(s, t, o, a, r.top - e.scrollY + 1, 3);
|
|
1323
1327
|
}
|
|
1324
1328
|
}
|
|
@@ -1387,7 +1391,7 @@ function Ne(s, t) {
|
|
|
1387
1391
|
const e = xe(s), n = xe(t);
|
|
1388
1392
|
return (Math.max(e, n) + 0.05) / (Math.min(e, n) + 0.05);
|
|
1389
1393
|
}
|
|
1390
|
-
function
|
|
1394
|
+
function Pe(s, t, e) {
|
|
1391
1395
|
if (s === null) return null;
|
|
1392
1396
|
const n = typeof window > "u" ? 1 : window.devicePixelRatio || 1, i = Math.round(t * n), o = Math.round(e * n);
|
|
1393
1397
|
s.width !== i && (s.width = i), s.height !== o && (s.height = o);
|
|
@@ -1502,7 +1506,7 @@ function Ci(s, t, e) {
|
|
|
1502
1506
|
const o = (a) => Math.round(n[a] + (i[a] - n[a]) * e);
|
|
1503
1507
|
return `rgb(${o(0)}, ${o(1)}, ${o(2)})`;
|
|
1504
1508
|
}
|
|
1505
|
-
function
|
|
1509
|
+
function Re(s, t) {
|
|
1506
1510
|
const e = ft(s);
|
|
1507
1511
|
if (e === null || t === 0) return s;
|
|
1508
1512
|
const n = fs(e), i = ms(n), [o, a, r] = n.map((l) => {
|
|
@@ -1513,7 +1517,7 @@ function Pe(s, t) {
|
|
|
1513
1517
|
}
|
|
1514
1518
|
function pt(s, t, e, n) {
|
|
1515
1519
|
const i = (e === null ? void 0 : s.tasks.get(e)) ?? s.muted;
|
|
1516
|
-
return t.selectedTask === null ? i : e !== t.selectedTask ? s.forced ? s.muted :
|
|
1520
|
+
return t.selectedTask === null ? i : e !== t.selectedTask ? s.forced ? s.muted : Re(i, 1) : s.forced || t.selectedSubtask === null || n === null || n === t.selectedSubtask ? i : Re(i, 0.5);
|
|
1517
1521
|
}
|
|
1518
1522
|
const Ai = 2;
|
|
1519
1523
|
function gs(s, t, e, n) {
|
|
@@ -1636,7 +1640,7 @@ function Ht(s) {
|
|
|
1636
1640
|
}
|
|
1637
1641
|
}
|
|
1638
1642
|
const ze = 3, xi = 10, Ni = 600;
|
|
1639
|
-
class
|
|
1643
|
+
class Pi {
|
|
1640
1644
|
constructor(t) {
|
|
1641
1645
|
this.host = t;
|
|
1642
1646
|
}
|
|
@@ -2145,10 +2149,10 @@ class Ri {
|
|
|
2145
2149
|
return { overlaps: ee(a).filter(r), violated: se(d, l) };
|
|
2146
2150
|
}
|
|
2147
2151
|
}
|
|
2148
|
-
function
|
|
2152
|
+
function Ri(s, t) {
|
|
2149
2153
|
const e = /* @__PURE__ */ new Map();
|
|
2150
2154
|
for (const n of t) {
|
|
2151
|
-
const i = s.slots.get(n.lane), o = i === void 0 ? null :
|
|
2155
|
+
const i = s.slots.get(n.lane), o = i === void 0 ? null : at(s, i.top);
|
|
2152
2156
|
if (o === null) continue;
|
|
2153
2157
|
const a = s.rows.indexOf(o);
|
|
2154
2158
|
e.set(a, [...e.get(a) ?? [], n]);
|
|
@@ -2267,7 +2271,7 @@ class Yi {
|
|
|
2267
2271
|
}
|
|
2268
2272
|
walk(t) {
|
|
2269
2273
|
const { data: e, view: n } = this.host, i = this.active(), o = i === null ? null : i.kind === "subtask" ? i.id : i.kind === "milestone" ? Mt + i.id : e.dependencies.find((d) => d.id === i.id)?.from ?? null, a = [...e.subtasks, ...e.milestones.map((d) => ({ id: Mt + d.id, lane: d.lane, from: d.at, to: d.at }))];
|
|
2270
|
-
let r =
|
|
2274
|
+
let r = Ri(n.rows, a);
|
|
2271
2275
|
if (o === null) {
|
|
2272
2276
|
const d = r.filter((h) => {
|
|
2273
2277
|
const c = tt(n.viewport(), h[0].lane);
|
|
@@ -2394,7 +2398,7 @@ class Yi {
|
|
|
2394
2398
|
this.timer !== null && clearTimeout(this.timer), this.timer = null;
|
|
2395
2399
|
}
|
|
2396
2400
|
}
|
|
2397
|
-
const
|
|
2401
|
+
const it = (s) => JSON.stringify([s.domain ?? null, [...s.folded ?? []].sort()]);
|
|
2398
2402
|
function Vi(s, t) {
|
|
2399
2403
|
if (t.size === 0 || s.folded === void 0) return s;
|
|
2400
2404
|
const e = s.folded.filter((n) => t.has(n));
|
|
@@ -2476,7 +2480,7 @@ class Wi {
|
|
|
2476
2480
|
dataTable = null;
|
|
2477
2481
|
listeners = /* @__PURE__ */ new Set();
|
|
2478
2482
|
constructor(t = {}) {
|
|
2479
|
-
this.folded = t.folded ?? [], this.domainInView = t.domain ?? null, this.domainInView !== null && this.view.showWall(this.domainInView), this.viewNow = this.currentView(), this.gestures = new
|
|
2483
|
+
this.folded = t.folded ?? [], this.domainInView = t.domain ?? null, this.domainInView !== null && this.view.showWall(this.domainInView), this.viewNow = this.currentView(), this.gestures = new Pi({
|
|
2480
2484
|
data: this.data,
|
|
2481
2485
|
view: this.view,
|
|
2482
2486
|
plotElement: () => this.plot,
|
|
@@ -2552,7 +2556,7 @@ class Wi {
|
|
|
2552
2556
|
getView = () => this.viewNow;
|
|
2553
2557
|
/** Goes to a whole view (`setView`); what it leaves out goes back to its default. */
|
|
2554
2558
|
applyView(t) {
|
|
2555
|
-
|
|
2559
|
+
it(t) !== it(this.viewNow) && (this.actedOn = !0, this.folded = t.folded ?? [], this.setDomain(t.domain ?? null));
|
|
2556
2560
|
}
|
|
2557
2561
|
/** Puts a span of two wall-clock instants in view; null shows the
|
|
2558
2562
|
subtasks' extent. */
|
|
@@ -2578,7 +2582,7 @@ class Wi {
|
|
|
2578
2582
|
}
|
|
2579
2583
|
publishView() {
|
|
2580
2584
|
const t = this.currentView();
|
|
2581
|
-
if (
|
|
2585
|
+
if (it(t) !== it(this.viewNow)) {
|
|
2582
2586
|
this.viewNow = t;
|
|
2583
2587
|
for (const e of this.viewListeners) e();
|
|
2584
2588
|
}
|
|
@@ -2771,7 +2775,7 @@ class Wi {
|
|
|
2771
2775
|
const n = this.plot?.getBoundingClientRect();
|
|
2772
2776
|
if (n === void 0) return null;
|
|
2773
2777
|
const i = this.view.viewport(), o = e === void 0 ? null : tt(i, e), a = o === null ? 0 : o.top + o.height / 2;
|
|
2774
|
-
return { x: n.left +
|
|
2778
|
+
return { x: n.left + x(i, t), y: n.top + a };
|
|
2775
2779
|
}
|
|
2776
2780
|
/** Whether a lane has a row of its own on a mounted plot: not unknown, not
|
|
2777
2781
|
in a folded group, whose lanes are strips and no rows. */
|
|
@@ -2804,7 +2808,7 @@ class Wi {
|
|
|
2804
2808
|
draw() {
|
|
2805
2809
|
if (this.root === null) return;
|
|
2806
2810
|
this.colours === null && (this.colours = yi(this.root, this.data), this.publish());
|
|
2807
|
-
const { width: t, height: e } = this.view, n = this.dataStale ?
|
|
2811
|
+
const { width: t, height: e } = this.view, n = this.dataStale ? Pe(this.dataCanvas, t, e) : null, i = Pe(this.overlayCanvas, t, e);
|
|
2808
2812
|
if (i === null || t === 0 || this.dataStale && n === null) return;
|
|
2809
2813
|
this.dataStale = !1;
|
|
2810
2814
|
const o = {
|
|
@@ -2840,7 +2844,7 @@ class Wi {
|
|
|
2840
2844
|
}
|
|
2841
2845
|
function eo(s = {}) {
|
|
2842
2846
|
const { initialView: t, onViewChange: e } = s, [n] = ht(() => new Wi(t)), i = W(""), [o] = ht(() => {
|
|
2843
|
-
const l = (d) =>
|
|
2847
|
+
const l = (d) => Ps(ei, { ...d, scene: n });
|
|
2844
2848
|
return l.displayName = "Schedule", {
|
|
2845
2849
|
Schedule: l,
|
|
2846
2850
|
Lane: oi,
|
|
@@ -2851,7 +2855,7 @@ function eo(s = {}) {
|
|
|
2851
2855
|
Milestones: hi,
|
|
2852
2856
|
DataTable: ni,
|
|
2853
2857
|
setView: (d) => {
|
|
2854
|
-
n.applyView(d), i.current =
|
|
2858
|
+
n.applyView(d), i.current = it(n.getView());
|
|
2855
2859
|
},
|
|
2856
2860
|
setDomain: n.setDomain,
|
|
2857
2861
|
positionAt: (d, h) => n.positionAt(d, h),
|
|
@@ -2864,7 +2868,7 @@ function eo(s = {}) {
|
|
|
2864
2868
|
foldAll: n.foldAll,
|
|
2865
2869
|
unfoldAll: n.unfoldAll
|
|
2866
2870
|
};
|
|
2867
|
-
}), a = Jt(n.subscribeView, n.getView, n.getView), r =
|
|
2871
|
+
}), a = Jt(n.subscribeView, n.getView, n.getView), r = it(a);
|
|
2868
2872
|
return Y(() => {
|
|
2869
2873
|
i.current !== r && (i.current = r, n.acted && e?.(a));
|
|
2870
2874
|
}, [r]), U(() => ({ ...o, view: a }), [o, a]);
|
package/docs/llms-full.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @umriss-ui/schedule 0.
|
|
1
|
+
# @umriss-ui/schedule 0.49.0
|
|
2
2
|
|
|
3
3
|
> React Gantt-style schedule for data-dense applications - work on lanes over time, with dependencies, blocked time, findings and controlled editing.
|
|
4
4
|
|
|
@@ -1666,11 +1666,11 @@ no subtask yet; the caller creates one, with its own identity, from
|
|
|
1666
1666
|
|
|
1667
1667
|
#### Known limits
|
|
1668
1668
|
|
|
1669
|
-
- No dependency types, critical path or auto-scheduling: the application decides where work goes, the schedule shows the result and its findings ([ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/schedule-v0.
|
|
1669
|
+
- No dependency types, critical path or auto-scheduling: the application decides where work goes, the schedule shows the result and its findings ([ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/schedule-v0.49.0/docs/adr/0032-what-umriss-is-not.md)).
|
|
1670
1670
|
- No milestones yet: a point in time on a lane has no mark of its own.
|
|
1671
1671
|
- A dependency joins two subtasks of one task; dependencies across tasks are not yet possible.
|
|
1672
1672
|
|
|
1673
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/schedule-v0.
|
|
1673
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/schedule-v0.49.0/docs/adr/0032-what-umriss-is-not.md).
|
|
1674
1674
|
|
|
1675
1675
|
## Plan
|
|
1676
1676
|
|
|
@@ -2185,7 +2185,7 @@ The keys of [First schedule](#first-schedule) apply here.
|
|
|
2185
2185
|
|
|
2186
2186
|
- A folded group shows no summary - no utilisation band, no bar spanning its work: a computed claim would look like a drawn fact ([ADR-0025](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0025-a-lane-group-is-structure-over-lanes-never-a-lane.md)).
|
|
2187
2187
|
|
|
2188
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/schedule-v0.
|
|
2188
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/schedule-v0.49.0/docs/adr/0032-what-umriss-is-not.md).
|
|
2189
2189
|
|
|
2190
2190
|
### Subtasks
|
|
2191
2191
|
|
|
@@ -3049,7 +3049,7 @@ From `ScheduleView` — the full table stands on [View](#view).
|
|
|
3049
3049
|
|
|
3050
3050
|
- No stacked layout on request yet: an overlap is always drawn offset, as the finding it is.
|
|
3051
3051
|
|
|
3052
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/schedule-v0.
|
|
3052
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/schedule-v0.49.0/docs/adr/0032-what-umriss-is-not.md).
|
|
3053
3053
|
|
|
3054
3054
|
### Dependencies
|
|
3055
3055
|
|
|
@@ -3349,7 +3349,7 @@ export default function OneHandoverDrawnItsOwnWay() {
|
|
|
3349
3349
|
|
|
3350
3350
|
##### Mark the critical path
|
|
3351
3351
|
|
|
3352
|
-
The planning system works out the critical path and hands over its subtask ids; `muted` takes the rest back so the path reads first. The schedule computes nothing ([ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/schedule-v0.
|
|
3352
|
+
The planning system works out the critical path and hands over its subtask ids; `muted` takes the rest back so the path reads first. The schedule computes nothing ([ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/schedule-v0.49.0/docs/adr/0032-what-umriss-is-not.md)), so the switch only changes what the application marks.
|
|
3353
3353
|
|
|
3354
3354
|
```tsx
|
|
3355
3355
|
import { useState } from "react";
|
|
@@ -3475,9 +3475,9 @@ type DependencyEnds = "dot" | "none";
|
|
|
3475
3475
|
|
|
3476
3476
|
#### Known limits
|
|
3477
3477
|
|
|
3478
|
-
- Only finish-to-start within one task; no dependency types and no critical path ([ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/schedule-v0.
|
|
3478
|
+
- Only finish-to-start within one task; no dependency types and no critical path ([ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/schedule-v0.49.0/docs/adr/0032-what-umriss-is-not.md)).
|
|
3479
3479
|
|
|
3480
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/schedule-v0.
|
|
3480
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/schedule-v0.49.0/docs/adr/0032-what-umriss-is-not.md).
|
|
3481
3481
|
|
|
3482
3482
|
### Routes
|
|
3483
3483
|
|
|
@@ -5233,7 +5233,7 @@ From `ScheduleView` — the full table stands on [View](#view).
|
|
|
5233
5233
|
|
|
5234
5234
|
- One task at a time: there is no multiple selection.
|
|
5235
5235
|
|
|
5236
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/schedule-v0.
|
|
5236
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/schedule-v0.49.0/docs/adr/0032-what-umriss-is-not.md).
|
|
5237
5237
|
|
|
5238
5238
|
### Interactions
|
|
5239
5239
|
|
|
@@ -6352,7 +6352,7 @@ From `ScheduleView` — the full table stands on [View](#view).
|
|
|
6352
6352
|
|
|
6353
6353
|
- Only the view is shared - the span and the folded groups, not the selection, the hover or the vertical scroll.
|
|
6354
6354
|
|
|
6355
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/schedule-v0.
|
|
6355
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/schedule-v0.49.0/docs/adr/0032-what-umriss-is-not.md).
|
|
6356
6356
|
|
|
6357
6357
|
### Functions on the hook
|
|
6358
6358
|
|
|
@@ -6810,7 +6810,7 @@ The keys of [First schedule](#first-schedule) apply here.
|
|
|
6810
6810
|
|
|
6811
6811
|
- Overlapping work is marked, not packed into sub-lanes; stacked overlap is not built yet.
|
|
6812
6812
|
|
|
6813
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/schedule-v0.
|
|
6813
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/schedule-v0.49.0/docs/adr/0032-what-umriss-is-not.md).
|
|
6814
6814
|
|
|
6815
6815
|
## Editing
|
|
6816
6816
|
|
|
@@ -7185,10 +7185,10 @@ From `Overlap` — the full table stands on [Findings as data](#findings-as-data
|
|
|
7185
7185
|
|
|
7186
7186
|
#### Known limits
|
|
7187
7187
|
|
|
7188
|
-
- No undo: your application owns the data, and with it the history - see [Undo](#undo) ([ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/schedule-v0.
|
|
7188
|
+
- No undo: your application owns the data, and with it the history - see [Undo](#undo) ([ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/schedule-v0.49.0/docs/adr/0032-what-umriss-is-not.md)).
|
|
7189
7189
|
- The keys move work in time only; a lane change needs the pointer.
|
|
7190
7190
|
|
|
7191
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/schedule-v0.
|
|
7191
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/schedule-v0.49.0/docs/adr/0032-what-umriss-is-not.md).
|
|
7192
7192
|
|
|
7193
7193
|
### Undo
|
|
7194
7194
|
|
|
@@ -7198,13 +7198,13 @@ Taking back the last applied change: the application keeps the plan before each
|
|
|
7198
7198
|
import { useSchedule, applyIntent } from "@umriss-ui/schedule";
|
|
7199
7199
|
```
|
|
7200
7200
|
|
|
7201
|
-
The schedule keeps no history: it reports each intent and the application applies it ([ADR-0023](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0023-editing-is-controlled-the-schedule-reports-intents.md)), so the stack of plans is the application's to keep ([ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/schedule-v0.
|
|
7201
|
+
The schedule keeps no history: it reports each intent and the application applies it ([ADR-0023](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0023-editing-is-controlled-the-schedule-reports-intents.md)), so the stack of plans is the application's to keep ([ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/schedule-v0.49.0/docs/adr/0032-what-umriss-is-not.md)). The key is the page's, not the plot's - the plot leaves Ctrl and ⌘ to it.
|
|
7202
7202
|
|
|
7203
7203
|
#### Examples
|
|
7204
7204
|
|
|
7205
7205
|
##### Undo the applied intents
|
|
7206
7206
|
|
|
7207
|
-
The history is the application's, not the schedule's ([ADR-0023](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0023-editing-is-controlled-the-schedule-reports-intents.md), [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/schedule-v0.
|
|
7207
|
+
The history is the application's, not the schedule's ([ADR-0023](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0023-editing-is-controlled-the-schedule-reports-intents.md), [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/schedule-v0.49.0/docs/adr/0032-what-umriss-is-not.md)): it keeps the plan before each intent it applies, and Ctrl+Z, ⌘Z on a Mac, or the Undo button pops the last one. The schedule only knows end-to-start, so a start-to-start is one dependency with a negative lag: the lag is the delay less the spec's three hours, and the line is drawn apart.
|
|
7208
7208
|
|
|
7209
7209
|
```tsx
|
|
7210
7210
|
import { useState, type KeyboardEvent } from "react";
|
|
@@ -7539,7 +7539,7 @@ From `ScheduleView` — the full table stands on [View](#view).
|
|
|
7539
7539
|
|
|
7540
7540
|
- A main time never becomes shorter than one raster step, or a minute without a raster.
|
|
7541
7541
|
|
|
7542
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/schedule-v0.
|
|
7542
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/schedule-v0.49.0/docs/adr/0032-what-umriss-is-not.md).
|
|
7543
7543
|
|
|
7544
7544
|
### Snapping
|
|
7545
7545
|
|
|
@@ -8398,7 +8398,7 @@ From `ScheduleView` — the full table stands on [View](#view).
|
|
|
8398
8398
|
|
|
8399
8399
|
- A rule that changes while a drag runs is noticed at the drop, not before.
|
|
8400
8400
|
|
|
8401
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/schedule-v0.
|
|
8401
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/schedule-v0.49.0/docs/adr/0032-what-umriss-is-not.md).
|
|
8402
8402
|
|
|
8403
8403
|
### Ripple
|
|
8404
8404
|
|
|
@@ -8683,10 +8683,10 @@ From `ScheduleView` — the full table stands on [View](#view).
|
|
|
8683
8683
|
|
|
8684
8684
|
#### Known limits
|
|
8685
8685
|
|
|
8686
|
-
- No dependency types, slack or critical path: the schedule is no project-planning engine ([ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/schedule-v0.
|
|
8686
|
+
- No dependency types, slack or critical path: the schedule is no project-planning engine ([ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/schedule-v0.49.0/docs/adr/0032-what-umriss-is-not.md)).
|
|
8687
8687
|
- A dependency joins subtasks of one task, so work of other tasks is never pushed.
|
|
8688
8688
|
|
|
8689
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/schedule-v0.
|
|
8689
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/schedule-v0.49.0/docs/adr/0032-what-umriss-is-not.md).
|
|
8690
8690
|
|
|
8691
8691
|
## Measuring
|
|
8692
8692
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umriss-ui/schedule",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.49.0",
|
|
4
4
|
"description": "React Gantt-style schedule for data-dense applications - work on lanes over time, with dependencies, blocked time, findings and controlled editing.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Roman Händler",
|
|
@@ -59,16 +59,16 @@
|
|
|
59
59
|
}
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
|
-
"@umriss-ui/charts": "^0.
|
|
63
|
-
"@umriss-ui/core": "^0.
|
|
62
|
+
"@umriss-ui/charts": "^0.49.0",
|
|
63
|
+
"@umriss-ui/core": "^0.49.0",
|
|
64
64
|
"react": ">=19",
|
|
65
65
|
"react-dom": ">=19"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@fontsource/geist-mono": "^5.3.0",
|
|
69
69
|
"@fontsource/geist-sans": "^5.3.0",
|
|
70
|
-
"@umriss-ui/charts": "0.
|
|
71
|
-
"@umriss-ui/core": "0.
|
|
70
|
+
"@umriss-ui/charts": "0.49.0",
|
|
71
|
+
"@umriss-ui/core": "0.49.0",
|
|
72
72
|
"@umriss-ui/demo": "0.0.0",
|
|
73
73
|
"@types/node": "^22.20.2",
|
|
74
74
|
"@types/react": "^19.0.0",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"build:demo": "vite build --config vite.demo.config.ts",
|
|
90
90
|
"typecheck": "tsc --noEmit",
|
|
91
91
|
"typecheck:demo": "pnpm run props && tsc --noEmit -p tsconfig.demo.json",
|
|
92
|
-
"check:site": "pnpm run props -- --check",
|
|
92
|
+
"check:site": "pnpm run props -- --check && node --disable-warning=ExperimentalWarning --experimental-strip-types ../../scripts/checkReadmeLinks.ts",
|
|
93
93
|
"preview:demo": "vite preview --config vite.demo.config.ts --port 4176 --strictPort",
|
|
94
94
|
"test:unit": "vitest run",
|
|
95
95
|
"check:dist": "node --disable-warning=ExperimentalWarning --experimental-strip-types ../../scripts/check-dist.ts schedule.js schedule.css"
|