@blockquote-web-components/blockquote-controller-context-meta 1.3.3 → 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 | Privacy | Type | Default | Description | Inherited From |
107
- | ---------------------- | ------- | ---- | --------------------------------------------------------------------------------------------- | ----------- | -------------- |
108
- | `value` | | | | | |
109
- | `context` | | | | | |
110
- | `initialValue` | | | `initialValue` | | |
111
- | `callback` | | | `callback` | | |
112
- | `host` | | | `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.3",
3
+ "version": "1.4.0",
4
4
  "description": "Webcomponent blockquote-controller-context-meta following open-wc recommendations",
5
5
  "keywords": [
6
6
  "lit",
@@ -122,11 +122,11 @@
122
122
  },
123
123
  "devDependencies": {
124
124
  "@blockquote-web-components/blockquote-base-common-dev-dependencies": "^1.11.4",
125
- "@blockquote-web-components/blockquote-base-embedded-webview": "^1.12.11"
125
+ "@blockquote-web-components/blockquote-base-embedded-webview": "^1.13.0"
126
126
  },
127
127
  "publishConfig": {
128
128
  "access": "public"
129
129
  },
130
130
  "customElements": "custom-elements.json",
131
- "gitHead": "840a3ed593c02e0d18186fad73692530f48e2288"
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
- this._contextMetaProvider = new ContextProvider(this.host, {
119
- context: this.context,
120
- initialValue: this.initialValue,
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
  }