@justeattakeaway/pie-cookie-banner 0.11.3 → 0.11.4
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 +1 -1
- package/dist/react.d.ts +2 -2
- package/dist/react.js +13 -67
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -56,7 +56,7 @@ import '@justeattakeaway/pie-cookie-banner';
|
|
|
56
56
|
```js
|
|
57
57
|
// React
|
|
58
58
|
// For React, you will need to import our React-specific component build
|
|
59
|
-
// which wraps the web component using
|
|
59
|
+
// which wraps the web component using @lit/react
|
|
60
60
|
import { PieCookieBanner } from '@justeattakeaway/pie-cookie-banner/dist/react';
|
|
61
61
|
```
|
|
62
62
|
|
package/dist/react.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { CSSResult } from 'lit';
|
|
2
|
-
import type { EventName } from '@lit
|
|
2
|
+
import type { EventName } from '@lit/react';
|
|
3
3
|
import type { LitElement } from 'lit';
|
|
4
4
|
import { PieSwitch } from '@justeattakeaway/pie-switch';
|
|
5
|
-
import type { ReactWebComponent } from '@lit
|
|
5
|
+
import type { ReactWebComponent } from '@lit/react';
|
|
6
6
|
import { TemplateResult } from 'lit';
|
|
7
7
|
|
|
8
8
|
export declare interface CookieBannerLocale {
|
package/dist/react.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
import { createComponent as o } from "@lit/react";
|
|
3
|
+
import { PieCookieBanner as n } from "./index.js";
|
|
4
|
+
import { ON_COOKIE_BANNER_ACCEPT_ALL as P, ON_COOKIE_BANNER_MANAGE_PREFS as A, ON_COOKIE_BANNER_NECESSARY_ONLY as B, ON_COOKIE_BANNER_PREFS_SAVED as f, preferences as l } from "./index.js";
|
|
4
5
|
import "lit";
|
|
5
6
|
import "lit/decorators.js";
|
|
6
7
|
import "lit/directives/repeat.js";
|
|
@@ -10,65 +11,10 @@ import "@justeattakeaway/pie-icon-button";
|
|
|
10
11
|
import "@justeattakeaway/pie-link";
|
|
11
12
|
import "@justeattakeaway/pie-modal";
|
|
12
13
|
import "@justeattakeaway/pie-switch";
|
|
13
|
-
|
|
14
|
-
* @license
|
|
15
|
-
* Copyright 2018 Google LLC
|
|
16
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
17
|
-
*/
|
|
18
|
-
const O = /* @__PURE__ */ new Set(["children", "localName", "ref", "style", "className"]), C = /* @__PURE__ */ new WeakMap(), k = (o, n, c, m, d) => {
|
|
19
|
-
const r = d == null ? void 0 : d[n];
|
|
20
|
-
r === void 0 || c === m ? c == null && n in HTMLElement.prototype ? o.removeAttribute(n) : o[n] = c : ((s, t, h) => {
|
|
21
|
-
let a = C.get(s);
|
|
22
|
-
a === void 0 && C.set(s, a = /* @__PURE__ */ new Map());
|
|
23
|
-
let l = a.get(t);
|
|
24
|
-
h !== void 0 ? l === void 0 ? (a.set(t, l = { handleEvent: h }), s.addEventListener(t, l)) : l.handleEvent = h : l !== void 0 && (a.delete(t), s.removeEventListener(t, l));
|
|
25
|
-
})(o, r, c);
|
|
26
|
-
}, A = (o, n) => {
|
|
27
|
-
typeof o == "function" ? o(n) : o.current = n;
|
|
28
|
-
};
|
|
29
|
-
function P(o = window.React, n, c, m, d) {
|
|
30
|
-
let r, s, t;
|
|
31
|
-
if (n === void 0) {
|
|
32
|
-
const p = o;
|
|
33
|
-
({ tagName: s, elementClass: t, events: m, displayName: d } = p), r = p.react;
|
|
34
|
-
} else
|
|
35
|
-
r = o, t = c, s = n;
|
|
36
|
-
const h = r.Component, a = r.createElement, l = new Set(Object.keys(m ?? {}));
|
|
37
|
-
class v extends h {
|
|
38
|
-
constructor() {
|
|
39
|
-
super(...arguments), this.o = null;
|
|
40
|
-
}
|
|
41
|
-
t(e) {
|
|
42
|
-
if (this.o !== null)
|
|
43
|
-
for (const N in this.i)
|
|
44
|
-
k(this.o, N, this.props[N], e ? e[N] : void 0, m);
|
|
45
|
-
}
|
|
46
|
-
componentDidMount() {
|
|
47
|
-
var e;
|
|
48
|
-
this.t(), (e = this.o) === null || e === void 0 || e.removeAttribute("defer-hydration");
|
|
49
|
-
}
|
|
50
|
-
componentDidUpdate(e) {
|
|
51
|
-
this.t(e);
|
|
52
|
-
}
|
|
53
|
-
render() {
|
|
54
|
-
const { _$Gl: e, ...N } = this.props;
|
|
55
|
-
this.h !== e && (this.u = (i) => {
|
|
56
|
-
e !== null && A(e, i), this.o = i, this.h = e;
|
|
57
|
-
}), this.i = {};
|
|
58
|
-
const u = { ref: this.u };
|
|
59
|
-
for (const [i, f] of Object.entries(N))
|
|
60
|
-
O.has(i) ? u[i === "className" ? "class" : i] = f : l.has(i) || i in t.prototype ? this.i[i] = f : u[i] = f;
|
|
61
|
-
return u.suppressHydrationWarning = !0, a(s, u);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
v.displayName = d ?? t.name;
|
|
65
|
-
const E = r.forwardRef((p, e) => a(v, { ...p, _$Gl: e }, p == null ? void 0 : p.children));
|
|
66
|
-
return E.displayName = v.displayName, E;
|
|
67
|
-
}
|
|
68
|
-
const x = P({
|
|
14
|
+
const E = o({
|
|
69
15
|
displayName: "PieCookieBanner",
|
|
70
|
-
elementClass:
|
|
71
|
-
react:
|
|
16
|
+
elementClass: n,
|
|
17
|
+
react: e,
|
|
72
18
|
tagName: "pie-cookie-banner",
|
|
73
19
|
events: {
|
|
74
20
|
onPieCookieBannerAcceptAll: "pie-cookie-banner-accept-all",
|
|
@@ -82,10 +28,10 @@ const x = P({
|
|
|
82
28
|
}
|
|
83
29
|
});
|
|
84
30
|
export {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
31
|
+
P as ON_COOKIE_BANNER_ACCEPT_ALL,
|
|
32
|
+
A as ON_COOKIE_BANNER_MANAGE_PREFS,
|
|
33
|
+
B as ON_COOKIE_BANNER_NECESSARY_ONLY,
|
|
34
|
+
f as ON_COOKIE_BANNER_PREFS_SAVED,
|
|
35
|
+
E as PieCookieBanner,
|
|
36
|
+
l as preferences
|
|
91
37
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justeattakeaway/pie-cookie-banner",
|
|
3
3
|
"description": "PIE Design System Cookie Banner built using Web Components",
|
|
4
|
-
"version": "0.11.
|
|
4
|
+
"version": "0.11.4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
"@justeattakeaway/pie-components-config": "0.6.0"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@justeattakeaway/pie-button": "0.39.
|
|
37
|
-
"@justeattakeaway/pie-divider": "0.9.
|
|
38
|
-
"@justeattakeaway/pie-icon-button": "0.21.
|
|
39
|
-
"@justeattakeaway/pie-link": "0.11.
|
|
40
|
-
"@justeattakeaway/pie-modal": "0.33.
|
|
36
|
+
"@justeattakeaway/pie-button": "0.39.1",
|
|
37
|
+
"@justeattakeaway/pie-divider": "0.9.2",
|
|
38
|
+
"@justeattakeaway/pie-icon-button": "0.21.3",
|
|
39
|
+
"@justeattakeaway/pie-link": "0.11.2",
|
|
40
|
+
"@justeattakeaway/pie-modal": "0.33.1",
|
|
41
41
|
"@justeattakeaway/pie-switch": "0.17.2",
|
|
42
|
-
"@justeattakeaway/pie-webc-core": "0.
|
|
42
|
+
"@justeattakeaway/pie-webc-core": "0.12.0"
|
|
43
43
|
},
|
|
44
44
|
"volta": {
|
|
45
45
|
"extends": "../../../package.json"
|