@the-portland-company/shell 0.72.0 → 0.73.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/app-chrome.cjs +12 -34
- package/dist/app-chrome.cjs.map +1 -1
- package/dist/app-chrome.js +5 -4
- package/dist/app-chrome.js.map +1 -1
- package/dist/chrome.css +0 -50
- package/dist/{chunk-NHBNM5P3.js → chunk-BHRVZPZ7.js} +5 -14
- package/dist/chunk-BHRVZPZ7.js.map +1 -0
- package/dist/{chunk-6OM62ZTK.js → chunk-RTV4BIO6.js} +5 -19
- package/dist/chunk-RTV4BIO6.js.map +1 -0
- package/dist/index.cjs +2 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -10
- package/dist/index.js.map +1 -1
- package/dist/native.cjs +10 -33
- package/dist/native.cjs.map +1 -1
- package/dist/native.js +2 -2
- package/dist/theme-preference.cjs +3 -12
- package/dist/theme-preference.cjs.map +1 -1
- package/dist/theme-preference.d.cts +1 -1
- package/dist/theme-preference.d.ts +1 -1
- package/dist/theme-preference.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-6OM62ZTK.js.map +0 -1
- package/dist/chunk-NHBNM5P3.js.map +0 -1
package/dist/app-chrome.cjs
CHANGED
|
@@ -244,21 +244,12 @@ function readPendingThemeChoice() {
|
|
|
244
244
|
function clearPendingThemeChoice() {
|
|
245
245
|
writeSharedCookie(THEME_PENDING_COOKIE, "", 0);
|
|
246
246
|
}
|
|
247
|
-
function resolveTheme(
|
|
248
|
-
if (pref === "dark") return "dark";
|
|
249
|
-
if (pref === "system") {
|
|
250
|
-
try {
|
|
251
|
-
if (typeof window !== "undefined" && typeof window.matchMedia === "function") {
|
|
252
|
-
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
253
|
-
}
|
|
254
|
-
} catch {
|
|
255
|
-
}
|
|
256
|
-
}
|
|
247
|
+
function resolveTheme(_pref) {
|
|
257
248
|
return "light";
|
|
258
249
|
}
|
|
259
250
|
function applyThemePreference(pref) {
|
|
260
251
|
if (typeof document === "undefined") return;
|
|
261
|
-
const resolved = resolveTheme(
|
|
252
|
+
const resolved = resolveTheme();
|
|
262
253
|
const d = document.documentElement;
|
|
263
254
|
d.classList.toggle("dark", resolved === "dark");
|
|
264
255
|
try {
|
|
@@ -276,7 +267,7 @@ var ls=null;try{ls=localStorage.getItem(KEY);}catch(e){}
|
|
|
276
267
|
var pref=cookie||ls||"system";
|
|
277
268
|
if(VALID.indexOf(pref)===-1)pref="system";
|
|
278
269
|
if(cookie&&cookie!==ls){try{localStorage.setItem(KEY,cookie);}catch(e){}}
|
|
279
|
-
var dark=
|
|
270
|
+
var dark=false;
|
|
280
271
|
var d=document.documentElement;
|
|
281
272
|
if(dark)d.classList.add("dark");else d.classList.remove("dark");
|
|
282
273
|
try{d.setAttribute("data-theme",dark?"dark":"light");d.style.colorScheme=dark?"dark":"light";}catch(e){}
|
|
@@ -374,9 +365,7 @@ function TopBarWidgetSlot({
|
|
|
374
365
|
] });
|
|
375
366
|
}
|
|
376
367
|
var THEME_OPTIONS = [
|
|
377
|
-
{ value: "light", label: "Light" }
|
|
378
|
-
{ value: "system", label: "System" },
|
|
379
|
-
{ value: "dark", label: "Dark" }
|
|
368
|
+
{ value: "light", label: "Light" }
|
|
380
369
|
];
|
|
381
370
|
function NavThemeControl({
|
|
382
371
|
value,
|
|
@@ -1504,7 +1493,7 @@ function currentChromeTheme() {
|
|
|
1504
1493
|
const root = document.documentElement;
|
|
1505
1494
|
if (root.classList.contains("dark") || root.getAttribute("data-theme") === "dark") return "dark";
|
|
1506
1495
|
if (root.classList.contains("light") || root.getAttribute("data-theme") === "light") return "light";
|
|
1507
|
-
return
|
|
1496
|
+
return "light";
|
|
1508
1497
|
}
|
|
1509
1498
|
var SPEC_OVERLAY_ROOT_ATTR = "data-spec-overlay-root";
|
|
1510
1499
|
async function captureMyView(status, orgId, orgName) {
|
|
@@ -1837,7 +1826,7 @@ function useThemePreference() {
|
|
|
1837
1826
|
}
|
|
1838
1827
|
const pref = cookie ?? (isThemePreference(ls) ? ls : null) ?? "system";
|
|
1839
1828
|
setValueState(pref);
|
|
1840
|
-
applyThemePreference(
|
|
1829
|
+
applyThemePreference();
|
|
1841
1830
|
}, []);
|
|
1842
1831
|
const meCtx = react.useContext(NavChromeContext);
|
|
1843
1832
|
react.useEffect(() => {
|
|
@@ -1846,7 +1835,7 @@ function useThemePreference() {
|
|
|
1846
1835
|
if (pending) {
|
|
1847
1836
|
if (meCtx?.me) reconciled.current = true;
|
|
1848
1837
|
setValueState(pending);
|
|
1849
|
-
applyThemePreference(
|
|
1838
|
+
applyThemePreference();
|
|
1850
1839
|
writeThemeCookie(pending);
|
|
1851
1840
|
try {
|
|
1852
1841
|
localStorage.setItem(THEME_STORAGE_KEY, pending);
|
|
@@ -1865,7 +1854,7 @@ function useThemePreference() {
|
|
|
1865
1854
|
if (isThemePreference(pref)) {
|
|
1866
1855
|
reconciled.current = true;
|
|
1867
1856
|
setValueState(pref);
|
|
1868
|
-
applyThemePreference(
|
|
1857
|
+
applyThemePreference();
|
|
1869
1858
|
writeThemeCookie(pref);
|
|
1870
1859
|
try {
|
|
1871
1860
|
localStorage.setItem(THEME_STORAGE_KEY, pref);
|
|
@@ -1884,7 +1873,7 @@ function useThemePreference() {
|
|
|
1884
1873
|
const cookie = readThemeCookie();
|
|
1885
1874
|
if (cookie) {
|
|
1886
1875
|
setValueState((prev) => {
|
|
1887
|
-
if (cookie !== prev) applyThemePreference(
|
|
1876
|
+
if (cookie !== prev) applyThemePreference();
|
|
1888
1877
|
return cookie;
|
|
1889
1878
|
});
|
|
1890
1879
|
}
|
|
@@ -1898,22 +1887,10 @@ function useThemePreference() {
|
|
|
1898
1887
|
document.removeEventListener("visibilitychange", onWake);
|
|
1899
1888
|
};
|
|
1900
1889
|
}, []);
|
|
1901
|
-
react.useEffect(() => {
|
|
1902
|
-
if (value !== "system") return;
|
|
1903
|
-
let mq;
|
|
1904
|
-
try {
|
|
1905
|
-
mq = window.matchMedia("(prefers-color-scheme: dark)");
|
|
1906
|
-
} catch {
|
|
1907
|
-
return;
|
|
1908
|
-
}
|
|
1909
|
-
const onChange = () => applyThemePreference("system");
|
|
1910
|
-
mq.addEventListener("change", onChange);
|
|
1911
|
-
return () => mq.removeEventListener("change", onChange);
|
|
1912
|
-
}, [value]);
|
|
1913
1890
|
const setValue = react.useCallback(
|
|
1914
1891
|
(next) => {
|
|
1915
1892
|
setValueState(next);
|
|
1916
|
-
applyThemePreference(
|
|
1893
|
+
applyThemePreference();
|
|
1917
1894
|
writeThemeCookie(next);
|
|
1918
1895
|
try {
|
|
1919
1896
|
localStorage.setItem(THEME_STORAGE_KEY, next);
|
|
@@ -4361,7 +4338,8 @@ var POLITOGY_APPS = {
|
|
|
4361
4338
|
},
|
|
4362
4339
|
forms: { title: "Forms", origin: "https://forms.politogyvrm.com", storagePrefix: "forms" },
|
|
4363
4340
|
surveys: { title: "Surveys", origin: "https://surveys.politogyvrm.com", storagePrefix: "surveys" },
|
|
4364
|
-
|
|
4341
|
+
// Specs/Left-Navigation §9.2: Polling is a Campaign row (Research).
|
|
4342
|
+
polls: { title: "Polls", origin: "https://polls.politogyvrm.com", storagePrefix: "polls", mode: "campaign" },
|
|
4365
4343
|
ctas: { title: "CTAs", origin: "https://ctas.politogyvrm.com", storagePrefix: "ctas" },
|
|
4366
4344
|
petitions: {
|
|
4367
4345
|
title: "Petitions",
|