@abraca/dabra 2.6.0 → 2.7.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/dist/abracadabra-provider.cjs +24 -3
- package/dist/abracadabra-provider.cjs.map +1 -1
- package/dist/abracadabra-provider.esm.js +24 -3
- package/dist/abracadabra-provider.esm.js.map +1 -1
- package/dist/index.d.ts +7 -2
- package/package.json +2 -2
- package/src/AbracadabraBaseProvider.ts +15 -0
- package/src/ContentManager.ts +8 -6
package/dist/index.d.ts
CHANGED
|
@@ -4985,8 +4985,13 @@ declare class ContentManager {
|
|
|
4985
4985
|
constructor(dm: DocumentManager);
|
|
4986
4986
|
/**
|
|
4987
4987
|
* Read document content as markdown.
|
|
4988
|
-
*
|
|
4989
|
-
* body, tree
|
|
4988
|
+
*
|
|
4989
|
+
* Returns the markdown body, tree-derived label/type/meta, and immediate
|
|
4990
|
+
* children. `title` mirrors `label` (the tree entry's display name) — it
|
|
4991
|
+
* is *not* derived from a TipTap `documentHeader`, and the markdown body
|
|
4992
|
+
* does NOT include YAML frontmatter. Callers that want frontmatter-style
|
|
4993
|
+
* round-tripping should serialise `meta`/`type` themselves on top of the
|
|
4994
|
+
* returned markdown.
|
|
4990
4995
|
*/
|
|
4991
4996
|
read(docId: string): Promise<DocumentContent>;
|
|
4992
4997
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abraca/dabra",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"description": "abracadabra provider",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"abracadabra",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"yjs": "^13.6.8"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@abraca/schema": "2.
|
|
44
|
+
"@abraca/schema": "2.7.0"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
47
|
"test": "node --no-warnings --conditions=source --experimental-transform-types --test 'tests/*.test.ts'"
|
|
@@ -14,6 +14,7 @@ import { StatelessMessage } from "./OutgoingMessages/StatelessMessage.ts";
|
|
|
14
14
|
import { RpcClient } from "./RpcClient.ts";
|
|
15
15
|
import { QueryClient } from "./QueryClient.ts";
|
|
16
16
|
import type { QuerySpec, QuerySubscriptionHandlers, QuerySubscriptionHandle } from "./QueryClient.ts";
|
|
17
|
+
import { QueryAwarenessMessage } from "./OutgoingMessages/QueryAwarenessMessage.ts";
|
|
17
18
|
import { SyncStepOneMessage } from "./OutgoingMessages/SyncStepOneMessage.ts";
|
|
18
19
|
import { UpdateMessage } from "./OutgoingMessages/UpdateMessage.ts";
|
|
19
20
|
import type {
|
|
@@ -516,6 +517,20 @@ export class AbracadabraBaseProvider extends EventEmitter {
|
|
|
516
517
|
documentName: this.configuration.name,
|
|
517
518
|
});
|
|
518
519
|
}
|
|
520
|
+
|
|
521
|
+
// Pull existing peers' awareness on (re)connect. The server keeps no
|
|
522
|
+
// awareness cache and never replays presence to a fresh joiner, so without
|
|
523
|
+
// this a late-joining client only learns about a peer once that peer next
|
|
524
|
+
// *changes* its own awareness — producing asymmetric presence ("A sees B
|
|
525
|
+
// but B can't see A"). The server re-broadcasts this query to all peers,
|
|
526
|
+
// who answer with their full state (MessageReceiver.applyQueryAwareness),
|
|
527
|
+
// and those replies fan back to us. Matches stock y-websocket on-open
|
|
528
|
+
// behaviour. Only meaningful when an awareness instance exists.
|
|
529
|
+
if (this.awareness) {
|
|
530
|
+
this.send(QueryAwarenessMessage, {
|
|
531
|
+
documentName: this.configuration.name,
|
|
532
|
+
});
|
|
533
|
+
}
|
|
519
534
|
}
|
|
520
535
|
|
|
521
536
|
send(message: ConstructableOutgoingMessage, args: any) {
|
package/src/ContentManager.ts
CHANGED
|
@@ -44,8 +44,13 @@ export class ContentManager {
|
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* Read document content as markdown.
|
|
47
|
-
*
|
|
48
|
-
* body, tree
|
|
47
|
+
*
|
|
48
|
+
* Returns the markdown body, tree-derived label/type/meta, and immediate
|
|
49
|
+
* children. `title` mirrors `label` (the tree entry's display name) — it
|
|
50
|
+
* is *not* derived from a TipTap `documentHeader`, and the markdown body
|
|
51
|
+
* does NOT include YAML frontmatter. Callers that want frontmatter-style
|
|
52
|
+
* round-tripping should serialise `meta`/`type` themselves on top of the
|
|
53
|
+
* returned markdown.
|
|
49
54
|
*/
|
|
50
55
|
async read(docId: string): Promise<DocumentContent> {
|
|
51
56
|
const provider = await this.dm.getChildProvider(docId);
|
|
@@ -95,10 +100,7 @@ export class ContentManager {
|
|
|
95
100
|
meta,
|
|
96
101
|
}));
|
|
97
102
|
|
|
98
|
-
|
|
99
|
-
// so frontmatter round-trips. (Older code destructured an object and
|
|
100
|
-
// passed only the fragment — that silently produced `undefined`.)
|
|
101
|
-
const markdown = yjsToMarkdown(fragment, label, meta, type);
|
|
103
|
+
const { markdown } = yjsToMarkdown(fragment);
|
|
102
104
|
const title = label;
|
|
103
105
|
|
|
104
106
|
return { label, type, meta, title, markdown, children };
|