@dovetail-ts/ember 0.0.0-stage → 1.0.1

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 (81) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/LICENSE +21 -0
  3. package/README.md +180 -2
  4. package/addon-main.cjs +4 -0
  5. package/declarations/-private/status-dot.d.ts +14 -0
  6. package/declarations/-private/status-dot.d.ts.map +1 -0
  7. package/declarations/-private/visually-hidden.d.ts +6 -0
  8. package/declarations/-private/visually-hidden.d.ts.map +1 -0
  9. package/declarations/components/dovetail/avatar-stack.d.ts +31 -0
  10. package/declarations/components/dovetail/avatar-stack.d.ts.map +1 -0
  11. package/declarations/components/dovetail/connection-badge.d.ts +24 -0
  12. package/declarations/components/dovetail/connection-badge.d.ts.map +1 -0
  13. package/declarations/components/dovetail/dead-letters.d.ts +25 -0
  14. package/declarations/components/dovetail/dead-letters.d.ts.map +1 -0
  15. package/declarations/components/dovetail/editor.d.ts +58 -0
  16. package/declarations/components/dovetail/editor.d.ts.map +1 -0
  17. package/declarations/components/dovetail/live-cursors.d.ts +31 -0
  18. package/declarations/components/dovetail/live-cursors.d.ts.map +1 -0
  19. package/declarations/components/dovetail/presence.d.ts +27 -0
  20. package/declarations/components/dovetail/presence.d.ts.map +1 -0
  21. package/declarations/components/dovetail/sync-status.d.ts +25 -0
  22. package/declarations/components/dovetail/sync-status.d.ts.map +1 -0
  23. package/declarations/components/dovetail/typing.d.ts +17 -0
  24. package/declarations/components/dovetail/typing.d.ts.map +1 -0
  25. package/declarations/editor.d.ts +3 -0
  26. package/declarations/editor.d.ts.map +1 -0
  27. package/declarations/index.d.ts +25 -0
  28. package/declarations/index.d.ts.map +1 -0
  29. package/declarations/live.d.ts +46 -0
  30. package/declarations/live.d.ts.map +1 -0
  31. package/declarations/people.d.ts +51 -0
  32. package/declarations/people.d.ts.map +1 -0
  33. package/declarations/services/dovetail.d.ts +90 -0
  34. package/declarations/services/dovetail.d.ts.map +1 -0
  35. package/declarations/status.d.ts +16 -0
  36. package/declarations/status.d.ts.map +1 -0
  37. package/dist/_app_/components/dovetail/avatar-stack.js +1 -0
  38. package/dist/_app_/components/dovetail/connection-badge.js +1 -0
  39. package/dist/_app_/components/dovetail/dead-letters.js +1 -0
  40. package/dist/_app_/components/dovetail/editor.js +1 -0
  41. package/dist/_app_/components/dovetail/live-cursors.js +1 -0
  42. package/dist/_app_/components/dovetail/presence.js +1 -0
  43. package/dist/_app_/components/dovetail/sync-status.js +1 -0
  44. package/dist/_app_/components/dovetail/typing.js +1 -0
  45. package/dist/_app_/services/dovetail.js +1 -0
  46. package/dist/components/dovetail/avatar-stack.js +52 -0
  47. package/dist/components/dovetail/avatar-stack.js.map +1 -0
  48. package/dist/components/dovetail/connection-badge.js +43 -0
  49. package/dist/components/dovetail/connection-badge.js.map +1 -0
  50. package/dist/components/dovetail/dead-letters.js +47 -0
  51. package/dist/components/dovetail/dead-letters.js.map +1 -0
  52. package/dist/components/dovetail/editor.js +107 -0
  53. package/dist/components/dovetail/editor.js.map +1 -0
  54. package/dist/components/dovetail/live-cursors.js +46 -0
  55. package/dist/components/dovetail/live-cursors.js.map +1 -0
  56. package/dist/components/dovetail/presence.js +35 -0
  57. package/dist/components/dovetail/presence.js.map +1 -0
  58. package/dist/components/dovetail/sync-status.js +39 -0
  59. package/dist/components/dovetail/sync-status.js.map +1 -0
  60. package/dist/components/dovetail/typing.js +23 -0
  61. package/dist/components/dovetail/typing.js.map +1 -0
  62. package/dist/css.d.ts +2 -0
  63. package/dist/css.d.ts.map +1 -0
  64. package/dist/editor.js +2 -0
  65. package/dist/editor.js.map +1 -0
  66. package/dist/index.js +12 -0
  67. package/dist/index.js.map +1 -0
  68. package/dist/live-u5cQDrwU.js +93 -0
  69. package/dist/live-u5cQDrwU.js.map +1 -0
  70. package/dist/people-GBjAG7ZI.js +105 -0
  71. package/dist/people-GBjAG7ZI.js.map +1 -0
  72. package/dist/services/dovetail.js +233 -0
  73. package/dist/services/dovetail.js.map +1 -0
  74. package/dist/status-CYJBlnG7.js +59 -0
  75. package/dist/status-CYJBlnG7.js.map +1 -0
  76. package/dist/status-dot-DSQMdQhW.js +31 -0
  77. package/dist/status-dot-DSQMdQhW.js.map +1 -0
  78. package/dist/styles/editor.css +27 -0
  79. package/dist/visually-hidden-BFhJXHGu.js +10 -0
  80. package/dist/visually-hidden-BFhJXHGu.js.map +1 -0
  81. package/package.json +121 -3
@@ -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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ACrB,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAA;gBAGd,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC;IAenF,yFAAyF;IACzF,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAQzB"}
@@ -0,0 +1,51 @@
1
+ import type { PresencePointer, PresenceState, PresenceStatus } from '@dovetail-ts/core';
2
+ import type { JsonApiError, StoreOp } from '@dovetail-ts/protocol';
3
+ /** One person in a room. A user with more than one client (tabs) is one person. */
4
+ export interface Person {
5
+ id: string;
6
+ name: string;
7
+ color: string;
8
+ avatarUrl: string | undefined;
9
+ status: PresenceStatus;
10
+ /** True for the local user. */
11
+ self: boolean;
12
+ }
13
+ /** The color of a pointer when the color of the peer is not a hex color. */
14
+ export declare const FALLBACK_COLOR = "#6b7280";
15
+ /**
16
+ * `color` when it is a hex color (`#rgb`, `#rgba`, `#rrggbb` or `#rrggbbaa`, the rule of
17
+ * `isHexColor` of core), or else the fallback. A remote color goes into a style, so a value such
18
+ * as `url(...)` must not pass.
19
+ */
20
+ export declare function safeColor(color: unknown): string;
21
+ /**
22
+ * The default policy of the avatar URLs of the peers: an `https:` URL only. A relative URL
23
+ * (for example `/ann.png`) resolves against the page, so it passes on an `https:` page.
24
+ */
25
+ export declare function isSafeAvatarUrl(url: string): boolean;
26
+ /** The people that the avatar stack shows, and the people of the overflow count. */
27
+ export declare function people(state: PresenceState, options: {
28
+ max: number;
29
+ includeSelf: boolean;
30
+ /** True for an avatar URL that the page can load. The default is `isSafeAvatarUrl`. */
31
+ allowAvatarUrl?: (url: string) => boolean;
32
+ }): {
33
+ visible: Person[];
34
+ hidden: Person[];
35
+ };
36
+ /** The names of the peers that type, each user once. */
37
+ export declare function typingNames(state: PresenceState): string[];
38
+ /** The initials of a name: the first letter of the first two words. */
39
+ export declare function initials(name: string): string;
40
+ /** A pointer position as a fraction (0 to 1) of a box, so clients with other sizes agree. */
41
+ export declare function relativePointer(clientX: number, clientY: number, box: {
42
+ left: number;
43
+ top: number;
44
+ width: number;
45
+ height: number;
46
+ }): PresencePointer;
47
+ /** A short name of a write: `Save note 1`, `Delete note 2`. */
48
+ export declare function describeWrite(op: StoreOp): string;
49
+ /** Why the server refused a write: the detail or the title of the first error, or the status. */
50
+ export declare function describeError(status: number, errors: readonly JsonApiError[]): string;
51
+ //# sourceMappingURL=people.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"people.d.ts","sourceRoot":"","sources":["../src/people.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACvF,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAElE,mFAAmF;AACnF,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;IAC7B,MAAM,EAAE,cAAc,CAAA;IACtB,+BAA+B;IAC/B,IAAI,EAAE,OAAO,CAAA;CACd;AAED,4EAA4E;AAC5E,eAAO,MAAM,cAAc,YAAY,CAAA;AAEvC;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEhD;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAMpD;AAED,oFAAoF;AACpF,wBAAgB,MAAM,CACpB,KAAK,EAAE,aAAa,EACpB,OAAO,EAAE;IACP,GAAG,EAAE,MAAM,CAAA;IACX,WAAW,EAAE,OAAO,CAAA;IACpB,uFAAuF;IACvF,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAA;CAC1C,GACA;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAyBzC;AAED,wDAAwD;AACxD,wBAAgB,WAAW,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,EAAE,CAI1D;AAED,uEAAuE;AACvE,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAS7C;AAED,6FAA6F;AAC7F,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,GAAG,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAChE,eAAe,CAIjB;AAED,+DAA+D;AAC/D,wBAAgB,aAAa,CAAC,EAAE,EAAE,OAAO,GAAG,MAAM,CAKjD;AAED,iGAAiG;AACjG,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,YAAY,EAAE,GAAG,MAAM,CAGrF"}
@@ -0,0 +1,90 @@
1
+ import Service from '@ember/service';
2
+ import { Connection, SyncClient, WriteQueue } from '@dovetail-ts/core';
3
+ import type { ConnectionOptions, DeadLetter, LedgerError, PresenceRoomOptions, PresenceUser, StoreSink, SyncClientOptions } from '@dovetail-ts/core';
4
+ import type { DocEngine, DocStorage } from '@dovetail-ts/crdt';
5
+ import type { StoreOp } from '@dovetail-ts/protocol';
6
+ import type { ConnectionStatus } from '../status.ts';
7
+ import { LiveDoc, LivePresence } from '../live.ts';
8
+ /** The presence timings: the options of `PresenceRoom` without the room and the user. */
9
+ export type PresenceTimings = Pick<PresenceRoomOptions, 'clock' | 'awayAfter' | 'typingTimeout' | 'pointerThrottle'>;
10
+ /** What the host gives to `configure()`. */
11
+ export interface DovetailConfig {
12
+ /** Makes a new transport for each attempt: `() => new WebSocketTransport({ url })`. */
13
+ transport: ConnectionOptions['transport'];
14
+ /** The auth hook (ADR 0007). The connection calls it before each attempt. */
15
+ getToken?: ConnectionOptions['getToken'];
16
+ /** The local user, for presence and for the editor carets. */
17
+ user: PresenceUser;
18
+ /**
19
+ * Where the records of the store feed go: `storeSink(store)` of `@dovetail-ts/warp-drive`.
20
+ * Without it, the service has no sync client: no writes, no queue and no dead letters.
21
+ */
22
+ sink?: StoreSink;
23
+ /** The write queue. The default is a `WriteQueue` on the IndexedDB database `dbName`. */
24
+ queue?: WriteQueue;
25
+ /** Where the local doc updates wait. The default is IndexedDB, in the database `dbName`. */
26
+ docStorage?: DocStorage;
27
+ /** The name of the IndexedDB database. The default is `dovetail`. */
28
+ dbName?: string;
29
+ /** The other options of the connection: `network`, `clock`, `heartbeatInterval` and more. */
30
+ connection?: Omit<ConnectionOptions, 'transport' | 'getToken'>;
31
+ /** The other options of the sync client: `locks`, `channel`, `lockName` and more. */
32
+ sync?: Omit<SyncClientOptions, 'connection' | 'sink' | 'queue'>;
33
+ /** The timings of each presence room. */
34
+ presence?: PresenceTimings;
35
+ }
36
+ /** The options of `doc()`. */
37
+ export interface DocOptions {
38
+ /** The name of the document in the room. The default is `body`. */
39
+ doc?: string;
40
+ }
41
+ export default class DovetailService extends Service {
42
+ #private;
43
+ /** The state of the connection: `idle`, `connecting`, `open`, `reconnecting`, `offline` or `closed`. */
44
+ connectionState: string;
45
+ /** True when the device is online. */
46
+ online: boolean;
47
+ /** The number of writes in the queue. */
48
+ queued: number;
49
+ /** The writes that the server rejected. */
50
+ deadLetters: DeadLetter[];
51
+ /** The rejected local changes of this tab, which rolled back. */
52
+ errors: readonly LedgerError[];
53
+ connection: Connection | undefined;
54
+ sync: SyncClient | undefined;
55
+ /** The status that the components show: `online`, `connecting`, `reconnecting` or `offline`. */
56
+ get status(): ConnectionStatus;
57
+ /** The local user. */
58
+ get user(): PresenceUser;
59
+ /**
60
+ * Makes the connection and connects, then starts the sync client when there is a `sink`.
61
+ * Call it once, for example in the application route.
62
+ */
63
+ configure(config: DovetailConfig): Promise<void>;
64
+ /** Applies `op` at once, and puts it in the queue for `room`. Resolves with the id of the write. */
65
+ write(room: string, op: StoreOp): Promise<string>;
66
+ /** Sends a dead letter again. */
67
+ retry(id: string): Promise<void>;
68
+ /** Removes a dead letter and the writes that depend on it. Their changes roll back. */
69
+ discard(id: string): Promise<void>;
70
+ /** Puts the store feed of `room` in the store until `owner` is destroyed. */
71
+ subscribe(owner: object, room: string): void;
72
+ /**
73
+ * The presence of `room` until `owner` is destroyed. All owners of a room share one presence
74
+ * room. When a `doc()` of the room exists, the presence uses the awareness of its document,
75
+ * so call `doc()` first for a room with a document.
76
+ */
77
+ presence(owner: object, room: string): LivePresence;
78
+ /**
79
+ * A CRDT document of `room` (`engine.create()`), synced by a `DocSession` until `owner` is
80
+ * destroyed. The local updates wait in `docStorage` until the server has them.
81
+ */
82
+ doc(owner: object, room: string, engine: DocEngine, options?: DocOptions): LiveDoc;
83
+ willDestroy(): void;
84
+ }
85
+ declare module '@ember/service' {
86
+ interface Registry {
87
+ dovetail: DovetailService;
88
+ }
89
+ }
90
+ //# sourceMappingURL=dovetail.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dovetail.d.ts","sourceRoot":"","sources":["../../src/services/dovetail.ts"],"names":[],"mappings":"AAGA,OAAO,OAAO,MAAM,gBAAgB,CAAA;AAIpC,OAAO,EACL,UAAU,EAIV,UAAU,EACV,UAAU,EAEX,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EACV,iBAAiB,EACjB,UAAU,EAEV,WAAW,EACX,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,iBAAiB,EAClB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAEpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,YAA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AI,EAAE,UAAU,GAAG,SAAS,CAAA;IAS5B,gGAAgG;IAChG,IAAI,MAAM,IAAI,gBAAgB,CAE7B;IAED,sBAAsB;IACtB,IAAI,IAAI,IAAI,YAAY,CAEvB;IAED;;;OAGG;IACG,SAAS,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAkCtD,oGAAoG;IACpG,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAIjD,iCAAiC;IACjC,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIhC,uFAAuF;IACvF,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIlC,6EAA6E;IAC7E,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAI5C;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,YAAY;IAiBnD;;;OAGG;IACH,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAE,UAAe,GAAG,OAAO;IAwBtF,WAAW,IAAI,IAAI;CAsCpB;AAED,OAAO,QAAQ,gBAAgB,CAAC;IAC9B,UAAU,QAAQ;QAChB,QAAQ,EAAE,eAAe,CAAA;KAC1B;CACF"}
@@ -0,0 +1,16 @@
1
+ /** What the connection badge shows. */
2
+ export type ConnectionStatus = 'online' | 'connecting' | 'reconnecting' | 'offline';
3
+ /** The status of a connection state (`Connection.state.value`) and the online state of the device. */
4
+ export declare function connectionStatus(state: string, online: boolean): ConnectionStatus;
5
+ /** The text of the connection badge: `Online`, or `Offline · 3 queued`. */
6
+ export declare function connectionLabel(status: ConnectionStatus, queued: number): string;
7
+ /** What the sync status shows. */
8
+ export type SyncStatusState = 'saved' | 'syncing' | 'offline';
9
+ /** The state and the text of the sync status, from the connection status and the queued count. */
10
+ export declare function syncStatus(status: ConnectionStatus, queued: number): {
11
+ state: SyncStatusState;
12
+ text: string;
13
+ };
14
+ /** The text of the typing indicator: `Ana is typing`, `Ana and Ben are typing`, `3 people are typing`. */
15
+ export declare function typingText(names: readonly string[]): string;
16
+ //# sourceMappingURL=status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../src/status.ts"],"names":[],"mappings":"AAGA,uCAAuC;AACvC,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,YAAY,GAAG,cAAc,GAAG,SAAS,CAAA;AAEnF,sGAAsG;AACtG,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,gBAAgB,CAMjF;AASD,2EAA2E;AAC3E,wBAAgB,eAAe,CAAC,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAGhF;AAED,kCAAkC;AAClC,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAA;AAI7D,kGAAkG;AAClG,wBAAgB,UAAU,CACxB,MAAM,EAAE,gBAAgB,EACxB,MAAM,EAAE,MAAM,GACb;IAAE,KAAK,EAAE,eAAe,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAU1C;AAED,0GAA0G;AAC1G,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAK3D"}
@@ -0,0 +1 @@
1
+ export { default } from "@dovetail-ts/ember/components/dovetail/avatar-stack";
@@ -0,0 +1 @@
1
+ export { default } from "@dovetail-ts/ember/components/dovetail/connection-badge";
@@ -0,0 +1 @@
1
+ export { default } from "@dovetail-ts/ember/components/dovetail/dead-letters";
@@ -0,0 +1 @@
1
+ export { default } from "@dovetail-ts/ember/components/dovetail/editor";
@@ -0,0 +1 @@
1
+ export { default } from "@dovetail-ts/ember/components/dovetail/live-cursors";
@@ -0,0 +1 @@
1
+ export { default } from "@dovetail-ts/ember/components/dovetail/presence";
@@ -0,0 +1 @@
1
+ export { default } from "@dovetail-ts/ember/components/dovetail/sync-status";
@@ -0,0 +1 @@
1
+ export { default } from "@dovetail-ts/ember/components/dovetail/typing";
@@ -0,0 +1 @@
1
+ export { default } from "@dovetail-ts/ember/services/dovetail";
@@ -0,0 +1,52 @@
1
+ import Component from '@glimmer/component';
2
+ import { htmlSafe } from '@ember/template';
3
+ import { Avatar, Tooltip, AvatarGroup } from '@ember-joinery/ember';
4
+ import { p as people, i as initials } from '../../people-GBjAG7ZI.js';
5
+ import { d as dotColor } from '../../status-dot-DSQMdQhW.js';
6
+ import { V as VISUALLY_HIDDEN } from '../../visually-hidden-BFhJXHGu.js';
7
+ import { precompileTemplate } from '@ember/template-compilation';
8
+ import { setComponentTemplate } from '@ember/component';
9
+
10
+ const displayName = person => person.self ? `${person.name} (you)` : person.name;
11
+ const label = person => `${displayName(person)}, ${person.status}`;
12
+ // The trigger is a button, so each avatar takes the keyboard focus. The button has no style of
13
+ // its own; the outline of the focus stays.
14
+ const TRIGGER_STYLE = htmlSafe('padding: 0; border: 0; background: none; border-radius: 9999px');
15
+ /**
16
+ * The people in a room: an avatar for each user, with a dot for the status (online or away),
17
+ * and a count of the others after `@max`. The name shows on hover and on focus.
18
+ */
19
+ class AvatarStack extends Component {
20
+ get list() {
21
+ return people(this.args.presence.state, {
22
+ max: this.args.max ?? 5,
23
+ includeSelf: this.args.includeSelf ?? true,
24
+ ...(this.args.allowAvatarUrl ? {
25
+ allowAvatarUrl: this.args.allowAvatarUrl
26
+ } : {})
27
+ });
28
+ }
29
+ get overflowLabel() {
30
+ const names = this.list.hidden.map(displayName).join(', ');
31
+ return `${this.list.hidden.length} more: ${names}`;
32
+ }
33
+ static {
34
+ setComponentTemplate(precompileTemplate("<div role=\"group\" aria-label=\"People in this room\" data-test-dovetail-avatar-stack data-state={{if this.list.visible.length \"present\" \"empty\"}} data-overflow={{this.list.hidden.length}} ...attributes>\n <AvatarGroup as |g|>\n {{#each this.list.visible key=\"id\" as |person|}}\n <Tooltip as |t|>\n <t.Trigger type=\"button\" data-test-dovetail-avatar data-name={{person.name}} data-status={{person.status}} data-avatar-url={{person.avatarUrl}} style={{TRIGGER_STYLE}}>\n {{!-- The name and the status are the text of the button, so the name that a\n screen reader reads and the text are the same. --}}\n <span style={{VISUALLY_HIDDEN}} data-test-dovetail-avatar-label>{{label person}}</span>\n <Avatar aria-hidden=\"true\" as |a|>\n {{#if person.avatarUrl}}\n <a.Image @src={{person.avatarUrl}} alt />\n {{/if}}\n <a.Fallback style=\"color: var(--foreground)\">{{initials person.name}}</a.Fallback>\n <a.Badge style={{dotColor person.status}} />\n </Avatar>\n </t.Trigger>\n <t.Content data-test-dovetail-avatar-tooltip>{{displayName person}}</t.Content>\n </Tooltip>\n {{/each}}\n {{#if this.list.hidden.length}}\n <g.Count role=\"img\" style=\"color: var(--foreground)\" aria-label={{this.overflowLabel}} title={{this.overflowLabel}}>\n +{{this.list.hidden.length}}\n </g.Count>\n {{/if}}\n </AvatarGroup>\n</div>", {
35
+ strictMode: true,
36
+ scope: () => ({
37
+ AvatarGroup,
38
+ Tooltip,
39
+ TRIGGER_STYLE,
40
+ VISUALLY_HIDDEN,
41
+ label,
42
+ Avatar,
43
+ initials,
44
+ dotColor,
45
+ displayName
46
+ })
47
+ }), this);
48
+ }
49
+ }
50
+
51
+ export { AvatarStack as default };
52
+ //# sourceMappingURL=avatar-stack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"avatar-stack.js","sources":["../../../src/components/dovetail/avatar-stack.gts"],"sourcesContent":["import Component from '@glimmer/component'\nimport { htmlSafe } from '@ember/template'\nimport { Avatar, AvatarGroup, Tooltip } from '@ember-joinery/ember'\nimport type { PresenceSource } from '../../live.ts'\nimport { initials, people } from '../../people.ts'\nimport type { Person } from '../../people.ts'\nimport { dotColor } from '../../-private/status-dot.gts'\nimport { VISUALLY_HIDDEN } from '../../-private/visually-hidden.ts'\n\nexport interface AvatarStackSignature {\n Args: {\n /** The presence of the room: a yield of `<Dovetail::Presence>`, or any `PresenceSource`. */\n presence: PresenceSource\n /** The most avatars to show. A count shows the others. The default is 5. */\n max?: number\n /** Shows the local user first. The default is true. */\n includeSelf?: boolean\n /**\n * True for an avatar URL of a peer that the page can load. The default allows an `https:`\n * URL only (a relative URL on an `https:` page too). An avatar with a refused URL shows the initials.\n */\n allowAvatarUrl?: (url: string) => boolean\n }\n Element: HTMLDivElement\n}\n\nconst displayName = (person: Person) => (person.self ? `${person.name} (you)` : person.name)\nconst label = (person: Person) => `${displayName(person)}, ${person.status}`\n\n// The trigger is a button, so each avatar takes the keyboard focus. The button has no style of\n// its own; the outline of the focus stays.\nconst TRIGGER_STYLE = htmlSafe('padding: 0; border: 0; background: none; border-radius: 9999px')\n\n/**\n * The people in a room: an avatar for each user, with a dot for the status (online or away),\n * and a count of the others after `@max`. The name shows on hover and on focus.\n */\nexport default class AvatarStack extends Component<AvatarStackSignature> {\n get list() {\n return people(this.args.presence.state, {\n max: this.args.max ?? 5,\n includeSelf: this.args.includeSelf ?? true,\n ...(this.args.allowAvatarUrl ? { allowAvatarUrl: this.args.allowAvatarUrl } : {}),\n })\n }\n\n get overflowLabel(): string {\n const names = this.list.hidden.map(displayName).join(', ')\n return `${this.list.hidden.length} more: ${names}`\n }\n\n <template>\n <div\n role='group'\n aria-label='People in this room'\n data-test-dovetail-avatar-stack\n data-state={{if this.list.visible.length 'present' 'empty'}}\n data-overflow={{this.list.hidden.length}}\n ...attributes\n >\n <AvatarGroup as |g|>\n {{#each this.list.visible key='id' as |person|}}\n <Tooltip as |t|>\n <t.Trigger\n type='button'\n data-test-dovetail-avatar\n data-name={{person.name}}\n data-status={{person.status}}\n data-avatar-url={{person.avatarUrl}}\n style={{TRIGGER_STYLE}}\n >\n {{! The name and the status are the text of the button, so the name that a\n screen reader reads and the text are the same. }}\n <span style={{VISUALLY_HIDDEN}} data-test-dovetail-avatar-label>{{label\n person\n }}</span>\n <Avatar aria-hidden='true' as |a|>\n {{#if person.avatarUrl}}\n <a.Image @src={{person.avatarUrl}} alt='' />\n {{/if}}\n <a.Fallback style='color: var(--foreground)'>{{initials person.name}}</a.Fallback>\n <a.Badge style={{dotColor person.status}} />\n </Avatar>\n </t.Trigger>\n <t.Content data-test-dovetail-avatar-tooltip>{{displayName person}}</t.Content>\n </Tooltip>\n {{/each}}\n {{#if this.list.hidden.length}}\n <g.Count\n role='img'\n style='color: var(--foreground)'\n aria-label={{this.overflowLabel}}\n title={{this.overflowLabel}}\n >\n +{{this.list.hidden.length}}\n </g.Count>\n {{/if}}\n </AvatarGroup>\n </div>\n </template>\n}\n"],"names":["displayName","person","self","name","label","status","TRIGGER_STYLE","htmlSafe","AvatarStack","Component","list","people","args","presence","state","max","includeSelf","allowAvatarUrl","overflowLabel","names","hidden","map","join","length","setComponentTemplate","precompileTemplate","strictMode","scope","AvatarGroup","Tooltip","VISUALLY_HIDDEN","Avatar","initials","dotColor"],"mappings":";;;;;;;;;AA0BA,MAAMA,cAAeC,MAAQ,IAAYA,OAAOC,IAAI,GAAG,CAAA,EAAGD,MAAA,CAAOE,IAAI,CAAA,MAAA,CAAQ,GAAGF,OAAOE,IAAI;AAC3F,MAAMC,KAAA,GAASH,MAAQ,IAAW,CAAA,EAAGD,WAAA,CAAYC,MAAA,CAAA,CAAA,EAAA,EAAYA,MAAA,CAAOI,MAAM,CAAA,CAAE;AAE5E;AACA;AACA,MAAMC,gBAAgBC,QAAA,CAAS,gEAAA,CAAA;AAE/B;;;;AAIe,MAAMC,WAAA,SAAoBC,SAAA,CAAU;EACjD,IAAIC,IAAAA,GAAO;IACT,OAAOC,MAAA,CAAO,IAAI,CAACC,IAAI,CAACC,QAAQ,CAACC,KAAK,EAAE;AACtCC,MAAAA,GAAA,EAAK,IAAI,CAACH,IAAI,CAACG,GAAG,IAAI,CAAA;AACtBC,MAAAA,WAAA,EAAa,IAAI,CAACJ,IAAI,CAACI,WAAW,IAAI,IAAA;AACtC,MAAA,IAAI,IAAI,CAACJ,IAAI,CAACK,cAAc,GAAG;AAAEA,QAAAA,cAAA,EAAgB,IAAI,CAACL,IAAI,CAACK;OAAe,GAAI,EAAE;AAClF,KAAA,CAAA;AACF,EAAA;EAEA,IAAIC,aAAAA,GAAwB;AAC1B,IAAA,MAAMC,KAAA,GAAQ,IAAI,CAACT,IAAI,CAACU,MAAM,CAACC,GAAG,CAACrB,WAAA,CAAA,CAAasB,IAAI,CAAC,IAAA,CAAA;IACrD,OAAO,CAAA,EAAG,IAAI,CAACZ,IAAI,CAACU,MAAM,CAACG,MAAM,CAAA,OAAA,EAAUJ,KAAA,CAAA,CAAO;AACpD,EAAA;AAEA,EAAA;IAAAK,oBAAA,CAAAC,kBAAA,CAAA,q9CAAA,EAgDA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,WAAA;QAAAC,OAAA;QAAAvB,aAAA;QAAAwB,eAAA;QAAA1B,KAAA;QAAA2B,MAAA;QAAAC,QAAA;QAAAC,QAAA;AAAAjC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
@@ -0,0 +1,43 @@
1
+ import Component from '@glimmer/component';
2
+ import { service } from '@ember/service';
3
+ import { Badge } from '@ember-joinery/ember';
4
+ import { c as connectionLabel } from '../../status-CYJBlnG7.js';
5
+ import { S as StatusDot } from '../../status-dot-DSQMdQhW.js';
6
+ import { precompileTemplate } from '@ember/template-compilation';
7
+ import { setComponentTemplate } from '@ember/component';
8
+ import { g, i } from 'decorator-transforms/runtime';
9
+
10
+ /**
11
+ * The state of the connection, and the count of queued writes: `Online`, `Reconnecting` or
12
+ * `Offline · 3 queued`. It is a live region, so a screen reader reads each change.
13
+ */
14
+ class ConnectionBadge extends Component {
15
+ static {
16
+ g(this.prototype, "dovetail", [service('dovetail')]);
17
+ }
18
+ #dovetail = (i(this, "dovetail"), void 0);
19
+ get state() {
20
+ return this.args.state ?? this.dovetail.status;
21
+ }
22
+ get queued() {
23
+ return this.args.queued ?? this.dovetail.queued;
24
+ }
25
+ get label() {
26
+ return connectionLabel(this.state, this.queued);
27
+ }
28
+ get variant() {
29
+ return this.state === 'online' ? 'secondary' : 'outline';
30
+ }
31
+ static {
32
+ setComponentTemplate(precompileTemplate("<Badge @variant={{this.variant}} role=\"status\" data-test-dovetail-connection-badge data-state={{this.state}} data-queued={{this.queued}} ...attributes>\n <StatusDot @status={{this.state}} />\n {{this.label}}\n</Badge>", {
33
+ strictMode: true,
34
+ scope: () => ({
35
+ Badge,
36
+ StatusDot
37
+ })
38
+ }), this);
39
+ }
40
+ }
41
+
42
+ export { ConnectionBadge as default };
43
+ //# sourceMappingURL=connection-badge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection-badge.js","sources":["../../../src/components/dovetail/connection-badge.gts"],"sourcesContent":["import Component from '@glimmer/component'\nimport { service } from '@ember/service'\nimport { Badge } from '@ember-joinery/ember'\nimport type DovetailService from '../../services/dovetail.ts'\nimport { connectionLabel } from '../../status.ts'\nimport type { ConnectionStatus } from '../../status.ts'\nimport StatusDot from '../../-private/status-dot.gts'\n\nexport interface ConnectionBadgeSignature {\n Args: {\n /** The status to show. The default is the status of the `dovetail` service. */\n state?: ConnectionStatus\n /** The count of queued writes. The default is the count of the `dovetail` service. */\n queued?: number\n }\n Element: HTMLElement\n}\n\n/**\n * The state of the connection, and the count of queued writes: `Online`, `Reconnecting` or\n * `Offline · 3 queued`. It is a live region, so a screen reader reads each change.\n */\nexport default class ConnectionBadge extends Component<ConnectionBadgeSignature> {\n @service('dovetail') declare dovetail: DovetailService\n\n get state(): ConnectionStatus {\n return this.args.state ?? this.dovetail.status\n }\n\n get queued(): number {\n return this.args.queued ?? this.dovetail.queued\n }\n\n get label(): string {\n return connectionLabel(this.state, this.queued)\n }\n\n get variant() {\n return this.state === 'online' ? 'secondary' : 'outline'\n }\n\n <template>\n <Badge\n @variant={{this.variant}}\n role='status'\n data-test-dovetail-connection-badge\n data-state={{this.state}}\n data-queued={{this.queued}}\n ...attributes\n >\n <StatusDot @status={{this.state}} />\n {{this.label}}\n </Badge>\n </template>\n}\n"],"names":["ConnectionBadge","Component","g","prototype","service","i","state","args","dovetail","status","queued","label","connectionLabel","variant","setComponentTemplate","precompileTemplate","strictMode","scope","Badge","StatusDot"],"mappings":";;;;;;;;;AAkBA;;;;AAIe,MAAMA,eAAA,SAAwBC,SAAA,CAAU;AAAA,EAAA;AAAAC,IAAAA,CAAA,MAAAC,SAAA,EAAA,UAAA,EAAA,CACpDC,OAAA,CAAQ,UAAA,CAAA,CAAA,CAAA;AAAA;EAAA,SAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,UAAA,CAAA,EAAA,MAAA;EAET,IAAIC,QAA0B;IAC5B,OAAO,IAAI,CAACC,IAAI,CAACD,KAAK,IAAI,IAAI,CAACE,QAAQ,CAACC,MAAM;AAChD,EAAA;EAEA,IAAIC,MAAAA,GAAiB;IACnB,OAAO,IAAI,CAACH,IAAI,CAACG,MAAM,IAAI,IAAI,CAACF,QAAQ,CAACE,MAAM;AACjD,EAAA;EAEA,IAAIC,KAAAA,GAAgB;IAClB,OAAOC,gBAAgB,IAAI,CAACN,KAAK,EAAE,IAAI,CAACI,MAAM,CAAA;AAChD,EAAA;EAEA,IAAIG,OAAAA,GAAU;IACZ,OAAO,IAAI,CAACP,KAAK,KAAK,WAAW,WAAA,GAAc,SAAA;AACjD,EAAA;AAEA,EAAA;IAAAQ,oBAAA,CAAAC,kBAAA,CAAA,+NAAA,EAYA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,KAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
@@ -0,0 +1,47 @@
1
+ import Component from '@glimmer/component';
2
+ import { service } from '@ember/service';
3
+ import { fn } from '@ember/helper';
4
+ import { on } from '@ember/modifier';
5
+ import { Empty, Button, Item, ItemGroup } from '@ember-joinery/ember';
6
+ import { d as describeError, a as describeWrite } from '../../people-GBjAG7ZI.js';
7
+ import { V as VISUALLY_HIDDEN } from '../../visually-hidden-BFhJXHGu.js';
8
+ import { precompileTemplate } from '@ember/template-compilation';
9
+ import { setComponentTemplate } from '@ember/component';
10
+ import { g, i } from 'decorator-transforms/runtime';
11
+
12
+ const summary = count => count === 0 ? '' : count === 1 ? '1 change failed' : `${count} changes failed`;
13
+ /**
14
+ * The writes that the server refused, each with the reason, a Retry button and a Discard
15
+ * button. A discard rolls the change back. A hidden live region says the count.
16
+ */
17
+ class DeadLetters extends Component {
18
+ static {
19
+ g(this.prototype, "dovetail", [service('dovetail')]);
20
+ }
21
+ #dovetail = (i(this, "dovetail"), void 0);
22
+ get letters() {
23
+ return this.args.deadLetters ?? this.dovetail.deadLetters;
24
+ }
25
+ retry = id => void (this.args.onRetry ?? (i => this.dovetail.retry(i)))(id);
26
+ discard = id => void (this.args.onDiscard ?? (i => this.dovetail.discard(i)))(id);
27
+ static {
28
+ setComponentTemplate(precompileTemplate("<section aria-label=\"Failed changes\" data-test-dovetail-dead-letters data-state={{if this.letters.length \"failed\" \"empty\"}} ...attributes>\n <p role=\"status\" style={{VISUALLY_HIDDEN}} data-test-dovetail-dead-letters-summary>{{summary this.letters.length}}</p>\n {{#if this.letters.length}}\n <ItemGroup>\n {{#each this.letters key=\"id\" as |letter|}}\n <Item role=\"listitem\" @variant=\"outline\" @size=\"sm\" as |i|>\n <i.Content>\n <i.Title data-test-dovetail-dead-letter-title>{{describeWrite letter.op}}</i.Title>\n <i.Description data-test-dovetail-dead-letter-reason>\n {{describeError letter.status letter.errors}}\n </i.Description>\n </i.Content>\n <i.Actions>\n <Button @variant=\"outline\" @size=\"sm\" type=\"button\" data-test-dovetail-retry {{on \"click\" (fn this.retry letter.id)}}>Retry</Button>\n <Button @variant=\"ghost\" @size=\"sm\" type=\"button\" data-test-dovetail-discard {{on \"click\" (fn this.discard letter.id)}}>Discard</Button>\n </i.Actions>\n </Item>\n {{/each}}\n </ItemGroup>\n {{else}}\n <Empty as |e|>\n <e.Header>\n <e.Title>No failed changes</e.Title>\n <e.Description>The server accepted each change.</e.Description>\n </e.Header>\n </Empty>\n {{/if}}\n</section>", {
29
+ strictMode: true,
30
+ scope: () => ({
31
+ VISUALLY_HIDDEN,
32
+ summary,
33
+ ItemGroup,
34
+ Item,
35
+ describeWrite,
36
+ describeError,
37
+ Button,
38
+ on,
39
+ fn,
40
+ Empty
41
+ })
42
+ }), this);
43
+ }
44
+ }
45
+
46
+ export { DeadLetters as default };
47
+ //# sourceMappingURL=dead-letters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dead-letters.js","sources":["../../../src/components/dovetail/dead-letters.gts"],"sourcesContent":["import Component from '@glimmer/component'\nimport { service } from '@ember/service'\nimport { fn } from '@ember/helper'\nimport { on } from '@ember/modifier'\nimport { Button, Empty, Item, ItemGroup } from '@ember-joinery/ember'\nimport type { DeadLetter } from '@dovetail-ts/core'\nimport type DovetailService from '../../services/dovetail.ts'\nimport { describeError, describeWrite } from '../../people.ts'\nimport { VISUALLY_HIDDEN } from '../../-private/visually-hidden.ts'\n\nexport interface DeadLettersSignature {\n Args: {\n /** The refused writes. The default is the dead letters of the `dovetail` service. */\n deadLetters?: readonly DeadLetter[]\n /** Called with the id of a write on Retry. The default is `dovetail.retry(id)`. */\n onRetry?: (id: string) => unknown\n /** Called with the id of a write on Discard. The default is `dovetail.discard(id)`. */\n onDiscard?: (id: string) => unknown\n }\n Element: HTMLElement\n}\n\nconst summary = (count: number) =>\n count === 0 ? '' : count === 1 ? '1 change failed' : `${count} changes failed`\n\n/**\n * The writes that the server refused, each with the reason, a Retry button and a Discard\n * button. A discard rolls the change back. A hidden live region says the count.\n */\nexport default class DeadLetters extends Component<DeadLettersSignature> {\n @service('dovetail') declare dovetail: DovetailService\n\n get letters(): readonly DeadLetter[] {\n return this.args.deadLetters ?? this.dovetail.deadLetters\n }\n\n retry = (id: string) => void (this.args.onRetry ?? (i => this.dovetail.retry(i)))(id)\n\n discard = (id: string) => void (this.args.onDiscard ?? (i => this.dovetail.discard(i)))(id)\n\n <template>\n <section\n aria-label='Failed changes'\n data-test-dovetail-dead-letters\n data-state={{if this.letters.length 'failed' 'empty'}}\n ...attributes\n >\n <p role='status' style={{VISUALLY_HIDDEN}} data-test-dovetail-dead-letters-summary>{{summary\n this.letters.length\n }}</p>\n {{#if this.letters.length}}\n <ItemGroup>\n {{#each this.letters key='id' as |letter|}}\n <Item role='listitem' @variant='outline' @size='sm' as |i|>\n <i.Content>\n <i.Title data-test-dovetail-dead-letter-title>{{describeWrite letter.op}}</i.Title>\n <i.Description data-test-dovetail-dead-letter-reason>\n {{describeError letter.status letter.errors}}\n </i.Description>\n </i.Content>\n <i.Actions>\n <Button\n @variant='outline'\n @size='sm'\n type='button'\n data-test-dovetail-retry\n {{on 'click' (fn this.retry letter.id)}}\n >Retry</Button>\n <Button\n @variant='ghost'\n @size='sm'\n type='button'\n data-test-dovetail-discard\n {{on 'click' (fn this.discard letter.id)}}\n >Discard</Button>\n </i.Actions>\n </Item>\n {{/each}}\n </ItemGroup>\n {{else}}\n <Empty as |e|>\n <e.Header>\n <e.Title>No failed changes</e.Title>\n <e.Description>The server accepted each change.</e.Description>\n </e.Header>\n </Empty>\n {{/if}}\n </section>\n </template>\n}\n"],"names":["summary","count","DeadLetters","Component","g","prototype","service","i","letters","args","deadLetters","dovetail","retry","id","onRetry","discard","onDiscard","setComponentTemplate","precompileTemplate","strictMode","scope","VISUALLY_HIDDEN","ItemGroup","Item","describeWrite","describeError","Button","on","fn","Empty"],"mappings":";;;;;;;;;;;AAsBA,MAAMA,OAAA,GAAWC,KAAa,IAC5BA,KAAA,KAAU,CAAA,GAAI,EAAA,GAAKA,KAAA,KAAU,CAAA,GAAI,iBAAA,GAAoB,CAAA,EAAGA,KAAA,CAAA,eAAA,CAAsB;AAEhF;;;;AAIe,MAAMC,WAAA,SAAoBC,SAAA,CAAU;AAAA,EAAA;AAAAC,IAAAA,CAAA,MAAAC,SAAA,EAAA,UAAA,EAAA,CAChDC,OAAA,CAAQ,UAAA,CAAA,CAAA,CAAA;AAAA;EAAA,SAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,UAAA,CAAA,EAAA,MAAA;EAET,IAAIC,UAAiC;IACnC,OAAO,IAAI,CAACC,IAAI,CAACC,WAAW,IAAI,IAAI,CAACC,QAAQ,CAACD,WAAW;AAC3D,EAAA;EAEAE,KAAA,GAASC,EAAU,IAAK,KAAK,CAAC,IAAI,CAACJ,IAAI,CAACK,OAAO,KAAKP,CAAA,IAAK,IAAI,CAACI,QAAQ,CAACC,KAAK,CAACL,CAAA,CAAE,CAAC,EAAEM,EAAA,CAAA;EAElFE,OAAA,GAAWF,EAAU,IAAK,KAAK,CAAC,IAAI,CAACJ,IAAI,CAACO,SAAS,KAAKT,CAAA,IAAK,IAAI,CAACI,QAAQ,CAACI,OAAO,CAACR,CAAA,CAAE,CAAC,EAAEM,EAAA,CAAA;AAExF,EAAA;IAAAI,oBAAA,CAAAC,kBAAA,CAAA,w2CAAA,EAgDA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,eAAA;QAAArB,OAAA;QAAAsB,SAAA;QAAAC,IAAA;QAAAC,aAAA;QAAAC,aAAA;QAAAC,MAAA;QAAAC,EAAA;QAAAC,EAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
@@ -0,0 +1,107 @@
1
+ import "./../../styles/editor.css"
2
+ import Component from '@glimmer/component';
3
+ import { service } from '@ember/service';
4
+ import { hash } from '@ember/helper';
5
+ import { registerDestructor } from '@ember/destroyable';
6
+ import { modifier } from 'ember-modifier';
7
+ import { Editor as Editor$1 } from '@tiptap/core';
8
+ import StarterKit from '@tiptap/starter-kit';
9
+ import { PresenceRoom } from '@dovetail-ts/core';
10
+ import { yjsEngine } from '@dovetail-ts/crdt-yjs';
11
+ import { createDovetail } from '@dovetail-ts/tiptap';
12
+ import { yjsBinding } from '@dovetail-ts/tiptap/yjs';
13
+ import { L as LivePresence } from '../../live-u5cQDrwU.js';
14
+ import { precompileTemplate } from '@ember/template-compilation';
15
+ import { setComponentTemplate } from '@ember/component';
16
+ import { g, i } from 'decorator-transforms/runtime';
17
+
18
+ ;
19
+
20
+ /**
21
+ * A Tiptap editor that co-edits one document of a room through a `DocSession`, and shows the
22
+ * carets of the peers. It yields the presence of the room (for an avatar stack) and the
23
+ * Dovetail features of the editor: `features.threads` and `features.versions`.
24
+ */
25
+ class Editor extends Component {
26
+ static {
27
+ g(this.prototype, "dovetail", [service('dovetail')]);
28
+ }
29
+ #dovetail = (i(this, "dovetail"), void 0);
30
+ features;
31
+ doc;
32
+ presence;
33
+ user;
34
+ constructor(owner, args) {
35
+ super(owner, args);
36
+ if (args.doc) {
37
+ if (!args.user) throw new Error('Dovetail: <Editor @doc> needs a @user.');
38
+ this.doc = args.doc;
39
+ this.user = args.user;
40
+ const presence = new LivePresence(args.doc.room, new PresenceRoom({
41
+ user: args.user,
42
+ awareness: args.doc.handle.awareness
43
+ }));
44
+ registerDestructor(this, () => presence.destroy());
45
+ this.presence = presence;
46
+ } else {
47
+ if (!args.room) throw new Error('Dovetail: give <Editor> a @room or a @doc.');
48
+ // The doc first: then the presence of the room uses the awareness of the document.
49
+ this.doc = this.dovetail.doc(this, args.room, args.engine ?? yjsEngine());
50
+ this.presence = this.dovetail.presence(this, args.room);
51
+ this.user = args.user ?? this.dovetail.user;
52
+ }
53
+ const {
54
+ id,
55
+ name,
56
+ color
57
+ } = this.user;
58
+ this.features = createDovetail({
59
+ handle: this.doc.handle,
60
+ binding: args.binding ?? yjsBinding,
61
+ user: {
62
+ id,
63
+ name,
64
+ color
65
+ }
66
+ });
67
+ }
68
+ /** `loading` until the session starts, then `syncing` or `synced`. */
69
+ get state() {
70
+ if (!this.doc.started) return 'loading';
71
+ return this.doc.synced ? 'synced' : 'syncing';
72
+ }
73
+ /** The names of the peers with a caret in the document (the `cursor` field of Tiptap). */
74
+ get carets() {
75
+ return this.presence.state.peers.filter(peer => peer.extra['cursor'] != null).map(peer => peer.user.name).join(', ');
76
+ }
77
+ mount = modifier(element => {
78
+ const editor = new Editor$1({
79
+ element,
80
+ // The CRDT has its own undo, so the undo of StarterKit is off.
81
+ extensions: [StarterKit.configure({
82
+ undoRedo: false
83
+ }), this.features.extension],
84
+ editorProps: {
85
+ attributes: {
86
+ role: 'textbox',
87
+ 'aria-multiline': 'true',
88
+ 'aria-label': this.args.label ?? 'Document',
89
+ 'data-test-dovetail-editor-content': '',
90
+ style: 'min-block-size: 6rem; padding: 0.5rem 0.75rem; outline-offset: 2px'
91
+ }
92
+ }
93
+ });
94
+ return () => editor.destroy();
95
+ });
96
+ static {
97
+ setComponentTemplate(precompileTemplate("<div data-test-dovetail-editor data-state={{this.state}} data-carets={{this.carets}} style=\"border: 1px solid var(--border); border-radius: var(--radius); background: var(--background); color: var(--foreground)\" ...attributes>\n {{!-- The editor starts with the session. An edit before it is not lost (DocSession keeps it),\n but an editor that mounts before the session makes the caret of the peers flaky (ADR 0020). --}}\n {{#if this.doc.started}}\n <div {{this.mount}}></div>\n {{/if}}\n {{yield (hash presence=this.presence features=this.features)}}\n</div>", {
98
+ strictMode: true,
99
+ scope: () => ({
100
+ hash
101
+ })
102
+ }), this);
103
+ }
104
+ }
105
+
106
+ export { Editor as default };
107
+ //# sourceMappingURL=editor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor.js","sources":["../../../src/components/dovetail/editor.gts"],"sourcesContent":["import Component from '@glimmer/component'\nimport { service } from '@ember/service'\nimport { hash } from '@ember/helper'\nimport { registerDestructor } from '@ember/destroyable'\nimport type Owner from '@ember/owner'\nimport { modifier } from 'ember-modifier'\nimport { Editor as TiptapEditor } from '@tiptap/core'\nimport StarterKit from '@tiptap/starter-kit'\nimport { PresenceRoom } from '@dovetail-ts/core'\nimport type { PresenceUser } from '@dovetail-ts/core'\nimport type { DocEngine } from '@dovetail-ts/crdt'\nimport { yjsEngine } from '@dovetail-ts/crdt-yjs'\nimport { createDovetail } from '@dovetail-ts/tiptap'\nimport type { Dovetail, EditorBinding } from '@dovetail-ts/tiptap'\nimport { yjsBinding } from '@dovetail-ts/tiptap/yjs'\nimport type DovetailService from '../../services/dovetail.ts'\nimport { LivePresence } from '../../live.ts'\nimport '../../styles/editor.css'\nimport type { LiveDoc } from '../../live.ts'\n\nexport interface EditorSignature {\n Args: {\n /** The room of the document. The editor gets the document from the `dovetail` service. */\n room?: string\n /** The engine of the document of `@room`. The default is the Yjs engine. */\n engine?: DocEngine\n /** A document of your own, in place of `@room`: for a second connection, or a story. */\n doc?: LiveDoc\n /** The local user of the carets. The default is the user of the `dovetail` service. */\n user?: PresenceUser\n /** The binding of the engine. The default is `yjsBinding`. */\n binding?: EditorBinding\n /** The accessible name of the text box. The default is `Document`. */\n label?: string\n }\n Blocks: {\n /** The presence of the room, and the features of the editor: threads, versions, undo. */\n default: [{ presence: LivePresence; features: Dovetail }]\n }\n Element: HTMLDivElement\n}\n\n/**\n * A Tiptap editor that co-edits one document of a room through a `DocSession`, and shows the\n * carets of the peers. It yields the presence of the room (for an avatar stack) and the\n * Dovetail features of the editor: `features.threads` and `features.versions`.\n */\nexport default class Editor extends Component<EditorSignature> {\n @service('dovetail') declare dovetail: DovetailService\n readonly features: Dovetail\n readonly doc: LiveDoc\n readonly presence: LivePresence\n readonly user: PresenceUser\n\n constructor(owner: Owner, args: EditorSignature['Args']) {\n super(owner, args)\n if (args.doc) {\n if (!args.user) throw new Error('Dovetail: <Editor @doc> needs a @user.')\n this.doc = args.doc\n this.user = args.user\n const presence = new LivePresence(\n args.doc.room,\n new PresenceRoom({ user: args.user, awareness: args.doc.handle.awareness }),\n )\n registerDestructor(this, () => presence.destroy())\n this.presence = presence\n } else {\n if (!args.room) throw new Error('Dovetail: give <Editor> a @room or a @doc.')\n // The doc first: then the presence of the room uses the awareness of the document.\n this.doc = this.dovetail.doc(this, args.room, args.engine ?? yjsEngine())\n this.presence = this.dovetail.presence(this, args.room)\n this.user = args.user ?? this.dovetail.user\n }\n const { id, name, color } = this.user\n this.features = createDovetail({\n handle: this.doc.handle,\n binding: args.binding ?? yjsBinding,\n user: { id, name, color },\n })\n }\n\n /** `loading` until the session starts, then `syncing` or `synced`. */\n get state(): string {\n if (!this.doc.started) return 'loading'\n return this.doc.synced ? 'synced' : 'syncing'\n }\n\n /** The names of the peers with a caret in the document (the `cursor` field of Tiptap). */\n get carets(): string {\n return this.presence.state.peers\n .filter(peer => peer.extra['cursor'] != null)\n .map(peer => peer.user.name)\n .join(', ')\n }\n\n mount = modifier((element: HTMLElement) => {\n const editor = new TiptapEditor({\n element,\n // The CRDT has its own undo, so the undo of StarterKit is off.\n extensions: [StarterKit.configure({ undoRedo: false }), this.features.extension],\n editorProps: {\n attributes: {\n role: 'textbox',\n 'aria-multiline': 'true',\n 'aria-label': this.args.label ?? 'Document',\n 'data-test-dovetail-editor-content': '',\n style: 'min-block-size: 6rem; padding: 0.5rem 0.75rem; outline-offset: 2px',\n },\n },\n })\n return () => editor.destroy()\n })\n\n <template>\n <div\n data-test-dovetail-editor\n data-state={{this.state}}\n data-carets={{this.carets}}\n style='border: 1px solid var(--border); border-radius: var(--radius); background: var(--background); color: var(--foreground)'\n ...attributes\n >\n {{! The editor starts with the session. An edit before it is not lost (DocSession keeps it),\n but an editor that mounts before the session makes the caret of the peers flaky (ADR 0020). }}\n {{#if this.doc.started}}\n <div {{this.mount}}></div>\n {{/if}}\n {{yield (hash presence=this.presence features=this.features)}}\n </div>\n </template>\n}\n"],"names":["Editor","Component","g","prototype","service","i","features","doc","presence","user","constructor","owner","args","Error","LivePresence","room","PresenceRoom","awareness","handle","registerDestructor","destroy","dovetail","engine","yjsEngine","id","name","color","createDovetail","binding","yjsBinding","state","started","synced","carets","peers","filter","peer","extra","map","join","mount","modifier","element","editor","TiptapEditor","extensions","StarterKit","configure","undoRedo","extension","editorProps","attributes","role","label","style","setComponentTemplate","precompileTemplate","strictMode","scope","hash"],"mappings":";;;;;;;;;;;;;;;;;;;AA0CA,CAAA,CAAA;;;;;AAKe,KAAA,CAAMA,MAAA,CAAA,OAAA,CAAeC,SAAA,CAAU;AAAA,CAAA,CAAA,MAAA,CAAA;AAAAC,CAAAA,CAAAA,CAAAA,CAAAA,CAAA,MAAAC,SAAA,CAAA,CAAA,CAAA,QAAA,CAAA,CAAA,CAAA,CAC3CC,OAAA,CAAQ,CAAA,QAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA;EAAA,CAAA,QAAA,IAAAC,CAAA,CAAA,IAAA,CAAA,CAAA,CAAA,QAAA,CAAA,CAAA,CAAA,CAAA,IAAA,CAAA,CAAA,CAAA;EACAC;EACAC;EACAC;EACAC;AAETC,CAAAA,CAAAA,WAAAA,CAAYC,KAAY,CAAA,CAAEC,IAA6B,CAAA,CAAE;AACvD,CAAA,CAAA,CAAA,CAAA,KAAK,CAACD,KAAA,CAAA,CAAOC,IAAA,CAAA;IACb,EAAA,CAAA,CAAIA,IAAA,CAAKL,GAAG,CAAA,CAAE;MACZ,EAAA,CAAA,CAAI,CAACK,IAAA,CAAKH,IAAI,CAAA,CAAE,KAAA,CAAM,GAAA,CAAII,KAAA,CAAM,CAAA,QAAA,CAAA,CAAA,CAAA,MAAA,CAAA,CAAA,GAAA,CAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,IAAA,CAAA,CAAA,CAAA;AAChC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,IAAI,CAACN,GAAG,CAAA,CAAA,CAAGK,IAAA,CAAKL,GAAG;AACnB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,IAAI,CAACE,IAAI,CAAA,CAAA,CAAGG,IAAA,CAAKH,IAAI;AACrB,CAAA,CAAA,CAAA,CAAA,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