@pinecall/dot 0.0.0-stage → 0.11.21
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/LICENSE +202 -0
- package/README.md +316 -2
- package/dist/agent/index.d.ts +4 -0
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/agent/index.js +3 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/agent/tutor.d.ts +67 -0
- package/dist/agent/tutor.d.ts.map +1 -0
- package/dist/agent/tutor.js +351 -0
- package/dist/agent/tutor.js.map +1 -0
- package/dist/face/draw.d.ts +43 -0
- package/dist/face/draw.d.ts.map +1 -0
- package/dist/face/draw.js +74 -0
- package/dist/face/draw.js.map +1 -0
- package/dist/face/ear.d.ts +23 -0
- package/dist/face/ear.d.ts.map +1 -0
- package/dist/face/ear.js +111 -0
- package/dist/face/ear.js.map +1 -0
- package/dist/face/index.d.ts +23 -0
- package/dist/face/index.d.ts.map +1 -0
- package/dist/face/index.js +138 -0
- package/dist/face/index.js.map +1 -0
- package/dist/face/motion.d.ts +25 -0
- package/dist/face/motion.d.ts.map +1 -0
- package/dist/face/motion.js +58 -0
- package/dist/face/motion.js.map +1 -0
- package/dist/face/mouth.d.ts +45 -0
- package/dist/face/mouth.d.ts.map +1 -0
- package/dist/face/mouth.js +61 -0
- package/dist/face/mouth.js.map +1 -0
- package/dist/face/shape.d.ts +15 -0
- package/dist/face/shape.d.ts.map +1 -0
- package/dist/face/shape.js +50 -0
- package/dist/face/shape.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/page/page.d.ts +34 -0
- package/dist/page/page.d.ts.map +1 -0
- package/dist/page/page.js +218 -0
- package/dist/page/page.js.map +1 -0
- package/dist/page/roles.d.ts +10 -0
- package/dist/page/roles.d.ts.map +1 -0
- package/dist/page/roles.js +87 -0
- package/dist/page/roles.js.map +1 -0
- package/dist/pointer/card.d.ts +13 -0
- package/dist/pointer/card.d.ts.map +1 -0
- package/dist/pointer/card.js +75 -0
- package/dist/pointer/card.js.map +1 -0
- package/dist/pointer/code.d.ts +21 -0
- package/dist/pointer/code.d.ts.map +1 -0
- package/dist/pointer/code.js +147 -0
- package/dist/pointer/code.js.map +1 -0
- package/dist/pointer/flight.d.ts +21 -0
- package/dist/pointer/flight.d.ts.map +1 -0
- package/dist/pointer/flight.js +80 -0
- package/dist/pointer/flight.js.map +1 -0
- package/dist/pointer/hover.d.ts +20 -0
- package/dist/pointer/hover.d.ts.map +1 -0
- package/dist/pointer/hover.js +96 -0
- package/dist/pointer/hover.js.map +1 -0
- package/dist/pointer/menu.d.ts +48 -0
- package/dist/pointer/menu.d.ts.map +1 -0
- package/dist/pointer/menu.js +252 -0
- package/dist/pointer/menu.js.map +1 -0
- package/dist/pointer/person.d.ts +91 -0
- package/dist/pointer/person.d.ts.map +1 -0
- package/dist/pointer/person.js +345 -0
- package/dist/pointer/person.js.map +1 -0
- package/dist/pointer/sections.d.ts +24 -0
- package/dist/pointer/sections.d.ts.map +1 -0
- package/dist/pointer/sections.js +64 -0
- package/dist/pointer/sections.js.map +1 -0
- package/dist/pointer/syntax.d.ts +10 -0
- package/dist/pointer/syntax.d.ts.map +1 -0
- package/dist/pointer/syntax.js +61 -0
- package/dist/pointer/syntax.js.map +1 -0
- package/dist/pointer/typing.d.ts +6 -0
- package/dist/pointer/typing.d.ts.map +1 -0
- package/dist/pointer/typing.js +62 -0
- package/dist/pointer/typing.js.map +1 -0
- package/dist/tutor/captions.d.ts +22 -0
- package/dist/tutor/captions.d.ts.map +1 -0
- package/dist/tutor/captions.js +62 -0
- package/dist/tutor/captions.js.map +1 -0
- package/dist/tutor/macro.d.ts +19 -0
- package/dist/tutor/macro.d.ts.map +1 -0
- package/dist/tutor/macro.js +67 -0
- package/dist/tutor/macro.js.map +1 -0
- package/dist/tutor/options.d.ts +42 -0
- package/dist/tutor/options.d.ts.map +1 -0
- package/dist/tutor/options.js +3 -0
- package/dist/tutor/options.js.map +1 -0
- package/dist/tutor/tutor.d.ts +14 -0
- package/dist/tutor/tutor.d.ts.map +1 -0
- package/dist/tutor/tutor.js +388 -0
- package/dist/tutor/tutor.js.map +1 -0
- package/dist/tutor/views.d.ts +27 -0
- package/dist/tutor/views.d.ts.map +1 -0
- package/dist/tutor/views.js +63 -0
- package/dist/tutor/views.js.map +1 -0
- package/dist/tutor/walking.d.ts +44 -0
- package/dist/tutor/walking.d.ts.map +1 -0
- package/dist/tutor/walking.js +142 -0
- package/dist/tutor/walking.js.map +1 -0
- package/dist/tutor/walks.d.ts +46 -0
- package/dist/tutor/walks.d.ts.map +1 -0
- package/dist/tutor/walks.js +112 -0
- package/dist/tutor/walks.js.map +1 -0
- package/dist/wire/index.d.ts +133 -0
- package/dist/wire/index.d.ts.map +1 -0
- package/dist/wire/index.js +204 -0
- package/dist/wire/index.js.map +1 -0
- package/package.json +53 -3
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** The page as the agent reads it: Playwright's aria snapshot, kept small, with a ref on what can be pointed at. */
|
|
2
|
+
import type { Line } from "../wire/index.js";
|
|
3
|
+
/** What `seen()` returns: the text the agent reads, and its size. */
|
|
4
|
+
export interface Seen {
|
|
5
|
+
text: string;
|
|
6
|
+
bytes: number;
|
|
7
|
+
lines: number;
|
|
8
|
+
}
|
|
9
|
+
export declare class Page {
|
|
10
|
+
#private;
|
|
11
|
+
constructor(document: Document);
|
|
12
|
+
/** The page as text, now. Refs given before are given again to the same elements. */
|
|
13
|
+
seen(): Seen;
|
|
14
|
+
/**
|
|
15
|
+
* What the site wrote for the agent to say, each beside the element it is about: `data-pinecall-say`,
|
|
16
|
+
* in `data-pinecall-order` and then in the page's order, with the move `data-pinecall-do` names
|
|
17
|
+
* (`point` unless it says `highlight` or `scroll_to`).
|
|
18
|
+
*/
|
|
19
|
+
lines(): Line[];
|
|
20
|
+
/** The ref the agent knows `element` by. */
|
|
21
|
+
refOf(element: Element): string;
|
|
22
|
+
/** The element a ref names, while it is on the page; null once it is gone. */
|
|
23
|
+
element(ref: string): Element | null;
|
|
24
|
+
/** The ref of the first element of `role` whose name holds `name`, in the last `seen()`. */
|
|
25
|
+
find(role: string, name: string): string | null;
|
|
26
|
+
/**
|
|
27
|
+
* The ref of what a person would mean by `name`, anywhere on the page, on the screen or not (a section
|
|
28
|
+
* out of view is one line of the snapshot, and the things in it can still be named): the name said
|
|
29
|
+
* exactly, else one that starts with it, else one that holds it, a section before a heading before
|
|
30
|
+
* a card, a button or a link when several share it.
|
|
31
|
+
*/
|
|
32
|
+
named(name: string): string | null;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=page.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../src/page/page.ts"],"names":[],"mappings":"AAAA,oHAAoH;AAWpH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7C,qEAAqE;AACrE,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAUD,qBAAa,IAAI;;IASf,YAAY,QAAQ,EAAE,QAAQ,EAE7B;IAED,qFAAqF;IACrF,IAAI,IAAI,IAAI,CAUX;IAED;;;;OAIG;IACH,KAAK,IAAI,IAAI,EAAE,CAYd;IAED,4CAA4C;IAC5C,KAAK,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAE9B;IAED,8EAA8E;IAC9E,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAGnC;IAED,4FAA4F;IAC5F,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAO9C;IAED;;;;;OAKG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAgBjC;CAgDF"}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
/** The page as the agent reads it: Playwright's aria snapshot, kept small, with a ref on what can be pointed at. */
|
|
2
|
+
//
|
|
3
|
+
// One line per thing a person would name, indented by what holds it: roles and names, not markup.
|
|
4
|
+
// Words in a box that is only layout, as a price, are a line of text, as Playwright says them.
|
|
5
|
+
// What is on the screen is there in full; a section out of view is one line, its name and whether
|
|
6
|
+
// it is above or below, so the agent knows it is there and can scroll to it. A ref is stable for
|
|
7
|
+
// the page's life. A field is its label and what it holds now, a list its options; passwords, card
|
|
8
|
+
// numbers and anything the site marks `data-pinecall-skip` or `aria-hidden` are left out. What the
|
|
9
|
+
// site wrote for the agent to say (`data-pinecall-say`) is marked, and read by `lines()`.
|
|
10
|
+
import { SAID_WHOLE, clean, nameOf, roleOf } from "./roles.js";
|
|
11
|
+
/** The roles that get a ref: what the agent can point at, scroll to, or highlight. */
|
|
12
|
+
const POINTABLE = new Set(["link", "button", "tab", "textbox", "combobox", "checkbox", "radio", "heading", "article", "region", "img", "form", "group"]);
|
|
13
|
+
/** Kept as a line even with no name, because they say where things are. */
|
|
14
|
+
const LANDMARKS = new Set(["banner", "navigation", "main", "contentinfo", "form", "list", "group"]);
|
|
15
|
+
/** Always walked, on screen or not: a sticky header, the page's frame. */
|
|
16
|
+
const FRAME = new Set(["banner", "navigation", "main"]);
|
|
17
|
+
const IGNORED = "script, style, template, audio, video, svg, noscript";
|
|
18
|
+
export class Page {
|
|
19
|
+
#document;
|
|
20
|
+
#refs = new WeakMap();
|
|
21
|
+
/** Every ref ever given, so one the agent holds still names its element after a scroll took it off the screen. */
|
|
22
|
+
#given = new Map();
|
|
23
|
+
/** The refs the last `seen()` showed, which `find()` looks through. */
|
|
24
|
+
#byRef = new Map();
|
|
25
|
+
#next = 1;
|
|
26
|
+
constructor(document) {
|
|
27
|
+
this.#document = document;
|
|
28
|
+
}
|
|
29
|
+
/** The page as text, now. Refs given before are given again to the same elements. */
|
|
30
|
+
seen() {
|
|
31
|
+
this.#byRef = new Map();
|
|
32
|
+
const view = this.#document.defaultView;
|
|
33
|
+
const height = view?.innerHeight ?? 0;
|
|
34
|
+
const top = Math.round(view?.scrollY ?? 0);
|
|
35
|
+
const total = Math.round(this.#document.documentElement.scrollHeight);
|
|
36
|
+
const lines = [`- page "${this.#document.title}" (scrolled ${top}–${top + Math.round(height)} of ${total}px)`];
|
|
37
|
+
this.#walk(this.#document.body, 0, height, lines);
|
|
38
|
+
const text = lines.join("\n");
|
|
39
|
+
return { text, bytes: new TextEncoder().encode(text).length, lines: lines.length };
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* What the site wrote for the agent to say, each beside the element it is about: `data-pinecall-say`,
|
|
43
|
+
* in `data-pinecall-order` and then in the page's order, with the move `data-pinecall-do` names
|
|
44
|
+
* (`point` unless it says `highlight` or `scroll_to`).
|
|
45
|
+
*/
|
|
46
|
+
lines() {
|
|
47
|
+
const marked = [...this.#document.body.querySelectorAll("[data-pinecall-say]")].filter((element) => !element.matches(IGNORED) && !left(element));
|
|
48
|
+
const order = (element) => Number.parseFloat(element.getAttribute("data-pinecall-order") ?? "") || Number.POSITIVE_INFINITY;
|
|
49
|
+
return marked
|
|
50
|
+
.map((element, at) => ({ element, at }))
|
|
51
|
+
.sort((a, b) => order(a.element) - order(b.element) || a.at - b.at)
|
|
52
|
+
.map(({ element }) => {
|
|
53
|
+
const asked = element.getAttribute("data-pinecall-do");
|
|
54
|
+
const move = asked === "highlight" || asked === "scroll_to" ? asked : "point";
|
|
55
|
+
return { at: this.#ref(element), say: clean(element.getAttribute("data-pinecall-say"), 400), do: move };
|
|
56
|
+
})
|
|
57
|
+
.filter((line) => line.say !== "");
|
|
58
|
+
}
|
|
59
|
+
/** The ref the agent knows `element` by. */
|
|
60
|
+
refOf(element) {
|
|
61
|
+
return this.#ref(element);
|
|
62
|
+
}
|
|
63
|
+
/** The element a ref names, while it is on the page; null once it is gone. */
|
|
64
|
+
element(ref) {
|
|
65
|
+
const element = this.#given.get(ref)?.deref();
|
|
66
|
+
return element !== undefined && element.isConnected ? element : null;
|
|
67
|
+
}
|
|
68
|
+
/** The ref of the first element of `role` whose name holds `name`, in the last `seen()`. */
|
|
69
|
+
find(role, name) {
|
|
70
|
+
const wanted = name.toLowerCase();
|
|
71
|
+
for (const [ref, element] of this.#byRef) {
|
|
72
|
+
const own = roleOf(element);
|
|
73
|
+
if (own === role && nameOf(element, own).toLowerCase().includes(wanted))
|
|
74
|
+
return ref;
|
|
75
|
+
}
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* The ref of what a person would mean by `name`, anywhere on the page, on the screen or not (a section
|
|
80
|
+
* out of view is one line of the snapshot, and the things in it can still be named): the name said
|
|
81
|
+
* exactly, else one that starts with it, else one that holds it, a section before a heading before
|
|
82
|
+
* a card, a button or a link when several share it.
|
|
83
|
+
*/
|
|
84
|
+
named(name) {
|
|
85
|
+
const wanted = name.trim().toLowerCase();
|
|
86
|
+
if (wanted === "")
|
|
87
|
+
return null;
|
|
88
|
+
const candidates = [];
|
|
89
|
+
for (const element of this.#document.body.querySelectorAll("*")) {
|
|
90
|
+
if (element.matches(IGNORED) || left(element))
|
|
91
|
+
continue;
|
|
92
|
+
const role = roleOf(element);
|
|
93
|
+
if (role === null || !POINTABLE.has(role))
|
|
94
|
+
continue;
|
|
95
|
+
const said = nameOf(element, role).toLowerCase();
|
|
96
|
+
if (said !== "")
|
|
97
|
+
candidates.push({ ref: this.#ref(element), role, name: said });
|
|
98
|
+
}
|
|
99
|
+
for (const fits of [(one) => one === wanted, (one) => one.startsWith(wanted), (one) => one.includes(wanted)]) {
|
|
100
|
+
const found = candidates.filter((one) => fits(one.name)).sort((a, b) => rank(a.role) - rank(b.role))[0];
|
|
101
|
+
if (found !== undefined)
|
|
102
|
+
return found.ref;
|
|
103
|
+
}
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
#ref(element) {
|
|
107
|
+
let ref = this.#refs.get(element);
|
|
108
|
+
if (ref === undefined) {
|
|
109
|
+
ref = `e${this.#next}`;
|
|
110
|
+
this.#next += 1;
|
|
111
|
+
this.#refs.set(element, ref);
|
|
112
|
+
this.#given.set(ref, new WeakRef(element));
|
|
113
|
+
}
|
|
114
|
+
this.#byRef.set(ref, element);
|
|
115
|
+
return ref;
|
|
116
|
+
}
|
|
117
|
+
#walk(parent, depth, height, lines) {
|
|
118
|
+
for (const child of parent.children) {
|
|
119
|
+
if (child.matches(IGNORED) || left(child))
|
|
120
|
+
continue;
|
|
121
|
+
const role = roleOf(child);
|
|
122
|
+
const name = role === null ? "" : nameOf(child, role);
|
|
123
|
+
const box = child.getBoundingClientRect();
|
|
124
|
+
const visible = box.bottom > 0 && box.top < height && box.width > 0 && box.height > 0;
|
|
125
|
+
const indent = " ".repeat(depth);
|
|
126
|
+
if (role === "region" && !visible) {
|
|
127
|
+
const held = holds(child);
|
|
128
|
+
const inside = held.length > 0 ? `, holds ${held.map((one) => `"${one}"`).join(", ")}` : "";
|
|
129
|
+
const line = child.hasAttribute("data-pinecall-say") ? " [has a line]" : "";
|
|
130
|
+
lines.push(`${indent}- region "${name}" [ref=${this.#ref(child)}] (${box.top > 0 ? "below" : "above"}${inside})${line}`);
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
const kept = role !== null && (name !== "" || LANDMARKS.has(role));
|
|
134
|
+
if (!kept) {
|
|
135
|
+
const words = role === null && visible ? wordsIn(child) : "";
|
|
136
|
+
if (words !== "")
|
|
137
|
+
lines.push(`${indent}- text "${words.replaceAll('"', "'")}"`);
|
|
138
|
+
else
|
|
139
|
+
this.#walk(child, depth, height, lines);
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
if (!visible && !FRAME.has(role))
|
|
143
|
+
continue;
|
|
144
|
+
const parts = [`- ${role}`];
|
|
145
|
+
if (name !== "")
|
|
146
|
+
parts.push(`"${name.replaceAll('"', "'")}"`);
|
|
147
|
+
if (role === "heading")
|
|
148
|
+
parts.push(`[level=${child.tagName.slice(1)}]`);
|
|
149
|
+
if (child instanceof HTMLDetailsElement)
|
|
150
|
+
parts.push(child.open ? "[expanded]" : "[collapsed]");
|
|
151
|
+
if (POINTABLE.has(role))
|
|
152
|
+
parts.push(`[ref=${this.#ref(child)}]`);
|
|
153
|
+
parts.push(...heldBy(child));
|
|
154
|
+
if (child.hasAttribute("data-pinecall-say"))
|
|
155
|
+
parts.push("[has a line]");
|
|
156
|
+
lines.push(indent + parts.join(" "));
|
|
157
|
+
if (!SAID_WHOLE.has(role))
|
|
158
|
+
this.#walk(child, depth + 1, height, lines);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
/** Which of several things that share a name a person means first: the section, then its heading. */
|
|
163
|
+
const PREFERRED = ["region", "heading", "article", "button", "link", "form", "img", "group"];
|
|
164
|
+
function rank(role) {
|
|
165
|
+
const at = PREFERRED.indexOf(role);
|
|
166
|
+
return at === -1 ? PREFERRED.length : at;
|
|
167
|
+
}
|
|
168
|
+
/** How many of a section's things its one line names, when the section is out of view. */
|
|
169
|
+
const HELD_AT_MOST = 8;
|
|
170
|
+
const HELD = new Set(["heading", "article", "button", "link"]);
|
|
171
|
+
/** The things a section out of view holds, by name, so the agent knows what it can scroll to. */
|
|
172
|
+
function holds(region) {
|
|
173
|
+
const names = [];
|
|
174
|
+
for (const element of region.querySelectorAll("*")) {
|
|
175
|
+
if (names.length >= HELD_AT_MOST)
|
|
176
|
+
break;
|
|
177
|
+
if (element.matches(IGNORED) || left(element))
|
|
178
|
+
continue;
|
|
179
|
+
const role = roleOf(element);
|
|
180
|
+
if (role === null || !HELD.has(role))
|
|
181
|
+
continue;
|
|
182
|
+
const name = nameOf(element, role).replaceAll('"', "'");
|
|
183
|
+
if (name !== "" && !names.includes(name))
|
|
184
|
+
names.push(name);
|
|
185
|
+
}
|
|
186
|
+
return names;
|
|
187
|
+
}
|
|
188
|
+
/** Out of the snapshot: hidden, marked by the site, or a secret. */
|
|
189
|
+
/** What a field holds now, as the visitor sees it: its value, the option chosen and the others, ticked or not. */
|
|
190
|
+
function heldBy(field) {
|
|
191
|
+
const quoted = (text) => `"${clean(text, 80).replaceAll('"', "'")}"`;
|
|
192
|
+
if (field instanceof HTMLSelectElement) {
|
|
193
|
+
const options = [...field.options].map((option) => quoted(option.text));
|
|
194
|
+
const chosen = field.selectedOptions[0]?.text ?? "";
|
|
195
|
+
return [chosen === "" ? "[empty]" : `[value=${quoted(chosen)}]`, `(options ${options.join(", ")})`];
|
|
196
|
+
}
|
|
197
|
+
if (field instanceof HTMLInputElement && (field.type === "checkbox" || field.type === "radio"))
|
|
198
|
+
return [field.checked ? "[checked]" : "[unchecked]"];
|
|
199
|
+
if (field instanceof HTMLInputElement || field instanceof HTMLTextAreaElement)
|
|
200
|
+
return [field.value === "" ? "[empty]" : `[value=${quoted(field.value)}]`];
|
|
201
|
+
return [];
|
|
202
|
+
}
|
|
203
|
+
/** The words of a box holding only words and inline marks, as `<div>$19<small> / month</small></div>`; none when it holds more. */
|
|
204
|
+
function wordsIn(box) {
|
|
205
|
+
const inner = [...box.children];
|
|
206
|
+
if (inner.some((child) => roleOf(child) !== null || child.children.length > 0))
|
|
207
|
+
return "";
|
|
208
|
+
return clean([...box.childNodes].map((node) => (node instanceof Text || (node instanceof Element && !left(node)) ? node.textContent : "")).join(""), 120);
|
|
209
|
+
}
|
|
210
|
+
function left(element) {
|
|
211
|
+
if (element.closest("[data-pinecall-skip], [aria-hidden='true']") !== null)
|
|
212
|
+
return true;
|
|
213
|
+
if (element instanceof HTMLInputElement && (element.type === "password" || element.autocomplete.startsWith("cc-")))
|
|
214
|
+
return true;
|
|
215
|
+
const style = element.ownerDocument.defaultView?.getComputedStyle(element);
|
|
216
|
+
return style !== undefined && (style.display === "none" || style.visibility === "hidden");
|
|
217
|
+
}
|
|
218
|
+
//# sourceMappingURL=page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page.js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AA4C,CAAC,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACxF,IAAI,OAAO,YAAY,gBAAgB,IAAI,CAAC,OAAO,CAAC,IAAI,KAAK,UAAU,IAAI,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IAChI,MAAM,KAAK,GAAG,OAAO,CAAC,aAAa,CAAC,WAAW,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC3E,OAAO,KAAK,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,OAAO,KAAK,MAAM,IAAI,KAAK,CAAC,UAAU,KAAK,QAAQ,CAAC,CAAC;AAC5F,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** What an element is to a person, as the accessibility tree says it: its role and its name. */
|
|
2
|
+
/** The role an element plays: its `role`, else the one its tag implies; null for a box that is only layout. */
|
|
3
|
+
export declare function roleOf(element: Element): string | null;
|
|
4
|
+
/** Text on one line, cut at `max` characters. */
|
|
5
|
+
export declare function clean(text: string | null | undefined, max?: number): string;
|
|
6
|
+
/** The roles whose name is their own words: nothing under them is said again. */
|
|
7
|
+
export declare const SAID_WHOLE: Set<string>;
|
|
8
|
+
/** What a person calls the element. A field is its label, never its value: a value never leaves the page. */
|
|
9
|
+
export declare function nameOf(element: Element, role: string): string;
|
|
10
|
+
//# sourceMappingURL=roles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../../src/page/roles.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAEhG,+GAA+G;AAC/G,wBAAgB,MAAM,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAuBtD;AASD,iDAAiD;AACjD,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,GAAG,SAAK,GAAG,MAAM,CAGvE;AAED,iFAAiF;AACjF,eAAO,MAAM,UAAU,aAA2F,CAAC;AAEnH,6GAA6G;AAC7G,wBAAgB,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAS7D"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/** What an element is to a person, as the accessibility tree says it: its role and its name. */
|
|
2
|
+
/** The role an element plays: its `role`, else the one its tag implies; null for a box that is only layout. */
|
|
3
|
+
export function roleOf(element) {
|
|
4
|
+
const explicit = element.getAttribute("role");
|
|
5
|
+
if (explicit)
|
|
6
|
+
return explicit;
|
|
7
|
+
const tag = element.tagName.toLowerCase();
|
|
8
|
+
if (tag === "a" && element.hasAttribute("href"))
|
|
9
|
+
return "link";
|
|
10
|
+
if (tag === "button" || tag === "summary")
|
|
11
|
+
return "button";
|
|
12
|
+
if (/^h[1-6]$/.test(tag))
|
|
13
|
+
return "heading";
|
|
14
|
+
if (tag === "nav")
|
|
15
|
+
return "navigation";
|
|
16
|
+
if (tag === "header" && element.closest("main, article, section") === null)
|
|
17
|
+
return "banner";
|
|
18
|
+
if (tag === "footer" && element.closest("main, article, section") === null)
|
|
19
|
+
return "contentinfo";
|
|
20
|
+
if (tag === "main")
|
|
21
|
+
return "main";
|
|
22
|
+
if (tag === "section" && (element.hasAttribute("aria-labelledby") || element.hasAttribute("aria-label")))
|
|
23
|
+
return "region";
|
|
24
|
+
if (tag === "article")
|
|
25
|
+
return "article";
|
|
26
|
+
if (tag === "form")
|
|
27
|
+
return "form";
|
|
28
|
+
if (tag === "select")
|
|
29
|
+
return "combobox";
|
|
30
|
+
if (tag === "textarea")
|
|
31
|
+
return "textbox";
|
|
32
|
+
if (tag === "input")
|
|
33
|
+
return inputRole(element);
|
|
34
|
+
if (tag === "img" || tag === "figure")
|
|
35
|
+
return "img";
|
|
36
|
+
if (tag === "ul" || tag === "ol")
|
|
37
|
+
return "list";
|
|
38
|
+
if (tag === "li")
|
|
39
|
+
return "listitem";
|
|
40
|
+
if (tag === "details")
|
|
41
|
+
return "group";
|
|
42
|
+
if (tag === "p")
|
|
43
|
+
return "text";
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
function inputRole(input) {
|
|
47
|
+
const type = (input.getAttribute("type") ?? "text").toLowerCase();
|
|
48
|
+
if (type === "checkbox" || type === "radio")
|
|
49
|
+
return type;
|
|
50
|
+
if (type === "submit" || type === "button")
|
|
51
|
+
return "button";
|
|
52
|
+
return "textbox";
|
|
53
|
+
}
|
|
54
|
+
/** Text on one line, cut at `max` characters. */
|
|
55
|
+
export function clean(text, max = 80) {
|
|
56
|
+
const line = (text ?? "").replace(/\s+/g, " ").trim();
|
|
57
|
+
return line.length > max ? `${line.slice(0, max - 1)}…` : line;
|
|
58
|
+
}
|
|
59
|
+
/** The roles whose name is their own words: nothing under them is said again. */
|
|
60
|
+
export const SAID_WHOLE = new Set(["link", "button", "tab", "heading", "text", "textbox", "combobox", "listitem"]);
|
|
61
|
+
/** What a person calls the element. A field is its label, never its value: a value never leaves the page. */
|
|
62
|
+
export function nameOf(element, role) {
|
|
63
|
+
const label = element.getAttribute("aria-label");
|
|
64
|
+
if (label)
|
|
65
|
+
return clean(label);
|
|
66
|
+
const by = element.getAttribute("aria-labelledby");
|
|
67
|
+
if (by)
|
|
68
|
+
return clean(by.split(/\s+/).map((id) => element.ownerDocument.getElementById(id)?.textContent ?? "").join(" "));
|
|
69
|
+
if (role === "img")
|
|
70
|
+
return clean(element.getAttribute("alt") ?? element.textContent);
|
|
71
|
+
if (role === "textbox" || role === "combobox")
|
|
72
|
+
return fieldLabel(element);
|
|
73
|
+
if (SAID_WHOLE.has(role))
|
|
74
|
+
return clean(element.textContent, role === "text" ? 120 : 80);
|
|
75
|
+
return "";
|
|
76
|
+
}
|
|
77
|
+
// The label's own words, without the field inside it: a <label> that wraps its input holds the value too.
|
|
78
|
+
function fieldLabel(field) {
|
|
79
|
+
const id = field.getAttribute("id");
|
|
80
|
+
const label = id ? field.ownerDocument.querySelector(`label[for="${CSS.escape(id)}"]`) : field.closest("label");
|
|
81
|
+
if (label !== null) {
|
|
82
|
+
const words = [...label.childNodes].filter((node) => node.nodeType === Node.TEXT_NODE).map((node) => node.textContent ?? "");
|
|
83
|
+
return clean(words.join(" "));
|
|
84
|
+
}
|
|
85
|
+
return clean(field.getAttribute("placeholder"));
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=roles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roles.js","sourceRoot":"","sources":["../../src/page/roles.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAEhG,+GAA+G;AAC/G,MAAM,UAAU,MAAM,CAAC,OAAgB;IACrC,MAAM,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IAC9C,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAC9B,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;IAC1C,IAAI,GAAG,KAAK,GAAG,IAAI,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC;QAAE,OAAO,MAAM,CAAC;IAC/D,IAAI,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,QAAQ,CAAC;IAC3D,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,SAAS,CAAC;IAC3C,IAAI,GAAG,KAAK,KAAK;QAAE,OAAO,YAAY,CAAC;IACvC,IAAI,GAAG,KAAK,QAAQ,IAAI,OAAO,CAAC,OAAO,CAAC,wBAAwB,CAAC,KAAK,IAAI;QAAE,OAAO,QAAQ,CAAC;IAC5F,IAAI,GAAG,KAAK,QAAQ,IAAI,OAAO,CAAC,OAAO,CAAC,wBAAwB,CAAC,KAAK,IAAI;QAAE,OAAO,aAAa,CAAC;IACjG,IAAI,GAAG,KAAK,MAAM;QAAE,OAAO,MAAM,CAAC;IAClC,IAAI,GAAG,KAAK,SAAS,IAAI,CAAC,OAAO,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W,EAAE,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACxF,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,0GAA0G;AAC1G,SAAS,UAAU,CAAC,KAAc;IAChC,MAAM,EAAE,GAAG,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IACpC,MAAM,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,aAAa,CAAC,cAAc,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAChH,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACnB,MAAM,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC;QAC7H,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAChC,CAAC;IACD,OAAO,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** A card beside the resting face for what the agent puts on the screen: the free times, a form, a piece of code. */
|
|
2
|
+
export declare class Card {
|
|
3
|
+
#private;
|
|
4
|
+
/** The card, hidden, put on a layer by `host`; `label` names its close button. */
|
|
5
|
+
constructor(document: Document, host: (element: Element) => void, label: string);
|
|
6
|
+
/** Put something on the card, in place of what it held: `render` draws into the body, and may answer how to take it down. */
|
|
7
|
+
show(render: (body: HTMLElement) => void | (() => void)): void;
|
|
8
|
+
/** Put it away. */
|
|
9
|
+
hide(): void;
|
|
10
|
+
get shown(): boolean;
|
|
11
|
+
close(): void;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../src/pointer/card.ts"],"names":[],"mappings":"AAAA,qHAAqH;AAoBrH,qBAAa,IAAI;;IAOf,kFAAkF;IAClF,YAAY,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,EAAE,KAAK,EAAE,MAAM,EAkB9E;IAED,6HAA6H;IAC7H,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAK7D;IAED,mBAAmB;IACnB,IAAI,IAAI,IAAI,CAKX;IAED,IAAI,KAAK,IAAI,OAAO,CAEnB;IAED,KAAK,IAAI,IAAI,CAKZ;CAOF"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/** A card beside the resting face for what the agent puts on the screen: the free times, a form, a piece of code. */
|
|
2
|
+
//
|
|
3
|
+
// It stands on the person's layer, above the face's corner, out of what the agent reads. The page
|
|
4
|
+
// draws what is in it (`show` hands it the body); the card keeps it until it is put away, replaced or
|
|
5
|
+
// the call ends. Colours: --pc-card and --pc-card-ink, else the bubble's.
|
|
6
|
+
const STYLE = `
|
|
7
|
+
.pc-card { position: fixed; z-index: 1; right: 22px; bottom: 112px; box-sizing: border-box; width: min(600px, calc(100vw - 32px));
|
|
8
|
+
max-height: min(78vh, 720px); overflow: auto; padding: 20px 22px; border-radius: 16px; pointer-events: auto;
|
|
9
|
+
background: var(--pc-card, var(--pc-bubble, #fff)); color: var(--pc-card-ink, var(--pc-bubble-ink, #17201c));
|
|
10
|
+
border: 1px solid rgb(127 127 127 / .24); box-shadow: 0 18px 50px rgb(0 0 0 / .3);
|
|
11
|
+
font: 15px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; transform-origin: bottom right; transition: opacity .22s, transform .22s; }
|
|
12
|
+
.pc-card[hidden] { display: block !important; opacity: 0; transform: translateY(8px) scale(.98); pointer-events: none; }
|
|
13
|
+
.pc-layer.pc-left .pc-card { right: auto; left: 22px; transform-origin: bottom left; }
|
|
14
|
+
.pc-card-x { all: unset; position: absolute; top: 8px; right: 10px; width: 22px; height: 22px; line-height: 22px; text-align: center;
|
|
15
|
+
border-radius: 50%; cursor: pointer; opacity: .5; font-size: 16px; }
|
|
16
|
+
.pc-card-x:hover, .pc-card-x:focus-visible { opacity: 1; background: rgb(127 127 127 / .2); }
|
|
17
|
+
@media (prefers-reduced-motion: reduce) { .pc-card { transition: none; } }
|
|
18
|
+
`;
|
|
19
|
+
export class Card {
|
|
20
|
+
#style;
|
|
21
|
+
#card;
|
|
22
|
+
#body;
|
|
23
|
+
#cleanup;
|
|
24
|
+
#fading;
|
|
25
|
+
/** The card, hidden, put on a layer by `host`; `label` names its close button. */
|
|
26
|
+
constructor(document, host, label) {
|
|
27
|
+
this.#style = document.createElement("style");
|
|
28
|
+
this.#style.textContent = STYLE;
|
|
29
|
+
document.head.append(this.#style);
|
|
30
|
+
this.#card = document.createElement("div");
|
|
31
|
+
this.#card.className = "pc-card";
|
|
32
|
+
this.#card.hidden = true;
|
|
33
|
+
this.#card.setAttribute("role", "dialog");
|
|
34
|
+
const close = document.createElement("button");
|
|
35
|
+
close.type = "button";
|
|
36
|
+
close.className = "pc-card-x";
|
|
37
|
+
close.textContent = "×";
|
|
38
|
+
close.setAttribute("aria-label", label);
|
|
39
|
+
close.title = label;
|
|
40
|
+
close.addEventListener("click", () => this.hide());
|
|
41
|
+
this.#body = document.createElement("div");
|
|
42
|
+
this.#card.append(this.#body, close);
|
|
43
|
+
host(this.#card);
|
|
44
|
+
}
|
|
45
|
+
/** Put something on the card, in place of what it held: `render` draws into the body, and may answer how to take it down. */
|
|
46
|
+
show(render) {
|
|
47
|
+
this.#release();
|
|
48
|
+
clearTimeout(this.#fading);
|
|
49
|
+
this.#card.hidden = false;
|
|
50
|
+
this.#cleanup = render(this.#body) ?? undefined;
|
|
51
|
+
}
|
|
52
|
+
/** Put it away. */
|
|
53
|
+
hide() {
|
|
54
|
+
if (this.#card.hidden)
|
|
55
|
+
return;
|
|
56
|
+
this.#card.hidden = true;
|
|
57
|
+
// What it held goes once it has faded, unless something else was put on it meanwhile.
|
|
58
|
+
this.#fading = setTimeout(() => this.#release(), 260);
|
|
59
|
+
}
|
|
60
|
+
get shown() {
|
|
61
|
+
return !this.#card.hidden;
|
|
62
|
+
}
|
|
63
|
+
close() {
|
|
64
|
+
clearTimeout(this.#fading);
|
|
65
|
+
this.#release();
|
|
66
|
+
this.#card.remove();
|
|
67
|
+
this.#style.remove();
|
|
68
|
+
}
|
|
69
|
+
#release() {
|
|
70
|
+
this.#cleanup?.();
|
|
71
|
+
this.#cleanup = undefined;
|
|
72
|
+
this.#body.replaceChildren();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.js","sourceRoot":"","sources":["../../src/pointer/card.ts"],"names":[],"mappings":"AAAA,qHAAqH;AACrH,EAAE;AACF,kGAAkG;AAClG,sGAAsG;AACtG,0EAA0E;AAE1E,MAAM,KAAK,GAAG;;;;;;;;;;;;CAYb,CAAC;AAEF,MAAM,OAAO,IAAI;IACN,MAAM,CAAmB;IACzB,KAAK,CAAc;IACnB,KAAK,CAAc;IAC5B,QAAQ,CAA2B;IACnC,OAAO,CAA4C;IAEnD,kFAAkF;IAClF,YAAY,QAAkB,EAAE,IAAgC,EAAE,KAAa;QAC7E,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAC9C,IAAI,CAAC,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;QAChC,QAAQ,CAAC,IAAI,CAAC,MA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AAI,CAAC,KAAK,CAAC,MAAM;YAAE,OAAO;QAC9B,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;QACzB,sFAAsF;QACtF,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,GAAG,CAAC,CAAC;IACxD,CAAC;IAED,IAAI,KAAK;QACP,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC5B,CAAC;IAED,KAAK;QACH,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC3B,IAAI,CAAC,QAAQ,EAAE,CAAC;QAChB,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;QACpB,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;IACvB,CAAC;IAED,QAAQ;QACN,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;QAC1B,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC;IAC/B,CAAC;CACF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** A window of code the tutor opens beside the page while it explains it: written in line by line, coloured, the lines it talks about lit. */
|
|
2
|
+
import type { CodeView } from "../wire/index.js";
|
|
3
|
+
export declare class CodeWindow {
|
|
4
|
+
#private;
|
|
5
|
+
/** The window, hidden, put on a layer by `host`; `still` writes its lines in at once (reduced motion). */
|
|
6
|
+
constructor(document: Document, host: (element: Element) => void, still?: boolean);
|
|
7
|
+
/**
|
|
8
|
+
* What a step shows: a window opened (or another in its place) for `code`, closed for `null`, kept as
|
|
9
|
+
* it is for none; and `lines` lit. Answers the first lit line, for the pointer to go to.
|
|
10
|
+
*/
|
|
11
|
+
show(code: CodeView | null | undefined, lines: [number, number] | undefined): HTMLElement | null;
|
|
12
|
+
/** Light lines `from` to `to` (from 1), dim the rest, bring the lit ones into the window; answers the first one's code, past its number. */
|
|
13
|
+
light([from, to]: [number, number]): HTMLElement | null;
|
|
14
|
+
/** The box the lit lines fill on the screen, for the person to stand clear of; null with none lit. */
|
|
15
|
+
litBox(): DOMRect | null;
|
|
16
|
+
/** Whether a window is open. */
|
|
17
|
+
get open(): boolean;
|
|
18
|
+
hide(): void;
|
|
19
|
+
close(): void;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code.d.ts","sourceRoot":"","sources":["../../src/pointer/code.ts"],"names":[],"mappings":"AAAA,8IAA8I;AAS9I,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAmCjD,qBAAa,UAAU;;IAUrB,0GAA0G;IAC1G,YAAY,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,EAAE,KAAK,UAAQ,EAc9E;IAED;;;OAGG;IACH,IAAI,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,GAAG,SAAS,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GAAG,WAAW,GAAG,IAAI,CAO/F;IAED,4IAA4I;IAC5I,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,WAAW,GAAG,IAAI,CAStD;IAED,sGAAsG;IACtG,MAAM,IAAI,OAAO,GAAG,IAAI,CAQvB;IAED,gCAAgC;IAChC,IAAI,IAAI,IAAI,OAAO,CAElB;IAED,IAAI,IAAI,IAAI,CAIX;IAED,KAAK,IAAI,IAAI,CAIZ;CA+BF"}
|