@redacto.io/consent-sdk-js 2.1.0 → 2.3.0-beta.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/dist/privacy-center/locales/as.js +1 -1
- package/dist/privacy-center/locales/bn.js +1 -1
- package/dist/privacy-center/locales/brx.js +1 -1
- package/dist/privacy-center/locales/doi.js +1 -1
- package/dist/privacy-center/locales/gom.js +1 -1
- package/dist/privacy-center/locales/gu.js +1 -1
- package/dist/privacy-center/locales/hi.js +1 -1
- package/dist/privacy-center/locales/kn.js +1 -1
- package/dist/privacy-center/locales/ks.js +1 -1
- package/dist/privacy-center/locales/mai.js +1 -1
- package/dist/privacy-center/locales/ml.js +1 -1
- package/dist/privacy-center/locales/mni-Mtei.js +1 -1
- package/dist/privacy-center/locales/mr.js +1 -1
- package/dist/privacy-center/locales/ne.js +1 -1
- package/dist/privacy-center/locales/or.js +1 -1
- package/dist/privacy-center/locales/pa.js +1 -1
- package/dist/privacy-center/locales/sa.js +1 -1
- package/dist/privacy-center/locales/sat.js +1 -1
- package/dist/privacy-center/locales/sd.js +1 -1
- package/dist/privacy-center/locales/ta.js +1 -1
- package/dist/privacy-center/locales/te.js +1 -1
- package/dist/privacy-center/locales/ur.js +1 -1
- package/dist/redacto-privacy-center.global.js +41 -41
- package/dist/redacto-privacy-center.global.js.map +1 -1
- package/dist/redacto-privacy-center.js +170 -80
- package/dist/redacto-privacy-center.mjs +170 -102
- package/dist/redacto.d.mts +20 -1
- package/dist/redacto.d.ts +20 -1
- package/dist/redacto.global.js +93 -93
- package/dist/redacto.global.js.map +1 -1
- package/dist/redacto.js +1004 -321
- package/dist/redacto.mjs +942 -321
- package/dist/{translation-MBGE7KYU.mjs → translation-2A2JXEIJ.mjs} +3 -0
- package/dist/{translation-3IAUHBQO.mjs → translation-2OF4ERZ6.mjs} +3 -0
- package/dist/{translation-HUUSKQB5.mjs → translation-2WSFDX76.mjs} +3 -0
- package/dist/{translation-GTONCNVZ.mjs → translation-67S3WZB3.mjs} +3 -0
- package/dist/{translation-NAWDRQYM.mjs → translation-6SKHCQDT.mjs} +3 -0
- package/dist/{translation-DBJE52UX.mjs → translation-7CNFRFUD.mjs} +3 -0
- package/dist/{translation-DRTKVWFD.mjs → translation-7X2V3LCS.mjs} +3 -0
- package/dist/{translation-C4EA7NR6.mjs → translation-BFU4M3WL.mjs} +3 -0
- package/dist/{translation-4VNBLMFS.mjs → translation-BQF72BAY.mjs} +3 -0
- package/dist/{translation-54VF5MY3.mjs → translation-EZMDKVOT.mjs} +3 -0
- package/dist/{translation-TP6K4SC4.mjs → translation-FLR4L3IE.mjs} +3 -0
- package/dist/{translation-5O732WWG.mjs → translation-JDN6NEBX.mjs} +3 -0
- package/dist/{translation-WFBFKNV5.mjs → translation-M2M4OM3Q.mjs} +3 -0
- package/dist/{translation-BQABMEQU.mjs → translation-NBCG3BUP.mjs} +3 -0
- package/dist/{translation-W6HTCTKZ.mjs → translation-O55XUXAO.mjs} +3 -0
- package/dist/{translation-BX3FJA6E.mjs → translation-OASHXSGF.mjs} +3 -0
- package/dist/{translation-ITVO7LSO.mjs → translation-URMTAHIB.mjs} +3 -0
- package/dist/{translation-62B5PCBT.mjs → translation-W55WDB67.mjs} +3 -0
- package/dist/{translation-3TCIC57D.mjs → translation-YG73EV6H.mjs} +3 -0
- package/dist/{translation-7MGWGIAV.mjs → translation-YSN6SB4W.mjs} +3 -0
- package/dist/{translation-FNXKSX4V.mjs → translation-Z2TRAOKE.mjs} +3 -0
- package/dist/{translation-BEC2RYFD.mjs → translation-ZPOHAWFH.mjs} +3 -0
- package/package.json +2 -2
|
@@ -127,6 +127,7 @@ var translation_default = {
|
|
|
127
127
|
aboutToModifyConsentOnBehalf: "You are about to modify consent on behalf of {{nominator}} for:",
|
|
128
128
|
noDataElementsAvailable: "No data elements available",
|
|
129
129
|
revokeConsentWarning: "If you revoke this consent, you may lose access to certain features that rely on this data.",
|
|
130
|
+
nonRevocableConsentWarning: "This consent cannot be withdrawn, so the revoke option is not available.",
|
|
130
131
|
revokeConsent: "Revoke Consent",
|
|
131
132
|
regrantConsent: "Regrant Consent",
|
|
132
133
|
regrantConsentWarning: "By regranting this consent, you will allow the organization to process your data for this purpose again.",
|
|
@@ -461,28 +462,28 @@ var SHIPPED_LANGUAGES = [
|
|
|
461
462
|
"ur"
|
|
462
463
|
];
|
|
463
464
|
var LOCALE_IMPORTS = {
|
|
464
|
-
as: () => import("./translation-
|
|
465
|
-
bn: () => import("./translation-
|
|
466
|
-
brx: () => import("./translation-
|
|
467
|
-
doi: () => import("./translation-
|
|
468
|
-
gom: () => import("./translation-
|
|
469
|
-
gu: () => import("./translation-
|
|
470
|
-
hi: () => import("./translation-
|
|
471
|
-
kn: () => import("./translation-
|
|
472
|
-
ks: () => import("./translation-
|
|
473
|
-
mai: () => import("./translation-
|
|
474
|
-
ml: () => import("./translation-
|
|
475
|
-
"mni-Mtei": () => import("./translation-
|
|
476
|
-
mr: () => import("./translation-
|
|
477
|
-
ne: () => import("./translation-
|
|
478
|
-
or: () => import("./translation-
|
|
479
|
-
pa: () => import("./translation-
|
|
480
|
-
sa: () => import("./translation-
|
|
481
|
-
sat: () => import("./translation-
|
|
482
|
-
sd: () => import("./translation-
|
|
483
|
-
ta: () => import("./translation-
|
|
484
|
-
te: () => import("./translation-
|
|
485
|
-
ur: () => import("./translation-
|
|
465
|
+
as: () => import("./translation-OASHXSGF.mjs"),
|
|
466
|
+
bn: () => import("./translation-BFU4M3WL.mjs"),
|
|
467
|
+
brx: () => import("./translation-W55WDB67.mjs"),
|
|
468
|
+
doi: () => import("./translation-2WSFDX76.mjs"),
|
|
469
|
+
gom: () => import("./translation-JDN6NEBX.mjs"),
|
|
470
|
+
gu: () => import("./translation-O55XUXAO.mjs"),
|
|
471
|
+
hi: () => import("./translation-67S3WZB3.mjs"),
|
|
472
|
+
kn: () => import("./translation-YSN6SB4W.mjs"),
|
|
473
|
+
ks: () => import("./translation-EZMDKVOT.mjs"),
|
|
474
|
+
mai: () => import("./translation-2OF4ERZ6.mjs"),
|
|
475
|
+
ml: () => import("./translation-YG73EV6H.mjs"),
|
|
476
|
+
"mni-Mtei": () => import("./translation-NBCG3BUP.mjs"),
|
|
477
|
+
mr: () => import("./translation-2A2JXEIJ.mjs"),
|
|
478
|
+
ne: () => import("./translation-FLR4L3IE.mjs"),
|
|
479
|
+
or: () => import("./translation-BQF72BAY.mjs"),
|
|
480
|
+
pa: () => import("./translation-Z2TRAOKE.mjs"),
|
|
481
|
+
sa: () => import("./translation-M2M4OM3Q.mjs"),
|
|
482
|
+
sat: () => import("./translation-7CNFRFUD.mjs"),
|
|
483
|
+
sd: () => import("./translation-7X2V3LCS.mjs"),
|
|
484
|
+
ta: () => import("./translation-6SKHCQDT.mjs"),
|
|
485
|
+
te: () => import("./translation-ZPOHAWFH.mjs"),
|
|
486
|
+
ur: () => import("./translation-URMTAHIB.mjs")
|
|
486
487
|
};
|
|
487
488
|
function toTranslationResource(language, translation) {
|
|
488
489
|
return { translation: withSharedActivityErrors(language, translation) };
|
|
@@ -13422,7 +13423,12 @@ var NOTICE_CHROME_EN = {
|
|
|
13422
13423
|
productPoliciesLabel: "Privacy policies:",
|
|
13423
13424
|
hintNothingChosen: "Select at least one purpose to confirm.",
|
|
13424
13425
|
hintNothingEngaged: "Select or change a purpose for the product you are consenting to.",
|
|
13425
|
-
hintRequiredOutstanding: "Accept the required purposes to confirm."
|
|
13426
|
+
hintRequiredOutstanding: "Accept the required purposes to confirm.",
|
|
13427
|
+
errorTitle: "Error Loading Consent Notice",
|
|
13428
|
+
errorMessage: "Failed to load consent notice. Please try again.",
|
|
13429
|
+
errorRefresh: "Refresh",
|
|
13430
|
+
errorClose: "Close error message",
|
|
13431
|
+
nonRevocableReason: "This consent cannot be withdrawn, so the revoke option is not available."
|
|
13426
13432
|
};
|
|
13427
13433
|
|
|
13428
13434
|
// src/constants.ts
|
|
@@ -13449,6 +13455,7 @@ var SELECTION_CONTROL_COPY = {
|
|
|
13449
13455
|
{ label: NOTICE_CHROME_EN.no, value: false }
|
|
13450
13456
|
]
|
|
13451
13457
|
};
|
|
13458
|
+
var MODIFY_CONSENT_WARNING_ID = "pc-modify-consent-warning";
|
|
13452
13459
|
var CONFIRM_DIALOG_COPY = {
|
|
13453
13460
|
"accept-all": {
|
|
13454
13461
|
title: NOTICE_CHROME_EN.confirmAcceptAllTitle,
|
|
@@ -14088,18 +14095,30 @@ var settingsCopyDeps = (ctx) => {
|
|
|
14088
14095
|
return deps;
|
|
14089
14096
|
};
|
|
14090
14097
|
|
|
14098
|
+
// src/core/revocability.ts
|
|
14099
|
+
var isPurposeRevocable = (purpose) => purpose.revocable !== false;
|
|
14100
|
+
var purposeWithdrawalReason = (purpose, fallbackReason) => {
|
|
14101
|
+
var _a;
|
|
14102
|
+
return ((_a = purpose.revoke_warning_message) == null ? void 0 : _a.trim()) || fallbackReason;
|
|
14103
|
+
};
|
|
14104
|
+
|
|
14091
14105
|
// src/privacy-center-native/components/ModifyConsentModal.ts
|
|
14092
14106
|
var getActionConfig = (record, withdrawWarning) => {
|
|
14093
14107
|
const nominatorInfo = record.nominator;
|
|
14094
14108
|
const nominatorLabel = (nominatorInfo == null ? void 0 : nominatorInfo.name) || (nominatorInfo == null ? void 0 : nominatorInfo.email) || (nominatorInfo == null ? void 0 : nominatorInfo.org_user_id) || null;
|
|
14095
14109
|
const status = record.status;
|
|
14096
14110
|
if (status === "ACTIVE" /* ACTIVE */) {
|
|
14111
|
+
const blocked = !isPurposeRevocable(record);
|
|
14097
14112
|
return {
|
|
14098
14113
|
action: "revoke",
|
|
14099
14114
|
buttonLabel: t("revokeConsent"),
|
|
14100
14115
|
buttonVariant: "danger",
|
|
14101
|
-
warningMessage:
|
|
14102
|
-
|
|
14116
|
+
warningMessage: purposeWithdrawalReason(
|
|
14117
|
+
record,
|
|
14118
|
+
blocked ? t("nonRevocableConsentWarning") : withdrawWarning
|
|
14119
|
+
),
|
|
14120
|
+
description: nominatorLabel ? t("aboutToModifyConsentOnBehalf", { nominator: nominatorLabel }) : t("aboutToModifyConsent"),
|
|
14121
|
+
blocked
|
|
14103
14122
|
};
|
|
14104
14123
|
}
|
|
14105
14124
|
if (status === "WITHDRAW" /* WITHDRAWN */ || status === "REVOKED" /* REVOKED */) {
|
|
@@ -14108,7 +14127,8 @@ var getActionConfig = (record, withdrawWarning) => {
|
|
|
14108
14127
|
buttonLabel: t("regrantConsent"),
|
|
14109
14128
|
buttonVariant: "primary",
|
|
14110
14129
|
warningMessage: t("regrantConsentWarning"),
|
|
14111
|
-
description: nominatorLabel ? t("aboutToRegrantConsentOnBehalf", { nominator: nominatorLabel }) : t("aboutToRegrantConsent")
|
|
14130
|
+
description: nominatorLabel ? t("aboutToRegrantConsentOnBehalf", { nominator: nominatorLabel }) : t("aboutToRegrantConsent"),
|
|
14131
|
+
blocked: false
|
|
14112
14132
|
};
|
|
14113
14133
|
}
|
|
14114
14134
|
if (status === "EXPIRED" /* EXPIRED */) {
|
|
@@ -14117,7 +14137,8 @@ var getActionConfig = (record, withdrawWarning) => {
|
|
|
14117
14137
|
buttonLabel: t("renewConsent"),
|
|
14118
14138
|
buttonVariant: "primary",
|
|
14119
14139
|
warningMessage: t("renewConsentWarning"),
|
|
14120
|
-
description: nominatorLabel ? t("aboutToRenewConsentOnBehalf", { nominator: nominatorLabel }) : t("aboutToRenewConsent")
|
|
14140
|
+
description: nominatorLabel ? t("aboutToRenewConsentOnBehalf", { nominator: nominatorLabel }) : t("aboutToRenewConsent"),
|
|
14141
|
+
blocked: false
|
|
14121
14142
|
};
|
|
14122
14143
|
}
|
|
14123
14144
|
return null;
|
|
@@ -14294,7 +14315,8 @@ var ModifyConsentModal = (ctx, {
|
|
|
14294
14315
|
ac,
|
|
14295
14316
|
{
|
|
14296
14317
|
isLoading: isLoading.get().value,
|
|
14297
|
-
disabled: !selected.purpose_uuid || isRegrantAction && selectedUuids.get().value.length === 0,
|
|
14318
|
+
disabled: actionConfig.blocked || !selected.purpose_uuid || isRegrantAction && selectedUuids.get().value.length === 0,
|
|
14319
|
+
...actionConfig.blocked ? { "aria-describedby": MODIFY_CONSENT_WARNING_ID } : {},
|
|
14298
14320
|
variant: actionConfig.buttonVariant,
|
|
14299
14321
|
onClick: () => {
|
|
14300
14322
|
var _a, _b, _c;
|
|
@@ -14409,6 +14431,7 @@ var ModifyConsentModal = (ctx, {
|
|
|
14409
14431
|
h(
|
|
14410
14432
|
"div",
|
|
14411
14433
|
{
|
|
14434
|
+
id: MODIFY_CONSENT_WARNING_ID,
|
|
14412
14435
|
className: "pc-modal-warning",
|
|
14413
14436
|
style: {
|
|
14414
14437
|
marginTop: pcStyles.mtLg.marginTop,
|
|
@@ -14994,7 +15017,9 @@ var renderValidTill = (ctx, consent) => PCText(
|
|
|
14994
15017
|
);
|
|
14995
15018
|
var methodIcon = (method) => {
|
|
14996
15019
|
const style = { color: "var(--pc-text-secondary)" };
|
|
14997
|
-
if (method === "MOBILE"
|
|
15020
|
+
if (method === "MOBILE" || method === "ANDROID" || method === "IOS") {
|
|
15021
|
+
return icon("Smartphone", { size: 12, style });
|
|
15022
|
+
}
|
|
14998
15023
|
if (method === "WEB") return icon("LaptopMinimal", { size: 12, style });
|
|
14999
15024
|
return null;
|
|
15000
15025
|
};
|
|
@@ -24910,7 +24935,7 @@ var NotificationBell = (ctx) => {
|
|
|
24910
24935
|
};
|
|
24911
24936
|
|
|
24912
24937
|
// src/privacy-center-native/components/AppShell/CompactLanguageMenu.ts
|
|
24913
|
-
function CompactLanguageMenu(ctx, { locale, options, onChange }) {
|
|
24938
|
+
function CompactLanguageMenu(ctx, { locale, options, onChange, showGlobe = false }) {
|
|
24914
24939
|
var _a, _b, _c, _d;
|
|
24915
24940
|
const open = createStore({ value: false });
|
|
24916
24941
|
const setOpen = (value) => open.set({ value });
|
|
@@ -24945,6 +24970,7 @@ function CompactLanguageMenu(ctx, { locale, options, onChange }) {
|
|
|
24945
24970
|
lineHeight: 1
|
|
24946
24971
|
}
|
|
24947
24972
|
},
|
|
24973
|
+
showGlobe ? icon("Globe2", { size: 12, strokeWidth: 1.8 }) : null,
|
|
24948
24974
|
code,
|
|
24949
24975
|
icon("ChevronDown", { size: 12, strokeWidth: 2 })
|
|
24950
24976
|
);
|
|
@@ -25094,7 +25120,7 @@ function readIdentity(ctx) {
|
|
|
25094
25120
|
return {
|
|
25095
25121
|
email,
|
|
25096
25122
|
displayName,
|
|
25097
|
-
|
|
25123
|
+
identityAvatarName: email ? initialsFromEmail(email) : displayName || "?"
|
|
25098
25124
|
};
|
|
25099
25125
|
}
|
|
25100
25126
|
function UserMenu(ctx, { onBack } = {}) {
|
|
@@ -25102,9 +25128,10 @@ function UserMenu(ctx, { onBack } = {}) {
|
|
|
25102
25128
|
...optional2(ctx.tryGet(BrandingKey)),
|
|
25103
25129
|
...optional2(ctx.tryGet(OrganizationKey))
|
|
25104
25130
|
];
|
|
25105
|
-
const
|
|
25106
|
-
width:
|
|
25107
|
-
height:
|
|
25131
|
+
const triggerAvatarStyle = {
|
|
25132
|
+
width: 24,
|
|
25133
|
+
height: 24,
|
|
25134
|
+
fontSize: 10
|
|
25108
25135
|
};
|
|
25109
25136
|
const menuItemStyle = {
|
|
25110
25137
|
display: "flex",
|
|
@@ -25137,19 +25164,19 @@ function UserMenu(ctx, { onBack } = {}) {
|
|
|
25137
25164
|
};
|
|
25138
25165
|
const triggerAvatar = region(ctx, identityDeps, (c) => {
|
|
25139
25166
|
const branding = getBranding(c);
|
|
25140
|
-
const
|
|
25167
|
+
const name = readIdentity(c).displayName || "?";
|
|
25141
25168
|
return (branding == null ? void 0 : branding.icon_url) ? PCAvatar(c, {
|
|
25142
25169
|
src: branding.icon_url,
|
|
25143
|
-
name
|
|
25144
|
-
size: "
|
|
25170
|
+
name,
|
|
25171
|
+
size: "sm",
|
|
25145
25172
|
color: "info",
|
|
25146
25173
|
framed: false,
|
|
25147
|
-
style:
|
|
25174
|
+
style: triggerAvatarStyle
|
|
25148
25175
|
}) : PCAvatar(c, {
|
|
25149
|
-
name
|
|
25150
|
-
size: "
|
|
25176
|
+
name,
|
|
25177
|
+
size: "sm",
|
|
25151
25178
|
color: "info",
|
|
25152
|
-
style:
|
|
25179
|
+
style: triggerAvatarStyle
|
|
25153
25180
|
});
|
|
25154
25181
|
});
|
|
25155
25182
|
const trigger = h(
|
|
@@ -25157,9 +25184,16 @@ function UserMenu(ctx, { onBack } = {}) {
|
|
|
25157
25184
|
{
|
|
25158
25185
|
type: "button",
|
|
25159
25186
|
"aria-label": t("accountMenu"),
|
|
25160
|
-
className: "pc-navbar-avatar-btn"
|
|
25187
|
+
className: "pc-navbar-avatar-btn",
|
|
25188
|
+
style: {
|
|
25189
|
+
width: "auto",
|
|
25190
|
+
gap: 4,
|
|
25191
|
+
paddingInlineStart: 3,
|
|
25192
|
+
paddingInlineEnd: 8
|
|
25193
|
+
}
|
|
25161
25194
|
},
|
|
25162
|
-
triggerAvatar.el
|
|
25195
|
+
triggerAvatar.el,
|
|
25196
|
+
icon("ChevronDown", { size: 12, strokeWidth: 2 })
|
|
25163
25197
|
);
|
|
25164
25198
|
ctx.watch(languageStore(), () => {
|
|
25165
25199
|
trigger.setAttribute("aria-label", t("accountMenu"));
|
|
@@ -25172,7 +25206,7 @@ function UserMenu(ctx, { onBack } = {}) {
|
|
|
25172
25206
|
} = privacyCenterExitAction(c, onBack);
|
|
25173
25207
|
const { canSwitch, switchProfile } = getProfileSwitch(c);
|
|
25174
25208
|
const orgUserId = readOrgUserId(c);
|
|
25175
|
-
const { email, displayName,
|
|
25209
|
+
const { email, displayName, identityAvatarName } = readIdentity(c);
|
|
25176
25210
|
return h(
|
|
25177
25211
|
"div",
|
|
25178
25212
|
{
|
|
@@ -25245,7 +25279,7 @@ function UserMenu(ctx, { onBack } = {}) {
|
|
|
25245
25279
|
}
|
|
25246
25280
|
},
|
|
25247
25281
|
PCAvatar(c, {
|
|
25248
|
-
name:
|
|
25282
|
+
name: identityAvatarName,
|
|
25249
25283
|
size: "sm",
|
|
25250
25284
|
color: "info"
|
|
25251
25285
|
}),
|
|
@@ -25337,6 +25371,9 @@ var LOGO_GROUP_PLACEMENT = {
|
|
|
25337
25371
|
},
|
|
25338
25372
|
right: { order: 1 }
|
|
25339
25373
|
};
|
|
25374
|
+
var CENTRED_LOGO_GAP = 8;
|
|
25375
|
+
var CENTRED_LOGO_MIN_WIDTH = 96;
|
|
25376
|
+
var centredLogoMaxWidth = (headerWidth, padding, actionsWidth) => Math.max(0, headerWidth - 2 * (padding + actionsWidth + CENTRED_LOGO_GAP));
|
|
25340
25377
|
var hamburgerLeadsHeader = (logoAlign) => logoAlign === "center" || logoAlign === "right";
|
|
25341
25378
|
var TOP_BAR_LOGO_HEIGHT = 32;
|
|
25342
25379
|
var TOP_BAR_LOGO_MAX_HEIGHT = 40;
|
|
@@ -25377,8 +25414,8 @@ function TopAppBar(ctx, {
|
|
|
25377
25414
|
);
|
|
25378
25415
|
const languageSlot = region(
|
|
25379
25416
|
ctx,
|
|
25380
|
-
[
|
|
25381
|
-
(c) => LanguageControl(c
|
|
25417
|
+
[...settingsHooksDeps(ctx)],
|
|
25418
|
+
(c) => LanguageControl(c)
|
|
25382
25419
|
);
|
|
25383
25420
|
const bellShown = derived(
|
|
25384
25421
|
[notificationsShown, ...settingsHooksDeps(ctx)],
|
|
@@ -25416,39 +25453,73 @@ function TopAppBar(ctx, {
|
|
|
25416
25453
|
bellSlot.el,
|
|
25417
25454
|
UserMenu(ctx, { onBack })
|
|
25418
25455
|
);
|
|
25456
|
+
const header = h(
|
|
25457
|
+
"header",
|
|
25458
|
+
{
|
|
25459
|
+
role: "banner",
|
|
25460
|
+
className: "pc-shell-topbar",
|
|
25461
|
+
style: {
|
|
25462
|
+
position: "sticky",
|
|
25463
|
+
top: 0,
|
|
25464
|
+
left: 0,
|
|
25465
|
+
right: 0,
|
|
25466
|
+
zIndex: 50,
|
|
25467
|
+
display: "flex",
|
|
25468
|
+
alignItems: "center",
|
|
25469
|
+
justifyContent: "space-between",
|
|
25470
|
+
gap: 16,
|
|
25471
|
+
height: 56,
|
|
25472
|
+
paddingLeft: 16,
|
|
25473
|
+
paddingRight: 16,
|
|
25474
|
+
background: getVar3("--pc-bg-shell"),
|
|
25475
|
+
borderBottom: `1px solid ${getVar3("--pc-border-color")}`,
|
|
25476
|
+
boxSizing: "border-box"
|
|
25477
|
+
},
|
|
25478
|
+
...partAttribute("topbar")
|
|
25479
|
+
},
|
|
25480
|
+
hamburgerSlot(true),
|
|
25481
|
+
logoGroup,
|
|
25482
|
+
actions2
|
|
25483
|
+
);
|
|
25484
|
+
const fitCentredLogo = () => {
|
|
25485
|
+
if (logoAlign.get().value !== "center") {
|
|
25486
|
+
logoGroup.style.maxWidth = "";
|
|
25487
|
+
return;
|
|
25488
|
+
}
|
|
25489
|
+
if (header.clientWidth <= 0) {
|
|
25490
|
+
return;
|
|
25491
|
+
}
|
|
25492
|
+
const padding = parseFloat(getComputedStyle(header).paddingLeft) || 0;
|
|
25493
|
+
const maxWidth = centredLogoMaxWidth(
|
|
25494
|
+
header.clientWidth,
|
|
25495
|
+
padding,
|
|
25496
|
+
actions2.offsetWidth
|
|
25497
|
+
);
|
|
25498
|
+
if (maxWidth >= CENTRED_LOGO_MIN_WIDTH) {
|
|
25499
|
+
setStyle(logoGroup, { ...logoGroupStyle(), maxWidth });
|
|
25500
|
+
return;
|
|
25501
|
+
}
|
|
25502
|
+
setStyle(logoGroup, {
|
|
25503
|
+
...logoGroupStyle(),
|
|
25504
|
+
position: "static",
|
|
25505
|
+
left: "auto",
|
|
25506
|
+
transform: "none",
|
|
25507
|
+
maxWidth: "none"
|
|
25508
|
+
});
|
|
25509
|
+
};
|
|
25510
|
+
if (typeof ResizeObserver !== "undefined") {
|
|
25511
|
+
const observer = new ResizeObserver(fitCentredLogo);
|
|
25512
|
+
observer.observe(header);
|
|
25513
|
+
observer.observe(actions2);
|
|
25514
|
+
ctx.onCleanup(() => observer.disconnect());
|
|
25515
|
+
}
|
|
25419
25516
|
ctx.watch(logoAlign, () => {
|
|
25420
25517
|
setStyle(logoGroup, logoGroupStyle());
|
|
25421
25518
|
setStyle(actions2, actionsStyle());
|
|
25519
|
+
fitCentredLogo();
|
|
25422
25520
|
});
|
|
25423
25521
|
return fragment(
|
|
25424
|
-
|
|
25425
|
-
"header",
|
|
25426
|
-
{
|
|
25427
|
-
role: "banner",
|
|
25428
|
-
className: "pc-shell-topbar",
|
|
25429
|
-
style: {
|
|
25430
|
-
position: "sticky",
|
|
25431
|
-
top: 0,
|
|
25432
|
-
left: 0,
|
|
25433
|
-
right: 0,
|
|
25434
|
-
zIndex: 50,
|
|
25435
|
-
display: "flex",
|
|
25436
|
-
alignItems: "center",
|
|
25437
|
-
justifyContent: "space-between",
|
|
25438
|
-
gap: 16,
|
|
25439
|
-
height: 56,
|
|
25440
|
-
paddingLeft: 16,
|
|
25441
|
-
paddingRight: 16,
|
|
25442
|
-
background: getVar3("--pc-bg-shell"),
|
|
25443
|
-
borderBottom: `1px solid ${getVar3("--pc-border-color")}`,
|
|
25444
|
-
boxSizing: "border-box"
|
|
25445
|
-
},
|
|
25446
|
-
...partAttribute("topbar")
|
|
25447
|
-
},
|
|
25448
|
-
hamburgerSlot(true),
|
|
25449
|
-
logoGroup,
|
|
25450
|
-
actions2
|
|
25451
|
-
),
|
|
25522
|
+
header,
|
|
25452
25523
|
h(
|
|
25453
25524
|
"style",
|
|
25454
25525
|
null,
|
|
@@ -25491,7 +25562,9 @@ function BrandButton(ctx) {
|
|
|
25491
25562
|
cursor: "pointer",
|
|
25492
25563
|
borderRadius: 8,
|
|
25493
25564
|
fontFamily: "inherit",
|
|
25494
|
-
|
|
25565
|
+
gap: 10,
|
|
25566
|
+
minWidth: 0,
|
|
25567
|
+
maxWidth: "100%"
|
|
25495
25568
|
},
|
|
25496
25569
|
onMouseEnter: (e) => {
|
|
25497
25570
|
if (e.currentTarget instanceof HTMLElement) {
|
|
@@ -25531,37 +25604,32 @@ function BrandButton(ctx) {
|
|
|
25531
25604
|
size: "md",
|
|
25532
25605
|
color: "info"
|
|
25533
25606
|
}) : PCAvatar(ctx, { name: displayName, size: "md", color: "info" })
|
|
25534
|
-
)
|
|
25607
|
+
),
|
|
25608
|
+
displayName ? h(
|
|
25609
|
+
"span",
|
|
25610
|
+
{
|
|
25611
|
+
className: "pc-shell-topbar-brand-name",
|
|
25612
|
+
style: {
|
|
25613
|
+
minWidth: 0,
|
|
25614
|
+
fontSize: 14,
|
|
25615
|
+
fontWeight: 600,
|
|
25616
|
+
whiteSpace: "nowrap",
|
|
25617
|
+
overflow: "hidden",
|
|
25618
|
+
textOverflow: "ellipsis"
|
|
25619
|
+
}
|
|
25620
|
+
},
|
|
25621
|
+
displayName
|
|
25622
|
+
) : null
|
|
25535
25623
|
);
|
|
25536
25624
|
}
|
|
25537
|
-
function LanguageControl(ctx
|
|
25538
|
-
var _a;
|
|
25625
|
+
function LanguageControl(ctx) {
|
|
25539
25626
|
const { options, showSwitcher } = languageOptions2(ctx);
|
|
25540
25627
|
if (!showSwitcher) return null;
|
|
25541
|
-
|
|
25542
|
-
|
|
25543
|
-
if (!value) return;
|
|
25544
|
-
changeLocale(String(value.value));
|
|
25545
|
-
};
|
|
25546
|
-
return compact ? CompactLanguageMenu(ctx, {
|
|
25547
|
-
locale,
|
|
25628
|
+
return CompactLanguageMenu(ctx, {
|
|
25629
|
+
locale: languageStore().get().language,
|
|
25548
25630
|
options,
|
|
25549
|
-
onChange: changeLocale
|
|
25550
|
-
|
|
25551
|
-
size: "sm",
|
|
25552
|
-
searchable: true,
|
|
25553
|
-
prefix: icon("Globe2", { size: 12, strokeWidth: 1.8 }),
|
|
25554
|
-
searchPlaceholder: t("searchPlaceholder"),
|
|
25555
|
-
noOptionsMessage: t("noOptionsFound"),
|
|
25556
|
-
style: {
|
|
25557
|
-
width: "auto",
|
|
25558
|
-
minWidth: 120,
|
|
25559
|
-
maxWidth: "min(60vw, 280px)",
|
|
25560
|
-
flexShrink: 0
|
|
25561
|
-
},
|
|
25562
|
-
options: [...options],
|
|
25563
|
-
value: (_a = options.find((opt) => opt.value === locale)) != null ? _a : null,
|
|
25564
|
-
onChange: handleLanguageChange
|
|
25631
|
+
onChange: changeLocale,
|
|
25632
|
+
showGlobe: true
|
|
25565
25633
|
});
|
|
25566
25634
|
}
|
|
25567
25635
|
function HamburgerButton(ctx, {
|
package/dist/redacto.d.mts
CHANGED
|
@@ -323,6 +323,25 @@ declare class ApiError extends Error {
|
|
|
323
323
|
});
|
|
324
324
|
}
|
|
325
325
|
|
|
326
|
+
/** Host-level webfont configuration, applied via `configureNoticeFonts`. */
|
|
327
|
+
type NoticeFontOptions = {
|
|
328
|
+
/**
|
|
329
|
+
* Skip webfont loading entirely; families resolve to their fallback stack,
|
|
330
|
+
* which is a same-genre face. Useful to avoid the per-family payload, or when
|
|
331
|
+
* a strict CSP omits `data:` from `font-src`.
|
|
332
|
+
*/
|
|
333
|
+
disabled?: boolean;
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Configures notice webfont loading. Optional — the fonts ship inside this
|
|
338
|
+
* package and load automatically, so an integrator never has to call this.
|
|
339
|
+
*
|
|
340
|
+
* Pass `disabled: true` to skip loading entirely; families then render via their
|
|
341
|
+
* fallback stack, which is a same-genre face.
|
|
342
|
+
*/
|
|
343
|
+
declare const configureNoticeFonts: (options: NoticeFontOptions) => void;
|
|
344
|
+
|
|
326
345
|
/**
|
|
327
346
|
* Initialize a modal consent dialog.
|
|
328
347
|
* Renders a full-screen overlay with the consent form.
|
|
@@ -360,4 +379,4 @@ declare const RedactoConsent: {
|
|
|
360
379
|
version: string;
|
|
361
380
|
};
|
|
362
381
|
|
|
363
|
-
export { ApiError, type ApiErrorCode, type AssistedOptions, type DigiLockerCallbackOptions, type InlineOptions, type ModalOptions, type OtpGateOptions, type OtpVerifyResult, type PrivacyCenterHandle, type PrivacyCenterOptions, type Settings, assisted, RedactoConsent as default, destroy, digilockerCallback, init, inline, privacyCenter, updateToken };
|
|
382
|
+
export { ApiError, type ApiErrorCode, type AssistedOptions, type DigiLockerCallbackOptions, type InlineOptions, type ModalOptions, type NoticeFontOptions, type OtpGateOptions, type OtpVerifyResult, type PrivacyCenterHandle, type PrivacyCenterOptions, type Settings, assisted, configureNoticeFonts, RedactoConsent as default, destroy, digilockerCallback, init, inline, privacyCenter, updateToken };
|
package/dist/redacto.d.ts
CHANGED
|
@@ -323,6 +323,25 @@ declare class ApiError extends Error {
|
|
|
323
323
|
});
|
|
324
324
|
}
|
|
325
325
|
|
|
326
|
+
/** Host-level webfont configuration, applied via `configureNoticeFonts`. */
|
|
327
|
+
type NoticeFontOptions = {
|
|
328
|
+
/**
|
|
329
|
+
* Skip webfont loading entirely; families resolve to their fallback stack,
|
|
330
|
+
* which is a same-genre face. Useful to avoid the per-family payload, or when
|
|
331
|
+
* a strict CSP omits `data:` from `font-src`.
|
|
332
|
+
*/
|
|
333
|
+
disabled?: boolean;
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Configures notice webfont loading. Optional — the fonts ship inside this
|
|
338
|
+
* package and load automatically, so an integrator never has to call this.
|
|
339
|
+
*
|
|
340
|
+
* Pass `disabled: true` to skip loading entirely; families then render via their
|
|
341
|
+
* fallback stack, which is a same-genre face.
|
|
342
|
+
*/
|
|
343
|
+
declare const configureNoticeFonts: (options: NoticeFontOptions) => void;
|
|
344
|
+
|
|
326
345
|
/**
|
|
327
346
|
* Initialize a modal consent dialog.
|
|
328
347
|
* Renders a full-screen overlay with the consent form.
|
|
@@ -360,4 +379,4 @@ declare const RedactoConsent: {
|
|
|
360
379
|
version: string;
|
|
361
380
|
};
|
|
362
381
|
|
|
363
|
-
export { ApiError, type ApiErrorCode, type AssistedOptions, type DigiLockerCallbackOptions, type InlineOptions, type ModalOptions, type OtpGateOptions, type OtpVerifyResult, type PrivacyCenterHandle, type PrivacyCenterOptions, type Settings, assisted, RedactoConsent as default, destroy, digilockerCallback, init, inline, privacyCenter, updateToken };
|
|
382
|
+
export { ApiError, type ApiErrorCode, type AssistedOptions, type DigiLockerCallbackOptions, type InlineOptions, type ModalOptions, type NoticeFontOptions, type OtpGateOptions, type OtpVerifyResult, type PrivacyCenterHandle, type PrivacyCenterOptions, type Settings, assisted, configureNoticeFonts, RedactoConsent as default, destroy, digilockerCallback, init, inline, privacyCenter, updateToken };
|