@the-portland-company/shell 0.72.1 → 0.73.1
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 +14 -34
- package/dist/app-chrome.cjs.map +1 -1
- package/dist/app-chrome.js +3 -3
- 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-DFR6CNE4.js} +9 -20
- package/dist/chunk-DFR6CNE4.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 +14 -34
- 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) {
|
|
@@ -1624,7 +1613,10 @@ function SpecOverlayAction({ orgId, orgName } = {}) {
|
|
|
1624
1613
|
for (let i = 0; i < 45; i++) {
|
|
1625
1614
|
await new Promise((r) => setTimeout(r, 3e3));
|
|
1626
1615
|
if (run !== captureRun.current) return;
|
|
1627
|
-
if (!accessRef.current?.allowed)
|
|
1616
|
+
if (!accessRef.current?.allowed) {
|
|
1617
|
+
setCapture({ state: "idle" });
|
|
1618
|
+
return;
|
|
1619
|
+
}
|
|
1628
1620
|
const next = await specOverlayFetchJson(specOverlayStatusPath()).catch(() => null);
|
|
1629
1621
|
if (next && next.matched && next.live_source === "viewer" && next.finished_at !== before) {
|
|
1630
1622
|
setStatus(next);
|
|
@@ -1837,7 +1829,7 @@ function useThemePreference() {
|
|
|
1837
1829
|
}
|
|
1838
1830
|
const pref = cookie ?? (isThemePreference(ls) ? ls : null) ?? "system";
|
|
1839
1831
|
setValueState(pref);
|
|
1840
|
-
applyThemePreference(
|
|
1832
|
+
applyThemePreference();
|
|
1841
1833
|
}, []);
|
|
1842
1834
|
const meCtx = react.useContext(NavChromeContext);
|
|
1843
1835
|
react.useEffect(() => {
|
|
@@ -1846,7 +1838,7 @@ function useThemePreference() {
|
|
|
1846
1838
|
if (pending) {
|
|
1847
1839
|
if (meCtx?.me) reconciled.current = true;
|
|
1848
1840
|
setValueState(pending);
|
|
1849
|
-
applyThemePreference(
|
|
1841
|
+
applyThemePreference();
|
|
1850
1842
|
writeThemeCookie(pending);
|
|
1851
1843
|
try {
|
|
1852
1844
|
localStorage.setItem(THEME_STORAGE_KEY, pending);
|
|
@@ -1865,7 +1857,7 @@ function useThemePreference() {
|
|
|
1865
1857
|
if (isThemePreference(pref)) {
|
|
1866
1858
|
reconciled.current = true;
|
|
1867
1859
|
setValueState(pref);
|
|
1868
|
-
applyThemePreference(
|
|
1860
|
+
applyThemePreference();
|
|
1869
1861
|
writeThemeCookie(pref);
|
|
1870
1862
|
try {
|
|
1871
1863
|
localStorage.setItem(THEME_STORAGE_KEY, pref);
|
|
@@ -1884,7 +1876,7 @@ function useThemePreference() {
|
|
|
1884
1876
|
const cookie = readThemeCookie();
|
|
1885
1877
|
if (cookie) {
|
|
1886
1878
|
setValueState((prev) => {
|
|
1887
|
-
if (cookie !== prev) applyThemePreference(
|
|
1879
|
+
if (cookie !== prev) applyThemePreference();
|
|
1888
1880
|
return cookie;
|
|
1889
1881
|
});
|
|
1890
1882
|
}
|
|
@@ -1898,22 +1890,10 @@ function useThemePreference() {
|
|
|
1898
1890
|
document.removeEventListener("visibilitychange", onWake);
|
|
1899
1891
|
};
|
|
1900
1892
|
}, []);
|
|
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
1893
|
const setValue = react.useCallback(
|
|
1914
1894
|
(next) => {
|
|
1915
1895
|
setValueState(next);
|
|
1916
|
-
applyThemePreference(
|
|
1896
|
+
applyThemePreference();
|
|
1917
1897
|
writeThemeCookie(next);
|
|
1918
1898
|
try {
|
|
1919
1899
|
localStorage.setItem(THEME_STORAGE_KEY, next);
|