@pinecall/dot 0.0.0-stage → 0.11.22
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 +30 -0
- package/dist/pointer/flight.d.ts.map +1 -0
- package/dist/pointer/flight.js +92 -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 +389 -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,252 @@
|
|
|
1
|
+
/** The walks a visitor may play with no call: a small button beside the resting face, its pills fanned in an arc round it. */
|
|
2
|
+
//
|
|
3
|
+
// The button sits on the face's shoulder, toward the page, in front of the face: behind it, a click
|
|
4
|
+
// meant for it reached the face and began a call. A click fans the walks out beside the
|
|
5
|
+
// face, each a pill with its title and length, read from the top: the first walk is the highest. Escape, a click elsewhere or
|
|
6
|
+
// a pick closes them. One walk can also be offered alone, beside the face, for a few seconds: the one
|
|
7
|
+
// of the section scrolled to. Every colour is the person's: --pc-face, --pc-bubble, --pc-bubble-ink.
|
|
8
|
+
import { clock } from "../wire/index.js";
|
|
9
|
+
/** A pill's height, in px. */
|
|
10
|
+
const PILL = 24;
|
|
11
|
+
const STYLE = `
|
|
12
|
+
.pc-walks { position: fixed; z-index: 3; width: 22px; height: 22px; padding: 0; border: 2px solid var(--pc-bubble, #fff); border-radius: 50%;
|
|
13
|
+
background: var(--pc-face, #1f6b55); color: #fff; font: 700 10px/18px system-ui, sans-serif; text-align: center; cursor: pointer;
|
|
14
|
+
pointer-events: auto; box-shadow: 0 2px 8px rgb(0 0 0 / .2); transition: transform .15s; }
|
|
15
|
+
.pc-walks:hover, .pc-walks[aria-expanded="true"] { transform: scale(1.12); }
|
|
16
|
+
.pc-walks:focus-visible, .pc-pill:focus-visible { outline: 2px solid var(--pc-face-ring, #44a785); outline-offset: 2px; }
|
|
17
|
+
.pc-walks[hidden], .pc-pill[hidden] { display: none; }
|
|
18
|
+
.pc-pill { position: fixed; z-index: 3; display: flex; align-items: center; gap: 6px; height: ${PILL}px; padding: 0 10px 0 8px; border: 0;
|
|
19
|
+
border-radius: 999px; background: var(--pc-bubble, #fff); color: var(--pc-bubble-ink, #17201c); cursor: pointer; pointer-events: auto;
|
|
20
|
+
font: 500 12px/${PILL}px system-ui, -apple-system, "Segoe UI", sans-serif; white-space: nowrap; box-shadow: 0 4px 14px rgb(0 0 0 / .16);
|
|
21
|
+
opacity: 0; transform: scale(.85); transition: opacity .18s, transform .18s; }
|
|
22
|
+
.pc-pill.pc-shown { opacity: 1; transform: none; }
|
|
23
|
+
.pc-pill .pc-tri { width: 0; height: 0; border-style: solid; border-width: 4px 0 4px 6px; border-color: transparent transparent transparent var(--pc-face, #1f6b55); }
|
|
24
|
+
.pc-pill .pc-long { opacity: .55; font-variant-numeric: tabular-nums; }
|
|
25
|
+
.pc-more { position: fixed; z-index: 3; display: grid; place-items: center; width: ${PILL}px; height: ${PILL}px; padding: 0; border: 0;
|
|
26
|
+
border-radius: 50%; background: var(--pc-bubble, #fff); color: var(--pc-face, #1f6b55); cursor: pointer; pointer-events: auto;
|
|
27
|
+
box-shadow: 0 4px 14px rgb(0 0 0 / .16); }
|
|
28
|
+
.pc-more[hidden] { display: none; }
|
|
29
|
+
.pc-more svg { transition: transform .2s; }
|
|
30
|
+
.pc-more.pc-last svg { transform: rotate(180deg); }
|
|
31
|
+
.pc-more:focus-visible { outline: 2px solid var(--pc-face-ring, #44a785); outline-offset: 2px; }
|
|
32
|
+
@media (prefers-reduced-motion: reduce) { .pc-pill, .pc-walks, .pc-more svg { transition: none; } }
|
|
33
|
+
`;
|
|
34
|
+
/** How long a walk offered alone stays beside the face, in ms. */
|
|
35
|
+
export const OFFERED_MS = 5000;
|
|
36
|
+
/** How many pills show at once; the rest come a page at a time, from a small button under them. */
|
|
37
|
+
export const PAGE = 4;
|
|
38
|
+
/** How far apart two pills stand, in px: a pill's height and a gap of 6, so no two ever overlap. */
|
|
39
|
+
export const STEP = PILL + 6;
|
|
40
|
+
/** How far the nearest pill stands from the face's edge, and how much farther each lower one does, in px. */
|
|
41
|
+
const GAP = 14;
|
|
42
|
+
const SLANT = 10;
|
|
43
|
+
/**
|
|
44
|
+
* Where each of `count` pills sits beside a face at `at` of `radius`, the end nearest it: rising a
|
|
45
|
+
* step at a time from beside the face, each a slant nearer it than the one below, the highest a gap
|
|
46
|
+
* from its edge. On an arc wide enough for the highest, the lowest stood far out from the face.
|
|
47
|
+
*/
|
|
48
|
+
export function fanned(count, at, radius, dock) {
|
|
49
|
+
const side = dock === "right" ? -1 : 1;
|
|
50
|
+
const lowest = radius * 0.3;
|
|
51
|
+
return Array.from({ length: count }, (_, index) => ({
|
|
52
|
+
x: at.x + side * (radius + GAP + (count - 1 - index) * SLANT),
|
|
53
|
+
y: at.y - lowest - index * STEP,
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
export class Menu {
|
|
57
|
+
#document;
|
|
58
|
+
#options;
|
|
59
|
+
#style;
|
|
60
|
+
#button;
|
|
61
|
+
#host;
|
|
62
|
+
#more;
|
|
63
|
+
#pills = [];
|
|
64
|
+
#open = false;
|
|
65
|
+
/** Which page of pills shows, from 0. */
|
|
66
|
+
#page = 0;
|
|
67
|
+
/** The walk offered alone, by its place in the list, and when it goes. */
|
|
68
|
+
#alone = null;
|
|
69
|
+
#outside = (event) => {
|
|
70
|
+
const target = event.target instanceof Node ? event.target : null;
|
|
71
|
+
if (target !== null && [this.#button, this.#more, ...this.#pills].some((part) => part.contains(target)))
|
|
72
|
+
return;
|
|
73
|
+
this.toggle(false);
|
|
74
|
+
};
|
|
75
|
+
#escape = (event) => {
|
|
76
|
+
if (event.key === "Escape")
|
|
77
|
+
this.toggle(false);
|
|
78
|
+
};
|
|
79
|
+
// The face rests in a corner of the window, so a resize moves it, and the button and pills with it.
|
|
80
|
+
#resized = () => this.#place();
|
|
81
|
+
constructor(document, host, options) {
|
|
82
|
+
this.#document = document;
|
|
83
|
+
this.#options = options;
|
|
84
|
+
this.#style = document.createElement("style");
|
|
85
|
+
this.#style.textContent = STYLE;
|
|
86
|
+
document.head.append(this.#style);
|
|
87
|
+
this.#button = document.createElement("button");
|
|
88
|
+
this.#button.type = "button";
|
|
89
|
+
this.#button.className = "pc-walks";
|
|
90
|
+
this.#button.hidden = true;
|
|
91
|
+
this.#button.textContent = "▸";
|
|
92
|
+
this.#button.setAttribute("aria-label", options.label);
|
|
93
|
+
this.#button.setAttribute("aria-expanded", "false");
|
|
94
|
+
this.#button.title = options.label;
|
|
95
|
+
this.#button.addEventListener("click", () => this.toggle(!this.#open));
|
|
96
|
+
host(this.#button);
|
|
97
|
+
this.#more = document.createElement("button");
|
|
98
|
+
this.#more.type = "button";
|
|
99
|
+
this.#more.className = "pc-more";
|
|
100
|
+
this.#more.hidden = true;
|
|
101
|
+
this.#more.innerHTML = `<svg viewBox="0 0 12 12" width="11" height="11" aria-hidden="true"><path d="M2.5 4.5 6 8l3.5-3.5" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/></svg>`;
|
|
102
|
+
this.#more.setAttribute("aria-label", options.more);
|
|
103
|
+
this.#more.title = options.more;
|
|
104
|
+
this.#more.addEventListener("click", () => {
|
|
105
|
+
this.#page = (this.#page + 1) % Math.ceil(this.#pills.length / PAGE);
|
|
106
|
+
this.#show();
|
|
107
|
+
this.#shown()[0]?.focus();
|
|
108
|
+
});
|
|
109
|
+
host(this.#more);
|
|
110
|
+
this.#host = host;
|
|
111
|
+
document.addEventListener("pointerdown", this.#outside, true);
|
|
112
|
+
document.addEventListener("keydown", this.#escape);
|
|
113
|
+
document.defaultView?.addEventListener("resize", this.#resized);
|
|
114
|
+
}
|
|
115
|
+
/** The walks to offer; none hides the button. */
|
|
116
|
+
offer(items) {
|
|
117
|
+
this.#unsuggest();
|
|
118
|
+
for (const pill of this.#pills)
|
|
119
|
+
pill.remove();
|
|
120
|
+
this.#pills = items.map((item, index) => {
|
|
121
|
+
const pill = this.#document.createElement("button");
|
|
122
|
+
pill.type = "button";
|
|
123
|
+
pill.className = "pc-pill";
|
|
124
|
+
pill.hidden = true;
|
|
125
|
+
const tri = this.#document.createElement("span");
|
|
126
|
+
tri.className = "pc-tri";
|
|
127
|
+
const long = this.#document.createElement("span");
|
|
128
|
+
long.className = "pc-long";
|
|
129
|
+
long.textContent = clock(item.ms);
|
|
130
|
+
pill.append(tri, this.#document.createTextNode(item.title), long);
|
|
131
|
+
pill.addEventListener("click", () => {
|
|
132
|
+
this.toggle(false);
|
|
133
|
+
this.#options.onPick(index);
|
|
134
|
+
});
|
|
135
|
+
this.#host(pill);
|
|
136
|
+
return pill;
|
|
137
|
+
});
|
|
138
|
+
this.#button.hidden = items.length === 0;
|
|
139
|
+
}
|
|
140
|
+
/** Whether the button may show now: not during a call, nor while a walk plays. */
|
|
141
|
+
available(on) {
|
|
142
|
+
this.#button.hidden = !on || this.#pills.length === 0;
|
|
143
|
+
if (!on)
|
|
144
|
+
this.toggle(false);
|
|
145
|
+
if (on)
|
|
146
|
+
this.#place();
|
|
147
|
+
}
|
|
148
|
+
/** Offer one walk alone, beside the face, for `ms`, while the button shows and the pills are folded. */
|
|
149
|
+
suggest(index, ms = OFFERED_MS) {
|
|
150
|
+
const pill = this.#pills[index];
|
|
151
|
+
if (pill === undefined || this.#open || this.#button.hidden)
|
|
152
|
+
return;
|
|
153
|
+
this.#unsuggest();
|
|
154
|
+
this.#alone = { index, timer: setTimeout(() => this.#unsuggest(), ms) };
|
|
155
|
+
this.#place();
|
|
156
|
+
pill.hidden = false;
|
|
157
|
+
setTimeout(() => pill.classList.add("pc-shown"), 30);
|
|
158
|
+
}
|
|
159
|
+
/** Fan the pills out, or fold them back. */
|
|
160
|
+
toggle(open) {
|
|
161
|
+
this.#unsuggest();
|
|
162
|
+
this.#open = open && !this.#button.hidden;
|
|
163
|
+
this.#page = 0;
|
|
164
|
+
this.#button.setAttribute("aria-expanded", String(this.#open));
|
|
165
|
+
this.#show();
|
|
166
|
+
if (this.#open)
|
|
167
|
+
this.#shown()[0]?.focus();
|
|
168
|
+
}
|
|
169
|
+
/** The pills of the page showing, while the pills are fanned out. */
|
|
170
|
+
#shown() {
|
|
171
|
+
return this.#open ? this.#pills.slice(this.#page * PAGE, (this.#page + 1) * PAGE) : [];
|
|
172
|
+
}
|
|
173
|
+
// The page's pills shown, one after another; the others folded; the button for more while there are more than a page.
|
|
174
|
+
#show() {
|
|
175
|
+
this.#place();
|
|
176
|
+
const shown = this.#shown();
|
|
177
|
+
for (const pill of this.#pills) {
|
|
178
|
+
if (shown.includes(pill))
|
|
179
|
+
continue;
|
|
180
|
+
pill.hidden = true;
|
|
181
|
+
pill.classList.remove("pc-shown");
|
|
182
|
+
}
|
|
183
|
+
shown.forEach((pill, index) => {
|
|
184
|
+
pill.hidden = false;
|
|
185
|
+
setTimeout(() => pill.classList.add("pc-shown"), 30 * index);
|
|
186
|
+
});
|
|
187
|
+
this.#more.hidden = !this.#open || this.#pills.length <= PAGE;
|
|
188
|
+
this.#more.classList.toggle("pc-last", (this.#page + 1) * PAGE >= this.#pills.length);
|
|
189
|
+
}
|
|
190
|
+
get open() {
|
|
191
|
+
return this.#open;
|
|
192
|
+
}
|
|
193
|
+
#place() {
|
|
194
|
+
const { at, radius } = this.#options.face();
|
|
195
|
+
const lean = radius * 0.72 + 2;
|
|
196
|
+
const side = this.#options.dock === "right" ? -1 : 1;
|
|
197
|
+
Object.assign(this.#button.style, { left: `${at.x + side * lean - 11}px`, top: `${at.y - lean - 11}px` });
|
|
198
|
+
const view = this.#document.defaultView;
|
|
199
|
+
const right = this.#options.dock === "right";
|
|
200
|
+
const stand = (pill, point) => {
|
|
201
|
+
if (pill === undefined)
|
|
202
|
+
return;
|
|
203
|
+
Object.assign(pill.style, {
|
|
204
|
+
top: `${point.y - PILL / 2}px`,
|
|
205
|
+
left: right ? "auto" : `${point.x}px`,
|
|
206
|
+
right: right ? `${(view?.innerWidth ?? 0) - point.x}px` : "auto",
|
|
207
|
+
transformOrigin: right ? "right center" : "left center",
|
|
208
|
+
});
|
|
209
|
+
};
|
|
210
|
+
// The page's pills from the top, the first the highest; under them, the button for more.
|
|
211
|
+
const shown = this.#shown();
|
|
212
|
+
const paged = this.#pills.length > PAGE;
|
|
213
|
+
const slots = fanned(shown.length + (paged ? 1 : 0), at, radius, this.#options.dock);
|
|
214
|
+
shown.forEach((pill, index) => stand(pill, slots[slots.length - 1 - index] ?? at));
|
|
215
|
+
const [under] = slots;
|
|
216
|
+
if (paged && under !== undefined) {
|
|
217
|
+
Object.assign(this.#more.style, { left: `${right ? under.x - PILL : under.x}px`, top: `${under.y - PILL / 2}px` });
|
|
218
|
+
}
|
|
219
|
+
// A walk offered alone stands where the lowest pill would, beside the face.
|
|
220
|
+
const [beside] = fanned(1, at, radius, this.#options.dock);
|
|
221
|
+
if (this.#alone !== null && beside !== undefined)
|
|
222
|
+
stand(this.#pills[this.#alone.index], beside);
|
|
223
|
+
}
|
|
224
|
+
#unsuggest() {
|
|
225
|
+
if (this.#alone === null)
|
|
226
|
+
return;
|
|
227
|
+
clearTimeout(this.#alone.timer);
|
|
228
|
+
const { index } = this.#alone;
|
|
229
|
+
const pill = this.#pills[index];
|
|
230
|
+
this.#alone = null;
|
|
231
|
+
if (pill === undefined || this.#open)
|
|
232
|
+
return;
|
|
233
|
+
pill.classList.remove("pc-shown");
|
|
234
|
+
// Hidden once it has faded, unless it was offered again or the pills fanned out meanwhile.
|
|
235
|
+
setTimeout(() => {
|
|
236
|
+
if (!this.#open && this.#alone?.index !== index)
|
|
237
|
+
pill.hidden = true;
|
|
238
|
+
}, 200);
|
|
239
|
+
}
|
|
240
|
+
close() {
|
|
241
|
+
this.#unsuggest();
|
|
242
|
+
this.#document.removeEventListener("pointerdown", this.#outside, true);
|
|
243
|
+
this.#document.removeEventListener("keydown", this.#escape);
|
|
244
|
+
this.#document.defaultView?.removeEventListener("resize", this.#resized);
|
|
245
|
+
this.#button.remove();
|
|
246
|
+
this.#more.remove();
|
|
247
|
+
for (const pill of this.#pills)
|
|
248
|
+
pill.remove();
|
|
249
|
+
this.#style.remove();
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
//# sourceMappingURL=menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu.js","sourceRoot":"","sources":["../../src/pointer/menu.ts"],"names":[],"mappings":"AAAA,8HAA8H;AAC9H,EAAE;AACF,oGAAoG;AACpG,wFAAwF;AACxF,8HAA8H;AAC9H,sGAAsG;AACtG,qGAAqG;AAErG,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAGzC,8BAA8B;AAC9B,MAAM,IAAI,GAAG,EAAE,CAAC;AAEhB,MAAM,KAAK,GAAG;;;;;;;gGAOkF,IAAI;;mBAEjF,IAAI;;;;;qFAK8D,IAAI,eAAe,IAAI;;;;;;;;CAQ3G,CAAC;AAoBF,kEAAkE;AAClE,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC;AAE/B,mGAAmG;AACnG,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC;AAEtB,oGAAoG;AACpG,MAAM,CAAC,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,CAAC;AAE7B,6GAA6G;AAC7G,MAAM,GAAG,GAAG,EAAE,CAAC;AACf,MAAM,KAAK,GAAG,EAAE,CAAC;AAEjB;;;;GAIG;AACH,MAAM,UAAU,MAAM,CAAC,KAAa,EAAE,EAAS,EAAE,MAAc,EAAE,IAAsB;IACrF,MAAM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AC,MAAM,EAAE,CAAC;QACpB,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,MAAM;YAAE,IAAI,CAAC,MAAM,EAAE,CAAC;QAC9C,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;IACvB,CAAC;CACF"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/** The tutor as one more person on the page: a pointer of its own, its face beside the tip, what it says beside the face. */
|
|
2
|
+
import type { Kind } from "./hover.js";
|
|
3
|
+
import type { Point } from "./flight.js";
|
|
4
|
+
/** Which side of the tip the face and its words sit on: to its left or right, above or below it. */
|
|
5
|
+
export interface Side {
|
|
6
|
+
west: boolean;
|
|
7
|
+
up: boolean;
|
|
8
|
+
}
|
|
9
|
+
/** The first side whose reach fits the screen and covers nothing of `avoid`; else the first that fits; else below and right. */
|
|
10
|
+
export declare function sideOf(tip: Point, avoid: DOMRect | null, width: number, height: number): Side;
|
|
11
|
+
export interface PersonOptions {
|
|
12
|
+
/** The corner it rests in. */
|
|
13
|
+
dock: "right" | "left";
|
|
14
|
+
/** What the face is called for a screen reader: "Talk to Pip". */
|
|
15
|
+
label: string;
|
|
16
|
+
/** The face's and the arrow's colour, any CSS colour; the page's `--pc-face` when left out. */
|
|
17
|
+
color?: string | undefined;
|
|
18
|
+
/** A click (or Enter) on the face. */
|
|
19
|
+
onClick: () => void;
|
|
20
|
+
/** The hang-up button: its name, and its click. */
|
|
21
|
+
hangUp: {
|
|
22
|
+
label: string;
|
|
23
|
+
onClick: () => void;
|
|
24
|
+
};
|
|
25
|
+
/** The button that stops a walk: its name, and its click. */
|
|
26
|
+
stop: {
|
|
27
|
+
label: string;
|
|
28
|
+
onClick: () => void;
|
|
29
|
+
};
|
|
30
|
+
/** The button that holds a walk and goes on with it: its name, and its click. */
|
|
31
|
+
pause: {
|
|
32
|
+
label: string;
|
|
33
|
+
onClick: () => void;
|
|
34
|
+
};
|
|
35
|
+
/** The captions button, when the site lets the visitor choose: its name, and its click. */
|
|
36
|
+
captions: {
|
|
37
|
+
label: string;
|
|
38
|
+
onClick: () => void;
|
|
39
|
+
} | null;
|
|
40
|
+
/** The ▶ beside an element the site wrote a line for: its name, and its click with that element. */
|
|
41
|
+
explain: {
|
|
42
|
+
label: string;
|
|
43
|
+
onClick: (element: Element) => void;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export declare class Person {
|
|
47
|
+
#private;
|
|
48
|
+
/** The element the face is drawn into. */
|
|
49
|
+
readonly face: HTMLElement;
|
|
50
|
+
constructor(document: Document, options: PersonOptions);
|
|
51
|
+
/** Where the face rests: its middle, 52 px in from the corner. */
|
|
52
|
+
dock(): Point;
|
|
53
|
+
/** The tip, now. */
|
|
54
|
+
get at(): Point;
|
|
55
|
+
/**
|
|
56
|
+
* Put the tip at a point of the viewport, the face and its words on `side`, or on the side of it that
|
|
57
|
+
* fits the screen and covers nothing of `avoid`, the box being explained: right or left, below or above.
|
|
58
|
+
*/
|
|
59
|
+
place(point: Point, avoid?: DOMRect | null, side?: Side): void;
|
|
60
|
+
/** Out of the corner with the arrow showing, the buttons sliding into it; or back in it, and they aside. */
|
|
61
|
+
tour(on: boolean): void;
|
|
62
|
+
get touring(): boolean;
|
|
63
|
+
kind(kind: Kind): void;
|
|
64
|
+
/** What it is saying: the words said, and the ones still to come; null hides the bubble. */
|
|
65
|
+
say(lit: string | null, coming?: string): void;
|
|
66
|
+
/** What the visitor is saying, in the corner; null hides it. */
|
|
67
|
+
heard(text: string | null): void;
|
|
68
|
+
/**
|
|
69
|
+
* The corner's buttons: captions and hang-up while a call is on, captions, pause and stop while a
|
|
70
|
+
* walk plays; captions pressed while they show, pause while the walk is held. Called every frame, so
|
|
71
|
+
* it writes only what changed.
|
|
72
|
+
*/
|
|
73
|
+
buttons(call: boolean, walk: boolean, captioned: boolean, paused?: boolean): void;
|
|
74
|
+
/** The ▶ at the top right of `element`, or none. Called every frame while shown, so it follows the element. */
|
|
75
|
+
offer(element: Element | null): void;
|
|
76
|
+
/** The spotlight on an element's box, or off. Called every frame while on, so it follows the element. */
|
|
77
|
+
spot(element: Element | null): void;
|
|
78
|
+
/** "Here": a ring where the tip is, twice. */
|
|
79
|
+
ring(): void;
|
|
80
|
+
/** Put another part on the person's layer, out of what the agent reads: the walks' button and pills. */
|
|
81
|
+
add(element: Element): void;
|
|
82
|
+
/**
|
|
83
|
+
* Half the resting face's width, in px, touring or not: read off a face still small from a walk, it
|
|
84
|
+
* set the walks' button where the face, grown back, covered it.
|
|
85
|
+
*/
|
|
86
|
+
get radius(): number;
|
|
87
|
+
/** How far a walk has played, 0 to 1, as a ring round the face; null takes the ring away. */
|
|
88
|
+
progress(fraction: number | null): void;
|
|
89
|
+
close(): void;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=person.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"person.d.ts","sourceRoot":"","sources":["../../src/pointer/person.ts"],"names":[],"mappings":"AAAA,6HAA6H;AAW7H,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAmFzC,oGAAoG;AACpG,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,OAAO,CAAC;IACd,EAAE,EAAE,OAAO,CAAC;CACb;AAaD,gIAAgI;AAChI,wBAAgB,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAiB7F;AAED,MAAM,WAAW,aAAa;IAC5B,8BAA8B;IAC9B,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;IACvB,kEAAkE;IAClE,KAAK,EAAE,MAAM,CAAC;IACd,+FAA+F;IAC/F,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,sCAAsC;IACtC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,mDAAm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