@justeattakeaway/pie-webc-core 0.16.0 → 0.17.1

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.
@@ -1,7 +1,7 @@
1
1
  vite v4.3.9 building for production...
2
2
  transforming...
3
- ✓ 10 modules transformed.
3
+ ✓ 11 modules transformed.
4
4
  rendering chunks...
5
5
  computing gzip size...
6
- dist/index.js 2.23 kB │ gzip: 1.02 kB
7
- ✓ built in 333ms
6
+ dist/index.js 2.40 kB │ gzip: 1.09 kB
7
+ ✓ built in 198ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.17.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [Changed] - Updated Lit to 3.1.1 ([#1178](https://github.com/justeattakeaway/pie/pull/1178)) by [@renovate](https://github.com/apps/renovate)
8
+
9
+ ## 0.17.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [Added] - new wrapNativeEvent function to standardise how we structure custom versions of native browser events such as 'change' ([#1173](https://github.com/justeattakeaway/pie/pull/1173)) by [@jamieomaguire](https://github.com/jamieomaguire)
14
+
3
15
  ## 0.16.0
4
16
 
5
17
  ### Minor Changes
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { isServer as u } from "lit";
2
- const l = (e) => {
1
+ import { isServer as l } from "lit";
2
+ const a = (e) => {
3
3
  class t extends e {
4
4
  /**
5
5
  * A getter to determine whether the text direction is right-to-left (RTL).
@@ -11,11 +11,11 @@ const l = (e) => {
11
11
  * @returns {boolean} - Returns `true` if the text direction is RTL, otherwise `false`.
12
12
  */
13
13
  get isRTL() {
14
- return this.dir ? this.dir === "rtl" : !u && !this.dir ? document.documentElement.getAttribute("dir") === "rtl" : !1;
14
+ return this.dir ? this.dir === "rtl" : !l && !this.dir ? document.documentElement.getAttribute("dir") === "rtl" : !1;
15
15
  }
16
16
  }
17
17
  return t;
18
- }, a = (e) => {
18
+ }, d = (e) => {
19
19
  class t extends e {
20
20
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
21
21
  constructor(...i) {
@@ -53,13 +53,23 @@ const l = (e) => {
53
53
  configurable: !0
54
54
  });
55
55
  };
56
- function h(e, t) {
56
+ function b(e, t) {
57
57
  customElements.get(e) ? console.warn(`PIE Web Component: "${e}" has already been defined. Please ensure the component is only being defined once in your application.`) : customElements.define(e, t);
58
58
  }
59
+ function p(e) {
60
+ return new CustomEvent(e.type, {
61
+ detail: {
62
+ sourceEvent: e
63
+ },
64
+ bubbles: e.bubbles,
65
+ cancelable: e.cancelable
66
+ });
67
+ }
59
68
  export {
60
- a as FormControlMixin,
61
- l as RtlMixin,
62
- h as defineCustomElement,
69
+ d as FormControlMixin,
70
+ a as RtlMixin,
71
+ b as defineCustomElement,
63
72
  m as requiredProperty,
64
- f as validPropertyValues
73
+ f as validPropertyValues,
74
+ p as wrapNativeEvent
65
75
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justeattakeaway/pie-webc-core",
3
- "version": "0.16.0",
3
+ "version": "0.17.1",
4
4
  "description": "PIE design system base classes, mixins and utilities for web components",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -17,10 +17,10 @@
17
17
  "test:watch": "run -T vitest"
18
18
  },
19
19
  "dependencies": {
20
- "lit": "3.1.0"
20
+ "lit": "3.1.1"
21
21
  },
22
22
  "devDependencies": {
23
- "@justeattakeaway/pie-components-config": "0.8.0"
23
+ "@justeattakeaway/pie-components-config": "0.9.0"
24
24
  },
25
25
  "volta": {
26
26
  "extends": "../../../package.json"
@@ -1 +1,2 @@
1
1
  export * from './defineCustomElement';
2
+ export * from './wrapNativeEvent';
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Wraps the native event in a custom event. This is useful for native events that have `composed` set to `false`
3
+ * as these cannot propagate outside of the shadow DOM.
4
+ * @param event - The native event.
5
+ */
6
+ export function wrapNativeEvent (event: Event) {
7
+ return new CustomEvent(event.type, {
8
+ detail: {
9
+ sourceEvent: event,
10
+ },
11
+ bubbles: event.bubbles,
12
+ cancelable: event.cancelable,
13
+ });
14
+ }
package/tsconfig.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "extends": "../../../configs/pie-components-config/tsconfig.json",
2
+ "extends": "@justeattakeaway/pie-components-config/tsconfig.json",
3
3
  "compilerOptions": {
4
4
  "baseUrl": ".",
5
5
  "rootDir": ".",