@monimesl/dot-renderer-react 0.1.0-alpha.27 → 0.1.0-alpha.29

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.
@@ -1,6 +1,6 @@
1
1
  import { useTheme } from "../theme.js";
2
2
  import { SPACE } from "./tokens.js";
3
- import { insets, paddingStyle } from "./padding.js";
3
+ import { HOME_INDICATOR, insets, pinnedPaddingStyle } from "./padding.js";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  //#region src/components/footer.tsx
6
6
  const Footer = ({ children, ...padding }) => {
@@ -14,7 +14,8 @@ const Footer = ({ children, ...padding }) => {
14
14
  display: "flex",
15
15
  flexDirection: "column",
16
16
  gap: SPACE.medium,
17
- ...paddingStyle(padding, insets(SPACE.medium, 0)),
17
+ ...pinnedPaddingStyle(padding, insets(SPACE.medium, 0)),
18
+ marginBottom: `calc(-1 * ${HOME_INDICATOR})`,
18
19
  background: colors.background
19
20
  },
20
21
  children
@@ -26,5 +26,13 @@ function sidePadding(pageSpace, ownPixels) {
26
26
  if (pageSpace === void 0) return ownPixels;
27
27
  return SPACE[pageSpace];
28
28
  }
29
+ const HOME_INDICATOR = "env(safe-area-inset-bottom, 0px)";
30
+ function pinnedPaddingStyle(props, ownInsets) {
31
+ const style = paddingStyle(props, ownInsets);
32
+ return {
33
+ ...style,
34
+ paddingBottom: `calc(${style.paddingBottom}px + ${HOME_INDICATOR})`
35
+ };
36
+ }
29
37
  //#endregion
30
- export { insets, paddingStyle };
38
+ export { HOME_INDICATOR, insets, paddingStyle, pinnedPaddingStyle };
@@ -2,7 +2,7 @@ import { FONT_FAMILY, useTheme } from "../theme.js";
2
2
  import { CARD_RADIUS_SCALE, FONT_SIZE, ICON_SIZE, SPACE, WEIGHTS } from "./tokens.js";
3
3
  import { CLOSE_ARTWORK } from "./icon-artwork.js";
4
4
  import { IconSvg } from "./icon-svg.js";
5
- import { paddingStyle } from "./padding.js";
5
+ import { pinnedPaddingStyle } from "./padding.js";
6
6
  import { DialogBackdrop } from "../vendor/@base-ui/react/dialog/backdrop/DialogBackdrop.js";
7
7
  import { DialogClose } from "../vendor/@base-ui/react/dialog/close/DialogClose.js";
8
8
  import { DialogPopup } from "../vendor/@base-ui/react/dialog/popup/DialogPopup.js";
@@ -45,7 +45,7 @@ const SheetPanel = ({ open, title, showCloseIcon = false, onClose, children, ...
45
45
  gap: SPACE.medium,
46
46
  maxHeight: "85vh",
47
47
  overflowY: "auto",
48
- ...paddingStyle(padding, {
48
+ ...pinnedPaddingStyle(padding, {
49
49
  top: 16,
50
50
  start: 16,
51
51
  end: 16,
@@ -1,9 +1,11 @@
1
1
  import { useTheme } from "../theme.js";
2
2
  import { SPACE } from "./tokens.js";
3
3
  import { insets, paddingStyle } from "./padding.js";
4
+ import { Footer as Footer$1 } from "./footer.js";
4
5
  import { pressable } from "./pressable.js";
5
6
  import { boxStyle } from "./box.js";
6
7
  import { createEvent } from "@monimesl/dot-core";
8
+ import { Children, isValidElement } from "react";
7
9
  import { jsx } from "react/jsx-runtime";
8
10
  //#region src/components/view.tsx
9
11
  const ALIGN = {
@@ -38,6 +40,7 @@ const View$1 = (props) => {
38
40
  ...boxStyle(props, theme, card ? CARD_LOOK : void 0),
39
41
  cursor: onTap ? "pointer" : void 0
40
42
  };
43
+ if (endsWithFooter(children)) style.paddingBottom = 0;
41
44
  if (grow) {
42
45
  style.flexGrow = 1;
43
46
  style.minWidth = 0;
@@ -50,5 +53,9 @@ const View$1 = (props) => {
50
53
  children
51
54
  });
52
55
  };
56
+ function endsWithFooter(children) {
57
+ const last = Children.toArray(children).at(-1);
58
+ return isValidElement(last) && last.type === Footer$1;
59
+ }
53
60
  //#endregion
54
61
  export { View$1 as View };
package/dist/root.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { FONT_FAMILY, ThemeContext, resolveTheme, useTheme } from "./theme.js";
2
+ import { HOME_INDICATOR } from "./components/padding.js";
2
3
  import { PortalContainerContext } from "./portal.js";
3
4
  import { PageRoot } from "./page-root.js";
4
5
  import { PullToRefresh } from "./pull-to-refresh.js";
@@ -54,7 +55,9 @@ function DefaultSurface({ children }) {
54
55
  return /* @__PURE__ */ jsx("div", {
55
56
  className: "dot-surface",
56
57
  style: {
58
+ boxSizing: "border-box",
57
59
  minHeight: "100vh",
60
+ paddingBottom: HOME_INDICATOR,
58
61
  display: "flex",
59
62
  flexDirection: "column",
60
63
  background: colors.background,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monimesl/dot-renderer-react",
3
- "version": "0.1.0-alpha.27",
3
+ "version": "0.1.0-alpha.29",
4
4
  "description": "React renderer for Dot webviews",
5
5
  "type": "module",
6
6
  "repository": {
@@ -29,8 +29,8 @@
29
29
  "react": "^19.3.0",
30
30
  "react-dom": "^19.3.0",
31
31
  "uqr": "^0.1.3",
32
- "@monimesl/dot-core": "0.1.0-alpha.27",
33
- "@monimesl/dot-webview": "0.1.0-alpha.27"
32
+ "@monimesl/dot-core": "0.1.0-alpha.29",
33
+ "@monimesl/dot-webview": "0.1.0-alpha.29"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@base-ui/react": "1.8.0",
@@ -46,7 +46,7 @@
46
46
  "tsdown": "^0.23.0",
47
47
  "typescript": "^5.9.3",
48
48
  "vitest": "^5.0.1",
49
- "@monimesl/dot-service": "0.1.0-alpha.27"
49
+ "@monimesl/dot-service": "0.1.0-alpha.29"
50
50
  },
51
51
  "publishConfig": {
52
52
  "access": "public"