@telepath-computer/television 1.4.26 → 1.4.27
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/THIRD-PARTY-NOTICES.txt +208 -0
- package/dist/cli.cjs +3971 -702
- package/dist/onboarding/README.md +9 -3
- package/dist/onboarding/onboarding-channels.json +52 -0
- package/dist/onboarding/productivity/company-todos/index.html +6 -97
- package/dist/onboarding/productivity/company-todos/onboarding-company-todos.js +220 -0
- package/dist/onboarding/productivity/company-todos/task.css +20 -43
- package/dist/onboarding/productivity/company-todos/task.js +1 -1
- package/dist/onboarding/productivity/todays-calendar/onboarding-relative-dates.js +3 -12
- package/dist/sdk/v1/THIRD-PARTY-NOTICES.txt +211 -0
- package/dist/sdk/v1/resources.js +1413 -0
- package/dist/skills/television/SKILL.md +14 -11
- package/dist/skills/television/resources.md +286 -0
- package/dist/skills/tv-tasks/SKILL.md +30 -7
- package/dist/skills/tv-tasks/task.css +18 -19
- package/dist/web/assets/main-BFYjHkxN.js +848 -0
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
- package/dist/onboarding/productivity/company-todos/onboarding-relative-dates.js +0 -40
- package/dist/web/assets/main-C1ANF-FD.js +0 -826
|
@@ -16,14 +16,20 @@ Their display `name` values, channel order, and `focusChannel` in
|
|
|
16
16
|
entry may also carry optional initial-page `size` and `geometry`; for baked
|
|
17
17
|
channels author those fields in the design channel's `layout.yml` so a
|
|
18
18
|
re-bake carries them into the config. Missing fields use the shared page
|
|
19
|
-
defaults. The
|
|
19
|
+
defaults. The starting value of an HTML artifact's store is declared the
|
|
20
|
+
same way, as `store` on its card, and the bake carries it into its artifact
|
|
21
|
+
entry. The bake renders flat `.frame` sources into complete HTML documents
|
|
20
22
|
and copies flat `.md` sources unchanged. Declared skill assets are copied beside
|
|
21
23
|
the task and calendar entry documents; the welcome is a single HTML file with
|
|
22
|
-
an inline logo.
|
|
24
|
+
an inline logo. Company To-dos also receives the to-do store module
|
|
25
|
+
(`packages/server/assets/onboarding-company-todos.js`) beside its document.
|
|
23
26
|
|
|
24
27
|
**All non-tv-guide content is swap-free**: tests derive their expectations
|
|
25
28
|
from this config and these files at runtime, so content edits need zero test
|
|
26
|
-
changes.
|
|
29
|
+
changes. The one exception is the declared store: the production-tree
|
|
30
|
+
contract in `packages/server/test/onboarding-content.test.ts` pins Company
|
|
31
|
+
To-dos as the only artifact that declares one, because its live list depends
|
|
32
|
+
on it.
|
|
27
33
|
|
|
28
34
|
**`tv-guide` content is deliberately test-pinned** (it is released copy) and
|
|
29
35
|
is covered by `packages/server/test/onboarding-content.test.ts`, which pins
|
|
@@ -80,6 +80,58 @@
|
|
|
80
80
|
"size": {
|
|
81
81
|
"width": 400,
|
|
82
82
|
"height": 770
|
|
83
|
+
},
|
|
84
|
+
"store": {
|
|
85
|
+
"value": {
|
|
86
|
+
"tasks": {
|
|
87
|
+
"acme-success-metric": {
|
|
88
|
+
"title": "Define pilot success metric for Acme",
|
|
89
|
+
"note": "\"Accepted autonomous actions per analyst hour\" plus rollback rate.",
|
|
90
|
+
"due": "2026-07-04",
|
|
91
|
+
"project": "Acme Pilot",
|
|
92
|
+
"tags": [
|
|
93
|
+
"urgent"
|
|
94
|
+
],
|
|
95
|
+
"done": false
|
|
96
|
+
},
|
|
97
|
+
"customer-story": {
|
|
98
|
+
"title": "Synthesize NeonBank and Mallory Health calls into a customer story",
|
|
99
|
+
"note": "Painful workflow, before/after demo, measurable outcome — for the seed deck.",
|
|
100
|
+
"due": "2026-07-08",
|
|
101
|
+
"project": "Seed Deck",
|
|
102
|
+
"done": false
|
|
103
|
+
},
|
|
104
|
+
"investor-metrics": {
|
|
105
|
+
"title": "Send rough metrics to Jake for investor update",
|
|
106
|
+
"note": "Pipeline and burn numbers — defer visual polish.",
|
|
107
|
+
"due": "2026-07-08",
|
|
108
|
+
"project": "Investor Update",
|
|
109
|
+
"done": false
|
|
110
|
+
},
|
|
111
|
+
"priya-one-on-one": {
|
|
112
|
+
"title": "Prep for 1:1 with Priya",
|
|
113
|
+
"note": "Review two solutions for unblocking the dev team.",
|
|
114
|
+
"due": "2026-07-08",
|
|
115
|
+
"project": "Platform Reliability",
|
|
116
|
+
"done": false
|
|
117
|
+
},
|
|
118
|
+
"neonbank-procurement": {
|
|
119
|
+
"title": "Follow up with NeonBank on procurement map",
|
|
120
|
+
"note": "Confirm whether their security team needs the audit trail before next week.",
|
|
121
|
+
"due": "2026-07-10",
|
|
122
|
+
"project": "Acme Pilot",
|
|
123
|
+
"done": false
|
|
124
|
+
},
|
|
125
|
+
"investor-deck": {
|
|
126
|
+
"title": "Redesign investor deck",
|
|
127
|
+
"note": "Visual polish — wait until the customer story and metrics spine are locked.",
|
|
128
|
+
"due": "2026-07-14",
|
|
129
|
+
"project": "Seed Deck",
|
|
130
|
+
"done": false
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
"shiftDatesFrom": "2026-07-08"
|
|
83
135
|
}
|
|
84
136
|
},
|
|
85
137
|
{
|
|
@@ -5,11 +5,14 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
6
|
<title>Company To-dos</title>
|
|
7
7
|
<link rel="stylesheet" href="/canonical/v2/styles.css">
|
|
8
|
-
<script type="module" src="./onboarding-
|
|
8
|
+
<script type="module" src="./onboarding-company-todos.js"></script>
|
|
9
9
|
<script type="module" src="/canonical/v2/components.js"></script>
|
|
10
10
|
<link rel="stylesheet" href="./task.css">
|
|
11
11
|
<script type="module" src="./task.js"></script>
|
|
12
12
|
<style>
|
|
13
|
+
header > .tv-error {
|
|
14
|
+
margin-top: var(--space-8, 8px);
|
|
15
|
+
}
|
|
13
16
|
|
|
14
17
|
</style>
|
|
15
18
|
</head>
|
|
@@ -17,103 +20,9 @@
|
|
|
17
20
|
<header>
|
|
18
21
|
<h1>Company To-dos</h1>
|
|
19
22
|
<p>Wednesday, July 8</p>
|
|
23
|
+
<p class="tv-error" role="status" hidden></p>
|
|
20
24
|
</header>
|
|
21
25
|
|
|
22
|
-
<tv-task-list>
|
|
23
|
-
|
|
24
|
-
<tv-task-section>
|
|
25
|
-
<header><h2>Overdue</h2></header>
|
|
26
|
-
|
|
27
|
-
<tv-task>
|
|
28
|
-
<tv-task-checkbox></tv-task-checkbox>
|
|
29
|
-
<tv-task-body>
|
|
30
|
-
<tv-task-title>Define pilot success metric for Acme</tv-task-title>
|
|
31
|
-
<tv-task-note>"Accepted autonomous actions per analyst hour" plus rollback rate.</tv-task-note>
|
|
32
|
-
<tv-task-meta>
|
|
33
|
-
<tv-task-meta-due date="2026-07-04"></tv-task-meta-due>
|
|
34
|
-
<tv-task-meta-item><tv-icon name="hash"></tv-icon>Acme Pilot</tv-task-meta-item>
|
|
35
|
-
<tv-task-meta-tag>urgent</tv-task-meta-tag>
|
|
36
|
-
</tv-task-meta>
|
|
37
|
-
</tv-task-body>
|
|
38
|
-
</tv-task>
|
|
39
|
-
|
|
40
|
-
</tv-task-section>
|
|
41
|
-
|
|
42
|
-
<tv-task-section>
|
|
43
|
-
<header><h2>Today</h2></header>
|
|
44
|
-
|
|
45
|
-
<tv-task>
|
|
46
|
-
<tv-task-checkbox></tv-task-checkbox>
|
|
47
|
-
<tv-task-body>
|
|
48
|
-
<tv-task-title>Synthesize NeonBank and Mallory Health calls into a customer story</tv-task-title>
|
|
49
|
-
<tv-task-note>Painful workflow, before/after demo, measurable outcome — for the seed deck.</tv-task-note>
|
|
50
|
-
<tv-task-meta>
|
|
51
|
-
<tv-task-meta-due date="2026-07-08"></tv-task-meta-due>
|
|
52
|
-
<tv-task-meta-item><tv-icon name="hash"></tv-icon>Seed Deck</tv-task-meta-item>
|
|
53
|
-
|
|
54
|
-
</tv-task-meta>
|
|
55
|
-
</tv-task-body>
|
|
56
|
-
</tv-task>
|
|
57
|
-
|
|
58
|
-
<tv-task>
|
|
59
|
-
<tv-task-checkbox></tv-task-checkbox>
|
|
60
|
-
<tv-task-body>
|
|
61
|
-
<tv-task-title>Send rough metrics to Jake for investor update</tv-task-title>
|
|
62
|
-
<tv-task-note>Pipeline and burn numbers — defer visual polish.</tv-task-note>
|
|
63
|
-
<tv-task-meta>
|
|
64
|
-
<tv-task-meta-due date="2026-07-08"></tv-task-meta-due>
|
|
65
|
-
<tv-task-meta-item><tv-icon name="hash"></tv-icon>Investor Update</tv-task-meta-item>
|
|
66
|
-
|
|
67
|
-
</tv-task-meta>
|
|
68
|
-
</tv-task-body>
|
|
69
|
-
</tv-task>
|
|
70
|
-
|
|
71
|
-
<tv-task>
|
|
72
|
-
<tv-task-checkbox></tv-task-checkbox>
|
|
73
|
-
<tv-task-body>
|
|
74
|
-
<tv-task-title>Prep for 1:1 with Priya</tv-task-title>
|
|
75
|
-
<tv-task-note>Review two solutions for unblocking the dev team.</tv-task-note>
|
|
76
|
-
<tv-task-meta>
|
|
77
|
-
<tv-task-meta-due date="2026-07-08"></tv-task-meta-due>
|
|
78
|
-
<tv-task-meta-item><tv-icon name="hash"></tv-icon>Platform Reliability</tv-task-meta-item>
|
|
79
|
-
|
|
80
|
-
</tv-task-meta>
|
|
81
|
-
</tv-task-body>
|
|
82
|
-
</tv-task>
|
|
83
|
-
|
|
84
|
-
</tv-task-section>
|
|
85
|
-
|
|
86
|
-
<tv-task-section>
|
|
87
|
-
<header><h2>Upcoming</h2></header>
|
|
88
|
-
|
|
89
|
-
<tv-task>
|
|
90
|
-
<tv-task-checkbox></tv-task-checkbox>
|
|
91
|
-
<tv-task-body>
|
|
92
|
-
<tv-task-title>Follow up with NeonBank on procurement map</tv-task-title>
|
|
93
|
-
<tv-task-note>Confirm whether their security team needs the audit trail before next week.</tv-task-note>
|
|
94
|
-
<tv-task-meta>
|
|
95
|
-
<tv-task-meta-due date="2026-07-10"></tv-task-meta-due>
|
|
96
|
-
<tv-task-meta-item><tv-icon name="hash"></tv-icon>Acme Pilot</tv-task-meta-item>
|
|
97
|
-
|
|
98
|
-
</tv-task-meta>
|
|
99
|
-
</tv-task-body>
|
|
100
|
-
</tv-task>
|
|
101
|
-
|
|
102
|
-
<tv-task>
|
|
103
|
-
<tv-task-checkbox></tv-task-checkbox>
|
|
104
|
-
<tv-task-body>
|
|
105
|
-
<tv-task-title>Redesign investor deck</tv-task-title>
|
|
106
|
-
<tv-task-note>Visual polish — wait until the customer story and metrics spine are locked.</tv-task-note>
|
|
107
|
-
<tv-task-meta>
|
|
108
|
-
<tv-task-meta-due date="2026-07-14"></tv-task-meta-due>
|
|
109
|
-
<tv-task-meta-item><tv-icon name="hash"></tv-icon>Seed Deck</tv-task-meta-item>
|
|
110
|
-
|
|
111
|
-
</tv-task-meta>
|
|
112
|
-
</tv-task-body>
|
|
113
|
-
</tv-task>
|
|
114
|
-
|
|
115
|
-
</tv-task-section>
|
|
116
|
-
|
|
117
|
-
</tv-task-list>
|
|
26
|
+
<tv-task-list></tv-task-list>
|
|
118
27
|
</body>
|
|
119
28
|
</html>
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
// Company To-dos renders its to-do list live from its artifact's own JSON
|
|
2
|
+
// store, whose content the comment beside `getStore()` below describes. The
|
|
3
|
+
// page groups the tasks by due date relative to the viewer's local day and
|
|
4
|
+
// saves each checkbox toggle as its task's `done`; agents add, change and
|
|
5
|
+
// remove tasks with `tv resource json --artifact`, and the page shows the
|
|
6
|
+
// result. It has no local-only mode: the checkboxes can be used only while the
|
|
7
|
+
// page has the store's value, can use the store and is connected, and the one
|
|
8
|
+
// message in the page header says when it is disconnected or cannot use the
|
|
9
|
+
// store (specs/ui/onboarding-artifacts/index.md#^productivity-todo-store,
|
|
10
|
+
// #^productivity-todo-live, #^productivity-todo-store-problems and
|
|
11
|
+
// #^productivity-todo-layout).
|
|
12
|
+
const SECTIONS = ["Earlier", "Today", "Upcoming", "Someday"];
|
|
13
|
+
const DISCONNECTED = "Disconnected from the server. Changes cannot be saved until the connection returns.";
|
|
14
|
+
const CALENDAR_DATE = /^\d{4}-\d{2}-\d{2}$/;
|
|
15
|
+
|
|
16
|
+
/** The local calendar day of `date`, as YYYY-MM-DD. */
|
|
17
|
+
function localDay(date) {
|
|
18
|
+
return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}`;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function isCalendarDate(value) {
|
|
22
|
+
if (typeof value !== "string" || !CALENDAR_DATE.test(value)) return false;
|
|
23
|
+
const date = new Date(`${value}T00:00:00Z`);
|
|
24
|
+
return !Number.isNaN(date.getTime()) && date.toISOString().slice(0, 10) === value;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** The task an entry describes, or null without a title; a field of the wrong type counts as absent. */
|
|
28
|
+
function taskOf(key, entry) {
|
|
29
|
+
if (entry === null || typeof entry !== "object" || Array.isArray(entry)) return null;
|
|
30
|
+
if (typeof entry.title !== "string" || entry.title.trim() === "") return null;
|
|
31
|
+
const text = (value) => (typeof value === "string" && value !== "" ? value : undefined);
|
|
32
|
+
return {
|
|
33
|
+
key,
|
|
34
|
+
title: entry.title,
|
|
35
|
+
note: text(entry.note),
|
|
36
|
+
due: isCalendarDate(entry.due) ? entry.due : undefined,
|
|
37
|
+
project: text(entry.project),
|
|
38
|
+
tags: Array.isArray(entry.tags) && entry.tags.every((tag) => typeof tag === "string") ? entry.tags : [],
|
|
39
|
+
done: entry.done === true,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function sectionOf(task, today) {
|
|
44
|
+
if (task.due === undefined) return "Someday";
|
|
45
|
+
if (task.due < today) return "Earlier";
|
|
46
|
+
return task.due === today ? "Today" : "Upcoming";
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** The sections to show, in order, each with its tasks by due date and then the store's key order. */
|
|
50
|
+
function sectionsOf(tasks, today) {
|
|
51
|
+
return SECTIONS.map((heading) => ({
|
|
52
|
+
heading,
|
|
53
|
+
tasks: tasks
|
|
54
|
+
.filter((task) => sectionOf(task, today) === heading)
|
|
55
|
+
.sort((left, right) => ((left.due ?? "") < (right.due ?? "") ? -1 : (left.due ?? "") > (right.due ?? "") ? 1 : 0)),
|
|
56
|
+
})).filter((section) => section.tasks.length > 0);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function element(name, attributes = {}, children = []) {
|
|
60
|
+
const node = document.createElement(name);
|
|
61
|
+
for (const [attribute, value] of Object.entries(attributes)) node.setAttribute(attribute, value);
|
|
62
|
+
node.append(...children);
|
|
63
|
+
return node;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** One task's row in the tv-tasks vocabulary, built whole so its checkbox takes its name from the title as it connects. */
|
|
67
|
+
function taskRow(task) {
|
|
68
|
+
const meta = [
|
|
69
|
+
...(task.due === undefined ? [] : [element("tv-task-meta-due", { date: task.due })]),
|
|
70
|
+
...(task.project === undefined ? [] : [element("tv-task-meta-item", {}, [element("tv-icon", { name: "hash" }), task.project])]),
|
|
71
|
+
...task.tags.map((tag) => element("tv-task-meta-tag", {}, [tag])),
|
|
72
|
+
];
|
|
73
|
+
const checkbox = element("tv-task-checkbox", task.done ? { checked: "" } : {});
|
|
74
|
+
return element("tv-task", { id: task.key }, [
|
|
75
|
+
checkbox,
|
|
76
|
+
element("tv-task-body", {}, [
|
|
77
|
+
element("tv-task-title", {}, [task.title]),
|
|
78
|
+
...(task.note === undefined ? [] : [element("tv-task-note", {}, [task.note])]),
|
|
79
|
+
...(meta.length === 0 ? [] : [element("tv-task-meta", {}, meta)]),
|
|
80
|
+
]),
|
|
81
|
+
]);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const list = typeof document === "undefined" ? null : document.querySelector("tv-task-list");
|
|
85
|
+
const message = typeof document === "undefined" ? null : document.querySelector("header > p.tv-error");
|
|
86
|
+
|
|
87
|
+
if (list && message) {
|
|
88
|
+
const dateLine = document.querySelector("header > p:not(.tv-error)");
|
|
89
|
+
if (dateLine) {
|
|
90
|
+
dateLine.textContent = new Date().toLocaleDateString("en-US", { weekday: "long", month: "long", day: "numeric" });
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
let status = "connecting";
|
|
94
|
+
let hasValue = false;
|
|
95
|
+
/** Why the page cannot use the store; once set, it stands until the page reloads. */
|
|
96
|
+
let unusable = null;
|
|
97
|
+
/** Why the last refused save was refused, until a toggle made after it is saved. */
|
|
98
|
+
let refused = null;
|
|
99
|
+
let toggles = 0;
|
|
100
|
+
let refusedAt = 0;
|
|
101
|
+
/** Each shown task's done state as the page last heard it, its own unconfirmed saves included. */
|
|
102
|
+
let done = new Map();
|
|
103
|
+
/** What the shown rows say, but for their done state, so a change of done alone updates rows in place. */
|
|
104
|
+
let shown = null;
|
|
105
|
+
|
|
106
|
+
const renderState = () => {
|
|
107
|
+
const usable = hasValue && unusable === null && status === "connected";
|
|
108
|
+
for (const checkbox of list.querySelectorAll("tv-task tv-task-checkbox")) checkbox.toggleAttribute("disabled", !usable);
|
|
109
|
+
const text = unusable ?? refused ?? (status === "disconnected" ? DISCONNECTED : null);
|
|
110
|
+
message.hidden = text === null;
|
|
111
|
+
message.textContent = text ?? "";
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const renderTasks = (snapshot) => {
|
|
115
|
+
const tasks = [];
|
|
116
|
+
snapshot.child("tasks").forEach((child) => {
|
|
117
|
+
const task = taskOf(child.key, child.val());
|
|
118
|
+
if (task !== null) tasks.push(task);
|
|
119
|
+
});
|
|
120
|
+
const sections = sectionsOf(tasks, localDay(new Date()));
|
|
121
|
+
const layout = JSON.stringify(sections.map(({ heading, tasks: rows }) => [heading, rows.map(({ done: _done, ...rest }) => rest)]));
|
|
122
|
+
done = new Map(tasks.map((task) => [task.key, task.done]));
|
|
123
|
+
if (layout === shown) {
|
|
124
|
+
// Only done states changed: update the rows in place, keeping focus where it is.
|
|
125
|
+
for (const row of list.querySelectorAll("tv-task")) {
|
|
126
|
+
row.querySelector("tv-task-checkbox")?.toggleAttribute("checked", done.get(row.id) === true);
|
|
127
|
+
}
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
shown = layout;
|
|
131
|
+
list.replaceChildren(
|
|
132
|
+
...(sections.length === 0
|
|
133
|
+
? [element("tv-task-placeholder", {}, ["No tasks"])]
|
|
134
|
+
: sections.map(({ heading, tasks: rows }) =>
|
|
135
|
+
element("tv-task-section", {}, [element("header", {}, [element("h2", {}, [heading])]), ...rows.map(taskRow)]))),
|
|
136
|
+
);
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
const reasonOf = (error) => (error instanceof Error ? error.message : String(error));
|
|
140
|
+
const cannotUse = (reason) => {
|
|
141
|
+
unusable = `Company To-dos cannot use its store: ${reason}`;
|
|
142
|
+
renderState();
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
const useStore = (sdk) => {
|
|
146
|
+
// The store holds the list: { "tasks": { <key>: <task> } }. The starting
|
|
147
|
+
// tasks have readable keys; a task an agent adds with push is stored under
|
|
148
|
+
// the key that push makes. A task is an object with these fields:
|
|
149
|
+
// - title: string, required, not empty. A short imperative line.
|
|
150
|
+
// - note: string, optional. One brief line.
|
|
151
|
+
// - due: string, optional. A calendar date, YYYY-MM-DD.
|
|
152
|
+
// - project: string, optional. Shown with a # icon.
|
|
153
|
+
// - tags: array of strings, optional. A few short labels.
|
|
154
|
+
// - done: boolean, optional. true when the task is done; false or absent when it is not.
|
|
155
|
+
// The page writes only a task's done, when the person checks the task off
|
|
156
|
+
// or unchecks it. Agents write everything else: they add tasks with push,
|
|
157
|
+
// change and complete them with set, and remove them, by the artifact's ID.
|
|
158
|
+
// The page leaves out an entry without a title, and treats a field of the
|
|
159
|
+
// wrong type, or a due that is not a calendar date, as absent.
|
|
160
|
+
const root = sdk.ref(sdk.getStore());
|
|
161
|
+
sdk.onConnectionStatusChanged((current) => {
|
|
162
|
+
status = current;
|
|
163
|
+
renderState();
|
|
164
|
+
});
|
|
165
|
+
sdk.onValue(
|
|
166
|
+
root,
|
|
167
|
+
(snapshot) => {
|
|
168
|
+
hasValue = true;
|
|
169
|
+
renderTasks(snapshot);
|
|
170
|
+
renderState();
|
|
171
|
+
},
|
|
172
|
+
(error) => cannotUse(reasonOf(error)),
|
|
173
|
+
);
|
|
174
|
+
|
|
175
|
+
list.addEventListener("toggle", (event) => {
|
|
176
|
+
const row = event.target.closest("tv-task");
|
|
177
|
+
if (!row || !row.id) return;
|
|
178
|
+
const checkbox = event.target;
|
|
179
|
+
const toggle = ++toggles;
|
|
180
|
+
let saving;
|
|
181
|
+
try {
|
|
182
|
+
saving = sdk.set(sdk.child(root, `tasks/${row.id}/done`), event.checked);
|
|
183
|
+
} catch (error) {
|
|
184
|
+
saving = Promise.reject(error);
|
|
185
|
+
}
|
|
186
|
+
saving.then(
|
|
187
|
+
() => {
|
|
188
|
+
if (toggle > refusedAt) refused = null;
|
|
189
|
+
renderState();
|
|
190
|
+
},
|
|
191
|
+
(error) => {
|
|
192
|
+
// The box shows again what the page last heard: while the page hears
|
|
193
|
+
// the store, the SDK's rollback of this save, or the state before it
|
|
194
|
+
// when the SDK refused it without showing it; once the page has lost
|
|
195
|
+
// the store, what the box last showed. A save lost with the
|
|
196
|
+
// connection shows as the disconnected state, not as an error.
|
|
197
|
+
checkbox.toggleAttribute("checked", done.get(row.id) === true);
|
|
198
|
+
if (error?.code !== "disconnected") {
|
|
199
|
+
refused = `Company To-dos could not save to its store: ${reasonOf(error)}`;
|
|
200
|
+
refusedAt = toggle;
|
|
201
|
+
}
|
|
202
|
+
renderState();
|
|
203
|
+
},
|
|
204
|
+
);
|
|
205
|
+
});
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
renderState();
|
|
209
|
+
import("/sdk/v1/resources.js").then(
|
|
210
|
+
(sdk) => {
|
|
211
|
+
try {
|
|
212
|
+
useStore(sdk);
|
|
213
|
+
} catch (error) {
|
|
214
|
+
// Off an artifact page every SDK function refuses with not-artifact-page.
|
|
215
|
+
cannotUse(reasonOf(error));
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
() => cannotUse("the resource SDK could not be loaded."),
|
|
219
|
+
);
|
|
220
|
+
}
|
|
@@ -9,18 +9,11 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
:root {
|
|
12
|
-
/*
|
|
13
|
-
|
|
14
|
-
--task-due-today: #EA880B;
|
|
12
|
+
/* Task accents follow the active canonical/theme semantic roles. */
|
|
13
|
+
--task-due-today: var(--color-alert);
|
|
15
14
|
/* Highlight hue — the highlighted row's wash derives from this one knob.
|
|
16
15
|
Set it on any ancestor (or the row itself) to retint. */
|
|
17
16
|
--task-highlight: var(--task-due-today);
|
|
18
|
-
/* Skill-local muted: a shade darker than the canonical --color-text-muted
|
|
19
|
-
(neutral-500, L 0.553) so notes hold their own against the darker meta
|
|
20
|
-
treatment below. Declared at :root, so it recolors ALL muted text on the
|
|
21
|
-
page (canonical components included) — deliberate for a single-skill
|
|
22
|
-
artifact; revisit if skills ever share a page. */
|
|
23
|
-
--color-text-muted: oklch(0.52 0 0);
|
|
24
17
|
/* The meta line recedes a step behind the note: 85% of muted. */
|
|
25
18
|
--task-meta-text: color-mix(in srgb, var(--color-text-muted) 85%, transparent);
|
|
26
19
|
}
|
|
@@ -111,31 +104,30 @@ tv-task:has(tv-task-checkbox[disabled]) tv-task-title {
|
|
|
111
104
|
color: var(--color-text-muted);
|
|
112
105
|
}
|
|
113
106
|
|
|
107
|
+
/* ---- The page ----
|
|
108
|
+
One default inset for the whole page, at zero specificity so an
|
|
109
|
+
artifact's own body rule replaces it. The page header, the list and
|
|
110
|
+
anything placed between them, such as an add form or a toolbar, share its
|
|
111
|
+
gutters, and each stands one gap below the one before it; a script or
|
|
112
|
+
style element is no block, so the first block shown gets no gap above it.
|
|
113
|
+
The artifact's own heading is the house page-header idiom (header > h1 +
|
|
114
|
+
p), which house typography styles. Its last line shown has no margin
|
|
115
|
+
outside a prose region and one no larger than the gap inside one, which
|
|
116
|
+
collapses into the gap, so the gap below the header is the same whatever
|
|
117
|
+
it ends with. */
|
|
118
|
+
:where(body) {
|
|
119
|
+
padding: var(--space-16, 16px);
|
|
120
|
+
}
|
|
121
|
+
:where(body > :not(script, style, template) ~ *) {
|
|
122
|
+
margin-top: var(--space-12, 12px);
|
|
123
|
+
}
|
|
124
|
+
|
|
114
125
|
/* ---- List container ----
|
|
115
126
|
No frame of its own: the artifact page is the surface, and Television's
|
|
116
127
|
artifact frame supplies the chrome around the document. */
|
|
117
128
|
|
|
118
129
|
tv-task-list {
|
|
119
130
|
display: block;
|
|
120
|
-
padding: 0 var(--space-16, 16px) var(--space-16, 16px);
|
|
121
|
-
}
|
|
122
|
-
/* Nothing above the list (no page heading): give it its own top breathing
|
|
123
|
-
room. When a header precedes it, the gap is the subtitle's house margin —
|
|
124
|
-
or the h1 rule below when there is no subtitle. */
|
|
125
|
-
tv-task-list:first-child {
|
|
126
|
-
padding-top: var(--space-16, 16px);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/* The artifact's own heading lives on the page, above the list, as the house
|
|
130
|
-
page-header idiom (header > h1 + p) — house typography styles it; the
|
|
131
|
-
skill only aligns it with the list's interior padding. */
|
|
132
|
-
header:has(+ tv-task-list) {
|
|
133
|
-
padding: var(--space-16, 16px) var(--space-16, 16px) 0;
|
|
134
|
-
}
|
|
135
|
-
/* A header whose last child is the h1 (no subtitle) has no house margin
|
|
136
|
-
below it — supply the gap the subtitle's margin would have given. */
|
|
137
|
-
header:has(+ tv-task-list) > h1:last-child {
|
|
138
|
-
margin-bottom: var(--space-12, 12px);
|
|
139
131
|
}
|
|
140
132
|
|
|
141
133
|
/* Section headers lay their title out inline. */
|
|
@@ -186,18 +178,3 @@ tv-task-placeholder {
|
|
|
186
178
|
tv-task[highlighted] {
|
|
187
179
|
background: color-mix(in srgb, var(--task-highlight) 10%, transparent);
|
|
188
180
|
}
|
|
189
|
-
|
|
190
|
-
/* ---- Dark mode ----
|
|
191
|
-
The canonical theme is light-only, so the skill carries its own dark token
|
|
192
|
-
set, applied when the document has data-theme="dark". */
|
|
193
|
-
[data-theme="dark"] {
|
|
194
|
-
--color-surface: var(--neutral-800);
|
|
195
|
-
--color-surface-muted: var(--neutral-900);
|
|
196
|
-
--color-text: var(--neutral-50);
|
|
197
|
-
--color-text-muted: var(--neutral-400);
|
|
198
|
-
/* Re-derive: custom properties resolve where declared, so without this the
|
|
199
|
-
meta tone would keep the light-mode muted it was mixed from. */
|
|
200
|
-
--task-meta-text: color-mix(in srgb, var(--color-text-muted) 85%, transparent);
|
|
201
|
-
--color-border: rgba(255, 255, 255, 0.14);
|
|
202
|
-
color-scheme: dark;
|
|
203
|
-
}
|
|
@@ -157,7 +157,7 @@ const CHECKBOX_STYLES = `
|
|
|
157
157
|
content: "";
|
|
158
158
|
width: 4px;
|
|
159
159
|
height: 7px;
|
|
160
|
-
border: solid
|
|
160
|
+
border: solid var(--color-primary-text);
|
|
161
161
|
border-width: 0 1.5px 1.5px 0;
|
|
162
162
|
opacity: 0;
|
|
163
163
|
transform: translateY(-0.5px) rotate(45deg) scale(0.75);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
1
|
+
// Today's Calendar is authored on the Productivity story day. Its dates move
|
|
2
|
+
// when the document opens, using the viewer's local calendar day
|
|
3
|
+
// (specs/ui/onboarding-artifacts/index.md#^productivity-relative-dates).
|
|
3
4
|
const dayMs = 86_400_000;
|
|
4
5
|
const storyDay = Date.UTC(2026, 6, 8);
|
|
5
6
|
|
|
@@ -19,16 +20,6 @@ if (typeof document !== "undefined") {
|
|
|
19
20
|
const today = new Date();
|
|
20
21
|
const days = localDayShift(today);
|
|
21
22
|
|
|
22
|
-
const tasks = document.querySelector("tv-task-list");
|
|
23
|
-
if (tasks) {
|
|
24
|
-
for (const due of tasks.querySelectorAll("tv-task-meta-due")) {
|
|
25
|
-
due.setAttribute("date", shiftDate(due.getAttribute("date"), days));
|
|
26
|
-
}
|
|
27
|
-
document.querySelector("header p").textContent = today.toLocaleDateString("en-US", {
|
|
28
|
-
weekday: "long", month: "long", day: "numeric",
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
|
|
32
23
|
const calendar = document.querySelector("calendar-week");
|
|
33
24
|
if (calendar) {
|
|
34
25
|
calendar.setAttribute("start-date", shiftDate(calendar.getAttribute("start-date"), days));
|