@ibyar/expressions 2.5.0 → 3.1.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibyar/expressions",
3
- "version": "2.5.0",
3
+ "version": "3.1.1",
4
4
  "description": "Aurora expression, an template expression and evaluation, An 100% spec compliant ES2022 JavaScript toolchain,",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/ibyar/aurora/tree/dev/packages/expressions",
@@ -36,11 +36,11 @@
36
36
  "access": "public"
37
37
  },
38
38
  "dependencies": {
39
- "@ibyar/decorators": "^2.5.0",
40
- "tslib": "^2.7.0"
39
+ "@ibyar/decorators": "^3.1.1",
40
+ "tslib": "^2.8.1"
41
41
  },
42
42
  "devDependencies": {
43
- "typescript": "^5.6.3"
43
+ "typescript": "^5.7.3"
44
44
  },
45
45
  "scripts": {
46
46
  "build": "tsc --build --verbose",
@@ -65,5 +65,5 @@
65
65
  "backend",
66
66
  "front-end"
67
67
  ],
68
- "gitHead": "67b064cb1a4a9c11cf4bf31da7dd7cc8bb3675ce"
68
+ "gitHead": "9532d01b23f038ee839911245e7ccf1f24add1d6"
69
69
  }
@@ -1,4 +1,4 @@
1
- import { Context, ReactiveScope, ReactiveScopeControl, ReadOnlyScope, Scope } from './scope.js';
1
+ import { Context, ReactiveScope, ReactiveControlScope, ReadOnlyScope, Scope } from './scope.js';
2
2
  export declare class ScopeBuilder {
3
3
  static for<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]): Scope<T>;
4
4
  static blockScope<T extends Context>(propertyKeys?: (keyof T)[]): Scope<T>;
@@ -15,8 +15,8 @@ export declare class ScopeBuilder {
15
15
  static reactiveScopeAndScopeForThis<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]): Scope<{
16
16
  this: T;
17
17
  }>;
18
- static reactiveScopeControlFor<T extends Context>(context: T, propertyKeys?: (keyof T)[]): ReactiveScopeControl<T>;
19
- static blockReactiveScopeControl<T extends Context>(propertyKeys?: (keyof T)[]): ReactiveScopeControl<T>;
18
+ static reactiveScopeControlFor<T extends Context>(context: T, propertyKeys?: (keyof T)[]): ReactiveControlScope<T>;
19
+ static blockReactiveScopeControl<T extends Context>(propertyKeys?: (keyof T)[]): ReactiveControlScope<T>;
20
20
  static reactiveScopeControlForThis<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]): Scope<{
21
21
  this: T;
22
22
  }>;
package/scope/builder.js CHANGED
@@ -1,4 +1,4 @@
1
- import { ReactiveScope, ReactiveScopeControl, ReadOnlyScope, Scope } from './scope.js';
1
+ import { ReactiveScope, ReactiveControlScope, ReadOnlyScope, Scope } from './scope.js';
2
2
  export class ScopeBuilder {
3
3
  static for(ctx, propertyKeys) {
4
4
  return new Scope(ctx, propertyKeys);
@@ -46,13 +46,13 @@ export class ScopeBuilder {
46
46
  return rootScope;
47
47
  }
48
48
  static reactiveScopeControlFor(context, propertyKeys) {
49
- return new ReactiveScopeControl(context, propertyKeys);
49
+ return new ReactiveControlScope(context, propertyKeys);
50
50
  }
51
51
  static blockReactiveScopeControl(propertyKeys) {
52
- return new ReactiveScopeControl({}, propertyKeys);
52
+ return new ReactiveControlScope({}, propertyKeys);
53
53
  }
54
54
  static reactiveScopeControlForThis(ctx, propertyKeys) {
55
- const thisScope = ReactiveScopeControl.for(ctx, propertyKeys);
55
+ const thisScope = ReactiveControlScope.for(ctx, propertyKeys);
56
56
  const thisCtx = {
57
57
  'this': ctx,
58
58
  };
@@ -61,7 +61,7 @@ export class ScopeBuilder {
61
61
  return rootScope;
62
62
  }
63
63
  static readOnlyScopeAndReactiveScopeControlForThis(ctx, propertyKeys) {
64
- const thisScope = ReactiveScopeControl.for(ctx, propertyKeys);
64
+ const thisScope = ReactiveControlScope.for(ctx, propertyKeys);
65
65
  const thisCtx = {
66
66
  'this': ctx,
67
67
  };
@@ -1 +1 @@
1
- {"version":3,"file":"builder.js","sourceRoot":"","sources":["../../../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EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;QAC/C,SAAS,CAAC,aAAa,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAC3C,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,MAAM,CAAC,2CAA2C,CAAoB,GAAM,EAAE,YAA0B;QACvG,MAAM,SAAS,GAAG,oBAAoB,CAAC,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;QAC9D,MAAM,OAAO,GAAG;YACf,MAAM,EAAE,GAAG;SACX,CAAC;QACF,MAAM,SAAS,GAAG,aAAa,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;QACvD,SAAS,CAAC,aAAa,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAC3C,OAAO,SAAS,CAAC;IAClB,CAAC;CACD","sourcesContent":["import { Context, ReactiveScope, ReactiveScopeControl, ReadOnlyScope, Scope } from './scope.js';\n\nexport class ScopeBuilder {\n\tstatic for<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\treturn new Scope(ctx, propertyKeys);\n\t}\n\tstatic blockScope<T extends Context>(propertyKeys?: (keyof T)[]) {\n\t\treturn new Scope({} as T, propertyKeys);\n\t}\n\tstatic readOnlyScopeFor<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\treturn new ReadOnlyScope(ctx, propertyKeys);\n\t}\n\tstatic blockReadOnlyScope<T extends Context>(propertyKeys?: (keyof T)[]) {\n\t\treturn new ReadOnlyScope({} as T, propertyKeys);\n\t}\n\tstatic reactiveScopeFor<T extends Context>(context: T, propertyKeys?: (keyof T)[]) {\n\t\treturn new ReactiveScope(context, propertyKeys);\n\t}\n\tstatic blockReactiveScope<T extends Context>(propertyKeys?: (keyof T)[]) {\n\t\treturn new ReactiveScope({} as T, propertyKeys);\n\t}\n\tstatic reactiveScopeForThis<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\tconst thisScope = ReactiveScope.for(ctx, propertyKeys);\n\t\tconst thisCtx = {\n\t\t\t'this': ctx,\n\t\t};\n\t\tconst rootScope = Scope.for(thisCtx, ['this']);\n\t\trootScope.setInnerScope('this', thisScope);\n\t\treturn rootScope;\n\t}\n\tstatic readOnlyScopeAndReactiveScopeForThis<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\tconst thisScope = ReactiveScope.for(ctx, propertyKeys);\n\t\tconst thisCtx = {\n\t\t\t'this': ctx,\n\t\t};\n\t\tconst rootScope = ReadOnlyScope.for(thisCtx, ['this']);\n\t\trootScope.setInnerScope('this', thisScope);\n\t\treturn rootScope;\n\t}\n\tstatic reactiveScopeAndScopeForThis<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\tconst thisScope = ReactiveScope.for(ctx, propertyKeys);\n\t\tconst thisCtx = {\n\t\t\t'this': ctx,\n\t\t};\n\t\tconst rootScope = Scope.for(thisCtx, ['this']);\n\t\trootScope.setInnerScope('this', thisScope);\n\t\treturn rootScope;\n\t}\n\tstatic reactiveScopeControlFor<T extends Context>(context: T, propertyKeys?: (keyof T)[]) {\n\t\treturn new ReactiveScopeControl(context, propertyKeys);\n\t}\n\tstatic blockReactiveScopeControl<T extends Context>(propertyKeys?: (keyof T)[]) {\n\t\treturn new ReactiveScopeControl({} as T, propertyKeys);\n\t}\n\tstatic reactiveScopeControlForThis<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\tconst thisScope = ReactiveScopeControl.for(ctx, propertyKeys);\n\t\tconst thisCtx = {\n\t\t\t'this': ctx,\n\t\t};\n\t\tconst rootScope = Scope.for(thisCtx, ['this']);\n\t\trootScope.setInnerScope('this', thisScope);\n\t\treturn rootScope;\n\t}\n\tstatic readOnlyScopeAndReactiveScopeControlForThis<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\tconst thisScope = ReactiveScopeControl.for(ctx, propertyKeys);\n\t\tconst thisCtx = {\n\t\t\t'this': ctx,\n\t\t};\n\t\tconst rootScope = ReadOnlyScope.for(thisCtx, ['this']);\n\t\trootScope.setInnerScope('this', thisScope);\n\t\treturn rootScope;\n\t}\n}\n"]}
1
+ {"version":3,"file":"builder.js","sourceRoot":"","sources":["../../../src/expressions/scope/builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,aAAa,EAAE,oBAAoB,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEhG,MAAM,OAAO,YAAY;IACxB,MAAM,CAAC,GAAG,CAAoB,GAAM,EAAE,YAA0B;QAC/D,OAAO,IAAI,KAAK,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;IACrC,CAAC;IACD,MAAM,CAAC,UAAU,CAAoB,YAA0B;QAC9D,OAAO,IAAI,KAAK,CAAC,EAAO,EAAE,YAAY,CAAC,CAAC;IACzC,CAAC;IACD,MAAM,CAAC,gBAAgB,CAAoB,GAAM,EAAE,YAA0B;QAC5E,OAAO,IAAI,aAAa,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;IAC7C,CAAC;IACD,MAAM,CAAC,kBAAkB,CAAoB,YAA0B;QACtE,OAAO,IAAI,aAAa,CAAC,EAAO,EAAE,YAAY,CAAC,CAAC;IACjD,CAAC;IACD,MAAM,CAAC,gBAAgB,CAAoB,OAAU,EAAE,YAA0B;QAChF,OAAO,IAAI,aAAa,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IACjD,CAAC;IACD,MAAM,CAAC,kBAAkB,CAAoB,YAA0B;QACtE,OAAO,IAAI,aAAa,CAAC,EAAO,EAAE,YAAY,CAAC,CAAC;IACjD,CAAC;IACD,MAAM,CAAC,oBAAoB,CAAoB,GAAM,EAAE,YAA0B;QAChF,MAAM,SAAS,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;QACvD,MAAM,OAAO,GAAG;YACf,MAAM,EAAE,GAAG;SACX,CAAC;QACF,MAAM,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,EAA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AAE,YAAY,CAAC,CAAC;QAC9D,MAAM,OAAO,GAAG;YACf,MAAM,EAAE,GAAG;SACX,CAAC;QACF,MAAM,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;QAC/C,SAAS,CAAC,aAAa,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAC3C,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,MAAM,CAAC,2CAA2C,CAAoB,GAAM,EAAE,YAA0B;QACvG,MAAM,SAAS,GAAG,oBAAoB,CAAC,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;QAC9D,MAAM,OAAO,GAAG;YACf,MAAM,EAAE,GAAG;SACX,CAAC;QACF,MAAM,SAAS,GAAG,aAAa,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;QACvD,SAAS,CAAC,aAAa,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAC3C,OAAO,SAAS,CAAC;IAClB,CAAC;CACD","sourcesContent":["import { Context, ReactiveScope, ReactiveControlScope, ReadOnlyScope, Scope } from './scope.js';\n\nexport class ScopeBuilder {\n\tstatic for<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\treturn new Scope(ctx, propertyKeys);\n\t}\n\tstatic blockScope<T extends Context>(propertyKeys?: (keyof T)[]) {\n\t\treturn new Scope({} as T, propertyKeys);\n\t}\n\tstatic readOnlyScopeFor<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\treturn new ReadOnlyScope(ctx, propertyKeys);\n\t}\n\tstatic blockReadOnlyScope<T extends Context>(propertyKeys?: (keyof T)[]) {\n\t\treturn new ReadOnlyScope({} as T, propertyKeys);\n\t}\n\tstatic reactiveScopeFor<T extends Context>(context: T, propertyKeys?: (keyof T)[]) {\n\t\treturn new ReactiveScope(context, propertyKeys);\n\t}\n\tstatic blockReactiveScope<T extends Context>(propertyKeys?: (keyof T)[]) {\n\t\treturn new ReactiveScope({} as T, propertyKeys);\n\t}\n\tstatic reactiveScopeForThis<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\tconst thisScope = ReactiveScope.for(ctx, propertyKeys);\n\t\tconst thisCtx = {\n\t\t\t'this': ctx,\n\t\t};\n\t\tconst rootScope = Scope.for(thisCtx, ['this']);\n\t\trootScope.setInnerScope('this', thisScope);\n\t\treturn rootScope;\n\t}\n\tstatic readOnlyScopeAndReactiveScopeForThis<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\tconst thisScope = ReactiveScope.for(ctx, propertyKeys);\n\t\tconst thisCtx = {\n\t\t\t'this': ctx,\n\t\t};\n\t\tconst rootScope = ReadOnlyScope.for(thisCtx, ['this']);\n\t\trootScope.setInnerScope('this', thisScope);\n\t\treturn rootScope;\n\t}\n\tstatic reactiveScopeAndScopeForThis<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\tconst thisScope = ReactiveScope.for(ctx, propertyKeys);\n\t\tconst thisCtx = {\n\t\t\t'this': ctx,\n\t\t};\n\t\tconst rootScope = Scope.for(thisCtx, ['this']);\n\t\trootScope.setInnerScope('this', thisScope);\n\t\treturn rootScope;\n\t}\n\tstatic reactiveScopeControlFor<T extends Context>(context: T, propertyKeys?: (keyof T)[]) {\n\t\treturn new ReactiveControlScope(context, propertyKeys);\n\t}\n\tstatic blockReactiveScopeControl<T extends Context>(propertyKeys?: (keyof T)[]) {\n\t\treturn new ReactiveControlScope({} as T, propertyKeys);\n\t}\n\tstatic reactiveScopeControlForThis<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\tconst thisScope = ReactiveControlScope.for(ctx, propertyKeys);\n\t\tconst thisCtx = {\n\t\t\t'this': ctx,\n\t\t};\n\t\tconst rootScope = Scope.for(thisCtx, ['this']);\n\t\trootScope.setInnerScope('this', thisScope);\n\t\treturn rootScope;\n\t}\n\tstatic readOnlyScopeAndReactiveScopeControlForThis<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\tconst thisScope = ReactiveControlScope.for(ctx, propertyKeys);\n\t\tconst thisCtx = {\n\t\t\t'this': ctx,\n\t\t};\n\t\tconst rootScope = ReadOnlyScope.for(thisCtx, ['this']);\n\t\trootScope.setInnerScope('this', thisScope);\n\t\treturn rootScope;\n\t}\n}\n"]}
package/scope/cd.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ export declare function skipChangeDetection(obj: object): void;
2
+ export declare function isChangeDetectionSkipped(obj: object): boolean;
3
+ //# sourceMappingURL=cd.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cd.d.ts","sourceRoot":"","sources":["../../../src/expressions/scope/cd.ts"],"names":[],"mappings":"AAEA,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,QAI9C;AAED,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,WAEnD"}
package/scope/cd.js ADDED
@@ -0,0 +1,10 @@
1
+ const SKIP_CHANGE_DETECTION = new WeakMap();
2
+ export function skipChangeDetection(obj) {
3
+ if (obj !== null && typeof obj === 'object') {
4
+ SKIP_CHANGE_DETECTION.set(obj, true);
5
+ }
6
+ }
7
+ export function isChangeDetectionSkipped(obj) {
8
+ return obj !== null && typeof obj === 'object' && SKIP_CHANGE_DETECTION.has(obj);
9
+ }
10
+ //# sourceMappingURL=cd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cd.js","sourceRoot":"","sources":["../../../src/expressions/scope/cd.ts"],"names":[],"mappings":"AAAA,MAAM,qBAAqB,GAAG,IAAI,OAAO,EAAmB,CAAC;AAE7D,MAAM,UAAU,mBAAmB,CAAC,GAAW;IAC9C,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC7C,qBAAqB,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACtC,CAAC;AACF,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,GAAW;IACnD,OAAO,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,qBAAqB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAClF,CAAC","sourcesContent":["const SKIP_CHANGE_DETECTION = new WeakMap<object, boolean>();\n\nexport function skipChangeDetection(obj: object) {\n\tif (obj !== null && typeof obj === 'object') {\n\t\tSKIP_CHANGE_DETECTION.set(obj, true);\n\t}\n}\n\nexport function isChangeDetectionSkipped(obj: object) {\n\treturn obj !== null && typeof obj === 'object' && SKIP_CHANGE_DETECTION.has(obj);\n}\n"]}
package/scope/pool.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { ReactiveScope, ReactiveScopeControl, ReadOnlyScope, Scope } from './scope.js';
1
+ import { ReactiveScope, ReactiveControlScope, ReadOnlyScope, Scope } from './scope.js';
2
2
  export type ScopeType = 'scope' | 'read-only' | 'reactive' | 'reactive-control';
3
3
  export declare function getScopeFor<S extends Scope<T>, T extends object>(ctx: T): S | undefined;
4
4
  export declare function getScopeFor<T extends object>(ctx: T, type: 'scope', propertyKeys?: (keyof T)[]): Scope<T>;
5
5
  export declare function getScopeFor<T extends object>(ctx: T, type: 'read-only', propertyKeys?: (keyof T)[]): ReadOnlyScope<T>;
6
6
  export declare function getScopeFor<T extends object>(ctx: T, type: 'reactive', propertyKeys?: (keyof T)[]): ReactiveScope<T>;
7
- export declare function getScopeFor<T extends object>(ctx: T, type: 'reactive-control', propertyKeys?: (keyof T)[]): ReactiveScopeControl<T>;
7
+ export declare function getScopeFor<T extends object>(ctx: T, type: 'reactive-control', propertyKeys?: (keyof T)[]): ReactiveControlScope<T>;
8
8
  //# sourceMappingURL=pool.d.ts.map
package/scope/pool.js CHANGED
@@ -1,4 +1,4 @@
1
- import { ReactiveScope, ReactiveScopeControl, ReadOnlyScope, Scope } from './scope.js';
1
+ import { ReactiveScope, ReactiveControlScope, ReadOnlyScope, Scope } from './scope.js';
2
2
  const pool = new WeakMap();
3
3
  export function getScopeFor(ctx, type, propertyKeys) {
4
4
  if (pool.has(ctx)) {
@@ -16,7 +16,7 @@ export function getScopeFor(ctx, type, propertyKeys) {
16
16
  scope = ReactiveScope.for(ctx, propertyKeys);
17
17
  break;
18
18
  case 'reactive-control':
19
- scope = ReactiveScopeControl.for(ctx, propertyKeys);
19
+ scope = ReactiveControlScope.for(ctx, propertyKeys);
20
20
  break;
21
21
  default:
22
22
  case 'scope':
package/scope/pool.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"pool.js","sourceRoot":"","sources":["../../../src/expressions/scope/pool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEvF,MAAM,IAAI,GAAG,IAAI,OAAO,EAAsB,CAAC;AAS/C,MAAM,UAAU,WAAW,CAAuC,GAAM,EAAE,IAAgB,EAAE,YAA0B;IACrH,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;QACnB,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAQ,CAAC;IAC7B,CAAC;IACD,IAAI,CAAC,IAAI,EAAE,CAAC;QACX,OAAO;IACR,CAAC;IACD,IAAI,KAAe,CAAC;IACpB,QAAQ,IAAI,EAAE,CAAC;QACd,KAAK,WAAW;YACf,KAAK,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;YAC7C,MAAM;QACP,KAAK,UAAU;YACd,KAAK,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;YAC7C,MAAM;QACP,KAAK,kBAAkB;YACtB,KAAK,GAAG,oBAAoB,CAAC,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;YACpD,MAAM;QACP,QAAQ;QACR,KAAK,OAAO;YACX,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;YACrC,MAAM;IACR,CAAC;IACD,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACrB,OAAO,KAAiB,CAAC;AAC1B,CAAC","sourcesContent":["import { ReactiveScope, ReactiveScopeControl, ReadOnlyScope, Scope } from './scope.js';\n\nconst pool = new WeakMap<object, Scope<any>>();\n\nexport type ScopeType = 'scope' | 'read-only' | 'reactive' | 'reactive-control';\n\nexport function getScopeFor<S extends Scope<T>, T extends object>(ctx: T): S | undefined;\nexport function getScopeFor<T extends object>(ctx: T, type: 'scope', propertyKeys?: (keyof T)[]): Scope<T>;\nexport function getScopeFor<T extends object>(ctx: T, type: 'read-only', propertyKeys?: (keyof T)[]): ReadOnlyScope<T>;\nexport function getScopeFor<T extends object>(ctx: T, type: 'reactive', propertyKeys?: (keyof T)[]): ReactiveScope<T>;\nexport function getScopeFor<T extends object>(ctx: T, type: 'reactive-control', propertyKeys?: (keyof T)[]): ReactiveScopeControl<T>;\nexport function getScopeFor<S extends Scope<T>, T extends object>(ctx: T, type?: ScopeType, propertyKeys?: (keyof T)[]): S | undefined {\n\tif (pool.has(ctx)) {\n\t\treturn pool.get(ctx) as any;\n\t}\n\tif (!type) {\n\t\treturn;\n\t}\n\tlet scope: Scope<T>;\n\tswitch (type) {\n\t\tcase 'read-only':\n\t\t\tscope = ReadOnlyScope.for(ctx, propertyKeys);\n\t\t\tbreak;\n\t\tcase 'reactive':\n\t\t\tscope = ReactiveScope.for(ctx, propertyKeys);\n\t\t\tbreak;\n\t\tcase 'reactive-control':\n\t\t\tscope = ReactiveScopeControl.for(ctx, propertyKeys);\n\t\t\tbreak;\n\t\tdefault:\n\t\tcase 'scope':\n\t\t\tscope = Scope.for(ctx, propertyKeys);\n\t\t\tbreak;\n\t}\n\tpool.set(ctx, scope);\n\treturn scope as any as S;\n}\n"]}
1
+ {"version":3,"file":"pool.js","sourceRoot":"","sources":["../../../src/expressions/scope/pool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEvF,MAAM,IAAI,GAAG,IAAI,OAAO,EAAsB,CAAC;AAS/C,MAAM,UAAU,WAAW,CAAuC,GAAM,EAAE,IAAgB,EAAE,YAA0B;IACrH,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;QACnB,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAQ,CAAC;IAC7B,CAAC;IACD,IAAI,CAAC,IAAI,EAAE,CAAC;QACX,OAAO;IACR,CAAC;IACD,IAAI,KAAe,CAAC;IACpB,QAAQ,IAAI,EAAE,CAAC;QACd,KAAK,WAAW;YACf,KAAK,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;YAC7C,MAAM;QACP,KAAK,UAAU;YACd,KAAK,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;YAC7C,MAAM;QACP,KAAK,kBAAkB;YACtB,KAAK,GAAG,oBAAoB,CAAC,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;YACpD,MAAM;QACP,QAAQ;QACR,KAAK,OAAO;YACX,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;YACrC,MAAM;IACR,CAAC;IACD,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACrB,OAAO,KAAiB,CAAC;AAC1B,CAAC","sourcesContent":["import { ReactiveScope, ReactiveControlScope, ReadOnlyScope, Scope } from './scope.js';\n\nconst pool = new WeakMap<object, Scope<any>>();\n\nexport type ScopeType = 'scope' | 'read-only' | 'reactive' | 'reactive-control';\n\nexport function getScopeFor<S extends Scope<T>, T extends object>(ctx: T): S | undefined;\nexport function getScopeFor<T extends object>(ctx: T, type: 'scope', propertyKeys?: (keyof T)[]): Scope<T>;\nexport function getScopeFor<T extends object>(ctx: T, type: 'read-only', propertyKeys?: (keyof T)[]): ReadOnlyScope<T>;\nexport function getScopeFor<T extends object>(ctx: T, type: 'reactive', propertyKeys?: (keyof T)[]): ReactiveScope<T>;\nexport function getScopeFor<T extends object>(ctx: T, type: 'reactive-control', propertyKeys?: (keyof T)[]): ReactiveControlScope<T>;\nexport function getScopeFor<S extends Scope<T>, T extends object>(ctx: T, type?: ScopeType, propertyKeys?: (keyof T)[]): S | undefined {\n\tif (pool.has(ctx)) {\n\t\treturn pool.get(ctx) as any;\n\t}\n\tif (!type) {\n\t\treturn;\n\t}\n\tlet scope: Scope<T>;\n\tswitch (type) {\n\t\tcase 'read-only':\n\t\t\tscope = ReadOnlyScope.for(ctx, propertyKeys);\n\t\t\tbreak;\n\t\tcase 'reactive':\n\t\t\tscope = ReactiveScope.for(ctx, propertyKeys);\n\t\t\tbreak;\n\t\tcase 'reactive-control':\n\t\t\tscope = ReactiveControlScope.for(ctx, propertyKeys);\n\t\t\tbreak;\n\t\tdefault:\n\t\tcase 'scope':\n\t\t\tscope = Scope.for(ctx, propertyKeys);\n\t\t\tbreak;\n\t}\n\tpool.set(ctx, scope);\n\treturn scope as any as S;\n}\n"]}
package/scope/scope.d.ts CHANGED
@@ -124,7 +124,7 @@ export declare class ReactiveScope<T extends Context> extends Scope<T> {
124
124
  /**
125
125
  * used control/notify/pause scope about changes in current context
126
126
  */
127
- export interface ScopeControl<T extends Context> {
127
+ export interface ControlScope<T extends Context> {
128
128
  /**
129
129
  * get current stacte of applying change detection.
130
130
  */
@@ -151,9 +151,9 @@ export interface ScopeControl<T extends Context> {
151
151
  */
152
152
  checkNoChanges(): void;
153
153
  }
154
- export declare class ReactiveScopeControl<T extends Context> extends ReactiveScope<T> implements ScopeControl<T> {
155
- static for<T extends Context>(context: T, propertyKeys?: (keyof T)[]): ReactiveScopeControl<T>;
156
- static blockScope<T extends Context>(propertyKeys?: (keyof T)[]): ReactiveScopeControl<T>;
154
+ export declare class ReactiveControlScope<T extends Context> extends ReactiveScope<T> implements ControlScope<T> {
155
+ static for<T extends Context>(context: T, propertyKeys?: (keyof T)[]): ReactiveControlScope<T>;
156
+ static blockScope<T extends Context>(propertyKeys?: (keyof T)[]): ReactiveControlScope<T>;
157
157
  static scopeForThis<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]): Scope<{
158
158
  this: T;
159
159
  }>;
@@ -174,7 +174,7 @@ export declare class ReactiveScopeControl<T extends Context> extends ReactiveSco
174
174
  emitChanges(propertyKey?: keyof T, propertyValue?: any): void;
175
175
  detectChanges(): void;
176
176
  checkNoChanges(): void;
177
- getClass(): TypeOf<ReactiveScopeControl<Context>>;
177
+ getClass(): TypeOf<ReactiveControlScope<Context>>;
178
178
  }
179
179
  interface ImportMeta {
180
180
  url: URL;
@@ -1 +1 @@
1
- {"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../../src/expressions/scope/scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;AAC/C,MAAM,WAAW,KAAK,CAAC,CAAC,GAAG,OAAO;IAEjC;;;OAGG;IACH,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,GAAG,GAAG,CAAC;IAE/B;;;;;OAKG;IACH,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,EAAE,KAAK,CAAC,EAAE,GAAG,EAAE,QAAQ,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC;IAEhE;;;OAGG;IACH,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC;IAEnC;;;OAGG;IACH,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC;IAEtC;;OAEG;IACH,UAAU,IAAI,CAAC,CAAC;IAEhB;;OAEG;IACH,eAAe,CAAC,IAAI,CAAC,CAAC;IAEtB;;;;;OAKG;IACH,aAAa,CAAC,CAAC,S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AG,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACpE;AAED,MAAM,WAAW,YAAY;IAC5B,IAAI,EAAE,UAAU,CAAA;CAChB;AAED,MAAM,WAAW,aAAc,SAAQ,OAAO;IAC7C,MAAM,EAAE,YAAY,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;CACxD;AAED,qBAAa,WAAY,SAAQ,aAAa,CAAC,aAAa,CAAC;gBAChD,OAAO,EAAE,aAAa,EAAE,YAAY,CAAC,EAAE,CAAC,MAAM,aAAa,CAAC,EAAE;IAG1E,YAAY,CAAC,WAAW,EAAE,MAAM,aAAa,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI;CAKxE;AACD,qBAAa,cAAe,SAAQ,WAAW;IAIlC,OAAO,CAAC,MAAM;IAAU,OAAO,CAAC,iBAAiB,CAAC;IAD9D,OAAO,CAAC,MAAM,CAAe;gBACT,MAAM,EAAE,MAAM,EAAU,iBAAiB,CAAC,EAAE,iBAAiB,YAAA;IAOjF,OAAO,CAAC,aAAa;IAKrB,aAAa;CAGb"}
package/scope/scope.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { isChangeDetectionSkipped } from './cd.js';
1
2
  export class Scope {
2
3
  _ctx;
3
4
  _keys;
@@ -261,7 +262,7 @@ export class ReactiveScope extends Scope {
261
262
  getPropertyKeys(...objs) {
262
263
  let keys = [];
263
264
  objs.forEach(obj => {
264
- keys.push(...Object.keys(obj));
265
+ keys.push(...Object.keys(obj).filter(key => !isChangeDetectionSkipped(obj[key])));
265
266
  keys.push(...Object.getOwnPropertySymbols(obj));
266
267
  });
267
268
  keys = Array.from(new Set(keys));
@@ -281,15 +282,15 @@ export class ReactiveScope extends Scope {
281
282
  return ReactiveScope;
282
283
  }
283
284
  }
284
- export class ReactiveScopeControl extends ReactiveScope {
285
+ export class ReactiveControlScope extends ReactiveScope {
285
286
  static for(context, propertyKeys) {
286
- return new ReactiveScopeControl(context, propertyKeys);
287
+ return new ReactiveControlScope(context, propertyKeys);
287
288
  }
288
289
  static blockScope(propertyKeys) {
289
- return new ReactiveScopeControl({}, propertyKeys);
290
+ return new ReactiveControlScope({}, propertyKeys);
290
291
  }
291
292
  static scopeForThis(ctx, propertyKeys) {
292
- const thisScope = ReactiveScopeControl.for(ctx, propertyKeys);
293
+ const thisScope = ReactiveControlScope.for(ctx, propertyKeys);
293
294
  const thisCtx = {
294
295
  'this': ctx,
295
296
  };
@@ -298,7 +299,7 @@ export class ReactiveScopeControl extends ReactiveScope {
298
299
  return rootScope;
299
300
  }
300
301
  static readOnlyScopeForThis(ctx, propertyKeys) {
301
- const thisScope = ReactiveScopeControl.for(ctx, propertyKeys);
302
+ const thisScope = ReactiveControlScope.for(ctx, propertyKeys);
302
303
  const thisCtx = {
303
304
  'this': ctx,
304
305
  };
@@ -371,7 +372,7 @@ export class ReactiveScopeControl extends ReactiveScope {
371
372
  }
372
373
  }
373
374
  getClass() {
374
- return ReactiveScopeControl;
375
+ return ReactiveControlScope;
375
376
  }
376
377
  }
377
378
  export class ModuleScope extends ReactiveScope {
@@ -1 +1 @@
1
- {"version":3,"file":"scope.js","sourceRoot":"","sources":["../../../src/expressions/scope/scope.ts"],"names":[],"mappings":"AAgEA,MAAM,OAAO,KAAK;IAWK;IAAmB;IAVzC,MAAM,CAAC,GAAG,CAAoB,GAAM,EAAE,YAA0B;QAC/D,OAAO,IAAI,KAAK,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;IACrC,CAAC;IACD,MAAM,CAAC,UAAU,CAAoB,YAA0B;QAC9D,OAAO,IAAI,KAAK,CAAC,EAAO,EAAE,YAAY,CAAC,CAAC;IACzC,CAAC;IAES,OAAO,GAAG,IAAI,GAAG,EAAuB,CAAC;IAGnD,YAAsB,IAAO,EAAY,KAAmB;QAAtC,SAAI,GAAJ,IAAI,CAAG;QAAY,UAAK,GAAL,KAAK,CAAc;IAAI,CAAC;IACjE,GAAG,CAAC,GAAY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M,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvF,CAAC;IACO,aAAa,CAAC,OAAY;QACjC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC;QACpB,IAAI,CAAC,aAAa,EAAE,CAAC;IACtB,CAAC;IAED,aAAa;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC;IACpB,CAAC;CACD","sourcesContent":["import { TypeOf } from '../api/utils.js';\n\nexport type Context = Record<PropertyKey, any>;\nexport interface Scope<T = Context> {\n\n\t/**\n\t * get value of `propertyKey` in current context\n\t * @param propertyKey \n\t */\n\tget(propertyKey: keyof T): any;\n\n\t/**\n\t * set the value of `propertyKey` in current context, could be instilled with `value`.\n\t * @param propertyKey \n\t * @param value \n\t * @param receiver \n\t */\n\tset(propertyKey: keyof T, value?: any, receiver?: any): boolean;\n\n\t/**\n\t * is current context has `propertyKey` in hash map keys\n\t * @param propertyKey \n\t */\n\thas(propertyKey: keyof T): boolean;\n\n\t/**\n\t * delete property from context\n\t * @param propertyKey \n\t */\n\tdelete(propertyKey: keyof T): boolean;\n\n\t/**\n\t * get current context object of this scope\n\t */\n\tgetContext(): T;\n\n\t/**\n\t * get a proxy of the current context object if exists. \n\t */\n\tgetContextProxy?(): T;\n\n\t/**\n\t * get a scope for an object named as `propertyKey` from cache map,\n\t * \n\t * if the current value is not type od `object`, will return `undefined`.\n\t * @param propertyKey the name of the property\n\t */\n\tgetInnerScope<S extends Scope<Context>>(propertyKey: keyof T): S | undefined;\n\n\t/**\n\t * create a scope with the same type of this scope\n\t */\n\tsetInnerScope<S extends Scope<Context>>(propertyKey: keyof T): S;\n\n\t/**\n\t * sc\n\t * @param propertyKey \n\t * @param scope \n\t */\n\tsetInnerScope<S extends Scope<Context>>(propertyKey: keyof T, scope?: S): S;\n\n\tgetClass(): TypeOf<Scope<Context>>;\n}\n\nexport class Scope<T extends Context> implements Scope<T> {\n\tstatic for<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\treturn new Scope(ctx, propertyKeys);\n\t}\n\tstatic blockScope<T extends Context>(propertyKeys?: (keyof T)[]) {\n\t\treturn new Scope({} as T, propertyKeys);\n\t}\n\n\tprotected _inners = new Map<keyof T, Scope<any>>();\n\n\tconstructor(context: T, propertyKeys?: (keyof T)[]);\n\tconstructor(protected _ctx: T, protected _keys?: (keyof T)[]) { }\n\tget(key: keyof T): any {\n\t\treturn Reflect.get(this._ctx, key);\n\t}\n\tset(key: keyof T, value: any, receiver?: any): boolean {\n\t\treturn Reflect.set(this._ctx, key, value);\n\t}\n\thas(key: keyof T): boolean {\n\t\treturn this._keys?.includes(key) ?? key in this._ctx;\n\t}\n\tdelete(key: keyof T): boolean {\n\t\treturn Reflect.deleteProperty(this._ctx, key);\n\t}\n\tgetContext(): T {\n\t\treturn this._ctx;\n\t}\n\tgetInnerScope<S extends Scope<Context>>(key: keyof T): S | undefined {\n\t\tconst ctx = this.get(key);\n\t\tlet scope = this._inners.get(key);\n\t\tif (scope) {\n\t\t\tscope._ctx = ctx;\n\t\t\treturn scope as S;\n\t\t}\n\t\tif (!(ctx && typeof ctx === 'object')) {\n\t\t\treturn;\n\t\t}\n\t\tscope = new (this.getClass())(ctx, undefined, key, this);\n\t\tthis._inners.set(key, scope);\n\t\treturn scope as S;\n\t}\n\tsetInnerScope<S extends Scope<Context>>(key: keyof T, scope?: S): S {\n\t\tif (scope) {\n\t\t\tthis._inners.set(key, scope);\n\t\t\treturn scope;\n\t\t}\n\t\tconst ctx = this.get(key);\n\t\tscope = new (this.getClass())(ctx, undefined, key, this) as S;\n\t\tthis._inners.set(key, scope);\n\t\treturn scope;\n\t}\n\tgetClass(): TypeOf<Scope<Context>> {\n\t\treturn Scope;\n\t}\n}\n\nexport class ReadOnlyScope<T extends Context> extends Scope<T> {\n\tstatic for<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\treturn new ReadOnlyScope(ctx, propertyKeys);\n\t}\n\tstatic blockScope<T extends Context>(propertyKeys?: (keyof T)[]) {\n\t\treturn new ReadOnlyScope({} as T, propertyKeys);\n\t}\n\tset(propertyKey: keyof T, value: any, receiver?: any): boolean {\n\t\t// do nothing\n\t\treturn false;\n\t}\n\tdelete(propertyKey: keyof T): boolean {\n\t\t// do nothing\n\t\treturn false;\n\t}\n\tgetClass(): TypeOf<ReadOnlyScope<Context>> {\n\t\treturn ReadOnlyScope;\n\t}\n}\n\nexport class ScopeSubscription<T> {\n\tconstructor(private propertyKey: keyof T, private observer: ValueChangeObserver<T>) { }\n\tpause() {\n\t\tthis.observer.pause(this.propertyKey, this);\n\t}\n\tresume() {\n\t\tthis.observer.resume(this.propertyKey, this);\n\t}\n\tunsubscribe(): void {\n\t\tthis.observer.unsubscribe(this.propertyKey, this);\n\t}\n}\n\nexport type ValueChangedCallback = (newValue: any, oldValue?: any) => void;\n\ntype SubscriptionInfo = { callback: ValueChangedCallback, enable: boolean };\n\nexport class ValueChangeObserver<T> {\n\tprivate _subscribers: Map<keyof T, Map<ScopeSubscription<T>, SubscriptionInfo>> = new Map();\n\tprivate _lock: (keyof T)[] = [];\n\temit(propertyKey: keyof T, newValue: any, oldValue?: any): void {\n\t\tif (this._lock.includes(propertyKey)) {\n\t\t\treturn;\n\t\t}\n\t\tconst subscribers = this._subscribers.get(propertyKey);\n\t\tif (!subscribers || subscribers.size == 0) {\n\t\t\treturn;\n\t\t}\n\t\tthis._lock.push(propertyKey);\n\n\t\tconst currentSubscription = Array.from(subscribers.values());\n\t\tcurrentSubscription.forEach(subscriptionInfo => {\n\t\t\tif (!subscriptionInfo.enable) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tsubscriptionInfo.callback(newValue, oldValue);\n\t\t\t} catch (e) {\n\t\t\t\tconsole.error(e);\n\t\t\t}\n\t\t});\n\t\tif (this._lock.pop() !== propertyKey) {\n\t\t\tconsole.error('lock error');\n\t\t};\n\t}\n\tsubscribe(propertyKey: keyof T, callback: ValueChangedCallback): ScopeSubscription<T> {\n\t\tconst subscription: ScopeSubscription<T> = new ScopeSubscription(propertyKey, this);\n\t\tlet propertySubscribers = this._subscribers.get(propertyKey);\n\t\tif (!propertySubscribers) {\n\t\t\tpropertySubscribers = new Map();\n\t\t\tthis._subscribers.set(propertyKey, propertySubscribers);\n\t\t}\n\t\tpropertySubscribers.set(subscription, { callback, enable: true });\n\t\treturn subscription;\n\t}\n\n\tunsubscribe(propertyKey: keyof T, subscription?: ScopeSubscription<T>) {\n\t\tif (subscription) {\n\t\t\tthis._subscribers.get(propertyKey)?.delete(subscription);\n\t\t} else {\n\t\t\tthis._subscribers.delete(propertyKey);\n\t\t}\n\t}\n\n\tpause(propertyKey: keyof T, subscription: ScopeSubscription<T>) {\n\t\tconst subscriptionInfo = this._subscribers.get(propertyKey)?.get(subscription);\n\t\tsubscriptionInfo && (subscriptionInfo.enable = false);\n\t}\n\n\tresume(propertyKey: keyof T, subscription: ScopeSubscription<T>) {\n\t\tconst subscriptionInfo = this._subscribers.get(propertyKey)?.get(subscription);\n\t\tsubscriptionInfo && (subscriptionInfo.enable = true);\n\t}\n\n\t/**\n\t * check if this Observer has any subscribers\n\t */\n\thasSubscribers(): boolean;\n\n\t/**\n\t * check if there is any subscribers registered by the propertyKey.\n\t * \n\t * @param propertyKey\n\t */\n\thasSubscribers(propertyKey: keyof T): boolean;\n\thasSubscribers(propertyKey?: keyof T): boolean {\n\t\tif (propertyKey) {\n\t\t\treturn (this._subscribers.get(propertyKey)?.size ?? 0) > 0;\n\t\t}\n\t\treturn this._subscribers.size > 0;\n\t}\n\n\t/**\n\t * clear subscription maps\n\t */\n\tdestroy() {\n\t\tthis._subscribers.clear();\n\t}\n}\n\nexport class ReactiveScope<T extends Context> extends Scope<T> {\n\tstatic for<T extends Context>(context: T, propertyKeys?: (keyof T)[]) {\n\t\treturn new ReactiveScope(context, propertyKeys);\n\t}\n\tstatic blockScope<T extends Context>(propertyKeys?: (keyof T)[]) {\n\t\treturn new ReactiveScope({} as T, propertyKeys);\n\t}\n\tstatic scopeForThis<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\tconst thisScope = ReactiveScope.for(ctx, propertyKeys);\n\t\tconst thisCtx = {\n\t\t\t'this': ctx,\n\t\t};\n\t\tconst rootScope = Scope.for(thisCtx, ['this']);\n\t\trootScope.setInnerScope('this', thisScope);\n\t\treturn rootScope;\n\t}\n\tstatic readOnlyScopeForThis<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\tconst thisScope = ReactiveScope.for(ctx, propertyKeys);\n\t\tconst thisCtx = {\n\t\t\t'this': ctx,\n\t\t};\n\t\tconst rootScope = ReadOnlyScope.for(thisCtx, ['this']);\n\t\trootScope.setInnerScope('this', thisScope);\n\t\treturn rootScope;\n\t}\n\tprotected _clone: T;\n\tdeclare protected _inners: Map<keyof T, ReactiveScope<any>>;\n\tprotected _observer: ValueChangeObserver<T> = new ValueChangeObserver<T>();\n\n\n\tconstructor(context: T, propertyKeys?: (keyof T)[], protected _name?: PropertyKey, protected _parent?: ReactiveScope<any>) {\n\t\tsuper(context, propertyKeys);\n\t\tthis._clone = Object.assign({}, context);\n\t}\n\n\tset(propertyKey: keyof T, newValue: any, receiver?: any): boolean {\n\t\tconst oldValue = Reflect.get(this._ctx, propertyKey);\n\t\tconst result = Reflect.set(this._ctx, propertyKey, newValue);\n\t\tif (result) {\n\t\t\tthis.emit(propertyKey, newValue, oldValue);\n\t\t}\n\t\treturn result;\n\t}\n\tdelete(propertyKey: keyof T): boolean {\n\t\tconst oldValue = Reflect.get(this._ctx, propertyKey);\n\t\tconst isDelete = Reflect.deleteProperty(this._ctx, propertyKey);\n\t\tif (isDelete && oldValue !== undefined) {\n\t\t\tthis.emit(propertyKey, undefined, oldValue);\n\t\t}\n\t\treturn isDelete;\n\t}\n\temit(propertyKey: keyof T, newValue: any, oldValue?: any): void {\n\t\tthis._observer.emit(propertyKey, newValue, oldValue);\n\t\tthis._parent?.emit(this._name!, this._ctx);\n\t}\n\tsubscribe(propertyKey: keyof T, callback: ValueChangedCallback): ScopeSubscription<T> {\n\t\treturn this._observer.subscribe(propertyKey, callback);\n\t}\n\tunsubscribe(propertyKey?: keyof T, subscription?: ScopeSubscription<T>) {\n\t\tif (subscription && propertyKey !== null && propertyKey !== undefined) {\n\t\t\tthis._observer.unsubscribe(propertyKey, subscription);\n\t\t} else if (propertyKey !== null && propertyKey !== undefined) {\n\t\t\tthis._observer.unsubscribe(propertyKey);\n\t\t} else {\n\t\t\tthis._observer.destroy();\n\t\t}\n\t}\n\tdetectChanges() {\n\t\tconst previous = this._clone;\n\t\tconst current = this._ctx;\n\t\tif ((!!!previous && !!current) || (!!previous && !!!current)) {\n\t\t\tthis._parent?.emit(this._name!, current);\n\t\t\treturn;\n\t\t}\n\t\tconst keys = this._keys ?? this.getPropertyKeys(previous, current);\n\t\tkeys.forEach(key => {\n\t\t\tconst pv = previous[key];\n\t\t\tconst cv = current[key];\n\t\t\tconst pt = typeof pv;\n\t\t\tconst ct = typeof cv;\n\t\t\tif (pt === 'object') {\n\t\t\t\tif (ct === 'object' && pv == cv) {\n\t\t\t\t\tthis.getInnerScope<ReactiveScope<Context>>(key)?.detectChanges();\n\t\t\t\t} else if (cv != pv) {\n\t\t\t\t\tthis.emit(key, cv, pv);\n\t\t\t\t}\n\t\t\t} else if (ct === 'object') {\n\t\t\t\tthis.emit(key, cv, pv);\n\t\t\t} else if (pv != cv) {\n\t\t\t\tthis.emit(key, cv, pv);\n\t\t\t}\n\t\t});\n\t\tthis._clone = Object.assign({}, this._ctx);\n\t}\n\tprotected getPropertyKeys<V extends Record<PropertyKey, any>>(...objs: V[]) {\n\t\tlet keys: (keyof V)[] = [];\n\t\tobjs.forEach(obj => {\n\t\t\tkeys.push(...Object.keys(obj));\n\t\t\tkeys.push(...Object.getOwnPropertySymbols(obj));\n\t\t});\n\t\tkeys = Array.from(new Set(keys));\n\t\tkeys = keys.filter(key => {\n\t\t\tswitch (typeof key) {\n\t\t\t\tcase 'string':\n\t\t\t\t\treturn !key.startsWith('_');\n\t\t\t\tcase 'symbol':\n\t\t\t\t\treturn !key.toString().startsWith('Symbol(_');\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t\treturn keys;\n\t}\n\tgetClass(): TypeOf<ReactiveScope<Context>> {\n\t\treturn ReactiveScope;\n\t}\n}\n\n/**\n * used control/notify/pause scope about changes in current context\n */\nexport interface ScopeControl<T extends Context> {\n\n\t/**\n\t * get current stacte of applying change detection.\n\t */\n\tisAttached(): boolean;\n\n\t/**\n\t * used when want to update ui-view like, you want to replace an array with another \n\t * without reflect changes on view until reattached again.\n\t */\n\tdetach(): void;\n\n\t/**\n\t * apply all the not emitted changes, and continue emit in time.\n\t */\n\treattach(): void;\n\n\t/**\n\t * apply changes now,\n\t * will not effect the state of the detector wither if attached ot not.\n\t * \n\t * if a propertyKey is provided, will emit this property only \n\t * @param propertyKey \n\t */\n\temitChanges(propertyKey?: keyof T, propertyValue?: any): void;\n\n\t/**\n\t * throw error if any changes has been made\n\t */\n\tcheckNoChanges(): void;\n}\n\nexport class ReactiveScopeControl<T extends Context> extends ReactiveScope<T> implements ScopeControl<T> {\n\tstatic for<T extends Context>(context: T, propertyKeys?: (keyof T)[]) {\n\t\treturn new ReactiveScopeControl(context, propertyKeys);\n\t}\n\tstatic blockScope<T extends Context>(propertyKeys?: (keyof T)[]) {\n\t\treturn new ReactiveScopeControl({} as T, propertyKeys);\n\t}\n\tstatic scopeForThis<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\tconst thisScope = ReactiveScopeControl.for(ctx, propertyKeys);\n\t\tconst thisCtx = {\n\t\t\t'this': ctx,\n\t\t};\n\t\tconst rootScope = Scope.for(thisCtx, ['this']);\n\t\trootScope.setInnerScope('this', thisScope);\n\t\treturn rootScope;\n\t}\n\tstatic readOnlyScopeForThis<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\tconst thisScope = ReactiveScopeControl.for(ctx, propertyKeys);\n\t\tconst thisCtx = {\n\t\t\t'this': ctx,\n\t\t};\n\t\tconst rootScope = ReadOnlyScope.for(thisCtx, ['this']);\n\t\trootScope.setInnerScope('this', thisScope);\n\t\treturn rootScope;\n\t}\n\tstatic reactiveScopeForThis<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\tconst thisScope = ReactiveScope.for(ctx, propertyKeys);\n\t\tconst thisCtx = {\n\t\t\t'this': ctx,\n\t\t};\n\t\tconst rootScope = Scope.for(thisCtx, ['this']);\n\t\trootScope.setInnerScope('this', thisScope);\n\t\treturn rootScope;\n\t}\n\n\tprotected _attached: boolean = true;\n\tprotected _marked: { [key: keyof Context]: [any, any] } = {};\n\n\toverride emit(propertyKey: keyof T, newValue: any, oldValue?: any): void {\n\t\tif (this._attached) {\n\t\t\tsuper.emit(propertyKey, newValue, oldValue);\n\t\t} else if (this._marked[propertyKey as string]) {\n\t\t\tif (newValue == this._marked[propertyKey as string][1]) {\n\t\t\t\tdelete this._marked[propertyKey as string];\n\t\t\t} else {\n\t\t\t\tthis._marked[propertyKey as string][0] = newValue;\n\t\t\t}\n\t\t} else {\n\t\t\tthis._marked[propertyKey as string] = [newValue, oldValue];\n\t\t}\n\t}\n\tisAttached(): boolean {\n\t\treturn this._attached;\n\t}\n\tdetach(): void {\n\t\tthis._attached = false;\n\t}\n\treattach(): void {\n\t\tthis._attached = true;\n\t\tthis.emitChanges();\n\t}\n\temitChanges(propertyKey?: keyof T, propertyValue?: any): void {\n\t\tif (propertyKey) {\n\t\t\tsuper.emit(propertyKey, propertyValue);\n\t\t\tReflect.deleteProperty(this._marked, propertyKey);\n\t\t\treturn;\n\t\t}\n\t\tconst latestChanges = this._marked;\n\t\tthis._marked = {};\n\t\tconst keys = this._keys ?? this.getPropertyKeys(latestChanges);\n\t\tkeys.forEach(propertyKey => {\n\t\t\tthis._observer.emit(propertyKey, latestChanges[propertyKey][0], latestChanges[propertyKey][1]);\n\t\t});\n\t\tkeys.length && this._parent?.emit(this._name!, this._ctx);\n\t}\n\tdetectChanges() {\n\t\tthis.detach();\n\t\tsuper.detectChanges();\n\t\tthis.reattach();\n\t}\n\tcheckNoChanges() {\n\t\tthis.detach();\n\t\tsuper.detectChanges();\n\t\tconst keys = Object.keys(this._marked);\n\t\tif (keys.length > 0) {\n\t\t\tthrow new Error(`Some Changes had been detected`);\n\t\t}\n\t}\n\tgetClass(): TypeOf<ReactiveScopeControl<Context>> {\n\t\treturn ReactiveScopeControl;\n\t}\n}\n\n\ninterface ImportMeta {\n\turl: URL;\n\t/**\n\t *\n\t * Provides a module-relative resolution function scoped to each module, returning\n\t * the URL string.\n\t *\n\t * @param specified The module specifier to resolve relative to `parent`.\n\t * @param parent The absolute parent module URL to resolve from. If none\n\t * is specified, the value of `import.meta.url` is used as the default.\n\t */\n\tresolve?(specified: string, parent?: string | URL): Promise<string>;\n}\n\nexport interface ModuleImport {\n\tmeta: ImportMeta\n}\n\nexport interface ModuleContext extends Context {\n\timport: ModuleImport & ((path: string) => Promise<any>);\n}\n\nexport class ModuleScope extends ReactiveScope<ModuleContext> {\n\tconstructor(context: ModuleContext, propertyKeys?: (keyof ModuleContext)[]) {\n\t\tsuper(context, propertyKeys);\n\t}\n\timportModule(propertyKey: keyof ModuleContext, scope: ModuleScope): void {\n\t\tthis._ctx[propertyKey] = scope._ctx;\n\t\tthis._inners.set(propertyKey, scope);\n\t\tthis.detectChanges();\n\t}\n}\nexport class WebModuleScope extends ModuleScope {\n\n\t// private loaded = false;\n\tprivate import: Promise<any>;\n\tconstructor(private source: string, private importCallOptions?: ImportCallOptions) {\n\t\tsuper({} as ModuleContext);\n\t\tthis.import = import(\n\t\t\tsource\n\t\t\t/*, { assert: importCallOptions?.assert } */ // TODO: update in future, node16, ESNEXT,ES2022, ES2023, ES2024\n\t\t).then(module => (this.updateContext(module))).then(() => this._ctx, () => this._ctx);\n\t}\n\tprivate updateContext(context: any) {\n\t\tthis._ctx = context;\n\t\tthis.detectChanges();\n\t}\n\n\tresolveImport() {\n\t\treturn this.import;\n\t}\n}\n"]}
1
+ {"version":3,"file":"scope.js","sourceRoot":"","sources":["../../../src/expressions/scope/scope.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAgEnD,MAAM,OAAO,KAAK;IAWK;IAAmB;IAVzC,MAAM,CAAC,GAAG,CAAoB,GAAM,EAAE,YAA0B;QAC/D,OAAO,IAAI,KAAK,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;IACrC,CAAC;IACD,MAAM,CAAC,UAAU,CAAoB,YAA0B;QAC9D,OAAO,IAAI,KAAK,CAAC,EAAO,EAAE,YAAY,CAAC,CAAC;IACzC,CAAC;IAES,OAAO,GAAG,IAAI,GAAG,EAAuB,CAAC;IAGnD,YAAsB,IAAO,EAAY,KAAmB;QAAtC,SAAI,GAAJ,IAAI,CAAG;QAAY,UAAK,GAAL,KAAK,CAAc;IAAI,CAAC;IACjE,GAAG,CAAC,GAAY;QACf,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACpC,CAAC;IACD,GAAG,CAAC,GAAY,EAAE,KAAU,EAAE,QAAc;QAC3C,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IAC3C,CAAC;IACD,GAAG,CAAC,GAAY;QACf,OAAO,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC;IACtD,CAAC;IACD,MAAM,CAAC,GAAY;QAClB,OAAO,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAC/C,CAAC;I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utils.js';\nimport { isChangeDetectionSkipped } from './cd.js';\n\nexport type Context = Record<PropertyKey, any>;\nexport interface Scope<T = Context> {\n\n\t/**\n\t * get value of `propertyKey` in current context\n\t * @param propertyKey \n\t */\n\tget(propertyKey: keyof T): any;\n\n\t/**\n\t * set the value of `propertyKey` in current context, could be instilled with `value`.\n\t * @param propertyKey \n\t * @param value \n\t * @param receiver \n\t */\n\tset(propertyKey: keyof T, value?: any, receiver?: any): boolean;\n\n\t/**\n\t * is current context has `propertyKey` in hash map keys\n\t * @param propertyKey \n\t */\n\thas(propertyKey: keyof T): boolean;\n\n\t/**\n\t * delete property from context\n\t * @param propertyKey \n\t */\n\tdelete(propertyKey: keyof T): boolean;\n\n\t/**\n\t * get current context object of this scope\n\t */\n\tgetContext(): T;\n\n\t/**\n\t * get a proxy of the current context object if exists. \n\t */\n\tgetContextProxy?(): T;\n\n\t/**\n\t * get a scope for an object named as `propertyKey` from cache map,\n\t * \n\t * if the current value is not type od `object`, will return `undefined`.\n\t * @param propertyKey the name of the property\n\t */\n\tgetInnerScope<S extends Scope<Context>>(propertyKey: keyof T): S | undefined;\n\n\t/**\n\t * create a scope with the same type of this scope\n\t */\n\tsetInnerScope<S extends Scope<Context>>(propertyKey: keyof T): S;\n\n\t/**\n\t * sc\n\t * @param propertyKey \n\t * @param scope \n\t */\n\tsetInnerScope<S extends Scope<Context>>(propertyKey: keyof T, scope?: S): S;\n\n\tgetClass(): TypeOf<Scope<Context>>;\n}\n\nexport class Scope<T extends Context> implements Scope<T> {\n\tstatic for<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\treturn new Scope(ctx, propertyKeys);\n\t}\n\tstatic blockScope<T extends Context>(propertyKeys?: (keyof T)[]) {\n\t\treturn new Scope({} as T, propertyKeys);\n\t}\n\n\tprotected _inners = new Map<keyof T, Scope<any>>();\n\n\tconstructor(context: T, propertyKeys?: (keyof T)[]);\n\tconstructor(protected _ctx: T, protected _keys?: (keyof T)[]) { }\n\tget(key: keyof T): any {\n\t\treturn Reflect.get(this._ctx, key);\n\t}\n\tset(key: keyof T, value: any, receiver?: any): boolean {\n\t\treturn Reflect.set(this._ctx, key, value);\n\t}\n\thas(key: keyof T): boolean {\n\t\treturn this._keys?.includes(key) ?? key in this._ctx;\n\t}\n\tdelete(key: keyof T): boolean {\n\t\treturn Reflect.deleteProperty(this._ctx, key);\n\t}\n\tgetContext(): T {\n\t\treturn this._ctx;\n\t}\n\tgetInnerScope<S extends Scope<Context>>(key: keyof T): S | undefined {\n\t\tconst ctx = this.get(key);\n\t\tlet scope = this._inners.get(key);\n\t\tif (scope) {\n\t\t\tscope._ctx = ctx;\n\t\t\treturn scope as S;\n\t\t}\n\t\tif (!(ctx && typeof ctx === 'object')) {\n\t\t\treturn;\n\t\t}\n\t\tscope = new (this.getClass())(ctx, undefined, key, this);\n\t\tthis._inners.set(key, scope);\n\t\treturn scope as S;\n\t}\n\tsetInnerScope<S extends Scope<Context>>(key: keyof T, scope?: S): S {\n\t\tif (scope) {\n\t\t\tthis._inners.set(key, scope);\n\t\t\treturn scope;\n\t\t}\n\t\tconst ctx = this.get(key);\n\t\tscope = new (this.getClass())(ctx, undefined, key, this) as S;\n\t\tthis._inners.set(key, scope);\n\t\treturn scope;\n\t}\n\tgetClass(): TypeOf<Scope<Context>> {\n\t\treturn Scope;\n\t}\n}\n\nexport class ReadOnlyScope<T extends Context> extends Scope<T> {\n\tstatic for<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\treturn new ReadOnlyScope(ctx, propertyKeys);\n\t}\n\tstatic blockScope<T extends Context>(propertyKeys?: (keyof T)[]) {\n\t\treturn new ReadOnlyScope({} as T, propertyKeys);\n\t}\n\tset(propertyKey: keyof T, value: any, receiver?: any): boolean {\n\t\t// do nothing\n\t\treturn false;\n\t}\n\tdelete(propertyKey: keyof T): boolean {\n\t\t// do nothing\n\t\treturn false;\n\t}\n\tgetClass(): TypeOf<ReadOnlyScope<Context>> {\n\t\treturn ReadOnlyScope;\n\t}\n}\n\nexport class ScopeSubscription<T> {\n\tconstructor(private propertyKey: keyof T, private observer: ValueChangeObserver<T>) { }\n\tpause() {\n\t\tthis.observer.pause(this.propertyKey, this);\n\t}\n\tresume() {\n\t\tthis.observer.resume(this.propertyKey, this);\n\t}\n\tunsubscribe(): void {\n\t\tthis.observer.unsubscribe(this.propertyKey, this);\n\t}\n}\n\nexport type ValueChangedCallback = (newValue: any, oldValue?: any) => void;\n\ntype SubscriptionInfo = { callback: ValueChangedCallback, enable: boolean };\n\nexport class ValueChangeObserver<T> {\n\tprivate _subscribers: Map<keyof T, Map<ScopeSubscription<T>, SubscriptionInfo>> = new Map();\n\tprivate _lock: (keyof T)[] = [];\n\temit(propertyKey: keyof T, newValue: any, oldValue?: any): void {\n\t\tif (this._lock.includes(propertyKey)) {\n\t\t\treturn;\n\t\t}\n\t\tconst subscribers = this._subscribers.get(propertyKey);\n\t\tif (!subscribers || subscribers.size == 0) {\n\t\t\treturn;\n\t\t}\n\t\tthis._lock.push(propertyKey);\n\n\t\tconst currentSubscription = Array.from(subscribers.values());\n\t\tcurrentSubscription.forEach(subscriptionInfo => {\n\t\t\tif (!subscriptionInfo.enable) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tsubscriptionInfo.callback(newValue, oldValue);\n\t\t\t} catch (e) {\n\t\t\t\tconsole.error(e);\n\t\t\t}\n\t\t});\n\t\tif (this._lock.pop() !== propertyKey) {\n\t\t\tconsole.error('lock error');\n\t\t};\n\t}\n\tsubscribe(propertyKey: keyof T, callback: ValueChangedCallback): ScopeSubscription<T> {\n\t\tconst subscription: ScopeSubscription<T> = new ScopeSubscription(propertyKey, this);\n\t\tlet propertySubscribers = this._subscribers.get(propertyKey);\n\t\tif (!propertySubscribers) {\n\t\t\tpropertySubscribers = new Map();\n\t\t\tthis._subscribers.set(propertyKey, propertySubscribers);\n\t\t}\n\t\tpropertySubscribers.set(subscription, { callback, enable: true });\n\t\treturn subscription;\n\t}\n\n\tunsubscribe(propertyKey: keyof T, subscription?: ScopeSubscription<T>) {\n\t\tif (subscription) {\n\t\t\tthis._subscribers.get(propertyKey)?.delete(subscription);\n\t\t} else {\n\t\t\tthis._subscribers.delete(propertyKey);\n\t\t}\n\t}\n\n\tpause(propertyKey: keyof T, subscription: ScopeSubscription<T>) {\n\t\tconst subscriptionInfo = this._subscribers.get(propertyKey)?.get(subscription);\n\t\tsubscriptionInfo && (subscriptionInfo.enable = false);\n\t}\n\n\tresume(propertyKey: keyof T, subscription: ScopeSubscription<T>) {\n\t\tconst subscriptionInfo = this._subscribers.get(propertyKey)?.get(subscription);\n\t\tsubscriptionInfo && (subscriptionInfo.enable = true);\n\t}\n\n\t/**\n\t * check if this Observer has any subscribers\n\t */\n\thasSubscribers(): boolean;\n\n\t/**\n\t * check if there is any subscribers registered by the propertyKey.\n\t * \n\t * @param propertyKey\n\t */\n\thasSubscribers(propertyKey: keyof T): boolean;\n\thasSubscribers(propertyKey?: keyof T): boolean {\n\t\tif (propertyKey) {\n\t\t\treturn (this._subscribers.get(propertyKey)?.size ?? 0) > 0;\n\t\t}\n\t\treturn this._subscribers.size > 0;\n\t}\n\n\t/**\n\t * clear subscription maps\n\t */\n\tdestroy() {\n\t\tthis._subscribers.clear();\n\t}\n}\n\nexport class ReactiveScope<T extends Context> extends Scope<T> {\n\tstatic for<T extends Context>(context: T, propertyKeys?: (keyof T)[]) {\n\t\treturn new ReactiveScope(context, propertyKeys);\n\t}\n\tstatic blockScope<T extends Context>(propertyKeys?: (keyof T)[]) {\n\t\treturn new ReactiveScope({} as T, propertyKeys);\n\t}\n\tstatic scopeForThis<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\tconst thisScope = ReactiveScope.for(ctx, propertyKeys);\n\t\tconst thisCtx = {\n\t\t\t'this': ctx,\n\t\t};\n\t\tconst rootScope = Scope.for(thisCtx, ['this']);\n\t\trootScope.setInnerScope('this', thisScope);\n\t\treturn rootScope;\n\t}\n\tstatic readOnlyScopeForThis<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\tconst thisScope = ReactiveScope.for(ctx, propertyKeys);\n\t\tconst thisCtx = {\n\t\t\t'this': ctx,\n\t\t};\n\t\tconst rootScope = ReadOnlyScope.for(thisCtx, ['this']);\n\t\trootScope.setInnerScope('this', thisScope);\n\t\treturn rootScope;\n\t}\n\tprotected _clone: T;\n\tdeclare protected _inners: Map<keyof T, ReactiveScope<any>>;\n\tprotected _observer: ValueChangeObserver<T> = new ValueChangeObserver<T>();\n\n\n\tconstructor(context: T, propertyKeys?: (keyof T)[], protected _name?: PropertyKey, protected _parent?: ReactiveScope<any>) {\n\t\tsuper(context, propertyKeys);\n\t\tthis._clone = Object.assign({}, context);\n\t}\n\n\tset(propertyKey: keyof T, newValue: any, receiver?: any): boolean {\n\t\tconst oldValue = Reflect.get(this._ctx, propertyKey);\n\t\tconst result = Reflect.set(this._ctx, propertyKey, newValue);\n\t\tif (result) {\n\t\t\tthis.emit(propertyKey, newValue, oldValue);\n\t\t}\n\t\treturn result;\n\t}\n\tdelete(propertyKey: keyof T): boolean {\n\t\tconst oldValue = Reflect.get(this._ctx, propertyKey);\n\t\tconst isDelete = Reflect.deleteProperty(this._ctx, propertyKey);\n\t\tif (isDelete && oldValue !== undefined) {\n\t\t\tthis.emit(propertyKey, undefined, oldValue);\n\t\t}\n\t\treturn isDelete;\n\t}\n\temit(propertyKey: keyof T, newValue: any, oldValue?: any): void {\n\t\tthis._observer.emit(propertyKey, newValue, oldValue);\n\t\tthis._parent?.emit(this._name!, this._ctx);\n\t}\n\tsubscribe(propertyKey: keyof T, callback: ValueChangedCallback): ScopeSubscription<T> {\n\t\treturn this._observer.subscribe(propertyKey, callback);\n\t}\n\tunsubscribe(propertyKey?: keyof T, subscription?: ScopeSubscription<T>) {\n\t\tif (subscription && propertyKey !== null && propertyKey !== undefined) {\n\t\t\tthis._observer.unsubscribe(propertyKey, subscription);\n\t\t} else if (propertyKey !== null && propertyKey !== undefined) {\n\t\t\tthis._observer.unsubscribe(propertyKey);\n\t\t} else {\n\t\t\tthis._observer.destroy();\n\t\t}\n\t}\n\tdetectChanges() {\n\t\tconst previous = this._clone;\n\t\tconst current = this._ctx;\n\t\tif ((!!!previous && !!current) || (!!previous && !!!current)) {\n\t\t\tthis._parent?.emit(this._name!, current);\n\t\t\treturn;\n\t\t}\n\t\tconst keys = this._keys ?? this.getPropertyKeys(previous, current);\n\t\tkeys.forEach(key => {\n\t\t\tconst pv = previous[key];\n\t\t\tconst cv = current[key];\n\t\t\tconst pt = typeof pv;\n\t\t\tconst ct = typeof cv;\n\t\t\tif (pt === 'object') {\n\t\t\t\tif (ct === 'object' && pv == cv) {\n\t\t\t\t\tthis.getInnerScope<ReactiveScope<Context>>(key)?.detectChanges();\n\t\t\t\t} else if (cv != pv) {\n\t\t\t\t\tthis.emit(key, cv, pv);\n\t\t\t\t}\n\t\t\t} else if (ct === 'object') {\n\t\t\t\tthis.emit(key, cv, pv);\n\t\t\t} else if (pv != cv) {\n\t\t\t\tthis.emit(key, cv, pv);\n\t\t\t}\n\t\t});\n\t\tthis._clone = Object.assign({}, this._ctx);\n\t}\n\tprotected getPropertyKeys<V extends Record<PropertyKey, any>>(...objs: V[]) {\n\t\tlet keys: (keyof V)[] = [];\n\t\tobjs.forEach(obj => {\n\t\t\tkeys.push(...Object.keys(obj).filter(key => !isChangeDetectionSkipped(obj[key])));\n\t\t\tkeys.push(...Object.getOwnPropertySymbols(obj));\n\t\t});\n\t\tkeys = Array.from(new Set(keys));\n\t\tkeys = keys.filter(key => {\n\t\t\tswitch (typeof key) {\n\t\t\t\tcase 'string':\n\t\t\t\t\treturn !key.startsWith('_');\n\t\t\t\tcase 'symbol':\n\t\t\t\t\treturn !key.toString().startsWith('Symbol(_');\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t\treturn keys;\n\t}\n\tgetClass(): TypeOf<ReactiveScope<Context>> {\n\t\treturn ReactiveScope;\n\t}\n}\n\n/**\n * used control/notify/pause scope about changes in current context\n */\nexport interface ControlScope<T extends Context> {\n\n\t/**\n\t * get current stacte of applying change detection.\n\t */\n\tisAttached(): boolean;\n\n\t/**\n\t * used when want to update ui-view like, you want to replace an array with another \n\t * without reflect changes on view until reattached again.\n\t */\n\tdetach(): void;\n\n\t/**\n\t * apply all the not emitted changes, and continue emit in time.\n\t */\n\treattach(): void;\n\n\t/**\n\t * apply changes now,\n\t * will not effect the state of the detector wither if attached ot not.\n\t * \n\t * if a propertyKey is provided, will emit this property only \n\t * @param propertyKey \n\t */\n\temitChanges(propertyKey?: keyof T, propertyValue?: any): void;\n\n\t/**\n\t * throw error if any changes has been made\n\t */\n\tcheckNoChanges(): void;\n}\n\nexport class ReactiveControlScope<T extends Context> extends ReactiveScope<T> implements ControlScope<T> {\n\tstatic for<T extends Context>(context: T, propertyKeys?: (keyof T)[]) {\n\t\treturn new ReactiveControlScope(context, propertyKeys);\n\t}\n\tstatic blockScope<T extends Context>(propertyKeys?: (keyof T)[]) {\n\t\treturn new ReactiveControlScope({} as T, propertyKeys);\n\t}\n\tstatic scopeForThis<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\tconst thisScope = ReactiveControlScope.for(ctx, propertyKeys);\n\t\tconst thisCtx = {\n\t\t\t'this': ctx,\n\t\t};\n\t\tconst rootScope = Scope.for(thisCtx, ['this']);\n\t\trootScope.setInnerScope('this', thisScope);\n\t\treturn rootScope;\n\t}\n\tstatic readOnlyScopeForThis<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\tconst thisScope = ReactiveControlScope.for(ctx, propertyKeys);\n\t\tconst thisCtx = {\n\t\t\t'this': ctx,\n\t\t};\n\t\tconst rootScope = ReadOnlyScope.for(thisCtx, ['this']);\n\t\trootScope.setInnerScope('this', thisScope);\n\t\treturn rootScope;\n\t}\n\tstatic reactiveScopeForThis<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\tconst thisScope = ReactiveScope.for(ctx, propertyKeys);\n\t\tconst thisCtx = {\n\t\t\t'this': ctx,\n\t\t};\n\t\tconst rootScope = Scope.for(thisCtx, ['this']);\n\t\trootScope.setInnerScope('this', thisScope);\n\t\treturn rootScope;\n\t}\n\n\tprotected _attached: boolean = true;\n\tprotected _marked: { [key: keyof Context]: [any, any] } = {};\n\n\toverride emit(propertyKey: keyof T, newValue: any, oldValue?: any): void {\n\t\tif (this._attached) {\n\t\t\tsuper.emit(propertyKey, newValue, oldValue);\n\t\t} else if (this._marked[propertyKey as string]) {\n\t\t\tif (newValue == this._marked[propertyKey as string][1]) {\n\t\t\t\tdelete this._marked[propertyKey as string];\n\t\t\t} else {\n\t\t\t\tthis._marked[propertyKey as string][0] = newValue;\n\t\t\t}\n\t\t} else {\n\t\t\tthis._marked[propertyKey as string] = [newValue, oldValue];\n\t\t}\n\t}\n\tisAttached(): boolean {\n\t\treturn this._attached;\n\t}\n\tdetach(): void {\n\t\tthis._attached = false;\n\t}\n\treattach(): void {\n\t\tthis._attached = true;\n\t\tthis.emitChanges();\n\t}\n\temitChanges(propertyKey?: keyof T, propertyValue?: any): void {\n\t\tif (propertyKey) {\n\t\t\tsuper.emit(propertyKey, propertyValue);\n\t\t\tReflect.deleteProperty(this._marked, propertyKey);\n\t\t\treturn;\n\t\t}\n\t\tconst latestChanges = this._marked;\n\t\tthis._marked = {};\n\t\tconst keys = this._keys ?? this.getPropertyKeys(latestChanges);\n\t\tkeys.forEach(propertyKey => {\n\t\t\tthis._observer.emit(propertyKey, latestChanges[propertyKey][0], latestChanges[propertyKey][1]);\n\t\t});\n\t\tkeys.length && this._parent?.emit(this._name!, this._ctx);\n\t}\n\tdetectChanges() {\n\t\tthis.detach();\n\t\tsuper.detectChanges();\n\t\tthis.reattach();\n\t}\n\tcheckNoChanges() {\n\t\tthis.detach();\n\t\tsuper.detectChanges();\n\t\tconst keys = Object.keys(this._marked);\n\t\tif (keys.length > 0) {\n\t\t\tthrow new Error(`Some Changes had been detected`);\n\t\t}\n\t}\n\tgetClass(): TypeOf<ReactiveControlScope<Context>> {\n\t\treturn ReactiveControlScope;\n\t}\n}\n\n\ninterface ImportMeta {\n\turl: URL;\n\t/**\n\t *\n\t * Provides a module-relative resolution function scoped to each module, returning\n\t * the URL string.\n\t *\n\t * @param specified The module specifier to resolve relative to `parent`.\n\t * @param parent The absolute parent module URL to resolve from. If none\n\t * is specified, the value of `import.meta.url` is used as the default.\n\t */\n\tresolve?(specified: string, parent?: string | URL): Promise<string>;\n}\n\nexport interface ModuleImport {\n\tmeta: ImportMeta\n}\n\nexport interface ModuleContext extends Context {\n\timport: ModuleImport & ((path: string) => Promise<any>);\n}\n\nexport class ModuleScope extends ReactiveScope<ModuleContext> {\n\tconstructor(context: ModuleContext, propertyKeys?: (keyof ModuleContext)[]) {\n\t\tsuper(context, propertyKeys);\n\t}\n\timportModule(propertyKey: keyof ModuleContext, scope: ModuleScope): void {\n\t\tthis._ctx[propertyKey] = scope._ctx;\n\t\tthis._inners.set(propertyKey, scope);\n\t\tthis.detectChanges();\n\t}\n}\nexport class WebModuleScope extends ModuleScope {\n\n\t// private loaded = false;\n\tprivate import: Promise<any>;\n\tconstructor(private source: string, private importCallOptions?: ImportCallOptions) {\n\t\tsuper({} as ModuleContext);\n\t\tthis.import = import(\n\t\t\tsource\n\t\t\t/*, { assert: importCallOptions?.assert } */ // TODO: update in future, node16, ESNEXT,ES2022, ES2023, ES2024\n\t\t).then(module => (this.updateContext(module))).then(() => this._ctx, () => this._ctx);\n\t}\n\tprivate updateContext(context: any) {\n\t\tthis._ctx = context;\n\t\tthis.detectChanges();\n\t}\n\n\tresolveImport() {\n\t\treturn this.import;\n\t}\n}\n"]}
package/scope/signal.d.ts CHANGED
@@ -1,19 +1,19 @@
1
1
  import { ReactiveScope, ValueChangedCallback } from './scope.js';
2
- type CleanupFn = () => void;
2
+ export type CleanupFn = () => void;
3
+ export type CleanupRegister = (cleanupFn?: CleanupFn) => void;
4
+ export type SignalDestroyRef = {
5
+ destroy(): void;
6
+ };
3
7
  export declare class SignalScope extends ReactiveScope<Array<any>> {
4
8
  static create(): SignalScope;
5
9
  private state;
6
10
  private watch;
7
11
  constructor();
8
- createSignal<T, S extends typeof Signal<T>>(initValue?: T, signalType?: S): InstanceType<S>;
9
- createSignalFn<T, S extends typeof Signal<T>>(initValue: T, signalType?: S): WritableSignal<T>;
12
+ getNextKey(): number;
13
+ createSignal<T>(initValue?: T): Signal<T>;
10
14
  createLazy<T>(updateFn: () => T): Lazy<T>;
11
- createLazyFn<T>(updateFn: () => T): ReactiveSignal<T>;
12
15
  createComputed<T>(updateFn: () => T): Computed<T>;
13
- createComputedFn<T>(updateFn: () => T): ReactiveSignal<T>;
14
- createEffect(effectFn: (onCleanup?: CleanupFn) => void): {
15
- destroy(): void;
16
- };
16
+ createEffect(effectFn: (onCleanup?: CleanupFn) => void): SignalDestroyRef;
17
17
  watchState(): void;
18
18
  untrack(): void;
19
19
  observeIndex(index: number): void;
@@ -27,26 +27,12 @@ export declare class SignalScope extends ReactiveScope<Array<any>> {
27
27
  export declare abstract class ReactiveNode<T> {
28
28
  protected scope: SignalScope;
29
29
  protected index: number;
30
- static bindNode<T>(instance: ReactiveNode<T>): void;
31
- static toReactiveSignal<T>(instance: ReadOnlySignal<T>): ReactiveSignal<T>;
32
30
  constructor(scope: SignalScope, index: number);
33
31
  get(): T;
34
- getScope(): void;
35
- getIndex(): void;
32
+ getScope(): SignalScope;
33
+ getIndex(): number;
36
34
  subscribe(callback: ValueChangedCallback): import("./scope.js").ScopeSubscription<any[]>;
37
35
  }
38
- declare const SIGNAL: unique symbol;
39
- export interface Reactive<T> {
40
- [SIGNAL]: ReactiveNode<T>;
41
- }
42
- export declare function isReactive<T = any>(value: unknown): value is Reactive<T>;
43
- export declare function getReactiveNode<T = any>(value: unknown): ReactiveNode<T> | void;
44
- export type ReactiveSignal<T> = (() => T) & {
45
- /**
46
- * original node that can access value from scope
47
- */
48
- [SIGNAL]: unknown;
49
- };
50
36
  export declare class Computed<T> extends ReactiveNode<T> {
51
37
  constructor(scope: SignalScope, index: number, initValue: T);
52
38
  }
@@ -55,24 +41,17 @@ export declare class Lazy<T> extends ReactiveNode<T> {
55
41
  constructor(scope: SignalScope, index: number, updateFn: () => T);
56
42
  get(): T;
57
43
  }
58
- export type WritableSignal<T> = ReactiveSignal<T> & {
59
- set(value: T): void;
60
- update(updateFn: (value: T) => T): void;
61
- };
62
44
  export declare class Signal<T> extends ReactiveNode<T> {
63
- static bindNode<T>(signal: Signal<T>): void;
64
- static toReactiveSignal<T>(signal: Signal<T>): WritableSignal<T>;
65
45
  constructor(scope: SignalScope, index: number, initValue?: T);
66
46
  set(value: T): void;
67
47
  update(updateFn: (value: T) => T): void;
68
- asReadonly(): ReactiveSignal<unknown>;
69
- asReadonlyNode(): ReadOnlySignal<unknown>;
48
+ asReadonly(): ReadOnlySignal<unknown>;
70
49
  }
71
50
  export declare class ReadOnlySignal<T> extends ReactiveNode<T> {
72
51
  }
73
- export declare class SignalValueScope<T> extends ReactiveScope<Record<PropertyKey, any>> {
74
- constructor();
75
- watchSignal(propertyKey: keyof T, node: ReactiveNode<any>): import("./scope.js").ScopeSubscription<any[]>;
76
- }
77
- export {};
52
+ export declare function isSignal<T = any>(signal: unknown): signal is Signal<T>;
53
+ export declare function isComputed<T = any>(signal: unknown): signal is Computed<T>;
54
+ export declare function isLazy<T = any>(signal: unknown): signal is Lazy<T>;
55
+ export declare function isReadOnlySignal<T = any>(signal: unknown): signal is ReadOnlySignal<T>;
56
+ export declare function isReactive<T = any>(signal: unknown): signal is ReactiveNode<T>;
78
57
  //# sourceMappingURL=signal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"signal.d.ts","sourceRoot":"","sources":["../../../src/expressions/scope/signal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEjE,KAAK,SAAS,GAAG,MAAM,IAAI,CAAC;AAW5B,qBAAa,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