@dovetail-ts/ember 0.0.0-stage → 1.0.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/CHANGELOG.md +25 -0
- package/LICENSE +21 -0
- package/README.md +180 -2
- package/addon-main.cjs +4 -0
- package/declarations/-private/status-dot.d.ts +14 -0
- package/declarations/-private/status-dot.d.ts.map +1 -0
- package/declarations/-private/visually-hidden.d.ts +6 -0
- package/declarations/-private/visually-hidden.d.ts.map +1 -0
- package/declarations/components/dovetail/avatar-stack.d.ts +31 -0
- package/declarations/components/dovetail/avatar-stack.d.ts.map +1 -0
- package/declarations/components/dovetail/connection-badge.d.ts +24 -0
- package/declarations/components/dovetail/connection-badge.d.ts.map +1 -0
- package/declarations/components/dovetail/dead-letters.d.ts +25 -0
- package/declarations/components/dovetail/dead-letters.d.ts.map +1 -0
- package/declarations/components/dovetail/editor.d.ts +58 -0
- package/declarations/components/dovetail/editor.d.ts.map +1 -0
- package/declarations/components/dovetail/live-cursors.d.ts +31 -0
- package/declarations/components/dovetail/live-cursors.d.ts.map +1 -0
- package/declarations/components/dovetail/presence.d.ts +27 -0
- package/declarations/components/dovetail/presence.d.ts.map +1 -0
- package/declarations/components/dovetail/sync-status.d.ts +25 -0
- package/declarations/components/dovetail/sync-status.d.ts.map +1 -0
- package/declarations/components/dovetail/typing.d.ts +17 -0
- package/declarations/components/dovetail/typing.d.ts.map +1 -0
- package/declarations/editor.d.ts +3 -0
- package/declarations/editor.d.ts.map +1 -0
- package/declarations/index.d.ts +25 -0
- package/declarations/index.d.ts.map +1 -0
- package/declarations/live.d.ts +46 -0
- package/declarations/live.d.ts.map +1 -0
- package/declarations/people.d.ts +51 -0
- package/declarations/people.d.ts.map +1 -0
- package/declarations/services/dovetail.d.ts +90 -0
- package/declarations/services/dovetail.d.ts.map +1 -0
- package/declarations/status.d.ts +16 -0
- package/declarations/status.d.ts.map +1 -0
- package/dist/_app_/components/dovetail/avatar-stack.js +1 -0
- package/dist/_app_/components/dovetail/connection-badge.js +1 -0
- package/dist/_app_/components/dovetail/dead-letters.js +1 -0
- package/dist/_app_/components/dovetail/editor.js +1 -0
- package/dist/_app_/components/dovetail/live-cursors.js +1 -0
- package/dist/_app_/components/dovetail/presence.js +1 -0
- package/dist/_app_/components/dovetail/sync-status.js +1 -0
- package/dist/_app_/components/dovetail/typing.js +1 -0
- package/dist/_app_/services/dovetail.js +1 -0
- package/dist/components/dovetail/avatar-stack.js +52 -0
- package/dist/components/dovetail/avatar-stack.js.map +1 -0
- package/dist/components/dovetail/connection-badge.js +43 -0
- package/dist/components/dovetail/connection-badge.js.map +1 -0
- package/dist/components/dovetail/dead-letters.js +47 -0
- package/dist/components/dovetail/dead-letters.js.map +1 -0
- package/dist/components/dovetail/editor.js +107 -0
- package/dist/components/dovetail/editor.js.map +1 -0
- package/dist/components/dovetail/live-cursors.js +46 -0
- package/dist/components/dovetail/live-cursors.js.map +1 -0
- package/dist/components/dovetail/presence.js +35 -0
- package/dist/components/dovetail/presence.js.map +1 -0
- package/dist/components/dovetail/sync-status.js +39 -0
- package/dist/components/dovetail/sync-status.js.map +1 -0
- package/dist/components/dovetail/typing.js +23 -0
- package/dist/components/dovetail/typing.js.map +1 -0
- package/dist/css.d.ts +2 -0
- package/dist/css.d.ts.map +1 -0
- package/dist/editor.js +2 -0
- package/dist/editor.js.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/live-u5cQDrwU.js +93 -0
- package/dist/live-u5cQDrwU.js.map +1 -0
- package/dist/people-GBjAG7ZI.js +105 -0
- package/dist/people-GBjAG7ZI.js.map +1 -0
- package/dist/services/dovetail.js +233 -0
- package/dist/services/dovetail.js.map +1 -0
- package/dist/status-CYJBlnG7.js +59 -0
- package/dist/status-CYJBlnG7.js.map +1 -0
- package/dist/status-dot-DSQMdQhW.js +31 -0
- package/dist/status-dot-DSQMdQhW.js.map +1 -0
- package/dist/styles/editor.css +27 -0
- package/dist/visually-hidden-BFhJXHGu.js +10 -0
- package/dist/visually-hidden-BFhJXHGu.js.map +1 -0
- package/package.json +121 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# @dovetail-ts/ember
|
|
2
|
+
|
|
3
|
+
## 1.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 480744b: First release of Dovetail: real-time and offline sync for Ember.
|
|
8
|
+
|
|
9
|
+
- `@dovetail-ts/core`: the connection life cycle, live store subscriptions, the optimistic ledger with rebase and rollback, the offline write queue in IndexedDB with a leader tab and dead letters, `DocSession` and `PresenceRoom`.
|
|
10
|
+
- `@dovetail-ts/warp-drive`: the store feed into WarpDrive.
|
|
11
|
+
- `@dovetail-ts/crdt`, `crdt-yjs`, `crdt-loro` and `crdt-automerge`: one `DocEngine` interface with three engines.
|
|
12
|
+
- `@dovetail-ts/tiptap`: co-editing in Tiptap 3 with carets, per-user undo, versions and comment threads.
|
|
13
|
+
- `@dovetail-ts/ember`, `notifications` and `inspector`: presence and status components, the inbox, toasts and activity feeds, and a dev panel.
|
|
14
|
+
- `@dovetail-ts/server`, the transports (`transport-ws`, `transport-sse`, `transport-cable`) and `conformance`: a Node server and one wire protocol that the Rails gems also pass.
|
|
15
|
+
- Adapters for Hocuspocus, Liveblocks, PartyKit and Supabase, and integrations for Switchyard, Millwork, Benchdog and Lattice. The Neon adapter is not in 1.0: it waits for a stable Neon Realtime client (1.1).
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies [480744b]
|
|
20
|
+
- @dovetail-ts/core@1.0.0
|
|
21
|
+
- @dovetail-ts/crdt-yjs@1.0.0
|
|
22
|
+
- @dovetail-ts/crdt@1.0.0
|
|
23
|
+
- @dovetail-ts/protocol@1.0.0
|
|
24
|
+
- @dovetail-ts/tiptap@1.0.0
|
|
25
|
+
- @dovetail-ts/warp-drive@1.0.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Joe Gaudet
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,181 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @dovetail-ts/ember
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Dovetail for Ember: the `dovetail` service, the live objects of a room, and the Joinery-based
|
|
4
|
+
presence and status components.
|
|
5
|
+
|
|
6
|
+
Part of [Dovetail](https://joegaudet.com/dovetail/). Not released yet.
|
|
7
|
+
|
|
8
|
+
## Configure the service
|
|
9
|
+
|
|
10
|
+
Call `configure()` one time, for example in the application route. The service makes the
|
|
11
|
+
connection and connects. With a `sink`, it also starts the sync client (the optimistic ledger
|
|
12
|
+
and the offline queue).
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import Route from '@ember/routing/route'
|
|
16
|
+
import { service } from '@ember/service'
|
|
17
|
+
import type { DovetailService } from '@dovetail-ts/ember'
|
|
18
|
+
import { WebSocketTransport } from '@dovetail-ts/transport-ws'
|
|
19
|
+
import { storeSink } from '@dovetail-ts/warp-drive'
|
|
20
|
+
|
|
21
|
+
export default class ApplicationRoute extends Route {
|
|
22
|
+
@service declare dovetail: DovetailService
|
|
23
|
+
@service declare store: Store
|
|
24
|
+
@service declare session: Session
|
|
25
|
+
|
|
26
|
+
async beforeModel() {
|
|
27
|
+
await this.dovetail.configure({
|
|
28
|
+
transport: () => new WebSocketTransport({ url: 'wss://example.com/dovetail/ws' }),
|
|
29
|
+
getToken: () => this.session.token,
|
|
30
|
+
user: { id: 'u1', name: 'Ana Lima', color: '#1d4ed8' },
|
|
31
|
+
sink: storeSink(this.store),
|
|
32
|
+
})
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
| Option | Default | What it does |
|
|
38
|
+
| ------------ | --------------------------- | ----------------------------------------------------------------------------------- |
|
|
39
|
+
| `transport` | (required) | Makes a new transport for each attempt. |
|
|
40
|
+
| `getToken` | none | The auth hook. The connection calls it before each attempt. |
|
|
41
|
+
| `user` | (required) | `{ id, name, color, avatarUrl? }`: the avatars, the pointers and the carets. |
|
|
42
|
+
| `sink` | none | Where the store feed goes. Without it, there are no writes and no queue. |
|
|
43
|
+
| `queue` | a `WriteQueue` on IndexedDB | The offline write queue. |
|
|
44
|
+
| `docStorage` | `IndexedDBDocStorage` | Where the local doc updates wait until the server has them. |
|
|
45
|
+
| `dbName` | `dovetail` | The name of the IndexedDB database. |
|
|
46
|
+
| `connection` | none | The other `Connection` options: `network`, `clock`, `heartbeatInterval`, …. |
|
|
47
|
+
| `sync` | none | The other `SyncClient` options: `locks`, `channel`, `lockName`, `backoff`, …. |
|
|
48
|
+
| `presence` | none | The timings of each presence room: `awayAfter`, `typingTimeout`, `pointerThrottle`. |
|
|
49
|
+
|
|
50
|
+
The tracked state of the service:
|
|
51
|
+
|
|
52
|
+
- `connectionState`: `idle`, `connecting`, `open`, `reconnecting`, `offline` or `closed`.
|
|
53
|
+
- `status`: `online`, `connecting`, `reconnecting` or `offline`. The components show it.
|
|
54
|
+
- `online`, `queued`, `deadLetters` and `errors`.
|
|
55
|
+
- `connection` and `sync`: the core objects.
|
|
56
|
+
|
|
57
|
+
The methods:
|
|
58
|
+
|
|
59
|
+
- `write(room, op)`, `retry(id)` and `discard(id)`: the sync client.
|
|
60
|
+
- `subscribe(owner, room)`: puts the store feed of the room in the store until `owner` is
|
|
61
|
+
destroyed.
|
|
62
|
+
- `presence(owner, room)`: a `LivePresence` until `owner` is destroyed. All owners of a room
|
|
63
|
+
share one presence room.
|
|
64
|
+
- `doc(owner, room, engine, { doc })`: a `LiveDoc`, a CRDT document that a `DocSession` syncs
|
|
65
|
+
until `owner` is destroyed. The default document name is `body`.
|
|
66
|
+
|
|
67
|
+
For a room with a document, call `doc()` before `presence()`. Then the presence uses the
|
|
68
|
+
awareness of the document, and the room has one awareness.
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
import Component from '@glimmer/component'
|
|
72
|
+
import { service } from '@ember/service'
|
|
73
|
+
import type { DovetailService } from '@dovetail-ts/ember'
|
|
74
|
+
|
|
75
|
+
export default class Board extends Component {
|
|
76
|
+
@service declare dovetail: DovetailService
|
|
77
|
+
presence = this.dovetail.presence(this, 'board:1')
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
`LivePresence` has a tracked `state` (`{ self, peers }`), and `activity()`, `setPointer()`,
|
|
82
|
+
`typing()`, `stopTyping()` and `set()`. `LiveDoc` has `handle`, a tracked `synced` and `started`, `session`
|
|
83
|
+
and `ready`.
|
|
84
|
+
|
|
85
|
+
## The components
|
|
86
|
+
|
|
87
|
+
Import a component from `@dovetail-ts/ember`, or use its classic name
|
|
88
|
+
(`<Dovetail::AvatarStack>`). The editor has its own entry: `@dovetail-ts/ember/editor`.
|
|
89
|
+
|
|
90
|
+
| Component | Arguments | What it shows |
|
|
91
|
+
| ----------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- |
|
|
92
|
+
| `<Dovetail::Presence>` | `@room` | Nothing. It yields the `LivePresence` of the room. |
|
|
93
|
+
| `<Dovetail::AvatarStack>` | `@presence`, `@max` (5), `@includeSelf` (true), `@allowAvatarUrl` | An avatar for each user, the status dot, and an overflow count. |
|
|
94
|
+
| `<Dovetail::Typing>` | `@presence` | `Ana is typing`, `Ana and Ben are typing`, `3 people are typing`. |
|
|
95
|
+
| `<Dovetail::LiveCursors>` | `@presence`, a block | The pointers of the peers over the block, with names. |
|
|
96
|
+
| `<Dovetail::ConnectionBadge>` | `@state`, `@queued` (both from the service) | `Online`, `Reconnecting`, `Offline · 3 queued`. |
|
|
97
|
+
| `<Dovetail::SyncStatus>` | `@status`, `@queued` (both from the service) | `Saved`, `Syncing 3 changes`, `Offline: 3 changes wait`. |
|
|
98
|
+
| `<Dovetail::DeadLetters>` | `@deadLetters`, `@onRetry`, `@onDiscard` | The refused writes, each with Retry and Discard. |
|
|
99
|
+
| `<Dovetail::Editor>` | `@room` or `@doc` with `@user`, `@engine`, `@binding`, `@label` | A Tiptap editor that co-edits the document, with remote carets. |
|
|
100
|
+
|
|
101
|
+
```hbs
|
|
102
|
+
<Dovetail::Presence @room='board:1' as |presence|>
|
|
103
|
+
<Dovetail::AvatarStack @presence={{presence}} @max={{4}} />
|
|
104
|
+
<Dovetail::LiveCursors @presence={{presence}}>
|
|
105
|
+
<MyBoard />
|
|
106
|
+
</Dovetail::LiveCursors>
|
|
107
|
+
<Dovetail::Typing @presence={{presence}} />
|
|
108
|
+
</Dovetail::Presence>
|
|
109
|
+
|
|
110
|
+
<Dovetail::ConnectionBadge />
|
|
111
|
+
<Dovetail::SyncStatus />
|
|
112
|
+
<Dovetail::DeadLetters />
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
- `@presence` is a `PresenceSource`: a `state`, and the optional calls `setPointer`,
|
|
116
|
+
`activity` and `typing`. A `LivePresence` has this shape.
|
|
117
|
+
- The core adds no DOM listeners. `LiveCursors` sends the pointer of the local user, as a
|
|
118
|
+
fraction (0 to 1) of the size of its box. For typing, call `presence.typing()` in the input
|
|
119
|
+
handler of your text field.
|
|
120
|
+
- The status components are live regions (`role="status"`). The typing indicator stays in the
|
|
121
|
+
page when it is empty, so a screen reader reads each change.
|
|
122
|
+
- Each avatar is a button: the name shows in a tooltip on hover and on keyboard focus.
|
|
123
|
+
- The components hide their screen reader text (the avatar labels, the count of
|
|
124
|
+
`DeadLetters`) with an inline style. The host needs no `.sr-only` class and no addon CSS.
|
|
125
|
+
|
|
126
|
+
### The editor
|
|
127
|
+
|
|
128
|
+
```gts
|
|
129
|
+
import { Editor } from '@dovetail-ts/ember/editor'
|
|
130
|
+
|
|
131
|
+
<template>
|
|
132
|
+
<Editor @room='note:1' @label='Note' as |editor|>
|
|
133
|
+
<Dovetail::AvatarStack @presence={{editor.presence}} />
|
|
134
|
+
<button type='button' {{on 'click' (fn editor.features.versions.create 'Draft')}}>
|
|
135
|
+
Keep a version
|
|
136
|
+
</button>
|
|
137
|
+
</Editor>
|
|
138
|
+
</template>
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
- With `@room`, the editor gets the document from the service (`dovetail.doc`), with the Yjs
|
|
142
|
+
engine by default (`@engine` changes it), and the presence of the room.
|
|
143
|
+
- With `@doc` (a `LiveDoc`) and `@user`, it uses a document of your own, for example on a
|
|
144
|
+
second connection.
|
|
145
|
+
- It yields `presence` and `features`: the `threads`, `versions`, `undo` and `redo` of
|
|
146
|
+
`@dovetail-ts/tiptap`.
|
|
147
|
+
- `data-state` is `loading` until the doc session starts, then `syncing`, and `synced` when the
|
|
148
|
+
server has each local change. The text box shows when the session starts. A local edit
|
|
149
|
+
before the start is not lost, but an editor that mounts before it makes the carets of the
|
|
150
|
+
peers flaky in the tests (ADR 0020).
|
|
151
|
+
|
|
152
|
+
### The colors
|
|
153
|
+
|
|
154
|
+
The name, the color and the avatar URL of a peer come from that peer, so the components do not
|
|
155
|
+
trust them:
|
|
156
|
+
|
|
157
|
+
- A name shows only as text.
|
|
158
|
+
- A color goes into a style only when it is a hex color (`#rgb`, `#rgba`, `#rrggbb` or
|
|
159
|
+
`#rrggbbaa`). Another value, for example `url(...)`, shows as gray. Use hex colors.
|
|
160
|
+
- An avatar URL goes to the image only when it is an `https:` URL. A relative URL, for example
|
|
161
|
+
`/ann.png`, passes on an `https:` page. Give `@allowAvatarUrl` (a function of the URL that
|
|
162
|
+
returns true or false) to the avatar stack to use your own policy. An avatar with a refused
|
|
163
|
+
URL shows the initials.
|
|
164
|
+
|
|
165
|
+
The components use the Joinery tokens. Joinery has no green or amber token, so the status dots
|
|
166
|
+
use `--dovetail-online` and `--dovetail-away`. Set them to change the colors.
|
|
167
|
+
|
|
168
|
+
## Tests
|
|
169
|
+
|
|
170
|
+
Each component has a harness in `@dovetail-ts/test-support`: `ConnectionBadgeHarness`,
|
|
171
|
+
`SyncStatusHarness`, `AvatarStackHarness`, `TypingHarness`, `LiveCursorsHarness`,
|
|
172
|
+
`DeadLettersHarness` and `EditorHarness`.
|
|
173
|
+
|
|
174
|
+
```ts
|
|
175
|
+
import { ember } from '@harnessed-ts/ember'
|
|
176
|
+
import { ConnectionBadgeHarness } from '@dovetail-ts/test-support'
|
|
177
|
+
|
|
178
|
+
const badge = new ConnectionBadgeHarness(ember())
|
|
179
|
+
await badge.state.should.equal('offline')
|
|
180
|
+
await badge.text.should.equal('Offline · 3 queued')
|
|
181
|
+
```
|
package/addon-main.cjs
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { TOC } from '@ember/component/template-only';
|
|
2
|
+
/** The background of a dot. The values are constants, not user input, so they are safe. */
|
|
3
|
+
export declare function dotColor(status: string): import("@ember/template").TrustedHTML;
|
|
4
|
+
/** The style of a dot. */
|
|
5
|
+
export declare function dotStyle(status: string): import("@ember/template").TrustedHTML;
|
|
6
|
+
/** A small colored dot for a status. It is only decoration: the text says the status. */
|
|
7
|
+
declare const StatusDot: TOC<{
|
|
8
|
+
Args: {
|
|
9
|
+
status: string;
|
|
10
|
+
};
|
|
11
|
+
Element: HTMLSpanElement;
|
|
12
|
+
}>;
|
|
13
|
+
export default StatusDot;
|
|
14
|
+
//# sourceMappingURL=status-dot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-dot.d.ts","sourceRoot":"","sources":["../../src/-private/status-dot.gts"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gCAAgC,CAAA;AAczD,2FAA2F;AAC3F,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,yCAEtC;AAED,0BAA0B;AAC1B,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,yCAItC;AAED,yFAAyF;AACzF,QAAA,MAAM,SAAS,EAAE,GAAG,CAAC;IAAE,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAAC,OAAO,EAAE,eAAe,CAAA;CAAE,CAiBzE,CAAA;AAEF,eAAe,SAAS,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The style of text that a screen reader reads but the screen does not show. It is inline, so
|
|
3
|
+
* the host needs no `.sr-only` class and no CSS of the addon.
|
|
4
|
+
*/
|
|
5
|
+
export declare const VISUALLY_HIDDEN: import("@ember/template").TrustedHTML;
|
|
6
|
+
//# sourceMappingURL=visually-hidden.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visually-hidden.d.ts","sourceRoot":"","sources":["../../src/-private/visually-hidden.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,eAAe,uCAE3B,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import type { PresenceSource } from '../../live.ts';
|
|
3
|
+
import type { Person } from '../../people.ts';
|
|
4
|
+
export interface AvatarStackSignature {
|
|
5
|
+
Args: {
|
|
6
|
+
/** The presence of the room: a yield of `<Dovetail::Presence>`, or any `PresenceSource`. */
|
|
7
|
+
presence: PresenceSource;
|
|
8
|
+
/** The most avatars to show. A count shows the others. The default is 5. */
|
|
9
|
+
max?: number;
|
|
10
|
+
/** Shows the local user first. The default is true. */
|
|
11
|
+
includeSelf?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* True for an avatar URL of a peer that the page can load. The default allows an `https:`
|
|
14
|
+
* URL only (a relative URL on an `https:` page too). An avatar with a refused URL shows the initials.
|
|
15
|
+
*/
|
|
16
|
+
allowAvatarUrl?: (url: string) => boolean;
|
|
17
|
+
};
|
|
18
|
+
Element: HTMLDivElement;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The people in a room: an avatar for each user, with a dot for the status (online or away),
|
|
22
|
+
* and a count of the others after `@max`. The name shows on hover and on focus.
|
|
23
|
+
*/
|
|
24
|
+
export default class AvatarStack extends Component<AvatarStackSignature> {
|
|
25
|
+
get list(): {
|
|
26
|
+
visible: Person[];
|
|
27
|
+
hidden: Person[];
|
|
28
|
+
};
|
|
29
|
+
get overflowLabel(): string;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=avatar-stack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avatar-stack.d.ts","sourceRoot":"","sources":["../../../src/components/dovetail/avatar-stack.gts"],"names":[],"mappings":"AAqGA,OAAO,SAAS,MAAM,oBAAoB,CAAA;AAG1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAEnD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAI7C,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE;QACJ,4FAA4F;QAC5F,QAAQ,EAAE,cAAc,CAAA;QACxB,4EAA4E;QAC5E,GAAG,CAAC,EAAE,MAAM,CAAA;QACZ,uDAAuD;QACvD,WAAW,CAAC,EAAE,OAAO,CAAA;QACrB;;;WAGG;QACH,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAA;KAC1C,CAAA;IACD,OAAO,EAAE,cAAc,CAAA;CACxB;AASD;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,SAAS,CAAC,oBAAoB,CAAC;IACtE,IAAI,IAAI;;;MAMP;IAED,IAAI,aAAa,IAAI,MAAM,CAG1B;CAkJF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import type DovetailService from '../../services/dovetail.ts';
|
|
3
|
+
import type { ConnectionStatus } from '../../status.ts';
|
|
4
|
+
export interface ConnectionBadgeSignature {
|
|
5
|
+
Args: {
|
|
6
|
+
/** The status to show. The default is the status of the `dovetail` service. */
|
|
7
|
+
state?: ConnectionStatus;
|
|
8
|
+
/** The count of queued writes. The default is the count of the `dovetail` service. */
|
|
9
|
+
queued?: number;
|
|
10
|
+
};
|
|
11
|
+
Element: HTMLElement;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The state of the connection, and the count of queued writes: `Online`, `Reconnecting` or
|
|
15
|
+
* `Offline · 3 queued`. It is a live region, so a screen reader reads each change.
|
|
16
|
+
*/
|
|
17
|
+
export default class ConnectionBadge extends Component<ConnectionBadgeSignature> {
|
|
18
|
+
dovetail: DovetailService;
|
|
19
|
+
get state(): ConnectionStatus;
|
|
20
|
+
get queued(): number;
|
|
21
|
+
get label(): string;
|
|
22
|
+
get variant(): "secondary" | "outline";
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=connection-badge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection-badge.d.ts","sourceRoot":"","sources":["../../../src/components/dovetail/connection-badge.gts"],"names":[],"mappings":"AAuDA,OAAO,SAAS,MAAM,oBAAoB,CAAA;AAG1C,OAAO,KAAK,eAAe,MAAM,4BAA4B,CAAA;AAE7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAGvD,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE;QACJ,+EAA+E;QAC/E,KAAK,CAAC,EAAE,gBAAgB,CAAA;QACxB,sFAAsF;QACtF,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,OAAO,EAAE,WAAW,CAAA;CACrB;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,SAAS,CAAC,wBAAwB,CAAC;IACjD,QAAQ,EAAE,eAAe,CAAA;IAEtD,IAAI,KAAK,IAAI,gBAAgB,CAE5B;IAED,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,IAAI,OAAO,4BAEV;CA8BF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import type { DeadLetter } from '@dovetail-ts/core';
|
|
3
|
+
import type DovetailService from '../../services/dovetail.ts';
|
|
4
|
+
export interface DeadLettersSignature {
|
|
5
|
+
Args: {
|
|
6
|
+
/** The refused writes. The default is the dead letters of the `dovetail` service. */
|
|
7
|
+
deadLetters?: readonly DeadLetter[];
|
|
8
|
+
/** Called with the id of a write on Retry. The default is `dovetail.retry(id)`. */
|
|
9
|
+
onRetry?: (id: string) => unknown;
|
|
10
|
+
/** Called with the id of a write on Discard. The default is `dovetail.discard(id)`. */
|
|
11
|
+
onDiscard?: (id: string) => unknown;
|
|
12
|
+
};
|
|
13
|
+
Element: HTMLElement;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The writes that the server refused, each with the reason, a Retry button and a Discard
|
|
17
|
+
* button. A discard rolls the change back. A hidden live region says the count.
|
|
18
|
+
*/
|
|
19
|
+
export default class DeadLetters extends Component<DeadLettersSignature> {
|
|
20
|
+
dovetail: DovetailService;
|
|
21
|
+
get letters(): readonly DeadLetter[];
|
|
22
|
+
retry: (id: string) => undefined;
|
|
23
|
+
discard: (id: string) => undefined;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=dead-letters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dead-letters.d.ts","sourceRoot":"","sources":["../../../src/components/dovetail/dead-letters.gts"],"names":[],"mappings":"AA0FA,OAAO,SAAS,MAAM,oBAAoB,CAAA;AAK1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,KAAK,eAAe,MAAM,4BAA4B,CAAA;AAI7D,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE;QACJ,qFAAqF;QACrF,WAAW,CAAC,EAAE,SAAS,UAAU,EAAE,CAAA;QACnC,mFAAmF;QACnF,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAA;QACjC,uFAAuF;QACvF,SAAS,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAA;KACpC,CAAA;IACD,OAAO,EAAE,WAAW,CAAA;CACrB;AAKD;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,SAAS,CAAC,oBAAoB,CAAC;IACzC,QAAQ,EAAE,eAAe,CAAA;IAEtD,IAAI,OAAO,IAAI,SAAS,UAAU,EAAE,CAEnC;IAED,KAAK,GAAI,IAAI,MAAM,eAAkE;IAErF,OAAO,GAAI,IAAI,MAAM,eAAsE;CAoJ5F"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import type Owner from '@ember/owner';
|
|
3
|
+
import type { PresenceUser } from '@dovetail-ts/core';
|
|
4
|
+
import type { DocEngine } from '@dovetail-ts/crdt';
|
|
5
|
+
import type { Dovetail, EditorBinding } from '@dovetail-ts/tiptap';
|
|
6
|
+
import type DovetailService from '../../services/dovetail.ts';
|
|
7
|
+
import { LivePresence } from '../../live.ts';
|
|
8
|
+
import '../../styles/editor.css';
|
|
9
|
+
import type { LiveDoc } from '../../live.ts';
|
|
10
|
+
export interface EditorSignature {
|
|
11
|
+
Args: {
|
|
12
|
+
/** The room of the document. The editor gets the document from the `dovetail` service. */
|
|
13
|
+
room?: string;
|
|
14
|
+
/** The engine of the document of `@room`. The default is the Yjs engine. */
|
|
15
|
+
engine?: DocEngine;
|
|
16
|
+
/** A document of your own, in place of `@room`: for a second connection, or a story. */
|
|
17
|
+
doc?: LiveDoc;
|
|
18
|
+
/** The local user of the carets. The default is the user of the `dovetail` service. */
|
|
19
|
+
user?: PresenceUser;
|
|
20
|
+
/** The binding of the engine. The default is `yjsBinding`. */
|
|
21
|
+
binding?: EditorBinding;
|
|
22
|
+
/** The accessible name of the text box. The default is `Document`. */
|
|
23
|
+
label?: string;
|
|
24
|
+
};
|
|
25
|
+
Blocks: {
|
|
26
|
+
/** The presence of the room, and the features of the editor: threads, versions, undo. */
|
|
27
|
+
default: [{
|
|
28
|
+
presence: LivePresence;
|
|
29
|
+
features: Dovetail;
|
|
30
|
+
}];
|
|
31
|
+
};
|
|
32
|
+
Element: HTMLDivElement;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* A Tiptap editor that co-edits one document of a room through a `DocSession`, and shows the
|
|
36
|
+
* carets of the peers. It yields the presence of the room (for an avatar stack) and the
|
|
37
|
+
* Dovetail features of the editor: `features.threads` and `features.versions`.
|
|
38
|
+
*/
|
|
39
|
+
export default class Editor extends Component<EditorSignature> {
|
|
40
|
+
dovetail: DovetailService;
|
|
41
|
+
readonly features: Dovetail;
|
|
42
|
+
readonly doc: LiveDoc;
|
|
43
|
+
readonly presence: LivePresence;
|
|
44
|
+
readonly user: PresenceUser;
|
|
45
|
+
constructor(owner: Owner, args: EditorSignature['Args']);
|
|
46
|
+
/** `loading` until the session starts, then `syncing` or `synced`. */
|
|
47
|
+
get state(): string;
|
|
48
|
+
/** The names of the peers with a caret in the document (the `cursor` field of Tiptap). */
|
|
49
|
+
get carets(): string;
|
|
50
|
+
mount: import("ember-modifier").FunctionBasedModifier<{
|
|
51
|
+
Args: {
|
|
52
|
+
Positional: unknown[];
|
|
53
|
+
Named: import("ember-modifier/-private/signature").EmptyObject;
|
|
54
|
+
};
|
|
55
|
+
Element: HTMLElement;
|
|
56
|
+
}>;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=editor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../src/components/dovetail/editor.gts"],"names":[],"mappings":"AAkIA,OAAO,SAAS,MAAM,oBAAoB,CAAA;AAI1C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAKrC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAGlD,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAElE,OAAO,KAAK,eAAe,MAAM,4BAA4B,CAAA;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAE5C,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE;QACJ,0FAA0F;QAC1F,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,4EAA4E;QAC5E,MAAM,CAAC,EAAE,SAAS,CAAA;QAClB,wFAAwF;QACxF,GAAG,CAAC,EAAE,OAAO,CAAA;QACb,uFAAuF;QACvF,IAAI,CAAC,EAAE,YAAY,CAAA;QACnB,8DAA8D;QAC9D,OAAO,CAAC,EAAE,aAAa,CAAA;QACvB,sEAAsE;QACtE,KAAK,CAAC,EAAE,MAAM,CAAA;KACf,CAAA;IACD,MAAM,EAAE;QACN,yFAAyF;QACzF,OAAO,EAAE,CAAC;YAAE,QAAQ,EAAE,YAAY,CAAC;YAAC,QAAQ,EAAE,QAAQ,CAAA;SAAE,CAAC,CAAA;KAC1D,CAAA;IACD,OAAO,EAAE,cAAc,CAAA;CACxB;AAED;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,SAAS,CAAC,eAAe,CAAC;IAC/B,QAAQ,EAAE,eAAe,CAAA;IACtD,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAA;IAC3B,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAA;IACrB,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAA;IAC/B,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAA;gBAEf,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,eAAe,CAAC,MAAM,CAAC;IA2BvD,sEAAsE;IACtE,IAAI,KAAK,IAAI,MAAM,CAGlB;IAED,0FAA0F;IAC1F,IAAI,MAAM,IAAI,MAAM,CAKnB;IAED,KAAK;;;;;;OAgBH;CAmCH"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import type { PresencePeer, PresencePointer } from '@dovetail-ts/core';
|
|
3
|
+
import type { PresenceSource } from '../../live.ts';
|
|
4
|
+
export interface LiveCursorsSignature {
|
|
5
|
+
Args: {
|
|
6
|
+
/** The presence of the room. The component sends the local pointer through it. */
|
|
7
|
+
presence: PresenceSource;
|
|
8
|
+
};
|
|
9
|
+
Blocks: {
|
|
10
|
+
default: [];
|
|
11
|
+
};
|
|
12
|
+
Element: HTMLDivElement;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The pointers of the peers over the content of the block, with their names and colors. It
|
|
16
|
+
* sends the local pointer, as a fraction of the size of the box, so that boxes of other sizes
|
|
17
|
+
* show it at the same place. The pointers are decoration for the screen readers.
|
|
18
|
+
*/
|
|
19
|
+
export default class LiveCursors extends Component<LiveCursorsSignature> {
|
|
20
|
+
track: import("ember-modifier").FunctionBasedModifier<{
|
|
21
|
+
Args: {
|
|
22
|
+
Positional: unknown[];
|
|
23
|
+
Named: import("ember-modifier/-private/signature").EmptyObject;
|
|
24
|
+
};
|
|
25
|
+
Element: HTMLElement;
|
|
26
|
+
}>;
|
|
27
|
+
get cursors(): (PresencePeer & {
|
|
28
|
+
pointer: PresencePointer;
|
|
29
|
+
})[];
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=live-cursors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live-cursors.d.ts","sourceRoot":"","sources":["../../../src/components/dovetail/live-cursors.gts"],"names":[],"mappings":"AA8EA,OAAO,SAAS,MAAM,oBAAoB,CAAA;AAE1C,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAGnD,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE;QACJ,kFAAkF;QAClF,QAAQ,EAAE,cAAc,CAAA;KACzB,CAAA;IACD,MAAM,EAAE;QAAE,OAAO,EAAE,EAAE,CAAA;KAAE,CAAA;IACvB,OAAO,EAAE,cAAc,CAAA;CACxB;AAYD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,SAAS,CAAC,oBAAoB,CAAC;IACtE,KAAK;;;;;;OAYH;IAEF,IAAI,OAAO,IAAI,CAAC,YAAY,GAAG;QAAE,OAAO,EAAE,eAAe,CAAA;KAAE,CAAC,EAAE,CAI7D;CAwFF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import type Owner from '@ember/owner';
|
|
3
|
+
import type DovetailService from '../../services/dovetail.ts';
|
|
4
|
+
import type { LivePresence } from '../../live.ts';
|
|
5
|
+
export interface PresenceSignature {
|
|
6
|
+
Args: {
|
|
7
|
+
/** The room. A change of the room after the first render does nothing. */
|
|
8
|
+
room: string;
|
|
9
|
+
};
|
|
10
|
+
Blocks: {
|
|
11
|
+
default: [LivePresence];
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Yields the presence of a room (`dovetail.presence(this, room)`), and stops it when it leaves
|
|
16
|
+
* the page. Give the yielded presence to the presence components.
|
|
17
|
+
*
|
|
18
|
+
* <Dovetail::Presence @room="board:1" as |presence|>
|
|
19
|
+
* <Dovetail::AvatarStack @presence={{presence}} />
|
|
20
|
+
* </Dovetail::Presence>
|
|
21
|
+
*/
|
|
22
|
+
export default class Presence extends Component<PresenceSignature> {
|
|
23
|
+
dovetail: DovetailService;
|
|
24
|
+
readonly presence: LivePresence;
|
|
25
|
+
constructor(owner: Owner, args: PresenceSignature['Args']);
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=presence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presence.d.ts","sourceRoot":"","sources":["../../../src/components/dovetail/presence.gts"],"names":[],"mappings":"AAoCA,OAAO,SAAS,MAAM,oBAAoB,CAAA;AAE1C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,eAAe,MAAM,4BAA4B,CAAA;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE;QACJ,0EAA0E;QAC1E,IAAI,EAAE,MAAM,CAAA;KACb,CAAA;IACD,MAAM,EAAE;QAAE,OAAO,EAAE,CAAC,YAAY,CAAC,CAAA;KAAE,CAAA;CACpC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,SAAS,CAAC,iBAAiB,CAAC;IACnC,QAAQ,EAAE,eAAe,CAAA;IAEtD,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAA;gBAEnB,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,iBAAiB,CAAC,MAAM,CAAC;CAW1D"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import type DovetailService from '../../services/dovetail.ts';
|
|
3
|
+
import type { ConnectionStatus } from '../../status.ts';
|
|
4
|
+
export interface SyncStatusSignature {
|
|
5
|
+
Args: {
|
|
6
|
+
/** The connection status. The default is the status of the `dovetail` service. */
|
|
7
|
+
status?: ConnectionStatus;
|
|
8
|
+
/** The count of queued writes. The default is the count of the `dovetail` service. */
|
|
9
|
+
queued?: number;
|
|
10
|
+
};
|
|
11
|
+
Element: HTMLParagraphElement;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Whether the local changes reached the server: `Saved`, `Syncing 3 changes` or
|
|
15
|
+
* `Offline: 3 changes wait`. It is a live region.
|
|
16
|
+
*/
|
|
17
|
+
export default class SyncStatus extends Component<SyncStatusSignature> {
|
|
18
|
+
dovetail: DovetailService;
|
|
19
|
+
get view(): {
|
|
20
|
+
state: import("../../status.ts").SyncStatusState;
|
|
21
|
+
text: string;
|
|
22
|
+
};
|
|
23
|
+
get dot(): string;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=sync-status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-status.d.ts","sourceRoot":"","sources":["../../../src/components/dovetail/sync-status.gts"],"names":[],"mappings":"AAgDA,OAAO,SAAS,MAAM,oBAAoB,CAAA;AAE1C,OAAO,KAAK,eAAe,MAAM,4BAA4B,CAAA;AAE7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAGvD,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE;QACJ,kFAAkF;QAClF,MAAM,CAAC,EAAE,gBAAgB,CAAA;QACzB,sFAAsF;QACtF,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,OAAO,EAAE,oBAAoB,CAAA;CAC9B;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,SAAS,CAAC,mBAAmB,CAAC;IACvC,QAAQ,EAAE,eAAe,CAAA;IAEtD,IAAI,IAAI;;;MAKP;IAED,IAAI,GAAG,IAAI,MAAM,CAEhB;CA4BF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import type { PresenceSource } from '../../live.ts';
|
|
3
|
+
export interface TypingSignature {
|
|
4
|
+
Args: {
|
|
5
|
+
/** The presence of the room. Call `presence.typing()` at each keystroke of the local user. */
|
|
6
|
+
presence: PresenceSource;
|
|
7
|
+
};
|
|
8
|
+
Element: HTMLParagraphElement;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Who types in the room: `Ana is typing`, `Ana and Ben are typing`, `3 people are typing`. It
|
|
12
|
+
* is a live region, and it stays in the page when it is empty, so each change is read.
|
|
13
|
+
*/
|
|
14
|
+
export default class Typing extends Component<TypingSignature> {
|
|
15
|
+
get text(): string;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=typing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typing.d.ts","sourceRoot":"","sources":["../../../src/components/dovetail/typing.gts"],"names":[],"mappings":"AAgCA,OAAO,SAAS,MAAM,oBAAoB,CAAA;AAC1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAInD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE;QACJ,8FAA8F;QAC9F,QAAQ,EAAE,cAAc,CAAA;KACzB,CAAA;IACD,OAAO,EAAE,oBAAoB,CAAA;CAC9B;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,SAAS,CAAC,eAAe,CAAC;IAC5D,IAAI,IAAI,IAAI,MAAM,CAEjB;CAwBF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../src/editor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,kCAAkC,CAAA;AACpE,YAAY,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export { default as DovetailService } from './services/dovetail.ts';
|
|
2
|
+
export type { DocOptions, DovetailConfig, PresenceTimings } from './services/dovetail.ts';
|
|
3
|
+
export { LiveDoc, LivePresence } from './live.ts';
|
|
4
|
+
export type { PresenceSource } from './live.ts';
|
|
5
|
+
export { connectionLabel, connectionStatus } from './status.ts';
|
|
6
|
+
export type { ConnectionStatus } from './status.ts';
|
|
7
|
+
export { default as ConnectionBadge } from './components/dovetail/connection-badge';
|
|
8
|
+
export type { ConnectionBadgeSignature } from './components/dovetail/connection-badge';
|
|
9
|
+
export { default as AvatarStack } from './components/dovetail/avatar-stack';
|
|
10
|
+
export type { AvatarStackSignature } from './components/dovetail/avatar-stack';
|
|
11
|
+
export { default as DeadLetters } from './components/dovetail/dead-letters';
|
|
12
|
+
export type { DeadLettersSignature } from './components/dovetail/dead-letters';
|
|
13
|
+
export { default as LiveCursors } from './components/dovetail/live-cursors';
|
|
14
|
+
export type { LiveCursorsSignature } from './components/dovetail/live-cursors';
|
|
15
|
+
export { default as Presence } from './components/dovetail/presence';
|
|
16
|
+
export type { PresenceSignature } from './components/dovetail/presence';
|
|
17
|
+
export { default as SyncStatus } from './components/dovetail/sync-status';
|
|
18
|
+
export type { SyncStatusSignature } from './components/dovetail/sync-status';
|
|
19
|
+
export { default as Typing } from './components/dovetail/typing';
|
|
20
|
+
export type { TypingSignature } from './components/dovetail/typing';
|
|
21
|
+
export { describeError, describeWrite, initials, isSafeAvatarUrl, people, safeColor, relativePointer, typingNames, } from './people.ts';
|
|
22
|
+
export type { Person } from './people.ts';
|
|
23
|
+
export { syncStatus, typingText } from './status.ts';
|
|
24
|
+
export type { SyncStatusState } from './status.ts';
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACnE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACzF,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACjD,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC/D,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AACnD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,4CAA4C,CAAA;AACvF,YAAY,EAAE,wBAAwB,EAAE,MAAM,4CAA4C,CAAA;AAC1F,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,wCAAwC,CAAA;AAC/E,YAAY,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAA;AAClF,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,wCAAwC,CAAA;AAC/E,YAAY,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAA;AAClF,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,wCAAwC,CAAA;AAC/E,YAAY,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAA;AAClF,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,oCAAoC,CAAA;AACxE,YAAY,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAA;AAC3E,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,uCAAuC,CAAA;AAC7E,YAAY,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAA;AAChF,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,kCAAkC,CAAA;AACpE,YAAY,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AACvE,OAAO,EACL,aAAa,EACb,aAAa,EACb,QAAQ,EACR,eAAe,EACf,MAAM,EACN,SAAS,EACT,eAAe,EACf,WAAW,GACZ,MAAM,aAAa,CAAA;AACpB,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACpD,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { DocSession, PresencePointer, PresenceRoom, PresenceState } from '@dovetail-ts/core';
|
|
2
|
+
import type { DocHandle, JsonObject } from '@dovetail-ts/crdt';
|
|
3
|
+
/**
|
|
4
|
+
* What the presence components read: a state, and the calls for the local user. A
|
|
5
|
+
* `LivePresence` has this shape. A story can give a plain object.
|
|
6
|
+
*/
|
|
7
|
+
export interface PresenceSource {
|
|
8
|
+
readonly state: PresenceState;
|
|
9
|
+
activity?(): void;
|
|
10
|
+
setPointer?(pointer: PresencePointer | null): void;
|
|
11
|
+
typing?(): void;
|
|
12
|
+
}
|
|
13
|
+
/** The presence of a room, with a tracked `state`. */
|
|
14
|
+
export declare class LivePresence implements PresenceSource {
|
|
15
|
+
#private;
|
|
16
|
+
state: PresenceState;
|
|
17
|
+
readonly room: string;
|
|
18
|
+
readonly presence: PresenceRoom;
|
|
19
|
+
constructor(room: string, presence: PresenceRoom);
|
|
20
|
+
activity(): void;
|
|
21
|
+
setPointer(pointer: PresencePointer | null): void;
|
|
22
|
+
typing(): void;
|
|
23
|
+
stopTyping(): void;
|
|
24
|
+
set(fields: JsonObject): void;
|
|
25
|
+
destroy(): void;
|
|
26
|
+
}
|
|
27
|
+
/** A CRDT document of a room, synced by a `DocSession`, with a tracked `synced`. */
|
|
28
|
+
export declare class LiveDoc {
|
|
29
|
+
#private;
|
|
30
|
+
synced: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* True when the session started: the stored updates are in the document. A local update
|
|
33
|
+
* before the start is not lost: it waits in the storage, and the session sends it.
|
|
34
|
+
*/
|
|
35
|
+
started: boolean;
|
|
36
|
+
/** The session, when it started. */
|
|
37
|
+
session: DocSession | undefined;
|
|
38
|
+
/** Resolves when the session started. */
|
|
39
|
+
readonly ready: Promise<void>;
|
|
40
|
+
readonly room: string;
|
|
41
|
+
readonly handle: DocHandle;
|
|
42
|
+
constructor(room: string, handle: DocHandle, makeSession: () => Promise<DocSession>);
|
|
43
|
+
/** Stops the session and destroys the document. A second call gives the same promise. */
|
|
44
|
+
destroy(): Promise<void>;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=live.d.ts.map
|