@umriss-ui/schedule 0.40.3 → 0.40.4
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 +6 -0
- package/dist/index.d.ts +3 -1
- package/dist/schedule.js +667 -646
- package/docs/llms-full.md +3 -3
- package/package.json +6 -6
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 $t, toWorkingTimeClamped as G, calendarFrom as gt, toWallClock as Gt, MINUTE as q, DAY as U, timeStep as us, workingTimeTicks as fs, HOUR as Ht, LinearScale as ms, resolveColours as ps, removedIntervals as gs, subscribeTheme as ks } from "@umriss-ui/charts";
|
|
4
|
+
import { useContext as Re, createContext as Ne, useRef as Y, useEffect as z, useId as vs, useState as rt, useLayoutEffect as ft, useImperativeHandle as ys, useSyncExternalStore as Pe, useMemo as K, createElement as ws } from "react";
|
|
5
|
+
import { jsxs as $, Fragment as at, jsx as m } from "react/jsx-runtime";
|
|
6
|
+
import { useFormats as Yt, useWording as kt, AngleGlyph as bs, VisuallyHidden as fe } from "@umriss-ui/core";
|
|
7
|
+
function st(s) {
|
|
8
8
|
return { from: s.from - (s.leadIn ?? 0), to: s.to + (s.leadOut ?? 0) };
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function Kt(s, t) {
|
|
11
11
|
return (s.leaves ?? "leadOut") === "main" ? t.to : t.to + (t.leadOut ?? 0);
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function Vt(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 he(s, t) {
|
|
|
27
27
|
return { ...s, lane: t.lane };
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function wi(s, t) {
|
|
31
31
|
return {
|
|
32
32
|
id: t,
|
|
33
33
|
task: s.task,
|
|
@@ -38,10 +38,10 @@ function hi(s, t) {
|
|
|
38
38
|
...s.leadOut === void 0 ? {} : { leadOut: s.leadOut }
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function Wt(s) {
|
|
42
42
|
const t = [], e = /* @__PURE__ */ new Map();
|
|
43
43
|
s.forEach((n, i) => {
|
|
44
|
-
const { from: o, to: r } =
|
|
44
|
+
const { from: o, to: r } = st(n);
|
|
45
45
|
if (!(o < r)) return;
|
|
46
46
|
const a = e.get(n.lane) ?? [];
|
|
47
47
|
a.push({ subtask: n, index: i, from: o, to: r }), e.set(n.lane, a);
|
|
@@ -59,10 +59,10 @@ function Ht(s) {
|
|
|
59
59
|
}
|
|
60
60
|
return t;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function Ms(s) {
|
|
63
63
|
const t = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map();
|
|
64
64
|
for (const n of s) {
|
|
65
|
-
const i =
|
|
65
|
+
const i = st(n), o = e.get(n.lane) ?? [];
|
|
66
66
|
let r = 0;
|
|
67
67
|
if (i.from < i.to) {
|
|
68
68
|
for (const a of o) i.from < a.to && a.from < i.to && r++;
|
|
@@ -72,35 +72,35 @@ function ms(s) {
|
|
|
72
72
|
}
|
|
73
73
|
return t;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function zt(s, t) {
|
|
76
76
|
const e = new Map(s.map((i) => [i.id, i])), n = [];
|
|
77
77
|
for (const i of t) {
|
|
78
78
|
const o = e.get(i.from), r = e.get(i.to);
|
|
79
79
|
if (o === void 0 || r === void 0) continue;
|
|
80
|
-
const a =
|
|
80
|
+
const a = Kt(i, o), l = Vt(i, r), d = a + i.lag - l;
|
|
81
81
|
d > 0 && n.push({ dependency: i.id, departure: a, arrival: l, shortBy: d });
|
|
82
82
|
}
|
|
83
83
|
return n;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function Be(s, t) {
|
|
86
86
|
const e = [];
|
|
87
87
|
for (const n of s) {
|
|
88
|
-
const i =
|
|
88
|
+
const i = st(n);
|
|
89
89
|
for (const o of t)
|
|
90
90
|
o.lane !== n.lane || !(i.from < o.to && o.from < i.to) || e.push({ subtask: n.id, blocked: o.id, lane: o.lane, from: Math.max(i.from, o.from), to: Math.min(i.to, o.to) });
|
|
91
91
|
}
|
|
92
92
|
return e;
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function bi(s, t, e = []) {
|
|
95
95
|
return {
|
|
96
|
-
overlaps:
|
|
97
|
-
violatedDependencies:
|
|
98
|
-
inBlockedTime:
|
|
96
|
+
overlaps: Wt(s),
|
|
97
|
+
violatedDependencies: zt(s, t),
|
|
98
|
+
inBlockedTime: Be(s, e)
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function Mi(s, t, e) {
|
|
102
102
|
if (e.kind === "place") return [];
|
|
103
|
-
const n = new Map(s.map((l) => [l.id,
|
|
103
|
+
const n = new Map(s.map((l) => [l.id, me(l, e)])), i = /* @__PURE__ */ new Map();
|
|
104
104
|
for (const l of t) {
|
|
105
105
|
const d = i.get(l.from) ?? [];
|
|
106
106
|
d.push(l), i.set(l.from, d);
|
|
@@ -114,141 +114,141 @@ function ci(s, t, e) {
|
|
|
114
114
|
if (h.to === e.subtask) continue;
|
|
115
115
|
const c = n.get(h.to);
|
|
116
116
|
if (c === void 0) continue;
|
|
117
|
-
const f =
|
|
117
|
+
const f = Kt(h, d) + h.lag - Vt(h, c);
|
|
118
118
|
if (!(f > 0)) continue;
|
|
119
|
-
const
|
|
120
|
-
n.set(c.id,
|
|
119
|
+
const p = { kind: "move", subtask: c.id, from: c.from + f, to: c.to + f };
|
|
120
|
+
n.set(c.id, me(c, p)), o.set(c.id, p), r.push(c.id);
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
return [...o.values()];
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function Ts(s, t) {
|
|
126
126
|
const { step: e, offset: n } = typeof t == "number" ? { step: t, offset: 0 } : t;
|
|
127
127
|
if (!(e > 0) || !Number.isFinite(s)) return s;
|
|
128
|
-
const i =
|
|
128
|
+
const i = $t(s) + n;
|
|
129
129
|
return i + Math.round((s - i) / e) * e;
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function Ti(s, t, e) {
|
|
132
132
|
return e === 0 || !Number.isFinite(e) ? [] : s.filter((n) => n.task === t).map((n) => ({ kind: "move", subtask: n.id, from: n.from + e, to: n.to + e }));
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function vt(s) {
|
|
135
135
|
let t = !1, e = !1, n = !1, i = !1;
|
|
136
136
|
for (const o of s ?? [])
|
|
137
137
|
o === "provisional" ? (t = !0, e = !1) : o === "fixed" ? (e = !0, t = !1) : o === "muted" ? n = !0 : o === "open" && (i = !0);
|
|
138
138
|
return { dashed: t, hatched: e, muted: n, open: i };
|
|
139
139
|
}
|
|
140
|
-
const
|
|
141
|
-
function
|
|
142
|
-
return
|
|
140
|
+
const xe = /* @__PURE__ */ Ne(null), $e = /* @__PURE__ */ Ne(null);
|
|
141
|
+
function Ge() {
|
|
142
|
+
return Re($e);
|
|
143
143
|
}
|
|
144
|
-
function
|
|
145
|
-
const t =
|
|
144
|
+
function Ss(s) {
|
|
145
|
+
const t = Re(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 Ut(s, t, e, n, i) {
|
|
151
|
+
const o = Ss(s), r = Y(null);
|
|
152
|
+
z(() => (r.current = e(o, t), () => {
|
|
153
153
|
r.current !== null && i(o, r.current), r.current = null;
|
|
154
|
-
}), [o]),
|
|
154
|
+
}), [o]), z(() => {
|
|
155
155
|
r.current !== null && n(o, r.current, t);
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
|
-
function
|
|
159
|
-
|
|
158
|
+
function Is(s) {
|
|
159
|
+
Ut("Lane", s, (t, e) => t.registerLane(e), (t, e, n) => t.updateLane(e, n), (t, e) => t.unregisterLane(e));
|
|
160
160
|
}
|
|
161
|
-
function
|
|
162
|
-
|
|
161
|
+
function Ls(s) {
|
|
162
|
+
Ut("LaneGroup", s, (t, e) => t.registerGroup(e), (t, e, n) => t.updateGroup(e, n), (t, e) => t.unregisterGroup(e));
|
|
163
163
|
}
|
|
164
|
-
function
|
|
165
|
-
|
|
164
|
+
function yt(s, t) {
|
|
165
|
+
Ut(s, t, (e, n) => e.registerLayer(n), (e, n, i) => e.updateLayer(n, i), (e, n) => e.unregisterLayer(n));
|
|
166
166
|
}
|
|
167
|
-
const
|
|
168
|
-
function
|
|
169
|
-
const { lanes: t, groups: e, collapsed: n, laneHeight: i } = s,
|
|
167
|
+
const He = 24, As = 4, Cs = 3, Dt = 4;
|
|
168
|
+
function pe(s) {
|
|
169
|
+
const { lanes: t, groups: e, collapsed: n, laneHeight: i, headHeight: o = He } = s, r = new Map(e.map((w) => [w.id, w])), a = (w) => w !== void 0 && r.has(w) ? w : void 0, l = /* @__PURE__ */ new Map(), d = (w) => {
|
|
170
170
|
const M = [];
|
|
171
|
-
let T =
|
|
172
|
-
const
|
|
173
|
-
for (; T !== void 0 && !
|
|
174
|
-
|
|
171
|
+
let T = a(w.parent);
|
|
172
|
+
const _ = /* @__PURE__ */ new Set();
|
|
173
|
+
for (; T !== void 0 && !_.has(T); )
|
|
174
|
+
_.add(T), M.unshift(T), T = a(r.get(T).parent);
|
|
175
175
|
return M;
|
|
176
|
-
},
|
|
177
|
-
for (const
|
|
178
|
-
const M =
|
|
179
|
-
|
|
176
|
+
}, h = /* @__PURE__ */ new Map();
|
|
177
|
+
for (const w of t) {
|
|
178
|
+
const M = d(w);
|
|
179
|
+
h.set(w.id, M);
|
|
180
180
|
for (const T of M) {
|
|
181
|
-
const
|
|
182
|
-
|
|
181
|
+
const _ = l.get(T) ?? [];
|
|
182
|
+
_.push(w.id), l.set(T, _);
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
|
-
const
|
|
186
|
-
let
|
|
187
|
-
const
|
|
188
|
-
if (
|
|
189
|
-
const { row:
|
|
190
|
-
|
|
191
|
-
const
|
|
192
|
-
M.forEach((
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
top: T.top +
|
|
196
|
-
height:
|
|
185
|
+
const c = [], f = /* @__PURE__ */ new Map();
|
|
186
|
+
let p = [], k = null, A = 0;
|
|
187
|
+
const I = (w) => (c.push({ ...w, top: A }), A += w.height, c.length - 1), L = (w) => w.find((M) => n.has(M)), D = () => {
|
|
188
|
+
if (k === null) return;
|
|
189
|
+
const { row: w, lanes: M } = k, T = c[w], _ = Math.max(T.height, M.length * As + 2 * Dt);
|
|
190
|
+
c[w] = { ...T, height: _ }, A += _ - T.height;
|
|
191
|
+
const O = _ - 2 * Dt, V = Math.max(Cs, Math.floor(O / M.length));
|
|
192
|
+
M.forEach((ut, nt) => {
|
|
193
|
+
const it = h.get(ut) ?? [];
|
|
194
|
+
f.set(ut, {
|
|
195
|
+
top: T.top + Dt + nt * V,
|
|
196
|
+
height: V,
|
|
197
197
|
miniature: !0,
|
|
198
|
-
group:
|
|
198
|
+
group: it[it.length - 1]
|
|
199
199
|
});
|
|
200
|
-
}),
|
|
200
|
+
}), k = null;
|
|
201
201
|
};
|
|
202
|
-
for (const
|
|
203
|
-
const M = (
|
|
204
|
-
if (
|
|
205
|
-
|
|
202
|
+
for (const w of t) {
|
|
203
|
+
const M = (h.get(w.id) ?? []).filter((O) => (l.get(O) ?? []).length > 0), T = L(M);
|
|
204
|
+
if (k !== null && T === k.group) {
|
|
205
|
+
k.lanes.push(w.id);
|
|
206
206
|
continue;
|
|
207
207
|
}
|
|
208
|
-
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
for (const
|
|
212
|
-
if (
|
|
213
|
-
|
|
208
|
+
D();
|
|
209
|
+
const _ = M.filter((O, V) => p[V] === O).length;
|
|
210
|
+
p = p.slice(0, _);
|
|
211
|
+
for (const O of M.slice(_)) {
|
|
212
|
+
if (p.push(O), O === T) break;
|
|
213
|
+
I({
|
|
214
214
|
kind: "groupHead",
|
|
215
215
|
lane: void 0,
|
|
216
|
-
group:
|
|
217
|
-
depth:
|
|
218
|
-
within: [...
|
|
219
|
-
lanes: (
|
|
220
|
-
height:
|
|
216
|
+
group: O,
|
|
217
|
+
depth: p.length - 1,
|
|
218
|
+
within: [...p],
|
|
219
|
+
lanes: (l.get(O) ?? []).length,
|
|
220
|
+
height: o
|
|
221
221
|
});
|
|
222
222
|
}
|
|
223
223
|
if (T !== void 0) {
|
|
224
|
-
const
|
|
224
|
+
const O = M.indexOf(T), V = I({
|
|
225
225
|
kind: "miniature",
|
|
226
226
|
lane: void 0,
|
|
227
227
|
group: T,
|
|
228
|
-
depth:
|
|
229
|
-
within: M.slice(0,
|
|
230
|
-
lanes: (
|
|
228
|
+
depth: O,
|
|
229
|
+
within: M.slice(0, O + 1),
|
|
230
|
+
lanes: (l.get(T) ?? []).length,
|
|
231
231
|
height: i
|
|
232
232
|
});
|
|
233
|
-
|
|
233
|
+
k = { group: T, row: V, lanes: [w.id] };
|
|
234
234
|
continue;
|
|
235
235
|
}
|
|
236
|
-
|
|
237
|
-
top:
|
|
236
|
+
I({ kind: "lane", lane: w.id, group: M[M.length - 1], depth: M.length, within: M, lanes: 1, height: i }), f.set(w.id, {
|
|
237
|
+
top: c[c.length - 1].top,
|
|
238
238
|
height: i,
|
|
239
239
|
miniature: !1,
|
|
240
240
|
group: M[M.length - 1]
|
|
241
241
|
});
|
|
242
242
|
}
|
|
243
|
-
return
|
|
243
|
+
return D(), { rows: c, slots: f, height: A };
|
|
244
244
|
}
|
|
245
|
-
function
|
|
245
|
+
function Ds(s, t) {
|
|
246
246
|
if (t.size === 0) return s;
|
|
247
247
|
const e = /* @__PURE__ */ new Set();
|
|
248
248
|
for (const n of s) t.has(n) || e.add(n);
|
|
249
249
|
return e;
|
|
250
250
|
}
|
|
251
|
-
function
|
|
251
|
+
function et(s, t) {
|
|
252
252
|
if (t < 0 || t >= s.height) return null;
|
|
253
253
|
let e = 0, n = s.rows.length - 1;
|
|
254
254
|
for (; e <= n; ) {
|
|
@@ -259,11 +259,11 @@ function tt(s, t) {
|
|
|
259
259
|
}
|
|
260
260
|
return null;
|
|
261
261
|
}
|
|
262
|
-
function
|
|
262
|
+
function Xt(s, t) {
|
|
263
263
|
return s.slots.get(t) ?? null;
|
|
264
264
|
}
|
|
265
|
-
function
|
|
266
|
-
const e =
|
|
265
|
+
function _s(s, t) {
|
|
266
|
+
const e = et(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,148 +271,151 @@ function Ts(s, t) {
|
|
|
271
271
|
if (i.miniature && t >= i.top && t < i.top + i.height) return n;
|
|
272
272
|
return null;
|
|
273
273
|
}
|
|
274
|
-
const
|
|
275
|
-
function
|
|
276
|
-
return Math.round(s.scale.toPx(
|
|
274
|
+
const Fs = 6, Ye = 3, ot = 2, ge = 3, ke = 3;
|
|
275
|
+
function R(s, t) {
|
|
276
|
+
return Math.round(s.scale.toPx(G(t, s.calendar)));
|
|
277
277
|
}
|
|
278
|
-
function
|
|
279
|
-
const e =
|
|
278
|
+
function j(s, t) {
|
|
279
|
+
const e = Xt(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 qt(s, t) {
|
|
283
|
+
const e = j(s, t.lane);
|
|
284
|
+
return e === null ? null : { x: R(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 ve(s, t) {
|
|
287
|
+
return _s(s.rows, t + s.scrollY);
|
|
288
288
|
}
|
|
289
|
-
function
|
|
290
|
-
const i = e.miniature ? 0 :
|
|
289
|
+
function Ke(s, t, e, n) {
|
|
290
|
+
const i = e.miniature ? 0 : Fs, o = e.miniature ? 0 : ke * ge, r = Math.max(e.miniature ? 1 : 4, e.height - 2 * i - o), a = e.top - s.scrollY + Math.floor((e.height - r) / 2), l = st(t);
|
|
291
291
|
return {
|
|
292
292
|
subtask: t,
|
|
293
293
|
miniature: e.miniature,
|
|
294
294
|
depth: n,
|
|
295
|
-
y: a + (e.miniature ? 0 : Math.min(n,
|
|
295
|
+
y: a + (e.miniature ? 0 : Math.min(n, ke) * ge),
|
|
296
296
|
height: r,
|
|
297
|
-
outerFrom:
|
|
298
|
-
mainFrom:
|
|
299
|
-
mainTo:
|
|
300
|
-
outerTo:
|
|
297
|
+
outerFrom: R(s, l.from),
|
|
298
|
+
mainFrom: R(s, t.from),
|
|
299
|
+
mainTo: R(s, t.to),
|
|
300
|
+
outerTo: R(s, l.to)
|
|
301
301
|
};
|
|
302
302
|
}
|
|
303
|
-
function
|
|
303
|
+
function Ve(s, t, e) {
|
|
304
304
|
if (e < s.y || e > s.y + s.height) return null;
|
|
305
305
|
const n = Math.max(0, (6 - (s.outerTo - s.outerFrom)) / 2);
|
|
306
306
|
return t < s.outerFrom - n || t > s.outerTo + n ? null : t < s.mainFrom ? "leadIn" : t > s.mainTo ? "leadOut" : "main";
|
|
307
307
|
}
|
|
308
|
-
function
|
|
308
|
+
function Os(s, t, e, n = 5) {
|
|
309
309
|
if (e < s.y || e > s.y + s.height) return null;
|
|
310
310
|
const i = Math.abs(t - s.mainFrom), o = Math.abs(t - s.mainTo);
|
|
311
311
|
return Math.min(i, o) > n ? null : i <= o ? "from" : "to";
|
|
312
312
|
}
|
|
313
|
-
function
|
|
313
|
+
function Et(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 Es(s, t, e) {
|
|
317
317
|
let i = 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
|
i = Math.min(i, 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 && i <= t + 8 && a >= -8 && r <= e + 8;
|
|
321
321
|
}
|
|
322
|
-
const
|
|
323
|
-
function
|
|
322
|
+
const Rs = 64;
|
|
323
|
+
function Ns(s, t) {
|
|
324
324
|
if (s.miniature) return null;
|
|
325
|
-
const e =
|
|
326
|
-
return i <
|
|
325
|
+
const e = vt(s.subtask.appearance).hatched ? ot + Ye + 1 : 0, n = Math.max(s.mainFrom + e, 0), i = Math.min(s.mainTo - e, t) - n;
|
|
326
|
+
return i < Rs ? null : { x: n, width: i, y: s.y, height: s.height };
|
|
327
327
|
}
|
|
328
|
-
const
|
|
329
|
-
function
|
|
328
|
+
const Ps = 10;
|
|
329
|
+
function ye(s, t, e) {
|
|
330
330
|
const n = Math.round(t.y + t.height / 2);
|
|
331
331
|
return s === "centre" || e.y === t.y ? n : Math.round(e.y > t.y ? t.y + t.height - 1 : t.y + 1);
|
|
332
332
|
}
|
|
333
|
-
function
|
|
334
|
-
const o = t.route ?? i.route, r = t.attach ?? i.attach, a = t.ends ?? i.ends, l =
|
|
333
|
+
function Rt(s, t, e, n, i) {
|
|
334
|
+
const o = t.route ?? i.route, r = t.attach ?? i.attach, a = t.ends ?? i.ends, l = R(s, Kt(t, e.subtask)), d = R(s, Vt(t, n.subtask)), h = ye(r, e, n), c = ye(r, n, 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
|
|
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,
|
|
338
|
+
const I = l + Ps, L = h === c ? I : Math.round((I + d) / 2);
|
|
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),
|
|
342
|
-
for (let
|
|
343
|
-
const
|
|
341
|
+
const f = Math.max(14, Math.abs(d - l) / 2), p = l + f, k = d - f, A = [];
|
|
342
|
+
for (let I = 0; I <= 16; I++) {
|
|
343
|
+
const L = I / 16, D = 1 - L;
|
|
344
344
|
A.push(
|
|
345
|
-
|
|
346
|
-
|
|
345
|
+
D * D * D * l + 3 * D * D * L * p + 3 * D * L * L * k + L * L * L * d,
|
|
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:
|
|
349
|
+
return { dependency: t, kind: "curve", ends: a, x1: l, y1: h, x2: d, y2: c, c1x: p, c2x: k, points: A };
|
|
350
350
|
}
|
|
351
|
-
function
|
|
351
|
+
function Bs(s, t, e) {
|
|
352
352
|
let n = 1 / 0;
|
|
353
353
|
const i = s.points;
|
|
354
354
|
for (let o = 0; o + 3 < i.length; o += 2) {
|
|
355
|
-
const r = i[o], a = i[o + 1], l = i[o + 2], d = i[o + 3], h = l - r, c = d - a, f = h * h + c * c,
|
|
356
|
-
n = Math.min(n, Math.hypot(t - (r +
|
|
355
|
+
const r = i[o], a = i[o + 1], l = i[o + 2], d = i[o + 3], h = l - r, c = d - a, f = h * h + c * c, p = f === 0 ? 0 : Math.max(0, Math.min(1, ((t - r) * h + (e - a) * c) / f));
|
|
356
|
+
n = Math.min(n, Math.hypot(t - (r + p * h), e - (a + p * c)));
|
|
357
357
|
}
|
|
358
358
|
return n;
|
|
359
359
|
}
|
|
360
|
-
const
|
|
361
|
-
function
|
|
362
|
-
return s >
|
|
360
|
+
const We = [], ze = 56;
|
|
361
|
+
function xs(s) {
|
|
362
|
+
return s > 16 ? s / 16 : 1;
|
|
363
363
|
}
|
|
364
|
-
function
|
|
365
|
-
|
|
366
|
-
|
|
364
|
+
function $s(s, t = ze) {
|
|
365
|
+
return s > 0 ? Math.min(U, Math.max(15 * q, us(s * t, 1))) : 15 * q;
|
|
366
|
+
}
|
|
367
|
+
function Gs(s, t, e = We) {
|
|
368
|
+
const [n, i] = Ue(s, e);
|
|
369
|
+
return fs(e, n, i, t, $t(n)).filter(
|
|
367
370
|
(o) => o.workingTime >= s[0] && o.workingTime <= s[1]
|
|
368
371
|
);
|
|
369
372
|
}
|
|
370
|
-
function
|
|
371
|
-
const [e, n] =
|
|
373
|
+
function Hs(s, t = We) {
|
|
374
|
+
const [e, n] = Ue(s, t), i = [], o = new Date(e);
|
|
372
375
|
for (o.setHours(0, 0, 0, 0); o.getTime() < n && i.length < 400; ) {
|
|
373
376
|
const r = o.getTime();
|
|
374
377
|
o.setDate(o.getDate() + 1);
|
|
375
378
|
const a = o.getTime();
|
|
376
379
|
i.push({
|
|
377
380
|
start: r,
|
|
378
|
-
from:
|
|
379
|
-
to:
|
|
381
|
+
from: G(r, t),
|
|
382
|
+
to: G(a, t)
|
|
380
383
|
});
|
|
381
384
|
}
|
|
382
385
|
return i;
|
|
383
386
|
}
|
|
384
|
-
const
|
|
385
|
-
function
|
|
386
|
-
return
|
|
387
|
+
const _t = [1, 2, 7, 14, 28];
|
|
388
|
+
function Ys(s, t) {
|
|
389
|
+
return _t.find((e) => e * s >= t) ?? _t[_t.length - 1];
|
|
387
390
|
}
|
|
388
|
-
function
|
|
389
|
-
return ((Math.round((s -
|
|
391
|
+
function Ft(s, t) {
|
|
392
|
+
return ((Math.round((s - $t(s)) / U) - 4) % t + t) % t === 0;
|
|
390
393
|
}
|
|
391
|
-
function
|
|
394
|
+
function Ks(s, t, e, n) {
|
|
392
395
|
const i = s[1] - s[0];
|
|
393
396
|
if (!(i > 0)) return [s[0], s[1]];
|
|
394
397
|
const o = Math.min(n.max, Math.max(n.min, i * e)), r = (t - s[0]) / i, a = t - r * o;
|
|
395
398
|
return [a, a + o];
|
|
396
399
|
}
|
|
397
|
-
function
|
|
400
|
+
function Vs(s, t) {
|
|
398
401
|
return [s[0] + t, s[1] + t];
|
|
399
402
|
}
|
|
400
|
-
function
|
|
401
|
-
const e =
|
|
402
|
-
return e.intervals.length === 0 ? s :
|
|
403
|
+
function dt(s, t) {
|
|
404
|
+
const e = gt(t);
|
|
405
|
+
return e.intervals.length === 0 ? s : Gt(Math.max(0, Math.min(e.total, s)), e);
|
|
403
406
|
}
|
|
404
|
-
function
|
|
405
|
-
return [
|
|
407
|
+
function Ue(s, t) {
|
|
408
|
+
return [dt(s[0], t), dt(s[1], t)];
|
|
406
409
|
}
|
|
407
|
-
const
|
|
408
|
-
class
|
|
410
|
+
const Nt = 44;
|
|
411
|
+
class Ws {
|
|
409
412
|
constructor(t) {
|
|
410
413
|
this.data = t;
|
|
411
414
|
}
|
|
412
415
|
options = {
|
|
413
|
-
laneHeight:
|
|
416
|
+
laneHeight: Nt,
|
|
414
417
|
calendar: [],
|
|
415
|
-
zoomLimits: { min:
|
|
418
|
+
zoomLimits: { min: Ht, max: 28 * U },
|
|
416
419
|
snap: "ticks",
|
|
417
420
|
intents: [],
|
|
418
421
|
now: null,
|
|
@@ -420,14 +423,16 @@ class Rs {
|
|
|
420
423
|
attach: "centre",
|
|
421
424
|
ends: "dot"
|
|
422
425
|
};
|
|
423
|
-
|
|
426
|
+
/** The root font size over 16 px, 1 at the default size and below (`fontScaleOf`). */
|
|
427
|
+
fontScale = 1;
|
|
428
|
+
domain = [0, U];
|
|
424
429
|
scrollY = 0;
|
|
425
430
|
width = 0;
|
|
426
431
|
height = 0;
|
|
427
432
|
/* What is laid out from top to bottom (`rows.ts`). It is derived here and
|
|
428
433
|
not in the data, because a row's height comes from a view option; every y
|
|
429
434
|
in the package reads it. */
|
|
430
|
-
rows =
|
|
435
|
+
rows = pe({ lanes: [], groups: [], collapsed: /* @__PURE__ */ new Set(), laneHeight: Nt });
|
|
431
436
|
/** The folded groups, as the scene holds them. */
|
|
432
437
|
collapsed = /* @__PURE__ */ new Set();
|
|
433
438
|
/** The groups a gesture in flight holds open. Dropped when it ends; the
|
|
@@ -455,24 +460,28 @@ class Rs {
|
|
|
455
460
|
current() {
|
|
456
461
|
this.moved && this.layout();
|
|
457
462
|
}
|
|
463
|
+
/** Takes the reader's font scale; the next `layout` uses it. */
|
|
464
|
+
setFontScale(t) {
|
|
465
|
+
this.fontScale = t;
|
|
466
|
+
}
|
|
458
467
|
/** Takes new options; a new calendar keeps the wall-clock span in view. */
|
|
459
468
|
setOptions(t) {
|
|
460
469
|
const e = t.calendar !== this.options.calendar, n = this.options.calendar;
|
|
461
470
|
if (this.options = t, e) {
|
|
462
|
-
const i =
|
|
471
|
+
const i = gt(n), o = (r) => {
|
|
463
472
|
const a = i.intervals.length === 0 ? r : Math.max(0, Math.min(i.total, r));
|
|
464
|
-
return
|
|
473
|
+
return G(Gt(a, i), t.calendar) + (r - a);
|
|
465
474
|
};
|
|
466
475
|
this.domain = [o(this.domain[0]), o(this.domain[1])];
|
|
467
476
|
}
|
|
468
477
|
}
|
|
469
478
|
/** Puts a span of two wall-clock instants in view. */
|
|
470
479
|
showWall(t) {
|
|
471
|
-
this.domain = [
|
|
480
|
+
this.domain = [G(t[0], this.options.calendar), G(t[1], this.options.calendar)];
|
|
472
481
|
}
|
|
473
482
|
viewport() {
|
|
474
483
|
return {
|
|
475
|
-
scale: new
|
|
484
|
+
scale: new ms(this.domain, [0, this.width]),
|
|
476
485
|
calendar: this.options.calendar,
|
|
477
486
|
scrollY: this.scrollY,
|
|
478
487
|
rows: this.rows
|
|
@@ -488,28 +497,29 @@ class Rs {
|
|
|
488
497
|
/** The fine band's step at the current zoom. */
|
|
489
498
|
step() {
|
|
490
499
|
const t = this.domain[1] - this.domain[0];
|
|
491
|
-
return
|
|
500
|
+
return $s(this.width > 0 ? t / this.width : t, ze * this.fontScale);
|
|
492
501
|
}
|
|
493
502
|
/** Lays the rows out, clamps the scroll, and lays the data out anew. */
|
|
494
503
|
layout() {
|
|
495
|
-
this.moved = !1, this.rows =
|
|
504
|
+
this.moved = !1, this.rows = pe({
|
|
496
505
|
lanes: this.data.lanes,
|
|
497
506
|
groups: this.data.groups,
|
|
498
|
-
collapsed:
|
|
499
|
-
laneHeight: this.options.laneHeight
|
|
507
|
+
collapsed: Ds(this.collapsed, this.openForGesture),
|
|
508
|
+
laneHeight: Math.round(this.options.laneHeight * this.fontScale),
|
|
509
|
+
headHeight: Math.round(He * this.fontScale)
|
|
500
510
|
}), this.scrollY = Math.max(0, Math.min(this.maxScroll(), this.scrollY));
|
|
501
511
|
const t = this.viewport();
|
|
502
512
|
this.laidBoxes = [], this.laidBoxById = /* @__PURE__ */ new Map();
|
|
503
513
|
for (const e of this.data.subtasks) {
|
|
504
|
-
const n =
|
|
514
|
+
const n = Xt(this.rows, e.lane);
|
|
505
515
|
if (n === null) continue;
|
|
506
|
-
const i =
|
|
516
|
+
const i = Ke(t, e, n, this.data.depth.get(e.id) ?? 0);
|
|
507
517
|
this.laidBoxes.push(i), this.laidBoxById.set(e.id, i);
|
|
508
518
|
}
|
|
509
519
|
this.laidPaths = [];
|
|
510
520
|
for (const e of this.data.dependencies) {
|
|
511
521
|
const n = this.boxById.get(e.from), i = this.boxById.get(e.to);
|
|
512
|
-
n === void 0 || i === void 0 || this.laidPaths.push(
|
|
522
|
+
n === void 0 || i === void 0 || this.laidPaths.push(Rt(t, e, n, i, this.options));
|
|
513
523
|
}
|
|
514
524
|
}
|
|
515
525
|
/** The days of the coarse band and the ticks of the fine band, in pixels. */
|
|
@@ -518,11 +528,11 @@ class Rs {
|
|
|
518
528
|
if (this.width <= 0) return { days: [], ticks: [], step: t };
|
|
519
529
|
const e = this.viewport().scale, n = this.options.calendar;
|
|
520
530
|
return {
|
|
521
|
-
days:
|
|
531
|
+
days: Hs(this.domain, n).map((i) => {
|
|
522
532
|
const o = Math.round(e.toPx(i.from));
|
|
523
533
|
return { start: i.start, x: o, width: Math.round(e.toPx(i.to)) - o };
|
|
524
534
|
}),
|
|
525
|
-
ticks:
|
|
535
|
+
ticks: Gs(this.domain, t, n).map((i) => ({ wallClock: i.wallClock, x: Math.round(e.toPx(i.workingTime)) })),
|
|
526
536
|
step: t
|
|
527
537
|
};
|
|
528
538
|
}
|
|
@@ -530,32 +540,32 @@ class Rs {
|
|
|
530
540
|
nowX() {
|
|
531
541
|
const t = this.options.now;
|
|
532
542
|
if (t === null || this.width <= 0) return null;
|
|
533
|
-
const e = Math.round(this.viewport().scale.toPx(
|
|
543
|
+
const e = Math.round(this.viewport().scale.toPx(G(t, this.options.calendar)));
|
|
534
544
|
return e >= 0 && e <= this.width ? e : null;
|
|
535
545
|
}
|
|
536
546
|
hitAt(t, e) {
|
|
537
547
|
const n = this.viewport();
|
|
538
548
|
for (let a = this.data.milestones.length - 1; a >= 0; a--) {
|
|
539
|
-
const l = this.data.milestones[a], d =
|
|
549
|
+
const l = this.data.milestones[a], d = qt(n, l);
|
|
540
550
|
if (d !== null && Math.abs(t - d.x) + Math.abs(e - d.y) <= d.half + 2) return { kind: "milestone", milestone: l };
|
|
541
551
|
}
|
|
542
552
|
for (let a = this.boxes.length - 1; a >= 0; a--) {
|
|
543
|
-
const l = this.boxes[a], d =
|
|
553
|
+
const l = this.boxes[a], d = Ve(l, t, e);
|
|
544
554
|
if (d !== null) return { kind: "subtask", subtask: l.subtask, part: d };
|
|
545
555
|
}
|
|
546
556
|
let i = null, o = 4;
|
|
547
557
|
for (const a of this.paths) {
|
|
548
|
-
const l =
|
|
558
|
+
const l = Bs(a, t, e);
|
|
549
559
|
l <= o && (o = l, i = a);
|
|
550
560
|
}
|
|
551
561
|
if (i !== null) return { kind: "dependency", dependency: i.dependency };
|
|
552
|
-
const r =
|
|
562
|
+
const r = ve(this.viewport(), e);
|
|
553
563
|
return r !== null ? { kind: "lane", lane: r } : { kind: "nothing" };
|
|
554
564
|
}
|
|
555
565
|
/** The wall-clock time at a plot x; within the calendar's extent. */
|
|
556
566
|
timeAt(t) {
|
|
557
567
|
const e = this.viewport().scale.fromPx(t);
|
|
558
|
-
return
|
|
568
|
+
return dt(e, this.options.calendar);
|
|
559
569
|
}
|
|
560
570
|
/** The lane at a y, strips included: what the pointer is ON.
|
|
561
571
|
|
|
@@ -564,7 +574,7 @@ class Rs {
|
|
|
564
574
|
`foldedGroupAt` - and a caller that reached through `viewport()` for it
|
|
565
575
|
would be depending on the layout rather than asking the view. */
|
|
566
576
|
laneIdAt(t) {
|
|
567
|
-
return
|
|
577
|
+
return ve(this.viewport(), t);
|
|
568
578
|
}
|
|
569
579
|
/** The lane a DROP at this y would land on.
|
|
570
580
|
|
|
@@ -574,19 +584,19 @@ class Rs {
|
|
|
574
584
|
aim at. Hover, the tooltip and selection do read a strip - they cost
|
|
575
585
|
nothing if they are a pixel out. */
|
|
576
586
|
dropLaneIdAt(t) {
|
|
577
|
-
const e =
|
|
587
|
+
const e = et(this.rows, t + this.scrollY);
|
|
578
588
|
return e === null || e.kind !== "lane" ? null : e.lane ?? null;
|
|
579
589
|
}
|
|
580
590
|
/** The folded group a y lies over, or null. */
|
|
581
591
|
foldedGroupAt(t) {
|
|
582
|
-
const e =
|
|
592
|
+
const e = et(this.rows, t + this.scrollY);
|
|
583
593
|
return e !== null && e.kind === "miniature" ? e.group ?? null : null;
|
|
584
594
|
}
|
|
585
595
|
/** Pans by pixels. Says what moved: the span through time, the lanes, or
|
|
586
596
|
neither - a scroll through the lanes is no news about the time. */
|
|
587
597
|
pan(t, e) {
|
|
588
598
|
const n = this.domain[0], i = this.scrollY, o = this.domain[1] - n;
|
|
589
|
-
this.width > 0 && t !== 0 && (this.domain =
|
|
599
|
+
this.width > 0 && t !== 0 && (this.domain = Vs(this.domain, t / this.width * o)), this.scrollY = Math.max(0, Math.min(this.maxScroll(), this.scrollY + e));
|
|
590
600
|
const r = this.domain[0] !== n;
|
|
591
601
|
return { moved: r || this.scrollY !== i, time: r };
|
|
592
602
|
}
|
|
@@ -594,63 +604,63 @@ class Rs {
|
|
|
594
604
|
zoomAt(t, e) {
|
|
595
605
|
if (this.width <= 0 || !Number.isFinite(e)) return !1;
|
|
596
606
|
const n = this.domain, i = this.viewport().scale.fromPx(t);
|
|
597
|
-
return this.domain =
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
const
|
|
601
|
-
root:
|
|
602
|
-
corner:
|
|
603
|
-
dayBand:
|
|
604
|
-
tickBand:
|
|
605
|
-
day:
|
|
606
|
-
dayLabel:
|
|
607
|
-
tick:
|
|
608
|
-
tickLabel:
|
|
609
|
-
headers:
|
|
610
|
-
header:
|
|
611
|
-
headerLabel:
|
|
612
|
-
headerCount:
|
|
613
|
-
chevron:
|
|
614
|
-
plot:
|
|
615
|
-
focusRing:
|
|
616
|
-
layer:
|
|
617
|
-
grip:
|
|
618
|
-
ghostLabel:
|
|
619
|
-
finding:
|
|
620
|
-
refusal:
|
|
621
|
-
tooltip:
|
|
622
|
-
tooltipHead:
|
|
623
|
-
tooltipTimes:
|
|
624
|
-
now:
|
|
625
|
-
barLabel:
|
|
626
|
-
barLabelText:
|
|
607
|
+
return this.domain = Ks(this.domain, i, e, this.options.zoomLimits), n[0] !== this.domain[0] || n[1] !== this.domain[1];
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
const zs = "_root_1g7hg_4 _text_18806_22", Us = "_corner_1g7hg_19", Xs = "_dayBand_1g7hg_23", qs = "_tickBand_1g7hg_24", js = "_day_1g7hg_23", Js = "_dayLabel_1g7hg_50", Zs = "_tick_1g7hg_24", Qs = "_tickLabel_1g7hg_71", tn = "_headers_1g7hg_79", en = "_header_1g7hg_79", sn = "_headerLabel_1g7hg_97", nn = "_headerCount_1g7hg_133", on = "_chevron_1g7hg_142", rn = "_plot_1g7hg_197", an = "_focusRing_1g7hg_204", ln = "_layer_1g7hg_222", dn = "_grip_1g7hg_231", hn = "_ghostLabel_1g7hg_241", cn = "_finding_1g7hg_254", un = "_refusal_1g7hg_262", fn = "_tooltip_1g7hg_266", mn = "_tooltipHead_1g7hg_285", pn = "_tooltipTimes_1g7hg_290", gn = "_now_1g7hg_299", kn = "_barLabel_1g7hg_313", vn = "_barLabelText_1g7hg_326", g = {
|
|
611
|
+
root: zs,
|
|
612
|
+
corner: Us,
|
|
613
|
+
dayBand: Xs,
|
|
614
|
+
tickBand: qs,
|
|
615
|
+
day: js,
|
|
616
|
+
dayLabel: Js,
|
|
617
|
+
tick: Zs,
|
|
618
|
+
tickLabel: Qs,
|
|
619
|
+
headers: tn,
|
|
620
|
+
header: en,
|
|
621
|
+
headerLabel: sn,
|
|
622
|
+
headerCount: nn,
|
|
623
|
+
chevron: on,
|
|
624
|
+
plot: rn,
|
|
625
|
+
focusRing: an,
|
|
626
|
+
layer: ln,
|
|
627
|
+
grip: dn,
|
|
628
|
+
ghostLabel: hn,
|
|
629
|
+
finding: cn,
|
|
630
|
+
refusal: un,
|
|
631
|
+
tooltip: fn,
|
|
632
|
+
tooltipHead: mn,
|
|
633
|
+
tooltipTimes: pn,
|
|
634
|
+
now: gn,
|
|
635
|
+
barLabel: kn,
|
|
636
|
+
barLabelText: vn
|
|
627
637
|
};
|
|
628
|
-
function
|
|
629
|
-
const s =
|
|
638
|
+
function Xe() {
|
|
639
|
+
const s = kt();
|
|
630
640
|
return (t) => {
|
|
631
|
-
const e = Math.round(t /
|
|
641
|
+
const e = Math.round(t / q), n = Math.floor(e / 60), i = e % 60;
|
|
632
642
|
return [n > 0 ? s.hoursShort(n) : "", i > 0 || n === 0 ? s.minutesShort(i) : ""].filter(Boolean).join(" ");
|
|
633
643
|
};
|
|
634
644
|
}
|
|
635
|
-
function
|
|
636
|
-
const e =
|
|
645
|
+
function yn({ target: s, lane: t }) {
|
|
646
|
+
const e = Yt(), n = kt(), i = Xe(), o = (c) => e.time(new Date(c), !1);
|
|
637
647
|
if (s.kind === "subtask") {
|
|
638
|
-
const { subtask: c, task: f } = s,
|
|
648
|
+
const { subtask: c, task: f } = s, p = [
|
|
639
649
|
f?.name ?? c.task,
|
|
640
650
|
c.name ?? c.id,
|
|
641
651
|
`${e.dateShort(new Date(c.from))} ${n.scheduleGhostTimes(o(c.from), o(c.to))}`,
|
|
642
|
-
...s.overlapping.map((
|
|
643
|
-
...s.violatedDependencies.map((
|
|
644
|
-
...s.blocked.map((
|
|
652
|
+
...s.overlapping.map((k) => n.scheduleOverlapWith(k.name ?? k.id)),
|
|
653
|
+
...s.violatedDependencies.map((k) => n.scheduleViolatedBy(i(k.shortBy))),
|
|
654
|
+
...s.blocked.map((k) => n.scheduleInBlockedTime(k.label))
|
|
645
655
|
];
|
|
646
|
-
return /* @__PURE__ */
|
|
656
|
+
return /* @__PURE__ */ $(at, { children: [
|
|
647
657
|
t,
|
|
648
|
-
`, ${
|
|
658
|
+
`, ${p.join(", ")}`
|
|
649
659
|
] });
|
|
650
660
|
}
|
|
651
661
|
if (s.kind === "milestone") {
|
|
652
662
|
const { milestone: c } = s;
|
|
653
|
-
return /* @__PURE__ */
|
|
663
|
+
return /* @__PURE__ */ $(at, { children: [
|
|
654
664
|
t,
|
|
655
665
|
`, ${n.scheduleMilestone(c.label ?? c.id)}, ${e.dateShort(new Date(c.at))} ${o(c.at)}`
|
|
656
666
|
] });
|
|
@@ -663,77 +673,77 @@ function cn({ target: s, lane: t }) {
|
|
|
663
673
|
...h === void 0 ? [] : [n.scheduleViolatedBy(i(h.shortBy))]
|
|
664
674
|
].join(", ");
|
|
665
675
|
}
|
|
666
|
-
function
|
|
667
|
-
const t =
|
|
676
|
+
function wn({ target: s }) {
|
|
677
|
+
const t = Yt(), e = kt(), n = (h) => t.time(new Date(h), !1), i = Xe();
|
|
668
678
|
if (s.kind === "subtask") {
|
|
669
679
|
const { subtask: h, task: c } = s;
|
|
670
|
-
return /* @__PURE__ */
|
|
671
|
-
/* @__PURE__ */ m("span", { className:
|
|
680
|
+
return /* @__PURE__ */ $(at, { children: [
|
|
681
|
+
/* @__PURE__ */ m("span", { className: g.tooltipHead, children: c?.name ?? h.task }),
|
|
672
682
|
/* @__PURE__ */ m("span", { children: h.name ?? h.id }),
|
|
673
|
-
/* @__PURE__ */ m("span", { className:
|
|
683
|
+
/* @__PURE__ */ m("span", { className: g.tooltipTimes, children: e.scheduleGhostTimes(n(h.from), n(h.to)) }),
|
|
674
684
|
(h.leadIn ?? 0) > 0 && /* @__PURE__ */ m("span", { children: `${e.scheduleLeadIn} ${i(h.leadIn)}` }),
|
|
675
685
|
(h.leadOut ?? 0) > 0 && /* @__PURE__ */ m("span", { children: `${e.scheduleLeadOut} ${i(h.leadOut)}` }),
|
|
676
|
-
s.overlapping.map((f) => /* @__PURE__ */ m("span", { className:
|
|
677
|
-
s.violatedDependencies.map((f) => /* @__PURE__ */ m("span", { className:
|
|
678
|
-
s.blocked.map((f) => /* @__PURE__ */ m("span", { className:
|
|
686
|
+
s.overlapping.map((f) => /* @__PURE__ */ m("span", { className: g.finding, children: e.scheduleOverlapWith(f.name ?? f.id) }, f.id)),
|
|
687
|
+
s.violatedDependencies.map((f) => /* @__PURE__ */ m("span", { className: g.finding, children: e.scheduleViolatedBy(i(f.shortBy)) }, f.dependency)),
|
|
688
|
+
s.blocked.map((f) => /* @__PURE__ */ m("span", { className: g.finding, children: e.scheduleInBlockedTime(f.label) }, f.id))
|
|
679
689
|
] });
|
|
680
690
|
}
|
|
681
691
|
if (s.kind === "milestone") {
|
|
682
692
|
const { milestone: h } = s;
|
|
683
|
-
return /* @__PURE__ */
|
|
684
|
-
/* @__PURE__ */ m("span", { className:
|
|
685
|
-
/* @__PURE__ */ m("span", { className:
|
|
693
|
+
return /* @__PURE__ */ $(at, { children: [
|
|
694
|
+
/* @__PURE__ */ m("span", { className: g.tooltipHead, children: e.scheduleMilestone(h.label ?? h.id) }),
|
|
695
|
+
/* @__PURE__ */ m("span", { className: g.tooltipTimes, children: `${t.dateShort(new Date(h.at))} ${n(h.at)}` })
|
|
686
696
|
] });
|
|
687
697
|
}
|
|
688
698
|
const { dependency: o, task: r, from: a, to: l, violated: d } = s;
|
|
689
|
-
return /* @__PURE__ */
|
|
690
|
-
/* @__PURE__ */ m("span", { className:
|
|
699
|
+
return /* @__PURE__ */ $(at, { children: [
|
|
700
|
+
/* @__PURE__ */ m("span", { className: g.tooltipHead, children: r?.name ?? r?.id ?? o.id }),
|
|
691
701
|
/* @__PURE__ */ m("span", { children: e.scheduleRoute(a?.name ?? o.from, l?.name ?? o.to) }),
|
|
692
702
|
/* @__PURE__ */ m("span", { children: `${e.scheduleDependency} ${i(o.lag)}` }),
|
|
693
|
-
d !== void 0 && /* @__PURE__ */ m("span", { className:
|
|
703
|
+
d !== void 0 && /* @__PURE__ */ m("span", { className: g.finding, children: e.scheduleViolatedBy(i(d.shortBy)) })
|
|
694
704
|
] });
|
|
695
705
|
}
|
|
696
|
-
const
|
|
697
|
-
function
|
|
706
|
+
const bn = [], we = { min: Ht, max: 28 * U }, Mn = [], be = 20, Tn = 44, Sn = 84, In = 200;
|
|
707
|
+
function Ln(s) {
|
|
698
708
|
const {
|
|
699
709
|
ref: t,
|
|
700
710
|
scene: e,
|
|
701
711
|
ariaLabel: n,
|
|
702
712
|
height: i = 400,
|
|
703
|
-
laneHeight: o =
|
|
713
|
+
laneHeight: o = Nt,
|
|
704
714
|
headerWidth: r = 160,
|
|
705
|
-
calendar: a =
|
|
715
|
+
calendar: a = Mn,
|
|
706
716
|
zoomLimits: l,
|
|
707
717
|
snap: d = "ticks",
|
|
708
|
-
intents: h =
|
|
718
|
+
intents: h = bn,
|
|
709
719
|
onIntent: c,
|
|
710
720
|
canMoveTo: f,
|
|
711
|
-
onInteraction:
|
|
712
|
-
selectedTask:
|
|
721
|
+
onInteraction: p,
|
|
722
|
+
selectedTask: k,
|
|
713
723
|
onSelectedTaskChange: A,
|
|
714
|
-
placing:
|
|
715
|
-
route:
|
|
716
|
-
attach:
|
|
717
|
-
ends:
|
|
718
|
-
label:
|
|
719
|
-
tooltip:
|
|
720
|
-
now:
|
|
721
|
-
className:
|
|
722
|
-
style:
|
|
723
|
-
children:
|
|
724
|
-
} = s,
|
|
725
|
-
|
|
726
|
-
if (
|
|
727
|
-
const u = setInterval(() =>
|
|
724
|
+
placing: I,
|
|
725
|
+
route: L = "curve",
|
|
726
|
+
attach: D = "centre",
|
|
727
|
+
ends: w = "dot",
|
|
728
|
+
label: M,
|
|
729
|
+
tooltip: T,
|
|
730
|
+
now: _,
|
|
731
|
+
className: O,
|
|
732
|
+
style: V,
|
|
733
|
+
children: ut
|
|
734
|
+
} = s, nt = vs(), it = `${nt}-summary`, Jt = Y(null), Zt = Y(null), Qt = Y(null), te = Y(null), H = Yt(), P = kt(), ee = l?.min ?? we.min, se = l?.max ?? we.max, ne = typeof d == "object" ? d.step : null, ie = typeof d == "object" ? d.offset : null, oe = typeof d == "object" ? null : d, [ss, ns] = rt(() => Date.now());
|
|
735
|
+
z(() => {
|
|
736
|
+
if (_ !== !0) return;
|
|
737
|
+
const u = setInterval(() => ns(Date.now()), q);
|
|
728
738
|
return () => clearInterval(u);
|
|
729
|
-
}, [
|
|
730
|
-
const
|
|
731
|
-
|
|
732
|
-
const u =
|
|
733
|
-
e.setOptions({ laneHeight: o, calendar: a, zoomLimits: { min:
|
|
734
|
-
}, [e, o, a,
|
|
735
|
-
e.setHandlers({ onIntent: c, canMoveTo: f, onInteraction:
|
|
736
|
-
}, [e, c, f,
|
|
739
|
+
}, [_]);
|
|
740
|
+
const re = _ === !0 ? ss : typeof _ == "number" ? _ : null;
|
|
741
|
+
ft(() => {
|
|
742
|
+
const u = oe ?? { step: ne ?? 0, offset: ie ?? 0 };
|
|
743
|
+
e.setOptions({ laneHeight: o, calendar: a, zoomLimits: { min: ee, max: se }, snap: u, intents: h, now: re, route: L, attach: D, ends: w });
|
|
744
|
+
}, [e, o, a, ee, se, oe, ne, ie, h, re, L, D, w]), z(() => {
|
|
745
|
+
e.setHandlers({ onIntent: c, canMoveTo: f, onInteraction: p, onSelectedTaskChange: A });
|
|
746
|
+
}, [e, c, f, p, A]), ys(
|
|
737
747
|
t,
|
|
738
748
|
() => ({
|
|
739
749
|
positionAt: (u, y) => e.positionAt(u, y),
|
|
@@ -741,151 +751,157 @@ function gn(s) {
|
|
|
741
751
|
visibleDomain: () => e.visibleDomain()
|
|
742
752
|
}),
|
|
743
753
|
[e]
|
|
744
|
-
),
|
|
745
|
-
e.setControlledTask(
|
|
746
|
-
}, [e,
|
|
747
|
-
e.setPlacing(
|
|
748
|
-
}, [e,
|
|
749
|
-
const u =
|
|
750
|
-
if (!u || !y || !
|
|
751
|
-
e.bind(u, y,
|
|
752
|
-
const
|
|
753
|
-
e.resize(
|
|
754
|
-
const
|
|
755
|
-
const
|
|
756
|
-
|
|
754
|
+
), z(() => {
|
|
755
|
+
e.setControlledTask(k);
|
|
756
|
+
}, [e, k]), z(() => {
|
|
757
|
+
e.setPlacing(I ?? null);
|
|
758
|
+
}, [e, I]), z(() => {
|
|
759
|
+
const u = Jt.current, y = Zt.current, S = Qt.current, E = te.current;
|
|
760
|
+
if (!u || !y || !S || !E) return;
|
|
761
|
+
e.bind(u, y, S, E);
|
|
762
|
+
const C = y.getBoundingClientRect();
|
|
763
|
+
e.resize(C.width, C.height);
|
|
764
|
+
const F = new ResizeObserver((X) => {
|
|
765
|
+
const Ct = X[X.length - 1]?.contentRect;
|
|
766
|
+
Ct !== void 0 && e.resize(Ct.width, Ct.height);
|
|
757
767
|
});
|
|
758
|
-
|
|
759
|
-
const
|
|
760
|
-
|
|
761
|
-
const
|
|
762
|
-
|
|
768
|
+
F.observe(y);
|
|
769
|
+
const N = document.createElement("div");
|
|
770
|
+
N.setAttribute("aria-hidden", "true"), N.style.cssText = "position:absolute;visibility:hidden;pointer-events:none;width:1rem;height:0", u.appendChild(N);
|
|
771
|
+
const B = () => e.setFontScale(xs(parseFloat(getComputedStyle(N).width)));
|
|
772
|
+
B();
|
|
773
|
+
const x = new ResizeObserver(B);
|
|
774
|
+
x.observe(N);
|
|
775
|
+
const Q = (X) => e.wheel(X);
|
|
776
|
+
u.addEventListener("wheel", Q, { passive: !1 });
|
|
777
|
+
const ue = (X) => {
|
|
778
|
+
X.key === "Escape" && e.cancelEdit() && X.preventDefault();
|
|
763
779
|
};
|
|
764
|
-
return window.addEventListener("keydown",
|
|
765
|
-
window.removeEventListener("keydown",
|
|
780
|
+
return window.addEventListener("keydown", ue), () => {
|
|
781
|
+
window.removeEventListener("keydown", ue), u.removeEventListener("wheel", Q), F.disconnect(), x.disconnect(), N.remove(), e.unbind();
|
|
766
782
|
};
|
|
767
783
|
}, [e]);
|
|
768
|
-
const
|
|
769
|
-
const
|
|
770
|
-
return y >=
|
|
771
|
-
},
|
|
784
|
+
const v = Pe(e.subscribe, e.getSnapshot, e.getServerSnapshot), { fontScale: wt } = v, bt = Tn * wt, is = Sn * wt, os = In * wt, rs = (u, y) => {
|
|
785
|
+
const S = new Date(u);
|
|
786
|
+
return y >= os ? H.dateLong(S) : y >= is ? H.date(S) : y >= bt ? H.dateShort(S) : "";
|
|
787
|
+
}, as = v.days.reduce((u, y) => Math.max(u, y.width), 0), J = Ys(as, bt), ae = v.step >= U ? J : 1, b = v.ghost, Z = v.spoken, Mt = v.summary, le = (u) => `${H.dateShort(new Date(u))} ${H.time(new Date(u), !1)}`, Tt = (u) => `${nt}-row-${encodeURIComponent(u.key)}`, ls = K(() => {
|
|
772
788
|
const u = /* @__PURE__ */ new Map();
|
|
773
|
-
for (const y of
|
|
774
|
-
for (const
|
|
775
|
-
y.kind === "groupHead" &&
|
|
789
|
+
for (const y of v.headers)
|
|
790
|
+
for (const S of y.within)
|
|
791
|
+
y.kind === "groupHead" && S === y.group || u.set(S, [...u.get(S) ?? [], Tt(y)]);
|
|
776
792
|
return u;
|
|
777
|
-
}, [
|
|
778
|
-
|
|
779
|
-
const u =
|
|
793
|
+
}, [v.headers, nt]), de = Y(null);
|
|
794
|
+
ft(() => {
|
|
795
|
+
const u = de.current;
|
|
780
796
|
if (u === null) return;
|
|
781
797
|
let y = !0;
|
|
782
|
-
const
|
|
798
|
+
const S = () => {
|
|
783
799
|
if (!y) return;
|
|
784
|
-
const
|
|
785
|
-
for (const
|
|
786
|
-
const
|
|
787
|
-
const
|
|
788
|
-
if (!(
|
|
789
|
-
const
|
|
790
|
-
return
|
|
800
|
+
const F = [...u.querySelectorAll("[data-lane-count]")];
|
|
801
|
+
for (const B of F) B.hidden = !1;
|
|
802
|
+
const N = F.some((B) => {
|
|
803
|
+
const x = B.previousElementSibling;
|
|
804
|
+
if (!(x instanceof HTMLElement)) return !1;
|
|
805
|
+
const Q = parseFloat(getComputedStyle(x).lineHeight);
|
|
806
|
+
return x.scrollWidth > x.clientWidth || x.clientHeight > Q * 1.5;
|
|
791
807
|
});
|
|
792
|
-
for (const
|
|
808
|
+
for (const B of F) B.hidden = N;
|
|
793
809
|
};
|
|
794
|
-
|
|
795
|
-
const E = new ResizeObserver(
|
|
810
|
+
S(), document.fonts?.ready.then(S);
|
|
811
|
+
const E = new ResizeObserver(S);
|
|
796
812
|
E.observe(u);
|
|
797
|
-
const
|
|
798
|
-
return
|
|
799
|
-
y = !1, E.disconnect(),
|
|
813
|
+
const C = new MutationObserver(S);
|
|
814
|
+
return C.observe(u, { childList: !0, characterData: !0, subtree: !0 }), () => {
|
|
815
|
+
y = !1, E.disconnect(), C.disconnect();
|
|
800
816
|
};
|
|
801
817
|
}, []);
|
|
802
|
-
const
|
|
803
|
-
|
|
804
|
-
const u =
|
|
818
|
+
const ds = K(() => new Set(b?.refusedLanes ?? []), [b?.refusedLanes]), he = Y(null), [St, hs] = rt({ x: 0, y: 0, at: "" }), It = b === null ? "" : `${b.x}:${b.y}:${b.from}:${b.to}:${b.overlap}:${b.violated}:${b.refused}:${b.blocked}`;
|
|
819
|
+
ft(() => {
|
|
820
|
+
const u = he.current;
|
|
805
821
|
if (b === null || u === null) return;
|
|
806
|
-
const y = 4,
|
|
807
|
-
x: Math.max(2, Math.min(b.x,
|
|
808
|
-
y:
|
|
809
|
-
at:
|
|
822
|
+
const y = 4, S = b.y - u.offsetHeight - y, E = b.y + b.height + y, C = {
|
|
823
|
+
x: Math.max(2, Math.min(b.x, v.width - u.offsetWidth - 2)),
|
|
824
|
+
y: S >= 2 ? S : Math.min(E, v.height - u.offsetHeight - 2),
|
|
825
|
+
at: It
|
|
810
826
|
};
|
|
811
|
-
|
|
812
|
-
}, [b,
|
|
813
|
-
const
|
|
814
|
-
return
|
|
815
|
-
const u =
|
|
816
|
-
if (
|
|
817
|
-
const y = 12,
|
|
818
|
-
const
|
|
819
|
-
return Math.max(4, Math.min(
|
|
827
|
+
hs((F) => F.x === C.x && F.y === C.y && F.at === C.at ? F : C);
|
|
828
|
+
}, [b, It, v.width, v.height]);
|
|
829
|
+
const ce = Y(null), [Lt, cs] = rt({ x: 0, y: 0, at: "" }), W = v.tooltip, At = W === null ? "" : `${W.x}:${W.y}:${W.target.kind}`;
|
|
830
|
+
return ft(() => {
|
|
831
|
+
const u = ce.current;
|
|
832
|
+
if (W === null || u === null) return;
|
|
833
|
+
const y = 12, S = (C, F, N) => {
|
|
834
|
+
const B = C + y, x = C - y - F, Q = B + F <= N - 4 || x < 4 ? B : x;
|
|
835
|
+
return Math.max(4, Math.min(Q, N - F - 4));
|
|
820
836
|
}, E = {
|
|
821
|
-
x:
|
|
822
|
-
y:
|
|
823
|
-
at:
|
|
837
|
+
x: S(W.x, u.offsetWidth, v.width),
|
|
838
|
+
y: S(W.y, u.offsetHeight, v.height),
|
|
839
|
+
at: At
|
|
824
840
|
};
|
|
825
|
-
|
|
826
|
-
}, [
|
|
827
|
-
/* @__PURE__ */
|
|
841
|
+
cs((C) => C.x === E.x && C.y === E.y && C.at === E.at ? C : E);
|
|
842
|
+
}, [W, At, v.width, v.height]), /* @__PURE__ */ $(xe, { value: e, children: [
|
|
843
|
+
/* @__PURE__ */ $(
|
|
828
844
|
"div",
|
|
829
845
|
{
|
|
830
|
-
ref:
|
|
846
|
+
ref: Jt,
|
|
831
847
|
role: "figure",
|
|
832
848
|
"aria-label": n,
|
|
833
|
-
className:
|
|
834
|
-
style: { height: `${i}px`, gridTemplateColumns: `min(${r}px, 40%) minmax(0, 1fr)`, ...
|
|
849
|
+
className: O ? `${g.root} ${O}` : g.root,
|
|
850
|
+
style: { height: `${i}px`, gridTemplateColumns: `min(${r}px, 40%) minmax(0, 1fr)`, ...V },
|
|
835
851
|
children: [
|
|
836
|
-
/* @__PURE__ */ m("div", { className:
|
|
837
|
-
/* @__PURE__ */ m("div", { className:
|
|
838
|
-
const
|
|
839
|
-
return /* @__PURE__ */ m("span", { className:
|
|
852
|
+
/* @__PURE__ */ m("div", { className: g.corner }),
|
|
853
|
+
/* @__PURE__ */ m("div", { className: g.dayBand, "aria-hidden": "true", "data-schedule-days": "", "data-schedule-clip": "day band", children: v.days.map((u, y) => {
|
|
854
|
+
const S = J === 1 || y === 0 || Ft(u.start, J), E = J === 1 ? u.x + u.width : v.days.slice(y + 1).find((N) => Ft(N.start, J))?.x ?? v.width, C = Math.max(0, -u.x), F = Math.min(E, v.width) - Math.max(u.x, 0);
|
|
855
|
+
return /* @__PURE__ */ m("span", { className: g.day, style: { left: `${u.x}px`, width: `${S ? E - u.x : u.width}px` }, children: /* @__PURE__ */ m("span", { className: g.dayLabel, "data-schedule-overlay": "day label", style: { marginLeft: `${C}px` }, children: S ? rs(u.start, J === 1 ? F : Math.min(F, bt)) : "" }) }, u.start);
|
|
840
856
|
}) }),
|
|
841
|
-
/* @__PURE__ */ m("div", { ref:
|
|
857
|
+
/* @__PURE__ */ m("div", { ref: de, className: g.headers, "data-schedule-headers": "", children: /* @__PURE__ */ m("div", { className: g.headerRun, style: { transform: `translateY(${-v.scrollY}px)` }, children: v.headers.map((u) => /* @__PURE__ */ $(
|
|
842
858
|
"div",
|
|
843
859
|
{
|
|
844
|
-
id:
|
|
845
|
-
className:
|
|
860
|
+
id: Tt(u),
|
|
861
|
+
className: g.header,
|
|
846
862
|
style: { height: `${u.height}px`, paddingLeft: `calc(var(--u-space-3) + ${u.depth} * var(--u-space-3))` },
|
|
847
863
|
"data-lane": u.lane,
|
|
848
864
|
"data-group": u.group,
|
|
849
865
|
"data-row": u.kind,
|
|
850
866
|
"data-schedule-clip": `header ${u.kind}`,
|
|
851
|
-
"data-refused": u.lane !== void 0 &&
|
|
867
|
+
"data-refused": u.lane !== void 0 && ds.has(u.lane) ? "" : void 0,
|
|
852
868
|
children: [
|
|
853
869
|
u.kind !== "lane" && u.group !== void 0 && /* @__PURE__ */ m(
|
|
854
870
|
"button",
|
|
855
871
|
{
|
|
856
872
|
type: "button",
|
|
857
|
-
className:
|
|
873
|
+
className: g.chevron,
|
|
858
874
|
"data-schedule-overlay": "fold control",
|
|
859
875
|
"aria-expanded": u.collapsed === !1,
|
|
860
|
-
"aria-controls": (
|
|
861
|
-
"aria-label": `${u.collapsed === !0 ?
|
|
876
|
+
"aria-controls": (ls.get(u.group) ?? [Tt(u)]).join(" "),
|
|
877
|
+
"aria-label": `${u.collapsed === !0 ? P.scheduleUnfoldGroup : P.scheduleFoldGroup}: ${typeof u.label == "string" ? u.label : u.group}`,
|
|
862
878
|
onClick: () => e.toggleGroup(u.group),
|
|
863
|
-
children: /* @__PURE__ */ m(
|
|
879
|
+
children: /* @__PURE__ */ m(bs, { size: 9, "data-open": u.collapsed === !1 ? "" : void 0 })
|
|
864
880
|
}
|
|
865
881
|
),
|
|
866
|
-
/* @__PURE__ */ m("span", { className:
|
|
867
|
-
u.kind !== "lane" && /* @__PURE__ */ m("span", { className:
|
|
882
|
+
/* @__PURE__ */ m("span", { className: g.headerLabel, "data-schedule-overlay": "header label", children: u.label }),
|
|
883
|
+
u.kind !== "lane" && /* @__PURE__ */ m("span", { className: g.headerCount, "data-schedule-overlay": "lane count", "data-lane-count": u.lanes, children: P.scheduleLaneCount(u.lanes) })
|
|
868
884
|
]
|
|
869
885
|
},
|
|
870
886
|
u.key
|
|
871
887
|
)) }) }),
|
|
872
|
-
/* @__PURE__ */
|
|
888
|
+
/* @__PURE__ */ $(
|
|
873
889
|
"div",
|
|
874
890
|
{
|
|
875
|
-
ref:
|
|
876
|
-
className:
|
|
891
|
+
ref: Zt,
|
|
892
|
+
className: g.plot,
|
|
877
893
|
"data-schedule-plot": "",
|
|
878
894
|
"data-schedule-clip": "plot",
|
|
879
|
-
style: { cursor:
|
|
895
|
+
style: { cursor: v.cursor },
|
|
880
896
|
tabIndex: 0,
|
|
881
897
|
role: "application",
|
|
882
|
-
"aria-roledescription":
|
|
898
|
+
"aria-roledescription": P.scheduleRoleDescription,
|
|
883
899
|
"aria-label": n,
|
|
884
|
-
"aria-describedby":
|
|
900
|
+
"aria-describedby": it,
|
|
885
901
|
onKeyDown: (u) => {
|
|
886
902
|
e.key(u.nativeEvent) && u.preventDefault();
|
|
887
903
|
},
|
|
888
|
-
onFocus: (u) => e.focus(
|
|
904
|
+
onFocus: (u) => e.focus(An(u.currentTarget)),
|
|
889
905
|
onBlur: () => e.blur(),
|
|
890
906
|
onPointerDown: (u) => e.pointerDown(u.nativeEvent),
|
|
891
907
|
onPointerMove: (u) => e.pointerMove(u.nativeEvent),
|
|
@@ -900,128 +916,128 @@ function gn(s) {
|
|
|
900
916
|
(!(y instanceof Node) || !u.currentTarget.contains(y)) && e.dragLeave();
|
|
901
917
|
},
|
|
902
918
|
children: [
|
|
903
|
-
/* @__PURE__ */ m("canvas", { ref:
|
|
904
|
-
/* @__PURE__ */ m("canvas", { ref:
|
|
905
|
-
|
|
919
|
+
/* @__PURE__ */ m("canvas", { ref: Qt, className: g.layer, "aria-hidden": "true" }),
|
|
920
|
+
/* @__PURE__ */ m("canvas", { ref: te, className: g.layer, "aria-hidden": "true" }),
|
|
921
|
+
v.grips.map((u) => /* @__PURE__ */ m(
|
|
906
922
|
"span",
|
|
907
923
|
{
|
|
908
924
|
"data-grip": u.kind,
|
|
909
925
|
"data-schedule-overlay": `${u.kind} grip`,
|
|
910
926
|
"aria-hidden": "true",
|
|
911
|
-
className:
|
|
927
|
+
className: g.grip,
|
|
912
928
|
style: { left: `${u.x}px`, top: `${u.y}px`, height: `${u.height}px` }
|
|
913
929
|
},
|
|
914
930
|
u.kind
|
|
915
931
|
)),
|
|
916
|
-
|
|
932
|
+
M !== void 0 && v.bars.map((u) => /* @__PURE__ */ m(
|
|
917
933
|
"span",
|
|
918
934
|
{
|
|
919
|
-
className:
|
|
935
|
+
className: g.barLabel,
|
|
920
936
|
"data-bar-label": u.subtask.id,
|
|
921
937
|
"data-schedule-overlay": "bar label",
|
|
922
938
|
"data-schedule-may-cover": "",
|
|
923
939
|
"data-on": u.dark ? "dark" : "light",
|
|
924
940
|
style: { left: `${u.x}px`, top: `${u.y}px`, width: `${u.width}px`, height: `${u.height}px` },
|
|
925
|
-
children: /* @__PURE__ */ m("span", { className:
|
|
941
|
+
children: /* @__PURE__ */ m("span", { className: g.barLabelText, children: M(u.subtask) })
|
|
926
942
|
},
|
|
927
943
|
u.subtask.id
|
|
928
944
|
)),
|
|
929
|
-
|
|
945
|
+
T !== !1 && v.tooltip !== null && /* @__PURE__ */ m(
|
|
930
946
|
"span",
|
|
931
947
|
{
|
|
932
|
-
ref:
|
|
948
|
+
ref: ce,
|
|
933
949
|
role: "tooltip",
|
|
934
|
-
className:
|
|
950
|
+
className: g.tooltip,
|
|
935
951
|
"data-schedule-tooltip": "",
|
|
936
952
|
"data-schedule-overlay": "tooltip",
|
|
937
953
|
style: {
|
|
938
|
-
left: `${
|
|
939
|
-
top: `${
|
|
940
|
-
visibility:
|
|
954
|
+
left: `${Lt.x}px`,
|
|
955
|
+
top: `${Lt.y}px`,
|
|
956
|
+
visibility: Lt.at === At ? void 0 : "hidden"
|
|
941
957
|
},
|
|
942
|
-
children: typeof
|
|
958
|
+
children: typeof T == "function" ? T(v.tooltip.target) : /* @__PURE__ */ m(wn, { target: v.tooltip.target })
|
|
943
959
|
}
|
|
944
960
|
),
|
|
945
|
-
b !== null && /* @__PURE__ */
|
|
961
|
+
b !== null && /* @__PURE__ */ $(
|
|
946
962
|
"span",
|
|
947
963
|
{
|
|
948
|
-
ref:
|
|
949
|
-
className:
|
|
964
|
+
ref: he,
|
|
965
|
+
className: g.ghostLabel,
|
|
950
966
|
"data-ghost": "",
|
|
951
967
|
"data-schedule-overlay": "ghost label",
|
|
952
968
|
"data-findings": [b.overlap ? "overlap" : "", b.violated ? "violated-dependency" : ""].filter(Boolean).join(" "),
|
|
953
969
|
"data-refused": b.refused ? "" : void 0,
|
|
954
970
|
"data-blocked": b.blocked ? "" : void 0,
|
|
955
971
|
style: {
|
|
956
|
-
left: `${
|
|
957
|
-
top: `${
|
|
958
|
-
visibility:
|
|
972
|
+
left: `${St.x}px`,
|
|
973
|
+
top: `${St.y}px`,
|
|
974
|
+
visibility: St.at === It ? void 0 : "hidden"
|
|
959
975
|
},
|
|
960
976
|
children: [
|
|
961
|
-
|
|
962
|
-
b.refused && /* @__PURE__ */ m("span", { className:
|
|
963
|
-
b.blocked && /* @__PURE__ */ m("span", { className:
|
|
964
|
-
b.overlap && /* @__PURE__ */ m("span", { className:
|
|
965
|
-
b.violated && /* @__PURE__ */ m("span", { className:
|
|
977
|
+
P.scheduleGhostTimes(H.time(new Date(b.from), !1), H.time(new Date(b.to), !1)),
|
|
978
|
+
b.refused && /* @__PURE__ */ m("span", { className: g.refusal, children: P.scheduleLaneRefused }),
|
|
979
|
+
b.blocked && /* @__PURE__ */ m("span", { className: g.refusal, children: P.scheduleBlockedTime }),
|
|
980
|
+
b.overlap && /* @__PURE__ */ m("span", { className: g.finding, children: P.scheduleOverlap }),
|
|
981
|
+
b.violated && /* @__PURE__ */ m("span", { className: g.finding, children: P.scheduleViolatedDependency })
|
|
966
982
|
]
|
|
967
983
|
}
|
|
968
984
|
),
|
|
969
|
-
/* @__PURE__ */ m("span", { className:
|
|
985
|
+
/* @__PURE__ */ m("span", { className: g.focusRing, "aria-hidden": "true" })
|
|
970
986
|
]
|
|
971
987
|
}
|
|
972
988
|
),
|
|
973
|
-
/* @__PURE__ */ m("div", { className:
|
|
974
|
-
/* @__PURE__ */
|
|
975
|
-
|
|
976
|
-
|
|
989
|
+
/* @__PURE__ */ m("div", { className: g.corner }),
|
|
990
|
+
/* @__PURE__ */ $("div", { className: g.tickBand, "aria-hidden": "true", "data-schedule-ticks": "", "data-schedule-clip": "time band", children: [
|
|
991
|
+
v.now !== null && /* @__PURE__ */ m("span", { className: g.now, "data-now": "", "data-schedule-overlay": "now mark", style: { left: `${v.now}px` } }),
|
|
992
|
+
v.ticks.map((u) => /* @__PURE__ */ m("span", { className: g.tick, style: { left: `${u.x}px` }, children: u.x >= be && u.x <= v.width - be && (ae === 1 || Ft(u.wallClock, ae)) && /* @__PURE__ */ m("span", { className: g.tickLabel, "data-schedule-overlay": "time label", children: v.step >= U ? H.dateShort(new Date(u.wallClock)) : H.time(new Date(u.wallClock), !1) }) }, u.wallClock))
|
|
977
993
|
] }),
|
|
978
|
-
/* @__PURE__ */ m(
|
|
979
|
-
|
|
994
|
+
/* @__PURE__ */ m(fe, { "aria-live": "polite", children: Z !== null && /* @__PURE__ */ m(
|
|
995
|
+
yn,
|
|
980
996
|
{
|
|
981
997
|
target: Z.target,
|
|
982
998
|
lane: Z.lane === null ? null : e.data.lanes.find((u) => u.id === Z.lane)?.label ?? Z.lane
|
|
983
999
|
},
|
|
984
1000
|
Z.count
|
|
985
1001
|
) }),
|
|
986
|
-
/* @__PURE__ */ m(
|
|
1002
|
+
/* @__PURE__ */ m(fe, { id: it, children: `${P.scheduleSummary({ ...Mt, from: le(Mt.from), to: le(Mt.to) })} ${P.scheduleKeyHelp}` })
|
|
987
1003
|
]
|
|
988
1004
|
}
|
|
989
1005
|
),
|
|
990
|
-
|
|
1006
|
+
ut
|
|
991
1007
|
] });
|
|
992
1008
|
}
|
|
993
|
-
function
|
|
1009
|
+
function An(s) {
|
|
994
1010
|
try {
|
|
995
1011
|
return s.matches(":focus-visible");
|
|
996
1012
|
} catch {
|
|
997
1013
|
return !0;
|
|
998
1014
|
}
|
|
999
1015
|
}
|
|
1000
|
-
function
|
|
1001
|
-
const e =
|
|
1002
|
-
return
|
|
1016
|
+
function Cn({ id: s, label: t }) {
|
|
1017
|
+
const e = Ge(), n = K(() => ({ id: s, label: t ?? s, ...e === null ? {} : { parent: e } }), [s, t, e]);
|
|
1018
|
+
return Is(n), null;
|
|
1003
1019
|
}
|
|
1004
|
-
function
|
|
1005
|
-
const n =
|
|
1006
|
-
return
|
|
1020
|
+
function Dn({ id: s, label: t, children: e }) {
|
|
1021
|
+
const n = Ge(), i = K(() => ({ id: s, label: t ?? s, ...n === null ? {} : { parent: n } }), [s, t, n]);
|
|
1022
|
+
return Ls(i), /* @__PURE__ */ m($e, { value: s, children: e });
|
|
1007
1023
|
}
|
|
1008
|
-
function
|
|
1024
|
+
function _n({ data: s, tasks: t }) {
|
|
1009
1025
|
const e = K(() => ({ kind: "subtasks", data: s, tasks: t }), [s, t]);
|
|
1010
|
-
return
|
|
1026
|
+
return yt("Subtasks", e), null;
|
|
1011
1027
|
}
|
|
1012
|
-
function
|
|
1028
|
+
function Fn({ data: s }) {
|
|
1013
1029
|
const t = K(() => ({ kind: "dependencies", data: s }), [s]);
|
|
1014
|
-
return
|
|
1030
|
+
return yt("Dependencies", t), null;
|
|
1015
1031
|
}
|
|
1016
|
-
function
|
|
1032
|
+
function On({ data: s }) {
|
|
1017
1033
|
const t = K(() => ({ kind: "blocked", data: s }), [s]);
|
|
1018
|
-
return
|
|
1034
|
+
return yt("BlockedTimes", t), null;
|
|
1019
1035
|
}
|
|
1020
|
-
function
|
|
1036
|
+
function En({ data: s }) {
|
|
1021
1037
|
const t = K(() => ({ kind: "milestones", data: s }), [s]);
|
|
1022
|
-
return
|
|
1038
|
+
return yt("Milestones", t), null;
|
|
1023
1039
|
}
|
|
1024
|
-
class
|
|
1040
|
+
class Rn {
|
|
1025
1041
|
/** `changed` is called after every registration change. */
|
|
1026
1042
|
constructor(t) {
|
|
1027
1043
|
this.changed = t;
|
|
@@ -1093,7 +1109,7 @@ class In {
|
|
|
1093
1109
|
this.subtasks.push(...e.data);
|
|
1094
1110
|
for (const n of e.tasks) this.tasks.set(n.id, n);
|
|
1095
1111
|
} else e.kind === "dependencies" ? this.dependencies.push(...e.data) : e.kind === "milestones" ? this.milestones.push(...e.data) : this.blocked.push(...e.data);
|
|
1096
|
-
return this.subtaskById = new Map(this.subtasks.map((e) => [e.id, e])), this.overlaps =
|
|
1112
|
+
return this.subtaskById = new Map(this.subtasks.map((e) => [e.id, e])), this.overlaps = Wt(this.subtasks), this.violatedById = new Map(zt(this.subtasks, this.dependencies).map((e) => [e.dependency, e])), this.depth = Ms(this.subtasks), this.inBlocked = Be(this.subtasks, this.blocked), !0;
|
|
1097
1113
|
}
|
|
1098
1114
|
/** The task a dependency belongs to: its departing subtask's. */
|
|
1099
1115
|
taskOfDependency(t) {
|
|
@@ -1119,60 +1135,60 @@ class In {
|
|
|
1119
1135
|
};
|
|
1120
1136
|
}
|
|
1121
1137
|
}
|
|
1122
|
-
const
|
|
1123
|
-
function
|
|
1138
|
+
const Nn = 6;
|
|
1139
|
+
function qe(s, t, e, n, i, o) {
|
|
1124
1140
|
s.save(), s.beginPath(), s.rect(t, e, n, i), s.clip(), s.globalAlpha = 0.35, s.strokeStyle = o, s.lineWidth = 1, s.beginPath();
|
|
1125
|
-
for (let r = t - i; r < t + n + i; r +=
|
|
1141
|
+
for (let r = t - i; r < t + n + i; r += Nn)
|
|
1126
1142
|
s.moveTo(r, e + i), s.lineTo(r + i, e);
|
|
1127
1143
|
s.stroke(), s.restore();
|
|
1128
1144
|
}
|
|
1129
|
-
function
|
|
1145
|
+
function Pn(s, t, e, n) {
|
|
1130
1146
|
if (n.size === 0) return;
|
|
1131
1147
|
const { width: i, height: o } = t.view;
|
|
1132
1148
|
for (const r of n) {
|
|
1133
|
-
const a =
|
|
1149
|
+
const a = j(e, r);
|
|
1134
1150
|
if (a === null) continue;
|
|
1135
1151
|
const { top: l, height: d } = a;
|
|
1136
|
-
l + d < 0 || l > o || (s.globalAlpha = 0.6, s.fillStyle = t.colours.surface, s.fillRect(0, l, i, d), s.globalAlpha = 1,
|
|
1152
|
+
l + d < 0 || l > o || (s.globalAlpha = 0.6, s.fillStyle = t.colours.surface, s.fillRect(0, l, i, d), s.globalAlpha = 1, qe(s, 0, l, i, d, t.colours.muted));
|
|
1137
1153
|
}
|
|
1138
1154
|
}
|
|
1139
|
-
function
|
|
1155
|
+
function Bn(s, t, e) {
|
|
1140
1156
|
const { data: n } = t;
|
|
1141
1157
|
if (n.violatedById.size !== 0)
|
|
1142
1158
|
for (const i of n.violatedById.values()) {
|
|
1143
1159
|
const o = n.dependencies.find((c) => c.id === i.dependency), r = o === void 0 ? void 0 : n.subtaskById.get(o.to);
|
|
1144
1160
|
if (r === void 0) continue;
|
|
1145
|
-
const a =
|
|
1161
|
+
const a = j(e, r.lane);
|
|
1146
1162
|
if (a === null || !a.miniature) continue;
|
|
1147
|
-
const l =
|
|
1163
|
+
const l = et(e.rows, a.top + e.scrollY);
|
|
1148
1164
|
if (l === null) continue;
|
|
1149
|
-
const d =
|
|
1150
|
-
|
|
1165
|
+
const d = R(e, i.arrival), h = Math.max(d + 2, R(e, i.arrival + i.shortBy));
|
|
1166
|
+
Pt(s, t, d, h, l.top - e.scrollY + 1, 3);
|
|
1151
1167
|
}
|
|
1152
1168
|
}
|
|
1153
|
-
function
|
|
1169
|
+
function Pt(s, t, e, n, i, o) {
|
|
1154
1170
|
if (!t.colours.forced) {
|
|
1155
1171
|
s.fillStyle = t.colours.alarm, s.fillRect(e, i, n - e, o);
|
|
1156
1172
|
return;
|
|
1157
1173
|
}
|
|
1158
1174
|
s.strokeStyle = t.colours.alarm, s.lineWidth = o, s.setLineDash([4, 3]), s.beginPath(), s.moveTo(e, i + o / 2), s.lineTo(n, i + o / 2), s.stroke(), s.setLineDash([]);
|
|
1159
1175
|
}
|
|
1160
|
-
function
|
|
1161
|
-
const i =
|
|
1176
|
+
function xn(s, t, e, n) {
|
|
1177
|
+
const i = j(e, n.lane);
|
|
1162
1178
|
if (i === null || i.top + i.height < 0 || i.top > t.view.height) return;
|
|
1163
|
-
const o = Math.max(0,
|
|
1164
|
-
r <= o || (s.globalAlpha = 0.1, s.fillStyle = t.colours.muted, s.fillRect(o, i.top, r - o, i.height), s.globalAlpha = 1,
|
|
1179
|
+
const o = Math.max(0, R(e, n.from)), r = Math.min(t.view.width, R(e, n.to));
|
|
1180
|
+
r <= o || (s.globalAlpha = 0.1, s.fillStyle = t.colours.muted, s.fillRect(o, i.top, r - o, i.height), s.globalAlpha = 1, qe(s, o, i.top, r - o, i.height, t.colours.muted));
|
|
1165
1181
|
}
|
|
1166
|
-
function
|
|
1167
|
-
const i =
|
|
1182
|
+
function Bt(s, t, e, n) {
|
|
1183
|
+
const i = j(e, n.lane);
|
|
1168
1184
|
if (i === null) return;
|
|
1169
|
-
const o =
|
|
1170
|
-
if (s.fillStyle = t.colours.alarm, s.globalAlpha = 0.14, s.fillRect(o, i.top + 1, r - o, Math.max(1, i.height - 2)), s.globalAlpha = 1,
|
|
1171
|
-
const a =
|
|
1172
|
-
a !== null &&
|
|
1185
|
+
const o = R(e, n.from), r = Math.max(o + 2, R(e, n.to));
|
|
1186
|
+
if (s.fillStyle = t.colours.alarm, s.globalAlpha = 0.14, s.fillRect(o, i.top + 1, r - o, Math.max(1, i.height - 2)), s.globalAlpha = 1, Pt(s, t, o, r, i.top + 1, Math.min(3, Math.max(1, i.height - 1))), i.miniature) {
|
|
1187
|
+
const a = et(e.rows, i.top + e.scrollY);
|
|
1188
|
+
a !== null && Pt(s, t, o, r, a.top - e.scrollY + 1, 3);
|
|
1173
1189
|
}
|
|
1174
1190
|
}
|
|
1175
|
-
const
|
|
1191
|
+
const $n = {
|
|
1176
1192
|
line: "var(--u-hairline)",
|
|
1177
1193
|
lineStrong: "var(--u-hairline-strong)",
|
|
1178
1194
|
text: "var(--u-color-text)",
|
|
@@ -1186,7 +1202,7 @@ const Dn = {
|
|
|
1186
1202
|
/* What text and marks take ON a filled bar - the same token the bar labels
|
|
1187
1203
|
use in CSS, so a cap and the label beside it are one colour. */
|
|
1188
1204
|
onAccent: "var(--u-color-on-accent)"
|
|
1189
|
-
},
|
|
1205
|
+
}, je = {
|
|
1190
1206
|
line: "GrayText",
|
|
1191
1207
|
lineStrong: "CanvasText",
|
|
1192
1208
|
text: "CanvasText",
|
|
@@ -1196,11 +1212,11 @@ const Dn = {
|
|
|
1196
1212
|
active: "Highlight",
|
|
1197
1213
|
now: "GrayText",
|
|
1198
1214
|
onAccent: "Canvas"
|
|
1199
|
-
},
|
|
1200
|
-
function
|
|
1201
|
-
const e =
|
|
1202
|
-
for (const r of t.tasks.values()) n[`task:${r.id}`] = e ?
|
|
1203
|
-
const i =
|
|
1215
|
+
}, Gn = (s) => s ? je : $n, Hn = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(forced-colors: active)").matches;
|
|
1216
|
+
function Yn(s, t) {
|
|
1217
|
+
const e = Hn(), n = {};
|
|
1218
|
+
for (const r of t.tasks.values()) n[`task:${r.id}`] = e ? je.text : r.color;
|
|
1219
|
+
const i = ps(s, { ...Gn(e), ...n }), o = /* @__PURE__ */ new Map();
|
|
1204
1220
|
for (const r of t.tasks.values()) o.set(r.id, i[`task:${r.id}`] ?? r.color);
|
|
1205
1221
|
return {
|
|
1206
1222
|
line: i.line,
|
|
@@ -1216,89 +1232,89 @@ function On(s, t) {
|
|
|
1216
1232
|
forced: e
|
|
1217
1233
|
};
|
|
1218
1234
|
}
|
|
1219
|
-
function
|
|
1235
|
+
function ht(s) {
|
|
1220
1236
|
const t = s.match(/[\d.]+/g);
|
|
1221
1237
|
return t === null || t.length < 3 ? null : [Number(t[0]), Number(t[1]), Number(t[2])];
|
|
1222
1238
|
}
|
|
1223
|
-
function
|
|
1224
|
-
const t =
|
|
1225
|
-
return t === null ? 0 :
|
|
1239
|
+
function Me(s) {
|
|
1240
|
+
const t = ht(s);
|
|
1241
|
+
return t === null ? 0 : Ze(Je(t));
|
|
1226
1242
|
}
|
|
1227
|
-
function
|
|
1243
|
+
function Je(s) {
|
|
1228
1244
|
return s.map((t) => {
|
|
1229
1245
|
const e = t / 255;
|
|
1230
1246
|
return e <= 0.04045 ? e / 12.92 : ((e + 0.055) / 1.055) ** 2.4;
|
|
1231
1247
|
});
|
|
1232
1248
|
}
|
|
1233
|
-
function
|
|
1249
|
+
function Ze([s, t, e]) {
|
|
1234
1250
|
return 0.2126 * s + 0.7152 * t + 0.0722 * e;
|
|
1235
1251
|
}
|
|
1236
|
-
function
|
|
1237
|
-
const e =
|
|
1252
|
+
function Te(s, t) {
|
|
1253
|
+
const e = Me(s), n = Me(t);
|
|
1238
1254
|
return (Math.max(e, n) + 0.05) / (Math.min(e, n) + 0.05);
|
|
1239
1255
|
}
|
|
1240
|
-
function
|
|
1256
|
+
function Se(s, t, e) {
|
|
1241
1257
|
if (s === null) return null;
|
|
1242
1258
|
const n = typeof window > "u" ? 1 : window.devicePixelRatio || 1, i = Math.round(t * n), o = Math.round(e * n);
|
|
1243
1259
|
s.width !== i && (s.width = i), s.height !== o && (s.height = o);
|
|
1244
1260
|
const r = s.getContext("2d");
|
|
1245
1261
|
return r === null ? null : (r.setTransform(n, 0, 0, n, 0, 0), r.clearRect(0, 0, t, e), r);
|
|
1246
1262
|
}
|
|
1247
|
-
function
|
|
1263
|
+
function Kn(s, t) {
|
|
1248
1264
|
const { data: e, view: n } = t, i = n.viewport();
|
|
1249
|
-
|
|
1250
|
-
for (const o of e.blocked)
|
|
1251
|
-
|
|
1265
|
+
zn(s, t, i);
|
|
1266
|
+
for (const o of e.blocked) xn(s, t, i, o);
|
|
1267
|
+
Un(s, t);
|
|
1252
1268
|
for (const o of e.layers) {
|
|
1253
1269
|
if (o.kind === "blocked" || o.kind === "milestones") continue;
|
|
1254
1270
|
const r = new Set(o.data);
|
|
1255
1271
|
if (o.kind === "dependencies")
|
|
1256
|
-
for (const a of n.paths) r.has(a.dependency) &&
|
|
1272
|
+
for (const a of n.paths) r.has(a.dependency) && Es(a, n.width, n.height) && xt(s, t, a, !1);
|
|
1257
1273
|
else
|
|
1258
|
-
for (const a of n.boxes) r.has(a.subtask) &&
|
|
1274
|
+
for (const a of n.boxes) r.has(a.subtask) && ts(s, t, a, 1);
|
|
1259
1275
|
}
|
|
1260
|
-
for (const o of e.overlaps)
|
|
1261
|
-
for (const o of e.inBlocked)
|
|
1262
|
-
|
|
1263
|
-
for (const o of e.milestones)
|
|
1264
|
-
|
|
1276
|
+
for (const o of e.overlaps) Bt(s, t, i, o);
|
|
1277
|
+
for (const o of e.inBlocked) Bt(s, t, i, o);
|
|
1278
|
+
Bn(s, t, i);
|
|
1279
|
+
for (const o of e.milestones) es(s, t, i, o, !1);
|
|
1280
|
+
ei(s, t);
|
|
1265
1281
|
}
|
|
1266
|
-
function
|
|
1282
|
+
function Vn(s, t) {
|
|
1267
1283
|
const { view: e, hover: n } = t, i = e.viewport();
|
|
1268
1284
|
if (t.ghost === null) {
|
|
1269
1285
|
if (n.kind === "subtask") {
|
|
1270
1286
|
const c = e.boxById.get(n.subtask.id);
|
|
1271
|
-
c !== void 0 &&
|
|
1287
|
+
c !== void 0 && Qn(s, t, c);
|
|
1272
1288
|
} else if (n.kind === "dependency") {
|
|
1273
1289
|
const c = e.paths.find((f) => f.dependency === n.dependency);
|
|
1274
|
-
c !== void 0 &&
|
|
1275
|
-
} else n.kind === "milestone" &&
|
|
1290
|
+
c !== void 0 && xt(s, t, c, !0);
|
|
1291
|
+
} else n.kind === "milestone" && es(s, t, i, n.milestone, !0);
|
|
1276
1292
|
return;
|
|
1277
1293
|
}
|
|
1278
1294
|
const o = t.ghost, { ghost: r, overlaps: a, violated: l } = o;
|
|
1279
|
-
|
|
1280
|
-
const d =
|
|
1295
|
+
Pn(s, t, i, o.refusedLanes);
|
|
1296
|
+
const d = Qe(i, r);
|
|
1281
1297
|
if (d === null) return;
|
|
1282
|
-
for (const c of a)
|
|
1298
|
+
for (const c of a) Bt(s, t, i, c);
|
|
1283
1299
|
const h = new Set(l.map((c) => c.dependency));
|
|
1284
1300
|
for (const c of t.data.dependencies) {
|
|
1285
1301
|
if (c.from !== r.id && c.to !== r.id) continue;
|
|
1286
1302
|
const f = e.boxById.get(c.from === r.id ? c.to : c.from);
|
|
1287
1303
|
if (f === void 0) continue;
|
|
1288
|
-
const
|
|
1289
|
-
|
|
1304
|
+
const p = c.from === r.id ? Rt(i, c, d, f, e.options) : Rt(i, c, f, d, e.options);
|
|
1305
|
+
xt(s, t, p, !0, h.has(c.id));
|
|
1290
1306
|
}
|
|
1291
|
-
|
|
1307
|
+
ts(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 && Wn(s, t, d, o.tether);
|
|
1292
1308
|
}
|
|
1293
|
-
function
|
|
1309
|
+
function Wn(s, t, e, n) {
|
|
1294
1310
|
const i = Math.max(e.outerFrom, Math.min(e.outerTo, n.x)), o = Math.max(e.y, Math.min(e.y + e.height, n.y));
|
|
1295
1311
|
Math.hypot(n.x - i, n.y - o) < 2 || (s.strokeStyle = t.colours.text, s.lineWidth = 1, s.setLineDash([2, 3]), s.beginPath(), s.moveTo(i + 0.5, o + 0.5), s.lineTo(n.x + 0.5, n.y + 0.5), s.stroke(), s.setLineDash([]));
|
|
1296
1312
|
}
|
|
1297
|
-
function
|
|
1298
|
-
const e =
|
|
1299
|
-
return e === null ? null :
|
|
1313
|
+
function Qe(s, t) {
|
|
1314
|
+
const e = Xt(s.rows, t.lane);
|
|
1315
|
+
return e === null ? null : Ke(s, t, e, 0);
|
|
1300
1316
|
}
|
|
1301
|
-
function
|
|
1317
|
+
function zn(s, t, e) {
|
|
1302
1318
|
const { view: n, colours: i, bands: o } = t, { width: r, height: a } = n;
|
|
1303
1319
|
s.lineWidth = 1, s.strokeStyle = i.line, s.beginPath();
|
|
1304
1320
|
for (const h of o.ticks)
|
|
@@ -1311,13 +1327,13 @@ function Nn(s, t, e) {
|
|
|
1311
1327
|
l.forEach((h, c) => {
|
|
1312
1328
|
const f = l[c + 1];
|
|
1313
1329
|
if (f === void 0 || f.top !== h.top + h.height || f.group === h.group) return;
|
|
1314
|
-
const
|
|
1315
|
-
|
|
1330
|
+
const p = h.top + h.height - e.scrollY - 0.5;
|
|
1331
|
+
p < 0 || p > a || (s.moveTo(0, p), s.lineTo(r, p));
|
|
1316
1332
|
}), s.stroke(), s.strokeStyle = i.lineStrong, s.beginPath();
|
|
1317
1333
|
for (const h of o.days)
|
|
1318
1334
|
s.moveTo(h.x + 0.5, 0), s.lineTo(h.x + 0.5, a);
|
|
1319
1335
|
s.stroke();
|
|
1320
|
-
const d =
|
|
1336
|
+
const d = gs(n.options.calendar);
|
|
1321
1337
|
if (d.length > 0) {
|
|
1322
1338
|
s.strokeStyle = i.muted, s.setLineDash([2, 3]), s.beginPath();
|
|
1323
1339
|
for (const h of d) {
|
|
@@ -1327,12 +1343,12 @@ function Nn(s, t, e) {
|
|
|
1327
1343
|
s.stroke(), s.setLineDash([]);
|
|
1328
1344
|
}
|
|
1329
1345
|
}
|
|
1330
|
-
function
|
|
1346
|
+
function Un(s, t) {
|
|
1331
1347
|
const e = t.view.nowX();
|
|
1332
1348
|
e !== null && (s.fillStyle = t.colours.now, s.fillRect(e, 0, 2, t.view.height));
|
|
1333
1349
|
}
|
|
1334
|
-
function
|
|
1335
|
-
const i =
|
|
1350
|
+
function Xn(s, t, e, n) {
|
|
1351
|
+
const i = ct(t.colours, t, e.subtask.task, e.subtask.id);
|
|
1336
1352
|
s.fillStyle = i;
|
|
1337
1353
|
for (const [o, r] of [
|
|
1338
1354
|
[e.outerFrom, e.mainFrom],
|
|
@@ -1341,72 +1357,72 @@ function Rn(s, t, e, n) {
|
|
|
1341
1357
|
r <= o || (s.globalAlpha = 0.28 * n, s.fillRect(o, e.y, r - o, e.height));
|
|
1342
1358
|
s.globalAlpha = n, s.fillRect(e.mainFrom, e.y, Math.max(1, e.mainTo - e.mainFrom), e.height), s.globalAlpha = 1;
|
|
1343
1359
|
}
|
|
1344
|
-
function
|
|
1360
|
+
function jt(s, t, e) {
|
|
1345
1361
|
if (s.dashed) return { fill: null, onDark: !1 };
|
|
1346
|
-
const n = s.muted ?
|
|
1347
|
-
return { fill: n, onDark:
|
|
1362
|
+
const n = s.muted ? qn(t, e.surface, 0.5) : t;
|
|
1363
|
+
return { fill: n, onDark: Te(n, e.onAccent) > Te(n, e.text) };
|
|
1348
1364
|
}
|
|
1349
|
-
function
|
|
1350
|
-
const n =
|
|
1365
|
+
function qn(s, t, e) {
|
|
1366
|
+
const n = ht(s), i = ht(t);
|
|
1351
1367
|
if (n === null || i === null) return s;
|
|
1352
1368
|
const o = (r) => Math.round(n[r] + (i[r] - n[r]) * e);
|
|
1353
1369
|
return `rgb(${o(0)}, ${o(1)}, ${o(2)})`;
|
|
1354
1370
|
}
|
|
1355
|
-
function
|
|
1356
|
-
const e =
|
|
1371
|
+
function Ie(s, t) {
|
|
1372
|
+
const e = ht(s);
|
|
1357
1373
|
if (e === null || t === 0) return s;
|
|
1358
|
-
const n =
|
|
1374
|
+
const n = Je(e), i = Ze(n), [o, r, a] = n.map((l) => {
|
|
1359
1375
|
const d = l + (i - l) * t, h = d <= 31308e-7 ? d * 12.92 : 1.055 * d ** (1 / 2.4) - 0.055;
|
|
1360
1376
|
return Math.round(Math.min(1, Math.max(0, h)) * 255);
|
|
1361
1377
|
});
|
|
1362
1378
|
return `rgb(${o}, ${r}, ${a})`;
|
|
1363
1379
|
}
|
|
1364
|
-
function
|
|
1380
|
+
function ct(s, t, e, n) {
|
|
1365
1381
|
const i = (e === null ? void 0 : s.tasks.get(e)) ?? s.muted;
|
|
1366
|
-
return t.selectedTask === null ? i : e !== t.selectedTask ? s.forced ? s.muted :
|
|
1382
|
+
return t.selectedTask === null ? i : e !== t.selectedTask ? s.forced ? s.muted : Ie(i, 1) : s.forced || t.selectedSubtask === null || n === null || n === t.selectedSubtask ? i : Ie(i, 0.5);
|
|
1367
1383
|
}
|
|
1368
|
-
const
|
|
1369
|
-
function
|
|
1384
|
+
const jn = 2;
|
|
1385
|
+
function ts(s, t, e, n) {
|
|
1370
1386
|
const { view: i, colours: o } = t;
|
|
1371
|
-
if (!
|
|
1387
|
+
if (!Et(e, i.width, i.height)) return;
|
|
1372
1388
|
if (e.miniature) {
|
|
1373
|
-
|
|
1389
|
+
Xn(s, t, e, n);
|
|
1374
1390
|
return;
|
|
1375
1391
|
}
|
|
1376
|
-
const r =
|
|
1392
|
+
const r = vt(e.subtask.appearance), a = ct(o, t, e.subtask.task, e.subtask.id), l = jt(r, a, o), d = e.y, h = e.height, c = Math.max(1, e.mainTo - e.mainFrom), f = l.onDark ? o.onAccent : o.text;
|
|
1377
1393
|
s.lineWidth = 1, s.fillStyle = a, s.strokeStyle = a;
|
|
1378
|
-
for (const [
|
|
1394
|
+
for (const [k, A] of [
|
|
1379
1395
|
[e.outerFrom, e.mainFrom],
|
|
1380
1396
|
[e.mainTo, e.outerTo]
|
|
1381
1397
|
])
|
|
1382
|
-
A <=
|
|
1398
|
+
A <= k || (s.globalAlpha = 0.28 * n, s.fillRect(k, d, A - k, h), s.globalAlpha = n, s.strokeRect(k + 0.5, d + 0.5, A - k - 1, h - 1));
|
|
1383
1399
|
l.fill !== null && (s.globalAlpha = n, s.fillStyle = l.fill, s.fillRect(e.mainFrom, d, c, h));
|
|
1384
|
-
const
|
|
1385
|
-
if (
|
|
1386
|
-
const
|
|
1387
|
-
s.fillStyle = l.fill === null ? a : f, s.globalAlpha = 0.3 * n, s.fillRect(e.mainFrom, A, c,
|
|
1400
|
+
const p = e.subtask.progress;
|
|
1401
|
+
if (p !== void 0) {
|
|
1402
|
+
const k = Math.min(4, Math.max(2, Math.round(h / 6))), A = d + h - k - jn, I = Math.round(c * Math.max(0, Math.min(1, p)));
|
|
1403
|
+
s.fillStyle = l.fill === null ? a : f, s.globalAlpha = 0.3 * n, s.fillRect(e.mainFrom, A, c, k), s.globalAlpha = n, I > 0 && s.fillRect(e.mainFrom, A, I, k);
|
|
1388
1404
|
}
|
|
1389
1405
|
if (r.hatched) {
|
|
1390
|
-
const
|
|
1391
|
-
s.globalAlpha = n, s.fillStyle = f, s.fillRect(e.mainFrom + A, d +
|
|
1406
|
+
const k = Math.max(1, Math.min(Ye, Math.floor((c - 2 * ot) / 3))), A = c >= 4 * k ? ot : 0, I = h >= 4 * ot ? ot : 0;
|
|
1407
|
+
s.globalAlpha = n, s.fillStyle = f, s.fillRect(e.mainFrom + A, d + I, k, h - 2 * I), s.fillRect(e.mainTo - A - k, d + I, k, h - 2 * I);
|
|
1392
1408
|
}
|
|
1393
|
-
r.open &&
|
|
1409
|
+
r.open && Zn(s, e, d, h, o.surface, i.width), r.dashed && (s.globalAlpha = n, 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 && n === 1 && (s.strokeStyle = o.surface, s.strokeRect(e.outerFrom - 0.5, d - 0.5, e.outerTo - e.outerFrom + 1, h + 1));
|
|
1394
1410
|
}
|
|
1395
|
-
const
|
|
1396
|
-
function
|
|
1397
|
-
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(
|
|
1398
|
-
r &&
|
|
1411
|
+
const Jn = 16;
|
|
1412
|
+
function Zn(s, t, e, n, i, o) {
|
|
1413
|
+
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(Jn, l);
|
|
1414
|
+
r && Le(s, 0, d, e, n, i), a && Le(s, o, -d, e, n, i);
|
|
1399
1415
|
}
|
|
1400
|
-
function
|
|
1416
|
+
function Le(s, t, e, n, i, o) {
|
|
1401
1417
|
const r = s.createLinearGradient(t, 0, t + e, 0);
|
|
1402
|
-
r.addColorStop(0,
|
|
1418
|
+
r.addColorStop(0, Ae(o, 1)), r.addColorStop(1, Ae(o, 0)), s.globalAlpha = 1, s.fillStyle = r, s.fillRect(Math.min(t, t + e), n, Math.abs(e), i);
|
|
1403
1419
|
}
|
|
1404
|
-
function
|
|
1405
|
-
const e =
|
|
1420
|
+
function Ae(s, t) {
|
|
1421
|
+
const e = ht(s);
|
|
1406
1422
|
return e === null ? s : `rgba(${e[0]}, ${e[1]}, ${e[2]}, ${t})`;
|
|
1407
1423
|
}
|
|
1408
|
-
function
|
|
1409
|
-
const { data: o, colours: r } = t, a = o.taskOfDependency(e.dependency), l = i ?? o.violatedById.has(e.dependency.id), d = a !== null && a === t.selectedTask, h = l ? r.alarm :
|
|
1424
|
+
function xt(s, t, e, n, i) {
|
|
1425
|
+
const { data: o, colours: r } = t, a = o.taskOfDependency(e.dependency), l = i ?? o.violatedById.has(e.dependency.id), d = a !== null && a === t.selectedTask, h = l ? r.alarm : ct(r, t, a, null);
|
|
1410
1426
|
if (s.strokeStyle = h, s.fillStyle = h, s.lineWidth = n || d ? 2 : 1.25, s.setLineDash(l ? [4, 3] : []), s.beginPath(), s.moveTo(e.x1, e.y1), e.kind === "curve")
|
|
1411
1427
|
s.bezierCurveTo(e.c1x, e.y1, e.c2x, e.y2, e.x2, e.y2);
|
|
1412
1428
|
else
|
|
@@ -1418,24 +1434,24 @@ function Pt(s, t, e, n, i) {
|
|
|
1418
1434
|
])
|
|
1419
1435
|
s.beginPath(), s.arc(c, f, l ? 3 : 2.5, 0, Math.PI * 2), s.fill();
|
|
1420
1436
|
}
|
|
1421
|
-
function
|
|
1422
|
-
const o =
|
|
1437
|
+
function es(s, t, e, n, i) {
|
|
1438
|
+
const o = qt(e, n);
|
|
1423
1439
|
if (o === null || o.x < -o.half || o.x > t.view.width + o.half) return;
|
|
1424
1440
|
const r = (a) => {
|
|
1425
1441
|
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();
|
|
1426
1442
|
};
|
|
1427
1443
|
i && (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();
|
|
1428
1444
|
}
|
|
1429
|
-
function
|
|
1430
|
-
const { colours: n } = t, i =
|
|
1445
|
+
function Qn(s, t, e) {
|
|
1446
|
+
const { colours: n } = t, i = vt(e.subtask.appearance), o = jt(i, ct(n, t, e.subtask.task, e.subtask.id), n);
|
|
1431
1447
|
if (n.forced) {
|
|
1432
1448
|
s.strokeStyle = n.active, s.lineWidth = 2, s.strokeRect(e.outerFrom - 2, e.y - 2, Math.max(1, e.outerTo - e.outerFrom) + 4, e.height + 4);
|
|
1433
1449
|
return;
|
|
1434
1450
|
}
|
|
1435
|
-
s.globalAlpha =
|
|
1451
|
+
s.globalAlpha = ti, s.fillStyle = o.onDark ? n.onAccent : n.text, s.fillRect(e.outerFrom, e.y, Math.max(1, e.outerTo - e.outerFrom), e.height), s.globalAlpha = 1;
|
|
1436
1452
|
}
|
|
1437
|
-
const
|
|
1438
|
-
function
|
|
1453
|
+
const ti = 0.2;
|
|
1454
|
+
function ei(s, t) {
|
|
1439
1455
|
const e = t.selectedTask;
|
|
1440
1456
|
if (e !== null) {
|
|
1441
1457
|
s.strokeStyle = t.colours.text;
|
|
@@ -1448,30 +1464,30 @@ function Wn(s, t) {
|
|
|
1448
1464
|
}
|
|
1449
1465
|
}
|
|
1450
1466
|
}
|
|
1451
|
-
const
|
|
1452
|
-
function
|
|
1453
|
-
if (!(t > 2 *
|
|
1454
|
-
const e =
|
|
1467
|
+
const mt = 32, si = 18;
|
|
1468
|
+
function Ce(s, t) {
|
|
1469
|
+
if (!(t > 2 * mt)) return 0;
|
|
1470
|
+
const e = mt - s, n = s - (t - mt), i = Math.max(e, n);
|
|
1455
1471
|
if (i <= 0) return 0;
|
|
1456
|
-
const o = Math.min(1, i /
|
|
1472
|
+
const o = Math.min(1, i / mt), r = si * o * o;
|
|
1457
1473
|
return e > 0 ? -r : r;
|
|
1458
1474
|
}
|
|
1459
|
-
function
|
|
1475
|
+
function lt(s, t, e) {
|
|
1460
1476
|
const n = (i, o) => {
|
|
1461
|
-
const r =
|
|
1477
|
+
const r = st(i);
|
|
1462
1478
|
return i.lane === o.lane && r.from < o.to && o.from < r.to;
|
|
1463
1479
|
};
|
|
1464
1480
|
return e.some((i) => n(s, i) && !(t !== null && n(t, i)));
|
|
1465
1481
|
}
|
|
1466
|
-
function
|
|
1482
|
+
function ni(s, t, e, n) {
|
|
1467
1483
|
const i = /* @__PURE__ */ new Set();
|
|
1468
1484
|
if (n === void 0) return i;
|
|
1469
1485
|
for (const o of s)
|
|
1470
1486
|
o !== e && (n(t, o) || i.add(o));
|
|
1471
1487
|
return i;
|
|
1472
1488
|
}
|
|
1473
|
-
const
|
|
1474
|
-
function
|
|
1489
|
+
const De = "\0placing", _e = /* @__PURE__ */ new Set();
|
|
1490
|
+
function Ot(s) {
|
|
1475
1491
|
switch (s.kind) {
|
|
1476
1492
|
case "subtask":
|
|
1477
1493
|
return `subtask:${s.subtask.id}:${s.part}`;
|
|
@@ -1485,8 +1501,8 @@ function Ct(s) {
|
|
|
1485
1501
|
return "nothing";
|
|
1486
1502
|
}
|
|
1487
1503
|
}
|
|
1488
|
-
const
|
|
1489
|
-
class
|
|
1504
|
+
const Fe = 3, ii = 10, oi = 600;
|
|
1505
|
+
class ri {
|
|
1490
1506
|
constructor(t) {
|
|
1491
1507
|
this.host = t;
|
|
1492
1508
|
}
|
|
@@ -1547,9 +1563,9 @@ class jn {
|
|
|
1547
1563
|
ghostSummary() {
|
|
1548
1564
|
const t = this.gesture;
|
|
1549
1565
|
if (t.kind !== "edit" && t.kind !== "place") return null;
|
|
1550
|
-
const e =
|
|
1566
|
+
const e = Qe(this.host.view.viewport(), t.ghost);
|
|
1551
1567
|
if (e === null) return null;
|
|
1552
|
-
const n = this.ghostFindings(t.ghost, this.ghostHome(t)), i = t.kind === "edit" && (t.mode === "leadIn" || t.mode === "leadOut"), o = i ?
|
|
1568
|
+
const n = this.ghostFindings(t.ghost, this.ghostHome(t)), i = t.kind === "edit" && (t.mode === "leadIn" || t.mode === "leadOut"), o = i ? st(t.ghost) : t.ghost;
|
|
1553
1569
|
return {
|
|
1554
1570
|
refused: this.refused,
|
|
1555
1571
|
refusedLanes: [...t.refused],
|
|
@@ -1597,7 +1613,7 @@ class jn {
|
|
|
1597
1613
|
group: n,
|
|
1598
1614
|
timer: setTimeout(() => {
|
|
1599
1615
|
this.resting = null, e.openForGesture = /* @__PURE__ */ new Set([...e.openForGesture, n]), this.host.viewChanged();
|
|
1600
|
-
},
|
|
1616
|
+
}, oi)
|
|
1601
1617
|
}));
|
|
1602
1618
|
}
|
|
1603
1619
|
stopResting() {
|
|
@@ -1625,9 +1641,9 @@ class jn {
|
|
|
1625
1641
|
gesture that cannot change a lane at all asks nothing: the intents the
|
|
1626
1642
|
caller handles decide whether the question exists. */
|
|
1627
1643
|
askRefused(t, e) {
|
|
1628
|
-
if (!this.host.view.options.intents.includes(e === null ? "place" : "lane")) return
|
|
1644
|
+
if (!this.host.view.options.intents.includes(e === null ? "place" : "lane")) return _e;
|
|
1629
1645
|
const n = this.host.data.lanes.map((i) => i.id);
|
|
1630
|
-
return
|
|
1646
|
+
return ni(n, t, e, this.host.handlers().canMoveTo);
|
|
1631
1647
|
}
|
|
1632
1648
|
/** What a press at a point would start, given the intents the caller handles. */
|
|
1633
1649
|
modeAt(t, e) {
|
|
@@ -1636,10 +1652,10 @@ class jn {
|
|
|
1636
1652
|
for (let o = n.boxes.length - 1; o >= 0; o--) {
|
|
1637
1653
|
const r = n.boxes[o];
|
|
1638
1654
|
if (i.includes("stretch")) {
|
|
1639
|
-
const a =
|
|
1655
|
+
const a = Os(r, t, e);
|
|
1640
1656
|
if (a !== null) return { mode: a === "from" ? "stretch-from" : "stretch-to", subtask: r.subtask };
|
|
1641
1657
|
}
|
|
1642
|
-
if (
|
|
1658
|
+
if (Ve(r, t, e) !== null)
|
|
1643
1659
|
return i.includes("move") || i.includes("lane") ? { mode: "move", subtask: r.subtask } : { mode: "pan", subtask: r.subtask };
|
|
1644
1660
|
}
|
|
1645
1661
|
return { mode: "pan", subtask: null };
|
|
@@ -1653,7 +1669,7 @@ class jn {
|
|
|
1653
1669
|
}
|
|
1654
1670
|
const i = this.gesture;
|
|
1655
1671
|
if (i.kind === "pending" && i.pointerId === t.pointerId) {
|
|
1656
|
-
if (Math.hypot(e - i.x0, n - i.y0) < (t.pointerType === "touch" ?
|
|
1672
|
+
if (Math.hypot(e - i.x0, n - i.y0) < (t.pointerType === "touch" ? ii : Fe)) return;
|
|
1657
1673
|
if (i.mode === "pan" || i.subtask === null)
|
|
1658
1674
|
this.gesture = { kind: "pan", pointerId: i.pointerId, lastX: i.x0, lastY: i.y0 }, this.setCursor("grabbing");
|
|
1659
1675
|
else {
|
|
@@ -1667,7 +1683,7 @@ class jn {
|
|
|
1667
1683
|
ghost: i.subtask,
|
|
1668
1684
|
/* Asked here, once, and drawn from the first frame of the drag: the
|
|
1669
1685
|
lanes that are closed are marked before the pointer reaches one. */
|
|
1670
|
-
refused: i.mode === "move" ? this.askRefused(i.subtask, i.subtask.lane) :
|
|
1686
|
+
refused: i.mode === "move" ? this.askRefused(i.subtask, i.subtask.lane) : _e
|
|
1671
1687
|
}, this.setCursor(i.mode === "move" ? "grabbing" : "ew-resize");
|
|
1672
1688
|
}
|
|
1673
1689
|
}
|
|
@@ -1712,7 +1728,7 @@ class jn {
|
|
|
1712
1728
|
this.panFrame = 0;
|
|
1713
1729
|
const e = this.gesture;
|
|
1714
1730
|
if (e.kind !== "edit" && e.kind !== "place") return;
|
|
1715
|
-
const n = this.host.view, { x: i, y: o } = this.local(this.lastClient.x, this.lastClient.y), r =
|
|
1731
|
+
const n = this.host.view, { x: i, y: o } = this.local(this.lastClient.x, this.lastClient.y), r = Ce(i, n.width), a = Ce(o, n.height);
|
|
1716
1732
|
if (r === 0 && a === 0) return;
|
|
1717
1733
|
const l = n.pan(r, a);
|
|
1718
1734
|
if (l.moved) {
|
|
@@ -1740,7 +1756,7 @@ class jn {
|
|
|
1740
1756
|
refreshHover() {
|
|
1741
1757
|
if (!this.idle || this.hoverKey === "nothing" || this.byKeyboard) return;
|
|
1742
1758
|
const { x: t, y: e } = this.hoverPoint, n = this.host.view.hitAt(t, e);
|
|
1743
|
-
this.hover = n, this.hoverKey =
|
|
1759
|
+
this.hover = n, this.hoverKey = Ot(n);
|
|
1744
1760
|
}
|
|
1745
1761
|
pointerLeave() {
|
|
1746
1762
|
this.gesture.kind !== "none" || this.byKeyboard || this.setHover({ kind: "nothing" }, "nothing");
|
|
@@ -1785,7 +1801,7 @@ class jn {
|
|
|
1785
1801
|
this.host.select(r, o.kind === "subtask" ? o.subtask.id : null), this.report("click", o, t, e, n, i);
|
|
1786
1802
|
}
|
|
1787
1803
|
hoverAt(t, e, n, i) {
|
|
1788
|
-
const o = this.host.view.hitAt(n, i), r =
|
|
1804
|
+
const o = this.host.view.hitAt(n, i), r = Ot(o), { mode: a } = this.modeAt(n, i);
|
|
1789
1805
|
if (this.setCursor(a === "move" ? "grab" : a === "stretch-from" || a === "stretch-to" ? "ew-resize" : "default"), this.hoverPoint = { x: n, y: i }, r === this.hoverKey) {
|
|
1790
1806
|
(o.kind === "subtask" || o.kind === "dependency" || o.kind === "milestone") && this.host.hoverChanged();
|
|
1791
1807
|
return;
|
|
@@ -1796,7 +1812,7 @@ class jn {
|
|
|
1796
1812
|
pointer's would be - and reported to nobody, since `onInteraction`
|
|
1797
1813
|
speaks of pointer positions. `nothing` hands the hover back. */
|
|
1798
1814
|
setKeyboardHover(t, e) {
|
|
1799
|
-
this.byKeyboard = t.kind !== "nothing", this.hoverPoint = e, this.hover = t, this.hoverKey =
|
|
1815
|
+
this.byKeyboard = t.kind !== "nothing", this.hoverPoint = e, this.hover = t, this.hoverKey = Ot(t), this.host.interactionChanged();
|
|
1800
1816
|
}
|
|
1801
1817
|
setHover(t, e) {
|
|
1802
1818
|
e !== this.hoverKey && (this.hoverKey = e, this.hover = t, this.host.hoverChanged());
|
|
@@ -1846,8 +1862,8 @@ class jn {
|
|
|
1846
1862
|
const o = this.onLane(n);
|
|
1847
1863
|
if (o === null) return { ghost: null, refused: !1, blocked: !1 };
|
|
1848
1864
|
if (i.has(o)) return { ghost: null, refused: !0, blocked: !1 };
|
|
1849
|
-
const r = { ...this.askedFor(t, o, e), id:
|
|
1850
|
-
return
|
|
1865
|
+
const r = { ...this.askedFor(t, o, e), id: De };
|
|
1866
|
+
return lt(r, null, this.host.data.blocked) ? { ghost: null, refused: !1, blocked: !0 } : { ghost: r, refused: !1, blocked: !1 };
|
|
1851
1867
|
}
|
|
1852
1868
|
/** The dragged item as a subtask, under the caller's key for it - not the
|
|
1853
1869
|
internal sentinel: the rule is asked about the thing the application says
|
|
@@ -1904,7 +1920,7 @@ class jn {
|
|
|
1904
1920
|
blocked time takes the ghost along again. */
|
|
1905
1921
|
heldGhost(t, e, n) {
|
|
1906
1922
|
const i = this.ghostFor(t, e, n);
|
|
1907
|
-
return this.blocked =
|
|
1923
|
+
return this.blocked = lt(i, t.subtask, this.host.data.blocked), this.blocked ? t.ghost : i;
|
|
1908
1924
|
}
|
|
1909
1925
|
ghostFor(t, e, n) {
|
|
1910
1926
|
const i = this.host.view, o = t.subtask, r = this.snapStep(), a = i.options.intents, l = this.snapInside(i.timeAt(e), r);
|
|
@@ -1912,19 +1928,19 @@ class jn {
|
|
|
1912
1928
|
case "move": {
|
|
1913
1929
|
let d = o.from;
|
|
1914
1930
|
const h = i.viewport().scale, c = h.fromPx(e) - t.t0;
|
|
1915
|
-
a.includes("move") && Math.abs(c * h.m) >=
|
|
1931
|
+
a.includes("move") && Math.abs(c * h.m) >= Fe && (d = this.shifted(o.from, c, r));
|
|
1916
1932
|
let f = t.ghost.lane;
|
|
1917
1933
|
if (a.includes("lane")) {
|
|
1918
|
-
const
|
|
1919
|
-
this.refused = t.refused.has(
|
|
1934
|
+
const p = this.onLane(n) ?? f;
|
|
1935
|
+
this.refused = t.refused.has(p), this.refused || (f = p);
|
|
1920
1936
|
} else
|
|
1921
1937
|
this.refused = !1;
|
|
1922
1938
|
return { ...o, from: d, to: d + (o.to - o.from), lane: f };
|
|
1923
1939
|
}
|
|
1924
1940
|
case "stretch-from":
|
|
1925
|
-
return { ...o, from: Math.min(l, o.to - Math.max(r.step,
|
|
1941
|
+
return { ...o, from: Math.min(l, o.to - Math.max(r.step, q)) };
|
|
1926
1942
|
case "stretch-to":
|
|
1927
|
-
return { ...o, to: Math.max(l, o.from + Math.max(r.step,
|
|
1943
|
+
return { ...o, to: Math.max(l, o.from + Math.max(r.step, q)) };
|
|
1928
1944
|
case "leadIn":
|
|
1929
1945
|
return { ...o, leadIn: Math.max(0, o.from - l) };
|
|
1930
1946
|
case "leadOut":
|
|
@@ -1935,15 +1951,15 @@ class jn {
|
|
|
1935
1951
|
a start this way, and a key by one step of the raster - one arithmetic,
|
|
1936
1952
|
so a key proposes exactly what a drag of that length would. */
|
|
1937
1953
|
shifted(t, e, n) {
|
|
1938
|
-
const i =
|
|
1954
|
+
const i = gt(this.host.view.options.calendar), o = G(t, i) + e, r = dt(o, i);
|
|
1939
1955
|
return this.snapInside(r, n);
|
|
1940
1956
|
}
|
|
1941
1957
|
/** Snapped - and, where the raster lands in time the calendar removes, moved
|
|
1942
1958
|
on to the seam, where time counts again. An intent never asks for a time
|
|
1943
1959
|
nobody works. */
|
|
1944
1960
|
snapInside(t, e) {
|
|
1945
|
-
const n =
|
|
1946
|
-
return i.intervals.length === 0 ? n :
|
|
1961
|
+
const n = Ts(t, e), i = gt(this.host.view.options.calendar);
|
|
1962
|
+
return i.intervals.length === 0 ? n : Gt(G(n, i), i);
|
|
1947
1963
|
}
|
|
1948
1964
|
intentsOf(t, e, n) {
|
|
1949
1965
|
const i = [], o = this.host.view.options.intents, r = t.id;
|
|
@@ -1963,22 +1979,22 @@ class jn {
|
|
|
1963
1979
|
keeps a plan of hundreds of tasks fluid while a drag runs, since this is
|
|
1964
1980
|
computed on every pointer movement. */
|
|
1965
1981
|
ghostFindings(t, e) {
|
|
1966
|
-
const n = this.host.data, i = (h) => h.lane === t.lane || h.lane === e, r = [...n.subtasks.filter((h) => h.id !== t.id && i(h)), t], a = (h) => h.first === t.id || h.second === t.id, l = n.dependencies.filter((h) => h.from === t.id || h.to === t.id), d = t.id ===
|
|
1967
|
-
return { overlaps:
|
|
1982
|
+
const n = this.host.data, i = (h) => h.lane === t.lane || h.lane === e, r = [...n.subtasks.filter((h) => h.id !== t.id && i(h)), t], a = (h) => h.first === t.id || h.second === t.id, l = n.dependencies.filter((h) => h.from === t.id || h.to === t.id), d = t.id === De ? n.subtasks : n.subtasks.map((h) => h.id === t.id ? t : h);
|
|
1983
|
+
return { overlaps: Wt(r).filter(a), violated: zt(d, l) };
|
|
1968
1984
|
}
|
|
1969
1985
|
}
|
|
1970
|
-
function
|
|
1986
|
+
function ai(s, t) {
|
|
1971
1987
|
const e = /* @__PURE__ */ new Map();
|
|
1972
1988
|
for (const n of t) {
|
|
1973
|
-
const i = s.slots.get(n.lane), o = i === void 0 ? null :
|
|
1989
|
+
const i = s.slots.get(n.lane), o = i === void 0 ? null : et(s, i.top);
|
|
1974
1990
|
if (o === null) continue;
|
|
1975
1991
|
const r = s.rows.indexOf(o);
|
|
1976
1992
|
e.set(r, [...e.get(r) ?? [], n]);
|
|
1977
1993
|
}
|
|
1978
1994
|
return [...e.entries()].sort(([n], [i]) => n - i).map(([, n]) => n.sort((i, o) => i.from - o.from || i.to - o.to));
|
|
1979
1995
|
}
|
|
1980
|
-
const
|
|
1981
|
-
function
|
|
1996
|
+
const Oe = (s, t) => t < s.from ? s.from - t : t > s.to ? t - s.to : 0;
|
|
1997
|
+
function li(s, t, e, n) {
|
|
1982
1998
|
let i = -1, o = -1;
|
|
1983
1999
|
for (let d = 0; d < s.length && t !== null && i < 0; d++)
|
|
1984
2000
|
o = s[d].findIndex((h) => h.id === t), o >= 0 && (i = d);
|
|
@@ -2009,11 +2025,11 @@ function Zn(s, t, e, n) {
|
|
|
2009
2025
|
const d = s[e === "up" ? i - 1 : i + 1];
|
|
2010
2026
|
if (d === void 0) return a;
|
|
2011
2027
|
const h = (a.from + a.to) / 2;
|
|
2012
|
-
return d.reduce((c, f) =>
|
|
2028
|
+
return d.reduce((c, f) => Oe(f, h) < Oe(c, h) ? f : c);
|
|
2013
2029
|
}
|
|
2014
2030
|
}
|
|
2015
2031
|
}
|
|
2016
|
-
function
|
|
2032
|
+
function di(s, t, e, n) {
|
|
2017
2033
|
if (e.kind === "milestone") return e;
|
|
2018
2034
|
if (e.kind === "dependency") {
|
|
2019
2035
|
const o = s.find((a) => a.id === e.id), r = o === void 0 ? void 0 : n === "out" ? o.to : o.from;
|
|
@@ -2024,7 +2040,7 @@ function Qn(s, t, e, n) {
|
|
|
2024
2040
|
);
|
|
2025
2041
|
return i === void 0 ? e : { kind: "dependency", id: i.id };
|
|
2026
2042
|
}
|
|
2027
|
-
const
|
|
2043
|
+
const pt = "\0milestone:", hi = 150, ci = {
|
|
2028
2044
|
ArrowRight: "next",
|
|
2029
2045
|
ArrowLeft: "previous",
|
|
2030
2046
|
ArrowUp: "up",
|
|
@@ -2034,7 +2050,7 @@ const ct = "\0milestone:", ti = 150, ei = {
|
|
|
2034
2050
|
PageDown: "pageNext",
|
|
2035
2051
|
PageUp: "pagePrevious"
|
|
2036
2052
|
};
|
|
2037
|
-
class
|
|
2053
|
+
class ui {
|
|
2038
2054
|
constructor(t) {
|
|
2039
2055
|
this.host = t;
|
|
2040
2056
|
}
|
|
@@ -2064,28 +2080,28 @@ class si {
|
|
|
2064
2080
|
const o = this.active();
|
|
2065
2081
|
if (o === null) return !1;
|
|
2066
2082
|
const r = this.host.data, a = n ? !t.shiftKey : t.key === "]";
|
|
2067
|
-
return this.show(
|
|
2083
|
+
return this.show(di(r.dependencies, r.subtaskById, o, a ? "out" : "back")), !0;
|
|
2068
2084
|
}
|
|
2069
2085
|
if (t.ctrlKey) return !1;
|
|
2070
2086
|
if (t.altKey) return this.edit(t);
|
|
2071
2087
|
if (t.key === "Escape")
|
|
2072
2088
|
return e.byKeyboard ? (this.blur(), !0) : !1;
|
|
2073
2089
|
if (t.key === "Enter" || t.key === " ") return this.select();
|
|
2074
|
-
const i = t.shiftKey ? void 0 :
|
|
2090
|
+
const i = t.shiftKey ? void 0 : ci[t.key];
|
|
2075
2091
|
return i === void 0 ? !1 : (this.walk(i), !0);
|
|
2076
2092
|
}
|
|
2077
2093
|
walk(t) {
|
|
2078
|
-
const { data: e, view: n } = this.host, i = this.active(), o = i === null ? null : i.kind === "subtask" ? i.id : i.kind === "milestone" ?
|
|
2079
|
-
let a =
|
|
2094
|
+
const { data: e, view: n } = this.host, i = this.active(), o = i === null ? null : i.kind === "subtask" ? i.id : i.kind === "milestone" ? pt + i.id : e.dependencies.find((d) => d.id === i.id)?.from ?? null, r = [...e.subtasks, ...e.milestones.map((d) => ({ id: pt + d.id, lane: d.lane, from: d.at, to: d.at }))];
|
|
2095
|
+
let a = ai(n.rows, r);
|
|
2080
2096
|
if (o === null) {
|
|
2081
2097
|
const d = a.filter((h) => {
|
|
2082
|
-
const c =
|
|
2098
|
+
const c = j(n.viewport(), h[0].lane);
|
|
2083
2099
|
return c !== null && c.top + c.height > 0 && c.top < n.height;
|
|
2084
2100
|
});
|
|
2085
2101
|
d.length > 0 && (a = d);
|
|
2086
2102
|
}
|
|
2087
|
-
const l =
|
|
2088
|
-
l !== null && this.show(l.id.startsWith(
|
|
2103
|
+
const l = li(a, o, t, this.host.visibleDomain());
|
|
2104
|
+
l !== null && this.show(l.id.startsWith(pt) ? { kind: "milestone", id: l.id.slice(pt.length) } : { kind: "subtask", id: l.id });
|
|
2089
2105
|
}
|
|
2090
2106
|
/** Space and Enter select as a click does: the whole task, and the subtask. */
|
|
2091
2107
|
select() {
|
|
@@ -2105,16 +2121,16 @@ class si {
|
|
|
2105
2121
|
const i = e.subtask, o = this.host.gestures, r = this.host.view.options.intents, a = o.snapStep(), l = a.step > 0 ? a : { step: this.host.view.step(), offset: 0 }, d = this.host.data.blocked;
|
|
2106
2122
|
let h = null;
|
|
2107
2123
|
if (!t.shiftKey && r.includes("move")) {
|
|
2108
|
-
const c = (
|
|
2124
|
+
const c = (p) => ({ ...i, from: p, to: p + (i.to - i.from) });
|
|
2109
2125
|
let f = i.from;
|
|
2110
|
-
for (let
|
|
2111
|
-
const
|
|
2112
|
-
if (
|
|
2126
|
+
for (let p = 0; p < 1e3; p++) {
|
|
2127
|
+
const k = o.shifted(f, n * l.step, l);
|
|
2128
|
+
if (k === f || (f = k, !lt(c(f), i, d))) break;
|
|
2113
2129
|
}
|
|
2114
|
-
f !== i.from && !
|
|
2130
|
+
f !== i.from && !lt(c(f), i, d) && (h = { kind: "move", subtask: i.id, from: f, to: c(f).to });
|
|
2115
2131
|
} else if (t.shiftKey && r.includes("stretch")) {
|
|
2116
|
-
const c = Math.max(o.shifted(i.to, n * l.step, l), i.from + Math.max(l.step,
|
|
2117
|
-
c !== i.to && !
|
|
2132
|
+
const c = Math.max(o.shifted(i.to, n * l.step, l), i.from + Math.max(l.step, q));
|
|
2133
|
+
c !== i.to && !lt({ ...i, to: c }, i, d) && (h = { kind: "stretch", subtask: i.id, from: i.from, to: c });
|
|
2118
2134
|
}
|
|
2119
2135
|
return o.byKeyboard = !0, h !== null && this.host.handlers().onIntent?.(h), this.scheduleReadout(), !0;
|
|
2120
2136
|
}
|
|
@@ -2153,7 +2169,7 @@ class si {
|
|
|
2153
2169
|
return a === void 0 ? null : { x0: a.outerFrom, x1: a.outerTo, y0: a.y, y1: a.y + a.height };
|
|
2154
2170
|
}
|
|
2155
2171
|
if (t.kind === "milestone") {
|
|
2156
|
-
const a = this.host.data.milestones.find((d) => d.id === t.id), l = a === void 0 ? null :
|
|
2172
|
+
const a = this.host.data.milestones.find((d) => d.id === t.id), l = a === void 0 ? null : qt(e.viewport(), a);
|
|
2157
2173
|
return l === null ? null : { x0: l.x - l.half, x1: l.x + l.half, y0: l.y - l.half, y1: l.y + l.half };
|
|
2158
2174
|
}
|
|
2159
2175
|
const i = this.host.data.dependencies.find((a) => a.id === t.id), o = i === void 0 ? void 0 : n(i.from), r = i === void 0 ? void 0 : n(i.to);
|
|
@@ -2190,20 +2206,20 @@ class si {
|
|
|
2190
2206
|
if (!this.host.gestures.byKeyboard) return;
|
|
2191
2207
|
const e = this.host.data.tooltipTargetFor(t);
|
|
2192
2208
|
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());
|
|
2193
|
-
},
|
|
2209
|
+
}, hi);
|
|
2194
2210
|
}
|
|
2195
2211
|
/** Unmount: no readout after it. */
|
|
2196
2212
|
stop() {
|
|
2197
2213
|
this.timer !== null && clearTimeout(this.timer), this.timer = null;
|
|
2198
2214
|
}
|
|
2199
2215
|
}
|
|
2200
|
-
const
|
|
2201
|
-
function
|
|
2216
|
+
const tt = (s) => JSON.stringify([s.domain ?? null, [...s.folded ?? []].sort()]);
|
|
2217
|
+
function fi(s, t) {
|
|
2202
2218
|
if (t.size === 0 || s.folded === void 0) return s;
|
|
2203
2219
|
const e = s.folded.filter((n) => t.has(n));
|
|
2204
2220
|
return e.length === s.folded.length ? s : { ...s.domain ? { domain: s.domain } : {}, ...e.length ? { folded: e } : {} };
|
|
2205
2221
|
}
|
|
2206
|
-
function
|
|
2222
|
+
function mi(s, t, e = (n) => n) {
|
|
2207
2223
|
if (s.length === 0) return null;
|
|
2208
2224
|
let n = 1 / 0, i = -1 / 0;
|
|
2209
2225
|
for (const a of s)
|
|
@@ -2212,14 +2228,15 @@ function ii(s, t, e = (n) => n) {
|
|
|
2212
2228
|
const o = Math.min(t.max, Math.max(t.min, i - n)), r = (n + i) / 2;
|
|
2213
2229
|
return [r - o / 2, r + o / 2];
|
|
2214
2230
|
}
|
|
2215
|
-
const
|
|
2231
|
+
const Ee = {
|
|
2216
2232
|
width: 0,
|
|
2217
2233
|
height: 0,
|
|
2218
2234
|
scrollY: 0,
|
|
2219
2235
|
headers: [],
|
|
2220
2236
|
days: [],
|
|
2221
2237
|
ticks: [],
|
|
2222
|
-
step:
|
|
2238
|
+
step: Ht,
|
|
2239
|
+
fontScale: 1,
|
|
2223
2240
|
ghost: null,
|
|
2224
2241
|
grips: [],
|
|
2225
2242
|
cursor: "default",
|
|
@@ -2229,9 +2246,9 @@ const De = {
|
|
|
2229
2246
|
spoken: null,
|
|
2230
2247
|
summary: { lanes: 0, subtasks: 0, from: 0, to: 0, overlaps: 0, violated: 0, blocked: 0, milestones: 0 }
|
|
2231
2248
|
};
|
|
2232
|
-
class
|
|
2233
|
-
data = new
|
|
2234
|
-
view = new
|
|
2249
|
+
class pi {
|
|
2250
|
+
data = new Rn(() => this.viewChanged());
|
|
2251
|
+
view = new Ws(this.data);
|
|
2235
2252
|
gestures;
|
|
2236
2253
|
keys;
|
|
2237
2254
|
handlersNow = {};
|
|
@@ -2272,10 +2289,10 @@ class oi {
|
|
|
2272
2289
|
movePending = !1;
|
|
2273
2290
|
domainFrame = 0;
|
|
2274
2291
|
unsubscribeTheme = null;
|
|
2275
|
-
snapshot =
|
|
2292
|
+
snapshot = Ee;
|
|
2276
2293
|
listeners = /* @__PURE__ */ new Set();
|
|
2277
2294
|
constructor(t = {}) {
|
|
2278
|
-
this.folded = t.folded ?? [], this.domainInView = t.domain ?? null, this.domainInView !== null && this.view.showWall(this.domainInView), this.viewNow = this.currentView(), this.gestures = new
|
|
2295
|
+
this.folded = t.folded ?? [], this.domainInView = t.domain ?? null, this.domainInView !== null && this.view.showWall(this.domainInView), this.viewNow = this.currentView(), this.gestures = new ri({
|
|
2279
2296
|
data: this.data,
|
|
2280
2297
|
view: this.view,
|
|
2281
2298
|
plotElement: () => this.plot,
|
|
@@ -2286,7 +2303,7 @@ class oi {
|
|
|
2286
2303
|
viewMoved: (e) => this.viewMoved(e),
|
|
2287
2304
|
interactionChanged: () => this.interactionChanged(),
|
|
2288
2305
|
hoverChanged: () => this.hoverChanged()
|
|
2289
|
-
}), this.keys = new
|
|
2306
|
+
}), this.keys = new ui({
|
|
2290
2307
|
data: this.data,
|
|
2291
2308
|
view: this.view,
|
|
2292
2309
|
gestures: this.gestures,
|
|
@@ -2312,6 +2329,9 @@ class oi {
|
|
|
2312
2329
|
setOptions(t) {
|
|
2313
2330
|
this.view.setOptions(t), this.viewChanged();
|
|
2314
2331
|
}
|
|
2332
|
+
setFontScale(t) {
|
|
2333
|
+
t !== this.view.fontScale && (this.view.setFontScale(t), this.viewChanged());
|
|
2334
|
+
}
|
|
2315
2335
|
setHandlers(t) {
|
|
2316
2336
|
this.handlersNow = t;
|
|
2317
2337
|
}
|
|
@@ -2328,7 +2348,7 @@ class oi {
|
|
|
2328
2348
|
getView = () => this.viewNow;
|
|
2329
2349
|
/** Goes to a whole view (`setView`); what it leaves out goes back to its default. */
|
|
2330
2350
|
applyView(t) {
|
|
2331
|
-
|
|
2351
|
+
tt(t) !== tt(this.viewNow) && (this.actedOn = !0, this.folded = t.folded ?? [], this.setDomain(t.domain ?? null));
|
|
2332
2352
|
}
|
|
2333
2353
|
/** Puts a span of two wall-clock instants in view; null shows the
|
|
2334
2354
|
subtasks' extent. */
|
|
@@ -2347,14 +2367,14 @@ class oi {
|
|
|
2347
2367
|
this.actedOn = !0, this.folded = [], this.viewChanged();
|
|
2348
2368
|
};
|
|
2349
2369
|
currentView() {
|
|
2350
|
-
return
|
|
2370
|
+
return fi(
|
|
2351
2371
|
{ ...this.domainInView === null ? {} : { domain: this.domainInView }, ...this.folded.length > 0 ? { folded: this.folded } : {} },
|
|
2352
2372
|
new Set(this.data.groups.map((t) => t.id))
|
|
2353
2373
|
);
|
|
2354
2374
|
}
|
|
2355
2375
|
publishView() {
|
|
2356
2376
|
const t = this.currentView();
|
|
2357
|
-
if (
|
|
2377
|
+
if (tt(t) !== tt(this.viewNow)) {
|
|
2358
2378
|
this.viewNow = t;
|
|
2359
2379
|
for (const e of this.viewListeners) e();
|
|
2360
2380
|
}
|
|
@@ -2362,13 +2382,13 @@ class oi {
|
|
|
2362
2382
|
/** The subtasks' extent within the zoom limits, while the view names no
|
|
2363
2383
|
span - and the local day of today while there is no work to show. */
|
|
2364
2384
|
fit() {
|
|
2365
|
-
const t = this.view.options.calendar, e =
|
|
2385
|
+
const t = this.view.options.calendar, e = mi(this.data.subtasks, this.view.options.zoomLimits, (i) => G(i, t));
|
|
2366
2386
|
if (e !== null) {
|
|
2367
2387
|
this.view.domain = e, this.fitted = !0;
|
|
2368
2388
|
return;
|
|
2369
2389
|
}
|
|
2370
2390
|
const n = /* @__PURE__ */ new Date();
|
|
2371
|
-
n.setHours(0, 0, 0, 0), this.view.showWall([n.getTime(), n.getTime() +
|
|
2391
|
+
n.setHours(0, 0, 0, 0), this.view.showWall([n.getTime(), n.getTime() + U]);
|
|
2372
2392
|
}
|
|
2373
2393
|
/** `undefined`: the scene keeps the selection itself. */
|
|
2374
2394
|
setControlledTask(t) {
|
|
@@ -2392,7 +2412,7 @@ class oi {
|
|
|
2392
2412
|
/* DOM binding */
|
|
2393
2413
|
/* ---------------------------------------------------------------- */
|
|
2394
2414
|
bind(t, e, n, i) {
|
|
2395
|
-
this.root = t, this.plot = e, this.dataCanvas = n, this.overlayCanvas = i, this.unsubscribeTheme =
|
|
2415
|
+
this.root = t, this.plot = e, this.dataCanvas = n, this.overlayCanvas = i, this.unsubscribeTheme = ks(() => {
|
|
2396
2416
|
this.colours = null, this.dataStale = !0, this.requestDraw();
|
|
2397
2417
|
}), this.viewChanged();
|
|
2398
2418
|
}
|
|
@@ -2407,7 +2427,7 @@ class oi {
|
|
|
2407
2427
|
this.listeners.delete(t);
|
|
2408
2428
|
});
|
|
2409
2429
|
getSnapshot = () => this.snapshot;
|
|
2410
|
-
getServerSnapshot = () =>
|
|
2430
|
+
getServerSnapshot = () => Ee;
|
|
2411
2431
|
/* ---------------------------------------------------------------- */
|
|
2412
2432
|
/* Changes */
|
|
2413
2433
|
/* ---------------------------------------------------------------- */
|
|
@@ -2445,6 +2465,7 @@ class oi {
|
|
|
2445
2465
|
scrollY: t.scrollY,
|
|
2446
2466
|
headers: this.headers(),
|
|
2447
2467
|
...t.bands(),
|
|
2468
|
+
fontScale: t.fontScale,
|
|
2448
2469
|
ghost: this.gestures.ghostSummary(),
|
|
2449
2470
|
grips: n,
|
|
2450
2471
|
cursor: this.gestures.cursor,
|
|
@@ -2483,12 +2504,12 @@ class oi {
|
|
|
2483
2504
|
if (t.width <= 0) return [];
|
|
2484
2505
|
const e = this.colours;
|
|
2485
2506
|
return t.boxes.flatMap((n) => {
|
|
2486
|
-
if (!
|
|
2487
|
-
const i =
|
|
2507
|
+
if (!Et(n, t.width, t.height)) return [];
|
|
2508
|
+
const i = Ns(n, t.width);
|
|
2488
2509
|
if (i === null) return [];
|
|
2489
|
-
const o = e === null ? !0 :
|
|
2490
|
-
|
|
2491
|
-
|
|
2510
|
+
const o = e === null ? !0 : jt(
|
|
2511
|
+
vt(n.subtask.appearance),
|
|
2512
|
+
ct(e, { selectedTask: this.selectedTask, selectedSubtask: this.selectedSubtask }, n.subtask.task, n.subtask.id),
|
|
2492
2513
|
e
|
|
2493
2514
|
).onDark;
|
|
2494
2515
|
return [{ subtask: n.subtask, ...i, dark: o }];
|
|
@@ -2500,7 +2521,7 @@ class oi {
|
|
|
2500
2521
|
const t = this.view, [e, n] = this.visibleDomain();
|
|
2501
2522
|
return {
|
|
2502
2523
|
lanes: this.data.lanes.length,
|
|
2503
|
-
subtasks: t.boxes.filter((i) =>
|
|
2524
|
+
subtasks: t.boxes.filter((i) => Et(i, t.width, t.height)).length,
|
|
2504
2525
|
from: e,
|
|
2505
2526
|
to: n,
|
|
2506
2527
|
overlaps: this.data.overlaps.length,
|
|
@@ -2519,7 +2540,7 @@ class oi {
|
|
|
2519
2540
|
}
|
|
2520
2541
|
/** The visible span, as two wall-clock instants. */
|
|
2521
2542
|
visibleDomain() {
|
|
2522
|
-
const t = (e) =>
|
|
2543
|
+
const t = (e) => dt(e, this.view.options.calendar);
|
|
2523
2544
|
return [t(this.view.domain[0]), t(this.view.domain[1])];
|
|
2524
2545
|
}
|
|
2525
2546
|
/** A pan or zoom of the planner's goes into the view once per frame,
|
|
@@ -2543,8 +2564,8 @@ class oi {
|
|
|
2543
2564
|
clientPointOf(t, e) {
|
|
2544
2565
|
const n = this.plot?.getBoundingClientRect();
|
|
2545
2566
|
if (n === void 0) return null;
|
|
2546
|
-
const i = this.view.viewport(), o = e === void 0 ? null :
|
|
2547
|
-
return { x: n.left +
|
|
2567
|
+
const i = this.view.viewport(), o = e === void 0 ? null : j(i, e), r = o === null ? 0 : o.top + o.height / 2;
|
|
2568
|
+
return { x: n.left + R(i, t), y: n.top + r };
|
|
2548
2569
|
}
|
|
2549
2570
|
requestDraw() {
|
|
2550
2571
|
this.frame !== 0 || this.dataCanvas === null || typeof requestAnimationFrame != "function" || (this.frame = requestAnimationFrame(() => {
|
|
@@ -2553,8 +2574,8 @@ class oi {
|
|
|
2553
2574
|
}
|
|
2554
2575
|
draw() {
|
|
2555
2576
|
if (this.root === null) return;
|
|
2556
|
-
this.colours === null && (this.colours =
|
|
2557
|
-
const { width: t, height: e } = this.view, n = this.dataStale ?
|
|
2577
|
+
this.colours === null && (this.colours = Yn(this.root, this.data), this.publish());
|
|
2578
|
+
const { width: t, height: e } = this.view, n = this.dataStale ? Se(this.dataCanvas, t, e) : null, i = Se(this.overlayCanvas, t, e);
|
|
2558
2579
|
if (i === null || t === 0 || this.dataStale && n === null) return;
|
|
2559
2580
|
this.dataStale = !1;
|
|
2560
2581
|
const o = {
|
|
@@ -2567,7 +2588,7 @@ class oi {
|
|
|
2567
2588
|
hover: this.gestures.hover,
|
|
2568
2589
|
ghost: this.gestures.ghostDrawing()
|
|
2569
2590
|
};
|
|
2570
|
-
n !== null &&
|
|
2591
|
+
n !== null && Kn(n, o), Vn(i, o);
|
|
2571
2592
|
}
|
|
2572
2593
|
/* ---------------------------------------------------------------- */
|
|
2573
2594
|
/* Gestures, as the component hands them in */
|
|
@@ -2587,43 +2608,43 @@ class oi {
|
|
|
2587
2608
|
focus = (t) => this.keys.focus(t);
|
|
2588
2609
|
blur = () => this.keys.blur();
|
|
2589
2610
|
}
|
|
2590
|
-
function
|
|
2591
|
-
const { initialView: t, onViewChange: e } = s, [n] =
|
|
2592
|
-
const l = (d) =>
|
|
2611
|
+
function Si(s = {}) {
|
|
2612
|
+
const { initialView: t, onViewChange: e } = s, [n] = rt(() => new pi(t)), i = Y(""), [o] = rt(() => {
|
|
2613
|
+
const l = (d) => ws(Ln, { ...d, scene: n });
|
|
2593
2614
|
return l.displayName = "Schedule", {
|
|
2594
2615
|
Schedule: l,
|
|
2595
|
-
Lane:
|
|
2596
|
-
LaneGroup:
|
|
2597
|
-
Subtasks:
|
|
2598
|
-
Dependencies:
|
|
2599
|
-
BlockedTimes:
|
|
2600
|
-
Milestones:
|
|
2616
|
+
Lane: Cn,
|
|
2617
|
+
LaneGroup: Dn,
|
|
2618
|
+
Subtasks: _n,
|
|
2619
|
+
Dependencies: Fn,
|
|
2620
|
+
BlockedTimes: On,
|
|
2621
|
+
Milestones: En,
|
|
2601
2622
|
setView: (d) => {
|
|
2602
|
-
n.applyView(d), i.current =
|
|
2623
|
+
n.applyView(d), i.current = tt(n.getView());
|
|
2603
2624
|
},
|
|
2604
2625
|
setDomain: n.setDomain,
|
|
2605
2626
|
toggleGroup: n.toggleGroup,
|
|
2606
2627
|
foldAll: n.foldAll,
|
|
2607
2628
|
unfoldAll: n.unfoldAll
|
|
2608
2629
|
};
|
|
2609
|
-
}), r =
|
|
2610
|
-
return
|
|
2630
|
+
}), r = Pe(n.subscribeView, n.getView, n.getView), a = tt(r);
|
|
2631
|
+
return z(() => {
|
|
2611
2632
|
i.current !== a && (i.current = a, n.acted && e?.(r));
|
|
2612
2633
|
}, [a]), K(() => ({ ...o, view: r }), [o, r]);
|
|
2613
2634
|
}
|
|
2614
2635
|
export {
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2636
|
+
me as applyIntent,
|
|
2637
|
+
Vt as arrival,
|
|
2638
|
+
Kt as departure,
|
|
2639
|
+
bi as findings,
|
|
2640
|
+
Be as inBlockedTime,
|
|
2641
|
+
st as occupied,
|
|
2642
|
+
Wt as overlaps,
|
|
2643
|
+
vt as resolveAppearance,
|
|
2644
|
+
Mi as ripple,
|
|
2645
|
+
Ti as shiftTask,
|
|
2646
|
+
Ts as snapTime,
|
|
2647
|
+
wi as subtaskFromPlace,
|
|
2648
|
+
Si as useSchedule,
|
|
2649
|
+
zt as violatedDependencies
|
|
2629
2650
|
};
|