@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.
- package/README.md +28 -2
- package/canvas.css +1660 -86
- package/dist/add-icons.d.ts +137 -0
- package/dist/add-icons.d.ts.map +1 -0
- package/dist/add-icons.js +387 -0
- package/dist/add-icons.js.map +1 -0
- package/dist/app.d.ts +710 -18
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +3970 -308
- package/dist/app.js.map +1 -1
- package/dist/bars.d.ts +32 -0
- package/dist/bars.d.ts.map +1 -0
- package/dist/bars.js +71 -0
- package/dist/bars.js.map +1 -0
- package/dist/dom.d.ts +29 -0
- package/dist/dom.d.ts.map +1 -1
- package/dist/dom.js +46 -1
- package/dist/dom.js.map +1 -1
- package/dist/font-picker.d.ts +108 -0
- package/dist/font-picker.d.ts.map +1 -0
- package/dist/font-picker.js +340 -0
- package/dist/font-picker.js.map +1 -0
- package/dist/glyphs.d.ts +19 -1
- package/dist/glyphs.d.ts.map +1 -1
- package/dist/glyphs.js +151 -19
- package/dist/glyphs.js.map +1 -1
- package/dist/icon-picker.d.ts +5 -0
- package/dist/icon-picker.d.ts.map +1 -1
- package/dist/icon-picker.js +12 -1
- package/dist/icon-picker.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/inline.d.ts +86 -1
- package/dist/inline.d.ts.map +1 -1
- package/dist/inline.js +148 -9
- package/dist/inline.js.map +1 -1
- package/dist/inspector.d.ts +184 -3
- package/dist/inspector.d.ts.map +1 -1
- package/dist/inspector.js +744 -35
- package/dist/inspector.js.map +1 -1
- package/dist/library.d.ts +6 -0
- package/dist/library.d.ts.map +1 -1
- package/dist/library.js +11 -2
- package/dist/library.js.map +1 -1
- package/dist/messages/en.d.ts +258 -9
- package/dist/messages/en.d.ts.map +1 -1
- package/dist/messages/en.js +257 -14
- package/dist/messages/en.js.map +1 -1
- package/dist/messages/es.d.ts.map +1 -1
- package/dist/messages/es.js +168 -11
- package/dist/messages/es.js.map +1 -1
- package/dist/messages/index.d.ts +164 -6
- package/dist/messages/index.d.ts.map +1 -1
- package/dist/pen-menu.d.ts +92 -0
- package/dist/pen-menu.d.ts.map +1 -0
- package/dist/pen-menu.js +292 -0
- package/dist/pen-menu.js.map +1 -0
- package/dist/pen.d.ts +48 -0
- package/dist/pen.d.ts.map +1 -0
- package/dist/pen.js +204 -0
- package/dist/pen.js.map +1 -0
- package/dist/presence-layer.d.ts +68 -10
- package/dist/presence-layer.d.ts.map +1 -1
- package/dist/presence-layer.js +176 -13
- package/dist/presence-layer.js.map +1 -1
- package/dist/presence.d.ts +85 -1
- package/dist/presence.d.ts.map +1 -1
- package/dist/presence.js +104 -0
- package/dist/presence.js.map +1 -1
- package/dist/sticky.d.ts +25 -0
- package/dist/sticky.d.ts.map +1 -0
- package/dist/sticky.js +26 -0
- package/dist/sticky.js.map +1 -0
- package/dist/story.d.ts.map +1 -1
- package/dist/story.js +5 -0
- package/dist/story.js.map +1 -1
- package/dist/strokes.d.ts +82 -0
- package/dist/strokes.d.ts.map +1 -0
- package/dist/strokes.js +305 -0
- package/dist/strokes.js.map +1 -0
- package/dist/tooltip.d.ts +11 -3
- package/dist/tooltip.d.ts.map +1 -1
- package/dist/tooltip.js +14 -9
- package/dist/tooltip.js.map +1 -1
- package/dist/trail.d.ts +60 -0
- package/dist/trail.d.ts.map +1 -0
- package/dist/trail.js +107 -0
- package/dist/trail.js.map +1 -0
- package/dist/view-only.d.ts +2 -2
- package/dist/view-only.d.ts.map +1 -1
- package/dist/view-only.js +5 -2
- package/dist/view-only.js.map +1 -1
- 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.
|
|
51
|
-
|
|
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)
|