@ddd-qc/lit-happ 0.9.3 → 0.9.5

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/README.md CHANGED
@@ -12,46 +12,127 @@ npm i @ddd-qc/cell-proxy
12
12
 
13
13
  ## Design
14
14
 
15
- Model-View-ViewModel where:
16
- - Model: holochain DNAs
17
- - View: LitElements
18
- - ViewModel: subclasses of this package `ViewModel`
15
+ Rhe Model-View-ViewModel ("MVVM") architectural pattern can be used for build holochain web apps by considering Holochain DNAs as the "Model" and LitElements as the "View".
16
+ What is missing is the "ViewModel", the categorie of objects that formats data from the model in a way that it can be consumed and updated by the view (without actually knowing the exact implementations of Views).
17
+ This package provides this categorie of objects.
19
18
 
20
- In this architectural pattern, the ViewModel, while being unaware of the exact implements of the Views, makes the data from the Model available and in a usable/presentable form by the Views.
21
-
22
- This package makes use of Lit's reactive properties to perform the data-binding between the View and the ViewModel.
19
+ To achieve this, the package makes use of Lit's reactive properties to perform the data-binding between the View and the ViewModel.
23
20
  On the other end, the ViewModel makes use of `cell-proxy` to communicate with the Model.
24
- `lit-context` is used to pass around the ViewModels to all the different `LitElements`.
21
+ `@lit-labs/context` is used to pass around the ViewModels to all the different `LitElements`.
22
+ This means that ViewModels are bound to a `ReactiveElement`.
25
23
 
26
- The host Element, that holds the `ConductorAppProxy` is the main provider of those contexts.
24
+ The host `ReactiveElement` that holds the `ConductorAppProxy` **should** also hold the ViewModels and thus be the provider of those contexts.
27
25
 
28
26
 
29
27
  ### Perspective
30
28
 
31
- A `Perspective` is the set of data that a ViewModel presents to its client Views.
32
- This name makes is clear that the App never pretends to have a full picture of the data available on the DHT.
29
+ A `Perspective` is the data set that a ViewModel presents to its client Views.
30
+ This name makes is clear that the data provided is always a slice of all the data available on the DHT.
31
+ This is to reflect that in holochain "no node can pretend to have the full truth at any moment".
33
32
  The exact shape of a perspective is dependent on the ViewModel implementation for a DNA or Zome.
34
33
 
35
- ## API
36
34
 
37
- On one side, the API defines a `ViewModel` abstract base class and abstract implementations for Zomes and Dnas.
38
- On the other, it provides `LitElement` abstract subclasses that make uses of `ViewModel` for Zomes, Dnas and Happs.
39
- Finaly it provides two useful `LitElement`:
40
- - `cell-context`: Provide the installed cell context to its children.
41
- - `entry-defs-select`: A selector for picking an entryDef in the current cell.
35
+ # API
36
+
37
+ On one side, the API defines the `ViewModel` abstract base class and abstract implementations for Zomes and Dnas.
38
+ On the other, it provides `LitElement` abstract subclasses that make uses of `ViewModel` for Zomes, Dnas and Happs. These `LitElement` subclasses are provided for faster development but are not mandatory for using `ViewModels`.
39
+
40
+ The package also provides these finalized `LitElements`:
41
+ - `entry-defs-select`: A selector for picking an `EntryDef` from all the available ones in the current cell.
42
+ - `cell-context`: Provide the `InstalledCell` context to its children.
43
+ - `view-cell-context`: Display the `InstalledCell` received from context (used for debugging)
44
+
45
+
46
+ ## ViewModels
47
+
48
+ ### ViewModel abstract base class
49
+
50
+ The `ViewModel` abstract base class implements the Observer design pattern:
51
+
52
+ ```typescript
53
+ subscribe(providedHost: ReactiveControllerHost, propName: PropertyKey): void;
54
+ unsubscribe(candidat: ReactiveControllerHost): void;
55
+ protected notifySubscribers(): void;
56
+ ```
57
+
58
+ Observers are `ReactiveControllerHost` who must provide the name of one of their reactive properties.
59
+ The property will be automatically updated by the `ViewModel` when its private method `notifySubscribers()` is called.
60
+
61
+ **Subclasses are responsible for calling `this.notifySubscribers()` when their perspective has been updated.**
62
+
63
+ The `ViewModel` is retrievable via Context using the `ContextKey` defined by its private method `getContext()`.
64
+
65
+
66
+ ### ZomeViewModel (zvm)
42
67
 
43
- ### ViewModel Definition
68
+ An abstract subclass of `ViewModel` designed to be inhereted for a Zome.
69
+ It is in relation with the `ZomeProxy` subclass for the same Zome.
70
+ This relation is set in the `ZOME_PROXY` static field.
44
71
 
45
- A Happ
72
+ On construction, the zvm will be bound to a cell and will create a ZomeProxy of the type defined by `ZOME_PROXY`.
46
73
 
47
- ### HappViewModel
74
+ The ZomeProxy's `DEFAULT_ZOME_NAME` will be used to define the Context for which we can find this ViewModel in order to avoid collisions in ZomeViewModel contexts, when you have multiple zomes in a DNA.
75
+ The cell's dnaHash is also used to avoid collisions in ZomeViewModel contexts when multiple DNAs use the same zome.
48
76
 
49
- Although not actually a subclass of `ViewModel` and thus does not hold a `perspective`, the `HappViewModel`represents the ViewModel of a happ.
50
- A `HappViewModel` is the aggregate of all the `DnaViewModel`s used by the happ.
51
- A `ReactiveElement` holding a `HappViewModel` must explicity subscribe to the `DnaViewModel`s it wants to receive updates from.
52
- It creates and stores all the DnaViewModels from the happ definition.
77
+ A zvm is free to define the type of its perspective.
53
78
 
54
- A Happ definition is roughly a translation of the AppManifest, but it associates each role to a DnaViewModel. Example:
79
+ All subclasses of `ZomeViewModel` **must** implement the following methods:
80
+ ```typescript
81
+ get perspective(): any;
82
+ protected hasChanged(): boolean; // return true when the perspective has been updated. This will update the reactive properties of its observers.
83
+ get zomeProxy(): ZomeProxy; // should return its zomeProxy in its concrete type.
84
+ ```
85
+
86
+
87
+ All subclasses of `ZomeViewModel` **can** implement the following methods:
88
+ ```typescript
89
+ async probeAll(): Promise<void>; // Lets an observer trigger probing in the DHT in order to get an updated perspective
90
+ async initialProbe(): Promise<void>; // Define the probing to do at startup (should get data on source-chain only)
91
+ ```
92
+
93
+ ### DnaViewModel (dvm)
94
+
95
+ An abstract subclass of `ViewModel` designed to be inhereted for a DNA.
96
+ On construction, the dvm will be bound to a cell and create a zvm for each of its zome.
97
+ To make this possible a dvm **must** define the static field `ZVM_DEFS`, which is the list of its zvms.
98
+ To construct a dvm, a roleName must be provided. It will use the one define in its statif field `DEFAULT_BASE_ROLE_NAME` if none is provided as constructor argument.
99
+
100
+ A `ReactiveElement` holding a `DnaViewModel` must explicity subscribe to a dvm's zvm if it wants to be updated when the zvm's perspective changed. Otherwise, it will only receive updates from changes in the dvm's perspective. The dvm's perspective is **not** an agregate of its zvms perspectives.
101
+ The intent of the dvm is to provide data that is more than the sum of its zvms perspective.
102
+
103
+ The dvm's roleName is used to define the Context for which we can find this ViewModel.
104
+
105
+ The `DNA_MODIFIERS` static field can be set to define Role-specific dvms.
106
+
107
+ The zvm of one of its zomes can be retrieved by calling:
108
+ `getZomeViewModel(zomeName)`
109
+
110
+ A dvm is free to define the type of its perspective.
111
+
112
+ All subclasses of `DnaViewModel` **must** implement the following methods:
113
+ ```typescript
114
+ get perspective(): any;
115
+ protected hasChanged(): boolean; // return true when the perspective has been updated. This will update the reactive properties of its observers.
116
+ ```
117
+
118
+ All subclasses of `DnaViewModel` **can** implement the following members:
119
+ ```typescript
120
+ signalHandler?: AppSignalCb; // The handler called when a signal for this cell is received
121
+ ```
122
+
123
+ `probeAll()` and `initialProbe()` do not need to be overriden since by default they will call the respective method on all its zvms.
124
+
125
+
126
+ ### HappViewModel (hvm)
127
+
128
+ The `HappViewModel`represents the ViewModel of a happ, but is not actually a subclass of `ViewModel` and thus does not hold a
129
+ `perspective`.
130
+ The intent of a `HappViewModel` is to create and store all the `DnaViewModels` for a happ, in an aggregate way.
131
+
132
+ A `ReactiveElement` holding a `HappViewModel` must explicity subscribe to the `DnaViewModels` it wants to receive updates from.
133
+
134
+ A hvm requires a `HvmDef` to be constructed.
135
+ A `HvmDef` is a rough translation of an AppManifest, but it associates each role to a `DnaViewModel`. Example:
55
136
  ```typescript
56
137
  const playgroundDef: HvmDef = {
57
138
  id: "playground-app",
@@ -68,7 +149,84 @@ const playgroundDef: HvmDef = {
68
149
  }
69
150
  ```
70
151
 
71
- ## Example use
152
+ On construction, the hvm will use the provided `ConductorAppProxy` and create a dvm for each one defined in the `HvmDef`, and bind them to the provided `ReactiveElement`.
153
+ It will store the `HvmDef` so as to be able to create clones when requested.
154
+
155
+ `HappViewModel` provides an API for retrieving dvms:
156
+ ```typescript
157
+ getDvm(hclOrId: HCL | RoleInstanceId): DnaViewModel | undefined;
158
+ getClones(baseRoleName: BaseRoleName): DnaViewModel[];
159
+ getCellDvms(cellId: CellId): Dictionary<DnaViewModel> | undefined;
160
+ ```
161
+
162
+
163
+ `HappViewModel` provides an API for creating dvms for clones: `async cloneDvm(baseRoleName: BaseRoleName, cellDef?: CellDef)`
164
+
165
+ ```typescript
166
+ interface CellDef {
167
+ modifiers: DnaModifiersOptions,
168
+ membraneProof?: MembraneProof,
169
+ cloneName?: string,
170
+ }
171
+ ```
172
+
173
+ As with `DnaViewModel`, `probeAll()` and `initialProbe()` are implemented and will call the respective method on all its dvms.
174
+
175
+
176
+
177
+
178
+ ### Views
179
+
180
+ The following abstract base classes are provided for easily building Views for your own zomes and DNAs.
181
+
182
+ ### ZomeElement
183
+
184
+ A `ZomeElement` is an abstract subclass of a `LitElement` bound to a concrete `ZomeViewModel` and its perspective type.
185
+
186
+ it has a reactive property holding an `installedCell`, and a reactive property for its zvm's perspective: `this.perspective`.
187
+ The zvm itself is stored in the `this._zvm` field.
188
+
189
+ On first update, it will request the zvm for its cell from context.
190
+ The element will not render as long as it hasn't found a zvm from context.
191
+
192
+ If the installedCell property changes value, it will automatically fetch the zvm for this new cell.
193
+ When this happens `zvmUpdated()` is called, meaning subclasses can override this method if they want init and deinit things based on the zvm.
194
+
195
+ With this implementation, in your subclass you can directly use the zvm's perspective within `render()`.
196
+
197
+
198
+ ### DnaElement
199
+
200
+ A `DnaElement` is an abstract subclass of a `LitElement` bound to a concrete `DnaViewModel` and its perspective type.
201
+
202
+ it has reactive property holding an `installedCell`, and a reactive property for its dvm's perspective: `this.perspective`.
203
+ the dvm itself is stored in the `_dvm` field.
204
+
205
+ On first update, it will request the dvm for its cell from context.
206
+ The element will not render as long as it hasn't found a dvm from context.
207
+
208
+ If the installedCell property changes value, it will automatically fetch the dvm for this new cell.
209
+ When this happens `dvmUpdated()` is called, meaning subclasses can override this method if they want init and deinit things based on the dvm.
210
+
211
+ With this implementation, in your subclass you can directly use the dvm's perspective within `render()`.
212
+
213
+
214
+ ### HappElement
215
+
216
+ A `HappElement` is an abstract subclass of a `LitElement` bound to a `HvmDef` defined in the static field `HVM_DEF`.
217
+ It creates and holds a `ConductorAppProxy` and `HappViewModel` based on `HVM_DEF`.
218
+
219
+ On construction, it will create the `ConductorAppProxy` and `HappViewModel` based on its static
220
+
221
+ It will only render once the hvm has been built.
222
+ Once the hvm is built, it will call `this.happInitialized()`, meaning a subclass can override this method and do whatever it needs to do at startup with the hvm.
223
+
224
+ Subclasses are encourage to define getters for directly accessing the happ's dvms.
225
+ Example:
226
+ `get profilesDvm(): ProfilesDvm { return this.hvm.getDvm(ProfilesDvm.DEFAULT_BASE_ROLE_NAME)! as ProfilesDvm }`
227
+
228
+
229
+ ## Example
72
230
 
73
231
  Define reactive property for the ViewModels in the LitElement:
74
232
  ```typescript
@@ -103,9 +261,11 @@ render() {
103
261
 
104
262
  ## Implementation
105
263
 
106
- To make full use of the framework, a DNA developer must implement:
107
- - A `ZomeProxy` subclass for each of their zome (and input&output type bindings from Rust).
108
- - A `ZomeViewModel` subclass for each of their zome, and its respective perspective type
264
+ To make full use of the framework, a DNA developer should implement:
265
+ - A `ZomeProxy` subclass for each of their zome (and input & output type bindings from Rust).
266
+ - A `ZomeViewModel` subclass for each of their zome, and its respective perspective type.
109
267
  - A `DnaViewModel` subclass for their DNA and its respective perspective type.
110
268
 
111
269
  A developer could also provide abstract subclasses to `ZomeElement` and `DnaElement` which add specific code for using their DNA.
270
+
271
+ An example implementation of all the subclasses is available in the github repo under `/example`.
@@ -1,10 +1,10 @@
1
- import { LitElement } from "lit";
1
+ import { LitElement, PropertyValues } from "lit";
2
2
  import { DnaViewModel } from "./DnaViewModel";
3
3
  import { CellId, InstalledCell } from "@holochain/client";
4
4
  import { AgentPubKeyB64, EntryHashB64 } from "@holochain-open-dev/core-types";
5
5
  import { BaseRoleName, IInstalledCell, RoleInstanceId } from "@ddd-qc/cell-proxy";
6
6
  declare const DnaElement_base: (abstract new (...args: any[]) => {
7
- baseRoleName: string;
7
+ baseRoleName: string; /** Provided by Context depending on BaseRoleName */
8
8
  }) & {
9
9
  readonly DEFAULT_BASE_ROLE_NAME: string;
10
10
  } & typeof LitElement & import("@open-wc/dedupe-mixin").Constructor<import("@open-wc/scoped-elements/types/src/types").ScopedElementsHost>;
@@ -16,9 +16,9 @@ export declare class DnaElement<P, DVM extends DnaViewModel> extends DnaElement_
16
16
  constructor(baseRoleName?: BaseRoleName);
17
17
  /** Provided by Context depending on BaseRoleName */
18
18
  protected _dvm: DVM;
19
+ installedCell: InstalledCell;
19
20
  perspective: P;
20
21
  /** InstalledCell interface */
21
- get installedCell(): InstalledCell;
22
22
  get roleInstanceId(): RoleInstanceId;
23
23
  get cellId(): CellId;
24
24
  get dnaHash(): EntryHashB64;
@@ -28,5 +28,7 @@ export declare class DnaElement<P, DVM extends DnaViewModel> extends DnaElement_
28
28
  protected requestDvm(): void;
29
29
  /** */
30
30
  shouldUpdate(): boolean;
31
+ /** */
32
+ protected willUpdate(changedProperties: PropertyValues<this>): void;
31
33
  }
32
34
  export {};
@@ -2,8 +2,9 @@ import { __decorate } from "tslib";
2
2
  import { ScopedElementsMixin } from "@open-wc/scoped-elements";
3
3
  import { LitElement } from "lit";
4
4
  import { property, state } from "lit/decorators.js";
5
- import { ContextConsumer, createContext } from "@lit-labs/context";
5
+ import { ContextConsumer, contextProvided, createContext } from "@lit-labs/context";
6
6
  import { RoleSpecificMixin } from "@ddd-qc/cell-proxy";
7
+ import { cellContext } from "./elements/cell-context";
7
8
  /**
8
9
  * A LitElement that is bound to a specific DnaViewModel, e.g. a View for the ViewModel
9
10
  */
@@ -17,8 +18,8 @@ export class DnaElement extends RoleSpecificMixin(ScopedElementsMixin(LitElement
17
18
  }
18
19
  }
19
20
  /** InstalledCell interface */
20
- get installedCell() { return this._dvm.installedCell; }
21
- get roleInstanceId() { return this._dvm.roleInstanceId; } // Already defined in RoleSpecificMixin
21
+ //get installedCell(): InstalledCell {return this._dvm.installedCell}
22
+ get roleInstanceId() { return this._dvm.roleInstanceId; }
22
23
  get cellId() { return this._dvm.cellId; }
23
24
  get dnaHash() { return this._dvm.dnaHash; }
24
25
  get agentPubKey() { return this._dvm.agentPubKey; }
@@ -26,9 +27,13 @@ export class DnaElement extends RoleSpecificMixin(ScopedElementsMixin(LitElement
26
27
  /** */
27
28
  requestDvm() {
28
29
  /** Consume Context based on given dnaHash */
29
- const contextType = createContext('dvm/' + this.baseRoleName);
30
+ const roleInstanceId = this.installedCell ? this.installedCell.role_id : this.baseRoleName;
31
+ const contextType = createContext('dvm/' + roleInstanceId);
30
32
  console.log(`\t\tRequesting context "${contextType}"`);
31
33
  /*const consumer =*/ new ContextConsumer(this, contextType, (value, dispose) => {
34
+ if (this._dvm) {
35
+ this._dvm.unsubscribe(this);
36
+ }
32
37
  this._dvm = value;
33
38
  this._dvm.subscribe(this, 'perspective');
34
39
  }, false);
@@ -38,10 +43,20 @@ export class DnaElement extends RoleSpecificMixin(ScopedElementsMixin(LitElement
38
43
  shouldUpdate() {
39
44
  return !!this._dvm;
40
45
  }
46
+ /** */
47
+ willUpdate(changedProperties) {
48
+ if (changedProperties.has("installedCell")) {
49
+ this.requestDvm();
50
+ }
51
+ }
41
52
  }
42
53
  __decorate([
43
54
  state()
44
55
  ], DnaElement.prototype, "_dvm", void 0);
56
+ __decorate([
57
+ contextProvided({ context: cellContext, subscribe: true }),
58
+ property({ type: Object })
59
+ ], DnaElement.prototype, "installedCell", void 0);
45
60
  __decorate([
46
61
  property({ type: Object, attribute: false, hasChanged: (_v, _old) => true })
47
62
  ], DnaElement.prototype, "perspective", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"DnaElement.js","sourceRoot":"","sources":["../src/DnaElement.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,mBAAmB,EAAC,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAC,UAAU,EAAC,MAAM,KAAK,CAAC;AAC/B,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,eAAe,EAAE,aAAa,EAAC,MAAM,mBAAmB,CAAC;A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,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAC,CAAC;+CAC3D"}
@@ -59,7 +59,7 @@ export class DnaViewModel extends RoleSpecificMixin(ViewModel) {
59
59
  zvm.provideContext(host);
60
60
  }
61
61
  }
62
- getContext() { return createContext('dvm/' + this.baseRoleName); }
62
+ getContext() { return createContext('dvm/' + this.roleInstanceId); }
63
63
  ;
64
64
  /** */
65
65
  async probeAll() {
@@ -1 +1 @@
1
- {"version":3,"file":"DnaViewModel.js","sourceRoot":"","sources":["../src/DnaViewModel.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAGtC,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAGL,iBAAiB,EAEjB,GAAG,GAIJ,MAAM,oBAAoB,CAAC;AAmB5B;;;;;GAKG;AACH,MAAM,OAAgB,YAAa,SAAQ,iBAAiB,CAAC,SAAS,CAAC;IAQrE,WAAW;IACX,YAAY,IAAqB,EAAE,iBAAoC,EAAE,OAA6B;QACpG,KAAK,EAAE,CAAC;QA6BA,oBAAe,GAA8B,EAAE,CAAC;QAC1D,6BAA6B;QACnB,eAAU,GAAyB,EAAE,CAAC;QACxC,kBAAa,GAAoC,EAAE,CAAC;QA/B1D,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;YAC/B,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;YACzC,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC;SACpB;aAAM;YACL,IAAI,CAAC,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,YAA8B,CAAC,CAAC;SAClE;QACD,MAAM,OAAO,GAAI,IAAI,CAAC,WAAmC,CAAA;QACzD,MAAM,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC;QACjC,IAAI,CAAC,UAAU,GAAG,iBAAi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AG,EAAE,CAAC;aACnC;SACF;QACD,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAID,MAAM;IACN,QAAQ,CAAC,QAAmB;QAC1B,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACnC,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC;IAChC,CAAC;CACF"}
@@ -24,9 +24,9 @@ export declare class ZomeElement<P, ZVM extends ZomeViewModel> extends ZomeEleme
24
24
  /** -- Methods -- */
25
25
  /** Request zvm from Context based on current CellId */
26
26
  private requestZvm;
27
- /** */
28
- protected willUpdate(changedProperties: PropertyValues<this>): void;
29
27
  /** RequestZvm on first "shouldUpdate" */
30
28
  shouldUpdate(): boolean;
29
+ /** */
30
+ protected willUpdate(changedProperties: PropertyValues<this>): void;
31
31
  }
32
32
  export {};
@@ -41,14 +41,6 @@ export class ZomeElement extends ScopedElementsMixin(LitElement) {
41
41
  this._zvm.subscribe(this, 'perspective');
42
42
  }, false);
43
43
  }
44
- /** */
45
- willUpdate(changedProperties) {
46
- //console.log("ZomeElement.willUpdate()", changedProperties)
47
- if (changedProperties.has("installedCell")) {
48
- console.log("ZomeElement.willUpdate() installedCell in this element", this);
49
- this.requestZvm();
50
- }
51
- }
52
44
  /** RequestZvm on first "shouldUpdate" */
53
45
  shouldUpdate() {
54
46
  //console.log("ZomeElement.shouldUpdate() start", !!this._zvm, this.installedCell);
@@ -57,6 +49,14 @@ export class ZomeElement extends ScopedElementsMixin(LitElement) {
57
49
  }
58
50
  return !!this._zvm;
59
51
  }
52
+ /** */
53
+ willUpdate(changedProperties) {
54
+ //console.log("ZomeElement.willUpdate()", changedProperties)
55
+ if (changedProperties.has("installedCell")) {
56
+ //console.log("ZomeElement.willUpdate() installedCell in this element", this)
57
+ this.requestZvm();
58
+ }
59
+ }
60
60
  }
61
61
  __decorate([
62
62
  contextProvided({ context: cellContext, subscribe: true }),
@@ -1 +1 @@
1
- {"version":3,"file":"Zom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CAAC;CAEF;AA9DC;IAFC,eAAe,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAC,CAAC;IACzD,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;kDACK;AAMrB;IAAR,KAAK,EAAE;yCAAsB;AAG9B;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAC,CAAC;gDAC3D"}
@@ -0,0 +1,12 @@
1
+ import { LitElement } from "lit";
2
+ import { InstalledCell } from "@holochain/client";
3
+ declare const ViewCellContext_base: typeof LitElement & import("@open-wc/dedupe-mixin").Constructor<import("@open-wc/scoped-elements/types/src/types").ScopedElementsHost>;
4
+ /**
5
+ * LitElement that shows the cellContext as a <div>
6
+ * Used for debugging
7
+ */
8
+ export declare class ViewCellContext extends ViewCellContext_base {
9
+ installedCell: InstalledCell;
10
+ render(): import("lit-html").TemplateResult<1>;
11
+ }
12
+ export {};
@@ -0,0 +1,25 @@
1
+ import { __decorate } from "tslib";
2
+ import { ScopedElementsMixin } from "@open-wc/scoped-elements";
3
+ import { LitElement, html } from "lit";
4
+ import { property } from "lit/decorators.js";
5
+ import { contextProvided } from "@lit-labs/context";
6
+ import { cellContext } from "./cell-context";
7
+ /**
8
+ * LitElement that shows the cellContext as a <div>
9
+ * Used for debugging
10
+ */
11
+ export class ViewCellContext extends ScopedElementsMixin(LitElement) {
12
+ render() {
13
+ const roleId = this.installedCell === undefined ? "undefined" : this.installedCell.role_id;
14
+ return html `
15
+ <div>
16
+ <span><b>(InstalledCell set to: "${roleId}")</b></span>
17
+ </div>
18
+ `;
19
+ }
20
+ }
21
+ __decorate([
22
+ contextProvided({ context: cellContext, subscribe: true }),
23
+ property({ type: Object })
24
+ ], ViewCellContext.prototype, "installedCell", void 0);
25
+ //# sourceMappingURL=view-cell-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"view-cell-context.js","sourceRoot":"","sources":["../../src/elements/view-cell-context.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,mBAAmB,EAAC,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAC,UAAU,EAAE,IAAI,EAAC,MAAM,KAAK,CAAC;AACrC,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAE3C;;;GAGG;AACH,MAAM,OAAO,eAAgB,SAAQ,mBAAmB,CAAC,UAAU,CAAC;IAMlE,MAAM;QACJ,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,KAAK,SAAS,CAAA,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC;QAC1F,OAAO,IAAI,CAAA;;2CAE4B,MAAM;;KAE5C,CAAC;IACJ,CAAC;CACF;AAVC;IAFC,eAAe,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAC,CAAC;IACzD,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;sDACK"}
package/dist/index.d.ts CHANGED
@@ -8,4 +8,5 @@ export * from "./HappElement";
8
8
  export * from "./definitions";
9
9
  export * from "./elements/entry-def-select";
10
10
  export * from "./elements/cell-context";
11
+ export * from "./elements/view-cell-context";
11
12
  export * from "@ddd-qc/cell-proxy";
package/dist/index.js CHANGED
@@ -8,6 +8,7 @@ export * from "./HappElement";
8
8
  export * from "./definitions";
9
9
  export * from "./elements/entry-def-select";
10
10
  export * from "./elements/cell-context";
11
+ export * from "./elements/view-cell-context";
11
12
  /* Include all from cell-proxy */
12
13
  export * from "@ddd-qc/cell-proxy";
13
14
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAE9B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AAExC,iCAAiC;AACjC,cAAc,oBAAoB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAE9B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAE7C,iCAAiC;AACjC,cAAc,oBAAoB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ddd-qc/lit-happ",
3
- "version": "0.9.3",
3
+ "version": "0.9.5",
4
4
  "description": "MVVM Framework for holochain apps using Lit",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",