@umriss-ui/schedule 0.49.0 → 0.51.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 +10 -0
- package/dist/schedule.js +301 -301
- package/docs/llms-full.md +77 -39
- package/package.json +6 -6
package/dist/schedule.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "./schedule.css";
|
|
3
|
-
import { localOffset as
|
|
4
|
-
import { useContext as Zt, useEffect as Y, createContext as
|
|
3
|
+
import { localOffset as qe, toWorkingTimeClamped as V, calendarFrom as Tt, toWallClock as qt, MINUTE as Z, DAY as J, timeStep as As, workingTimeTicks as Ds, inDoubledHour as _s, HOUR as jt, LinearScale as Os, resolveColours as Fs, removedIntervals as $s, subscribeTheme as Es } from "@umriss-ui/charts";
|
|
4
|
+
import { useContext as Zt, useEffect as Y, createContext as je, useRef as W, useId as Ze, useState as ht, useLayoutEffect as yt, useImperativeHandle as Bs, useSyncExternalStore as Jt, useMemo as U, createElement as xs } from "react";
|
|
5
5
|
import { jsxs as E, Fragment as ot, jsx as p } from "react/jsx-runtime";
|
|
6
|
-
import { zoneFields as
|
|
6
|
+
import { zoneFields as Je, zoneInstant as Kt, useWording as mt, useFormats as St, useTimeZoneLabel as Ns, Skeleton as Ps, AngleGlyph as Rs, VisuallyHidden as Le, warnOnce as Gs, createLongPress as Hs, zoneDayStart as Ks } 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
|
}
|
|
@@ -27,7 +27,7 @@ function Ce(s, t) {
|
|
|
27
27
|
return { ...s, lane: t.lane };
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function Ji(s, t) {
|
|
31
31
|
return {
|
|
32
32
|
id: t,
|
|
33
33
|
task: s.task,
|
|
@@ -59,7 +59,7 @@ function ee(s) {
|
|
|
59
59
|
}
|
|
60
60
|
return t;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function Ys(s) {
|
|
63
63
|
const t = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map();
|
|
64
64
|
for (const n of s) {
|
|
65
65
|
const i = Q(n), o = e.get(n.lane) ?? [];
|
|
@@ -82,7 +82,7 @@ function se(s, t) {
|
|
|
82
82
|
}
|
|
83
83
|
return n;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function Qe(s, t) {
|
|
86
86
|
const e = [];
|
|
87
87
|
for (const n of s) {
|
|
88
88
|
const i = Q(n);
|
|
@@ -91,14 +91,14 @@ function ts(s, t) {
|
|
|
91
91
|
}
|
|
92
92
|
return e;
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function Qi(s, t, e = []) {
|
|
95
95
|
return {
|
|
96
96
|
overlaps: ee(s),
|
|
97
97
|
violatedDependencies: se(s, t),
|
|
98
|
-
inBlockedTime:
|
|
98
|
+
inBlockedTime: Qe(s, e)
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function to(s, t, e) {
|
|
102
102
|
if (e.kind === "place") return [];
|
|
103
103
|
const n = new Map(s.map((l) => [l.id, Ce(l, e)])), i = /* @__PURE__ */ new Map();
|
|
104
104
|
for (const l of t) {
|
|
@@ -122,13 +122,13 @@ function Qi(s, t, e) {
|
|
|
122
122
|
}
|
|
123
123
|
return [...o.values()];
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function Vs(s, t, e) {
|
|
126
126
|
const { step: n, offset: i } = typeof t == "number" ? { step: t, offset: 0 } : t;
|
|
127
127
|
if (!(n > 0) || !Number.isFinite(s)) return s;
|
|
128
|
-
const o =
|
|
128
|
+
const o = qe(s, e) + i;
|
|
129
129
|
return o + Math.round((s - o) / n) * n;
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function eo(s, t, e) {
|
|
132
132
|
return e === 0 || !Number.isFinite(e) ? [] : s.filter((n) => n.task === t).map((n) => ({ kind: "move", subtask: n.id, from: n.from + e, to: n.to + e }));
|
|
133
133
|
}
|
|
134
134
|
function It(s) {
|
|
@@ -137,31 +137,31 @@ function It(s) {
|
|
|
137
137
|
o === "provisional" ? (t = !0, e = !1) : o === "fixed" ? (e = !0, t = !1) : o === "muted" ? n = !0 : o === "open" && (i = !0);
|
|
138
138
|
return { dashed: t, hatched: e, muted: n, open: i };
|
|
139
139
|
}
|
|
140
|
-
const ne = /* @__PURE__ */
|
|
141
|
-
function
|
|
142
|
-
return Zt(
|
|
140
|
+
const ne = /* @__PURE__ */ je(null), ts = /* @__PURE__ */ je(null);
|
|
141
|
+
function es() {
|
|
142
|
+
return Zt(ts);
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function zs(s) {
|
|
145
145
|
const t = Zt(ne);
|
|
146
146
|
if (t === null)
|
|
147
147
|
throw new Error(`@umriss-ui/schedule: <${s}> must be used inside a <Schedule>.`);
|
|
148
148
|
return t;
|
|
149
149
|
}
|
|
150
150
|
function ie(s, t, e, n, i) {
|
|
151
|
-
const o =
|
|
151
|
+
const o = zs(s), a = W(null);
|
|
152
152
|
Y(() => (a.current = e(o, t), () => {
|
|
153
153
|
a.current !== null && i(o, a.current), a.current = null;
|
|
154
154
|
}), [o]), Y(() => {
|
|
155
155
|
a.current !== null && n(o, a.current, t);
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
|
-
function
|
|
158
|
+
function Ws(s) {
|
|
159
159
|
ie("Lane", s, (t, e) => t.registerLane(e), (t, e, n) => t.updateLane(e, n), (t, e) => t.unregisterLane(e));
|
|
160
160
|
}
|
|
161
|
-
function
|
|
161
|
+
function Us(s) {
|
|
162
162
|
ie("LaneGroup", s, (t, e) => t.registerGroup(e), (t, e, n) => t.updateGroup(e, n), (t, e) => t.unregisterGroup(e));
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function Xs(s) {
|
|
165
165
|
const t = Zt(ne);
|
|
166
166
|
return Y(() => {
|
|
167
167
|
if (t !== null)
|
|
@@ -171,9 +171,9 @@ 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
|
|
174
|
+
const ss = 24, qs = 4, js = 3, Pt = 4;
|
|
175
175
|
function Ae(s) {
|
|
176
|
-
const { lanes: t, groups: e, collapsed: n, laneHeight: i, headHeight: o =
|
|
176
|
+
const { lanes: t, groups: e, collapsed: n, laneHeight: i, headHeight: o = ss } = 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 = [];
|
|
178
178
|
let I = r(b.parent);
|
|
179
179
|
const F = /* @__PURE__ */ new Set();
|
|
@@ -193,9 +193,9 @@ 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 *
|
|
196
|
+
const { row: b, lanes: S } = f, I = c[b], F = Math.max(I.height, S.length * qs + 2 * Pt);
|
|
197
197
|
c[b] = { ...I, height: F }, v += F - I.height;
|
|
198
|
-
const O = F - 2 * Pt, R = Math.max(
|
|
198
|
+
const O = F - 2 * Pt, R = Math.max(js, Math.floor(O / S.length));
|
|
199
199
|
S.forEach((q, gt) => {
|
|
200
200
|
const kt = h.get(q) ?? [];
|
|
201
201
|
m.set(q, {
|
|
@@ -249,7 +249,7 @@ function Ae(s) {
|
|
|
249
249
|
}
|
|
250
250
|
return M(), { rows: c, slots: m, height: v };
|
|
251
251
|
}
|
|
252
|
-
function
|
|
252
|
+
function Zs(s, t) {
|
|
253
253
|
if (t.size === 0) return s;
|
|
254
254
|
const e = /* @__PURE__ */ new Set();
|
|
255
255
|
for (const n of s) t.has(n) || e.add(n);
|
|
@@ -269,7 +269,7 @@ function at(s, t) {
|
|
|
269
269
|
function oe(s, t) {
|
|
270
270
|
return s.slots.get(t) ?? null;
|
|
271
271
|
}
|
|
272
|
-
function
|
|
272
|
+
function Js(s, t) {
|
|
273
273
|
const e = at(s, t);
|
|
274
274
|
if (e === null) return null;
|
|
275
275
|
if (e.kind === "lane") return e.lane ?? null;
|
|
@@ -278,7 +278,7 @@ function Qs(s, t) {
|
|
|
278
278
|
if (i.miniature && t >= i.top && t < i.top + i.height) return n;
|
|
279
279
|
return null;
|
|
280
280
|
}
|
|
281
|
-
const
|
|
281
|
+
const Qs = 6, ns = 3, dt = 2, De = 3, _e = 3;
|
|
282
282
|
function x(s, t) {
|
|
283
283
|
return Math.round(s.scale.toPx(V(t, s.calendar)));
|
|
284
284
|
}
|
|
@@ -291,10 +291,10 @@ function ae(s, t) {
|
|
|
291
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
|
-
return
|
|
294
|
+
return Js(s.rows, t + s.scrollY);
|
|
295
295
|
}
|
|
296
|
-
function
|
|
297
|
-
const i = e.miniature ? 0 :
|
|
296
|
+
function is(s, t, e, n) {
|
|
297
|
+
const i = e.miniature ? 0 : Qs, o = e.miniature ? 0 : _e * De, a = Math.max(e.miniature ? 1 : 4, e.height - 2 * i - o), r = e.top - s.scrollY + Math.floor((e.height - a) / 2), l = Q(t);
|
|
298
298
|
return {
|
|
299
299
|
subtask: t,
|
|
300
300
|
miniature: e.miniature,
|
|
@@ -307,12 +307,12 @@ function os(s, t, e, n) {
|
|
|
307
307
|
outerTo: x(s, l.to)
|
|
308
308
|
};
|
|
309
309
|
}
|
|
310
|
-
function
|
|
310
|
+
function os(s, t, e) {
|
|
311
311
|
if (e < s.y || e > s.y + s.height) return null;
|
|
312
312
|
const n = Math.max(0, (6 - (s.outerTo - s.outerFrom)) / 2);
|
|
313
313
|
return t < s.outerFrom - n || t > s.outerTo + n ? null : t < s.mainFrom ? "leadIn" : t > s.mainTo ? "leadOut" : "main";
|
|
314
314
|
}
|
|
315
|
-
function
|
|
315
|
+
function tn(s, t, e, n = 5) {
|
|
316
316
|
if (e < s.y || e > s.y + s.height) return null;
|
|
317
317
|
const i = Math.abs(t - s.mainFrom), o = Math.abs(t - s.mainTo);
|
|
318
318
|
return Math.min(i, o) > n ? null : i <= o ? "from" : "to";
|
|
@@ -320,19 +320,19 @@ function en(s, t, e, n = 5) {
|
|
|
320
320
|
function Yt(s, t, e) {
|
|
321
321
|
return s.outerTo >= 0 && s.outerFrom <= t && s.y + s.height >= 0 && s.y <= e;
|
|
322
322
|
}
|
|
323
|
-
function
|
|
323
|
+
function en(s, t, e) {
|
|
324
324
|
let i = Math.min(s.x1, s.x2, s.c1x, s.c2x), o = Math.max(s.x1, s.x2, s.c1x, s.c2x), a = Math.min(s.y1, s.y2), r = Math.max(s.y1, s.y2);
|
|
325
325
|
for (let l = 0; l + 1 < s.points.length; l += 2)
|
|
326
326
|
i = Math.min(i, s.points[l]), o = Math.max(o, s.points[l]), a = Math.min(a, s.points[l + 1]), r = Math.max(r, s.points[l + 1]);
|
|
327
327
|
return o >= -8 && i <= t + 8 && r >= -8 && a <= e + 8;
|
|
328
328
|
}
|
|
329
|
-
const
|
|
330
|
-
function
|
|
329
|
+
const sn = 64;
|
|
330
|
+
function nn(s, t) {
|
|
331
331
|
if (s.miniature) return null;
|
|
332
|
-
const e = It(s.subtask.appearance).hatched ? dt +
|
|
333
|
-
return i <
|
|
332
|
+
const e = It(s.subtask.appearance).hatched ? dt + ns + 1 : 0, n = Math.max(s.mainFrom + e, 0), i = Math.min(s.mainTo - e, t) - n;
|
|
333
|
+
return i < sn ? null : { x: n, width: i, y: s.y, height: s.height };
|
|
334
334
|
}
|
|
335
|
-
const
|
|
335
|
+
const on = 10;
|
|
336
336
|
function Fe(s, t, e) {
|
|
337
337
|
const n = Math.round(t.y + t.height / 2);
|
|
338
338
|
return s === "centre" || e.y === t.y ? n : Math.round(e.y > t.y ? t.y + t.height - 1 : t.y + 1);
|
|
@@ -342,7 +342,7 @@ function Vt(s, t, e, n, i) {
|
|
|
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") {
|
|
345
|
-
const C = l +
|
|
345
|
+
const C = l + on, A = h === c ? C : Math.round((C + d) / 2);
|
|
346
346
|
return { dependency: t, kind: o, ends: r, x1: l, y1: h, x2: d, y2: c, c1x: l, c2x: d, points: h === c ? [l, h, d, c] : [l, h, A, h, A, c, d, c] };
|
|
347
347
|
}
|
|
348
348
|
const m = Math.max(14, Math.abs(d - l) / 2), k = l + m, f = d - m, v = [];
|
|
@@ -355,7 +355,7 @@ function Vt(s, t, e, n, i) {
|
|
|
355
355
|
}
|
|
356
356
|
return { dependency: t, kind: "curve", ends: r, x1: l, y1: h, x2: d, y2: c, c1x: k, c2x: f, points: v };
|
|
357
357
|
}
|
|
358
|
-
function
|
|
358
|
+
function an(s, t, e) {
|
|
359
359
|
let n = 1 / 0;
|
|
360
360
|
const i = s.points;
|
|
361
361
|
for (let o = 0; o + 3 < i.length; o += 2) {
|
|
@@ -364,22 +364,22 @@ function rn(s, t, e) {
|
|
|
364
364
|
}
|
|
365
365
|
return n;
|
|
366
366
|
}
|
|
367
|
-
const
|
|
368
|
-
function
|
|
367
|
+
const as = [], rs = 56;
|
|
368
|
+
function rn(s) {
|
|
369
369
|
return s > 16 ? s / 16 : 1;
|
|
370
370
|
}
|
|
371
|
-
function
|
|
372
|
-
return s > 0 ? Math.min(J, Math.max(15 * Z,
|
|
371
|
+
function ln(s, t = rs) {
|
|
372
|
+
return s > 0 ? Math.min(J, Math.max(15 * Z, As(s * t, 1))) : 15 * Z;
|
|
373
373
|
}
|
|
374
|
-
const
|
|
375
|
-
function
|
|
376
|
-
const [i, o] =
|
|
377
|
-
return
|
|
374
|
+
const dn = () => new Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
375
|
+
function hn(s, t, e = as, n) {
|
|
376
|
+
const [i, o] = ls(s, e);
|
|
377
|
+
return Ds(e, i, o, t, 0, n ?? dn()).filter(
|
|
378
378
|
(a) => a.workingTime >= s[0] && a.workingTime <= s[1]
|
|
379
379
|
);
|
|
380
380
|
}
|
|
381
|
-
function
|
|
382
|
-
const [n, i] =
|
|
381
|
+
function cn(s, t = as, e) {
|
|
382
|
+
const [n, i] = ls(s, t), o = [], { year: a, month: r, day: l } = Je(n, e);
|
|
383
383
|
let d = l, h = Kt({ year: a, month: r, day: d }, e).getTime();
|
|
384
384
|
for (; h < i && o.length < 400; ) {
|
|
385
385
|
const c = h;
|
|
@@ -392,34 +392,34 @@ function un(s, t = rs, e) {
|
|
|
392
392
|
return o;
|
|
393
393
|
}
|
|
394
394
|
const Rt = [1, 2, 7, 14, 28];
|
|
395
|
-
function
|
|
395
|
+
function un(s, t) {
|
|
396
396
|
return Rt.find((e) => e * s >= t) ?? Rt[Rt.length - 1];
|
|
397
397
|
}
|
|
398
398
|
function Gt(s, t, e, n = 1) {
|
|
399
|
-
return ((Math.round((s -
|
|
399
|
+
return ((Math.round((s - qe(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);
|
|
403
|
-
return
|
|
403
|
+
return _s(t, s.timeZone) ? `${e} ${s.offset(new Date(t))}` : e;
|
|
404
404
|
}
|
|
405
|
-
function
|
|
405
|
+
function fn(s, t, e, n) {
|
|
406
406
|
const i = s[1] - s[0];
|
|
407
407
|
if (!(i > 0)) return [s[0], s[1]];
|
|
408
408
|
const o = Math.min(n.max, Math.max(n.min, i * e)), a = (t - s[0]) / i, r = t - a * o;
|
|
409
409
|
return [r, r + o];
|
|
410
410
|
}
|
|
411
|
-
function
|
|
411
|
+
function mn(s, t) {
|
|
412
412
|
return [s[0] + t, s[1] + t];
|
|
413
413
|
}
|
|
414
414
|
function ut(s, t) {
|
|
415
415
|
const e = Tt(t);
|
|
416
416
|
return e.intervals.length === 0 ? s : qt(Math.max(0, Math.min(e.total, s)), e);
|
|
417
417
|
}
|
|
418
|
-
function
|
|
418
|
+
function ls(s, t) {
|
|
419
419
|
return [ut(s[0], t), ut(s[1], t)];
|
|
420
420
|
}
|
|
421
421
|
const zt = 44;
|
|
422
|
-
class
|
|
422
|
+
class pn {
|
|
423
423
|
constructor(t) {
|
|
424
424
|
this.data = t;
|
|
425
425
|
}
|
|
@@ -492,7 +492,7 @@ class gn {
|
|
|
492
492
|
}
|
|
493
493
|
viewport() {
|
|
494
494
|
return {
|
|
495
|
-
scale: new
|
|
495
|
+
scale: new Os(this.domain, [0, this.width]),
|
|
496
496
|
calendar: this.options.calendar,
|
|
497
497
|
scrollY: this.scrollY,
|
|
498
498
|
rows: this.rows
|
|
@@ -508,23 +508,23 @@ class gn {
|
|
|
508
508
|
/** The fine band's step at the current zoom. */
|
|
509
509
|
step() {
|
|
510
510
|
const t = this.domain[1] - this.domain[0];
|
|
511
|
-
return
|
|
511
|
+
return ln(this.width > 0 ? t / this.width : t, rs * this.fontScale);
|
|
512
512
|
}
|
|
513
513
|
/** Lays the rows out, clamps the scroll, and lays the data out anew. */
|
|
514
514
|
layout() {
|
|
515
515
|
this.moved = !1, this.rows = Ae({
|
|
516
516
|
lanes: this.data.lanes,
|
|
517
517
|
groups: this.data.groups,
|
|
518
|
-
collapsed:
|
|
518
|
+
collapsed: Zs(this.collapsed, this.openForGesture),
|
|
519
519
|
laneHeight: Math.round(this.options.laneHeight * this.fontScale),
|
|
520
|
-
headHeight: Math.round(
|
|
520
|
+
headHeight: Math.round(ss * this.fontScale)
|
|
521
521
|
}), this.scrollY = Math.max(0, Math.min(this.maxScroll(), this.scrollY));
|
|
522
522
|
const t = this.viewport();
|
|
523
523
|
this.laidBoxes = [], this.laidBoxById = /* @__PURE__ */ new Map();
|
|
524
524
|
for (const e of this.data.subtasks) {
|
|
525
525
|
const n = oe(this.rows, e.lane);
|
|
526
526
|
if (n === null) continue;
|
|
527
|
-
const i =
|
|
527
|
+
const i = is(t, e, n, this.data.depth.get(e.id) ?? 0);
|
|
528
528
|
this.laidBoxes.push(i), this.laidBoxById.set(e.id, i);
|
|
529
529
|
}
|
|
530
530
|
this.laidPaths = [];
|
|
@@ -539,11 +539,11 @@ class gn {
|
|
|
539
539
|
if (this.width <= 0) return { days: [], ticks: [], step: t };
|
|
540
540
|
const e = this.viewport().scale, n = this.options.calendar;
|
|
541
541
|
return {
|
|
542
|
-
days:
|
|
542
|
+
days: cn(this.domain, n, this.options.timeZone).map((i) => {
|
|
543
543
|
const o = Math.round(e.toPx(i.from));
|
|
544
544
|
return { start: i.start, x: o, width: Math.round(e.toPx(i.to)) - o };
|
|
545
545
|
}),
|
|
546
|
-
ticks:
|
|
546
|
+
ticks: hn(this.domain, t, n, this.options.timeZone).map((i) => ({ wallClock: i.wallClock, x: Math.round(e.toPx(i.workingTime)) })),
|
|
547
547
|
step: t
|
|
548
548
|
};
|
|
549
549
|
}
|
|
@@ -561,12 +561,12 @@ class gn {
|
|
|
561
561
|
if (d !== null && Math.abs(t - d.x) + Math.abs(e - d.y) <= d.half + 2) return { kind: "milestone", milestone: l };
|
|
562
562
|
}
|
|
563
563
|
for (let r = this.boxes.length - 1; r >= 0; r--) {
|
|
564
|
-
const l = this.boxes[r], d =
|
|
564
|
+
const l = this.boxes[r], d = os(l, t, e);
|
|
565
565
|
if (d !== null) return { kind: "subtask", subtask: l.subtask, part: d };
|
|
566
566
|
}
|
|
567
567
|
let i = null, o = 4;
|
|
568
568
|
for (const r of this.paths) {
|
|
569
|
-
const l =
|
|
569
|
+
const l = an(r, t, e);
|
|
570
570
|
l <= o && (o = l, i = r);
|
|
571
571
|
}
|
|
572
572
|
if (i !== null) return { kind: "dependency", dependency: i.dependency };
|
|
@@ -607,7 +607,7 @@ class gn {
|
|
|
607
607
|
neither - a scroll through the lanes is no news about the time. */
|
|
608
608
|
pan(t, e) {
|
|
609
609
|
const n = this.domain[0], i = this.scrollY, o = this.domain[1] - n;
|
|
610
|
-
this.width > 0 && t !== 0 && (this.domain =
|
|
610
|
+
this.width > 0 && t !== 0 && (this.domain = mn(this.domain, t / this.width * o)), this.scrollY = Math.max(0, Math.min(this.maxScroll(), this.scrollY + e));
|
|
611
611
|
const a = this.domain[0] !== n;
|
|
612
612
|
return { moved: a || this.scrollY !== i, time: a };
|
|
613
613
|
}
|
|
@@ -615,41 +615,41 @@ class gn {
|
|
|
615
615
|
zoomAt(t, e) {
|
|
616
616
|
if (this.width <= 0 || !Number.isFinite(e)) return !1;
|
|
617
617
|
const n = this.domain, i = this.viewport().scale.fromPx(t);
|
|
618
|
-
return this.domain =
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
|
-
const
|
|
622
|
-
root:
|
|
623
|
-
corner:
|
|
624
|
-
zoneLabel:
|
|
625
|
-
dayBand:
|
|
626
|
-
headers:
|
|
627
|
-
plot:
|
|
628
|
-
cornerBottom:
|
|
629
|
-
tickBand:
|
|
630
|
-
dataKey:
|
|
631
|
-
dataPanel:
|
|
632
|
-
dataTable:
|
|
633
|
-
day:
|
|
634
|
-
dayLabel:
|
|
635
|
-
tick:
|
|
636
|
-
tickLabel:
|
|
637
|
-
header:
|
|
638
|
-
headerLabel:
|
|
639
|
-
headerCount:
|
|
640
|
-
chevron:
|
|
641
|
-
focusRing:
|
|
642
|
-
layer:
|
|
643
|
-
grip:
|
|
644
|
-
ghostLabel:
|
|
645
|
-
finding:
|
|
646
|
-
refusal:
|
|
647
|
-
tooltip:
|
|
648
|
-
tooltipHead:
|
|
649
|
-
tooltipTimes:
|
|
650
|
-
now:
|
|
651
|
-
barLabel:
|
|
652
|
-
barLabelText:
|
|
618
|
+
return this.domain = fn(this.domain, i, e, this.options.zoomLimits), n[0] !== this.domain[0] || n[1] !== this.domain[1];
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
const gn = "_root_9ariw_4 _text_18806_22", kn = "_corner_9ariw_19", wn = "_zoneLabel_9ariw_24", vn = "_dayBand_9ariw_43", yn = "_headers_9ariw_48", bn = "_plot_9ariw_53", Mn = "_cornerBottom_9ariw_58", Tn = "_tickBand_9ariw_63", Sn = "_dataKey_9ariw_69", In = "_dataPanel_9ariw_100", Ln = "_dataTable_9ariw_119", Cn = "_day_9ariw_43", An = "_dayLabel_9ariw_179", Dn = "_tick_9ariw_63", _n = "_tickLabel_9ariw_200", On = "_header_9ariw_48", Fn = "_headerLabel_9ariw_229", $n = "_headerCount_9ariw_265", En = "_chevron_9ariw_274", Bn = "_focusRing_9ariw_372", xn = "_layer_9ariw_390", Nn = "_grip_9ariw_417", Pn = "_ghostLabel_9ariw_427", Rn = "_finding_9ariw_440", Gn = "_refusal_9ariw_448", Hn = "_tooltip_9ariw_452", Kn = "_tooltipHead_9ariw_471", Yn = "_tooltipTimes_9ariw_476", Vn = "_now_9ariw_485", zn = "_barLabel_9ariw_499", Wn = "_barLabelText_9ariw_512", g = {
|
|
622
|
+
root: gn,
|
|
623
|
+
corner: kn,
|
|
624
|
+
zoneLabel: wn,
|
|
625
|
+
dayBand: vn,
|
|
626
|
+
headers: yn,
|
|
627
|
+
plot: bn,
|
|
628
|
+
cornerBottom: Mn,
|
|
629
|
+
tickBand: Tn,
|
|
630
|
+
dataKey: Sn,
|
|
631
|
+
dataPanel: In,
|
|
632
|
+
dataTable: Ln,
|
|
633
|
+
day: Cn,
|
|
634
|
+
dayLabel: An,
|
|
635
|
+
tick: Dn,
|
|
636
|
+
tickLabel: _n,
|
|
637
|
+
header: On,
|
|
638
|
+
headerLabel: Fn,
|
|
639
|
+
headerCount: $n,
|
|
640
|
+
chevron: En,
|
|
641
|
+
focusRing: Bn,
|
|
642
|
+
layer: xn,
|
|
643
|
+
grip: Nn,
|
|
644
|
+
ghostLabel: Pn,
|
|
645
|
+
finding: Rn,
|
|
646
|
+
refusal: Gn,
|
|
647
|
+
tooltip: Hn,
|
|
648
|
+
tooltipHead: Kn,
|
|
649
|
+
tooltipTimes: Yn,
|
|
650
|
+
now: Vn,
|
|
651
|
+
barLabel: zn,
|
|
652
|
+
barLabelText: Wn
|
|
653
653
|
};
|
|
654
654
|
function re() {
|
|
655
655
|
const s = mt();
|
|
@@ -658,7 +658,7 @@ function re() {
|
|
|
658
658
|
return [n > 0 ? s.hoursShort(n) : "", i > 0 || n === 0 ? s.minutesShort(i) : ""].filter(Boolean).join(" ");
|
|
659
659
|
};
|
|
660
660
|
}
|
|
661
|
-
function
|
|
661
|
+
function Un({ target: s, lane: t }) {
|
|
662
662
|
const e = St(), n = mt(), i = re(), o = (c) => j(e, c);
|
|
663
663
|
if (s.kind === "subtask") {
|
|
664
664
|
const { subtask: c, task: m } = s, k = [
|
|
@@ -689,7 +689,7 @@ function Xn({ target: s, lane: t }) {
|
|
|
689
689
|
...h === void 0 ? [] : [n.scheduleViolatedBy(i(h.shortBy))]
|
|
690
690
|
].join(", ");
|
|
691
691
|
}
|
|
692
|
-
function
|
|
692
|
+
function Xn({ 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;
|
|
@@ -719,8 +719,8 @@ function qn({ target: s }) {
|
|
|
719
719
|
d !== void 0 && /* @__PURE__ */ p("span", { className: g.finding, children: e.scheduleViolatedBy(i(d.shortBy)) })
|
|
720
720
|
] });
|
|
721
721
|
}
|
|
722
|
-
const
|
|
723
|
-
function
|
|
722
|
+
const qn = [], $e = { min: jt, max: 28 * J }, jn = [], Ee = 20, Zn = 44, Jn = 84, Qn = 200;
|
|
723
|
+
function ti(s) {
|
|
724
724
|
const {
|
|
725
725
|
ref: t,
|
|
726
726
|
scene: e,
|
|
@@ -730,10 +730,10 @@ function ei(s) {
|
|
|
730
730
|
height: a,
|
|
731
731
|
laneHeight: r = zt,
|
|
732
732
|
headerWidth: l = 160,
|
|
733
|
-
calendar: d =
|
|
733
|
+
calendar: d = jn,
|
|
734
734
|
zoomLimits: h,
|
|
735
735
|
snap: c = "ticks",
|
|
736
|
-
intents: m =
|
|
736
|
+
intents: m = qn,
|
|
737
737
|
onIntent: k,
|
|
738
738
|
canMoveTo: f,
|
|
739
739
|
onInteraction: v,
|
|
@@ -749,21 +749,23 @@ function ei(s) {
|
|
|
749
749
|
loading: q = !1,
|
|
750
750
|
className: gt,
|
|
751
751
|
style: kt,
|
|
752
|
-
children:
|
|
753
|
-
...
|
|
754
|
-
} = s, de = { "aria-label": n, "aria-labelledby": i }, Ct =
|
|
752
|
+
children: gs,
|
|
753
|
+
...ks
|
|
754
|
+
} = s, de = { "aria-label": n, "aria-labelledby": i }, Ct = Ze(), At = `${Ct}-summary`, Dt = W(null), he = W(null), ce = W(null), ue = W(null), N = St(), B = mt(), rt = N.timeZone, wt = Ns(), 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, [ws, vs] = ht(() => Date.now());
|
|
755
755
|
Y(() => {
|
|
756
756
|
if (R !== !0) return;
|
|
757
|
-
const u = setInterval(() =>
|
|
757
|
+
const u = setInterval(() => vs(Date.now()), Z);
|
|
758
758
|
return () => clearInterval(u);
|
|
759
759
|
}, [R]);
|
|
760
|
-
const we = R === !0 ?
|
|
760
|
+
const we = R === !0 ? ws : typeof R == "number" ? R : null;
|
|
761
761
|
yt(() => {
|
|
762
762
|
const u = ke ?? { step: pe ?? 0, offset: ge ?? 0 };
|
|
763
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
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
|
-
}, [e, k, f, v, A]),
|
|
766
|
+
}, [e, k, f, v, A]), Bs(t, () => Dt.current, []), Y(() => {
|
|
767
|
+
e.data.warnOfMalformedData();
|
|
768
|
+
}), Y(() => {
|
|
767
769
|
e.setLoading(q);
|
|
768
770
|
}, [e, q]), Y(() => {
|
|
769
771
|
e.setControlledTask(C);
|
|
@@ -782,7 +784,7 @@ function ei(s) {
|
|
|
782
784
|
_.observe(y);
|
|
783
785
|
const P = document.createElement("div");
|
|
784
786
|
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(
|
|
787
|
+
const H = () => e.setFontScale(rn(parseFloat(getComputedStyle(P).width)));
|
|
786
788
|
H();
|
|
787
789
|
const K = new ResizeObserver(H);
|
|
788
790
|
K.observe(P);
|
|
@@ -797,10 +799,10 @@ function ei(s) {
|
|
|
797
799
|
window.removeEventListener("keydown", Ie), u.removeEventListener("wheel", st), u.removeEventListener("touchmove", Se), _.disconnect(), K.disconnect(), P.remove(), e.unbind();
|
|
798
800
|
};
|
|
799
801
|
}, [e]);
|
|
800
|
-
const w = Jt(e.subscribe, e.getSnapshot, e.getServerSnapshot), { fontScale: lt } = w, _t =
|
|
802
|
+
const w = Jt(e.subscribe, e.getSnapshot, e.getServerSnapshot), { fontScale: lt } = w, _t = Zn * lt, ys = Jn * lt, bs = Qn * lt, Ms = (u, y) => {
|
|
801
803
|
const L = new Date(u);
|
|
802
|
-
return y >=
|
|
803
|
-
},
|
|
804
|
+
return y >= bs ? N.dateLong(L) : y >= ys ? N.date(L) : y >= _t ? N.dateShort(L) : "";
|
|
805
|
+
}, Ts = w.days.reduce((u, y) => Math.max(u, y.width), 0), et = un(Ts, _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)}`, Ss = U(() => {
|
|
804
806
|
const u = /* @__PURE__ */ new Map();
|
|
805
807
|
for (const y of w.headers)
|
|
806
808
|
for (const L of y.within)
|
|
@@ -831,7 +833,7 @@ function ei(s) {
|
|
|
831
833
|
y = !1, $.disconnect(), D.disconnect();
|
|
832
834
|
};
|
|
833
835
|
}, []);
|
|
834
|
-
const
|
|
836
|
+
const Is = U(() => new Set(T?.refusedLanes ?? []), [T?.refusedLanes]), Me = W(null), [$t, Ls] = ht({ x: 0, y: 0, at: "" }), Et = T === null ? "" : `${T.x}:${T.y}:${T.from}:${T.to}:${T.overlap}:${T.violated}:${T.refused}:${T.blocked}`;
|
|
835
837
|
yt(() => {
|
|
836
838
|
const u = Me.current;
|
|
837
839
|
if (T === null || u === null) return;
|
|
@@ -840,9 +842,9 @@ function ei(s) {
|
|
|
840
842
|
y: L >= 2 ? L : Math.min($, w.height - u.offsetHeight - 2),
|
|
841
843
|
at: Et
|
|
842
844
|
};
|
|
843
|
-
|
|
845
|
+
Ls((_) => _.x === D.x && _.y === D.y && _.at === D.at ? _ : D);
|
|
844
846
|
}, [T, Et, w.width, w.height]);
|
|
845
|
-
const Te = W(null), [Bt,
|
|
847
|
+
const Te = W(null), [Bt, Cs] = ht({ x: 0, y: 0, at: "" }), X = w.tooltip, xt = X === null ? "" : `${X.x}:${X.y}:${X.target.kind}`;
|
|
846
848
|
return yt(() => {
|
|
847
849
|
const u = Te.current;
|
|
848
850
|
if (X === null || u === null) return;
|
|
@@ -854,11 +856,11 @@ function ei(s) {
|
|
|
854
856
|
y: L(X.y, u.offsetHeight, w.height),
|
|
855
857
|
at: xt
|
|
856
858
|
};
|
|
857
|
-
|
|
859
|
+
Cs((D) => D.x === $.x && D.y === $.y && D.at === $.at ? D : $);
|
|
858
860
|
}, [X, xt, w.width, w.height]), /* @__PURE__ */ p(ne, { value: e, children: /* @__PURE__ */ E(
|
|
859
861
|
"div",
|
|
860
862
|
{
|
|
861
|
-
...
|
|
863
|
+
...ks,
|
|
862
864
|
ref: Dt,
|
|
863
865
|
role: "figure",
|
|
864
866
|
"data-schedule-clip": "schedule",
|
|
@@ -869,10 +871,10 @@ function ei(s) {
|
|
|
869
871
|
/* @__PURE__ */ p("div", { className: g.corner, children: wt !== null && /* @__PURE__ */ p("span", { className: g.zoneLabel, "data-schedule-overlay": "zone label", children: wt }) }),
|
|
870
872
|
/* @__PURE__ */ p("div", { className: g.dayBand, "aria-hidden": "true", "data-schedule-days": "", "data-schedule-clip": "day band", children: w.days.map((u, y) => {
|
|
871
873
|
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
|
-
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 ?
|
|
874
|
+
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 ? Ms(u.start, et === 1 ? _ : Math.min(_, _t)) : "" }) }, u.start);
|
|
873
875
|
}) }),
|
|
874
876
|
/* @__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 * lt)) }, (u, y) => /* @__PURE__ */ p("div", { className: g.header, style: { height: `${Math.round(r * lt)}px` }, children: /* @__PURE__ */ p(
|
|
877
|
+
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(Ps, { width: "60%" }) }, y)),
|
|
876
878
|
w.headers.map((u) => /* @__PURE__ */ E(
|
|
877
879
|
"div",
|
|
878
880
|
{
|
|
@@ -883,7 +885,7 @@ function ei(s) {
|
|
|
883
885
|
"data-group": u.group,
|
|
884
886
|
"data-row": u.kind,
|
|
885
887
|
"data-schedule-clip": `header ${u.kind}`,
|
|
886
|
-
"data-refused": u.lane !== void 0 &&
|
|
888
|
+
"data-refused": u.lane !== void 0 && Is.has(u.lane) ? "" : void 0,
|
|
887
889
|
children: [
|
|
888
890
|
u.kind !== "lane" && u.group !== void 0 && /* @__PURE__ */ p(
|
|
889
891
|
"button",
|
|
@@ -892,10 +894,10 @@ function ei(s) {
|
|
|
892
894
|
className: g.chevron,
|
|
893
895
|
"data-schedule-overlay": "fold control",
|
|
894
896
|
"aria-expanded": u.collapsed === !1,
|
|
895
|
-
"aria-controls": (
|
|
897
|
+
"aria-controls": (Ss.get(u.group) ?? [Ft(u)]).join(" "),
|
|
896
898
|
"aria-label": `${u.collapsed === !0 ? B.scheduleUnfoldGroup : B.scheduleFoldGroup}: ${typeof u.label == "string" ? u.label : u.group}`,
|
|
897
899
|
onClick: () => e.toggleGroup(u.group),
|
|
898
|
-
children: /* @__PURE__ */ p(
|
|
900
|
+
children: /* @__PURE__ */ p(Rs, { size: 9, "data-open": u.collapsed === !1 ? "" : void 0 })
|
|
899
901
|
}
|
|
900
902
|
),
|
|
901
903
|
/* @__PURE__ */ p("span", { className: g.headerLabel, "data-schedule-overlay": "header label", children: u.label }),
|
|
@@ -925,7 +927,7 @@ function ei(s) {
|
|
|
925
927
|
onKeyDown: (u) => {
|
|
926
928
|
e.key(u.nativeEvent) && u.preventDefault();
|
|
927
929
|
},
|
|
928
|
-
onFocus: (u) => e.focus(
|
|
930
|
+
onFocus: (u) => e.focus(ei(u.currentTarget)),
|
|
929
931
|
onBlur: () => e.blur(),
|
|
930
932
|
onPointerDown: (u) => e.pointerDown(u.nativeEvent),
|
|
931
933
|
onPointerMove: (u) => e.pointerMove(u.nativeEvent),
|
|
@@ -979,7 +981,7 @@ function ei(s) {
|
|
|
979
981
|
top: `${Bt.y}px`,
|
|
980
982
|
visibility: Bt.at === xt ? void 0 : "hidden"
|
|
981
983
|
},
|
|
982
|
-
children: typeof O == "function" ? O(w.tooltip.target) : /* @__PURE__ */ p(
|
|
984
|
+
children: typeof O == "function" ? O(w.tooltip.target) : /* @__PURE__ */ p(Xn, { target: w.tooltip.target })
|
|
983
985
|
}
|
|
984
986
|
),
|
|
985
987
|
T !== null && /* @__PURE__ */ E(
|
|
@@ -1018,7 +1020,7 @@ function ei(s) {
|
|
|
1018
1020
|
/* @__PURE__ */ E(Le, { "aria-live": "polite", children: [
|
|
1019
1021
|
G?.span !== void 0 && /* @__PURE__ */ p("span", { children: B.scheduleVisibleRange(vt(G.span[0]), vt(G.span[1])) }, G.count),
|
|
1020
1022
|
G !== null && G.target !== null && /* @__PURE__ */ p(
|
|
1021
|
-
|
|
1023
|
+
Un,
|
|
1022
1024
|
{
|
|
1023
1025
|
target: G.target,
|
|
1024
1026
|
lane: G.lane === null ? null : e.data.lanes.find((u) => u.id === G.lane)?.label ?? G.lane
|
|
@@ -1027,21 +1029,21 @@ function ei(s) {
|
|
|
1027
1029
|
)
|
|
1028
1030
|
] }),
|
|
1029
1031
|
/* @__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}` }),
|
|
1030
|
-
|
|
1032
|
+
gs
|
|
1031
1033
|
]
|
|
1032
1034
|
}
|
|
1033
1035
|
) });
|
|
1034
1036
|
}
|
|
1035
|
-
function
|
|
1037
|
+
function ei(s) {
|
|
1036
1038
|
try {
|
|
1037
1039
|
return s.matches(":focus-visible");
|
|
1038
1040
|
} catch {
|
|
1039
1041
|
return !0;
|
|
1040
1042
|
}
|
|
1041
1043
|
}
|
|
1042
|
-
function
|
|
1043
|
-
const s =
|
|
1044
|
-
t?.subscribe ??
|
|
1044
|
+
function si() {
|
|
1045
|
+
const s = Ze(), t = Xs(s), e = St(), n = mt(), i = re(), o = Jt(
|
|
1046
|
+
t?.subscribe ?? ni,
|
|
1045
1047
|
t?.getSnapshot ?? (() => null),
|
|
1046
1048
|
t?.getServerSnapshot ?? (() => null)
|
|
1047
1049
|
);
|
|
@@ -1104,44 +1106,41 @@ function ni() {
|
|
|
1104
1106
|
/* @__PURE__ */ p("div", { id: s, className: g.dataPanel, tabIndex: 0, children: r })
|
|
1105
1107
|
] });
|
|
1106
1108
|
}
|
|
1107
|
-
const
|
|
1109
|
+
const ni = () => () => {
|
|
1108
1110
|
};
|
|
1109
|
-
function
|
|
1110
|
-
const e =
|
|
1111
|
-
return
|
|
1111
|
+
function ii({ id: s, label: t }) {
|
|
1112
|
+
const e = es(), n = U(() => ({ id: s, label: t ?? s, ...e === null ? {} : { parent: e } }), [s, t, e]);
|
|
1113
|
+
return Ws(n), null;
|
|
1112
1114
|
}
|
|
1113
|
-
function
|
|
1114
|
-
const n =
|
|
1115
|
-
return
|
|
1115
|
+
function oi({ id: s, label: t, children: e }) {
|
|
1116
|
+
const n = es(), i = U(() => ({ id: s, label: t ?? s, ...n === null ? {} : { parent: n } }), [s, t, n]);
|
|
1117
|
+
return Us(i), /* @__PURE__ */ p(ts, { value: s, children: e });
|
|
1116
1118
|
}
|
|
1117
|
-
function
|
|
1119
|
+
function ai({ data: s, tasks: t }) {
|
|
1118
1120
|
const e = U(() => ({ kind: "subtasks", data: s, tasks: t }), [s, t]);
|
|
1119
1121
|
return Lt("Subtasks", e), null;
|
|
1120
1122
|
}
|
|
1121
|
-
function
|
|
1123
|
+
function ri({ data: s }) {
|
|
1122
1124
|
const t = U(() => ({ kind: "dependencies", data: s }), [s]);
|
|
1123
1125
|
return Lt("Dependencies", t), null;
|
|
1124
1126
|
}
|
|
1125
|
-
function
|
|
1127
|
+
function li({ data: s }) {
|
|
1126
1128
|
const t = U(() => ({ kind: "blocked", data: s }), [s]);
|
|
1127
1129
|
return Lt("BlockedTimes", t), null;
|
|
1128
1130
|
}
|
|
1129
|
-
function
|
|
1131
|
+
function di({ data: s }) {
|
|
1130
1132
|
const t = U(() => ({ kind: "milestones", data: s }), [s]);
|
|
1131
1133
|
return Lt("Milestones", t), null;
|
|
1132
1134
|
}
|
|
1133
|
-
function
|
|
1135
|
+
function hi() {
|
|
1134
1136
|
try {
|
|
1135
1137
|
return process.env.NODE_ENV !== "production";
|
|
1136
1138
|
} catch {
|
|
1137
1139
|
return !1;
|
|
1138
1140
|
}
|
|
1139
1141
|
}
|
|
1140
|
-
const
|
|
1141
|
-
|
|
1142
|
-
!hs || Be.has(s) || (Be.add(s), console.warn(`@umriss-ui/schedule: ${t}`));
|
|
1143
|
-
}
|
|
1144
|
-
class ui {
|
|
1142
|
+
const ci = hi(), ui = "@umriss-ui/schedule", nt = (s, t) => Gs(ui, s, t);
|
|
1143
|
+
class fi {
|
|
1145
1144
|
/** `changed` is called after every registration change. */
|
|
1146
1145
|
constructor(t) {
|
|
1147
1146
|
this.changed = t;
|
|
@@ -1168,6 +1167,7 @@ class ui {
|
|
|
1168
1167
|
violatedById = /* @__PURE__ */ new Map();
|
|
1169
1168
|
depth = /* @__PURE__ */ new Map();
|
|
1170
1169
|
inBlocked = [];
|
|
1170
|
+
unchecked = !1;
|
|
1171
1171
|
registerLane(t) {
|
|
1172
1172
|
const e = this.nextId++;
|
|
1173
1173
|
return this.laneEntries.set(e, t), this.touch(), e;
|
|
@@ -1213,15 +1213,16 @@ class ui {
|
|
|
1213
1213
|
this.subtasks.push(...e.data);
|
|
1214
1214
|
for (const n of e.tasks) this.tasks.set(n.id, n);
|
|
1215
1215
|
} else e.kind === "dependencies" ? this.dependencies.push(...e.data) : e.kind === "milestones" ? this.milestones.push(...e.data) : this.blocked.push(...e.data);
|
|
1216
|
-
return this.subtaskById = new Map(this.subtasks.map((e) => [e.id, e])), this.overlaps = ee(this.subtasks), this.violatedById = new Map(se(this.subtasks, this.dependencies).map((e) => [e.dependency, e])), this.depth =
|
|
1216
|
+
return this.subtaskById = new Map(this.subtasks.map((e) => [e.id, e])), this.overlaps = ee(this.subtasks), this.violatedById = new Map(se(this.subtasks, this.dependencies).map((e) => [e.dependency, e])), this.depth = Ys(this.subtasks), this.inBlocked = Qe(this.subtasks, this.blocked), this.unchecked = !0, !0;
|
|
1217
1217
|
}
|
|
1218
1218
|
/** Says in development what the data gets wrong and is drawn, dropped or
|
|
1219
|
-
counted regardless.
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1219
|
+
counted regardless. The Schedule calls it from an effect of its own,
|
|
1220
|
+
which runs after the effects of every part in the same commit: a lane
|
|
1221
|
+
or a subtask layer registered after the layer that names it is not
|
|
1222
|
+
missing. With no lane declared the lanes are still on their way, and an
|
|
1223
|
+
empty `tasks` is a plan drawn muted on purpose. */
|
|
1223
1224
|
warnOfMalformedData() {
|
|
1224
|
-
if (!
|
|
1225
|
+
if (!this.unchecked || (this.unchecked = !1, !ci)) return;
|
|
1225
1226
|
const t = (i, o) => {
|
|
1226
1227
|
const a = /* @__PURE__ */ new Set();
|
|
1227
1228
|
for (const r of o)
|
|
@@ -1238,10 +1239,9 @@ class ui {
|
|
|
1238
1239
|
for (const a of i.data)
|
|
1239
1240
|
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.`);
|
|
1240
1241
|
}
|
|
1241
|
-
|
|
1242
|
-
for (const
|
|
1243
|
-
|
|
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.`);
|
|
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.`);
|
|
1245
1245
|
if (this.lanes.length === 0) return;
|
|
1246
1246
|
const e = new Set(this.lanes.map((i) => i.id)), n = (i, o) => {
|
|
1247
1247
|
for (const { id: a, lane: r } of o)
|
|
@@ -1273,24 +1273,24 @@ class ui {
|
|
|
1273
1273
|
};
|
|
1274
1274
|
}
|
|
1275
1275
|
}
|
|
1276
|
-
const
|
|
1277
|
-
function
|
|
1276
|
+
const mi = 6;
|
|
1277
|
+
function ds(s, t, e, n, i, o) {
|
|
1278
1278
|
s.save(), s.beginPath(), s.rect(t, e, n, i), s.clip(), s.globalAlpha = 0.35, s.strokeStyle = o, s.lineWidth = 1, s.beginPath();
|
|
1279
|
-
for (let a = t - i; a < t + n + i; a +=
|
|
1279
|
+
for (let a = t - i; a < t + n + i; a += mi)
|
|
1280
1280
|
s.moveTo(a, e + i), s.lineTo(a + i, e);
|
|
1281
1281
|
s.stroke(), s.restore();
|
|
1282
1282
|
}
|
|
1283
|
-
function
|
|
1283
|
+
function pi(s, t, e, n) {
|
|
1284
1284
|
if (n.size === 0) return;
|
|
1285
1285
|
const { width: i, height: o } = t.view;
|
|
1286
1286
|
for (const a of n) {
|
|
1287
1287
|
const r = tt(e, a);
|
|
1288
1288
|
if (r === null) continue;
|
|
1289
1289
|
const { top: l, height: d } = r;
|
|
1290
|
-
l + d < 0 || l > o || (s.globalAlpha = 0.6, s.fillStyle = t.colours.surface, s.fillRect(0, l, i, d), s.globalAlpha = 1,
|
|
1290
|
+
l + d < 0 || l > o || (s.globalAlpha = 0.6, s.fillStyle = t.colours.surface, s.fillRect(0, l, i, d), s.globalAlpha = 1, ds(s, 0, l, i, d, t.colours.muted));
|
|
1291
1291
|
}
|
|
1292
1292
|
}
|
|
1293
|
-
function
|
|
1293
|
+
function gi(s, t, e) {
|
|
1294
1294
|
const { data: n } = t;
|
|
1295
1295
|
if (n.violatedById.size !== 0)
|
|
1296
1296
|
for (const i of n.violatedById.values()) {
|
|
@@ -1311,11 +1311,11 @@ function Wt(s, t, e, n, i, o) {
|
|
|
1311
1311
|
}
|
|
1312
1312
|
s.strokeStyle = t.colours.alarm, s.lineWidth = o, s.setLineDash([4, 3]), s.beginPath(), s.moveTo(e, i + o / 2), s.lineTo(n, i + o / 2), s.stroke(), s.setLineDash([]);
|
|
1313
1313
|
}
|
|
1314
|
-
function
|
|
1314
|
+
function ki(s, t, e, n) {
|
|
1315
1315
|
const i = tt(e, n.lane);
|
|
1316
1316
|
if (i === null || i.top + i.height < 0 || i.top > t.view.height) return;
|
|
1317
1317
|
const o = Math.max(0, x(e, n.from)), a = Math.min(t.view.width, x(e, n.to));
|
|
1318
|
-
a <= o || (s.globalAlpha = 0.1, s.fillStyle = t.colours.muted, s.fillRect(o, i.top, a - o, i.height), s.globalAlpha = 1,
|
|
1318
|
+
a <= o || (s.globalAlpha = 0.1, s.fillStyle = t.colours.muted, s.fillRect(o, i.top, a - o, i.height), s.globalAlpha = 1, ds(s, o, i.top, a - o, i.height, t.colours.muted));
|
|
1319
1319
|
}
|
|
1320
1320
|
function Ut(s, t, e, n) {
|
|
1321
1321
|
const i = tt(e, n.lane);
|
|
@@ -1326,7 +1326,7 @@ function Ut(s, t, e, n) {
|
|
|
1326
1326
|
r !== null && Wt(s, t, o, a, r.top - e.scrollY + 1, 3);
|
|
1327
1327
|
}
|
|
1328
1328
|
}
|
|
1329
|
-
const
|
|
1329
|
+
const wi = {
|
|
1330
1330
|
line: "var(--u-hairline)",
|
|
1331
1331
|
lineStrong: "var(--u-hairline-strong)",
|
|
1332
1332
|
text: "var(--u-color-text)",
|
|
@@ -1340,7 +1340,7 @@ const ki = {
|
|
|
1340
1340
|
/* What text and marks take ON a filled bar - the same token the bar labels
|
|
1341
1341
|
use in CSS, so a cap and the label beside it are one colour. */
|
|
1342
1342
|
onAccent: "var(--u-color-on-accent)"
|
|
1343
|
-
},
|
|
1343
|
+
}, hs = {
|
|
1344
1344
|
line: "GrayText",
|
|
1345
1345
|
lineStrong: "CanvasText",
|
|
1346
1346
|
text: "CanvasText",
|
|
@@ -1350,11 +1350,11 @@ const ki = {
|
|
|
1350
1350
|
active: "Highlight",
|
|
1351
1351
|
now: "GrayText",
|
|
1352
1352
|
onAccent: "Canvas"
|
|
1353
|
-
},
|
|
1354
|
-
function
|
|
1355
|
-
const e =
|
|
1356
|
-
for (const a of t.tasks.values()) n[`task:${a.id}`] = e ?
|
|
1357
|
-
const i =
|
|
1353
|
+
}, vi = (s) => s ? hs : wi, yi = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(forced-colors: active)").matches;
|
|
1354
|
+
function bi(s, t) {
|
|
1355
|
+
const e = yi(), n = {};
|
|
1356
|
+
for (const a of t.tasks.values()) n[`task:${a.id}`] = e ? hs.text : a.color;
|
|
1357
|
+
const i = Fs(s, { ...vi(e), ...n }), o = /* @__PURE__ */ new Map();
|
|
1358
1358
|
for (const a of t.tasks.values()) o.set(a.id, i[`task:${a.id}`] ?? a.color);
|
|
1359
1359
|
return {
|
|
1360
1360
|
line: i.line,
|
|
@@ -1374,64 +1374,64 @@ function ft(s) {
|
|
|
1374
1374
|
const t = s.match(/[\d.]+/g);
|
|
1375
1375
|
return t === null || t.length < 3 ? null : [Number(t[0]), Number(t[1]), Number(t[2])];
|
|
1376
1376
|
}
|
|
1377
|
-
function
|
|
1377
|
+
function Be(s) {
|
|
1378
1378
|
const t = ft(s);
|
|
1379
|
-
return t === null ? 0 :
|
|
1379
|
+
return t === null ? 0 : us(cs(t));
|
|
1380
1380
|
}
|
|
1381
|
-
function
|
|
1381
|
+
function cs(s) {
|
|
1382
1382
|
return s.map((t) => {
|
|
1383
1383
|
const e = t / 255;
|
|
1384
1384
|
return e <= 0.04045 ? e / 12.92 : ((e + 0.055) / 1.055) ** 2.4;
|
|
1385
1385
|
});
|
|
1386
1386
|
}
|
|
1387
|
-
function
|
|
1387
|
+
function us([s, t, e]) {
|
|
1388
1388
|
return 0.2126 * s + 0.7152 * t + 0.0722 * e;
|
|
1389
1389
|
}
|
|
1390
|
-
function
|
|
1391
|
-
const e =
|
|
1390
|
+
function xe(s, t) {
|
|
1391
|
+
const e = Be(s), n = Be(t);
|
|
1392
1392
|
return (Math.max(e, n) + 0.05) / (Math.min(e, n) + 0.05);
|
|
1393
1393
|
}
|
|
1394
|
-
function
|
|
1394
|
+
function Ne(s, t, e) {
|
|
1395
1395
|
if (s === null) return null;
|
|
1396
1396
|
const n = typeof window > "u" ? 1 : window.devicePixelRatio || 1, i = Math.round(t * n), o = Math.round(e * n);
|
|
1397
1397
|
s.width !== i && (s.width = i), s.height !== o && (s.height = o);
|
|
1398
1398
|
const a = s.getContext("2d");
|
|
1399
1399
|
return a === null ? null : (a.setTransform(n, 0, 0, n, 0, 0), a.clearRect(0, 0, t, e), a);
|
|
1400
1400
|
}
|
|
1401
|
-
function
|
|
1401
|
+
function Mi(s, t) {
|
|
1402
1402
|
const { data: e, view: n } = t, i = n.viewport();
|
|
1403
|
-
|
|
1404
|
-
for (const o of e.blocked)
|
|
1405
|
-
|
|
1403
|
+
Ii(s, t, i);
|
|
1404
|
+
for (const o of e.blocked) ki(s, t, i, o);
|
|
1405
|
+
Li(s, t);
|
|
1406
1406
|
for (const o of e.layers) {
|
|
1407
1407
|
if (o.kind === "blocked" || o.kind === "milestones") continue;
|
|
1408
1408
|
const a = new Set(o.data);
|
|
1409
1409
|
if (o.kind === "dependencies")
|
|
1410
|
-
for (const r of n.paths) a.has(r.dependency) &&
|
|
1410
|
+
for (const r of n.paths) a.has(r.dependency) && en(r, n.width, n.height) && Xt(s, t, r, !1);
|
|
1411
1411
|
else
|
|
1412
|
-
for (const r of n.boxes) a.has(r.subtask) &&
|
|
1412
|
+
for (const r of n.boxes) a.has(r.subtask) && ms(s, t, r, 1);
|
|
1413
1413
|
}
|
|
1414
1414
|
for (const o of e.overlaps) Ut(s, t, i, o);
|
|
1415
1415
|
for (const o of e.inBlocked) Ut(s, t, i, o);
|
|
1416
|
-
|
|
1417
|
-
for (const o of e.milestones)
|
|
1418
|
-
|
|
1416
|
+
gi(s, t, i);
|
|
1417
|
+
for (const o of e.milestones) ps(s, t, i, o, !1);
|
|
1418
|
+
Ei(s, t);
|
|
1419
1419
|
}
|
|
1420
|
-
function
|
|
1420
|
+
function Ti(s, t) {
|
|
1421
1421
|
const { view: e, hover: n } = t, i = e.viewport();
|
|
1422
1422
|
if (t.ghost === null) {
|
|
1423
1423
|
if (n.kind === "subtask") {
|
|
1424
1424
|
const c = e.boxById.get(n.subtask.id);
|
|
1425
|
-
c !== void 0 &&
|
|
1425
|
+
c !== void 0 && Fi(s, t, c);
|
|
1426
1426
|
} else if (n.kind === "dependency") {
|
|
1427
1427
|
const c = e.paths.find((m) => m.dependency === n.dependency);
|
|
1428
1428
|
c !== void 0 && Xt(s, t, c, !0);
|
|
1429
|
-
} else n.kind === "milestone" &&
|
|
1429
|
+
} else n.kind === "milestone" && ps(s, t, i, n.milestone, !0);
|
|
1430
1430
|
return;
|
|
1431
1431
|
}
|
|
1432
1432
|
const o = t.ghost, { ghost: a, overlaps: r, violated: l } = o;
|
|
1433
|
-
|
|
1434
|
-
const d =
|
|
1433
|
+
pi(s, t, i, o.refusedLanes);
|
|
1434
|
+
const d = fs(i, a);
|
|
1435
1435
|
if (d === null) return;
|
|
1436
1436
|
for (const c of r) Ut(s, t, i, c);
|
|
1437
1437
|
const h = new Set(l.map((c) => c.dependency));
|
|
@@ -1442,17 +1442,17 @@ function Mi(s, t) {
|
|
|
1442
1442
|
const k = c.from === a.id ? Vt(i, c, d, m, e.options) : Vt(i, c, m, d, e.options);
|
|
1443
1443
|
Xt(s, t, k, !0, h.has(c.id));
|
|
1444
1444
|
}
|
|
1445
|
-
|
|
1445
|
+
ms(s, { ...t, selectedTask: null }, d, 0.55), s.strokeStyle = t.colours.text, s.lineWidth = 1, s.setLineDash([3, 2]), s.strokeRect(d.outerFrom + 0.5, d.y + 0.5, Math.max(1, d.outerTo - d.outerFrom - 1), d.height - 1), s.setLineDash([]), o.tether !== null && Si(s, t, d, o.tether);
|
|
1446
1446
|
}
|
|
1447
|
-
function
|
|
1447
|
+
function Si(s, t, e, n) {
|
|
1448
1448
|
const i = Math.max(e.outerFrom, Math.min(e.outerTo, n.x)), o = Math.max(e.y, Math.min(e.y + e.height, n.y));
|
|
1449
1449
|
Math.hypot(n.x - i, n.y - o) < 2 || (s.strokeStyle = t.colours.text, s.lineWidth = 1, s.setLineDash([2, 3]), s.beginPath(), s.moveTo(i + 0.5, o + 0.5), s.lineTo(n.x + 0.5, n.y + 0.5), s.stroke(), s.setLineDash([]));
|
|
1450
1450
|
}
|
|
1451
|
-
function
|
|
1451
|
+
function fs(s, t) {
|
|
1452
1452
|
const e = oe(s.rows, t.lane);
|
|
1453
|
-
return e === null ? null :
|
|
1453
|
+
return e === null ? null : is(s, t, e, 0);
|
|
1454
1454
|
}
|
|
1455
|
-
function
|
|
1455
|
+
function Ii(s, t, e) {
|
|
1456
1456
|
const { view: n, colours: i, bands: o } = t, { width: a, height: r } = n;
|
|
1457
1457
|
s.lineWidth = 1, s.strokeStyle = i.line, s.beginPath();
|
|
1458
1458
|
for (const h of o.ticks)
|
|
@@ -1471,7 +1471,7 @@ function Si(s, t, e) {
|
|
|
1471
1471
|
for (const h of o.days)
|
|
1472
1472
|
s.moveTo(h.x + 0.5, 0), s.lineTo(h.x + 0.5, r);
|
|
1473
1473
|
s.stroke();
|
|
1474
|
-
const d =
|
|
1474
|
+
const d = $s(n.options.calendar);
|
|
1475
1475
|
if (d.length > 0) {
|
|
1476
1476
|
s.strokeStyle = i.muted, s.setLineDash([2, 3]), s.beginPath();
|
|
1477
1477
|
for (const h of d) {
|
|
@@ -1481,11 +1481,11 @@ function Si(s, t, e) {
|
|
|
1481
1481
|
s.stroke(), s.setLineDash([]);
|
|
1482
1482
|
}
|
|
1483
1483
|
}
|
|
1484
|
-
function
|
|
1484
|
+
function Li(s, t) {
|
|
1485
1485
|
const e = t.view.nowX();
|
|
1486
1486
|
e !== null && (s.fillStyle = t.colours.now, s.fillRect(e, 0, 2, t.view.height));
|
|
1487
1487
|
}
|
|
1488
|
-
function
|
|
1488
|
+
function Ci(s, t, e, n) {
|
|
1489
1489
|
const i = pt(t.colours, t, e.subtask.task, e.subtask.id);
|
|
1490
1490
|
s.fillStyle = i;
|
|
1491
1491
|
for (const [o, a] of [
|
|
@@ -1497,19 +1497,19 @@ function Li(s, t, e, n) {
|
|
|
1497
1497
|
}
|
|
1498
1498
|
function le(s, t, e) {
|
|
1499
1499
|
if (s.dashed) return { fill: null, onDark: !1 };
|
|
1500
|
-
const n = s.muted ?
|
|
1501
|
-
return { fill: n, onDark:
|
|
1500
|
+
const n = s.muted ? Ai(t, e.surface, 0.5) : t;
|
|
1501
|
+
return { fill: n, onDark: xe(n, e.onAccent) > xe(n, e.text) };
|
|
1502
1502
|
}
|
|
1503
|
-
function
|
|
1503
|
+
function Ai(s, t, e) {
|
|
1504
1504
|
const n = ft(s), i = ft(t);
|
|
1505
1505
|
if (n === null || i === null) return s;
|
|
1506
1506
|
const o = (a) => Math.round(n[a] + (i[a] - n[a]) * e);
|
|
1507
1507
|
return `rgb(${o(0)}, ${o(1)}, ${o(2)})`;
|
|
1508
1508
|
}
|
|
1509
|
-
function
|
|
1509
|
+
function Pe(s, t) {
|
|
1510
1510
|
const e = ft(s);
|
|
1511
1511
|
if (e === null || t === 0) return s;
|
|
1512
|
-
const n =
|
|
1512
|
+
const n = cs(e), i = us(n), [o, a, r] = n.map((l) => {
|
|
1513
1513
|
const d = l + (i - l) * t, h = d <= 31308e-7 ? d * 12.92 : 1.055 * d ** (1 / 2.4) - 0.055;
|
|
1514
1514
|
return Math.round(Math.min(1, Math.max(0, h)) * 255);
|
|
1515
1515
|
});
|
|
@@ -1517,14 +1517,14 @@ function Re(s, t) {
|
|
|
1517
1517
|
}
|
|
1518
1518
|
function pt(s, t, e, n) {
|
|
1519
1519
|
const i = (e === null ? void 0 : s.tasks.get(e)) ?? s.muted;
|
|
1520
|
-
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 : Pe(i, 1) : s.forced || t.selectedSubtask === null || n === null || n === t.selectedSubtask ? i : Pe(i, 0.5);
|
|
1521
1521
|
}
|
|
1522
|
-
const
|
|
1523
|
-
function
|
|
1522
|
+
const Di = 2;
|
|
1523
|
+
function ms(s, t, e, n) {
|
|
1524
1524
|
const { view: i, colours: o } = t;
|
|
1525
1525
|
if (!Yt(e, i.width, i.height)) return;
|
|
1526
1526
|
if (e.miniature) {
|
|
1527
|
-
|
|
1527
|
+
Ci(s, t, e, n);
|
|
1528
1528
|
return;
|
|
1529
1529
|
}
|
|
1530
1530
|
const a = It(e.subtask.appearance), r = pt(o, t, e.subtask.task, e.subtask.id), l = le(a, r, o), d = e.y, h = e.height, c = Math.max(1, e.mainTo - e.mainFrom), m = l.onDark ? o.onAccent : o.text;
|
|
@@ -1537,25 +1537,25 @@ function gs(s, t, e, n) {
|
|
|
1537
1537
|
l.fill !== null && (s.globalAlpha = n, s.fillStyle = l.fill, s.fillRect(e.mainFrom, d, c, h));
|
|
1538
1538
|
const k = e.subtask.progress;
|
|
1539
1539
|
if (k !== void 0) {
|
|
1540
|
-
const f = Math.min(4, Math.max(2, Math.round(h / 6))), v = d + h - f -
|
|
1540
|
+
const f = Math.min(4, Math.max(2, Math.round(h / 6))), v = d + h - f - Di, C = Math.round(c * Math.max(0, Math.min(1, k)));
|
|
1541
1541
|
s.fillStyle = l.fill === null ? r : m, s.globalAlpha = 0.3 * n, s.fillRect(e.mainFrom, v, c, f), s.globalAlpha = n, C > 0 && s.fillRect(e.mainFrom, v, C, f);
|
|
1542
1542
|
}
|
|
1543
1543
|
if (a.hatched) {
|
|
1544
|
-
const f = Math.max(1, Math.min(
|
|
1544
|
+
const f = Math.max(1, Math.min(ns, Math.floor((c - 2 * dt) / 3))), v = c >= 4 * f ? dt : 0, C = h >= 4 * dt ? dt : 0;
|
|
1545
1545
|
s.globalAlpha = n, s.fillStyle = m, s.fillRect(e.mainFrom + v, d + C, f, h - 2 * C), s.fillRect(e.mainTo - v - f, d + C, f, h - 2 * C);
|
|
1546
1546
|
}
|
|
1547
|
-
a.open &&
|
|
1547
|
+
a.open && Oi(s, e, d, h, o.surface, i.width), a.dashed && (s.globalAlpha = n, s.strokeStyle = r, s.setLineDash([4, 3]), s.strokeRect(e.mainFrom + 0.5, d + 0.5, c - 1, h - 1), s.setLineDash([])), s.globalAlpha = 1, e.depth > 0 && n === 1 && (s.strokeStyle = o.surface, s.strokeRect(e.outerFrom - 0.5, d - 0.5, e.outerTo - e.outerFrom + 1, h + 1));
|
|
1548
1548
|
}
|
|
1549
|
-
const
|
|
1550
|
-
function
|
|
1551
|
-
const a = t.mainFrom < 0, r = t.mainTo > o, l = Math.max(1, Math.min(t.mainTo, o) - Math.max(t.mainFrom, 0)), d = Math.min(
|
|
1552
|
-
a &&
|
|
1549
|
+
const _i = 16;
|
|
1550
|
+
function Oi(s, t, e, n, i, o) {
|
|
1551
|
+
const a = t.mainFrom < 0, r = t.mainTo > o, l = Math.max(1, Math.min(t.mainTo, o) - Math.max(t.mainFrom, 0)), d = Math.min(_i, l);
|
|
1552
|
+
a && Re(s, 0, d, e, n, i), r && Re(s, o, -d, e, n, i);
|
|
1553
1553
|
}
|
|
1554
|
-
function
|
|
1554
|
+
function Re(s, t, e, n, i, o) {
|
|
1555
1555
|
const a = s.createLinearGradient(t, 0, t + e, 0);
|
|
1556
|
-
a.addColorStop(0,
|
|
1556
|
+
a.addColorStop(0, Ge(o, 1)), a.addColorStop(1, Ge(o, 0)), s.globalAlpha = 1, s.fillStyle = a, s.fillRect(Math.min(t, t + e), n, Math.abs(e), i);
|
|
1557
1557
|
}
|
|
1558
|
-
function
|
|
1558
|
+
function Ge(s, t) {
|
|
1559
1559
|
const e = ft(s);
|
|
1560
1560
|
return e === null ? s : `rgba(${e[0]}, ${e[1]}, ${e[2]}, ${t})`;
|
|
1561
1561
|
}
|
|
@@ -1572,7 +1572,7 @@ function Xt(s, t, e, n, i) {
|
|
|
1572
1572
|
])
|
|
1573
1573
|
s.beginPath(), s.arc(c, m, l ? 3 : 2.5, 0, Math.PI * 2), s.fill();
|
|
1574
1574
|
}
|
|
1575
|
-
function
|
|
1575
|
+
function ps(s, t, e, n, i) {
|
|
1576
1576
|
const o = ae(e, n);
|
|
1577
1577
|
if (o === null || o.x < -o.half || o.x > t.view.width + o.half) return;
|
|
1578
1578
|
const a = (r) => {
|
|
@@ -1580,16 +1580,16 @@ function ks(s, t, e, n, i) {
|
|
|
1580
1580
|
};
|
|
1581
1581
|
i && (a(o.half + 3), s.fillStyle = t.colours.active, s.fill()), a(o.half + 1), s.fillStyle = t.colours.surface, s.fill(), a(o.half), s.fillStyle = t.colours.text, s.fill();
|
|
1582
1582
|
}
|
|
1583
|
-
function
|
|
1583
|
+
function Fi(s, t, e) {
|
|
1584
1584
|
const { colours: n } = t, i = It(e.subtask.appearance), o = le(i, pt(n, t, e.subtask.task, e.subtask.id), n);
|
|
1585
1585
|
if (n.forced) {
|
|
1586
1586
|
s.strokeStyle = n.active, s.lineWidth = 2, s.strokeRect(e.outerFrom - 2, e.y - 2, Math.max(1, e.outerTo - e.outerFrom) + 4, e.height + 4);
|
|
1587
1587
|
return;
|
|
1588
1588
|
}
|
|
1589
|
-
s.globalAlpha =
|
|
1589
|
+
s.globalAlpha = $i, s.fillStyle = o.onDark ? n.onAccent : n.text, s.fillRect(e.outerFrom, e.y, Math.max(1, e.outerTo - e.outerFrom), e.height), s.globalAlpha = 1;
|
|
1590
1590
|
}
|
|
1591
|
-
const
|
|
1592
|
-
function
|
|
1591
|
+
const $i = 0.2;
|
|
1592
|
+
function Ei(s, t) {
|
|
1593
1593
|
const e = t.selectedTask;
|
|
1594
1594
|
if (e !== null) {
|
|
1595
1595
|
s.strokeStyle = t.colours.text;
|
|
@@ -1602,12 +1602,12 @@ function $i(s, t) {
|
|
|
1602
1602
|
}
|
|
1603
1603
|
}
|
|
1604
1604
|
}
|
|
1605
|
-
const bt = 32,
|
|
1606
|
-
function
|
|
1605
|
+
const bt = 32, Bi = 18;
|
|
1606
|
+
function He(s, t) {
|
|
1607
1607
|
if (!(t > 2 * bt)) return 0;
|
|
1608
1608
|
const e = bt - s, n = s - (t - bt), i = Math.max(e, n);
|
|
1609
1609
|
if (i <= 0) return 0;
|
|
1610
|
-
const o = Math.min(1, i / bt), a =
|
|
1610
|
+
const o = Math.min(1, i / bt), a = Bi * o * o;
|
|
1611
1611
|
return e > 0 ? -a : a;
|
|
1612
1612
|
}
|
|
1613
1613
|
function ct(s, t, e) {
|
|
@@ -1617,14 +1617,14 @@ function ct(s, t, e) {
|
|
|
1617
1617
|
};
|
|
1618
1618
|
return e.some((i) => n(s, i) && !(t !== null && n(t, i)));
|
|
1619
1619
|
}
|
|
1620
|
-
function
|
|
1620
|
+
function xi(s, t, e, n) {
|
|
1621
1621
|
const i = /* @__PURE__ */ new Set();
|
|
1622
1622
|
if (n === void 0) return i;
|
|
1623
1623
|
for (const o of s)
|
|
1624
1624
|
o !== e && (n(t, o) || i.add(o));
|
|
1625
1625
|
return i;
|
|
1626
1626
|
}
|
|
1627
|
-
const
|
|
1627
|
+
const Ke = "\0placing", Ye = /* @__PURE__ */ new Set();
|
|
1628
1628
|
function Ht(s) {
|
|
1629
1629
|
switch (s.kind) {
|
|
1630
1630
|
case "subtask":
|
|
@@ -1639,8 +1639,8 @@ function Ht(s) {
|
|
|
1639
1639
|
return "nothing";
|
|
1640
1640
|
}
|
|
1641
1641
|
}
|
|
1642
|
-
const
|
|
1643
|
-
class
|
|
1642
|
+
const Ve = 3, Ni = 10, Pi = 600;
|
|
1643
|
+
class Ri {
|
|
1644
1644
|
constructor(t) {
|
|
1645
1645
|
this.host = t;
|
|
1646
1646
|
}
|
|
@@ -1667,7 +1667,7 @@ class Pi {
|
|
|
1667
1667
|
/** The finger's long press, armed by a touch on a bar that may be moved.
|
|
1668
1668
|
`armed` is whether the press may still turn into a grab - and, once it
|
|
1669
1669
|
has, whether the `contextmenu` Android fires for it is the grab's. */
|
|
1670
|
-
press =
|
|
1670
|
+
press = Hs((t) => this.grab(t));
|
|
1671
1671
|
armed = !1;
|
|
1672
1672
|
hover = { kind: "nothing" };
|
|
1673
1673
|
/** Where the pointer rests on the plot while nothing is being dragged - or,
|
|
@@ -1706,7 +1706,7 @@ class Pi {
|
|
|
1706
1706
|
ghostSummary() {
|
|
1707
1707
|
const t = this.gesture;
|
|
1708
1708
|
if (t.kind !== "edit" && t.kind !== "place") return null;
|
|
1709
|
-
const e =
|
|
1709
|
+
const e = fs(this.host.view.viewport(), t.ghost);
|
|
1710
1710
|
if (e === null) return null;
|
|
1711
1711
|
const n = this.ghostFindings(t.ghost, this.ghostHome(t)), i = t.kind === "edit" && (t.mode === "leadIn" || t.mode === "leadOut"), o = i ? Q(t.ghost) : t.ghost;
|
|
1712
1712
|
return {
|
|
@@ -1760,7 +1760,7 @@ class Pi {
|
|
|
1760
1760
|
group: n,
|
|
1761
1761
|
timer: setTimeout(() => {
|
|
1762
1762
|
this.resting = null, e.openForGesture = /* @__PURE__ */ new Set([...e.openForGesture, n]), this.host.viewChanged();
|
|
1763
|
-
},
|
|
1763
|
+
}, Pi)
|
|
1764
1764
|
}));
|
|
1765
1765
|
}
|
|
1766
1766
|
stopResting() {
|
|
@@ -1788,9 +1788,9 @@ class Pi {
|
|
|
1788
1788
|
gesture that cannot change a lane at all asks nothing: the intents the
|
|
1789
1789
|
caller handles decide whether the question exists. */
|
|
1790
1790
|
askRefused(t, e) {
|
|
1791
|
-
if (!this.host.view.options.intents.includes(e === null ? "place" : "lane")) return
|
|
1791
|
+
if (!this.host.view.options.intents.includes(e === null ? "place" : "lane")) return Ye;
|
|
1792
1792
|
const n = this.host.data.lanes.map((i) => i.id);
|
|
1793
|
-
return
|
|
1793
|
+
return xi(n, t, e, this.host.handlers().canMoveTo);
|
|
1794
1794
|
}
|
|
1795
1795
|
/** What a press at a point would start, given the intents the caller handles. */
|
|
1796
1796
|
modeAt(t, e) {
|
|
@@ -1799,10 +1799,10 @@ class Pi {
|
|
|
1799
1799
|
for (let o = n.boxes.length - 1; o >= 0; o--) {
|
|
1800
1800
|
const a = n.boxes[o];
|
|
1801
1801
|
if (i.includes("stretch")) {
|
|
1802
|
-
const r =
|
|
1802
|
+
const r = tn(a, t, e);
|
|
1803
1803
|
if (r !== null) return { mode: r === "from" ? "stretch-from" : "stretch-to", subtask: a.subtask };
|
|
1804
1804
|
}
|
|
1805
|
-
if (
|
|
1805
|
+
if (os(a, t, e) !== null)
|
|
1806
1806
|
return i.includes("move") || i.includes("lane") ? { mode: "move", subtask: a.subtask } : { mode: "pan", subtask: a.subtask };
|
|
1807
1807
|
}
|
|
1808
1808
|
return { mode: "pan", subtask: null };
|
|
@@ -1816,7 +1816,7 @@ class Pi {
|
|
|
1816
1816
|
}
|
|
1817
1817
|
const i = this.gesture;
|
|
1818
1818
|
if (i.kind === "pending" && i.pointerId === t.pointerId) {
|
|
1819
|
-
if (Math.hypot(e - i.x0, n - i.y0) < (t.pointerType === "touch" ?
|
|
1819
|
+
if (Math.hypot(e - i.x0, n - i.y0) < (t.pointerType === "touch" ? Ni : Ve)) return;
|
|
1820
1820
|
i.mode === "pan" || i.subtask === null ? (this.gesture = { kind: "pan", pointerId: i.pointerId, lastX: i.x0, lastY: i.y0 }, this.setCursor("grabbing")) : this.startEdit(i, i.mode, i.subtask);
|
|
1821
1821
|
}
|
|
1822
1822
|
const o = this.gesture;
|
|
@@ -1845,7 +1845,7 @@ class Pi {
|
|
|
1845
1845
|
ghost: n,
|
|
1846
1846
|
/* Asked here, once, and drawn from the first frame of the drag: the
|
|
1847
1847
|
lanes that are closed are marked before the pointer reaches one. */
|
|
1848
|
-
refused: e === "move" ? this.askRefused(n, n.lane) :
|
|
1848
|
+
refused: e === "move" ? this.askRefused(n, n.lane) : Ye
|
|
1849
1849
|
}, this.setCursor(e === "move" ? "grabbing" : "ew-resize");
|
|
1850
1850
|
}
|
|
1851
1851
|
/** The finger has been held on a bar: the bar is grabbed, unless the finger
|
|
@@ -1895,7 +1895,7 @@ class Pi {
|
|
|
1895
1895
|
this.panFrame = 0;
|
|
1896
1896
|
const e = this.gesture;
|
|
1897
1897
|
if (e.kind !== "edit" && e.kind !== "place") return;
|
|
1898
|
-
const n = this.host.view, { x: i, y: o } = this.local(this.lastClient.x, this.lastClient.y), a =
|
|
1898
|
+
const n = this.host.view, { x: i, y: o } = this.local(this.lastClient.x, this.lastClient.y), a = He(i, n.width), r = He(o, n.height);
|
|
1899
1899
|
if (a === 0 && r === 0) return;
|
|
1900
1900
|
const l = n.pan(a, r);
|
|
1901
1901
|
if (l.moved) {
|
|
@@ -2028,7 +2028,7 @@ class Pi {
|
|
|
2028
2028
|
const o = this.onLane(n);
|
|
2029
2029
|
if (o === null) return { ghost: null, refused: !1, blocked: !1 };
|
|
2030
2030
|
if (i.has(o)) return { ghost: null, refused: !0, blocked: !1 };
|
|
2031
|
-
const a = { ...this.askedFor(t, o, e), id:
|
|
2031
|
+
const a = { ...this.askedFor(t, o, e), id: Ke };
|
|
2032
2032
|
return ct(a, null, this.host.data.blocked) ? { ghost: null, refused: !1, blocked: !0 } : { ghost: a, refused: !1, blocked: !1 };
|
|
2033
2033
|
}
|
|
2034
2034
|
/** The dragged item as a subtask, under the caller's key for it - not the
|
|
@@ -2094,7 +2094,7 @@ class Pi {
|
|
|
2094
2094
|
case "move": {
|
|
2095
2095
|
let d = o.from;
|
|
2096
2096
|
const h = i.viewport().scale, c = h.fromPx(e) - t.t0;
|
|
2097
|
-
r.includes("move") && Math.abs(c * h.m) >=
|
|
2097
|
+
r.includes("move") && Math.abs(c * h.m) >= Ve && (d = this.shifted(o.from, c, a));
|
|
2098
2098
|
let m = t.ghost.lane;
|
|
2099
2099
|
if (r.includes("lane")) {
|
|
2100
2100
|
const k = this.onLane(n) ?? m;
|
|
@@ -2124,7 +2124,7 @@ class Pi {
|
|
|
2124
2124
|
on to the seam, where time counts again. An intent never asks for a time
|
|
2125
2125
|
nobody works. */
|
|
2126
2126
|
snapInside(t, e) {
|
|
2127
|
-
const n =
|
|
2127
|
+
const n = Vs(t, e, this.host.view.options.timeZone), i = Tt(this.host.view.options.calendar);
|
|
2128
2128
|
return i.intervals.length === 0 ? n : qt(V(n, i), i);
|
|
2129
2129
|
}
|
|
2130
2130
|
intentsOf(t, e, n) {
|
|
@@ -2145,11 +2145,11 @@ class Pi {
|
|
|
2145
2145
|
keeps a plan of hundreds of tasks fluid while a drag runs, since this is
|
|
2146
2146
|
computed on every pointer movement. */
|
|
2147
2147
|
ghostFindings(t, e) {
|
|
2148
|
-
const n = this.host.data, i = (h) => h.lane === t.lane || h.lane === e, a = [...n.subtasks.filter((h) => h.id !== t.id && i(h)), t], r = (h) => h.first === t.id || h.second === t.id, l = n.dependencies.filter((h) => h.from === t.id || h.to === t.id), d = t.id ===
|
|
2148
|
+
const n = this.host.data, i = (h) => h.lane === t.lane || h.lane === e, a = [...n.subtasks.filter((h) => h.id !== t.id && i(h)), t], r = (h) => h.first === t.id || h.second === t.id, l = n.dependencies.filter((h) => h.from === t.id || h.to === t.id), d = t.id === Ke ? n.subtasks : n.subtasks.map((h) => h.id === t.id ? t : h);
|
|
2149
2149
|
return { overlaps: ee(a).filter(r), violated: se(d, l) };
|
|
2150
2150
|
}
|
|
2151
2151
|
}
|
|
2152
|
-
function
|
|
2152
|
+
function Gi(s, t) {
|
|
2153
2153
|
const e = /* @__PURE__ */ new Map();
|
|
2154
2154
|
for (const n of t) {
|
|
2155
2155
|
const i = s.slots.get(n.lane), o = i === void 0 ? null : at(s, i.top);
|
|
@@ -2159,8 +2159,8 @@ function Ri(s, t) {
|
|
|
2159
2159
|
}
|
|
2160
2160
|
return [...e.entries()].sort(([n], [i]) => n - i).map(([, n]) => n.sort((i, o) => i.from - o.from || i.to - o.to));
|
|
2161
2161
|
}
|
|
2162
|
-
const
|
|
2163
|
-
function
|
|
2162
|
+
const ze = (s, t) => t < s.from ? s.from - t : t > s.to ? t - s.to : 0;
|
|
2163
|
+
function Hi(s, t, e, n) {
|
|
2164
2164
|
let i = -1, o = -1;
|
|
2165
2165
|
for (let d = 0; d < s.length && t !== null && i < 0; d++)
|
|
2166
2166
|
o = s[d].findIndex((h) => h.id === t), o >= 0 && (i = d);
|
|
@@ -2191,11 +2191,11 @@ function Gi(s, t, e, n) {
|
|
|
2191
2191
|
const d = s[e === "up" ? i - 1 : i + 1];
|
|
2192
2192
|
if (d === void 0) return r;
|
|
2193
2193
|
const h = (r.from + r.to) / 2;
|
|
2194
|
-
return d.reduce((c, m) =>
|
|
2194
|
+
return d.reduce((c, m) => ze(m, h) < ze(c, h) ? m : c);
|
|
2195
2195
|
}
|
|
2196
2196
|
}
|
|
2197
2197
|
}
|
|
2198
|
-
function
|
|
2198
|
+
function Ki(s, t, e, n) {
|
|
2199
2199
|
if (e.kind === "milestone") return e;
|
|
2200
2200
|
if (e.kind === "dependency") {
|
|
2201
2201
|
const o = s.find((r) => r.id === e.id), a = o === void 0 ? void 0 : n === "out" ? o.to : o.from;
|
|
@@ -2206,7 +2206,7 @@ function Hi(s, t, e, n) {
|
|
|
2206
2206
|
);
|
|
2207
2207
|
return i === void 0 ? e : { kind: "dependency", id: i.id };
|
|
2208
2208
|
}
|
|
2209
|
-
const Mt = "\0milestone:",
|
|
2209
|
+
const Mt = "\0milestone:", We = 150, Ue = 1.25, Yi = {
|
|
2210
2210
|
ArrowRight: "next",
|
|
2211
2211
|
ArrowLeft: "previous",
|
|
2212
2212
|
ArrowUp: "up",
|
|
@@ -2216,7 +2216,7 @@ const Mt = "\0milestone:", Ue = 150, Xe = 1.25, Ki = {
|
|
|
2216
2216
|
PageDown: "pageNext",
|
|
2217
2217
|
PageUp: "pagePrevious"
|
|
2218
2218
|
};
|
|
2219
|
-
class
|
|
2219
|
+
class Vi {
|
|
2220
2220
|
constructor(t) {
|
|
2221
2221
|
this.host = t;
|
|
2222
2222
|
}
|
|
@@ -2246,7 +2246,7 @@ class Yi {
|
|
|
2246
2246
|
const o = this.active();
|
|
2247
2247
|
if (o === null) return !1;
|
|
2248
2248
|
const a = this.host.data, r = n ? !t.shiftKey : t.key === "]";
|
|
2249
|
-
return this.show(
|
|
2249
|
+
return this.show(Ki(a.dependencies, a.subtaskById, o, r ? "out" : "back")), !0;
|
|
2250
2250
|
}
|
|
2251
2251
|
if (t.ctrlKey) return !1;
|
|
2252
2252
|
if (!t.altKey && this.zoom(t)) return !0;
|
|
@@ -2254,14 +2254,14 @@ class Yi {
|
|
|
2254
2254
|
if (t.key === "Escape")
|
|
2255
2255
|
return e.byKeyboard ? (this.blur(), !0) : !1;
|
|
2256
2256
|
if (t.key === "Enter" || t.key === " ") return this.select();
|
|
2257
|
-
const i = t.shiftKey ? void 0 :
|
|
2257
|
+
const i = t.shiftKey ? void 0 : Yi[t.key];
|
|
2258
2258
|
return i === void 0 ? !1 : (this.walk(i), !0);
|
|
2259
2259
|
}
|
|
2260
2260
|
/** + and = zoom in, - and _ zoom out, 0 fits the work: by the character, so
|
|
2261
2261
|
that every layout reaches them (Shift is how a US keyboard types +). The
|
|
2262
2262
|
anchor is the middle of the active subtask's main time, else of the plot. */
|
|
2263
2263
|
zoom(t) {
|
|
2264
|
-
const e = t.key === "+" || t.key === "=" ? 1 /
|
|
2264
|
+
const e = t.key === "+" || t.key === "=" ? 1 / Ue : t.key === "-" || t.key === "_" ? Ue : 1;
|
|
2265
2265
|
if (e === 1 && t.key !== "0") return !1;
|
|
2266
2266
|
if (e !== 1) {
|
|
2267
2267
|
const n = this.active(), i = n?.kind === "subtask" ? this.host.view.boxById.get(n.id) : void 0, o = this.host.view.width;
|
|
@@ -2271,7 +2271,7 @@ class Yi {
|
|
|
2271
2271
|
}
|
|
2272
2272
|
walk(t) {
|
|
2273
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 }))];
|
|
2274
|
-
let r =
|
|
2274
|
+
let r = Gi(n.rows, a);
|
|
2275
2275
|
if (o === null) {
|
|
2276
2276
|
const d = r.filter((h) => {
|
|
2277
2277
|
const c = tt(n.viewport(), h[0].lane);
|
|
@@ -2279,7 +2279,7 @@ class Yi {
|
|
|
2279
2279
|
});
|
|
2280
2280
|
d.length > 0 && (r = d);
|
|
2281
2281
|
}
|
|
2282
|
-
const l =
|
|
2282
|
+
const l = Hi(r, o, t, this.host.visibleDomain());
|
|
2283
2283
|
l !== null && this.show(l.id.startsWith(Mt) ? { kind: "milestone", id: l.id.slice(Mt.length) } : { kind: "subtask", id: l.id });
|
|
2284
2284
|
}
|
|
2285
2285
|
/** Space and Enter select as a click does: the whole task, and the subtask. */
|
|
@@ -2385,13 +2385,13 @@ class Yi {
|
|
|
2385
2385
|
if (!this.host.gestures.byKeyboard) return;
|
|
2386
2386
|
const e = this.host.data.tooltipTargetFor(t);
|
|
2387
2387
|
e !== null && (this.spoken = { target: e, lane: t.kind === "subtask" ? t.subtask.lane : t.kind === "milestone" ? t.milestone.lane : null, count: (this.spoken?.count ?? 0) + 1 }, this.host.spokenChanged());
|
|
2388
|
-
},
|
|
2388
|
+
}, We);
|
|
2389
2389
|
}
|
|
2390
2390
|
/** The span in view, said once the keys rest - also after a key that changed nothing. */
|
|
2391
2391
|
scheduleSpan() {
|
|
2392
2392
|
this.timer !== null && clearTimeout(this.timer), this.timer = setTimeout(() => {
|
|
2393
2393
|
this.timer = null, this.spoken = { target: null, lane: null, span: this.host.visibleDomain(), count: (this.spoken?.count ?? 0) + 1 }, this.host.spokenChanged();
|
|
2394
|
-
},
|
|
2394
|
+
}, We);
|
|
2395
2395
|
}
|
|
2396
2396
|
/** Unmount: no readout after it. */
|
|
2397
2397
|
stop() {
|
|
@@ -2399,12 +2399,12 @@ class Yi {
|
|
|
2399
2399
|
}
|
|
2400
2400
|
}
|
|
2401
2401
|
const it = (s) => JSON.stringify([s.domain ?? null, [...s.folded ?? []].sort()]);
|
|
2402
|
-
function
|
|
2402
|
+
function zi(s, t) {
|
|
2403
2403
|
if (t.size === 0 || s.folded === void 0) return s;
|
|
2404
2404
|
const e = s.folded.filter((n) => t.has(n));
|
|
2405
2405
|
return e.length === s.folded.length ? s : { ...s.domain ? { domain: s.domain } : {}, ...e.length ? { folded: e } : {} };
|
|
2406
2406
|
}
|
|
2407
|
-
function
|
|
2407
|
+
function Wi(s, t, e = (n) => n) {
|
|
2408
2408
|
if (s.length === 0) return null;
|
|
2409
2409
|
let n = 1 / 0, i = -1 / 0;
|
|
2410
2410
|
for (const r of s)
|
|
@@ -2413,7 +2413,7 @@ function zi(s, t, e = (n) => n) {
|
|
|
2413
2413
|
const o = Math.min(t.max, Math.max(t.min, i - n)), a = (n + i) / 2;
|
|
2414
2414
|
return [a - o / 2, a + o / 2];
|
|
2415
2415
|
}
|
|
2416
|
-
const
|
|
2416
|
+
const Xe = {
|
|
2417
2417
|
width: 0,
|
|
2418
2418
|
height: 0,
|
|
2419
2419
|
scrollY: 0,
|
|
@@ -2433,9 +2433,9 @@ const qe = {
|
|
|
2433
2433
|
spoken: null,
|
|
2434
2434
|
summary: { lanes: 0, subtasks: 0, from: 0, to: 0, overlaps: 0, violated: 0, blocked: 0, milestones: 0 }
|
|
2435
2435
|
};
|
|
2436
|
-
class
|
|
2437
|
-
data = new
|
|
2438
|
-
view = new
|
|
2436
|
+
class Ui {
|
|
2437
|
+
data = new fi(() => this.viewChanged());
|
|
2438
|
+
view = new pn(this.data);
|
|
2439
2439
|
gestures;
|
|
2440
2440
|
keys;
|
|
2441
2441
|
handlersNow = {};
|
|
@@ -2476,11 +2476,11 @@ class Wi {
|
|
|
2476
2476
|
movePending = !1;
|
|
2477
2477
|
domainFrame = 0;
|
|
2478
2478
|
unsubscribeTheme = null;
|
|
2479
|
-
snapshot =
|
|
2479
|
+
snapshot = Xe;
|
|
2480
2480
|
dataTable = null;
|
|
2481
2481
|
listeners = /* @__PURE__ */ new Set();
|
|
2482
2482
|
constructor(t = {}) {
|
|
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
|
|
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 Ri({
|
|
2484
2484
|
data: this.data,
|
|
2485
2485
|
view: this.view,
|
|
2486
2486
|
plotElement: () => this.plot,
|
|
@@ -2491,7 +2491,7 @@ class Wi {
|
|
|
2491
2491
|
viewMoved: (e) => this.viewMoved(e),
|
|
2492
2492
|
interactionChanged: () => this.interactionChanged(),
|
|
2493
2493
|
hoverChanged: () => this.hoverChanged()
|
|
2494
|
-
}), this.keys = new
|
|
2494
|
+
}), this.keys = new Vi({
|
|
2495
2495
|
data: this.data,
|
|
2496
2496
|
view: this.view,
|
|
2497
2497
|
gestures: this.gestures,
|
|
@@ -2575,7 +2575,7 @@ class Wi {
|
|
|
2575
2575
|
this.actedOn = !0, this.folded = [], this.viewChanged();
|
|
2576
2576
|
};
|
|
2577
2577
|
currentView() {
|
|
2578
|
-
return
|
|
2578
|
+
return zi(
|
|
2579
2579
|
{ ...this.domainInView === null ? {} : { domain: this.domainInView }, ...this.folded.length > 0 ? { folded: this.folded } : {} },
|
|
2580
2580
|
new Set(this.data.groups.map((t) => t.id))
|
|
2581
2581
|
);
|
|
@@ -2590,12 +2590,12 @@ class Wi {
|
|
|
2590
2590
|
/** The subtasks' extent within the zoom limits, while the view names no
|
|
2591
2591
|
span - and the local day of today while there is no work to show. */
|
|
2592
2592
|
fit() {
|
|
2593
|
-
const t = this.view.options.calendar, e =
|
|
2593
|
+
const t = this.view.options.calendar, e = Wi(this.data.subtasks, this.view.options.zoomLimits, (l) => V(l, t));
|
|
2594
2594
|
if (e !== null) {
|
|
2595
2595
|
this.view.domain = e, this.fitted = !0;
|
|
2596
2596
|
return;
|
|
2597
2597
|
}
|
|
2598
|
-
const n = this.view.options.timeZone, i =
|
|
2598
|
+
const n = this.view.options.timeZone, i = Ks(Date.now(), n), { year: o, month: a, day: r } = Je(i, n);
|
|
2599
2599
|
this.view.showWall([i.getTime(), Kt({ year: o, month: a, day: r + 1 }, n).getTime()]);
|
|
2600
2600
|
}
|
|
2601
2601
|
/** `undefined`: the scene keeps the selection itself. */
|
|
@@ -2620,7 +2620,7 @@ class Wi {
|
|
|
2620
2620
|
/* DOM binding */
|
|
2621
2621
|
/* ---------------------------------------------------------------- */
|
|
2622
2622
|
bind(t, e, n, i) {
|
|
2623
|
-
this.root = t, this.plot = e, this.dataCanvas = n, this.overlayCanvas = i, this.unsubscribeTheme =
|
|
2623
|
+
this.root = t, this.plot = e, this.dataCanvas = n, this.overlayCanvas = i, this.unsubscribeTheme = Es(() => {
|
|
2624
2624
|
this.colours = null, this.dataStale = !0, this.requestDraw();
|
|
2625
2625
|
}), this.viewChanged();
|
|
2626
2626
|
}
|
|
@@ -2635,7 +2635,7 @@ class Wi {
|
|
|
2635
2635
|
this.listeners.delete(t);
|
|
2636
2636
|
});
|
|
2637
2637
|
getSnapshot = () => this.snapshot;
|
|
2638
|
-
getServerSnapshot = () =>
|
|
2638
|
+
getServerSnapshot = () => Xe;
|
|
2639
2639
|
/* ---------------------------------------------------------------- */
|
|
2640
2640
|
/* Changes */
|
|
2641
2641
|
/* ---------------------------------------------------------------- */
|
|
@@ -2715,7 +2715,7 @@ class Wi {
|
|
|
2715
2715
|
const e = this.colours;
|
|
2716
2716
|
return t.boxes.flatMap((n) => {
|
|
2717
2717
|
if (!Yt(n, t.width, t.height)) return [];
|
|
2718
|
-
const i =
|
|
2718
|
+
const i = nn(n, t.width);
|
|
2719
2719
|
if (i === null) return [];
|
|
2720
2720
|
const o = e === null ? !0 : le(
|
|
2721
2721
|
It(n.subtask.appearance),
|
|
@@ -2807,8 +2807,8 @@ class Wi {
|
|
|
2807
2807
|
}
|
|
2808
2808
|
draw() {
|
|
2809
2809
|
if (this.root === null) return;
|
|
2810
|
-
this.colours === null && (this.colours =
|
|
2811
|
-
const { width: t, height: e } = this.view, n = this.dataStale ?
|
|
2810
|
+
this.colours === null && (this.colours = bi(this.root, this.data), this.publish());
|
|
2811
|
+
const { width: t, height: e } = this.view, n = this.dataStale ? Ne(this.dataCanvas, t, e) : null, i = Ne(this.overlayCanvas, t, e);
|
|
2812
2812
|
if (i === null || t === 0 || this.dataStale && n === null) return;
|
|
2813
2813
|
this.dataStale = !1;
|
|
2814
2814
|
const o = {
|
|
@@ -2821,7 +2821,7 @@ class Wi {
|
|
|
2821
2821
|
hover: this.gestures.hover,
|
|
2822
2822
|
ghost: this.gestures.ghostDrawing()
|
|
2823
2823
|
};
|
|
2824
|
-
n !== null &&
|
|
2824
|
+
n !== null && Mi(n, o), Ti(i, o);
|
|
2825
2825
|
}
|
|
2826
2826
|
/* ---------------------------------------------------------------- */
|
|
2827
2827
|
/* Gestures, as the component hands them in */
|
|
@@ -2842,18 +2842,18 @@ class Wi {
|
|
|
2842
2842
|
focus = (t) => this.keys.focus(t);
|
|
2843
2843
|
blur = () => this.keys.blur();
|
|
2844
2844
|
}
|
|
2845
|
-
function
|
|
2846
|
-
const { initialView: t, onViewChange: e } = s, [n] = ht(() => new
|
|
2847
|
-
const l = (d) =>
|
|
2845
|
+
function so(s = {}) {
|
|
2846
|
+
const { initialView: t, onViewChange: e } = s, [n] = ht(() => new Ui(t)), i = W(""), [o] = ht(() => {
|
|
2847
|
+
const l = (d) => xs(ti, { ...d, scene: n });
|
|
2848
2848
|
return l.displayName = "Schedule", {
|
|
2849
2849
|
Schedule: l,
|
|
2850
|
-
Lane:
|
|
2851
|
-
LaneGroup:
|
|
2852
|
-
Subtasks:
|
|
2853
|
-
Dependencies:
|
|
2854
|
-
BlockedTimes:
|
|
2855
|
-
Milestones:
|
|
2856
|
-
DataTable:
|
|
2850
|
+
Lane: ii,
|
|
2851
|
+
LaneGroup: oi,
|
|
2852
|
+
Subtasks: ai,
|
|
2853
|
+
Dependencies: ri,
|
|
2854
|
+
BlockedTimes: li,
|
|
2855
|
+
Milestones: di,
|
|
2856
|
+
DataTable: si,
|
|
2857
2857
|
setView: (d) => {
|
|
2858
2858
|
n.applyView(d), i.current = it(n.getView());
|
|
2859
2859
|
},
|
|
@@ -2877,15 +2877,15 @@ export {
|
|
|
2877
2877
|
Ce as applyIntent,
|
|
2878
2878
|
te as arrival,
|
|
2879
2879
|
Qt as departure,
|
|
2880
|
-
|
|
2881
|
-
|
|
2880
|
+
Qi as findings,
|
|
2881
|
+
Qe as inBlockedTime,
|
|
2882
2882
|
Q as occupied,
|
|
2883
2883
|
ee as overlaps,
|
|
2884
2884
|
It as resolveAppearance,
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2885
|
+
to as ripple,
|
|
2886
|
+
eo as shiftTask,
|
|
2887
|
+
Vs as snapTime,
|
|
2888
|
+
Ji as subtaskFromPlace,
|
|
2889
|
+
so as useSchedule,
|
|
2890
2890
|
se as violatedDependencies
|
|
2891
2891
|
};
|