@brightspace-ui/core 1.201.1 → 1.202.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/helpers/README.md CHANGED
@@ -21,6 +21,25 @@ import { AsyncStateEvent } from '@brightspace-ui/core/helpers/asyncStateEvent.js
21
21
  const asyncStateEvent = new AsyncStateEvent(pendingPromise);
22
22
  ```
23
23
 
24
+ ## composeMixins
25
+
26
+ A helper function for cleanly incorporating a list of mixins into a base class. Designed for use with Lit components with a large amount of reusable functionality.
27
+
28
+ ```js
29
+ // other imports...
30
+ import { composeMixins } from '@brightspace-ui/core/helpers/composeMixins.js';
31
+
32
+ class ExampleComponent extends composeMixins(
33
+ LitElement,
34
+ EntityMixin,
35
+ LocalizeMixin,
36
+ ) {
37
+ // ...
38
+ }
39
+ ```
40
+
41
+ Read more about mixins on [the `open-wc` docs](https://open-wc.org/docs/development/dedupe-mixin/#what-is-a-mixin).
42
+
24
43
  ## Dismissible
25
44
 
26
45
  Dismissible components are those that should be dismissible when the user presses
@@ -196,4 +215,3 @@ import '@brightspace-ui/core/helpers/viewport-size.js';
196
215
  min-width: calc(var(--d2l-vw, 1vw) * 100);
197
216
  }
198
217
  ```
199
-
@@ -0,0 +1,2 @@
1
+ export const composeMixins = (base, ...mixins) =>
2
+ mixins.reduce((subclass, superclass) => superclass(subclass), base);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "1.201.1",
3
+ "version": "1.202.0",
4
4
  "description": "A collection of accessible, free, open-source web components for building Brightspace applications",
5
5
  "repository": "https://github.com/BrightspaceUI/core.git",
6
6
  "publishConfig": {