@open-artifact/motion-stage 0.0.0-stage → 0.12.0
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/NOTICE +5 -0
- package/README.md +5 -2
- package/package.json +69 -4
- package/src/build.d.ts +18 -0
- package/src/build.js +73 -0
- package/src/host.d.ts +37 -0
- package/src/host.js +76 -0
- package/src/index.d.ts +11 -0
- package/src/index.js +6 -0
- package/src/layers.d.ts +30 -0
- package/src/layers.js +56 -0
- package/src/offline/audio.d.ts +19 -0
- package/src/offline/audio.js +20 -0
- package/src/offline/data.d.ts +26 -0
- package/src/offline/data.js +71 -0
- package/src/offline/main.d.ts +9 -0
- package/src/offline/main.js +52 -0
- package/src/offline/player.d.ts +23 -0
- package/src/offline/player.js +155 -0
- package/src/protocol/guards.d.ts +6 -0
- package/src/protocol/guards.js +208 -0
- package/src/protocol/layer-guards.d.ts +7 -0
- package/src/protocol/layer-guards.js +97 -0
- package/src/protocol/layers.d.ts +123 -0
- package/src/protocol/layers.js +1 -0
- package/src/protocol/types.d.ts +261 -0
- package/src/protocol/types.js +7 -0
- package/src/protocol.d.ts +2 -0
- package/src/protocol.js +2 -0
- package/src/raster.d.ts +4 -0
- package/src/raster.js +2 -0
- package/src/runtime/assets.d.ts +19 -0
- package/src/runtime/assets.js +63 -0
- package/src/runtime/captions.d.ts +26 -0
- package/src/runtime/captions.js +103 -0
- package/src/runtime/console.d.ts +13 -0
- package/src/runtime/console.js +99 -0
- package/src/runtime/cut.d.ts +7 -0
- package/src/runtime/cut.js +63 -0
- package/src/runtime/determinism.d.ts +12 -0
- package/src/runtime/determinism.js +47 -0
- package/src/runtime/film.d.ts +40 -0
- package/src/runtime/film.js +29 -0
- package/src/runtime/focus.d.ts +8 -0
- package/src/runtime/focus.js +71 -0
- package/src/runtime/fonts.d.ts +22 -0
- package/src/runtime/fonts.js +109 -0
- package/src/runtime/frame.d.ts +9 -0
- package/src/runtime/frame.js +123 -0
- package/src/runtime/kit/camera.d.ts +40 -0
- package/src/runtime/kit/camera.js +56 -0
- package/src/runtime/kit/chip.d.ts +25 -0
- package/src/runtime/kit/chip.js +75 -0
- package/src/runtime/kit/cursor.d.ts +46 -0
- package/src/runtime/kit/cursor.js +108 -0
- package/src/runtime/kit/dom.d.ts +14 -0
- package/src/runtime/kit/dom.js +46 -0
- package/src/runtime/kit/geometry.d.ts +22 -0
- package/src/runtime/kit/geometry.js +46 -0
- package/src/runtime/kit/index.d.ts +95 -0
- package/src/runtime/kit/index.js +149 -0
- package/src/runtime/kit/mark-strokes.d.ts +65 -0
- package/src/runtime/kit/mark-strokes.js +226 -0
- package/src/runtime/kit/marks.d.ts +21 -0
- package/src/runtime/kit/marks.js +165 -0
- package/src/runtime/kit/math.d.ts +23 -0
- package/src/runtime/kit/math.js +35 -0
- package/src/runtime/kit/paper.d.ts +7 -0
- package/src/runtime/kit/paper.js +27 -0
- package/src/runtime/kit/random.d.ts +8 -0
- package/src/runtime/kit/random.js +32 -0
- package/src/runtime/kit/text-fx.d.ts +18 -0
- package/src/runtime/kit/text-fx.js +55 -0
- package/src/runtime/kit/typing.d.ts +21 -0
- package/src/runtime/kit/typing.js +42 -0
- package/src/runtime/layers/describe.d.ts +41 -0
- package/src/runtime/layers/describe.js +327 -0
- package/src/runtime/layers/item.d.ts +121 -0
- package/src/runtime/layers/item.js +149 -0
- package/src/runtime/layers/parts.d.ts +50 -0
- package/src/runtime/layers/parts.js +155 -0
- package/src/runtime/layers/rows.d.ts +4 -0
- package/src/runtime/layers/rows.js +233 -0
- package/src/runtime/layers/scan.d.ts +24 -0
- package/src/runtime/layers/scan.js +202 -0
- package/src/runtime/layers/walk.d.ts +16 -0
- package/src/runtime/layers/walk.js +333 -0
- package/src/runtime/load.d.ts +10 -0
- package/src/runtime/load.js +228 -0
- package/src/runtime/main.d.ts +1 -0
- package/src/runtime/main.js +69 -0
- package/src/runtime/modules.d.ts +23 -0
- package/src/runtime/modules.js +53 -0
- package/src/runtime/port.d.ts +8 -0
- package/src/runtime/port.js +46 -0
- package/src/runtime/questions.d.ts +24 -0
- package/src/runtime/questions.js +162 -0
- package/src/runtime/recut.d.ts +35 -0
- package/src/runtime/recut.js +158 -0
- package/src/runtime/render.d.ts +80 -0
- package/src/runtime/render.js +342 -0
- package/src/runtime/retouch/ask.d.ts +17 -0
- package/src/runtime/retouch/ask.js +156 -0
- package/src/runtime/retouch/entry.d.ts +77 -0
- package/src/runtime/retouch/entry.js +1 -0
- package/src/runtime/retouch/judge.d.ts +25 -0
- package/src/runtime/retouch/judge.js +209 -0
- package/src/runtime/retouch/look.d.ts +39 -0
- package/src/runtime/retouch/look.js +135 -0
- package/src/runtime/retouch/parts.d.ts +22 -0
- package/src/runtime/retouch/parts.js +166 -0
- package/src/runtime/retouch/retouch.d.ts +37 -0
- package/src/runtime/retouch/retouch.js +238 -0
- package/src/runtime/retouch/seat.d.ts +40 -0
- package/src/runtime/retouch/seat.js +228 -0
- package/src/runtime/retouch/state.d.ts +37 -0
- package/src/runtime/retouch/state.js +153 -0
- package/src/runtime/retouch/type-style.d.ts +19 -0
- package/src/runtime/retouch/type-style.js +111 -0
- package/src/runtime/scan.d.ts +2 -0
- package/src/runtime/scan.js +49 -0
- package/src/runtime/scenes/card.d.ts +12 -0
- package/src/runtime/scenes/card.js +56 -0
- package/src/runtime/scenes/install.d.ts +47 -0
- package/src/runtime/scenes/install.js +387 -0
- package/src/runtime/scenes/read.d.ts +15 -0
- package/src/runtime/scenes/read.js +57 -0
- package/src/runtime/scenes/scoped.d.ts +13 -0
- package/src/runtime/scenes/scoped.js +40 -0
- package/src/runtime/score.d.ts +26 -0
- package/src/runtime/score.js +221 -0
- package/src/runtime/sketch/pen.d.ts +3 -0
- package/src/runtime/sketch/pen.js +371 -0
- package/src/runtime/sketch/strokes.d.ts +41 -0
- package/src/runtime/sketch/strokes.js +187 -0
- package/src/runtime/snapshot/draw.d.ts +14 -0
- package/src/runtime/snapshot/draw.js +125 -0
- package/src/runtime/snapshot/hold-first-draw.d.ts +12 -0
- package/src/runtime/snapshot/hold-first-draw.js +128 -0
- package/src/runtime/snapshot/plate.d.ts +20 -0
- package/src/runtime/snapshot/plate.js +79 -0
- package/src/runtime/snapshot/serialize.d.ts +49 -0
- package/src/runtime/snapshot/serialize.js +271 -0
- package/src/runtime/snapshot/styles.d.ts +8 -0
- package/src/runtime/snapshot/styles.js +109 -0
- package/src/runtime/snapshot/xml.d.ts +6 -0
- package/src/runtime/snapshot/xml.js +110 -0
- package/src/runtime/stage-size.d.ts +7 -0
- package/src/runtime/stage-size.js +3 -0
- package/src/runtime/stage.d.ts +27 -0
- package/src/runtime/stage.js +154 -0
- package/src/runtime/stretch.d.ts +13 -0
- package/src/runtime/stretch.js +16 -0
- package/src/runtime/texts.d.ts +24 -0
- package/src/runtime/texts.js +210 -0
- package/src/runtime/video-sync.d.ts +26 -0
- package/src/runtime/video-sync.js +126 -0
- package/src/stills.d.ts +41 -0
- package/src/stills.js +253 -0
- package/src/tools/film.d.ts +13 -0
- package/src/tools/film.js +116 -0
- package/src/tools/main.d.ts +1 -0
- package/src/tools/main.js +216 -0
- package/src/tools/score.d.ts +4 -0
- package/src/tools/score.js +29 -0
- package/src/tools/types.d.ts +69 -0
- package/src/tools/types.js +2 -0
- package/src/tools.d.ts +5 -0
- package/src/tools.js +3 -0
- package/src/virtual.d.ts +11 -0
- package/src/vite.d.ts +8 -0
- package/src/vite.js +43 -0
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
import { srect } from "../kit/geometry.js";
|
|
2
|
+
import { DRAWN, FULL, MOST, tidy, union } from "./item.js";
|
|
3
|
+
import { PAINT_KEYS, laidOn } from "./parts.js";
|
|
4
|
+
const LONGEST_MOVE_S = 1.5;
|
|
5
|
+
const NAME = /^[a-z][a-z0-9]{2,}([-_][a-z0-9]+)*$/i;
|
|
6
|
+
/** stays: a person's change is laid on it, so it is never looked through: its row leads to the controls that made the change. */
|
|
7
|
+
export const stays = (it) => it.own || it.laid;
|
|
8
|
+
export function beneath(it) {
|
|
9
|
+
for (let u = it.up; u; u = u.up)
|
|
10
|
+
if (stays(u))
|
|
11
|
+
return true;
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
export function inOrder(a, b) {
|
|
15
|
+
for (let i = 0; i < a.path.length && i < b.path.length; i++)
|
|
16
|
+
if (a.path[i] !== b.path[i])
|
|
17
|
+
return (a.path[i] ?? 0) - (b.path[i] ?? 0);
|
|
18
|
+
return a.path.length - b.path.length;
|
|
19
|
+
}
|
|
20
|
+
/** A card's first line is its words, not the number in its corner. */
|
|
21
|
+
export function lead(said) {
|
|
22
|
+
const w = said.findIndex((s) => /\p{L}{2}/u.test(s));
|
|
23
|
+
if (w > 0)
|
|
24
|
+
said.unshift(...said.splice(w, 1));
|
|
25
|
+
return said;
|
|
26
|
+
}
|
|
27
|
+
function spoken(s) {
|
|
28
|
+
const t = tidy(s.replace(/[-_]+/g, ' '));
|
|
29
|
+
return t ? t.charAt(0).toUpperCase() + t.slice(1) : '';
|
|
30
|
+
}
|
|
31
|
+
function titled(el) {
|
|
32
|
+
for (let c = el.firstElementChild; c; c = c.nextElementSibling)
|
|
33
|
+
if (c.tagName === 'title')
|
|
34
|
+
return c.textContent ?? '';
|
|
35
|
+
return '';
|
|
36
|
+
}
|
|
37
|
+
const still = (p, q) => !!p && !!q && Math.abs(p.x - q.x) + Math.abs(p.y - q.y) + Math.abs(p.w - q.w) + Math.abs(p.h - q.h) < 1;
|
|
38
|
+
/** The measures of one reading: what is as large as the stage, what grew by a hand-set Scale, and each row's description. */
|
|
39
|
+
export function measures(s, inked) {
|
|
40
|
+
const { W, H, n, times, from, to } = s;
|
|
41
|
+
/** A wrapper as large as the stage (a scene's box, a camera) is never a thing on the picture. */
|
|
42
|
+
const isFull = (it) => {
|
|
43
|
+
if (it.cand)
|
|
44
|
+
return it.shown > 0 && it.full >= it.shown * 0.8 && !it.words;
|
|
45
|
+
const r = srect(it.el);
|
|
46
|
+
return r.w >= FULL * W && r.h >= FULL * H;
|
|
47
|
+
};
|
|
48
|
+
/** The Scale a person set on it (1: none). */
|
|
49
|
+
const grew = (it) => {
|
|
50
|
+
if (!stays(it) || !laidOn(it.el, 'size'))
|
|
51
|
+
return 1;
|
|
52
|
+
const g = parseFloat(getComputedStyle(it.el).scale);
|
|
53
|
+
return g > 0 ? g : 1;
|
|
54
|
+
};
|
|
55
|
+
/** It has a Scale set by hand above 1, and without it would be smaller than the stage. */
|
|
56
|
+
const swelled = (it) => {
|
|
57
|
+
const g = grew(it);
|
|
58
|
+
if (!(g > 1) || !it.el.isConnected)
|
|
59
|
+
return false;
|
|
60
|
+
const r = srect(it.el);
|
|
61
|
+
return r.w >= 1 && r.h >= 1 && (r.w / g < FULL * W || r.h / g < FULL * H);
|
|
62
|
+
};
|
|
63
|
+
/** The Scales set by hand above it grow it; before them it was smaller than the stage; and it lies inside one that grew. */
|
|
64
|
+
const grown = (it) => {
|
|
65
|
+
let g = 1;
|
|
66
|
+
for (let u = it.up; u; u = u.up)
|
|
67
|
+
g *= grew(u);
|
|
68
|
+
if (!(g > 1) || !it.el.isConnected)
|
|
69
|
+
return false;
|
|
70
|
+
const r = srect(it.el);
|
|
71
|
+
const e = 4 * g;
|
|
72
|
+
if (!(r.w >= 1 && r.h >= 1) || (r.w / g >= FULL * W && r.h / g >= FULL * H))
|
|
73
|
+
return false;
|
|
74
|
+
for (let u = it.up; u; u = u.up) {
|
|
75
|
+
if (!(grew(u) > 1) || !u.el.isConnected)
|
|
76
|
+
continue;
|
|
77
|
+
const h = srect(u.el);
|
|
78
|
+
if (h.w >= 1 && h.h >= 1 && r.x >= h.x - e && r.y >= h.y - e && r.x + r.w <= h.x + h.w + e && r.y + r.h <= h.y + h.h + e)
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
return false;
|
|
82
|
+
};
|
|
83
|
+
const growth = (it) => {
|
|
84
|
+
let g = grew(it);
|
|
85
|
+
for (let u = it.up; u; u = u.up)
|
|
86
|
+
g *= grew(u);
|
|
87
|
+
return g;
|
|
88
|
+
};
|
|
89
|
+
const covers = (r) => Math.min(r.x + r.w, W) - Math.max(r.x, 0) >= FULL * W && Math.min(r.y + r.h, H) - Math.max(r.y, 0) >= FULL * H;
|
|
90
|
+
/** One layer: it, the thing it is called after, and parts, all that is drawn of it. */
|
|
91
|
+
const describe = (it, parts) => {
|
|
92
|
+
const el = it.el;
|
|
93
|
+
const on = [];
|
|
94
|
+
const op = [];
|
|
95
|
+
const box = [];
|
|
96
|
+
for (let i = 0; i < n; i++) {
|
|
97
|
+
on[i] = false;
|
|
98
|
+
op[i] = 0;
|
|
99
|
+
box[i] = null;
|
|
100
|
+
for (const p of parts)
|
|
101
|
+
if (p.on[i]) {
|
|
102
|
+
on[i] = true;
|
|
103
|
+
op[i] = Math.max(op[i] ?? 0, p.op[i] ?? 0);
|
|
104
|
+
box[i] = union(box[i] ?? null, p.box[i] ?? null);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
let texts = [];
|
|
108
|
+
for (const p of parts)
|
|
109
|
+
if (p.text && texts.length < MOST)
|
|
110
|
+
texts.push(p.text);
|
|
111
|
+
// What is drawn inside an opened svg never joins a row's parts, so each opened svg among the parts adds its words here.
|
|
112
|
+
const within = [];
|
|
113
|
+
for (const p of parts)
|
|
114
|
+
if (p.easel && !p.art)
|
|
115
|
+
for (const q of inked(p))
|
|
116
|
+
if (q.text)
|
|
117
|
+
within.push(q.text);
|
|
118
|
+
texts = lead(texts).concat(lead(within)).slice(0, MOST);
|
|
119
|
+
const one = parts.length === 1 ? (parts[0] ?? null) : null;
|
|
120
|
+
const tag = (one ?? it).el.tagName.toLowerCase();
|
|
121
|
+
let ground = one !== null && isFull(one) && (!one.unit || one.filled);
|
|
122
|
+
let full = one !== null && one.art && !ground && isFull(one);
|
|
123
|
+
const drawn = it.art && !it.cand && one === null ? 'group' : one !== null && one.unit && (one.art || tag === 'svg') ? (DRAWN[tag] ?? '') : '';
|
|
124
|
+
// The Background has no controls: a thing a person changed or hid, or that grew by a hand-set Scale, keeps its kind and is full.
|
|
125
|
+
if (one && ground && (stays(one) || grown(one))) {
|
|
126
|
+
ground = false;
|
|
127
|
+
full = true;
|
|
128
|
+
}
|
|
129
|
+
if (one !== null && !ground && !full && one.unit && isFull(one) && grown(one))
|
|
130
|
+
full = true;
|
|
131
|
+
// A row of several parts that grew is full when, at most looks it is on, its box covers the picture and was smaller before every Scale.
|
|
132
|
+
if (one === null && (swelled(it) || grown(it))) {
|
|
133
|
+
const g = growth(it);
|
|
134
|
+
let seen = 0;
|
|
135
|
+
let over = 0;
|
|
136
|
+
for (let i = 0; i < n; i++) {
|
|
137
|
+
const b = box[i];
|
|
138
|
+
if (!on[i] || !b)
|
|
139
|
+
continue;
|
|
140
|
+
seen++;
|
|
141
|
+
if (covers(b) && !(b.w / g >= FULL * W && b.h / g >= FULL * H))
|
|
142
|
+
over++;
|
|
143
|
+
}
|
|
144
|
+
full = seen > 0 && over >= seen * 0.8;
|
|
145
|
+
}
|
|
146
|
+
const kind = ground
|
|
147
|
+
? 'ground'
|
|
148
|
+
: one === null || (one.art && tag === 'g')
|
|
149
|
+
? 'group'
|
|
150
|
+
: one.unit
|
|
151
|
+
? one.art && !/^(use|image|foreignobject)$/.test(tag)
|
|
152
|
+
? 'shape'
|
|
153
|
+
: 'image'
|
|
154
|
+
: one.words && !one.paint
|
|
155
|
+
? 'text'
|
|
156
|
+
: 'shape';
|
|
157
|
+
// Its own name, if the film gave it one: a label, or for what is not plain words the class the scene calls it by.
|
|
158
|
+
let cls = '';
|
|
159
|
+
const prefix = s.prefix;
|
|
160
|
+
if (prefix)
|
|
161
|
+
for (const c of Array.from(el.classList))
|
|
162
|
+
if (c.indexOf(prefix) === 0)
|
|
163
|
+
cls = c.slice(prefix.length);
|
|
164
|
+
if (!cls)
|
|
165
|
+
cls = el.id || (it.art ? Array.from(el.classList).filter((x) => NAME.test(x)).pop() : el.classList[el.classList.length - 1]) || '';
|
|
166
|
+
if (kind === 'text' || kind === 'ground' || !NAME.test(cls))
|
|
167
|
+
cls = '';
|
|
168
|
+
const name = tidy(el.getAttribute('data-label') || el.getAttribute('aria-label') || el.getAttribute('alt') || titled(el)) || (el.classList.contains('film-cursor') ? 'Cursor' : spoken(cls));
|
|
169
|
+
// The stretches it is on for; an edge lies half-way between the two looks that differ.
|
|
170
|
+
const spans = [];
|
|
171
|
+
let a = -1;
|
|
172
|
+
let top = 0;
|
|
173
|
+
let long = 0;
|
|
174
|
+
const time = (i) => times[i] ?? from;
|
|
175
|
+
for (let i = 0; i <= n; i++) {
|
|
176
|
+
if (i < n && on[i]) {
|
|
177
|
+
if (a < 0)
|
|
178
|
+
a = i;
|
|
179
|
+
top = Math.max(top, op[i] ?? 0);
|
|
180
|
+
}
|
|
181
|
+
else if (a >= 0) {
|
|
182
|
+
spans.push([a === 0 ? from : (time(a - 1) + time(a)) / 2, i === n ? to : (time(i - 1) + time(i)) / 2]);
|
|
183
|
+
a = -1;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
for (const x of spans)
|
|
187
|
+
long += x[1] - x[0];
|
|
188
|
+
// Where to look at it: the first moment it is as solid as it gets and at rest; if it never rests, the first at which it is as solid.
|
|
189
|
+
let best = -1;
|
|
190
|
+
for (let i = 0; i + 1 < n && best < 0; i++)
|
|
191
|
+
if (on[i] && (op[i] ?? 0) >= top * 0.98 && still(box[i], box[i + 1]))
|
|
192
|
+
best = i;
|
|
193
|
+
for (let i = 0; i < n && best < 0; i++)
|
|
194
|
+
if (on[i] && (op[i] ?? 0) >= top * 0.98)
|
|
195
|
+
best = i;
|
|
196
|
+
// How it comes and goes, from look p, part of the way, to look q, at rest; null where opacity and box cannot tell.
|
|
197
|
+
const way = (pa, pb) => {
|
|
198
|
+
const p = box[pa];
|
|
199
|
+
const q = box[pb];
|
|
200
|
+
const how = [];
|
|
201
|
+
// Parts that come one after another make a box that grows, which nothing on the picture does.
|
|
202
|
+
if (!p || !q || Math.abs(time(pa) - time(pb)) > LONGEST_MOVE_S || !parts.every((x) => x.on[pa] && x.on[pb]))
|
|
203
|
+
return null;
|
|
204
|
+
if (pa === pb)
|
|
205
|
+
return how;
|
|
206
|
+
if ((op[pa] ?? 0) < (op[pb] ?? 0) * 0.7)
|
|
207
|
+
how.push('fade');
|
|
208
|
+
// Under a camera every box moves, so only fading can be told.
|
|
209
|
+
for (let cam = it.up; cam; cam = cam.up)
|
|
210
|
+
if (cam.pans && cam.big)
|
|
211
|
+
return how.length ? how : null;
|
|
212
|
+
const fw = p.w / q.w;
|
|
213
|
+
const fh = p.h / q.h;
|
|
214
|
+
const dx = p.x + p.w / 2 - q.x - q.w / 2;
|
|
215
|
+
const dy = p.y + p.h / 2 - q.y - q.h / 2;
|
|
216
|
+
const same = (f) => f >= 0.85 && f <= 1.15;
|
|
217
|
+
const small = (f) => f < 0.85;
|
|
218
|
+
if (same(fw) && same(fh)) {
|
|
219
|
+
if (Math.abs(dx) + Math.abs(dy) > W / 200)
|
|
220
|
+
how.push(Math.abs(dx) > Math.abs(dy) ? (dx < 0 ? 'left' : 'right') : dy < 0 ? 'top' : 'bottom');
|
|
221
|
+
}
|
|
222
|
+
// Smaller both ways alike, or, if it is not words, one way only (a bar of a chart). Words that get longer are being typed.
|
|
223
|
+
else if ((small(fw) && small(fh) && Math.abs(fw - fh) < 0.2) || (kind !== 'text' && ((small(fw) && same(fh)) || (same(fw) && small(fh)))))
|
|
224
|
+
how.push('grow');
|
|
225
|
+
else
|
|
226
|
+
return null;
|
|
227
|
+
return how;
|
|
228
|
+
};
|
|
229
|
+
const first = on.indexOf(true);
|
|
230
|
+
const last = on.lastIndexOf(true);
|
|
231
|
+
let rest = last;
|
|
232
|
+
while (rest > best && !((op[rest] ?? 0) >= top * 0.98 && still(box[rest], box[rest - 1])))
|
|
233
|
+
rest--;
|
|
234
|
+
const motion = (how, f, t) => ({ how, from: f, to: t });
|
|
235
|
+
const enter = motion(way(first, best), spans.length ? (spans[0]?.[0] ?? from) : from, time(Math.max(0, best)));
|
|
236
|
+
const leave = motion(way(last, rest), time(Math.max(0, rest)), spans.length ? (spans[spans.length - 1]?.[1] ?? to) : to);
|
|
237
|
+
// Still on as the stretch ends: at rest, it stays; moving, it may be leaving or not, so nothing is said.
|
|
238
|
+
if (last === n - 1 && leave.how && leave.how.length && (op[last] ?? 0) >= top * 0.7)
|
|
239
|
+
leave.how = null;
|
|
240
|
+
return {
|
|
241
|
+
id: s.stretch + ':' + it.key,
|
|
242
|
+
kind,
|
|
243
|
+
round: kind === 'shape' && one?.round === true,
|
|
244
|
+
drawn: ground ? '' : drawn,
|
|
245
|
+
full,
|
|
246
|
+
name: name.slice(0, 80),
|
|
247
|
+
texts,
|
|
248
|
+
spans,
|
|
249
|
+
long,
|
|
250
|
+
at: time(Math.max(0, best)),
|
|
251
|
+
enter,
|
|
252
|
+
leave,
|
|
253
|
+
parts,
|
|
254
|
+
it,
|
|
255
|
+
kids: [],
|
|
256
|
+
pack: false,
|
|
257
|
+
many: 0,
|
|
258
|
+
keep: false,
|
|
259
|
+
sole: null,
|
|
260
|
+
svg: null,
|
|
261
|
+
inked: [],
|
|
262
|
+
below: 0,
|
|
263
|
+
n: 0,
|
|
264
|
+
now: null,
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
return { isFull, swelled, grown, describe };
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* How the film itself draws a layer now, for what the page can change by itself: only of one thing, whose place tells
|
|
271
|
+
* it from all others. What the film itself changes in the course of the stretch is left out: a value laid over it
|
|
272
|
+
* would stop that.
|
|
273
|
+
*/
|
|
274
|
+
export function lookOf(l, sys, memo, used) {
|
|
275
|
+
const it = l.it;
|
|
276
|
+
const el = it.el;
|
|
277
|
+
if (l.kind === 'ground' || /[+*]/.test(l.id) || !el.isConnected)
|
|
278
|
+
return null;
|
|
279
|
+
const k = sys.look(el);
|
|
280
|
+
const boxed = it.paint && !it.unit;
|
|
281
|
+
if (!k)
|
|
282
|
+
return null;
|
|
283
|
+
// As many as the record can hold: it is held to those it names, so fewer is no fault.
|
|
284
|
+
k.cls = (it.always ?? []).reduce((all, c) => (all.length + c.length < 200 ? (all ? all + ' ' : '') + c : all), '');
|
|
285
|
+
k.kin = sys.kin(el, k.cls, memo);
|
|
286
|
+
if (!boxed || it.vary.fill)
|
|
287
|
+
k.fill = null;
|
|
288
|
+
if (!boxed || it.vary.radius)
|
|
289
|
+
k.radius = null;
|
|
290
|
+
if (!it.words || it.vary.ink)
|
|
291
|
+
k.ink = null;
|
|
292
|
+
if (it.vary.size)
|
|
293
|
+
k.size = null;
|
|
294
|
+
if (it.vary.hidden && !it.own)
|
|
295
|
+
k.hidden = null;
|
|
296
|
+
const printed = (k.kin ?? '').split('/').length === 3;
|
|
297
|
+
if (it.art) {
|
|
298
|
+
// None of these four is offered on a part inside an svg; an svg text's colour is offered with its text styles instead.
|
|
299
|
+
k.fill = k.ink = null;
|
|
300
|
+
k.radius = k.size = null;
|
|
301
|
+
/*
|
|
302
|
+
* A hide must hold at every frame and on this part alone: none is offered where the print is not the part's own,
|
|
303
|
+
* the film makes its node anew, or what the print is of changes in the stretch.
|
|
304
|
+
*/
|
|
305
|
+
let firm = !it.anew && !it.vary.within && printed;
|
|
306
|
+
for (let u = it; firm && u && (u.art || u.easel); u = u.up)
|
|
307
|
+
firm = !u.vary.drawn && !(u.art && !!u.up?.vary.tags[u.el.tagName]);
|
|
308
|
+
if (!firm && !it.own)
|
|
309
|
+
k.hidden = null;
|
|
310
|
+
// So must a colour, which would also show on every copy a use draws of the part or of what holds it.
|
|
311
|
+
for (let u = it; firm && u && (u.art || u.easel); u = u.up)
|
|
312
|
+
firm = !(u.el.id && used.has(u.el.id));
|
|
313
|
+
for (const p of PAINT_KEYS)
|
|
314
|
+
if ((!firm || it.vary[p]) && !laidOn(el, p))
|
|
315
|
+
k[p] = null;
|
|
316
|
+
}
|
|
317
|
+
// A loose entry's hide would be saved with this kin; with no print in it, it would count by its turn from then on.
|
|
318
|
+
if (k.loose && !printed)
|
|
319
|
+
k.hidden = null;
|
|
320
|
+
// A hide on a g is also saved with its parts, where the g has a class and no other g has its classes (kin 0/1/…).
|
|
321
|
+
if (it.art && k.hidden !== null && sys.parts && /^g$/i.test(el.tagName) && k.cls && /^0\/1\//.test(k.kin ?? '')) {
|
|
322
|
+
const parts = sys.parts(el, memo);
|
|
323
|
+
if (parts !== null)
|
|
324
|
+
k.parts = parts;
|
|
325
|
+
}
|
|
326
|
+
return k;
|
|
327
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import type { LayerDrawn, LayerKind, LayerLook, LayerMotion } from '../../protocol.ts';
|
|
2
|
+
import type { StageRect } from '../kit/geometry.ts';
|
|
3
|
+
/** Rows in the list, and texts of one row. */
|
|
4
|
+
export declare const MOST = 24;
|
|
5
|
+
/** A box as large as this share of the stage each way is as large as the stage. */
|
|
6
|
+
export declare const FULL = 0.95;
|
|
7
|
+
export declare const FAINT = 0.02;
|
|
8
|
+
/** What the film itself changes, as the walk tells it: a value laid over it would stop that. */
|
|
9
|
+
export interface Vary {
|
|
10
|
+
fill: boolean;
|
|
11
|
+
ink: boolean;
|
|
12
|
+
radius: boolean;
|
|
13
|
+
size: boolean;
|
|
14
|
+
hidden: boolean;
|
|
15
|
+
svgfill: boolean;
|
|
16
|
+
svgstroke: boolean;
|
|
17
|
+
/** How it, or all under it, is drawn. */
|
|
18
|
+
drawn: boolean;
|
|
19
|
+
/** Something under it changes how it is drawn. */
|
|
20
|
+
within: boolean;
|
|
21
|
+
/** The number of parts of each tag it holds. */
|
|
22
|
+
tags: Record<string, boolean>;
|
|
23
|
+
}
|
|
24
|
+
/** One thing as the reading finds it, look after look. */
|
|
25
|
+
export interface Item {
|
|
26
|
+
key: string;
|
|
27
|
+
path: number[];
|
|
28
|
+
up: Item | null;
|
|
29
|
+
el: Element;
|
|
30
|
+
/** At some look as large as the stage (a camera, a world). */
|
|
31
|
+
big: boolean;
|
|
32
|
+
/** Its own box differs between two looks. */
|
|
33
|
+
pans: boolean;
|
|
34
|
+
lay: StageRect | null;
|
|
35
|
+
tf: string | null;
|
|
36
|
+
sig: string | null;
|
|
37
|
+
moved: boolean;
|
|
38
|
+
named: boolean;
|
|
39
|
+
unit: boolean;
|
|
40
|
+
words: boolean;
|
|
41
|
+
paint: boolean;
|
|
42
|
+
round: boolean | null;
|
|
43
|
+
/** The classes it has at every look. */
|
|
44
|
+
always: string[] | null;
|
|
45
|
+
hues: Record<string, string> | null;
|
|
46
|
+
vary: Vary;
|
|
47
|
+
/** It draws something itself. */
|
|
48
|
+
cand: boolean;
|
|
49
|
+
full: number;
|
|
50
|
+
shown: number;
|
|
51
|
+
on: boolean[];
|
|
52
|
+
op: number[];
|
|
53
|
+
box: Array<StageRect | null>;
|
|
54
|
+
text: string;
|
|
55
|
+
/** A part of an svg drawing. */
|
|
56
|
+
art: boolean;
|
|
57
|
+
/** An svg, or a g in one, read part by part; false: shut for the rest of the reading; null: not decided. */
|
|
58
|
+
easel: boolean | null;
|
|
59
|
+
anew: boolean;
|
|
60
|
+
/** A person's change is laid on it. */
|
|
61
|
+
laid: boolean;
|
|
62
|
+
/** A person hid it. */
|
|
63
|
+
own: boolean;
|
|
64
|
+
/** Something under it had a change laid on it. */
|
|
65
|
+
marked: boolean;
|
|
66
|
+
/** It holds something that may draw but has no row. */
|
|
67
|
+
odd: boolean;
|
|
68
|
+
filled: boolean;
|
|
69
|
+
speck: boolean;
|
|
70
|
+
/** Of the things that hold it, the outermost a person hid; false: none. */
|
|
71
|
+
held: Item | false;
|
|
72
|
+
hid: Item | false;
|
|
73
|
+
as: string | null;
|
|
74
|
+
tally: Record<string, number> | null;
|
|
75
|
+
most: number;
|
|
76
|
+
head: Item | null;
|
|
77
|
+
}
|
|
78
|
+
export declare function newItem(el: Element, key: string, path: number[], up: Item | null, named: boolean, unit: boolean): Item;
|
|
79
|
+
/** One row as the reading describes it, before it is told to the page. */
|
|
80
|
+
export interface Layer {
|
|
81
|
+
id: string;
|
|
82
|
+
kind: LayerKind;
|
|
83
|
+
round: boolean;
|
|
84
|
+
drawn: LayerDrawn;
|
|
85
|
+
full: boolean;
|
|
86
|
+
name: string;
|
|
87
|
+
texts: string[];
|
|
88
|
+
spans: Array<[number, number]>;
|
|
89
|
+
long: number;
|
|
90
|
+
at: number;
|
|
91
|
+
enter: LayerMotion;
|
|
92
|
+
leave: LayerMotion;
|
|
93
|
+
/** All that is drawn of it. */
|
|
94
|
+
parts: Item[];
|
|
95
|
+
it: Item;
|
|
96
|
+
kids: Layer[];
|
|
97
|
+
pack: boolean;
|
|
98
|
+
many: number;
|
|
99
|
+
/** A pack that holds something pinned. */
|
|
100
|
+
keep: boolean;
|
|
101
|
+
sole: Layer | null;
|
|
102
|
+
/** The svg whose parts the row holds, and all that it draws. */
|
|
103
|
+
svg: Item | null;
|
|
104
|
+
inked: Item[];
|
|
105
|
+
/** The level its row will stand at once a change pins it under what holds it. */
|
|
106
|
+
below: number;
|
|
107
|
+
n: number;
|
|
108
|
+
now: LayerLook | null;
|
|
109
|
+
}
|
|
110
|
+
export declare function union(a: StageRect | null, b: StageRect | null): StageRect | null;
|
|
111
|
+
export declare const opacityOf: (cs: CSSStyleDeclaration) => number;
|
|
112
|
+
export declare const tidy: (s: string) => string;
|
|
113
|
+
/** A change is laid on the row's thing or on something in it: the cuts of the list pass over such a row, the way to take the change back. */
|
|
114
|
+
export declare const pinned: (l: Layer) => boolean;
|
|
115
|
+
/** The order the looks are taken in: both ends, then the middle of each gap. Whenever the time is up, the stretch has been looked at evenly. */
|
|
116
|
+
export declare function inTurn(n: number): number[];
|
|
117
|
+
/** The page shares this thread: the reading stops every few ms to let it draw and answer. */
|
|
118
|
+
export declare function breath(): Promise<void>;
|
|
119
|
+
export declare function wordsIn(el: Element): string;
|
|
120
|
+
/** What the list calls a drawing that has no name, where its kind does not say. */
|
|
121
|
+
export declare const DRAWN: Record<string, LayerDrawn>;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { RealMessageChannel } from "../determinism.js";
|
|
2
|
+
import { SKIP, isPen } from "./parts.js";
|
|
3
|
+
/** Rows in the list, and texts of one row. */
|
|
4
|
+
export const MOST = 24;
|
|
5
|
+
/** A box as large as this share of the stage each way is as large as the stage. */
|
|
6
|
+
export const FULL = 0.95;
|
|
7
|
+
export const FAINT = 0.02;
|
|
8
|
+
export function newItem(el, key, path, up, named, unit) {
|
|
9
|
+
return {
|
|
10
|
+
key,
|
|
11
|
+
path,
|
|
12
|
+
up,
|
|
13
|
+
el,
|
|
14
|
+
big: false,
|
|
15
|
+
pans: false,
|
|
16
|
+
lay: null,
|
|
17
|
+
tf: null,
|
|
18
|
+
sig: null,
|
|
19
|
+
moved: false,
|
|
20
|
+
named,
|
|
21
|
+
unit,
|
|
22
|
+
words: false,
|
|
23
|
+
paint: false,
|
|
24
|
+
round: null,
|
|
25
|
+
always: null,
|
|
26
|
+
hues: null,
|
|
27
|
+
vary: { fill: false, ink: false, radius: false, size: false, hidden: false, svgfill: false, svgstroke: false, drawn: false, within: false, tags: {} },
|
|
28
|
+
cand: false,
|
|
29
|
+
full: 0,
|
|
30
|
+
shown: 0,
|
|
31
|
+
on: [],
|
|
32
|
+
op: [],
|
|
33
|
+
box: [],
|
|
34
|
+
text: '',
|
|
35
|
+
art: false,
|
|
36
|
+
easel: null,
|
|
37
|
+
anew: false,
|
|
38
|
+
laid: false,
|
|
39
|
+
own: false,
|
|
40
|
+
marked: false,
|
|
41
|
+
odd: false,
|
|
42
|
+
filled: false,
|
|
43
|
+
speck: false,
|
|
44
|
+
held: false,
|
|
45
|
+
hid: false,
|
|
46
|
+
as: null,
|
|
47
|
+
tally: null,
|
|
48
|
+
most: 0,
|
|
49
|
+
head: null,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
export function union(a, b) {
|
|
53
|
+
if (!a)
|
|
54
|
+
return b;
|
|
55
|
+
if (!b)
|
|
56
|
+
return a;
|
|
57
|
+
const x = Math.min(a.x, b.x);
|
|
58
|
+
const y = Math.min(a.y, b.y);
|
|
59
|
+
return { x, y, w: Math.max(a.x + a.w, b.x + b.w) - x, h: Math.max(a.y + a.h, b.y + b.h) - y };
|
|
60
|
+
}
|
|
61
|
+
export const opacityOf = (cs) => {
|
|
62
|
+
const o = parseFloat(cs.opacity);
|
|
63
|
+
return isNaN(o) ? 1 : o;
|
|
64
|
+
};
|
|
65
|
+
export const tidy = (s) => s.replace(/\s+/g, ' ').trim();
|
|
66
|
+
/** A change is laid on the row's thing or on something in it: the cuts of the list pass over such a row, the way to take the change back. */
|
|
67
|
+
export const pinned = (l) => l.keep || l.it.own || l.it.laid || l.it.marked;
|
|
68
|
+
/** The order the looks are taken in: both ends, then the middle of each gap. Whenever the time is up, the stretch has been looked at evenly. */
|
|
69
|
+
export function inTurn(n) {
|
|
70
|
+
const out = [0, n - 1];
|
|
71
|
+
const gaps = [[0, n - 1]];
|
|
72
|
+
for (let gap = gaps.shift(); gap; gap = gaps.shift()) {
|
|
73
|
+
const m = (gap[0] + gap[1]) >> 1;
|
|
74
|
+
if (m !== gap[0]) {
|
|
75
|
+
out.push(m);
|
|
76
|
+
gaps.push([gap[0], m], [m, gap[1]]);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return out;
|
|
80
|
+
}
|
|
81
|
+
/** The page shares this thread: the reading stops every few ms to let it draw and answer. */
|
|
82
|
+
export function breath() {
|
|
83
|
+
return new Promise((go) => {
|
|
84
|
+
if (!RealMessageChannel) {
|
|
85
|
+
setTimeout(go, 0);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
const channel = new RealMessageChannel();
|
|
89
|
+
channel.port1.onmessage = () => {
|
|
90
|
+
channel.port1.close();
|
|
91
|
+
go();
|
|
92
|
+
};
|
|
93
|
+
channel.port2.postMessage(0);
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
const GAP = '\u0001';
|
|
97
|
+
const GAPS_AT_ENDS = /^\u0001+|\u0001+$/g;
|
|
98
|
+
/** A tspan starts a line when it goes back to the last x set, or before it, and down: letters laid along a line, or nudged, don't. */
|
|
99
|
+
function startsLine(n, column, at) {
|
|
100
|
+
if (/^br$/i.test(n.tagName))
|
|
101
|
+
return true;
|
|
102
|
+
if (/^tspan$/i.test(n.tagName)) {
|
|
103
|
+
const x = parseFloat(n.getAttribute('x') ?? '');
|
|
104
|
+
const y = parseFloat(n.getAttribute('y') ?? '');
|
|
105
|
+
return n.hasAttribute('x') && (at.x === null || x <= parseFloat(at.x)) && ((parseFloat(n.getAttribute('dy') ?? '') || 0) > 0 || (at.y !== null && y > parseFloat(at.y)));
|
|
106
|
+
}
|
|
107
|
+
const cs = getComputedStyle(n);
|
|
108
|
+
if (/^(absolute|fixed)$/.test(cs.position) || (cs.float || 'none') !== 'none')
|
|
109
|
+
return false;
|
|
110
|
+
return column !== null ? column : /^(block|flex|grid|list-item|flow-root|table|table-row|table-caption)$/.test(cs.display);
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* An element's words with a gap where a line breaks: textContent runs lines together. Items of a flex row or a grid,
|
|
114
|
+
* floats and absolute elements also compute as display: block, so display alone can't tell.
|
|
115
|
+
*/
|
|
116
|
+
function spaced(el, deep) {
|
|
117
|
+
const cs = getComputedStyle(el);
|
|
118
|
+
const grid = /grid$/.test(cs.display);
|
|
119
|
+
const column = /flex$/.test(cs.display)
|
|
120
|
+
? /^column/.test(cs.flexDirection)
|
|
121
|
+
: grid
|
|
122
|
+
? !/column/.test(cs.gridAutoFlow) && cs.gridTemplateColumns.replace(/\[[^\]]*\]/g, '').trim().split(/\s+/).length === 1
|
|
123
|
+
: null;
|
|
124
|
+
// An inline box keeps the spaces put round its lines inside it: letters each in a box of their own stay one word.
|
|
125
|
+
const words = (n) => {
|
|
126
|
+
const w = deep < 24 ? spaced(n, deep + 1) : (n.textContent ?? '');
|
|
127
|
+
return /^inline-/.test(getComputedStyle(n).display) ? w.replace(GAPS_AT_ENDS, '') : w;
|
|
128
|
+
};
|
|
129
|
+
let s = '';
|
|
130
|
+
const at = { x: el.getAttribute('x'), y: el.getAttribute('y') };
|
|
131
|
+
for (let n = el.firstChild; n; n = n.nextSibling) {
|
|
132
|
+
if (n instanceof Text)
|
|
133
|
+
s += n.data;
|
|
134
|
+
else if (n instanceof Element && !SKIP.test(n.tagName) && !isPen(n)) {
|
|
135
|
+
// A tspan starts a line and runs on into what follows it: the gap goes before it alone.
|
|
136
|
+
s += startsLine(n, column, at) ? GAP + words(n) + (/^tspan$/i.test(n.tagName) ? '' : GAP) : words(n);
|
|
137
|
+
}
|
|
138
|
+
if (n instanceof Element && n.hasAttribute('x'))
|
|
139
|
+
at.x = n.getAttribute('x');
|
|
140
|
+
if (n instanceof Element && n.hasAttribute('y'))
|
|
141
|
+
at.y = n.getAttribute('y');
|
|
142
|
+
}
|
|
143
|
+
return s;
|
|
144
|
+
}
|
|
145
|
+
export function wordsIn(el) {
|
|
146
|
+
return tidy(el.firstElementChild ? spaced(el, 0).replace(/\u0001/g, ' ') : (el.textContent ?? ''));
|
|
147
|
+
}
|
|
148
|
+
/** What the list calls a drawing that has no name, where its kind does not say. */
|
|
149
|
+
export const DRAWN = { svg: 'graphic', g: 'group', line: 'line', path: 'path', polyline: 'path', polygon: 'polygon' };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export declare const SKIP: RegExp;
|
|
2
|
+
export declare const PHRASE: RegExp;
|
|
3
|
+
export declare const UNIT: RegExp;
|
|
4
|
+
/** A g holds parts, each other tag is one part. Whatever else stands in an svg (defs, a mask, a nested svg) is passed over. */
|
|
5
|
+
export declare const ART: RegExp;
|
|
6
|
+
/** The parts that paint themselves. */
|
|
7
|
+
export declare const SHAPE: RegExp;
|
|
8
|
+
/** The two colours of a shape a person can change, each with the property it is laid as. */
|
|
9
|
+
export declare const PAINT: {
|
|
10
|
+
readonly svgfill: "fill";
|
|
11
|
+
readonly svgstroke: "stroke";
|
|
12
|
+
};
|
|
13
|
+
export type PaintKey = keyof typeof PAINT;
|
|
14
|
+
export declare const PAINT_KEYS: readonly PaintKey[];
|
|
15
|
+
/** The element's own inline style, where it has one. */
|
|
16
|
+
export declare function styleOf(el: Element): CSSStyleDeclaration | null;
|
|
17
|
+
/** A rough scene's pen strokes, which are no thing of the film's. */
|
|
18
|
+
export declare const isPen: (node: Node) => boolean;
|
|
19
|
+
/**
|
|
20
|
+
* The film's own elements under `el`: a thing is known by its place among them. A caption is passed over: the stage's
|
|
21
|
+
* own goes to the end only after a frame is drawn, so it can stand ahead of what the film added meanwhile.
|
|
22
|
+
*/
|
|
23
|
+
export declare function kidsOf(el: Element | Node): Element[];
|
|
24
|
+
export declare function alphaOf(colour: string): number;
|
|
25
|
+
/** It paints a box: a background, a shadow or a border that shows. Read inside `inOwnColors`. */
|
|
26
|
+
export declare function paints(cs: CSSStyleDeclaration, el: Element): boolean;
|
|
27
|
+
/** A part of an svg drawing. The kit's hand-drawn marks are none: their order and number differ from runner to runner. */
|
|
28
|
+
export declare const isPart: (el: Element | Node | null) => el is Element;
|
|
29
|
+
export declare const isArtWords: (el: Element) => boolean;
|
|
30
|
+
/**
|
|
31
|
+
* What an element's own attributes say of how it is drawn: tag, id, classes, link and paint, not its shape or place,
|
|
32
|
+
* which most films change from frame to frame. `blur`: numbers in its id and classes count for nothing.
|
|
33
|
+
*/
|
|
34
|
+
export declare function saidOf(el: Element, blur?: boolean): string;
|
|
35
|
+
/** The same of a part and all the parts under it. `memo` lasts while the stage stands as drawn. */
|
|
36
|
+
export declare function drawnAs(el: Element, blur: boolean, memo: Map<Element, string>): string;
|
|
37
|
+
/** A paint shows at all: a colour or a pattern, not see-through. */
|
|
38
|
+
export declare function showsPaint(paint: string, opacity: string): boolean;
|
|
39
|
+
/** A filled shape, or a use of one: only such a part can be the Background. */
|
|
40
|
+
export declare function fills(cs: CSSStyleDeclaration, el: Element): boolean;
|
|
41
|
+
/** A use, an image, a foreignObject and a g read as one thing always count: what they show is not theirs to paint. */
|
|
42
|
+
export declare function inks(cs: CSSStyleDeclaration, el: Element): boolean;
|
|
43
|
+
export declare function ownText(el: Element): boolean;
|
|
44
|
+
/** A line of words: text, and nothing under it but spans and the like. Spans that paint with no text beside them are things of their own. */
|
|
45
|
+
export declare function isWords(el: Element): boolean;
|
|
46
|
+
/** A declared value that uses a var(), with each fallback taken out that uses none itself; null: it uses none, or a var() is not closed. */
|
|
47
|
+
export declare function drawnValue(text: string): string | null;
|
|
48
|
+
/** What of a person's change is laid on the element (the retouch marks). */
|
|
49
|
+
export declare const laidOn: (el: Element, what: string) => boolean;
|
|
50
|
+
export declare const hiddenByHand: (el: Element) => boolean;
|