@meltemi/diagrams-canvas 1.9.0 → 1.10.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.
Files changed (56) hide show
  1. package/README.md +15 -2
  2. package/canvas.css +619 -20
  3. package/dist/add-icons.d.ts +137 -0
  4. package/dist/add-icons.d.ts.map +1 -0
  5. package/dist/add-icons.js +387 -0
  6. package/dist/add-icons.js.map +1 -0
  7. package/dist/app.d.ts +162 -5
  8. package/dist/app.d.ts.map +1 -1
  9. package/dist/app.js +972 -58
  10. package/dist/app.js.map +1 -1
  11. package/dist/dom.d.ts +2 -0
  12. package/dist/dom.d.ts.map +1 -1
  13. package/dist/dom.js +2 -0
  14. package/dist/dom.js.map +1 -1
  15. package/dist/glyphs.d.ts +6 -1
  16. package/dist/glyphs.d.ts.map +1 -1
  17. package/dist/glyphs.js +85 -13
  18. package/dist/glyphs.js.map +1 -1
  19. package/dist/icon-picker.d.ts +5 -0
  20. package/dist/icon-picker.d.ts.map +1 -1
  21. package/dist/icon-picker.js +12 -1
  22. package/dist/icon-picker.js.map +1 -1
  23. package/dist/inspector.d.ts +88 -3
  24. package/dist/inspector.d.ts.map +1 -1
  25. package/dist/inspector.js +331 -17
  26. package/dist/inspector.js.map +1 -1
  27. package/dist/library.d.ts +6 -0
  28. package/dist/library.d.ts.map +1 -1
  29. package/dist/library.js +11 -2
  30. package/dist/library.js.map +1 -1
  31. package/dist/messages/en.d.ts +61 -3
  32. package/dist/messages/en.d.ts.map +1 -1
  33. package/dist/messages/en.js +58 -3
  34. package/dist/messages/en.js.map +1 -1
  35. package/dist/messages/es.d.ts.map +1 -1
  36. package/dist/messages/es.js +47 -3
  37. package/dist/messages/es.js.map +1 -1
  38. package/dist/messages/index.d.ts +50 -3
  39. package/dist/messages/index.d.ts.map +1 -1
  40. package/dist/presence-layer.d.ts +46 -10
  41. package/dist/presence-layer.d.ts.map +1 -1
  42. package/dist/presence-layer.js +133 -13
  43. package/dist/presence-layer.js.map +1 -1
  44. package/dist/presence.d.ts +47 -0
  45. package/dist/presence.d.ts.map +1 -1
  46. package/dist/presence.js +69 -0
  47. package/dist/presence.js.map +1 -1
  48. package/dist/trail.d.ts +60 -0
  49. package/dist/trail.d.ts.map +1 -0
  50. package/dist/trail.js +107 -0
  51. package/dist/trail.js.map +1 -0
  52. package/dist/view-only.d.ts +2 -2
  53. package/dist/view-only.d.ts.map +1 -1
  54. package/dist/view-only.js +5 -2
  55. package/dist/view-only.js.map +1 -1
  56. package/package.json +5 -5
package/README.md CHANGED
@@ -47,8 +47,21 @@ A host that shares the diagram can show who else is in it with `presence` messag
47
47
  in `@meltemi/diagrams-editor`): the other people, each with a name, a colour and the ids they have
48
48
  selected. The canvas draws an outline in the person's colour around each of those and a tag with
49
49
  the name (always text, never markup) on a layer above the scene that is never selected, copied or
50
- exported and that nothing of is sent back. Each message replaces the last; a message with nobody,
51
- an empty canvas or another diagram clears it, and ids the diagram does not have are ignored.
50
+ exported and that nothing of is sent back. A person may also have a `pointer` (`{ x, y }` in
51
+ diagram units): the canvas draws a cursor in their colour with the name at its tail, which glides
52
+ to the next point in 200 ms and keeps its size at every zoom. Each message replaces the last; a
53
+ message with nobody, an empty canvas or another diagram clears it, and ids the diagram does not
54
+ have, and pointers that are not two finite numbers, are ignored. Once a host has sent `presence`,
55
+ the canvas tells it where the person's own pointer is with `presencePointer` messages (diagram
56
+ units and the diagram's id, `null` when it leaves), at most every 50 ms.
57
+
58
+ The Pointer tool (K, or its toggle before the grid's) draws a trail that fades in 800 ms and edits
59
+ nothing, on every canvas, read-only ones included; the trail is no part of the document or of any
60
+ export. In the colour of the person: the `me: { colour }` of the last `presence` message, else the
61
+ render's `colors.accent`. A person's `laser` (`{ batch, points }`, at most 64 points `{ x, y, t }`,
62
+ `t` in milliseconds since the batch's first point) is drawn once per `batch` as that person's trail,
63
+ and the canvas posts the points of the person's own strokes with `presenceLaser` messages to a host
64
+ that has sent `presence`, at most every 50 ms.
52
65
 
53
66
  Popovers, menus, side panels, tooltips and target outlines open and close with short transitions
54
67
  on the motion tokens of `canvas.css` (`--mdg-motion-fast`, `--mdg-motion`, `--mdg-motion-slow`,