@gem-sdk/plugin-cookie-bar 3.0.0-pre-production.1 → 3.1.0-staging.1137
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/dist/cjs/components/CookieBar.js +1 -41
- package/dist/cjs/index.js +1 -11
- package/dist/cjs/setting/CookieBar.js +1 -10
- package/dist/esm/components/CookieBar.js +1 -37
- package/dist/esm/index.js +1 -6
- package/dist/esm/setting/CookieBar.js +1 -6
- package/dist/types/index.d.ts +3 -2
- package/package.json +5 -6
- package/dist/cjs/setting/index.js +0 -11
- package/dist/esm/setting/index.js +0 -7
|
@@ -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,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var CookieBar = require('./components/CookieBar.js');
|
|
6
|
-
var index = require('./setting/index.js');
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
exports.default = CookieBar.default;
|
|
11
|
-
exports.builderSetting = index.default;
|
|
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,6 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { default as builderSetting } from './setting/index.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export { 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/dist/types/index.d.ts
CHANGED
|
@@ -4,10 +4,11 @@ import { BaseProps } from '@gem-sdk/core';
|
|
|
4
4
|
type CookieBarProps = BaseProps<{
|
|
5
5
|
content?: string;
|
|
6
6
|
}>;
|
|
7
|
+
|
|
7
8
|
declare const CookieBar: React.FC<CookieBarProps>;
|
|
8
9
|
|
|
9
|
-
declare const
|
|
10
|
+
declare const builderSetting: {
|
|
10
11
|
CookieBar: _gem_sdk_core.ComponentSetting<CookieBarProps>;
|
|
11
12
|
};
|
|
12
13
|
|
|
13
|
-
export {
|
|
14
|
+
export { builderSetting, CookieBar as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/plugin-cookie-bar",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.0-staging.1137",
|
|
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": "3.0.0-pre-production.1"
|
|
22
|
+
"@gem-sdk/core": "3.1.0-staging.1137",
|
|
23
|
+
"@gem-sdk/styles": "3.1.0-staging.1137"
|
|
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",
|