@umriss-ui/schedule 0.44.0 → 0.45.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 +12 -2
- package/dist/index.d.ts +4 -4
- package/dist/schedule.css +1 -1
- package/dist/schedule.js +613 -608
- package/docs/llms-full.md +20 -20
- package/package.json +5 -5
package/dist/schedule.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "./schedule.css";
|
|
3
|
-
import { localOffset as
|
|
4
|
-
import { useContext as
|
|
5
|
-
import { jsxs as
|
|
6
|
-
import { useFormats as
|
|
7
|
-
function
|
|
3
|
+
import { localOffset as Ke, toWorkingTimeClamped as Y, calendarFrom as bt, toWallClock as Wt, MINUTE as X, DAY as j, timeStep as Ls, workingTimeTicks as As, inDoubledHour as Cs, HOUR as Ut, LinearScale as Ds, resolveColours as _s, removedIntervals as Os, subscribeTheme as Fs } from "@umriss-ui/charts";
|
|
4
|
+
import { useContext as Ve, createContext as qe, useRef as V, useEffect as q, useId as $s, useState as dt, useLayoutEffect as wt, useImperativeHandle as Es, useSyncExternalStore as ze, useMemo as z, createElement as xs } from "react";
|
|
5
|
+
import { jsxs as B, Fragment as ht, jsx as m } from "react/jsx-runtime";
|
|
6
|
+
import { zoneFields as We, zoneInstant as Gt, useFormats as Xt, useWording as Mt, useTimeZoneLabel as Rs, Skeleton as Ns, AngleGlyph as Bs, VisuallyHidden as be, createLongPress as Ps, zoneDayStart as Gs } from "@umriss-ui/core";
|
|
7
|
+
function it(s) {
|
|
8
8
|
return { from: s.from - (s.leadIn ?? 0), to: s.to + (s.leadOut ?? 0) };
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function jt(s, t) {
|
|
11
11
|
return (s.leaves ?? "leadOut") === "main" ? t.to : t.to + (t.leadOut ?? 0);
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function Zt(s, t) {
|
|
14
14
|
return (s.arrives ?? "leadIn") === "main" ? t.from : t.from - (t.leadIn ?? 0);
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function Me(s, t) {
|
|
17
17
|
if (t.kind === "place" || t.subtask !== s.id) return s;
|
|
18
18
|
switch (t.kind) {
|
|
19
19
|
case "move":
|
|
@@ -27,7 +27,7 @@ function ye(s, t) {
|
|
|
27
27
|
return { ...s, lane: t.lane };
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function Yi(s, t) {
|
|
31
31
|
return {
|
|
32
32
|
id: t,
|
|
33
33
|
task: s.task,
|
|
@@ -38,10 +38,10 @@ function Fi(s, t) {
|
|
|
38
38
|
...s.leadOut === void 0 ? {} : { leadOut: s.leadOut }
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function Jt(s) {
|
|
42
42
|
const t = [], e = /* @__PURE__ */ new Map();
|
|
43
43
|
s.forEach((i, n) => {
|
|
44
|
-
const { from: o, to: r } =
|
|
44
|
+
const { from: o, to: r } = it(i);
|
|
45
45
|
if (!(o < r)) return;
|
|
46
46
|
const a = e.get(i.lane) ?? [];
|
|
47
47
|
a.push({ subtask: i, index: n, from: o, to: r }), e.set(i.lane, a);
|
|
@@ -59,10 +59,10 @@ function Xt(s) {
|
|
|
59
59
|
}
|
|
60
60
|
return t;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function Hs(s) {
|
|
63
63
|
const t = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map();
|
|
64
64
|
for (const i of s) {
|
|
65
|
-
const n =
|
|
65
|
+
const n = it(i), o = e.get(i.lane) ?? [];
|
|
66
66
|
let r = 0;
|
|
67
67
|
if (n.from < n.to) {
|
|
68
68
|
for (const a of o) n.from < a.to && a.from < n.to && r++;
|
|
@@ -72,35 +72,35 @@ function Es(s) {
|
|
|
72
72
|
}
|
|
73
73
|
return t;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function Qt(s, t) {
|
|
76
76
|
const e = new Map(s.map((n) => [n.id, n])), i = [];
|
|
77
77
|
for (const n of t) {
|
|
78
78
|
const o = e.get(n.from), r = e.get(n.to);
|
|
79
79
|
if (o === void 0 || r === void 0) continue;
|
|
80
|
-
const a =
|
|
80
|
+
const a = jt(n, o), l = Zt(n, r), d = a + n.lag - l;
|
|
81
81
|
d > 0 && i.push({ dependency: n.id, departure: a, arrival: l, shortBy: d });
|
|
82
82
|
}
|
|
83
83
|
return i;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function Ue(s, t) {
|
|
86
86
|
const e = [];
|
|
87
87
|
for (const i of s) {
|
|
88
|
-
const n =
|
|
88
|
+
const n = it(i);
|
|
89
89
|
for (const o of t)
|
|
90
90
|
o.lane !== i.lane || !(n.from < o.to && o.from < n.to) || e.push({ subtask: i.id, blocked: o.id, lane: o.lane, from: Math.max(n.from, o.from), to: Math.min(n.to, o.to) });
|
|
91
91
|
}
|
|
92
92
|
return e;
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function Ki(s, t, e = []) {
|
|
95
95
|
return {
|
|
96
|
-
overlaps:
|
|
97
|
-
violatedDependencies:
|
|
98
|
-
inBlockedTime:
|
|
96
|
+
overlaps: Jt(s),
|
|
97
|
+
violatedDependencies: Qt(s, t),
|
|
98
|
+
inBlockedTime: Ue(s, e)
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function Vi(s, t, e) {
|
|
102
102
|
if (e.kind === "place") return [];
|
|
103
|
-
const i = new Map(s.map((l) => [l.id,
|
|
103
|
+
const i = new Map(s.map((l) => [l.id, Me(l, e)])), n = /* @__PURE__ */ new Map();
|
|
104
104
|
for (const l of t) {
|
|
105
105
|
const d = n.get(l.from) ?? [];
|
|
106
106
|
d.push(l), n.set(l.from, d);
|
|
@@ -114,99 +114,99 @@ function $i(s, t, e) {
|
|
|
114
114
|
if (h.to === e.subtask) continue;
|
|
115
115
|
const c = i.get(h.to);
|
|
116
116
|
if (c === void 0) continue;
|
|
117
|
-
const f =
|
|
117
|
+
const f = jt(h, d) + h.lag - Zt(h, c);
|
|
118
118
|
if (!(f > 0)) continue;
|
|
119
119
|
const g = { kind: "move", subtask: c.id, from: c.from + f, to: c.to + f };
|
|
120
|
-
i.set(c.id,
|
|
120
|
+
i.set(c.id, Me(c, g)), o.set(c.id, g), r.push(c.id);
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
return [...o.values()];
|
|
124
124
|
}
|
|
125
|
-
function
|
|
126
|
-
const { step:
|
|
127
|
-
if (!(
|
|
128
|
-
const
|
|
129
|
-
return
|
|
125
|
+
function Ys(s, t, e) {
|
|
126
|
+
const { step: i, offset: n } = typeof t == "number" ? { step: t, offset: 0 } : t;
|
|
127
|
+
if (!(i > 0) || !Number.isFinite(s)) return s;
|
|
128
|
+
const o = Ke(s, e) + n;
|
|
129
|
+
return o + Math.round((s - o) / i) * i;
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function qi(s, t, e) {
|
|
132
132
|
return e === 0 || !Number.isFinite(e) ? [] : s.filter((i) => i.task === t).map((i) => ({ kind: "move", subtask: i.id, from: i.from + e, to: i.to + e }));
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function Tt(s) {
|
|
135
135
|
let t = !1, e = !1, i = !1, n = !1;
|
|
136
136
|
for (const o of s ?? [])
|
|
137
137
|
o === "provisional" ? (t = !0, e = !1) : o === "fixed" ? (e = !0, t = !1) : o === "muted" ? i = !0 : o === "open" && (n = !0);
|
|
138
138
|
return { dashed: t, hatched: e, muted: i, open: n };
|
|
139
139
|
}
|
|
140
|
-
const
|
|
141
|
-
function
|
|
142
|
-
return
|
|
140
|
+
const Xe = /* @__PURE__ */ qe(null), je = /* @__PURE__ */ qe(null);
|
|
141
|
+
function Ze() {
|
|
142
|
+
return Ve(je);
|
|
143
143
|
}
|
|
144
|
-
function
|
|
145
|
-
const t =
|
|
144
|
+
function Ks(s) {
|
|
145
|
+
const t = Ve(Xe);
|
|
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
|
-
function
|
|
151
|
-
const o =
|
|
152
|
-
|
|
150
|
+
function te(s, t, e, i, n) {
|
|
151
|
+
const o = Ks(s), r = V(null);
|
|
152
|
+
q(() => (r.current = e(o, t), () => {
|
|
153
153
|
r.current !== null && n(o, r.current), r.current = null;
|
|
154
|
-
}), [o]),
|
|
154
|
+
}), [o]), q(() => {
|
|
155
155
|
r.current !== null && i(o, r.current, t);
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
|
-
function
|
|
159
|
-
|
|
158
|
+
function Vs(s) {
|
|
159
|
+
te("Lane", s, (t, e) => t.registerLane(e), (t, e, i) => t.updateLane(e, i), (t, e) => t.unregisterLane(e));
|
|
160
160
|
}
|
|
161
|
-
function
|
|
162
|
-
|
|
161
|
+
function qs(s) {
|
|
162
|
+
te("LaneGroup", s, (t, e) => t.registerGroup(e), (t, e, i) => t.updateGroup(e, i), (t, e) => t.unregisterGroup(e));
|
|
163
163
|
}
|
|
164
|
-
function
|
|
165
|
-
|
|
164
|
+
function St(s, t) {
|
|
165
|
+
te(s, t, (e, i) => e.registerLayer(i), (e, i, n) => e.updateLayer(i, n), (e, i) => e.unregisterLayer(i));
|
|
166
166
|
}
|
|
167
|
-
const
|
|
168
|
-
function
|
|
169
|
-
const { lanes: t, groups: e, collapsed: i, laneHeight: n, headHeight: o =
|
|
167
|
+
const Je = 24, zs = 4, Ws = 3, Rt = 4;
|
|
168
|
+
function Te(s) {
|
|
169
|
+
const { lanes: t, groups: e, collapsed: i, laneHeight: n, headHeight: o = Je } = s, r = new Map(e.map((y) => [y.id, y])), a = (y) => y !== void 0 && r.has(y) ? y : void 0, l = /* @__PURE__ */ new Map(), d = (y) => {
|
|
170
170
|
const M = [];
|
|
171
|
-
let T = a(
|
|
171
|
+
let T = a(y.parent);
|
|
172
172
|
const F = /* @__PURE__ */ new Set();
|
|
173
173
|
for (; T !== void 0 && !F.has(T); )
|
|
174
174
|
F.add(T), M.unshift(T), T = a(r.get(T).parent);
|
|
175
175
|
return M;
|
|
176
176
|
}, h = /* @__PURE__ */ new Map();
|
|
177
|
-
for (const
|
|
178
|
-
const M = d(
|
|
179
|
-
h.set(
|
|
177
|
+
for (const y of t) {
|
|
178
|
+
const M = d(y);
|
|
179
|
+
h.set(y.id, M);
|
|
180
180
|
for (const T of M) {
|
|
181
181
|
const F = l.get(T) ?? [];
|
|
182
|
-
F.push(
|
|
182
|
+
F.push(y.id), l.set(T, F);
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
const c = [], f = /* @__PURE__ */ new Map();
|
|
186
|
-
let g = [],
|
|
187
|
-
const I = (
|
|
188
|
-
if (
|
|
189
|
-
const { row:
|
|
190
|
-
c[
|
|
191
|
-
const O = F - 2 *
|
|
192
|
-
M.forEach((
|
|
193
|
-
const
|
|
194
|
-
f.set(
|
|
195
|
-
top: T.top +
|
|
196
|
-
height:
|
|
186
|
+
let g = [], w = null, A = 0;
|
|
187
|
+
const I = (y) => (c.push({ ...y, top: A }), A += y.height, c.length - 1), L = (y) => y.find((M) => i.has(M)), D = () => {
|
|
188
|
+
if (w === null) return;
|
|
189
|
+
const { row: y, lanes: M } = w, T = c[y], F = Math.max(T.height, M.length * zs + 2 * Rt);
|
|
190
|
+
c[y] = { ...T, height: F }, A += F - T.height;
|
|
191
|
+
const O = F - 2 * Rt, R = Math.max(Ws, Math.floor(O / M.length));
|
|
192
|
+
M.forEach((U, pt) => {
|
|
193
|
+
const gt = h.get(U) ?? [];
|
|
194
|
+
f.set(U, {
|
|
195
|
+
top: T.top + Rt + pt * R,
|
|
196
|
+
height: R,
|
|
197
197
|
miniature: !0,
|
|
198
|
-
group:
|
|
198
|
+
group: gt[gt.length - 1]
|
|
199
199
|
});
|
|
200
|
-
}),
|
|
200
|
+
}), w = null;
|
|
201
201
|
};
|
|
202
|
-
for (const
|
|
203
|
-
const M = (h.get(
|
|
204
|
-
if (
|
|
205
|
-
|
|
202
|
+
for (const y of t) {
|
|
203
|
+
const M = (h.get(y.id) ?? []).filter((O) => (l.get(O) ?? []).length > 0), T = L(M);
|
|
204
|
+
if (w !== null && T === w.group) {
|
|
205
|
+
w.lanes.push(y.id);
|
|
206
206
|
continue;
|
|
207
207
|
}
|
|
208
208
|
D();
|
|
209
|
-
const F = M.filter((O,
|
|
209
|
+
const F = M.filter((O, R) => g[R] === O).length;
|
|
210
210
|
g = g.slice(0, F);
|
|
211
211
|
for (const O of M.slice(F)) {
|
|
212
212
|
if (g.push(O), O === T) break;
|
|
@@ -221,7 +221,7 @@ function we(s) {
|
|
|
221
221
|
});
|
|
222
222
|
}
|
|
223
223
|
if (T !== void 0) {
|
|
224
|
-
const O = M.indexOf(T),
|
|
224
|
+
const O = M.indexOf(T), R = I({
|
|
225
225
|
kind: "miniature",
|
|
226
226
|
lane: void 0,
|
|
227
227
|
group: T,
|
|
@@ -230,10 +230,10 @@ function we(s) {
|
|
|
230
230
|
lanes: (l.get(T) ?? []).length,
|
|
231
231
|
height: n
|
|
232
232
|
});
|
|
233
|
-
|
|
233
|
+
w = { group: T, row: R, lanes: [y.id] };
|
|
234
234
|
continue;
|
|
235
235
|
}
|
|
236
|
-
I({ kind: "lane", lane:
|
|
236
|
+
I({ kind: "lane", lane: y.id, group: M[M.length - 1], depth: M.length, within: M, lanes: 1, height: n }), f.set(y.id, {
|
|
237
237
|
top: c[c.length - 1].top,
|
|
238
238
|
height: n,
|
|
239
239
|
miniature: !1,
|
|
@@ -242,13 +242,13 @@ function we(s) {
|
|
|
242
242
|
}
|
|
243
243
|
return D(), { rows: c, slots: f, height: A };
|
|
244
244
|
}
|
|
245
|
-
function
|
|
245
|
+
function Us(s, t) {
|
|
246
246
|
if (t.size === 0) return s;
|
|
247
247
|
const e = /* @__PURE__ */ new Set();
|
|
248
248
|
for (const i of s) t.has(i) || e.add(i);
|
|
249
249
|
return e;
|
|
250
250
|
}
|
|
251
|
-
function
|
|
251
|
+
function nt(s, t) {
|
|
252
252
|
if (t < 0 || t >= s.height) return null;
|
|
253
253
|
let e = 0, i = s.rows.length - 1;
|
|
254
254
|
for (; e <= i; ) {
|
|
@@ -259,11 +259,11 @@ function st(s, t) {
|
|
|
259
259
|
}
|
|
260
260
|
return null;
|
|
261
261
|
}
|
|
262
|
-
function
|
|
262
|
+
function ee(s, t) {
|
|
263
263
|
return s.slots.get(t) ?? null;
|
|
264
264
|
}
|
|
265
|
-
function
|
|
266
|
-
const e =
|
|
265
|
+
function Xs(s, t) {
|
|
266
|
+
const e = nt(s, t);
|
|
267
267
|
if (e === null) return null;
|
|
268
268
|
if (e.kind === "lane") return e.lane ?? null;
|
|
269
269
|
if (e.kind === "groupHead") return null;
|
|
@@ -271,84 +271,84 @@ function Hs(s, t) {
|
|
|
271
271
|
if (n.miniature && t >= n.top && t < n.top + n.height) return i;
|
|
272
272
|
return null;
|
|
273
273
|
}
|
|
274
|
-
const
|
|
275
|
-
function
|
|
276
|
-
return Math.round(s.scale.toPx(
|
|
274
|
+
const js = 6, Qe = 3, lt = 2, Se = 3, Ie = 3;
|
|
275
|
+
function E(s, t) {
|
|
276
|
+
return Math.round(s.scale.toPx(Y(t, s.calendar)));
|
|
277
277
|
}
|
|
278
|
-
function
|
|
279
|
-
const e =
|
|
278
|
+
function Z(s, t) {
|
|
279
|
+
const e = ee(s.rows, t);
|
|
280
280
|
return e === null ? null : { ...e, top: e.top - s.scrollY };
|
|
281
281
|
}
|
|
282
|
-
function
|
|
283
|
-
const e =
|
|
284
|
-
return e === null ? null : { x:
|
|
282
|
+
function se(s, t) {
|
|
283
|
+
const e = Z(s, t.lane);
|
|
284
|
+
return e === null ? null : { x: E(s, t.at), y: e.top + e.height / 2, half: Math.max(2, Math.min(7, e.height * 0.3)) };
|
|
285
285
|
}
|
|
286
|
-
function
|
|
287
|
-
return
|
|
286
|
+
function Le(s, t) {
|
|
287
|
+
return Xs(s.rows, t + s.scrollY);
|
|
288
288
|
}
|
|
289
|
-
function
|
|
290
|
-
const n = e.miniature ? 0 :
|
|
289
|
+
function ts(s, t, e, i) {
|
|
290
|
+
const n = e.miniature ? 0 : js, o = e.miniature ? 0 : Ie * Se, r = Math.max(e.miniature ? 1 : 4, e.height - 2 * n - o), a = e.top - s.scrollY + Math.floor((e.height - r) / 2), l = it(t);
|
|
291
291
|
return {
|
|
292
292
|
subtask: t,
|
|
293
293
|
miniature: e.miniature,
|
|
294
294
|
depth: i,
|
|
295
|
-
y: a + (e.miniature ? 0 : Math.min(i,
|
|
295
|
+
y: a + (e.miniature ? 0 : Math.min(i, Ie) * Se),
|
|
296
296
|
height: r,
|
|
297
|
-
outerFrom:
|
|
298
|
-
mainFrom:
|
|
299
|
-
mainTo:
|
|
300
|
-
outerTo:
|
|
297
|
+
outerFrom: E(s, l.from),
|
|
298
|
+
mainFrom: E(s, t.from),
|
|
299
|
+
mainTo: E(s, t.to),
|
|
300
|
+
outerTo: E(s, l.to)
|
|
301
301
|
};
|
|
302
302
|
}
|
|
303
|
-
function
|
|
303
|
+
function es(s, t, e) {
|
|
304
304
|
if (e < s.y || e > s.y + s.height) return null;
|
|
305
305
|
const i = Math.max(0, (6 - (s.outerTo - s.outerFrom)) / 2);
|
|
306
306
|
return t < s.outerFrom - i || t > s.outerTo + i ? null : t < s.mainFrom ? "leadIn" : t > s.mainTo ? "leadOut" : "main";
|
|
307
307
|
}
|
|
308
|
-
function
|
|
308
|
+
function Zs(s, t, e, i = 5) {
|
|
309
309
|
if (e < s.y || e > s.y + s.height) return null;
|
|
310
310
|
const n = Math.abs(t - s.mainFrom), o = Math.abs(t - s.mainTo);
|
|
311
311
|
return Math.min(n, o) > i ? null : n <= o ? "from" : "to";
|
|
312
312
|
}
|
|
313
|
-
function
|
|
313
|
+
function Ht(s, t, e) {
|
|
314
314
|
return s.outerTo >= 0 && s.outerFrom <= t && s.y + s.height >= 0 && s.y <= e;
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function Js(s, t, e) {
|
|
317
317
|
let n = Math.min(s.x1, s.x2, s.c1x, s.c2x), o = Math.max(s.x1, s.x2, s.c1x, s.c2x), r = Math.min(s.y1, s.y2), a = Math.max(s.y1, s.y2);
|
|
318
318
|
for (let l = 0; l + 1 < s.points.length; l += 2)
|
|
319
319
|
n = Math.min(n, s.points[l]), o = Math.max(o, s.points[l]), r = Math.min(r, s.points[l + 1]), a = Math.max(a, s.points[l + 1]);
|
|
320
320
|
return o >= -8 && n <= t + 8 && a >= -8 && r <= e + 8;
|
|
321
321
|
}
|
|
322
|
-
const
|
|
323
|
-
function
|
|
322
|
+
const Qs = 64;
|
|
323
|
+
function tn(s, t) {
|
|
324
324
|
if (s.miniature) return null;
|
|
325
|
-
const e =
|
|
326
|
-
return n <
|
|
325
|
+
const e = Tt(s.subtask.appearance).hatched ? lt + Qe + 1 : 0, i = Math.max(s.mainFrom + e, 0), n = Math.min(s.mainTo - e, t) - i;
|
|
326
|
+
return n < Qs ? null : { x: i, width: n, y: s.y, height: s.height };
|
|
327
327
|
}
|
|
328
|
-
const
|
|
329
|
-
function
|
|
328
|
+
const en = 10;
|
|
329
|
+
function Ae(s, t, e) {
|
|
330
330
|
const i = Math.round(t.y + t.height / 2);
|
|
331
331
|
return s === "centre" || e.y === t.y ? i : Math.round(e.y > t.y ? t.y + t.height - 1 : t.y + 1);
|
|
332
332
|
}
|
|
333
|
-
function
|
|
334
|
-
const o = t.route ?? n.route, r = t.attach ?? n.attach, a = t.ends ?? n.ends, l =
|
|
333
|
+
function Yt(s, t, e, i, n) {
|
|
334
|
+
const o = t.route ?? n.route, r = t.attach ?? n.attach, a = t.ends ?? n.ends, l = E(s, jt(t, e.subtask)), d = E(s, Zt(t, i.subtask)), h = Ae(r, e, i), c = Ae(r, i, e);
|
|
335
335
|
if (o === "straight")
|
|
336
336
|
return { dependency: t, kind: o, ends: a, x1: l, y1: h, x2: d, y2: c, c1x: l, c2x: d, points: [l, h, d, c] };
|
|
337
337
|
if (o === "orthogonal") {
|
|
338
|
-
const I = l +
|
|
338
|
+
const I = l + en, L = h === c ? I : Math.round((I + d) / 2);
|
|
339
339
|
return { dependency: t, kind: o, ends: a, x1: l, y1: h, x2: d, y2: c, c1x: l, c2x: d, points: h === c ? [l, h, d, c] : [l, h, L, h, L, c, d, c] };
|
|
340
340
|
}
|
|
341
|
-
const f = Math.max(14, Math.abs(d - l) / 2), g = l + f,
|
|
341
|
+
const f = Math.max(14, Math.abs(d - l) / 2), g = l + f, w = d - f, A = [];
|
|
342
342
|
for (let I = 0; I <= 16; I++) {
|
|
343
343
|
const L = I / 16, D = 1 - L;
|
|
344
344
|
A.push(
|
|
345
|
-
D * D * D * l + 3 * D * D * L * g + 3 * D * L * L *
|
|
345
|
+
D * D * D * l + 3 * D * D * L * g + 3 * D * L * L * w + L * L * L * d,
|
|
346
346
|
D * D * D * h + 3 * D * D * L * h + 3 * D * L * L * c + L * L * L * c
|
|
347
347
|
);
|
|
348
348
|
}
|
|
349
|
-
return { dependency: t, kind: "curve", ends: a, x1: l, y1: h, x2: d, y2: c, c1x: g, c2x:
|
|
349
|
+
return { dependency: t, kind: "curve", ends: a, x1: l, y1: h, x2: d, y2: c, c1x: g, c2x: w, points: A };
|
|
350
350
|
}
|
|
351
|
-
function
|
|
351
|
+
function sn(s, t, e) {
|
|
352
352
|
let i = 1 / 0;
|
|
353
353
|
const n = s.points;
|
|
354
354
|
for (let o = 0; o + 3 < n.length; o += 2) {
|
|
@@ -357,65 +357,69 @@ function Us(s, t, e) {
|
|
|
357
357
|
}
|
|
358
358
|
return i;
|
|
359
359
|
}
|
|
360
|
-
const
|
|
361
|
-
function
|
|
360
|
+
const ss = [], ns = 56;
|
|
361
|
+
function nn(s) {
|
|
362
362
|
return s > 16 ? s / 16 : 1;
|
|
363
363
|
}
|
|
364
|
-
function
|
|
365
|
-
return s > 0 ? Math.min(
|
|
364
|
+
function on(s, t = ns) {
|
|
365
|
+
return s > 0 ? Math.min(j, Math.max(15 * X, Ls(s * t, 1))) : 15 * X;
|
|
366
366
|
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
367
|
+
const rn = () => new Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
368
|
+
function an(s, t, e = ss, i) {
|
|
369
|
+
const [n, o] = is(s, e);
|
|
370
|
+
return As(e, n, o, t, 0, i ?? rn()).filter(
|
|
371
|
+
(r) => r.workingTime >= s[0] && r.workingTime <= s[1]
|
|
371
372
|
);
|
|
372
373
|
}
|
|
373
|
-
function
|
|
374
|
-
const [
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
to: H(a, t)
|
|
374
|
+
function ln(s, t = ss, e) {
|
|
375
|
+
const [i, n] = is(s, t), o = [], { year: r, month: a, day: l } = We(i, e);
|
|
376
|
+
let d = l, h = Gt({ year: r, month: a, day: d }, e).getTime();
|
|
377
|
+
for (; h < n && o.length < 400; ) {
|
|
378
|
+
const c = h;
|
|
379
|
+
h = Gt({ year: r, month: a, day: ++d }, e).getTime(), o.push({
|
|
380
|
+
start: c,
|
|
381
|
+
from: Y(c, t),
|
|
382
|
+
to: Y(h, t)
|
|
383
383
|
});
|
|
384
384
|
}
|
|
385
|
-
return
|
|
385
|
+
return o;
|
|
386
386
|
}
|
|
387
|
-
const
|
|
388
|
-
function
|
|
389
|
-
return
|
|
387
|
+
const Nt = [1, 2, 7, 14, 28];
|
|
388
|
+
function dn(s, t) {
|
|
389
|
+
return Nt.find((e) => e * s >= t) ?? Nt[Nt.length - 1];
|
|
390
390
|
}
|
|
391
|
-
function
|
|
392
|
-
return ((Math.round((s -
|
|
391
|
+
function Bt(s, t, e) {
|
|
392
|
+
return ((Math.round((s - Ke(s, e)) / j) - 4) % t + t) % t === 0;
|
|
393
393
|
}
|
|
394
|
-
function
|
|
394
|
+
function et(s, t) {
|
|
395
|
+
const e = s.time(new Date(t), !1);
|
|
396
|
+
return Cs(t, s.timeZone) ? `${e} ${s.offset(new Date(t))}` : e;
|
|
397
|
+
}
|
|
398
|
+
function hn(s, t, e, i) {
|
|
395
399
|
const n = s[1] - s[0];
|
|
396
400
|
if (!(n > 0)) return [s[0], s[1]];
|
|
397
401
|
const o = Math.min(i.max, Math.max(i.min, n * e)), r = (t - s[0]) / n, a = t - r * o;
|
|
398
402
|
return [a, a + o];
|
|
399
403
|
}
|
|
400
|
-
function
|
|
404
|
+
function cn(s, t) {
|
|
401
405
|
return [s[0] + t, s[1] + t];
|
|
402
406
|
}
|
|
403
|
-
function
|
|
404
|
-
const e =
|
|
405
|
-
return e.intervals.length === 0 ? s :
|
|
407
|
+
function ut(s, t) {
|
|
408
|
+
const e = bt(t);
|
|
409
|
+
return e.intervals.length === 0 ? s : Wt(Math.max(0, Math.min(e.total, s)), e);
|
|
406
410
|
}
|
|
407
|
-
function
|
|
408
|
-
return [
|
|
411
|
+
function is(s, t) {
|
|
412
|
+
return [ut(s[0], t), ut(s[1], t)];
|
|
409
413
|
}
|
|
410
|
-
const
|
|
411
|
-
class
|
|
414
|
+
const Kt = 44;
|
|
415
|
+
class un {
|
|
412
416
|
constructor(t) {
|
|
413
417
|
this.data = t;
|
|
414
418
|
}
|
|
415
419
|
options = {
|
|
416
|
-
laneHeight:
|
|
420
|
+
laneHeight: Kt,
|
|
417
421
|
calendar: [],
|
|
418
|
-
zoomLimits: { min:
|
|
422
|
+
zoomLimits: { min: Ut, max: 28 * j },
|
|
419
423
|
snap: "ticks",
|
|
420
424
|
intents: [],
|
|
421
425
|
now: null,
|
|
@@ -425,14 +429,14 @@ class sn {
|
|
|
425
429
|
};
|
|
426
430
|
/** The root font size over 16 px, 1 at the default size and below (`fontScaleOf`). */
|
|
427
431
|
fontScale = 1;
|
|
428
|
-
domain = [0,
|
|
432
|
+
domain = [0, j];
|
|
429
433
|
scrollY = 0;
|
|
430
434
|
width = 0;
|
|
431
435
|
height = 0;
|
|
432
436
|
/* What is laid out from top to bottom (`rows.ts`). It is derived here and
|
|
433
437
|
not in the data, because a row's height comes from a view option; every y
|
|
434
438
|
in the package reads it. */
|
|
435
|
-
rows =
|
|
439
|
+
rows = Te({ lanes: [], groups: [], collapsed: /* @__PURE__ */ new Set(), laneHeight: Kt });
|
|
436
440
|
/** The folded groups, as the scene holds them. */
|
|
437
441
|
collapsed = /* @__PURE__ */ new Set();
|
|
438
442
|
/** The groups a gesture in flight holds open. Dropped when it ends; the
|
|
@@ -468,20 +472,20 @@ class sn {
|
|
|
468
472
|
setOptions(t) {
|
|
469
473
|
const e = t.calendar !== this.options.calendar, i = this.options.calendar;
|
|
470
474
|
if (this.options = t, e) {
|
|
471
|
-
const n =
|
|
475
|
+
const n = bt(i), o = (r) => {
|
|
472
476
|
const a = n.intervals.length === 0 ? r : Math.max(0, Math.min(n.total, r));
|
|
473
|
-
return
|
|
477
|
+
return Y(Wt(a, n), t.calendar) + (r - a);
|
|
474
478
|
};
|
|
475
479
|
this.domain = [o(this.domain[0]), o(this.domain[1])];
|
|
476
480
|
}
|
|
477
481
|
}
|
|
478
482
|
/** Puts a span of two wall-clock instants in view. */
|
|
479
483
|
showWall(t) {
|
|
480
|
-
this.domain = [
|
|
484
|
+
this.domain = [Y(t[0], this.options.calendar), Y(t[1], this.options.calendar)];
|
|
481
485
|
}
|
|
482
486
|
viewport() {
|
|
483
487
|
return {
|
|
484
|
-
scale: new
|
|
488
|
+
scale: new Ds(this.domain, [0, this.width]),
|
|
485
489
|
calendar: this.options.calendar,
|
|
486
490
|
scrollY: this.scrollY,
|
|
487
491
|
rows: this.rows
|
|
@@ -497,29 +501,29 @@ class sn {
|
|
|
497
501
|
/** The fine band's step at the current zoom. */
|
|
498
502
|
step() {
|
|
499
503
|
const t = this.domain[1] - this.domain[0];
|
|
500
|
-
return
|
|
504
|
+
return on(this.width > 0 ? t / this.width : t, ns * this.fontScale);
|
|
501
505
|
}
|
|
502
506
|
/** Lays the rows out, clamps the scroll, and lays the data out anew. */
|
|
503
507
|
layout() {
|
|
504
|
-
this.moved = !1, this.rows =
|
|
508
|
+
this.moved = !1, this.rows = Te({
|
|
505
509
|
lanes: this.data.lanes,
|
|
506
510
|
groups: this.data.groups,
|
|
507
|
-
collapsed:
|
|
511
|
+
collapsed: Us(this.collapsed, this.openForGesture),
|
|
508
512
|
laneHeight: Math.round(this.options.laneHeight * this.fontScale),
|
|
509
|
-
headHeight: Math.round(
|
|
513
|
+
headHeight: Math.round(Je * this.fontScale)
|
|
510
514
|
}), this.scrollY = Math.max(0, Math.min(this.maxScroll(), this.scrollY));
|
|
511
515
|
const t = this.viewport();
|
|
512
516
|
this.laidBoxes = [], this.laidBoxById = /* @__PURE__ */ new Map();
|
|
513
517
|
for (const e of this.data.subtasks) {
|
|
514
|
-
const i =
|
|
518
|
+
const i = ee(this.rows, e.lane);
|
|
515
519
|
if (i === null) continue;
|
|
516
|
-
const n =
|
|
520
|
+
const n = ts(t, e, i, this.data.depth.get(e.id) ?? 0);
|
|
517
521
|
this.laidBoxes.push(n), this.laidBoxById.set(e.id, n);
|
|
518
522
|
}
|
|
519
523
|
this.laidPaths = [];
|
|
520
524
|
for (const e of this.data.dependencies) {
|
|
521
525
|
const i = this.boxById.get(e.from), n = this.boxById.get(e.to);
|
|
522
|
-
i === void 0 || n === void 0 || this.laidPaths.push(
|
|
526
|
+
i === void 0 || n === void 0 || this.laidPaths.push(Yt(t, e, i, n, this.options));
|
|
523
527
|
}
|
|
524
528
|
}
|
|
525
529
|
/** The days of the coarse band and the ticks of the fine band, in pixels. */
|
|
@@ -528,11 +532,11 @@ class sn {
|
|
|
528
532
|
if (this.width <= 0) return { days: [], ticks: [], step: t };
|
|
529
533
|
const e = this.viewport().scale, i = this.options.calendar;
|
|
530
534
|
return {
|
|
531
|
-
days:
|
|
535
|
+
days: ln(this.domain, i, this.options.timeZone).map((n) => {
|
|
532
536
|
const o = Math.round(e.toPx(n.from));
|
|
533
537
|
return { start: n.start, x: o, width: Math.round(e.toPx(n.to)) - o };
|
|
534
538
|
}),
|
|
535
|
-
ticks:
|
|
539
|
+
ticks: an(this.domain, t, i, this.options.timeZone).map((n) => ({ wallClock: n.wallClock, x: Math.round(e.toPx(n.workingTime)) })),
|
|
536
540
|
step: t
|
|
537
541
|
};
|
|
538
542
|
}
|
|
@@ -540,32 +544,32 @@ class sn {
|
|
|
540
544
|
nowX() {
|
|
541
545
|
const t = this.options.now;
|
|
542
546
|
if (t === null || this.width <= 0) return null;
|
|
543
|
-
const e = Math.round(this.viewport().scale.toPx(
|
|
547
|
+
const e = Math.round(this.viewport().scale.toPx(Y(t, this.options.calendar)));
|
|
544
548
|
return e >= 0 && e <= this.width ? e : null;
|
|
545
549
|
}
|
|
546
550
|
hitAt(t, e) {
|
|
547
551
|
const i = this.viewport();
|
|
548
552
|
for (let a = this.data.milestones.length - 1; a >= 0; a--) {
|
|
549
|
-
const l = this.data.milestones[a], d =
|
|
553
|
+
const l = this.data.milestones[a], d = se(i, l);
|
|
550
554
|
if (d !== null && Math.abs(t - d.x) + Math.abs(e - d.y) <= d.half + 2) return { kind: "milestone", milestone: l };
|
|
551
555
|
}
|
|
552
556
|
for (let a = this.boxes.length - 1; a >= 0; a--) {
|
|
553
|
-
const l = this.boxes[a], d =
|
|
557
|
+
const l = this.boxes[a], d = es(l, t, e);
|
|
554
558
|
if (d !== null) return { kind: "subtask", subtask: l.subtask, part: d };
|
|
555
559
|
}
|
|
556
560
|
let n = null, o = 4;
|
|
557
561
|
for (const a of this.paths) {
|
|
558
|
-
const l =
|
|
562
|
+
const l = sn(a, t, e);
|
|
559
563
|
l <= o && (o = l, n = a);
|
|
560
564
|
}
|
|
561
565
|
if (n !== null) return { kind: "dependency", dependency: n.dependency };
|
|
562
|
-
const r =
|
|
566
|
+
const r = Le(this.viewport(), e);
|
|
563
567
|
return r !== null ? { kind: "lane", lane: r } : { kind: "nothing" };
|
|
564
568
|
}
|
|
565
569
|
/** The wall-clock time at a plot x; within the calendar's extent. */
|
|
566
570
|
timeAt(t) {
|
|
567
571
|
const e = this.viewport().scale.fromPx(t);
|
|
568
|
-
return
|
|
572
|
+
return ut(e, this.options.calendar);
|
|
569
573
|
}
|
|
570
574
|
/** The lane at a y, strips included: what the pointer is ON.
|
|
571
575
|
|
|
@@ -574,7 +578,7 @@ class sn {
|
|
|
574
578
|
`foldedGroupAt` - and a caller that reached through `viewport()` for it
|
|
575
579
|
would be depending on the layout rather than asking the view. */
|
|
576
580
|
laneIdAt(t) {
|
|
577
|
-
return
|
|
581
|
+
return Le(this.viewport(), t);
|
|
578
582
|
}
|
|
579
583
|
/** The lane a DROP at this y would land on.
|
|
580
584
|
|
|
@@ -584,19 +588,19 @@ class sn {
|
|
|
584
588
|
aim at. Hover, the tooltip and selection do read a strip - they cost
|
|
585
589
|
nothing if they are a pixel out. */
|
|
586
590
|
dropLaneIdAt(t) {
|
|
587
|
-
const e =
|
|
591
|
+
const e = nt(this.rows, t + this.scrollY);
|
|
588
592
|
return e === null || e.kind !== "lane" ? null : e.lane ?? null;
|
|
589
593
|
}
|
|
590
594
|
/** The folded group a y lies over, or null. */
|
|
591
595
|
foldedGroupAt(t) {
|
|
592
|
-
const e =
|
|
596
|
+
const e = nt(this.rows, t + this.scrollY);
|
|
593
597
|
return e !== null && e.kind === "miniature" ? e.group ?? null : null;
|
|
594
598
|
}
|
|
595
599
|
/** Pans by pixels. Says what moved: the span through time, the lanes, or
|
|
596
600
|
neither - a scroll through the lanes is no news about the time. */
|
|
597
601
|
pan(t, e) {
|
|
598
602
|
const i = this.domain[0], n = this.scrollY, o = this.domain[1] - i;
|
|
599
|
-
this.width > 0 && t !== 0 && (this.domain =
|
|
603
|
+
this.width > 0 && t !== 0 && (this.domain = cn(this.domain, t / this.width * o)), this.scrollY = Math.max(0, Math.min(this.maxScroll(), this.scrollY + e));
|
|
600
604
|
const r = this.domain[0] !== i;
|
|
601
605
|
return { moved: r || this.scrollY !== n, time: r };
|
|
602
606
|
}
|
|
@@ -604,63 +608,64 @@ class sn {
|
|
|
604
608
|
zoomAt(t, e) {
|
|
605
609
|
if (this.width <= 0 || !Number.isFinite(e)) return !1;
|
|
606
610
|
const i = this.domain, n = this.viewport().scale.fromPx(t);
|
|
607
|
-
return this.domain =
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
const
|
|
611
|
-
root:
|
|
612
|
-
corner:
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
611
|
+
return this.domain = hn(this.domain, n, e, this.options.zoomLimits), i[0] !== this.domain[0] || i[1] !== this.domain[1];
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
const fn = "_root_q0w8s_4 _text_18806_22", mn = "_corner_q0w8s_19", pn = "_zoneLabel_q0w8s_24", gn = "_dayBand_q0w8s_40", kn = "_tickBand_q0w8s_41", wn = "_day_q0w8s_40", vn = "_dayLabel_q0w8s_67", yn = "_tick_q0w8s_41", bn = "_tickLabel_q0w8s_88", Mn = "_headers_q0w8s_98", Tn = "_header_q0w8s_98", Sn = "_headerLabel_q0w8s_117", In = "_headerCount_q0w8s_153", Ln = "_chevron_q0w8s_162", An = "_plot_q0w8s_240", Cn = "_focusRing_q0w8s_254", Dn = "_layer_q0w8s_272", _n = "_grip_q0w8s_299", On = "_ghostLabel_q0w8s_309", Fn = "_finding_q0w8s_322", $n = "_refusal_q0w8s_330", En = "_tooltip_q0w8s_334", xn = "_tooltipHead_q0w8s_353", Rn = "_tooltipTimes_q0w8s_358", Nn = "_now_q0w8s_367", Bn = "_barLabel_q0w8s_381", Pn = "_barLabelText_q0w8s_394", p = {
|
|
615
|
+
root: fn,
|
|
616
|
+
corner: mn,
|
|
617
|
+
zoneLabel: pn,
|
|
618
|
+
dayBand: gn,
|
|
619
|
+
tickBand: kn,
|
|
620
|
+
day: wn,
|
|
621
|
+
dayLabel: vn,
|
|
622
|
+
tick: yn,
|
|
623
|
+
tickLabel: bn,
|
|
624
|
+
headers: Mn,
|
|
625
|
+
header: Tn,
|
|
626
|
+
headerLabel: Sn,
|
|
627
|
+
headerCount: In,
|
|
628
|
+
chevron: Ln,
|
|
629
|
+
plot: An,
|
|
630
|
+
focusRing: Cn,
|
|
631
|
+
layer: Dn,
|
|
632
|
+
grip: _n,
|
|
633
|
+
ghostLabel: On,
|
|
634
|
+
finding: Fn,
|
|
635
|
+
refusal: $n,
|
|
636
|
+
tooltip: En,
|
|
637
|
+
tooltipHead: xn,
|
|
638
|
+
tooltipTimes: Rn,
|
|
639
|
+
now: Nn,
|
|
640
|
+
barLabel: Bn,
|
|
641
|
+
barLabelText: Pn
|
|
637
642
|
};
|
|
638
|
-
function
|
|
639
|
-
const s =
|
|
643
|
+
function os() {
|
|
644
|
+
const s = Mt();
|
|
640
645
|
return (t) => {
|
|
641
|
-
const e = Math.round(t /
|
|
646
|
+
const e = Math.round(t / X), i = Math.floor(e / 60), n = e % 60;
|
|
642
647
|
return [i > 0 ? s.hoursShort(i) : "", n > 0 || i === 0 ? s.minutesShort(n) : ""].filter(Boolean).join(" ");
|
|
643
648
|
};
|
|
644
649
|
}
|
|
645
|
-
function
|
|
646
|
-
const e =
|
|
650
|
+
function Gn({ target: s, lane: t }) {
|
|
651
|
+
const e = Xt(), i = Mt(), n = os(), o = (c) => et(e, c);
|
|
647
652
|
if (s.kind === "subtask") {
|
|
648
653
|
const { subtask: c, task: f } = s, g = [
|
|
649
654
|
f?.name ?? c.task,
|
|
650
655
|
c.name ?? c.id,
|
|
651
656
|
`${e.dateShort(new Date(c.from))} ${i.scheduleGhostTimes(o(c.from), o(c.to))}`,
|
|
652
|
-
...s.overlapping.map((
|
|
653
|
-
...s.violatedDependencies.map((
|
|
654
|
-
...s.blocked.map((
|
|
657
|
+
...s.overlapping.map((w) => i.scheduleOverlapWith(w.name ?? w.id)),
|
|
658
|
+
...s.violatedDependencies.map((w) => i.scheduleViolatedBy(n(w.shortBy))),
|
|
659
|
+
...s.blocked.map((w) => i.scheduleInBlockedTime(w.label))
|
|
655
660
|
];
|
|
656
|
-
return /* @__PURE__ */
|
|
661
|
+
return /* @__PURE__ */ B(ht, { children: [
|
|
657
662
|
t,
|
|
658
663
|
`, ${g.join(", ")}`
|
|
659
664
|
] });
|
|
660
665
|
}
|
|
661
666
|
if (s.kind === "milestone") {
|
|
662
667
|
const { milestone: c } = s;
|
|
663
|
-
return /* @__PURE__ */
|
|
668
|
+
return /* @__PURE__ */ B(ht, { children: [
|
|
664
669
|
t,
|
|
665
670
|
`, ${i.scheduleMilestone(c.label ?? c.id)}, ${e.dateShort(new Date(c.at))} ${o(c.at)}`
|
|
666
671
|
] });
|
|
@@ -673,11 +678,11 @@ function _n({ target: s, lane: t }) {
|
|
|
673
678
|
...h === void 0 ? [] : [i.scheduleViolatedBy(n(h.shortBy))]
|
|
674
679
|
].join(", ");
|
|
675
680
|
}
|
|
676
|
-
function
|
|
677
|
-
const t =
|
|
681
|
+
function Hn({ target: s }) {
|
|
682
|
+
const t = Xt(), e = Mt(), i = (h) => et(t, h), n = os();
|
|
678
683
|
if (s.kind === "subtask") {
|
|
679
684
|
const { subtask: h, task: c } = s;
|
|
680
|
-
return /* @__PURE__ */
|
|
685
|
+
return /* @__PURE__ */ B(ht, { children: [
|
|
681
686
|
/* @__PURE__ */ m("span", { className: p.tooltipHead, children: c?.name ?? h.task }),
|
|
682
687
|
/* @__PURE__ */ m("span", { children: h.name ?? h.id }),
|
|
683
688
|
/* @__PURE__ */ m("span", { className: p.tooltipTimes, children: e.scheduleGhostTimes(i(h.from), i(h.to)) }),
|
|
@@ -690,21 +695,21 @@ function On({ target: s }) {
|
|
|
690
695
|
}
|
|
691
696
|
if (s.kind === "milestone") {
|
|
692
697
|
const { milestone: h } = s;
|
|
693
|
-
return /* @__PURE__ */
|
|
698
|
+
return /* @__PURE__ */ B(ht, { children: [
|
|
694
699
|
/* @__PURE__ */ m("span", { className: p.tooltipHead, children: e.scheduleMilestone(h.label ?? h.id) }),
|
|
695
700
|
/* @__PURE__ */ m("span", { className: p.tooltipTimes, children: `${t.dateShort(new Date(h.at))} ${i(h.at)}` })
|
|
696
701
|
] });
|
|
697
702
|
}
|
|
698
703
|
const { dependency: o, task: r, from: a, to: l, violated: d } = s;
|
|
699
|
-
return /* @__PURE__ */
|
|
704
|
+
return /* @__PURE__ */ B(ht, { children: [
|
|
700
705
|
/* @__PURE__ */ m("span", { className: p.tooltipHead, children: r?.name ?? r?.id ?? o.id }),
|
|
701
706
|
/* @__PURE__ */ m("span", { children: e.scheduleRoute(a?.name ?? o.from, l?.name ?? o.to) }),
|
|
702
707
|
/* @__PURE__ */ m("span", { children: `${e.scheduleDependency} ${n(o.lag)}` }),
|
|
703
708
|
d !== void 0 && /* @__PURE__ */ m("span", { className: p.finding, children: e.scheduleViolatedBy(n(d.shortBy)) })
|
|
704
709
|
] });
|
|
705
710
|
}
|
|
706
|
-
const
|
|
707
|
-
function
|
|
711
|
+
const Yn = [], Ce = { min: Ut, max: 28 * j }, Kn = [], De = 20, Vn = 44, qn = 84, zn = 200;
|
|
712
|
+
function Wn(s) {
|
|
708
713
|
const {
|
|
709
714
|
ref: t,
|
|
710
715
|
scene: e,
|
|
@@ -712,162 +717,162 @@ function Bn(s) {
|
|
|
712
717
|
"aria-labelledby": n,
|
|
713
718
|
"aria-describedby": o,
|
|
714
719
|
height: r,
|
|
715
|
-
laneHeight: a =
|
|
720
|
+
laneHeight: a = Kt,
|
|
716
721
|
headerWidth: l = 160,
|
|
717
|
-
calendar: d =
|
|
722
|
+
calendar: d = Kn,
|
|
718
723
|
zoomLimits: h,
|
|
719
724
|
snap: c = "ticks",
|
|
720
|
-
intents: f =
|
|
725
|
+
intents: f = Yn,
|
|
721
726
|
onIntent: g,
|
|
722
|
-
canMoveTo:
|
|
727
|
+
canMoveTo: w,
|
|
723
728
|
onInteraction: A,
|
|
724
729
|
selectedTask: I,
|
|
725
730
|
onSelectedTaskChange: L,
|
|
726
731
|
placing: D,
|
|
727
|
-
route:
|
|
732
|
+
route: y = "curve",
|
|
728
733
|
attach: M = "centre",
|
|
729
734
|
ends: T = "dot",
|
|
730
735
|
label: F,
|
|
731
736
|
tooltip: O,
|
|
732
|
-
now:
|
|
733
|
-
loading:
|
|
734
|
-
className:
|
|
735
|
-
style:
|
|
736
|
-
children:
|
|
737
|
-
...
|
|
738
|
-
} = s,
|
|
739
|
-
|
|
740
|
-
if (
|
|
741
|
-
const u = setInterval(() =>
|
|
737
|
+
now: R,
|
|
738
|
+
loading: U = !1,
|
|
739
|
+
className: pt,
|
|
740
|
+
style: gt,
|
|
741
|
+
children: ms,
|
|
742
|
+
...ps
|
|
743
|
+
} = s, ie = { "aria-label": i, "aria-labelledby": n }, It = $s(), Lt = `${It}-summary`, At = V(null), oe = V(null), re = V(null), ae = V(null), H = Xt(), N = Mt(), ot = H.timeZone, kt = Rs(), le = h?.min ?? Ce.min, de = h?.max ?? Ce.max, he = typeof c == "object" ? c.step : null, ce = typeof c == "object" ? c.offset : null, ue = typeof c == "object" ? null : c, [gs, ks] = dt(() => Date.now());
|
|
744
|
+
q(() => {
|
|
745
|
+
if (R !== !0) return;
|
|
746
|
+
const u = setInterval(() => ks(Date.now()), X);
|
|
742
747
|
return () => clearInterval(u);
|
|
743
|
-
}, [
|
|
744
|
-
const
|
|
745
|
-
|
|
746
|
-
const u =
|
|
747
|
-
e.setOptions({ laneHeight: a, calendar: d, zoomLimits: { min:
|
|
748
|
-
}, [e, a, d,
|
|
749
|
-
e.setHandlers({ onIntent: g, canMoveTo:
|
|
750
|
-
}, [e, g,
|
|
751
|
-
e.setLoading(
|
|
752
|
-
}, [e,
|
|
748
|
+
}, [R]);
|
|
749
|
+
const fe = R === !0 ? gs : typeof R == "number" ? R : null;
|
|
750
|
+
wt(() => {
|
|
751
|
+
const u = ue ?? { step: he ?? 0, offset: ce ?? 0 };
|
|
752
|
+
e.setOptions({ laneHeight: a, calendar: d, zoomLimits: { min: le, max: de }, snap: u, intents: f, now: fe, timeZone: ot, route: y, attach: M, ends: T });
|
|
753
|
+
}, [e, a, d, le, de, ue, he, ce, f, fe, ot, y, M, T]), q(() => {
|
|
754
|
+
e.setHandlers({ onIntent: g, canMoveTo: w, onInteraction: A, onSelectedTaskChange: L });
|
|
755
|
+
}, [e, g, w, A, L]), Es(t, () => At.current, []), q(() => {
|
|
756
|
+
e.setLoading(U);
|
|
757
|
+
}, [e, U]), q(() => {
|
|
753
758
|
e.setControlledTask(I);
|
|
754
|
-
}, [e, I]),
|
|
759
|
+
}, [e, I]), q(() => {
|
|
755
760
|
e.setPlacing(D ?? null);
|
|
756
|
-
}, [e, D]),
|
|
757
|
-
const u =
|
|
758
|
-
if (!u || !
|
|
759
|
-
e.bind(u,
|
|
760
|
-
const C =
|
|
761
|
+
}, [e, D]), q(() => {
|
|
762
|
+
const u = At.current, v = oe.current, S = re.current, $ = ae.current;
|
|
763
|
+
if (!u || !v || !S || !$) return;
|
|
764
|
+
e.bind(u, v, S, $);
|
|
765
|
+
const C = v.getBoundingClientRect();
|
|
761
766
|
e.resize(C.width, C.height);
|
|
762
767
|
const _ = new ResizeObserver((K) => {
|
|
763
|
-
const
|
|
764
|
-
|
|
768
|
+
const xt = K[K.length - 1]?.contentRect;
|
|
769
|
+
xt !== void 0 && e.resize(xt.width, xt.height);
|
|
765
770
|
});
|
|
766
|
-
_.observe(
|
|
767
|
-
const
|
|
768
|
-
|
|
769
|
-
const P = () => e.setFontScale(
|
|
771
|
+
_.observe(v);
|
|
772
|
+
const x = document.createElement("div");
|
|
773
|
+
x.setAttribute("aria-hidden", "true"), x.style.cssText = "position:absolute;visibility:hidden;pointer-events:none;width:1rem;height:0", u.appendChild(x);
|
|
774
|
+
const P = () => e.setFontScale(nn(parseFloat(getComputedStyle(x).width)));
|
|
770
775
|
P();
|
|
771
776
|
const G = new ResizeObserver(P);
|
|
772
|
-
G.observe(
|
|
777
|
+
G.observe(x);
|
|
773
778
|
const tt = (K) => e.wheel(K);
|
|
774
779
|
u.addEventListener("wheel", tt, { passive: !1 });
|
|
775
|
-
const
|
|
776
|
-
u.addEventListener("touchmove",
|
|
777
|
-
const
|
|
780
|
+
const ve = (K) => e.touchMove(K);
|
|
781
|
+
u.addEventListener("touchmove", ve, { passive: !1 });
|
|
782
|
+
const ye = (K) => {
|
|
778
783
|
K.key === "Escape" && e.cancelEdit() && K.preventDefault();
|
|
779
784
|
};
|
|
780
|
-
return window.addEventListener("keydown",
|
|
781
|
-
window.removeEventListener("keydown",
|
|
785
|
+
return window.addEventListener("keydown", ye), () => {
|
|
786
|
+
window.removeEventListener("keydown", ye), u.removeEventListener("wheel", tt), u.removeEventListener("touchmove", ve), _.disconnect(), G.disconnect(), x.remove(), e.unbind();
|
|
782
787
|
};
|
|
783
788
|
}, [e]);
|
|
784
|
-
const k =
|
|
789
|
+
const k = ze(e.subscribe, e.getSnapshot, e.getServerSnapshot), { fontScale: rt } = k, Ct = Vn * rt, ws = qn * rt, vs = zn * rt, ys = (u, v) => {
|
|
785
790
|
const S = new Date(u);
|
|
786
|
-
return
|
|
787
|
-
},
|
|
791
|
+
return v >= vs ? H.dateLong(S) : v >= ws ? H.date(S) : v >= Ct ? H.dateShort(S) : "";
|
|
792
|
+
}, bs = k.days.reduce((u, v) => Math.max(u, v.width), 0), J = dn(bs, Ct), me = k.step >= j ? J : 1, b = k.ghost, Q = k.spoken, Dt = k.summary, pe = (u) => `${H.dateShort(new Date(u))} ${et(H, u)}`, _t = (u) => `${It}-row-${encodeURIComponent(u.key)}`, Ms = z(() => {
|
|
788
793
|
const u = /* @__PURE__ */ new Map();
|
|
789
|
-
for (const
|
|
790
|
-
for (const S of
|
|
791
|
-
|
|
794
|
+
for (const v of k.headers)
|
|
795
|
+
for (const S of v.within)
|
|
796
|
+
v.kind === "groupHead" && S === v.group || u.set(S, [...u.get(S) ?? [], _t(v)]);
|
|
792
797
|
return u;
|
|
793
|
-
}, [k.headers,
|
|
794
|
-
|
|
795
|
-
const u =
|
|
798
|
+
}, [k.headers, It]), ge = V(null);
|
|
799
|
+
wt(() => {
|
|
800
|
+
const u = ge.current;
|
|
796
801
|
if (u === null) return;
|
|
797
|
-
let
|
|
802
|
+
let v = !0;
|
|
798
803
|
const S = () => {
|
|
799
|
-
if (!
|
|
804
|
+
if (!v) return;
|
|
800
805
|
const _ = [...u.querySelectorAll("[data-lane-count]")];
|
|
801
806
|
for (const P of _) P.hidden = !1;
|
|
802
|
-
const
|
|
807
|
+
const x = _.some((P) => {
|
|
803
808
|
const G = P.previousElementSibling;
|
|
804
809
|
if (!(G instanceof HTMLElement)) return !1;
|
|
805
810
|
const tt = parseFloat(getComputedStyle(G).lineHeight);
|
|
806
811
|
return G.scrollWidth > G.clientWidth || G.clientHeight > tt * 1.5;
|
|
807
812
|
});
|
|
808
|
-
for (const P of _) P.hidden =
|
|
813
|
+
for (const P of _) P.hidden = x;
|
|
809
814
|
};
|
|
810
815
|
S(), document.fonts?.ready.then(S);
|
|
811
|
-
const
|
|
812
|
-
|
|
816
|
+
const $ = new ResizeObserver(S);
|
|
817
|
+
$.observe(u);
|
|
813
818
|
const C = new MutationObserver(S);
|
|
814
819
|
return C.observe(u, { childList: !0, characterData: !0, subtree: !0 }), () => {
|
|
815
|
-
|
|
820
|
+
v = !1, $.disconnect(), C.disconnect();
|
|
816
821
|
};
|
|
817
822
|
}, []);
|
|
818
|
-
const
|
|
819
|
-
|
|
820
|
-
const u =
|
|
823
|
+
const Ts = z(() => new Set(b?.refusedLanes ?? []), [b?.refusedLanes]), ke = V(null), [Ot, Ss] = dt({ x: 0, y: 0, at: "" }), Ft = b === null ? "" : `${b.x}:${b.y}:${b.from}:${b.to}:${b.overlap}:${b.violated}:${b.refused}:${b.blocked}`;
|
|
824
|
+
wt(() => {
|
|
825
|
+
const u = ke.current;
|
|
821
826
|
if (b === null || u === null) return;
|
|
822
|
-
const
|
|
827
|
+
const v = 4, S = b.y - u.offsetHeight - v, $ = b.y + b.height + v, C = {
|
|
823
828
|
x: Math.max(2, Math.min(b.x, k.width - u.offsetWidth - 2)),
|
|
824
|
-
y: S >= 2 ? S : Math.min(
|
|
825
|
-
at:
|
|
829
|
+
y: S >= 2 ? S : Math.min($, k.height - u.offsetHeight - 2),
|
|
830
|
+
at: Ft
|
|
826
831
|
};
|
|
827
|
-
|
|
828
|
-
}, [b,
|
|
829
|
-
const
|
|
830
|
-
return
|
|
831
|
-
const u =
|
|
832
|
-
if (
|
|
833
|
-
const
|
|
834
|
-
const P = C +
|
|
835
|
-
return Math.max(4, Math.min(tt,
|
|
836
|
-
},
|
|
837
|
-
x: S(
|
|
838
|
-
y: S(
|
|
839
|
-
at:
|
|
832
|
+
Ss((_) => _.x === C.x && _.y === C.y && _.at === C.at ? _ : C);
|
|
833
|
+
}, [b, Ft, k.width, k.height]);
|
|
834
|
+
const we = V(null), [$t, Is] = dt({ x: 0, y: 0, at: "" }), W = k.tooltip, Et = W === null ? "" : `${W.x}:${W.y}:${W.target.kind}`;
|
|
835
|
+
return wt(() => {
|
|
836
|
+
const u = we.current;
|
|
837
|
+
if (W === null || u === null) return;
|
|
838
|
+
const v = 12, S = (C, _, x) => {
|
|
839
|
+
const P = C + v, G = C - v - _, tt = P + _ <= x - 4 || G < 4 ? P : G;
|
|
840
|
+
return Math.max(4, Math.min(tt, x - _ - 4));
|
|
841
|
+
}, $ = {
|
|
842
|
+
x: S(W.x, u.offsetWidth, k.width),
|
|
843
|
+
y: S(W.y, u.offsetHeight, k.height),
|
|
844
|
+
at: Et
|
|
840
845
|
};
|
|
841
|
-
|
|
842
|
-
}, [
|
|
843
|
-
/* @__PURE__ */
|
|
846
|
+
Is((C) => C.x === $.x && C.y === $.y && C.at === $.at ? C : $);
|
|
847
|
+
}, [W, Et, k.width, k.height]), /* @__PURE__ */ B(Xe, { value: e, children: [
|
|
848
|
+
/* @__PURE__ */ B(
|
|
844
849
|
"div",
|
|
845
850
|
{
|
|
846
|
-
...
|
|
847
|
-
ref:
|
|
851
|
+
...ps,
|
|
852
|
+
ref: At,
|
|
848
853
|
role: "figure",
|
|
849
|
-
...
|
|
850
|
-
className:
|
|
851
|
-
style: { ...r === void 0 ? { height: "100%", minHeight: 400 } : { height: `${r}px` }, gridTemplateColumns: `min(${l}px, 40%) minmax(0, 1fr)`, ...
|
|
854
|
+
...ie,
|
|
855
|
+
className: pt ? `${p.root} ${pt}` : p.root,
|
|
856
|
+
style: { ...r === void 0 ? { height: "100%", minHeight: 400 } : { height: `${r}px` }, gridTemplateColumns: `min(${l}px, 40%) minmax(0, 1fr)`, ...gt },
|
|
852
857
|
children: [
|
|
853
|
-
/* @__PURE__ */ m("div", { className: p.corner }),
|
|
854
|
-
/* @__PURE__ */ m("div", { className: p.dayBand, "aria-hidden": "true", "data-schedule-days": "", "data-schedule-clip": "day band", children: k.days.map((u,
|
|
855
|
-
const S =
|
|
856
|
-
return /* @__PURE__ */ m("span", { className: p.day, style: { left: `${u.x}px`, width: `${S ?
|
|
858
|
+
/* @__PURE__ */ m("div", { className: p.corner, children: kt !== null && /* @__PURE__ */ m("span", { className: p.zoneLabel, "data-schedule-overlay": "zone label", children: kt }) }),
|
|
859
|
+
/* @__PURE__ */ m("div", { className: p.dayBand, "aria-hidden": "true", "data-schedule-days": "", "data-schedule-clip": "day band", children: k.days.map((u, v) => {
|
|
860
|
+
const S = J === 1 || v === 0 || Bt(u.start, J, ot), $ = J === 1 ? u.x + u.width : k.days.slice(v + 1).find((x) => Bt(x.start, J, ot))?.x ?? k.width, C = Math.max(0, -u.x), _ = Math.min($, k.width) - Math.max(u.x, 0);
|
|
861
|
+
return /* @__PURE__ */ m("span", { className: p.day, style: { left: `${u.x}px`, width: `${S ? $ - u.x : u.width}px` }, children: /* @__PURE__ */ m("span", { className: p.dayLabel, "data-schedule-overlay": "day label", style: { marginLeft: `${C}px` }, children: S ? ys(u.start, J === 1 ? _ : Math.min(_, Ct)) : "" }) }, u.start);
|
|
857
862
|
}) }),
|
|
858
|
-
/* @__PURE__ */ m("div", { ref:
|
|
859
|
-
|
|
860
|
-
k.headers.map((u) => /* @__PURE__ */
|
|
863
|
+
/* @__PURE__ */ m("div", { ref: ge, className: p.headers, "data-schedule-headers": "", children: /* @__PURE__ */ B("div", { className: p.headerRun, style: { transform: `translateY(${-k.scrollY}px)` }, children: [
|
|
864
|
+
U && k.headers.length === 0 && Array.from({ length: Math.floor(k.height / Math.round(a * rt)) }, (u, v) => /* @__PURE__ */ m("div", { className: p.header, style: { height: `${Math.round(a * rt)}px` }, children: /* @__PURE__ */ m(Ns, { width: "60%" }) }, v)),
|
|
865
|
+
k.headers.map((u) => /* @__PURE__ */ B(
|
|
861
866
|
"div",
|
|
862
867
|
{
|
|
863
|
-
id:
|
|
868
|
+
id: _t(u),
|
|
864
869
|
className: p.header,
|
|
865
870
|
style: { height: `${u.height}px`, paddingLeft: `calc(var(--u-space-3) + ${u.depth} * var(--u-space-3))` },
|
|
866
871
|
"data-lane": u.lane,
|
|
867
872
|
"data-group": u.group,
|
|
868
873
|
"data-row": u.kind,
|
|
869
874
|
"data-schedule-clip": `header ${u.kind}`,
|
|
870
|
-
"data-refused": u.lane !== void 0 &&
|
|
875
|
+
"data-refused": u.lane !== void 0 && Ts.has(u.lane) ? "" : void 0,
|
|
871
876
|
children: [
|
|
872
877
|
u.kind !== "lane" && u.group !== void 0 && /* @__PURE__ */ m(
|
|
873
878
|
"button",
|
|
@@ -876,38 +881,38 @@ function Bn(s) {
|
|
|
876
881
|
className: p.chevron,
|
|
877
882
|
"data-schedule-overlay": "fold control",
|
|
878
883
|
"aria-expanded": u.collapsed === !1,
|
|
879
|
-
"aria-controls": (
|
|
880
|
-
"aria-label": `${u.collapsed === !0 ?
|
|
884
|
+
"aria-controls": (Ms.get(u.group) ?? [_t(u)]).join(" "),
|
|
885
|
+
"aria-label": `${u.collapsed === !0 ? N.scheduleUnfoldGroup : N.scheduleFoldGroup}: ${typeof u.label == "string" ? u.label : u.group}`,
|
|
881
886
|
onClick: () => e.toggleGroup(u.group),
|
|
882
|
-
children: /* @__PURE__ */ m(
|
|
887
|
+
children: /* @__PURE__ */ m(Bs, { size: 9, "data-open": u.collapsed === !1 ? "" : void 0 })
|
|
883
888
|
}
|
|
884
889
|
),
|
|
885
890
|
/* @__PURE__ */ m("span", { className: p.headerLabel, "data-schedule-overlay": "header label", children: u.label }),
|
|
886
|
-
u.kind !== "lane" && /* @__PURE__ */ m("span", { className: p.headerCount, "data-schedule-overlay": "lane count", "data-lane-count": u.lanes, children:
|
|
891
|
+
u.kind !== "lane" && /* @__PURE__ */ m("span", { className: p.headerCount, "data-schedule-overlay": "lane count", "data-lane-count": u.lanes, children: N.scheduleLaneCount(u.lanes) })
|
|
887
892
|
]
|
|
888
893
|
},
|
|
889
894
|
u.key
|
|
890
895
|
))
|
|
891
896
|
] }) }),
|
|
892
|
-
/* @__PURE__ */
|
|
897
|
+
/* @__PURE__ */ B(
|
|
893
898
|
"div",
|
|
894
899
|
{
|
|
895
|
-
ref:
|
|
900
|
+
ref: oe,
|
|
896
901
|
className: p.plot,
|
|
897
902
|
"data-schedule-plot": "",
|
|
898
903
|
"data-schedule-clip": "plot",
|
|
899
904
|
style: { cursor: k.cursor },
|
|
900
|
-
"aria-busy":
|
|
905
|
+
"aria-busy": U || void 0,
|
|
901
906
|
"data-stale": k.loading && k.headers.length > 0 || void 0,
|
|
902
907
|
tabIndex: 0,
|
|
903
908
|
role: "application",
|
|
904
|
-
"aria-roledescription":
|
|
905
|
-
...
|
|
906
|
-
"aria-describedby": o ? `${
|
|
909
|
+
"aria-roledescription": N.scheduleRoleDescription,
|
|
910
|
+
...ie,
|
|
911
|
+
"aria-describedby": o ? `${Lt} ${o}` : Lt,
|
|
907
912
|
onKeyDown: (u) => {
|
|
908
913
|
e.key(u.nativeEvent) && u.preventDefault();
|
|
909
914
|
},
|
|
910
|
-
onFocus: (u) => e.focus(
|
|
915
|
+
onFocus: (u) => e.focus(Un(u.currentTarget)),
|
|
911
916
|
onBlur: () => e.blur(),
|
|
912
917
|
onPointerDown: (u) => e.pointerDown(u.nativeEvent),
|
|
913
918
|
onPointerMove: (u) => e.pointerMove(u.nativeEvent),
|
|
@@ -918,12 +923,12 @@ function Bn(s) {
|
|
|
918
923
|
onDragOver: (u) => e.dragOver(u.nativeEvent),
|
|
919
924
|
onDrop: (u) => e.drop(u.nativeEvent),
|
|
920
925
|
onDragLeave: (u) => {
|
|
921
|
-
const
|
|
922
|
-
(!(
|
|
926
|
+
const v = u.nativeEvent.relatedTarget;
|
|
927
|
+
(!(v instanceof Node) || !u.currentTarget.contains(v)) && e.dragLeave();
|
|
923
928
|
},
|
|
924
929
|
children: [
|
|
925
|
-
/* @__PURE__ */ m("canvas", { ref:
|
|
926
|
-
/* @__PURE__ */ m("canvas", { ref:
|
|
930
|
+
/* @__PURE__ */ m("canvas", { ref: re, className: p.layer, "aria-hidden": "true" }),
|
|
931
|
+
/* @__PURE__ */ m("canvas", { ref: ae, className: p.layer, "aria-hidden": "true" }),
|
|
927
932
|
k.grips.map((u) => /* @__PURE__ */ m(
|
|
928
933
|
"span",
|
|
929
934
|
{
|
|
@@ -951,23 +956,23 @@ function Bn(s) {
|
|
|
951
956
|
O !== !1 && k.tooltip !== null && /* @__PURE__ */ m(
|
|
952
957
|
"span",
|
|
953
958
|
{
|
|
954
|
-
ref:
|
|
959
|
+
ref: we,
|
|
955
960
|
role: "tooltip",
|
|
956
961
|
className: p.tooltip,
|
|
957
962
|
"data-schedule-tooltip": "",
|
|
958
963
|
"data-schedule-overlay": "tooltip",
|
|
959
964
|
style: {
|
|
960
|
-
left: `${
|
|
961
|
-
top: `${
|
|
962
|
-
visibility:
|
|
965
|
+
left: `${$t.x}px`,
|
|
966
|
+
top: `${$t.y}px`,
|
|
967
|
+
visibility: $t.at === Et ? void 0 : "hidden"
|
|
963
968
|
},
|
|
964
|
-
children: typeof O == "function" ? O(k.tooltip.target) : /* @__PURE__ */ m(
|
|
969
|
+
children: typeof O == "function" ? O(k.tooltip.target) : /* @__PURE__ */ m(Hn, { target: k.tooltip.target })
|
|
965
970
|
}
|
|
966
971
|
),
|
|
967
|
-
b !== null && /* @__PURE__ */
|
|
972
|
+
b !== null && /* @__PURE__ */ B(
|
|
968
973
|
"span",
|
|
969
974
|
{
|
|
970
|
-
ref:
|
|
975
|
+
ref: ke,
|
|
971
976
|
className: p.ghostLabel,
|
|
972
977
|
"data-ghost": "",
|
|
973
978
|
"data-schedule-overlay": "ghost label",
|
|
@@ -975,16 +980,16 @@ function Bn(s) {
|
|
|
975
980
|
"data-refused": b.refused ? "" : void 0,
|
|
976
981
|
"data-blocked": b.blocked ? "" : void 0,
|
|
977
982
|
style: {
|
|
978
|
-
left: `${
|
|
979
|
-
top: `${
|
|
980
|
-
visibility:
|
|
983
|
+
left: `${Ot.x}px`,
|
|
984
|
+
top: `${Ot.y}px`,
|
|
985
|
+
visibility: Ot.at === Ft ? void 0 : "hidden"
|
|
981
986
|
},
|
|
982
987
|
children: [
|
|
983
|
-
|
|
984
|
-
b.refused && /* @__PURE__ */ m("span", { className: p.refusal, children:
|
|
985
|
-
b.blocked && /* @__PURE__ */ m("span", { className: p.refusal, children:
|
|
986
|
-
b.overlap && /* @__PURE__ */ m("span", { className: p.finding, children:
|
|
987
|
-
b.violated && /* @__PURE__ */ m("span", { className: p.finding, children:
|
|
988
|
+
N.scheduleGhostTimes(et(H, b.from), et(H, b.to)),
|
|
989
|
+
b.refused && /* @__PURE__ */ m("span", { className: p.refusal, children: N.scheduleLaneRefused }),
|
|
990
|
+
b.blocked && /* @__PURE__ */ m("span", { className: p.refusal, children: N.scheduleBlockedTime }),
|
|
991
|
+
b.overlap && /* @__PURE__ */ m("span", { className: p.finding, children: N.scheduleOverlap }),
|
|
992
|
+
b.violated && /* @__PURE__ */ m("span", { className: p.finding, children: N.scheduleViolatedDependency })
|
|
988
993
|
]
|
|
989
994
|
}
|
|
990
995
|
),
|
|
@@ -993,68 +998,68 @@ function Bn(s) {
|
|
|
993
998
|
}
|
|
994
999
|
),
|
|
995
1000
|
/* @__PURE__ */ m("div", { className: p.corner }),
|
|
996
|
-
/* @__PURE__ */
|
|
1001
|
+
/* @__PURE__ */ B("div", { className: p.tickBand, "aria-hidden": "true", "data-schedule-ticks": "", "data-schedule-clip": "time band", children: [
|
|
997
1002
|
k.now !== null && /* @__PURE__ */ m("span", { className: p.now, "data-now": "", "data-schedule-overlay": "now mark", style: { left: `${k.now}px` } }),
|
|
998
|
-
k.ticks.map((u) => /* @__PURE__ */ m("span", { className: p.tick, style: { left: `${u.x}px` }, children: u.x >=
|
|
1003
|
+
k.ticks.map((u) => /* @__PURE__ */ m("span", { className: p.tick, style: { left: `${u.x}px` }, children: u.x >= De && u.x <= k.width - De && (me === 1 || Bt(u.wallClock, me, ot)) && /* @__PURE__ */ m("span", { className: p.tickLabel, "data-schedule-overlay": "time label", children: k.step >= j ? H.dateShort(new Date(u.wallClock)) : et(H, u.wallClock) }) }, u.wallClock))
|
|
999
1004
|
] }),
|
|
1000
|
-
/* @__PURE__ */ m(
|
|
1001
|
-
|
|
1005
|
+
/* @__PURE__ */ m(be, { "aria-live": "polite", children: Q !== null && /* @__PURE__ */ m(
|
|
1006
|
+
Gn,
|
|
1002
1007
|
{
|
|
1003
1008
|
target: Q.target,
|
|
1004
1009
|
lane: Q.lane === null ? null : e.data.lanes.find((u) => u.id === Q.lane)?.label ?? Q.lane
|
|
1005
1010
|
},
|
|
1006
1011
|
Q.count
|
|
1007
1012
|
) }),
|
|
1008
|
-
/* @__PURE__ */ m(
|
|
1013
|
+
/* @__PURE__ */ m(be, { id: Lt, children: k === e.getServerSnapshot() ? N.scheduleKeyHelp : `${N.scheduleSummary({ ...Dt, from: pe(Dt.from), to: pe(Dt.to) })}${kt === null ? "" : ` ${kt}.`} ${N.scheduleKeyHelp}` })
|
|
1009
1014
|
]
|
|
1010
1015
|
}
|
|
1011
1016
|
),
|
|
1012
|
-
|
|
1017
|
+
ms
|
|
1013
1018
|
] });
|
|
1014
1019
|
}
|
|
1015
|
-
function
|
|
1020
|
+
function Un(s) {
|
|
1016
1021
|
try {
|
|
1017
1022
|
return s.matches(":focus-visible");
|
|
1018
1023
|
} catch {
|
|
1019
1024
|
return !0;
|
|
1020
1025
|
}
|
|
1021
1026
|
}
|
|
1022
|
-
function
|
|
1023
|
-
const e =
|
|
1024
|
-
return
|
|
1027
|
+
function Xn({ id: s, label: t }) {
|
|
1028
|
+
const e = Ze(), i = z(() => ({ id: s, label: t ?? s, ...e === null ? {} : { parent: e } }), [s, t, e]);
|
|
1029
|
+
return Vs(i), null;
|
|
1025
1030
|
}
|
|
1026
|
-
function
|
|
1027
|
-
const i =
|
|
1028
|
-
return
|
|
1031
|
+
function jn({ id: s, label: t, children: e }) {
|
|
1032
|
+
const i = Ze(), n = z(() => ({ id: s, label: t ?? s, ...i === null ? {} : { parent: i } }), [s, t, i]);
|
|
1033
|
+
return qs(n), /* @__PURE__ */ m(je, { value: s, children: e });
|
|
1029
1034
|
}
|
|
1030
|
-
function
|
|
1031
|
-
const e =
|
|
1032
|
-
return
|
|
1035
|
+
function Zn({ data: s, tasks: t }) {
|
|
1036
|
+
const e = z(() => ({ kind: "subtasks", data: s, tasks: t }), [s, t]);
|
|
1037
|
+
return St("Subtasks", e), null;
|
|
1033
1038
|
}
|
|
1034
|
-
function
|
|
1035
|
-
const t =
|
|
1036
|
-
return
|
|
1039
|
+
function Jn({ data: s }) {
|
|
1040
|
+
const t = z(() => ({ kind: "dependencies", data: s }), [s]);
|
|
1041
|
+
return St("Dependencies", t), null;
|
|
1037
1042
|
}
|
|
1038
|
-
function
|
|
1039
|
-
const t =
|
|
1040
|
-
return
|
|
1043
|
+
function Qn({ data: s }) {
|
|
1044
|
+
const t = z(() => ({ kind: "blocked", data: s }), [s]);
|
|
1045
|
+
return St("BlockedTimes", t), null;
|
|
1041
1046
|
}
|
|
1042
|
-
function
|
|
1043
|
-
const t =
|
|
1044
|
-
return
|
|
1047
|
+
function ti({ data: s }) {
|
|
1048
|
+
const t = z(() => ({ kind: "milestones", data: s }), [s]);
|
|
1049
|
+
return St("Milestones", t), null;
|
|
1045
1050
|
}
|
|
1046
|
-
function
|
|
1051
|
+
function ei() {
|
|
1047
1052
|
try {
|
|
1048
1053
|
return process.env.NODE_ENV !== "production";
|
|
1049
1054
|
} catch {
|
|
1050
1055
|
return !1;
|
|
1051
1056
|
}
|
|
1052
1057
|
}
|
|
1053
|
-
const
|
|
1054
|
-
function
|
|
1055
|
-
!
|
|
1058
|
+
const rs = ei(), _e = /* @__PURE__ */ new Set();
|
|
1059
|
+
function at(s, t) {
|
|
1060
|
+
!rs || _e.has(s) || (_e.add(s), console.warn(`@umriss-ui/schedule: ${t}`));
|
|
1056
1061
|
}
|
|
1057
|
-
class
|
|
1062
|
+
class si {
|
|
1058
1063
|
/** `changed` is called after every registration change. */
|
|
1059
1064
|
constructor(t) {
|
|
1060
1065
|
this.changed = t;
|
|
@@ -1126,7 +1131,7 @@ class Wn {
|
|
|
1126
1131
|
this.subtasks.push(...e.data);
|
|
1127
1132
|
for (const i of e.tasks) this.tasks.set(i.id, i);
|
|
1128
1133
|
} else e.kind === "dependencies" ? this.dependencies.push(...e.data) : e.kind === "milestones" ? this.milestones.push(...e.data) : this.blocked.push(...e.data);
|
|
1129
|
-
return this.subtaskById = new Map(this.subtasks.map((e) => [e.id, e])), this.overlaps =
|
|
1134
|
+
return this.subtaskById = new Map(this.subtasks.map((e) => [e.id, e])), this.overlaps = Jt(this.subtasks), this.violatedById = new Map(Qt(this.subtasks, this.dependencies).map((e) => [e.dependency, e])), this.depth = Hs(this.subtasks), this.inBlocked = Ue(this.subtasks, this.blocked), this.warnOfMalformedData(), !0;
|
|
1130
1135
|
}
|
|
1131
1136
|
/** Says in development what the data gets wrong and is drawn, dropped or
|
|
1132
1137
|
counted regardless. It runs here, once the parts have registered, so a
|
|
@@ -1134,28 +1139,28 @@ class Wn {
|
|
|
1134
1139
|
the lanes are still on their way, and an empty `tasks` is a plan drawn
|
|
1135
1140
|
muted on purpose. */
|
|
1136
1141
|
warnOfMalformedData() {
|
|
1137
|
-
if (!
|
|
1142
|
+
if (!rs) return;
|
|
1138
1143
|
const t = (n, o) => {
|
|
1139
1144
|
const r = /* @__PURE__ */ new Set();
|
|
1140
1145
|
for (const a of o)
|
|
1141
|
-
r.has(a) &&
|
|
1146
|
+
r.has(a) && at(`twice:${n}:${a}`, `the ${n} id "${a}" stands twice; give each ${n} an id of its own, or only the first is found.`), r.add(a);
|
|
1142
1147
|
};
|
|
1143
1148
|
t("subtask", this.subtasks.map((n) => n.id)), t("dependency", this.dependencies.map((n) => n.id)), t("lane", this.lanes.map((n) => n.id));
|
|
1144
1149
|
for (const n of this.subtasks)
|
|
1145
|
-
n.to > n.from ||
|
|
1150
|
+
n.to > n.from || at(`span:${n.id}`, `subtask "${n.id}" does not end after it starts (from ${n.from}, to ${n.to}); a point in time is a Milestone, and a span with no length is drawn as a hairline.`);
|
|
1146
1151
|
for (const n of this.layers) {
|
|
1147
1152
|
if (n.kind !== "subtasks" || n.tasks.length === 0) continue;
|
|
1148
1153
|
const o = new Set(n.tasks.map((r) => r.id));
|
|
1149
1154
|
for (const r of n.data)
|
|
1150
|
-
o.has(r.task) ||
|
|
1155
|
+
o.has(r.task) || at(`task:${r.id}`, `subtask "${r.id}" names the task "${r.task}", which is not among the tasks of its Subtasks layer; it is drawn muted. Add the task, or correct the subtask's task.`);
|
|
1151
1156
|
}
|
|
1152
1157
|
for (const n of this.dependencies)
|
|
1153
1158
|
for (const o of [n.from, n.to])
|
|
1154
|
-
this.subtaskById.has(o) ||
|
|
1159
|
+
this.subtaskById.has(o) || at(`end:${n.id}:${o}`, `dependency "${n.id}" names the subtask "${o}", and no subtask has that id; the dependency is left out.`);
|
|
1155
1160
|
if (this.lanes.length === 0) return;
|
|
1156
1161
|
const e = new Set(this.lanes.map((n) => n.id)), i = (n, o) => {
|
|
1157
1162
|
for (const { id: r, lane: a } of o)
|
|
1158
|
-
e.has(a) ||
|
|
1163
|
+
e.has(a) || at(`lane:${n}:${r}`, `${n} "${r}" is on the lane "${a}", which no Lane declares; it is left out. Declare <Lane id="${a}" />.`);
|
|
1159
1164
|
};
|
|
1160
1165
|
i("subtask", this.subtasks), i("milestone", this.milestones), i("blocked time", this.blocked);
|
|
1161
1166
|
}
|
|
@@ -1183,60 +1188,60 @@ class Wn {
|
|
|
1183
1188
|
};
|
|
1184
1189
|
}
|
|
1185
1190
|
}
|
|
1186
|
-
const
|
|
1187
|
-
function
|
|
1191
|
+
const ni = 6;
|
|
1192
|
+
function as(s, t, e, i, n, o) {
|
|
1188
1193
|
s.save(), s.beginPath(), s.rect(t, e, i, n), s.clip(), s.globalAlpha = 0.35, s.strokeStyle = o, s.lineWidth = 1, s.beginPath();
|
|
1189
|
-
for (let r = t - n; r < t + i + n; r +=
|
|
1194
|
+
for (let r = t - n; r < t + i + n; r += ni)
|
|
1190
1195
|
s.moveTo(r, e + n), s.lineTo(r + n, e);
|
|
1191
1196
|
s.stroke(), s.restore();
|
|
1192
1197
|
}
|
|
1193
|
-
function
|
|
1198
|
+
function ii(s, t, e, i) {
|
|
1194
1199
|
if (i.size === 0) return;
|
|
1195
1200
|
const { width: n, height: o } = t.view;
|
|
1196
1201
|
for (const r of i) {
|
|
1197
|
-
const a =
|
|
1202
|
+
const a = Z(e, r);
|
|
1198
1203
|
if (a === null) continue;
|
|
1199
1204
|
const { top: l, height: d } = a;
|
|
1200
|
-
l + d < 0 || l > o || (s.globalAlpha = 0.6, s.fillStyle = t.colours.surface, s.fillRect(0, l, n, d), s.globalAlpha = 1,
|
|
1205
|
+
l + d < 0 || l > o || (s.globalAlpha = 0.6, s.fillStyle = t.colours.surface, s.fillRect(0, l, n, d), s.globalAlpha = 1, as(s, 0, l, n, d, t.colours.muted));
|
|
1201
1206
|
}
|
|
1202
1207
|
}
|
|
1203
|
-
function
|
|
1208
|
+
function oi(s, t, e) {
|
|
1204
1209
|
const { data: i } = t;
|
|
1205
1210
|
if (i.violatedById.size !== 0)
|
|
1206
1211
|
for (const n of i.violatedById.values()) {
|
|
1207
1212
|
const o = i.dependencies.find((c) => c.id === n.dependency), r = o === void 0 ? void 0 : i.subtaskById.get(o.to);
|
|
1208
1213
|
if (r === void 0) continue;
|
|
1209
|
-
const a =
|
|
1214
|
+
const a = Z(e, r.lane);
|
|
1210
1215
|
if (a === null || !a.miniature) continue;
|
|
1211
|
-
const l =
|
|
1216
|
+
const l = nt(e.rows, a.top + e.scrollY);
|
|
1212
1217
|
if (l === null) continue;
|
|
1213
|
-
const d =
|
|
1214
|
-
|
|
1218
|
+
const d = E(e, n.arrival), h = Math.max(d + 2, E(e, n.arrival + n.shortBy));
|
|
1219
|
+
Vt(s, t, d, h, l.top - e.scrollY + 1, 3);
|
|
1215
1220
|
}
|
|
1216
1221
|
}
|
|
1217
|
-
function
|
|
1222
|
+
function Vt(s, t, e, i, n, o) {
|
|
1218
1223
|
if (!t.colours.forced) {
|
|
1219
1224
|
s.fillStyle = t.colours.alarm, s.fillRect(e, n, i - e, o);
|
|
1220
1225
|
return;
|
|
1221
1226
|
}
|
|
1222
1227
|
s.strokeStyle = t.colours.alarm, s.lineWidth = o, s.setLineDash([4, 3]), s.beginPath(), s.moveTo(e, n + o / 2), s.lineTo(i, n + o / 2), s.stroke(), s.setLineDash([]);
|
|
1223
1228
|
}
|
|
1224
|
-
function
|
|
1225
|
-
const n =
|
|
1229
|
+
function ri(s, t, e, i) {
|
|
1230
|
+
const n = Z(e, i.lane);
|
|
1226
1231
|
if (n === null || n.top + n.height < 0 || n.top > t.view.height) return;
|
|
1227
|
-
const o = Math.max(0,
|
|
1228
|
-
r <= o || (s.globalAlpha = 0.1, s.fillStyle = t.colours.muted, s.fillRect(o, n.top, r - o, n.height), s.globalAlpha = 1,
|
|
1232
|
+
const o = Math.max(0, E(e, i.from)), r = Math.min(t.view.width, E(e, i.to));
|
|
1233
|
+
r <= o || (s.globalAlpha = 0.1, s.fillStyle = t.colours.muted, s.fillRect(o, n.top, r - o, n.height), s.globalAlpha = 1, as(s, o, n.top, r - o, n.height, t.colours.muted));
|
|
1229
1234
|
}
|
|
1230
|
-
function
|
|
1231
|
-
const n =
|
|
1235
|
+
function qt(s, t, e, i) {
|
|
1236
|
+
const n = Z(e, i.lane);
|
|
1232
1237
|
if (n === null) return;
|
|
1233
|
-
const o =
|
|
1234
|
-
if (s.fillStyle = t.colours.alarm, s.globalAlpha = 0.14, s.fillRect(o, n.top + 1, r - o, Math.max(1, n.height - 2)), s.globalAlpha = 1,
|
|
1235
|
-
const a =
|
|
1236
|
-
a !== null &&
|
|
1238
|
+
const o = E(e, i.from), r = Math.max(o + 2, E(e, i.to));
|
|
1239
|
+
if (s.fillStyle = t.colours.alarm, s.globalAlpha = 0.14, s.fillRect(o, n.top + 1, r - o, Math.max(1, n.height - 2)), s.globalAlpha = 1, Vt(s, t, o, r, n.top + 1, Math.min(3, Math.max(1, n.height - 1))), n.miniature) {
|
|
1240
|
+
const a = nt(e.rows, n.top + e.scrollY);
|
|
1241
|
+
a !== null && Vt(s, t, o, r, a.top - e.scrollY + 1, 3);
|
|
1237
1242
|
}
|
|
1238
1243
|
}
|
|
1239
|
-
const
|
|
1244
|
+
const ai = {
|
|
1240
1245
|
line: "var(--u-hairline)",
|
|
1241
1246
|
lineStrong: "var(--u-hairline-strong)",
|
|
1242
1247
|
text: "var(--u-color-text)",
|
|
@@ -1250,7 +1255,7 @@ const Jn = {
|
|
|
1250
1255
|
/* What text and marks take ON a filled bar - the same token the bar labels
|
|
1251
1256
|
use in CSS, so a cap and the label beside it are one colour. */
|
|
1252
1257
|
onAccent: "var(--u-color-on-accent)"
|
|
1253
|
-
},
|
|
1258
|
+
}, ls = {
|
|
1254
1259
|
line: "GrayText",
|
|
1255
1260
|
lineStrong: "CanvasText",
|
|
1256
1261
|
text: "CanvasText",
|
|
@@ -1260,11 +1265,11 @@ const Jn = {
|
|
|
1260
1265
|
active: "Highlight",
|
|
1261
1266
|
now: "GrayText",
|
|
1262
1267
|
onAccent: "Canvas"
|
|
1263
|
-
},
|
|
1264
|
-
function
|
|
1265
|
-
const e =
|
|
1266
|
-
for (const r of t.tasks.values()) i[`task:${r.id}`] = e ?
|
|
1267
|
-
const n =
|
|
1268
|
+
}, li = (s) => s ? ls : ai, di = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(forced-colors: active)").matches;
|
|
1269
|
+
function hi(s, t) {
|
|
1270
|
+
const e = di(), i = {};
|
|
1271
|
+
for (const r of t.tasks.values()) i[`task:${r.id}`] = e ? ls.text : r.color;
|
|
1272
|
+
const n = _s(s, { ...li(e), ...i }), o = /* @__PURE__ */ new Map();
|
|
1268
1273
|
for (const r of t.tasks.values()) o.set(r.id, n[`task:${r.id}`] ?? r.color);
|
|
1269
1274
|
return {
|
|
1270
1275
|
line: n.line,
|
|
@@ -1280,89 +1285,89 @@ function ti(s, t) {
|
|
|
1280
1285
|
forced: e
|
|
1281
1286
|
};
|
|
1282
1287
|
}
|
|
1283
|
-
function
|
|
1288
|
+
function ft(s) {
|
|
1284
1289
|
const t = s.match(/[\d.]+/g);
|
|
1285
1290
|
return t === null || t.length < 3 ? null : [Number(t[0]), Number(t[1]), Number(t[2])];
|
|
1286
1291
|
}
|
|
1287
|
-
function
|
|
1288
|
-
const t =
|
|
1289
|
-
return t === null ? 0 :
|
|
1292
|
+
function Oe(s) {
|
|
1293
|
+
const t = ft(s);
|
|
1294
|
+
return t === null ? 0 : hs(ds(t));
|
|
1290
1295
|
}
|
|
1291
|
-
function
|
|
1296
|
+
function ds(s) {
|
|
1292
1297
|
return s.map((t) => {
|
|
1293
1298
|
const e = t / 255;
|
|
1294
1299
|
return e <= 0.04045 ? e / 12.92 : ((e + 0.055) / 1.055) ** 2.4;
|
|
1295
1300
|
});
|
|
1296
1301
|
}
|
|
1297
|
-
function
|
|
1302
|
+
function hs([s, t, e]) {
|
|
1298
1303
|
return 0.2126 * s + 0.7152 * t + 0.0722 * e;
|
|
1299
1304
|
}
|
|
1300
|
-
function
|
|
1301
|
-
const e =
|
|
1305
|
+
function Fe(s, t) {
|
|
1306
|
+
const e = Oe(s), i = Oe(t);
|
|
1302
1307
|
return (Math.max(e, i) + 0.05) / (Math.min(e, i) + 0.05);
|
|
1303
1308
|
}
|
|
1304
|
-
function
|
|
1309
|
+
function $e(s, t, e) {
|
|
1305
1310
|
if (s === null) return null;
|
|
1306
1311
|
const i = typeof window > "u" ? 1 : window.devicePixelRatio || 1, n = Math.round(t * i), o = Math.round(e * i);
|
|
1307
1312
|
s.width !== n && (s.width = n), s.height !== o && (s.height = o);
|
|
1308
1313
|
const r = s.getContext("2d");
|
|
1309
1314
|
return r === null ? null : (r.setTransform(i, 0, 0, i, 0, 0), r.clearRect(0, 0, t, e), r);
|
|
1310
1315
|
}
|
|
1311
|
-
function
|
|
1316
|
+
function ci(s, t) {
|
|
1312
1317
|
const { data: e, view: i } = t, n = i.viewport();
|
|
1313
|
-
|
|
1314
|
-
for (const o of e.blocked)
|
|
1315
|
-
|
|
1318
|
+
mi(s, t, n);
|
|
1319
|
+
for (const o of e.blocked) ri(s, t, n, o);
|
|
1320
|
+
pi(s, t);
|
|
1316
1321
|
for (const o of e.layers) {
|
|
1317
1322
|
if (o.kind === "blocked" || o.kind === "milestones") continue;
|
|
1318
1323
|
const r = new Set(o.data);
|
|
1319
1324
|
if (o.kind === "dependencies")
|
|
1320
|
-
for (const a of i.paths) r.has(a.dependency) &&
|
|
1325
|
+
for (const a of i.paths) r.has(a.dependency) && Js(a, i.width, i.height) && zt(s, t, a, !1);
|
|
1321
1326
|
else
|
|
1322
|
-
for (const a of i.boxes) r.has(a.subtask) &&
|
|
1327
|
+
for (const a of i.boxes) r.has(a.subtask) && us(s, t, a, 1);
|
|
1323
1328
|
}
|
|
1324
|
-
for (const o of e.overlaps)
|
|
1325
|
-
for (const o of e.inBlocked)
|
|
1326
|
-
|
|
1327
|
-
for (const o of e.milestones)
|
|
1328
|
-
|
|
1329
|
+
for (const o of e.overlaps) qt(s, t, n, o);
|
|
1330
|
+
for (const o of e.inBlocked) qt(s, t, n, o);
|
|
1331
|
+
oi(s, t, n);
|
|
1332
|
+
for (const o of e.milestones) fs(s, t, n, o, !1);
|
|
1333
|
+
Ti(s, t);
|
|
1329
1334
|
}
|
|
1330
|
-
function
|
|
1335
|
+
function ui(s, t) {
|
|
1331
1336
|
const { view: e, hover: i } = t, n = e.viewport();
|
|
1332
1337
|
if (t.ghost === null) {
|
|
1333
1338
|
if (i.kind === "subtask") {
|
|
1334
1339
|
const c = e.boxById.get(i.subtask.id);
|
|
1335
|
-
c !== void 0 &&
|
|
1340
|
+
c !== void 0 && bi(s, t, c);
|
|
1336
1341
|
} else if (i.kind === "dependency") {
|
|
1337
1342
|
const c = e.paths.find((f) => f.dependency === i.dependency);
|
|
1338
|
-
c !== void 0 &&
|
|
1339
|
-
} else i.kind === "milestone" &&
|
|
1343
|
+
c !== void 0 && zt(s, t, c, !0);
|
|
1344
|
+
} else i.kind === "milestone" && fs(s, t, n, i.milestone, !0);
|
|
1340
1345
|
return;
|
|
1341
1346
|
}
|
|
1342
1347
|
const o = t.ghost, { ghost: r, overlaps: a, violated: l } = o;
|
|
1343
|
-
|
|
1344
|
-
const d =
|
|
1348
|
+
ii(s, t, n, o.refusedLanes);
|
|
1349
|
+
const d = cs(n, r);
|
|
1345
1350
|
if (d === null) return;
|
|
1346
|
-
for (const c of a)
|
|
1351
|
+
for (const c of a) qt(s, t, n, c);
|
|
1347
1352
|
const h = new Set(l.map((c) => c.dependency));
|
|
1348
1353
|
for (const c of t.data.dependencies) {
|
|
1349
1354
|
if (c.from !== r.id && c.to !== r.id) continue;
|
|
1350
1355
|
const f = e.boxById.get(c.from === r.id ? c.to : c.from);
|
|
1351
1356
|
if (f === void 0) continue;
|
|
1352
|
-
const g = c.from === r.id ?
|
|
1353
|
-
|
|
1357
|
+
const g = c.from === r.id ? Yt(n, c, d, f, e.options) : Yt(n, c, f, d, e.options);
|
|
1358
|
+
zt(s, t, g, !0, h.has(c.id));
|
|
1354
1359
|
}
|
|
1355
|
-
|
|
1360
|
+
us(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 && fi(s, t, d, o.tether);
|
|
1356
1361
|
}
|
|
1357
|
-
function
|
|
1362
|
+
function fi(s, t, e, i) {
|
|
1358
1363
|
const n = Math.max(e.outerFrom, Math.min(e.outerTo, i.x)), o = Math.max(e.y, Math.min(e.y + e.height, i.y));
|
|
1359
1364
|
Math.hypot(i.x - n, i.y - o) < 2 || (s.strokeStyle = t.colours.text, s.lineWidth = 1, s.setLineDash([2, 3]), s.beginPath(), s.moveTo(n + 0.5, o + 0.5), s.lineTo(i.x + 0.5, i.y + 0.5), s.stroke(), s.setLineDash([]));
|
|
1360
1365
|
}
|
|
1361
|
-
function
|
|
1362
|
-
const e =
|
|
1363
|
-
return e === null ? null :
|
|
1366
|
+
function cs(s, t) {
|
|
1367
|
+
const e = ee(s.rows, t.lane);
|
|
1368
|
+
return e === null ? null : ts(s, t, e, 0);
|
|
1364
1369
|
}
|
|
1365
|
-
function
|
|
1370
|
+
function mi(s, t, e) {
|
|
1366
1371
|
const { view: i, colours: n, bands: o } = t, { width: r, height: a } = i;
|
|
1367
1372
|
s.lineWidth = 1, s.strokeStyle = n.line, s.beginPath();
|
|
1368
1373
|
for (const h of o.ticks)
|
|
@@ -1381,7 +1386,7 @@ function ii(s, t, e) {
|
|
|
1381
1386
|
for (const h of o.days)
|
|
1382
1387
|
s.moveTo(h.x + 0.5, 0), s.lineTo(h.x + 0.5, a);
|
|
1383
1388
|
s.stroke();
|
|
1384
|
-
const d =
|
|
1389
|
+
const d = Os(i.options.calendar);
|
|
1385
1390
|
if (d.length > 0) {
|
|
1386
1391
|
s.strokeStyle = n.muted, s.setLineDash([2, 3]), s.beginPath();
|
|
1387
1392
|
for (const h of d) {
|
|
@@ -1391,12 +1396,12 @@ function ii(s, t, e) {
|
|
|
1391
1396
|
s.stroke(), s.setLineDash([]);
|
|
1392
1397
|
}
|
|
1393
1398
|
}
|
|
1394
|
-
function
|
|
1399
|
+
function pi(s, t) {
|
|
1395
1400
|
const e = t.view.nowX();
|
|
1396
1401
|
e !== null && (s.fillStyle = t.colours.now, s.fillRect(e, 0, 2, t.view.height));
|
|
1397
1402
|
}
|
|
1398
|
-
function
|
|
1399
|
-
const n =
|
|
1403
|
+
function gi(s, t, e, i) {
|
|
1404
|
+
const n = mt(t.colours, t, e.subtask.task, e.subtask.id);
|
|
1400
1405
|
s.fillStyle = n;
|
|
1401
1406
|
for (const [o, r] of [
|
|
1402
1407
|
[e.outerFrom, e.mainFrom],
|
|
@@ -1405,72 +1410,72 @@ function ri(s, t, e, i) {
|
|
|
1405
1410
|
r <= o || (s.globalAlpha = 0.28 * i, s.fillRect(o, e.y, r - o, e.height));
|
|
1406
1411
|
s.globalAlpha = i, s.fillRect(e.mainFrom, e.y, Math.max(1, e.mainTo - e.mainFrom), e.height), s.globalAlpha = 1;
|
|
1407
1412
|
}
|
|
1408
|
-
function
|
|
1413
|
+
function ne(s, t, e) {
|
|
1409
1414
|
if (s.dashed) return { fill: null, onDark: !1 };
|
|
1410
|
-
const i = s.muted ?
|
|
1411
|
-
return { fill: i, onDark:
|
|
1415
|
+
const i = s.muted ? ki(t, e.surface, 0.5) : t;
|
|
1416
|
+
return { fill: i, onDark: Fe(i, e.onAccent) > Fe(i, e.text) };
|
|
1412
1417
|
}
|
|
1413
|
-
function
|
|
1414
|
-
const i =
|
|
1418
|
+
function ki(s, t, e) {
|
|
1419
|
+
const i = ft(s), n = ft(t);
|
|
1415
1420
|
if (i === null || n === null) return s;
|
|
1416
1421
|
const o = (r) => Math.round(i[r] + (n[r] - i[r]) * e);
|
|
1417
1422
|
return `rgb(${o(0)}, ${o(1)}, ${o(2)})`;
|
|
1418
1423
|
}
|
|
1419
|
-
function
|
|
1420
|
-
const e =
|
|
1424
|
+
function Ee(s, t) {
|
|
1425
|
+
const e = ft(s);
|
|
1421
1426
|
if (e === null || t === 0) return s;
|
|
1422
|
-
const i =
|
|
1427
|
+
const i = ds(e), n = hs(i), [o, r, a] = i.map((l) => {
|
|
1423
1428
|
const d = l + (n - l) * t, h = d <= 31308e-7 ? d * 12.92 : 1.055 * d ** (1 / 2.4) - 0.055;
|
|
1424
1429
|
return Math.round(Math.min(1, Math.max(0, h)) * 255);
|
|
1425
1430
|
});
|
|
1426
1431
|
return `rgb(${o}, ${r}, ${a})`;
|
|
1427
1432
|
}
|
|
1428
|
-
function
|
|
1433
|
+
function mt(s, t, e, i) {
|
|
1429
1434
|
const n = (e === null ? void 0 : s.tasks.get(e)) ?? s.muted;
|
|
1430
|
-
return t.selectedTask === null ? n : e !== t.selectedTask ? s.forced ? s.muted :
|
|
1435
|
+
return t.selectedTask === null ? n : e !== t.selectedTask ? s.forced ? s.muted : Ee(n, 1) : s.forced || t.selectedSubtask === null || i === null || i === t.selectedSubtask ? n : Ee(n, 0.5);
|
|
1431
1436
|
}
|
|
1432
|
-
const
|
|
1433
|
-
function
|
|
1437
|
+
const wi = 2;
|
|
1438
|
+
function us(s, t, e, i) {
|
|
1434
1439
|
const { view: n, colours: o } = t;
|
|
1435
|
-
if (!
|
|
1440
|
+
if (!Ht(e, n.width, n.height)) return;
|
|
1436
1441
|
if (e.miniature) {
|
|
1437
|
-
|
|
1442
|
+
gi(s, t, e, i);
|
|
1438
1443
|
return;
|
|
1439
1444
|
}
|
|
1440
|
-
const r =
|
|
1445
|
+
const r = Tt(e.subtask.appearance), a = mt(o, t, e.subtask.task, e.subtask.id), l = ne(r, a, o), d = e.y, h = e.height, c = Math.max(1, e.mainTo - e.mainFrom), f = l.onDark ? o.onAccent : o.text;
|
|
1441
1446
|
s.lineWidth = 1, s.fillStyle = a, s.strokeStyle = a;
|
|
1442
|
-
for (const [
|
|
1447
|
+
for (const [w, A] of [
|
|
1443
1448
|
[e.outerFrom, e.mainFrom],
|
|
1444
1449
|
[e.mainTo, e.outerTo]
|
|
1445
1450
|
])
|
|
1446
|
-
A <=
|
|
1451
|
+
A <= w || (s.globalAlpha = 0.28 * i, s.fillRect(w, d, A - w, h), s.globalAlpha = i, s.strokeRect(w + 0.5, d + 0.5, A - w - 1, h - 1));
|
|
1447
1452
|
l.fill !== null && (s.globalAlpha = i, s.fillStyle = l.fill, s.fillRect(e.mainFrom, d, c, h));
|
|
1448
1453
|
const g = e.subtask.progress;
|
|
1449
1454
|
if (g !== void 0) {
|
|
1450
|
-
const
|
|
1451
|
-
s.fillStyle = l.fill === null ? a : f, s.globalAlpha = 0.3 * i, s.fillRect(e.mainFrom, A, c,
|
|
1455
|
+
const w = Math.min(4, Math.max(2, Math.round(h / 6))), A = d + h - w - wi, I = Math.round(c * Math.max(0, Math.min(1, g)));
|
|
1456
|
+
s.fillStyle = l.fill === null ? a : f, s.globalAlpha = 0.3 * i, s.fillRect(e.mainFrom, A, c, w), s.globalAlpha = i, I > 0 && s.fillRect(e.mainFrom, A, I, w);
|
|
1452
1457
|
}
|
|
1453
1458
|
if (r.hatched) {
|
|
1454
|
-
const
|
|
1455
|
-
s.globalAlpha = i, s.fillStyle = f, s.fillRect(e.mainFrom + A, d + I,
|
|
1459
|
+
const w = Math.max(1, Math.min(Qe, Math.floor((c - 2 * lt) / 3))), A = c >= 4 * w ? lt : 0, I = h >= 4 * lt ? lt : 0;
|
|
1460
|
+
s.globalAlpha = i, s.fillStyle = f, s.fillRect(e.mainFrom + A, d + I, w, h - 2 * I), s.fillRect(e.mainTo - A - w, d + I, w, h - 2 * I);
|
|
1456
1461
|
}
|
|
1457
|
-
r.open &&
|
|
1462
|
+
r.open && yi(s, e, d, h, o.surface, n.width), r.dashed && (s.globalAlpha = i, s.strokeStyle = a, 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 && i === 1 && (s.strokeStyle = o.surface, s.strokeRect(e.outerFrom - 0.5, d - 0.5, e.outerTo - e.outerFrom + 1, h + 1));
|
|
1458
1463
|
}
|
|
1459
|
-
const
|
|
1460
|
-
function
|
|
1461
|
-
const r = t.mainFrom < 0, a = t.mainTo > o, l = Math.max(1, Math.min(t.mainTo, o) - Math.max(t.mainFrom, 0)), d = Math.min(
|
|
1462
|
-
r &&
|
|
1464
|
+
const vi = 16;
|
|
1465
|
+
function yi(s, t, e, i, n, o) {
|
|
1466
|
+
const r = t.mainFrom < 0, a = t.mainTo > o, l = Math.max(1, Math.min(t.mainTo, o) - Math.max(t.mainFrom, 0)), d = Math.min(vi, l);
|
|
1467
|
+
r && xe(s, 0, d, e, i, n), a && xe(s, o, -d, e, i, n);
|
|
1463
1468
|
}
|
|
1464
|
-
function
|
|
1469
|
+
function xe(s, t, e, i, n, o) {
|
|
1465
1470
|
const r = s.createLinearGradient(t, 0, t + e, 0);
|
|
1466
|
-
r.addColorStop(0,
|
|
1471
|
+
r.addColorStop(0, Re(o, 1)), r.addColorStop(1, Re(o, 0)), s.globalAlpha = 1, s.fillStyle = r, s.fillRect(Math.min(t, t + e), i, Math.abs(e), n);
|
|
1467
1472
|
}
|
|
1468
|
-
function
|
|
1469
|
-
const e =
|
|
1473
|
+
function Re(s, t) {
|
|
1474
|
+
const e = ft(s);
|
|
1470
1475
|
return e === null ? s : `rgba(${e[0]}, ${e[1]}, ${e[2]}, ${t})`;
|
|
1471
1476
|
}
|
|
1472
|
-
function
|
|
1473
|
-
const { data: o, colours: r } = t, a = o.taskOfDependency(e.dependency), l = n ?? o.violatedById.has(e.dependency.id), d = a !== null && a === t.selectedTask, h = l ? r.alarm :
|
|
1477
|
+
function zt(s, t, e, i, n) {
|
|
1478
|
+
const { data: o, colours: r } = t, a = o.taskOfDependency(e.dependency), l = n ?? o.violatedById.has(e.dependency.id), d = a !== null && a === t.selectedTask, h = l ? r.alarm : mt(r, t, a, null);
|
|
1474
1479
|
if (s.strokeStyle = h, s.fillStyle = h, s.lineWidth = i || d ? 2 : 1.25, s.setLineDash(l ? [4, 3] : []), s.beginPath(), s.moveTo(e.x1, e.y1), e.kind === "curve")
|
|
1475
1480
|
s.bezierCurveTo(e.c1x, e.y1, e.c2x, e.y2, e.x2, e.y2);
|
|
1476
1481
|
else
|
|
@@ -1482,24 +1487,24 @@ function Yt(s, t, e, i, n) {
|
|
|
1482
1487
|
])
|
|
1483
1488
|
s.beginPath(), s.arc(c, f, l ? 3 : 2.5, 0, Math.PI * 2), s.fill();
|
|
1484
1489
|
}
|
|
1485
|
-
function
|
|
1486
|
-
const o =
|
|
1490
|
+
function fs(s, t, e, i, n) {
|
|
1491
|
+
const o = se(e, i);
|
|
1487
1492
|
if (o === null || o.x < -o.half || o.x > t.view.width + o.half) return;
|
|
1488
1493
|
const r = (a) => {
|
|
1489
1494
|
s.beginPath(), s.moveTo(o.x, o.y - a), s.lineTo(o.x + a, o.y), s.lineTo(o.x, o.y + a), s.lineTo(o.x - a, o.y), s.closePath();
|
|
1490
1495
|
};
|
|
1491
1496
|
n && (r(o.half + 3), s.fillStyle = t.colours.active, s.fill()), r(o.half + 1), s.fillStyle = t.colours.surface, s.fill(), r(o.half), s.fillStyle = t.colours.text, s.fill();
|
|
1492
1497
|
}
|
|
1493
|
-
function
|
|
1494
|
-
const { colours: i } = t, n =
|
|
1498
|
+
function bi(s, t, e) {
|
|
1499
|
+
const { colours: i } = t, n = Tt(e.subtask.appearance), o = ne(n, mt(i, t, e.subtask.task, e.subtask.id), i);
|
|
1495
1500
|
if (i.forced) {
|
|
1496
1501
|
s.strokeStyle = i.active, s.lineWidth = 2, s.strokeRect(e.outerFrom - 2, e.y - 2, Math.max(1, e.outerTo - e.outerFrom) + 4, e.height + 4);
|
|
1497
1502
|
return;
|
|
1498
1503
|
}
|
|
1499
|
-
s.globalAlpha =
|
|
1504
|
+
s.globalAlpha = Mi, s.fillStyle = o.onDark ? i.onAccent : i.text, s.fillRect(e.outerFrom, e.y, Math.max(1, e.outerTo - e.outerFrom), e.height), s.globalAlpha = 1;
|
|
1500
1505
|
}
|
|
1501
|
-
const
|
|
1502
|
-
function
|
|
1506
|
+
const Mi = 0.2;
|
|
1507
|
+
function Ti(s, t) {
|
|
1503
1508
|
const e = t.selectedTask;
|
|
1504
1509
|
if (e !== null) {
|
|
1505
1510
|
s.strokeStyle = t.colours.text;
|
|
@@ -1512,30 +1517,30 @@ function fi(s, t) {
|
|
|
1512
1517
|
}
|
|
1513
1518
|
}
|
|
1514
1519
|
}
|
|
1515
|
-
const
|
|
1516
|
-
function
|
|
1517
|
-
if (!(t > 2 *
|
|
1518
|
-
const e =
|
|
1520
|
+
const vt = 32, Si = 18;
|
|
1521
|
+
function Ne(s, t) {
|
|
1522
|
+
if (!(t > 2 * vt)) return 0;
|
|
1523
|
+
const e = vt - s, i = s - (t - vt), n = Math.max(e, i);
|
|
1519
1524
|
if (n <= 0) return 0;
|
|
1520
|
-
const o = Math.min(1, n /
|
|
1525
|
+
const o = Math.min(1, n / vt), r = Si * o * o;
|
|
1521
1526
|
return e > 0 ? -r : r;
|
|
1522
1527
|
}
|
|
1523
|
-
function
|
|
1528
|
+
function ct(s, t, e) {
|
|
1524
1529
|
const i = (n, o) => {
|
|
1525
|
-
const r =
|
|
1530
|
+
const r = it(n);
|
|
1526
1531
|
return n.lane === o.lane && r.from < o.to && o.from < r.to;
|
|
1527
1532
|
};
|
|
1528
1533
|
return e.some((n) => i(s, n) && !(t !== null && i(t, n)));
|
|
1529
1534
|
}
|
|
1530
|
-
function
|
|
1535
|
+
function Ii(s, t, e, i) {
|
|
1531
1536
|
const n = /* @__PURE__ */ new Set();
|
|
1532
1537
|
if (i === void 0) return n;
|
|
1533
1538
|
for (const o of s)
|
|
1534
1539
|
o !== e && (i(t, o) || n.add(o));
|
|
1535
1540
|
return n;
|
|
1536
1541
|
}
|
|
1537
|
-
const
|
|
1538
|
-
function
|
|
1542
|
+
const Be = "\0placing", Pe = /* @__PURE__ */ new Set();
|
|
1543
|
+
function Pt(s) {
|
|
1539
1544
|
switch (s.kind) {
|
|
1540
1545
|
case "subtask":
|
|
1541
1546
|
return `subtask:${s.subtask.id}:${s.part}`;
|
|
@@ -1549,8 +1554,8 @@ function xt(s) {
|
|
|
1549
1554
|
return "nothing";
|
|
1550
1555
|
}
|
|
1551
1556
|
}
|
|
1552
|
-
const
|
|
1553
|
-
class
|
|
1557
|
+
const Ge = 3, Li = 10, Ai = 600;
|
|
1558
|
+
class Ci {
|
|
1554
1559
|
constructor(t) {
|
|
1555
1560
|
this.host = t;
|
|
1556
1561
|
}
|
|
@@ -1577,7 +1582,7 @@ class vi {
|
|
|
1577
1582
|
/** The finger's long press, armed by a touch on a bar that may be moved.
|
|
1578
1583
|
`armed` is whether the press may still turn into a grab - and, once it
|
|
1579
1584
|
has, whether the `contextmenu` Android fires for it is the grab's. */
|
|
1580
|
-
press =
|
|
1585
|
+
press = Ps((t) => this.grab(t));
|
|
1581
1586
|
armed = !1;
|
|
1582
1587
|
hover = { kind: "nothing" };
|
|
1583
1588
|
/** Where the pointer rests on the plot while nothing is being dragged - or,
|
|
@@ -1616,9 +1621,9 @@ class vi {
|
|
|
1616
1621
|
ghostSummary() {
|
|
1617
1622
|
const t = this.gesture;
|
|
1618
1623
|
if (t.kind !== "edit" && t.kind !== "place") return null;
|
|
1619
|
-
const e =
|
|
1624
|
+
const e = cs(this.host.view.viewport(), t.ghost);
|
|
1620
1625
|
if (e === null) return null;
|
|
1621
|
-
const i = this.ghostFindings(t.ghost, this.ghostHome(t)), n = t.kind === "edit" && (t.mode === "leadIn" || t.mode === "leadOut"), o = n ?
|
|
1626
|
+
const i = this.ghostFindings(t.ghost, this.ghostHome(t)), n = t.kind === "edit" && (t.mode === "leadIn" || t.mode === "leadOut"), o = n ? it(t.ghost) : t.ghost;
|
|
1622
1627
|
return {
|
|
1623
1628
|
refused: this.refused,
|
|
1624
1629
|
refusedLanes: [...t.refused],
|
|
@@ -1670,7 +1675,7 @@ class vi {
|
|
|
1670
1675
|
group: i,
|
|
1671
1676
|
timer: setTimeout(() => {
|
|
1672
1677
|
this.resting = null, e.openForGesture = /* @__PURE__ */ new Set([...e.openForGesture, i]), this.host.viewChanged();
|
|
1673
|
-
},
|
|
1678
|
+
}, Ai)
|
|
1674
1679
|
}));
|
|
1675
1680
|
}
|
|
1676
1681
|
stopResting() {
|
|
@@ -1698,9 +1703,9 @@ class vi {
|
|
|
1698
1703
|
gesture that cannot change a lane at all asks nothing: the intents the
|
|
1699
1704
|
caller handles decide whether the question exists. */
|
|
1700
1705
|
askRefused(t, e) {
|
|
1701
|
-
if (!this.host.view.options.intents.includes(e === null ? "place" : "lane")) return
|
|
1706
|
+
if (!this.host.view.options.intents.includes(e === null ? "place" : "lane")) return Pe;
|
|
1702
1707
|
const i = this.host.data.lanes.map((n) => n.id);
|
|
1703
|
-
return
|
|
1708
|
+
return Ii(i, t, e, this.host.handlers().canMoveTo);
|
|
1704
1709
|
}
|
|
1705
1710
|
/** What a press at a point would start, given the intents the caller handles. */
|
|
1706
1711
|
modeAt(t, e) {
|
|
@@ -1709,10 +1714,10 @@ class vi {
|
|
|
1709
1714
|
for (let o = i.boxes.length - 1; o >= 0; o--) {
|
|
1710
1715
|
const r = i.boxes[o];
|
|
1711
1716
|
if (n.includes("stretch")) {
|
|
1712
|
-
const a =
|
|
1717
|
+
const a = Zs(r, t, e);
|
|
1713
1718
|
if (a !== null) return { mode: a === "from" ? "stretch-from" : "stretch-to", subtask: r.subtask };
|
|
1714
1719
|
}
|
|
1715
|
-
if (
|
|
1720
|
+
if (es(r, t, e) !== null)
|
|
1716
1721
|
return n.includes("move") || n.includes("lane") ? { mode: "move", subtask: r.subtask } : { mode: "pan", subtask: r.subtask };
|
|
1717
1722
|
}
|
|
1718
1723
|
return { mode: "pan", subtask: null };
|
|
@@ -1726,7 +1731,7 @@ class vi {
|
|
|
1726
1731
|
}
|
|
1727
1732
|
const n = this.gesture;
|
|
1728
1733
|
if (n.kind === "pending" && n.pointerId === t.pointerId) {
|
|
1729
|
-
if (Math.hypot(e - n.x0, i - n.y0) < (t.pointerType === "touch" ?
|
|
1734
|
+
if (Math.hypot(e - n.x0, i - n.y0) < (t.pointerType === "touch" ? Li : Ge)) return;
|
|
1730
1735
|
n.mode === "pan" || n.subtask === null ? (this.gesture = { kind: "pan", pointerId: n.pointerId, lastX: n.x0, lastY: n.y0 }, this.setCursor("grabbing")) : this.startEdit(n, n.mode, n.subtask);
|
|
1731
1736
|
}
|
|
1732
1737
|
const o = this.gesture;
|
|
@@ -1755,7 +1760,7 @@ class vi {
|
|
|
1755
1760
|
ghost: i,
|
|
1756
1761
|
/* Asked here, once, and drawn from the first frame of the drag: the
|
|
1757
1762
|
lanes that are closed are marked before the pointer reaches one. */
|
|
1758
|
-
refused: e === "move" ? this.askRefused(i, i.lane) :
|
|
1763
|
+
refused: e === "move" ? this.askRefused(i, i.lane) : Pe
|
|
1759
1764
|
}, this.setCursor(e === "move" ? "grabbing" : "ew-resize");
|
|
1760
1765
|
}
|
|
1761
1766
|
/** The finger has been held on a bar: the bar is grabbed, unless the finger
|
|
@@ -1805,7 +1810,7 @@ class vi {
|
|
|
1805
1810
|
this.panFrame = 0;
|
|
1806
1811
|
const e = this.gesture;
|
|
1807
1812
|
if (e.kind !== "edit" && e.kind !== "place") return;
|
|
1808
|
-
const i = this.host.view, { x: n, y: o } = this.local(this.lastClient.x, this.lastClient.y), r =
|
|
1813
|
+
const i = this.host.view, { x: n, y: o } = this.local(this.lastClient.x, this.lastClient.y), r = Ne(n, i.width), a = Ne(o, i.height);
|
|
1809
1814
|
if (r === 0 && a === 0) return;
|
|
1810
1815
|
const l = i.pan(r, a);
|
|
1811
1816
|
if (l.moved) {
|
|
@@ -1833,7 +1838,7 @@ class vi {
|
|
|
1833
1838
|
refreshHover() {
|
|
1834
1839
|
if (!this.idle || this.hoverKey === "nothing" || this.byKeyboard) return;
|
|
1835
1840
|
const { x: t, y: e } = this.hoverPoint, i = this.host.view.hitAt(t, e);
|
|
1836
|
-
this.hover = i, this.hoverKey =
|
|
1841
|
+
this.hover = i, this.hoverKey = Pt(i);
|
|
1837
1842
|
}
|
|
1838
1843
|
pointerLeave() {
|
|
1839
1844
|
this.gesture.kind !== "none" || this.byKeyboard || this.setHover({ kind: "nothing" }, "nothing");
|
|
@@ -1877,7 +1882,7 @@ class vi {
|
|
|
1877
1882
|
this.host.select(r, o.kind === "subtask" ? o.subtask.id : null), this.report("click", o, t, e, i, n);
|
|
1878
1883
|
}
|
|
1879
1884
|
hoverAt(t, e, i, n) {
|
|
1880
|
-
const o = this.host.view.hitAt(i, n), r =
|
|
1885
|
+
const o = this.host.view.hitAt(i, n), r = Pt(o), { mode: a } = this.modeAt(i, n);
|
|
1881
1886
|
if (this.setCursor(a === "move" ? "grab" : a === "stretch-from" || a === "stretch-to" ? "ew-resize" : "default"), this.hoverPoint = { x: i, y: n }, r === this.hoverKey) {
|
|
1882
1887
|
(o.kind === "subtask" || o.kind === "dependency" || o.kind === "milestone") && this.host.hoverChanged();
|
|
1883
1888
|
return;
|
|
@@ -1888,7 +1893,7 @@ class vi {
|
|
|
1888
1893
|
pointer's would be - and reported to nobody, since `onInteraction`
|
|
1889
1894
|
speaks of pointer positions. `nothing` hands the hover back. */
|
|
1890
1895
|
setKeyboardHover(t, e) {
|
|
1891
|
-
this.byKeyboard = t.kind !== "nothing", this.hoverPoint = e, this.hover = t, this.hoverKey =
|
|
1896
|
+
this.byKeyboard = t.kind !== "nothing", this.hoverPoint = e, this.hover = t, this.hoverKey = Pt(t), this.host.interactionChanged();
|
|
1892
1897
|
}
|
|
1893
1898
|
setHover(t, e) {
|
|
1894
1899
|
e !== this.hoverKey && (this.hoverKey = e, this.hover = t, this.host.hoverChanged());
|
|
@@ -1938,8 +1943,8 @@ class vi {
|
|
|
1938
1943
|
const o = this.onLane(i);
|
|
1939
1944
|
if (o === null) return { ghost: null, refused: !1, blocked: !1 };
|
|
1940
1945
|
if (n.has(o)) return { ghost: null, refused: !0, blocked: !1 };
|
|
1941
|
-
const r = { ...this.askedFor(t, o, e), id:
|
|
1942
|
-
return
|
|
1946
|
+
const r = { ...this.askedFor(t, o, e), id: Be };
|
|
1947
|
+
return ct(r, null, this.host.data.blocked) ? { ghost: null, refused: !1, blocked: !0 } : { ghost: r, refused: !1, blocked: !1 };
|
|
1943
1948
|
}
|
|
1944
1949
|
/** The dragged item as a subtask, under the caller's key for it - not the
|
|
1945
1950
|
internal sentinel: the rule is asked about the thing the application says
|
|
@@ -1996,7 +2001,7 @@ class vi {
|
|
|
1996
2001
|
blocked time takes the ghost along again. */
|
|
1997
2002
|
heldGhost(t, e, i) {
|
|
1998
2003
|
const n = this.ghostFor(t, e, i);
|
|
1999
|
-
return this.blocked =
|
|
2004
|
+
return this.blocked = ct(n, t.subtask, this.host.data.blocked), this.blocked ? t.ghost : n;
|
|
2000
2005
|
}
|
|
2001
2006
|
ghostFor(t, e, i) {
|
|
2002
2007
|
const n = this.host.view, o = t.subtask, r = this.snapStep(), a = n.options.intents, l = this.snapInside(n.timeAt(e), r);
|
|
@@ -2004,7 +2009,7 @@ class vi {
|
|
|
2004
2009
|
case "move": {
|
|
2005
2010
|
let d = o.from;
|
|
2006
2011
|
const h = n.viewport().scale, c = h.fromPx(e) - t.t0;
|
|
2007
|
-
a.includes("move") && Math.abs(c * h.m) >=
|
|
2012
|
+
a.includes("move") && Math.abs(c * h.m) >= Ge && (d = this.shifted(o.from, c, r));
|
|
2008
2013
|
let f = t.ghost.lane;
|
|
2009
2014
|
if (a.includes("lane")) {
|
|
2010
2015
|
const g = this.onLane(i) ?? f;
|
|
@@ -2014,9 +2019,9 @@ class vi {
|
|
|
2014
2019
|
return { ...o, from: d, to: d + (o.to - o.from), lane: f };
|
|
2015
2020
|
}
|
|
2016
2021
|
case "stretch-from":
|
|
2017
|
-
return { ...o, from: Math.min(l, o.to - Math.max(r.step,
|
|
2022
|
+
return { ...o, from: Math.min(l, o.to - Math.max(r.step, X)) };
|
|
2018
2023
|
case "stretch-to":
|
|
2019
|
-
return { ...o, to: Math.max(l, o.from + Math.max(r.step,
|
|
2024
|
+
return { ...o, to: Math.max(l, o.from + Math.max(r.step, X)) };
|
|
2020
2025
|
case "leadIn":
|
|
2021
2026
|
return { ...o, leadIn: Math.max(0, o.from - l) };
|
|
2022
2027
|
case "leadOut":
|
|
@@ -2027,15 +2032,15 @@ class vi {
|
|
|
2027
2032
|
a start this way, and a key by one step of the raster - one arithmetic,
|
|
2028
2033
|
so a key proposes exactly what a drag of that length would. */
|
|
2029
2034
|
shifted(t, e, i) {
|
|
2030
|
-
const n =
|
|
2035
|
+
const n = bt(this.host.view.options.calendar), o = Y(t, n) + e, r = ut(o, n);
|
|
2031
2036
|
return this.snapInside(r, i);
|
|
2032
2037
|
}
|
|
2033
2038
|
/** Snapped - and, where the raster lands in time the calendar removes, moved
|
|
2034
2039
|
on to the seam, where time counts again. An intent never asks for a time
|
|
2035
2040
|
nobody works. */
|
|
2036
2041
|
snapInside(t, e) {
|
|
2037
|
-
const i =
|
|
2038
|
-
return n.intervals.length === 0 ? i :
|
|
2042
|
+
const i = Ys(t, e, this.host.view.options.timeZone), n = bt(this.host.view.options.calendar);
|
|
2043
|
+
return n.intervals.length === 0 ? i : Wt(Y(i, n), n);
|
|
2039
2044
|
}
|
|
2040
2045
|
intentsOf(t, e, i) {
|
|
2041
2046
|
const n = [], o = this.host.view.options.intents, r = t.id;
|
|
@@ -2055,22 +2060,22 @@ class vi {
|
|
|
2055
2060
|
keeps a plan of hundreds of tasks fluid while a drag runs, since this is
|
|
2056
2061
|
computed on every pointer movement. */
|
|
2057
2062
|
ghostFindings(t, e) {
|
|
2058
|
-
const i = this.host.data, n = (h) => h.lane === t.lane || h.lane === e, r = [...i.subtasks.filter((h) => h.id !== t.id && n(h)), t], a = (h) => h.first === t.id || h.second === t.id, l = i.dependencies.filter((h) => h.from === t.id || h.to === t.id), d = t.id ===
|
|
2059
|
-
return { overlaps:
|
|
2063
|
+
const i = this.host.data, n = (h) => h.lane === t.lane || h.lane === e, r = [...i.subtasks.filter((h) => h.id !== t.id && n(h)), t], a = (h) => h.first === t.id || h.second === t.id, l = i.dependencies.filter((h) => h.from === t.id || h.to === t.id), d = t.id === Be ? i.subtasks : i.subtasks.map((h) => h.id === t.id ? t : h);
|
|
2064
|
+
return { overlaps: Jt(r).filter(a), violated: Qt(d, l) };
|
|
2060
2065
|
}
|
|
2061
2066
|
}
|
|
2062
|
-
function
|
|
2067
|
+
function Di(s, t) {
|
|
2063
2068
|
const e = /* @__PURE__ */ new Map();
|
|
2064
2069
|
for (const i of t) {
|
|
2065
|
-
const n = s.slots.get(i.lane), o = n === void 0 ? null :
|
|
2070
|
+
const n = s.slots.get(i.lane), o = n === void 0 ? null : nt(s, n.top);
|
|
2066
2071
|
if (o === null) continue;
|
|
2067
2072
|
const r = s.rows.indexOf(o);
|
|
2068
2073
|
e.set(r, [...e.get(r) ?? [], i]);
|
|
2069
2074
|
}
|
|
2070
2075
|
return [...e.entries()].sort(([i], [n]) => i - n).map(([, i]) => i.sort((n, o) => n.from - o.from || n.to - o.to));
|
|
2071
2076
|
}
|
|
2072
|
-
const
|
|
2073
|
-
function
|
|
2077
|
+
const He = (s, t) => t < s.from ? s.from - t : t > s.to ? t - s.to : 0;
|
|
2078
|
+
function _i(s, t, e, i) {
|
|
2074
2079
|
let n = -1, o = -1;
|
|
2075
2080
|
for (let d = 0; d < s.length && t !== null && n < 0; d++)
|
|
2076
2081
|
o = s[d].findIndex((h) => h.id === t), o >= 0 && (n = d);
|
|
@@ -2101,11 +2106,11 @@ function wi(s, t, e, i) {
|
|
|
2101
2106
|
const d = s[e === "up" ? n - 1 : n + 1];
|
|
2102
2107
|
if (d === void 0) return a;
|
|
2103
2108
|
const h = (a.from + a.to) / 2;
|
|
2104
|
-
return d.reduce((c, f) =>
|
|
2109
|
+
return d.reduce((c, f) => He(f, h) < He(c, h) ? f : c);
|
|
2105
2110
|
}
|
|
2106
2111
|
}
|
|
2107
2112
|
}
|
|
2108
|
-
function
|
|
2113
|
+
function Oi(s, t, e, i) {
|
|
2109
2114
|
if (e.kind === "milestone") return e;
|
|
2110
2115
|
if (e.kind === "dependency") {
|
|
2111
2116
|
const o = s.find((a) => a.id === e.id), r = o === void 0 ? void 0 : i === "out" ? o.to : o.from;
|
|
@@ -2116,7 +2121,7 @@ function bi(s, t, e, i) {
|
|
|
2116
2121
|
);
|
|
2117
2122
|
return n === void 0 ? e : { kind: "dependency", id: n.id };
|
|
2118
2123
|
}
|
|
2119
|
-
const
|
|
2124
|
+
const yt = "\0milestone:", Fi = 150, $i = {
|
|
2120
2125
|
ArrowRight: "next",
|
|
2121
2126
|
ArrowLeft: "previous",
|
|
2122
2127
|
ArrowUp: "up",
|
|
@@ -2126,7 +2131,7 @@ const kt = "\0milestone:", Mi = 150, Ti = {
|
|
|
2126
2131
|
PageDown: "pageNext",
|
|
2127
2132
|
PageUp: "pagePrevious"
|
|
2128
2133
|
};
|
|
2129
|
-
class
|
|
2134
|
+
class Ei {
|
|
2130
2135
|
constructor(t) {
|
|
2131
2136
|
this.host = t;
|
|
2132
2137
|
}
|
|
@@ -2156,28 +2161,28 @@ class Si {
|
|
|
2156
2161
|
const o = this.active();
|
|
2157
2162
|
if (o === null) return !1;
|
|
2158
2163
|
const r = this.host.data, a = i ? !t.shiftKey : t.key === "]";
|
|
2159
|
-
return this.show(
|
|
2164
|
+
return this.show(Oi(r.dependencies, r.subtaskById, o, a ? "out" : "back")), !0;
|
|
2160
2165
|
}
|
|
2161
2166
|
if (t.ctrlKey) return !1;
|
|
2162
2167
|
if (t.altKey) return this.edit(t);
|
|
2163
2168
|
if (t.key === "Escape")
|
|
2164
2169
|
return e.byKeyboard ? (this.blur(), !0) : !1;
|
|
2165
2170
|
if (t.key === "Enter" || t.key === " ") return this.select();
|
|
2166
|
-
const n = t.shiftKey ? void 0 :
|
|
2171
|
+
const n = t.shiftKey ? void 0 : $i[t.key];
|
|
2167
2172
|
return n === void 0 ? !1 : (this.walk(n), !0);
|
|
2168
2173
|
}
|
|
2169
2174
|
walk(t) {
|
|
2170
|
-
const { data: e, view: i } = this.host, n = this.active(), o = n === null ? null : n.kind === "subtask" ? n.id : n.kind === "milestone" ?
|
|
2171
|
-
let a =
|
|
2175
|
+
const { data: e, view: i } = this.host, n = this.active(), o = n === null ? null : n.kind === "subtask" ? n.id : n.kind === "milestone" ? yt + n.id : e.dependencies.find((d) => d.id === n.id)?.from ?? null, r = [...e.subtasks, ...e.milestones.map((d) => ({ id: yt + d.id, lane: d.lane, from: d.at, to: d.at }))];
|
|
2176
|
+
let a = Di(i.rows, r);
|
|
2172
2177
|
if (o === null) {
|
|
2173
2178
|
const d = a.filter((h) => {
|
|
2174
|
-
const c =
|
|
2179
|
+
const c = Z(i.viewport(), h[0].lane);
|
|
2175
2180
|
return c !== null && c.top + c.height > 0 && c.top < i.height;
|
|
2176
2181
|
});
|
|
2177
2182
|
d.length > 0 && (a = d);
|
|
2178
2183
|
}
|
|
2179
|
-
const l =
|
|
2180
|
-
l !== null && this.show(l.id.startsWith(
|
|
2184
|
+
const l = _i(a, o, t, this.host.visibleDomain());
|
|
2185
|
+
l !== null && this.show(l.id.startsWith(yt) ? { kind: "milestone", id: l.id.slice(yt.length) } : { kind: "subtask", id: l.id });
|
|
2181
2186
|
}
|
|
2182
2187
|
/** Space and Enter select as a click does: the whole task, and the subtask. */
|
|
2183
2188
|
select() {
|
|
@@ -2200,13 +2205,13 @@ class Si {
|
|
|
2200
2205
|
const c = (g) => ({ ...n, from: g, to: g + (n.to - n.from) });
|
|
2201
2206
|
let f = n.from;
|
|
2202
2207
|
for (let g = 0; g < 1e3; g++) {
|
|
2203
|
-
const
|
|
2204
|
-
if (
|
|
2208
|
+
const w = o.shifted(f, i * l.step, l);
|
|
2209
|
+
if (w === f || (f = w, !ct(c(f), n, d))) break;
|
|
2205
2210
|
}
|
|
2206
|
-
f !== n.from && !
|
|
2211
|
+
f !== n.from && !ct(c(f), n, d) && (h = { kind: "move", subtask: n.id, from: f, to: c(f).to });
|
|
2207
2212
|
} else if (t.shiftKey && r.includes("stretch")) {
|
|
2208
|
-
const c = Math.max(o.shifted(n.to, i * l.step, l), n.from + Math.max(l.step,
|
|
2209
|
-
c !== n.to && !
|
|
2213
|
+
const c = Math.max(o.shifted(n.to, i * l.step, l), n.from + Math.max(l.step, X));
|
|
2214
|
+
c !== n.to && !ct({ ...n, to: c }, n, d) && (h = { kind: "stretch", subtask: n.id, from: n.from, to: c });
|
|
2210
2215
|
}
|
|
2211
2216
|
return o.byKeyboard = !0, h !== null && this.host.handlers().onIntent?.(h), this.scheduleReadout(), !0;
|
|
2212
2217
|
}
|
|
@@ -2245,7 +2250,7 @@ class Si {
|
|
|
2245
2250
|
return a === void 0 ? null : { x0: a.outerFrom, x1: a.outerTo, y0: a.y, y1: a.y + a.height };
|
|
2246
2251
|
}
|
|
2247
2252
|
if (t.kind === "milestone") {
|
|
2248
|
-
const a = this.host.data.milestones.find((d) => d.id === t.id), l = a === void 0 ? null :
|
|
2253
|
+
const a = this.host.data.milestones.find((d) => d.id === t.id), l = a === void 0 ? null : se(e.viewport(), a);
|
|
2249
2254
|
return l === null ? null : { x0: l.x - l.half, x1: l.x + l.half, y0: l.y - l.half, y1: l.y + l.half };
|
|
2250
2255
|
}
|
|
2251
2256
|
const n = this.host.data.dependencies.find((a) => a.id === t.id), o = n === void 0 ? void 0 : i(n.from), r = n === void 0 ? void 0 : i(n.to);
|
|
@@ -2282,20 +2287,20 @@ class Si {
|
|
|
2282
2287
|
if (!this.host.gestures.byKeyboard) return;
|
|
2283
2288
|
const e = this.host.data.tooltipTargetFor(t);
|
|
2284
2289
|
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());
|
|
2285
|
-
},
|
|
2290
|
+
}, Fi);
|
|
2286
2291
|
}
|
|
2287
2292
|
/** Unmount: no readout after it. */
|
|
2288
2293
|
stop() {
|
|
2289
2294
|
this.timer !== null && clearTimeout(this.timer), this.timer = null;
|
|
2290
2295
|
}
|
|
2291
2296
|
}
|
|
2292
|
-
const
|
|
2293
|
-
function
|
|
2297
|
+
const st = (s) => JSON.stringify([s.domain ?? null, [...s.folded ?? []].sort()]);
|
|
2298
|
+
function xi(s, t) {
|
|
2294
2299
|
if (t.size === 0 || s.folded === void 0) return s;
|
|
2295
2300
|
const e = s.folded.filter((i) => t.has(i));
|
|
2296
2301
|
return e.length === s.folded.length ? s : { ...s.domain ? { domain: s.domain } : {}, ...e.length ? { folded: e } : {} };
|
|
2297
2302
|
}
|
|
2298
|
-
function
|
|
2303
|
+
function Ri(s, t, e = (i) => i) {
|
|
2299
2304
|
if (s.length === 0) return null;
|
|
2300
2305
|
let i = 1 / 0, n = -1 / 0;
|
|
2301
2306
|
for (const a of s)
|
|
@@ -2304,14 +2309,14 @@ function Li(s, t, e = (i) => i) {
|
|
|
2304
2309
|
const o = Math.min(t.max, Math.max(t.min, n - i)), r = (i + n) / 2;
|
|
2305
2310
|
return [r - o / 2, r + o / 2];
|
|
2306
2311
|
}
|
|
2307
|
-
const
|
|
2312
|
+
const Ye = {
|
|
2308
2313
|
width: 0,
|
|
2309
2314
|
height: 0,
|
|
2310
2315
|
scrollY: 0,
|
|
2311
2316
|
headers: [],
|
|
2312
2317
|
days: [],
|
|
2313
2318
|
ticks: [],
|
|
2314
|
-
step:
|
|
2319
|
+
step: Ut,
|
|
2315
2320
|
fontScale: 1,
|
|
2316
2321
|
ghost: null,
|
|
2317
2322
|
grips: [],
|
|
@@ -2323,9 +2328,9 @@ const Pe = {
|
|
|
2323
2328
|
spoken: null,
|
|
2324
2329
|
summary: { lanes: 0, subtasks: 0, from: 0, to: 0, overlaps: 0, violated: 0, blocked: 0, milestones: 0 }
|
|
2325
2330
|
};
|
|
2326
|
-
class
|
|
2327
|
-
data = new
|
|
2328
|
-
view = new
|
|
2331
|
+
class Ni {
|
|
2332
|
+
data = new si(() => this.viewChanged());
|
|
2333
|
+
view = new un(this.data);
|
|
2329
2334
|
gestures;
|
|
2330
2335
|
keys;
|
|
2331
2336
|
handlersNow = {};
|
|
@@ -2366,10 +2371,10 @@ class Ai {
|
|
|
2366
2371
|
movePending = !1;
|
|
2367
2372
|
domainFrame = 0;
|
|
2368
2373
|
unsubscribeTheme = null;
|
|
2369
|
-
snapshot =
|
|
2374
|
+
snapshot = Ye;
|
|
2370
2375
|
listeners = /* @__PURE__ */ new Set();
|
|
2371
2376
|
constructor(t = {}) {
|
|
2372
|
-
this.folded = t.folded ?? [], this.domainInView = t.domain ?? null, this.domainInView !== null && this.view.showWall(this.domainInView), this.viewNow = this.currentView(), this.gestures = new
|
|
2377
|
+
this.folded = t.folded ?? [], this.domainInView = t.domain ?? null, this.domainInView !== null && this.view.showWall(this.domainInView), this.viewNow = this.currentView(), this.gestures = new Ci({
|
|
2373
2378
|
data: this.data,
|
|
2374
2379
|
view: this.view,
|
|
2375
2380
|
plotElement: () => this.plot,
|
|
@@ -2380,7 +2385,7 @@ class Ai {
|
|
|
2380
2385
|
viewMoved: (e) => this.viewMoved(e),
|
|
2381
2386
|
interactionChanged: () => this.interactionChanged(),
|
|
2382
2387
|
hoverChanged: () => this.hoverChanged()
|
|
2383
|
-
}), this.keys = new
|
|
2388
|
+
}), this.keys = new Ei({
|
|
2384
2389
|
data: this.data,
|
|
2385
2390
|
view: this.view,
|
|
2386
2391
|
gestures: this.gestures,
|
|
@@ -2430,7 +2435,7 @@ class Ai {
|
|
|
2430
2435
|
getView = () => this.viewNow;
|
|
2431
2436
|
/** Goes to a whole view (`setView`); what it leaves out goes back to its default. */
|
|
2432
2437
|
applyView(t) {
|
|
2433
|
-
|
|
2438
|
+
st(t) !== st(this.viewNow) && (this.actedOn = !0, this.folded = t.folded ?? [], this.setDomain(t.domain ?? null));
|
|
2434
2439
|
}
|
|
2435
2440
|
/** Puts a span of two wall-clock instants in view; null shows the
|
|
2436
2441
|
subtasks' extent. */
|
|
@@ -2449,14 +2454,14 @@ class Ai {
|
|
|
2449
2454
|
this.actedOn = !0, this.folded = [], this.viewChanged();
|
|
2450
2455
|
};
|
|
2451
2456
|
currentView() {
|
|
2452
|
-
return
|
|
2457
|
+
return xi(
|
|
2453
2458
|
{ ...this.domainInView === null ? {} : { domain: this.domainInView }, ...this.folded.length > 0 ? { folded: this.folded } : {} },
|
|
2454
2459
|
new Set(this.data.groups.map((t) => t.id))
|
|
2455
2460
|
);
|
|
2456
2461
|
}
|
|
2457
2462
|
publishView() {
|
|
2458
2463
|
const t = this.currentView();
|
|
2459
|
-
if (
|
|
2464
|
+
if (st(t) !== st(this.viewNow)) {
|
|
2460
2465
|
this.viewNow = t;
|
|
2461
2466
|
for (const e of this.viewListeners) e();
|
|
2462
2467
|
}
|
|
@@ -2464,13 +2469,13 @@ class Ai {
|
|
|
2464
2469
|
/** The subtasks' extent within the zoom limits, while the view names no
|
|
2465
2470
|
span - and the local day of today while there is no work to show. */
|
|
2466
2471
|
fit() {
|
|
2467
|
-
const t = this.view.options.calendar, e =
|
|
2472
|
+
const t = this.view.options.calendar, e = Ri(this.data.subtasks, this.view.options.zoomLimits, (l) => Y(l, t));
|
|
2468
2473
|
if (e !== null) {
|
|
2469
2474
|
this.view.domain = e, this.fitted = !0;
|
|
2470
2475
|
return;
|
|
2471
2476
|
}
|
|
2472
|
-
const i =
|
|
2473
|
-
|
|
2477
|
+
const i = this.view.options.timeZone, n = Gs(Date.now(), i), { year: o, month: r, day: a } = We(n, i);
|
|
2478
|
+
this.view.showWall([n.getTime(), Gt({ year: o, month: r, day: a + 1 }, i).getTime()]);
|
|
2474
2479
|
}
|
|
2475
2480
|
/** `undefined`: the scene keeps the selection itself. */
|
|
2476
2481
|
setControlledTask(t) {
|
|
@@ -2494,7 +2499,7 @@ class Ai {
|
|
|
2494
2499
|
/* DOM binding */
|
|
2495
2500
|
/* ---------------------------------------------------------------- */
|
|
2496
2501
|
bind(t, e, i, n) {
|
|
2497
|
-
this.root = t, this.plot = e, this.dataCanvas = i, this.overlayCanvas = n, this.unsubscribeTheme =
|
|
2502
|
+
this.root = t, this.plot = e, this.dataCanvas = i, this.overlayCanvas = n, this.unsubscribeTheme = Fs(() => {
|
|
2498
2503
|
this.colours = null, this.dataStale = !0, this.requestDraw();
|
|
2499
2504
|
}), this.viewChanged();
|
|
2500
2505
|
}
|
|
@@ -2509,7 +2514,7 @@ class Ai {
|
|
|
2509
2514
|
this.listeners.delete(t);
|
|
2510
2515
|
});
|
|
2511
2516
|
getSnapshot = () => this.snapshot;
|
|
2512
|
-
getServerSnapshot = () =>
|
|
2517
|
+
getServerSnapshot = () => Ye;
|
|
2513
2518
|
/* ---------------------------------------------------------------- */
|
|
2514
2519
|
/* Changes */
|
|
2515
2520
|
/* ---------------------------------------------------------------- */
|
|
@@ -2587,12 +2592,12 @@ class Ai {
|
|
|
2587
2592
|
if (t.width <= 0) return [];
|
|
2588
2593
|
const e = this.colours;
|
|
2589
2594
|
return t.boxes.flatMap((i) => {
|
|
2590
|
-
if (!
|
|
2591
|
-
const n =
|
|
2595
|
+
if (!Ht(i, t.width, t.height)) return [];
|
|
2596
|
+
const n = tn(i, t.width);
|
|
2592
2597
|
if (n === null) return [];
|
|
2593
|
-
const o = e === null ? !0 :
|
|
2594
|
-
|
|
2595
|
-
|
|
2598
|
+
const o = e === null ? !0 : ne(
|
|
2599
|
+
Tt(i.subtask.appearance),
|
|
2600
|
+
mt(e, { selectedTask: this.selectedTask, selectedSubtask: this.selectedSubtask }, i.subtask.task, i.subtask.id),
|
|
2596
2601
|
e
|
|
2597
2602
|
).onDark;
|
|
2598
2603
|
return [{ subtask: i.subtask, ...n, dark: o }];
|
|
@@ -2604,7 +2609,7 @@ class Ai {
|
|
|
2604
2609
|
const t = this.view, [e, i] = this.visibleDomain();
|
|
2605
2610
|
return {
|
|
2606
2611
|
lanes: this.data.lanes.length,
|
|
2607
|
-
subtasks: t.boxes.filter((n) =>
|
|
2612
|
+
subtasks: t.boxes.filter((n) => Ht(n, t.width, t.height)).length,
|
|
2608
2613
|
from: e,
|
|
2609
2614
|
to: i,
|
|
2610
2615
|
overlaps: this.data.overlaps.length,
|
|
@@ -2623,7 +2628,7 @@ class Ai {
|
|
|
2623
2628
|
}
|
|
2624
2629
|
/** The visible span, as two wall-clock instants. */
|
|
2625
2630
|
visibleDomain() {
|
|
2626
|
-
const t = (e) =>
|
|
2631
|
+
const t = (e) => ut(e, this.view.options.calendar);
|
|
2627
2632
|
return [t(this.view.domain[0]), t(this.view.domain[1])];
|
|
2628
2633
|
}
|
|
2629
2634
|
/** A pan or zoom of the planner's goes into the view once per frame,
|
|
@@ -2647,8 +2652,8 @@ class Ai {
|
|
|
2647
2652
|
clientPointOf(t, e) {
|
|
2648
2653
|
const i = this.plot?.getBoundingClientRect();
|
|
2649
2654
|
if (i === void 0) return null;
|
|
2650
|
-
const n = this.view.viewport(), o = e === void 0 ? null :
|
|
2651
|
-
return { x: i.left +
|
|
2655
|
+
const n = this.view.viewport(), o = e === void 0 ? null : Z(n, e), r = o === null ? 0 : o.top + o.height / 2;
|
|
2656
|
+
return { x: i.left + E(n, t), y: i.top + r };
|
|
2652
2657
|
}
|
|
2653
2658
|
/** Whether a lane has a row of its own on a mounted plot: not unknown, not
|
|
2654
2659
|
in a folded group, whose lanes are strips and no rows. */
|
|
@@ -2680,8 +2685,8 @@ class Ai {
|
|
|
2680
2685
|
}
|
|
2681
2686
|
draw() {
|
|
2682
2687
|
if (this.root === null) return;
|
|
2683
|
-
this.colours === null && (this.colours =
|
|
2684
|
-
const { width: t, height: e } = this.view, i = this.dataStale ?
|
|
2688
|
+
this.colours === null && (this.colours = hi(this.root, this.data), this.publish());
|
|
2689
|
+
const { width: t, height: e } = this.view, i = this.dataStale ? $e(this.dataCanvas, t, e) : null, n = $e(this.overlayCanvas, t, e);
|
|
2685
2690
|
if (n === null || t === 0 || this.dataStale && i === null) return;
|
|
2686
2691
|
this.dataStale = !1;
|
|
2687
2692
|
const o = {
|
|
@@ -2694,7 +2699,7 @@ class Ai {
|
|
|
2694
2699
|
hover: this.gestures.hover,
|
|
2695
2700
|
ghost: this.gestures.ghostDrawing()
|
|
2696
2701
|
};
|
|
2697
|
-
i !== null &&
|
|
2702
|
+
i !== null && ci(i, o), ui(n, o);
|
|
2698
2703
|
}
|
|
2699
2704
|
/* ---------------------------------------------------------------- */
|
|
2700
2705
|
/* Gestures, as the component hands them in */
|
|
@@ -2715,19 +2720,19 @@ class Ai {
|
|
|
2715
2720
|
focus = (t) => this.keys.focus(t);
|
|
2716
2721
|
blur = () => this.keys.blur();
|
|
2717
2722
|
}
|
|
2718
|
-
function
|
|
2719
|
-
const { initialView: t, onViewChange: e } = s, [i] =
|
|
2720
|
-
const l = (d) =>
|
|
2723
|
+
function zi(s = {}) {
|
|
2724
|
+
const { initialView: t, onViewChange: e } = s, [i] = dt(() => new Ni(t)), n = V(""), [o] = dt(() => {
|
|
2725
|
+
const l = (d) => xs(Wn, { ...d, scene: i });
|
|
2721
2726
|
return l.displayName = "Schedule", {
|
|
2722
2727
|
Schedule: l,
|
|
2723
|
-
Lane:
|
|
2724
|
-
LaneGroup:
|
|
2725
|
-
Subtasks:
|
|
2726
|
-
Dependencies:
|
|
2727
|
-
BlockedTimes:
|
|
2728
|
-
Milestones:
|
|
2728
|
+
Lane: Xn,
|
|
2729
|
+
LaneGroup: jn,
|
|
2730
|
+
Subtasks: Zn,
|
|
2731
|
+
Dependencies: Jn,
|
|
2732
|
+
BlockedTimes: Qn,
|
|
2733
|
+
Milestones: ti,
|
|
2729
2734
|
setView: (d) => {
|
|
2730
|
-
i.applyView(d), n.current =
|
|
2735
|
+
i.applyView(d), n.current = st(i.getView());
|
|
2731
2736
|
},
|
|
2732
2737
|
setDomain: i.setDomain,
|
|
2733
2738
|
positionAt: (d, h) => i.positionAt(d, h),
|
|
@@ -2740,24 +2745,24 @@ function xi(s = {}) {
|
|
|
2740
2745
|
foldAll: i.foldAll,
|
|
2741
2746
|
unfoldAll: i.unfoldAll
|
|
2742
2747
|
};
|
|
2743
|
-
}), r =
|
|
2744
|
-
return
|
|
2748
|
+
}), r = ze(i.subscribeView, i.getView, i.getView), a = st(r);
|
|
2749
|
+
return q(() => {
|
|
2745
2750
|
n.current !== a && (n.current = a, i.acted && e?.(r));
|
|
2746
|
-
}, [a]),
|
|
2751
|
+
}, [a]), z(() => ({ ...o, view: r }), [o, r]);
|
|
2747
2752
|
}
|
|
2748
2753
|
export {
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2754
|
+
Me as applyIntent,
|
|
2755
|
+
Zt as arrival,
|
|
2756
|
+
jt as departure,
|
|
2757
|
+
Ki as findings,
|
|
2758
|
+
Ue as inBlockedTime,
|
|
2759
|
+
it as occupied,
|
|
2760
|
+
Jt as overlaps,
|
|
2761
|
+
Tt as resolveAppearance,
|
|
2762
|
+
Vi as ripple,
|
|
2763
|
+
qi as shiftTask,
|
|
2764
|
+
Ys as snapTime,
|
|
2765
|
+
Yi as subtaskFromPlace,
|
|
2766
|
+
zi as useSchedule,
|
|
2767
|
+
Qt as violatedDependencies
|
|
2763
2768
|
};
|