rhine-var 0.9.23 → 0.10.3
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/.github/workflows/release.yml +1 -1
- package/dist/core/connector/connector.abstract.d.ts +4 -4
- package/dist/core/connector/connector.abstract.d.ts.map +1 -1
- package/dist/core/native/y-object.d.ts +0 -1
- package/dist/core/native/y-object.d.ts.map +1 -1
- package/dist/core/native/y-object.js +0 -1
- package/dist/core/proxy/create-rhine-var.js +1 -1
- package/dist/core/proxy/rhine-proxy.d.ts.map +1 -1
- package/dist/core/proxy/rhine-proxy.js +5 -11
- package/dist/core/subscriber/event-type.enum.d.ts +7 -0
- package/dist/core/subscriber/event-type.enum.d.ts.map +1 -0
- package/dist/core/subscriber/event-type.enum.js +10 -0
- package/dist/core/subscriber/subscriber.d.ts +9 -0
- package/dist/core/subscriber/subscriber.d.ts.map +1 -0
- package/dist/core/utils/native.utils.js +2 -3
- package/dist/core/var/items/rhine-var-array.class.d.ts +1 -1
- package/dist/core/var/items/rhine-var-array.class.d.ts.map +1 -1
- package/dist/core/var/items/rhine-var-array.class.js +1 -1
- package/dist/core/var/items/rhine-var-map.class.d.ts +1 -1
- package/dist/core/var/items/rhine-var-map.class.d.ts.map +1 -1
- package/dist/core/var/items/rhine-var-map.class.js +1 -1
- package/dist/core/var/items/rhine-var-object.class.d.ts +1 -1
- package/dist/core/var/items/rhine-var-object.class.d.ts.map +1 -1
- package/dist/core/var/items/rhine-var-object.class.js +1 -1
- package/dist/core/var/items/rhine-var-text.class.d.ts +1 -1
- package/dist/core/var/items/rhine-var-text.class.d.ts.map +1 -1
- package/dist/core/var/items/rhine-var-text.class.js +1 -1
- package/dist/core/var/items/rhine-var-xml-element.class.d.ts +1 -1
- package/dist/core/var/items/rhine-var-xml-element.class.d.ts.map +1 -1
- package/dist/core/var/items/rhine-var-xml-element.class.js +1 -1
- package/dist/core/var/items/rhine-var-xml-fragment.class.d.ts +1 -1
- package/dist/core/var/items/rhine-var-xml-fragment.class.d.ts.map +1 -1
- package/dist/core/var/items/rhine-var-xml-fragment.class.js +1 -1
- package/dist/core/var/items/rhine-var-xml-text.class.d.ts +1 -1
- package/dist/core/var/items/rhine-var-xml-text.class.d.ts.map +1 -1
- package/dist/core/var/items/rhine-var-xml-text.class.js +1 -1
- package/dist/core/var/rhine-var-base.class.d.ts +20 -19
- package/dist/core/var/rhine-var-base.class.d.ts.map +1 -1
- package/dist/core/var/rhine-var-base.class.js +109 -85
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/package.json +4 -4
- package/dist/core/event/callback.d.ts +0 -8
- package/dist/core/event/callback.d.ts.map +0 -1
- package/dist/core/event/change-type.enum.d.ts +0 -7
- package/dist/core/event/change-type.enum.d.ts.map +0 -1
- package/dist/core/event/change-type.enum.js +0 -10
- /package/dist/core/{event/callback.js → subscriber/subscriber.js} +0 -0
|
@@ -131,7 +131,7 @@ jobs:
|
|
|
131
131
|
npm config set @RhineAI-Lab:registry=https://npm.pkg.github.com
|
|
132
132
|
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> ~/.npmrc
|
|
133
133
|
|
|
134
|
-
- name: Publish to
|
|
134
|
+
- name: Publish to Github
|
|
135
135
|
run: npm publish
|
|
136
136
|
env:
|
|
137
137
|
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
|
@@ -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 {
|
|
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:
|
|
13
|
-
subscribeSynced(callback:
|
|
14
|
-
unsubscribeSynced(callback:
|
|
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,
|
|
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,gBAAgB,EAAC,iCAAqC;AAE9D,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;IACb,MAAM,UAAQ;IAEd,MAAM,EAAE,eAAe,CAA+B;IAGtD,SAAS,CAAC,iBAAiB,EAAE,gBAAgB,EAAE,CAAK;IACpD,eAAe,CAAC,QAAQ,EAAE,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"y-object.d.ts","sourceRoot":"","sources":["../../../src/core/native/y-object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,IAAI,IAAI,EAAC,MAAM,KAAK,CAAC;AAEhC,MAAM,CAAC,OAAO,OAAO,OAAO,CAAC,CAAC,CAAE,SAAQ,IAAI,CAAC,GAAG,CAAC;;
|
|
1
|
+
{"version":3,"file":"y-object.d.ts","sourceRoot":"","sources":["../../../src/core/native/y-object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,IAAI,IAAI,EAAC,MAAM,KAAK,CAAC;AAEhC,MAAM,CAAC,OAAO,OAAO,OAAO,CAAC,CAAC,CAAE,SAAQ,IAAI,CAAC,GAAG,CAAC;;CAMhD"}
|
|
@@ -18,7 +18,7 @@ function createRhineVar(target, parent) {
|
|
|
18
18
|
return new rhine_var_object_class_1.default(target, parent);
|
|
19
19
|
}
|
|
20
20
|
else if (target instanceof index_1.YMap) {
|
|
21
|
-
if (target.get('
|
|
21
|
+
if (target.get('_class') === 'RhineVarObject') {
|
|
22
22
|
return new rhine_var_object_class_1.default(target, parent);
|
|
23
23
|
}
|
|
24
24
|
return new rhine_var_map_class_1.default(target, parent);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rhine-proxy.d.ts","sourceRoot":"","sources":["../../../src/core/proxy/rhine-proxy.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,wCAA4C;AAC5D,OAAO,YAA+C,oCAAwC;AAE9F,OAAO,
|
|
1
|
+
{"version":3,"file":"rhine-proxy.d.ts","sourceRoot":"","sources":["../../../src/core/proxy/rhine-proxy.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,wCAA4C;AAC5D,OAAO,YAA+C,oCAAwC;AAE9F,OAAO,EAAc,cAAc,EAAC,8BAAkC;AACtE,OAAO,EAAC,MAAM,EAAC,8BAAkC;AAOjD,OAAO,YAAY,kCAA6C;AAGhE,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,EACzC,YAAY,EAAE,CAAC,GAAG,MAAM,EACxB,SAAS,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,MAAM,EACvC,OAAO,GAAE,YAAiB,GACzB,cAAc,CAAC,CAAC,CAAC,CAmCnB;AAGD,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,EAChD,IAAI,EAAE,CAAC,GAAG,MAAM,EAChB,MAAM,GAAE,YAAY,GAAG,IAAW,GACjC,cAAc,CAAC,CAAC,CAAC,CAyGnB"}
|
|
@@ -32,8 +32,8 @@ function rhineProxy(defaultValue, connector, options = {}) {
|
|
|
32
32
|
}
|
|
33
33
|
connector = connector;
|
|
34
34
|
const root = object;
|
|
35
|
-
root.
|
|
36
|
-
root.
|
|
35
|
+
root._options = options;
|
|
36
|
+
root._connector = connector;
|
|
37
37
|
// Bind connector
|
|
38
38
|
connector.subscribeSynced((synced) => {
|
|
39
39
|
if (options.overwrite) {
|
|
@@ -42,7 +42,7 @@ function rhineProxy(defaultValue, connector, options = {}) {
|
|
|
42
42
|
if (!connector.hasState()) {
|
|
43
43
|
connector.setState(object.native.clone());
|
|
44
44
|
}
|
|
45
|
-
object.
|
|
45
|
+
object._initialize(connector.getState());
|
|
46
46
|
});
|
|
47
47
|
return object;
|
|
48
48
|
}
|
|
@@ -124,19 +124,13 @@ function rhineProxyGeneral(data, parent = null) {
|
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
value = (0, var_utils_1.ensureRhineVar)(value, object);
|
|
127
|
-
|
|
128
|
-
if (!result)
|
|
129
|
-
(0, logger_1.error)('Failed to set value');
|
|
130
|
-
return result;
|
|
127
|
+
return (0, native_utils_1.nativeSet)(object.native, p, value);
|
|
131
128
|
},
|
|
132
129
|
deleteProperty(proxy, p) {
|
|
133
130
|
if (rhine_var_base_class_1.RHINE_VAR_PREDEFINED_PROPERTIES.has(p))
|
|
134
131
|
return false;
|
|
135
132
|
(0, logger_1.log)('Proxy.handler.deleteProperty:', p);
|
|
136
|
-
|
|
137
|
-
if (!result)
|
|
138
|
-
(0, logger_1.error)('Failed to delete value');
|
|
139
|
-
return result;
|
|
133
|
+
return (0, native_utils_1.nativeDelete)(object.native, p);
|
|
140
134
|
},
|
|
141
135
|
has(proxy, p) {
|
|
142
136
|
if (rhine_var_base_class_1.RHINE_VAR_PREDEFINED_PROPERTIES.has(p))
|
|
@@ -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,GA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");
|
|
|
16
16
|
const data_utils_1 = require("./data.utils");
|
|
17
17
|
const rhine_var_base_class_1 = __importDefault(require("../var/rhine-var-base.class"));
|
|
18
18
|
const logger_1 = require("../../utils/logger");
|
|
19
|
-
const y_object_1 = __importDefault(require("../native/y-object"));
|
|
20
19
|
function isNative(value) {
|
|
21
20
|
return value instanceof index_1.YMap
|
|
22
21
|
|| value instanceof index_1.YArray
|
|
@@ -146,11 +145,11 @@ function jsonToNative(data) {
|
|
|
146
145
|
return map;
|
|
147
146
|
}
|
|
148
147
|
if ((0, data_utils_1.isObject)(data)) {
|
|
149
|
-
let map = new
|
|
148
|
+
let map = new index_1.YMap();
|
|
150
149
|
Object.entries(data).forEach(([key, value]) => {
|
|
151
150
|
map.set(key, jsonToNative(value));
|
|
152
151
|
});
|
|
153
|
-
map.set('
|
|
152
|
+
map.set('_class', 'RhineVarObject');
|
|
154
153
|
return map;
|
|
155
154
|
}
|
|
156
155
|
if ((0, data_utils_1.isArray)(data)) {
|
|
@@ -2,7 +2,7 @@ import RhineVarBase from "../rhine-var-base.class";
|
|
|
2
2
|
import { NativeType } from "../../native/native-type.enum";
|
|
3
3
|
import { InputItem } from "../rhine-var.type";
|
|
4
4
|
export default class RhineVarArray<T = any, N = any> extends RhineVarBase<T[]> implements Iterable<T> {
|
|
5
|
-
|
|
5
|
+
_type: NativeType.Array;
|
|
6
6
|
[key: number]: T;
|
|
7
7
|
length: number;
|
|
8
8
|
insert(index: number, ...items: InputItem<N>[]): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rhine-var-array.class.d.ts","sourceRoot":"","sources":["../../../../src/core/var/items/rhine-var-array.class.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,gCAAwC;AAC3D,OAAO,EAAC,UAAU,EAAC,sCAAuC;AAC1D,OAAO,EAAC,SAAS,EAAC,0BAAkC;AAGpD,MAAM,CAAC,OAAO,OAAO,aAAa,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG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9,7 +9,7 @@ const native_type_enum_1 = require("../../native/native-type.enum");
|
|
|
9
9
|
class RhineVarArray extends rhine_var_base_class_1.default {
|
|
10
10
|
constructor() {
|
|
11
11
|
super(...arguments);
|
|
12
|
-
this.
|
|
12
|
+
this._type = native_type_enum_1.NativeType.Array;
|
|
13
13
|
this.length = 0;
|
|
14
14
|
this[_a] = {
|
|
15
15
|
copyWithin: true,
|
|
@@ -4,7 +4,7 @@ import { InputItem } from "../rhine-var.type";
|
|
|
4
4
|
export default class RhineVarMap<T = any, N = any> extends RhineVarBase<{
|
|
5
5
|
[key: string]: T;
|
|
6
6
|
}> implements Iterable<[string, T]> {
|
|
7
|
-
|
|
7
|
+
_type: NativeType.Map;
|
|
8
8
|
size: number;
|
|
9
9
|
set(key: string, value: InputItem<N>): void;
|
|
10
10
|
get(key: string): T | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rhine-var-map.class.d.ts","sourceRoot":"","sources":["../../../../src/core/var/items/rhine-var-map.class.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,gCAAwC;AAC3D,OAAO,EAAC,UAAU,EAAC,sCAAuC;AAC1D,OAAO,EAAC,SAAS,EAAC,0BAAkC;AAEpD,MAAM,CAAC,OAAO,OAAO,WAAW,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,CAAE,SAAQ,YAAY,CAAC;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAA;CAAC,CAAE,YAAW,QAAQ,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAE1H,
|
|
1
|
+
{"version":3,"file":"rhine-var-map.class.d.ts","sourceRoot":"","sources":["../../../../src/core/var/items/rhine-var-map.class.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,gCAAwC;AAC3D,OAAO,EAAC,UAAU,EAAC,sCAAuC;AAC1D,OAAO,EAAC,SAAS,EAAC,0BAAkC;AAEpD,MAAM,CAAC,OAAO,OAAO,WAAW,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,CAAE,SAAQ,YAAY,CAAC;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAA;CAAC,CAAE,YAAW,QAAQ,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAE1H,KAAK,EAAE,UAAU,CAAC,GAAG,CAAiB;IAEtC,IAAI,EAAE,MAAM,CAAK;IAEjB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI;IAG3C,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAI/B,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIzB,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,KAAK,IAAI,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,IAAI;IAGlF,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAI5B,KAAK,IAAI,IAAI;IAGb,IAAI,IAAI,gBAAgB,CAAC,MAAM,CAAC;IAIhC,MAAM,IAAI,gBAAgB,CAAC,CAAC,CAAC;IAI7B,OAAO,IAAI,gBAAgB,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAIxC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,gBAAgB,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;CAQnD"}
|
|
@@ -8,7 +8,7 @@ const native_type_enum_1 = require("../../native/native-type.enum");
|
|
|
8
8
|
class RhineVarMap extends rhine_var_base_class_1.default {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments);
|
|
11
|
-
this.
|
|
11
|
+
this._type = native_type_enum_1.NativeType.Map;
|
|
12
12
|
this.size = -1;
|
|
13
13
|
// Enable this if we need to use dynamic keys later
|
|
14
14
|
// @ts-ignore
|
|
@@ -2,7 +2,7 @@ import RhineVarBase from "../rhine-var-base.class";
|
|
|
2
2
|
import { NativeType } from "../../native/native-type.enum";
|
|
3
3
|
import { InputItem, OutputItem } from "../rhine-var.type";
|
|
4
4
|
export default class RhineVarObject<T extends object = any> extends RhineVarBase<T> implements Iterable<[keyof T, OutputItem<T[keyof T]>]> {
|
|
5
|
-
|
|
5
|
+
_type: NativeType.Object;
|
|
6
6
|
set(key: keyof T, value: InputItem<T[keyof T]>): void;
|
|
7
7
|
get(key: keyof T): OutputItem<T[keyof T]> | undefined;
|
|
8
8
|
has(key: keyof T): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rhine-var-object.class.d.ts","sourceRoot":"","sources":["../../../../src/core/var/items/rhine-var-object.class.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,gCAAwC;AAC3D,OAAO,EAAC,UAAU,EAAC,sCAAuC;AAC1D,OAAO,EAAC,SAAS,EAAE,UAAU,EAAiB,0BAAkC;AAEhF,MAAM,CAAC,OAAO,OAAO,cAAc,CAAC,CAAC,SAAS,MAAM,GAAG,GAAG,CAAE,SAAQ,YAAY,CAAC,CAAC,CAAE,YAAW,QAAQ,CAAC,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAExI,
|
|
1
|
+
{"version":3,"file":"rhine-var-object.class.d.ts","sourceRoot":"","sources":["../../../../src/core/var/items/rhine-var-object.class.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,gCAAwC;AAC3D,OAAO,EAAC,UAAU,EAAC,sCAAuC;AAC1D,OAAO,EAAC,SAAS,EAAE,UAAU,EAAiB,0BAAkC;AAEhF,MAAM,CAAC,OAAO,OAAO,cAAc,CAAC,CAAC,SAAS,MAAM,GAAG,GAAG,CAAE,SAAQ,YAAY,CAAC,CAAC,CAAE,YAAW,QAAQ,CAAC,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAExI,KAAK,EAAE,UAAU,CAAC,MAAM,CAAqB;IAE7C,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI;IAIrD,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,SAAS;IAIrD,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,OAAO;IAI1B,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,GAAG,EAAE,cAAc,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,IAAI;IAGrH,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,OAAO;IAI7B,IAAI,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAIjC,MAAM,IAAI,gBAAgB,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAIlD,OAAO,IAAI,gBAAgB,CAAC,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAI9D,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;CAIjE"}
|
|
@@ -8,7 +8,7 @@ const native_type_enum_1 = require("../../native/native-type.enum");
|
|
|
8
8
|
class RhineVarObject extends rhine_var_base_class_1.default {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments);
|
|
11
|
-
this.
|
|
11
|
+
this._type = native_type_enum_1.NativeType.Object;
|
|
12
12
|
}
|
|
13
13
|
set(key, value) {
|
|
14
14
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import RhineVarBase from "../rhine-var-base.class";
|
|
2
2
|
import { NativeType } from "../../native/native-type.enum";
|
|
3
3
|
export default class RhineVarText extends RhineVarBase implements Iterable<string> {
|
|
4
|
-
|
|
4
|
+
_type: NativeType.Text;
|
|
5
5
|
value: string;
|
|
6
6
|
length: number;
|
|
7
7
|
json(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rhine-var-text.class.d.ts","sourceRoot":"","sources":["../../../../src/core/var/items/rhine-var-text.class.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,gCAAwC;AAC3D,OAAO,EAAE,UAAU,EAAE,sCAAuC;AAE5D,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,YAAa,YAAW,QAAQ,CAAC,MAAM,CAAC;IAEhF,
|
|
1
|
+
{"version":3,"file":"rhine-var-text.class.d.ts","sourceRoot":"","sources":["../../../../src/core/var/items/rhine-var-text.class.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,gCAAwC;AAC3D,OAAO,EAAE,UAAU,EAAE,sCAAuC;AAE5D,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,YAAa,YAAW,QAAQ,CAAC,MAAM,CAAC;IAEhF,KAAK,EAAE,UAAU,CAAC,IAAI,CAAkB;IAExC,KAAK,EAAE,MAAM,CAAK;IAElB,MAAM,EAAE,MAAM,CAAK;IAEnB,IAAI,IAAI,MAAM;IAId,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM;IAI5C,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM;IAI7C,KAAK;IAIL,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAIzB,MAAM,CAAC,KAAK,EAAE,MAAM,GA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,YAAY,EAAE,MAAM,GAAG,MAAM;IAItE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAI9B,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM;IAI1C,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE;IAI3D,UAAU,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO;IAI5D,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM;IAI9C,iBAAiB,IAAI,MAAM;IAI3B,iBAAiB,IAAI,MAAM;IAI3B,WAAW,IAAI,MAAM;IAIrB,QAAQ,IAAI,MAAM;IAIlB,WAAW,IAAI,MAAM;IAIrB,YAAY,IAAI,MAAM;IAItB,IAAI,IAAI,MAAM;IAId,OAAO,IAAI,MAAM;IAIjB,SAAS,IAAI,MAAM;IAInB,OAAO,IAAI,MAAM;IAIjB,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,gBAAgB,CAAC,MAAM,CAAC;CAI9C"}
|
|
@@ -8,7 +8,7 @@ const native_type_enum_1 = require("../../native/native-type.enum");
|
|
|
8
8
|
class RhineVarText extends rhine_var_base_class_1.default {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments);
|
|
11
|
-
this.
|
|
11
|
+
this._type = native_type_enum_1.NativeType.Text;
|
|
12
12
|
this.value = '';
|
|
13
13
|
this.length = -1;
|
|
14
14
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import RhineVarBase from "../rhine-var-base.class";
|
|
2
2
|
import { NativeType } from "../../native/native-type.enum";
|
|
3
3
|
export default class RhineVarXmlElement<T extends object = any> extends RhineVarBase<T> {
|
|
4
|
-
|
|
4
|
+
_type: NativeType.XmlElement;
|
|
5
5
|
}
|
|
6
6
|
//# sourceMappingURL=rhine-var-xml-element.class.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rhine-var-xml-element.class.d.ts","sourceRoot":"","sources":["../../../../src/core/var/items/rhine-var-xml-element.class.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,gCAAwC;AAC3D,OAAO,EAAC,UAAU,EAAC,sCAAuC;AAE1D,MAAM,CAAC,OAAO,OAAO,kBAAkB,CAAC,CAAC,SAAS,MAAM,GAAG,GAAG,CAAE,SAAQ,YAAY,CAAC,CAAC,CAAC;IAErF,
|
|
1
|
+
{"version":3,"file":"rhine-var-xml-element.class.d.ts","sourceRoot":"","sources":["../../../../src/core/var/items/rhine-var-xml-element.class.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,gCAAwC;AAC3D,OAAO,EAAC,UAAU,EAAC,sCAAuC;AAE1D,MAAM,CAAC,OAAO,OAAO,kBAAkB,CAAC,CAAC,SAAS,MAAM,GAAG,GAAG,CAAE,SAAQ,YAAY,CAAC,CAAC,CAAC;IAErF,KAAK,EAAE,UAAU,CAAC,UAAU,CAAwB;CAErD"}
|
|
@@ -8,7 +8,7 @@ const native_type_enum_1 = require("../../native/native-type.enum");
|
|
|
8
8
|
class RhineVarXmlElement extends rhine_var_base_class_1.default {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments);
|
|
11
|
-
this.
|
|
11
|
+
this._type = native_type_enum_1.NativeType.XmlElement;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
exports.default = RhineVarXmlElement;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import RhineVarBase from "../rhine-var-base.class";
|
|
2
2
|
import { NativeType } from "../../native/native-type.enum";
|
|
3
3
|
export default class RhineVarXmlFragment extends RhineVarBase {
|
|
4
|
-
|
|
4
|
+
_type: NativeType.XmlFragment;
|
|
5
5
|
}
|
|
6
6
|
//# sourceMappingURL=rhine-var-xml-fragment.class.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rhine-var-xml-fragment.class.d.ts","sourceRoot":"","sources":["../../../../src/core/var/items/rhine-var-xml-fragment.class.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,gCAAwC;AAC3D,OAAO,EAAC,UAAU,EAAC,sCAAuC;AAE1D,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,YAAY;IAE3D,
|
|
1
|
+
{"version":3,"file":"rhine-var-xml-fragment.class.d.ts","sourceRoot":"","sources":["../../../../src/core/var/items/rhine-var-xml-fragment.class.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,gCAAwC;AAC3D,OAAO,EAAC,UAAU,EAAC,sCAAuC;AAE1D,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,YAAY;IAE3D,KAAK,EAAE,UAAU,CAAC,WAAW,CAAyB;CAEvD"}
|
|
@@ -8,7 +8,7 @@ const native_type_enum_1 = require("../../native/native-type.enum");
|
|
|
8
8
|
class RhineVarXmlFragment extends rhine_var_base_class_1.default {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments);
|
|
11
|
-
this.
|
|
11
|
+
this._type = native_type_enum_1.NativeType.XmlFragment;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
exports.default = RhineVarXmlFragment;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import RhineVarBase from "../rhine-var-base.class";
|
|
2
2
|
import { NativeType } from "../../native/native-type.enum";
|
|
3
3
|
export default class RhineVarXmlText extends RhineVarBase {
|
|
4
|
-
|
|
4
|
+
_type: NativeType.XmlText;
|
|
5
5
|
}
|
|
6
6
|
//# sourceMappingURL=rhine-var-xml-text.class.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rhine-var-xml-text.class.d.ts","sourceRoot":"","sources":["../../../../src/core/var/items/rhine-var-xml-text.class.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,gCAAwC;AAC3D,OAAO,EAAC,UAAU,EAAC,sCAAuC;AAE1D,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,YAAY;IAEvD,
|
|
1
|
+
{"version":3,"file":"rhine-var-xml-text.class.d.ts","sourceRoot":"","sources":["../../../../src/core/var/items/rhine-var-xml-text.class.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,gCAAwC;AAC3D,OAAO,EAAC,UAAU,EAAC,sCAAuC;AAE1D,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,YAAY;IAEvD,KAAK,EAAE,UAAU,CAAC,OAAO,CAAqB;CAE/C"}
|
|
@@ -8,7 +8,7 @@ const native_type_enum_1 = require("../../native/native-type.enum");
|
|
|
8
8
|
class RhineVarXmlText extends rhine_var_base_class_1.default {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments);
|
|
11
|
-
this.
|
|
11
|
+
this._type = native_type_enum_1.NativeType.XmlText;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
exports.default = RhineVarXmlText;
|
|
@@ -1,20 +1,20 @@
|
|
|
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 {
|
|
5
|
-
import {
|
|
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> {
|
|
9
9
|
native: Native;
|
|
10
10
|
parent: RhineVarBase | null;
|
|
11
|
-
|
|
12
|
-
constructor(native: Native, parent?: RhineVarBase | null,
|
|
13
|
-
private
|
|
14
|
-
private
|
|
15
|
-
private
|
|
16
|
-
private
|
|
17
|
-
private
|
|
11
|
+
_origin: RhineVarBase<T>;
|
|
12
|
+
constructor(native: Native, parent?: RhineVarBase | null, _origin?: RhineVarBase<T>);
|
|
13
|
+
private _options;
|
|
14
|
+
private _connector;
|
|
15
|
+
private _undoManager;
|
|
16
|
+
private _awareness;
|
|
17
|
+
private _clientId;
|
|
18
18
|
isRoot(): boolean;
|
|
19
19
|
root(): RhineVarBase;
|
|
20
20
|
getOptions(): ProxyOptions;
|
|
@@ -22,31 +22,32 @@ export default abstract class RhineVarBase<T extends object = any> {
|
|
|
22
22
|
getUndoManager(): UndoManager | null;
|
|
23
23
|
getAwareness(): Awareness | null;
|
|
24
24
|
getClientId(): number;
|
|
25
|
-
|
|
25
|
+
private _initialize;
|
|
26
26
|
afterSynced(callback: () => void): void;
|
|
27
27
|
waitSynced(): Promise<unknown>;
|
|
28
28
|
json(): T;
|
|
29
|
+
private _removeBuiltInProperty;
|
|
29
30
|
frozenJson(): T;
|
|
30
31
|
jsonString(indent?: number): string;
|
|
31
32
|
private syncedSubscribers;
|
|
32
|
-
subscribeSynced(callback:
|
|
33
|
-
unsubscribeSynced(callback:
|
|
33
|
+
subscribeSynced(callback: SyncedSubscriber): () => void;
|
|
34
|
+
unsubscribeSynced(callback: SyncedSubscriber): void;
|
|
34
35
|
unsubscribeAllSynced(): void;
|
|
35
36
|
private emitSynced;
|
|
36
37
|
private subscribers;
|
|
37
|
-
subscribe(
|
|
38
|
-
unsubscribe(
|
|
38
|
+
subscribe(subscriber: Subscriber<T>): () => void;
|
|
39
|
+
unsubscribe(subscriber: Subscriber<T>): void;
|
|
39
40
|
unsubscribeAll(): void;
|
|
40
41
|
private keySubscribers;
|
|
41
|
-
subscribeKey(key: keyof T,
|
|
42
|
-
unsubscribeKey(
|
|
42
|
+
subscribeKey(key: keyof T, subscriber: KeySubscriber<T>): () => void;
|
|
43
|
+
unsubscribeKey(subscriber: KeySubscriber<T>): void;
|
|
43
44
|
unsubscribeAllKey(): void;
|
|
44
45
|
private emit;
|
|
45
46
|
private deepSubscribers;
|
|
46
|
-
subscribeDeep(
|
|
47
|
-
unsubscribeDeep(
|
|
47
|
+
subscribeDeep(subscriber: DeepSubscriber<T>): () => void;
|
|
48
|
+
unsubscribeDeep(subscriber: DeepSubscriber<T>): void;
|
|
48
49
|
unsubscribeAllDeep(): void;
|
|
49
|
-
emitDeep(path: RvPath, value: any, oldValue: any,
|
|
50
|
+
emitDeep(type: EventType, path: RvPath, value: any, oldValue: any, nativeEvent: YMapEvent<any> | YArrayEvent<any> | YTextEvent, nativeTransaction: Transaction): void;
|
|
50
51
|
private observer;
|
|
51
52
|
private syncedObserver;
|
|
52
53
|
observe(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rhine-var-base.class.d.ts","sourceRoot":"","sources":["../../../src/core/var/rhine-var-base.class.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAC,MAAM,KAAK,CAAC;AACjF,OAAO,EAAC,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAKhD,OAAO,EAAC,MAAM,EAAS,MAAM,EAAC,8BAAkC;AAChE,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"rhine-var-base.class.d.ts","sourceRoot":"","sources":["../../../src/core/var/rhine-var-base.class.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAC,MAAM,KAAK,CAAC;AACjF,OAAO,EAAC,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAKhD,OAAO,EAAC,MAAM,EAAS,MAAM,EAAC,8BAAkC;AAChE,OAAO,EAAC,SAAS,EAAC,sCAA0C;AAC5D,OAAO,EAAC,UAAU,EAAE,cAAc,EAAE,gBAAgB,EAAE,aAAa,EAAC,iCAAqC;AACzG,OAAO,SAAS,wCAA4C;AAE5D,OAAO,YAAY,yCAA6C;AAKhE,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,YAAY,CAAC,CA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AAE,aAAa,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI;IAOpE,cAAc,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC;IAK3C,iBAAiB;IAIjB,OAAO,CAAC,IAAI;IAQZ,OAAO,CAAC,eAAe,CAA0B;IACjD,aAAa,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI;IAIxD,eAAe,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC;IAG7C,kBAAkB;IAIlB,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,WAAW,EAAE,SAAS,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,UAAU,EAAE,iBAAiB,EAAE,WAAW;IAW9J,OAAO,CAAC,QAAQ,CAA0F;IAC1G,OAAO,CAAC,cAAc,CAA4C;IAElE,OAAO;IA4IP,SAAS;CAQV;AAGD,eAAO,MAAM,+BAA+B,sBAyD1C,CAAA"}
|
|
@@ -10,19 +10,19 @@ const index_1 = require("../../index");
|
|
|
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
|
|
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 {
|
|
17
|
-
constructor(native, parent = null,
|
|
17
|
+
constructor(native, parent = null, _origin = this) {
|
|
18
18
|
this.native = native;
|
|
19
19
|
this.parent = parent;
|
|
20
|
-
this.
|
|
21
|
-
this.
|
|
22
|
-
this.
|
|
23
|
-
this.
|
|
24
|
-
this.
|
|
25
|
-
this.
|
|
20
|
+
this._origin = _origin;
|
|
21
|
+
this._options = {};
|
|
22
|
+
this._connector = null;
|
|
23
|
+
this._undoManager = null;
|
|
24
|
+
this._awareness = null;
|
|
25
|
+
this._clientId = -1;
|
|
26
26
|
this.syncedSubscribers = [];
|
|
27
27
|
this.subscribers = [];
|
|
28
28
|
this.keySubscribers = new Map();
|
|
@@ -43,33 +43,33 @@ class RhineVarBase {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
getOptions() {
|
|
46
|
-
return this.root().
|
|
46
|
+
return this.root()._options;
|
|
47
47
|
}
|
|
48
48
|
getConnector() {
|
|
49
|
-
return this.root().
|
|
49
|
+
return this.root()._connector;
|
|
50
50
|
}
|
|
51
51
|
getUndoManager() {
|
|
52
52
|
if (this.getOptions().awareness !== undefined && !this.getOptions().awareness) {
|
|
53
53
|
(0, logger_1.error)('You need to enable awareness to use undoManager');
|
|
54
54
|
return null;
|
|
55
55
|
}
|
|
56
|
-
return this.root().
|
|
56
|
+
return this.root()._undoManager;
|
|
57
57
|
}
|
|
58
58
|
getAwareness() {
|
|
59
59
|
if (this.getOptions().awareness !== undefined && !this.getOptions().awareness) {
|
|
60
60
|
(0, logger_1.error)('You need to enable awareness to use awareness');
|
|
61
61
|
return null;
|
|
62
62
|
}
|
|
63
|
-
return this.root().
|
|
63
|
+
return this.root()._awareness;
|
|
64
64
|
}
|
|
65
65
|
getClientId() {
|
|
66
66
|
if (this.getOptions().awareness !== undefined && !this.getOptions().awareness) {
|
|
67
67
|
(0, logger_1.error)('You need to enable awareness to use clientId');
|
|
68
68
|
return -1;
|
|
69
69
|
}
|
|
70
|
-
return this.root().
|
|
70
|
+
return this.root()._clientId;
|
|
71
71
|
}
|
|
72
|
-
|
|
72
|
+
_initialize(native) {
|
|
73
73
|
var _a;
|
|
74
74
|
// initialize function will call after every synced
|
|
75
75
|
if (config_1.default.ENABLE_ERROR) {
|
|
@@ -82,29 +82,29 @@ class RhineVarBase {
|
|
|
82
82
|
recursiveKeys.push(key);
|
|
83
83
|
}
|
|
84
84
|
else {
|
|
85
|
-
Reflect.deleteProperty(this.
|
|
85
|
+
Reflect.deleteProperty(this._origin, key);
|
|
86
86
|
}
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
89
|
this.unobserve();
|
|
90
90
|
this.native = native;
|
|
91
91
|
if (this.isRoot()) {
|
|
92
|
-
if (this.
|
|
92
|
+
if (this._options.undoManager === undefined || this._options.undoManager) {
|
|
93
93
|
if (!native) {
|
|
94
94
|
(0, logger_1.error)('Base map is not available for undoManager');
|
|
95
95
|
}
|
|
96
96
|
else {
|
|
97
|
-
this.
|
|
97
|
+
this._undoManager = new yjs_1.UndoManager(native, (0, data_utils_1.isObject)(this._options.undoManager) ? this._options.undoManager : undefined);
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
if (this.
|
|
101
|
-
const doc = (_a = this.
|
|
100
|
+
if (this._options.awareness === undefined || this._options.awareness) {
|
|
101
|
+
const doc = (_a = this._connector) === null || _a === void 0 ? void 0 : _a.yDoc;
|
|
102
102
|
if (!doc) {
|
|
103
103
|
(0, logger_1.error)('YDoc is not available for awareness');
|
|
104
104
|
}
|
|
105
105
|
else {
|
|
106
|
-
this.
|
|
107
|
-
this.
|
|
106
|
+
this._awareness = new awareness_1.Awareness(doc);
|
|
107
|
+
this._clientId = this._awareness.clientID;
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
}
|
|
@@ -114,25 +114,25 @@ class RhineVarBase {
|
|
|
114
114
|
if (recursiveKeys.includes(key)) {
|
|
115
115
|
const child = Reflect.get(this, key);
|
|
116
116
|
if (child instanceof RhineVarBase) {
|
|
117
|
-
child.
|
|
117
|
+
child._initialize(value);
|
|
118
118
|
}
|
|
119
119
|
else {
|
|
120
|
-
Reflect.set(this.
|
|
120
|
+
Reflect.set(this._origin, key, value);
|
|
121
121
|
}
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
124
|
if ((0, native_utils_1.isNative)(value)) {
|
|
125
|
-
Reflect.set(this.
|
|
125
|
+
Reflect.set(this._origin, key, (0, rhine_proxy_1.rhineProxyGeneral)(value, this));
|
|
126
126
|
}
|
|
127
127
|
else {
|
|
128
|
-
Reflect.set(this.
|
|
128
|
+
Reflect.set(this._origin, key, value);
|
|
129
129
|
}
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
afterSynced(callback) {
|
|
134
134
|
var _a;
|
|
135
|
-
const connector = (_a = this.root()) === null || _a === void 0 ? void 0 : _a.
|
|
135
|
+
const connector = (_a = this.root()) === null || _a === void 0 ? void 0 : _a._connector;
|
|
136
136
|
if (connector) {
|
|
137
137
|
connector.afterSynced(callback);
|
|
138
138
|
}
|
|
@@ -143,10 +143,34 @@ class RhineVarBase {
|
|
|
143
143
|
});
|
|
144
144
|
}
|
|
145
145
|
json() {
|
|
146
|
-
return this.native.toJSON();
|
|
146
|
+
return this._removeBuiltInProperty(this.native.toJSON());
|
|
147
|
+
}
|
|
148
|
+
_removeBuiltInProperty(obj) {
|
|
149
|
+
if (obj === null || typeof obj !== 'object') {
|
|
150
|
+
return obj;
|
|
151
|
+
}
|
|
152
|
+
if (obj instanceof Date || obj instanceof RegExp) {
|
|
153
|
+
return obj;
|
|
154
|
+
}
|
|
155
|
+
const builtInProperties = ['_type', '_class'];
|
|
156
|
+
if (Array.isArray(obj)) {
|
|
157
|
+
return obj.map(item => this._removeBuiltInProperty(item));
|
|
158
|
+
}
|
|
159
|
+
if (typeof obj === 'object') {
|
|
160
|
+
const result = {};
|
|
161
|
+
for (const key in obj) {
|
|
162
|
+
if (builtInProperties.includes(key))
|
|
163
|
+
continue;
|
|
164
|
+
if (obj.hasOwnProperty(key)) {
|
|
165
|
+
result[key] = this._removeBuiltInProperty(obj[key]);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return result;
|
|
169
|
+
}
|
|
170
|
+
return obj;
|
|
147
171
|
}
|
|
148
172
|
frozenJson() {
|
|
149
|
-
const origin = this.
|
|
173
|
+
const origin = this._origin;
|
|
150
174
|
if (this.native instanceof index_1.YMap) {
|
|
151
175
|
const result = {};
|
|
152
176
|
for (let key in origin) {
|
|
@@ -201,53 +225,53 @@ class RhineVarBase {
|
|
|
201
225
|
emitSynced(synced) {
|
|
202
226
|
this.syncedSubscribers.forEach(subscriber => subscriber(synced));
|
|
203
227
|
}
|
|
204
|
-
subscribe(
|
|
205
|
-
this.subscribers.push(
|
|
206
|
-
return () => this.unsubscribe(
|
|
228
|
+
subscribe(subscriber) {
|
|
229
|
+
this.subscribers.push(subscriber);
|
|
230
|
+
return () => this.unsubscribe(subscriber);
|
|
207
231
|
}
|
|
208
|
-
unsubscribe(
|
|
209
|
-
this.subscribers = this.subscribers.filter(
|
|
232
|
+
unsubscribe(subscriber) {
|
|
233
|
+
this.subscribers = this.subscribers.filter(s => s !== subscriber);
|
|
210
234
|
}
|
|
211
235
|
unsubscribeAll() {
|
|
212
236
|
this.subscribers = [];
|
|
213
237
|
}
|
|
214
|
-
subscribeKey(key,
|
|
238
|
+
subscribeKey(key, subscriber) {
|
|
215
239
|
if (!this.keySubscribers.has(key)) {
|
|
216
240
|
this.keySubscribers.set(key, []);
|
|
217
241
|
}
|
|
218
|
-
this.keySubscribers.get(key).push(
|
|
219
|
-
return () => this.unsubscribeKey(
|
|
242
|
+
this.keySubscribers.get(key).push(subscriber);
|
|
243
|
+
return () => this.unsubscribeKey(subscriber);
|
|
220
244
|
}
|
|
221
|
-
unsubscribeKey(
|
|
245
|
+
unsubscribeKey(subscriber) {
|
|
222
246
|
this.keySubscribers.forEach((subscribers, key) => {
|
|
223
|
-
this.keySubscribers.set(key, subscribers.filter(
|
|
247
|
+
this.keySubscribers.set(key, subscribers.filter(s => s !== subscriber));
|
|
224
248
|
});
|
|
225
249
|
}
|
|
226
250
|
unsubscribeAllKey() {
|
|
227
251
|
this.keySubscribers = new Map();
|
|
228
252
|
}
|
|
229
|
-
emit(key, value, oldValue,
|
|
230
|
-
this.subscribers.forEach(subscriber => subscriber(key, value, oldValue,
|
|
253
|
+
emit(type, key, value, oldValue, nativeEvent, nativeTransaction) {
|
|
254
|
+
this.subscribers.forEach(subscriber => subscriber(type, key, value, oldValue, nativeEvent, nativeTransaction));
|
|
231
255
|
if (this.keySubscribers.has(key)) {
|
|
232
|
-
this.keySubscribers.get(key).forEach(subscriber => subscriber(
|
|
256
|
+
this.keySubscribers.get(key).forEach(subscriber => subscriber(type, value, oldValue, nativeEvent, nativeTransaction));
|
|
233
257
|
}
|
|
234
258
|
}
|
|
235
|
-
subscribeDeep(
|
|
236
|
-
this.deepSubscribers.push(
|
|
237
|
-
return () => this.unsubscribeDeep(
|
|
259
|
+
subscribeDeep(subscriber) {
|
|
260
|
+
this.deepSubscribers.push(subscriber);
|
|
261
|
+
return () => this.unsubscribeDeep(subscriber);
|
|
238
262
|
}
|
|
239
|
-
unsubscribeDeep(
|
|
240
|
-
this.deepSubscribers = this.deepSubscribers.filter(
|
|
263
|
+
unsubscribeDeep(subscriber) {
|
|
264
|
+
this.deepSubscribers = this.deepSubscribers.filter(s => s !== subscriber);
|
|
241
265
|
}
|
|
242
266
|
unsubscribeAllDeep() {
|
|
243
267
|
this.deepSubscribers = [];
|
|
244
268
|
}
|
|
245
|
-
emitDeep(path, value, oldValue,
|
|
246
|
-
this.deepSubscribers.forEach(subscriber => subscriber(path, value, oldValue,
|
|
269
|
+
emitDeep(type, path, value, oldValue, nativeEvent, nativeTransaction) {
|
|
270
|
+
this.deepSubscribers.forEach(subscriber => subscriber(type, path, value, oldValue, nativeEvent, nativeTransaction));
|
|
247
271
|
if (this.parent) {
|
|
248
272
|
const key = (0, native_utils_1.getKeyFromParent)(this.native);
|
|
249
273
|
if (key !== undefined) {
|
|
250
|
-
this.parent.emitDeep([key, ...path], value, oldValue,
|
|
274
|
+
this.parent.emitDeep(type, [key, ...path], value, oldValue, nativeEvent, nativeTransaction);
|
|
251
275
|
}
|
|
252
276
|
}
|
|
253
277
|
}
|
|
@@ -264,7 +288,7 @@ class RhineVarBase {
|
|
|
264
288
|
if (target instanceof index_1.YMap) {
|
|
265
289
|
this.observer = (event, transaction) => {
|
|
266
290
|
event.changes.keys.forEach(({ action, oldValue }, key) => {
|
|
267
|
-
const type = action === 'add' ?
|
|
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);
|
|
268
292
|
if ((0, data_utils_1.isObjectOrArray)(oldValue)) {
|
|
269
293
|
oldValue = Reflect.get(this, key);
|
|
270
294
|
if (oldValue instanceof RhineVarBase) {
|
|
@@ -272,22 +296,22 @@ class RhineVarBase {
|
|
|
272
296
|
}
|
|
273
297
|
}
|
|
274
298
|
let value = undefined;
|
|
275
|
-
if (type ===
|
|
299
|
+
if (type === event_type_enum_1.EventType.ADD || type === event_type_enum_1.EventType.UPDATE) {
|
|
276
300
|
value = target.get(key);
|
|
277
301
|
if ((0, native_utils_1.isNative)(value)) {
|
|
278
|
-
Reflect.set(this.
|
|
302
|
+
Reflect.set(this._origin, key, (0, rhine_proxy_1.rhineProxyGeneral)(value, this));
|
|
279
303
|
}
|
|
280
304
|
else {
|
|
281
|
-
Reflect.set(this.
|
|
305
|
+
Reflect.set(this._origin, key, value);
|
|
282
306
|
}
|
|
283
307
|
}
|
|
284
|
-
else if (type ===
|
|
285
|
-
Reflect.deleteProperty(this.
|
|
308
|
+
else if (type === event_type_enum_1.EventType.DELETE) {
|
|
309
|
+
Reflect.deleteProperty(this._origin, key);
|
|
286
310
|
}
|
|
287
311
|
const newValue = key in this ? Reflect.get(this, key) : value;
|
|
288
312
|
(0, logger_1.log)('Proxy.event: Map', action, key + ':', oldValue, '->', newValue);
|
|
289
|
-
this.emit(key, newValue, oldValue,
|
|
290
|
-
this.emitDeep([key], newValue, oldValue,
|
|
313
|
+
this.emit(type, key, newValue, oldValue, event, transaction);
|
|
314
|
+
this.emitDeep(type, [key], newValue, oldValue, event, transaction);
|
|
291
315
|
});
|
|
292
316
|
};
|
|
293
317
|
}
|
|
@@ -304,15 +328,15 @@ class RhineVarBase {
|
|
|
304
328
|
if (oldValue instanceof RhineVarBase) {
|
|
305
329
|
oldValue = oldValue.frozenJson();
|
|
306
330
|
}
|
|
307
|
-
Reflect.deleteProperty(this.
|
|
331
|
+
Reflect.deleteProperty(this._origin, i);
|
|
308
332
|
for (let k = i + 1; k < target.length + deltaItem.delete; k++) {
|
|
309
333
|
const value = Reflect.get(this, k);
|
|
310
|
-
Reflect.set(this.
|
|
311
|
-
Reflect.deleteProperty(this.
|
|
334
|
+
Reflect.set(this._origin, k - 1, value);
|
|
335
|
+
Reflect.deleteProperty(this._origin, k);
|
|
312
336
|
}
|
|
313
337
|
(0, logger_1.log)('Proxy.event: Array delete', i + ':', oldValue, '->', undefined);
|
|
314
|
-
this.emit(i, undefined, oldValue,
|
|
315
|
-
this.emitDeep([i], undefined, oldValue,
|
|
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);
|
|
316
340
|
i++;
|
|
317
341
|
}
|
|
318
342
|
}
|
|
@@ -320,18 +344,18 @@ class RhineVarBase {
|
|
|
320
344
|
deltaItem.insert.forEach((value) => {
|
|
321
345
|
for (let k = target.length - 1; k >= i; k--) {
|
|
322
346
|
const existingValue = Reflect.get(this, k);
|
|
323
|
-
Reflect.set(this.
|
|
347
|
+
Reflect.set(this._origin, k + 1, existingValue);
|
|
324
348
|
}
|
|
325
349
|
if ((0, data_utils_1.isObjectOrArray)(value)) {
|
|
326
|
-
Reflect.set(this.
|
|
350
|
+
Reflect.set(this._origin, i, (0, rhine_proxy_1.rhineProxyGeneral)(value, this));
|
|
327
351
|
}
|
|
328
352
|
else {
|
|
329
|
-
Reflect.set(this.
|
|
353
|
+
Reflect.set(this._origin, i, value);
|
|
330
354
|
}
|
|
331
355
|
const newValue = i in this ? Reflect.get(this, i) : target.get(i);
|
|
332
356
|
(0, logger_1.log)('Proxy.event: Array add', i, ':', undefined, '->', newValue);
|
|
333
|
-
this.emit(i, newValue, undefined,
|
|
334
|
-
this.emitDeep([i], newValue, undefined,
|
|
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);
|
|
335
359
|
i++;
|
|
336
360
|
});
|
|
337
361
|
}
|
|
@@ -353,12 +377,12 @@ class RhineVarBase {
|
|
|
353
377
|
const isUpdate = hasDelete && hasInsert;
|
|
354
378
|
const oldValue = Reflect.get(this, 'value');
|
|
355
379
|
const newValue = this.native.toString();
|
|
356
|
-
Reflect.set(this.
|
|
380
|
+
Reflect.set(this._origin, 'value', newValue);
|
|
357
381
|
let i = 0;
|
|
358
382
|
if (isUpdate) {
|
|
359
383
|
(0, logger_1.log)('Proxy.event: Text update', ':', oldValue, '->', newValue);
|
|
360
|
-
this.emit(i, newValue, oldValue,
|
|
361
|
-
this.emitDeep([i], newValue, oldValue,
|
|
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);
|
|
362
386
|
}
|
|
363
387
|
else {
|
|
364
388
|
event.delta.forEach(deltaItem => {
|
|
@@ -368,14 +392,14 @@ class RhineVarBase {
|
|
|
368
392
|
}
|
|
369
393
|
if (deltaItem.delete !== undefined) {
|
|
370
394
|
(0, logger_1.log)('Proxy.event: Text delete', i, ':', oldValue, '->', newValue);
|
|
371
|
-
this.emit(i, newValue, oldValue,
|
|
372
|
-
this.emitDeep([i], newValue, oldValue,
|
|
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);
|
|
373
397
|
i += deltaItem.delete;
|
|
374
398
|
}
|
|
375
399
|
else if (deltaItem.insert !== undefined) {
|
|
376
400
|
(0, logger_1.log)('Proxy.event: Text add', i, ':', oldValue, '->', newValue);
|
|
377
|
-
this.emit(i, newValue, oldValue,
|
|
378
|
-
this.emitDeep([i], newValue, oldValue,
|
|
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);
|
|
379
403
|
i += newValue.length;
|
|
380
404
|
}
|
|
381
405
|
});
|
|
@@ -384,8 +408,8 @@ class RhineVarBase {
|
|
|
384
408
|
}
|
|
385
409
|
else {
|
|
386
410
|
this.observer = (event, transaction) => {
|
|
387
|
-
this.emit(
|
|
388
|
-
this.emitDeep(
|
|
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);
|
|
389
413
|
};
|
|
390
414
|
}
|
|
391
415
|
if (this.observer) {
|
|
@@ -404,21 +428,21 @@ class RhineVarBase {
|
|
|
404
428
|
}
|
|
405
429
|
exports.default = RhineVarBase;
|
|
406
430
|
exports.RHINE_VAR_PREDEFINED_PROPERTIES = new Set([
|
|
407
|
-
'
|
|
431
|
+
'_origin',
|
|
432
|
+
'_class',
|
|
433
|
+
'_type',
|
|
434
|
+
'_initialize',
|
|
408
435
|
'native',
|
|
409
|
-
'nativeType',
|
|
410
|
-
'initialize',
|
|
411
436
|
'json',
|
|
412
437
|
'jsonString',
|
|
413
438
|
'parent',
|
|
414
439
|
'isRoot',
|
|
415
440
|
'root',
|
|
416
|
-
'
|
|
417
|
-
'
|
|
418
|
-
'
|
|
419
|
-
'
|
|
420
|
-
'
|
|
421
|
-
'clientId',
|
|
441
|
+
'_options',
|
|
442
|
+
'_connector',
|
|
443
|
+
'_undoManager',
|
|
444
|
+
'_awareness',
|
|
445
|
+
'_clientId',
|
|
422
446
|
'getOptions',
|
|
423
447
|
'getConnector',
|
|
424
448
|
'getUndoManager',
|
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 {
|
|
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,
|
|
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
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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,EA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efault = (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.
|
|
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
|
|
47
|
-
Object.defineProperty(exports, "
|
|
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.
|
|
3
|
+
"version": "0.10.3",
|
|
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",
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
"types": "dist/index.d.ts",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"dev": "tsc --watch",
|
|
12
|
-
"playground": "npm run dev --prefix playground/next
|
|
12
|
+
"playground": "npm run dev --prefix playground/next",
|
|
13
13
|
"prepare": "ts-patch install -s",
|
|
14
|
-
"install-next": "npm install --prefix playground/next
|
|
15
|
-
"link-next": "npm link && npm link rhine-var --prefix playground/next
|
|
14
|
+
"install-next": "npm install --prefix playground/next",
|
|
15
|
+
"link-next": "npm link && npm link rhine-var --prefix playground/next",
|
|
16
16
|
"test": "echo All tests passed.",
|
|
17
17
|
"build": "tsc",
|
|
18
18
|
"commit": "node scripts/commit.js"
|
|
@@ -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 +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 = {}));
|
|
File without changes
|