polfan-server-js-client 0.2.33 → 0.2.35
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/.idea/workspace.xml +22 -7
- package/build/index.cjs.js +13 -5
- package/build/index.cjs.js.map +1 -1
- package/build/index.umd.js +1 -1
- package/build/index.umd.js.map +1 -1
- package/build/types/state-tracker/UsersManager.d.ts +3 -1
- package/package.json +1 -1
- package/src/state-tracker/UsersManager.ts +16 -6
package/.idea/workspace.xml
CHANGED
|
@@ -4,10 +4,7 @@
|
|
|
4
4
|
<option name="autoReloadType" value="SELECTIVE" />
|
|
5
5
|
</component>
|
|
6
6
|
<component name="ChangeListManager">
|
|
7
|
-
<list default="true" id="831dae43-0da1-47fd-a5f7-33dd5eec2992" name="Changes" comment="
|
|
8
|
-
<change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
|
|
9
|
-
<change beforePath="$PROJECT_DIR$/src/state-tracker/MessagesManager.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/state-tracker/MessagesManager.ts" afterDir="false" />
|
|
10
|
-
</list>
|
|
7
|
+
<list default="true" id="831dae43-0da1-47fd-a5f7-33dd5eec2992" name="Changes" comment="Dedicated event for user status change" />
|
|
11
8
|
<option name="SHOW_DIALOG" value="false" />
|
|
12
9
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
13
10
|
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
|
@@ -101,7 +98,8 @@
|
|
|
101
98
|
<workItem from="1750982834349" duration="24000" />
|
|
102
99
|
<workItem from="1751050123708" duration="983000" />
|
|
103
100
|
<workItem from="1751060147554" duration="143000" />
|
|
104
|
-
<workItem from="1751159757238" duration="
|
|
101
|
+
<workItem from="1751159757238" duration="782000" />
|
|
102
|
+
<workItem from="1751539766803" duration="1251000" />
|
|
105
103
|
</task>
|
|
106
104
|
<task id="LOCAL-00001" summary="Emoticons objects">
|
|
107
105
|
<option name="closed" value="true" />
|
|
@@ -383,7 +381,23 @@
|
|
|
383
381
|
<option name="project" value="LOCAL" />
|
|
384
382
|
<updated>1751159850812</updated>
|
|
385
383
|
</task>
|
|
386
|
-
<
|
|
384
|
+
<task id="LOCAL-00036" summary="New message type">
|
|
385
|
+
<option name="closed" value="true" />
|
|
386
|
+
<created>1751160521070</created>
|
|
387
|
+
<option name="number" value="00036" />
|
|
388
|
+
<option name="presentableId" value="LOCAL-00036" />
|
|
389
|
+
<option name="project" value="LOCAL" />
|
|
390
|
+
<updated>1751160521070</updated>
|
|
391
|
+
</task>
|
|
392
|
+
<task id="LOCAL-00037" summary="Dedicated event for user status change">
|
|
393
|
+
<option name="closed" value="true" />
|
|
394
|
+
<created>1751547708628</created>
|
|
395
|
+
<option name="number" value="00037" />
|
|
396
|
+
<option name="presentableId" value="LOCAL-00037" />
|
|
397
|
+
<option name="project" value="LOCAL" />
|
|
398
|
+
<updated>1751547708628</updated>
|
|
399
|
+
</task>
|
|
400
|
+
<option name="localTasksCounter" value="38" />
|
|
387
401
|
<servers />
|
|
388
402
|
</component>
|
|
389
403
|
<component name="TypeScriptGeneratedFilesManager">
|
|
@@ -422,6 +436,7 @@
|
|
|
422
436
|
<MESSAGE value="Fix package.json exports" />
|
|
423
437
|
<MESSAGE value="Fix package.json type exports" />
|
|
424
438
|
<MESSAGE value="New message type" />
|
|
425
|
-
<
|
|
439
|
+
<MESSAGE value="Dedicated event for user status change" />
|
|
440
|
+
<option name="LAST_COMMIT_MESSAGE" value="Dedicated event for user status change" />
|
|
426
441
|
</component>
|
|
427
442
|
</project>
|
package/build/index.cjs.js
CHANGED
|
@@ -1860,9 +1860,11 @@ function UsersManager_toPropertyKey(arg) { var key = UsersManager_toPrimitive(ar
|
|
|
1860
1860
|
function UsersManager_toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
1861
1861
|
|
|
1862
1862
|
|
|
1863
|
+
|
|
1863
1864
|
class UsersManager {
|
|
1864
1865
|
constructor(tracker) {
|
|
1865
1866
|
this.tracker = tracker;
|
|
1867
|
+
UsersManager_defineProperty(this, "onlineStatus", new EventTarget());
|
|
1866
1868
|
UsersManager_defineProperty(this, "users", new ObservableIndexedObjectCollection('id'));
|
|
1867
1869
|
// RoomMemberUpdated & SpaceMemberUpdated events are not contains user object
|
|
1868
1870
|
tracker.client.on('UserUpdated', event => this.handleUsers([event.user]));
|
|
@@ -1882,14 +1884,20 @@ class UsersManager {
|
|
|
1882
1884
|
return this.users;
|
|
1883
1885
|
}
|
|
1884
1886
|
handleMembers(members) {
|
|
1885
|
-
this.
|
|
1886
|
-
}
|
|
1887
|
-
handleUsers(users) {
|
|
1888
|
-
this.users.set(...users);
|
|
1887
|
+
this.handleUsers(members.map(extractUserFromMember));
|
|
1889
1888
|
}
|
|
1890
1889
|
handleSession(session) {
|
|
1891
1890
|
this.users.deleteAll();
|
|
1892
|
-
this.
|
|
1891
|
+
this.handleUsers([session.user]);
|
|
1892
|
+
}
|
|
1893
|
+
handleUsers(users) {
|
|
1894
|
+
users.forEach(newUser => {
|
|
1895
|
+
const oldUser = this.users.get(newUser.id);
|
|
1896
|
+
if (oldUser && oldUser.online !== newUser.online) {
|
|
1897
|
+
this.onlineStatus.emit('change', newUser);
|
|
1898
|
+
}
|
|
1899
|
+
});
|
|
1900
|
+
this.users.set(...users);
|
|
1893
1901
|
}
|
|
1894
1902
|
}
|
|
1895
1903
|
;// CONCATENATED MODULE: ./src/state-tracker/ChatStateTracker.ts
|