@justeattakeaway/pie-webc-core 0.24.0 → 0.24.2

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
- vite v4.5.3 building for production...
1
+ vite v5.3.6 building for production...
2
2
  transforming...
3
3
  ✓ 16 modules transformed.
4
4
  rendering chunks...
5
5
  computing gzip size...
6
- dist/index.js 2.66 kB │ gzip: 1.20 kB
7
- ✓ built in 205ms
6
+ dist/index.js 2.69 kB │ gzip: 1.22 kB
7
+ ✓ built in 104ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.24.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [Fixed] - Imports to align with new linting rule ([#1622](https://github.com/justeattakeaway/pie/pull/1622)) by [@xander-marjoram](https://github.com/xander-marjoram)
8
+
9
+ [Removed] - Empty lines at the start of some files
10
+
11
+ ## 0.24.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [Changed] - Suggested package updates for security ([#1953](https://github.com/justeattakeaway/pie/pull/1953)) by [@xander-marjoram](https://github.com/xander-marjoram)
16
+
3
17
  ## 0.24.0
4
18
 
5
19
  ### Minor Changes
package/dist/index.js CHANGED
@@ -1,27 +1,27 @@
1
- import { isServer as c } from "lit";
2
- const a = (t, e, r) => function(s, n) {
3
- const o = `#${n}`;
4
- Object.defineProperty(s, n, {
1
+ import { isServer as u } from "lit";
2
+ const d = (t, e, n) => function(s, r) {
3
+ const o = `#${r}`;
4
+ Object.defineProperty(s, r, {
5
5
  get() {
6
6
  return this[o];
7
7
  },
8
- set(u) {
9
- e.includes(u) ? this[o] = u : (console.error(
10
- `<${t}> Invalid value "${u}" provided for property "${n}".`,
8
+ set(c) {
9
+ e.includes(c) ? this[o] = c : (console.error(
10
+ `<${t}> Invalid value "${c}" provided for property "${r}".`,
11
11
  `Must be one of: ${e.join(" | ")}.`,
12
- `Falling back to default value: "${r}"`
13
- ), this[o] = r);
12
+ `Falling back to default value: "${n}"`
13
+ ), this[o] = n);
14
14
  },
15
15
  configurable: !0
16
16
  });
17
- }, d = (t) => function(r, i) {
17
+ }, l = (t) => function(n, i) {
18
18
  const s = `#${i}`;
19
- Object.defineProperty(r, i, {
19
+ Object.defineProperty(n, i, {
20
20
  get() {
21
21
  return this[s];
22
22
  },
23
- set(n) {
24
- (n == null || typeof n == "string" && n.trim() === "") && console.error(`<${t}> Missing required attribute "${i}"`), this[s] = n;
23
+ set(r) {
24
+ (r == null || typeof r == "string" && r.trim() === "") && console.error(`<${t}> Missing required attribute "${i}"`), this[s] = r;
25
25
  },
26
26
  configurable: !0
27
27
  });
@@ -29,7 +29,7 @@ const a = (t, e, r) => function(s, n) {
29
29
  function f(t, e) {
30
30
  customElements.get(t) ? console.warn(`PIE Web Component: "${t}" has already been defined. Please ensure the component is only being defined once in your application.`) : customElements.define(t, e);
31
31
  }
32
- function m(t) {
32
+ function b(t) {
33
33
  return new CustomEvent(t.type, {
34
34
  detail: {
35
35
  sourceEvent: t
@@ -38,16 +38,16 @@ function m(t) {
38
38
  cancelable: t.cancelable
39
39
  });
40
40
  }
41
- function b(t, e, r) {
41
+ function h(t, e, n) {
42
42
  e.startsWith("pie-") || console.warn("A custom event name should start with `pie-`");
43
43
  const i = new CustomEvent(e, {
44
44
  bubbles: !0,
45
45
  composed: !0,
46
- detail: r
46
+ detail: n
47
47
  });
48
48
  t.dispatchEvent(i);
49
49
  }
50
- const h = (t) => {
50
+ const m = (t) => {
51
51
  class e extends t {
52
52
  /**
53
53
  * A getter to determine whether the text direction is right-to-left (RTL).
@@ -59,28 +59,30 @@ const h = (t) => {
59
59
  * @returns {boolean} - Returns `true` if the text direction is RTL, otherwise `false`.
60
60
  */
61
61
  get isRTL() {
62
- return this.dir ? this.dir === "rtl" : !c && !this.dir ? document.documentElement.getAttribute("dir") === "rtl" : !1;
62
+ return this.dir ? this.dir === "rtl" : !u && !this.dir ? document.documentElement.getAttribute("dir") === "rtl" : !1;
63
63
  }
64
64
  }
65
65
  return e;
66
66
  }, p = (t) => {
67
- class e extends t {
68
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
69
- constructor(...i) {
70
- super(...i), this._internals = this.attachInternals();
71
- }
67
+ const n = class n extends t {
72
68
  get form() {
73
69
  return this._internals.form;
74
70
  }
75
- }
76
- return e.formAssociated = !0, e;
71
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
72
+ constructor(...s) {
73
+ super(...s), this._internals = this.attachInternals();
74
+ }
75
+ };
76
+ n.formAssociated = !0;
77
+ let e = n;
78
+ return e;
77
79
  };
78
80
  export {
79
81
  p as FormControlMixin,
80
- h as RtlMixin,
82
+ m as RtlMixin,
81
83
  f as defineCustomElement,
82
- b as dispatchCustomEvent,
83
- d as requiredProperty,
84
- a as validPropertyValues,
85
- m as wrapNativeEvent
84
+ h as dispatchCustomEvent,
85
+ l as requiredProperty,
86
+ d as validPropertyValues,
87
+ b as wrapNativeEvent
86
88
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justeattakeaway/pie-webc-core",
3
- "version": "0.24.0",
3
+ "version": "0.24.2",
4
4
  "description": "PIE design system base classes, mixins and utilities for web components",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -18,10 +18,10 @@
18
18
  "test:watch": "run -T vitest"
19
19
  },
20
20
  "dependencies": {
21
- "lit": "3.1.3"
21
+ "lit": "3.2.0"
22
22
  },
23
23
  "devDependencies": {
24
- "@justeattakeaway/pie-components-config": "0.16.0"
24
+ "@justeattakeaway/pie-components-config": "0.18.0"
25
25
  },
26
26
  "volta": {
27
27
  "extends": "../../../package.json"
@@ -1,6 +1,5 @@
1
- /* eslint-disable max-classes-per-file */
2
- import { LitElement, isServer } from 'lit';
3
- import type { GenericConstructor } from '../types/GenericConstructor';
1
+ import { type LitElement, isServer } from 'lit';
2
+ import { type GenericConstructor } from '../types/GenericConstructor';
4
3
 
5
4
  /**
6
5
  * An interface representing the structure of RTL related class.
@@ -41,16 +40,16 @@ export interface RTLInterface {
41
40
  *
42
41
  * class MyStyledElement extends RtlMixin(LitElement) {
43
42
  * render() {
44
- * return html`<div class="foo" ?isRTL=${this.isRTL}>Content</div>`;
43
+ * return html`<div class="foo" ?data-is-rtl=${this.isRTL}>Content</div>`;
45
44
  * }
46
45
  * }
47
46
  *
48
47
  * customElements.define('my-styled-element', MyStyledElement);
49
48
  * ```
50
49
  *
51
- * The corresponding SCSS to leverage the `isRTL` attribute:
50
+ * The corresponding SCSS to leverage the `data-is-rtl` attribute:
52
51
  * ```scss
53
- * .foo[isRTL] {
52
+ * .foo[data-is-rtl] {
54
53
  * background-color: red;
55
54
  * text-align: right;
56
55
  * }