@justai/cuts 0.3.2 → 0.4.0
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/package.json +1 -1
- package/src/Base.astro +18 -3
package/package.json
CHANGED
package/src/Base.astro
CHANGED
|
@@ -40,8 +40,11 @@ interface Props {
|
|
|
40
40
|
/** Defaults are the fleet majority, measured. Override when the persona genuinely differs. */
|
|
41
41
|
themeDark?: string;
|
|
42
42
|
themeLight?: string;
|
|
43
|
-
/** app.zone's property. justai.pro
|
|
44
|
-
|
|
43
|
+
/** app.zone's property by default. justai.pro passes its own. Pass `null` for a persona that runs
|
|
44
|
+
* NO analytics at all — the whole GA block and the consent banner are then not rendered. The
|
|
45
|
+
* privacy/terms sub-personas use this: the surface that proves it collects nothing by running
|
|
46
|
+
* nothing. */
|
|
47
|
+
gaId?: string | null;
|
|
45
48
|
}
|
|
46
49
|
|
|
47
50
|
const {
|
|
@@ -170,6 +173,13 @@ const localePath = (l: string) => (l === defaultLocale ? "/" : `/${l}/`);
|
|
|
170
173
|
has no access to component scope, so a bare `gaId` here would be undefined at runtime and
|
|
171
174
|
every persona would report to a property that does not exist — silently, with no failed
|
|
172
175
|
request and no console error, which is the only kind of analytics bug nobody finds. */}
|
|
176
|
+
{/* gaId can be null: a persona that measures NOTHING. Pass gaId={null} and the entire analytics
|
|
177
|
+
block below and the consent banner in the body are simply not rendered — no gtag, no cookie,
|
|
178
|
+
no request. The privacy/terms sub-personas run this way, and it is not an exception but their
|
|
179
|
+
character: the one surface that can prove it collects nothing by running nothing (doctrine 15).
|
|
180
|
+
The default stays app.zone's property, so every existing persona is unchanged — this costs the
|
|
181
|
+
ten that measure themselves exactly nothing. */}
|
|
182
|
+
{gaId && (
|
|
173
183
|
<script is:inline define:vars={{ gaId }}>
|
|
174
184
|
window.dataLayer = window.dataLayer || [];
|
|
175
185
|
function gtag() { dataLayer.push(arguments); }
|
|
@@ -196,11 +206,15 @@ const localePath = (l: string) => (l === defaultLocale ? "/" : `/${l}/`);
|
|
|
196
206
|
});
|
|
197
207
|
});
|
|
198
208
|
</script>
|
|
209
|
+
)}
|
|
199
210
|
</head>
|
|
200
211
|
<body>
|
|
201
212
|
<slot />
|
|
202
213
|
{/* Consent banner — shown only to European-timezone visitors with no stored choice. The
|
|
203
|
-
Consent Mode region default already denies analytics for the EEA/UK until "Allow".
|
|
214
|
+
Consent Mode region default already denies analytics for the EEA/UK until "Allow". Gated on
|
|
215
|
+
gaId with the analytics block above: a persona that runs no analytics has nothing to consent
|
|
216
|
+
to, so it renders no banner. */}
|
|
217
|
+
{gaId && (
|
|
204
218
|
<div id="cc" class="cc" role="dialog" aria-label={t.chromePrivacy}>
|
|
205
219
|
<div class="cc-card">
|
|
206
220
|
<p class="cc-text">{t.consentText}</p>
|
|
@@ -246,5 +260,6 @@ const localePath = (l: string) => (l === defaultLocale ? "/" : `/${l}/`);
|
|
|
246
260
|
} catch (_) {}
|
|
247
261
|
})();
|
|
248
262
|
</script>
|
|
263
|
+
)}
|
|
249
264
|
</body>
|
|
250
265
|
</html>
|