@burdenoff/microfe-timecampus 2026.904.1 → 2026.1025.1
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/generated/global-types.d.ts +4577 -1620
- package/dist/generated/global-types.d.ts.map +1 -1
- package/dist/generated/wspace-operations.d.ts +547 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -1
- package/dist/generated/wspace-operations.js +1201 -920
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +93410 -34028
- package/dist/generated/wspace-types.d.ts.map +1 -1
- package/dist/generated/wspace-types.js +11 -5
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/index.js +7 -7
- package/dist/timecampus/TimeCampusRoot.d.ts.map +1 -1
- package/dist/timecampus/TimeCampusRoot.js +84 -76
- package/dist/timecampus/TimeCampusRoot.js.map +1 -1
- package/dist/timecampus/TimeCampusRoutes.d.ts.map +1 -1
- package/dist/timecampus/TimeCampusRoutes.js +25 -21
- package/dist/timecampus/TimeCampusRoutes.js.map +1 -1
- package/dist/timecampus/index.js +7 -7
- package/dist/timecampus/pages/focus/FocusProtectionPage.d.ts +2 -0
- package/dist/timecampus/pages/focus/FocusProtectionPage.d.ts.map +1 -0
- package/dist/timecampus/pages/focus/FocusProtectionPage.js +553 -0
- package/dist/timecampus/pages/focus/FocusProtectionPage.js.map +1 -0
- package/dist/timecampus/pages/focus/focusHelpers.d.ts +25 -0
- package/dist/timecampus/pages/focus/focusHelpers.d.ts.map +1 -0
- package/dist/timecampus/pages/focus/focusHelpers.js +55 -0
- package/dist/timecampus/pages/focus/focusHelpers.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure helpers for the Focus Protection page (BOFF-4196).
|
|
3
|
+
*/
|
|
4
|
+
export declare const DAY_MS: number;
|
|
5
|
+
/** The instant of local midnight for `date` plus `offsetDays` (the planner's `dayStart`). */
|
|
6
|
+
export declare function localDayStart(date: Date, offsetDays?: number): Date;
|
|
7
|
+
export declare const REASON_LABELS: Record<string, string>;
|
|
8
|
+
export declare function reasonLabel(code: string): string;
|
|
9
|
+
export declare function formatClock(iso: string): string;
|
|
10
|
+
export declare function formatRange(startIso: string, endIso: string): string;
|
|
11
|
+
export declare function formatDuration(seconds: number): string;
|
|
12
|
+
/** "HH:MM" for a minutes-after-midnight value (1440 shows as 24:00). */
|
|
13
|
+
export declare function minutesToTime(minutes: number): string;
|
|
14
|
+
/** Minutes after midnight for an "HH:MM" value, or null when malformed. */
|
|
15
|
+
export declare function timeToMinutes(value: string): number | null;
|
|
16
|
+
/** Remaining whole minutes of a session with a planned duration, or null. */
|
|
17
|
+
export declare function minutesLeft(startIso: string, plannedDurationSeconds: number | null | undefined, now?: number): number | null;
|
|
18
|
+
/** Whether an accepted block can be started now (it has not ended yet). */
|
|
19
|
+
export declare function canStartBlock(endIso: string, now?: number): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Split a free-text list of sites (commas, spaces or new lines) into entries.
|
|
22
|
+
* The server normalises and validates each one.
|
|
23
|
+
*/
|
|
24
|
+
export declare function parseSiteList(text: string): string[];
|
|
25
|
+
//# sourceMappingURL=focusHelpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"focusHelpers.d.ts","sourceRoot":"","sources":["../../../../src/timecampus/pages/focus/focusHelpers.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,MAAM,QAAsB,CAAC;AAE1C,6FAA6F;AAC7F,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,SAAI,GAAG,IAAI,CAK9D;AAED,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAOhD,CAAC;AAEF,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAK/C;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpE;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAMtD;AAED,wEAAwE;AACxE,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAIrD;AAED,2EAA2E;AAC3E,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAO1D;AAED,6EAA6E;AAC7E,wBAAgB,WAAW,CACzB,QAAQ,EAAE,MAAM,EAChB,sBAAsB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACjD,GAAG,SAAa,GACf,MAAM,GAAG,IAAI,CAIf;AAED,2EAA2E;AAC3E,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,SAAa,GAAG,OAAO,CAEvE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAKpD"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
//#region src/timecampus/pages/focus/focusHelpers.ts
|
|
2
|
+
var e = 864e5;
|
|
3
|
+
function t(e, t = 0) {
|
|
4
|
+
let n = new Date(e);
|
|
5
|
+
return n.setHours(0, 0, 0, 0), n.setDate(n.getDate() + t), n;
|
|
6
|
+
}
|
|
7
|
+
var n = {
|
|
8
|
+
PEAK_HOURS: "Your peak hours",
|
|
9
|
+
HISTORICALLY_PROTECTED: "Usually well protected",
|
|
10
|
+
LOW_INTERRUPTIONS: "Few interruptions",
|
|
11
|
+
FITS_BETWEEN_MEETINGS: "Fits between meetings",
|
|
12
|
+
MEETING_FREE_DAY: "No meetings today",
|
|
13
|
+
DEFAULT_SCHEDULE: "Default schedule — builds as you focus"
|
|
14
|
+
};
|
|
15
|
+
function r(e) {
|
|
16
|
+
return n[e] ?? e;
|
|
17
|
+
}
|
|
18
|
+
function i(e) {
|
|
19
|
+
return new Date(e).toLocaleTimeString(void 0, {
|
|
20
|
+
hour: "numeric",
|
|
21
|
+
minute: "2-digit"
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function a(e, t) {
|
|
25
|
+
return `${i(e)} – ${i(t)}`;
|
|
26
|
+
}
|
|
27
|
+
function o(e) {
|
|
28
|
+
let t = Math.max(0, Math.round(e / 60)), n = Math.floor(t / 60), r = t % 60;
|
|
29
|
+
return n === 0 ? `${r}m` : r === 0 ? `${n}h` : `${n}h ${r}m`;
|
|
30
|
+
}
|
|
31
|
+
function s(e) {
|
|
32
|
+
let t = Math.floor(e / 60), n = e % 60;
|
|
33
|
+
return `${String(t).padStart(2, "0")}:${String(n).padStart(2, "0")}`;
|
|
34
|
+
}
|
|
35
|
+
function c(e) {
|
|
36
|
+
let t = /^(\d{1,2}):(\d{2})$/.exec(e.trim());
|
|
37
|
+
if (!t) return null;
|
|
38
|
+
let n = Number(t[1]), r = Number(t[2]);
|
|
39
|
+
return n > 24 || r > 59 || n === 24 && r > 0 ? null : n * 60 + r;
|
|
40
|
+
}
|
|
41
|
+
function l(e, t, n = Date.now()) {
|
|
42
|
+
if (!t) return null;
|
|
43
|
+
let r = Date.parse(e) + t * 1e3;
|
|
44
|
+
return Math.max(0, Math.ceil((r - n) / 6e4));
|
|
45
|
+
}
|
|
46
|
+
function u(e, t = Date.now()) {
|
|
47
|
+
return Date.parse(e) > t;
|
|
48
|
+
}
|
|
49
|
+
function d(e) {
|
|
50
|
+
return e.split(/[\s,]+/).map((e) => e.trim()).filter(Boolean);
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
export { e as DAY_MS, n as REASON_LABELS, u as canStartBlock, i as formatClock, o as formatDuration, a as formatRange, t as localDayStart, l as minutesLeft, s as minutesToTime, d as parseSiteList, r as reasonLabel, c as timeToMinutes };
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=focusHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"focusHelpers.js","names":[],"sources":["../../../../src/timecampus/pages/focus/focusHelpers.ts"],"sourcesContent":["/**\n * Pure helpers for the Focus Protection page (BOFF-4196).\n */\n\nexport const DAY_MS = 24 * 60 * 60 * 1000;\n\n/** The instant of local midnight for `date` plus `offsetDays` (the planner's `dayStart`). */\nexport function localDayStart(date: Date, offsetDays = 0): Date {\n const d = new Date(date);\n d.setHours(0, 0, 0, 0);\n d.setDate(d.getDate() + offsetDays);\n return d;\n}\n\nexport const REASON_LABELS: Record<string, string> = {\n PEAK_HOURS: \"Your peak hours\",\n HISTORICALLY_PROTECTED: \"Usually well protected\",\n LOW_INTERRUPTIONS: \"Few interruptions\",\n FITS_BETWEEN_MEETINGS: \"Fits between meetings\",\n MEETING_FREE_DAY: \"No meetings today\",\n DEFAULT_SCHEDULE: \"Default schedule — builds as you focus\",\n};\n\nexport function reasonLabel(code: string): string {\n return REASON_LABELS[code] ?? code;\n}\n\nexport function formatClock(iso: string): string {\n return new Date(iso).toLocaleTimeString(undefined, {\n hour: \"numeric\",\n minute: \"2-digit\",\n });\n}\n\nexport function formatRange(startIso: string, endIso: string): string {\n return `${formatClock(startIso)} – ${formatClock(endIso)}`;\n}\n\nexport function formatDuration(seconds: number): string {\n const total = Math.max(0, Math.round(seconds / 60));\n const h = Math.floor(total / 60);\n const m = total % 60;\n if (h === 0) return `${m}m`;\n return m === 0 ? `${h}h` : `${h}h ${m}m`;\n}\n\n/** \"HH:MM\" for a minutes-after-midnight value (1440 shows as 24:00). */\nexport function minutesToTime(minutes: number): string {\n const h = Math.floor(minutes / 60);\n const m = minutes % 60;\n return `${String(h).padStart(2, \"0\")}:${String(m).padStart(2, \"0\")}`;\n}\n\n/** Minutes after midnight for an \"HH:MM\" value, or null when malformed. */\nexport function timeToMinutes(value: string): number | null {\n const match = /^(\\d{1,2}):(\\d{2})$/.exec(value.trim());\n if (!match) return null;\n const h = Number(match[1]);\n const m = Number(match[2]);\n if (h > 24 || m > 59 || (h === 24 && m > 0)) return null;\n return h * 60 + m;\n}\n\n/** Remaining whole minutes of a session with a planned duration, or null. */\nexport function minutesLeft(\n startIso: string,\n plannedDurationSeconds: number | null | undefined,\n now = Date.now(),\n): number | null {\n if (!plannedDurationSeconds) return null;\n const end = Date.parse(startIso) + plannedDurationSeconds * 1000;\n return Math.max(0, Math.ceil((end - now) / 60000));\n}\n\n/** Whether an accepted block can be started now (it has not ended yet). */\nexport function canStartBlock(endIso: string, now = Date.now()): boolean {\n return Date.parse(endIso) > now;\n}\n\n/**\n * Split a free-text list of sites (commas, spaces or new lines) into entries.\n * The server normalises and validates each one.\n */\nexport function parseSiteList(text: string): string[] {\n return text\n .split(/[\\s,]+/)\n .map((s) => s.trim())\n .filter(Boolean);\n}\n"],"mappings":";AAIA,IAAa,IAAS;AAGtB,SAAgB,EAAc,GAAY,IAAa,GAAS;CAC9D,IAAM,IAAI,IAAI,KAAK,CAAI;CAGvB,OAFA,EAAE,SAAS,GAAG,GAAG,GAAG,CAAC,GACrB,EAAE,QAAQ,EAAE,QAAQ,IAAI,CAAU,GAC3B;AACT;AAEA,IAAa,IAAwC;CACnD,YAAY;CACZ,wBAAwB;CACxB,mBAAmB;CACnB,uBAAuB;CACvB,kBAAkB;CAClB,kBAAkB;AACpB;AAEA,SAAgB,EAAY,GAAsB;CAChD,OAAO,EAAc,MAAS;AAChC;AAEA,SAAgB,EAAY,GAAqB;CAC/C,OAAO,IAAI,KAAK,CAAG,CAAC,CAAC,mBAAmB,KAAA,GAAW;EACjD,MAAM;EACN,QAAQ;CACV,CAAC;AACH;AAEA,SAAgB,EAAY,GAAkB,GAAwB;CACpE,OAAO,GAAG,EAAY,CAAQ,EAAE,KAAK,EAAY,CAAM;AACzD;AAEA,SAAgB,EAAe,GAAyB;CACtD,IAAM,IAAQ,KAAK,IAAI,GAAG,KAAK,MAAM,IAAU,EAAE,CAAC,GAC5C,IAAI,KAAK,MAAM,IAAQ,EAAE,GACzB,IAAI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