@pluv/client 0.12.3 → 0.14.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/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +28 -0
- package/dist/index.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +6 -0
- package/dist/index.mjs +6 -0
- package/package.json +6 -6
- package/src/AbstractRoom.ts +3 -1
- package/src/MockedRoom.ts +5 -1
- package/src/PluvRoom.ts +5 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @pluv/client@0.
|
|
2
|
+
> @pluv/client@0.14.0 build /home/runner/work/pluv/pluv/packages/client
|
|
3
3
|
> tsup src/index.ts --format esm,cjs --dts
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
[34mCLI[39m Target: es6
|
|
9
9
|
[34mESM[39m Build start
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
|
-
[32mCJS[39m [1mdist/index.js [22m[32m44.
|
|
12
|
-
[32mCJS[39m ⚡️ Build success in
|
|
13
|
-
[32mESM[39m [1mdist/index.mjs [22m[32m42.
|
|
14
|
-
[32mESM[39m ⚡️ Build success in
|
|
11
|
+
[32mCJS[39m [1mdist/index.js [22m[32m44.17 KB[39m
|
|
12
|
+
[32mCJS[39m ⚡️ Build success in 76ms
|
|
13
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m42.92 KB[39m
|
|
14
|
+
[32mESM[39m ⚡️ Build success in 78ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
17
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[32m14.
|
|
18
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m14.
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 2970ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m14.31 KB[39m
|
|
18
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m14.31 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @pluv/client
|
|
2
2
|
|
|
3
|
+
## 0.14.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @pluv/crdt-yjs@0.14.0
|
|
8
|
+
- @pluv/types@0.14.0
|
|
9
|
+
|
|
10
|
+
## 0.13.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- 1126215: Added `getDoc` on `PluvRoom` to access the root Yjs doc.
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { createClient } from "@pluv/client";
|
|
18
|
+
import type { Doc } from "yjs";
|
|
19
|
+
|
|
20
|
+
const client = createClient(/* ... */);
|
|
21
|
+
const room = client.createRoom(/* ... */);
|
|
22
|
+
|
|
23
|
+
const doc: Doc = room.getDoc();
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- @pluv/crdt-yjs@0.13.0
|
|
29
|
+
- @pluv/types@0.13.0
|
|
30
|
+
|
|
3
31
|
## 0.12.3
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -3,7 +3,7 @@ export { InferYjsSharedTypeJson, TrackOriginOptions } from '@pluv/crdt-yjs';
|
|
|
3
3
|
import * as _pluv_types from '@pluv/types';
|
|
4
4
|
import { IOLike, InferIOOutput, Id, IOEventMessage, JsonObject, InferIOAuthorizeUser, InferIOAuthorize, InferIOInput, InputZodLike, InferIOAuthorizeRequired } from '@pluv/types';
|
|
5
5
|
export { BaseUser, EventMessage, EventRecord, IOEventMessage } from '@pluv/types';
|
|
6
|
-
import { AbstractType } from 'yjs';
|
|
6
|
+
import { AbstractType, Doc } from 'yjs';
|
|
7
7
|
export { AbstractType } from 'yjs';
|
|
8
8
|
import { Subject } from 'wonka';
|
|
9
9
|
|
|
@@ -53,6 +53,7 @@ declare abstract class AbstractRoom<TIO extends IOLike, TPresence extends JsonOb
|
|
|
53
53
|
abstract broadcast<TEvent extends keyof InferIOInput<TIO>>(event: TEvent, data: Id<InferIOInput<TIO>[TEvent]>): void;
|
|
54
54
|
abstract canRedo(): boolean;
|
|
55
55
|
abstract canUndo(): boolean;
|
|
56
|
+
abstract getDoc(): Doc;
|
|
56
57
|
abstract event<TEvent extends keyof InferIOOutput<TIO>>(event: TEvent, callback: EventNotifierSubscriptionCallback<TIO, TEvent>): () => void;
|
|
57
58
|
abstract getConnection(): WebSocketConnection;
|
|
58
59
|
abstract getMyPresence(): TPresence;
|
|
@@ -158,6 +159,7 @@ declare class PluvRoom<TIO extends IOLike, TPresence extends JsonObject = {}, TS
|
|
|
158
159
|
disconnect(): Promise<void>;
|
|
159
160
|
event: <TEvent extends keyof InferIOOutput<TIO>>(event: TEvent, callback: EventNotifierSubscriptionCallback<TIO, TEvent>) => (() => void);
|
|
160
161
|
getConnection(): WebSocketConnection;
|
|
162
|
+
getDoc(): Doc;
|
|
161
163
|
getMyPresence: () => TPresence;
|
|
162
164
|
getMyself: () => Id<UserInfo<TIO, TPresence>> | null;
|
|
163
165
|
getOther: (connectionId: string) => Id<UserInfo<TIO, TPresence>> | null;
|
|
@@ -264,6 +266,7 @@ declare class MockedRoom<TIO extends IOLike, TPresence extends JsonObject = {},
|
|
|
264
266
|
canUndo: () => boolean;
|
|
265
267
|
event: <TEvent extends keyof InferIOOutput<TIO>>(event: TEvent, callback: EventNotifierSubscriptionCallback<TIO, TEvent>) => (() => void);
|
|
266
268
|
getConnection(): WebSocketConnection;
|
|
269
|
+
getDoc(): Doc;
|
|
267
270
|
getMyPresence: () => TPresence;
|
|
268
271
|
getMyself: () => Id<UserInfo<TIO, TPresence>> | null;
|
|
269
272
|
getOther: (connectionId: string) => Id<UserInfo<TIO, TPresence>> | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { InferYjsSharedTypeJson, TrackOriginOptions } from '@pluv/crdt-yjs';
|
|
|
3
3
|
import * as _pluv_types from '@pluv/types';
|
|
4
4
|
import { IOLike, InferIOOutput, Id, IOEventMessage, JsonObject, InferIOAuthorizeUser, InferIOAuthorize, InferIOInput, InputZodLike, InferIOAuthorizeRequired } from '@pluv/types';
|
|
5
5
|
export { BaseUser, EventMessage, EventRecord, IOEventMessage } from '@pluv/types';
|
|
6
|
-
import { AbstractType } from 'yjs';
|
|
6
|
+
import { AbstractType, Doc } from 'yjs';
|
|
7
7
|
export { AbstractType } from 'yjs';
|
|
8
8
|
import { Subject } from 'wonka';
|
|
9
9
|
|
|
@@ -53,6 +53,7 @@ declare abstract class AbstractRoom<TIO extends IOLike, TPresence extends JsonOb
|
|
|
53
53
|
abstract broadcast<TEvent extends keyof InferIOInput<TIO>>(event: TEvent, data: Id<InferIOInput<TIO>[TEvent]>): void;
|
|
54
54
|
abstract canRedo(): boolean;
|
|
55
55
|
abstract canUndo(): boolean;
|
|
56
|
+
abstract getDoc(): Doc;
|
|
56
57
|
abstract event<TEvent extends keyof InferIOOutput<TIO>>(event: TEvent, callback: EventNotifierSubscriptionCallback<TIO, TEvent>): () => void;
|
|
57
58
|
abstract getConnection(): WebSocketConnection;
|
|
58
59
|
abstract getMyPresence(): TPresence;
|
|
@@ -158,6 +159,7 @@ declare class PluvRoom<TIO extends IOLike, TPresence extends JsonObject = {}, TS
|
|
|
158
159
|
disconnect(): Promise<void>;
|
|
159
160
|
event: <TEvent extends keyof InferIOOutput<TIO>>(event: TEvent, callback: EventNotifierSubscriptionCallback<TIO, TEvent>) => (() => void);
|
|
160
161
|
getConnection(): WebSocketConnection;
|
|
162
|
+
getDoc(): Doc;
|
|
161
163
|
getMyPresence: () => TPresence;
|
|
162
164
|
getMyself: () => Id<UserInfo<TIO, TPresence>> | null;
|
|
163
165
|
getOther: (connectionId: string) => Id<UserInfo<TIO, TPresence>> | null;
|
|
@@ -264,6 +266,7 @@ declare class MockedRoom<TIO extends IOLike, TPresence extends JsonObject = {},
|
|
|
264
266
|
canUndo: () => boolean;
|
|
265
267
|
event: <TEvent extends keyof InferIOOutput<TIO>>(event: TEvent, callback: EventNotifierSubscriptionCallback<TIO, TEvent>) => (() => void);
|
|
266
268
|
getConnection(): WebSocketConnection;
|
|
269
|
+
getDoc(): Doc;
|
|
267
270
|
getMyPresence: () => TPresence;
|
|
268
271
|
getMyself: () => Id<UserInfo<TIO, TPresence>> | null;
|
|
269
272
|
getOther: (connectionId: string) => Id<UserInfo<TIO, TPresence>> | null;
|
package/dist/index.js
CHANGED
|
@@ -638,6 +638,9 @@ var PluvRoom = class extends AbstractRoom {
|
|
|
638
638
|
JSON.parse(JSON.stringify(this._state.connection))
|
|
639
639
|
);
|
|
640
640
|
}
|
|
641
|
+
getDoc() {
|
|
642
|
+
return this._crdtManager.doc.value;
|
|
643
|
+
}
|
|
641
644
|
_addToStorageStore(update) {
|
|
642
645
|
return __async(this, null, function* () {
|
|
643
646
|
yield this._storageStore.addUpdate(update);
|
|
@@ -1411,6 +1414,9 @@ var MockedRoom = class extends AbstractRoom {
|
|
|
1411
1414
|
JSON.parse(JSON.stringify(this._state.connection))
|
|
1412
1415
|
);
|
|
1413
1416
|
}
|
|
1417
|
+
getDoc() {
|
|
1418
|
+
return this._crdtManager.doc.value;
|
|
1419
|
+
}
|
|
1414
1420
|
_observeCrdt() {
|
|
1415
1421
|
var _a, _b;
|
|
1416
1422
|
(_b = (_a = this._subscriptions).observeCrdt) == null ? void 0 : _b.call(_a);
|
package/dist/index.mjs
CHANGED
|
@@ -612,6 +612,9 @@ var PluvRoom = class extends AbstractRoom {
|
|
|
612
612
|
JSON.parse(JSON.stringify(this._state.connection))
|
|
613
613
|
);
|
|
614
614
|
}
|
|
615
|
+
getDoc() {
|
|
616
|
+
return this._crdtManager.doc.value;
|
|
617
|
+
}
|
|
615
618
|
_addToStorageStore(update) {
|
|
616
619
|
return __async(this, null, function* () {
|
|
617
620
|
yield this._storageStore.addUpdate(update);
|
|
@@ -1385,6 +1388,9 @@ var MockedRoom = class extends AbstractRoom {
|
|
|
1385
1388
|
JSON.parse(JSON.stringify(this._state.connection))
|
|
1386
1389
|
);
|
|
1387
1390
|
}
|
|
1391
|
+
getDoc() {
|
|
1392
|
+
return this._crdtManager.doc.value;
|
|
1393
|
+
}
|
|
1388
1394
|
_observeCrdt() {
|
|
1389
1395
|
var _a, _b;
|
|
1390
1396
|
(_b = (_a = this._subscriptions).observeCrdt) == null ? void 0 : _b.call(_a);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pluv/client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "@pluv/io frontend client",
|
|
5
5
|
"author": "leedavidcs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,19 +18,19 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"wonka": "^6.3.4",
|
|
21
|
-
"@pluv/crdt-yjs": "^0.
|
|
22
|
-
"@pluv/types": "^0.
|
|
21
|
+
"@pluv/crdt-yjs": "^0.14.0",
|
|
22
|
+
"@pluv/types": "^0.14.0"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"yjs": "^13.0.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"eslint": "^8.
|
|
28
|
+
"eslint": "^8.56.0",
|
|
29
29
|
"tsup": "^8.0.1",
|
|
30
30
|
"typescript": "^5.2.2",
|
|
31
31
|
"yjs": "^13.6.10",
|
|
32
|
-
"@pluv/tsconfig": "^0.
|
|
33
|
-
"eslint-config-pluv": "^0.
|
|
32
|
+
"@pluv/tsconfig": "^0.14.0",
|
|
33
|
+
"eslint-config-pluv": "^0.14.0"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|
package/src/AbstractRoom.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type {
|
|
|
6
6
|
IOLike,
|
|
7
7
|
JsonObject,
|
|
8
8
|
} from "@pluv/types";
|
|
9
|
-
import type { AbstractType } from "yjs";
|
|
9
|
+
import type { AbstractType, Doc } from "yjs";
|
|
10
10
|
import type { EventNotifierSubscriptionCallback } from "./EventNotifier";
|
|
11
11
|
import type { OtherNotifierSubscriptionCallback } from "./OtherNotifier";
|
|
12
12
|
import type {
|
|
@@ -35,6 +35,8 @@ export abstract class AbstractRoom<
|
|
|
35
35
|
|
|
36
36
|
public abstract canUndo(): boolean;
|
|
37
37
|
|
|
38
|
+
public abstract getDoc(): Doc;
|
|
39
|
+
|
|
38
40
|
public abstract event<TEvent extends keyof InferIOOutput<TIO>>(
|
|
39
41
|
event: TEvent,
|
|
40
42
|
callback: EventNotifierSubscriptionCallback<TIO, TEvent>,
|
package/src/MockedRoom.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type {
|
|
|
6
6
|
IOLike,
|
|
7
7
|
JsonObject,
|
|
8
8
|
} from "@pluv/types";
|
|
9
|
-
import type { AbstractType } from "yjs";
|
|
9
|
+
import type { AbstractType, Doc } from "yjs";
|
|
10
10
|
import { AbstractRoom } from "./AbstractRoom";
|
|
11
11
|
import { CrdtManager, CrdtManagerOptions } from "./CrdtManager";
|
|
12
12
|
import { CrdtNotifier } from "./CrdtNotifier";
|
|
@@ -139,6 +139,10 @@ export class MockedRoom<
|
|
|
139
139
|
);
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
+
public getDoc(): Doc {
|
|
143
|
+
return this._crdtManager.doc.value;
|
|
144
|
+
}
|
|
145
|
+
|
|
142
146
|
public getMyPresence = (): TPresence => {
|
|
143
147
|
return this._usersManager.myPresence;
|
|
144
148
|
};
|
package/src/PluvRoom.ts
CHANGED
|
@@ -12,7 +12,7 @@ import type {
|
|
|
12
12
|
IOLike,
|
|
13
13
|
JsonObject,
|
|
14
14
|
} from "@pluv/types";
|
|
15
|
-
import type { AbstractType } from "yjs";
|
|
15
|
+
import type { AbstractType, Doc } from "yjs";
|
|
16
16
|
import { AbstractRoom } from "./AbstractRoom";
|
|
17
17
|
import { AbstractStorageStore } from "./AbstractStorageStore";
|
|
18
18
|
import type { CrdtManagerOptions } from "./CrdtManager";
|
|
@@ -364,6 +364,10 @@ export class PluvRoom<
|
|
|
364
364
|
);
|
|
365
365
|
}
|
|
366
366
|
|
|
367
|
+
public getDoc(): Doc {
|
|
368
|
+
return this._crdtManager.doc.value;
|
|
369
|
+
}
|
|
370
|
+
|
|
367
371
|
public getMyPresence = (): TPresence => {
|
|
368
372
|
return this._usersManager.myPresence;
|
|
369
373
|
};
|