rhine-var 0.10.1 → 0.10.4

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.
@@ -122,16 +122,16 @@ jobs:
122
122
  run: |
123
123
  sudo apt-get install -y jq
124
124
  cp package.json package.json.bak
125
- jq '.name = "@RhineAI-Lab/\(.name)" | .repository.url = "git+https://github.com/RhineAI-Lab/rhine-var.git"' package.json > package.json.tmp
125
+ jq '.name = "@RhineAI/\(.name)" | .repository.url = "git+https://github.com/RhineAI/rhine-var.git"' package.json > package.json.tmp
126
126
  mv package.json.tmp package.json
127
127
  jq empty package.json
128
128
 
129
129
  - name: Configure npm Registry
130
130
  run: |
131
- npm config set @RhineAI-Lab:registry=https://npm.pkg.github.com
131
+ npm config set @RhineAI:registry=https://npm.pkg.github.com
132
132
  echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> ~/.npmrc
133
133
 
134
- - name: Publish to NPM
134
+ - name: Publish to Github
135
135
  run: npm publish
136
136
  env:
137
137
  NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
package/README.md CHANGED
@@ -31,7 +31,7 @@ Try: [https://rv.rhineai.com/examples/counter](https://rv.rhineai.com/examples/c
31
31
 
32
32
  **Document:** [LEARN.md](assets/documents/LEARN.md)
33
33
 
34
- **Github:** [https://github.com/RhineAI-Lab/rhine-var](https://github.com/RhineAI-Lab/rhine-var)
34
+ **Github:** [https://github.com/RhineAI/rhine-var](https://github.com/RhineAI/rhine-var)
35
35
 
36
36
  **Npm:** [https://www.npmjs.com/package/rhine-var](https://www.npmjs.com/package/rhine-var)
37
37
 
@@ -189,13 +189,13 @@ server.listen()
189
189
 
190
190
  We also provide a more complete [Hocuspocus](https://tiptap.dev/docs/hocuspocus/introduction) server (link below), which supports pre-authorization for connections and the ability to store data in a database.
191
191
 
192
- Best Implementation: [https://github.com/RhineAI-Lab/rhine-var-hocuspocus-server](https://github.com/RhineAI-Lab/rhine-var-hocuspocus-server)
192
+ Best Implementation: [https://github.com/RhineAI/rhine-var-hocuspocus-server](https://github.com/RhineAI/rhine-var-hocuspocus-server)
193
193
 
194
194
  <br/>
195
195
 
196
196
  Original server-side development reference: [https://docs.yjs.dev/ecosystem/connection-provider/y-websocket](https://docs.yjs.dev/ecosystem/connection-provider/y-websocket)
197
197
 
198
- And we also provide the original Yjs WebSocket server example: [https://github.com/RhineAI-Lab/rhine-var-server](https://github.com/RhineAI-Lab/rhine-var-server)
198
+ And we also provide the original Yjs WebSocket server example: [https://github.com/RhineAI/rhine-var-server](https://github.com/RhineAI/rhine-var-server)
199
199
 
200
200
 
201
201
  ## Develop
package/README_zh.md CHANGED
@@ -30,7 +30,7 @@ Try: [https://rv.rhineai.com/examples/counter](https://rv.rhineai.com/examples/c
30
30
 
31
31
  **Document:** [LEARN_zh.md](assets/documents/LEARN_zh.md)
32
32
 
33
- **Github:** [https://github.com/RhineAI-Lab/rhine-var](https://github.com/RhineAI-Lab/rhine-var)
33
+ **Github:** [https://github.com/RhineAI/rhine-var](https://github.com/RhineAI/rhine-var)
34
34
 
35
35
  **Npm:** [https://www.npmjs.com/package/rhine-var](https://www.npmjs.com/package/rhine-var)
36
36
 
@@ -203,13 +203,13 @@ server.listen()
203
203
  ```
204
204
  我们还提供了一个更完整的 [Hocuspocus](https://tiptap.dev/docs/hocuspocus/introduction) 服务器 (下方链接),支持连接前鉴权,以及将数据持久化到数据库中。
205
205
 
206
- Best Implementation: [https://github.com/RhineAI-Lab/rhine-var-hocuspocus-server](https://github.com/RhineAI-Lab/rhine-var-hocuspocus-server)
206
+ Best Implementation: [https://github.com/RhineAI/rhine-var-hocuspocus-server](https://github.com/RhineAI/rhine-var-hocuspocus-server)
207
207
 
208
208
  <br/>
209
209
 
210
210
  原生服务端开发信息请参考: [https://docs.yjs.dev/ecosystem/connection-provider/y-websocket](https://docs.yjs.dev/ecosystem/connection-provider/y-websocket)
211
211
 
212
- 以及我们提供的原生 Yjs Websocket 服务器的示例: [https://github.com/RhineAI-Lab/rhine-var-server](https://github.com/RhineAI-Lab/rhine-var-server)
212
+ 以及我们提供的原生 Yjs Websocket 服务器的示例: [https://github.com/RhineAI/rhine-var-server](https://github.com/RhineAI/rhine-var-server)
213
213
 
214
214
  <br/>
215
215
 
@@ -1,7 +1,7 @@
1
1
  import { YMap, YDoc } from "../../index";
2
2
  import { ConnectorStatus } from "./connector-status.enum";
3
3
  import { Native } from "../native/native.type";
4
- import { SyncedCallback } from "../event/callback";
4
+ import { SyncedSubscriber } from "../subscriber/subscriber";
5
5
  export default abstract class Connector {
6
6
  static STATE_KEY: string;
7
7
  yDoc: YDoc | null;
@@ -9,9 +9,9 @@ export default abstract class Connector {
9
9
  clientId: number;
10
10
  synced: boolean;
11
11
  status: ConnectorStatus;
12
- protected syncedSubscribers: SyncedCallback[];
13
- subscribeSynced(callback: SyncedCallback): () => void;
14
- unsubscribeSynced(callback: SyncedCallback): void;
12
+ protected syncedSubscribers: SyncedSubscriber[];
13
+ subscribeSynced(callback: SyncedSubscriber): () => void;
14
+ unsubscribeSynced(callback: SyncedSubscriber): void;
15
15
  unsubscribeAllSynced(): void;
16
16
  protected emitSynced(synced: boolean): void;
17
17
  afterSynced(callback: () => void): void;
@@ -1 +1 @@
1
- {"version":3,"file":"connector.abstract.d.ts","sourceRoot":"","sources":["../../../src/core/connector/connector.abstract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,oBAAe;AACpC,OAAO,EAAC,eAAe,EAAC,gCAA+C;AACvE,OAAO,EAAC,MAAM,EAAC,8BAAkC;AACjD,OAAO,EAAC,cAAc,EAAC,0BAA8B;AAErD,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,SAAS;IAErC,MAAM,CAAC,SAAS,SAAU;IAE1B,IAAI,EAAE,IAAI,GAAG,IAAI,CAAO;IACxB,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAO;IAEjC,QAAQ,SAAK;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AAE,gBAAgB;IAI1C,iBAAiB,CAAC,QAAQ,EAAE,gBAAgB;IAG5C,oBAAoB;IAGpB,SAAS,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO;IAIpC,WAAW,CAAC,QAAQ,EAAE,MAAM,IAAI;IAahC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;gBAMf,IAAI,GAAE,MAAW;IAG7B,QAAQ,IAAI,OAAO;IAInB,QAAQ,IAAI,MAAM;IAIlB,QAAQ,CAAC,KAAK,EAAE,MAAM;IAItB,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAE7C,QAAQ,CAAC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAErC;AAGD,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,QAChD"}
@@ -0,0 +1,7 @@
1
+ export declare enum EventType {
2
+ ADD = "ADD",// For YMap / YArray
3
+ UPDATE = "UPDATE",// For YMap
4
+ DELETE = "DELETE",// For YMap / YArray
5
+ SYNC = "SYNC"
6
+ }
7
+ //# sourceMappingURL=event-type.enum.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-type.enum.d.ts","sourceRoot":"","sources":["../../../src/core/subscriber/event-type.enum.ts"],"names":[],"mappings":"AACA,oBAAY,SAAS;IACnB,GAAG,QAAQ,CAAG,oBAAoB;IAClC,MAAM,WAAW,CAAG,WAAW;IAC/B,MAAM,WAAW,CAAG,oBAAoB;IACxC,IAAI,SAAS;CACd"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EventType = void 0;
4
+ var EventType;
5
+ (function (EventType) {
6
+ EventType["ADD"] = "ADD";
7
+ EventType["UPDATE"] = "UPDATE";
8
+ EventType["DELETE"] = "DELETE";
9
+ EventType["SYNC"] = "SYNC";
10
+ })(EventType || (exports.EventType = EventType = {}));
@@ -0,0 +1,9 @@
1
+ import { EventType } from "./event-type.enum";
2
+ import { Transaction, YArrayEvent, YMapEvent, YTextEvent } from "yjs";
3
+ import { RvPath } from "../native/native.type";
4
+ import { StoredRhineVar } from "../var/rhine-var.type";
5
+ export type Subscriber<T> = (type: EventType, key: keyof T, value: T[keyof T] extends object ? T[keyof T] | StoredRhineVar<T[keyof T]> : T[keyof T], oldValue: T[keyof T], nativeEvent: YMapEvent<any> | YArrayEvent<any> | YTextEvent, nativeTransaction: Transaction) => void;
6
+ export type KeySubscriber<T> = (type: EventType, value: T[keyof T] extends object ? T[keyof T] | StoredRhineVar<T[keyof T]> : T[keyof T], oldValue: T[keyof T], nativeEvent: YMapEvent<any> | YArrayEvent<any> | YTextEvent, nativeTransaction: Transaction) => void;
7
+ export type DeepSubscriber<T> = (type: EventType, path: RvPath, value: any | StoredRhineVar<any>, oldValue: any, nativeEvent: YMapEvent<any> | YArrayEvent<any> | YTextEvent, nativeTransaction: Transaction) => void;
8
+ export type SyncedSubscriber = (synced: boolean) => void;
9
+ //# sourceMappingURL=subscriber.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscriber.d.ts","sourceRoot":"","sources":["../../../src/core/subscriber/subscriber.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,0BAA0C;AAC5D,OAAO,EAAC,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAC,MAAM,KAAK,CAAC;AACpE,OAAO,EAAC,MAAM,EAAC,8BAAkC;AACjD,OAAO,EAAC,cAAc,EAAC,8BAAkC;AAGzD,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,CAC1B,IAAI,EAAE,SAAS,EACf,GAAG,EAAE,MAAM,CAAC,EACZ,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,EACvF,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EACpB,WAAW,EAAE,SAAS,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,UAAU,EAC3D,iBAAiB,EAAE,WAAW,KAC3B,IAAI,CAAA;AAET,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAC7B,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,EACvF,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EACpB,WAAW,EAAE,SAAS,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,UAAU,EAC3D,iBAAiB,EAAE,WAAW,KAC3B,IAAI,CAAA;AAET,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAC9B,IAAI,EAAE,SAAS,EACf,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,GAAG,GAAG,cAAc,CAAC,GAAG,CAAC,EAChC,QAAQ,EAAE,GAAG,EACb,WAAW,EAAE,SAAS,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,UAAU,EAC3D,iBAAiB,EAAE,WAAW,KAC3B,IAAI,CAAA;AAET,MAAM,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAA"}
@@ -1,8 +1,8 @@
1
1
  import { Transaction, UndoManager, YArrayEvent, YMapEvent, YTextEvent } from "yjs";
2
2
  import { Awareness } from "y-protocols/awareness";
3
3
  import { Native, RvPath } from "../native/native.type";
4
- import { ChangeType } from "../event/change-type.enum";
5
- import { Callback, DeepCallback, SyncedCallback } from "../event/callback";
4
+ import { EventType } from "../subscriber/event-type.enum";
5
+ import { Subscriber, DeepSubscriber, SyncedSubscriber, KeySubscriber } from "../subscriber/subscriber";
6
6
  import Connector from "../connector/connector.abstract";
7
7
  import ProxyOptions from "../proxy/proxy-options.interface";
8
8
  export default abstract class RhineVarBase<T extends object = any> {
@@ -30,24 +30,24 @@ export default abstract class RhineVarBase<T extends object = any> {
30
30
  frozenJson(): T;
31
31
  jsonString(indent?: number): string;
32
32
  private syncedSubscribers;
33
- subscribeSynced(callback: SyncedCallback): () => void;
34
- unsubscribeSynced(callback: SyncedCallback): void;
33
+ subscribeSynced(callback: SyncedSubscriber): () => void;
34
+ unsubscribeSynced(callback: SyncedSubscriber): void;
35
35
  unsubscribeAllSynced(): void;
36
36
  private emitSynced;
37
37
  private subscribers;
38
- subscribe(callback: Callback<T>): () => void;
39
- unsubscribe(callback: Callback<T>): void;
38
+ subscribe(subscriber: Subscriber<T>): () => void;
39
+ unsubscribe(subscriber: Subscriber<T>): void;
40
40
  unsubscribeAll(): void;
41
41
  private keySubscribers;
42
- subscribeKey(key: keyof T, callback: Callback<T>): () => void;
43
- unsubscribeKey(callback: Callback<T>): void;
42
+ subscribeKey(key: keyof T, subscriber: KeySubscriber<T>): () => void;
43
+ unsubscribeKey(subscriber: KeySubscriber<T>): void;
44
44
  unsubscribeAllKey(): void;
45
45
  private emit;
46
46
  private deepSubscribers;
47
- subscribeDeep(callback: DeepCallback<T>): () => void;
48
- unsubscribeDeep(callback: DeepCallback<T>): void;
47
+ subscribeDeep(subscriber: DeepSubscriber<T>): () => void;
48
+ unsubscribeDeep(subscriber: DeepSubscriber<T>): void;
49
49
  unsubscribeAllDeep(): void;
50
- emitDeep(path: RvPath, value: any, oldValue: any, type: ChangeType, nativeEvent: YMapEvent<any> | YArrayEvent<any> | YTextEvent, nativeTransaction: Transaction): void;
50
+ emitDeep(type: EventType, path: RvPath, value: any, oldValue: any, nativeEvent: YMapEvent<any> | YArrayEvent<any> | YTextEvent, nativeTransaction: Transaction): void;
51
51
  private observer;
52
52
  private syncedObserver;
53
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10
10
  const rhine_proxy_1 = require("../proxy/rhine-proxy");
11
11
  const logger_1 = require("../../utils/logger");
12
12
  const data_utils_1 = require("../utils/data.utils");
13
- const change_type_enum_1 = require("../event/change-type.enum");
13
+ const event_type_enum_1 = require("../subscriber/event-type.enum");
14
14
  const native_utils_1 = require("../utils/native.utils");
15
15
  const config_1 = __importDefault(require("../../config/config"));
16
16
  class RhineVarBase {
@@ -225,53 +225,53 @@ class RhineVarBase {
225
225
  emitSynced(synced) {
226
226
  this.syncedSubscribers.forEach(subscriber => subscriber(synced));
227
227
  }
228
- subscribe(callback) {
229
- this.subscribers.push(callback);
230
- return () => this.unsubscribe(callback);
228
+ subscribe(subscriber) {
229
+ this.subscribers.push(subscriber);
230
+ return () => this.unsubscribe(subscriber);
231
231
  }
232
- unsubscribe(callback) {
233
- this.subscribers = this.subscribers.filter(subscriber => subscriber !== callback);
232
+ unsubscribe(subscriber) {
233
+ this.subscribers = this.subscribers.filter(s => s !== subscriber);
234
234
  }
235
235
  unsubscribeAll() {
236
236
  this.subscribers = [];
237
237
  }
238
- subscribeKey(key, callback) {
238
+ subscribeKey(key, subscriber) {
239
239
  if (!this.keySubscribers.has(key)) {
240
240
  this.keySubscribers.set(key, []);
241
241
  }
242
- this.keySubscribers.get(key).push(callback);
243
- return () => this.unsubscribeKey(callback);
242
+ this.keySubscribers.get(key).push(subscriber);
243
+ return () => this.unsubscribeKey(subscriber);
244
244
  }
245
- unsubscribeKey(callback) {
245
+ unsubscribeKey(subscriber) {
246
246
  this.keySubscribers.forEach((subscribers, key) => {
247
- this.keySubscribers.set(key, subscribers.filter(subscriber => subscriber !== callback));
247
+ this.keySubscribers.set(key, subscribers.filter(s => s !== subscriber));
248
248
  });
249
249
  }
250
250
  unsubscribeAllKey() {
251
251
  this.keySubscribers = new Map();
252
252
  }
253
- emit(key, value, oldValue, type, nativeEvent, nativeTransaction) {
254
- this.subscribers.forEach(subscriber => subscriber(key, value, oldValue, type, nativeEvent, nativeTransaction));
253
+ emit(type, key, value, oldValue, nativeEvent, nativeTransaction) {
254
+ this.subscribers.forEach(subscriber => subscriber(type, key, value, oldValue, nativeEvent, nativeTransaction));
255
255
  if (this.keySubscribers.has(key)) {
256
- this.keySubscribers.get(key).forEach(subscriber => subscriber(key, value, oldValue, type, nativeEvent, nativeTransaction));
256
+ this.keySubscribers.get(key).forEach(subscriber => subscriber(type, value, oldValue, nativeEvent, nativeTransaction));
257
257
  }
258
258
  }
259
- subscribeDeep(callback) {
260
- this.deepSubscribers.push(callback);
261
- return () => this.unsubscribeDeep(callback);
259
+ subscribeDeep(subscriber) {
260
+ this.deepSubscribers.push(subscriber);
261
+ return () => this.unsubscribeDeep(subscriber);
262
262
  }
263
- unsubscribeDeep(callback) {
264
- this.deepSubscribers = this.deepSubscribers.filter(subscriber => subscriber !== callback);
263
+ unsubscribeDeep(subscriber) {
264
+ this.deepSubscribers = this.deepSubscribers.filter(s => s !== subscriber);
265
265
  }
266
266
  unsubscribeAllDeep() {
267
267
  this.deepSubscribers = [];
268
268
  }
269
- emitDeep(path, value, oldValue, type, nativeEvent, nativeTransaction) {
270
- this.deepSubscribers.forEach(subscriber => subscriber(path, value, oldValue, type, nativeEvent, nativeTransaction));
269
+ emitDeep(type, path, value, oldValue, nativeEvent, nativeTransaction) {
270
+ this.deepSubscribers.forEach(subscriber => subscriber(type, path, value, oldValue, nativeEvent, nativeTransaction));
271
271
  if (this.parent) {
272
272
  const key = (0, native_utils_1.getKeyFromParent)(this.native);
273
273
  if (key !== undefined) {
274
- this.parent.emitDeep([key, ...path], value, oldValue, type, nativeEvent, nativeTransaction);
274
+ this.parent.emitDeep(type, [key, ...path], value, oldValue, nativeEvent, nativeTransaction);
275
275
  }
276
276
  }
277
277
  }
@@ -288,7 +288,7 @@ class RhineVarBase {
288
288
  if (target instanceof index_1.YMap) {
289
289
  this.observer = (event, transaction) => {
290
290
  event.changes.keys.forEach(({ action, oldValue }, key) => {
291
- const type = action === 'add' ? change_type_enum_1.ChangeType.Add : (action === 'delete' ? change_type_enum_1.ChangeType.Delete : change_type_enum_1.ChangeType.Update);
291
+ const type = action === 'add' ? event_type_enum_1.EventType.ADD : (action === 'delete' ? event_type_enum_1.EventType.DELETE : event_type_enum_1.EventType.UPDATE);
292
292
  if ((0, data_utils_1.isObjectOrArray)(oldValue)) {
293
293
  oldValue = Reflect.get(this, key);
294
294
  if (oldValue instanceof RhineVarBase) {
@@ -296,7 +296,7 @@ class RhineVarBase {
296
296
  }
297
297
  }
298
298
  let value = undefined;
299
- if (type === change_type_enum_1.ChangeType.Add || type === change_type_enum_1.ChangeType.Update) {
299
+ if (type === event_type_enum_1.EventType.ADD || type === event_type_enum_1.EventType.UPDATE) {
300
300
  value = target.get(key);
301
301
  if ((0, native_utils_1.isNative)(value)) {
302
302
  Reflect.set(this._origin, key, (0, rhine_proxy_1.rhineProxyGeneral)(value, this));
@@ -305,13 +305,13 @@ class RhineVarBase {
305
305
  Reflect.set(this._origin, key, value);
306
306
  }
307
307
  }
308
- else if (type === change_type_enum_1.ChangeType.Delete) {
308
+ else if (type === event_type_enum_1.EventType.DELETE) {
309
309
  Reflect.deleteProperty(this._origin, key);
310
310
  }
311
311
  const newValue = key in this ? Reflect.get(this, key) : value;
312
312
  (0, logger_1.log)('Proxy.event: Map', action, key + ':', oldValue, '->', newValue);
313
- this.emit(key, newValue, oldValue, type, event, transaction);
314
- this.emitDeep([key], newValue, oldValue, type, event, transaction);
313
+ this.emit(type, key, newValue, oldValue, event, transaction);
314
+ this.emitDeep(type, [key], newValue, oldValue, event, transaction);
315
315
  });
316
316
  };
317
317
  }
@@ -335,8 +335,8 @@ class RhineVarBase {
335
335
  Reflect.deleteProperty(this._origin, k);
336
336
  }
337
337
  (0, logger_1.log)('Proxy.event: Array delete', i + ':', oldValue, '->', undefined);
338
- this.emit(i, undefined, oldValue, change_type_enum_1.ChangeType.Delete, event, transaction);
339
- this.emitDeep([i], undefined, oldValue, change_type_enum_1.ChangeType.Delete, event, transaction);
338
+ this.emit(event_type_enum_1.EventType.DELETE, i, undefined, oldValue, event, transaction);
339
+ this.emitDeep(event_type_enum_1.EventType.DELETE, [i], undefined, oldValue, event, transaction);
340
340
  i++;
341
341
  }
342
342
  }
@@ -354,8 +354,8 @@ class RhineVarBase {
354
354
  }
355
355
  const newValue = i in this ? Reflect.get(this, i) : target.get(i);
356
356
  (0, logger_1.log)('Proxy.event: Array add', i, ':', undefined, '->', newValue);
357
- this.emit(i, newValue, undefined, change_type_enum_1.ChangeType.Add, event, transaction);
358
- this.emitDeep([i], newValue, undefined, change_type_enum_1.ChangeType.Add, event, transaction);
357
+ this.emit(event_type_enum_1.EventType.ADD, i, newValue, undefined, event, transaction);
358
+ this.emitDeep(event_type_enum_1.EventType.ADD, [i], newValue, undefined, event, transaction);
359
359
  i++;
360
360
  });
361
361
  }
@@ -381,8 +381,8 @@ class RhineVarBase {
381
381
  let i = 0;
382
382
  if (isUpdate) {
383
383
  (0, logger_1.log)('Proxy.event: Text update', ':', oldValue, '->', newValue);
384
- this.emit(i, newValue, oldValue, change_type_enum_1.ChangeType.Update, event, transaction);
385
- this.emitDeep([i], newValue, oldValue, change_type_enum_1.ChangeType.Update, event, transaction);
384
+ this.emit(event_type_enum_1.EventType.UPDATE, i, newValue, oldValue, event, transaction);
385
+ this.emitDeep(event_type_enum_1.EventType.UPDATE, [i], newValue, oldValue, event, transaction);
386
386
  }
387
387
  else {
388
388
  event.delta.forEach(deltaItem => {
@@ -392,14 +392,14 @@ class RhineVarBase {
392
392
  }
393
393
  if (deltaItem.delete !== undefined) {
394
394
  (0, logger_1.log)('Proxy.event: Text delete', i, ':', oldValue, '->', newValue);
395
- this.emit(i, newValue, oldValue, change_type_enum_1.ChangeType.Delete, event, transaction);
396
- this.emitDeep([i], newValue, oldValue, change_type_enum_1.ChangeType.Delete, event, transaction);
395
+ this.emit(event_type_enum_1.EventType.DELETE, i, newValue, oldValue, event, transaction);
396
+ this.emitDeep(event_type_enum_1.EventType.DELETE, [i], newValue, oldValue, event, transaction);
397
397
  i += deltaItem.delete;
398
398
  }
399
399
  else if (deltaItem.insert !== undefined) {
400
400
  (0, logger_1.log)('Proxy.event: Text add', i, ':', oldValue, '->', newValue);
401
- this.emit(i, newValue, oldValue, change_type_enum_1.ChangeType.Add, event, transaction);
402
- this.emitDeep([i], newValue, oldValue, change_type_enum_1.ChangeType.Add, event, transaction);
401
+ this.emit(event_type_enum_1.EventType.ADD, i, newValue, oldValue, event, transaction);
402
+ this.emitDeep(event_type_enum_1.EventType.ADD, [i], newValue, oldValue, event, transaction);
403
403
  i += newValue.length;
404
404
  }
405
405
  });
@@ -408,8 +408,8 @@ class RhineVarBase {
408
408
  }
409
409
  else {
410
410
  this.observer = (event, transaction) => {
411
- this.emit(undefined, undefined, undefined, change_type_enum_1.ChangeType.Update, event, transaction);
412
- this.emitDeep(undefined, undefined, undefined, change_type_enum_1.ChangeType.Update, event, transaction);
411
+ this.emit(event_type_enum_1.EventType.UPDATE, undefined, undefined, undefined, event, transaction);
412
+ this.emitDeep(event_type_enum_1.EventType.UPDATE, undefined, undefined, undefined, event, transaction);
413
413
  };
414
414
  }
415
415
  if (this.observer) {
package/dist/index.d.ts CHANGED
@@ -17,7 +17,7 @@ import item from "./core/proxy/items/item";
17
17
  import { Doc as YDoc, Array as YArray, Map as YMap, Text as YText, XmlFragment as YXmlFragment, XmlElement as YXmlElement, XmlText as YXmlText } from "yjs";
18
18
  import ProxyOptions from "./core/proxy/proxy-options.interface";
19
19
  import { UndoManagerOptions } from "yjs/dist/src/utils/UndoManager";
20
- import { ChangeType } from "./core/event/change-type.enum";
20
+ import { EventType } from "./core/subscriber/event-type.enum";
21
21
  export type { StoredRhineVar, RhineVarAny, RecursiveCrossRhineVar, RecursiveObject, RecursiveArray, RecursiveMap, Native, RvPath, RvKey, ProxyOptions, UndoManagerOptions, };
22
- export { Connector, rhineProxy, rhineProxyGeneral, item, text, map, RhineVarBase, RhineVar, RhineVarMap, RhineVarArray, RhineVarText, RhineVarXmlText, RhineVarXmlElement, RhineVarXmlFragment, SupportManager, enableRhineVarLog, enableRhineVarSyncHandshakeCheck, getRhineVarConfig, YDoc, YMap, YArray, YText, YXmlFragment, YXmlElement, YXmlText, ChangeType, };
22
+ export { Connector, rhineProxy, rhineProxyGeneral, item, text, map, RhineVarBase, RhineVar, RhineVarMap, RhineVarArray, RhineVarText, RhineVarXmlText, RhineVarXmlElement, RhineVarXmlFragment, SupportManager, enableRhineVarLog, enableRhineVarSyncHandshakeCheck, getRhineVarConfig, YDoc, YMap, YArray, YText, YXmlFragment, YXmlElement, YXmlText, EventType, };
23
23
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,iBAAiB,EAAC,iCAAiC;AACvE,OAAO,EAAE,QAAQ,EAAE,sBAAsB,EAAE,cAAc,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,EAAE,YAAY,EAAE,kCAAkC;AACzJ,OAAO,SAAS,4CAA4C;AAC5D,OAAO,EAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAC,kCAAkC;AAChE,OAAO,EAAC,iBAAiB,EAAE,iBAAiB,EAAE,gCAAgC,EAAC,wBAAwB;AACvG,OAAO,YAAY,wCAAwC;AAC3D,OAAO,WAAW,6CAA6C;AAC/D,OAAO,aAAa,+CAA+C;AACnE,OAAO,YAAY,8CAA8C;AACjE,OAAO,eAAe,kDAAkD;AACxE,OAAO,kBAAkB,qDAAqD;AAC9E,OAAO,mBAAmB,sDAAsD;AAChF,OAAO,cAAc,2CAA2C;AAChE,OAAO,IAAI,gCAAgC;AAC3C,OAAO,GAAG,MAAM,wBAAwB,CAAC;AACzC,OAAO,IAAI,MAAM,yBAAyB,CAAC;AAC3C,OAAO,EACL,GAAG,IAAI,IAAI,EACX,KAAK,IAAI,MAAM,EACf,GAAG,IAAI,IAAI,EACX,IAAI,IAAI,KAAK,EACb,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OAAO,eAAe,kDAAkD;AACxE,OAAO,kBAAkB,qDAAqD;AAC9E,OAAO,mBAAmB,sDAAsD;AAChF,OAAO,cAAc,2CAA2C;AAChE,OAAO,IAAI,gCAAgC;AAC3C,OAAO,GAAG,MAAM,wBAAwB,CAAC;AACzC,OAAO,IAAI,MAAM,yBAAyB,CAAC;AAC3C,OAAO,EACL,GAAG,IAAI,IAAI,EACX,KAAK,IAAI,MAAM,EACf,GAAG,IAAI,IAAI,EACX,IAAI,IAAI,KAAK,EACb,WAAW,IAAI,YAAY,EAC3B,UAAU,IAAI,WAAW,EACzB,OAAO,IAAI,QAAQ,EACpB,MAAM,KAAK,CAAC;AACb,OAAO,YAAY,MAAM,sCAAsC,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAE9D,YAAY,EACV,cAAc,EACd,WAAW,EACX,sBAAsB,EACtB,eAAe,EACf,cAAc,EACd,YAAY,EACZ,MAAM,EACN,MAAM,EACN,KAAK,EACL,YAAY,EACZ,kBAAkB,GACnB,CAAA;AAED,OAAO,EACL,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,IAAI,EACJ,IAAI,EACJ,GAAG,EACH,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,aAAa,EACb,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,gCAAgC,EAChC,iBAAiB,EACjB,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,KAAK,EACL,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,SAAS,GACV,CAAA"}
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ChangeType = exports.YXmlText = exports.YXmlElement = exports.YXmlFragment = exports.YText = exports.YArray = exports.YMap = exports.YDoc = exports.getRhineVarConfig = exports.enableRhineVarSyncHandshakeCheck = exports.enableRhineVarLog = exports.SupportManager = exports.RhineVarXmlFragment = exports.RhineVarXmlElement = exports.RhineVarXmlText = exports.RhineVarText = exports.RhineVarArray = exports.RhineVarMap = exports.RhineVarBase = exports.map = exports.text = exports.item = exports.rhineProxyGeneral = exports.rhineProxy = exports.Connector = void 0;
6
+ exports.EventType = exports.YXmlText = exports.YXmlElement = exports.YXmlFragment = exports.YText = exports.YArray = exports.YMap = exports.YDoc = exports.getRhineVarConfig = exports.enableRhineVarSyncHandshakeCheck = exports.enableRhineVarLog = exports.SupportManager = exports.RhineVarXmlFragment = exports.RhineVarXmlElement = exports.RhineVarXmlText = exports.RhineVarText = exports.RhineVarArray = exports.RhineVarMap = exports.RhineVarBase = exports.map = exports.text = exports.item = exports.rhineProxyGeneral = exports.rhineProxy = exports.Connector = void 0;
7
7
  const rhine_proxy_1 = require("./core/proxy/rhine-proxy");
8
8
  Object.defineProperty(exports, "rhineProxy", { enumerable: true, get: function () { return rhine_proxy_1.rhineProxy; } });
9
9
  Object.defineProperty(exports, "rhineProxyGeneral", { enumerable: true, get: function () { return rhine_proxy_1.rhineProxyGeneral; } });
@@ -43,5 +43,5 @@ Object.defineProperty(exports, "YText", { enumerable: true, get: function () { r
43
43
  Object.defineProperty(exports, "YXmlFragment", { enumerable: true, get: function () { return yjs_1.XmlFragment; } });
44
44
  Object.defineProperty(exports, "YXmlElement", { enumerable: true, get: function () { return yjs_1.XmlElement; } });
45
45
  Object.defineProperty(exports, "YXmlText", { enumerable: true, get: function () { return yjs_1.XmlText; } });
46
- const change_type_enum_1 = require("./core/event/change-type.enum");
47
- Object.defineProperty(exports, "ChangeType", { enumerable: true, get: function () { return change_type_enum_1.ChangeType; } });
46
+ const event_type_enum_1 = require("./core/subscriber/event-type.enum");
47
+ Object.defineProperty(exports, "EventType", { enumerable: true, get: function () { return event_type_enum_1.EventType; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rhine-var",
3
- "version": "0.10.1",
3
+ "version": "0.10.4",
4
4
  "description": "Variables that support multi-user collaboration and persistence, making collaboration and variable operations as simple as possible, with strict and well-defined type hints.",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",
@@ -39,12 +39,12 @@
39
39
  ],
40
40
  "repository": {
41
41
  "type": "git",
42
- "url": "https://github.com/RhineAI-Lab/rhine-var.git"
42
+ "url": "https://github.com/RhineAI/rhine-var.git"
43
43
  },
44
44
  "bugs": {
45
- "url": "https://github.com/RhineAI-Lab/rhine-var/issues"
45
+ "url": "https://github.com/RhineAI/rhine-var/issues"
46
46
  },
47
- "homepage": "https://github.com/RhineAI-Lab/rhine-var#readme",
47
+ "homepage": "https://github.com/RhineAI/rhine-var#readme",
48
48
  "devDependencies": {
49
49
  "@testing-library/jest-dom": "^6.5.0",
50
50
  "@testing-library/react": "^16.0.1",
@@ -1,8 +0,0 @@
1
- import { ChangeType } from "./change-type.enum";
2
- import { Transaction, YArrayEvent, YMapEvent, YTextEvent } from "yjs";
3
- import { RvPath } from "../native/native.type";
4
- import { StoredRhineVar } from "../var/rhine-var.type";
5
- export type Callback<T> = (key: keyof T, value: T[keyof T] extends object ? T[keyof T] | StoredRhineVar<T[keyof T]> : T[keyof T], oldValue: T[keyof T], type: ChangeType, nativeEvent: YMapEvent<any> | YArrayEvent<any> | YTextEvent, nativeTransaction: Transaction) => void;
6
- export type DeepCallback<T> = (path: RvPath, value: any | StoredRhineVar<any>, oldValue: any, type: ChangeType, nativeEvent: YMapEvent<any> | YArrayEvent<any> | YTextEvent, nativeTransaction: Transaction) => void;
7
- export type SyncedCallback = (synced: boolean) => void;
8
- //# sourceMappingURL=callback.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"callback.d.ts","sourceRoot":"","sources":["../../../src/core/event/callback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,2BAAsC;AACzD,OAAO,EAAgB,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAC,MAAM,KAAK,CAAC;AACnF,OAAO,EAAC,MAAM,EAAC,8BAAkC;AACjD,OAAO,EAAC,cAAc,EAAC,8BAAkC;AAGzD,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,CACxB,GAAG,EAAE,MAAM,CAAC,EACZ,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,EACvF,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EACpB,IAAI,EAAE,UAAU,EAChB,WAAW,EAAE,SAAS,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,UAAU,EAC3D,iBAAiB,EAAE,WAAW,KAC3B,IAAI,CAAA;AAET,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAC5B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,GAAG,GAAG,cAAc,CAAC,GAAG,CAAC,EAChC,QAAQ,EAAE,GAAG,EACb,IAAI,EAAE,UAAU,EAChB,WAAW,EAAE,SAAS,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,UAAU,EAC3D,iBAAiB,EAAE,WAAW,KAC3B,IAAI,CAAA;AAET,MAAM,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAA"}
@@ -1,7 +0,0 @@
1
- export declare enum ChangeType {
2
- Add = "ADD",// For YMap / YArray
3
- Update = "UPDATE",// For YMap
4
- Delete = "DELETE",// For YMap / YArray
5
- Sync = "SYNC"
6
- }
7
- //# sourceMappingURL=change-type.enum.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"change-type.enum.d.ts","sourceRoot":"","sources":["../../../src/core/event/change-type.enum.ts"],"names":[],"mappings":"AACA,oBAAY,UAAU;IACpB,GAAG,QAAQ,CAAG,oBAAoB;IAClC,MAAM,WAAW,CAAG,WAAW;IAC/B,MAAM,WAAW,CAAG,oBAAoB;IACxC,IAAI,SAAS;CACd"}
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ChangeType = void 0;
4
- var ChangeType;
5
- (function (ChangeType) {
6
- ChangeType["Add"] = "ADD";
7
- ChangeType["Update"] = "UPDATE";
8
- ChangeType["Delete"] = "DELETE";
9
- ChangeType["Sync"] = "SYNC";
10
- })(ChangeType || (exports.ChangeType = ChangeType = {}));