pinokiod 3.212.0 → 3.214.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "3.212.0",
3
+ "version": "3.214.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -761,6 +761,7 @@
761
761
  initLayout();
762
762
  window.addEventListener('message', onMessage);
763
763
  window.addEventListener('resize', onResize);
764
+ window.addEventListener('pinokio:viewport-change', onResize);
764
765
 
765
766
  const api = {
766
767
  split({ frameId, direction, targetUrl }) {
@@ -11,11 +11,13 @@
11
11
  --layout-gutter-bg: rgba(0, 0, 0, 0.04);
12
12
  --layout-gutter-bg-hover: cornflowerblue;
13
13
  --layout-shadow: rgba(0, 0, 0, 0.06);
14
+ --layout-viewport-height: 100vh;
14
15
  color-scheme: light dark;
15
16
  }
16
17
 
17
18
  html, body {
18
- height: 100%;
19
+ height: var(--layout-viewport-height);
20
+ min-height: var(--layout-viewport-height);
19
21
  width: 100%;
20
22
  margin: 0;
21
23
  padding: 0;
@@ -118,6 +120,35 @@
118
120
  pointer-events: none;
119
121
  }
120
122
  </style>
123
+ <script>
124
+ (function () {
125
+ const root = document.documentElement;
126
+ const updateViewportHeight = () => {
127
+ const viewport = window.visualViewport;
128
+ const height = viewport ? viewport.height : window.innerHeight;
129
+ if (!height || !Number.isFinite(height)) {
130
+ return;
131
+ }
132
+ root.style.setProperty('--layout-viewport-height', `${Math.max(0, height).toFixed(2)}px`);
133
+ window.dispatchEvent(new Event('pinokio:viewport-change'));
134
+ };
135
+
136
+ const resizeEvents = ['resize', 'orientationchange'];
137
+ const boundUpdate = () => requestAnimationFrame(updateViewportHeight);
138
+
139
+ updateViewportHeight();
140
+
141
+ resizeEvents.forEach((eventName) => {
142
+ window.addEventListener(eventName, boundUpdate, { passive: true });
143
+ });
144
+ if (window.visualViewport) {
145
+ window.visualViewport.addEventListener('resize', boundUpdate, { passive: true });
146
+ window.visualViewport.addEventListener('scroll', boundUpdate, { passive: true });
147
+ }
148
+
149
+ window.addEventListener('pageshow', boundUpdate, { passive: true });
150
+ })();
151
+ </script>
121
152
  </head>
122
153
  <body class="<%= theme %>" data-agent="<%= agent %>">
123
154
  <div id='dragger'></div>