@noya-app/noya-multiplayer-react 0.1.74 → 0.1.76
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/.turbo/turbo-build.log +11 -11
- package/CHANGELOG.md +15 -0
- package/dist/index.bundle.js +28 -28
- package/dist/index.d.mts +7 -9
- package/dist/index.d.ts +7 -9
- package/dist/index.js +298 -207
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +242 -147
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/NoyaStateContext.tsx +26 -42
- package/src/inspector/StateInspector.tsx +123 -52
- package/src/inspector/sections/EventsSection.tsx +22 -1
- package/src/inspector/sections/ServerScriptLogsSection.tsx +18 -2
- package/src/inspector/usePausedStream.ts +33 -0
- package/src/singleton.tsx +2 -3
package/dist/index.mjs
CHANGED
|
@@ -2023,7 +2023,7 @@ function Literal(value, options = {}) {
|
|
|
2023
2023
|
}
|
|
2024
2024
|
|
|
2025
2025
|
// ../../node_modules/@sinclair/typebox/build/esm/type/boolean/boolean.mjs
|
|
2026
|
-
function
|
|
2026
|
+
function Boolean2(options = {}) {
|
|
2027
2027
|
return {
|
|
2028
2028
|
...options,
|
|
2029
2029
|
[Kind]: "Boolean",
|
|
@@ -2057,7 +2057,7 @@ function String2(options = {}) {
|
|
|
2057
2057
|
// ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/syntax.mjs
|
|
2058
2058
|
function* FromUnion(syntax) {
|
|
2059
2059
|
const trim = syntax.trim().replace(/"|'/g, "");
|
|
2060
|
-
return trim === "boolean" ? yield
|
|
2060
|
+
return trim === "boolean" ? yield Boolean2() : trim === "number" ? yield Number2() : trim === "bigint" ? yield BigInt2() : trim === "string" ? yield String2() : yield (() => {
|
|
2061
2061
|
const literals = trim.split("|").map((literal) => Literal(literal.trim()));
|
|
2062
2062
|
return literals.length === 0 ? Never() : literals.length === 1 ? literals[0] : UnionEvaluated(literals);
|
|
2063
2063
|
})();
|
|
@@ -3849,7 +3849,7 @@ __export(type_exports3, {
|
|
|
3849
3849
|
AsyncIterator: () => AsyncIterator,
|
|
3850
3850
|
Awaited: () => Awaited,
|
|
3851
3851
|
BigInt: () => BigInt2,
|
|
3852
|
-
Boolean: () =>
|
|
3852
|
+
Boolean: () => Boolean2,
|
|
3853
3853
|
Capitalize: () => Capitalize,
|
|
3854
3854
|
Composite: () => Composite,
|
|
3855
3855
|
Const: () => Const,
|
|
@@ -4612,7 +4612,10 @@ import {
|
|
|
4612
4612
|
Observable
|
|
4613
4613
|
} from "@noya-app/observable";
|
|
4614
4614
|
import { useJsonMemo, useStableCallback } from "@noya-app/react-utils";
|
|
4615
|
-
import
|
|
4615
|
+
import {
|
|
4616
|
+
findNoyaUser
|
|
4617
|
+
} from "@noya-app/state-manager";
|
|
4618
|
+
import React19, {
|
|
4616
4619
|
createContext,
|
|
4617
4620
|
useCallback as useCallback3,
|
|
4618
4621
|
useContext,
|
|
@@ -4729,7 +4732,7 @@ var ErrorOverlay = React.memo(function ErrorOverlay2({
|
|
|
4729
4732
|
});
|
|
4730
4733
|
|
|
4731
4734
|
// src/inspector/useStateInspector.tsx
|
|
4732
|
-
import
|
|
4735
|
+
import React17 from "react";
|
|
4733
4736
|
import { createRoot } from "react-dom/client";
|
|
4734
4737
|
import { useIsomorphicLayoutEffect } from "@noya-app/react-utils";
|
|
4735
4738
|
|
|
@@ -4863,7 +4866,7 @@ function uuid() {
|
|
|
4863
4866
|
|
|
4864
4867
|
// src/inspector/StateInspector.tsx
|
|
4865
4868
|
import { downloadBlob, memoGeneric } from "@noya-app/react-utils";
|
|
4866
|
-
import
|
|
4869
|
+
import React16, {
|
|
4867
4870
|
useCallback,
|
|
4868
4871
|
useEffect as useEffect2,
|
|
4869
4872
|
useLayoutEffect
|
|
@@ -5263,7 +5266,9 @@ function EventsSection({
|
|
|
5263
5266
|
setShowEvents,
|
|
5264
5267
|
colorScheme,
|
|
5265
5268
|
eventsContainerRef,
|
|
5266
|
-
connectionEvents
|
|
5269
|
+
connectionEvents,
|
|
5270
|
+
paused,
|
|
5271
|
+
onTogglePaused
|
|
5267
5272
|
}) {
|
|
5268
5273
|
const theme = getStateInspectorTheme(colorScheme);
|
|
5269
5274
|
return /* @__PURE__ */ React9.createElement(
|
|
@@ -5272,9 +5277,20 @@ function EventsSection({
|
|
|
5272
5277
|
open: showEvents,
|
|
5273
5278
|
setOpen: setShowEvents,
|
|
5274
5279
|
title: "Events",
|
|
5275
|
-
colorScheme
|
|
5280
|
+
colorScheme,
|
|
5281
|
+
right: /* @__PURE__ */ React9.createElement(StateInspectorButton, { theme, onClick: onTogglePaused }, paused ? "Resume" : "Pause")
|
|
5276
5282
|
},
|
|
5277
|
-
/* @__PURE__ */ React9.createElement(StateInspectorDisclosureRowInner, { ref: eventsContainerRef },
|
|
5283
|
+
/* @__PURE__ */ React9.createElement(StateInspectorDisclosureRowInner, { ref: eventsContainerRef }, paused && /* @__PURE__ */ React9.createElement(
|
|
5284
|
+
"div",
|
|
5285
|
+
{
|
|
5286
|
+
style: {
|
|
5287
|
+
padding: "4px 12px",
|
|
5288
|
+
fontSize: "11px",
|
|
5289
|
+
opacity: 0.7
|
|
5290
|
+
}
|
|
5291
|
+
},
|
|
5292
|
+
"Event streaming paused"
|
|
5293
|
+
), connectionEvents?.map(
|
|
5278
5294
|
(event, index) => event.type === "stateChange" ? /* @__PURE__ */ React9.createElement(StateInspectorRow, { key: index, colorScheme }, "connection:", " ", /* @__PURE__ */ React9.createElement("span", { style: { fontStyle: "italic" } }, event.state.toLowerCase())) : /* @__PURE__ */ React9.createElement(
|
|
5279
5295
|
StateInspectorRow,
|
|
5280
5296
|
{
|
|
@@ -5305,7 +5321,7 @@ function EventsSection({
|
|
|
5305
5321
|
}
|
|
5306
5322
|
)
|
|
5307
5323
|
)
|
|
5308
|
-
), !connectionEvents && /* @__PURE__ */ React9.createElement(
|
|
5324
|
+
), !connectionEvents?.length && /* @__PURE__ */ React9.createElement(
|
|
5309
5325
|
"div",
|
|
5310
5326
|
{
|
|
5311
5327
|
style: {
|
|
@@ -5559,7 +5575,8 @@ function ServerScriptLogsSection({
|
|
|
5559
5575
|
logs,
|
|
5560
5576
|
containerRef,
|
|
5561
5577
|
paused,
|
|
5562
|
-
onTogglePaused
|
|
5578
|
+
onTogglePaused,
|
|
5579
|
+
title = "Server Script Logs"
|
|
5563
5580
|
}) {
|
|
5564
5581
|
const theme = getStateInspectorTheme(colorScheme);
|
|
5565
5582
|
return /* @__PURE__ */ React11.createElement(
|
|
@@ -5567,7 +5584,7 @@ function ServerScriptLogsSection({
|
|
|
5567
5584
|
{
|
|
5568
5585
|
open: showLogs,
|
|
5569
5586
|
setOpen: setShowLogs,
|
|
5570
|
-
title
|
|
5587
|
+
title,
|
|
5571
5588
|
colorScheme,
|
|
5572
5589
|
right: /* @__PURE__ */ React11.createElement(StateInspectorButton, { theme, onClick: onTogglePaused }, paused ? "Resume" : "Pause")
|
|
5573
5590
|
},
|
|
@@ -5596,6 +5613,18 @@ function ServerScriptLogsSection({
|
|
|
5596
5613
|
},
|
|
5597
5614
|
/* @__PURE__ */ React11.createElement("span", null, formatTimestamp(log.timestamp)),
|
|
5598
5615
|
/* @__PURE__ */ React11.createElement("span", { style: { color: levelColors[log.level] } }, log.level),
|
|
5616
|
+
(log.origin || log.target || log.mode) && /* @__PURE__ */ React11.createElement(
|
|
5617
|
+
"span",
|
|
5618
|
+
{
|
|
5619
|
+
style: {
|
|
5620
|
+
fontFamily: "monospace",
|
|
5621
|
+
textTransform: "none",
|
|
5622
|
+
fontSize: "10px",
|
|
5623
|
+
opacity: 0.75
|
|
5624
|
+
}
|
|
5625
|
+
},
|
|
5626
|
+
[log.origin ?? log.target, log.mode].filter(Boolean).join(" / ")
|
|
5627
|
+
),
|
|
5599
5628
|
/* @__PURE__ */ React11.createElement(
|
|
5600
5629
|
"span",
|
|
5601
5630
|
{
|
|
@@ -5621,8 +5650,7 @@ function ServerScriptLogsSection({
|
|
|
5621
5650
|
{
|
|
5622
5651
|
key: index,
|
|
5623
5652
|
data: value,
|
|
5624
|
-
theme
|
|
5625
|
-
expandLevel: 3
|
|
5653
|
+
theme
|
|
5626
5654
|
}
|
|
5627
5655
|
)) : /* @__PURE__ */ React11.createElement("span", { style: { fontSize: "11px", opacity: 0.7 } }, "No data")
|
|
5628
5656
|
))), !logs?.length && /* @__PURE__ */ React11.createElement(
|
|
@@ -6291,6 +6319,31 @@ function useLocalStorageState(key, defaultValue) {
|
|
|
6291
6319
|
return [state, setLocalStorageState];
|
|
6292
6320
|
}
|
|
6293
6321
|
|
|
6322
|
+
// src/inspector/usePausedStream.ts
|
|
6323
|
+
import React15 from "react";
|
|
6324
|
+
function usePausedStream(items) {
|
|
6325
|
+
const [paused, setPaused] = React15.useState(false);
|
|
6326
|
+
const [visibleItems, setVisibleItems] = React15.useState(items ?? []);
|
|
6327
|
+
const togglePaused = React15.useCallback(() => {
|
|
6328
|
+
setPaused((value) => {
|
|
6329
|
+
if (!value) {
|
|
6330
|
+
setVisibleItems(items ?? []);
|
|
6331
|
+
}
|
|
6332
|
+
return !value;
|
|
6333
|
+
});
|
|
6334
|
+
}, [items]);
|
|
6335
|
+
React15.useEffect(() => {
|
|
6336
|
+
if (paused) return;
|
|
6337
|
+
setVisibleItems(items ?? []);
|
|
6338
|
+
}, [items, paused]);
|
|
6339
|
+
return {
|
|
6340
|
+
paused,
|
|
6341
|
+
setPaused,
|
|
6342
|
+
togglePaused,
|
|
6343
|
+
visibleItems
|
|
6344
|
+
};
|
|
6345
|
+
}
|
|
6346
|
+
|
|
6294
6347
|
// src/inspector/StateInspector.tsx
|
|
6295
6348
|
var StateInspector = memoGeneric(function StateInspector2({
|
|
6296
6349
|
noyaManager,
|
|
@@ -6313,16 +6366,17 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
6313
6366
|
activityEventsManager,
|
|
6314
6367
|
logManager
|
|
6315
6368
|
} = noyaManager;
|
|
6316
|
-
const [didMount, setDidMount] =
|
|
6369
|
+
const [didMount, setDidMount] = React16.useState(false);
|
|
6317
6370
|
const tasks = useObservable(taskManager.tasks$);
|
|
6318
6371
|
const inputs = useObservable(ioManager.inputs$);
|
|
6319
6372
|
const outputTransforms = useObservable(ioManager.outputTransforms$);
|
|
6320
6373
|
useLayoutEffect(() => {
|
|
6321
6374
|
setDidMount(true);
|
|
6322
6375
|
}, []);
|
|
6323
|
-
const eventsContainerRef =
|
|
6324
|
-
const activityEventsContainerRef =
|
|
6325
|
-
const serverLogsContainerRef =
|
|
6376
|
+
const eventsContainerRef = React16.useRef(null);
|
|
6377
|
+
const activityEventsContainerRef = React16.useRef(null);
|
|
6378
|
+
const serverLogsContainerRef = React16.useRef(null);
|
|
6379
|
+
const serverSimulationLogsContainerRef = React16.useRef(null);
|
|
6326
6380
|
const [showInspector, setShowInspector] = useLocalStorageState(
|
|
6327
6381
|
"noya-multiplayer-react-show-inspector",
|
|
6328
6382
|
true
|
|
@@ -6383,35 +6437,51 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
6383
6437
|
"noya-multiplayer-react-show-server-logs",
|
|
6384
6438
|
false
|
|
6385
6439
|
);
|
|
6440
|
+
const [showServerSimulationLogs, setShowServerSimulationLogs] = useLocalStorageState(
|
|
6441
|
+
"noya-multiplayer-react-show-server-simulation-logs",
|
|
6442
|
+
false
|
|
6443
|
+
);
|
|
6444
|
+
const [showSimulation, setShowSimulation] = useLocalStorageState(
|
|
6445
|
+
"noya-multiplayer-react-show-simulation",
|
|
6446
|
+
false
|
|
6447
|
+
);
|
|
6386
6448
|
const connectionEvents = useObservable(connectionEventManager.events$);
|
|
6449
|
+
const {
|
|
6450
|
+
visibleItems: visibleConnectionEvents,
|
|
6451
|
+
paused: connectionEventsPaused,
|
|
6452
|
+
togglePaused: toggleConnectionEventsPaused
|
|
6453
|
+
} = usePausedStream(connectionEvents);
|
|
6387
6454
|
useEffect2(() => {
|
|
6388
6455
|
if (eventsContainerRef.current) {
|
|
6389
6456
|
eventsContainerRef.current.scrollTop = eventsContainerRef.current.scrollHeight;
|
|
6390
6457
|
}
|
|
6391
|
-
}, [
|
|
6458
|
+
}, [visibleConnectionEvents]);
|
|
6392
6459
|
const serverLogs = useObservable(logManager.logs$);
|
|
6393
|
-
const
|
|
6394
|
-
|
|
6395
|
-
|
|
6460
|
+
const {
|
|
6461
|
+
visibleItems: visibleServerLogs,
|
|
6462
|
+
paused: serverLogsPaused,
|
|
6463
|
+
togglePaused: toggleServerLogsPaused
|
|
6464
|
+
} = usePausedStream(serverLogs);
|
|
6465
|
+
const serverSimulationLogs = useObservable(
|
|
6466
|
+
multiplayerStateManager.serverSimulationLogs$
|
|
6396
6467
|
);
|
|
6397
|
-
const
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
return !value;
|
|
6403
|
-
});
|
|
6404
|
-
}, [serverLogs]);
|
|
6405
|
-
useEffect2(() => {
|
|
6406
|
-
if (serverLogsPaused) return;
|
|
6407
|
-
setVisibleServerLogs(serverLogs ?? []);
|
|
6408
|
-
}, [serverLogs, serverLogsPaused]);
|
|
6468
|
+
const {
|
|
6469
|
+
visibleItems: visibleServerSimulationLogs,
|
|
6470
|
+
paused: serverSimulationLogsPaused,
|
|
6471
|
+
togglePaused: toggleServerSimulationLogsPaused
|
|
6472
|
+
} = usePausedStream(serverSimulationLogs);
|
|
6409
6473
|
useEffect2(() => {
|
|
6410
6474
|
if (!showServerLogs) return;
|
|
6411
6475
|
if (serverLogsContainerRef.current) {
|
|
6412
6476
|
serverLogsContainerRef.current.scrollTop = serverLogsContainerRef.current.scrollHeight;
|
|
6413
6477
|
}
|
|
6414
6478
|
}, [showServerLogs, visibleServerLogs]);
|
|
6479
|
+
useEffect2(() => {
|
|
6480
|
+
if (!showServerSimulationLogs) return;
|
|
6481
|
+
if (serverSimulationLogsContainerRef.current) {
|
|
6482
|
+
serverSimulationLogsContainerRef.current.scrollTop = serverSimulationLogsContainerRef.current.scrollHeight;
|
|
6483
|
+
}
|
|
6484
|
+
}, [showServerSimulationLogs, visibleServerSimulationLogs]);
|
|
6415
6485
|
const multipeerStateInitialized = useObservable(
|
|
6416
6486
|
multiplayerStateManager.isInitialized$
|
|
6417
6487
|
);
|
|
@@ -6423,8 +6493,10 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
6423
6493
|
const assetsInitialized = useObservable(assetManager.isInitialized$);
|
|
6424
6494
|
const secrets = useObservable(secretManager.secrets$);
|
|
6425
6495
|
const secretsInitialized = useObservable(secretManager.isInitialized$);
|
|
6426
|
-
const connectedUsers = useObservable(userManager.
|
|
6496
|
+
const connectedUsers = useObservable(userManager.allUsers$);
|
|
6427
6497
|
const connectionId = useObservable(userManager.currentConnectionId$);
|
|
6498
|
+
const simulationDiagnostics = multiplayerStateManager.getServerSimulationDiagnostics?.() ?? null;
|
|
6499
|
+
const showSimulationLogsSection = (simulationDiagnostics?.simulateLocally ?? false) || visibleServerSimulationLogs.length > 0;
|
|
6428
6500
|
const state = useObservable(multiplayerStateManager.optimisticState$);
|
|
6429
6501
|
const inputsInitialized = useObservable(ioManager.inputsInitialized$);
|
|
6430
6502
|
const outputTransformsInitialized = useObservable(
|
|
@@ -6468,7 +6540,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
6468
6540
|
}, [noyaManager]);
|
|
6469
6541
|
if (!didMount) return null;
|
|
6470
6542
|
if (!showInspector) {
|
|
6471
|
-
return /* @__PURE__ */
|
|
6543
|
+
return /* @__PURE__ */ React16.createElement(
|
|
6472
6544
|
"div",
|
|
6473
6545
|
{
|
|
6474
6546
|
...props,
|
|
@@ -6480,7 +6552,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
6480
6552
|
},
|
|
6481
6553
|
onClick: () => setShowInspector(true)
|
|
6482
6554
|
},
|
|
6483
|
-
/* @__PURE__ */
|
|
6555
|
+
/* @__PURE__ */ React16.createElement(
|
|
6484
6556
|
StateInspectorToggleButton,
|
|
6485
6557
|
{
|
|
6486
6558
|
showInspector,
|
|
@@ -6491,7 +6563,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
6491
6563
|
)
|
|
6492
6564
|
);
|
|
6493
6565
|
}
|
|
6494
|
-
return /* @__PURE__ */
|
|
6566
|
+
return /* @__PURE__ */ React16.createElement(
|
|
6495
6567
|
"div",
|
|
6496
6568
|
{
|
|
6497
6569
|
...props,
|
|
@@ -6500,7 +6572,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
6500
6572
|
...props.style
|
|
6501
6573
|
}
|
|
6502
6574
|
},
|
|
6503
|
-
/* @__PURE__ */
|
|
6575
|
+
/* @__PURE__ */ React16.createElement(
|
|
6504
6576
|
StateInspectorDisclosureSection,
|
|
6505
6577
|
{
|
|
6506
6578
|
isFirst: true,
|
|
@@ -6513,14 +6585,14 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
6513
6585
|
maxHeight: "50%",
|
|
6514
6586
|
overflowY: "auto"
|
|
6515
6587
|
},
|
|
6516
|
-
right: /* @__PURE__ */
|
|
6588
|
+
right: /* @__PURE__ */ React16.createElement("span", { style: { display: "flex", gap: "10px" } }, /* @__PURE__ */ React16.createElement(
|
|
6517
6589
|
StateInspectorButton,
|
|
6518
6590
|
{
|
|
6519
6591
|
theme,
|
|
6520
6592
|
onClick: () => setShowUserDetails(!showUserDetails)
|
|
6521
6593
|
},
|
|
6522
6594
|
"Toggle details"
|
|
6523
|
-
), /* @__PURE__ */
|
|
6595
|
+
), /* @__PURE__ */ React16.createElement(
|
|
6524
6596
|
StateInspectorToggleButton,
|
|
6525
6597
|
{
|
|
6526
6598
|
showInspector,
|
|
@@ -6530,16 +6602,19 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
6530
6602
|
}
|
|
6531
6603
|
))
|
|
6532
6604
|
},
|
|
6533
|
-
/* @__PURE__ */
|
|
6534
|
-
return /* @__PURE__ */
|
|
6605
|
+
/* @__PURE__ */ React16.createElement(StateInspectorDisclosureRowInner, { style: { flex: "0 0 auto" } }, connectedUsers?.filter((user) => showUserDetails || !user.inactive).map((user, index, array) => {
|
|
6606
|
+
return /* @__PURE__ */ React16.createElement(
|
|
6535
6607
|
StateInspectorRow,
|
|
6536
6608
|
{
|
|
6537
6609
|
key: user.connectionId,
|
|
6538
6610
|
colorScheme,
|
|
6539
6611
|
variant: user.connectionId === connectionId ? "up" : void 0,
|
|
6540
|
-
bordered: index !== array.length - 1
|
|
6612
|
+
bordered: index !== array.length - 1,
|
|
6613
|
+
style: {
|
|
6614
|
+
opacity: user.inactive ? 0.5 : 1
|
|
6615
|
+
}
|
|
6541
6616
|
},
|
|
6542
|
-
user.image && /* @__PURE__ */
|
|
6617
|
+
user.image && /* @__PURE__ */ React16.createElement(
|
|
6543
6618
|
"img",
|
|
6544
6619
|
{
|
|
6545
6620
|
src: user.image,
|
|
@@ -6556,9 +6631,9 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
6556
6631
|
}
|
|
6557
6632
|
}
|
|
6558
6633
|
),
|
|
6559
|
-
showUserDetails ? /* @__PURE__ */
|
|
6634
|
+
showUserDetails ? /* @__PURE__ */ React16.createElement(ObjectInspector5, { data: user, theme }) : user.name
|
|
6560
6635
|
);
|
|
6561
|
-
}), !connectedUsers && /* @__PURE__ */
|
|
6636
|
+
}), !connectedUsers && /* @__PURE__ */ React16.createElement(
|
|
6562
6637
|
"div",
|
|
6563
6638
|
{
|
|
6564
6639
|
style: {
|
|
@@ -6569,13 +6644,13 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
6569
6644
|
gap: "4px"
|
|
6570
6645
|
}
|
|
6571
6646
|
},
|
|
6572
|
-
/* @__PURE__ */
|
|
6647
|
+
/* @__PURE__ */ React16.createElement("span", null, "No connected users")
|
|
6573
6648
|
))
|
|
6574
6649
|
),
|
|
6575
|
-
/* @__PURE__ */
|
|
6650
|
+
/* @__PURE__ */ React16.createElement(
|
|
6576
6651
|
StateInspectorDisclosureSection,
|
|
6577
6652
|
{
|
|
6578
|
-
title: /* @__PURE__ */
|
|
6653
|
+
title: /* @__PURE__ */ React16.createElement(StateInspectorTitleLabel, null, "Data", /* @__PURE__ */ React16.createElement(
|
|
6579
6654
|
ColoredDot,
|
|
6580
6655
|
{
|
|
6581
6656
|
type: multipeerStateInitialized ? "success" : "error"
|
|
@@ -6584,7 +6659,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
6584
6659
|
colorScheme,
|
|
6585
6660
|
setOpen: setShowData,
|
|
6586
6661
|
open: showData,
|
|
6587
|
-
right: /* @__PURE__ */
|
|
6662
|
+
right: /* @__PURE__ */ React16.createElement(
|
|
6588
6663
|
"span",
|
|
6589
6664
|
{
|
|
6590
6665
|
style: {
|
|
@@ -6592,9 +6667,9 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
6592
6667
|
gap: "12px"
|
|
6593
6668
|
}
|
|
6594
6669
|
},
|
|
6595
|
-
/* @__PURE__ */
|
|
6596
|
-
/* @__PURE__ */
|
|
6597
|
-
/* @__PURE__ */
|
|
6670
|
+
/* @__PURE__ */ React16.createElement(StateInspectorButton, { theme, onClick: handleImportAll }, "Import"),
|
|
6671
|
+
/* @__PURE__ */ React16.createElement(StateInspectorButton, { theme, onClick: handleExportAll }, "Export"),
|
|
6672
|
+
/* @__PURE__ */ React16.createElement(
|
|
6598
6673
|
StateInspectorButton,
|
|
6599
6674
|
{
|
|
6600
6675
|
theme,
|
|
@@ -6606,14 +6681,14 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
6606
6681
|
)
|
|
6607
6682
|
)
|
|
6608
6683
|
},
|
|
6609
|
-
/* @__PURE__ */
|
|
6684
|
+
/* @__PURE__ */ React16.createElement(StateInspectorDisclosureRowInner, null, /* @__PURE__ */ React16.createElement(StateInspectorRow, { colorScheme }, /* @__PURE__ */ React16.createElement(
|
|
6610
6685
|
ObjectInspector5,
|
|
6611
6686
|
{
|
|
6612
6687
|
name: multiplayerStateManager.schema ? "state" : void 0,
|
|
6613
6688
|
data: state,
|
|
6614
6689
|
theme
|
|
6615
6690
|
}
|
|
6616
|
-
)), multiplayerStateManager.schema && /* @__PURE__ */
|
|
6691
|
+
)), multiplayerStateManager.schema && /* @__PURE__ */ React16.createElement(StateInspectorRow, { colorScheme }, /* @__PURE__ */ React16.createElement(
|
|
6617
6692
|
ObjectInspector5,
|
|
6618
6693
|
{
|
|
6619
6694
|
name: "schema",
|
|
@@ -6622,7 +6697,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
6622
6697
|
}
|
|
6623
6698
|
)))
|
|
6624
6699
|
),
|
|
6625
|
-
/* @__PURE__ */
|
|
6700
|
+
/* @__PURE__ */ React16.createElement(
|
|
6626
6701
|
HistorySection,
|
|
6627
6702
|
{
|
|
6628
6703
|
showHistory,
|
|
@@ -6632,14 +6707,14 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
6632
6707
|
multiplayerStateManager
|
|
6633
6708
|
}
|
|
6634
6709
|
),
|
|
6635
|
-
/* @__PURE__ */
|
|
6710
|
+
/* @__PURE__ */ React16.createElement(
|
|
6636
6711
|
StateInspectorDisclosureSection,
|
|
6637
6712
|
{
|
|
6638
6713
|
open: showAssets,
|
|
6639
6714
|
setOpen: setShowAssets,
|
|
6640
|
-
title: /* @__PURE__ */
|
|
6715
|
+
title: /* @__PURE__ */ React16.createElement(StateInspectorTitleLabel, null, "Assets (", assets.length, ")", /* @__PURE__ */ React16.createElement(ColoredDot, { type: assetsInitialized ? "success" : "error" })),
|
|
6641
6716
|
colorScheme,
|
|
6642
|
-
right: /* @__PURE__ */
|
|
6717
|
+
right: /* @__PURE__ */ React16.createElement("span", { style: { display: "flex", gap: "10px" } }, /* @__PURE__ */ React16.createElement(
|
|
6643
6718
|
StateInspectorButton,
|
|
6644
6719
|
{
|
|
6645
6720
|
theme,
|
|
@@ -6654,7 +6729,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
6654
6729
|
}
|
|
6655
6730
|
},
|
|
6656
6731
|
"Delete all"
|
|
6657
|
-
), /* @__PURE__ */
|
|
6732
|
+
), /* @__PURE__ */ React16.createElement(
|
|
6658
6733
|
StateInspectorButton,
|
|
6659
6734
|
{
|
|
6660
6735
|
theme,
|
|
@@ -6667,7 +6742,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
6667
6742
|
}
|
|
6668
6743
|
},
|
|
6669
6744
|
"Reload"
|
|
6670
|
-
), /* @__PURE__ */
|
|
6745
|
+
), /* @__PURE__ */ React16.createElement(
|
|
6671
6746
|
StateInspectorButton,
|
|
6672
6747
|
{
|
|
6673
6748
|
theme,
|
|
@@ -6691,14 +6766,14 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
6691
6766
|
"Upload"
|
|
6692
6767
|
))
|
|
6693
6768
|
},
|
|
6694
|
-
/* @__PURE__ */
|
|
6769
|
+
/* @__PURE__ */ React16.createElement(StateInspectorDisclosureRowInner, null, assets.map((asset) => /* @__PURE__ */ React16.createElement(StateInspectorRow, { key: asset.id, colorScheme }, /* @__PURE__ */ React16.createElement(
|
|
6695
6770
|
ObjectInspector5,
|
|
6696
6771
|
{
|
|
6697
6772
|
name: asset.id,
|
|
6698
6773
|
data: truncateAsset(asset),
|
|
6699
6774
|
theme
|
|
6700
6775
|
}
|
|
6701
|
-
), /* @__PURE__ */
|
|
6776
|
+
), /* @__PURE__ */ React16.createElement(
|
|
6702
6777
|
StateInspectorButton,
|
|
6703
6778
|
{
|
|
6704
6779
|
theme,
|
|
@@ -6707,14 +6782,14 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
6707
6782
|
"Delete"
|
|
6708
6783
|
))))
|
|
6709
6784
|
),
|
|
6710
|
-
advanced && /* @__PURE__ */
|
|
6785
|
+
advanced && /* @__PURE__ */ React16.createElement(
|
|
6711
6786
|
StateInspectorDisclosureSection,
|
|
6712
6787
|
{
|
|
6713
|
-
title: /* @__PURE__ */
|
|
6788
|
+
title: /* @__PURE__ */ React16.createElement(StateInspectorTitleLabel, null, "Resources (", resources.length, ")", /* @__PURE__ */ React16.createElement(ColoredDot, { type: resourcesInitialized ? "success" : "error" })),
|
|
6714
6789
|
colorScheme,
|
|
6715
6790
|
open: showResources,
|
|
6716
6791
|
setOpen: setShowResources,
|
|
6717
|
-
right: /* @__PURE__ */
|
|
6792
|
+
right: /* @__PURE__ */ React16.createElement("span", { style: { display: "flex", gap: "10px" } }, /* @__PURE__ */ React16.createElement(
|
|
6718
6793
|
StateInspectorButton,
|
|
6719
6794
|
{
|
|
6720
6795
|
theme,
|
|
@@ -6729,7 +6804,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
6729
6804
|
}
|
|
6730
6805
|
},
|
|
6731
6806
|
"Delete all"
|
|
6732
|
-
), /* @__PURE__ */
|
|
6807
|
+
), /* @__PURE__ */ React16.createElement(
|
|
6733
6808
|
StateInspectorButton,
|
|
6734
6809
|
{
|
|
6735
6810
|
theme,
|
|
@@ -6742,7 +6817,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
6742
6817
|
}
|
|
6743
6818
|
},
|
|
6744
6819
|
"Create Directory"
|
|
6745
|
-
), /* @__PURE__ */
|
|
6820
|
+
), /* @__PURE__ */ React16.createElement(
|
|
6746
6821
|
StateInspectorButton,
|
|
6747
6822
|
{
|
|
6748
6823
|
theme,
|
|
@@ -6762,21 +6837,21 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
6762
6837
|
"Create Asset"
|
|
6763
6838
|
))
|
|
6764
6839
|
},
|
|
6765
|
-
/* @__PURE__ */
|
|
6840
|
+
/* @__PURE__ */ React16.createElement(StateInspectorDisclosureRowInner, null, resources?.map((resource) => /* @__PURE__ */ React16.createElement(StateInspectorRow, { key: resource.id, colorScheme }, /* @__PURE__ */ React16.createElement(
|
|
6766
6841
|
ObjectInspector5,
|
|
6767
6842
|
{
|
|
6768
6843
|
name: resource.path,
|
|
6769
6844
|
data: resource,
|
|
6770
6845
|
theme
|
|
6771
6846
|
}
|
|
6772
|
-
), /* @__PURE__ */
|
|
6847
|
+
), /* @__PURE__ */ React16.createElement("div", { style: { display: "flex", gap: "4px" } }, /* @__PURE__ */ React16.createElement(
|
|
6773
6848
|
StateInspectorButton,
|
|
6774
6849
|
{
|
|
6775
6850
|
theme,
|
|
6776
6851
|
onClick: () => resourceManager.deleteResource({ id: resource.id })
|
|
6777
6852
|
},
|
|
6778
6853
|
"Delete"
|
|
6779
|
-
), /* @__PURE__ */
|
|
6854
|
+
), /* @__PURE__ */ React16.createElement(
|
|
6780
6855
|
StateInspectorButton,
|
|
6781
6856
|
{
|
|
6782
6857
|
theme,
|
|
@@ -6789,14 +6864,14 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
6789
6864
|
"Rename"
|
|
6790
6865
|
)))))
|
|
6791
6866
|
),
|
|
6792
|
-
advanced && /* @__PURE__ */
|
|
6867
|
+
advanced && /* @__PURE__ */ React16.createElement(
|
|
6793
6868
|
StateInspectorDisclosureSection,
|
|
6794
6869
|
{
|
|
6795
|
-
title: /* @__PURE__ */
|
|
6870
|
+
title: /* @__PURE__ */ React16.createElement(StateInspectorTitleLabel, null, "Secrets", /* @__PURE__ */ React16.createElement(ColoredDot, { type: secretsInitialized ? "success" : "error" })),
|
|
6796
6871
|
colorScheme,
|
|
6797
6872
|
open: showSecrets,
|
|
6798
6873
|
setOpen: setShowSecrets,
|
|
6799
|
-
right: /* @__PURE__ */
|
|
6874
|
+
right: /* @__PURE__ */ React16.createElement(
|
|
6800
6875
|
StateInspectorButton,
|
|
6801
6876
|
{
|
|
6802
6877
|
theme,
|
|
@@ -6811,7 +6886,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
6811
6886
|
"Create"
|
|
6812
6887
|
)
|
|
6813
6888
|
},
|
|
6814
|
-
/* @__PURE__ */
|
|
6889
|
+
/* @__PURE__ */ React16.createElement(StateInspectorDisclosureRowInner, null, secrets.map((secret) => /* @__PURE__ */ React16.createElement(StateInspectorRow, { key: secret.id, colorScheme }, /* @__PURE__ */ React16.createElement(ObjectInspector5, { data: secret, theme }), /* @__PURE__ */ React16.createElement(
|
|
6815
6890
|
StateInspectorButton,
|
|
6816
6891
|
{
|
|
6817
6892
|
theme,
|
|
@@ -6820,15 +6895,15 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
6820
6895
|
"Delete"
|
|
6821
6896
|
))))
|
|
6822
6897
|
),
|
|
6823
|
-
advanced && /* @__PURE__ */
|
|
6898
|
+
advanced && /* @__PURE__ */ React16.createElement(
|
|
6824
6899
|
StateInspectorDisclosureSection,
|
|
6825
6900
|
{
|
|
6826
6901
|
open: showInputs,
|
|
6827
6902
|
setOpen: setShowInputs,
|
|
6828
|
-
title: /* @__PURE__ */
|
|
6903
|
+
title: /* @__PURE__ */ React16.createElement(StateInspectorTitleLabel, null, "Inputs", /* @__PURE__ */ React16.createElement(ColoredDot, { type: inputsInitialized ? "success" : "error" })),
|
|
6829
6904
|
colorScheme
|
|
6830
6905
|
},
|
|
6831
|
-
/* @__PURE__ */
|
|
6906
|
+
/* @__PURE__ */ React16.createElement(StateInspectorDisclosureRowInner, null, inputs?.map((input) => /* @__PURE__ */ React16.createElement(StateInspectorRow, { key: input.id, colorScheme }, /* @__PURE__ */ React16.createElement(ObjectInspector5, { data: input, theme }))), !inputs?.length && /* @__PURE__ */ React16.createElement(
|
|
6832
6907
|
"div",
|
|
6833
6908
|
{
|
|
6834
6909
|
style: {
|
|
@@ -6839,15 +6914,15 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
6839
6914
|
gap: "4px"
|
|
6840
6915
|
}
|
|
6841
6916
|
},
|
|
6842
|
-
/* @__PURE__ */
|
|
6917
|
+
/* @__PURE__ */ React16.createElement("span", null, "No inputs")
|
|
6843
6918
|
))
|
|
6844
6919
|
),
|
|
6845
|
-
advanced && /* @__PURE__ */
|
|
6920
|
+
advanced && /* @__PURE__ */ React16.createElement(
|
|
6846
6921
|
StateInspectorDisclosureSection,
|
|
6847
6922
|
{
|
|
6848
6923
|
open: showOutputTransforms,
|
|
6849
6924
|
setOpen: setShowOutputTransforms,
|
|
6850
|
-
title: /* @__PURE__ */
|
|
6925
|
+
title: /* @__PURE__ */ React16.createElement(StateInspectorTitleLabel, null, "Output Transforms", /* @__PURE__ */ React16.createElement(
|
|
6851
6926
|
ColoredDot,
|
|
6852
6927
|
{
|
|
6853
6928
|
type: outputTransformsInitialized ? "success" : "error"
|
|
@@ -6855,7 +6930,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
6855
6930
|
)),
|
|
6856
6931
|
colorScheme
|
|
6857
6932
|
},
|
|
6858
|
-
/* @__PURE__ */
|
|
6933
|
+
/* @__PURE__ */ React16.createElement(StateInspectorDisclosureRowInner, null, outputTransforms?.map((transform) => /* @__PURE__ */ React16.createElement(StateInspectorRow, { key: transform.id, colorScheme }, /* @__PURE__ */ React16.createElement(ObjectInspector5, { data: transform, theme }))), !outputTransforms?.length && /* @__PURE__ */ React16.createElement(
|
|
6859
6934
|
"div",
|
|
6860
6935
|
{
|
|
6861
6936
|
style: {
|
|
@@ -6866,10 +6941,10 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
6866
6941
|
gap: "4px"
|
|
6867
6942
|
}
|
|
6868
6943
|
},
|
|
6869
|
-
/* @__PURE__ */
|
|
6944
|
+
/* @__PURE__ */ React16.createElement("span", null, "No output transforms")
|
|
6870
6945
|
))
|
|
6871
6946
|
),
|
|
6872
|
-
advanced && /* @__PURE__ */
|
|
6947
|
+
advanced && /* @__PURE__ */ React16.createElement(
|
|
6873
6948
|
StateInspectorDisclosureSection,
|
|
6874
6949
|
{
|
|
6875
6950
|
title: "Tasks",
|
|
@@ -6877,7 +6952,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
6877
6952
|
open: showTasks,
|
|
6878
6953
|
setOpen: setShowTasks
|
|
6879
6954
|
},
|
|
6880
|
-
/* @__PURE__ */
|
|
6955
|
+
/* @__PURE__ */ React16.createElement(StateInspectorDisclosureRowInner, null, tasks?.map((task) => /* @__PURE__ */ React16.createElement(
|
|
6881
6956
|
StateInspectorRow,
|
|
6882
6957
|
{
|
|
6883
6958
|
key: task.id,
|
|
@@ -6886,7 +6961,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
6886
6961
|
backgroundColor: task.status === "done" ? "rgba(0,255,0,0.2)" : task.status === "error" ? "rgba(255,0,0,0.2)" : void 0
|
|
6887
6962
|
}
|
|
6888
6963
|
},
|
|
6889
|
-
/* @__PURE__ */
|
|
6964
|
+
/* @__PURE__ */ React16.createElement(
|
|
6890
6965
|
ObjectInspector5,
|
|
6891
6966
|
{
|
|
6892
6967
|
name: task.name,
|
|
@@ -6896,7 +6971,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
6896
6971
|
)
|
|
6897
6972
|
)))
|
|
6898
6973
|
),
|
|
6899
|
-
/* @__PURE__ */
|
|
6974
|
+
/* @__PURE__ */ React16.createElement(
|
|
6900
6975
|
StateInspectorDisclosureSection,
|
|
6901
6976
|
{
|
|
6902
6977
|
open: showShared,
|
|
@@ -6904,7 +6979,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
6904
6979
|
title: "Shared Connection Data",
|
|
6905
6980
|
colorScheme
|
|
6906
6981
|
},
|
|
6907
|
-
/* @__PURE__ */
|
|
6982
|
+
/* @__PURE__ */ React16.createElement(StateInspectorDisclosureRowInner, null, Object.entries(shared).map(([key, value]) => /* @__PURE__ */ React16.createElement(StateInspectorRow, { key, colorScheme }, /* @__PURE__ */ React16.createElement(
|
|
6908
6983
|
ObjectInspector5,
|
|
6909
6984
|
{
|
|
6910
6985
|
name: key,
|
|
@@ -6914,7 +6989,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
6914
6989
|
}
|
|
6915
6990
|
))))
|
|
6916
6991
|
),
|
|
6917
|
-
/* @__PURE__ */
|
|
6992
|
+
/* @__PURE__ */ React16.createElement(
|
|
6918
6993
|
ServerScriptLogsSection,
|
|
6919
6994
|
{
|
|
6920
6995
|
colorScheme,
|
|
@@ -6926,7 +7001,44 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
6926
7001
|
containerRef: serverLogsContainerRef
|
|
6927
7002
|
}
|
|
6928
7003
|
),
|
|
6929
|
-
|
|
7004
|
+
showSimulationLogsSection && /* @__PURE__ */ React16.createElement(
|
|
7005
|
+
ServerScriptLogsSection,
|
|
7006
|
+
{
|
|
7007
|
+
title: "Server Script Simulation Logs",
|
|
7008
|
+
colorScheme,
|
|
7009
|
+
showLogs: showServerSimulationLogs,
|
|
7010
|
+
setShowLogs: setShowServerSimulationLogs,
|
|
7011
|
+
logs: visibleServerSimulationLogs,
|
|
7012
|
+
paused: serverSimulationLogsPaused,
|
|
7013
|
+
onTogglePaused: toggleServerSimulationLogsPaused,
|
|
7014
|
+
containerRef: serverSimulationLogsContainerRef
|
|
7015
|
+
}
|
|
7016
|
+
),
|
|
7017
|
+
/* @__PURE__ */ React16.createElement(
|
|
7018
|
+
StateInspectorDisclosureSection,
|
|
7019
|
+
{
|
|
7020
|
+
open: showSimulation,
|
|
7021
|
+
setOpen: setShowSimulation,
|
|
7022
|
+
title: "Server Simulation",
|
|
7023
|
+
colorScheme
|
|
7024
|
+
},
|
|
7025
|
+
/* @__PURE__ */ React16.createElement(StateInspectorDisclosureRowInner, null, /* @__PURE__ */ React16.createElement(StateInspectorRow, { colorScheme }, /* @__PURE__ */ React16.createElement(
|
|
7026
|
+
ObjectInspector5,
|
|
7027
|
+
{
|
|
7028
|
+
name: "status",
|
|
7029
|
+
data: simulationDiagnostics ?? {
|
|
7030
|
+
simulateLocally: false,
|
|
7031
|
+
simulatorActive: false,
|
|
7032
|
+
clockSkewMs: 0,
|
|
7033
|
+
invocations: [],
|
|
7034
|
+
pendingPredictions: []
|
|
7035
|
+
},
|
|
7036
|
+
theme,
|
|
7037
|
+
expandLevel: 2
|
|
7038
|
+
}
|
|
7039
|
+
)))
|
|
7040
|
+
),
|
|
7041
|
+
advanced && /* @__PURE__ */ React16.createElement(
|
|
6930
7042
|
ActivityEventsSection,
|
|
6931
7043
|
{
|
|
6932
7044
|
colorScheme,
|
|
@@ -6936,10 +7048,12 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
6936
7048
|
activityEventsManager
|
|
6937
7049
|
}
|
|
6938
7050
|
),
|
|
6939
|
-
/* @__PURE__ */
|
|
7051
|
+
/* @__PURE__ */ React16.createElement(
|
|
6940
7052
|
EventsSection,
|
|
6941
7053
|
{
|
|
6942
|
-
connectionEvents,
|
|
7054
|
+
connectionEvents: visibleConnectionEvents,
|
|
7055
|
+
paused: connectionEventsPaused,
|
|
7056
|
+
onTogglePaused: toggleConnectionEventsPaused,
|
|
6943
7057
|
colorScheme,
|
|
6944
7058
|
eventsContainerRef,
|
|
6945
7059
|
showEvents,
|
|
@@ -6982,7 +7096,7 @@ function useStateInspector({
|
|
|
6982
7096
|
colorScheme,
|
|
6983
7097
|
anchor
|
|
6984
7098
|
}) {
|
|
6985
|
-
const [root, setRoot] =
|
|
7099
|
+
const [root, setRoot] = React17.useState(null);
|
|
6986
7100
|
useIsomorphicLayoutEffect(() => {
|
|
6987
7101
|
if (disabled) return;
|
|
6988
7102
|
const { root: root2, unmount } = createStateInspectorRoot();
|
|
@@ -6992,7 +7106,7 @@ function useStateInspector({
|
|
|
6992
7106
|
useIsomorphicLayoutEffect(() => {
|
|
6993
7107
|
if (!root) return;
|
|
6994
7108
|
root.render(
|
|
6995
|
-
/* @__PURE__ */
|
|
7109
|
+
/* @__PURE__ */ React17.createElement(
|
|
6996
7110
|
StateInspector,
|
|
6997
7111
|
{
|
|
6998
7112
|
colorScheme,
|
|
@@ -7270,7 +7384,7 @@ function useNoyaStateInternal(...args) {
|
|
|
7270
7384
|
import {
|
|
7271
7385
|
NoyaManager as NoyaManager4
|
|
7272
7386
|
} from "@noya-app/state-manager";
|
|
7273
|
-
import
|
|
7387
|
+
import React18 from "react";
|
|
7274
7388
|
var noyaManagerSingleton;
|
|
7275
7389
|
var noyaSingletonBindings;
|
|
7276
7390
|
function initializeNoyaSingleton(options) {
|
|
@@ -7287,7 +7401,6 @@ function initializeNoyaSingleton(options) {
|
|
|
7287
7401
|
viewType,
|
|
7288
7402
|
offlineStorageKey,
|
|
7289
7403
|
multiplayerUrl,
|
|
7290
|
-
serverScripts,
|
|
7291
7404
|
...managerOptions
|
|
7292
7405
|
} = options ?? {};
|
|
7293
7406
|
const appData = getAppData(
|
|
@@ -7314,7 +7427,7 @@ function initializeNoyaSingleton(options) {
|
|
|
7314
7427
|
multiplayerUrl: multiplayerUrl ?? appData.multiplayerUrl,
|
|
7315
7428
|
offlineStorageKey,
|
|
7316
7429
|
debug: managerOptions?.debug,
|
|
7317
|
-
serverScripts,
|
|
7430
|
+
serverScripts: managerOptions?.serverScripts,
|
|
7318
7431
|
policyAuthContext
|
|
7319
7432
|
});
|
|
7320
7433
|
try {
|
|
@@ -7328,7 +7441,7 @@ function initializeNoyaSingleton(options) {
|
|
|
7328
7441
|
if (resolvedInspector) {
|
|
7329
7442
|
const { root } = createStateInspectorRoot();
|
|
7330
7443
|
root.render(
|
|
7331
|
-
/* @__PURE__ */
|
|
7444
|
+
/* @__PURE__ */ React18.createElement(
|
|
7332
7445
|
StateInspector,
|
|
7333
7446
|
{
|
|
7334
7447
|
noyaManager: noyaManagerSingleton,
|
|
@@ -7547,29 +7660,33 @@ function usePipelineManager() {
|
|
|
7547
7660
|
const { noyaManager } = useAnyNoyaStateContext();
|
|
7548
7661
|
return noyaManager.pipelineManager;
|
|
7549
7662
|
}
|
|
7550
|
-
function
|
|
7663
|
+
function useNoyaUserManager() {
|
|
7551
7664
|
const { noyaManager } = useAnyNoyaStateContext();
|
|
7552
7665
|
return noyaManager.userManager;
|
|
7553
7666
|
}
|
|
7554
|
-
function
|
|
7555
|
-
const userManager =
|
|
7556
|
-
return useObservable(userManager?.
|
|
7667
|
+
function useNoyaUsers() {
|
|
7668
|
+
const userManager = useNoyaUserManager();
|
|
7669
|
+
return useObservable(userManager?.allUsers$);
|
|
7557
7670
|
}
|
|
7558
|
-
function
|
|
7559
|
-
const userManager =
|
|
7671
|
+
function useNoyaUser(id) {
|
|
7672
|
+
const userManager = useNoyaUserManager();
|
|
7560
7673
|
return useObservable(
|
|
7561
|
-
userManager?.
|
|
7562
|
-
useCallback3(
|
|
7563
|
-
(users) => {
|
|
7564
|
-
return users.find((user) => {
|
|
7565
|
-
const prefix = user.connectionId.slice(0, 8);
|
|
7566
|
-
return userId?.includes(prefix);
|
|
7567
|
-
});
|
|
7568
|
-
},
|
|
7569
|
-
[userId]
|
|
7570
|
-
)
|
|
7674
|
+
userManager?.allUsers$,
|
|
7675
|
+
useCallback3((users) => findNoyaUser(users, id), [id])
|
|
7571
7676
|
);
|
|
7572
7677
|
}
|
|
7678
|
+
function useNoyaActiveUsers() {
|
|
7679
|
+
const userManager = useNoyaUserManager();
|
|
7680
|
+
return useObservable(userManager?.connectedUsers$);
|
|
7681
|
+
}
|
|
7682
|
+
function useNoyaCurrentUser() {
|
|
7683
|
+
const userManager = useNoyaUserManager();
|
|
7684
|
+
return useObservable(userManager?.currentUser$);
|
|
7685
|
+
}
|
|
7686
|
+
function useNoyaCurrentUserId() {
|
|
7687
|
+
const userManager = useNoyaUserManager();
|
|
7688
|
+
return useObservable(userManager?.currentId$);
|
|
7689
|
+
}
|
|
7573
7690
|
function useAnySharedConnectionData() {
|
|
7574
7691
|
const { noyaManager } = useAnyNoyaStateContext();
|
|
7575
7692
|
return noyaManager.sharedConnectionDataManager;
|
|
@@ -7578,26 +7695,6 @@ function useEnqueueInput() {
|
|
|
7578
7695
|
const { noyaManager } = useAnyNoyaStateContext();
|
|
7579
7696
|
return noyaManager.enqueueInput;
|
|
7580
7697
|
}
|
|
7581
|
-
function useNoyaUser() {
|
|
7582
|
-
const userManager = useUserManager();
|
|
7583
|
-
return useObservable(userManager?.currentUser$);
|
|
7584
|
-
}
|
|
7585
|
-
function useNoyaId() {
|
|
7586
|
-
const userManager = useUserManager();
|
|
7587
|
-
return useObservable(userManager?.currentId$);
|
|
7588
|
-
}
|
|
7589
|
-
function useNoyaUserId() {
|
|
7590
|
-
const userManager = useUserManager();
|
|
7591
|
-
return useObservable(userManager?.currentUserId$);
|
|
7592
|
-
}
|
|
7593
|
-
function useNoyaConnectionId() {
|
|
7594
|
-
const userManager = useUserManager();
|
|
7595
|
-
return useObservable(userManager?.currentConnectionId$);
|
|
7596
|
-
}
|
|
7597
|
-
function useNoyaClientId() {
|
|
7598
|
-
const userManager = useUserManager();
|
|
7599
|
-
return useObservable(userManager?.currentClientId$);
|
|
7600
|
-
}
|
|
7601
7698
|
function useIsProcessing() {
|
|
7602
7699
|
const { noyaManager } = useAnyNoyaStateContext();
|
|
7603
7700
|
return useObservable(noyaManager.isProcessing$);
|
|
@@ -7724,7 +7821,7 @@ function createNoyaContext({
|
|
|
7724
7821
|
children,
|
|
7725
7822
|
contextValue
|
|
7726
7823
|
}) {
|
|
7727
|
-
return /* @__PURE__ */
|
|
7824
|
+
return /* @__PURE__ */ React19.createElement(AnyNoyaStateContext.Provider, { value: contextValue }, children);
|
|
7728
7825
|
}
|
|
7729
7826
|
function NoyaStateProvider({
|
|
7730
7827
|
children,
|
|
@@ -7747,7 +7844,7 @@ function createNoyaContext({
|
|
|
7747
7844
|
}),
|
|
7748
7845
|
[noyaManager, theme, viewType]
|
|
7749
7846
|
);
|
|
7750
|
-
return /* @__PURE__ */
|
|
7847
|
+
return /* @__PURE__ */ React19.createElement(NoyaContextProvider, { contextValue }, options.fallback !== void 0 ? /* @__PURE__ */ React19.createElement(FallbackUntilInitialized, { fallback: options.fallback }, children) : children);
|
|
7751
7848
|
}
|
|
7752
7849
|
function useValue(path2, options) {
|
|
7753
7850
|
const { noyaManager } = useAnyNoyaStateContext();
|
|
@@ -7872,7 +7969,7 @@ function useCallableAITools() {
|
|
|
7872
7969
|
// src/components/UserPointersOverlay.tsx
|
|
7873
7970
|
import { Observable as Observable2 } from "@noya-app/observable";
|
|
7874
7971
|
import { memoGeneric as memoGeneric2 } from "@noya-app/react-utils";
|
|
7875
|
-
import
|
|
7972
|
+
import React20, { useEffect as useEffect7, useMemo as useMemo5, useState as useState5 } from "react";
|
|
7876
7973
|
function shouldShow(hideAfter, updatedAt) {
|
|
7877
7974
|
return !!updatedAt && Date.now() - updatedAt < hideAfter;
|
|
7878
7975
|
}
|
|
@@ -7917,9 +8014,9 @@ var UserPointersOverlay = memoGeneric2(function UserPointers({
|
|
|
7917
8014
|
sharedConnectionDataManager.currentConnectionId$
|
|
7918
8015
|
);
|
|
7919
8016
|
const connectedUsers = useObservable(userManager.connectedUsers$);
|
|
7920
|
-
return /* @__PURE__ */
|
|
8017
|
+
return /* @__PURE__ */ React20.createElement(React20.Fragment, null, connectedUsers.map((user) => {
|
|
7921
8018
|
if (user.connectionId === currentConnectionId) return null;
|
|
7922
|
-
return /* @__PURE__ */
|
|
8019
|
+
return /* @__PURE__ */ React20.createElement(
|
|
7923
8020
|
UserPointerInternal,
|
|
7924
8021
|
{
|
|
7925
8022
|
key: user.connectionId,
|
|
@@ -8049,8 +8146,6 @@ export {
|
|
|
8049
8146
|
useBindNoyaManager,
|
|
8050
8147
|
useCallableAITools,
|
|
8051
8148
|
useColorScheme,
|
|
8052
|
-
useConnectedUser,
|
|
8053
|
-
useConnectedUsers,
|
|
8054
8149
|
useEnqueueInput,
|
|
8055
8150
|
useFileName,
|
|
8056
8151
|
useFilePropertyManager,
|
|
@@ -8061,14 +8156,15 @@ export {
|
|
|
8061
8156
|
useManagedHistory,
|
|
8062
8157
|
useManagedState,
|
|
8063
8158
|
useMultiplayerState,
|
|
8159
|
+
useNoyaActiveUsers,
|
|
8064
8160
|
useNoyaAssetTranscription,
|
|
8065
|
-
|
|
8066
|
-
|
|
8067
|
-
useNoyaId,
|
|
8161
|
+
useNoyaCurrentUser,
|
|
8162
|
+
useNoyaCurrentUserId,
|
|
8068
8163
|
useNoyaStateInternal,
|
|
8069
8164
|
useNoyaTranscriptionManager,
|
|
8070
8165
|
useNoyaUser,
|
|
8071
|
-
|
|
8166
|
+
useNoyaUserManager,
|
|
8167
|
+
useNoyaUsers,
|
|
8072
8168
|
useObservable,
|
|
8073
8169
|
useOutputTransforms,
|
|
8074
8170
|
usePipelineManager,
|
|
@@ -8081,7 +8177,6 @@ export {
|
|
|
8081
8177
|
useSecrets,
|
|
8082
8178
|
useSetFileNameState,
|
|
8083
8179
|
useStateInspector,
|
|
8084
|
-
useUserManager,
|
|
8085
8180
|
useViewType
|
|
8086
8181
|
};
|
|
8087
8182
|
//# sourceMappingURL=index.mjs.map
|