@scalemule/news-publication 0.0.7
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/LICENSE +21 -0
- package/README.md +74 -0
- package/cookie-consent.css +419 -0
- package/dist/chunk-C7JTEHTH.js +158 -0
- package/dist/chunk-GB36YM56.js +72 -0
- package/dist/chunk-PYCU2T5O.js +93 -0
- package/dist/chunk-R33MJWND.js +261 -0
- package/dist/chunk-TJ7RL3PV.js +252 -0
- package/dist/chunk-YQXS2KQI.js +112 -0
- package/dist/cookie-consent-banner.cjs +210 -0
- package/dist/cookie-consent-banner.d.cts +19 -0
- package/dist/cookie-consent-banner.d.ts +19 -0
- package/dist/cookie-consent-banner.js +3 -0
- package/dist/cookie-settings-view.cjs +470 -0
- package/dist/cookie-settings-view.d.cts +15 -0
- package/dist/cookie-settings-view.d.ts +15 -0
- package/dist/cookie-settings-view.js +3 -0
- package/dist/index.cjs +1460 -0
- package/dist/index.d.cts +317 -0
- package/dist/index.d.ts +317 -0
- package/dist/index.js +441 -0
- package/dist/marketplace-Ch7mdJZv.d.cts +123 -0
- package/dist/marketplace-Ch7mdJZv.d.ts +123 -0
- package/dist/marketplace-forms.cjs +134 -0
- package/dist/marketplace-forms.d.cts +10 -0
- package/dist/marketplace-forms.d.ts +10 -0
- package/dist/marketplace-forms.js +115 -0
- package/dist/marketplace-view.cjs +110 -0
- package/dist/marketplace-view.d.cts +21 -0
- package/dist/marketplace-view.d.ts +21 -0
- package/dist/marketplace-view.js +85 -0
- package/dist/meet-5Ym5bxfh.d.cts +79 -0
- package/dist/meet-5Ym5bxfh.d.ts +79 -0
- package/dist/meet-forms.cjs +188 -0
- package/dist/meet-forms.d.cts +13 -0
- package/dist/meet-forms.d.ts +13 -0
- package/dist/meet-forms.js +166 -0
- package/dist/meet-view.cjs +82 -0
- package/dist/meet-view.d.cts +23 -0
- package/dist/meet-view.d.ts +23 -0
- package/dist/meet-view.js +59 -0
- package/dist/snapshot-BS4hn1dk.d.cts +234 -0
- package/dist/snapshot-BS4hn1dk.d.ts +234 -0
- package/dist/snapshot-file.cjs +192 -0
- package/dist/snapshot-file.d.cts +21 -0
- package/dist/snapshot-file.d.ts +21 -0
- package/dist/snapshot-file.js +38 -0
- package/marketplace.css +61 -0
- package/package.json +103 -0
- package/tokens/broadsheet.css +61 -0
|
@@ -0,0 +1,470 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var react = require('react');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
|
|
7
|
+
// src/cookies.ts
|
|
8
|
+
var COOKIE_CONSENT_KEY = "sm_cookie_consent_v1";
|
|
9
|
+
var COOKIE_CONSENT_BACKUP_KEY = "napsite_cookie_consent_v1";
|
|
10
|
+
var COOKIE_CONSENT_EVENT = "scalemule-cookie-consent-change";
|
|
11
|
+
var COOKIE_CONSENT_MAX_AGE_SECONDS = 365 * 24 * 60 * 60;
|
|
12
|
+
var DEFAULT_PREFERENCES_REJECTED = {
|
|
13
|
+
essential: true,
|
|
14
|
+
performance: false,
|
|
15
|
+
functional: false,
|
|
16
|
+
advertising: false
|
|
17
|
+
};
|
|
18
|
+
var DEFAULT_PREFERENCES_ACCEPTED = {
|
|
19
|
+
essential: true,
|
|
20
|
+
performance: true,
|
|
21
|
+
functional: true,
|
|
22
|
+
advertising: true
|
|
23
|
+
};
|
|
24
|
+
var COOKIE_CATEGORIES = [
|
|
25
|
+
{
|
|
26
|
+
id: "essential",
|
|
27
|
+
title: "Strictly Necessary Cookies",
|
|
28
|
+
shortDescription: "Essential for site security, navigation, and privacy preference management.",
|
|
29
|
+
fullDescription: "These cookies are necessary for the website to function properly and securely. They enable core features such as load balancing, CSRF protection, secure session tokens, and remembering your cookie consent choice. Because the site cannot function without them, they cannot be turned off.",
|
|
30
|
+
required: true,
|
|
31
|
+
cookies: [
|
|
32
|
+
{
|
|
33
|
+
name: "sm_cookie_consent_v1",
|
|
34
|
+
provider: "First-Party (ScaleMule)",
|
|
35
|
+
purpose: "Stores your verified cookie privacy and category consent choices.",
|
|
36
|
+
duration: "1 year",
|
|
37
|
+
type: "HTTP Cookie"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "napsite_session_v1",
|
|
41
|
+
provider: "First-Party",
|
|
42
|
+
purpose: "Maintains session continuity, security tokens, and server routing.",
|
|
43
|
+
duration: "30 minutes (idle)",
|
|
44
|
+
type: "Session Storage"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: "napsite_preview",
|
|
48
|
+
provider: "First-Party",
|
|
49
|
+
purpose: "Verifies preview access permissions when viewing unpublished newsroom editions.",
|
|
50
|
+
duration: "14 days",
|
|
51
|
+
type: "HTTP Cookie"
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: "performance",
|
|
57
|
+
title: "Performance & Analytics Cookies",
|
|
58
|
+
shortDescription: "Help us measure reader engagement, story completion, and site reliability.",
|
|
59
|
+
fullDescription: "These cookies collect anonymous information about how visitors navigate our news publication. They allow us to count article reads, understand scroll depth and reading completion, and identify broken links or slow-loading assets so we can keep our community reporting responsive and fast. All metrics are aggregated and never contain personal information.",
|
|
60
|
+
required: false,
|
|
61
|
+
cookies: [
|
|
62
|
+
{
|
|
63
|
+
name: "napsite_visitor_v1",
|
|
64
|
+
provider: "First-Party",
|
|
65
|
+
purpose: "A randomized anonymous UUIDv7 to count distinct readers without tracking personal identity.",
|
|
66
|
+
duration: "1 year",
|
|
67
|
+
type: "Local Storage"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: "napsite_analytics_v1",
|
|
71
|
+
provider: "First-Party",
|
|
72
|
+
purpose: "Connects reading completion and web vitals to the anonymous session.",
|
|
73
|
+
duration: "30 minutes",
|
|
74
|
+
type: "HTTP Cookie"
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
id: "functional",
|
|
80
|
+
title: "Functional & Personalization Cookies",
|
|
81
|
+
shortDescription: "Remember your reading preferences, text size, and narration audio settings.",
|
|
82
|
+
fullDescription: "These cookies enable enhanced convenience features designed for readers. They remember your custom text sizing, keep your preferred audio narration playback speed (e.g., 1.0x vs 1.25x), and preserve your local town filters across the front page so you always see news closest to your neighborhood.",
|
|
83
|
+
required: false,
|
|
84
|
+
cookies: [
|
|
85
|
+
{
|
|
86
|
+
name: "reader_text_size",
|
|
87
|
+
provider: "First-Party",
|
|
88
|
+
purpose: "Remembers your preferred reading font size across articles.",
|
|
89
|
+
duration: "1 year",
|
|
90
|
+
type: "Local Storage"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: "audio_narration_speed",
|
|
94
|
+
provider: "First-Party",
|
|
95
|
+
purpose: "Stores your preferred audio player playback rate (e.g. 1.0x, 1.25x).",
|
|
96
|
+
duration: "1 year",
|
|
97
|
+
type: "Local Storage"
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
id: "advertising",
|
|
103
|
+
title: "Advertising & Local Sponsorship Cookies",
|
|
104
|
+
shortDescription: "Support local business sponsors by capping repetition and measuring notices.",
|
|
105
|
+
fullDescription: "Our journalism is supported by local business sponsors and community partners. These cookies ensure you do not see the same sponsor banner repeatedly (frequency capping) and help local merchants measure whether their announcement reached their community. They never track your activity across unrelated third-party websites or build external advertising profiles.",
|
|
106
|
+
required: false,
|
|
107
|
+
cookies: [
|
|
108
|
+
{
|
|
109
|
+
name: "napsite_sponsor_cap",
|
|
110
|
+
provider: "First-Party",
|
|
111
|
+
purpose: "Prevents repetitive display of identical local business announcements.",
|
|
112
|
+
duration: "7 days",
|
|
113
|
+
type: "Local Storage"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: "local_sponsor_ref",
|
|
117
|
+
provider: "First-Party",
|
|
118
|
+
purpose: "Attributes community inquiries directly to the sponsoring local merchant.",
|
|
119
|
+
duration: "30 days",
|
|
120
|
+
type: "Local Storage"
|
|
121
|
+
}
|
|
122
|
+
]
|
|
123
|
+
}
|
|
124
|
+
];
|
|
125
|
+
var memoryConsent = null;
|
|
126
|
+
function readCookie(name) {
|
|
127
|
+
if (typeof document === "undefined") return null;
|
|
128
|
+
const match = document.cookie.match(new RegExp("(?:^|; )" + name.replace(/([.$?*|{}()[\]\\/+^])/g, "\\$1") + "=([^;]*)"));
|
|
129
|
+
return match ? decodeURIComponent(match[1]) : null;
|
|
130
|
+
}
|
|
131
|
+
function writeCookie(name, value, maxAgeSeconds) {
|
|
132
|
+
if (typeof document === "undefined") return;
|
|
133
|
+
const secure = typeof location !== "undefined" && location.protocol === "https:" ? "; Secure" : "";
|
|
134
|
+
document.cookie = `${name}=${encodeURIComponent(value)}; Path=/; Max-Age=${maxAgeSeconds}; SameSite=Lax${secure}`;
|
|
135
|
+
}
|
|
136
|
+
function getCookieConsent() {
|
|
137
|
+
if (typeof window === "undefined") return memoryConsent;
|
|
138
|
+
try {
|
|
139
|
+
const raw = readCookie(COOKIE_CONSENT_KEY) || readCookie(COOKIE_CONSENT_BACKUP_KEY);
|
|
140
|
+
if (raw) {
|
|
141
|
+
const parsed = JSON.parse(raw);
|
|
142
|
+
if (parsed && parsed.version === 1 && parsed.preferences) {
|
|
143
|
+
memoryConsent = parsed;
|
|
144
|
+
return parsed;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
const stored = window.localStorage?.getItem(COOKIE_CONSENT_KEY);
|
|
148
|
+
if (stored) {
|
|
149
|
+
const parsed = JSON.parse(stored);
|
|
150
|
+
if (parsed && parsed.version === 1 && parsed.preferences) {
|
|
151
|
+
memoryConsent = parsed;
|
|
152
|
+
return parsed;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
} catch {
|
|
156
|
+
}
|
|
157
|
+
return memoryConsent;
|
|
158
|
+
}
|
|
159
|
+
function setCookieConsent(preferences, source = "settings_save") {
|
|
160
|
+
const mergedPreferences = {
|
|
161
|
+
essential: true,
|
|
162
|
+
performance: Boolean(preferences.performance),
|
|
163
|
+
functional: Boolean(preferences.functional),
|
|
164
|
+
advertising: Boolean(preferences.advertising)
|
|
165
|
+
};
|
|
166
|
+
let anonymous_id;
|
|
167
|
+
if (typeof window !== "undefined") {
|
|
168
|
+
try {
|
|
169
|
+
anonymous_id = window.localStorage?.getItem("napsite_visitor_v1") || void 0;
|
|
170
|
+
} catch {
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
const record = {
|
|
174
|
+
version: 1,
|
|
175
|
+
preferences: mergedPreferences,
|
|
176
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
177
|
+
anonymous_id,
|
|
178
|
+
source
|
|
179
|
+
};
|
|
180
|
+
memoryConsent = record;
|
|
181
|
+
const serialized = JSON.stringify(record);
|
|
182
|
+
writeCookie(COOKIE_CONSENT_KEY, serialized, COOKIE_CONSENT_MAX_AGE_SECONDS);
|
|
183
|
+
writeCookie(COOKIE_CONSENT_BACKUP_KEY, serialized, COOKIE_CONSENT_MAX_AGE_SECONDS);
|
|
184
|
+
if (typeof window !== "undefined") {
|
|
185
|
+
try {
|
|
186
|
+
window.localStorage?.setItem(COOKIE_CONSENT_KEY, serialized);
|
|
187
|
+
} catch {
|
|
188
|
+
}
|
|
189
|
+
window.dispatchEvent(new CustomEvent(COOKIE_CONSENT_EVENT, { detail: record }));
|
|
190
|
+
}
|
|
191
|
+
return record;
|
|
192
|
+
}
|
|
193
|
+
async function recordConsentToCompliance(record, options) {
|
|
194
|
+
if (typeof window === "undefined") return;
|
|
195
|
+
const endpoint = options?.endpoint || "/api/compliance/consent";
|
|
196
|
+
try {
|
|
197
|
+
const payload = {
|
|
198
|
+
consent_type: "cookie_policy",
|
|
199
|
+
granted: record.preferences.performance || record.preferences.advertising,
|
|
200
|
+
preferences: record.preferences,
|
|
201
|
+
source: record.source,
|
|
202
|
+
anonymous_id: record.anonymous_id,
|
|
203
|
+
timestamp: record.timestamp,
|
|
204
|
+
url: window.location.href,
|
|
205
|
+
user_agent: window.navigator.userAgent
|
|
206
|
+
};
|
|
207
|
+
if (typeof navigator.sendBeacon === "function") {
|
|
208
|
+
navigator.sendBeacon(endpoint, new Blob([JSON.stringify(payload)], { type: "application/json" }));
|
|
209
|
+
} else {
|
|
210
|
+
await fetch(endpoint, {
|
|
211
|
+
method: "POST",
|
|
212
|
+
headers: { "content-type": "application/json" },
|
|
213
|
+
body: JSON.stringify(payload),
|
|
214
|
+
keepalive: true
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
} catch {
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
function CookieSettingsView({
|
|
221
|
+
publicationName = "This Publication",
|
|
222
|
+
region,
|
|
223
|
+
complianceEndpoint = "/api/compliance/consent",
|
|
224
|
+
publicationSlug
|
|
225
|
+
}) {
|
|
226
|
+
const [preferences, setPreferences] = react.useState(() => {
|
|
227
|
+
const existing = getCookieConsent();
|
|
228
|
+
return existing ? existing.preferences : { ...DEFAULT_PREFERENCES_ACCEPTED };
|
|
229
|
+
});
|
|
230
|
+
const [expandedCategories, setExpandedCategories] = react.useState({
|
|
231
|
+
essential: false,
|
|
232
|
+
performance: false,
|
|
233
|
+
functional: false,
|
|
234
|
+
advertising: false
|
|
235
|
+
});
|
|
236
|
+
const [saveSuccess, setSaveSuccess] = react.useState(false);
|
|
237
|
+
const [lastSavedTime, setLastSavedTime] = react.useState(null);
|
|
238
|
+
react.useEffect(() => {
|
|
239
|
+
const existing = getCookieConsent();
|
|
240
|
+
if (existing) {
|
|
241
|
+
setPreferences(existing.preferences);
|
|
242
|
+
setLastSavedTime(new Date(existing.timestamp).toLocaleTimeString([], { hour: "numeric", minute: "2-digit" }));
|
|
243
|
+
}
|
|
244
|
+
}, []);
|
|
245
|
+
const handleToggle = (category) => {
|
|
246
|
+
if (category === "essential") return;
|
|
247
|
+
setPreferences((prev) => ({
|
|
248
|
+
...prev,
|
|
249
|
+
[category]: !prev[category]
|
|
250
|
+
}));
|
|
251
|
+
setSaveSuccess(false);
|
|
252
|
+
};
|
|
253
|
+
const toggleExpand = (category) => {
|
|
254
|
+
setExpandedCategories((prev) => ({
|
|
255
|
+
...prev,
|
|
256
|
+
[category]: !prev[category]
|
|
257
|
+
}));
|
|
258
|
+
};
|
|
259
|
+
const handleSave = () => {
|
|
260
|
+
const record = setCookieConsent(preferences, "settings_save");
|
|
261
|
+
setSaveSuccess(true);
|
|
262
|
+
setLastSavedTime(new Date(record.timestamp).toLocaleTimeString([], { hour: "numeric", minute: "2-digit" }));
|
|
263
|
+
void recordConsentToCompliance(record, {
|
|
264
|
+
endpoint: complianceEndpoint});
|
|
265
|
+
window.scrollTo({ top: 0, behavior: "smooth" });
|
|
266
|
+
};
|
|
267
|
+
const handleAcceptAll = () => {
|
|
268
|
+
setPreferences({ ...DEFAULT_PREFERENCES_ACCEPTED });
|
|
269
|
+
const record = setCookieConsent(DEFAULT_PREFERENCES_ACCEPTED, "settings_save");
|
|
270
|
+
setSaveSuccess(true);
|
|
271
|
+
setLastSavedTime(new Date(record.timestamp).toLocaleTimeString([], { hour: "numeric", minute: "2-digit" }));
|
|
272
|
+
void recordConsentToCompliance(record, {
|
|
273
|
+
endpoint: complianceEndpoint});
|
|
274
|
+
window.scrollTo({ top: 0, behavior: "smooth" });
|
|
275
|
+
};
|
|
276
|
+
const handleRejectAll = () => {
|
|
277
|
+
setPreferences({ ...DEFAULT_PREFERENCES_REJECTED });
|
|
278
|
+
const record = setCookieConsent(DEFAULT_PREFERENCES_REJECTED, "settings_save");
|
|
279
|
+
setSaveSuccess(true);
|
|
280
|
+
setLastSavedTime(new Date(record.timestamp).toLocaleTimeString([], { hour: "numeric", minute: "2-digit" }));
|
|
281
|
+
void recordConsentToCompliance(record, {
|
|
282
|
+
endpoint: complianceEndpoint});
|
|
283
|
+
window.scrollTo({ top: 0, behavior: "smooth" });
|
|
284
|
+
};
|
|
285
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sm-cookie-settings-container", children: [
|
|
286
|
+
/* @__PURE__ */ jsxRuntime.jsxs("header", { className: "sm-cookie-settings-header", children: [
|
|
287
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sm-cookie-settings-eyebrow", children: [
|
|
288
|
+
publicationName,
|
|
289
|
+
" \xB7 Legal & Privacy"
|
|
290
|
+
] }),
|
|
291
|
+
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "sm-cookie-settings-title", children: "Cookie Settings & Privacy Controls" }),
|
|
292
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "sm-cookie-settings-intro", children: [
|
|
293
|
+
"We believe in transparent, neighborly community journalism. When you visit ",
|
|
294
|
+
publicationName,
|
|
295
|
+
region ? ` across ${region}` : "",
|
|
296
|
+
", we use cookies and process device data to ensure the website is secure, reliable, and easy to read. Review our cookie categories below, view detailed technical disclosures, and choose your preferences at any time."
|
|
297
|
+
] })
|
|
298
|
+
] }),
|
|
299
|
+
saveSuccess && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sm-cookie-alert-success", role: "status", "aria-live": "polite", children: [
|
|
300
|
+
/* @__PURE__ */ jsxRuntime.jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
301
|
+
"path",
|
|
302
|
+
{
|
|
303
|
+
d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.707l-4.5 4.5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L8.5 10.586l3.793-3.793a1 1 0 011.414 1.414z",
|
|
304
|
+
fill: "currentColor"
|
|
305
|
+
}
|
|
306
|
+
) }),
|
|
307
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
308
|
+
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Preferences Saved." }),
|
|
309
|
+
" Your cookie choices have been updated",
|
|
310
|
+
lastSavedTime ? ` (at ${lastSavedTime})` : "",
|
|
311
|
+
" and will be remembered across all community editions."
|
|
312
|
+
] })
|
|
313
|
+
] }),
|
|
314
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sm-cookie-global-actions", children: [
|
|
315
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
316
|
+
"button",
|
|
317
|
+
{
|
|
318
|
+
type: "button",
|
|
319
|
+
className: "sm-cookie-btn sm-cookie-btn-secondary",
|
|
320
|
+
onClick: handleRejectAll,
|
|
321
|
+
children: "Reject Optional Cookies"
|
|
322
|
+
}
|
|
323
|
+
),
|
|
324
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
325
|
+
"button",
|
|
326
|
+
{
|
|
327
|
+
type: "button",
|
|
328
|
+
className: "sm-cookie-btn sm-cookie-btn-secondary",
|
|
329
|
+
onClick: handleAcceptAll,
|
|
330
|
+
children: "Accept All Cookies"
|
|
331
|
+
}
|
|
332
|
+
),
|
|
333
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
334
|
+
"button",
|
|
335
|
+
{
|
|
336
|
+
type: "button",
|
|
337
|
+
className: "sm-cookie-btn sm-cookie-btn-primary",
|
|
338
|
+
onClick: handleSave,
|
|
339
|
+
children: "Save Preferences"
|
|
340
|
+
}
|
|
341
|
+
)
|
|
342
|
+
] }),
|
|
343
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "sm-cookie-category-list", children: COOKIE_CATEGORIES.map((category) => {
|
|
344
|
+
const isEssential = category.id === "essential";
|
|
345
|
+
const isChecked = isEssential || preferences[category.id];
|
|
346
|
+
const isExpanded = expandedCategories[category.id];
|
|
347
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
348
|
+
"section",
|
|
349
|
+
{
|
|
350
|
+
className: "sm-cookie-category-card",
|
|
351
|
+
"aria-labelledby": `cookie-cat-${category.id}`,
|
|
352
|
+
children: [
|
|
353
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sm-cookie-category-top", children: [
|
|
354
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { id: `cookie-cat-${category.id}`, className: "sm-cookie-category-heading", children: category.title }),
|
|
355
|
+
isEssential ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sm-cookie-badge-required", children: "Always Active" }) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
356
|
+
"label",
|
|
357
|
+
{
|
|
358
|
+
className: "sm-cookie-switch-label",
|
|
359
|
+
htmlFor: `toggle-${category.id}`,
|
|
360
|
+
"aria-label": `Toggle ${category.title}`,
|
|
361
|
+
children: [
|
|
362
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
363
|
+
"input",
|
|
364
|
+
{
|
|
365
|
+
id: `toggle-${category.id}`,
|
|
366
|
+
type: "checkbox",
|
|
367
|
+
className: "sm-cookie-switch-input",
|
|
368
|
+
checked: isChecked,
|
|
369
|
+
onChange: () => handleToggle(category.id)
|
|
370
|
+
}
|
|
371
|
+
),
|
|
372
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sm-cookie-switch-slider" })
|
|
373
|
+
]
|
|
374
|
+
}
|
|
375
|
+
)
|
|
376
|
+
] }),
|
|
377
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "sm-cookie-category-desc", children: category.fullDescription }),
|
|
378
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
379
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
380
|
+
"button",
|
|
381
|
+
{
|
|
382
|
+
type: "button",
|
|
383
|
+
className: "sm-cookie-details-toggle",
|
|
384
|
+
onClick: () => toggleExpand(category.id),
|
|
385
|
+
"aria-expanded": isExpanded,
|
|
386
|
+
children: [
|
|
387
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
388
|
+
"svg",
|
|
389
|
+
{
|
|
390
|
+
width: "14",
|
|
391
|
+
height: "14",
|
|
392
|
+
viewBox: "0 0 20 20",
|
|
393
|
+
fill: "currentColor",
|
|
394
|
+
style: {
|
|
395
|
+
transform: isExpanded ? "rotate(90deg)" : "rotate(0deg)",
|
|
396
|
+
transition: "transform 0.2s ease"
|
|
397
|
+
},
|
|
398
|
+
"aria-hidden": "true",
|
|
399
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
400
|
+
"path",
|
|
401
|
+
{
|
|
402
|
+
fillRule: "evenodd",
|
|
403
|
+
d: "M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",
|
|
404
|
+
clipRule: "evenodd"
|
|
405
|
+
}
|
|
406
|
+
)
|
|
407
|
+
}
|
|
408
|
+
),
|
|
409
|
+
isExpanded ? "Hide cookie disclosures" : `View ${category.cookies.length} cookie disclosures`
|
|
410
|
+
]
|
|
411
|
+
}
|
|
412
|
+
),
|
|
413
|
+
isExpanded && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sm-cookie-table-wrapper", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "sm-cookie-table", children: [
|
|
414
|
+
/* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
|
|
415
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { children: "Cookie Name" }),
|
|
416
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { children: "Provider" }),
|
|
417
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { children: "Duration" }),
|
|
418
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { children: "Storage Type" }),
|
|
419
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { children: "Purpose" })
|
|
420
|
+
] }) }),
|
|
421
|
+
/* @__PURE__ */ jsxRuntime.jsx("tbody", { children: category.cookies.map((cookie) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
|
|
422
|
+
/* @__PURE__ */ jsxRuntime.jsx("td", { children: /* @__PURE__ */ jsxRuntime.jsx("code", { className: "sm-cookie-code", children: cookie.name }) }),
|
|
423
|
+
/* @__PURE__ */ jsxRuntime.jsx("td", { children: cookie.provider }),
|
|
424
|
+
/* @__PURE__ */ jsxRuntime.jsx("td", { children: cookie.duration }),
|
|
425
|
+
/* @__PURE__ */ jsxRuntime.jsx("td", { children: cookie.type }),
|
|
426
|
+
/* @__PURE__ */ jsxRuntime.jsx("td", { children: cookie.purpose })
|
|
427
|
+
] }, cookie.name)) })
|
|
428
|
+
] }) })
|
|
429
|
+
] })
|
|
430
|
+
]
|
|
431
|
+
},
|
|
432
|
+
category.id
|
|
433
|
+
);
|
|
434
|
+
}) }),
|
|
435
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sm-cookie-save-bar", children: [
|
|
436
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "sm-cookie-save-status", children: lastSavedTime ? `Last saved: today at ${lastSavedTime}` : "No custom preferences saved yet." }),
|
|
437
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sm-cookie-save-buttons", children: [
|
|
438
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
439
|
+
"button",
|
|
440
|
+
{
|
|
441
|
+
type: "button",
|
|
442
|
+
className: "sm-cookie-btn sm-cookie-btn-secondary",
|
|
443
|
+
onClick: handleRejectAll,
|
|
444
|
+
children: "Reject Optional"
|
|
445
|
+
}
|
|
446
|
+
),
|
|
447
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
448
|
+
"button",
|
|
449
|
+
{
|
|
450
|
+
type: "button",
|
|
451
|
+
className: "sm-cookie-btn sm-cookie-btn-secondary",
|
|
452
|
+
onClick: handleAcceptAll,
|
|
453
|
+
children: "Accept All"
|
|
454
|
+
}
|
|
455
|
+
),
|
|
456
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
457
|
+
"button",
|
|
458
|
+
{
|
|
459
|
+
type: "button",
|
|
460
|
+
className: "sm-cookie-btn sm-cookie-btn-primary",
|
|
461
|
+
onClick: handleSave,
|
|
462
|
+
children: "Save Preferences"
|
|
463
|
+
}
|
|
464
|
+
)
|
|
465
|
+
] })
|
|
466
|
+
] })
|
|
467
|
+
] });
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
exports.CookieSettingsView = CookieSettingsView;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import react__default from 'react';
|
|
2
|
+
|
|
3
|
+
interface CookieSettingsViewProps {
|
|
4
|
+
/** The publication display name (e.g., "San Ramon Times") */
|
|
5
|
+
publicationName?: string;
|
|
6
|
+
/** Publication region / coverage context (e.g., "San Ramon Valley, California") */
|
|
7
|
+
region?: string;
|
|
8
|
+
/** Compliance endpoint for recording consent. Default: "/api/compliance/consent" */
|
|
9
|
+
complianceEndpoint?: string;
|
|
10
|
+
/** Optional publication slug for metadata */
|
|
11
|
+
publicationSlug?: string;
|
|
12
|
+
}
|
|
13
|
+
declare function CookieSettingsView({ publicationName, region, complianceEndpoint, publicationSlug, }: CookieSettingsViewProps): react__default.JSX.Element;
|
|
14
|
+
|
|
15
|
+
export { CookieSettingsView, type CookieSettingsViewProps };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import react__default from 'react';
|
|
2
|
+
|
|
3
|
+
interface CookieSettingsViewProps {
|
|
4
|
+
/** The publication display name (e.g., "San Ramon Times") */
|
|
5
|
+
publicationName?: string;
|
|
6
|
+
/** Publication region / coverage context (e.g., "San Ramon Valley, California") */
|
|
7
|
+
region?: string;
|
|
8
|
+
/** Compliance endpoint for recording consent. Default: "/api/compliance/consent" */
|
|
9
|
+
complianceEndpoint?: string;
|
|
10
|
+
/** Optional publication slug for metadata */
|
|
11
|
+
publicationSlug?: string;
|
|
12
|
+
}
|
|
13
|
+
declare function CookieSettingsView({ publicationName, region, complianceEndpoint, publicationSlug, }: CookieSettingsViewProps): react__default.JSX.Element;
|
|
14
|
+
|
|
15
|
+
export { CookieSettingsView, type CookieSettingsViewProps };
|