@activecollab/components 2.0.576 → 2.0.578
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/dist/cjs/presentation/myWork/MyWorkTasks.js +83 -30
- package/dist/cjs/presentation/myWork/MyWorkTasks.js.map +1 -1
- package/dist/cjs/presentation/myWork/agendaGrid.js +1095 -0
- package/dist/cjs/presentation/myWork/agendaGrid.js.map +1 -0
- package/dist/cjs/presentation/reports/allReports.js +6 -0
- package/dist/cjs/presentation/reports/allReports.js.map +1 -1
- package/dist/cjs/presentation/reports/controls.js +6 -3
- package/dist/cjs/presentation/reports/controls.js.map +1 -1
- package/dist/cjs/presentation/reports/expenses.js +946 -0
- package/dist/cjs/presentation/reports/expenses.js.map +1 -0
- package/dist/cjs/presentation/shared/settings.js +6 -2
- package/dist/cjs/presentation/shared/settings.js.map +1 -1
- package/dist/cjs/presentation/shared/tokens.js +8 -1
- package/dist/cjs/presentation/shared/tokens.js.map +1 -1
- package/dist/cjs/presentation/timeboxes/AdjustmentList.js +31 -0
- package/dist/cjs/presentation/timeboxes/AdjustmentList.js.map +1 -0
- package/dist/cjs/presentation/timeboxes/AgendaDayView.js +1722 -0
- package/dist/cjs/presentation/timeboxes/AgendaDayView.js.map +1 -0
- package/dist/cjs/presentation/timeboxes/CapacityBar.js +54 -0
- package/dist/cjs/presentation/timeboxes/CapacityBar.js.map +1 -0
- package/dist/cjs/presentation/timeboxes/SimulationCard.js +47 -0
- package/dist/cjs/presentation/timeboxes/SimulationCard.js.map +1 -0
- package/dist/cjs/presentation/timeboxes/SimulationPanel.js +319 -0
- package/dist/cjs/presentation/timeboxes/SimulationPanel.js.map +1 -0
- package/dist/cjs/presentation/timeboxes/TimeRecordsSection.js +206 -0
- package/dist/cjs/presentation/timeboxes/TimeRecordsSection.js.map +1 -0
- package/dist/cjs/presentation/timeboxes/WorkloadView.js +887 -0
- package/dist/cjs/presentation/timeboxes/WorkloadView.js.map +1 -0
- package/dist/cjs/presentation/timeboxes/__tests__/timeboxes.test.js +699 -0
- package/dist/cjs/presentation/timeboxes/__tests__/timeboxes.test.js.map +1 -0
- package/dist/cjs/presentation/timeboxes/changes.js +293 -0
- package/dist/cjs/presentation/timeboxes/changes.js.map +1 -0
- package/dist/cjs/presentation/timeboxes/mockData.js +320 -0
- package/dist/cjs/presentation/timeboxes/mockData.js.map +1 -0
- package/dist/cjs/presentation/timeboxes/model.js +186 -0
- package/dist/cjs/presentation/timeboxes/model.js.map +1 -0
- package/dist/cjs/presentation/timeboxes/pillLook.js +72 -0
- package/dist/cjs/presentation/timeboxes/pillLook.js.map +1 -0
- package/dist/cjs/presentation/timeboxes/plan.js +181 -0
- package/dist/cjs/presentation/timeboxes/plan.js.map +1 -0
- package/dist/cjs/presentation/timeboxes/reducer.js +763 -0
- package/dist/cjs/presentation/timeboxes/reducer.js.map +1 -0
- package/dist/cjs/presentation/timeboxes/scheduler.js +147 -0
- package/dist/cjs/presentation/timeboxes/scheduler.js.map +1 -0
- package/dist/cjs/presentation/timeboxes/store.js +65 -0
- package/dist/cjs/presentation/timeboxes/store.js.map +1 -0
- package/dist/cjs/presentation/timeboxes/timeBlocks.js +1931 -0
- package/dist/cjs/presentation/timeboxes/timeBlocks.js.map +1 -0
- package/dist/cjs/presentation/timeboxes/timeboxSettings.js +369 -0
- package/dist/cjs/presentation/timeboxes/timeboxSettings.js.map +1 -0
- package/dist/cjs/presentation/timeboxes/tracked.js +189 -0
- package/dist/cjs/presentation/timeboxes/tracked.js.map +1 -0
- package/dist/esm/presentation/myWork/MyWorkTasks.d.ts +81 -1
- package/dist/esm/presentation/myWork/MyWorkTasks.d.ts.map +1 -1
- package/dist/esm/presentation/myWork/MyWorkTasks.js +76 -23
- package/dist/esm/presentation/myWork/MyWorkTasks.js.map +1 -1
- package/dist/esm/presentation/myWork/agendaGrid.d.ts +341 -0
- package/dist/esm/presentation/myWork/agendaGrid.d.ts.map +1 -0
- package/dist/esm/presentation/myWork/agendaGrid.js +1001 -0
- package/dist/esm/presentation/myWork/agendaGrid.js.map +1 -0
- package/dist/esm/presentation/reports/allReports.d.ts.map +1 -1
- package/dist/esm/presentation/reports/allReports.js +6 -0
- package/dist/esm/presentation/reports/allReports.js.map +1 -1
- package/dist/esm/presentation/reports/controls.d.ts +3 -1
- package/dist/esm/presentation/reports/controls.d.ts.map +1 -1
- package/dist/esm/presentation/reports/controls.js +6 -3
- package/dist/esm/presentation/reports/controls.js.map +1 -1
- package/dist/esm/presentation/reports/expenses.d.ts +62 -0
- package/dist/esm/presentation/reports/expenses.d.ts.map +1 -0
- package/dist/esm/presentation/reports/expenses.js +849 -0
- package/dist/esm/presentation/reports/expenses.js.map +1 -0
- package/dist/esm/presentation/shared/settings.d.ts +2 -0
- package/dist/esm/presentation/shared/settings.d.ts.map +1 -1
- package/dist/esm/presentation/shared/settings.js +5 -1
- package/dist/esm/presentation/shared/settings.js.map +1 -1
- package/dist/esm/presentation/shared/tokens.d.ts +6 -0
- package/dist/esm/presentation/shared/tokens.d.ts.map +1 -1
- package/dist/esm/presentation/shared/tokens.js +7 -0
- package/dist/esm/presentation/shared/tokens.js.map +1 -1
- package/dist/esm/presentation/timeboxes/AdjustmentList.d.ts +11 -0
- package/dist/esm/presentation/timeboxes/AdjustmentList.d.ts.map +1 -0
- package/dist/esm/presentation/timeboxes/AdjustmentList.js +22 -0
- package/dist/esm/presentation/timeboxes/AdjustmentList.js.map +1 -0
- package/dist/esm/presentation/timeboxes/AgendaDayView.d.ts +15 -0
- package/dist/esm/presentation/timeboxes/AgendaDayView.d.ts.map +1 -0
- package/dist/esm/presentation/timeboxes/AgendaDayView.js +1524 -0
- package/dist/esm/presentation/timeboxes/AgendaDayView.js.map +1 -0
- package/dist/esm/presentation/timeboxes/CapacityBar.d.ts +15 -0
- package/dist/esm/presentation/timeboxes/CapacityBar.d.ts.map +1 -0
- package/dist/esm/presentation/timeboxes/CapacityBar.js +48 -0
- package/dist/esm/presentation/timeboxes/CapacityBar.js.map +1 -0
- package/dist/esm/presentation/timeboxes/SimulationCard.d.ts +13 -0
- package/dist/esm/presentation/timeboxes/SimulationCard.d.ts.map +1 -0
- package/dist/esm/presentation/timeboxes/SimulationCard.js +41 -0
- package/dist/esm/presentation/timeboxes/SimulationCard.js.map +1 -0
- package/dist/esm/presentation/timeboxes/SimulationPanel.d.ts +18 -0
- package/dist/esm/presentation/timeboxes/SimulationPanel.d.ts.map +1 -0
- package/dist/esm/presentation/timeboxes/SimulationPanel.js +267 -0
- package/dist/esm/presentation/timeboxes/SimulationPanel.js.map +1 -0
- package/dist/esm/presentation/timeboxes/TimeRecordsSection.d.ts +14 -0
- package/dist/esm/presentation/timeboxes/TimeRecordsSection.d.ts.map +1 -0
- package/dist/esm/presentation/timeboxes/TimeRecordsSection.js +159 -0
- package/dist/esm/presentation/timeboxes/TimeRecordsSection.js.map +1 -0
- package/dist/esm/presentation/timeboxes/WorkloadView.d.ts +9 -0
- package/dist/esm/presentation/timeboxes/WorkloadView.d.ts.map +1 -0
- package/dist/esm/presentation/timeboxes/WorkloadView.js +761 -0
- package/dist/esm/presentation/timeboxes/WorkloadView.js.map +1 -0
- package/dist/esm/presentation/timeboxes/__tests__/timeboxes.test.d.ts +2 -0
- package/dist/esm/presentation/timeboxes/__tests__/timeboxes.test.d.ts.map +1 -0
- package/dist/esm/presentation/timeboxes/__tests__/timeboxes.test.js +640 -0
- package/dist/esm/presentation/timeboxes/__tests__/timeboxes.test.js.map +1 -0
- package/dist/esm/presentation/timeboxes/changes.d.ts +72 -0
- package/dist/esm/presentation/timeboxes/changes.d.ts.map +1 -0
- package/dist/esm/presentation/timeboxes/changes.js +224 -0
- package/dist/esm/presentation/timeboxes/changes.js.map +1 -0
- package/dist/esm/presentation/timeboxes/mockData.d.ts +16 -0
- package/dist/esm/presentation/timeboxes/mockData.d.ts.map +1 -0
- package/dist/esm/presentation/timeboxes/mockData.js +297 -0
- package/dist/esm/presentation/timeboxes/mockData.js.map +1 -0
- package/dist/esm/presentation/timeboxes/model.d.ts +136 -0
- package/dist/esm/presentation/timeboxes/model.d.ts.map +1 -0
- package/dist/esm/presentation/timeboxes/model.js +129 -0
- package/dist/esm/presentation/timeboxes/model.js.map +1 -0
- package/dist/esm/presentation/timeboxes/pillLook.d.ts +40 -0
- package/dist/esm/presentation/timeboxes/pillLook.d.ts.map +1 -0
- package/dist/esm/presentation/timeboxes/pillLook.js +65 -0
- package/dist/esm/presentation/timeboxes/pillLook.js.map +1 -0
- package/dist/esm/presentation/timeboxes/plan.d.ts +62 -0
- package/dist/esm/presentation/timeboxes/plan.d.ts.map +1 -0
- package/dist/esm/presentation/timeboxes/plan.js +116 -0
- package/dist/esm/presentation/timeboxes/plan.js.map +1 -0
- package/dist/esm/presentation/timeboxes/reducer.d.ts +203 -0
- package/dist/esm/presentation/timeboxes/reducer.d.ts.map +1 -0
- package/dist/esm/presentation/timeboxes/reducer.js +616 -0
- package/dist/esm/presentation/timeboxes/reducer.js.map +1 -0
- package/dist/esm/presentation/timeboxes/scheduler.d.ts +63 -0
- package/dist/esm/presentation/timeboxes/scheduler.d.ts.map +1 -0
- package/dist/esm/presentation/timeboxes/scheduler.js +120 -0
- package/dist/esm/presentation/timeboxes/scheduler.js.map +1 -0
- package/dist/esm/presentation/timeboxes/store.d.ts +23 -0
- package/dist/esm/presentation/timeboxes/store.d.ts.map +1 -0
- package/dist/esm/presentation/timeboxes/store.js +46 -0
- package/dist/esm/presentation/timeboxes/store.js.map +1 -0
- package/dist/esm/presentation/timeboxes/timeBlocks.d.ts +10 -0
- package/dist/esm/presentation/timeboxes/timeBlocks.d.ts.map +1 -0
- package/dist/esm/presentation/timeboxes/timeBlocks.js +1767 -0
- package/dist/esm/presentation/timeboxes/timeBlocks.js.map +1 -0
- package/dist/esm/presentation/timeboxes/timeboxSettings.d.ts +71 -0
- package/dist/esm/presentation/timeboxes/timeboxSettings.d.ts.map +1 -0
- package/dist/esm/presentation/timeboxes/timeboxSettings.js +302 -0
- package/dist/esm/presentation/timeboxes/timeboxSettings.js.map +1 -0
- package/dist/esm/presentation/timeboxes/tracked.d.ts +51 -0
- package/dist/esm/presentation/timeboxes/tracked.d.ts.map +1 -0
- package/dist/esm/presentation/timeboxes/tracked.js +136 -0
- package/dist/esm/presentation/timeboxes/tracked.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.initialState = exports.WEEK_START = exports.WEEK_END = exports.WEEK_DAYS = exports.USERS = exports.TODAY = exports.TIME_RECORDS = exports.TASKS = exports.SUBTASKS = exports.SETTINGS = exports.PROJECTS = exports.PARTS = exports.ME = exports.EVENTS = void 0;
|
|
7
|
+
var _model = require("./model");
|
|
8
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
12
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
13
|
+
/* The simulated week: Mon 2 – Fri 6 Nov 2026, "today" is Wednesday. */
|
|
14
|
+
var WEEK_START = exports.WEEK_START = "2026-11-02";
|
|
15
|
+
var WEEK_END = exports.WEEK_END = "2026-11-06";
|
|
16
|
+
var WEEK_DAYS = exports.WEEK_DAYS = (0, _model.datesBetween)(WEEK_START, WEEK_END);
|
|
17
|
+
var TODAY = exports.TODAY = "2026-11-04";
|
|
18
|
+
var FULL_WEEK = {
|
|
19
|
+
1: 480,
|
|
20
|
+
2: 480,
|
|
21
|
+
3: 480,
|
|
22
|
+
4: 480,
|
|
23
|
+
5: 480
|
|
24
|
+
};
|
|
25
|
+
var ME = exports.ME = 1;
|
|
26
|
+
var USERS = exports.USERS = [{
|
|
27
|
+
id: ME,
|
|
28
|
+
name: "Marko Stamenkovic",
|
|
29
|
+
capacity: FULL_WEEK
|
|
30
|
+
}, {
|
|
31
|
+
id: 2,
|
|
32
|
+
name: "Ana Petrovic",
|
|
33
|
+
capacity: FULL_WEEK
|
|
34
|
+
}, {
|
|
35
|
+
id: 3,
|
|
36
|
+
name: "Ivan Jovanovic",
|
|
37
|
+
capacity: _objectSpread(_objectSpread({}, FULL_WEEK), {}, {
|
|
38
|
+
5: 240
|
|
39
|
+
})
|
|
40
|
+
}];
|
|
41
|
+
var PROJECTS = exports.PROJECTS = [{
|
|
42
|
+
id: 11,
|
|
43
|
+
name: "Website Redesign",
|
|
44
|
+
company: "ActiveCollab Inc.",
|
|
45
|
+
color: "#91C1FE"
|
|
46
|
+
}, {
|
|
47
|
+
id: 12,
|
|
48
|
+
name: "Platform API",
|
|
49
|
+
company: "ActiveCollab Inc.",
|
|
50
|
+
color: "#F5AA80"
|
|
51
|
+
}, {
|
|
52
|
+
id: 13,
|
|
53
|
+
name: "Mobile App",
|
|
54
|
+
company: "Northwind Traders",
|
|
55
|
+
color: "#C2B0FB"
|
|
56
|
+
}];
|
|
57
|
+
var task = function task(fields) {
|
|
58
|
+
return _objectSpread({
|
|
59
|
+
isImportant: false,
|
|
60
|
+
isCompleted: false
|
|
61
|
+
}, fields);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
/* Marko's tasks are the brief's A–F, in My Work order; Ana's and Ivan's
|
|
65
|
+
feed the Workload only. Estimates in minutes. */
|
|
66
|
+
var TASKS = exports.TASKS = [/* A */task({
|
|
67
|
+
id: 101,
|
|
68
|
+
projectId: 11,
|
|
69
|
+
name: "Homepage hero copy",
|
|
70
|
+
startOn: "2026-11-04",
|
|
71
|
+
dueOn: "2026-11-04",
|
|
72
|
+
position: 1,
|
|
73
|
+
assigneeId: ME,
|
|
74
|
+
estimate: 60
|
|
75
|
+
}), /* B */task({
|
|
76
|
+
id: 102,
|
|
77
|
+
projectId: 12,
|
|
78
|
+
name: "API rate limits",
|
|
79
|
+
startOn: "2026-11-04",
|
|
80
|
+
dueOn: "2026-11-04",
|
|
81
|
+
position: 2,
|
|
82
|
+
assigneeId: ME,
|
|
83
|
+
estimate: 90
|
|
84
|
+
}), /* C */task({
|
|
85
|
+
id: 103,
|
|
86
|
+
projectId: 11,
|
|
87
|
+
name: "Onboarding emails",
|
|
88
|
+
startOn: "2026-11-04",
|
|
89
|
+
dueOn: "2026-11-04",
|
|
90
|
+
position: 3,
|
|
91
|
+
assigneeId: ME,
|
|
92
|
+
estimate: 120
|
|
93
|
+
}), /* D */task({
|
|
94
|
+
id: 104,
|
|
95
|
+
projectId: 12,
|
|
96
|
+
name: "Workload export",
|
|
97
|
+
startOn: "2026-11-02",
|
|
98
|
+
dueOn: "2026-11-05",
|
|
99
|
+
position: 4,
|
|
100
|
+
assigneeId: ME,
|
|
101
|
+
estimate: 360
|
|
102
|
+
}), /* E */task({
|
|
103
|
+
id: 105,
|
|
104
|
+
projectId: 13,
|
|
105
|
+
name: "Release notes",
|
|
106
|
+
startOn: "2026-11-03",
|
|
107
|
+
dueOn: "2026-11-06",
|
|
108
|
+
position: 5,
|
|
109
|
+
assigneeId: ME,
|
|
110
|
+
estimate: 480
|
|
111
|
+
}), /* F */task({
|
|
112
|
+
id: 106,
|
|
113
|
+
projectId: 11,
|
|
114
|
+
name: "Fix login copy",
|
|
115
|
+
startOn: "2026-11-04",
|
|
116
|
+
dueOn: "2026-11-04",
|
|
117
|
+
position: 6,
|
|
118
|
+
assigneeId: ME,
|
|
119
|
+
estimate: null
|
|
120
|
+
}), task({
|
|
121
|
+
id: 201,
|
|
122
|
+
projectId: 11,
|
|
123
|
+
name: "Design QA pass",
|
|
124
|
+
startOn: "2026-11-02",
|
|
125
|
+
dueOn: "2026-11-04",
|
|
126
|
+
position: 1,
|
|
127
|
+
assigneeId: 2,
|
|
128
|
+
estimate: 720
|
|
129
|
+
}), task({
|
|
130
|
+
id: 202,
|
|
131
|
+
projectId: 13,
|
|
132
|
+
name: "Icon refresh",
|
|
133
|
+
startOn: "2026-11-03",
|
|
134
|
+
dueOn: "2026-11-06",
|
|
135
|
+
position: 2,
|
|
136
|
+
assigneeId: 2,
|
|
137
|
+
estimate: 600
|
|
138
|
+
}), task({
|
|
139
|
+
id: 301,
|
|
140
|
+
projectId: 12,
|
|
141
|
+
name: "Billing webhooks",
|
|
142
|
+
startOn: "2026-11-02",
|
|
143
|
+
dueOn: "2026-11-06",
|
|
144
|
+
position: 1,
|
|
145
|
+
assigneeId: 3,
|
|
146
|
+
estimate: 1200
|
|
147
|
+
}), task({
|
|
148
|
+
id: 302,
|
|
149
|
+
projectId: 12,
|
|
150
|
+
name: "Fix CSV import",
|
|
151
|
+
startOn: "2026-11-05",
|
|
152
|
+
dueOn: "2026-11-06",
|
|
153
|
+
position: 2,
|
|
154
|
+
assigneeId: 3,
|
|
155
|
+
estimate: 240
|
|
156
|
+
})];
|
|
157
|
+
var SUBTASKS = exports.SUBTASKS = [{
|
|
158
|
+
id: 9001,
|
|
159
|
+
taskId: 101,
|
|
160
|
+
name: "Review copy",
|
|
161
|
+
dueOn: "2026-11-04",
|
|
162
|
+
isCompleted: false
|
|
163
|
+
}];
|
|
164
|
+
|
|
165
|
+
/* A and B are pinned; D is split 1h30 a day with an hour pinned on
|
|
166
|
+
Thursday; Ana's QA pass and Ivan's CSV fix are split too. */
|
|
167
|
+
var PARTS = exports.PARTS = [{
|
|
168
|
+
id: "p1",
|
|
169
|
+
taskId: 101,
|
|
170
|
+
date: "2026-11-04",
|
|
171
|
+
startsOnTime: "09:30",
|
|
172
|
+
durationMinutes: 60
|
|
173
|
+
}, {
|
|
174
|
+
id: "p2",
|
|
175
|
+
taskId: 102,
|
|
176
|
+
date: "2026-11-04",
|
|
177
|
+
startsOnTime: "11:00",
|
|
178
|
+
durationMinutes: 90
|
|
179
|
+
}, {
|
|
180
|
+
id: "p3",
|
|
181
|
+
taskId: 104,
|
|
182
|
+
date: "2026-11-02",
|
|
183
|
+
startsOnTime: null,
|
|
184
|
+
durationMinutes: 90
|
|
185
|
+
}, {
|
|
186
|
+
id: "p4",
|
|
187
|
+
taskId: 104,
|
|
188
|
+
date: "2026-11-03",
|
|
189
|
+
startsOnTime: null,
|
|
190
|
+
durationMinutes: 90
|
|
191
|
+
}, {
|
|
192
|
+
id: "p5",
|
|
193
|
+
taskId: 104,
|
|
194
|
+
date: "2026-11-04",
|
|
195
|
+
startsOnTime: null,
|
|
196
|
+
durationMinutes: 90
|
|
197
|
+
}, {
|
|
198
|
+
id: "p6",
|
|
199
|
+
taskId: 104,
|
|
200
|
+
date: "2026-11-05",
|
|
201
|
+
startsOnTime: "10:00",
|
|
202
|
+
durationMinutes: 60
|
|
203
|
+
}, {
|
|
204
|
+
id: "p7",
|
|
205
|
+
taskId: 104,
|
|
206
|
+
date: "2026-11-05",
|
|
207
|
+
startsOnTime: null,
|
|
208
|
+
durationMinutes: 30
|
|
209
|
+
}, {
|
|
210
|
+
id: "p8",
|
|
211
|
+
taskId: 201,
|
|
212
|
+
date: "2026-11-02",
|
|
213
|
+
startsOnTime: null,
|
|
214
|
+
durationMinutes: 300
|
|
215
|
+
}, {
|
|
216
|
+
id: "p9",
|
|
217
|
+
taskId: 201,
|
|
218
|
+
date: "2026-11-03",
|
|
219
|
+
startsOnTime: null,
|
|
220
|
+
durationMinutes: 240
|
|
221
|
+
}, {
|
|
222
|
+
id: "p10",
|
|
223
|
+
taskId: 201,
|
|
224
|
+
date: "2026-11-04",
|
|
225
|
+
startsOnTime: null,
|
|
226
|
+
durationMinutes: 180
|
|
227
|
+
}, {
|
|
228
|
+
id: "p11",
|
|
229
|
+
taskId: 302,
|
|
230
|
+
date: "2026-11-05",
|
|
231
|
+
startsOnTime: "13:00",
|
|
232
|
+
durationMinutes: 120
|
|
233
|
+
}, {
|
|
234
|
+
id: "p12",
|
|
235
|
+
taskId: 302,
|
|
236
|
+
date: "2026-11-05",
|
|
237
|
+
startsOnTime: null,
|
|
238
|
+
durationMinutes: 60
|
|
239
|
+
}, {
|
|
240
|
+
id: "p13",
|
|
241
|
+
taskId: 302,
|
|
242
|
+
date: "2026-11-06",
|
|
243
|
+
startsOnTime: null,
|
|
244
|
+
durationMinutes: 60
|
|
245
|
+
}];
|
|
246
|
+
var EVENTS = exports.EVENTS = [{
|
|
247
|
+
id: 1,
|
|
248
|
+
name: "Sprint planning",
|
|
249
|
+
calendarName: "Team",
|
|
250
|
+
color: "#63A7DE",
|
|
251
|
+
date: "2026-11-04",
|
|
252
|
+
startsOnTime: "14:00",
|
|
253
|
+
endsOnTime: "15:00",
|
|
254
|
+
isParticipant: true,
|
|
255
|
+
meetingUrl: "https://zoom.us/j/84213377610"
|
|
256
|
+
}];
|
|
257
|
+
|
|
258
|
+
/* Marko's tracked time, against the plan planDay() gives:
|
|
259
|
+
- Mon: D 1h of its 1h30 suggestion (a past day partly done);
|
|
260
|
+
- Tue: D 1h30 (full), E 2h30 of its 2h (30m past its blocks);
|
|
261
|
+
- Wed: A 1h on its 09:30–10:30 timebox; C 45m on 09:00–09:30 and
|
|
262
|
+
10:30–10:45, nothing on 12:30–13:30; B nothing yet. */
|
|
263
|
+
var TIME_RECORDS = exports.TIME_RECORDS = [{
|
|
264
|
+
id: "t1",
|
|
265
|
+
taskId: 104,
|
|
266
|
+
userId: ME,
|
|
267
|
+
recordDate: "2026-11-02",
|
|
268
|
+
minutes: 60
|
|
269
|
+
}, {
|
|
270
|
+
id: "t2",
|
|
271
|
+
taskId: 104,
|
|
272
|
+
userId: ME,
|
|
273
|
+
recordDate: "2026-11-03",
|
|
274
|
+
minutes: 90
|
|
275
|
+
}, {
|
|
276
|
+
id: "t3",
|
|
277
|
+
taskId: 105,
|
|
278
|
+
userId: ME,
|
|
279
|
+
recordDate: "2026-11-03",
|
|
280
|
+
minutes: 150
|
|
281
|
+
}, {
|
|
282
|
+
id: "t4",
|
|
283
|
+
taskId: 101,
|
|
284
|
+
userId: ME,
|
|
285
|
+
recordDate: "2026-11-04",
|
|
286
|
+
minutes: 60
|
|
287
|
+
}, {
|
|
288
|
+
id: "t5",
|
|
289
|
+
taskId: 103,
|
|
290
|
+
userId: ME,
|
|
291
|
+
recordDate: "2026-11-04",
|
|
292
|
+
minutes: 45
|
|
293
|
+
}];
|
|
294
|
+
var SETTINGS = exports.SETTINGS = {
|
|
295
|
+
workdayStartsAt: "09:00",
|
|
296
|
+
minGapMinutes: 15,
|
|
297
|
+
pause: null
|
|
298
|
+
};
|
|
299
|
+
var initialState = exports.initialState = function initialState() {
|
|
300
|
+
return {
|
|
301
|
+
tasks: TASKS.map(function (item) {
|
|
302
|
+
return _objectSpread({}, item);
|
|
303
|
+
}),
|
|
304
|
+
subtasks: SUBTASKS.map(function (item) {
|
|
305
|
+
return _objectSpread({}, item);
|
|
306
|
+
}),
|
|
307
|
+
parts: PARTS.map(function (item) {
|
|
308
|
+
return _objectSpread({}, item);
|
|
309
|
+
}),
|
|
310
|
+
events: EVENTS.map(function (item) {
|
|
311
|
+
return _objectSpread({}, item);
|
|
312
|
+
}),
|
|
313
|
+
settings: _objectSpread({}, SETTINGS),
|
|
314
|
+
timeRecords: TIME_RECORDS.map(function (item) {
|
|
315
|
+
return _objectSpread({}, item);
|
|
316
|
+
}),
|
|
317
|
+
nextId: 100
|
|
318
|
+
};
|
|
319
|
+
};
|
|
320
|
+
//# sourceMappingURL=mockData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mockData.js","names":["_model","require","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","WEEK_START","exports","WEEK_END","WEEK_DAYS","datesBetween","TODAY","FULL_WEEK","ME","USERS","id","name","capacity","PROJECTS","company","color","task","fields","isImportant","isCompleted","TASKS","projectId","startOn","dueOn","position","assigneeId","estimate","SUBTASKS","taskId","PARTS","date","startsOnTime","durationMinutes","EVENTS","calendarName","endsOnTime","isParticipant","meetingUrl","TIME_RECORDS","userId","recordDate","minutes","SETTINGS","workdayStartsAt","minGapMinutes","pause","initialState","tasks","map","item","subtasks","parts","events","settings","timeRecords","nextId"],"sources":["../../../../src/presentation/timeboxes/mockData.ts"],"sourcesContent":["import {\n DateKey,\n TbEvent,\n TbPart,\n TbProject,\n TbSettings,\n TbState,\n TbSubtask,\n TbTask,\n TbTimeRecord,\n TbUser,\n datesBetween,\n} from \"./model\";\n\n/* The simulated week: Mon 2 – Fri 6 Nov 2026, \"today\" is Wednesday. */\nexport const WEEK_START: DateKey = \"2026-11-02\";\nexport const WEEK_END: DateKey = \"2026-11-06\";\nexport const WEEK_DAYS: DateKey[] = datesBetween(WEEK_START, WEEK_END);\nexport const TODAY: DateKey = \"2026-11-04\";\n\nconst FULL_WEEK = { 1: 480, 2: 480, 3: 480, 4: 480, 5: 480 };\n\nexport const ME = 1;\n\nexport const USERS: TbUser[] = [\n { id: ME, name: \"Marko Stamenkovic\", capacity: FULL_WEEK },\n { id: 2, name: \"Ana Petrovic\", capacity: FULL_WEEK },\n { id: 3, name: \"Ivan Jovanovic\", capacity: { ...FULL_WEEK, 5: 240 } },\n];\n\nexport const PROJECTS: TbProject[] = [\n {\n id: 11,\n name: \"Website Redesign\",\n company: \"ActiveCollab Inc.\",\n color: \"#91C1FE\",\n },\n {\n id: 12,\n name: \"Platform API\",\n company: \"ActiveCollab Inc.\",\n color: \"#F5AA80\",\n },\n {\n id: 13,\n name: \"Mobile App\",\n company: \"Northwind Traders\",\n color: \"#C2B0FB\",\n },\n];\n\nconst task = (\n fields: Omit<TbTask, \"isImportant\" | \"isCompleted\"> &\n Partial<Pick<TbTask, \"isImportant\" | \"isCompleted\">>\n): TbTask => ({ isImportant: false, isCompleted: false, ...fields });\n\n/* Marko's tasks are the brief's A–F, in My Work order; Ana's and Ivan's\n feed the Workload only. Estimates in minutes. */\nexport const TASKS: TbTask[] = [\n /* A */ task({\n id: 101,\n projectId: 11,\n name: \"Homepage hero copy\",\n startOn: \"2026-11-04\",\n dueOn: \"2026-11-04\",\n position: 1,\n assigneeId: ME,\n estimate: 60,\n }),\n /* B */ task({\n id: 102,\n projectId: 12,\n name: \"API rate limits\",\n startOn: \"2026-11-04\",\n dueOn: \"2026-11-04\",\n position: 2,\n assigneeId: ME,\n estimate: 90,\n }),\n /* C */ task({\n id: 103,\n projectId: 11,\n name: \"Onboarding emails\",\n startOn: \"2026-11-04\",\n dueOn: \"2026-11-04\",\n position: 3,\n assigneeId: ME,\n estimate: 120,\n }),\n /* D */ task({\n id: 104,\n projectId: 12,\n name: \"Workload export\",\n startOn: \"2026-11-02\",\n dueOn: \"2026-11-05\",\n position: 4,\n assigneeId: ME,\n estimate: 360,\n }),\n /* E */ task({\n id: 105,\n projectId: 13,\n name: \"Release notes\",\n startOn: \"2026-11-03\",\n dueOn: \"2026-11-06\",\n position: 5,\n assigneeId: ME,\n estimate: 480,\n }),\n /* F */ task({\n id: 106,\n projectId: 11,\n name: \"Fix login copy\",\n startOn: \"2026-11-04\",\n dueOn: \"2026-11-04\",\n position: 6,\n assigneeId: ME,\n estimate: null,\n }),\n task({\n id: 201,\n projectId: 11,\n name: \"Design QA pass\",\n startOn: \"2026-11-02\",\n dueOn: \"2026-11-04\",\n position: 1,\n assigneeId: 2,\n estimate: 720,\n }),\n task({\n id: 202,\n projectId: 13,\n name: \"Icon refresh\",\n startOn: \"2026-11-03\",\n dueOn: \"2026-11-06\",\n position: 2,\n assigneeId: 2,\n estimate: 600,\n }),\n task({\n id: 301,\n projectId: 12,\n name: \"Billing webhooks\",\n startOn: \"2026-11-02\",\n dueOn: \"2026-11-06\",\n position: 1,\n assigneeId: 3,\n estimate: 1200,\n }),\n task({\n id: 302,\n projectId: 12,\n name: \"Fix CSV import\",\n startOn: \"2026-11-05\",\n dueOn: \"2026-11-06\",\n position: 2,\n assigneeId: 3,\n estimate: 240,\n }),\n];\n\nexport const SUBTASKS: TbSubtask[] = [\n {\n id: 9001,\n taskId: 101,\n name: \"Review copy\",\n dueOn: \"2026-11-04\",\n isCompleted: false,\n },\n];\n\n/* A and B are pinned; D is split 1h30 a day with an hour pinned on\n Thursday; Ana's QA pass and Ivan's CSV fix are split too. */\nexport const PARTS: TbPart[] = [\n {\n id: \"p1\",\n taskId: 101,\n date: \"2026-11-04\",\n startsOnTime: \"09:30\",\n durationMinutes: 60,\n },\n {\n id: \"p2\",\n taskId: 102,\n date: \"2026-11-04\",\n startsOnTime: \"11:00\",\n durationMinutes: 90,\n },\n {\n id: \"p3\",\n taskId: 104,\n date: \"2026-11-02\",\n startsOnTime: null,\n durationMinutes: 90,\n },\n {\n id: \"p4\",\n taskId: 104,\n date: \"2026-11-03\",\n startsOnTime: null,\n durationMinutes: 90,\n },\n {\n id: \"p5\",\n taskId: 104,\n date: \"2026-11-04\",\n startsOnTime: null,\n durationMinutes: 90,\n },\n {\n id: \"p6\",\n taskId: 104,\n date: \"2026-11-05\",\n startsOnTime: \"10:00\",\n durationMinutes: 60,\n },\n {\n id: \"p7\",\n taskId: 104,\n date: \"2026-11-05\",\n startsOnTime: null,\n durationMinutes: 30,\n },\n {\n id: \"p8\",\n taskId: 201,\n date: \"2026-11-02\",\n startsOnTime: null,\n durationMinutes: 300,\n },\n {\n id: \"p9\",\n taskId: 201,\n date: \"2026-11-03\",\n startsOnTime: null,\n durationMinutes: 240,\n },\n {\n id: \"p10\",\n taskId: 201,\n date: \"2026-11-04\",\n startsOnTime: null,\n durationMinutes: 180,\n },\n {\n id: \"p11\",\n taskId: 302,\n date: \"2026-11-05\",\n startsOnTime: \"13:00\",\n durationMinutes: 120,\n },\n {\n id: \"p12\",\n taskId: 302,\n date: \"2026-11-05\",\n startsOnTime: null,\n durationMinutes: 60,\n },\n {\n id: \"p13\",\n taskId: 302,\n date: \"2026-11-06\",\n startsOnTime: null,\n durationMinutes: 60,\n },\n];\n\nexport const EVENTS: TbEvent[] = [\n {\n id: 1,\n name: \"Sprint planning\",\n calendarName: \"Team\",\n color: \"#63A7DE\",\n date: \"2026-11-04\",\n startsOnTime: \"14:00\",\n endsOnTime: \"15:00\",\n isParticipant: true,\n meetingUrl: \"https://zoom.us/j/84213377610\",\n },\n];\n\n/* Marko's tracked time, against the plan planDay() gives:\n - Mon: D 1h of its 1h30 suggestion (a past day partly done);\n - Tue: D 1h30 (full), E 2h30 of its 2h (30m past its blocks);\n - Wed: A 1h on its 09:30–10:30 timebox; C 45m on 09:00–09:30 and\n 10:30–10:45, nothing on 12:30–13:30; B nothing yet. */\nexport const TIME_RECORDS: TbTimeRecord[] = [\n { id: \"t1\", taskId: 104, userId: ME, recordDate: \"2026-11-02\", minutes: 60 },\n { id: \"t2\", taskId: 104, userId: ME, recordDate: \"2026-11-03\", minutes: 90 },\n { id: \"t3\", taskId: 105, userId: ME, recordDate: \"2026-11-03\", minutes: 150 },\n { id: \"t4\", taskId: 101, userId: ME, recordDate: \"2026-11-04\", minutes: 60 },\n { id: \"t5\", taskId: 103, userId: ME, recordDate: \"2026-11-04\", minutes: 45 },\n];\n\nexport const SETTINGS: TbSettings = {\n workdayStartsAt: \"09:00\",\n minGapMinutes: 15,\n pause: null,\n};\n\nexport const initialState = (): TbState => ({\n tasks: TASKS.map((item) => ({ ...item })),\n subtasks: SUBTASKS.map((item) => ({ ...item })),\n parts: PARTS.map((item) => ({ ...item })),\n events: EVENTS.map((item) => ({ ...item })),\n settings: { ...SETTINGS },\n timeRecords: TIME_RECORDS.map((item) => ({ ...item })),\n nextId: 100,\n});\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAYiB,SAAAC,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAZ,CAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAY,SAAA,CAAAC,MAAA,EAAAb,CAAA,UAAAC,CAAA,WAAAW,SAAA,CAAAZ,CAAA,IAAAY,SAAA,CAAAZ,CAAA,QAAAA,CAAA,OAAAF,OAAA,CAAAI,MAAA,CAAAD,CAAA,OAAAa,OAAA,WAAAd,CAAA,IAAAe,eAAA,CAAAhB,CAAA,EAAAC,CAAA,EAAAC,CAAA,CAAAD,CAAA,SAAAE,MAAA,CAAAc,yBAAA,GAAAd,MAAA,CAAAe,gBAAA,CAAAlB,CAAA,EAAAG,MAAA,CAAAc,yBAAA,CAAAf,CAAA,KAAAH,OAAA,CAAAI,MAAA,CAAAD,CAAA,GAAAa,OAAA,WAAAd,CAAA,IA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Y,CAACU,GAAG,CAAC,UAACC,IAAI;MAAA,OAAApE,aAAA,KAAWoE,IAAI;IAAA,CAAG,CAAC;IACtDM,MAAM,EAAE;EACV,CAAC;AAAA,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.untimedPartOn = exports.untimedOn = exports.timeboxesOn = exports.snapDown = exports.snap = exports.rangeOf = exports.pinnedOn = exports.partsOf = exports.overlaps = exports.minutesToClock = exports.isoWeekday = exports.isTimebox = exports.isSplit = exports.formatMinutes = exports.evenSpread = exports.datesBetween = exports.clockToMinutes = exports.capacityOn = exports.availableDays = exports.allocationOn = exports.addDays = exports.SNAP_MINUTES = exports.MIN_GAP_OPTIONS = exports.MINUTES_PER_DAY = void 0;
|
|
7
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
8
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
10
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
11
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
13
|
+
/**
|
|
14
|
+
* Timeboxes — the model behind the "Timeboxes – Agenda Day" and
|
|
15
|
+
* "Timeboxes – Workload" simulations.
|
|
16
|
+
*
|
|
17
|
+
* An estimate split and a timebox are the same thing: a task's split is a
|
|
18
|
+
* list of parts, one untimed part per day (it feeds suggestions) and any
|
|
19
|
+
* number of timed parts (pinned timeboxes). A day's allocation is the sum of
|
|
20
|
+
* the task's parts on that day; the estimate is the sum of all parts.
|
|
21
|
+
*
|
|
22
|
+
* All math is in whole minutes. Dates are "YYYY-MM-DD", clocks "HH:MM".
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
var MINUTES_PER_DAY = exports.MINUTES_PER_DAY = 24 * 60;
|
|
26
|
+
|
|
27
|
+
/** Durations and start times snap to this. */
|
|
28
|
+
var SNAP_MINUTES = exports.SNAP_MINUTES = 5;
|
|
29
|
+
var MIN_GAP_OPTIONS = exports.MIN_GAP_OPTIONS = [5, 10, 15, 30, 60];
|
|
30
|
+
|
|
31
|
+
/* ------------------------------------------------------------------ */
|
|
32
|
+
/* Payload shapes */
|
|
33
|
+
/* ------------------------------------------------------------------ */
|
|
34
|
+
|
|
35
|
+
/** Everything the simulation changes. Projects and users are fixed. */
|
|
36
|
+
|
|
37
|
+
/* ------------------------------------------------------------------ */
|
|
38
|
+
/* Time */
|
|
39
|
+
/* ------------------------------------------------------------------ */
|
|
40
|
+
|
|
41
|
+
var clockToMinutes = exports.clockToMinutes = function clockToMinutes(clock) {
|
|
42
|
+
var _clock$split$map = clock.split(":").map(Number),
|
|
43
|
+
_clock$split$map2 = _slicedToArray(_clock$split$map, 2),
|
|
44
|
+
hours = _clock$split$map2[0],
|
|
45
|
+
minutes = _clock$split$map2[1];
|
|
46
|
+
return hours * 60 + minutes;
|
|
47
|
+
};
|
|
48
|
+
var minutesToClock = exports.minutesToClock = function minutesToClock(minutes) {
|
|
49
|
+
return "".concat(String(Math.floor(minutes / 60)).padStart(2, "0"), ":").concat(String(minutes % 60).padStart(2, "0"));
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/** Down to the 5-minute grid. */
|
|
53
|
+
var snapDown = exports.snapDown = function snapDown(minutes) {
|
|
54
|
+
return Math.floor(minutes / SNAP_MINUTES) * SNAP_MINUTES;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/** To the nearest step of the 5-minute grid. */
|
|
58
|
+
var snap = exports.snap = function snap(minutes) {
|
|
59
|
+
return Math.round(minutes / SNAP_MINUTES) * SNAP_MINUTES;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/** "1h", "1h30", "45m" — the concept's hours. */
|
|
63
|
+
var formatMinutes = exports.formatMinutes = function formatMinutes(minutes) {
|
|
64
|
+
var hours = Math.floor(minutes / 60);
|
|
65
|
+
var rest = minutes % 60;
|
|
66
|
+
if (hours === 0) return "".concat(rest, "m");
|
|
67
|
+
return rest === 0 ? "".concat(hours, "h") : "".concat(hours, "h").concat(String(rest).padStart(2, "0"));
|
|
68
|
+
};
|
|
69
|
+
var toUtc = function toUtc(date) {
|
|
70
|
+
return new Date("".concat(date, "T00:00:00Z"));
|
|
71
|
+
};
|
|
72
|
+
var addDays = exports.addDays = function addDays(date, days) {
|
|
73
|
+
var next = toUtc(date);
|
|
74
|
+
next.setUTCDate(next.getUTCDate() + days);
|
|
75
|
+
return next.toISOString().slice(0, 10);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/** ISO weekday, 1 = Monday … 7 = Sunday. */
|
|
79
|
+
var isoWeekday = exports.isoWeekday = function isoWeekday(date) {
|
|
80
|
+
return (toUtc(date).getUTCDay() + 6) % 7 + 1;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/** Every date from start to end, both included. */
|
|
84
|
+
var datesBetween = exports.datesBetween = function datesBetween(start, end) {
|
|
85
|
+
var dates = [];
|
|
86
|
+
for (var date = start; date <= end; date = addDays(date, 1)) {
|
|
87
|
+
dates.push(date);
|
|
88
|
+
}
|
|
89
|
+
return dates;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
/* ------------------------------------------------------------------ */
|
|
93
|
+
/* Availability and allocation */
|
|
94
|
+
/* ------------------------------------------------------------------ */
|
|
95
|
+
|
|
96
|
+
var capacityOn = exports.capacityOn = function capacityOn(user, date) {
|
|
97
|
+
var _user$capacity$isoWee;
|
|
98
|
+
return (_user$capacity$isoWee = user.capacity[isoWeekday(date)]) !== null && _user$capacity$isoWee !== void 0 ? _user$capacity$isoWee : 0;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
/** The days in the task's range the assignee works (TaskSplitterByAssignee
|
|
102
|
+
gives the other days 0). */
|
|
103
|
+
var availableDays = exports.availableDays = function availableDays(task, user) {
|
|
104
|
+
return datesBetween(task.startOn, task.dueOn).filter(function (date) {
|
|
105
|
+
return capacityOn(user, date) > 0;
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* An even spread of whole minutes over days, as the app's add(): each day
|
|
111
|
+
* the total over the day count, rounded down to whole minutes, with the
|
|
112
|
+
* leftover minutes on the last days so the parts still sum to the total.
|
|
113
|
+
*/
|
|
114
|
+
var evenSpread = exports.evenSpread = function evenSpread(total, days) {
|
|
115
|
+
var spread = new Map();
|
|
116
|
+
if (days.length === 0) return spread;
|
|
117
|
+
var base = Math.floor(total / days.length);
|
|
118
|
+
var leftover = total - base * days.length;
|
|
119
|
+
days.forEach(function (date, index) {
|
|
120
|
+
spread.set(date, base + (index >= days.length - leftover ? 1 : 0));
|
|
121
|
+
});
|
|
122
|
+
return spread;
|
|
123
|
+
};
|
|
124
|
+
var partsOf = exports.partsOf = function partsOf(state, taskId) {
|
|
125
|
+
return state.parts.filter(function (part) {
|
|
126
|
+
return part.taskId === taskId;
|
|
127
|
+
});
|
|
128
|
+
};
|
|
129
|
+
var isSplit = exports.isSplit = function isSplit(state, taskId) {
|
|
130
|
+
return state.parts.some(function (part) {
|
|
131
|
+
return part.taskId === taskId;
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
var isTimebox = exports.isTimebox = function isTimebox(part) {
|
|
135
|
+
return part.startsOnTime !== null;
|
|
136
|
+
};
|
|
137
|
+
var timeboxesOn = exports.timeboxesOn = function timeboxesOn(state, taskId, date) {
|
|
138
|
+
return partsOf(state, taskId).filter(function (part) {
|
|
139
|
+
return part.date === date && isTimebox(part);
|
|
140
|
+
}).sort(function (a, b) {
|
|
141
|
+
var _a$startsOnTime, _b$startsOnTime;
|
|
142
|
+
return clockToMinutes((_a$startsOnTime = a.startsOnTime) !== null && _a$startsOnTime !== void 0 ? _a$startsOnTime : "00:00") - clockToMinutes((_b$startsOnTime = b.startsOnTime) !== null && _b$startsOnTime !== void 0 ? _b$startsOnTime : "00:00");
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
var untimedPartOn = exports.untimedPartOn = function untimedPartOn(state, taskId, date) {
|
|
146
|
+
return state.parts.find(function (part) {
|
|
147
|
+
return part.taskId === taskId && part.date === date && part.startsOnTime === null;
|
|
148
|
+
});
|
|
149
|
+
};
|
|
150
|
+
var sum = function sum(parts) {
|
|
151
|
+
return parts.reduce(function (total, part) {
|
|
152
|
+
return total + part.durationMinutes;
|
|
153
|
+
}, 0);
|
|
154
|
+
};
|
|
155
|
+
var pinnedOn = exports.pinnedOn = function pinnedOn(state, taskId, date) {
|
|
156
|
+
return sum(timeboxesOn(state, taskId, date));
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
/** The day's allocation: the parts on it once split, else the even share. */
|
|
160
|
+
var allocationOn = exports.allocationOn = function allocationOn(state, task, user, date) {
|
|
161
|
+
var _evenSpread$get;
|
|
162
|
+
if (isSplit(state, task.id)) {
|
|
163
|
+
return sum(partsOf(state, task.id).filter(function (part) {
|
|
164
|
+
return part.date === date;
|
|
165
|
+
}));
|
|
166
|
+
}
|
|
167
|
+
if (task.estimate === null) return 0;
|
|
168
|
+
return (_evenSpread$get = evenSpread(task.estimate, availableDays(task, user)).get(date)) !== null && _evenSpread$get !== void 0 ? _evenSpread$get : 0;
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
/** What the day still leaves to suggestions: allocation − pinned. */
|
|
172
|
+
var untimedOn = exports.untimedOn = function untimedOn(state, task, user, date) {
|
|
173
|
+
return allocationOn(state, task, user, date) - pinnedOn(state, task.id, date);
|
|
174
|
+
};
|
|
175
|
+
var rangeOf = exports.rangeOf = function rangeOf(part) {
|
|
176
|
+
var _part$startsOnTime;
|
|
177
|
+
var start = clockToMinutes((_part$startsOnTime = part.startsOnTime) !== null && _part$startsOnTime !== void 0 ? _part$startsOnTime : "00:00");
|
|
178
|
+
return {
|
|
179
|
+
start,
|
|
180
|
+
end: start + part.durationMinutes
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
var overlaps = exports.overlaps = function overlaps(a, b) {
|
|
184
|
+
return a.start < b.end && b.start < a.end;
|
|
185
|
+
};
|
|
186
|
+
//# sourceMappingURL=model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.js","names":["MINUTES_PER_DAY","exports","SNAP_MINUTES","MIN_GAP_OPTIONS","clockToMinutes","clock","_clock$split$map","split","map","Number","_clock$split$map2","_slicedToArray","hours","minutes","minutesToClock","concat","String","Math","floor","padStart","snapDown","snap","round","formatMinutes","rest","toUtc","date","Date","addDays","days","next","setUTCDate","getUTCDate","toISOString","slice","isoWeekday","getUTCDay","datesBetween","start","end","dates","push","capacityOn","user","_user$capacity$isoWee","capacity","availableDays","task","startOn","dueOn","filter","evenSpread","total","spread","Map","length","base","leftover","forEach","index","set","partsOf","state","taskId","parts","part","isSplit","some","isTimebox","startsOnTime","timeboxesOn","sort","a","b","_a$startsOnTime","_b$startsOnTime","untimedPartOn","find","sum","reduce","durationMinutes","pinnedOn","allocationOn","_evenSpread$get","id","estimate","get","untimedOn","rangeOf","_part$startsOnTime","overlaps"],"sources":["../../../../src/presentation/timeboxes/model.ts"],"sourcesContent":["/**\n * Timeboxes — the model behind the \"Timeboxes – Agenda Day\" and\n * \"Timeboxes – Workload\" simulations.\n *\n * An estimate split and a timebox are the same thing: a task's split is a\n * list of parts, one untimed part per day (it feeds suggestions) and any\n * number of timed parts (pinned timeboxes). A day's allocation is the sum of\n * the task's parts on that day; the estimate is the sum of all parts.\n *\n * All math is in whole minutes. Dates are \"YYYY-MM-DD\", clocks \"HH:MM\".\n */\n\nexport type DateKey = string;\nexport type Clock = string;\n\nexport const MINUTES_PER_DAY = 24 * 60;\n\n/** Durations and start times snap to this. */\nexport const SNAP_MINUTES = 5;\n\nexport const MIN_GAP_OPTIONS = [5, 10, 15, 30, 60] as const;\nexport type MinGap = (typeof MIN_GAP_OPTIONS)[number];\n\n/* ------------------------------------------------------------------ */\n/* Payload shapes */\n/* ------------------------------------------------------------------ */\n\nexport interface TbProject {\n /* mirrors: Project (id, name, company, label colour) */\n id: number;\n name: string;\n company: string;\n color: string;\n}\n\nexport interface TbUser {\n /* mirrors: User (id, display_name) + workweek capacity\n (loadUsersWorkweekCapacities: minutes per ISO weekday, 0 = day off) */\n id: number;\n name: string;\n /** ISO weekday (1 = Monday) → capacity in minutes; missing or 0 = off. */\n capacity: Record<number, number>;\n}\n\nexport interface TbTask {\n /* mirrors: Task (id, project_id, name, start_on, due_on, is_important,\n is_completed) + Assignee (user_id, estimate); estimate in minutes here,\n the payload has hours */\n id: number;\n projectId: number;\n name: string;\n startOn: DateKey;\n dueOn: DateKey;\n isImportant: boolean;\n isCompleted: boolean;\n /** My Work list order. */\n position: number;\n assigneeId: number;\n /** The assignee's estimate in minutes; null when there is none. */\n estimate: number | null;\n}\n\nexport interface TbSubtask {\n /* mirrors: Subtask (id, task_id, name, due_on, is_completed) */\n id: number;\n taskId: number;\n name: string;\n dueOn: DateKey;\n isCompleted: boolean;\n}\n\nexport interface TbPart {\n /* mirrors: TaskSplit (task_id, date, duration) + starts_on_time, which is\n no payload yet: null is the day's untimed part, a time is a pinned\n timebox */\n id: string;\n taskId: number;\n date: DateKey;\n startsOnTime: Clock | null;\n durationMinutes: number;\n}\n\nexport interface TbEvent {\n /* mirrors: GET /calendars/events/for-screen events[] (name, color,\n starts_on, starts_on_time, ends_on_time, is_participant, meeting_url) */\n id: number;\n name: string;\n calendarName: string;\n color: string;\n date: DateKey;\n startsOnTime: Clock;\n endsOnTime: Clock;\n isParticipant: boolean;\n meetingUrl: string | null;\n}\n\nexport interface TbSettings {\n /* mirrors: no payload yet (the user's timebox settings) */\n workdayStartsAt: Clock;\n minGapMinutes: MinGap;\n pause: { startsAt: Clock; minutes: number } | null;\n}\n\nexport interface TbTimeRecord {\n /* mirrors: TimeRecord (parent_id, user_id, record_date, value); value in\n minutes here, the payload has hours. A record has no start time. */\n id: string;\n taskId: number;\n userId: number;\n recordDate: DateKey;\n minutes: number;\n}\n\n/** Everything the simulation changes. Projects and users are fixed. */\nexport interface TbState {\n tasks: TbTask[];\n subtasks: TbSubtask[];\n parts: TbPart[];\n events: TbEvent[];\n settings: TbSettings;\n /** Tracked time: display only, nothing is planned from it. */\n timeRecords: TbTimeRecord[];\n /** Next id for parts and events the simulation creates. */\n nextId: number;\n}\n\n/* ------------------------------------------------------------------ */\n/* Time */\n/* ------------------------------------------------------------------ */\n\nexport const clockToMinutes = (clock: Clock): number => {\n const [hours, minutes] = clock.split(\":\").map(Number);\n return hours * 60 + minutes;\n};\n\nexport const minutesToClock = (minutes: number): Clock =>\n `${String(Math.floor(minutes / 60)).padStart(2, \"0\")}:${String(\n minutes % 60\n ).padStart(2, \"0\")}`;\n\n/** Down to the 5-minute grid. */\nexport const snapDown = (minutes: number): number =>\n Math.floor(minutes / SNAP_MINUTES) * SNAP_MINUTES;\n\n/** To the nearest step of the 5-minute grid. */\nexport const snap = (minutes: number): number =>\n Math.round(minutes / SNAP_MINUTES) * SNAP_MINUTES;\n\n/** \"1h\", \"1h30\", \"45m\" — the concept's hours. */\nexport const formatMinutes = (minutes: number): string => {\n const hours = Math.floor(minutes / 60);\n const rest = minutes % 60;\n if (hours === 0) return `${rest}m`;\n return rest === 0 ? `${hours}h` : `${hours}h${String(rest).padStart(2, \"0\")}`;\n};\n\nconst toUtc = (date: DateKey): Date => new Date(`${date}T00:00:00Z`);\n\nexport const addDays = (date: DateKey, days: number): DateKey => {\n const next = toUtc(date);\n next.setUTCDate(next.getUTCDate() + days);\n return next.toISOString().slice(0, 10);\n};\n\n/** ISO weekday, 1 = Monday … 7 = Sunday. */\nexport const isoWeekday = (date: DateKey): number =>\n ((toUtc(date).getUTCDay() + 6) % 7) + 1;\n\n/** Every date from start to end, both included. */\nexport const datesBetween = (start: DateKey, end: DateKey): DateKey[] => {\n const dates: DateKey[] = [];\n for (let date = start; date <= end; date = addDays(date, 1)) {\n dates.push(date);\n }\n return dates;\n};\n\n/* ------------------------------------------------------------------ */\n/* Availability and allocation */\n/* ------------------------------------------------------------------ */\n\nexport const capacityOn = (user: TbUser, date: DateKey): number =>\n user.capacity[isoWeekday(date)] ?? 0;\n\n/** The days in the task's range the assignee works (TaskSplitterByAssignee\n gives the other days 0). */\nexport const availableDays = (task: TbTask, user: TbUser): DateKey[] =>\n datesBetween(task.startOn, task.dueOn).filter(\n (date) => capacityOn(user, date) > 0\n );\n\n/**\n * An even spread of whole minutes over days, as the app's add(): each day\n * the total over the day count, rounded down to whole minutes, with the\n * leftover minutes on the last days so the parts still sum to the total.\n */\nexport const evenSpread = (\n total: number,\n days: DateKey[]\n): Map<DateKey, number> => {\n const spread = new Map<DateKey, number>();\n if (days.length === 0) return spread;\n const base = Math.floor(total / days.length);\n const leftover = total - base * days.length;\n days.forEach((date, index) => {\n spread.set(date, base + (index >= days.length - leftover ? 1 : 0));\n });\n return spread;\n};\n\nexport const partsOf = (state: TbState, taskId: number): TbPart[] =>\n state.parts.filter((part) => part.taskId === taskId);\n\nexport const isSplit = (state: TbState, taskId: number): boolean =>\n state.parts.some((part) => part.taskId === taskId);\n\nexport const isTimebox = (part: TbPart): boolean => part.startsOnTime !== null;\n\nexport const timeboxesOn = (\n state: TbState,\n taskId: number,\n date: DateKey\n): TbPart[] =>\n partsOf(state, taskId)\n .filter((part) => part.date === date && isTimebox(part))\n .sort(\n (a, b) =>\n clockToMinutes(a.startsOnTime ?? \"00:00\") -\n clockToMinutes(b.startsOnTime ?? \"00:00\")\n );\n\nexport const untimedPartOn = (\n state: TbState,\n taskId: number,\n date: DateKey\n): TbPart | undefined =>\n state.parts.find(\n (part) =>\n part.taskId === taskId && part.date === date && part.startsOnTime === null\n );\n\nconst sum = (parts: TbPart[]): number =>\n parts.reduce((total, part) => total + part.durationMinutes, 0);\n\nexport const pinnedOn = (\n state: TbState,\n taskId: number,\n date: DateKey\n): number => sum(timeboxesOn(state, taskId, date));\n\n/** The day's allocation: the parts on it once split, else the even share. */\nexport const allocationOn = (\n state: TbState,\n task: TbTask,\n user: TbUser,\n date: DateKey\n): number => {\n if (isSplit(state, task.id)) {\n return sum(partsOf(state, task.id).filter((part) => part.date === date));\n }\n if (task.estimate === null) return 0;\n return evenSpread(task.estimate, availableDays(task, user)).get(date) ?? 0;\n};\n\n/** What the day still leaves to suggestions: allocation − pinned. */\nexport const untimedOn = (\n state: TbState,\n task: TbTask,\n user: TbUser,\n date: DateKey\n): number =>\n allocationOn(state, task, user, date) - pinnedOn(state, task.id, date);\n\nexport interface TimeRange {\n start: number;\n end: number;\n}\n\nexport const rangeOf = (part: TbPart): TimeRange => {\n const start = clockToMinutes(part.startsOnTime ?? \"00:00\");\n return { start, end: start + part.durationMinutes };\n};\n\nexport const overlaps = (a: TimeRange, b: TimeRange): boolean =>\n a.start < b.end && b.start < a.end;\n"],"mappings":";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AC,CAAClC,GAAG,IAAIkC,CAAC,CAACnC,KAAK,GAAGkC,CAAC,CAACjC,GAAG;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.trackedFillColor = exports.tentativeHatch = exports.paletteOf = exports.paletteFill = exports.PILL_LOOK = exports.PAPER_RING = exports.MUTED_EVENT_FILL = void 0;
|
|
7
|
+
var _styledComponents = require("styled-components");
|
|
8
|
+
var _SwatchPalette = require("../../components/SwatchPalette");
|
|
9
|
+
/**
|
|
10
|
+
* The calendar look the app has under the new_task flag, for tasks and
|
|
11
|
+
* events in the hour grid (the Time Blocks concept's "new_task design
|
|
12
|
+
* proposal", shared here): every item is the app's pill filled with its
|
|
13
|
+
* palette colour (calendar.less .rbc-event with .calendar-event-fill), a
|
|
14
|
+
* suggestion keeps a lighter, see-through hatch of it.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/** A colour as the palette shows it: its hue's base colour, and that hue's
|
|
18
|
+
dark ink. */
|
|
19
|
+
var paletteOf = exports.paletteOf = function paletteOf(color) {
|
|
20
|
+
var _hue$ink;
|
|
21
|
+
var base = (0, _SwatchPalette.swatchPaletteBaseOf)(color);
|
|
22
|
+
var hue = _SwatchPalette.SWATCH_PALETTE_HUES.find(function (entry) {
|
|
23
|
+
return entry.soft === base;
|
|
24
|
+
});
|
|
25
|
+
return {
|
|
26
|
+
base,
|
|
27
|
+
ink: (_hue$ink = hue === null || hue === void 0 ? void 0 : hue.ink) !== null && _hue$ink !== void 0 ? _hue$ink : base
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/** A palette colour's fill on the paper; events and tasks take the
|
|
32
|
+
stronger share, cards the lighter one. */
|
|
33
|
+
var paletteFill = exports.paletteFill = function paletteFill(base) {
|
|
34
|
+
var kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "event";
|
|
35
|
+
return (0, _SwatchPalette.swatchPaletteFill)(base, kind);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/** A suggestion: the colour's hatch, about half a pill's strength and
|
|
39
|
+
see-through; a linked fragment's hatch steps up a little. */
|
|
40
|
+
var tentativeHatch = exports.tentativeHatch = function tentativeHatch(base, linked) {
|
|
41
|
+
return "repeating-linear-gradient(135deg, color-mix(in srgb, ".concat(base, " ").concat(linked ? 32 : 22, "%, transparent) 0 6px, color-mix(in srgb, ").concat(base, " ").concat(linked ? 14 : 8, "%, transparent) 6px 12px)");
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/** An event without the user (calendar-event-muted): neutral fill, its
|
|
45
|
+
colour on the leading edge only. */
|
|
46
|
+
var MUTED_EVENT_FILL = exports.MUTED_EVENT_FILL = "color-mix(in srgb, var(--color-theme-900) 9%, var(--page-paper-main))";
|
|
47
|
+
|
|
48
|
+
/** The 1px of paper between neighbouring fills (calendar.less). */
|
|
49
|
+
var PAPER_RING = exports.PAPER_RING = "0 0 0 1px var(--page-paper-main)";
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The pill: 4px radius, a transparent 1px border with the 3px leading edge,
|
|
53
|
+
* the content 4px in; a name line, then a detail line (times, fragments,
|
|
54
|
+
* overlaps) that a one-line pill drops. Secondary text on a fill follows the
|
|
55
|
+
* primary one (.calendar-event-fill .event-time).
|
|
56
|
+
*/
|
|
57
|
+
var PILL_LOOK = exports.PILL_LOOK = (0, _styledComponents.css)(["box-sizing:border-box;position:absolute;display:flex;flex-direction:column;min-height:20px;padding:3px 4px;border-style:solid;border-width:1px 1px 1px 3px;border-color:transparent;border-radius:var(--ac-br-4);overflow:hidden;z-index:1;&.compact{justify-content:center;padding-top:0;padding-bottom:0;}&& .fill-text{color:color-mix(in srgb,var(--color-theme-900) 80%,transparent);}.block-line,.block-detail{display:flex;align-items:center;gap:4px;min-width:0;}.block-detail{white-space:nowrap;}&.compact .block-detail{display:none;}.block-glyph{display:flex;flex-shrink:0;}.block-name{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.block-meta{flex-shrink:0;}.fragment-dots{display:inline-flex;gap:3px;}.fragment-dot{width:5px;height:5px;border-radius:var(--ac-br-rounded);border:1px solid;}.overlap-chip{display:inline-flex;align-items:center;gap:4px;min-width:0;padding:0 6px;border-radius:var(--ac-br-rounded);background-color:var(--alert-surface);}"]);
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Tracked time: a darker step of the pill's colour, as Timeline's
|
|
61
|
+
* TaskBar progress fill is a stronger rung of the bar's hue. On the light
|
|
62
|
+
* papers the palette colour itself (the pill is its 40% share); on the dark
|
|
63
|
+
* ones its hue's ink, darker than the pill's 38% share, so the light text
|
|
64
|
+
* keeps its contrast.
|
|
65
|
+
*/
|
|
66
|
+
var trackedFillColor = exports.trackedFillColor = function trackedFillColor(color) {
|
|
67
|
+
var _paletteOf = paletteOf(color),
|
|
68
|
+
base = _paletteOf.base,
|
|
69
|
+
ink = _paletteOf.ink;
|
|
70
|
+
return "light-dark(color-mix(in srgb, ".concat(base, " 85%, var(--page-paper-main)), color-mix(in srgb, ").concat(ink, " 75%, var(--page-paper-main)))");
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=pillLook.js.map
|