@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.
Files changed (81) hide show
  1. package/cjs/development/index.js +164 -191
  2. package/cjs/development/index.js.map +1 -1
  3. package/cjs/production/index.js +1 -1
  4. package/cjs/production/index.js.map +1 -1
  5. package/esm/development/commands/on-command-controller.js +17 -20
  6. package/esm/development/commands/on-command-controller.js.map +1 -1
  7. package/esm/development/commands/on-command.js +4 -9
  8. package/esm/development/commands/on-command.js.map +1 -1
  9. package/esm/development/commands/use-on-command.js +4 -3
  10. package/esm/development/commands/use-on-command.js.map +1 -1
  11. package/esm/development/consumption/injection.js +10 -9
  12. package/esm/development/consumption/injection.js.map +1 -1
  13. package/esm/development/consumption/use-container.js +2 -2
  14. package/esm/development/consumption/use-container.js.map +1 -1
  15. package/esm/development/consumption/use-injection.js +9 -7
  16. package/esm/development/consumption/use-injection.js.map +1 -1
  17. package/esm/development/consumption/use-scope.js +2 -2
  18. package/esm/development/consumption/use-scope.js.map +1 -1
  19. package/esm/development/context/container-context.js +2 -2
  20. package/esm/development/context/container-context.js.map +1 -1
  21. package/esm/development/error/error-code.js +1 -1
  22. package/esm/development/error/error-code.js.map +1 -1
  23. package/esm/development/events/on-event-controller.js +20 -24
  24. package/esm/development/events/on-event-controller.js.map +1 -1
  25. package/esm/development/events/on-event.js +5 -11
  26. package/esm/development/events/on-event.js.map +1 -1
  27. package/esm/development/events/use-on-events.js +5 -5
  28. package/esm/development/events/use-on-events.js.map +1 -1
  29. package/esm/development/provision/container-provide.js +7 -7
  30. package/esm/development/provision/container-provide.js.map +1 -1
  31. package/esm/development/provision/container-provider.js +17 -23
  32. package/esm/development/provision/container-provider.js.map +1 -1
  33. package/esm/development/provision/sub-container-provide.js +7 -7
  34. package/esm/development/provision/sub-container-provide.js.map +1 -1
  35. package/esm/development/provision/sub-container-provider.js +28 -31
  36. package/esm/development/provision/sub-container-provider.js.map +1 -1
  37. package/esm/development/queries/on-query-controller.js +17 -20
  38. package/esm/development/queries/on-query-controller.js.map +1 -1
  39. package/esm/development/queries/on-query.js +4 -9
  40. package/esm/development/queries/on-query.js.map +1 -1
  41. package/esm/development/queries/use-on-query.js +4 -3
  42. package/esm/development/queries/use-on-query.js.map +1 -1
  43. package/esm/production/commands/on-command-controller.js +1 -1
  44. package/esm/production/commands/on-command-controller.js.map +1 -1
  45. package/esm/production/commands/on-command.js +1 -1
  46. package/esm/production/commands/on-command.js.map +1 -1
  47. package/esm/production/commands/use-on-command.js +1 -1
  48. package/esm/production/commands/use-on-command.js.map +1 -1
  49. package/esm/production/consumption/injection.js +1 -1
  50. package/esm/production/consumption/injection.js.map +1 -1
  51. package/esm/production/consumption/use-container.js +1 -1
  52. package/esm/production/consumption/use-container.js.map +1 -1
  53. package/esm/production/consumption/use-injection.js +1 -1
  54. package/esm/production/consumption/use-injection.js.map +1 -1
  55. package/esm/production/consumption/use-scope.js +1 -1
  56. package/esm/production/consumption/use-scope.js.map +1 -1
  57. package/esm/production/context/container-context.js +1 -1
  58. package/esm/production/context/container-context.js.map +1 -1
  59. package/esm/production/error/error-code.js +1 -1
  60. package/esm/production/error/error-code.js.map +1 -1
  61. package/esm/production/events/on-event-controller.js +1 -1
  62. package/esm/production/events/on-event-controller.js.map +1 -1
  63. package/esm/production/events/on-event.js +1 -1
  64. package/esm/production/events/on-event.js.map +1 -1
  65. package/esm/production/events/use-on-events.js +1 -1
  66. package/esm/production/events/use-on-events.js.map +1 -1
  67. package/esm/production/provision/container-provide.js +1 -1
  68. package/esm/production/provision/container-provide.js.map +1 -1
  69. package/esm/production/provision/container-provider.js +1 -1
  70. package/esm/production/provision/container-provider.js.map +1 -1
  71. package/esm/production/provision/sub-container-provide.js +1 -1
  72. package/esm/production/provision/sub-container-provide.js.map +1 -1
  73. package/esm/production/provision/sub-container-provider.js +1 -1
  74. package/esm/production/provision/sub-container-provider.js.map +1 -1
  75. package/esm/production/queries/on-query-controller.js +1 -1
  76. package/esm/production/queries/on-query-controller.js.map +1 -1
  77. package/esm/production/queries/on-query.js +1 -1
  78. package/esm/production/queries/on-query.js.map +1 -1
  79. package/esm/production/queries/use-on-query.js +1 -1
  80. package/esm/production/queries/use-on-query.js.map +1 -1
  81. 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
- var normalized = types === undefined ? null : Array.isArray(types) ? __spreadArray([], types, true) : [types];
47
- return function (protoOrTarget, nameOrContext) {
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
- var _this = this;
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(function (element) {
59
- new OnEventController(element, normalized, function (event) {
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","__spreadArray","protoOrTarget","nameOrContext","addInitializer","_this","OnEventController","event","name","constructor","element"],"mappings":";;;AAyBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCG;AACG,SAAUA,OAAOA,CAA0BC,KAA4C,EAAA;EAC3F,IAAMC,UAAU,GACdD,KAAK,KAAKE,SAAS,GAAG,IAAI,GAAGC,KAAK,CAACC,OAAO,CAACJ,KAAK,CAAC,GAAEK,aAAA,CAAA,EAAA,EAAML,KAAkC,EAAA,IAAA,CAAA,GAAI,CAACA,KAAkB,CAAC;AAErH,EAAA,OAAQ,UAACM,aAAqB,EAAEC,aAAwD,EAAA;AACtF,IAAA,IAAI,OAAOA,aAAa,KAAK,QAAQ,EAAE;AACrC;MACAA,aAAa,CAACC,cAAc,CAAC,YAAA;QAAA,IAAAC,KAAA,GAAA,IAAA;QAC3B,IAAIC,iBAAiB,CAAC,IAAuB,EAAET,UAAU,EAAE,UAACU,KAAK,EAAA;UAC/D,OAACF,KAAkB,CAACF,aAAa,CAACK,IAAI,CAAC,CAACD,KAAK,CAAC;AAA9C,QAAA,CAA8C,CAC/C;AACH,MAAA,CAAC,CAAC;AACJ,IAAA,CAAC,MAAM;AACL;AACCL,MAAAA,aAAa,CAACO,WAAsC,CAACL,cAAc,CAAC,UAACM,OAAwB,EAAA;QAC5F,IAAIJ,iBAAiB,CAACI,OAAO,EAAEb,UAAU,EAAE,UAACU,KAAK,EAAA;AAAK,UAAA,OAACG,OAAqB,CAACP,aAAa,CAAC,CAACI,KAAK,CAAC;AAA5C,QAAA,CAA4C,CAAC;AACrG,MAAA,CAAC,CAAC;AACJ,IAAA;EACF,CAAC;AACH;;;;"}
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, _a) {
35
- var types = _a.types,
36
- handler = _a.handler;
37
- var normalized = types ? Array.isArray(types) ? __spreadArray([], types, true) : [types] : null;
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","_a","types","handler","normalized","Array","isArray","OnEventController"],"mappings":";;;AAuBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BG;AACG,SAAUA,WAAWA,CACzBC,IAAqB,EACrBC,EAAsC,EAAA;MAApCC,KAAK,GAAAD,EAAA,CAAAC,KAAA;IAAEC,OAAO,GAAAF,EAAA,CAAAE,OAAA;EAEhB,IAAMC,UAAU,GAAuCF,KAAK,GACxDG,KAAK,CAACC,OAAO,CAACJ,KAAK,CAAC,qBACbA,KAAkC,EAAA,IAAA,CAAA,GACvC,CAACA,KAAkB,CAAC,GACtB,IAAI;EAER,OAAO,IAAIK,iBAAiB,CAAIP,IAAI,EAAEI,UAAU,EAAED,OAAO,CAAC;AAC5D;;;;"}
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 function (protoOrTarget, nameOrContext) {
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
- var controller_1;
52
- protoOrTarget.constructor.addInitializer(function (element) {
53
- controller_1 = new ContainerProvider(element, options);
51
+ let controller;
52
+ protoOrTarget.constructor.addInitializer(element => {
53
+ controller = new ContainerProvider(element, options);
54
54
  });
55
55
  return {
56
- get: function () {
57
- return controller_1;
56
+ get() {
57
+ return controller;
58
58
  },
59
- set: function () {},
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","controller_1","constructor","element","get","configurable","enumerable"],"mappings":";;AA2BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCG;AACG,SAAUA,gBAAgBA,CAC9BC,OAAiC,EAAA;AAEjC,EAAA,OAAQ,UACNC,aAAkF,EAClFC,aAAiG,EAAA;AAEjG,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,YAAuC;AAE1CN,MAAAA,aAAa,CAACO,WAAsC,CAACL,cAAc,CAAC,UAACM,OAAwB,EAAA;AAC5FF,QAAAA,YAAU,GAAG,IAAID,iBAAiB,CAACG,OAAY,EAAET,OAAO,CAAC;AAC3D,MAAA,CAAC,CAAC;MAEF,OAAO;QACLU,GAAG,EAAA,YAAA;AACD,UAAA,OAAOH,YAAkC;QAC3C,CAAC;AACDH,QAAAA,GAAG,eAAU,CAAC;AACdO,QAAAA,YAAY,EAAE,IAAI;AAClBC,QAAAA,UAAU,EAAE;OACb;AACH,IAAA;EACF,CAAC;AACH;;;;"}
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
- var ContainerProvider = /** @class */function (_super) {
23
- __extends(ContainerProvider, _super);
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
- function ContainerProvider(host, options) {
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
- _this = _super.call(this, host, {
35
+ super(host, {
38
36
  context: ContainerContext,
39
- initialValue: options.container ? options.container : createContainer(__assign(__assign({}, options.options), {
37
+ initialValue: options.container ? options.container : createContainer({
38
+ ...options.options,
40
39
  activate: []
41
- }))
42
- }) || this;
43
- _this.destroyed = false;
44
- _this.options = options.options;
45
- return _this;
40
+ })
41
+ });
42
+ this.options = options.options;
46
43
  }
47
- ContainerProvider.prototype.hostConnected = function () {
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 ((_a = this.options) === null || _a === void 0 ? void 0 : _a.activate) {
55
- for (var _i = 0, _b = this.options.activate; _i < _b.length; _i++) {
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
- _super.prototype.hostConnected.call(this);
63
- };
64
- ContainerProvider.prototype.hostDisconnected = function () {
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
- return ContainerProvider;
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","_super","__extends","host","options","_this","container","WirestateError","ERROR_CODE_INVALID_ARGUMENTS","call","context","ContainerContext","initialValue","createContainer","activate","destroyed","prototype","hostConnected","value","_a","_i","_b","length","entry","get","hostDisconnected","unbindAll","ContextProvider"],"mappings":";;;;;;AAyCA;;;;;;;;;;;;;;AAcG;AACH,IAAAA,iBAAA,gBAAA,UAAAC,MAAA,EAAA;AACUC,EAAAA,SAAA,CAAAF,iBAAA,EAAAC,MAAA,CAAA;AAOR;;;;;AAKG;AACH,EAAA,SAAAD,iBAAAA,CAAmBG,IAAO,EAAEC,OAAiC,EAAA;IAA7D,IAAAC,KAAA,GAAA,IAAA;IACE,IAAI,CAACD,OAAO,CAACE,SAAS,IAAI,CAACF,OAAO,CAACA,OAAO,EAAE;AAC1C,MAAA,MAAM,IAAIG,cAAc,CACtBC,4BAA4B,EAC5B,4EAA4E,CAC7E;IACH,CAAC,MAAM,IAAIJ,OAAO,CAACE,SAAS,IAAIF,OAAO,CAACA,OAAO,EAAE;AAC/C,MAAA,MAAM,IAAIG,cAAc,CACtBC,4BAA4B,EAC5B,mFAAmF,CACpF;AACH,IAAA;IAEAH,KAAA,GAAAJ,MAAK,CAAAQ,IAAA,CAAA,IAAA,EAACN,IAAI,EAAE;AACVO,MAAAA,OAAO,EAAEC,gBAAgB;MACzBC,YAAY,EAAER,OAAO,CAACE,SAAS,GAAGF,OAAO,CAACE,SAAS,GAAGO,eAAe,uBAAMT,OAAO,CAACA,OAAO,CAAA,EAAA;AAAEU,QAAAA,QAAQ,EAAE;AAAE,OAAA,CAAA;KACzG,CAAC,IAAA,IAAA;IAxBMT,KAAA,CAAAU,SAAS,GAAY,KAAK;AA0BlCV,IAAAA,KAAI,CAACD,OAAO,GAAGA,OAAO,CAACA,OAAO;;AAQhC,EAAA;AAEOJ,EAAAA,iBAAA,CAAAgB,SAAA,CAAAC,aAAa,GAApB,YAAA;;IACE,IAAI,IAAI,CAACb,OAAO,EAAE;MAChB,IAAI,IAAI,CAACW,SAAS,EAAE;QAKlB,IAAI,CAACG,KAAK,GAAGL,eAAe,CAAC,IAAI,CAACT,OAAO,CAAC;QAC1C,IAAI,CAACW,SAAS,GAAG,KAAK;AACxB,MAAA,CAAC,MAAM;QACL,IAAI,MAAA,IAAI,CAACX,OAAO,MAAA,IAAA,IAAAe,EAAA,KAAA,MAAA,GAAA,MAAA,GAAAA,EAAA,CAAEL,QAAQ,EAAE;UAK1B,KAAoB,IAAAM,EAAA,GAAA,CAAqB,EAArBC,EAAA,GAAA,IAAI,CAACjB,OAAO,CAACU,QAAQ,EAArBM,EAAA,GAAAC,EAAA,CAAAC,MAAqB,EAArBF,EAAA,EAAqB,EAAE;AAAtC,YAAA,IAAMG,KAAK,GAAAF,EAAA,CAAAD,EAAA,CAAA;AACd,YAAA,IAAI,CAACF,KAAK,CAACM,GAAG,CAACD,KAAK,CAAC;AACvB,UAAA;AACF,QAAA;AACF,MAAA;AACF,IAAA;IAEAtB,MAAA,CAAAe,SAAK,CAACC,aAAa,CAAAR,IAAA,CAAA,IAAA,CAAE;EACvB,CAAC;AAEMT,EAAAA,iBAAA,CAAAgB,SAAA,CAAAS,gBAAgB,GAAvB,YAAA;IACE,IAAI,IAAI,CAACrB,OAAO,EAAE;AAKhB,MAAA,IAAI,CAACc,KAAK,CAACQ,SAAS,EAAE;MACtB,IAAI,CAACX,SAAS,GAAG,IAAI;AACvB,IAAA;EACF,CAAC;AACH,EAAA,OAAAf,iBAAC;AAAD,CA7EA,CACU2B,eAAe;;;;"}
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 function (protoOrTarget, nameOrContext) {
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
- var provider_1;
40
- protoOrTarget.constructor.addInitializer(function (element) {
41
- provider_1 = new SubContainerProvider(element, options);
39
+ let provider;
40
+ protoOrTarget.constructor.addInitializer(element => {
41
+ provider = new SubContainerProvider(element, options);
42
42
  });
43
43
  return {
44
- get: function () {
45
- return provider_1;
44
+ get() {
45
+ return provider;
46
46
  },
47
- set: function () {},
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","provider_1","constructor","element","get","configurable","enumerable"],"mappings":";;AA2BA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BG;AACG,SAAUA,mBAAmBA,CACjCC,OAAoC,EAAA;AAEpC,EAAA,OAAQ,UACNC,aAAmG,EACnGC,aAAkH,EAAA;AAElH,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,UAAwC;AAE3CN,MAAAA,aAAa,CAACO,WAAsC,CAACL,cAAc,CAAC,UAACM,OAAwB,EAAA;AAC5FF,QAAAA,UAAQ,GAAG,IAAID,oBAAoB,CAACG,OAAY,EAAET,OAAO,CAAC;AAC5D,MAAA,CAAC,CAAC;MAEF,OAAO;QACLU,GAAG,EAAA,YAAA;AACD,UAAA,OAAOH,UAAmC;QAC5C,CAAC;AACDH,QAAAA,GAAG,eAAU,CAAC;AACdO,QAAAA,YAAY,EAAE,IAAI;AAClBC,QAAAA,UAAU,EAAE;OACb;AACH,IAAA;EACF,CAAC;AACH;;;;"}
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 { __extends, __assign } from 'tslib';
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
- var SubContainerProvider = /** @class */function (_super) {
31
- __extends(SubContainerProvider, _super);
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
- function SubContainerProvider(host, options) {
37
- var _this = _super.call(this, host, {
36
+ constructor(host, options) {
37
+ super(host, {
38
38
  context: ContainerContext
39
- }) || this;
40
- _this.parent = null;
41
- _this.destroyed = true;
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: function (context) {
47
- var previousParent = _this.parent;
48
- _this.parent = context;
44
+ callback: context => {
45
+ const previousParent = this.parent;
46
+ this.parent = context;
49
47
  if (host.isConnected) {
50
- if (_this.destroyed || !_this.value || previousParent !== context) {
51
- _this.destroyContainer();
52
- _this.createContainer();
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
- SubContainerProvider.prototype.hostConnected = function () {
56
+ hostConnected() {
60
57
  if (this.parent && (this.destroyed || !this.value)) {
61
58
  this.destroyContainer();
62
59
  this.createContainer();
63
60
  }
64
- _super.prototype.hostConnected.call(this);
65
- };
66
- SubContainerProvider.prototype.hostDisconnected = function () {
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
- SubContainerProvider.prototype.createContainer = function () {
74
- var container = createContainer(__assign(__assign({}, this.options), {
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
- SubContainerProvider.prototype.destroyContainer = function () {
81
+ destroyContainer() {
84
82
  if (this.value && !this.destroyed) {
85
83
  this.value.unbindAll();
86
84
  this.destroyed = true;
87
85
  }
88
- };
89
- return SubContainerProvider;
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","_super","__extends","host","options","_this","call","context","ContainerContext","parent","destroyed","consumer","ContextConsumer","subscribe","callback","previousParent","isConnected","value","destroyContainer","createContainer","prototype","hostConnected","hostDisconnected","container","__assign","unbindAll","ContextProvider"],"mappings":";;;;;AAkDA;;;;;;;;;;;;;;;;;;;;;;;AAuBG;AACH,IAAAA,oBAAA,gBAAA,UAAAC,MAAA,EAAA;AACUC,EAAAA,SAAA,CAAAF,oBAAA,EAAAC,MAAA,CAAA;AASR;;;AAGG;AACH,EAAA,SAAAD,oBAAAA,CAAmBG,IAAO,EAAEC,OAAoC,EAAA;IAC9D,IAAAC,KAAA,GAAAJ,MAAK,CAAAK,IAAA,CAAA,IAAA,EAACH,IAAI,EAAE;AACVI,MAAAA,OAAO,EAAEC;KACV,CAAC,IAAA,IAAA;IAVMH,KAAA,CAAAI,MAAM,GAAqB,IAAI;IAC/BJ,KAAA,CAAAK,SAAS,GAAY,IAAI;AAajCL,IAAAA,KAAI,CAACD,OAAO,GAAGA,OAAO,CAACA,OAAO;AAE9BC,IAAAA,KAAI,CAACM,QAAQ,GAAG,IAAIC,eAAe,CAACT,IAAI,EAAE;AACxCI,MAAAA,OAAO,EAAEC,gBAAgB;AACzBK,MAAAA,SAAS,EAAE,IAAI;AACfC,MAAAA,QAAQ,EAAE,UAACP,OAAkB,EAAA;AAC3B,QAAA,IAAMQ,cAAc,GAAqBV,KAAI,CAACI,MAAM;QAEpDJ,KAAI,CAACI,MAAM,GAAGF,OAAO;QAErB,IAAIJ,IAAI,CAACa,WAAW,EAAE;AAMpB,UAAA,IAAIX,KAAI,CAACK,SAAS,IAAI,CAACL,KAAI,CAACY,KAAK,IAAIF,cAAc,KAAKR,OAAO,EAAE;YAC/DF,KAAI,CAACa,gBAAgB,EAAE;YACvBb,KAAI,CAACc,eAAe,EAAE;AACxB,UAAA;AACF,QAAA;AAMF,MAAA;AACD,KAAA,CAAC;;AACJ,EAAA;AAEOnB,EAAAA,oBAAA,CAAAoB,SAAA,CAAAC,aAAa,GAApB,YAAA;AAOE,IAAA,IAAI,IAAI,CAACZ,MAAM,KAAK,IAAI,CAACC,SAAS,IAAI,CAAC,IAAI,CAACO,KAAK,CAAC,EAAE;MAClD,IAAI,CAACC,gBAAgB,EAAE;MACvB,IAAI,CAACC,eAAe,EAAE;AACxB,IAAA;IAEAlB,MAAA,CAAAmB,SAAK,CAACC,aAAa,CAAAf,IAAA,CAAA,IAAA,CAAE;EACvB,CAAC;AAEMN,EAAAA,oBAAA,CAAAoB,SAAA,CAAAE,gBAAgB,GAAvB,YAAA;IAOE,IAAI,CAACJ,gBAAgB,EAAE;EACzB,CAAC;AAED;;;AAGG;AACOlB,EAAAA,oBAAA,CAAAoB,SAAA,CAAAD,eAAe,GAAzB,YAAA;AACE,IAAA,IAAMI,SAAS,GAAcJ,eAAe,CAAAK,QAAA,CAAAA,QAAA,CAAA,EAAA,EACvC,IAAI,CAACpB,OAAO,CAAA,EAAA;MACfK,MAAM,EAAE,IAAI,CAACA;OACb;IAQF,IAAI,CAACC,SAAS,GAAG,KAAK;IACtB,IAAI,CAACO,KAAK,GAAGM,SAAS;EACxB,CAAC;AAED;;AAEG;AACOvB,EAAAA,oBAAA,CAAAoB,SAAA,CAAAF,gBAAgB,GAA1B,YAAA;IACE,IAAI,IAAI,CAACD,KAAK,IAAI,CAAC,IAAI,CAACP,SAAS,EAAE;AAMjC,MAAA,IAAI,CAACO,KAAK,CAACQ,SAAS,EAAE;MACtB,IAAI,CAACf,SAAS,GAAG,IAAI;AACvB,IAAA;EACF,CAAC;AACH,EAAA,OAAAV,oBAAC;AAAD,CA9GA,CACU0B,eAAe;;;;"}
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
- var OnQueryController = /** @class */function () {
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
- function OnQueryController(host, type, handler) {
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: function (container) {
31
- _this.bus = container.get(QueryBus);
29
+ callback: container => {
30
+ this.bus = container.get(QueryBus);
32
31
  if (host.isConnected) {
33
- _this.reregister();
32
+ this.reregister();
34
33
  }
35
34
  }
36
35
  });
37
36
  }
38
- OnQueryController.prototype.hostConnected = function () {
37
+ hostConnected() {
39
38
  this.reregister();
40
- };
41
- OnQueryController.prototype.hostDisconnected = function () {
39
+ }
40
+ hostDisconnected() {
42
41
  this.cleanup();
43
- };
44
- OnQueryController.prototype.reregister = function () {
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
- OnQueryController.prototype.cleanup = function () {
51
- var _a;
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
- return OnQueryController;
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","host","type","handler","_this","bus","unregister","addController","ContextConsumer","context","ContainerContext","subscribe","callback","container","get","QueryBus","isConnected","reregister","prototype","hostConnected","hostDisconnected","cleanup","register","_a","call"],"mappings":";;;;AAUA;;;;;;;;AAQG;AACH,IAAAA,iBAAA,gBAAA,YAAA;AAOE;;;;AAIG;AACH,EAAA,SAAAA,iBAAAA,CAAmBC,IAAqB,EAAEC,IAAe,EAAEC,OAA2B,EAAA;IAAtF,IAAAC,KAAA,GAAA,IAAA;IAXQ,IAAA,CAAAC,GAAG,GAAuB,IAAI;IAC9B,IAAA,CAAAC,UAAU,GAA8B,IAAI;AAWlDL,IAAAA,IAAI,CAACM,aAAa,CAAC,IAAI,CAAC;IAExB,IAAI,CAACL,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACC,OAAO,GAAGA,OAAO;IAItB,IAAIK,eAAe,CAACP,IAAI,EAAE;AACxBQ,MAAAA,OAAO,EAAEC,gBAAgB;AACzBC,MAAAA,SAAS,EAAE,IAAI;AACfC,MAAAA,QAAQ,EAAE,UAACC,SAAS,EAAA;QAClBT,KAAI,CAACC,GAAG,GAAGQ,SAAS,CAACC,GAAG,CAACC,QAAQ,CAAC;QAElC,IAAId,IAAI,CAACe,WAAW,EAAE;UACpBZ,KAAI,CAACa,UAAU,EAAE;AACnB,QAAA;AACF,MAAA;AACD,KAAA,CAAC;AACJ,EAAA;AAEOjB,EAAAA,iBAAA,CAAAkB,SAAA,CAAAC,aAAa,GAApB,YAAA;IAEE,IAAI,CAACF,UAAU,EAAE;EACnB,CAAC;AAEMjB,EAAAA,iBAAA,CAAAkB,SAAA,CAAAE,gBAAgB,GAAvB,YAAA;IAEE,IAAI,CAACC,OAAO,EAAE;EAChB,CAAC;AAEOrB,EAAAA,iBAAA,CAAAkB,SAAA,CAAAD,UAAU,GAAlB,YAAA;IACE,IAAI,CAACI,OAAO,EAAE;IAEd,IAAI,IAAI,CAAChB,GAAG,EAAE;AAEZ,MAAA,IAAI,CAACC,UAAU,GAAG,IAAI,CAACD,GAAG,CAACiB,QAAQ,CAAC,IAAI,CAACpB,IAAI,EAAE,IAAI,CAACC,OAAO,CAAC;AAC9D,IAAA;EACF,CAAC;AAEOH,EAAAA,iBAAA,CAAAkB,SAAA,CAAAG,OAAO,GAAf,YAAA;;IACE,CAAAE,EAAA,GAAA,IAAI,CAACjB,UAAU,MAAA,IAAA,IAAAiB,EAAA,KAAA,MAAA,GAAA,MAAA,GAAAA,EAAA,CAAAC,IAAA,CAAA,IAAA,CAAI;IACnB,IAAI,CAAClB,UAAU,GAAG,IAAI;EACxB,CAAC;AACH,EAAA,OAAAN,iBAAC;AAAD,CAAC;;;;"}
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 function (protoOrTarget, nameOrContext) {
25
+ return (protoOrTarget, nameOrContext) => {
26
26
  if (typeof nameOrContext === "object") {
27
27
  // Standard decorators:
28
28
  nameOrContext.addInitializer(function () {
29
- var _this = this;
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(function (element) {
37
- new OnQueryController(element, type, function (data) {
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","_this","OnQueryController","data","name","constructor","element"],"mappings":";;AAyBA;;;;;;;;;;;;;;;;;;;;AAoBG;AACG,SAAUA,OAAOA,CAA2BC,IAAe,EAAA;AAC/D,EAAA,OAAQ,UAACC,aAAqB,EAAEC,aAAwD,EAAA;AACtF,IAAA,IAAI,OAAOA,aAAa,KAAK,QAAQ,EAAE;AACrC;MACAA,aAAa,CAACC,cAAc,CAAC,YAAA;QAAA,IAAAC,KAAA,GAAA,IAAA;QAC3B,IAAIC,iBAAiB,CACnB,IAAuB,EACvBL,IAAI,EACJ,UAACM,IAAO,EAAA;UAAK,OAACF,KAAkB,CAACF,aAAa,CAACK,IAAI,CAAC,CAACD,IAAI,CAAoB;AAAhE,QAAA,CAAgE,CAC9E;AACH,MAAA,CAAC,CAAC;AACJ,IAAA,CAAC,MAAM;AACL;AACCL,MAAAA,aAAa,CAACO,WAAsC,CAACL,cAAc,CAAC,UAACM,OAAwB,EAAA;QAC5F,IAAIJ,iBAAiB,CACnBI,OAAO,EACPT,IAAI,EACJ,UAACM,IAAO,EAAA;AAAK,UAAA,OAACG,OAAqB,CAACP,aAAa,CAAC,CAACI,IAAI,CAAoB;AAA9D,QAAA,CAA8D,CAC5E;AACH,MAAA,CAAC,CAAC;AACJ,IAAA;EACF,CAAC;AACH;;;;"}
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, _a) {
25
- var type = _a.type,
26
- handler = _a.handler;
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","_a","type","handler","OnQueryController"],"mappings":";;AAqBA;;;;;;;;;;;;;;;;;;;;AAoBG;AACG,SAAUA,UAAUA,CACxBC,IAAqB,EACrBC,EAA0C,EAAA;MAAxCC,IAAI,GAAAD,EAAA,CAAAC,IAAA;IAAEC,OAAO,GAAAF,EAAA,CAAAE,OAAA;EAEf,OAAO,IAAIC,iBAAiB,CAAOJ,IAAI,EAAEE,IAAI,EAAEC,OAAO,CAAC;AACzD;;;;"}
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 r}from"../context/container-context.js";var i=function(){function i(i,n,s){var o=this;this.bus=null,this.unregister=null,i.addController(this),this.type=n,this.handler=s,new t(i,{context:r,subscribe:!0,callback:function(t){o.bus=t.get(e),i.isConnected&&o.reregister()}})}return i.prototype.hostConnected=function(){this.reregister()},i.prototype.hostDisconnected=function(){this.cleanup()},i.prototype.reregister=function(){this.cleanup(),this.bus&&(this.unregister=this.bus.register(this.type,this.handler))},i.prototype.cleanup=function(){var t;null===(t=this.unregister)||void 0===t||t.call(this),this.unregister=null},i}();export{i as OnCommandController};//# sourceMappingURL=on-command-controller.js.map
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","host","type","handler","_this","this","bus","unregister","addController","context","subscribe","callback","container","get","isConnected","reregister","prototype","hostConnected","hostDisconnected","cleanup","register","_a","call"],"mappings":"0BAUAA,MAAA,oCAAAC,MAAA,6CAAAC,MAAA,kCASA,IAAAC,EAAA,WAYE,SAAAA,EAAmBC,EAAuBC,EAAmBC,GAA7D,IAAAC,EAAAC,KAXQA,KAAAC,IAA4B,KAC5BD,KAAAE,WAA0C,KAahDN,EAAKO,cAAcH,MAEnBA,KAAKH,KAAOA,EACZG,KAAKF,QAAUA,EAEf,IAAIN,EAAgBI,EAAM,CACxBQ,QAASV,EACTW,WAAW,EACXC,SAAU,SAACC,GACTR,EAAKE,IAAMM,EAAUC,IAAIf,GAErBG,EAAKa,aACPV,EAAKW,YAET,GAEJ,CA2BF,OAzBSf,EAAAgB,UAAAC,cAAP,WAEEZ,KAAKU,YACP,EAEOf,EAAAgB,UAAAE,iBAAP,WAEEb,KAAKc,SACP,EAEQnB,EAAAgB,UAAAD,WAAR,WACEV,KAAKc,UAEDd,KAAKC,MAEPD,KAAKE,WAAaF,KAAKC,IAAIc,SAASf,KAAKH,KAAMG,KAAKF,SAExD,EAEQH,EAAAgB,UAAAG,QAAR,iBAGiB,QAAfE,EAAAhB,KAAKE,kBAAU,IAAAc,GAAAA,EAAAC,KAAAjB,MACfA,KAAKE,WAAa,IACpB,EACFP,CAAA,CA1DA,UA0DCA"}
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 function(o,r){"object"==typeof r?r.addInitializer((function(){var o=this;new n(this,t,(function(n){return o[r.name](n)}))})):o.constructor.addInitializer((function(o){new n(o,t,(function(n){return o[r](n)}))}))}}export{t as onCommand};//# sourceMappingURL=on-command.js.map
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","_this","this","data","name","constructor","element"],"mappings":"8BAyBAA,MAAA,6BAqBM,SAAUC,EAAoCC,GAClD,OAAQ,SAACC,EAAuBC,GACD,iBAAlBA,EAETA,EAAcC,gBAAe,WAAA,IAAAC,EAAAC,KAC3B,IAAIP,EACFO,KACAL,GACA,SAACM,GAAY,OAACF,EAAmBF,EAAcK,MAAMD,EAAxC,GAEjB,IAGCL,EAAcO,YAAuCL,gBAAe,SAACM,GACpE,IAAIX,EACFW,EACAT,GACA,SAACM,GAAY,OAACG,EAAsBP,GAAeI,EAAtC,GAEjB,GAEJ,CACF,QAAAP"}
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 r}from"./on-command-controller.js";function n(n,o){var e=o.type,t=o.handler;return new r(n,e,t)}export{n as useOnCommand};//# sourceMappingURL=use-on-command.js.map
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","_a","type","handler"],"mappings":"8BAqBAA,MAAA,6BAqBM,SAAUC,EACdC,EACAC,OAAEC,EAAID,EAAAC,KAAEC,EAAOF,EAAAE,QAEf,OAAO,IAAIL,EAA0BE,EAAME,EAAMC,EACnD,QAAAJ"}
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){var i="object"==typeof c&&null!==c&&"injectionId"in c?c:{injectionId:c};return function(c,o){var e=i.injectionId,r=i.once;"object"==typeof o?o.addInitializer((function(){var i=this;new t(this,{context:n,callback:function(t){c.set.call(i,t.get(e))},subscribe:!r})})):c.constructor.addInitializer((function(c){new t(c,{context:n,callback:function(t){c[o]=t.get(e)},subscribe:!r})}))}}export{c as injection};//# sourceMappingURL=injection.js.map
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","_this","this","context","callback","container","set","call","get","subscribe","constructor","element"],"mappings":"0BAgDAA,MAAA,0CAAAC,MAAA,kCAgCM,SAAUC,EAAaC,GAC3B,IAAMC,EAC4B,iBAAzBD,GAA8D,OAAzBA,GAAiC,gBAAiBA,EAC1FA,EACA,CAAEE,YAAaF,GAErB,OAAQ,SACNG,EACAC,GAEQ,IAAAF,EAAsBD,EAAOC,YAAhBG,EAASJ,EAAOI,KAGR,iBAAlBD,EACTA,EAAcE,gBAAe,WAAA,IAAAC,EAAAC,KAC3B,IAAIX,EAAgBW,KAAM,CACxBC,QAASX,EACTY,SAAU,SAACC,GACTR,EAAcS,IAAIC,KAAKN,EAAMI,EAAUG,IAAIZ,GAC7C,EACAa,WAAYV,GAEhB,IAGCF,EAAca,YAAuCV,gBAAe,SAACW,GACpE,IAAIpB,EAAgBoB,EAAS,CAC3BR,QAASX,EACTY,SAAU,SAACC,GACRM,EAAsBb,GAAiBO,EAAUG,IAAIZ,EACxD,EACAa,WAAYV,GAEhB,GAEJ,CACF,QAAAN"}
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){var e={value:null};return new t(o,{context:n,callback:function(t){e.value=t}}),e}export{o as useContainer};//# sourceMappingURL=use-container.js.map
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,IAAMC,EAA6B,CAAEC,MAAO,MAS5C,OAPA,IAAIL,EAAgBG,EAAM,CACxBG,QAASL,EACTM,SAAU,SAACC,GACTJ,EAAQC,MAAQG,CAClB,IAGKJ,CACT,QAAAF"}
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 n}from"@lit/context";import{ContainerContext as t}from"../context/container-context.js";function e(e,o){var c="object"==typeof o&&null!==o&&"injectionId"in o?o:{injectionId:o},i=c.once,r=c.injectionId,l={value:c.value,injectionId:r};return new n(e,{context:t,subscribe:!i,callback:function(n){l.value=n.get(r)}}),l}export{e as useInjection};//# sourceMappingURL=use-injection.js.map
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","current","value","context","subscribe","callback","container","get"],"mappings":"0BAkDAA,MAAA,0CAAAC,MAAA,kCA+BM,SAAUC,EACdC,EACAC,GAEA,IAAMC,EAC4B,iBAAzBD,GAA8D,OAAzBA,GAAiC,gBAAiBA,EAC1FA,EACA,CAAEE,YAAaF,GAEbG,EAA6BF,EAAOE,KAA9BD,EAAuBD,EAAOC,YAQtCE,EAAgC,CAAEC,MARHJ,QAQiCC,YAAWA,GAUjF,OARA,IAAIN,EAAgBG,EAAM,CACxBO,QAAST,EACTU,WAAYJ,EACZK,SAAU,SAACC,GACTL,EAAQC,MAAQI,EAAUC,IAAIR,EAChC,IAGKE,CACT,QAAAN"}
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){var r={value:void 0,injectionId:o};return new t(n,{context:e,subscribe:!0,callback:function(t){r.value=t.get(o)}}),r}export{n as useScope};//# sourceMappingURL=use-scope.js.map
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