@gem-sdk/plugin-cookie-bar 2.0.0-staging.711 → 2.0.0-staging.860
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,41 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var react = require('react');
|
|
7
|
-
|
|
8
|
-
const CookieBar = ({ setting })=>{
|
|
9
|
-
const [isVisible, setIsVisible] = react.useState(window.localStorage.getItem('accepted-cookie') !== 'true');
|
|
10
|
-
const acceptCookie = ()=>{
|
|
11
|
-
window.localStorage.setItem('accepted-cookie', 'true');
|
|
12
|
-
setIsVisible(false);
|
|
13
|
-
};
|
|
14
|
-
if (!isVisible) return null;
|
|
15
|
-
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
16
|
-
className: "gp-fixed gp-inset-x-0 gp-bottom-0 gp-z-90 gp-flex gp-items-center gp-gap-4 gp-bg-white gp-py-6",
|
|
17
|
-
children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
18
|
-
className: "gp-mx-auto gp-flex gp-items-center gp-gap-4",
|
|
19
|
-
children: [
|
|
20
|
-
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
21
|
-
dangerouslySetInnerHTML: {
|
|
22
|
-
__html: setting?.content ?? ''
|
|
23
|
-
}
|
|
24
|
-
}),
|
|
25
|
-
/*#__PURE__*/ jsxRuntime.jsx("button", {
|
|
26
|
-
onClick: acceptCookie,
|
|
27
|
-
"aria-label": "Accept cookie",
|
|
28
|
-
className: "gp-bg-slate-900 gp-px-4 gp-py-2 gp-uppercase gp-text-white",
|
|
29
|
-
children: "Accept cookies"
|
|
30
|
-
})
|
|
31
|
-
]
|
|
32
|
-
})
|
|
33
|
-
});
|
|
34
|
-
};
|
|
35
|
-
CookieBar.defaultProps = {
|
|
36
|
-
setting: {
|
|
37
|
-
content: `<div><span>This site uses cookies to improve your experience. By clicking, you agree to our Privacy Policy.</span></div>`
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
exports.default = CookieBar;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),react=require("react");const CookieBar=({setting:e})=>{let[t,i]=react.useState("true"!==window.localStorage.getItem("accepted-cookie")),o=()=>{window.localStorage.setItem("accepted-cookie","true"),i(!1)};return t?jsxRuntime.jsx("div",{className:"gp-fixed gp-inset-x-0 gp-bottom-0 gp-z-90 gp-flex gp-items-center gp-gap-4 gp-bg-white gp-py-6",children:jsxRuntime.jsxs("div",{className:"gp-mx-auto gp-flex gp-items-center gp-gap-4",children:[jsxRuntime.jsx("div",{dangerouslySetInnerHTML:{__html:e?.content??""}}),jsxRuntime.jsx("button",{onClick:o,"aria-label":"Accept cookie",className:"gp-bg-slate-900 gp-px-4 gp-py-2 gp-uppercase gp-text-white",children:"Accept cookies"})]})}):null};CookieBar.defaultProps={setting:{content:"<div><span>This site uses cookies to improve your experience. By clicking, you agree to our Privacy Policy.</span></div>"}},exports.default=CookieBar;
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,13 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var CookieBar = require('./components/CookieBar.js');
|
|
6
|
-
var CookieBar$1 = require('./setting/CookieBar.js');
|
|
7
|
-
|
|
8
|
-
const builderSetting = {
|
|
9
|
-
CookieBar: CookieBar$1.default
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
exports.default = CookieBar.default;
|
|
13
|
-
exports.builderSetting = builderSetting;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var CookieBar=require("./components/CookieBar.js"),CookieBar$1=require("./setting/CookieBar.js");const builderSetting={CookieBar:CookieBar$1.default};exports.default=CookieBar.default,exports.builderSetting=builderSetting;
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const config = {
|
|
6
|
-
tag: 'CookieBar',
|
|
7
|
-
label: 'Cookie Bar'
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
exports.default = config;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const config={tag:"CookieBar",label:"Cookie Bar"};exports.default=config;
|
|
@@ -1,37 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
|
|
4
|
-
const CookieBar = ({ setting })=>{
|
|
5
|
-
const [isVisible, setIsVisible] = useState(window.localStorage.getItem('accepted-cookie') !== 'true');
|
|
6
|
-
const acceptCookie = ()=>{
|
|
7
|
-
window.localStorage.setItem('accepted-cookie', 'true');
|
|
8
|
-
setIsVisible(false);
|
|
9
|
-
};
|
|
10
|
-
if (!isVisible) return null;
|
|
11
|
-
return /*#__PURE__*/ jsx("div", {
|
|
12
|
-
className: "gp-fixed gp-inset-x-0 gp-bottom-0 gp-z-90 gp-flex gp-items-center gp-gap-4 gp-bg-white gp-py-6",
|
|
13
|
-
children: /*#__PURE__*/ jsxs("div", {
|
|
14
|
-
className: "gp-mx-auto gp-flex gp-items-center gp-gap-4",
|
|
15
|
-
children: [
|
|
16
|
-
/*#__PURE__*/ jsx("div", {
|
|
17
|
-
dangerouslySetInnerHTML: {
|
|
18
|
-
__html: setting?.content ?? ''
|
|
19
|
-
}
|
|
20
|
-
}),
|
|
21
|
-
/*#__PURE__*/ jsx("button", {
|
|
22
|
-
onClick: acceptCookie,
|
|
23
|
-
"aria-label": "Accept cookie",
|
|
24
|
-
className: "gp-bg-slate-900 gp-px-4 gp-py-2 gp-uppercase gp-text-white",
|
|
25
|
-
children: "Accept cookies"
|
|
26
|
-
})
|
|
27
|
-
]
|
|
28
|
-
})
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
CookieBar.defaultProps = {
|
|
32
|
-
setting: {
|
|
33
|
-
content: `<div><span>This site uses cookies to improve your experience. By clicking, you agree to our Privacy Policy.</span></div>`
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export { CookieBar as default };
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useState as o}from"react";let CookieBar=({setting:i})=>{let[p,c]=o("true"!==window.localStorage.getItem("accepted-cookie")),a=()=>{window.localStorage.setItem("accepted-cookie","true"),c(!1)};return p?e("div",{className:"gp-fixed gp-inset-x-0 gp-bottom-0 gp-z-90 gp-flex gp-items-center gp-gap-4 gp-bg-white gp-py-6",children:t("div",{className:"gp-mx-auto gp-flex gp-items-center gp-gap-4",children:[e("div",{dangerouslySetInnerHTML:{__html:i?.content??""}}),e("button",{onClick:a,"aria-label":"Accept cookie",className:"gp-bg-slate-900 gp-px-4 gp-py-2 gp-uppercase gp-text-white",children:"Accept cookies"})]})}):null};CookieBar.defaultProps={setting:{content:"<div><span>This site uses cookies to improve your experience. By clicking, you agree to our Privacy Policy.</span></div>"}};export{CookieBar as default};
|
package/dist/esm/index.js
CHANGED
|
@@ -1,8 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import config from './setting/CookieBar.js';
|
|
3
|
-
|
|
4
|
-
const builderSetting = {
|
|
5
|
-
CookieBar: config
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export { builderSetting, CookieBar as default };
|
|
1
|
+
import o from"./components/CookieBar.js";import e from"./setting/CookieBar.js";let builderSetting={CookieBar:e};export{builderSetting,o as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/plugin-cookie-bar",
|
|
3
|
-
"version": "2.0.0-staging.
|
|
3
|
+
"version": "2.0.0-staging.860",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -19,13 +19,12 @@
|
|
|
19
19
|
"test": "jest -c ./../../helpers/jest.config.ts"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@gem-sdk/
|
|
23
|
-
"@gem-sdk/
|
|
24
|
-
"@gem-sdk/styles": "2.0.0-staging.711"
|
|
22
|
+
"@gem-sdk/core": "2.0.0-staging.860",
|
|
23
|
+
"@gem-sdk/styles": "2.0.0-staging.784"
|
|
25
24
|
},
|
|
26
25
|
"peerDependencies": {
|
|
27
|
-
"react": "^
|
|
28
|
-
"react-dom": "^
|
|
26
|
+
"react": "^18",
|
|
27
|
+
"react-dom": "^18"
|
|
29
28
|
},
|
|
30
29
|
"module": "dist/esm/index.js",
|
|
31
30
|
"types": "dist/types/index.d.ts",
|