@meltemi/diagrams-canvas 1.9.0 → 1.10.17

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 (95) hide show
  1. package/README.md +28 -2
  2. package/canvas.css +1660 -86
  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 +710 -18
  8. package/dist/app.d.ts.map +1 -1
  9. package/dist/app.js +3970 -308
  10. package/dist/app.js.map +1 -1
  11. package/dist/bars.d.ts +32 -0
  12. package/dist/bars.d.ts.map +1 -0
  13. package/dist/bars.js +71 -0
  14. package/dist/bars.js.map +1 -0
  15. package/dist/dom.d.ts +29 -0
  16. package/dist/dom.d.ts.map +1 -1
  17. package/dist/dom.js +46 -1
  18. package/dist/dom.js.map +1 -1
  19. package/dist/font-picker.d.ts +108 -0
  20. package/dist/font-picker.d.ts.map +1 -0
  21. package/dist/font-picker.js +340 -0
  22. package/dist/font-picker.js.map +1 -0
  23. package/dist/glyphs.d.ts +19 -1
  24. package/dist/glyphs.d.ts.map +1 -1
  25. package/dist/glyphs.js +151 -19
  26. package/dist/glyphs.js.map +1 -1
  27. package/dist/icon-picker.d.ts +5 -0
  28. package/dist/icon-picker.d.ts.map +1 -1
  29. package/dist/icon-picker.js +12 -1
  30. package/dist/icon-picker.js.map +1 -1
  31. package/dist/index.d.ts +2 -1
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +2 -1
  34. package/dist/index.js.map +1 -1
  35. package/dist/inline.d.ts +86 -1
  36. package/dist/inline.d.ts.map +1 -1
  37. package/dist/inline.js +148 -9
  38. package/dist/inline.js.map +1 -1
  39. package/dist/inspector.d.ts +184 -3
  40. package/dist/inspector.d.ts.map +1 -1
  41. package/dist/inspector.js +744 -35
  42. package/dist/inspector.js.map +1 -1
  43. package/dist/library.d.ts +6 -0
  44. package/dist/library.d.ts.map +1 -1
  45. package/dist/library.js +11 -2
  46. package/dist/library.js.map +1 -1
  47. package/dist/messages/en.d.ts +258 -9
  48. package/dist/messages/en.d.ts.map +1 -1
  49. package/dist/messages/en.js +257 -14
  50. package/dist/messages/en.js.map +1 -1
  51. package/dist/messages/es.d.ts.map +1 -1
  52. package/dist/messages/es.js +168 -11
  53. package/dist/messages/es.js.map +1 -1
  54. package/dist/messages/index.d.ts +164 -6
  55. package/dist/messages/index.d.ts.map +1 -1
  56. package/dist/pen-menu.d.ts +92 -0
  57. package/dist/pen-menu.d.ts.map +1 -0
  58. package/dist/pen-menu.js +292 -0
  59. package/dist/pen-menu.js.map +1 -0
  60. package/dist/pen.d.ts +48 -0
  61. package/dist/pen.d.ts.map +1 -0
  62. package/dist/pen.js +204 -0
  63. package/dist/pen.js.map +1 -0
  64. package/dist/presence-layer.d.ts +68 -10
  65. package/dist/presence-layer.d.ts.map +1 -1
  66. package/dist/presence-layer.js +176 -13
  67. package/dist/presence-layer.js.map +1 -1
  68. package/dist/presence.d.ts +85 -1
  69. package/dist/presence.d.ts.map +1 -1
  70. package/dist/presence.js +104 -0
  71. package/dist/presence.js.map +1 -1
  72. package/dist/sticky.d.ts +25 -0
  73. package/dist/sticky.d.ts.map +1 -0
  74. package/dist/sticky.js +26 -0
  75. package/dist/sticky.js.map +1 -0
  76. package/dist/story.d.ts.map +1 -1
  77. package/dist/story.js +5 -0
  78. package/dist/story.js.map +1 -1
  79. package/dist/strokes.d.ts +82 -0
  80. package/dist/strokes.d.ts.map +1 -0
  81. package/dist/strokes.js +305 -0
  82. package/dist/strokes.js.map +1 -0
  83. package/dist/tooltip.d.ts +11 -3
  84. package/dist/tooltip.d.ts.map +1 -1
  85. package/dist/tooltip.js +14 -9
  86. package/dist/tooltip.js.map +1 -1
  87. package/dist/trail.d.ts +60 -0
  88. package/dist/trail.d.ts.map +1 -0
  89. package/dist/trail.js +107 -0
  90. package/dist/trail.js.map +1 -0
  91. package/dist/view-only.d.ts +2 -2
  92. package/dist/view-only.d.ts.map +1 -1
  93. package/dist/view-only.js +5 -2
  94. package/dist/view-only.js.map +1 -1
  95. package/package.json +5 -5
package/README.md CHANGED
@@ -47,13 +47,39 @@ 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`,
55
68
  `--mdg-ease`). When the system asks for reduced motion they are zero and nothing moves.
56
69
 
70
+ The properties panel folds to a rail from the button in its head and unfolds from the rail's
71
+ button or the toolbar's toggle, one choice kept with the canvas's state (`PersistedState.inspector`,
72
+ read as a boolean only). A host folds it too with `app.setInspectorCollapsed(collapsed)` and reads
73
+ `app.inspectorCollapsed`; a host that binds a key of its own for it names the key in
74
+ `host.keys.inspector` (the playground passes "Ctrl+Alt+B"), and the canvas's tooltips show it.
75
+
76
+ Every toolbar button's name says what it does, without its key; its `title` adds the key in
77
+ parentheses and `aria-keyshortcuts` says it. The package exports the bubble that shows those titles,
78
+ `Tooltips` (`new Tooltips(root, { except })`, 400 ms after the pointer rests, `TOOLTIP_DELAY`), so a
79
+ host draws its own controls' tooltips the same way (the playground uses `{ except: "#app" }`, and
80
+ the canvas keeps its own), and `ariaKeyshortcuts(shown)`, which writes a shown key ("Ctrl+Alt+B",
81
+ "Mayús+1") as `aria-keyshortcuts` wants it ("Control+Alt+B", "Shift+1").
82
+
57
83
  ## Documentation
58
84
 
59
85
  - [Editor guide](https://github.com/askenaz-dev/meltemi-diagrams/blob/main/docs/editor.md)