Compare commits
No commits in common. "85cb7ad08118778fc693916a65c4ea15af382128" and "2836e857ad7fff599c5e6ee39b97da1e6402b78b" have entirely different histories.
85cb7ad081
...
2836e857ad
5 changed files with 69 additions and 111 deletions
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"$schema": "https://json.schemastore.org/package",
|
"$schema": "https://json.schemastore.org/package",
|
||||||
"name": "tutu",
|
"name": "tutu",
|
||||||
"version": "1.1.0",
|
"version": "1.0.8",
|
||||||
"description": "",
|
"description": "",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|
|
@ -10,11 +10,6 @@
|
||||||
overscroll-behavior-block: none;
|
overscroll-behavior-block: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
body, #root {
|
|
||||||
min-height: 100vh;
|
|
||||||
min-height: 100dvh;
|
|
||||||
}
|
|
||||||
|
|
||||||
.custom-emoji {
|
.custom-emoji {
|
||||||
width: 1em;
|
width: 1em;
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,14 +98,7 @@ const safeAreaInsets: Record<string, SafeAreaInsets> = {
|
||||||
|
|
||||||
let screenOrientationCallback: (() => void) | undefined;
|
let screenOrientationCallback: (() => void) | undefined;
|
||||||
|
|
||||||
function removeSafeAreaEmulation(root: HTMLElement) {
|
|
||||||
for (const name of ["top", "right", "bottom", "left"]) {
|
|
||||||
root.style.removeProperty(`--safe-area-inset-${name}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function applySafeAreaEmulation(root: HTMLElement, insets: Inset) {
|
function applySafeAreaEmulation(root: HTMLElement, insets: Inset) {
|
||||||
removeSafeAreaEmulation(root);
|
|
||||||
for (const key of Object.keys(insets) as (keyof Inset)[]) {
|
for (const key of Object.keys(insets) as (keyof Inset)[]) {
|
||||||
const value = insets[key];
|
const value = insets[key];
|
||||||
if (!value || value === 0) continue;
|
if (!value || value === 0) continue;
|
||||||
|
@ -116,7 +109,7 @@ function applySafeAreaEmulation(root: HTMLElement, insets: Inset) {
|
||||||
function setupSafeAreaEmulation(name: string) {
|
function setupSafeAreaEmulation(name: string) {
|
||||||
const insets = safeAreaInsets[name];
|
const insets = safeAreaInsets[name];
|
||||||
const root = document.querySelector(":root")! as HTMLElement;
|
const root = document.querySelector(":root")! as HTMLElement;
|
||||||
|
if (!insets) {
|
||||||
if (screenOrientationCallback) {
|
if (screenOrientationCallback) {
|
||||||
window.screen.orientation.removeEventListener(
|
window.screen.orientation.removeEventListener(
|
||||||
"change",
|
"change",
|
||||||
|
@ -124,14 +117,11 @@ function setupSafeAreaEmulation(name: string) {
|
||||||
);
|
);
|
||||||
screenOrientationCallback = undefined;
|
screenOrientationCallback = undefined;
|
||||||
}
|
}
|
||||||
|
for (const name of ["top", "right", "bottom", "left"]) {
|
||||||
removeSafeAreaEmulation(root);
|
root.style.removeProperty(`--safe-area-inset-${name}`);
|
||||||
|
}
|
||||||
if (insets) {
|
} else {
|
||||||
screenOrientationCallback = () => {
|
screenOrientationCallback = () => {
|
||||||
console.debug(
|
|
||||||
`safe area emulation target: ${window.screen.orientation.type}`,
|
|
||||||
);
|
|
||||||
if (window.screen.orientation.type === "portrait-primary") {
|
if (window.screen.orientation.type === "portrait-primary") {
|
||||||
console.debug("safe area emulation: protrait");
|
console.debug("safe area emulation: protrait");
|
||||||
applySafeAreaEmulation(root, insets.protrait);
|
applySafeAreaEmulation(root, insets.protrait);
|
||||||
|
@ -148,16 +138,6 @@ function setupSafeAreaEmulation(name: string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (import.meta.hot) {
|
|
||||||
import.meta.hot.accept((mod) => {
|
|
||||||
if (!mod) return;
|
|
||||||
if (screenOrientationCallback) {
|
|
||||||
mod["screenOrientationCallback"] = screenOrientationCallback;
|
|
||||||
setTimeout(screenOrientationCallback, 0);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
type Strings = {
|
type Strings = {
|
||||||
["lang.auto"]: Template<{ detected: string }>;
|
["lang.auto"]: Template<{ detected: string }>;
|
||||||
} & Record<string, string | undefined>;
|
} & Record<string, string | undefined>;
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
.TootBottomSheet {
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
.Scrollable {
|
|
||||||
padding-bottom: var(--safe-area-inset-bottom, 0);
|
|
||||||
overflow-y: auto;
|
|
||||||
overscroll-behavior-y: contain;
|
|
||||||
max-height: calc(100vh - var(--scaffold-topbar-height, 0px));
|
|
||||||
max-height: calc(100dvh - var(--scaffold-topbar-height, 0px));
|
|
||||||
}
|
|
||||||
|
|
||||||
.progress-line {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
margin-top: 12px;
|
|
||||||
margin-bottom: 12px;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -11,7 +11,9 @@ import {
|
||||||
import Scaffold from "../material/Scaffold";
|
import Scaffold from "../material/Scaffold";
|
||||||
import { AppBar, CircularProgress, IconButton, Toolbar } from "@suid/material";
|
import { AppBar, CircularProgress, IconButton, Toolbar } from "@suid/material";
|
||||||
import { Title } from "../material/typography";
|
import { Title } from "../material/typography";
|
||||||
import { Close as CloseIcon } from "@suid/icons-material";
|
import {
|
||||||
|
Close as CloseIcon,
|
||||||
|
} from "@suid/icons-material";
|
||||||
import { useSessionForAcctStr } from "../masto/clients";
|
import { useSessionForAcctStr } from "../masto/clients";
|
||||||
import { resolveCustomEmoji } from "../masto/toot";
|
import { resolveCustomEmoji } from "../masto/toot";
|
||||||
import RegularToot, { findElementActionable } from "./RegularToot";
|
import RegularToot, { findElementActionable } from "./RegularToot";
|
||||||
|
@ -24,7 +26,6 @@ import TootComposer from "./TootComposer";
|
||||||
import { useDocumentTitle } from "../utils";
|
import { useDocumentTitle } from "../utils";
|
||||||
import { createTimelineControlsForArray } from "../masto/timelines";
|
import { createTimelineControlsForArray } from "../masto/timelines";
|
||||||
import TootList from "./TootList";
|
import TootList from "./TootList";
|
||||||
import "./TootBottomSheet.css";
|
|
||||||
|
|
||||||
let cachedEntry: [string, mastodon.v1.Status] | undefined;
|
let cachedEntry: [string, mastodon.v1.Status] | undefined;
|
||||||
|
|
||||||
|
@ -244,10 +245,6 @@ const TootBottomSheet: Component = (props) => {
|
||||||
</Toolbar>
|
</Toolbar>
|
||||||
</AppBar>
|
</AppBar>
|
||||||
}
|
}
|
||||||
class="TootBottomSheet"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="Scrollable"
|
|
||||||
>
|
>
|
||||||
<TimeSourceProvider value={time}>
|
<TimeSourceProvider value={time}>
|
||||||
<TootList
|
<TootList
|
||||||
|
@ -289,7 +286,11 @@ const TootBottomSheet: Component = (props) => {
|
||||||
|
|
||||||
<Show when={tootContextErrorUncaught.loading}>
|
<Show when={tootContextErrorUncaught.loading}>
|
||||||
<div
|
<div
|
||||||
class="progress-line"
|
style={{
|
||||||
|
display: "flex",
|
||||||
|
"justify-content": "center",
|
||||||
|
"margin-block": "12px",
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<CircularProgress style="width: 1.5em; height: 1.5em;" />
|
<CircularProgress style="width: 1.5em; height: 1.5em;" />
|
||||||
</div>
|
</div>
|
||||||
|
@ -301,7 +302,7 @@ const TootBottomSheet: Component = (props) => {
|
||||||
onChangeToot={descendants.set}
|
onChangeToot={descendants.set}
|
||||||
/>
|
/>
|
||||||
</TimeSourceProvider>
|
</TimeSourceProvider>
|
||||||
</div>
|
<div style={{ height: "var(--safe-area-inset-bottom, 0)" }}></div>
|
||||||
</Scaffold>
|
</Scaffold>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue