Commit cd51a9c
committed
fix(ui): scope entityAt to mounted host + publish new types (SD-2936)
Two review issues from PR #3139:
1. entityAt previously called document.elementFromPoint globally and
walked all ancestors with no check that the controller had a
mounted editor or that the hit landed inside this instance's
painted DOM. A page mounting two SuperDoc instances would have
one's entityAt return ids from the other; post-destroy calls
would return stale ids from cached painted nodes. Now resolves
the host editor via resolveHostEditor, reads
presentationEditor.visibleHost (newly added to the structural
type), and returns [] when the host is missing or the hit
element isn't inside it.
2. The published `superdoc/ui` declaration barrel at
packages/superdoc/src/ui.d.ts didn't list the new public types,
so `import type { ViewportEntityHit, ViewportEntityAtInput } from
'superdoc/ui'` failed for consumers. Same gap existed for
SelectionAnchorRectOptions from PR #3134. Added all three.1 parent 9b4d092 commit cd51a9c
4 files changed
Lines changed: 70 additions & 5 deletions
File tree
- packages
- super-editor/src/ui
- superdoc/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1572 | 1572 | | |
1573 | 1573 | | |
1574 | 1574 | | |
1575 | | - | |
| 1575 | + | |
1576 | 1576 | | |
1577 | 1577 | | |
1578 | 1578 | | |
1579 | 1579 | | |
1580 | 1580 | | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
1581 | 1588 | | |
| 1589 | + | |
1582 | 1590 | | |
1583 | 1591 | | |
1584 | 1592 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
172 | 180 | | |
173 | 181 | | |
174 | 182 | | |
| |||
1373 | 1381 | | |
1374 | 1382 | | |
1375 | 1383 | | |
1376 | | - | |
| 1384 | + | |
1377 | 1385 | | |
1378 | 1386 | | |
1379 | 1387 | | |
1380 | 1388 | | |
1381 | 1389 | | |
1382 | | - | |
| 1390 | + | |
1383 | 1391 | | |
1384 | 1392 | | |
1385 | 1393 | | |
1386 | 1394 | | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
1387 | 1401 | | |
1388 | | - | |
| 1402 | + | |
1389 | 1403 | | |
1390 | 1404 | | |
1391 | 1405 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
314 | | - | |
| 314 | + | |
315 | 315 | | |
316 | 316 | | |
317 | 317 | | |
| |||
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
324 | 364 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| 54 | + | |
| 55 | + | |
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
| |||
0 commit comments