@redacto.io/consent-sdk-js 2.2.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 +166 -80
- package/dist/redacto-privacy-center.mjs +166 -102
- package/dist/redacto.global.js +99 -99
- package/dist/redacto.global.js.map +1 -1
- package/dist/redacto.js +130 -28
- package/dist/redacto.mjs +130 -28
- 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 +1 -1
|
@@ -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) };
|
|
@@ -13426,7 +13427,8 @@ var NOTICE_CHROME_EN = {
|
|
|
13426
13427
|
errorTitle: "Error Loading Consent Notice",
|
|
13427
13428
|
errorMessage: "Failed to load consent notice. Please try again.",
|
|
13428
13429
|
errorRefresh: "Refresh",
|
|
13429
|
-
errorClose: "Close error message"
|
|
13430
|
+
errorClose: "Close error message",
|
|
13431
|
+
nonRevocableReason: "This consent cannot be withdrawn, so the revoke option is not available."
|
|
13430
13432
|
};
|
|
13431
13433
|
|
|
13432
13434
|
// src/constants.ts
|
|
@@ -13453,6 +13455,7 @@ var SELECTION_CONTROL_COPY = {
|
|
|
13453
13455
|
{ label: NOTICE_CHROME_EN.no, value: false }
|
|
13454
13456
|
]
|
|
13455
13457
|
};
|
|
13458
|
+
var MODIFY_CONSENT_WARNING_ID = "pc-modify-consent-warning";
|
|
13456
13459
|
var CONFIRM_DIALOG_COPY = {
|
|
13457
13460
|
"accept-all": {
|
|
13458
13461
|
title: NOTICE_CHROME_EN.confirmAcceptAllTitle,
|
|
@@ -14092,18 +14095,30 @@ var settingsCopyDeps = (ctx) => {
|
|
|
14092
14095
|
return deps;
|
|
14093
14096
|
};
|
|
14094
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
|
+
|
|
14095
14105
|
// src/privacy-center-native/components/ModifyConsentModal.ts
|
|
14096
14106
|
var getActionConfig = (record, withdrawWarning) => {
|
|
14097
14107
|
const nominatorInfo = record.nominator;
|
|
14098
14108
|
const nominatorLabel = (nominatorInfo == null ? void 0 : nominatorInfo.name) || (nominatorInfo == null ? void 0 : nominatorInfo.email) || (nominatorInfo == null ? void 0 : nominatorInfo.org_user_id) || null;
|
|
14099
14109
|
const status = record.status;
|
|
14100
14110
|
if (status === "ACTIVE" /* ACTIVE */) {
|
|
14111
|
+
const blocked = !isPurposeRevocable(record);
|
|
14101
14112
|
return {
|
|
14102
14113
|
action: "revoke",
|
|
14103
14114
|
buttonLabel: t("revokeConsent"),
|
|
14104
14115
|
buttonVariant: "danger",
|
|
14105
|
-
warningMessage:
|
|
14106
|
-
|
|
14116
|
+
warningMessage: purposeWithdrawalReason(
|
|
14117
|
+
record,
|
|
14118
|
+
blocked ? t("nonRevocableConsentWarning") : withdrawWarning
|
|
14119
|
+
),
|
|
14120
|
+
description: nominatorLabel ? t("aboutToModifyConsentOnBehalf", { nominator: nominatorLabel }) : t("aboutToModifyConsent"),
|
|
14121
|
+
blocked
|
|
14107
14122
|
};
|
|
14108
14123
|
}
|
|
14109
14124
|
if (status === "WITHDRAW" /* WITHDRAWN */ || status === "REVOKED" /* REVOKED */) {
|
|
@@ -14112,7 +14127,8 @@ var getActionConfig = (record, withdrawWarning) => {
|
|
|
14112
14127
|
buttonLabel: t("regrantConsent"),
|
|
14113
14128
|
buttonVariant: "primary",
|
|
14114
14129
|
warningMessage: t("regrantConsentWarning"),
|
|
14115
|
-
description: nominatorLabel ? t("aboutToRegrantConsentOnBehalf", { nominator: nominatorLabel }) : t("aboutToRegrantConsent")
|
|
14130
|
+
description: nominatorLabel ? t("aboutToRegrantConsentOnBehalf", { nominator: nominatorLabel }) : t("aboutToRegrantConsent"),
|
|
14131
|
+
blocked: false
|
|
14116
14132
|
};
|
|
14117
14133
|
}
|
|
14118
14134
|
if (status === "EXPIRED" /* EXPIRED */) {
|
|
@@ -14121,7 +14137,8 @@ var getActionConfig = (record, withdrawWarning) => {
|
|
|
14121
14137
|
buttonLabel: t("renewConsent"),
|
|
14122
14138
|
buttonVariant: "primary",
|
|
14123
14139
|
warningMessage: t("renewConsentWarning"),
|
|
14124
|
-
description: nominatorLabel ? t("aboutToRenewConsentOnBehalf", { nominator: nominatorLabel }) : t("aboutToRenewConsent")
|
|
14140
|
+
description: nominatorLabel ? t("aboutToRenewConsentOnBehalf", { nominator: nominatorLabel }) : t("aboutToRenewConsent"),
|
|
14141
|
+
blocked: false
|
|
14125
14142
|
};
|
|
14126
14143
|
}
|
|
14127
14144
|
return null;
|
|
@@ -14298,7 +14315,8 @@ var ModifyConsentModal = (ctx, {
|
|
|
14298
14315
|
ac,
|
|
14299
14316
|
{
|
|
14300
14317
|
isLoading: isLoading.get().value,
|
|
14301
|
-
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 } : {},
|
|
14302
14320
|
variant: actionConfig.buttonVariant,
|
|
14303
14321
|
onClick: () => {
|
|
14304
14322
|
var _a, _b, _c;
|
|
@@ -14413,6 +14431,7 @@ var ModifyConsentModal = (ctx, {
|
|
|
14413
14431
|
h(
|
|
14414
14432
|
"div",
|
|
14415
14433
|
{
|
|
14434
|
+
id: MODIFY_CONSENT_WARNING_ID,
|
|
14416
14435
|
className: "pc-modal-warning",
|
|
14417
14436
|
style: {
|
|
14418
14437
|
marginTop: pcStyles.mtLg.marginTop,
|
|
@@ -14998,7 +15017,9 @@ var renderValidTill = (ctx, consent) => PCText(
|
|
|
14998
15017
|
);
|
|
14999
15018
|
var methodIcon = (method) => {
|
|
15000
15019
|
const style = { color: "var(--pc-text-secondary)" };
|
|
15001
|
-
if (method === "MOBILE"
|
|
15020
|
+
if (method === "MOBILE" || method === "ANDROID" || method === "IOS") {
|
|
15021
|
+
return icon("Smartphone", { size: 12, style });
|
|
15022
|
+
}
|
|
15002
15023
|
if (method === "WEB") return icon("LaptopMinimal", { size: 12, style });
|
|
15003
15024
|
return null;
|
|
15004
15025
|
};
|
|
@@ -24914,7 +24935,7 @@ var NotificationBell = (ctx) => {
|
|
|
24914
24935
|
};
|
|
24915
24936
|
|
|
24916
24937
|
// src/privacy-center-native/components/AppShell/CompactLanguageMenu.ts
|
|
24917
|
-
function CompactLanguageMenu(ctx, { locale, options, onChange }) {
|
|
24938
|
+
function CompactLanguageMenu(ctx, { locale, options, onChange, showGlobe = false }) {
|
|
24918
24939
|
var _a, _b, _c, _d;
|
|
24919
24940
|
const open = createStore({ value: false });
|
|
24920
24941
|
const setOpen = (value) => open.set({ value });
|
|
@@ -24949,6 +24970,7 @@ function CompactLanguageMenu(ctx, { locale, options, onChange }) {
|
|
|
24949
24970
|
lineHeight: 1
|
|
24950
24971
|
}
|
|
24951
24972
|
},
|
|
24973
|
+
showGlobe ? icon("Globe2", { size: 12, strokeWidth: 1.8 }) : null,
|
|
24952
24974
|
code,
|
|
24953
24975
|
icon("ChevronDown", { size: 12, strokeWidth: 2 })
|
|
24954
24976
|
);
|
|
@@ -25098,7 +25120,7 @@ function readIdentity(ctx) {
|
|
|
25098
25120
|
return {
|
|
25099
25121
|
email,
|
|
25100
25122
|
displayName,
|
|
25101
|
-
|
|
25123
|
+
identityAvatarName: email ? initialsFromEmail(email) : displayName || "?"
|
|
25102
25124
|
};
|
|
25103
25125
|
}
|
|
25104
25126
|
function UserMenu(ctx, { onBack } = {}) {
|
|
@@ -25106,9 +25128,10 @@ function UserMenu(ctx, { onBack } = {}) {
|
|
|
25106
25128
|
...optional2(ctx.tryGet(BrandingKey)),
|
|
25107
25129
|
...optional2(ctx.tryGet(OrganizationKey))
|
|
25108
25130
|
];
|
|
25109
|
-
const
|
|
25110
|
-
width:
|
|
25111
|
-
height:
|
|
25131
|
+
const triggerAvatarStyle = {
|
|
25132
|
+
width: 24,
|
|
25133
|
+
height: 24,
|
|
25134
|
+
fontSize: 10
|
|
25112
25135
|
};
|
|
25113
25136
|
const menuItemStyle = {
|
|
25114
25137
|
display: "flex",
|
|
@@ -25141,19 +25164,19 @@ function UserMenu(ctx, { onBack } = {}) {
|
|
|
25141
25164
|
};
|
|
25142
25165
|
const triggerAvatar = region(ctx, identityDeps, (c) => {
|
|
25143
25166
|
const branding = getBranding(c);
|
|
25144
|
-
const
|
|
25167
|
+
const name = readIdentity(c).displayName || "?";
|
|
25145
25168
|
return (branding == null ? void 0 : branding.icon_url) ? PCAvatar(c, {
|
|
25146
25169
|
src: branding.icon_url,
|
|
25147
|
-
name
|
|
25148
|
-
size: "
|
|
25170
|
+
name,
|
|
25171
|
+
size: "sm",
|
|
25149
25172
|
color: "info",
|
|
25150
25173
|
framed: false,
|
|
25151
|
-
style:
|
|
25174
|
+
style: triggerAvatarStyle
|
|
25152
25175
|
}) : PCAvatar(c, {
|
|
25153
|
-
name
|
|
25154
|
-
size: "
|
|
25176
|
+
name,
|
|
25177
|
+
size: "sm",
|
|
25155
25178
|
color: "info",
|
|
25156
|
-
style:
|
|
25179
|
+
style: triggerAvatarStyle
|
|
25157
25180
|
});
|
|
25158
25181
|
});
|
|
25159
25182
|
const trigger = h(
|
|
@@ -25161,9 +25184,16 @@ function UserMenu(ctx, { onBack } = {}) {
|
|
|
25161
25184
|
{
|
|
25162
25185
|
type: "button",
|
|
25163
25186
|
"aria-label": t("accountMenu"),
|
|
25164
|
-
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
|
+
}
|
|
25165
25194
|
},
|
|
25166
|
-
triggerAvatar.el
|
|
25195
|
+
triggerAvatar.el,
|
|
25196
|
+
icon("ChevronDown", { size: 12, strokeWidth: 2 })
|
|
25167
25197
|
);
|
|
25168
25198
|
ctx.watch(languageStore(), () => {
|
|
25169
25199
|
trigger.setAttribute("aria-label", t("accountMenu"));
|
|
@@ -25176,7 +25206,7 @@ function UserMenu(ctx, { onBack } = {}) {
|
|
|
25176
25206
|
} = privacyCenterExitAction(c, onBack);
|
|
25177
25207
|
const { canSwitch, switchProfile } = getProfileSwitch(c);
|
|
25178
25208
|
const orgUserId = readOrgUserId(c);
|
|
25179
|
-
const { email, displayName,
|
|
25209
|
+
const { email, displayName, identityAvatarName } = readIdentity(c);
|
|
25180
25210
|
return h(
|
|
25181
25211
|
"div",
|
|
25182
25212
|
{
|
|
@@ -25249,7 +25279,7 @@ function UserMenu(ctx, { onBack } = {}) {
|
|
|
25249
25279
|
}
|
|
25250
25280
|
},
|
|
25251
25281
|
PCAvatar(c, {
|
|
25252
|
-
name:
|
|
25282
|
+
name: identityAvatarName,
|
|
25253
25283
|
size: "sm",
|
|
25254
25284
|
color: "info"
|
|
25255
25285
|
}),
|
|
@@ -25341,6 +25371,9 @@ var LOGO_GROUP_PLACEMENT = {
|
|
|
25341
25371
|
},
|
|
25342
25372
|
right: { order: 1 }
|
|
25343
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));
|
|
25344
25377
|
var hamburgerLeadsHeader = (logoAlign) => logoAlign === "center" || logoAlign === "right";
|
|
25345
25378
|
var TOP_BAR_LOGO_HEIGHT = 32;
|
|
25346
25379
|
var TOP_BAR_LOGO_MAX_HEIGHT = 40;
|
|
@@ -25381,8 +25414,8 @@ function TopAppBar(ctx, {
|
|
|
25381
25414
|
);
|
|
25382
25415
|
const languageSlot = region(
|
|
25383
25416
|
ctx,
|
|
25384
|
-
[
|
|
25385
|
-
(c) => LanguageControl(c
|
|
25417
|
+
[...settingsHooksDeps(ctx)],
|
|
25418
|
+
(c) => LanguageControl(c)
|
|
25386
25419
|
);
|
|
25387
25420
|
const bellShown = derived(
|
|
25388
25421
|
[notificationsShown, ...settingsHooksDeps(ctx)],
|
|
@@ -25420,39 +25453,73 @@ function TopAppBar(ctx, {
|
|
|
25420
25453
|
bellSlot.el,
|
|
25421
25454
|
UserMenu(ctx, { onBack })
|
|
25422
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
|
+
}
|
|
25423
25516
|
ctx.watch(logoAlign, () => {
|
|
25424
25517
|
setStyle(logoGroup, logoGroupStyle());
|
|
25425
25518
|
setStyle(actions2, actionsStyle());
|
|
25519
|
+
fitCentredLogo();
|
|
25426
25520
|
});
|
|
25427
25521
|
return fragment(
|
|
25428
|
-
|
|
25429
|
-
"header",
|
|
25430
|
-
{
|
|
25431
|
-
role: "banner",
|
|
25432
|
-
className: "pc-shell-topbar",
|
|
25433
|
-
style: {
|
|
25434
|
-
position: "sticky",
|
|
25435
|
-
top: 0,
|
|
25436
|
-
left: 0,
|
|
25437
|
-
right: 0,
|
|
25438
|
-
zIndex: 50,
|
|
25439
|
-
display: "flex",
|
|
25440
|
-
alignItems: "center",
|
|
25441
|
-
justifyContent: "space-between",
|
|
25442
|
-
gap: 16,
|
|
25443
|
-
height: 56,
|
|
25444
|
-
paddingLeft: 16,
|
|
25445
|
-
paddingRight: 16,
|
|
25446
|
-
background: getVar3("--pc-bg-shell"),
|
|
25447
|
-
borderBottom: `1px solid ${getVar3("--pc-border-color")}`,
|
|
25448
|
-
boxSizing: "border-box"
|
|
25449
|
-
},
|
|
25450
|
-
...partAttribute("topbar")
|
|
25451
|
-
},
|
|
25452
|
-
hamburgerSlot(true),
|
|
25453
|
-
logoGroup,
|
|
25454
|
-
actions2
|
|
25455
|
-
),
|
|
25522
|
+
header,
|
|
25456
25523
|
h(
|
|
25457
25524
|
"style",
|
|
25458
25525
|
null,
|
|
@@ -25495,7 +25562,9 @@ function BrandButton(ctx) {
|
|
|
25495
25562
|
cursor: "pointer",
|
|
25496
25563
|
borderRadius: 8,
|
|
25497
25564
|
fontFamily: "inherit",
|
|
25498
|
-
|
|
25565
|
+
gap: 10,
|
|
25566
|
+
minWidth: 0,
|
|
25567
|
+
maxWidth: "100%"
|
|
25499
25568
|
},
|
|
25500
25569
|
onMouseEnter: (e) => {
|
|
25501
25570
|
if (e.currentTarget instanceof HTMLElement) {
|
|
@@ -25535,37 +25604,32 @@ function BrandButton(ctx) {
|
|
|
25535
25604
|
size: "md",
|
|
25536
25605
|
color: "info"
|
|
25537
25606
|
}) : PCAvatar(ctx, { name: displayName, size: "md", color: "info" })
|
|
25538
|
-
)
|
|
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
|
|
25539
25623
|
);
|
|
25540
25624
|
}
|
|
25541
|
-
function LanguageControl(ctx
|
|
25542
|
-
var _a;
|
|
25625
|
+
function LanguageControl(ctx) {
|
|
25543
25626
|
const { options, showSwitcher } = languageOptions2(ctx);
|
|
25544
25627
|
if (!showSwitcher) return null;
|
|
25545
|
-
|
|
25546
|
-
|
|
25547
|
-
if (!value) return;
|
|
25548
|
-
changeLocale(String(value.value));
|
|
25549
|
-
};
|
|
25550
|
-
return compact ? CompactLanguageMenu(ctx, {
|
|
25551
|
-
locale,
|
|
25628
|
+
return CompactLanguageMenu(ctx, {
|
|
25629
|
+
locale: languageStore().get().language,
|
|
25552
25630
|
options,
|
|
25553
|
-
onChange: changeLocale
|
|
25554
|
-
|
|
25555
|
-
size: "sm",
|
|
25556
|
-
searchable: true,
|
|
25557
|
-
prefix: icon("Globe2", { size: 12, strokeWidth: 1.8 }),
|
|
25558
|
-
searchPlaceholder: t("searchPlaceholder"),
|
|
25559
|
-
noOptionsMessage: t("noOptionsFound"),
|
|
25560
|
-
style: {
|
|
25561
|
-
width: "auto",
|
|
25562
|
-
minWidth: 120,
|
|
25563
|
-
maxWidth: "min(60vw, 280px)",
|
|
25564
|
-
flexShrink: 0
|
|
25565
|
-
},
|
|
25566
|
-
options: [...options],
|
|
25567
|
-
value: (_a = options.find((opt) => opt.value === locale)) != null ? _a : null,
|
|
25568
|
-
onChange: handleLanguageChange
|
|
25631
|
+
onChange: changeLocale,
|
|
25632
|
+
showGlobe: true
|
|
25569
25633
|
});
|
|
25570
25634
|
}
|
|
25571
25635
|
function HamburgerButton(ctx, {
|