@noya-app/noya-api-client-react 0.1.43 → 0.1.44
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 +7 -7
- package/CHANGELOG.md +8 -0
- package/dist/index.js +463 -182
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +440 -159
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -7449,22 +7449,16 @@ var jwt;
|
|
|
7449
7449
|
jwt2.DEFAULT_HEADER = HEADER;
|
|
7450
7450
|
})(jwt || (jwt = {}));
|
|
7451
7451
|
|
|
7452
|
-
// ../state-manager/src/
|
|
7453
|
-
import { isDeepEqual as isDeepEqual2 } from "@noya-app/noya-utils";
|
|
7452
|
+
// ../state-manager/src/LogManager.ts
|
|
7454
7453
|
import { Observable as Observable7 } from "@noya-app/observable";
|
|
7455
7454
|
|
|
7456
|
-
// ../state-manager/src/
|
|
7457
|
-
import {
|
|
7458
|
-
import { Observable as
|
|
7459
|
-
|
|
7460
|
-
// ../state-manager/src/stateManager.ts
|
|
7461
|
-
import {
|
|
7462
|
-
Observable as Observable8,
|
|
7463
|
-
get as getPath2
|
|
7464
|
-
} from "@noya-app/observable";
|
|
7455
|
+
// ../state-manager/src/MenuManager.ts
|
|
7456
|
+
import { isDeepEqual as isDeepEqual2 } from "@noya-app/noya-utils";
|
|
7457
|
+
import { Observable as Observable8 } from "@noya-app/observable";
|
|
7465
7458
|
|
|
7466
7459
|
// ../state-manager/src/multiplayer.ts
|
|
7467
|
-
|
|
7460
|
+
import { Cache, hash, isDeepEqual as isDeepEqual3, uuid as uuid5 } from "@noya-app/noya-utils";
|
|
7461
|
+
import { Observable as Observable10, get as get2, set as set2 } from "@noya-app/observable";
|
|
7468
7462
|
|
|
7469
7463
|
// ../../node_modules/@marcbachmann/cel-js/lib/errors.js
|
|
7470
7464
|
var ParseError = class extends Error {
|
|
@@ -10442,7 +10436,7 @@ var globalEnvironment = new Environment({
|
|
|
10442
10436
|
});
|
|
10443
10437
|
|
|
10444
10438
|
// ../state-manager/src/multiplayerPolicies.ts
|
|
10445
|
-
import { uuid as
|
|
10439
|
+
import { uuid as uuid4 } from "@noya-app/noya-utils";
|
|
10446
10440
|
var celEnvironment = new Environment({
|
|
10447
10441
|
unlistedVariablesAreDyn: true
|
|
10448
10442
|
});
|
|
@@ -10477,12 +10471,21 @@ celEnvironment.registerFunction("random(): double", () => Math.random()).registe
|
|
|
10477
10471
|
const nowValue = typeof nowVariable?.value === "number" ? nowVariable.value : typeof nowVariable?.value === "string" ? Number(nowVariable.value) : Date.now();
|
|
10478
10472
|
return new Date(nowValue).toISOString();
|
|
10479
10473
|
}
|
|
10480
|
-
).registerFunction("uuid(): string", () =>
|
|
10474
|
+
).registerFunction("uuid(): string", () => uuid4());
|
|
10481
10475
|
var READ_DENIED = Symbol("readDenied");
|
|
10482
10476
|
|
|
10477
|
+
// ../state-manager/src/stateManager.ts
|
|
10478
|
+
import {
|
|
10479
|
+
Observable as Observable9,
|
|
10480
|
+
get as getPath2
|
|
10481
|
+
} from "@noya-app/observable";
|
|
10482
|
+
|
|
10483
|
+
// ../state-manager/src/multiplayer.ts
|
|
10484
|
+
var createHash = (value, options) => hash(value, { ...options, ignoreUndefinedProperties: true });
|
|
10485
|
+
|
|
10483
10486
|
// ../state-manager/src/NoyaManager.ts
|
|
10484
|
-
import { uuid as
|
|
10485
|
-
import { Observable as
|
|
10487
|
+
import { uuid as uuid12 } from "@noya-app/noya-utils";
|
|
10488
|
+
import { Observable as Observable20, set as set3 } from "@noya-app/observable";
|
|
10486
10489
|
|
|
10487
10490
|
// ../noya-pipeline/src/graphToTasks.ts
|
|
10488
10491
|
import { get as get3 } from "@noya-app/observable";
|
|
@@ -10587,40 +10590,163 @@ var pipelineSchema = Type.Object(
|
|
|
10587
10590
|
);
|
|
10588
10591
|
|
|
10589
10592
|
// ../state-manager/src/PipelineManager.ts
|
|
10590
|
-
import { Observable as
|
|
10593
|
+
import { Observable as Observable11 } from "@noya-app/observable";
|
|
10591
10594
|
|
|
10592
10595
|
// ../state-manager/src/PublishingManager.ts
|
|
10593
|
-
import { Observable as
|
|
10596
|
+
import { Observable as Observable12 } from "@noya-app/observable";
|
|
10594
10597
|
|
|
10595
10598
|
// ../state-manager/src/ResourceManager.ts
|
|
10596
10599
|
import { isDeepEqual as isDeepEqual4, uuid as uuid7 } from "@noya-app/noya-utils";
|
|
10597
|
-
import { Observable as
|
|
10600
|
+
import { Observable as Observable13 } from "@noya-app/observable";
|
|
10598
10601
|
|
|
10599
10602
|
// ../state-manager/src/rpcManager.ts
|
|
10600
10603
|
import { uuid as uuid8 } from "@noya-app/noya-utils";
|
|
10601
|
-
import { Observable as
|
|
10604
|
+
import { Observable as Observable14 } from "@noya-app/observable";
|
|
10602
10605
|
|
|
10603
10606
|
// ../state-manager/src/SecretManager.ts
|
|
10604
|
-
import { Observable as
|
|
10607
|
+
import { Observable as Observable15 } from "@noya-app/observable";
|
|
10605
10608
|
|
|
10606
10609
|
// ../state-manager/src/TaskManager.ts
|
|
10607
|
-
import { Observable as
|
|
10610
|
+
import { Observable as Observable16 } from "@noya-app/observable";
|
|
10611
|
+
|
|
10612
|
+
// ../state-manager/src/TranscriptionManager.ts
|
|
10613
|
+
import { Base64 as Base642 } from "@noya-app/noya-utils";
|
|
10614
|
+
import { Observable as Observable17 } from "@noya-app/observable";
|
|
10608
10615
|
|
|
10609
10616
|
// ../state-manager/src/UserManager.ts
|
|
10610
|
-
import { Observable as
|
|
10617
|
+
import { Observable as Observable19 } from "@noya-app/observable";
|
|
10611
10618
|
|
|
10612
|
-
// ../state-manager/src/
|
|
10613
|
-
|
|
10614
|
-
|
|
10615
|
-
|
|
10616
|
-
|
|
10617
|
-
|
|
10618
|
-
|
|
10619
|
-
|
|
10620
|
-
|
|
10619
|
+
// ../state-manager/src/sync/clientId.ts
|
|
10620
|
+
import { uuid as uuid9 } from "@noya-app/noya-utils";
|
|
10621
|
+
import { Observable as Observable18 } from "@noya-app/observable";
|
|
10622
|
+
|
|
10623
|
+
// ../state-manager/src/sync/defaultNames.ts
|
|
10624
|
+
import { upperFirst } from "@noya-app/noya-utils";
|
|
10625
|
+
var animals = [
|
|
10626
|
+
"cat",
|
|
10627
|
+
"dog",
|
|
10628
|
+
"owl",
|
|
10629
|
+
"fish",
|
|
10630
|
+
"horse",
|
|
10631
|
+
"rabbit",
|
|
10632
|
+
"snake",
|
|
10633
|
+
"lion",
|
|
10634
|
+
"bear",
|
|
10635
|
+
"wolf",
|
|
10636
|
+
"fox",
|
|
10637
|
+
"elephant",
|
|
10638
|
+
"giraffe",
|
|
10639
|
+
"zebra",
|
|
10640
|
+
"panda",
|
|
10641
|
+
"monkey",
|
|
10642
|
+
"penguin",
|
|
10643
|
+
"koala",
|
|
10644
|
+
"kangaroo",
|
|
10645
|
+
"whale",
|
|
10646
|
+
"shark",
|
|
10647
|
+
"turtle",
|
|
10648
|
+
"crocodile",
|
|
10649
|
+
"hippo"
|
|
10650
|
+
];
|
|
10651
|
+
var adjectives = [
|
|
10652
|
+
"happy",
|
|
10653
|
+
"sleepy",
|
|
10654
|
+
"hungry",
|
|
10655
|
+
"thirsty",
|
|
10656
|
+
"healthy",
|
|
10657
|
+
"rich",
|
|
10658
|
+
"funky",
|
|
10659
|
+
"cool",
|
|
10660
|
+
"awesome",
|
|
10661
|
+
"amazing",
|
|
10662
|
+
"fantastic",
|
|
10663
|
+
"incredible",
|
|
10664
|
+
"super",
|
|
10665
|
+
"mega",
|
|
10666
|
+
"ultra"
|
|
10667
|
+
];
|
|
10668
|
+
function randomElement(array) {
|
|
10669
|
+
return array[Math.floor(Math.random() * array.length)];
|
|
10670
|
+
}
|
|
10671
|
+
function getClientImageUrl(animal) {
|
|
10672
|
+
return `https://avatars.noya.site/animals/animals_${animal}.svg`;
|
|
10673
|
+
}
|
|
10674
|
+
function randomClientIdentity() {
|
|
10675
|
+
const animal = randomElement(animals);
|
|
10676
|
+
const name = `${upperFirst(randomElement(adjectives))} ${upperFirst(animal)}`;
|
|
10677
|
+
return {
|
|
10678
|
+
name,
|
|
10679
|
+
animal,
|
|
10680
|
+
image: getClientImageUrl(animal)
|
|
10681
|
+
};
|
|
10682
|
+
}
|
|
10683
|
+
function getClientAnimalFromName(name) {
|
|
10684
|
+
const parts = name.trim().split(/\s+/);
|
|
10685
|
+
const possibleAnimal = parts[parts.length - 1]?.toLowerCase();
|
|
10686
|
+
if (!possibleAnimal) return void 0;
|
|
10687
|
+
return animals.includes(possibleAnimal) ? possibleAnimal : void 0;
|
|
10688
|
+
}
|
|
10689
|
+
|
|
10690
|
+
// ../state-manager/src/sync/clientId.ts
|
|
10691
|
+
var CLIENT_ID_STORAGE_KEY = "noya-client-id";
|
|
10692
|
+
var CLIENT_NAME_STORAGE_KEY = "noya-client-name";
|
|
10693
|
+
var CLIENT_IMAGE_STORAGE_KEY = "noya-client-image";
|
|
10694
|
+
var clientId$ = new Observable18(void 0);
|
|
10695
|
+
var clientName$ = new Observable18(void 0);
|
|
10696
|
+
var clientImage$ = new Observable18(void 0);
|
|
10697
|
+
var safeGetItem = (key) => {
|
|
10698
|
+
try {
|
|
10699
|
+
return typeof localStorage !== "undefined" ? localStorage.getItem(key) : null;
|
|
10700
|
+
} catch {
|
|
10701
|
+
return null;
|
|
10702
|
+
}
|
|
10703
|
+
};
|
|
10704
|
+
var safeSetItem = (key, value) => {
|
|
10705
|
+
try {
|
|
10706
|
+
if (typeof localStorage !== "undefined") {
|
|
10707
|
+
localStorage.setItem(key, value);
|
|
10708
|
+
}
|
|
10709
|
+
} catch {
|
|
10710
|
+
}
|
|
10711
|
+
};
|
|
10712
|
+
if (typeof window !== "undefined") {
|
|
10713
|
+
const storedClientId = safeGetItem(CLIENT_ID_STORAGE_KEY);
|
|
10714
|
+
if (storedClientId) {
|
|
10715
|
+
clientId$.set(storedClientId);
|
|
10716
|
+
} else {
|
|
10717
|
+
const newClientId = uuid9();
|
|
10718
|
+
safeSetItem(CLIENT_ID_STORAGE_KEY, newClientId);
|
|
10719
|
+
clientId$.set(newClientId);
|
|
10720
|
+
}
|
|
10721
|
+
let storedClientName = safeGetItem(CLIENT_NAME_STORAGE_KEY) ?? void 0;
|
|
10722
|
+
let storedClientImage = safeGetItem(CLIENT_IMAGE_STORAGE_KEY) ?? void 0;
|
|
10723
|
+
const newIdentity = randomClientIdentity();
|
|
10724
|
+
if (!storedClientName) {
|
|
10725
|
+
storedClientName = newIdentity.name;
|
|
10726
|
+
safeSetItem(CLIENT_NAME_STORAGE_KEY, storedClientName);
|
|
10727
|
+
}
|
|
10728
|
+
if (!storedClientImage) {
|
|
10729
|
+
const animal = (storedClientName && getClientAnimalFromName(storedClientName)) ?? newIdentity.animal;
|
|
10730
|
+
if (animal) {
|
|
10731
|
+
storedClientImage = getClientImageUrl(animal);
|
|
10732
|
+
safeSetItem(CLIENT_IMAGE_STORAGE_KEY, storedClientImage);
|
|
10733
|
+
}
|
|
10734
|
+
}
|
|
10735
|
+
clientName$.set(storedClientName);
|
|
10736
|
+
clientImage$.set(storedClientImage);
|
|
10737
|
+
}
|
|
10738
|
+
|
|
10739
|
+
// ../state-manager/src/sync/syncUtils.ts
|
|
10740
|
+
import { uuid as uuid10 } from "@noya-app/noya-utils";
|
|
10621
10741
|
|
|
10622
10742
|
// ../state-manager/src/sync/localRpcHelpers.ts
|
|
10623
|
-
import { Base64 as
|
|
10743
|
+
import { Base64 as Base643 } from "@noya-app/noya-utils";
|
|
10744
|
+
|
|
10745
|
+
// ../state-manager/src/sync/localStorageSync.ts
|
|
10746
|
+
import { uuid as uuid11 } from "@noya-app/noya-utils";
|
|
10747
|
+
|
|
10748
|
+
// ../state-manager/src/serverScripts.ts
|
|
10749
|
+
import { uuid as createUuid, isDeepEqual as isDeepEqual5 } from "@noya-app/noya-utils";
|
|
10624
10750
|
|
|
10625
10751
|
// ../noya-keymap/src/hooks.ts
|
|
10626
10752
|
import { useEffect as useEffect2, useRef as useRef2 } from "react";
|
|
@@ -10732,12 +10858,22 @@ var MenuItemTree = (0, import_tree_visit3.defineTree)((node) => {
|
|
|
10732
10858
|
return node.type === "submenu" ? node.items : [];
|
|
10733
10859
|
});
|
|
10734
10860
|
|
|
10861
|
+
// ../state-manager/src/NoyaManager.ts
|
|
10862
|
+
var createMutatorParametersSchema = Type.Object({
|
|
10863
|
+
sourceCode: Type.String({
|
|
10864
|
+
description: "The source code of the mutator function."
|
|
10865
|
+
}),
|
|
10866
|
+
message: Type.String({
|
|
10867
|
+
description: `A message that summarizes the changes made to the document state.`
|
|
10868
|
+
})
|
|
10869
|
+
});
|
|
10870
|
+
|
|
10735
10871
|
// ../noya-multiplayer-react/src/ai.ts
|
|
10736
10872
|
import { useEffect as useEffect17 } from "react";
|
|
10737
10873
|
|
|
10738
10874
|
// ../noya-multiplayer-react/src/NoyaStateContext.tsx
|
|
10739
10875
|
import {
|
|
10740
|
-
Observable as
|
|
10876
|
+
Observable as Observable21
|
|
10741
10877
|
} from "@noya-app/observable";
|
|
10742
10878
|
|
|
10743
10879
|
// ../noya-react-utils/src/components/AutoSizer.tsx
|
|
@@ -10920,7 +11056,7 @@ var FileDropTarget = memoGeneric(function FileDropTarget2({ children, onDropFile
|
|
|
10920
11056
|
import { useCallback as useCallback4, useState as useState3 } from "react";
|
|
10921
11057
|
|
|
10922
11058
|
// ../noya-react-utils/src/hooks/useDeepArray.ts
|
|
10923
|
-
import { isDeepEqual as
|
|
11059
|
+
import { isDeepEqual as isDeepEqual6 } from "@noya-app/noya-utils";
|
|
10924
11060
|
import { useMemo as useMemo3, useState as useState4 } from "react";
|
|
10925
11061
|
function useJsonMemo(value) {
|
|
10926
11062
|
const stringified = useMemo3(
|
|
@@ -10935,7 +11071,7 @@ function useJsonMemo(value) {
|
|
|
10935
11071
|
}
|
|
10936
11072
|
|
|
10937
11073
|
// ../noya-react-utils/src/hooks/useDeepState.ts
|
|
10938
|
-
import { isDeepEqual as
|
|
11074
|
+
import { isDeepEqual as isDeepEqual7 } from "@noya-app/noya-utils";
|
|
10939
11075
|
import { useCallback as useCallback5, useMemo as useMemo4, useState as useState5 } from "react";
|
|
10940
11076
|
|
|
10941
11077
|
// ../noya-react-utils/src/hooks/useFetch.ts
|
|
@@ -11044,7 +11180,7 @@ function downloadBlob(...params) {
|
|
|
11044
11180
|
}
|
|
11045
11181
|
|
|
11046
11182
|
// ../noya-multiplayer-react/src/NoyaStateContext.tsx
|
|
11047
|
-
import
|
|
11183
|
+
import React35, {
|
|
11048
11184
|
createContext as createContext3,
|
|
11049
11185
|
useCallback as useCallback14,
|
|
11050
11186
|
useContext as useContext4,
|
|
@@ -11143,12 +11279,12 @@ var ErrorOverlay = React6.memo(function ErrorOverlay2({
|
|
|
11143
11279
|
});
|
|
11144
11280
|
|
|
11145
11281
|
// ../noya-multiplayer-react/src/inspector/useStateInspector.tsx
|
|
11146
|
-
import
|
|
11282
|
+
import React33 from "react";
|
|
11147
11283
|
import { createRoot } from "react-dom/client";
|
|
11148
11284
|
|
|
11149
11285
|
// ../noya-multiplayer-react/src/inspector/StateInspector.tsx
|
|
11150
|
-
import { Base64 as
|
|
11151
|
-
import
|
|
11286
|
+
import { Base64 as Base644, memoize as memoize2, uuid as uuid13 } from "@noya-app/noya-utils";
|
|
11287
|
+
import React31, {
|
|
11152
11288
|
useCallback as useCallback12,
|
|
11153
11289
|
useEffect as useEffect13,
|
|
11154
11290
|
useLayoutEffect as useLayoutEffect4
|
|
@@ -13008,6 +13144,105 @@ function HistorySection({
|
|
|
13008
13144
|
);
|
|
13009
13145
|
}
|
|
13010
13146
|
|
|
13147
|
+
// ../noya-multiplayer-react/src/inspector/sections/ServerScriptLogsSection.tsx
|
|
13148
|
+
import React27 from "react";
|
|
13149
|
+
var levelColors = {
|
|
13150
|
+
error: "#f87171",
|
|
13151
|
+
warn: "#facc15",
|
|
13152
|
+
log: "#9ca3af"
|
|
13153
|
+
};
|
|
13154
|
+
function formatTimestamp(timestamp) {
|
|
13155
|
+
return new Date(timestamp).toLocaleTimeString();
|
|
13156
|
+
}
|
|
13157
|
+
function ServerScriptLogsSection({
|
|
13158
|
+
showLogs,
|
|
13159
|
+
setShowLogs,
|
|
13160
|
+
colorScheme,
|
|
13161
|
+
logs,
|
|
13162
|
+
containerRef,
|
|
13163
|
+
paused,
|
|
13164
|
+
onTogglePaused
|
|
13165
|
+
}) {
|
|
13166
|
+
const theme3 = getStateInspectorTheme(colorScheme);
|
|
13167
|
+
return /* @__PURE__ */ React27.createElement(
|
|
13168
|
+
StateInspectorDisclosureSection,
|
|
13169
|
+
{
|
|
13170
|
+
open: showLogs,
|
|
13171
|
+
setOpen: setShowLogs,
|
|
13172
|
+
title: "Server Script Logs",
|
|
13173
|
+
colorScheme,
|
|
13174
|
+
right: /* @__PURE__ */ React27.createElement(StateInspectorButton, { theme: theme3, onClick: onTogglePaused }, paused ? "Resume" : "Pause")
|
|
13175
|
+
},
|
|
13176
|
+
/* @__PURE__ */ React27.createElement(StateInspectorDisclosureRowInner, { ref: containerRef }, paused && /* @__PURE__ */ React27.createElement(
|
|
13177
|
+
"div",
|
|
13178
|
+
{
|
|
13179
|
+
style: {
|
|
13180
|
+
padding: "4px 12px",
|
|
13181
|
+
fontSize: "11px",
|
|
13182
|
+
opacity: 0.7
|
|
13183
|
+
}
|
|
13184
|
+
},
|
|
13185
|
+
"Log streaming paused"
|
|
13186
|
+
), logs.map((log) => /* @__PURE__ */ React27.createElement(StateInspectorRow, { key: log.id, colorScheme }, /* @__PURE__ */ React27.createElement(
|
|
13187
|
+
"div",
|
|
13188
|
+
{
|
|
13189
|
+
style: {
|
|
13190
|
+
display: "flex",
|
|
13191
|
+
gap: "6px",
|
|
13192
|
+
alignItems: "center",
|
|
13193
|
+
fontSize: "10px",
|
|
13194
|
+
color: "inherit",
|
|
13195
|
+
marginBottom: log.values.length ? "4px" : 0,
|
|
13196
|
+
textTransform: "uppercase"
|
|
13197
|
+
}
|
|
13198
|
+
},
|
|
13199
|
+
/* @__PURE__ */ React27.createElement("span", null, formatTimestamp(log.timestamp)),
|
|
13200
|
+
/* @__PURE__ */ React27.createElement("span", { style: { color: levelColors[log.level] } }, log.level),
|
|
13201
|
+
/* @__PURE__ */ React27.createElement(
|
|
13202
|
+
"span",
|
|
13203
|
+
{
|
|
13204
|
+
style: {
|
|
13205
|
+
fontFamily: "monospace",
|
|
13206
|
+
textTransform: "none",
|
|
13207
|
+
fontSize: "10px"
|
|
13208
|
+
}
|
|
13209
|
+
},
|
|
13210
|
+
log.scriptId
|
|
13211
|
+
)
|
|
13212
|
+
), /* @__PURE__ */ React27.createElement(
|
|
13213
|
+
"div",
|
|
13214
|
+
{
|
|
13215
|
+
style: {
|
|
13216
|
+
display: "flex",
|
|
13217
|
+
flexDirection: "column",
|
|
13218
|
+
gap: "4px"
|
|
13219
|
+
}
|
|
13220
|
+
},
|
|
13221
|
+
log.values.length > 0 ? log.values.map((value, index) => /* @__PURE__ */ React27.createElement(
|
|
13222
|
+
themedObjectInspector,
|
|
13223
|
+
{
|
|
13224
|
+
key: index,
|
|
13225
|
+
data: value,
|
|
13226
|
+
theme: theme3,
|
|
13227
|
+
expandLevel: 3
|
|
13228
|
+
}
|
|
13229
|
+
)) : /* @__PURE__ */ React27.createElement("span", { style: { fontSize: "11px", opacity: 0.7 } }, "No data")
|
|
13230
|
+
))), !logs?.length && /* @__PURE__ */ React27.createElement(
|
|
13231
|
+
"div",
|
|
13232
|
+
{
|
|
13233
|
+
style: {
|
|
13234
|
+
padding: "12px",
|
|
13235
|
+
fontSize: "12px",
|
|
13236
|
+
display: "flex",
|
|
13237
|
+
flexDirection: "column",
|
|
13238
|
+
gap: "4px"
|
|
13239
|
+
}
|
|
13240
|
+
},
|
|
13241
|
+
/* @__PURE__ */ React27.createElement("span", null, "No logs received")
|
|
13242
|
+
))
|
|
13243
|
+
);
|
|
13244
|
+
}
|
|
13245
|
+
|
|
13011
13246
|
// ../noya-multiplayer-react/src/inspector/zip/crc32.ts
|
|
13012
13247
|
var CRC_TABLE = (() => {
|
|
13013
13248
|
const t = new Uint32Array(256);
|
|
@@ -13532,15 +13767,15 @@ function decodeAll(buffer) {
|
|
|
13532
13767
|
}
|
|
13533
13768
|
|
|
13534
13769
|
// ../noya-multiplayer-react/src/inspector/StateInspectorTitleLabel.tsx
|
|
13535
|
-
import
|
|
13770
|
+
import React28 from "react";
|
|
13536
13771
|
function StateInspectorTitleLabel({
|
|
13537
13772
|
children
|
|
13538
13773
|
}) {
|
|
13539
|
-
return /* @__PURE__ */
|
|
13774
|
+
return /* @__PURE__ */ React28.createElement("span", { style: { display: "flex", alignItems: "center", gap: "4px" } }, children);
|
|
13540
13775
|
}
|
|
13541
13776
|
|
|
13542
13777
|
// ../noya-multiplayer-react/src/inspector/StateInspectorToggleButton.tsx
|
|
13543
|
-
import
|
|
13778
|
+
import React29 from "react";
|
|
13544
13779
|
function StateInspectorToggleButton({
|
|
13545
13780
|
showInspector,
|
|
13546
13781
|
setShowInspector,
|
|
@@ -13548,7 +13783,7 @@ function StateInspectorToggleButton({
|
|
|
13548
13783
|
anchor
|
|
13549
13784
|
}) {
|
|
13550
13785
|
const isRightAnchor = anchor === "right";
|
|
13551
|
-
const rightIcon = /* @__PURE__ */
|
|
13786
|
+
const rightIcon = /* @__PURE__ */ React29.createElement(
|
|
13552
13787
|
"svg",
|
|
13553
13788
|
{
|
|
13554
13789
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -13558,7 +13793,7 @@ function StateInspectorToggleButton({
|
|
|
13558
13793
|
stroke: "currentColor",
|
|
13559
13794
|
className: "size-6"
|
|
13560
13795
|
},
|
|
13561
|
-
/* @__PURE__ */
|
|
13796
|
+
/* @__PURE__ */ React29.createElement(
|
|
13562
13797
|
"path",
|
|
13563
13798
|
{
|
|
13564
13799
|
strokeLinecap: "round",
|
|
@@ -13567,7 +13802,7 @@ function StateInspectorToggleButton({
|
|
|
13567
13802
|
}
|
|
13568
13803
|
)
|
|
13569
13804
|
);
|
|
13570
|
-
const leftIcon = /* @__PURE__ */
|
|
13805
|
+
const leftIcon = /* @__PURE__ */ React29.createElement(
|
|
13571
13806
|
"svg",
|
|
13572
13807
|
{
|
|
13573
13808
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -13577,7 +13812,7 @@ function StateInspectorToggleButton({
|
|
|
13577
13812
|
stroke: "currentColor",
|
|
13578
13813
|
className: "size-6"
|
|
13579
13814
|
},
|
|
13580
|
-
/* @__PURE__ */
|
|
13815
|
+
/* @__PURE__ */ React29.createElement(
|
|
13581
13816
|
"path",
|
|
13582
13817
|
{
|
|
13583
13818
|
strokeLinecap: "round",
|
|
@@ -13586,7 +13821,7 @@ function StateInspectorToggleButton({
|
|
|
13586
13821
|
}
|
|
13587
13822
|
)
|
|
13588
13823
|
);
|
|
13589
|
-
return /* @__PURE__ */
|
|
13824
|
+
return /* @__PURE__ */ React29.createElement(
|
|
13590
13825
|
"span",
|
|
13591
13826
|
{
|
|
13592
13827
|
role: "button",
|
|
@@ -13607,15 +13842,15 @@ function StateInspectorToggleButton({
|
|
|
13607
13842
|
setShowInspector(!showInspector);
|
|
13608
13843
|
}
|
|
13609
13844
|
},
|
|
13610
|
-
showInspector ? "Hide Inspector" : /* @__PURE__ */
|
|
13845
|
+
showInspector ? "Hide Inspector" : /* @__PURE__ */ React29.createElement("span", { style: { width: "12px", height: "12px" } }, isRightAnchor ? rightIcon : leftIcon)
|
|
13611
13846
|
);
|
|
13612
13847
|
}
|
|
13613
13848
|
|
|
13614
13849
|
// ../noya-multiplayer-react/src/inspector/useLocalStorageState.tsx
|
|
13615
|
-
import
|
|
13850
|
+
import React30 from "react";
|
|
13616
13851
|
var localStorage2 = typeof window !== "undefined" ? window.localStorage : null;
|
|
13617
13852
|
function useLocalStorageState(key, defaultValue) {
|
|
13618
|
-
const [state, setState] =
|
|
13853
|
+
const [state, setState] = React30.useState(() => {
|
|
13619
13854
|
const value = localStorage2?.getItem(key);
|
|
13620
13855
|
let result = defaultValue;
|
|
13621
13856
|
if (value) {
|
|
@@ -13648,22 +13883,24 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
13648
13883
|
assetManager,
|
|
13649
13884
|
userManager,
|
|
13650
13885
|
secretManager,
|
|
13651
|
-
|
|
13886
|
+
sharedConnectionDataManager,
|
|
13652
13887
|
connectionEventManager,
|
|
13653
13888
|
taskManager,
|
|
13654
13889
|
ioManager,
|
|
13655
13890
|
resourceManager,
|
|
13656
|
-
activityEventsManager
|
|
13891
|
+
activityEventsManager,
|
|
13892
|
+
logManager
|
|
13657
13893
|
} = noyaManager;
|
|
13658
|
-
const [didMount, setDidMount] =
|
|
13894
|
+
const [didMount, setDidMount] = React31.useState(false);
|
|
13659
13895
|
const tasks = useObservable2(taskManager.tasks$);
|
|
13660
13896
|
const inputs = useObservable2(ioManager.inputs$);
|
|
13661
13897
|
const outputTransforms = useObservable2(ioManager.outputTransforms$);
|
|
13662
13898
|
useLayoutEffect4(() => {
|
|
13663
13899
|
setDidMount(true);
|
|
13664
13900
|
}, []);
|
|
13665
|
-
const eventsContainerRef =
|
|
13666
|
-
const activityEventsContainerRef =
|
|
13901
|
+
const eventsContainerRef = React31.useRef(null);
|
|
13902
|
+
const activityEventsContainerRef = React31.useRef(null);
|
|
13903
|
+
const serverLogsContainerRef = React31.useRef(null);
|
|
13667
13904
|
const [showInspector, setShowInspector] = useLocalStorageState(
|
|
13668
13905
|
"noya-multiplayer-react-show-inspector",
|
|
13669
13906
|
true
|
|
@@ -13688,8 +13925,8 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
13688
13925
|
"noya-multiplayer-react-show-tasks",
|
|
13689
13926
|
false
|
|
13690
13927
|
);
|
|
13691
|
-
const [
|
|
13692
|
-
"noya-multiplayer-react-show-
|
|
13928
|
+
const [showShared, setShowShared] = useLocalStorageState(
|
|
13929
|
+
"noya-multiplayer-react-show-shared",
|
|
13693
13930
|
false
|
|
13694
13931
|
);
|
|
13695
13932
|
const [showAssets, setShowAssets] = useLocalStorageState(
|
|
@@ -13716,16 +13953,43 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
13716
13953
|
"noya-multiplayer-react-show-activity-events",
|
|
13717
13954
|
false
|
|
13718
13955
|
);
|
|
13956
|
+
const [showServerLogs, setShowServerLogs] = useLocalStorageState(
|
|
13957
|
+
"noya-multiplayer-react-show-server-logs",
|
|
13958
|
+
false
|
|
13959
|
+
);
|
|
13719
13960
|
const connectionEvents = useObservable2(connectionEventManager.events$);
|
|
13720
13961
|
useEffect13(() => {
|
|
13721
13962
|
if (eventsContainerRef.current) {
|
|
13722
13963
|
eventsContainerRef.current.scrollTop = eventsContainerRef.current.scrollHeight;
|
|
13723
13964
|
}
|
|
13724
13965
|
}, [connectionEvents]);
|
|
13966
|
+
const serverLogs = useObservable2(logManager.logs$);
|
|
13967
|
+
const [serverLogsPaused, setServerLogsPaused] = React31.useState(false);
|
|
13968
|
+
const [visibleServerLogs, setVisibleServerLogs] = React31.useState(
|
|
13969
|
+
serverLogs ?? []
|
|
13970
|
+
);
|
|
13971
|
+
const toggleServerLogsPaused = useCallback12(() => {
|
|
13972
|
+
setServerLogsPaused((value) => {
|
|
13973
|
+
if (!value) {
|
|
13974
|
+
setVisibleServerLogs(serverLogs ?? []);
|
|
13975
|
+
}
|
|
13976
|
+
return !value;
|
|
13977
|
+
});
|
|
13978
|
+
}, [serverLogs]);
|
|
13979
|
+
useEffect13(() => {
|
|
13980
|
+
if (serverLogsPaused) return;
|
|
13981
|
+
setVisibleServerLogs(serverLogs ?? []);
|
|
13982
|
+
}, [serverLogs, serverLogsPaused]);
|
|
13983
|
+
useEffect13(() => {
|
|
13984
|
+
if (!showServerLogs) return;
|
|
13985
|
+
if (serverLogsContainerRef.current) {
|
|
13986
|
+
serverLogsContainerRef.current.scrollTop = serverLogsContainerRef.current.scrollHeight;
|
|
13987
|
+
}
|
|
13988
|
+
}, [showServerLogs, visibleServerLogs]);
|
|
13725
13989
|
const multipeerStateInitialized = useObservable2(
|
|
13726
13990
|
multiplayerStateManager.isInitialized$
|
|
13727
13991
|
);
|
|
13728
|
-
const
|
|
13992
|
+
const shared = useObservable2(sharedConnectionDataManager.data$);
|
|
13729
13993
|
const historySnapshot = useManagedHistory(multiplayerStateManager.sm);
|
|
13730
13994
|
const assets = useObservable2(assetManager.assets$);
|
|
13731
13995
|
const resources = useObservable2(resourceManager.resources$);
|
|
@@ -13734,7 +13998,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
13734
13998
|
const secrets = useObservable2(secretManager.secrets$);
|
|
13735
13999
|
const secretsInitialized = useObservable2(secretManager.isInitialized$);
|
|
13736
14000
|
const connectedUsers = useObservable2(userManager.connectedUsers$);
|
|
13737
|
-
const
|
|
14001
|
+
const connectionId = useObservable2(userManager.currentConnectionId$);
|
|
13738
14002
|
const state = useObservable2(multiplayerStateManager.optimisticState$);
|
|
13739
14003
|
const inputsInitialized = useObservable2(ioManager.inputsInitialized$);
|
|
13740
14004
|
const outputTransformsInitialized = useObservable2(
|
|
@@ -13778,7 +14042,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
13778
14042
|
}, [noyaManager]);
|
|
13779
14043
|
if (!didMount) return null;
|
|
13780
14044
|
if (!showInspector) {
|
|
13781
|
-
return /* @__PURE__ */
|
|
14045
|
+
return /* @__PURE__ */ React31.createElement(
|
|
13782
14046
|
"div",
|
|
13783
14047
|
{
|
|
13784
14048
|
...props,
|
|
@@ -13790,7 +14054,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
13790
14054
|
},
|
|
13791
14055
|
onClick: () => setShowInspector(true)
|
|
13792
14056
|
},
|
|
13793
|
-
/* @__PURE__ */
|
|
14057
|
+
/* @__PURE__ */ React31.createElement(
|
|
13794
14058
|
StateInspectorToggleButton,
|
|
13795
14059
|
{
|
|
13796
14060
|
showInspector,
|
|
@@ -13801,7 +14065,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
13801
14065
|
)
|
|
13802
14066
|
);
|
|
13803
14067
|
}
|
|
13804
|
-
return /* @__PURE__ */
|
|
14068
|
+
return /* @__PURE__ */ React31.createElement(
|
|
13805
14069
|
"div",
|
|
13806
14070
|
{
|
|
13807
14071
|
...props,
|
|
@@ -13810,7 +14074,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
13810
14074
|
...props.style
|
|
13811
14075
|
}
|
|
13812
14076
|
},
|
|
13813
|
-
/* @__PURE__ */
|
|
14077
|
+
/* @__PURE__ */ React31.createElement(
|
|
13814
14078
|
StateInspectorDisclosureSection,
|
|
13815
14079
|
{
|
|
13816
14080
|
isFirst: true,
|
|
@@ -13822,7 +14086,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
13822
14086
|
flex: "0 0 auto",
|
|
13823
14087
|
maxHeight: "200px"
|
|
13824
14088
|
},
|
|
13825
|
-
right: /* @__PURE__ */
|
|
14089
|
+
right: /* @__PURE__ */ React31.createElement(
|
|
13826
14090
|
StateInspectorToggleButton,
|
|
13827
14091
|
{
|
|
13828
14092
|
showInspector,
|
|
@@ -13832,36 +14096,39 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
13832
14096
|
}
|
|
13833
14097
|
)
|
|
13834
14098
|
},
|
|
13835
|
-
/* @__PURE__ */
|
|
13836
|
-
|
|
13837
|
-
|
|
13838
|
-
|
|
13839
|
-
colorScheme,
|
|
13840
|
-
variant: user.id === userId ? "up" : void 0,
|
|
13841
|
-
bordered: index !== array.length - 1
|
|
13842
|
-
},
|
|
13843
|
-
user.image && /* @__PURE__ */ React30.createElement(
|
|
13844
|
-
"img",
|
|
14099
|
+
/* @__PURE__ */ React31.createElement(StateInspectorDisclosureRowInner, { style: { flex: "0 0 auto" } }, connectedUsers?.map((user, index, array) => {
|
|
14100
|
+
const identifier = user.userId ?? user.connectionId;
|
|
14101
|
+
return /* @__PURE__ */ React31.createElement(
|
|
14102
|
+
StateInspectorRow,
|
|
13845
14103
|
{
|
|
13846
|
-
|
|
13847
|
-
|
|
13848
|
-
|
|
13849
|
-
|
|
13850
|
-
|
|
13851
|
-
|
|
13852
|
-
|
|
13853
|
-
|
|
13854
|
-
|
|
13855
|
-
|
|
13856
|
-
|
|
14104
|
+
key: user.connectionId,
|
|
14105
|
+
colorScheme,
|
|
14106
|
+
variant: user.connectionId === connectionId ? "up" : void 0,
|
|
14107
|
+
bordered: index !== array.length - 1
|
|
14108
|
+
},
|
|
14109
|
+
user.image && /* @__PURE__ */ React31.createElement(
|
|
14110
|
+
"img",
|
|
14111
|
+
{
|
|
14112
|
+
src: user.image,
|
|
14113
|
+
alt: user.name,
|
|
14114
|
+
style: {
|
|
14115
|
+
width: "13px",
|
|
14116
|
+
height: "13px",
|
|
14117
|
+
borderRadius: "50%",
|
|
14118
|
+
marginRight: "4px",
|
|
14119
|
+
display: "inline-block",
|
|
14120
|
+
position: "relative",
|
|
14121
|
+
background: solidBorderColor,
|
|
14122
|
+
verticalAlign: "middle"
|
|
14123
|
+
}
|
|
13857
14124
|
}
|
|
13858
|
-
|
|
13859
|
-
|
|
13860
|
-
|
|
13861
|
-
|
|
13862
|
-
|
|
13863
|
-
|
|
13864
|
-
)
|
|
14125
|
+
),
|
|
14126
|
+
user.name,
|
|
14127
|
+
" (",
|
|
14128
|
+
ellipsis(identifier, 8, "middle"),
|
|
14129
|
+
")"
|
|
14130
|
+
);
|
|
14131
|
+
}), !connectedUsers && /* @__PURE__ */ React31.createElement(
|
|
13865
14132
|
"div",
|
|
13866
14133
|
{
|
|
13867
14134
|
style: {
|
|
@@ -13872,13 +14139,13 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
13872
14139
|
gap: "4px"
|
|
13873
14140
|
}
|
|
13874
14141
|
},
|
|
13875
|
-
/* @__PURE__ */
|
|
14142
|
+
/* @__PURE__ */ React31.createElement("span", null, "No connected users")
|
|
13876
14143
|
))
|
|
13877
14144
|
),
|
|
13878
|
-
/* @__PURE__ */
|
|
14145
|
+
/* @__PURE__ */ React31.createElement(
|
|
13879
14146
|
StateInspectorDisclosureSection,
|
|
13880
14147
|
{
|
|
13881
|
-
title: /* @__PURE__ */
|
|
14148
|
+
title: /* @__PURE__ */ React31.createElement(StateInspectorTitleLabel, null, "Data", /* @__PURE__ */ React31.createElement(
|
|
13882
14149
|
ColoredDot,
|
|
13883
14150
|
{
|
|
13884
14151
|
type: multipeerStateInitialized ? "success" : "error"
|
|
@@ -13887,7 +14154,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
13887
14154
|
colorScheme,
|
|
13888
14155
|
setOpen: setShowData,
|
|
13889
14156
|
open: showData,
|
|
13890
|
-
right: /* @__PURE__ */
|
|
14157
|
+
right: /* @__PURE__ */ React31.createElement(
|
|
13891
14158
|
"span",
|
|
13892
14159
|
{
|
|
13893
14160
|
style: {
|
|
@@ -13895,9 +14162,9 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
13895
14162
|
gap: "12px"
|
|
13896
14163
|
}
|
|
13897
14164
|
},
|
|
13898
|
-
/* @__PURE__ */
|
|
13899
|
-
/* @__PURE__ */
|
|
13900
|
-
/* @__PURE__ */
|
|
14165
|
+
/* @__PURE__ */ React31.createElement(StateInspectorButton, { theme: theme3, onClick: handleImportAll }, "Import"),
|
|
14166
|
+
/* @__PURE__ */ React31.createElement(StateInspectorButton, { theme: theme3, onClick: handleExportAll }, "Export"),
|
|
14167
|
+
/* @__PURE__ */ React31.createElement(
|
|
13901
14168
|
StateInspectorButton,
|
|
13902
14169
|
{
|
|
13903
14170
|
theme: theme3,
|
|
@@ -13909,14 +14176,14 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
13909
14176
|
)
|
|
13910
14177
|
)
|
|
13911
14178
|
},
|
|
13912
|
-
/* @__PURE__ */
|
|
14179
|
+
/* @__PURE__ */ React31.createElement(StateInspectorDisclosureRowInner, null, /* @__PURE__ */ React31.createElement(StateInspectorRow, { colorScheme }, /* @__PURE__ */ React31.createElement(
|
|
13913
14180
|
themedObjectInspector,
|
|
13914
14181
|
{
|
|
13915
14182
|
name: multiplayerStateManager.schema ? "state" : void 0,
|
|
13916
14183
|
data: state,
|
|
13917
14184
|
theme: theme3
|
|
13918
14185
|
}
|
|
13919
|
-
)), multiplayerStateManager.schema && /* @__PURE__ */
|
|
14186
|
+
)), multiplayerStateManager.schema && /* @__PURE__ */ React31.createElement(StateInspectorRow, { colorScheme }, /* @__PURE__ */ React31.createElement(
|
|
13920
14187
|
themedObjectInspector,
|
|
13921
14188
|
{
|
|
13922
14189
|
name: "schema",
|
|
@@ -13925,7 +14192,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
13925
14192
|
}
|
|
13926
14193
|
)))
|
|
13927
14194
|
),
|
|
13928
|
-
/* @__PURE__ */
|
|
14195
|
+
/* @__PURE__ */ React31.createElement(
|
|
13929
14196
|
HistorySection,
|
|
13930
14197
|
{
|
|
13931
14198
|
showHistory,
|
|
@@ -13935,14 +14202,14 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
13935
14202
|
multiplayerStateManager
|
|
13936
14203
|
}
|
|
13937
14204
|
),
|
|
13938
|
-
/* @__PURE__ */
|
|
14205
|
+
/* @__PURE__ */ React31.createElement(
|
|
13939
14206
|
StateInspectorDisclosureSection,
|
|
13940
14207
|
{
|
|
13941
14208
|
open: showAssets,
|
|
13942
14209
|
setOpen: setShowAssets,
|
|
13943
|
-
title: /* @__PURE__ */
|
|
14210
|
+
title: /* @__PURE__ */ React31.createElement(StateInspectorTitleLabel, null, "Assets (", assets.length, ")", /* @__PURE__ */ React31.createElement(ColoredDot, { type: assetsInitialized ? "success" : "error" })),
|
|
13944
14211
|
colorScheme,
|
|
13945
|
-
right: /* @__PURE__ */
|
|
14212
|
+
right: /* @__PURE__ */ React31.createElement("span", { style: { display: "flex", gap: "10px" } }, /* @__PURE__ */ React31.createElement(
|
|
13946
14213
|
StateInspectorButton,
|
|
13947
14214
|
{
|
|
13948
14215
|
theme: theme3,
|
|
@@ -13957,7 +14224,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
13957
14224
|
}
|
|
13958
14225
|
},
|
|
13959
14226
|
"Delete all"
|
|
13960
|
-
), /* @__PURE__ */
|
|
14227
|
+
), /* @__PURE__ */ React31.createElement(
|
|
13961
14228
|
StateInspectorButton,
|
|
13962
14229
|
{
|
|
13963
14230
|
theme: theme3,
|
|
@@ -13970,7 +14237,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
13970
14237
|
}
|
|
13971
14238
|
},
|
|
13972
14239
|
"Reload"
|
|
13973
|
-
), /* @__PURE__ */
|
|
14240
|
+
), /* @__PURE__ */ React31.createElement(
|
|
13974
14241
|
StateInspectorButton,
|
|
13975
14242
|
{
|
|
13976
14243
|
theme: theme3,
|
|
@@ -13994,14 +14261,14 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
13994
14261
|
"Upload"
|
|
13995
14262
|
))
|
|
13996
14263
|
},
|
|
13997
|
-
/* @__PURE__ */
|
|
14264
|
+
/* @__PURE__ */ React31.createElement(StateInspectorDisclosureRowInner, null, assets.map((asset) => /* @__PURE__ */ React31.createElement(StateInspectorRow, { key: asset.id, colorScheme }, /* @__PURE__ */ React31.createElement(
|
|
13998
14265
|
themedObjectInspector,
|
|
13999
14266
|
{
|
|
14000
14267
|
name: asset.id,
|
|
14001
14268
|
data: truncateAsset(asset),
|
|
14002
14269
|
theme: theme3
|
|
14003
14270
|
}
|
|
14004
|
-
), /* @__PURE__ */
|
|
14271
|
+
), /* @__PURE__ */ React31.createElement(
|
|
14005
14272
|
StateInspectorButton,
|
|
14006
14273
|
{
|
|
14007
14274
|
theme: theme3,
|
|
@@ -14010,14 +14277,14 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
14010
14277
|
"Delete"
|
|
14011
14278
|
))))
|
|
14012
14279
|
),
|
|
14013
|
-
advanced && /* @__PURE__ */
|
|
14280
|
+
advanced && /* @__PURE__ */ React31.createElement(
|
|
14014
14281
|
StateInspectorDisclosureSection,
|
|
14015
14282
|
{
|
|
14016
|
-
title: /* @__PURE__ */
|
|
14283
|
+
title: /* @__PURE__ */ React31.createElement(StateInspectorTitleLabel, null, "Resources (", resources.length, ")", /* @__PURE__ */ React31.createElement(ColoredDot, { type: resourcesInitialized ? "success" : "error" })),
|
|
14017
14284
|
colorScheme,
|
|
14018
14285
|
open: showResources,
|
|
14019
14286
|
setOpen: setShowResources,
|
|
14020
|
-
right: /* @__PURE__ */
|
|
14287
|
+
right: /* @__PURE__ */ React31.createElement("span", { style: { display: "flex", gap: "10px" } }, /* @__PURE__ */ React31.createElement(
|
|
14021
14288
|
StateInspectorButton,
|
|
14022
14289
|
{
|
|
14023
14290
|
theme: theme3,
|
|
@@ -14032,12 +14299,12 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
14032
14299
|
}
|
|
14033
14300
|
},
|
|
14034
14301
|
"Delete all"
|
|
14035
|
-
), /* @__PURE__ */
|
|
14302
|
+
), /* @__PURE__ */ React31.createElement(
|
|
14036
14303
|
StateInspectorButton,
|
|
14037
14304
|
{
|
|
14038
14305
|
theme: theme3,
|
|
14039
14306
|
onClick: async () => {
|
|
14040
|
-
const path2 = prompt("Enter directory path") ||
|
|
14307
|
+
const path2 = prompt("Enter directory path") || uuid13();
|
|
14041
14308
|
await resourceManager.createResource({
|
|
14042
14309
|
type: "directory",
|
|
14043
14310
|
path: path2
|
|
@@ -14045,7 +14312,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
14045
14312
|
}
|
|
14046
14313
|
},
|
|
14047
14314
|
"Create Directory"
|
|
14048
|
-
), /* @__PURE__ */
|
|
14315
|
+
), /* @__PURE__ */ React31.createElement(
|
|
14049
14316
|
StateInspectorButton,
|
|
14050
14317
|
{
|
|
14051
14318
|
theme: theme3,
|
|
@@ -14053,9 +14320,9 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
14053
14320
|
const file = await uploadFile();
|
|
14054
14321
|
resourceManager.createResource({
|
|
14055
14322
|
type: "asset",
|
|
14056
|
-
path: file.name ||
|
|
14323
|
+
path: file.name || uuid13(),
|
|
14057
14324
|
asset: {
|
|
14058
|
-
content:
|
|
14325
|
+
content: Base644.encode(await file.arrayBuffer()),
|
|
14059
14326
|
contentType: file.type,
|
|
14060
14327
|
encoding: "base64"
|
|
14061
14328
|
}
|
|
@@ -14065,21 +14332,21 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
14065
14332
|
"Create Asset"
|
|
14066
14333
|
))
|
|
14067
14334
|
},
|
|
14068
|
-
/* @__PURE__ */
|
|
14335
|
+
/* @__PURE__ */ React31.createElement(StateInspectorDisclosureRowInner, null, resources?.map((resource) => /* @__PURE__ */ React31.createElement(StateInspectorRow, { key: resource.id, colorScheme }, /* @__PURE__ */ React31.createElement(
|
|
14069
14336
|
themedObjectInspector,
|
|
14070
14337
|
{
|
|
14071
14338
|
name: resource.path,
|
|
14072
14339
|
data: resource,
|
|
14073
14340
|
theme: theme3
|
|
14074
14341
|
}
|
|
14075
|
-
), /* @__PURE__ */
|
|
14342
|
+
), /* @__PURE__ */ React31.createElement("div", { style: { display: "flex", gap: "4px" } }, /* @__PURE__ */ React31.createElement(
|
|
14076
14343
|
StateInspectorButton,
|
|
14077
14344
|
{
|
|
14078
14345
|
theme: theme3,
|
|
14079
14346
|
onClick: () => resourceManager.deleteResource({ id: resource.id })
|
|
14080
14347
|
},
|
|
14081
14348
|
"Delete"
|
|
14082
|
-
), /* @__PURE__ */
|
|
14349
|
+
), /* @__PURE__ */ React31.createElement(
|
|
14083
14350
|
StateInspectorButton,
|
|
14084
14351
|
{
|
|
14085
14352
|
theme: theme3,
|
|
@@ -14092,14 +14359,14 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
14092
14359
|
"Rename"
|
|
14093
14360
|
)))))
|
|
14094
14361
|
),
|
|
14095
|
-
advanced && /* @__PURE__ */
|
|
14362
|
+
advanced && /* @__PURE__ */ React31.createElement(
|
|
14096
14363
|
StateInspectorDisclosureSection,
|
|
14097
14364
|
{
|
|
14098
|
-
title: /* @__PURE__ */
|
|
14365
|
+
title: /* @__PURE__ */ React31.createElement(StateInspectorTitleLabel, null, "Secrets", /* @__PURE__ */ React31.createElement(ColoredDot, { type: secretsInitialized ? "success" : "error" })),
|
|
14099
14366
|
colorScheme,
|
|
14100
14367
|
open: showSecrets,
|
|
14101
14368
|
setOpen: setShowSecrets,
|
|
14102
|
-
right: /* @__PURE__ */
|
|
14369
|
+
right: /* @__PURE__ */ React31.createElement(
|
|
14103
14370
|
StateInspectorButton,
|
|
14104
14371
|
{
|
|
14105
14372
|
theme: theme3,
|
|
@@ -14114,7 +14381,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
14114
14381
|
"Create"
|
|
14115
14382
|
)
|
|
14116
14383
|
},
|
|
14117
|
-
/* @__PURE__ */
|
|
14384
|
+
/* @__PURE__ */ React31.createElement(StateInspectorDisclosureRowInner, null, secrets.map((secret) => /* @__PURE__ */ React31.createElement(StateInspectorRow, { key: secret.id, colorScheme }, /* @__PURE__ */ React31.createElement(themedObjectInspector, { data: secret, theme: theme3 }), /* @__PURE__ */ React31.createElement(
|
|
14118
14385
|
StateInspectorButton,
|
|
14119
14386
|
{
|
|
14120
14387
|
theme: theme3,
|
|
@@ -14123,15 +14390,15 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
14123
14390
|
"Delete"
|
|
14124
14391
|
))))
|
|
14125
14392
|
),
|
|
14126
|
-
advanced && /* @__PURE__ */
|
|
14393
|
+
advanced && /* @__PURE__ */ React31.createElement(
|
|
14127
14394
|
StateInspectorDisclosureSection,
|
|
14128
14395
|
{
|
|
14129
14396
|
open: showInputs,
|
|
14130
14397
|
setOpen: setShowInputs,
|
|
14131
|
-
title: /* @__PURE__ */
|
|
14398
|
+
title: /* @__PURE__ */ React31.createElement(StateInspectorTitleLabel, null, "Inputs", /* @__PURE__ */ React31.createElement(ColoredDot, { type: inputsInitialized ? "success" : "error" })),
|
|
14132
14399
|
colorScheme
|
|
14133
14400
|
},
|
|
14134
|
-
/* @__PURE__ */
|
|
14401
|
+
/* @__PURE__ */ React31.createElement(StateInspectorDisclosureRowInner, null, inputs?.map((input) => /* @__PURE__ */ React31.createElement(StateInspectorRow, { key: input.id, colorScheme }, /* @__PURE__ */ React31.createElement(themedObjectInspector, { data: input, theme: theme3 }))), !inputs?.length && /* @__PURE__ */ React31.createElement(
|
|
14135
14402
|
"div",
|
|
14136
14403
|
{
|
|
14137
14404
|
style: {
|
|
@@ -14142,15 +14409,15 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
14142
14409
|
gap: "4px"
|
|
14143
14410
|
}
|
|
14144
14411
|
},
|
|
14145
|
-
/* @__PURE__ */
|
|
14412
|
+
/* @__PURE__ */ React31.createElement("span", null, "No inputs")
|
|
14146
14413
|
))
|
|
14147
14414
|
),
|
|
14148
|
-
advanced && /* @__PURE__ */
|
|
14415
|
+
advanced && /* @__PURE__ */ React31.createElement(
|
|
14149
14416
|
StateInspectorDisclosureSection,
|
|
14150
14417
|
{
|
|
14151
14418
|
open: showOutputTransforms,
|
|
14152
14419
|
setOpen: setShowOutputTransforms,
|
|
14153
|
-
title: /* @__PURE__ */
|
|
14420
|
+
title: /* @__PURE__ */ React31.createElement(StateInspectorTitleLabel, null, "Output Transforms", /* @__PURE__ */ React31.createElement(
|
|
14154
14421
|
ColoredDot,
|
|
14155
14422
|
{
|
|
14156
14423
|
type: outputTransformsInitialized ? "success" : "error"
|
|
@@ -14158,7 +14425,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
14158
14425
|
)),
|
|
14159
14426
|
colorScheme
|
|
14160
14427
|
},
|
|
14161
|
-
/* @__PURE__ */
|
|
14428
|
+
/* @__PURE__ */ React31.createElement(StateInspectorDisclosureRowInner, null, outputTransforms?.map((transform) => /* @__PURE__ */ React31.createElement(StateInspectorRow, { key: transform.id, colorScheme }, /* @__PURE__ */ React31.createElement(themedObjectInspector, { data: transform, theme: theme3 }))), !outputTransforms?.length && /* @__PURE__ */ React31.createElement(
|
|
14162
14429
|
"div",
|
|
14163
14430
|
{
|
|
14164
14431
|
style: {
|
|
@@ -14169,10 +14436,10 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
14169
14436
|
gap: "4px"
|
|
14170
14437
|
}
|
|
14171
14438
|
},
|
|
14172
|
-
/* @__PURE__ */
|
|
14439
|
+
/* @__PURE__ */ React31.createElement("span", null, "No output transforms")
|
|
14173
14440
|
))
|
|
14174
14441
|
),
|
|
14175
|
-
advanced && /* @__PURE__ */
|
|
14442
|
+
advanced && /* @__PURE__ */ React31.createElement(
|
|
14176
14443
|
StateInspectorDisclosureSection,
|
|
14177
14444
|
{
|
|
14178
14445
|
title: "Tasks",
|
|
@@ -14180,7 +14447,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
14180
14447
|
open: showTasks,
|
|
14181
14448
|
setOpen: setShowTasks
|
|
14182
14449
|
},
|
|
14183
|
-
/* @__PURE__ */
|
|
14450
|
+
/* @__PURE__ */ React31.createElement(StateInspectorDisclosureRowInner, null, tasks?.map((task) => /* @__PURE__ */ React31.createElement(
|
|
14184
14451
|
StateInspectorRow,
|
|
14185
14452
|
{
|
|
14186
14453
|
key: task.id,
|
|
@@ -14189,7 +14456,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
14189
14456
|
backgroundColor: task.status === "done" ? "rgba(0,255,0,0.2)" : task.status === "error" ? "rgba(255,0,0,0.2)" : void 0
|
|
14190
14457
|
}
|
|
14191
14458
|
},
|
|
14192
|
-
/* @__PURE__ */
|
|
14459
|
+
/* @__PURE__ */ React31.createElement(
|
|
14193
14460
|
themedObjectInspector,
|
|
14194
14461
|
{
|
|
14195
14462
|
name: task.name,
|
|
@@ -14199,15 +14466,15 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
14199
14466
|
)
|
|
14200
14467
|
)))
|
|
14201
14468
|
),
|
|
14202
|
-
/* @__PURE__ */
|
|
14469
|
+
/* @__PURE__ */ React31.createElement(
|
|
14203
14470
|
StateInspectorDisclosureSection,
|
|
14204
14471
|
{
|
|
14205
|
-
open:
|
|
14206
|
-
setOpen:
|
|
14207
|
-
title: "
|
|
14472
|
+
open: showShared,
|
|
14473
|
+
setOpen: setShowShared,
|
|
14474
|
+
title: "Shared Connection Data",
|
|
14208
14475
|
colorScheme
|
|
14209
14476
|
},
|
|
14210
|
-
/* @__PURE__ */
|
|
14477
|
+
/* @__PURE__ */ React31.createElement(StateInspectorDisclosureRowInner, null, Object.entries(shared).map(([key, value]) => /* @__PURE__ */ React31.createElement(StateInspectorRow, { key, colorScheme }, /* @__PURE__ */ React31.createElement(
|
|
14211
14478
|
themedObjectInspector,
|
|
14212
14479
|
{
|
|
14213
14480
|
name: key,
|
|
@@ -14217,7 +14484,19 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
14217
14484
|
}
|
|
14218
14485
|
))))
|
|
14219
14486
|
),
|
|
14220
|
-
|
|
14487
|
+
/* @__PURE__ */ React31.createElement(
|
|
14488
|
+
ServerScriptLogsSection,
|
|
14489
|
+
{
|
|
14490
|
+
colorScheme,
|
|
14491
|
+
showLogs: showServerLogs,
|
|
14492
|
+
setShowLogs: setShowServerLogs,
|
|
14493
|
+
logs: visibleServerLogs,
|
|
14494
|
+
paused: serverLogsPaused,
|
|
14495
|
+
onTogglePaused: toggleServerLogsPaused,
|
|
14496
|
+
containerRef: serverLogsContainerRef
|
|
14497
|
+
}
|
|
14498
|
+
),
|
|
14499
|
+
advanced && /* @__PURE__ */ React31.createElement(
|
|
14221
14500
|
ActivityEventsSection,
|
|
14222
14501
|
{
|
|
14223
14502
|
colorScheme,
|
|
@@ -14227,7 +14506,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
14227
14506
|
activityEventsManager
|
|
14228
14507
|
}
|
|
14229
14508
|
),
|
|
14230
|
-
/* @__PURE__ */
|
|
14509
|
+
/* @__PURE__ */ React31.createElement(
|
|
14231
14510
|
EventsSection,
|
|
14232
14511
|
{
|
|
14233
14512
|
connectionEvents,
|
|
@@ -14256,7 +14535,7 @@ function useManagedHistory(stateManager) {
|
|
|
14256
14535
|
}
|
|
14257
14536
|
|
|
14258
14537
|
// ../noya-multiplayer-react/src/singleton.tsx
|
|
14259
|
-
import
|
|
14538
|
+
import React34 from "react";
|
|
14260
14539
|
|
|
14261
14540
|
// ../noya-multiplayer-react/src/NoyaStateContext.tsx
|
|
14262
14541
|
var AnyNoyaStateContext = createContext3(void 0);
|
|
@@ -14278,24 +14557,24 @@ function useActivityEventsForManager(streamFilter, activityEventsManager) {
|
|
|
14278
14557
|
}
|
|
14279
14558
|
|
|
14280
14559
|
// ../noya-multiplayer-react/src/components/UserPointersOverlay.tsx
|
|
14281
|
-
import { Observable as
|
|
14282
|
-
import
|
|
14560
|
+
import { Observable as Observable22 } from "@noya-app/observable";
|
|
14561
|
+
import React36, { useEffect as useEffect18, useMemo as useMemo12, useState as useState18 } from "react";
|
|
14283
14562
|
function shouldShow(hideAfter, updatedAt) {
|
|
14284
14563
|
return !!updatedAt && Date.now() - updatedAt < hideAfter;
|
|
14285
14564
|
}
|
|
14286
14565
|
var UserPointerInternal = memoGeneric(function UserPointerInternal2({
|
|
14287
14566
|
user,
|
|
14288
|
-
|
|
14567
|
+
sharedConnectionDataManager,
|
|
14289
14568
|
hideAfter = 5e3,
|
|
14290
14569
|
renderUserPointer
|
|
14291
14570
|
}) {
|
|
14292
14571
|
const observable = useMemo12(() => {
|
|
14293
|
-
const metadata$ =
|
|
14294
|
-
const data$ =
|
|
14295
|
-
return
|
|
14572
|
+
const metadata$ = sharedConnectionDataManager.metadata$.observePath([user.connectionId]).throttle(50);
|
|
14573
|
+
const data$ = sharedConnectionDataManager.data$.observePath([user.connectionId]).throttle(50);
|
|
14574
|
+
return Observable22.combine([metadata$, data$], ([metadata2, data2]) => {
|
|
14296
14575
|
return { metadata: metadata2, data: data2 };
|
|
14297
14576
|
});
|
|
14298
|
-
}, [
|
|
14577
|
+
}, [sharedConnectionDataManager, user.connectionId]);
|
|
14299
14578
|
const { metadata, data } = useObservable2(observable);
|
|
14300
14579
|
const [, setForceUpdate] = useState18(0);
|
|
14301
14580
|
const updatedAt = metadata?.updatedAt ?? 0;
|
|
@@ -14309,7 +14588,7 @@ var UserPointerInternal = memoGeneric(function UserPointerInternal2({
|
|
|
14309
14588
|
}, [hideAfter, show, updatedAt]);
|
|
14310
14589
|
if (!data?.pointer) return null;
|
|
14311
14590
|
return renderUserPointer({
|
|
14312
|
-
userId: user.
|
|
14591
|
+
userId: user.connectionId,
|
|
14313
14592
|
name: user.name,
|
|
14314
14593
|
point: data.pointer,
|
|
14315
14594
|
visible: show
|
|
@@ -14317,19 +14596,21 @@ var UserPointerInternal = memoGeneric(function UserPointerInternal2({
|
|
|
14317
14596
|
});
|
|
14318
14597
|
var UserPointersOverlay = memoGeneric(function UserPointers({
|
|
14319
14598
|
userManager,
|
|
14320
|
-
|
|
14599
|
+
sharedConnectionDataManager,
|
|
14321
14600
|
renderUserPointer
|
|
14322
14601
|
}) {
|
|
14323
|
-
const
|
|
14602
|
+
const currentConnectionId = useObservable2(
|
|
14603
|
+
sharedConnectionDataManager.currentConnectionId$
|
|
14604
|
+
);
|
|
14324
14605
|
const connectedUsers = useObservable2(userManager.connectedUsers$);
|
|
14325
|
-
return /* @__PURE__ */
|
|
14326
|
-
if (user.
|
|
14327
|
-
return /* @__PURE__ */
|
|
14606
|
+
return /* @__PURE__ */ React36.createElement(React36.Fragment, null, connectedUsers.map((user) => {
|
|
14607
|
+
if (user.connectionId === currentConnectionId) return null;
|
|
14608
|
+
return /* @__PURE__ */ React36.createElement(
|
|
14328
14609
|
UserPointerInternal,
|
|
14329
14610
|
{
|
|
14330
|
-
key: user.
|
|
14611
|
+
key: user.connectionId,
|
|
14331
14612
|
user,
|
|
14332
|
-
|
|
14613
|
+
sharedConnectionDataManager,
|
|
14333
14614
|
renderUserPointer
|
|
14334
14615
|
}
|
|
14335
14616
|
);
|