@blockquote-web-components/blockquote-controller-context-meta 1.3.4 → 1.4.0
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
|
@@ -103,14 +103,13 @@ customElements.define('consumer-el', ConsumerEl);
|
|
|
103
103
|
|
|
104
104
|
##### Fields
|
|
105
105
|
|
|
106
|
-
| Name
|
|
107
|
-
|
|
|
108
|
-
| `value`
|
|
109
|
-
| `context`
|
|
110
|
-
| `initialValue`
|
|
111
|
-
| `callback`
|
|
112
|
-
| `host`
|
|
113
|
-
| `_contextMetaProvider` | | | `new ContextProvider(this.host, { context: this.context, initialValue: this.initialValue, })` | | |
|
|
106
|
+
| Name | Privacy | Type | Default | Description | Inherited From |
|
|
107
|
+
| -------------- | ------- | ---- | -------------- | ----------- | -------------- |
|
|
108
|
+
| `value` | | | | | |
|
|
109
|
+
| `context` | | | | | |
|
|
110
|
+
| `initialValue` | | | `initialValue` | | |
|
|
111
|
+
| `callback` | | | `callback` | | |
|
|
112
|
+
| `host` | | | `host` | | |
|
|
114
113
|
|
|
115
114
|
##### Methods
|
|
116
115
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blockquote-web-components/blockquote-controller-context-meta",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Webcomponent blockquote-controller-context-meta following open-wc recommendations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lit",
|
|
@@ -128,5 +128,5 @@
|
|
|
128
128
|
"access": "public"
|
|
129
129
|
},
|
|
130
130
|
"customElements": "custom-elements.json",
|
|
131
|
-
"gitHead": "
|
|
131
|
+
"gitHead": "e1316ceca60c2a20630c925a79e5215df6942dcc"
|
|
132
132
|
}
|
|
@@ -108,17 +108,20 @@ class ContextMeta {
|
|
|
108
108
|
* initialValue?: import('@lit/context').ContextType<*>,
|
|
109
109
|
* callback?: (value: import('@lit/context').ContextType<*>, dispose?: () => void) => void
|
|
110
110
|
* }} arg - The arguments for the constructor.
|
|
111
|
+
* @param {boolean} isConsumerOnly - If true, the controller will only be a consumer. Default is false.
|
|
111
112
|
*/
|
|
112
|
-
constructor(host, {context = contextMetaSymbol, initialValue, callback}) {
|
|
113
|
+
constructor(host, {context = contextMetaSymbol, initialValue, callback}, isConsumerOnly = false) {
|
|
113
114
|
this.context = createContext(context);
|
|
114
115
|
this.initialValue = initialValue;
|
|
115
116
|
this.callback = callback;
|
|
116
117
|
this.host = host;
|
|
117
118
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
if (!isConsumerOnly) {
|
|
120
|
+
this._contextMetaProvider = new ContextProvider(this.host, {
|
|
121
|
+
context: this.context,
|
|
122
|
+
initialValue: this.initialValue,
|
|
123
|
+
});
|
|
124
|
+
}
|
|
122
125
|
|
|
123
126
|
this.host.addController?.(this);
|
|
124
127
|
}
|