@threenative/ui 0.3.3 → 0.3.5
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/index.js +9 -20
- package/package.json +5 -4
package/dist/index.js
CHANGED
|
@@ -452,50 +452,39 @@ function useUiLayer(name) {
|
|
|
452
452
|
}
|
|
453
453
|
return value;
|
|
454
454
|
}
|
|
455
|
-
function
|
|
456
|
-
const [fps, setFps] = useState(void 0);
|
|
455
|
+
function DevSceneVerdict({ bridge }) {
|
|
457
456
|
const [verdict, setVerdict] = useState(void 0);
|
|
458
457
|
useEffect(
|
|
459
458
|
() => bridge.onMessage((message) => {
|
|
460
459
|
if (message.type !== UI_DEV_METRICS_MESSAGE) return;
|
|
461
|
-
const value = message.fps;
|
|
462
|
-
if (typeof value === "number" && Number.isFinite(value) && value > 0) setFps(value);
|
|
463
460
|
const warning = message.sceneWarning;
|
|
464
461
|
if (typeof warning === "string" && warning.length > 0) setVerdict(warning);
|
|
465
462
|
}),
|
|
466
463
|
[bridge]
|
|
467
464
|
);
|
|
468
|
-
if (
|
|
465
|
+
if (verdict === void 0) return null;
|
|
469
466
|
return (
|
|
470
467
|
// `<output>` carries the status role natively, so the readout is announced without an ARIA
|
|
471
468
|
// attribute standing in for an element that already means this.
|
|
472
|
-
/* @__PURE__ */
|
|
469
|
+
/* @__PURE__ */ jsx(
|
|
473
470
|
"output",
|
|
474
471
|
{
|
|
475
|
-
className: "tn-dev-
|
|
472
|
+
className: "tn-dev-scene-warning",
|
|
476
473
|
style: {
|
|
477
474
|
position: "absolute",
|
|
478
475
|
top: 8,
|
|
479
476
|
right: 8,
|
|
477
|
+
maxWidth: 420,
|
|
480
478
|
padding: "2px 6px",
|
|
481
479
|
borderRadius: 4,
|
|
482
480
|
background: "rgba(0, 0, 0, 0.55)",
|
|
483
|
-
color: "#
|
|
481
|
+
color: "#ffd98a",
|
|
484
482
|
font: "500 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace",
|
|
483
|
+
whiteSpace: "normal",
|
|
485
484
|
pointerEvents: "none",
|
|
486
485
|
zIndex: 2147483647
|
|
487
486
|
},
|
|
488
|
-
children:
|
|
489
|
-
`${Math.round(fps)} fps`,
|
|
490
|
-
verdict === void 0 ? null : /* @__PURE__ */ jsx(
|
|
491
|
-
"span",
|
|
492
|
-
{
|
|
493
|
-
className: "tn-dev-scene-warning",
|
|
494
|
-
style: { display: "block", maxWidth: 420, color: "#ffd98a", whiteSpace: "normal" },
|
|
495
|
-
children: verdict
|
|
496
|
-
}
|
|
497
|
-
)
|
|
498
|
-
]
|
|
487
|
+
children: verdict
|
|
499
488
|
}
|
|
500
489
|
)
|
|
501
490
|
);
|
|
@@ -527,7 +516,7 @@ function UiLayer({ children }) {
|
|
|
527
516
|
if (value === void 0) return null;
|
|
528
517
|
return /* @__PURE__ */ jsxs(UiLayerContext.Provider, { value, children: [
|
|
529
518
|
children,
|
|
530
|
-
/* @__PURE__ */ jsx(
|
|
519
|
+
/* @__PURE__ */ jsx(DevSceneVerdict, { bridge: value.bridge })
|
|
531
520
|
] });
|
|
532
521
|
}
|
|
533
522
|
function useUiState(selector) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@threenative/ui",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "React bindings for mounting a ThreeNative game and reading throttled state.",
|
|
6
6
|
"keywords": [
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"sideEffects": false,
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@threenative/core": ">=0.3.
|
|
44
|
+
"@threenative/core": ">=0.3.5 <0.4.0",
|
|
45
45
|
"react": ">=19.2.0 <20",
|
|
46
46
|
"react-dom": ">=19.2.0 <20"
|
|
47
47
|
},
|
|
@@ -54,8 +54,9 @@
|
|
|
54
54
|
"react-dom": "19.2.0",
|
|
55
55
|
"react-test-renderer": "19.2.0",
|
|
56
56
|
"tsup": "8.5.1",
|
|
57
|
-
"typescript": "
|
|
58
|
-
"@
|
|
57
|
+
"typescript": "npm:@typescript/typescript6@6.0.2",
|
|
58
|
+
"@typescript/native": "npm:typescript@7.0.2",
|
|
59
|
+
"@threenative/core": "0.3.5"
|
|
59
60
|
},
|
|
60
61
|
"scripts": {
|
|
61
62
|
"build": "tsup --config tsup.config.ts && publint",
|