@wirestate/lit 0.7.0-experimental.2 → 0.7.0-experimental.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/cjs/development/index.js +164 -191
- package/cjs/development/index.js.map +1 -1
- package/cjs/production/index.js +1 -1
- package/cjs/production/index.js.map +1 -1
- package/esm/development/commands/on-command-controller.js +17 -20
- package/esm/development/commands/on-command-controller.js.map +1 -1
- package/esm/development/commands/on-command.js +4 -9
- package/esm/development/commands/on-command.js.map +1 -1
- package/esm/development/commands/use-on-command.js +4 -3
- package/esm/development/commands/use-on-command.js.map +1 -1
- package/esm/development/consumption/injection.js +10 -9
- package/esm/development/consumption/injection.js.map +1 -1
- package/esm/development/consumption/use-container.js +2 -2
- package/esm/development/consumption/use-container.js.map +1 -1
- package/esm/development/consumption/use-injection.js +9 -7
- package/esm/development/consumption/use-injection.js.map +1 -1
- package/esm/development/consumption/use-scope.js +2 -2
- package/esm/development/consumption/use-scope.js.map +1 -1
- package/esm/development/context/container-context.js +2 -2
- package/esm/development/context/container-context.js.map +1 -1
- package/esm/development/error/error-code.js +1 -1
- package/esm/development/error/error-code.js.map +1 -1
- package/esm/development/events/on-event-controller.js +20 -24
- package/esm/development/events/on-event-controller.js.map +1 -1
- package/esm/development/events/on-event.js +5 -11
- package/esm/development/events/on-event.js.map +1 -1
- package/esm/development/events/use-on-events.js +5 -5
- package/esm/development/events/use-on-events.js.map +1 -1
- package/esm/development/provision/container-provide.js +7 -7
- package/esm/development/provision/container-provide.js.map +1 -1
- package/esm/development/provision/container-provider.js +17 -23
- package/esm/development/provision/container-provider.js.map +1 -1
- package/esm/development/provision/sub-container-provide.js +7 -7
- package/esm/development/provision/sub-container-provide.js.map +1 -1
- package/esm/development/provision/sub-container-provider.js +28 -31
- package/esm/development/provision/sub-container-provider.js.map +1 -1
- package/esm/development/queries/on-query-controller.js +17 -20
- package/esm/development/queries/on-query-controller.js.map +1 -1
- package/esm/development/queries/on-query.js +4 -9
- package/esm/development/queries/on-query.js.map +1 -1
- package/esm/development/queries/use-on-query.js +4 -3
- package/esm/development/queries/use-on-query.js.map +1 -1
- package/esm/production/commands/on-command-controller.js +1 -1
- package/esm/production/commands/on-command-controller.js.map +1 -1
- package/esm/production/commands/on-command.js +1 -1
- package/esm/production/commands/on-command.js.map +1 -1
- package/esm/production/commands/use-on-command.js +1 -1
- package/esm/production/commands/use-on-command.js.map +1 -1
- package/esm/production/consumption/injection.js +1 -1
- package/esm/production/consumption/injection.js.map +1 -1
- package/esm/production/consumption/use-container.js +1 -1
- package/esm/production/consumption/use-container.js.map +1 -1
- package/esm/production/consumption/use-injection.js +1 -1
- package/esm/production/consumption/use-injection.js.map +1 -1
- package/esm/production/consumption/use-scope.js +1 -1
- package/esm/production/consumption/use-scope.js.map +1 -1
- package/esm/production/context/container-context.js +1 -1
- package/esm/production/context/container-context.js.map +1 -1
- package/esm/production/error/error-code.js +1 -1
- package/esm/production/error/error-code.js.map +1 -1
- package/esm/production/events/on-event-controller.js +1 -1
- package/esm/production/events/on-event-controller.js.map +1 -1
- package/esm/production/events/on-event.js +1 -1
- package/esm/production/events/on-event.js.map +1 -1
- package/esm/production/events/use-on-events.js +1 -1
- package/esm/production/events/use-on-events.js.map +1 -1
- package/esm/production/provision/container-provide.js +1 -1
- package/esm/production/provision/container-provide.js.map +1 -1
- package/esm/production/provision/container-provider.js +1 -1
- package/esm/production/provision/container-provider.js.map +1 -1
- package/esm/production/provision/sub-container-provide.js +1 -1
- package/esm/production/provision/sub-container-provide.js.map +1 -1
- package/esm/production/provision/sub-container-provider.js +1 -1
- package/esm/production/provision/sub-container-provider.js.map +1 -1
- package/esm/production/queries/on-query-controller.js +1 -1
- package/esm/production/queries/on-query-controller.js.map +1 -1
- package/esm/production/queries/on-query.js +1 -1
- package/esm/production/queries/on-query.js.map +1 -1
- package/esm/production/queries/use-on-query.js +1 -1
- package/esm/production/queries/use-on-query.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { __spreadArray } from 'tslib';
|
|
2
1
|
import { OnEventController } from './on-event-controller.js';
|
|
3
2
|
|
|
4
3
|
/**
|
|
@@ -43,22 +42,17 @@ import { OnEventController } from './on-event-controller.js';
|
|
|
43
42
|
* ```
|
|
44
43
|
*/
|
|
45
44
|
function onEvent(types) {
|
|
46
|
-
|
|
47
|
-
return
|
|
45
|
+
const normalized = types === undefined ? null : Array.isArray(types) ? [...types] : [types];
|
|
46
|
+
return (protoOrTarget, nameOrContext) => {
|
|
48
47
|
if (typeof nameOrContext === "object") {
|
|
49
48
|
// Standard decorators:
|
|
50
49
|
nameOrContext.addInitializer(function () {
|
|
51
|
-
|
|
52
|
-
new OnEventController(this, normalized, function (event) {
|
|
53
|
-
return _this[nameOrContext.name](event);
|
|
54
|
-
});
|
|
50
|
+
new OnEventController(this, normalized, event => this[nameOrContext.name](event));
|
|
55
51
|
});
|
|
56
52
|
} else {
|
|
57
53
|
// Experimental legacy decorators:
|
|
58
|
-
protoOrTarget.constructor.addInitializer(
|
|
59
|
-
new OnEventController(element, normalized,
|
|
60
|
-
return element[nameOrContext](event);
|
|
61
|
-
});
|
|
54
|
+
protoOrTarget.constructor.addInitializer(element => {
|
|
55
|
+
new OnEventController(element, normalized, event => element[nameOrContext](event));
|
|
62
56
|
});
|
|
63
57
|
}
|
|
64
58
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"on-event.js","sources":["../../../../../../../../src/wirestate-lit/events/on-event.ts"],"sourcesContent":[null],"names":["onEvent","types","normalized","undefined","Array","isArray","
|
|
1
|
+
{"version":3,"file":"on-event.js","sources":["../../../../../../../../src/wirestate-lit/events/on-event.ts"],"sourcesContent":[null],"names":["onEvent","types","normalized","undefined","Array","isArray","protoOrTarget","nameOrContext","addInitializer","OnEventController","event","name","constructor","element"],"mappings":";;AAyBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCG;AACG,SAAUA,OAAOA,CAA0BC,KAA4C,EAAA;EAC3F,MAAMC,UAAU,GACdD,KAAK,KAAKE,SAAS,GAAG,IAAI,GAAGC,KAAK,CAACC,OAAO,CAACJ,KAAK,CAAC,GAAG,CAAC,GAAIA,KAAkC,CAAC,GAAG,CAACA,KAAkB,CAAC;AAErH,EAAA,OAAQ,CAACK,aAAqB,EAAEC,aAAwD,KAAI;AAC1F,IAAA,IAAI,OAAOA,aAAa,KAAK,QAAQ,EAAE;AACrC;MACAA,aAAa,CAACC,cAAc,CAAC,YAAA;AAC3B,QAAA,IAAIC,iBAAiB,CAAC,IAAuB,EAAEP,UAAU,EAAGQ,KAAK,IAC9D,IAAkB,CAACH,aAAa,CAACI,IAAI,CAAC,CAACD,KAAK,CAAC,CAC/C;AACH,MAAA,CAAC,CAAC;AACJ,IAAA,CAAC,MAAM;AACL;AACCJ,MAAAA,aAAa,CAACM,WAAsC,CAACJ,cAAc,CAAEK,OAAwB,IAAU;AACtG,QAAA,IAAIJ,iBAAiB,CAACI,OAAO,EAAEX,UAAU,EAAGQ,KAAK,IAAMG,OAAqB,CAACN,aAAa,CAAC,CAACG,KAAK,CAAC,CAAC;AACrG,MAAA,CAAC,CAAC;AACJ,IAAA;EACF,CAAC;AACH;;;;"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { __spreadArray } from 'tslib';
|
|
2
1
|
import { OnEventController } from './on-event-controller.js';
|
|
3
2
|
|
|
4
3
|
/**
|
|
@@ -31,10 +30,11 @@ import { OnEventController } from './on-event-controller.js';
|
|
|
31
30
|
* }
|
|
32
31
|
* ```
|
|
33
32
|
*/
|
|
34
|
-
function useOnEvents(host,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
function useOnEvents(host, {
|
|
34
|
+
types,
|
|
35
|
+
handler
|
|
36
|
+
}) {
|
|
37
|
+
const normalized = types ? Array.isArray(types) ? [...types] : [types] : null;
|
|
38
38
|
return new OnEventController(host, normalized, handler);
|
|
39
39
|
}
|
|
40
40
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-on-events.js","sources":["../../../../../../../../src/wirestate-lit/events/use-on-events.ts"],"sourcesContent":[null],"names":["useOnEvents","host","
|
|
1
|
+
{"version":3,"file":"use-on-events.js","sources":["../../../../../../../../src/wirestate-lit/events/use-on-events.ts"],"sourcesContent":[null],"names":["useOnEvents","host","types","handler","normalized","Array","isArray","OnEventController"],"mappings":";;AAuBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BG;AACG,SAAUA,WAAWA,CACzBC,IAAqB,EACrB;EAAEC,KAAK;AAAEC,EAAAA;AAAO,CAAsB,EAAA;EAEtC,MAAMC,UAAU,GAAuCF,KAAK,GACxDG,KAAK,CAACC,OAAO,CAACJ,KAAK,CAAC,GAClB,CAAC,GAAIA,KAAkC,CAAC,GACxC,CAACA,KAAkB,CAAC,GACtB,IAAI;EAER,OAAO,IAAIK,iBAAiB,CAAIN,IAAI,EAAEG,UAAU,EAAED,OAAO,CAAC;AAC5D;;;;"}
|
|
@@ -41,22 +41,22 @@ import { ContainerProvider } from './container-provider.js';
|
|
|
41
41
|
* ```
|
|
42
42
|
*/
|
|
43
43
|
function containerProvide(options) {
|
|
44
|
-
return
|
|
44
|
+
return (protoOrTarget, nameOrContext) => {
|
|
45
45
|
if (typeof nameOrContext === "object") {
|
|
46
46
|
// Standard decorators:
|
|
47
47
|
nameOrContext.addInitializer(function () {
|
|
48
48
|
protoOrTarget.set.call(this, new ContainerProvider(this, options));
|
|
49
49
|
});
|
|
50
50
|
} else {
|
|
51
|
-
|
|
52
|
-
protoOrTarget.constructor.addInitializer(
|
|
53
|
-
|
|
51
|
+
let controller;
|
|
52
|
+
protoOrTarget.constructor.addInitializer(element => {
|
|
53
|
+
controller = new ContainerProvider(element, options);
|
|
54
54
|
});
|
|
55
55
|
return {
|
|
56
|
-
get
|
|
57
|
-
return
|
|
56
|
+
get() {
|
|
57
|
+
return controller;
|
|
58
58
|
},
|
|
59
|
-
set
|
|
59
|
+
set() {},
|
|
60
60
|
configurable: true,
|
|
61
61
|
enumerable: true
|
|
62
62
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container-provide.js","sources":["../../../../../../../../src/wirestate-lit/provision/container-provide.ts"],"sourcesContent":[null],"names":["containerProvide","options","protoOrTarget","nameOrContext","addInitializer","set","call","ContainerProvider","
|
|
1
|
+
{"version":3,"file":"container-provide.js","sources":["../../../../../../../../src/wirestate-lit/provision/container-provide.ts"],"sourcesContent":[null],"names":["containerProvide","options","protoOrTarget","nameOrContext","addInitializer","set","call","ContainerProvider","controller","constructor","element","get","configurable","enumerable"],"mappings":";;AA2BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCG;AACG,SAAUA,gBAAgBA,CAC9BC,OAAiC,EAAA;AAEjC,EAAA,OAAQ,CACNC,aAAkF,EAClFC,aAAiG,KAC/F;AACF,IAAA,IAAI,OAAOA,aAAa,KAAK,QAAQ,EAAE;AACrC;MACAA,aAAa,CAACC,cAAc,CAAC,YAAA;AAC3BF,QAAAA,aAAa,CAACG,GAAG,CAACC,IAAI,CAAC,IAAI,EAAE,IAAIC,iBAAiB,CAAC,IAAoB,EAAEN,OAAO,CAAC,CAAC;AACpF,MAAA,CAAC,CAAC;AACJ,IAAA,CAAC,MAAM;AACL,MAAA,IAAIO,UAAuC;AAE1CN,MAAAA,aAAa,CAACO,WAAsC,CAACL,cAAc,CAAEM,OAAwB,IAAU;AACtGF,QAAAA,UAAU,GAAG,IAAID,iBAAiB,CAACG,OAAY,EAAET,OAAO,CAAC;AAC3D,MAAA,CAAC,CAAC;MAEF,OAAO;AACLU,QAAAA,GAAGA,GAAA;AACD,UAAA,OAAOH,UAAkC;QAC3C,CAAC;QACDH,GAAGA,IAAU,CAAC;AACdO,QAAAA,YAAY,EAAE,IAAI;AAClBC,QAAAA,UAAU,EAAE;OACb;AACH,IAAA;EACF,CAAC;AACH;;;;"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { __extends, __assign } from 'tslib';
|
|
2
1
|
import { ContextProvider } from '@lit/context';
|
|
3
2
|
import { WirestateError, createContainer } from '@wirestate/core';
|
|
4
3
|
import { ContainerContext } from '../context/container-context.js';
|
|
@@ -19,56 +18,51 @@ import { ERROR_CODE_INVALID_ARGUMENTS } from '../error/error-code.js';
|
|
|
19
18
|
*
|
|
20
19
|
* @group Provision
|
|
21
20
|
*/
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
class ContainerProvider extends ContextProvider {
|
|
22
|
+
destroyed = false;
|
|
24
23
|
/**
|
|
25
24
|
* @param host - The host element.
|
|
26
25
|
* @param options - Provisioning options.
|
|
27
26
|
* @param options.container - External container instance to provide.
|
|
28
27
|
* @param options.options - Managed container creation options.
|
|
29
28
|
*/
|
|
30
|
-
|
|
31
|
-
var _this = this;
|
|
29
|
+
constructor(host, options) {
|
|
32
30
|
if (!options.container && !options.options) {
|
|
33
31
|
throw new WirestateError(ERROR_CODE_INVALID_ARGUMENTS, "ContainerProvider requires a valid container instance or creation options.");
|
|
34
32
|
} else if (options.container && options.options) {
|
|
35
33
|
throw new WirestateError(ERROR_CODE_INVALID_ARGUMENTS, "ContainerProvider requires only container or valid options object to be provided.");
|
|
36
34
|
}
|
|
37
|
-
|
|
35
|
+
super(host, {
|
|
38
36
|
context: ContainerContext,
|
|
39
|
-
initialValue: options.container ? options.container : createContainer(
|
|
37
|
+
initialValue: options.container ? options.container : createContainer({
|
|
38
|
+
...options.options,
|
|
40
39
|
activate: []
|
|
41
|
-
})
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
_this.options = options.options;
|
|
45
|
-
return _this;
|
|
40
|
+
})
|
|
41
|
+
});
|
|
42
|
+
this.options = options.options;
|
|
46
43
|
}
|
|
47
|
-
|
|
48
|
-
var _a;
|
|
44
|
+
hostConnected() {
|
|
49
45
|
if (this.options) {
|
|
50
46
|
if (this.destroyed) {
|
|
51
47
|
this.value = createContainer(this.options);
|
|
52
48
|
this.destroyed = false;
|
|
53
49
|
} else {
|
|
54
|
-
if (
|
|
55
|
-
for (
|
|
56
|
-
var entry = _b[_i];
|
|
50
|
+
if (this.options?.activate) {
|
|
51
|
+
for (const entry of this.options.activate) {
|
|
57
52
|
this.value.get(entry);
|
|
58
53
|
}
|
|
59
54
|
}
|
|
60
55
|
}
|
|
61
56
|
}
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
|
|
57
|
+
super.hostConnected();
|
|
58
|
+
}
|
|
59
|
+
hostDisconnected() {
|
|
65
60
|
if (this.options) {
|
|
66
61
|
this.value.unbindAll();
|
|
67
62
|
this.destroyed = true;
|
|
68
63
|
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
}(ContextProvider);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
72
66
|
|
|
73
67
|
export { ContainerProvider };
|
|
74
68
|
//# sourceMappingURL=container-provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container-provider.js","sources":["../../../../../../../../src/wirestate-lit/provision/container-provider.ts"],"sourcesContent":[null],"names":["ContainerProvider","
|
|
1
|
+
{"version":3,"file":"container-provider.js","sources":["../../../../../../../../src/wirestate-lit/provision/container-provider.ts"],"sourcesContent":[null],"names":["ContainerProvider","ContextProvider","destroyed","constructor","host","options","container","WirestateError","ERROR_CODE_INVALID_ARGUMENTS","context","ContainerContext","initialValue","createContainer","activate","hostConnected","value","entry","get","hostDisconnected","unbindAll"],"mappings":";;;;;AAyCA;;;;;;;;;;;;;;AAcG;AACG,MAAOA,iBACX,SAAQC,eAA2C,CAAA;AAKzCC,EAAAA,SAAS,GAAY,KAAK;AAEpC;;;;;AAKG;AACHC,EAAAA,WAAAA,CAAmBC,IAAO,EAAEC,OAAiC,EAAA;IAC3D,IAAI,CAACA,OAAO,CAACC,SAAS,IAAI,CAACD,OAAO,CAACA,OAAO,EAAE;AAC1C,MAAA,MAAM,IAAIE,cAAc,CACtBC,4BAA4B,EAC5B,4EAA4E,CAC7E;IACH,CAAC,MAAM,IAAIH,OAAO,CAACC,SAAS,IAAID,OAAO,CAACA,OAAO,EAAE;AAC/C,MAAA,MAAM,IAAIE,cAAc,CACtBC,4BAA4B,EAC5B,mFAAmF,CACpF;AACH,IAAA;IAEA,KAAK,CAACJ,IAAI,EAAE;AACVK,MAAAA,OAAO,EAAEC,gBAAgB;MACzBC,YAAY,EAAEN,OAAO,CAACC,SAAS,GAAGD,OAAO,CAACC,SAAS,GAAGM,eAAe,CAAC;QAAE,GAAGP,OAAO,CAACA,OAAO;AAAEQ,QAAAA,QAAQ,EAAE;OAAI;AAC3G,KAAA,CAAC;AAEF,IAAA,IAAI,CAACR,OAAO,GAAGA,OAAO,CAACA,OAAO;AAQhC,EAAA;AAEOS,EAAAA,aAAaA,GAAA;IAClB,IAAI,IAAI,CAACT,OAAO,EAAE;MAChB,IAAI,IAAI,CAACH,SAAS,EAAE;QAKlB,IAAI,CAACa,KAAK,GAAGH,eAAe,CAAC,IAAI,CAACP,OAAO,CAAC;QAC1C,IAAI,CAACH,SAAS,GAAG,KAAK;AACxB,MAAA,CAAC,MAAM;AACL,QAAA,IAAI,IAAI,CAACG,OAAO,EAAEQ,QAAQ,EAAE;UAK1B,KAAK,MAAMG,KAAK,IAAI,IAAI,CAACX,OAAO,CAACQ,QAAQ,EAAE;AACzC,YAAA,IAAI,CAACE,KAAK,CAACE,GAAG,CAACD,KAAK,CAAC;AACvB,UAAA;AACF,QAAA;AACF,MAAA;AACF,IAAA;IAEA,KAAK,CAACF,aAAa,EAAE;AACvB,EAAA;AAEOI,EAAAA,gBAAgBA,GAAA;IACrB,IAAI,IAAI,CAACb,OAAO,EAAE;AAKhB,MAAA,IAAI,CAACU,KAAK,CAACI,SAAS,EAAE;MACtB,IAAI,CAACjB,SAAS,GAAG,IAAI;AACvB,IAAA;AACF,EAAA;AACD;;;;"}
|
|
@@ -29,22 +29,22 @@ import { SubContainerProvider } from './sub-container-provider.js';
|
|
|
29
29
|
* ```
|
|
30
30
|
*/
|
|
31
31
|
function subContainerProvide(options) {
|
|
32
|
-
return
|
|
32
|
+
return (protoOrTarget, nameOrContext) => {
|
|
33
33
|
if (typeof nameOrContext === "object") {
|
|
34
34
|
// Standard decorators:
|
|
35
35
|
nameOrContext.addInitializer(function () {
|
|
36
36
|
protoOrTarget.set.call(this, new SubContainerProvider(this, options));
|
|
37
37
|
});
|
|
38
38
|
} else {
|
|
39
|
-
|
|
40
|
-
protoOrTarget.constructor.addInitializer(
|
|
41
|
-
|
|
39
|
+
let provider;
|
|
40
|
+
protoOrTarget.constructor.addInitializer(element => {
|
|
41
|
+
provider = new SubContainerProvider(element, options);
|
|
42
42
|
});
|
|
43
43
|
return {
|
|
44
|
-
get
|
|
45
|
-
return
|
|
44
|
+
get() {
|
|
45
|
+
return provider;
|
|
46
46
|
},
|
|
47
|
-
set
|
|
47
|
+
set() {},
|
|
48
48
|
configurable: true,
|
|
49
49
|
enumerable: true
|
|
50
50
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sub-container-provide.js","sources":["../../../../../../../../src/wirestate-lit/provision/sub-container-provide.ts"],"sourcesContent":[null],"names":["subContainerProvide","options","protoOrTarget","nameOrContext","addInitializer","set","call","SubContainerProvider","
|
|
1
|
+
{"version":3,"file":"sub-container-provide.js","sources":["../../../../../../../../src/wirestate-lit/provision/sub-container-provide.ts"],"sourcesContent":[null],"names":["subContainerProvide","options","protoOrTarget","nameOrContext","addInitializer","set","call","SubContainerProvider","provider","constructor","element","get","configurable","enumerable"],"mappings":";;AA2BA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BG;AACG,SAAUA,mBAAmBA,CACjCC,OAAoC,EAAA;AAEpC,EAAA,OAAQ,CACNC,aAAmG,EACnGC,aAAkH,KAChH;AACF,IAAA,IAAI,OAAOA,aAAa,KAAK,QAAQ,EAAE;AACrC;MACAA,aAAa,CAACC,cAAc,CAAC,YAAA;AAC3BF,QAAAA,aAAa,CAACG,GAAG,CAACC,IAAI,CAAC,IAAI,EAAE,IAAIC,oBAAoB,CAAC,IAAuB,EAAEN,OAAO,CAAC,CAAC;AAC1F,MAAA,CAAC,CAAC;AACJ,IAAA,CAAC,MAAM;AACL,MAAA,IAAIO,QAAwC;AAE3CN,MAAAA,aAAa,CAACO,WAAsC,CAACL,cAAc,CAAEM,OAAwB,IAAU;AACtGF,QAAAA,QAAQ,GAAG,IAAID,oBAAoB,CAACG,OAAY,EAAET,OAAO,CAAC;AAC5D,MAAA,CAAC,CAAC;MAEF,OAAO;AACLU,QAAAA,GAAGA,GAAA;AACD,UAAA,OAAOH,QAAmC;QAC5C,CAAC;QACDH,GAAGA,IAAU,CAAC;AACdO,QAAAA,YAAY,EAAE,IAAI;AAClBC,QAAAA,UAAU,EAAE;OACb;AACH,IAAA;EACF,CAAC;AACH;;;;"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ContextConsumer, ContextProvider } from '@lit/context';
|
|
1
|
+
import { ContextProvider, ContextConsumer } from '@lit/context';
|
|
3
2
|
import { createContainer } from '@wirestate/core';
|
|
4
3
|
import { ContainerContext } from '../context/container-context.js';
|
|
5
4
|
|
|
@@ -27,67 +26,65 @@ import { ContainerContext } from '../context/container-context.js';
|
|
|
27
26
|
* }
|
|
28
27
|
* ```
|
|
29
28
|
*/
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
class SubContainerProvider extends ContextProvider {
|
|
30
|
+
parent = null;
|
|
31
|
+
destroyed = true;
|
|
32
32
|
/**
|
|
33
33
|
* @param host - The host element.
|
|
34
34
|
* @param options - Provisioning options, including child entries, eager activations, and seeds.
|
|
35
35
|
*/
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
constructor(host, options) {
|
|
37
|
+
super(host, {
|
|
38
38
|
context: ContainerContext
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
_this.options = options.options;
|
|
43
|
-
_this.consumer = new ContextConsumer(host, {
|
|
39
|
+
});
|
|
40
|
+
this.options = options.options;
|
|
41
|
+
this.consumer = new ContextConsumer(host, {
|
|
44
42
|
context: ContainerContext,
|
|
45
43
|
subscribe: true,
|
|
46
|
-
callback:
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
callback: context => {
|
|
45
|
+
const previousParent = this.parent;
|
|
46
|
+
this.parent = context;
|
|
49
47
|
if (host.isConnected) {
|
|
50
|
-
if (
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
if (this.destroyed || !this.value || previousParent !== context) {
|
|
49
|
+
this.destroyContainer();
|
|
50
|
+
this.createContainer();
|
|
53
51
|
}
|
|
54
52
|
}
|
|
55
53
|
}
|
|
56
54
|
});
|
|
57
|
-
return _this;
|
|
58
55
|
}
|
|
59
|
-
|
|
56
|
+
hostConnected() {
|
|
60
57
|
if (this.parent && (this.destroyed || !this.value)) {
|
|
61
58
|
this.destroyContainer();
|
|
62
59
|
this.createContainer();
|
|
63
60
|
}
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
61
|
+
super.hostConnected();
|
|
62
|
+
}
|
|
63
|
+
hostDisconnected() {
|
|
67
64
|
this.destroyContainer();
|
|
68
|
-
}
|
|
65
|
+
}
|
|
69
66
|
/**
|
|
70
67
|
* Replaces the currently provided child container with a new one derived
|
|
71
68
|
* from the latest parent context.
|
|
72
69
|
*/
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
createContainer() {
|
|
71
|
+
const container = createContainer({
|
|
72
|
+
...this.options,
|
|
75
73
|
parent: this.parent
|
|
76
|
-
})
|
|
74
|
+
});
|
|
77
75
|
this.destroyed = false;
|
|
78
76
|
this.value = container;
|
|
79
|
-
}
|
|
77
|
+
}
|
|
80
78
|
/**
|
|
81
79
|
* Destroys the currently provided child container.
|
|
82
80
|
*/
|
|
83
|
-
|
|
81
|
+
destroyContainer() {
|
|
84
82
|
if (this.value && !this.destroyed) {
|
|
85
83
|
this.value.unbindAll();
|
|
86
84
|
this.destroyed = true;
|
|
87
85
|
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
}(ContextProvider);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
91
88
|
|
|
92
89
|
export { SubContainerProvider };
|
|
93
90
|
//# sourceMappingURL=sub-container-provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sub-container-provider.js","sources":["../../../../../../../../src/wirestate-lit/provision/sub-container-provider.ts"],"sourcesContent":[null],"names":["SubContainerProvider","
|
|
1
|
+
{"version":3,"file":"sub-container-provider.js","sources":["../../../../../../../../src/wirestate-lit/provision/sub-container-provider.ts"],"sourcesContent":[null],"names":["SubContainerProvider","ContextProvider","parent","destroyed","constructor","host","options","context","ContainerContext","consumer","ContextConsumer","subscribe","callback","previousParent","isConnected","value","destroyContainer","createContainer","hostConnected","hostDisconnected","container","unbindAll"],"mappings":";;;;AAkDA;;;;;;;;;;;;;;;;;;;;;;;AAuBG;AACG,MAAOA,oBACX,SAAQC,eAA2C,CAAA;AAMzCC,EAAAA,MAAM,GAAqB,IAAI;AAC/BC,EAAAA,SAAS,GAAY,IAAI;AAEnC;;;AAGG;AACHC,EAAAA,WAAAA,CAAmBC,IAAO,EAAEC,OAAoC,EAAA;IAC9D,KAAK,CAACD,IAAI,EAAE;AACVE,MAAAA,OAAO,EAAEC;AACV,KAAA,CAAC;AAIF,IAAA,IAAI,CAACF,OAAO,GAAGA,OAAO,CAACA,OAAO;AAE9B,IAAA,IAAI,CAACG,QAAQ,GAAG,IAAIC,eAAe,CAACL,IAAI,EAAE;AACxCE,MAAAA,OAAO,EAAEC,gBAAgB;AACzBG,MAAAA,SAAS,EAAE,IAAI;MACfC,QAAQ,EAAGL,OAAkB,IAAI;AAC/B,QAAA,MAAMM,cAAc,GAAqB,IAAI,CAACX,MAAM;QAEpD,IAAI,CAACA,MAAM,GAAGK,OAAO;QAErB,IAAIF,IAAI,CAACS,WAAW,EAAE;AAMpB,UAAA,IAAI,IAAI,CAACX,SAAS,IAAI,CAAC,IAAI,CAACY,KAAK,IAAIF,cAAc,KAAKN,OAAO,EAAE;YAC/D,IAAI,CAACS,gBAAgB,EAAE;YACvB,IAAI,CAACC,eAAe,EAAE;AACxB,UAAA;AACF,QAAA;AAMF,MAAA;AACD,KAAA,CAAC;AACJ,EAAA;AAEOC,EAAAA,aAAaA,GAAA;AAOlB,IAAA,IAAI,IAAI,CAAChB,MAAM,KAAK,IAAI,CAACC,SAAS,IAAI,CAAC,IAAI,CAACY,KAAK,CAAC,EAAE;MAClD,IAAI,CAACC,gBAAgB,EAAE;MACvB,IAAI,CAACC,eAAe,EAAE;AACxB,IAAA;IAEA,KAAK,CAACC,aAAa,EAAE;AACvB,EAAA;AAEOC,EAAAA,gBAAgBA,GAAA;IAOrB,IAAI,CAACH,gBAAgB,EAAE;AACzB,EAAA;AAEA;;;AAGG;AACOC,EAAAA,eAAeA,GAAA;IACvB,MAAMG,SAAS,GAAcH,eAAe,CAAC;MAC3C,GAAG,IAAI,CAACX,OAAO;MACfJ,MAAM,EAAE,IAAI,CAACA;AACd,KAAA,CAAC;IAQF,IAAI,CAACC,SAAS,GAAG,KAAK;IACtB,IAAI,CAACY,KAAK,GAAGK,SAAS;AACxB,EAAA;AAEA;;AAEG;AACOJ,EAAAA,gBAAgBA,GAAA;IACxB,IAAI,IAAI,CAACD,KAAK,IAAI,CAAC,IAAI,CAACZ,SAAS,EAAE;AAMjC,MAAA,IAAI,CAACY,KAAK,CAACM,SAAS,EAAE;MACtB,IAAI,CAAClB,SAAS,GAAG,IAAI;AACvB,IAAA;AACF,EAAA;AACD;;;;"}
|
|
@@ -11,49 +11,46 @@ import { ContainerContext } from '../context/container-context.js';
|
|
|
11
11
|
*
|
|
12
12
|
* @group Queries
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
class OnQueryController {
|
|
15
|
+
bus = null;
|
|
16
|
+
unregister = null;
|
|
15
17
|
/**
|
|
16
18
|
* @param host - The host element.
|
|
17
19
|
* @param type - Unique identifier of the query to handle.
|
|
18
20
|
* @param handler - The query handler function.
|
|
19
21
|
*/
|
|
20
|
-
|
|
21
|
-
var _this = this;
|
|
22
|
-
this.bus = null;
|
|
23
|
-
this.unregister = null;
|
|
22
|
+
constructor(host, type, handler) {
|
|
24
23
|
host.addController(this);
|
|
25
24
|
this.type = type;
|
|
26
25
|
this.handler = handler;
|
|
27
26
|
new ContextConsumer(host, {
|
|
28
27
|
context: ContainerContext,
|
|
29
28
|
subscribe: true,
|
|
30
|
-
callback:
|
|
31
|
-
|
|
29
|
+
callback: container => {
|
|
30
|
+
this.bus = container.get(QueryBus);
|
|
32
31
|
if (host.isConnected) {
|
|
33
|
-
|
|
32
|
+
this.reregister();
|
|
34
33
|
}
|
|
35
34
|
}
|
|
36
35
|
});
|
|
37
36
|
}
|
|
38
|
-
|
|
37
|
+
hostConnected() {
|
|
39
38
|
this.reregister();
|
|
40
|
-
}
|
|
41
|
-
|
|
39
|
+
}
|
|
40
|
+
hostDisconnected() {
|
|
42
41
|
this.cleanup();
|
|
43
|
-
}
|
|
44
|
-
|
|
42
|
+
}
|
|
43
|
+
reregister() {
|
|
45
44
|
this.cleanup();
|
|
46
45
|
if (this.bus) {
|
|
47
46
|
this.unregister = this.bus.register(this.type, this.handler);
|
|
48
47
|
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
(_a = this.unregister) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
48
|
+
}
|
|
49
|
+
cleanup() {
|
|
50
|
+
this.unregister?.();
|
|
53
51
|
this.unregister = null;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
}();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
57
54
|
|
|
58
55
|
export { OnQueryController };
|
|
59
56
|
//# sourceMappingURL=on-query-controller.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"on-query-controller.js","sources":["../../../../../../../../src/wirestate-lit/queries/on-query-controller.ts"],"sourcesContent":[null],"names":["OnQueryController","
|
|
1
|
+
{"version":3,"file":"on-query-controller.js","sources":["../../../../../../../../src/wirestate-lit/queries/on-query-controller.ts"],"sourcesContent":[null],"names":["OnQueryController","bus","unregister","constructor","host","type","handler","addController","ContextConsumer","context","ContainerContext","subscribe","callback","container","get","QueryBus","isConnected","reregister","hostConnected","hostDisconnected","cleanup","register"],"mappings":";;;;AAUA;;;;;;;;AAQG;MACUA,iBAAiB,CAAA;AACpBC,EAAAA,GAAG,GAAuB,IAAI;AAC9BC,EAAAA,UAAU,GAA8B,IAAI;AAKpD;;;;AAIG;AACHC,EAAAA,WAAAA,CAAmBC,IAAqB,EAAEC,IAAe,EAAEC,OAA2B,EAAA;AACpFF,IAAAA,IAAI,CAACG,aAAa,CAAC,IAAI,CAAC;IAExB,IAAI,CAACF,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACC,OAAO,GAAGA,OAAO;IAItB,IAAIE,eAAe,CAACJ,IAAI,EAAE;AACxBK,MAAAA,OAAO,EAAEC,gBAAgB;AACzBC,MAAAA,SAAS,EAAE,IAAI;MACfC,QAAQ,EAAGC,SAAS,IAAI;QACtB,IAAI,CAACZ,GAAG,GAAGY,SAAS,CAACC,GAAG,CAACC,QAAQ,CAAC;QAElC,IAAIX,IAAI,CAACY,WAAW,EAAE;UACpB,IAAI,CAACC,UAAU,EAAE;AACnB,QAAA;AACF,MAAA;AACD,KAAA,CAAC;AACJ,EAAA;AAEOC,EAAAA,aAAaA,GAAA;IAElB,IAAI,CAACD,UAAU,EAAE;AACnB,EAAA;AAEOE,EAAAA,gBAAgBA,GAAA;IAErB,IAAI,CAACC,OAAO,EAAE;AAChB,EAAA;AAEQH,EAAAA,UAAUA,GAAA;IAChB,IAAI,CAACG,OAAO,EAAE;IAEd,IAAI,IAAI,CAACnB,GAAG,EAAE;AAEZ,MAAA,IAAI,CAACC,UAAU,GAAG,IAAI,CAACD,GAAG,CAACoB,QAAQ,CAAC,IAAI,CAAChB,IAAI,EAAE,IAAI,CAACC,OAAO,CAAC;AAC9D,IAAA;AACF,EAAA;AAEQc,EAAAA,OAAOA,GAAA;IACb,IAAI,CAAClB,UAAU,IAAI;IACnB,IAAI,CAACA,UAAU,GAAG,IAAI;AACxB,EAAA;AACD;;;;"}
|
|
@@ -22,21 +22,16 @@ import { OnQueryController } from './on-query-controller.js';
|
|
|
22
22
|
* ```
|
|
23
23
|
*/
|
|
24
24
|
function onQuery(type) {
|
|
25
|
-
return
|
|
25
|
+
return (protoOrTarget, nameOrContext) => {
|
|
26
26
|
if (typeof nameOrContext === "object") {
|
|
27
27
|
// Standard decorators:
|
|
28
28
|
nameOrContext.addInitializer(function () {
|
|
29
|
-
|
|
30
|
-
new OnQueryController(this, type, function (data) {
|
|
31
|
-
return _this[nameOrContext.name](data);
|
|
32
|
-
});
|
|
29
|
+
new OnQueryController(this, type, data => this[nameOrContext.name](data));
|
|
33
30
|
});
|
|
34
31
|
} else {
|
|
35
32
|
// Experimental legacy decorators:
|
|
36
|
-
protoOrTarget.constructor.addInitializer(
|
|
37
|
-
new OnQueryController(element, type,
|
|
38
|
-
return element[nameOrContext](data);
|
|
39
|
-
});
|
|
33
|
+
protoOrTarget.constructor.addInitializer(element => {
|
|
34
|
+
new OnQueryController(element, type, data => element[nameOrContext](data));
|
|
40
35
|
});
|
|
41
36
|
}
|
|
42
37
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"on-query.js","sources":["../../../../../../../../src/wirestate-lit/queries/on-query.ts"],"sourcesContent":[null],"names":["onQuery","type","protoOrTarget","nameOrContext","addInitializer","
|
|
1
|
+
{"version":3,"file":"on-query.js","sources":["../../../../../../../../src/wirestate-lit/queries/on-query.ts"],"sourcesContent":[null],"names":["onQuery","type","protoOrTarget","nameOrContext","addInitializer","OnQueryController","data","name","constructor","element"],"mappings":";;AAyBA;;;;;;;;;;;;;;;;;;;;AAoBG;AACG,SAAUA,OAAOA,CAA2BC,IAAe,EAAA;AAC/D,EAAA,OAAQ,CAACC,aAAqB,EAAEC,aAAwD,KAAI;AAC1F,IAAA,IAAI,OAAOA,aAAa,KAAK,QAAQ,EAAE;AACrC;MACAA,aAAa,CAACC,cAAc,CAAC,YAAA;AAC3B,QAAA,IAAIC,iBAAiB,CACnB,IAAuB,EACvBJ,IAAI,EACHK,IAAO,IAAM,IAAkB,CAACH,aAAa,CAACI,IAAI,CAAC,CAACD,IAAI,CAAoB,CAC9E;AACH,MAAA,CAAC,CAAC;AACJ,IAAA,CAAC,MAAM;AACL;AACCJ,MAAAA,aAAa,CAACM,WAAsC,CAACJ,cAAc,CAAEK,OAAwB,IAAI;AAChG,QAAA,IAAIJ,iBAAiB,CACnBI,OAAO,EACPR,IAAI,EACHK,IAAO,IAAMG,OAAqB,CAACN,aAAa,CAAC,CAACG,IAAI,CAAoB,CAC5E;AACH,MAAA,CAAC,CAAC;AACJ,IAAA;EACF,CAAC;AACH;;;;"}
|
|
@@ -21,9 +21,10 @@ import { OnQueryController } from './on-query-controller.js';
|
|
|
21
21
|
* }
|
|
22
22
|
* ```
|
|
23
23
|
*/
|
|
24
|
-
function useOnQuery(host,
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
function useOnQuery(host, {
|
|
25
|
+
type,
|
|
26
|
+
handler
|
|
27
|
+
}) {
|
|
27
28
|
return new OnQueryController(host, type, handler);
|
|
28
29
|
}
|
|
29
30
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-on-query.js","sources":["../../../../../../../../src/wirestate-lit/queries/use-on-query.ts"],"sourcesContent":[null],"names":["useOnQuery","host","
|
|
1
|
+
{"version":3,"file":"use-on-query.js","sources":["../../../../../../../../src/wirestate-lit/queries/use-on-query.ts"],"sourcesContent":[null],"names":["useOnQuery","host","type","handler","OnQueryController"],"mappings":";;AAqBA;;;;;;;;;;;;;;;;;;;;AAoBG;AACG,SAAUA,UAAUA,CACxBC,IAAqB,EACrB;EAAEC,IAAI;AAAEC,EAAAA;AAAO,CAA2B,EAAA;EAE1C,OAAO,IAAIC,iBAAiB,CAAOH,IAAI,EAAEC,IAAI,EAAEC,OAAO,CAAC;AACzD;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ContextConsumer as t}from"@lit/context";import{CommandBus as e}from"@wirestate/core";import{ContainerContext as
|
|
1
|
+
import{ContextConsumer as t}from"@lit/context";import{CommandBus as e}from"@wirestate/core";import{ContainerContext as s}from"../context/container-context.js";class r{bus=null;unregister=null;constructor(r,i,n){r.addController(this),this.type=i,this.handler=n,new t(r,{context:s,subscribe:!0,callback:t=>{this.bus=t.get(e),r.isConnected&&this.reregister()}})}hostConnected(){this.reregister()}hostDisconnected(){this.cleanup()}reregister(){this.cleanup(),this.bus&&(this.unregister=this.bus.register(this.type,this.handler))}cleanup(){this.unregister?.(),this.unregister=null}}export{r as OnCommandController};//# sourceMappingURL=on-command-controller.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"on-command-controller.js","sources":["../../../../../../../../src/wirestate-lit/commands/on-command-controller.ts"],"sourcesContent":[null],"names":["ContextConsumer","CommandBus","ContainerContext","OnCommandController","
|
|
1
|
+
{"version":3,"file":"on-command-controller.js","sources":["../../../../../../../../src/wirestate-lit/commands/on-command-controller.ts"],"sourcesContent":[null],"names":["ContextConsumer","CommandBus","ContainerContext","OnCommandController","bus","unregister","constructor","host","type","handler","addController","this","context","subscribe","callback","container","get","isConnected","reregister","hostConnected","hostDisconnected","cleanup","register"],"mappings":"0BAUAA,MAAA,oCAAAC,MAAA,6CAAAC,MAAA,wCASaC,EACHC,IAA4B,KAC5BC,WAA0C,KAUlDC,YAAmBC,EAAuBC,EAAmBC,GAG3DF,EAAKG,cAAcC,MAEnBA,KAAKH,KAAOA,EACZG,KAAKF,QAAUA,EAEf,IAAIT,EAAgBO,EAAM,CACxBK,QAASV,EACTW,WAAW,EACXC,SAAWC,IACTJ,KAAKP,IAAMW,EAAUC,IAAIf,GAErBM,EAAKU,aACPN,KAAKO,YACP,GAGN,CAEOC,gBAELR,KAAKO,YACP,CAEOE,mBAELT,KAAKU,SACP,CAEQH,aACNP,KAAKU,UAEDV,KAAKP,MAEPO,KAAKN,WAAaM,KAAKP,IAAIkB,SAASX,KAAKH,KAAMG,KAAKF,SAExD,CAEQY,UAGNV,KAAKN,eACLM,KAAKN,WAAa,IACpB,SACDF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{OnCommandController as n}from"./on-command-controller.js";function t(t){return
|
|
1
|
+
import{OnCommandController as n}from"./on-command-controller.js";function t(t){return(o,i)=>{"object"==typeof i?i.addInitializer((function(){new n(this,t,(n=>this[i.name](n)))})):o.constructor.addInitializer((o=>{new n(o,t,(n=>o[i](n)))}))}}export{t as onCommand};//# sourceMappingURL=on-command.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"on-command.js","sources":["../../../../../../../../src/wirestate-lit/commands/on-command.ts"],"sourcesContent":[null],"names":["OnCommandController","onCommand","type","protoOrTarget","nameOrContext","addInitializer","
|
|
1
|
+
{"version":3,"file":"on-command.js","sources":["../../../../../../../../src/wirestate-lit/commands/on-command.ts"],"sourcesContent":[null],"names":["OnCommandController","onCommand","type","protoOrTarget","nameOrContext","addInitializer","this","data","name","constructor","element"],"mappings":"8BAyBAA,MAAA,6BAqBM,SAAUC,EAAoCC,GAClD,MAAQ,CAACC,EAAuBC,KACD,iBAAlBA,EAETA,EAAcC,gBAAe,WAC3B,IAAIL,EACFM,KACAJ,GACCK,GAAaD,KAAmBF,EAAcI,MAAMD,IAEzD,IAGCJ,EAAcM,YAAuCJ,gBAAgBK,IACpE,IAAIV,EACFU,EACAR,GACCK,GAAaG,EAAsBN,GAAeG,IACpD,GAEL,CAEJ,QAAAN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{OnCommandController as
|
|
1
|
+
import{OnCommandController as n}from"./on-command-controller.js";function o(o,{type:r,handler:e}){return new n(o,r,e)}export{o as useOnCommand};//# sourceMappingURL=use-on-command.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-on-command.js","sources":["../../../../../../../../src/wirestate-lit/commands/use-on-command.ts"],"sourcesContent":[null],"names":["OnCommandController","useOnCommand","host","
|
|
1
|
+
{"version":3,"file":"use-on-command.js","sources":["../../../../../../../../src/wirestate-lit/commands/use-on-command.ts"],"sourcesContent":[null],"names":["OnCommandController","useOnCommand","host","type","handler"],"mappings":"8BAqBAA,MAAA,6BAqBM,SAAUC,EACdC,GACAC,KAAEA,EAAIC,QAAEA,IAER,OAAO,IAAIJ,EAA0BE,EAAMC,EAAMC,EACnD,QAAAH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ContextConsumer as t}from"@lit/context";import{ContainerContext as n}from"../context/container-context.js";function c(c){
|
|
1
|
+
import{ContextConsumer as t}from"@lit/context";import{ContainerContext as n}from"../context/container-context.js";function c(c){const e="object"==typeof c&&null!==c&&"injectionId"in c?c:{injectionId:c};return(c,o)=>{const{injectionId:i,once:r}=e;"object"==typeof o?o.addInitializer((function(){new t(this,{context:n,callback:t=>{c.set.call(this,t.get(i))},subscribe:!r})})):c.constructor.addInitializer((c=>{new t(c,{context:n,callback:t=>{c[o]=t.get(i)},subscribe:!r})}))}}export{c as injection};//# sourceMappingURL=injection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"injection.js","sources":["../../../../../../../../src/wirestate-lit/consumption/injection.ts"],"sourcesContent":[null],"names":["ContextConsumer","ContainerContext","injection","optionsOrInjectionId","options","injectionId","protoOrTarget","nameOrContext","once","addInitializer","
|
|
1
|
+
{"version":3,"file":"injection.js","sources":["../../../../../../../../src/wirestate-lit/consumption/injection.ts"],"sourcesContent":[null],"names":["ContextConsumer","ContainerContext","injection","optionsOrInjectionId","options","injectionId","protoOrTarget","nameOrContext","once","addInitializer","this","context","callback","container","set","call","get","subscribe","constructor","element"],"mappings":"0BAgDAA,MAAA,0CAAAC,MAAA,kCAgCM,SAAUC,EAAaC,GAC3B,MAAMC,EAC4B,iBAAzBD,GAA8D,OAAzBA,GAAiC,gBAAiBA,EAC1FA,EACA,CAAEE,YAAaF,GAErB,MAAQ,CACNG,EACAC,KAEA,MAAMF,YAAEA,EAAWG,KAAEA,GAASJ,EAGD,iBAAlBG,EACTA,EAAcE,gBAAe,WAC3B,IAAIT,EAAgBU,KAAM,CACxBC,QAASV,EACTW,SAAWC,IACTP,EAAcQ,IAAIC,KAAKL,KAAMG,EAAUG,IAAIX,GAAa,EAE1DY,WAAYT,GAEhB,IAGCF,EAAcY,YAAuCT,gBAAgBU,IACpE,IAAInB,EAAgBmB,EAAS,CAC3BR,QAASV,EACTW,SAAWC,IACRM,EAAsBZ,GAAiBM,EAAUG,IAAIX,EAAY,EAEpEY,WAAYT,GACZ,GAEN,CAEJ,QAAAN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ContextConsumer as t}from"@lit/context";import{ContainerContext as n}from"../context/container-context.js";function o(o){
|
|
1
|
+
import{ContextConsumer as t}from"@lit/context";import{ContainerContext as n}from"../context/container-context.js";function o(o){const e={value:null};return new t(o,{context:n,callback:t=>{e.value=t}}),e}export{o as useContainer};//# sourceMappingURL=use-container.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-container.js","sources":["../../../../../../../../src/wirestate-lit/consumption/use-container.ts"],"sourcesContent":[null],"names":["ContextConsumer","ContainerContext","useContainer","host","current","value","context","callback","container"],"mappings":"0BAqBAA,MAAA,0CAAAC,MAAA,kCAsBM,SAAUC,EAA6DC,GAK3E,
|
|
1
|
+
{"version":3,"file":"use-container.js","sources":["../../../../../../../../src/wirestate-lit/consumption/use-container.ts"],"sourcesContent":[null],"names":["ContextConsumer","ContainerContext","useContainer","host","current","value","context","callback","container"],"mappings":"0BAqBAA,MAAA,0CAAAC,MAAA,kCAsBM,SAAUC,EAA6DC,GAK3E,MAAMC,EAA6B,CAAEC,MAAO,MAS5C,OAPA,IAAIL,EAAgBG,EAAM,CACxBG,QAASL,EACTM,SAAWC,IACTJ,EAAQC,MAAQG,CAAS,IAItBJ,CACT,QAAAF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ContextConsumer as
|
|
1
|
+
import{ContextConsumer as t}from"@lit/context";import{ContainerContext as n}from"../context/container-context.js";function e(e,o){const c="object"==typeof o&&null!==o&&"injectionId"in o?o:{injectionId:o},{once:i,injectionId:r,value:l}=c,u={value:l,injectionId:r};return new t(e,{context:n,subscribe:!i,callback:t=>{u.value=t.get(r)}}),u}export{e as useInjection};//# sourceMappingURL=use-injection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-injection.js","sources":["../../../../../../../../src/wirestate-lit/consumption/use-injection.ts"],"sourcesContent":[null],"names":["ContextConsumer","ContainerContext","useInjection","host","optionsOrInjectionId","options","injectionId","once","
|
|
1
|
+
{"version":3,"file":"use-injection.js","sources":["../../../../../../../../src/wirestate-lit/consumption/use-injection.ts"],"sourcesContent":[null],"names":["ContextConsumer","ContainerContext","useInjection","host","optionsOrInjectionId","options","injectionId","once","value","current","context","subscribe","callback","container","get"],"mappings":"0BAkDAA,MAAA,0CAAAC,MAAA,kCA+BM,SAAUC,EACdC,EACAC,GAEA,MAAMC,EAC4B,iBAAzBD,GAA8D,OAAzBA,GAAiC,gBAAiBA,EAC1FA,EACA,CAAEE,YAAaF,IAEfG,KAAEA,EAAID,YAAEA,EAAWE,MAAEA,GAAUH,EAQ/BI,EAAgC,CAAED,MAAOA,EAAuBF,eAUtE,OARA,IAAIN,EAAgBG,EAAM,CACxBO,QAAST,EACTU,WAAYJ,EACZK,SAAWC,IACTJ,EAAQD,MAAQK,EAAUC,IAAIR,EAAY,IAIvCG,CACT,QAAAP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ContextConsumer as t}from"@lit/context";import{WireScope as o}from"@wirestate/core";import{ContainerContext as e}from"../context/container-context.js";function n(n){
|
|
1
|
+
import{ContextConsumer as t}from"@lit/context";import{WireScope as o}from"@wirestate/core";import{ContainerContext as e}from"../context/container-context.js";function n(n){const r={value:void 0,injectionId:o};return new t(n,{context:e,subscribe:!0,callback:t=>{r.value=t.get(o)}}),r}export{n as useScope};//# sourceMappingURL=use-scope.js.map
|