|
1949 | 1949 | }
|
1950 | 1950 | if (background2.kind === "userImage") {
|
1951 | 1951 | const isDark = background2.value.colorScheme === "dark";
|
1952 |
| - nextBodyBackground = isDark ? "var(--default-dark-bg)" : "var(--default-light-bg)"; |
| 1952 | + nextBodyBackground = isDark ? "var(--default-dark-background-color)" : "var(--default-light-background-color)"; |
1953 | 1953 | }
|
1954 | 1954 | if (background2.kind === "default") {
|
1955 |
| - nextBodyBackground = browser.value === "dark" ? "var(--default-dark-bg)" : "var(--default-light-bg)"; |
| 1955 | + nextBodyBackground = browser.value === "dark" ? "var(--default-dark-background-color)" : "var(--default-light-background-color)"; |
1956 | 1956 | }
|
1957 | 1957 | document.body.style.setProperty("background-color", nextBodyBackground);
|
1958 | 1958 | if (!document.body.dataset.animateBackground) {
|
|
24351 | 24351 | };
|
24352 | 24352 | }, [rows.length]);
|
24353 | 24353 | y2(() => {
|
24354 |
| - if (!contentTubeRef.current) return console.warn("cannot find content tube"); |
| 24354 | + if (!contentTubeRef.current) return; |
24355 | 24355 | let lastHeight;
|
24356 | 24356 | let debounceTimer;
|
24357 | 24357 | const resizer = new ResizeObserver((entries4) => {
|
|
30542 | 30542 | messaging2.reportPageException({ message });
|
30543 | 30543 | };
|
30544 | 30544 | installGlobalSideEffects(environment, settings);
|
| 30545 | + applyDefaultStyles(init2.defaultStyles); |
30545 | 30546 | if (environment.display === "components") {
|
30546 | 30547 | return renderComponents(root2, environment, settings, strings);
|
30547 | 30548 | }
|
|
30596 | 30597 | document.body.dataset.display = environment.display;
|
30597 | 30598 | document.body.dataset.animation = environment.urlParams.get("animation") || "";
|
30598 | 30599 | }
|
| 30600 | + function applyDefaultStyles(defaultStyles) { |
| 30601 | + if (defaultStyles?.lightBackgroundColor) { |
| 30602 | + document.body.style.setProperty("--default-light-background-color", defaultStyles.lightBackgroundColor); |
| 30603 | + } |
| 30604 | + if (defaultStyles?.darkBackgroundColor) { |
| 30605 | + document.body.style.setProperty("--default-dark-background-color", defaultStyles.darkBackgroundColor); |
| 30606 | + } |
| 30607 | + } |
30599 | 30608 | async function resolveEntryPoints(widgets, didCatch) {
|
30600 | 30609 | try {
|
30601 | 30610 | const loaders = widgets.map((widget) => {
|
|
31415 | 31424 | platform: { name: "integration" },
|
31416 | 31425 | env: "development",
|
31417 | 31426 | locale: "en",
|
31418 |
| - updateNotification |
| 31427 | + updateNotification, |
| 31428 | + defaultStyles: getDefaultStyles() |
31419 | 31429 | };
|
31420 | 31430 | const feed = url4.searchParams.get("feed") || "stats";
|
31421 | 31431 | if (feed === "stats" || feed === "both") {
|
|
31444 | 31454 | }
|
31445 | 31455 | });
|
31446 | 31456 | }
|
| 31457 | + function getDefaultStyles() { |
| 31458 | + if (url4.searchParams.get("defaultStyles") === "visual-refresh") { |
| 31459 | + return { |
| 31460 | + lightBackgroundColor: "#E9EBEC", |
| 31461 | + darkBackgroundColor: "#27282A" |
| 31462 | + }; |
| 31463 | + } |
| 31464 | + return null; |
| 31465 | + } |
31447 | 31466 | function reorderArray(array, id, toIndex) {
|
31448 | 31467 | const fromIndex = array.findIndex((item) => item.id === id);
|
31449 | 31468 | const element = array.splice(fromIndex, 1)[0];
|
|
0 commit comments