@devslab/site-kit 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.
- package/README.ko.md +6 -5
- package/README.md +6 -5
- package/dist/consent.d.ts +10 -2
- package/dist/consent.d.ts.map +1 -1
- package/dist/solid.js +79 -89
- package/dist/solid.js.map +1 -1
- package/dist/solid.server.js +21 -28
- package/dist/solid.server.js.map +1 -1
- package/package.json +2 -2
- package/src/core/consent.d.mts +9 -0
- package/src/core/consent.mjs +25 -15
- package/src/core/index.d.mts +1 -0
- package/src/core/index.mjs +15 -11
- package/styles.css +31 -13
package/dist/solid.server.js
CHANGED
|
@@ -534,6 +534,8 @@ var _tmpl$6$3 = [
|
|
|
534
534
|
" aria-haspopup=\"dialog\">",
|
|
535
535
|
"</button>"
|
|
536
536
|
];
|
|
537
|
+
/** A link with a non-empty `#fragment`: the policy section, not the top of the page. */
|
|
538
|
+
var POLICY_SECTION_HREF = /^[^#\s]*#[^#\s]+$/;
|
|
537
539
|
/**
|
|
538
540
|
* The consent bar and its settings dialog (D-034).
|
|
539
541
|
*
|
|
@@ -544,9 +546,11 @@ var _tmpl$6$3 = [
|
|
|
544
546
|
*
|
|
545
547
|
* The bar's three choices are the same button, the same size: "모두 허용",
|
|
546
548
|
* "거부", "설정". Closing it any other way (✕, Escape) is no decision —
|
|
547
|
-
* nothing loads, and the next visit asks again.
|
|
549
|
+
* nothing loads, and the next visit asks again. Its text is short; the
|
|
550
|
+
* disclosure lives in the policy section `learnMoreHref` points at.
|
|
548
551
|
*/
|
|
549
552
|
function ConsentBanner(props) {
|
|
553
|
+
if (typeof props.learnMoreHref !== "string" || !POLICY_SECTION_HREF.test(props.learnMoreHref)) throw new RangeError(`ConsentBanner: learnMoreHref must link to the privacy policy's analytics section with its #anchor (e.g. /privacy#analytics), got ${JSON.stringify(props.learnMoreHref)}`);
|
|
550
554
|
const [mounted, setMounted] = createSignal(false);
|
|
551
555
|
const [undecided, setUndecided] = createSignal(false);
|
|
552
556
|
const [dismissed, setDismissed] = createSignal(false);
|
|
@@ -599,7 +603,7 @@ function ConsentBanner(props) {
|
|
|
599
603
|
return memo(() => !!undecided())() && !dismissed();
|
|
600
604
|
},
|
|
601
605
|
get children() {
|
|
602
|
-
return ssr(_tmpl$$5, ssrHydrationKey(), ssrAttribute("aria-label", escape(props.messages.regionLabel, true), false), escape(props.messages.title), escape(props.messages.body), ssrAttribute("href", escape(props.
|
|
606
|
+
return ssr(_tmpl$$5, ssrHydrationKey(), ssrAttribute("aria-label", escape(props.messages.regionLabel, true), false), escape(props.messages.title), escape(props.messages.body), ssrAttribute("href", escape(props.learnMoreHref, true), false), escape(props.messages.learnMore), escape(createComponent(Button, {
|
|
603
607
|
"class": "site-consent__action",
|
|
604
608
|
tone: "secondary",
|
|
605
609
|
onClick: acceptAll,
|
|
@@ -653,32 +657,21 @@ function ConsentBanner(props) {
|
|
|
653
657
|
return props.messages.settingsIntro;
|
|
654
658
|
},
|
|
655
659
|
get actions() {
|
|
656
|
-
return [
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
}
|
|
672
|
-
}),
|
|
673
|
-
createComponent(Button, {
|
|
674
|
-
"class": "site-consent__action",
|
|
675
|
-
tone: "secondary",
|
|
676
|
-
onClick: () => decide(() => props.controller.save({ analytics: analytics() })),
|
|
677
|
-
get children() {
|
|
678
|
-
return props.messages.save;
|
|
679
|
-
}
|
|
680
|
-
})
|
|
681
|
-
];
|
|
660
|
+
return [createComponent(Button, {
|
|
661
|
+
"class": "site-consent__action",
|
|
662
|
+
tone: "secondary",
|
|
663
|
+
onClick: () => setSettingsOpen(false),
|
|
664
|
+
get children() {
|
|
665
|
+
return props.messages.cancel;
|
|
666
|
+
}
|
|
667
|
+
}), createComponent(Button, {
|
|
668
|
+
"class": "site-consent__action",
|
|
669
|
+
tone: "secondary",
|
|
670
|
+
onClick: () => decide(() => props.controller.save({ analytics: analytics() })),
|
|
671
|
+
get children() {
|
|
672
|
+
return props.messages.save;
|
|
673
|
+
}
|
|
674
|
+
})];
|
|
682
675
|
},
|
|
683
676
|
get children() {
|
|
684
677
|
return [
|