@geometra/renderer-three 1.4.0 → 1.6.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/page-host.d.ts +7 -2
- package/dist/page-host.d.ts.map +1 -1
- package/dist/page-host.js +19 -1
- package/dist/page-host.js.map +1 -1
- package/package.json +4 -4
package/dist/page-host.d.ts
CHANGED
|
@@ -6,8 +6,13 @@ export interface GeometraPageSection {
|
|
|
6
6
|
id: string;
|
|
7
7
|
/** WebSocket URL for the Geometra server view. */
|
|
8
8
|
url: string;
|
|
9
|
-
/**
|
|
10
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Height in CSS pixels, or `'auto'` to size from server-computed layout.
|
|
11
|
+
* When `'auto'`, the section resizes to match the root `layout.height` from
|
|
12
|
+
* the first server frame (requires `height: 'auto'` on the corresponding
|
|
13
|
+
* `createGeometraServer`).
|
|
14
|
+
*/
|
|
15
|
+
height: number | 'auto';
|
|
11
16
|
/** Enable binary framing for the WebSocket. */
|
|
12
17
|
binaryFraming?: boolean;
|
|
13
18
|
/** Renderer options (background color, etc.). */
|
package/dist/page-host.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-host.d.ts","sourceRoot":"","sources":["../src/page-host.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAChC,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAEL,KAAK,4BAA4B,EACjC,KAAK,6BAA6B,EACnC,MAAM,iBAAiB,CAAA;AAExB,iFAAiF;AACjF,MAAM,WAAW,mBAAmB;IAClC,kCAAkC;IAClC,EAAE,EAAE,MAAM,CAAA;IACV,kDAAkD;IAClD,GAAG,EAAE,MAAM,CAAA;IACX
|
|
1
|
+
{"version":3,"file":"page-host.d.ts","sourceRoot":"","sources":["../src/page-host.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAChC,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAEL,KAAK,4BAA4B,EACjC,KAAK,6BAA6B,EACnC,MAAM,iBAAiB,CAAA;AAExB,iFAAiF;AACjF,MAAM,WAAW,mBAAmB;IAClC,kCAAkC;IAClC,EAAE,EAAE,MAAM,CAAA;IACV,kDAAkD;IAClD,GAAG,EAAE,MAAM,CAAA;IACX;;;;;OAKG;IACH,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,+CAA+C;IAC/C,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,iDAAiD;IACjD,eAAe,CAAC,EAAE,IAAI,CAAC,0BAA0B,CAAC,iBAAiB,CAAC,EAAE,QAAQ,CAAC,CAAA;CAChF;AAED,MAAM,WAAW,4BAA6B,SAAQ,6BAA6B;IACjF,6DAA6D;IAC7D,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,mFAAmF;IACnF,iBAAiB,CAAC,EAAE,mBAAmB,EAAE,CAAA;CAC1C;AAED,MAAM,WAAW,2BAA4B,SAAQ,4BAA4B;IAC/E,0EAA0E;IAC1E,MAAM,CAAC,EAAE,yBAAyB,CAAA;IAClC,uDAAuD;IACvD,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAA;IACjD,6CAA6C;IAC7C,QAAQ,EAAE,cAAc,CAAA;CACzB;AAoDD;;;;;;;;;GASG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,4BAA4B,GACpC,2BAA2B,CAiE7B"}
|
package/dist/page-host.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { createBrowserCanvasClient, } from '@geometra/renderer-canvas';
|
|
2
2
|
import { createThreeGeometraSplitHost, } from './split-host.js';
|
|
3
3
|
function createSectionCanvas(doc, section, win) {
|
|
4
|
+
const isAutoHeight = section.height === 'auto';
|
|
4
5
|
const wrapper = doc.createElement('div');
|
|
5
6
|
wrapper.style.width = '100%';
|
|
6
|
-
wrapper.style.height = `${section.height}px`;
|
|
7
|
+
wrapper.style.height = isAutoHeight ? '0' : `${section.height}px`;
|
|
7
8
|
wrapper.style.minWidth = '0';
|
|
8
9
|
wrapper.dataset.geometraSection = section.id;
|
|
9
10
|
const canvas = doc.createElement('canvas');
|
|
@@ -21,6 +22,23 @@ function createSectionCanvas(doc, section, win) {
|
|
|
21
22
|
...section.rendererOptions,
|
|
22
23
|
},
|
|
23
24
|
});
|
|
25
|
+
// Auto-height: poll the client's layout for the computed root height
|
|
26
|
+
if (isAutoHeight) {
|
|
27
|
+
let lastHeight = 0;
|
|
28
|
+
const checkHeight = () => {
|
|
29
|
+
const layout = handle.client.layout;
|
|
30
|
+
if (layout && layout.height > 0 && layout.height !== lastHeight) {
|
|
31
|
+
lastHeight = layout.height;
|
|
32
|
+
wrapper.style.height = `${layout.height}px`;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
// Check on each animation frame until we get a height, then periodically
|
|
36
|
+
const poll = () => {
|
|
37
|
+
checkHeight();
|
|
38
|
+
win.requestAnimationFrame(poll);
|
|
39
|
+
};
|
|
40
|
+
win.requestAnimationFrame(poll);
|
|
41
|
+
}
|
|
24
42
|
return { wrapper, handle };
|
|
25
43
|
}
|
|
26
44
|
/**
|
package/dist/page-host.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-host.js","sourceRoot":"","sources":["../src/page-host.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,GAG1B,MAAM,2BAA2B,CAAA;AAClC,OAAO,EACL,4BAA4B,GAG7B,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"page-host.js","sourceRoot":"","sources":["../src/page-host.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,GAG1B,MAAM,2BAA2B,CAAA;AAClC,OAAO,EACL,4BAA4B,GAG7B,MAAM,iBAAiB,CAAA;AAqCxB,SAAS,mBAAmB,CAC1B,GAAa,EACb,OAA4B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A;IAED,OAAO;QACL,GAAG,SAAS;QACZ,MAAM,EAAE,YAAY;QACpB,SAAS,EAAE,YAAY;QACvB,QAAQ;QACR,OAAO;KACR,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geometra/renderer-three",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Three.js render target helpers for Geometra — stack WebGL with the geometry-streamed canvas client, declarative scene3d element rendering",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"check": "tsc --noEmit"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@geometra/client": "^1.
|
|
40
|
-
"@geometra/core": "^1.
|
|
41
|
-
"@geometra/renderer-canvas": "^1.
|
|
39
|
+
"@geometra/client": "^1.6.0",
|
|
40
|
+
"@geometra/core": "^1.6.0",
|
|
41
|
+
"@geometra/renderer-canvas": "^1.6.0"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"three": ">=0.160.0 <0.180.0"
|