@webtides/element-js 1.0.0 → 1.1.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.
Files changed (41) hide show
  1. package/CHANGELOG.md +140 -90
  2. package/README.md +3 -3
  3. package/docs/README.md +70 -89
  4. package/docs/concepts/classes.md +37 -66
  5. package/docs/concepts/hierarchy.md +29 -31
  6. package/docs/concepts/lifecycle.md +9 -23
  7. package/docs/concepts/reactivity.md +1 -3
  8. package/docs/features/computed-properties.md +13 -16
  9. package/docs/features/dependency-injection-context-protocol.md +75 -87
  10. package/docs/features/global-styles.md +1 -1
  11. package/docs/features/methods.md +14 -15
  12. package/docs/features/properties.md +21 -33
  13. package/docs/features/refs.md +23 -31
  14. package/docs/features/renderless.md +31 -37
  15. package/docs/features/store.md +63 -78
  16. package/docs/features/templates.md +4 -1
  17. package/docs/features/watch.md +28 -35
  18. package/docs/getting-started/upgrade-to-v1.md +16 -0
  19. package/docs/guide/guide.md +10 -22
  20. package/index.js +29 -2
  21. package/package.json +62 -62
  22. package/src/BaseElement.js +631 -631
  23. package/src/StyledElement.js +104 -104
  24. package/src/TemplateElement.js +53 -53
  25. package/src/dom-parts/AttributePart.js +116 -116
  26. package/src/dom-parts/ChildNodePart.js +288 -288
  27. package/src/dom-parts/NodePart.js +27 -27
  28. package/src/dom-parts/Part.js +6 -6
  29. package/src/dom-parts/TemplatePart.js +119 -119
  30. package/src/dom-parts/TemplateResult.js +270 -270
  31. package/src/dom-parts/directives.js +105 -48
  32. package/src/dom-parts/html.js +1 -1
  33. package/src/dom-parts/render.js +6 -6
  34. package/src/util/AttributeParser.js +47 -47
  35. package/src/util/DOMHelper.js +190 -190
  36. package/src/util/Directive.js +31 -31
  37. package/src/util/GlobalStylesStore.js +56 -53
  38. package/src/util/SerializeStateHelper.js +56 -56
  39. package/src/util/Store.js +174 -174
  40. package/src/util/defineElement.js +5 -5
  41. package/src/util/toString.js +5 -5
package/CHANGELOG.md CHANGED
@@ -2,7 +2,8 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
- The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
5
+ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres
6
+ to [Semantic Versioning](http://semver.org/).
6
7
 
7
8
  <!--
8
9
  PRs should document their user-visible changes (if any) in the
@@ -15,305 +16,354 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
15
16
  <!-- ### Removed -->
16
17
  <!-- ### Fixed -->
17
18
 
19
+ ## [1.1.0] - 2024-06-24
20
+
21
+ ### Added
22
+
23
+ - Added `optionalAttribute` directive to conditionally render attributes (plus value)
24
+
25
+ ### FIXED
26
+
27
+ - Fixed `spreadAttributes` to not render "null|undefined|NaN" to the attributes value but removing the entire attribute
28
+ when such values are passed.
29
+
18
30
  ## [1.0.0] - 2024-05-24
19
31
 
20
32
  ### Added
21
33
 
22
- - Added our own versions of directives and template helpers ([#67](https://github.com/webtides/element-js/pull/67))
23
- - Added JSDocs for everything in the codebase. This will especially be helpful when using constructor options.
24
- - Added state serialization. This improves hydration from SSR a lot. ([#106](https://github.com/webtides/element-js/pull/106))
25
- - added declarative shadow dom rendering for template elements
34
+ - Added our own versions of directives and template helpers ([#67](https://github.com/webtides/element-js/pull/67))
35
+ - Added JSDocs for everything in the codebase. This will especially be helpful when using constructor options.
36
+ - Added state serialization. This improves hydration from SSR a
37
+ lot. ([#106](https://github.com/webtides/element-js/pull/106))
38
+ - added declarative shadow dom rendering for template elements
26
39
 
27
40
  ### Changed
28
41
 
29
- - _BRAKING_ Uses a new custom renderer for the `TemplateElement`. It replaces the old `lit-html` renderer. The API and usage should be exactly the same. The only thing to do/change is the use of the old `lit-html` directives. For detailed instructions see the upgrade guide. ([#67](https://github.com/webtides/element-js/pull/67))
30
- - _BREAKING_ `element-js` will now also trigger the `afterUpdate` hook right after the `connected` hook. This is to reduce the cases where you had to do the same things in `connected` and `afterUpdate`. You can now remove those duplicate calls from the `connected` hook. ([#60](https://github.com/webtides/element-js/pull/60))
31
- - _BREAKING_ Changed `package.json` type to `module`. This should hopefully not break anything. `element-js` is either used directly from the browser or through a bundler. In both cases the added type: module should not matter. ([#64](https://github.com/webtides/element-js/pull/64))
32
- - _BRAKING_ Changed the default options when using the `dispatch` helper function. `bubbles`, `cancelable` and `composed` will now be `true` by default.
33
- - _BRAKING_ Changed adopting global styles to include ALL global styles. Previously only one inline <style> with the ID of '#globalStyles' would be adopted. For more information see the docs.
42
+ - _BREAKING_ Uses a new custom renderer for the `TemplateElement`. It replaces the old `lit-html` renderer. The API and
43
+ usage should be exactly the same. The only thing to do/change is the use of the old `lit-html` directives. For
44
+ detailed instructions see the upgrade guide. ([#67](https://github.com/webtides/element-js/pull/67))
45
+ - _BREAKING_ `element-js` will now also trigger the `afterUpdate` hook right after the `connected` hook. This is to
46
+ reduce the cases where you had to do the same things in `connected` and `afterUpdate`. You can now remove those
47
+ duplicate calls from the `connected` hook. ([#60](https://github.com/webtides/element-js/pull/60))
48
+ - _BREAKING_ Changed `package.json` type to `module`. This should hopefully not break anything. `element-js` is either
49
+ used directly from the browser or through a bundler. In both cases the added type: module should not
50
+ matter. ([#64](https://github.com/webtides/element-js/pull/64))
51
+ - _BRAKING_ Changed the default options when using the `dispatch` helper function. `bubbles`, `cancelable`
52
+ and `composed` will now be `true` by default.
53
+ - _BRAKING_ Changed adopting global styles to include ALL global styles. Previously only one inline <style> with the ID
54
+ of '#globalStyles' would be adopted. For more information see the docs.
34
55
 
35
56
  ### Removed
36
57
 
37
- - _BREAKING_ Removed the `lit-html` dependency. `element-js` is now officially dependency free! ([#67](https://github.com/webtides/element-js/pull/67))
38
- - _BREAKING_ Removed the deprecated `BaseElement` constructor option `childListUpdate`. Please use the "mutationObserverOptions" dictionary instead. See the docs for more info. ([#99](https://github.com/webtides/element-js/pull/99))
39
- - _BREAKING_ Removed the `hooks` map in the `BaseElement`. Using the hooks() map for lifecycle hooks is deprecated! Please overwrite the existing lifecycle hook functions. See the docs for more info. ([#99](https://github.com/webtides/element-js/pull/99))
40
- - _BREAKING_ Removed the `computed` map in the `BaseElement`. Using the computed() map for computed properties is deprecated! Please use regular JS getters and return the computed value. See the docs for more info. ([#99](https://github.com/webtides/element-js/pull/99))
41
- - _BREAKING_ Removed all occurrences of `ShadyCSS` in `StyledElement`. ([#99](https://github.com/webtides/element-js/pull/99))
42
- - _BRAKING_ Removed the `i18n` helper function. See CHANGELOG how to implement it yourself or use a third party library.
58
+ - _BREAKING_ Removed the `lit-html` dependency. `element-js` is now officially dependency
59
+ free! ([#67](https://github.com/webtides/element-js/pull/67))
60
+ - _BREAKING_ Removed the deprecated `BaseElement` constructor option `childListUpdate`. Please use the "
61
+ mutationObserverOptions" dictionary instead. See the docs for more
62
+ info. ([#99](https://github.com/webtides/element-js/pull/99))
63
+ - _BREAKING_ Removed the `hooks` map in the `BaseElement`. Using the hooks() map for lifecycle hooks is deprecated!
64
+ Please overwrite the existing lifecycle hook functions. See the docs for more
65
+ info. ([#99](https://github.com/webtides/element-js/pull/99))
66
+ - _BREAKING_ Removed the `computed` map in the `BaseElement`. Using the computed() map for computed properties is
67
+ deprecated! Please use regular JS getters and return the computed value. See the docs for more
68
+ info. ([#99](https://github.com/webtides/element-js/pull/99))
69
+ - _BREAKING_ Removed all occurrences of `ShadyCSS`
70
+ in `StyledElement`. ([#99](https://github.com/webtides/element-js/pull/99))
71
+ - _BRAKING_ Removed the `i18n` helper function. See CHANGELOG how to implement it yourself or use a third party library.
43
72
 
44
73
  ## [1.0.0-alpha.13] - 2024-05-08
45
74
 
46
75
  ### Fixed
47
76
 
48
- - catch security errors when `GlobalStylesStore` tries to read css rules from cross-origin stylesheets.
77
+ - catch security errors when `GlobalStylesStore` tries to read css rules from cross-origin stylesheets.
49
78
 
50
79
  ## [1.0.0-alpha.12] - 2024-03-03
51
80
 
52
81
  ### Added
53
82
 
54
- - added declarative shadow dom rendering for template elements
83
+ - added declarative shadow dom rendering for template elements
55
84
 
56
85
  ### Fixed
57
86
 
58
- - fixed issues with whitespace being returned untrimmed in a template result
87
+ - fixed issues with whitespace being returned untrimmed in a template result
59
88
 
60
89
  ## [1.0.0-alpha.11] - 2024-03-13
61
90
 
62
91
  ### Fixed
63
92
 
64
- - fixed missing return type `string` for the `template()` function in `TemplateElement`
65
- - fixed types for the `propertyOptions` option in `BaseElement`
93
+ - fixed missing return type `string` for the `template()` function in `TemplateElement`
94
+ - fixed types for the `propertyOptions` option in `BaseElement`
66
95
 
67
96
  ## [1.0.0-alpha.10] - 2024-02-20
68
97
 
69
98
  ### Fixed
70
99
 
71
- - fixed unsafeHTML not rendering anything when toString was called
72
- - fixed using = sign in attribute positions with interpolations
73
- - fixed rendering null values in node part positions in SSR
74
- - fixed missing .js file extensions
100
+ - fixed unsafeHTML not rendering anything when toString was called
101
+ - fixed using = sign in attribute positions with interpolations
102
+ - fixed rendering null values in node part positions in SSR
103
+ - fixed missing .js file extensions
75
104
 
76
105
  ## [1.0.0-alpha.9] - 2024-01-05
77
106
 
78
107
  ### Changed
79
108
 
80
- - moved DOM methods into connected callbacks to make it safe for the elements to be created in SSR environments
109
+ - moved DOM methods into connected callbacks to make it safe for the elements to be created in SSR environments
81
110
 
82
111
  ## [1.0.0-alpha.8] - 2024-01-04
83
112
 
84
113
  ### Fixed
85
114
 
86
- - fixed ChildNodePart not replacing dom nodes from unsafeHTML
115
+ - fixed ChildNodePart not replacing dom nodes from unsafeHTML
87
116
 
88
117
  ## [1.0.0-alpha.7] - 2023-12-19
89
118
 
90
119
  ### Fixed
91
120
 
92
- - fixed wrong attribute parts for the same name on different elements
121
+ - fixed wrong attribute parts for the same name on different elements
93
122
 
94
123
  ## [1.0.0-alpha.6] - 2023-12-18
95
124
 
96
125
  ### Fixed
97
126
 
98
- - fixed hyphens in attribute names being split in SSR mode
127
+ - fixed hyphens in attribute names being split in SSR mode
99
128
 
100
129
  ## [1.0.0-alpha.5] - 2023-12-07
101
130
 
102
131
  ### Added
103
132
 
104
- - Added the /docs directory to the files array in package.json
105
- - Added part instances as \_\_part to comment nodes
133
+ - Added the /docs directory to the files array in package.json
134
+ - Added part instances as \_\_part to comment nodes
106
135
 
107
136
  ### Fixed
108
137
 
109
- - fixed escaped unsafeHTML in SSR mode
138
+ - fixed escaped unsafeHTML in SSR mode
110
139
 
111
140
  ## [1.0.0-alpha.4] - 2023-12-01
112
141
 
113
142
  ### Fixed
114
143
 
115
- - falsy creation of directive parts for non-directive attributes
116
- - creating parts with wrong comment marker positions
144
+ - falsy creation of directive parts for non-directive attributes
145
+ - creating parts with wrong comment marker positions
117
146
 
118
147
  ## [1.0.0-alpha.3] - 2023-12-01
119
148
 
120
149
  ### Added
121
150
 
122
- - Added state serialization. This improves hydration from SSR a lot. ([#106](https://github.com/webtides/element-js/pull/106))
151
+ - Added state serialization. This improves hydration from SSR a
152
+ lot. ([#106](https://github.com/webtides/element-js/pull/106))
123
153
 
124
154
  ### Changed
125
155
 
126
- - _BRAKING_ Changed the default options when using the `dispatch` helper function. `bubbles`, `cancelable` and `composed` will now be `true` by default.
127
- - _BRAKING_ Changed adopting global styles to include ALL global styles. Previously only one inline <style> with the ID of '#globalStyles' would be adopted. For more information see the docs.
156
+ - _BRAKING_ Changed the default options when using the `dispatch` helper function. `bubbles`, `cancelable`
157
+ and `composed` will now be `true` by default.
158
+ - _BRAKING_ Changed adopting global styles to include ALL global styles. Previously only one inline <style> with the ID
159
+ of '#globalStyles' would be adopted. For more information see the docs.
128
160
 
129
161
  ### Removed
130
162
 
131
- - _BRAKING_ Removed `i18n` helper function. See CHANGELOG how to implement it yourself or use a third party library.
163
+ - _BRAKING_ Removed `i18n` helper function. See CHANGELOG how to implement it yourself or use a third party library.
132
164
 
133
165
  ## [1.0.0-alpha.2] - 2023-08-23
134
166
 
135
167
  ### Added
136
168
 
137
- - Added JSDocs for everything in the codebase. This will especially be helpful when using constructor options.
169
+ - Added JSDocs for everything in the codebase. This will especially be helpful when using constructor options.
138
170
 
139
171
  ## [1.0.0-alpha.1] - 2023-08-15
140
172
 
141
173
  ### Added
142
174
 
143
- - Added our own versions of directives and template helpers ([#67](https://github.com/webtides/element-js/pull/67))
175
+ - Added our own versions of directives and template helpers ([#67](https://github.com/webtides/element-js/pull/67))
144
176
 
145
177
  ### Changed
146
178
 
147
- - _BRAKING_ Uses a new custom renderer for the `TemplateElement`. It replaces the old `lit-html` renderer. The API and usage should be exactly the same. The only thing to do/change is the use of the old `lit-html` directives. For detailed instructions see the upgrade guide. ([#67](https://github.com/webtides/element-js/pull/67))
148
- - _BREAKING_ `element-js` will now also trigger the `afterUpdate` hook right after the `connected` hook. This is to reduce the cases where you had to do the same things in `connected` and `afterUpdate`. You can now remove those duplicate calls from the `connected` hook. ([#60](https://github.com/webtides/element-js/pull/60))
149
- - _BREAKING_ Changed `package.json` type to `module`. This should hopefully not break anything. `element-js` is either used directly from the browser or through a bundler. In both cases the added type: module should not matter. ([#64](https://github.com/webtides/element-js/pull/64))
179
+ - _BRAKING_ Uses a new custom renderer for the `TemplateElement`. It replaces the old `lit-html` renderer. The API and
180
+ usage should be exactly the same. The only thing to do/change is the use of the old `lit-html` directives. For
181
+ detailed instructions see the upgrade guide. ([#67](https://github.com/webtides/element-js/pull/67))
182
+ - _BREAKING_ `element-js` will now also trigger the `afterUpdate` hook right after the `connected` hook. This is to
183
+ reduce the cases where you had to do the same things in `connected` and `afterUpdate`. You can now remove those
184
+ duplicate calls from the `connected` hook. ([#60](https://github.com/webtides/element-js/pull/60))
185
+ - _BREAKING_ Changed `package.json` type to `module`. This should hopefully not break anything. `element-js` is either
186
+ used directly from the browser or through a bundler. In both cases the added type: module should not
187
+ matter. ([#64](https://github.com/webtides/element-js/pull/64))
150
188
 
151
189
  ### Removed
152
190
 
153
- - _BREAKING_ Removed the `lit-html` dependency. `element-js` is now officially dependency free! ([#67](https://github.com/webtides/element-js/pull/67))
154
- - _BREAKING_ Removed the deprecated `BaseElement` constructor option `childListUpdate`. Please use the "mutationObserverOptions" dictionary instead. See the docs for more info. ([#99](https://github.com/webtides/element-js/pull/99))
155
- - _BREAKING_ Removed the `hooks` map in the `BaseElement`. Using the hooks() map for lifecycle hooks is deprecated! Please overwrite the existing lifecycle hook functions. See the docs for more info. ([#99](https://github.com/webtides/element-js/pull/99))
156
- - _BREAKING_ Removed the `computed` map in the `BaseElement`. Using the computed() map for computed properties is deprecated! Please use regular JS getters and return the computed value. See the docs for more info. ([#99](https://github.com/webtides/element-js/pull/99))
157
- - _BREAKING_ Removed all occurrences of `ShadyCSS` in `StyledElement`. ([#99](https://github.com/webtides/element-js/pull/99))
191
+ - _BREAKING_ Removed the `lit-html` dependency. `element-js` is now officially dependency
192
+ free! ([#67](https://github.com/webtides/element-js/pull/67))
193
+ - _BREAKING_ Removed the deprecated `BaseElement` constructor option `childListUpdate`. Please use the "
194
+ mutationObserverOptions" dictionary instead. See the docs for more
195
+ info. ([#99](https://github.com/webtides/element-js/pull/99))
196
+ - _BREAKING_ Removed the `hooks` map in the `BaseElement`. Using the hooks() map for lifecycle hooks is deprecated!
197
+ Please overwrite the existing lifecycle hook functions. See the docs for more
198
+ info. ([#99](https://github.com/webtides/element-js/pull/99))
199
+ - _BREAKING_ Removed the `computed` map in the `BaseElement`. Using the computed() map for computed properties is
200
+ deprecated! Please use regular JS getters and return the computed value. See the docs for more
201
+ info. ([#99](https://github.com/webtides/element-js/pull/99))
202
+ - _BREAKING_ Removed all occurrences of `ShadyCSS`
203
+ in `StyledElement`. ([#99](https://github.com/webtides/element-js/pull/99))
158
204
 
159
205
  ## [0.7.4] - 2023-11-24
160
206
 
161
207
  ### Added
162
208
 
163
- - storeception (reactive store properties in parent stores)
164
- - context injection in shadow elements requests travel though shadow roots
165
- - defer element connection (disables client side code until called manually)
209
+ - storeception (reactive store properties in parent stores)
210
+ - context injection in shadow elements requests travel though shadow roots
211
+ - defer element connection (disables client side code until called manually)
166
212
 
167
213
  ### Fixed
168
214
 
169
- - late context injection if parent mounts after child (loading order)
170
- - stores updating elements that want to be updated
215
+ - late context injection if parent mounts after child (loading order)
216
+ - stores updating elements that want to be updated
171
217
 
172
218
  ## [0.7.3] - 2023-03-07
173
219
 
174
220
  ### Fixed
175
221
 
176
- - last release was tagged wrong
222
+ - last release was tagged wrong
177
223
 
178
224
  ## [0.7.2] - 2023-03-03
179
225
 
180
226
  ### Fixed
181
227
 
182
- - watcher callbacks for injected stores
228
+ - watcher callbacks for injected stores
183
229
 
184
230
  ## [0.7.1] - 2023-03-03
185
231
 
186
232
  ### Added
187
233
 
188
- - Elements are now able to watch Stores
234
+ - Elements are now able to watch Stores
189
235
 
190
236
  ### Fixed
191
237
 
192
- - Injection of falsy values
238
+ - Injection of falsy values
193
239
 
194
240
  ## [0.7.0] - 2023-02-13
195
241
 
196
242
  ### Added
197
243
 
198
- - Dependency Injection via Context Protocol 💉
199
- - Provide reactive Properties or entire Stores via: provideProperties() { return { name : value}}
200
- - Inject / Request them via injectProperties() { return { name : 'defaultValue'}}
244
+ - Dependency Injection via Context Protocol 💉
245
+ - Provide reactive Properties or entire Stores via: provideProperties() { return { name : value}}
246
+ - Inject / Request them via injectProperties() { return { name : 'defaultValue'}}
201
247
 
202
248
  ### Changed
203
249
 
204
- - docs structure
250
+ - docs structure
205
251
 
206
252
  ### Fixed
207
253
 
208
- - Cannot re-render slotted light dom when using the vanilla renderer https://github.com/webtides/element-js/issues/76
209
- - adds Vanilla Renderer Tests
254
+ - Cannot re-render slotted light dom when using the vanilla renderer https://github.com/webtides/element-js/issues/76
255
+ - adds Vanilla Renderer Tests
210
256
 
211
257
  ## [0.6.2] - 2022-11-18
212
258
 
213
259
  ### FIXED
214
260
 
215
- - Store always switching to singleProperty Mode if constructed without any arguments.
261
+ - Store always switching to singleProperty Mode if constructed without any arguments.
216
262
 
217
263
  ## [0.6.1] - 2022-11-18
218
264
 
219
265
  ### ADDED
220
266
 
221
- - Store watch() map to control internal store state scope
267
+ - Store watch() map to control internal store state scope
222
268
 
223
269
  ## [0.6.0] - 2022-11-17
224
270
 
225
271
  ### ADDED
226
272
 
227
- - StoreProperty for shared application state
228
- - Directives for Vanilla Renderer
273
+ - StoreProperty for shared application state
274
+ - Directives for Vanilla Renderer
229
275
 
230
276
  ## [0.5.0] - 2022-09-13
231
277
 
232
278
  ### Changed
233
279
 
234
- - improved the performance of the vanilla-renderer
280
+ - improved the performance of the vanilla-renderer
235
281
 
236
282
  ### Removed
237
283
 
238
- - setting attributes as properties during dom diffing for the vanilla renderer. This is potentially a **breaking** change if you used attributes with the "." (dot) notation
284
+ - setting attributes as properties during dom diffing for the vanilla renderer. This is potentially a **breaking**
285
+ change if you used attributes with the "." (dot) notation
239
286
 
240
287
  ## [0.4.3] - 2022-07-06
241
288
 
242
289
  ### ADDED
243
290
 
244
- - parse option to propertyOptions that can be either a boolean OR a function for custom parsing
245
- - enhance reflect option in propertyOptions that it can also be a function for custom reflection
291
+ - parse option to propertyOptions that can be either a boolean OR a function for custom parsing
292
+ - enhance reflect option in propertyOptions that it can also be a function for custom reflection
246
293
 
247
294
  ## [0.4.2] - 2022-02-03
248
295
 
249
296
  ### Fixed
250
297
 
251
- - vanilla-renderer: fixes attribute comparsion
298
+ - vanilla-renderer: fixes attribute comparsion
252
299
 
253
300
  ## [0.4.1] - 2022-02-01
254
301
 
255
302
  ### Fixed
256
303
 
257
- - refs="id[]" indexing keys not nodes _rolleyes_
304
+ - refs="id[]" indexing keys not nodes _rolleyes_
258
305
 
259
306
  ### Added
260
307
 
261
- - refs="id[]" aka possibbility to refrence a list of nodes to the $refs map.
308
+ - refs="id[]" aka possibbility to refrence a list of nodes to the $refs map.
262
309
 
263
310
  ## [0.4.0] - 2022-01-28
264
311
 
265
312
  ### Added
266
313
 
267
- - a "vanilla" renderer with support for hydration and no dependencies
314
+ - a "vanilla" renderer with support for hydration and no dependencies
268
315
 
269
316
  ### Changed
270
317
 
271
- - uses new @web/test-runner isntead of karma (#27)
318
+ - uses new @web/test-runner isntead of karma (#27)
272
319
 
273
320
  ## [0.3.3] - 2021-09-22
274
321
 
275
322
  ### Added
276
323
 
277
- - optional complex event callback notation to support addEventListener options (i.E. for passive Event Listeners )
278
- - Example: {listener: () => {}, options: { passive: true } }
279
- - docs
280
- - tests
324
+ - optional complex event callback notation to support addEventListener options (i.E. for passive Event Listeners )
325
+ - Example: {listener: () => {}, options: { passive: true } }
326
+ - docs
327
+ - tests
281
328
 
282
329
  ## [0.3.2] - 2021-03-09
283
330
 
284
331
  ### Added
285
332
 
286
- - bundled version of `element-js` to use from a CDN and be able to prototype in tools like CodePen etc.
333
+ - bundled version of `element-js` to use from a CDN and be able to prototype in tools like CodePen etc.
287
334
 
288
335
  ## [0.3.1] - 2020-12-08
289
336
 
290
337
  ### Fixed
291
338
 
292
- - i18n fallback values
339
+ - i18n fallback values
293
340
 
294
341
  ### Added
295
342
 
296
- - i18n tests
343
+ - i18n tests
297
344
 
298
345
  ## [0.3.0] - 2020-07-27
299
346
 
300
347
  ### Added
301
348
 
302
- - first batch/draft of the documentation
303
- - property/attribute reflection via constructor options (see the [Documentation](/docs/README.md#propertyoptions) for more info)
304
- - mutationObserverOptions to enable observing subtree mutations (see the [Documentation](/docs/README.md#mutationobserveroptions) for more info)
349
+ - first batch/draft of the documentation
350
+ - property/attribute reflection via constructor options (see the [Documentation](/docs/README.md#propertyoptions) for
351
+ more info)
352
+ - mutationObserverOptions to enable observing subtree mutations (see
353
+ the [Documentation](/docs/README.md#mutationobserveroptions) for more info)
305
354
 
306
355
  ### Removed
307
356
 
308
- - `childListUpdate` constructor option has been deprecated and will be removed before `1.0`
357
+ - `childListUpdate` constructor option has been deprecated and will be removed before `1.0`
309
358
 
310
359
  ## [0.2.0] - 2020-07-01
311
360
 
312
361
  ### Changed
313
362
 
314
- - uses shady-render instead of render from `lit-html` for rendering templates to be compatible with the shady-css polyfill
315
- - refactored and simplified `StyledElement`s handling/loading of style sheets
363
+ - uses shady-render instead of render from `lit-html` for rendering templates to be compatible with the shady-css
364
+ polyfill
365
+ - refactored and simplified `StyledElement`s handling/loading of style sheets
316
366
 
317
367
  ## [0.1.0] - 2020-06-26
318
368
 
319
- - initial release
369
+ - initial release
package/README.md CHANGED
@@ -27,7 +27,7 @@ npm install --save @webtides/element-js
27
27
  // or when installed via npm
28
28
  import { BaseElement, defineElement, Store } from '@webtides/element-js';
29
29
 
30
- const sharedDate = new Store({date: Date.now()})
30
+ const sharedDate = new Store({ date: Date.now() });
31
31
 
32
32
  class ExampleElement extends BaseElement {
33
33
  // normal public properties
@@ -42,8 +42,8 @@ class ExampleElement extends BaseElement {
42
42
  // reactive attributes/properties
43
43
  properties() {
44
44
  return {
45
- familyName: 'Doe',
46
- sharedDate
45
+ familyName: 'Doe',
46
+ sharedDate
47
47
  };
48
48
  }
49
49