@replicated/portal-components 0.0.26 → 0.0.28
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/components/metadata/registry.json +2 -2
- package/components/metadata/registry.md +2 -2
- package/dist/actions/branding-actions.d.mts +1 -1
- package/dist/actions/branding-actions.d.ts +1 -1
- package/dist/actions/branding-actions.js +15 -5
- package/dist/actions/branding-actions.js.map +1 -1
- package/dist/actions/change-team.js +13 -3
- package/dist/actions/change-team.js.map +1 -1
- package/dist/actions/index.d.mts +1 -1
- package/dist/actions/index.d.ts +1 -1
- package/dist/actions/index.js +16 -15
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/install-actions.d.mts +1 -1
- package/dist/actions/install-actions.d.ts +1 -1
- package/dist/actions/install-actions.js +13 -3
- package/dist/actions/install-actions.js.map +1 -1
- package/dist/actions/invite-actions.js +13 -3
- package/dist/actions/invite-actions.js.map +1 -1
- package/dist/actions/magic-link-actions.js +13 -3
- package/dist/actions/magic-link-actions.js.map +1 -1
- package/dist/actions/service-account.d.mts +1 -1
- package/dist/actions/service-account.d.ts +1 -1
- package/dist/actions/service-account.js +13 -3
- package/dist/actions/service-account.js.map +1 -1
- package/dist/actions/support-bundles.d.mts +1 -1
- package/dist/actions/support-bundles.d.ts +1 -1
- package/dist/actions/support-bundles.js +13 -3
- package/dist/actions/support-bundles.js.map +1 -1
- package/dist/actions/team-settings.d.mts +1 -1
- package/dist/actions/team-settings.d.ts +1 -1
- package/dist/actions/team-settings.js +13 -3
- package/dist/actions/team-settings.js.map +1 -1
- package/dist/actions/trial-signup-actions.js +13 -3
- package/dist/actions/trial-signup-actions.js.map +1 -1
- package/dist/actions/trial-signup.js +13 -3
- package/dist/actions/trial-signup.js.map +1 -1
- package/dist/actions/user-settings.d.mts +1 -1
- package/dist/actions/user-settings.d.ts +1 -1
- package/dist/actions/user-settings.js +13 -3
- package/dist/actions/user-settings.js.map +1 -1
- package/dist/airgap-instances.d.mts +1 -1
- package/dist/airgap-instances.d.ts +1 -1
- package/dist/api/saml.js +13 -3
- package/dist/api/saml.js.map +1 -1
- package/dist/api/support-bundles.js +13 -3
- package/dist/api/support-bundles.js.map +1 -1
- package/dist/{branding-DmsrDTNE.d.mts → branding-C5H0L6Vi.d.mts} +13 -1
- package/dist/{branding-DmsrDTNE.d.ts → branding-C5H0L6Vi.d.ts} +13 -1
- package/dist/esm/actions/branding-actions.js +15 -5
- package/dist/esm/actions/branding-actions.js.map +1 -1
- package/dist/esm/actions/change-team.js +13 -3
- package/dist/esm/actions/change-team.js.map +1 -1
- package/dist/esm/actions/index.js +16 -15
- package/dist/esm/actions/index.js.map +1 -1
- package/dist/esm/actions/install-actions.js +13 -3
- package/dist/esm/actions/install-actions.js.map +1 -1
- package/dist/esm/actions/invite-actions.js +13 -3
- package/dist/esm/actions/invite-actions.js.map +1 -1
- package/dist/esm/actions/magic-link-actions.js +13 -3
- package/dist/esm/actions/magic-link-actions.js.map +1 -1
- package/dist/esm/actions/service-account.js +13 -3
- package/dist/esm/actions/service-account.js.map +1 -1
- package/dist/esm/actions/support-bundles.js +13 -3
- package/dist/esm/actions/support-bundles.js.map +1 -1
- package/dist/esm/actions/team-settings.js +13 -3
- package/dist/esm/actions/team-settings.js.map +1 -1
- package/dist/esm/actions/trial-signup-actions.js +13 -3
- package/dist/esm/actions/trial-signup-actions.js.map +1 -1
- package/dist/esm/actions/trial-signup.js +13 -3
- package/dist/esm/actions/trial-signup.js.map +1 -1
- package/dist/esm/actions/user-settings.js +13 -3
- package/dist/esm/actions/user-settings.js.map +1 -1
- package/dist/esm/api/saml.js +13 -3
- package/dist/esm/api/saml.js.map +1 -1
- package/dist/esm/api/support-bundles.js +13 -3
- package/dist/esm/api/support-bundles.js.map +1 -1
- package/dist/esm/helm-install-wizard.js +13 -3
- package/dist/esm/helm-install-wizard.js.map +1 -1
- package/dist/esm/index.js +51 -9
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/install-actions.js +13 -3
- package/dist/esm/install-actions.js.map +1 -1
- package/dist/esm/license-details.js +13 -3
- package/dist/esm/license-details.js.map +1 -1
- package/dist/esm/linux-install-wizard.js +13 -3
- package/dist/esm/linux-install-wizard.js.map +1 -1
- package/dist/esm/security-card.js +39 -24
- package/dist/esm/security-card.js.map +1 -1
- package/dist/esm/support-card.js +13 -3
- package/dist/esm/support-card.js.map +1 -1
- package/dist/esm/top-nav.js +34 -7
- package/dist/esm/top-nav.js.map +1 -1
- package/dist/esm/update-layout.js +34 -7
- package/dist/esm/update-layout.js.map +1 -1
- package/dist/esm/user-menu-dropdown.js +6 -3
- package/dist/esm/user-menu-dropdown.js.map +1 -1
- package/dist/esm/utils/index.js +44 -5
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/helm-install-wizard.d.mts +2 -2
- package/dist/helm-install-wizard.d.ts +2 -2
- package/dist/helm-install-wizard.js +13 -3
- package/dist/helm-install-wizard.js.map +1 -1
- package/dist/{index-Bcp17Mf3.d.ts → index-7ibNULXY.d.ts} +3 -1
- package/dist/{index-DaH1bSuO.d.mts → index-CITwEYtK.d.mts} +3 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +51 -8
- package/dist/index.js.map +1 -1
- package/dist/install-actions.d.mts +2 -2
- package/dist/install-actions.d.ts +2 -2
- package/dist/install-actions.js +13 -3
- package/dist/install-actions.js.map +1 -1
- package/dist/instance-card.d.mts +1 -1
- package/dist/instance-card.d.ts +1 -1
- package/dist/license-details.js +13 -3
- package/dist/license-details.js.map +1 -1
- package/dist/linux-install-wizard.d.mts +2 -2
- package/dist/linux-install-wizard.d.ts +2 -2
- package/dist/linux-install-wizard.js +13 -3
- package/dist/linux-install-wizard.js.map +1 -1
- package/dist/online-instance-list.d.mts +1 -1
- package/dist/online-instance-list.d.ts +1 -1
- package/dist/pending-installations.d.mts +1 -1
- package/dist/pending-installations.d.ts +1 -1
- package/dist/security-card.d.mts +1 -1
- package/dist/security-card.d.ts +1 -1
- package/dist/security-card.js +43 -24
- package/dist/security-card.js.map +1 -1
- package/dist/styles.css +16 -12
- package/dist/support-bundles-card.d.mts +1 -1
- package/dist/support-bundles-card.d.ts +1 -1
- package/dist/support-card.js +13 -3
- package/dist/support-card.js.map +1 -1
- package/dist/{top-nav-8f2U69MF.d.ts → top-nav-B2FVC4rl.d.ts} +1 -1
- package/dist/{top-nav-B2yA3PC7.d.mts → top-nav-Cf8zMq1A.d.mts} +1 -1
- package/dist/top-nav.d.mts +2 -2
- package/dist/top-nav.d.ts +2 -2
- package/dist/top-nav.js +34 -7
- package/dist/top-nav.js.map +1 -1
- package/dist/update-layout.js +34 -7
- package/dist/update-layout.js.map +1 -1
- package/dist/user-menu-dropdown.d.mts +2 -1
- package/dist/user-menu-dropdown.d.ts +2 -1
- package/dist/user-menu-dropdown.js +6 -3
- package/dist/user-menu-dropdown.js.map +1 -1
- package/dist/utils/index.d.mts +2 -2
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.js +44 -4
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -14,6 +14,13 @@ interface BrandingResult {
|
|
|
14
14
|
backgroundImage?: string;
|
|
15
15
|
backgroundGradientStart?: string;
|
|
16
16
|
backgroundGradientEnd?: string;
|
|
17
|
+
headerColor?: string;
|
|
18
|
+
headerGradientEnd?: string;
|
|
19
|
+
sidebarColor?: string;
|
|
20
|
+
sidebarGradientEnd?: string;
|
|
21
|
+
contentBackgroundColor?: string;
|
|
22
|
+
contentBackgroundGradientEnd?: string;
|
|
23
|
+
customCSS?: string;
|
|
17
24
|
}
|
|
18
25
|
/**
|
|
19
26
|
* Normalizes and validates CSS color values to prevent CSS injection attacks.
|
|
@@ -32,6 +39,11 @@ declare const normalizeColor: (color?: string) => string | undefined;
|
|
|
32
39
|
* @returns The sanitized URL or undefined if invalid
|
|
33
40
|
*/
|
|
34
41
|
declare const sanitizeUrlForCss: (url?: string) => string | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Determines if a hex color is "dark" based on relative luminance.
|
|
44
|
+
* Used for choosing white vs dark text on colored backgrounds.
|
|
45
|
+
*/
|
|
46
|
+
declare const isDarkColor: (hex?: string) => boolean;
|
|
35
47
|
declare const decodeBranding: ({ brandingData }: RawBranding) => BrandingResult;
|
|
36
48
|
|
|
37
|
-
export { type BrandingResult as B, type BackgroundType as a, decodeBranding as d, normalizeColor as n, sanitizeUrlForCss as s };
|
|
49
|
+
export { type BrandingResult as B, type BackgroundType as a, decodeBranding as d, isDarkColor as i, normalizeColor as n, sanitizeUrlForCss as s };
|
|
@@ -14,6 +14,13 @@ interface BrandingResult {
|
|
|
14
14
|
backgroundImage?: string;
|
|
15
15
|
backgroundGradientStart?: string;
|
|
16
16
|
backgroundGradientEnd?: string;
|
|
17
|
+
headerColor?: string;
|
|
18
|
+
headerGradientEnd?: string;
|
|
19
|
+
sidebarColor?: string;
|
|
20
|
+
sidebarGradientEnd?: string;
|
|
21
|
+
contentBackgroundColor?: string;
|
|
22
|
+
contentBackgroundGradientEnd?: string;
|
|
23
|
+
customCSS?: string;
|
|
17
24
|
}
|
|
18
25
|
/**
|
|
19
26
|
* Normalizes and validates CSS color values to prevent CSS injection attacks.
|
|
@@ -32,6 +39,11 @@ declare const normalizeColor: (color?: string) => string | undefined;
|
|
|
32
39
|
* @returns The sanitized URL or undefined if invalid
|
|
33
40
|
*/
|
|
34
41
|
declare const sanitizeUrlForCss: (url?: string) => string | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Determines if a hex color is "dark" based on relative luminance.
|
|
44
|
+
* Used for choosing white vs dark text on colored backgrounds.
|
|
45
|
+
*/
|
|
46
|
+
declare const isDarkColor: (hex?: string) => boolean;
|
|
35
47
|
declare const decodeBranding: ({ brandingData }: RawBranding) => BrandingResult;
|
|
36
48
|
|
|
37
|
-
export { type BrandingResult as B, type BackgroundType as a, decodeBranding as d, normalizeColor as n, sanitizeUrlForCss as s };
|
|
49
|
+
export { type BrandingResult as B, type BackgroundType as a, decodeBranding as d, isDarkColor as i, normalizeColor as n, sanitizeUrlForCss as s };
|
|
@@ -244,14 +244,17 @@ async function handleServerError(statusCode) {
|
|
|
244
244
|
var getApiOrigin = () => {
|
|
245
245
|
return (process.env.REPLICATED_APP_ORIGIN || "https://replicated.app").replace(/\/+$/, "");
|
|
246
246
|
};
|
|
247
|
-
var fetchCustomBrandingImpl = async () => {
|
|
247
|
+
var fetchCustomBrandingImpl = async (version) => {
|
|
248
248
|
const appSlug = process.env.PORTAL_APP_SLUG;
|
|
249
249
|
if (!appSlug) {
|
|
250
250
|
throw new Error("PORTAL_APP_SLUG is not configured");
|
|
251
251
|
}
|
|
252
|
-
|
|
252
|
+
let url = `${getApiOrigin()}/enterprise-portal/public/branding?app_slug=${encodeURIComponent(
|
|
253
253
|
appSlug
|
|
254
254
|
)}`;
|
|
255
|
+
if (version) {
|
|
256
|
+
url += `&version=${encodeURIComponent(version)}`;
|
|
257
|
+
}
|
|
255
258
|
if (process.env.NODE_ENV !== "production") {
|
|
256
259
|
console.debug(
|
|
257
260
|
"[portal-components] fetching custom branding via %s (Enterprise Portal API)",
|
|
@@ -280,7 +283,14 @@ var fetchCustomBrandingImpl = async () => {
|
|
|
280
283
|
background: payload.background,
|
|
281
284
|
backgroundImage: payload.backgroundImage,
|
|
282
285
|
customColor1: payload.customColor1,
|
|
283
|
-
customColor2: payload.customColor2
|
|
286
|
+
customColor2: payload.customColor2,
|
|
287
|
+
headerColor: payload.headerColor,
|
|
288
|
+
headerGradientEnd: payload.headerGradientEnd,
|
|
289
|
+
sidebarColor: payload.sidebarColor,
|
|
290
|
+
sidebarGradientEnd: payload.sidebarGradientEnd,
|
|
291
|
+
contentBackgroundColor: payload.contentBackgroundColor,
|
|
292
|
+
contentBackgroundGradientEnd: payload.contentBackgroundGradientEnd,
|
|
293
|
+
customCSS: payload.customCSS
|
|
284
294
|
};
|
|
285
295
|
const brandingData = Buffer.from(JSON.stringify(brandingObject)).toString("base64");
|
|
286
296
|
return {
|
|
@@ -367,9 +377,9 @@ var DEFAULT_PRIMARY_COLOR = "#4f46e5";
|
|
|
367
377
|
var DEFAULT_SECONDARY_COLOR = "#6366f1";
|
|
368
378
|
|
|
369
379
|
// src/actions/branding-actions.ts
|
|
370
|
-
async function fetchBrandingWithFallbackImpl(fallbackTitle) {
|
|
380
|
+
async function fetchBrandingWithFallbackImpl(fallbackTitle, version) {
|
|
371
381
|
try {
|
|
372
|
-
return await fetchCustomBranding();
|
|
382
|
+
return await fetchCustomBranding(version);
|
|
373
383
|
} catch (error) {
|
|
374
384
|
console.error("[branding-actions] Failed to fetch custom branding:", error);
|
|
375
385
|
const fallbackBranding = {
|