@noya-app/noya-api-client-react 0.1.36 → 0.1.38
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 +9 -9
- package/CHANGELOG.md +20 -0
- package/dist/index.d.mts +113 -50
- package/dist/index.d.ts +113 -50
- package/dist/index.js +1201 -469
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1193 -463
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -5
- package/src/react/hooks.ts +7 -0
- package/src/react/tableHooks.ts +149 -34
package/dist/index.js
CHANGED
|
@@ -45,10 +45,10 @@ var require_access = __commonJS({
|
|
|
45
45
|
const accessed = _getPath(node, indexPath, options);
|
|
46
46
|
return accessed[accessed.length - 1];
|
|
47
47
|
}
|
|
48
|
-
let
|
|
49
|
-
while (
|
|
50
|
-
let index =
|
|
51
|
-
const children = options.getChildren(node,
|
|
48
|
+
let path2 = indexPath.slice();
|
|
49
|
+
while (path2.length > 0) {
|
|
50
|
+
let index = path2.shift();
|
|
51
|
+
const children = options.getChildren(node, path2);
|
|
52
52
|
const child = children[index];
|
|
53
53
|
if (!child) {
|
|
54
54
|
return void 0;
|
|
@@ -61,12 +61,12 @@ var require_access = __commonJS({
|
|
|
61
61
|
return _getPath(node, indexPath, options).slice(0, -1);
|
|
62
62
|
}
|
|
63
63
|
function _getPath(node, indexPath, options) {
|
|
64
|
-
let
|
|
64
|
+
let path2 = indexPath.slice();
|
|
65
65
|
let result = [node];
|
|
66
|
-
while (
|
|
67
|
-
let index =
|
|
66
|
+
while (path2.length > 0) {
|
|
67
|
+
let index = path2.shift();
|
|
68
68
|
const context = options.includeTraversalContext ? makeTraversalContext(result) : void 0;
|
|
69
|
-
const children = options.getChildren(node,
|
|
69
|
+
const children = options.getChildren(node, path2, context);
|
|
70
70
|
const child = children[index];
|
|
71
71
|
if (!child) {
|
|
72
72
|
return result;
|
|
@@ -81,20 +81,20 @@ var require_access = __commonJS({
|
|
|
81
81
|
const accessed = accessPath(node, indexPath, options);
|
|
82
82
|
return accessed[accessed.length - 1];
|
|
83
83
|
}
|
|
84
|
-
let
|
|
85
|
-
while (
|
|
86
|
-
let index =
|
|
87
|
-
node = options.getChildren(node,
|
|
84
|
+
let path2 = indexPath.slice();
|
|
85
|
+
while (path2.length > 0) {
|
|
86
|
+
let index = path2.shift();
|
|
87
|
+
node = options.getChildren(node, path2)[index];
|
|
88
88
|
}
|
|
89
89
|
return node;
|
|
90
90
|
}
|
|
91
91
|
function accessPath(node, indexPath, options) {
|
|
92
|
-
let
|
|
92
|
+
let path2 = indexPath.slice();
|
|
93
93
|
let result = [node];
|
|
94
|
-
while (
|
|
95
|
-
let index =
|
|
94
|
+
while (path2.length > 0) {
|
|
95
|
+
let index = path2.shift();
|
|
96
96
|
const context = options.includeTraversalContext ? makeTraversalContext(result) : void 0;
|
|
97
|
-
node = options.getChildren(node,
|
|
97
|
+
node = options.getChildren(node, path2, context)[index];
|
|
98
98
|
result.push(node);
|
|
99
99
|
}
|
|
100
100
|
return result;
|
|
@@ -608,40 +608,40 @@ var require_transformPath = __commonJS({
|
|
|
608
608
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
609
609
|
exports2.transformPath = transformPath;
|
|
610
610
|
var sort_1 = require_sort();
|
|
611
|
-
function commonAncestor(
|
|
612
|
-
const length = Math.min(
|
|
611
|
+
function commonAncestor(path2, otherPath) {
|
|
612
|
+
const length = Math.min(path2.length, otherPath.length);
|
|
613
613
|
for (let i = 0; i < length; i++) {
|
|
614
|
-
if (
|
|
615
|
-
return
|
|
614
|
+
if (path2[i] !== otherPath[i]) {
|
|
615
|
+
return path2.slice(0, i);
|
|
616
616
|
}
|
|
617
617
|
}
|
|
618
|
-
return
|
|
618
|
+
return path2.slice(0, length);
|
|
619
619
|
}
|
|
620
|
-
function transformPath(
|
|
621
|
-
if (otherPath.length >
|
|
622
|
-
return
|
|
620
|
+
function transformPath(path2, operation, otherPath, count = 1) {
|
|
621
|
+
if (otherPath.length > path2.length || (0, sort_1.comparePathsByComponent)(otherPath, path2) > 0) {
|
|
622
|
+
return path2;
|
|
623
623
|
}
|
|
624
624
|
if (otherPath.length === 0 && operation === "remove") {
|
|
625
625
|
return void 0;
|
|
626
626
|
}
|
|
627
|
-
const common = commonAncestor(
|
|
628
|
-
const adjustmentIndex = common.length ===
|
|
629
|
-
const pathValue =
|
|
627
|
+
const common = commonAncestor(path2, otherPath);
|
|
628
|
+
const adjustmentIndex = common.length === path2.length || common.length === otherPath.length ? common.length - 1 : common.length;
|
|
629
|
+
const pathValue = path2[adjustmentIndex];
|
|
630
630
|
const otherPathValue = otherPath[adjustmentIndex];
|
|
631
631
|
if (operation === "insert" && otherPathValue <= pathValue) {
|
|
632
|
-
const newPath = [...
|
|
632
|
+
const newPath = [...path2];
|
|
633
633
|
newPath[adjustmentIndex] += count;
|
|
634
634
|
return newPath;
|
|
635
635
|
} else if (operation === "remove") {
|
|
636
636
|
if (otherPathValue === pathValue) {
|
|
637
637
|
return void 0;
|
|
638
638
|
} else if (otherPathValue < pathValue) {
|
|
639
|
-
const newPath = [...
|
|
639
|
+
const newPath = [...path2];
|
|
640
640
|
newPath[adjustmentIndex] -= count;
|
|
641
641
|
return newPath;
|
|
642
642
|
}
|
|
643
643
|
}
|
|
644
|
-
return
|
|
644
|
+
return path2;
|
|
645
645
|
}
|
|
646
646
|
}
|
|
647
647
|
});
|
|
@@ -807,15 +807,15 @@ var require_operation = __commonJS({
|
|
|
807
807
|
switch (operation.type) {
|
|
808
808
|
case "insert": {
|
|
809
809
|
const otherPath = parentPath.concat(operation.index);
|
|
810
|
-
return transformedPaths.map((
|
|
810
|
+
return transformedPaths.map((path2) => path2 ? (0, transformPath_1.transformPath)(path2, "insert", otherPath, operation.nodes.length) : void 0);
|
|
811
811
|
}
|
|
812
812
|
case "remove": {
|
|
813
813
|
const otherPaths = [...operation.indexes].reverse().map((index) => parentPath.concat(index));
|
|
814
|
-
return transformedPaths.map((
|
|
814
|
+
return transformedPaths.map((path2) => {
|
|
815
815
|
for (const otherPath of otherPaths) {
|
|
816
|
-
|
|
816
|
+
path2 = path2 ? (0, transformPath_1.transformPath)(path2, "remove", otherPath) : void 0;
|
|
817
817
|
}
|
|
818
|
-
return
|
|
818
|
+
return path2;
|
|
819
819
|
});
|
|
820
820
|
}
|
|
821
821
|
case "removeThenInsert": {
|
|
@@ -952,22 +952,22 @@ var require_splice = __commonJS({
|
|
|
952
952
|
return _spliceWithPathTracking(node, options);
|
|
953
953
|
}
|
|
954
954
|
function _spliceWithPathTracking(node, options) {
|
|
955
|
-
const { path, deleteCount = 0, nodes, track } = options;
|
|
956
|
-
if (
|
|
955
|
+
const { path: path2, deleteCount = 0, nodes, track } = options;
|
|
956
|
+
if (path2.length === 0) {
|
|
957
957
|
throw new Error(`Can't splice at the root`);
|
|
958
958
|
}
|
|
959
|
-
const pathsToRemove = getPathsToRemove(
|
|
960
|
-
const operations = (0, operation_1.getInsertionOperations)(
|
|
959
|
+
const pathsToRemove = getPathsToRemove(path2, deleteCount);
|
|
960
|
+
const operations = (0, operation_1.getInsertionOperations)(path2, nodes, (0, operation_1.getRemovalOperations)(pathsToRemove));
|
|
961
961
|
const transformedPaths = track ? (0, operation_1.transformPathsByOperations)(track, operations) : [];
|
|
962
962
|
return {
|
|
963
963
|
node: (0, operation_1.applyOperations)(node, operations, options),
|
|
964
964
|
paths: transformedPaths
|
|
965
965
|
};
|
|
966
966
|
}
|
|
967
|
-
function getPathsToRemove(
|
|
967
|
+
function getPathsToRemove(path2, deleteCount) {
|
|
968
968
|
let pathsToRemove = [];
|
|
969
|
-
let parentPath =
|
|
970
|
-
let index =
|
|
969
|
+
let parentPath = path2.slice(0, -1);
|
|
970
|
+
let index = path2[path2.length - 1];
|
|
971
971
|
for (let i = 0; i < deleteCount; i++) {
|
|
972
972
|
pathsToRemove.push(parentPath.concat(index + i));
|
|
973
973
|
}
|
|
@@ -981,7 +981,7 @@ var require_defineTree = __commonJS({
|
|
|
981
981
|
"../../node_modules/tree-visit/lib/defineTree.js"(exports2) {
|
|
982
982
|
"use strict";
|
|
983
983
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
984
|
-
exports2.defineTree =
|
|
984
|
+
exports2.defineTree = defineTree4;
|
|
985
985
|
var access_1 = require_access();
|
|
986
986
|
var diagram_1 = require_diagram();
|
|
987
987
|
var entries_1 = require_entries();
|
|
@@ -1030,7 +1030,7 @@ var require_defineTree = __commonJS({
|
|
|
1030
1030
|
this._getChildren = this.baseOptions.getChildren;
|
|
1031
1031
|
}
|
|
1032
1032
|
};
|
|
1033
|
-
function
|
|
1033
|
+
function defineTree4(getChildren) {
|
|
1034
1034
|
return new Tree(getChildren, {});
|
|
1035
1035
|
}
|
|
1036
1036
|
}
|
|
@@ -1107,6 +1107,391 @@ var require_lib = __commonJS({
|
|
|
1107
1107
|
}
|
|
1108
1108
|
});
|
|
1109
1109
|
|
|
1110
|
+
// ../../node_modules/imfs/lib/types.js
|
|
1111
|
+
var require_types = __commonJS({
|
|
1112
|
+
"../../node_modules/imfs/lib/types.js"(exports2) {
|
|
1113
|
+
"use strict";
|
|
1114
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1115
|
+
}
|
|
1116
|
+
});
|
|
1117
|
+
|
|
1118
|
+
// ../../node_modules/imfs/lib/node.js
|
|
1119
|
+
var require_node = __commonJS({
|
|
1120
|
+
"../../node_modules/imfs/lib/node.js"(exports2) {
|
|
1121
|
+
"use strict";
|
|
1122
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1123
|
+
exports2.Nodes = void 0;
|
|
1124
|
+
function createFile(data, metadata) {
|
|
1125
|
+
return { type: "file", data, metadata };
|
|
1126
|
+
}
|
|
1127
|
+
function createDirectory(children = {}, metadata) {
|
|
1128
|
+
return { type: "directory", children, metadata };
|
|
1129
|
+
}
|
|
1130
|
+
function isFile(node) {
|
|
1131
|
+
return node.type === "file";
|
|
1132
|
+
}
|
|
1133
|
+
function isDirectory(node) {
|
|
1134
|
+
return node.type === "directory";
|
|
1135
|
+
}
|
|
1136
|
+
function getMetadata(node) {
|
|
1137
|
+
return node.metadata;
|
|
1138
|
+
}
|
|
1139
|
+
function readDirectory(directory) {
|
|
1140
|
+
return Object.keys(directory.children);
|
|
1141
|
+
}
|
|
1142
|
+
function getChild(directory, name) {
|
|
1143
|
+
return directory.children[name];
|
|
1144
|
+
}
|
|
1145
|
+
function hasChild(directory, name) {
|
|
1146
|
+
return name in directory.children;
|
|
1147
|
+
}
|
|
1148
|
+
exports2.Nodes = {
|
|
1149
|
+
createDirectory,
|
|
1150
|
+
createFile,
|
|
1151
|
+
getChild,
|
|
1152
|
+
getMetadata,
|
|
1153
|
+
hasChild,
|
|
1154
|
+
isDirectory,
|
|
1155
|
+
isFile,
|
|
1156
|
+
readDirectory
|
|
1157
|
+
};
|
|
1158
|
+
}
|
|
1159
|
+
});
|
|
1160
|
+
|
|
1161
|
+
// ../../node_modules/imfs/lib/path.js
|
|
1162
|
+
var require_path = __commonJS({
|
|
1163
|
+
"../../node_modules/imfs/lib/path.js"(exports2) {
|
|
1164
|
+
"use strict";
|
|
1165
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1166
|
+
exports2.dirname = exports2.basename = exports2.extname = exports2.join = exports2.normalize = exports2.sep = void 0;
|
|
1167
|
+
exports2.sep = "/";
|
|
1168
|
+
function preserveLeadingAndTrailingSlash(original, updated) {
|
|
1169
|
+
if (original.startsWith("/")) {
|
|
1170
|
+
updated = "/" + updated;
|
|
1171
|
+
}
|
|
1172
|
+
if (updated[updated.length - 1] !== "/" && original.endsWith("/")) {
|
|
1173
|
+
updated = updated + "/";
|
|
1174
|
+
}
|
|
1175
|
+
return updated;
|
|
1176
|
+
}
|
|
1177
|
+
function normalize(filename) {
|
|
1178
|
+
const components = filename.split(exports2.sep).filter((component) => !!component);
|
|
1179
|
+
let i = 0;
|
|
1180
|
+
let length = components.length - 1;
|
|
1181
|
+
while (i < length) {
|
|
1182
|
+
if (components[i] === ".") {
|
|
1183
|
+
components.splice(i, 1);
|
|
1184
|
+
length--;
|
|
1185
|
+
} else if (components[i] === ".." && i !== 0) {
|
|
1186
|
+
components.splice(i - 1, 2);
|
|
1187
|
+
length -= 2;
|
|
1188
|
+
i -= 1;
|
|
1189
|
+
} else if (components[i] === "" && components[i + 1] === "") {
|
|
1190
|
+
components.splice(i, 1);
|
|
1191
|
+
length--;
|
|
1192
|
+
} else {
|
|
1193
|
+
i++;
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
return preserveLeadingAndTrailingSlash(filename, components.join(exports2.sep));
|
|
1197
|
+
}
|
|
1198
|
+
exports2.normalize = normalize;
|
|
1199
|
+
function join(...components) {
|
|
1200
|
+
let result = normalize(components.join(exports2.sep));
|
|
1201
|
+
if (result === "") {
|
|
1202
|
+
result = ".";
|
|
1203
|
+
}
|
|
1204
|
+
return result;
|
|
1205
|
+
}
|
|
1206
|
+
exports2.join = join;
|
|
1207
|
+
function extname(filename) {
|
|
1208
|
+
const index = filename.lastIndexOf(".");
|
|
1209
|
+
return index !== -1 ? filename.slice(index) : filename;
|
|
1210
|
+
}
|
|
1211
|
+
exports2.extname = extname;
|
|
1212
|
+
function basename(filename, extname2) {
|
|
1213
|
+
if (extname2 && filename.endsWith(extname2)) {
|
|
1214
|
+
filename = filename.slice(0, -extname2.length);
|
|
1215
|
+
}
|
|
1216
|
+
let sepIndex = filename.lastIndexOf(exports2.sep);
|
|
1217
|
+
if (sepIndex === filename.length - 1) {
|
|
1218
|
+
filename = filename.slice(0, -1);
|
|
1219
|
+
return filename.length > 1 ? basename(filename) : filename;
|
|
1220
|
+
}
|
|
1221
|
+
return filename.slice(sepIndex + 1);
|
|
1222
|
+
}
|
|
1223
|
+
exports2.basename = basename;
|
|
1224
|
+
function dirname(filename) {
|
|
1225
|
+
let base2 = basename(filename);
|
|
1226
|
+
let result = filename.slice(0, -(base2.length + 1));
|
|
1227
|
+
if (result === "") {
|
|
1228
|
+
if (filename.startsWith(exports2.sep)) {
|
|
1229
|
+
result = exports2.sep;
|
|
1230
|
+
} else {
|
|
1231
|
+
result = ".";
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1234
|
+
return result;
|
|
1235
|
+
}
|
|
1236
|
+
exports2.dirname = dirname;
|
|
1237
|
+
}
|
|
1238
|
+
});
|
|
1239
|
+
|
|
1240
|
+
// ../../node_modules/imfs/lib/entries.js
|
|
1241
|
+
var require_entries2 = __commonJS({
|
|
1242
|
+
"../../node_modules/imfs/lib/entries.js"(exports2) {
|
|
1243
|
+
"use strict";
|
|
1244
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1245
|
+
exports2.Entries = void 0;
|
|
1246
|
+
var node_1 = require_node();
|
|
1247
|
+
var path_1 = require_path();
|
|
1248
|
+
function getEntries(entry) {
|
|
1249
|
+
const [pathname, node] = entry;
|
|
1250
|
+
return node_1.Nodes.isDirectory(node) ? Object.entries(node.children).map(([key, value]) => [
|
|
1251
|
+
(0, path_1.join)(pathname, key),
|
|
1252
|
+
value
|
|
1253
|
+
]) : [];
|
|
1254
|
+
}
|
|
1255
|
+
function createEntry(pathname, node) {
|
|
1256
|
+
return [pathname, node];
|
|
1257
|
+
}
|
|
1258
|
+
exports2.Entries = {
|
|
1259
|
+
createEntry,
|
|
1260
|
+
getEntries
|
|
1261
|
+
};
|
|
1262
|
+
}
|
|
1263
|
+
});
|
|
1264
|
+
|
|
1265
|
+
// ../../node_modules/imfs/lib/volume/paths.js
|
|
1266
|
+
var require_paths = __commonJS({
|
|
1267
|
+
"../../node_modules/imfs/lib/volume/paths.js"(exports2) {
|
|
1268
|
+
"use strict";
|
|
1269
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1270
|
+
exports2.getNewAndParentName = exports2.normalizePathLikeInternal = exports2.getPathComponents = void 0;
|
|
1271
|
+
var path_1 = require_path();
|
|
1272
|
+
function getPathComponents(filepath) {
|
|
1273
|
+
return getPathComponentsNormalized((0, path_1.normalize)(filepath));
|
|
1274
|
+
function getPathComponentsNormalized(filepath2) {
|
|
1275
|
+
if (filepath2.startsWith("..")) {
|
|
1276
|
+
throw new Error(`Invalid path ${filepath2}, can't go up past root.`);
|
|
1277
|
+
}
|
|
1278
|
+
if (filepath2.startsWith(".") || filepath2.startsWith("/")) {
|
|
1279
|
+
return getPathComponentsNormalized(filepath2.slice(1));
|
|
1280
|
+
}
|
|
1281
|
+
if (filepath2 === "")
|
|
1282
|
+
return [];
|
|
1283
|
+
return filepath2.split(path_1.sep).filter((component) => !!component);
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
exports2.getPathComponents = getPathComponents;
|
|
1287
|
+
function normalizePathLikeInternal(pathlike) {
|
|
1288
|
+
return typeof pathlike === "string" ? getPathComponents(pathlike) : pathlike;
|
|
1289
|
+
}
|
|
1290
|
+
exports2.normalizePathLikeInternal = normalizePathLikeInternal;
|
|
1291
|
+
function getNewAndParentName(pathlike) {
|
|
1292
|
+
const parentName = typeof pathlike === "string" ? (0, path_1.dirname)(pathlike) : pathlike.slice(0, -1);
|
|
1293
|
+
const newName = typeof pathlike === "string" ? (0, path_1.basename)(pathlike) : pathlike[pathlike.length - 1];
|
|
1294
|
+
return { parentName, newName };
|
|
1295
|
+
}
|
|
1296
|
+
exports2.getNewAndParentName = getNewAndParentName;
|
|
1297
|
+
}
|
|
1298
|
+
});
|
|
1299
|
+
|
|
1300
|
+
// ../../node_modules/imfs/lib/volume/read.js
|
|
1301
|
+
var require_read = __commonJS({
|
|
1302
|
+
"../../node_modules/imfs/lib/volume/read.js"(exports2) {
|
|
1303
|
+
"use strict";
|
|
1304
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1305
|
+
exports2.getMetadata = exports2.readDirectory = exports2.readFile = exports2.getNode = exports2.getNodeInternal = void 0;
|
|
1306
|
+
var node_1 = require_node();
|
|
1307
|
+
var path_1 = require_path();
|
|
1308
|
+
var paths_1 = require_paths();
|
|
1309
|
+
function getNodeInternal(root, pathlike, options) {
|
|
1310
|
+
const components = (0, paths_1.normalizePathLikeInternal)(pathlike);
|
|
1311
|
+
let i = 0;
|
|
1312
|
+
let current2 = root;
|
|
1313
|
+
while (i < components.length) {
|
|
1314
|
+
let component = components[i];
|
|
1315
|
+
if (current2.type !== "directory") {
|
|
1316
|
+
throw new Error(`File ${(0, path_1.join)(...components.slice(0, i))} is not a directory`);
|
|
1317
|
+
}
|
|
1318
|
+
let node = node_1.Nodes.getChild(current2, component);
|
|
1319
|
+
if (!node) {
|
|
1320
|
+
if (options.makeIntermediateDirectoryMetadata) {
|
|
1321
|
+
const child = node_1.Nodes.createDirectory({}, options.makeIntermediateDirectoryMetadata((0, path_1.join)(...components.slice(0, i + 1))));
|
|
1322
|
+
current2.children[component] = child;
|
|
1323
|
+
node = child;
|
|
1324
|
+
} else if (options.makeIntermediateDirectories) {
|
|
1325
|
+
const child = node_1.Nodes.createDirectory();
|
|
1326
|
+
current2.children[component] = child;
|
|
1327
|
+
node = child;
|
|
1328
|
+
} else {
|
|
1329
|
+
throw new Error(`File ${(0, path_1.join)(...components.slice(0, i + 1))} not found`);
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
current2 = node;
|
|
1333
|
+
i++;
|
|
1334
|
+
}
|
|
1335
|
+
return current2;
|
|
1336
|
+
}
|
|
1337
|
+
exports2.getNodeInternal = getNodeInternal;
|
|
1338
|
+
function getNode(root, pathlike) {
|
|
1339
|
+
return getNodeInternal(root, pathlike, {});
|
|
1340
|
+
}
|
|
1341
|
+
exports2.getNode = getNode;
|
|
1342
|
+
function readFile(root, pathlike) {
|
|
1343
|
+
const components = (0, paths_1.normalizePathLikeInternal)(pathlike);
|
|
1344
|
+
const node = getNode(root, components);
|
|
1345
|
+
if (!node_1.Nodes.isFile(node)) {
|
|
1346
|
+
throw new Error(`Can't read, ${(0, path_1.join)(...components)} not a file`);
|
|
1347
|
+
}
|
|
1348
|
+
return node.data;
|
|
1349
|
+
}
|
|
1350
|
+
exports2.readFile = readFile;
|
|
1351
|
+
function readDirectory(root, pathlike) {
|
|
1352
|
+
const components = (0, paths_1.normalizePathLikeInternal)(pathlike);
|
|
1353
|
+
const node = getNode(root, components);
|
|
1354
|
+
if (!node_1.Nodes.isDirectory(node)) {
|
|
1355
|
+
throw new Error(`Can't read, ${(0, path_1.join)(...components)} not a directory`);
|
|
1356
|
+
}
|
|
1357
|
+
return node_1.Nodes.readDirectory(node);
|
|
1358
|
+
}
|
|
1359
|
+
exports2.readDirectory = readDirectory;
|
|
1360
|
+
function getMetadata(root, pathlike) {
|
|
1361
|
+
const components = (0, paths_1.normalizePathLikeInternal)(pathlike);
|
|
1362
|
+
const node = getNode(root, components);
|
|
1363
|
+
return node.metadata;
|
|
1364
|
+
}
|
|
1365
|
+
exports2.getMetadata = getMetadata;
|
|
1366
|
+
}
|
|
1367
|
+
});
|
|
1368
|
+
|
|
1369
|
+
// ../../node_modules/imfs/lib/volume/write.js
|
|
1370
|
+
var require_write = __commonJS({
|
|
1371
|
+
"../../node_modules/imfs/lib/volume/write.js"(exports2) {
|
|
1372
|
+
"use strict";
|
|
1373
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1374
|
+
exports2.create = exports2.setMetadata = exports2.removeFile = exports2.makeDirectory = exports2.writeFile = exports2.setNode = void 0;
|
|
1375
|
+
var node_1 = require_node();
|
|
1376
|
+
var paths_1 = require_paths();
|
|
1377
|
+
var read_1 = require_read();
|
|
1378
|
+
function setNode(root, pathlike, node, options) {
|
|
1379
|
+
const { parentName, newName } = (0, paths_1.getNewAndParentName)(pathlike);
|
|
1380
|
+
const parent = (0, read_1.getNodeInternal)(root, parentName, options !== null && options !== void 0 ? options : {});
|
|
1381
|
+
if (!node_1.Nodes.isDirectory(parent)) {
|
|
1382
|
+
throw new Error(`Can't create ${newName}, ${parentName} not a directory`);
|
|
1383
|
+
}
|
|
1384
|
+
parent.children[newName] = node;
|
|
1385
|
+
}
|
|
1386
|
+
exports2.setNode = setNode;
|
|
1387
|
+
function writeFile(root, pathlike, data, options) {
|
|
1388
|
+
var _a;
|
|
1389
|
+
setNode(root, pathlike, node_1.Nodes.createFile(data, (_a = options) === null || _a === void 0 ? void 0 : _a.metadata), options);
|
|
1390
|
+
}
|
|
1391
|
+
exports2.writeFile = writeFile;
|
|
1392
|
+
function makeDirectory(root, pathlike, options) {
|
|
1393
|
+
var _a;
|
|
1394
|
+
const { parentName, newName } = (0, paths_1.getNewAndParentName)(pathlike);
|
|
1395
|
+
const parent = (0, read_1.getNodeInternal)(root, parentName, options !== null && options !== void 0 ? options : {});
|
|
1396
|
+
if (!node_1.Nodes.isDirectory(parent)) {
|
|
1397
|
+
throw new Error(`Can't create ${newName}, ${parentName} not a directory`);
|
|
1398
|
+
}
|
|
1399
|
+
const existing = node_1.Nodes.getChild(parent, newName);
|
|
1400
|
+
if (existing && node_1.Nodes.isDirectory(parent.children[newName])) {
|
|
1401
|
+
return;
|
|
1402
|
+
}
|
|
1403
|
+
parent.children[newName] = node_1.Nodes.createDirectory({}, (_a = options) === null || _a === void 0 ? void 0 : _a.metadata);
|
|
1404
|
+
}
|
|
1405
|
+
exports2.makeDirectory = makeDirectory;
|
|
1406
|
+
function removeFile(root, pathlike) {
|
|
1407
|
+
const { parentName, newName } = (0, paths_1.getNewAndParentName)(pathlike);
|
|
1408
|
+
const parent = (0, read_1.getNode)(root, parentName);
|
|
1409
|
+
if (!node_1.Nodes.isDirectory(parent)) {
|
|
1410
|
+
throw new Error(`Can't remove file ${newName}, ${parentName} not a directory`);
|
|
1411
|
+
}
|
|
1412
|
+
delete parent.children[newName];
|
|
1413
|
+
}
|
|
1414
|
+
exports2.removeFile = removeFile;
|
|
1415
|
+
function setMetadata(root, pathlike, metadata) {
|
|
1416
|
+
const node = (0, read_1.getNode)(root, pathlike);
|
|
1417
|
+
node.metadata = metadata;
|
|
1418
|
+
}
|
|
1419
|
+
exports2.setMetadata = setMetadata;
|
|
1420
|
+
function create2(options) {
|
|
1421
|
+
return node_1.Nodes.createDirectory({}, options && "metadata" in options ? options.metadata : void 0);
|
|
1422
|
+
}
|
|
1423
|
+
exports2.create = create2;
|
|
1424
|
+
}
|
|
1425
|
+
});
|
|
1426
|
+
|
|
1427
|
+
// ../../node_modules/imfs/lib/volume.js
|
|
1428
|
+
var require_volume = __commonJS({
|
|
1429
|
+
"../../node_modules/imfs/lib/volume.js"(exports2) {
|
|
1430
|
+
"use strict";
|
|
1431
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1432
|
+
exports2.Volume = void 0;
|
|
1433
|
+
var paths_1 = require_paths();
|
|
1434
|
+
var read_1 = require_read();
|
|
1435
|
+
var write_1 = require_write();
|
|
1436
|
+
exports2.Volume = {
|
|
1437
|
+
// paths
|
|
1438
|
+
getPathComponents: paths_1.getPathComponents,
|
|
1439
|
+
// read
|
|
1440
|
+
getMetadata: read_1.getMetadata,
|
|
1441
|
+
getNode: read_1.getNode,
|
|
1442
|
+
readDirectory: read_1.readDirectory,
|
|
1443
|
+
readFile: read_1.readFile,
|
|
1444
|
+
// write
|
|
1445
|
+
create: write_1.create,
|
|
1446
|
+
makeDirectory: write_1.makeDirectory,
|
|
1447
|
+
removeFile: write_1.removeFile,
|
|
1448
|
+
setMetadata: write_1.setMetadata,
|
|
1449
|
+
setNode: write_1.setNode,
|
|
1450
|
+
writeFile: write_1.writeFile
|
|
1451
|
+
};
|
|
1452
|
+
}
|
|
1453
|
+
});
|
|
1454
|
+
|
|
1455
|
+
// ../../node_modules/imfs/lib/index.js
|
|
1456
|
+
var require_lib2 = __commonJS({
|
|
1457
|
+
"../../node_modules/imfs/lib/index.js"(exports2) {
|
|
1458
|
+
"use strict";
|
|
1459
|
+
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
1460
|
+
if (k2 === void 0) k2 = k;
|
|
1461
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() {
|
|
1462
|
+
return m[k];
|
|
1463
|
+
} });
|
|
1464
|
+
} : function(o, m, k, k2) {
|
|
1465
|
+
if (k2 === void 0) k2 = k;
|
|
1466
|
+
o[k2] = m[k];
|
|
1467
|
+
});
|
|
1468
|
+
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
|
|
1469
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
1470
|
+
} : function(o, v) {
|
|
1471
|
+
o["default"] = v;
|
|
1472
|
+
});
|
|
1473
|
+
var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) {
|
|
1474
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p);
|
|
1475
|
+
};
|
|
1476
|
+
var __importStar = exports2 && exports2.__importStar || function(mod) {
|
|
1477
|
+
if (mod && mod.__esModule) return mod;
|
|
1478
|
+
var result = {};
|
|
1479
|
+
if (mod != null) {
|
|
1480
|
+
for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
1481
|
+
}
|
|
1482
|
+
__setModuleDefault(result, mod);
|
|
1483
|
+
return result;
|
|
1484
|
+
};
|
|
1485
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1486
|
+
exports2.path = void 0;
|
|
1487
|
+
__exportStar(require_types(), exports2);
|
|
1488
|
+
__exportStar(require_node(), exports2);
|
|
1489
|
+
__exportStar(require_entries2(), exports2);
|
|
1490
|
+
__exportStar(require_volume(), exports2);
|
|
1491
|
+
exports2.path = __importStar(require_path());
|
|
1492
|
+
}
|
|
1493
|
+
});
|
|
1494
|
+
|
|
1110
1495
|
// ../../node_modules/fast-diff/diff.js
|
|
1111
1496
|
var require_diff = __commonJS({
|
|
1112
1497
|
"../../node_modules/fast-diff/diff.js"(exports2, module2) {
|
|
@@ -1880,6 +2265,7 @@ var require_diff = __commonJS({
|
|
|
1880
2265
|
var src_exports = {};
|
|
1881
2266
|
__export(src_exports, {
|
|
1882
2267
|
NoyaAPIProvider: () => NoyaAPIProvider,
|
|
2268
|
+
useActivityEventsList: () => useActivityEventsList,
|
|
1883
2269
|
useFileList: () => useFileList,
|
|
1884
2270
|
useFileListItem: () => useFileListItem,
|
|
1885
2271
|
useGeneratedComponentDescription: () => useGeneratedComponentDescription,
|
|
@@ -1891,6 +2277,7 @@ __export(src_exports, {
|
|
|
1891
2277
|
useMetadata: () => useMetadata,
|
|
1892
2278
|
useNetworkRequests: () => useNetworkRequests,
|
|
1893
2279
|
useNoyaAssets: () => useNoyaAssets,
|
|
2280
|
+
useNoyaAssetsByFileVersionId: () => useNoyaAssetsByFileVersionId,
|
|
1894
2281
|
useNoyaBilling: () => useNoyaBilling,
|
|
1895
2282
|
useNoyaClient: () => useNoyaClient,
|
|
1896
2283
|
useNoyaClientOrFallback: () => useNoyaClientOrFallback,
|
|
@@ -1918,7 +2305,10 @@ __export(src_exports, {
|
|
|
1918
2305
|
useOptionalNoyaTools: () => useOptionalNoyaTools,
|
|
1919
2306
|
useOptionalNoyaUserData: () => useOptionalNoyaUserData,
|
|
1920
2307
|
useRandomIcons: () => useRandomIcons,
|
|
1921
|
-
useRandomImages: () => useRandomImages
|
|
2308
|
+
useRandomImages: () => useRandomImages,
|
|
2309
|
+
useResourcesList: () => useResourcesList,
|
|
2310
|
+
useTable: () => useTable,
|
|
2311
|
+
useUser: () => useUser
|
|
1922
2312
|
});
|
|
1923
2313
|
module.exports = __toCommonJS(src_exports);
|
|
1924
2314
|
__reExport(src_exports, require("@noya-app/noya-api"), module.exports);
|
|
@@ -2018,6 +2408,12 @@ function useNoyaAssets(fileId) {
|
|
|
2018
2408
|
);
|
|
2019
2409
|
return assets ?? empty;
|
|
2020
2410
|
}
|
|
2411
|
+
function useNoyaAssetsByFileVersionId(fileVersionId) {
|
|
2412
|
+
const client = useNoyaClientOrFallback();
|
|
2413
|
+
const empty = (0, import_react3.useMemo)(() => ({ assets: [], loading: true }), []);
|
|
2414
|
+
const assets = (0, import_react2.useSelector)(client.assetsByFileVersionId$[fileVersionId]);
|
|
2415
|
+
return assets ?? empty;
|
|
2416
|
+
}
|
|
2021
2417
|
function useNoyaSecrets(fileId) {
|
|
2022
2418
|
const client = useNoyaClientOrFallback();
|
|
2023
2419
|
const empty = (0, import_react3.useMemo)(() => ({ secrets: [], loading: true }), []);
|
|
@@ -2224,8 +2620,8 @@ var emptyObservedFileVersions = {
|
|
|
2224
2620
|
};
|
|
2225
2621
|
function useNoyaOwnedFileVersions(fileId) {
|
|
2226
2622
|
const client = useNoyaClientOrFallback();
|
|
2227
|
-
const
|
|
2228
|
-
const fileVersions = (0, import_observable_react.useObservable)(client.ownedFileVersions$,
|
|
2623
|
+
const path2 = (0, import_react3.useMemo)(() => [fileId], [fileId]);
|
|
2624
|
+
const fileVersions = (0, import_observable_react.useObservable)(client.ownedFileVersions$, path2);
|
|
2229
2625
|
(0, import_react3.useEffect)(() => {
|
|
2230
2626
|
if (!fileVersions || fileVersions.loading === "idle") {
|
|
2231
2627
|
client.fileVersions.refetch({ fileId, type: "owned" });
|
|
@@ -2256,9 +2652,6 @@ function useNoyaTemplates() {
|
|
|
2256
2652
|
};
|
|
2257
2653
|
}
|
|
2258
2654
|
|
|
2259
|
-
// src/react/tableHooks.ts
|
|
2260
|
-
var import_noya_api3 = require("@noya-app/noya-api");
|
|
2261
|
-
|
|
2262
2655
|
// ../../node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
|
|
2263
2656
|
var value_exports = {};
|
|
2264
2657
|
__export(value_exports, {
|
|
@@ -4684,15 +5077,6 @@ __export(type_exports3, {
|
|
|
4684
5077
|
var Type = type_exports3;
|
|
4685
5078
|
|
|
4686
5079
|
// ../../node_modules/@sinclair/typebox/build/esm/value/guard/guard.mjs
|
|
4687
|
-
function IsStandardObject(value) {
|
|
4688
|
-
return IsObject4(value) && (Object.getPrototypeOf(value) === Object.prototype || Object.getPrototypeOf(value) === null);
|
|
4689
|
-
}
|
|
4690
|
-
function IsDate4(value) {
|
|
4691
|
-
return value instanceof Date && Number.isFinite(value.getTime());
|
|
4692
|
-
}
|
|
4693
|
-
function IsUint8Array4(value) {
|
|
4694
|
-
return value instanceof globalThis.Uint8Array;
|
|
4695
|
-
}
|
|
4696
5080
|
function IsObject4(value) {
|
|
4697
5081
|
return value !== null && typeof value === "object";
|
|
4698
5082
|
}
|
|
@@ -4702,24 +5086,9 @@ function IsArray4(value) {
|
|
|
4702
5086
|
function IsUndefined4(value) {
|
|
4703
5087
|
return value === void 0;
|
|
4704
5088
|
}
|
|
4705
|
-
function IsNull4(value) {
|
|
4706
|
-
return value === null;
|
|
4707
|
-
}
|
|
4708
|
-
function IsBoolean4(value) {
|
|
4709
|
-
return typeof value === "boolean";
|
|
4710
|
-
}
|
|
4711
5089
|
function IsNumber4(value) {
|
|
4712
5090
|
return typeof value === "number";
|
|
4713
5091
|
}
|
|
4714
|
-
function IsBigInt4(value) {
|
|
4715
|
-
return typeof value === "bigint";
|
|
4716
|
-
}
|
|
4717
|
-
function IsString4(value) {
|
|
4718
|
-
return typeof value === "string";
|
|
4719
|
-
}
|
|
4720
|
-
function IsSymbol4(value) {
|
|
4721
|
-
return typeof value === "symbol";
|
|
4722
|
-
}
|
|
4723
5092
|
|
|
4724
5093
|
// ../../node_modules/@sinclair/typebox/build/esm/system/policy.mjs
|
|
4725
5094
|
var TypeSystemPolicy;
|
|
@@ -4782,13 +5151,6 @@ var TypeSystem;
|
|
|
4782
5151
|
})(TypeSystem || (TypeSystem = {}));
|
|
4783
5152
|
|
|
4784
5153
|
// ../../node_modules/@sinclair/typebox/build/esm/value/hash/hash.mjs
|
|
4785
|
-
var ValueHashError = class extends TypeBoxError {
|
|
4786
|
-
value;
|
|
4787
|
-
constructor(value) {
|
|
4788
|
-
super(`Unable to hash value`);
|
|
4789
|
-
this.value = value;
|
|
4790
|
-
}
|
|
4791
|
-
};
|
|
4792
5154
|
var ByteMarker;
|
|
4793
5155
|
(function(ByteMarker2) {
|
|
4794
5156
|
ByteMarker2[ByteMarker2["Undefined"] = 0] = "Undefined";
|
|
@@ -4809,105 +5171,6 @@ var Bytes = Array.from({ length: 256 }).map((_, i) => BigInt(i));
|
|
|
4809
5171
|
var F64 = new Float64Array(1);
|
|
4810
5172
|
var F64In = new DataView(F64.buffer);
|
|
4811
5173
|
var F64Out = new Uint8Array(F64.buffer);
|
|
4812
|
-
function* NumberToBytes(value) {
|
|
4813
|
-
const byteCount = value === 0 ? 1 : Math.ceil(Math.floor(Math.log2(value) + 1) / 8);
|
|
4814
|
-
for (let i = 0; i < byteCount; i++) {
|
|
4815
|
-
yield value >> 8 * (byteCount - 1 - i) & 255;
|
|
4816
|
-
}
|
|
4817
|
-
}
|
|
4818
|
-
function ArrayType2(value) {
|
|
4819
|
-
FNV1A64(ByteMarker.Array);
|
|
4820
|
-
for (const item of value) {
|
|
4821
|
-
Visit4(item);
|
|
4822
|
-
}
|
|
4823
|
-
}
|
|
4824
|
-
function BooleanType(value) {
|
|
4825
|
-
FNV1A64(ByteMarker.Boolean);
|
|
4826
|
-
FNV1A64(value ? 1 : 0);
|
|
4827
|
-
}
|
|
4828
|
-
function BigIntType(value) {
|
|
4829
|
-
FNV1A64(ByteMarker.BigInt);
|
|
4830
|
-
F64In.setBigInt64(0, value);
|
|
4831
|
-
for (const byte of F64Out) {
|
|
4832
|
-
FNV1A64(byte);
|
|
4833
|
-
}
|
|
4834
|
-
}
|
|
4835
|
-
function DateType2(value) {
|
|
4836
|
-
FNV1A64(ByteMarker.Date);
|
|
4837
|
-
Visit4(value.getTime());
|
|
4838
|
-
}
|
|
4839
|
-
function NullType(value) {
|
|
4840
|
-
FNV1A64(ByteMarker.Null);
|
|
4841
|
-
}
|
|
4842
|
-
function NumberType(value) {
|
|
4843
|
-
FNV1A64(ByteMarker.Number);
|
|
4844
|
-
F64In.setFloat64(0, value);
|
|
4845
|
-
for (const byte of F64Out) {
|
|
4846
|
-
FNV1A64(byte);
|
|
4847
|
-
}
|
|
4848
|
-
}
|
|
4849
|
-
function ObjectType2(value) {
|
|
4850
|
-
FNV1A64(ByteMarker.Object);
|
|
4851
|
-
for (const key of globalThis.Object.getOwnPropertyNames(value).sort()) {
|
|
4852
|
-
Visit4(key);
|
|
4853
|
-
Visit4(value[key]);
|
|
4854
|
-
}
|
|
4855
|
-
}
|
|
4856
|
-
function StringType(value) {
|
|
4857
|
-
FNV1A64(ByteMarker.String);
|
|
4858
|
-
for (let i = 0; i < value.length; i++) {
|
|
4859
|
-
for (const byte of NumberToBytes(value.charCodeAt(i))) {
|
|
4860
|
-
FNV1A64(byte);
|
|
4861
|
-
}
|
|
4862
|
-
}
|
|
4863
|
-
}
|
|
4864
|
-
function SymbolType(value) {
|
|
4865
|
-
FNV1A64(ByteMarker.Symbol);
|
|
4866
|
-
Visit4(value.description);
|
|
4867
|
-
}
|
|
4868
|
-
function Uint8ArrayType2(value) {
|
|
4869
|
-
FNV1A64(ByteMarker.Uint8Array);
|
|
4870
|
-
for (let i = 0; i < value.length; i++) {
|
|
4871
|
-
FNV1A64(value[i]);
|
|
4872
|
-
}
|
|
4873
|
-
}
|
|
4874
|
-
function UndefinedType(value) {
|
|
4875
|
-
return FNV1A64(ByteMarker.Undefined);
|
|
4876
|
-
}
|
|
4877
|
-
function Visit4(value) {
|
|
4878
|
-
if (IsArray4(value))
|
|
4879
|
-
return ArrayType2(value);
|
|
4880
|
-
if (IsBoolean4(value))
|
|
4881
|
-
return BooleanType(value);
|
|
4882
|
-
if (IsBigInt4(value))
|
|
4883
|
-
return BigIntType(value);
|
|
4884
|
-
if (IsDate4(value))
|
|
4885
|
-
return DateType2(value);
|
|
4886
|
-
if (IsNull4(value))
|
|
4887
|
-
return NullType(value);
|
|
4888
|
-
if (IsNumber4(value))
|
|
4889
|
-
return NumberType(value);
|
|
4890
|
-
if (IsStandardObject(value))
|
|
4891
|
-
return ObjectType2(value);
|
|
4892
|
-
if (IsString4(value))
|
|
4893
|
-
return StringType(value);
|
|
4894
|
-
if (IsSymbol4(value))
|
|
4895
|
-
return SymbolType(value);
|
|
4896
|
-
if (IsUint8Array4(value))
|
|
4897
|
-
return Uint8ArrayType2(value);
|
|
4898
|
-
if (IsUndefined4(value))
|
|
4899
|
-
return UndefinedType(value);
|
|
4900
|
-
throw new ValueHashError(value);
|
|
4901
|
-
}
|
|
4902
|
-
function FNV1A64(byte) {
|
|
4903
|
-
Accumulator = Accumulator ^ Bytes[byte];
|
|
4904
|
-
Accumulator = Accumulator * Prime % Size;
|
|
4905
|
-
}
|
|
4906
|
-
function Hash(value) {
|
|
4907
|
-
Accumulator = BigInt("14695981039346656037");
|
|
4908
|
-
Visit4(value);
|
|
4909
|
-
return Accumulator;
|
|
4910
|
-
}
|
|
4911
5174
|
|
|
4912
5175
|
// ../../node_modules/@sinclair/typebox/build/esm/errors/errors.mjs
|
|
4913
5176
|
var ValueErrorType;
|
|
@@ -4995,6 +5258,9 @@ var Delete3 = Object2({
|
|
|
4995
5258
|
});
|
|
4996
5259
|
var Edit = Union([Insert, Update, Delete3]);
|
|
4997
5260
|
|
|
5261
|
+
// ../state-manager/src/ActivityEventsManager.ts
|
|
5262
|
+
var import_observable = require("@noya-app/observable");
|
|
5263
|
+
|
|
4998
5264
|
// ../emitter/src/index.ts
|
|
4999
5265
|
var Emitter = class {
|
|
5000
5266
|
constructor(options = {}) {
|
|
@@ -5038,11 +5304,71 @@ var Emitter = class {
|
|
|
5038
5304
|
|
|
5039
5305
|
// ../state-manager/src/AIManager.ts
|
|
5040
5306
|
var import_noya_utils2 = require("@noya-app/noya-utils");
|
|
5041
|
-
var
|
|
5307
|
+
var import_observable2 = require("@noya-app/observable");
|
|
5042
5308
|
|
|
5043
5309
|
// ../state-manager/src/AssetManager.ts
|
|
5044
5310
|
var import_noya_utils3 = require("@noya-app/noya-utils");
|
|
5045
|
-
var
|
|
5311
|
+
var import_observable3 = require("@noya-app/observable");
|
|
5312
|
+
|
|
5313
|
+
// ../noya-schemas/src/nullable.ts
|
|
5314
|
+
var Nullable = (schema) => Type.Union([Type.Null(), schema]);
|
|
5315
|
+
|
|
5316
|
+
// ../noya-schemas/src/activityEventSchema.ts
|
|
5317
|
+
var userSelectSchema = Type.Object({
|
|
5318
|
+
id: Type.String(),
|
|
5319
|
+
name: Nullable(Type.String()),
|
|
5320
|
+
email: Nullable(Type.String()),
|
|
5321
|
+
image: Nullable(Type.String())
|
|
5322
|
+
});
|
|
5323
|
+
var workspaceSelectSchema = Type.Object({
|
|
5324
|
+
id: Type.String(),
|
|
5325
|
+
name: Type.String()
|
|
5326
|
+
});
|
|
5327
|
+
var fileSelectSchema = Type.Object({
|
|
5328
|
+
id: Type.String(),
|
|
5329
|
+
name: Nullable(Type.String())
|
|
5330
|
+
});
|
|
5331
|
+
var resourceSelectSchema = Type.Object({
|
|
5332
|
+
id: Type.String(),
|
|
5333
|
+
path: Type.String(),
|
|
5334
|
+
type: Type.Union([
|
|
5335
|
+
Type.Literal("asset"),
|
|
5336
|
+
Type.Literal("file"),
|
|
5337
|
+
Type.Literal("fileVersion"),
|
|
5338
|
+
Type.Literal("directory"),
|
|
5339
|
+
Type.Literal("resource")
|
|
5340
|
+
])
|
|
5341
|
+
});
|
|
5342
|
+
var siteSelectSchema = Type.Object({
|
|
5343
|
+
id: Type.String(),
|
|
5344
|
+
subdomain: Nullable(Type.String())
|
|
5345
|
+
});
|
|
5346
|
+
var activityEventSchema = Type.Object({
|
|
5347
|
+
id: Type.String(),
|
|
5348
|
+
createdAt: Type.String(),
|
|
5349
|
+
actorId: Nullable(Type.String()),
|
|
5350
|
+
actor: Type.Optional(userSelectSchema),
|
|
5351
|
+
type: Type.Union([
|
|
5352
|
+
Type.Literal("file"),
|
|
5353
|
+
Type.Literal("resource"),
|
|
5354
|
+
Type.Literal("site"),
|
|
5355
|
+
Type.Literal("snapshot"),
|
|
5356
|
+
Type.Literal("restore")
|
|
5357
|
+
]),
|
|
5358
|
+
workspaceId: Nullable(Type.String()),
|
|
5359
|
+
workspace: Type.Optional(workspaceSelectSchema),
|
|
5360
|
+
fileId: Nullable(Type.String()),
|
|
5361
|
+
file: Type.Optional(fileSelectSchema),
|
|
5362
|
+
fileVersionId: Nullable(Type.String()),
|
|
5363
|
+
resourceId: Nullable(Type.String()),
|
|
5364
|
+
resource: Type.Optional(resourceSelectSchema),
|
|
5365
|
+
siteId: Nullable(Type.String()),
|
|
5366
|
+
site: Type.Optional(siteSelectSchema),
|
|
5367
|
+
previousData: Nullable(Type.Any()),
|
|
5368
|
+
currentData: Nullable(Type.Any()),
|
|
5369
|
+
metadata: Nullable(Type.Any()),
|
|
5370
|
+
userAgent: Nullable(Type.String())
|
|
5371
|
+
});
|
|
5046
5372
|
|
|
5047
5373
|
// ../noya-schemas/src/asset.ts
|
|
5048
5374
|
var assetSchema = Type.Object({
|
|
@@ -5050,7 +5376,10 @@ var assetSchema = Type.Object({
|
|
|
5050
5376
|
url: Type.String(),
|
|
5051
5377
|
createdAt: Type.String(),
|
|
5052
5378
|
size: Type.Number(),
|
|
5053
|
-
contentType: Type.Optional(Type.String())
|
|
5379
|
+
contentType: Type.Optional(Type.String()),
|
|
5380
|
+
width: Type.Union([Type.Null(), Type.Number()]),
|
|
5381
|
+
height: Type.Union([Type.Null(), Type.Number()]),
|
|
5382
|
+
userId: Type.Union([Type.Null(), Type.String()])
|
|
5054
5383
|
});
|
|
5055
5384
|
|
|
5056
5385
|
// ../noya-schemas/src/encode.ts
|
|
@@ -5204,25 +5533,25 @@ var jsonSchema = Type.Recursive(
|
|
|
5204
5533
|
);
|
|
5205
5534
|
|
|
5206
5535
|
// ../noya-schemas/src/input.ts
|
|
5207
|
-
function
|
|
5536
|
+
function Nullable2(type) {
|
|
5208
5537
|
return Type.Union([type, Type.Null()], { default: null });
|
|
5209
5538
|
}
|
|
5210
5539
|
var inputSchemaBase = {
|
|
5211
5540
|
id: Type.String({ format: "uuid", default: "" }),
|
|
5212
5541
|
stableId: Type.String({ format: "uuid", default: "" }),
|
|
5213
5542
|
name: Type.String(),
|
|
5214
|
-
description:
|
|
5543
|
+
description: Nullable2(Type.String()),
|
|
5215
5544
|
required: Type.Boolean({ default: false })
|
|
5216
5545
|
};
|
|
5217
5546
|
var fileInputSchema = Type.Object({
|
|
5218
5547
|
...inputSchemaBase,
|
|
5219
5548
|
kind: Type.Literal("file"),
|
|
5220
|
-
toolId:
|
|
5549
|
+
toolId: Nullable2(Type.String())
|
|
5221
5550
|
});
|
|
5222
5551
|
var dataInputSchema = Type.Object({
|
|
5223
5552
|
...inputSchemaBase,
|
|
5224
5553
|
kind: Type.Literal("data"),
|
|
5225
|
-
schema:
|
|
5554
|
+
schema: Nullable2(jsonSchema)
|
|
5226
5555
|
});
|
|
5227
5556
|
var secretInputSchema = Type.Object({
|
|
5228
5557
|
...inputSchemaBase,
|
|
@@ -5232,7 +5561,7 @@ var secretInputSchema = Type.Object({
|
|
|
5232
5561
|
default: null
|
|
5233
5562
|
})
|
|
5234
5563
|
),
|
|
5235
|
-
authScope: Type.Optional(
|
|
5564
|
+
authScope: Type.Optional(Nullable2(Type.String()))
|
|
5236
5565
|
});
|
|
5237
5566
|
var inputSchema = Type.Union(
|
|
5238
5567
|
[fileInputSchema, dataInputSchema, secretInputSchema],
|
|
@@ -5278,6 +5607,94 @@ var SchemaTree = (0, import_tree_visit.defineTree)((schema) => {
|
|
|
5278
5607
|
}
|
|
5279
5608
|
});
|
|
5280
5609
|
|
|
5610
|
+
// ../noya-schemas/src/resourceSchema.ts
|
|
5611
|
+
var baseSchemaProperties = {
|
|
5612
|
+
id: Type.String(),
|
|
5613
|
+
stableId: Type.String(),
|
|
5614
|
+
path: Type.String(),
|
|
5615
|
+
createdAt: Type.String(),
|
|
5616
|
+
updatedAt: Type.String(),
|
|
5617
|
+
accessibleByFileId: Nullable(Type.String()),
|
|
5618
|
+
accessibleByFile: Type.Optional(
|
|
5619
|
+
Type.Object({
|
|
5620
|
+
id: Type.String(),
|
|
5621
|
+
name: Type.String(),
|
|
5622
|
+
toolId: Type.String()
|
|
5623
|
+
})
|
|
5624
|
+
),
|
|
5625
|
+
accessibleByFileVersionId: Nullable(Type.String()),
|
|
5626
|
+
url: Type.Optional(Type.String())
|
|
5627
|
+
};
|
|
5628
|
+
var uploadableAssetSchema = Type.Object({
|
|
5629
|
+
content: Type.String(),
|
|
5630
|
+
contentType: Type.String(),
|
|
5631
|
+
encoding: Type.Union([Type.Literal("utf-8"), Type.Literal("base64")])
|
|
5632
|
+
});
|
|
5633
|
+
var assetResourceSchema = Type.Object({
|
|
5634
|
+
...baseSchemaProperties,
|
|
5635
|
+
type: Type.Literal("asset"),
|
|
5636
|
+
assetId: Type.String()
|
|
5637
|
+
});
|
|
5638
|
+
var assetResourceCreateSchema = Type.Object({
|
|
5639
|
+
...baseSchemaProperties,
|
|
5640
|
+
type: Type.Literal("asset"),
|
|
5641
|
+
assetId: Type.Optional(Type.String()),
|
|
5642
|
+
asset: Type.Optional(uploadableAssetSchema)
|
|
5643
|
+
});
|
|
5644
|
+
var fileResourceSchema = Type.Object({
|
|
5645
|
+
...baseSchemaProperties,
|
|
5646
|
+
type: Type.Literal("file"),
|
|
5647
|
+
fileId: Type.String()
|
|
5648
|
+
});
|
|
5649
|
+
var directoryResourceSchema = Type.Object({
|
|
5650
|
+
...baseSchemaProperties,
|
|
5651
|
+
type: Type.Literal("directory")
|
|
5652
|
+
});
|
|
5653
|
+
var nestedResourceSchema = Type.Object({
|
|
5654
|
+
...baseSchemaProperties,
|
|
5655
|
+
type: Type.Literal("resource"),
|
|
5656
|
+
fileId: Type.String(),
|
|
5657
|
+
resourceId: Type.String()
|
|
5658
|
+
});
|
|
5659
|
+
var resourceSchema = Type.Union(
|
|
5660
|
+
[
|
|
5661
|
+
assetResourceSchema,
|
|
5662
|
+
fileResourceSchema,
|
|
5663
|
+
directoryResourceSchema,
|
|
5664
|
+
nestedResourceSchema
|
|
5665
|
+
],
|
|
5666
|
+
{
|
|
5667
|
+
discriminator: "type"
|
|
5668
|
+
}
|
|
5669
|
+
);
|
|
5670
|
+
var resourceCreateSchema = Type.Union(
|
|
5671
|
+
[
|
|
5672
|
+
assetResourceCreateSchema,
|
|
5673
|
+
fileResourceSchema,
|
|
5674
|
+
directoryResourceSchema,
|
|
5675
|
+
nestedResourceSchema
|
|
5676
|
+
],
|
|
5677
|
+
{
|
|
5678
|
+
discriminator: "type"
|
|
5679
|
+
}
|
|
5680
|
+
);
|
|
5681
|
+
var flatResourceSchema = Type.Object({
|
|
5682
|
+
...baseSchemaProperties,
|
|
5683
|
+
type: Type.Union([
|
|
5684
|
+
Type.Literal("asset"),
|
|
5685
|
+
Type.Literal("file"),
|
|
5686
|
+
Type.Literal("directory"),
|
|
5687
|
+
Type.Literal("resource")
|
|
5688
|
+
]),
|
|
5689
|
+
assetId: Nullable(Type.String()),
|
|
5690
|
+
fileId: Nullable(Type.String()),
|
|
5691
|
+
resourceId: Nullable(Type.String())
|
|
5692
|
+
});
|
|
5693
|
+
|
|
5694
|
+
// ../noya-schemas/src/resourceTree.ts
|
|
5695
|
+
var import_imfs = __toESM(require_lib2());
|
|
5696
|
+
var import_tree_visit2 = __toESM(require_lib());
|
|
5697
|
+
|
|
5281
5698
|
// ../noya-schemas/src/index.ts
|
|
5282
5699
|
function validateUUID(value) {
|
|
5283
5700
|
return /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(
|
|
@@ -5288,10 +5705,10 @@ format_exports.Set("color", () => true);
|
|
|
5288
5705
|
format_exports.Set("uuid", validateUUID);
|
|
5289
5706
|
|
|
5290
5707
|
// ../state-manager/src/ConnectedUsersManager.ts
|
|
5291
|
-
var
|
|
5708
|
+
var import_observable4 = require("@noya-app/observable");
|
|
5292
5709
|
|
|
5293
5710
|
// ../state-manager/src/ConnectionEventManager.ts
|
|
5294
|
-
var
|
|
5711
|
+
var import_observable5 = require("@noya-app/observable");
|
|
5295
5712
|
|
|
5296
5713
|
// ../../node_modules/mutative/dist/mutative.esm.mjs
|
|
5297
5714
|
var PROXY_DRAFT = Symbol.for("__MUTATIVE_PROXY_DRAFT__");
|
|
@@ -5345,7 +5762,7 @@ function isDraftable(value, options) {
|
|
|
5345
5762
|
let markResult;
|
|
5346
5763
|
return Object.getPrototypeOf(value) === Object.prototype || Array.isArray(value) || value instanceof Map || value instanceof Set || !!(options === null || options === void 0 ? void 0 : options.mark) && ((markResult = options.mark(value, dataTypes)) === dataTypes.immutable || typeof markResult === "function");
|
|
5347
5764
|
}
|
|
5348
|
-
function getPath(target,
|
|
5765
|
+
function getPath(target, path2 = []) {
|
|
5349
5766
|
if (Object.hasOwnProperty.call(target, "key")) {
|
|
5350
5767
|
const parentCopy = target.parent.copy;
|
|
5351
5768
|
const proxyDraft = getProxyDraft(get(parentCopy, target.key));
|
|
@@ -5356,18 +5773,18 @@ function getPath(target, path = []) {
|
|
|
5356
5773
|
const key = isSet ? Array.from(target.parent.setMap.keys()).indexOf(target.key) : target.key;
|
|
5357
5774
|
if (!(isSet && parentCopy.size > key || has(parentCopy, key)))
|
|
5358
5775
|
return null;
|
|
5359
|
-
|
|
5776
|
+
path2.push(key);
|
|
5360
5777
|
}
|
|
5361
5778
|
if (target.parent) {
|
|
5362
|
-
return getPath(target.parent,
|
|
5779
|
+
return getPath(target.parent, path2);
|
|
5363
5780
|
}
|
|
5364
|
-
|
|
5781
|
+
path2.reverse();
|
|
5365
5782
|
try {
|
|
5366
|
-
resolvePath(target.copy,
|
|
5783
|
+
resolvePath(target.copy, path2);
|
|
5367
5784
|
} catch (e) {
|
|
5368
5785
|
return null;
|
|
5369
5786
|
}
|
|
5370
|
-
return
|
|
5787
|
+
return path2;
|
|
5371
5788
|
}
|
|
5372
5789
|
function getType(target) {
|
|
5373
5790
|
if (Array.isArray(target))
|
|
@@ -5409,25 +5826,25 @@ function revokeProxy(proxyDraft) {
|
|
|
5409
5826
|
revoke();
|
|
5410
5827
|
}
|
|
5411
5828
|
}
|
|
5412
|
-
function escapePath(
|
|
5413
|
-
return pathAsArray ?
|
|
5829
|
+
function escapePath(path2, pathAsArray) {
|
|
5830
|
+
return pathAsArray ? path2 : [""].concat(path2).map((_item) => {
|
|
5414
5831
|
const item = `${_item}`;
|
|
5415
5832
|
if (item.indexOf("/") === -1 && item.indexOf("~") === -1)
|
|
5416
5833
|
return item;
|
|
5417
5834
|
return item.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
5418
5835
|
}).join("/");
|
|
5419
5836
|
}
|
|
5420
|
-
function unescapePath(
|
|
5421
|
-
if (Array.isArray(
|
|
5422
|
-
return
|
|
5423
|
-
return
|
|
5837
|
+
function unescapePath(path2) {
|
|
5838
|
+
if (Array.isArray(path2))
|
|
5839
|
+
return path2;
|
|
5840
|
+
return path2.split("/").map((_item) => _item.replace(/~1/g, "/").replace(/~0/g, "~")).slice(1);
|
|
5424
5841
|
}
|
|
5425
|
-
function resolvePath(base2,
|
|
5426
|
-
for (let index = 0; index <
|
|
5427
|
-
const key =
|
|
5842
|
+
function resolvePath(base2, path2) {
|
|
5843
|
+
for (let index = 0; index < path2.length - 1; index += 1) {
|
|
5844
|
+
const key = path2[index];
|
|
5428
5845
|
base2 = get(getType(base2) === 3 ? Array.from(base2) : base2, key);
|
|
5429
5846
|
if (typeof base2 !== "object") {
|
|
5430
|
-
throw new Error(`Cannot resolve patch at '${
|
|
5847
|
+
throw new Error(`Cannot resolve patch at '${path2.join("/")}'.`);
|
|
5431
5848
|
}
|
|
5432
5849
|
}
|
|
5433
5850
|
return base2;
|
|
@@ -5811,8 +6228,8 @@ function generateArrayPatches(proxyState, basePath, patches, inversePatches, pat
|
|
|
5811
6228
|
cloneIfNeeded,
|
|
5812
6229
|
concatPath: (segment) => {
|
|
5813
6230
|
const _path = basePath.concat([segment]);
|
|
5814
|
-
const
|
|
5815
|
-
return
|
|
6231
|
+
const path2 = escapePath(_path, pathAsArray);
|
|
6232
|
+
return path2;
|
|
5816
6233
|
},
|
|
5817
6234
|
basePath,
|
|
5818
6235
|
original,
|
|
@@ -5832,26 +6249,26 @@ function generateArrayPatches(proxyState, basePath, patches, inversePatches, pat
|
|
|
5832
6249
|
}
|
|
5833
6250
|
for (let index = 0; index < original.length; index += 1) {
|
|
5834
6251
|
if (assignedMap.get(index.toString()) && copy[index] !== original[index]) {
|
|
5835
|
-
const
|
|
6252
|
+
const path2 = params.concatPath(index);
|
|
5836
6253
|
patches.push({
|
|
5837
6254
|
op: Operation.Replace,
|
|
5838
|
-
path,
|
|
6255
|
+
path: path2,
|
|
5839
6256
|
// If it is a draft, it needs to be deep cloned, and it may also be non-draft.
|
|
5840
6257
|
value: params.cloneIfNeeded(copy[index])
|
|
5841
6258
|
});
|
|
5842
6259
|
inversePatches.push({
|
|
5843
6260
|
op: Operation.Replace,
|
|
5844
|
-
path,
|
|
6261
|
+
path: path2,
|
|
5845
6262
|
// If it is a draft, it needs to be deep cloned, and it may also be non-draft.
|
|
5846
6263
|
value: params.cloneIfNeeded(original[index])
|
|
5847
6264
|
});
|
|
5848
6265
|
}
|
|
5849
6266
|
}
|
|
5850
6267
|
for (let index = original.length; index < copy.length; index += 1) {
|
|
5851
|
-
const
|
|
6268
|
+
const path2 = params.concatPath(index);
|
|
5852
6269
|
patches.push({
|
|
5853
6270
|
op: Operation.Add,
|
|
5854
|
-
path,
|
|
6271
|
+
path: path2,
|
|
5855
6272
|
// If it is a draft, it needs to be deep cloned, and it may also be non-draft.
|
|
5856
6273
|
value: params.cloneIfNeeded(copy[index])
|
|
5857
6274
|
});
|
|
@@ -5859,18 +6276,18 @@ function generateArrayPatches(proxyState, basePath, patches, inversePatches, pat
|
|
|
5859
6276
|
if (original.length < copy.length) {
|
|
5860
6277
|
const { arrayLengthAssignment = true } = options.enablePatches;
|
|
5861
6278
|
if (arrayLengthAssignment) {
|
|
5862
|
-
const
|
|
6279
|
+
const path2 = params.concatPath("length");
|
|
5863
6280
|
inversePatches.push({
|
|
5864
6281
|
op: Operation.Replace,
|
|
5865
|
-
path,
|
|
6282
|
+
path: path2,
|
|
5866
6283
|
value: original.length
|
|
5867
6284
|
});
|
|
5868
6285
|
} else {
|
|
5869
6286
|
for (let index = copy.length; original.length < index; index -= 1) {
|
|
5870
|
-
const
|
|
6287
|
+
const path2 = params.concatPath(index - 1);
|
|
5871
6288
|
inversePatches.push({
|
|
5872
6289
|
op: Operation.Remove,
|
|
5873
|
-
path
|
|
6290
|
+
path: path2
|
|
5874
6291
|
});
|
|
5875
6292
|
}
|
|
5876
6293
|
}
|
|
@@ -5884,9 +6301,9 @@ function generatePatchesFromAssigned({ original, copy, assignedMap }, basePath,
|
|
|
5884
6301
|
if (isEqual(originalValue, value) && op === Operation.Replace)
|
|
5885
6302
|
return;
|
|
5886
6303
|
const _path = basePath.concat(key);
|
|
5887
|
-
const
|
|
5888
|
-
patches.push(op === Operation.Remove ? { op, path } : { op, path, value });
|
|
5889
|
-
inversePatches.push(op === Operation.Add ? { op: Operation.Remove, path } : op === Operation.Remove ? { op: Operation.Add, path, value: originalValue } : { op: Operation.Replace, path, value: originalValue });
|
|
6304
|
+
const path2 = escapePath(_path, pathAsArray);
|
|
6305
|
+
patches.push(op === Operation.Remove ? { op, path: path2 } : { op, path: path2, value });
|
|
6306
|
+
inversePatches.push(op === Operation.Add ? { op: Operation.Remove, path: path2 } : op === Operation.Remove ? { op: Operation.Add, path: path2, value: originalValue } : { op: Operation.Replace, path: path2, value: originalValue });
|
|
5890
6307
|
});
|
|
5891
6308
|
}
|
|
5892
6309
|
function generateSetPatches({ original, copy }, basePath, patches, inversePatches, pathAsArray) {
|
|
@@ -5894,15 +6311,15 @@ function generateSetPatches({ original, copy }, basePath, patches, inversePatche
|
|
|
5894
6311
|
original.forEach((value) => {
|
|
5895
6312
|
if (!copy.has(value)) {
|
|
5896
6313
|
const _path = basePath.concat([index]);
|
|
5897
|
-
const
|
|
6314
|
+
const path2 = escapePath(_path, pathAsArray);
|
|
5898
6315
|
patches.push({
|
|
5899
6316
|
op: Operation.Remove,
|
|
5900
|
-
path,
|
|
6317
|
+
path: path2,
|
|
5901
6318
|
value
|
|
5902
6319
|
});
|
|
5903
6320
|
inversePatches.unshift({
|
|
5904
6321
|
op: Operation.Add,
|
|
5905
|
-
path,
|
|
6322
|
+
path: path2,
|
|
5906
6323
|
value
|
|
5907
6324
|
});
|
|
5908
6325
|
}
|
|
@@ -5912,15 +6329,15 @@ function generateSetPatches({ original, copy }, basePath, patches, inversePatche
|
|
|
5912
6329
|
copy.forEach((value) => {
|
|
5913
6330
|
if (!original.has(value)) {
|
|
5914
6331
|
const _path = basePath.concat([index]);
|
|
5915
|
-
const
|
|
6332
|
+
const path2 = escapePath(_path, pathAsArray);
|
|
5916
6333
|
patches.push({
|
|
5917
6334
|
op: Operation.Add,
|
|
5918
|
-
path,
|
|
6335
|
+
path: path2,
|
|
5919
6336
|
value
|
|
5920
6337
|
});
|
|
5921
6338
|
inversePatches.unshift({
|
|
5922
6339
|
op: Operation.Remove,
|
|
5923
|
-
path,
|
|
6340
|
+
path: path2,
|
|
5924
6341
|
value
|
|
5925
6342
|
});
|
|
5926
6343
|
}
|
|
@@ -6601,11 +7018,11 @@ function applyPatchToString(str, patch) {
|
|
|
6601
7018
|
return str;
|
|
6602
7019
|
}
|
|
6603
7020
|
}
|
|
6604
|
-
function evaluatePointer(draft,
|
|
7021
|
+
function evaluatePointer(draft, path2) {
|
|
6605
7022
|
let base2 = draft;
|
|
6606
|
-
for (let index = 0; index <
|
|
7023
|
+
for (let index = 0; index < path2.length - 1; index += 1) {
|
|
6607
7024
|
const parentType = getType(base2);
|
|
6608
|
-
let key =
|
|
7025
|
+
let key = path2[index];
|
|
6609
7026
|
if (typeof key !== "string" && typeof key !== "number") {
|
|
6610
7027
|
key = String(key);
|
|
6611
7028
|
}
|
|
@@ -6614,7 +7031,7 @@ function evaluatePointer(draft, path) {
|
|
|
6614
7031
|
}
|
|
6615
7032
|
base2 = get(parentType === 3 ? Array.from(base2) : base2, key);
|
|
6616
7033
|
if (typeof base2 !== "object" && typeof base2 !== "string") {
|
|
6617
|
-
throw new Error(`Cannot apply patch at '${
|
|
7034
|
+
throw new Error(`Cannot apply patch at '${path2.join("/")}'.`);
|
|
6618
7035
|
}
|
|
6619
7036
|
}
|
|
6620
7037
|
return base2;
|
|
@@ -6622,12 +7039,12 @@ function evaluatePointer(draft, path) {
|
|
|
6622
7039
|
function apply(state, patches, applyOptions) {
|
|
6623
7040
|
let i;
|
|
6624
7041
|
for (i = patches.length - 1; i >= 0; i -= 1) {
|
|
6625
|
-
const { value, op, path, from } = patches[i];
|
|
6626
|
-
if (!
|
|
7042
|
+
const { value, op, path: path2, from } = patches[i];
|
|
7043
|
+
if (!path2.length && op === Operation.Replace || path2 === "" && op === Operation.Add) {
|
|
6627
7044
|
state = value;
|
|
6628
7045
|
break;
|
|
6629
7046
|
}
|
|
6630
|
-
if (!
|
|
7047
|
+
if (!path2.length && op === Operation.Move) {
|
|
6631
7048
|
const fromPath = unescapePath(from);
|
|
6632
7049
|
const fromBase = evaluatePointer(state, fromPath);
|
|
6633
7050
|
const fromKey = fromPath[fromPath.length - 1];
|
|
@@ -6642,12 +7059,12 @@ function apply(state, patches, applyOptions) {
|
|
|
6642
7059
|
const mutate2 = (draft) => {
|
|
6643
7060
|
patches.forEach((patch) => {
|
|
6644
7061
|
const { path: _path, from: _fromPath, op } = patch;
|
|
6645
|
-
const
|
|
6646
|
-
let base2 = evaluatePointer(draft,
|
|
7062
|
+
const path2 = unescapePath(_path);
|
|
7063
|
+
let base2 = evaluatePointer(draft, path2);
|
|
6647
7064
|
if (typeof base2 === "string") {
|
|
6648
|
-
const parentPath =
|
|
7065
|
+
const parentPath = path2.slice(0, -1);
|
|
6649
7066
|
const parent = evaluatePointer(draft, parentPath);
|
|
6650
|
-
const key2 =
|
|
7067
|
+
const key2 = path2[path2.length - 2];
|
|
6651
7068
|
if (key2 === void 0) {
|
|
6652
7069
|
return;
|
|
6653
7070
|
}
|
|
@@ -6656,7 +7073,7 @@ function apply(state, patches, applyOptions) {
|
|
|
6656
7073
|
}
|
|
6657
7074
|
const type = getType(base2);
|
|
6658
7075
|
const value = deepClone(patch.value);
|
|
6659
|
-
const key =
|
|
7076
|
+
const key = path2[path2.length - 1];
|
|
6660
7077
|
switch (op) {
|
|
6661
7078
|
case Operation.Move: {
|
|
6662
7079
|
const fromPath = unescapePath(_fromPath);
|
|
@@ -6667,7 +7084,7 @@ function apply(state, patches, applyOptions) {
|
|
|
6667
7084
|
return;
|
|
6668
7085
|
}
|
|
6669
7086
|
const fromValue = deepClone(fromBase[fromKey]);
|
|
6670
|
-
if (
|
|
7087
|
+
if (path2.length === 0) {
|
|
6671
7088
|
return;
|
|
6672
7089
|
}
|
|
6673
7090
|
if (fromBase === base2 && fromType === 1 && type === 1) {
|
|
@@ -6957,19 +7374,19 @@ var HistoryEntries;
|
|
|
6957
7374
|
if (a.length !== b.length) {
|
|
6958
7375
|
return false;
|
|
6959
7376
|
}
|
|
6960
|
-
return a.every((
|
|
7377
|
+
return a.every((path2, index) => {
|
|
6961
7378
|
const other = b[index];
|
|
6962
|
-
if (typeof
|
|
6963
|
-
return
|
|
7379
|
+
if (typeof path2 === "object" && "id" in path2 && typeof other === "object" && "id" in other) {
|
|
7380
|
+
return path2.id === other.id;
|
|
6964
7381
|
}
|
|
6965
|
-
return
|
|
7382
|
+
return path2 === other;
|
|
6966
7383
|
});
|
|
6967
7384
|
}
|
|
6968
7385
|
HistoryEntries2.pathsEqual = pathsEqual;
|
|
6969
7386
|
})(HistoryEntries || (HistoryEntries = {}));
|
|
6970
7387
|
|
|
6971
7388
|
// ../state-manager/src/IOManager.ts
|
|
6972
|
-
var
|
|
7389
|
+
var import_observable6 = require("@noya-app/observable");
|
|
6973
7390
|
|
|
6974
7391
|
// ../state-manager/src/jwt.ts
|
|
6975
7392
|
function base64UrlEncode(str) {
|
|
@@ -7071,24 +7488,24 @@ var jwt;
|
|
|
7071
7488
|
})(jwt || (jwt = {}));
|
|
7072
7489
|
|
|
7073
7490
|
// ../state-manager/src/MenuManager.ts
|
|
7074
|
-
var
|
|
7491
|
+
var import_observable7 = require("@noya-app/observable");
|
|
7075
7492
|
|
|
7076
7493
|
// ../state-manager/src/multiplayer.ts
|
|
7077
7494
|
var import_noya_utils5 = require("@noya-app/noya-utils");
|
|
7078
|
-
var
|
|
7495
|
+
var import_observable9 = require("@noya-app/observable");
|
|
7079
7496
|
|
|
7080
7497
|
// ../state-manager/src/stateManager.ts
|
|
7081
|
-
var
|
|
7498
|
+
var import_observable8 = require("@noya-app/observable");
|
|
7082
7499
|
|
|
7083
7500
|
// ../state-manager/src/multiplayer.ts
|
|
7084
|
-
var createHash =
|
|
7501
|
+
var createHash = (value, options) => (0, import_noya_utils5.hash)(value, { ...options, ignoreUndefinedProperties: true });
|
|
7085
7502
|
|
|
7086
7503
|
// ../state-manager/src/NoyaManager.ts
|
|
7087
|
-
var
|
|
7088
|
-
var
|
|
7504
|
+
var import_noya_utils9 = require("@noya-app/noya-utils");
|
|
7505
|
+
var import_observable17 = require("@noya-app/observable");
|
|
7089
7506
|
|
|
7090
7507
|
// ../noya-pipeline/src/graphToTasks.ts
|
|
7091
|
-
var
|
|
7508
|
+
var import_observable10 = require("@noya-app/observable");
|
|
7092
7509
|
|
|
7093
7510
|
// ../noya-pipeline/src/state.ts
|
|
7094
7511
|
var import_noya_utils6 = require("@noya-app/noya-utils");
|
|
@@ -7190,20 +7607,24 @@ var pipelineSchema = Type.Object(
|
|
|
7190
7607
|
);
|
|
7191
7608
|
|
|
7192
7609
|
// ../state-manager/src/PipelineManager.ts
|
|
7193
|
-
var
|
|
7610
|
+
var import_observable11 = require("@noya-app/observable");
|
|
7194
7611
|
|
|
7195
7612
|
// ../state-manager/src/PublishingManager.ts
|
|
7196
|
-
var
|
|
7613
|
+
var import_observable12 = require("@noya-app/observable");
|
|
7197
7614
|
|
|
7198
|
-
// ../state-manager/src/
|
|
7615
|
+
// ../state-manager/src/ResourceManager.ts
|
|
7199
7616
|
var import_noya_utils7 = require("@noya-app/noya-utils");
|
|
7200
|
-
var
|
|
7617
|
+
var import_observable13 = require("@noya-app/observable");
|
|
7618
|
+
|
|
7619
|
+
// ../state-manager/src/rpcManager.ts
|
|
7620
|
+
var import_noya_utils8 = require("@noya-app/noya-utils");
|
|
7621
|
+
var import_observable14 = require("@noya-app/observable");
|
|
7201
7622
|
|
|
7202
7623
|
// ../state-manager/src/SecretManager.ts
|
|
7203
|
-
var
|
|
7624
|
+
var import_observable15 = require("@noya-app/observable");
|
|
7204
7625
|
|
|
7205
7626
|
// ../state-manager/src/TaskManager.ts
|
|
7206
|
-
var
|
|
7627
|
+
var import_observable16 = require("@noya-app/observable");
|
|
7207
7628
|
|
|
7208
7629
|
// ../state-manager/src/NoyaManager.ts
|
|
7209
7630
|
var createMutatorParametersSchema = Type.Object({
|
|
@@ -7320,16 +7741,16 @@ for (code in base) if (!shift.hasOwnProperty(code)) shift[code] = base[code];
|
|
|
7320
7741
|
var code;
|
|
7321
7742
|
|
|
7322
7743
|
// ../state-manager/src/menuTree.ts
|
|
7323
|
-
var
|
|
7324
|
-
var MenuItemTree = (0,
|
|
7744
|
+
var import_tree_visit3 = __toESM(require_lib());
|
|
7745
|
+
var MenuItemTree = (0, import_tree_visit3.defineTree)((node) => {
|
|
7325
7746
|
return node.type === "submenu" ? node.items : [];
|
|
7326
7747
|
});
|
|
7327
7748
|
|
|
7328
7749
|
// ../noya-multiplayer-react/src/ai.ts
|
|
7329
|
-
var
|
|
7750
|
+
var import_react59 = require("react");
|
|
7330
7751
|
|
|
7331
7752
|
// ../noya-multiplayer-react/src/NoyaStateContext.tsx
|
|
7332
|
-
var
|
|
7753
|
+
var import_observable18 = require("@noya-app/observable");
|
|
7333
7754
|
|
|
7334
7755
|
// ../noya-react-utils/src/components/AutoSizer.tsx
|
|
7335
7756
|
var React2 = __toESM(require("react"));
|
|
@@ -7511,11 +7932,22 @@ var FileDropTarget = memoGeneric(function FileDropTarget2({ children, onDropFile
|
|
|
7511
7932
|
var import_react8 = require("react");
|
|
7512
7933
|
|
|
7513
7934
|
// ../noya-react-utils/src/hooks/useDeepArray.ts
|
|
7514
|
-
var
|
|
7935
|
+
var import_noya_utils10 = require("@noya-app/noya-utils");
|
|
7515
7936
|
var import_react9 = require("react");
|
|
7937
|
+
function useJsonMemo(value) {
|
|
7938
|
+
const stringified = (0, import_react9.useMemo)(
|
|
7939
|
+
() => value === void 0 ? void 0 : JSON.stringify(value),
|
|
7940
|
+
[value]
|
|
7941
|
+
);
|
|
7942
|
+
const parsed = (0, import_react9.useMemo)(
|
|
7943
|
+
() => stringified === void 0 ? void 0 : JSON.parse(stringified),
|
|
7944
|
+
[stringified]
|
|
7945
|
+
);
|
|
7946
|
+
return parsed;
|
|
7947
|
+
}
|
|
7516
7948
|
|
|
7517
7949
|
// ../noya-react-utils/src/hooks/useDeepState.ts
|
|
7518
|
-
var
|
|
7950
|
+
var import_noya_utils11 = require("@noya-app/noya-utils");
|
|
7519
7951
|
var import_react10 = require("react");
|
|
7520
7952
|
|
|
7521
7953
|
// ../noya-react-utils/src/hooks/useFetch.ts
|
|
@@ -7546,7 +7978,7 @@ var import_react17 = require("react");
|
|
|
7546
7978
|
var import_react18 = require("react");
|
|
7547
7979
|
|
|
7548
7980
|
// ../noya-react-utils/src/hooks/useShallowArray.ts
|
|
7549
|
-
var
|
|
7981
|
+
var import_noya_utils12 = require("@noya-app/noya-utils");
|
|
7550
7982
|
var import_react19 = require("react");
|
|
7551
7983
|
|
|
7552
7984
|
// ../noya-react-utils/src/hooks/useStableCallback.ts
|
|
@@ -7556,7 +7988,7 @@ var import_react20 = require("react");
|
|
|
7556
7988
|
var import_react21 = require("react");
|
|
7557
7989
|
|
|
7558
7990
|
// ../noya-react-utils/src/hooks/useUrlHashParameters.ts
|
|
7559
|
-
var
|
|
7991
|
+
var import_noya_utils13 = require("@noya-app/noya-utils");
|
|
7560
7992
|
var import_react22 = require("react");
|
|
7561
7993
|
|
|
7562
7994
|
// ../noya-react-utils/src/hooks/useWindowSize.ts
|
|
@@ -7619,13 +8051,13 @@ function downloadBlob(...params) {
|
|
|
7619
8051
|
}
|
|
7620
8052
|
|
|
7621
8053
|
// ../noya-multiplayer-react/src/NoyaStateContext.tsx
|
|
7622
|
-
var
|
|
8054
|
+
var import_react58 = __toESM(require("react"));
|
|
7623
8055
|
|
|
7624
8056
|
// ../noya-multiplayer-react/src/noyaApp.ts
|
|
7625
|
-
var
|
|
8057
|
+
var import_react57 = require("react");
|
|
7626
8058
|
|
|
7627
8059
|
// ../noya-multiplayer-react/src/hooks.ts
|
|
7628
|
-
var
|
|
8060
|
+
var import_react56 = require("react");
|
|
7629
8061
|
var import_client2 = require("react-dom/client");
|
|
7630
8062
|
|
|
7631
8063
|
// ../noya-multiplayer-react/src/components/ErrorOverlay.tsx
|
|
@@ -7703,11 +8135,12 @@ var ErrorOverlay = React6.memo(function ErrorOverlay2({
|
|
|
7703
8135
|
});
|
|
7704
8136
|
|
|
7705
8137
|
// ../noya-multiplayer-react/src/inspector/useStateInspector.tsx
|
|
7706
|
-
var
|
|
8138
|
+
var import_react55 = __toESM(require("react"));
|
|
7707
8139
|
var import_client = require("react-dom/client");
|
|
7708
8140
|
|
|
7709
8141
|
// ../noya-multiplayer-react/src/inspector/StateInspector.tsx
|
|
7710
|
-
var
|
|
8142
|
+
var import_noya_utils14 = require("@noya-app/noya-utils");
|
|
8143
|
+
var import_react54 = __toESM(require("react"));
|
|
7711
8144
|
|
|
7712
8145
|
// ../../node_modules/react-inspector/dist/index.mjs
|
|
7713
8146
|
var import_react24 = __toESM(require("react"), 1);
|
|
@@ -8204,7 +8637,7 @@ var wildcardPathsFromLevel = (level) => {
|
|
|
8204
8637
|
return Array.from({ length: level }, (_, i) => [DEFAULT_ROOT_PATH].concat(Array.from({ length: i }, () => "*")).join("."));
|
|
8205
8638
|
};
|
|
8206
8639
|
var getExpandedPaths = (data, dataIterator, expandPaths, expandLevel, prevExpandedPaths) => {
|
|
8207
|
-
const wildcardPaths = [].concat(wildcardPathsFromLevel(expandLevel)).concat(expandPaths).filter((
|
|
8640
|
+
const wildcardPaths = [].concat(wildcardPathsFromLevel(expandLevel)).concat(expandPaths).filter((path2) => typeof path2 === "string");
|
|
8208
8641
|
const expandedPaths = [];
|
|
8209
8642
|
wildcardPaths.forEach((wildcardPath) => {
|
|
8210
8643
|
const keyPaths = wildcardPath.split(".");
|
|
@@ -8235,20 +8668,20 @@ var getExpandedPaths = (data, dataIterator, expandPaths, expandLevel, prevExpand
|
|
|
8235
8668
|
};
|
|
8236
8669
|
populatePaths(data, "", 0);
|
|
8237
8670
|
});
|
|
8238
|
-
return expandedPaths.reduce((obj,
|
|
8239
|
-
obj[
|
|
8671
|
+
return expandedPaths.reduce((obj, path2) => {
|
|
8672
|
+
obj[path2] = true;
|
|
8240
8673
|
return obj;
|
|
8241
8674
|
}, { ...prevExpandedPaths });
|
|
8242
8675
|
};
|
|
8243
8676
|
var ConnectedTreeNode = (0, import_react25.memo)((props) => {
|
|
8244
|
-
const { data, dataIterator, path, depth, nodeRenderer } = props;
|
|
8677
|
+
const { data, dataIterator, path: path2, depth, nodeRenderer } = props;
|
|
8245
8678
|
const [expandedPaths, setExpandedPaths] = (0, import_react25.useContext)(ExpandedPathsContext);
|
|
8246
8679
|
const nodeHasChildNodes = hasChildNodes(data, dataIterator);
|
|
8247
|
-
const expanded = !!expandedPaths[
|
|
8680
|
+
const expanded = !!expandedPaths[path2];
|
|
8248
8681
|
const handleClick = (0, import_react25.useCallback)(() => nodeHasChildNodes && setExpandedPaths((prevExpandedPaths) => ({
|
|
8249
8682
|
...prevExpandedPaths,
|
|
8250
|
-
[
|
|
8251
|
-
})), [nodeHasChildNodes, setExpandedPaths,
|
|
8683
|
+
[path2]: !expanded
|
|
8684
|
+
})), [nodeHasChildNodes, setExpandedPaths, path2, expanded]);
|
|
8252
8685
|
return /* @__PURE__ */ import_react25.default.createElement(TreeNode, {
|
|
8253
8686
|
expanded,
|
|
8254
8687
|
onClick: handleClick,
|
|
@@ -8261,7 +8694,7 @@ var ConnectedTreeNode = (0, import_react25.memo)((props) => {
|
|
|
8261
8694
|
name,
|
|
8262
8695
|
data: data2,
|
|
8263
8696
|
depth: depth + 1,
|
|
8264
|
-
path: `${
|
|
8697
|
+
path: `${path2}.${name}`,
|
|
8265
8698
|
key: name,
|
|
8266
8699
|
dataIterator,
|
|
8267
8700
|
nodeRenderer,
|
|
@@ -8960,39 +9393,47 @@ var getStateInspectorBorderColor = (colorScheme) => {
|
|
|
8960
9393
|
return colorScheme === "light" ? "rgb(223 223 223)" : "rgb(29 29 29)";
|
|
8961
9394
|
};
|
|
8962
9395
|
|
|
8963
|
-
// ../noya-multiplayer-react/src/inspector/sections/
|
|
9396
|
+
// ../noya-multiplayer-react/src/inspector/sections/ActivityEventsSection.tsx
|
|
8964
9397
|
var import_react47 = __toESM(require("react"));
|
|
8965
9398
|
|
|
8966
|
-
// ../noya-multiplayer-react/src/inspector/
|
|
9399
|
+
// ../noya-multiplayer-react/src/inspector/StateInspectorButton.tsx
|
|
8967
9400
|
var import_react43 = __toESM(require("react"));
|
|
8968
|
-
|
|
8969
|
-
|
|
8970
|
-
|
|
8971
|
-
|
|
8972
|
-
|
|
8973
|
-
|
|
8974
|
-
|
|
8975
|
-
|
|
8976
|
-
|
|
8977
|
-
|
|
8978
|
-
|
|
8979
|
-
|
|
8980
|
-
|
|
8981
|
-
|
|
8982
|
-
|
|
8983
|
-
display: "inline-flex",
|
|
8984
|
-
justifyContent: "center",
|
|
8985
|
-
alignItems: "center",
|
|
8986
|
-
marginRight: 4,
|
|
8987
|
-
lineHeight: "12px"
|
|
8988
|
-
}
|
|
9401
|
+
function StateInspectorButton({
|
|
9402
|
+
children,
|
|
9403
|
+
onClick,
|
|
9404
|
+
style: style2,
|
|
9405
|
+
theme: theme3,
|
|
9406
|
+
disabled
|
|
9407
|
+
}) {
|
|
9408
|
+
return /* @__PURE__ */ import_react43.default.createElement(
|
|
9409
|
+
"button",
|
|
9410
|
+
{
|
|
9411
|
+
type: "button",
|
|
9412
|
+
disabled,
|
|
9413
|
+
onClick: (event) => {
|
|
9414
|
+
event.stopPropagation();
|
|
9415
|
+
onClick();
|
|
8989
9416
|
},
|
|
8990
|
-
|
|
8991
|
-
|
|
8992
|
-
|
|
8993
|
-
|
|
8994
|
-
|
|
8995
|
-
|
|
9417
|
+
style: {
|
|
9418
|
+
flex: "0",
|
|
9419
|
+
appearance: "none",
|
|
9420
|
+
background: "none",
|
|
9421
|
+
color: theme3.BASE_COLOR,
|
|
9422
|
+
opacity: disabled ? 0.25 : 1,
|
|
9423
|
+
border: "none",
|
|
9424
|
+
fontSize: "12px",
|
|
9425
|
+
whiteSpace: "nowrap",
|
|
9426
|
+
display: "inline-flex",
|
|
9427
|
+
alignItems: "center",
|
|
9428
|
+
justifyContent: "center",
|
|
9429
|
+
padding: "0",
|
|
9430
|
+
cursor: "pointer",
|
|
9431
|
+
...style2
|
|
9432
|
+
}
|
|
9433
|
+
},
|
|
9434
|
+
children
|
|
9435
|
+
);
|
|
9436
|
+
}
|
|
8996
9437
|
|
|
8997
9438
|
// ../noya-multiplayer-react/src/inspector/StateInspectorDisclosureSection.tsx
|
|
8998
9439
|
var import_react45 = __toESM(require("react"));
|
|
@@ -9138,6 +9579,137 @@ function StateInspectorRow({
|
|
|
9138
9579
|
);
|
|
9139
9580
|
}
|
|
9140
9581
|
|
|
9582
|
+
// ../noya-multiplayer-react/src/inspector/sections/ActivityEventsSection.tsx
|
|
9583
|
+
function isResourceStreamFilter(streamFilter) {
|
|
9584
|
+
return typeof streamFilter === "object" && "resourceId" in streamFilter;
|
|
9585
|
+
}
|
|
9586
|
+
function isResourceActivityEvent(activityEvent) {
|
|
9587
|
+
return typeof activityEvent === "object" && activityEvent !== null && "type" in activityEvent && activityEvent.type === "resource" && "resourceId" in activityEvent && typeof activityEvent.resourceId === "string";
|
|
9588
|
+
}
|
|
9589
|
+
function ActivityEventsSection({
|
|
9590
|
+
showEvents,
|
|
9591
|
+
setShowEvents,
|
|
9592
|
+
colorScheme,
|
|
9593
|
+
activityEventsContainerRef,
|
|
9594
|
+
activityEventsManager
|
|
9595
|
+
}) {
|
|
9596
|
+
const [streamFilter, setStreamFilter] = (0, import_react47.useState)("all");
|
|
9597
|
+
const streamFilterType = isResourceStreamFilter(streamFilter) ? "resource" : "all";
|
|
9598
|
+
const theme3 = getStateInspectorTheme(colorScheme);
|
|
9599
|
+
const activityEvents = useActivityEventsForManager(
|
|
9600
|
+
showEvents ? streamFilter : void 0,
|
|
9601
|
+
activityEventsManager
|
|
9602
|
+
);
|
|
9603
|
+
return /* @__PURE__ */ import_react47.default.createElement(
|
|
9604
|
+
StateInspectorDisclosureSection,
|
|
9605
|
+
{
|
|
9606
|
+
open: showEvents,
|
|
9607
|
+
setOpen: setShowEvents,
|
|
9608
|
+
title: `Activity Events`,
|
|
9609
|
+
colorScheme
|
|
9610
|
+
},
|
|
9611
|
+
/* @__PURE__ */ import_react47.default.createElement(StateInspectorDisclosureRowInner, { ref: activityEventsContainerRef }, /* @__PURE__ */ import_react47.default.createElement("div", { style: { padding: "4px 12px", display: "flex", gap: "4px" } }, /* @__PURE__ */ import_react47.default.createElement(
|
|
9612
|
+
"select",
|
|
9613
|
+
{
|
|
9614
|
+
name: "streamFilterType",
|
|
9615
|
+
value: streamFilterType,
|
|
9616
|
+
style: { flex: "0 0 auto", height: "19px" },
|
|
9617
|
+
onChange: (e) => {
|
|
9618
|
+
const value = e.target.value;
|
|
9619
|
+
if (value === "all") {
|
|
9620
|
+
setStreamFilter("all");
|
|
9621
|
+
} else {
|
|
9622
|
+
setStreamFilter({ resourceId: "" });
|
|
9623
|
+
}
|
|
9624
|
+
}
|
|
9625
|
+
},
|
|
9626
|
+
/* @__PURE__ */ import_react47.default.createElement("option", { value: "all" }, "All"),
|
|
9627
|
+
/* @__PURE__ */ import_react47.default.createElement("option", { value: "resource" }, "Resource")
|
|
9628
|
+
), isResourceStreamFilter(streamFilter) && /* @__PURE__ */ import_react47.default.createElement(
|
|
9629
|
+
"input",
|
|
9630
|
+
{
|
|
9631
|
+
name: "resourceId",
|
|
9632
|
+
type: "text",
|
|
9633
|
+
placeholder: "Resource ID",
|
|
9634
|
+
value: streamFilter.resourceId,
|
|
9635
|
+
style: {
|
|
9636
|
+
flex: "1 1 auto",
|
|
9637
|
+
height: "19px",
|
|
9638
|
+
padding: "0px 4px",
|
|
9639
|
+
boxSizing: "border-box"
|
|
9640
|
+
},
|
|
9641
|
+
onChange: (e) => setStreamFilter({ ...streamFilter, resourceId: e.target.value })
|
|
9642
|
+
}
|
|
9643
|
+
)), activityEvents?.map((activityEvent, index) => /* @__PURE__ */ import_react47.default.createElement(
|
|
9644
|
+
StateInspectorRow,
|
|
9645
|
+
{
|
|
9646
|
+
key: index,
|
|
9647
|
+
colorScheme,
|
|
9648
|
+
style: {
|
|
9649
|
+
padding: "0px 12px 1px"
|
|
9650
|
+
}
|
|
9651
|
+
},
|
|
9652
|
+
/* @__PURE__ */ import_react47.default.createElement(themedObjectInspector, { data: activityEvent, theme: theme3 }),
|
|
9653
|
+
streamFilterType === "all" && isResourceActivityEvent(activityEvent) && /* @__PURE__ */ import_react47.default.createElement(
|
|
9654
|
+
StateInspectorButton,
|
|
9655
|
+
{
|
|
9656
|
+
theme: theme3,
|
|
9657
|
+
onClick: () => {
|
|
9658
|
+
setStreamFilter({ resourceId: activityEvent.resourceId });
|
|
9659
|
+
}
|
|
9660
|
+
},
|
|
9661
|
+
"Watch this resource"
|
|
9662
|
+
)
|
|
9663
|
+
)), !activityEvents && /* @__PURE__ */ import_react47.default.createElement(
|
|
9664
|
+
"div",
|
|
9665
|
+
{
|
|
9666
|
+
style: {
|
|
9667
|
+
padding: "12px",
|
|
9668
|
+
fontSize: "12px",
|
|
9669
|
+
display: "flex",
|
|
9670
|
+
flexDirection: "column",
|
|
9671
|
+
gap: "4px"
|
|
9672
|
+
}
|
|
9673
|
+
},
|
|
9674
|
+
/* @__PURE__ */ import_react47.default.createElement("span", null, "No activity events")
|
|
9675
|
+
))
|
|
9676
|
+
);
|
|
9677
|
+
}
|
|
9678
|
+
|
|
9679
|
+
// ../noya-multiplayer-react/src/inspector/sections/EventsSection.tsx
|
|
9680
|
+
var import_react49 = __toESM(require("react"));
|
|
9681
|
+
|
|
9682
|
+
// ../noya-multiplayer-react/src/inspector/ObjectRootLabel.tsx
|
|
9683
|
+
var import_react48 = __toESM(require("react"));
|
|
9684
|
+
var ObjectRootLabel2 = ({ name, data, direction }) => {
|
|
9685
|
+
if (typeof name === "string") {
|
|
9686
|
+
return /* @__PURE__ */ import_react48.default.createElement("span", null, /* @__PURE__ */ import_react48.default.createElement(ObjectName, { name }), /* @__PURE__ */ import_react48.default.createElement("span", null, ": "), /* @__PURE__ */ import_react48.default.createElement(ObjectPreview, { data }));
|
|
9687
|
+
}
|
|
9688
|
+
if (direction === "up" || direction === "down") {
|
|
9689
|
+
const arrow = direction === "up" ? "\u2191" : "\u2193";
|
|
9690
|
+
return /* @__PURE__ */ import_react48.default.createElement("span", null, /* @__PURE__ */ import_react48.default.createElement(
|
|
9691
|
+
"span",
|
|
9692
|
+
{
|
|
9693
|
+
style: {
|
|
9694
|
+
background: direction === "up" ? "rgba(0,255,0,0.2)" : "rgba(255,0,0,0.2)",
|
|
9695
|
+
// color: "white",
|
|
9696
|
+
width: 12,
|
|
9697
|
+
height: 12,
|
|
9698
|
+
borderRadius: 2,
|
|
9699
|
+
display: "inline-flex",
|
|
9700
|
+
justifyContent: "center",
|
|
9701
|
+
alignItems: "center",
|
|
9702
|
+
marginRight: 4,
|
|
9703
|
+
lineHeight: "12px"
|
|
9704
|
+
}
|
|
9705
|
+
},
|
|
9706
|
+
arrow
|
|
9707
|
+
), /* @__PURE__ */ import_react48.default.createElement(ObjectPreview, { data }));
|
|
9708
|
+
} else {
|
|
9709
|
+
return /* @__PURE__ */ import_react48.default.createElement(ObjectPreview, { data });
|
|
9710
|
+
}
|
|
9711
|
+
};
|
|
9712
|
+
|
|
9141
9713
|
// ../noya-multiplayer-react/src/inspector/sections/EventsSection.tsx
|
|
9142
9714
|
function EventsSection({
|
|
9143
9715
|
showEvents,
|
|
@@ -9147,7 +9719,7 @@ function EventsSection({
|
|
|
9147
9719
|
connectionEvents
|
|
9148
9720
|
}) {
|
|
9149
9721
|
const theme3 = getStateInspectorTheme(colorScheme);
|
|
9150
|
-
return /* @__PURE__ */
|
|
9722
|
+
return /* @__PURE__ */ import_react49.default.createElement(
|
|
9151
9723
|
StateInspectorDisclosureSection,
|
|
9152
9724
|
{
|
|
9153
9725
|
open: showEvents,
|
|
@@ -9155,8 +9727,8 @@ function EventsSection({
|
|
|
9155
9727
|
title: "Events",
|
|
9156
9728
|
colorScheme
|
|
9157
9729
|
},
|
|
9158
|
-
/* @__PURE__ */
|
|
9159
|
-
(event, index) => event.type === "stateChange" ? /* @__PURE__ */
|
|
9730
|
+
/* @__PURE__ */ import_react49.default.createElement(StateInspectorDisclosureRowInner, { ref: eventsContainerRef }, connectionEvents?.map(
|
|
9731
|
+
(event, index) => event.type === "stateChange" ? /* @__PURE__ */ import_react49.default.createElement(StateInspectorRow, { key: index, colorScheme }, "connection:", " ", /* @__PURE__ */ import_react49.default.createElement("span", { style: { fontStyle: "italic" } }, event.state.toLowerCase())) : /* @__PURE__ */ import_react49.default.createElement(
|
|
9160
9732
|
StateInspectorRow,
|
|
9161
9733
|
{
|
|
9162
9734
|
key: index,
|
|
@@ -9166,14 +9738,14 @@ function EventsSection({
|
|
|
9166
9738
|
padding: "0px 12px 1px"
|
|
9167
9739
|
}
|
|
9168
9740
|
},
|
|
9169
|
-
/* @__PURE__ */
|
|
9741
|
+
/* @__PURE__ */ import_react49.default.createElement(
|
|
9170
9742
|
themedObjectInspector,
|
|
9171
9743
|
{
|
|
9172
9744
|
data: event.type === "error" ? event.error : event.message,
|
|
9173
9745
|
theme: theme3,
|
|
9174
9746
|
nodeRenderer: ({ depth, name, data, isNonenumerable }) => {
|
|
9175
9747
|
const direction = event.type === "send" ? "up" : "down";
|
|
9176
|
-
return depth === 0 ? /* @__PURE__ */
|
|
9748
|
+
return depth === 0 ? /* @__PURE__ */ import_react49.default.createElement(ObjectRootLabel2, { direction, data }) : /* @__PURE__ */ import_react49.default.createElement(
|
|
9177
9749
|
ObjectLabel,
|
|
9178
9750
|
{
|
|
9179
9751
|
direction,
|
|
@@ -9186,7 +9758,7 @@ function EventsSection({
|
|
|
9186
9758
|
}
|
|
9187
9759
|
)
|
|
9188
9760
|
)
|
|
9189
|
-
), !connectionEvents && /* @__PURE__ */
|
|
9761
|
+
), !connectionEvents && /* @__PURE__ */ import_react49.default.createElement(
|
|
9190
9762
|
"div",
|
|
9191
9763
|
{
|
|
9192
9764
|
style: {
|
|
@@ -9197,52 +9769,13 @@ function EventsSection({
|
|
|
9197
9769
|
gap: "4px"
|
|
9198
9770
|
}
|
|
9199
9771
|
},
|
|
9200
|
-
/* @__PURE__ */
|
|
9772
|
+
/* @__PURE__ */ import_react49.default.createElement("span", null, "No recorded events")
|
|
9201
9773
|
))
|
|
9202
9774
|
);
|
|
9203
9775
|
}
|
|
9204
9776
|
|
|
9205
9777
|
// ../noya-multiplayer-react/src/inspector/sections/HistorySection.tsx
|
|
9206
|
-
var
|
|
9207
|
-
|
|
9208
|
-
// ../noya-multiplayer-react/src/inspector/StateInspectorButton.tsx
|
|
9209
|
-
var import_react48 = __toESM(require("react"));
|
|
9210
|
-
function StateInspectorButton({
|
|
9211
|
-
children,
|
|
9212
|
-
onClick,
|
|
9213
|
-
style: style2,
|
|
9214
|
-
theme: theme3,
|
|
9215
|
-
disabled
|
|
9216
|
-
}) {
|
|
9217
|
-
return /* @__PURE__ */ import_react48.default.createElement(
|
|
9218
|
-
"button",
|
|
9219
|
-
{
|
|
9220
|
-
type: "button",
|
|
9221
|
-
disabled,
|
|
9222
|
-
onClick: (event) => {
|
|
9223
|
-
event.stopPropagation();
|
|
9224
|
-
onClick();
|
|
9225
|
-
},
|
|
9226
|
-
style: {
|
|
9227
|
-
flex: "0",
|
|
9228
|
-
appearance: "none",
|
|
9229
|
-
background: "none",
|
|
9230
|
-
color: theme3.BASE_COLOR,
|
|
9231
|
-
opacity: disabled ? 0.25 : 1,
|
|
9232
|
-
border: "none",
|
|
9233
|
-
fontSize: "12px",
|
|
9234
|
-
whiteSpace: "nowrap",
|
|
9235
|
-
display: "inline-flex",
|
|
9236
|
-
alignItems: "center",
|
|
9237
|
-
justifyContent: "center",
|
|
9238
|
-
padding: "0",
|
|
9239
|
-
cursor: "pointer",
|
|
9240
|
-
...style2
|
|
9241
|
-
}
|
|
9242
|
-
},
|
|
9243
|
-
children
|
|
9244
|
-
);
|
|
9245
|
-
}
|
|
9778
|
+
var import_react50 = __toESM(require("react"));
|
|
9246
9779
|
|
|
9247
9780
|
// ../noya-multiplayer-react/src/inspector/utils.ts
|
|
9248
9781
|
function pathToString(extendedPath) {
|
|
@@ -9275,7 +9808,7 @@ function uploadFile() {
|
|
|
9275
9808
|
const reader = new FileReader();
|
|
9276
9809
|
reader.onload = () => {
|
|
9277
9810
|
const buffer = reader.result;
|
|
9278
|
-
const blob = new
|
|
9811
|
+
const blob = new File([buffer], file.name, { type: file.type });
|
|
9279
9812
|
resolve(blob);
|
|
9280
9813
|
};
|
|
9281
9814
|
reader.onerror = () => {
|
|
@@ -9297,15 +9830,15 @@ function HistorySection({
|
|
|
9297
9830
|
historySnapshot,
|
|
9298
9831
|
multiplayerStateManager
|
|
9299
9832
|
}) {
|
|
9300
|
-
const ref = (0,
|
|
9833
|
+
const ref = (0, import_react50.useRef)(null);
|
|
9301
9834
|
const theme3 = getStateInspectorTheme(colorScheme);
|
|
9302
9835
|
const solidBorderColor = getStateInspectorBorderColor(colorScheme);
|
|
9303
|
-
(0,
|
|
9836
|
+
(0, import_react50.useEffect)(() => {
|
|
9304
9837
|
if (ref.current) {
|
|
9305
9838
|
ref.current.scrollTop = ref.current.scrollHeight;
|
|
9306
9839
|
}
|
|
9307
9840
|
}, [historySnapshot]);
|
|
9308
|
-
(0,
|
|
9841
|
+
(0, import_react50.useEffect)(() => {
|
|
9309
9842
|
if (!ref.current) return;
|
|
9310
9843
|
const historyEntry = ref.current.querySelector(
|
|
9311
9844
|
`#${HISTORY_ELEMENT_PREFIX}${historySnapshot.historyIndex}`
|
|
@@ -9317,14 +9850,14 @@ function HistorySection({
|
|
|
9317
9850
|
});
|
|
9318
9851
|
}
|
|
9319
9852
|
}, [historySnapshot.historyIndex]);
|
|
9320
|
-
return /* @__PURE__ */
|
|
9853
|
+
return /* @__PURE__ */ import_react50.default.createElement(
|
|
9321
9854
|
StateInspectorDisclosureSection,
|
|
9322
9855
|
{
|
|
9323
9856
|
open: showHistory,
|
|
9324
9857
|
setOpen: setShowHistory,
|
|
9325
9858
|
title: "History",
|
|
9326
9859
|
colorScheme,
|
|
9327
|
-
right: /* @__PURE__ */
|
|
9860
|
+
right: /* @__PURE__ */ import_react50.default.createElement(
|
|
9328
9861
|
"span",
|
|
9329
9862
|
{
|
|
9330
9863
|
style: {
|
|
@@ -9332,7 +9865,7 @@ function HistorySection({
|
|
|
9332
9865
|
gap: "4px"
|
|
9333
9866
|
}
|
|
9334
9867
|
},
|
|
9335
|
-
/* @__PURE__ */
|
|
9868
|
+
/* @__PURE__ */ import_react50.default.createElement(
|
|
9336
9869
|
StateInspectorButton,
|
|
9337
9870
|
{
|
|
9338
9871
|
disabled: !historySnapshot.canUndo,
|
|
@@ -9341,7 +9874,7 @@ function HistorySection({
|
|
|
9341
9874
|
multiplayerStateManager.undo();
|
|
9342
9875
|
}
|
|
9343
9876
|
},
|
|
9344
|
-
/* @__PURE__ */
|
|
9877
|
+
/* @__PURE__ */ import_react50.default.createElement("span", { style: { width: "12px", height: "12px" } }, /* @__PURE__ */ import_react50.default.createElement(
|
|
9345
9878
|
"svg",
|
|
9346
9879
|
{
|
|
9347
9880
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -9349,7 +9882,7 @@ function HistorySection({
|
|
|
9349
9882
|
height: "1em",
|
|
9350
9883
|
viewBox: "0 0 20 20"
|
|
9351
9884
|
},
|
|
9352
|
-
/* @__PURE__ */
|
|
9885
|
+
/* @__PURE__ */ import_react50.default.createElement(
|
|
9353
9886
|
"path",
|
|
9354
9887
|
{
|
|
9355
9888
|
fill: "currentColor",
|
|
@@ -9358,7 +9891,7 @@ function HistorySection({
|
|
|
9358
9891
|
)
|
|
9359
9892
|
))
|
|
9360
9893
|
),
|
|
9361
|
-
/* @__PURE__ */
|
|
9894
|
+
/* @__PURE__ */ import_react50.default.createElement(
|
|
9362
9895
|
StateInspectorButton,
|
|
9363
9896
|
{
|
|
9364
9897
|
disabled: !historySnapshot.canRedo,
|
|
@@ -9367,7 +9900,7 @@ function HistorySection({
|
|
|
9367
9900
|
multiplayerStateManager.redo();
|
|
9368
9901
|
}
|
|
9369
9902
|
},
|
|
9370
|
-
/* @__PURE__ */
|
|
9903
|
+
/* @__PURE__ */ import_react50.default.createElement("span", { style: { width: "12px", height: "12px" } }, /* @__PURE__ */ import_react50.default.createElement(
|
|
9371
9904
|
"svg",
|
|
9372
9905
|
{
|
|
9373
9906
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -9375,7 +9908,7 @@ function HistorySection({
|
|
|
9375
9908
|
height: "1em",
|
|
9376
9909
|
viewBox: "0 0 20 20"
|
|
9377
9910
|
},
|
|
9378
|
-
/* @__PURE__ */
|
|
9911
|
+
/* @__PURE__ */ import_react50.default.createElement(
|
|
9379
9912
|
"path",
|
|
9380
9913
|
{
|
|
9381
9914
|
fill: "currentColor",
|
|
@@ -9386,7 +9919,7 @@ function HistorySection({
|
|
|
9386
9919
|
)
|
|
9387
9920
|
)
|
|
9388
9921
|
},
|
|
9389
|
-
/* @__PURE__ */
|
|
9922
|
+
/* @__PURE__ */ import_react50.default.createElement(StateInspectorDisclosureRowInner, { ref }, /* @__PURE__ */ import_react50.default.createElement(
|
|
9390
9923
|
"div",
|
|
9391
9924
|
{
|
|
9392
9925
|
id: `${HISTORY_ELEMENT_PREFIX}0`,
|
|
@@ -9400,7 +9933,7 @@ function HistorySection({
|
|
|
9400
9933
|
background: historySnapshot.historyIndex === 0 ? "rgb(59 130 246 / 15%)" : void 0
|
|
9401
9934
|
}
|
|
9402
9935
|
},
|
|
9403
|
-
/* @__PURE__ */
|
|
9936
|
+
/* @__PURE__ */ import_react50.default.createElement(
|
|
9404
9937
|
"span",
|
|
9405
9938
|
{
|
|
9406
9939
|
style: {
|
|
@@ -9415,7 +9948,7 @@ function HistorySection({
|
|
|
9415
9948
|
), historySnapshot.history.map((entry, index) => {
|
|
9416
9949
|
const metadata = entry.metadata;
|
|
9417
9950
|
const { id, name, timestamp, ...rest } = metadata;
|
|
9418
|
-
return /* @__PURE__ */
|
|
9951
|
+
return /* @__PURE__ */ import_react50.default.createElement(
|
|
9419
9952
|
"div",
|
|
9420
9953
|
{
|
|
9421
9954
|
id: `${HISTORY_ELEMENT_PREFIX}${index + 1}`,
|
|
@@ -9426,7 +9959,7 @@ function HistorySection({
|
|
|
9426
9959
|
background: index + 1 === historySnapshot.historyIndex ? "rgb(59 130 246 / 15%)" : void 0
|
|
9427
9960
|
}
|
|
9428
9961
|
},
|
|
9429
|
-
typeof name === "string" && /* @__PURE__ */
|
|
9962
|
+
typeof name === "string" && /* @__PURE__ */ import_react50.default.createElement(
|
|
9430
9963
|
"pre",
|
|
9431
9964
|
{
|
|
9432
9965
|
style: {
|
|
@@ -9437,9 +9970,9 @@ function HistorySection({
|
|
|
9437
9970
|
}
|
|
9438
9971
|
},
|
|
9439
9972
|
entry.metadata.name,
|
|
9440
|
-
Object.keys(rest).length > 0 && /* @__PURE__ */
|
|
9973
|
+
Object.keys(rest).length > 0 && /* @__PURE__ */ import_react50.default.createElement(themedObjectInspector, { data: rest, theme: theme3 })
|
|
9441
9974
|
),
|
|
9442
|
-
entry.redoPatches?.map((patch, j) => /* @__PURE__ */
|
|
9975
|
+
entry.redoPatches?.map((patch, j) => /* @__PURE__ */ import_react50.default.createElement(
|
|
9443
9976
|
"pre",
|
|
9444
9977
|
{
|
|
9445
9978
|
key: j,
|
|
@@ -9450,10 +9983,10 @@ function HistorySection({
|
|
|
9450
9983
|
margin: 0
|
|
9451
9984
|
}
|
|
9452
9985
|
},
|
|
9453
|
-
patch.op === "add" && /* @__PURE__ */
|
|
9454
|
-
patch.op === "replace" && /* @__PURE__ */
|
|
9455
|
-
patch.op === "remove" && /* @__PURE__ */
|
|
9456
|
-
patch.op === "move" && /* @__PURE__ */
|
|
9986
|
+
patch.op === "add" && /* @__PURE__ */ import_react50.default.createElement(import_react50.default.Fragment, null, /* @__PURE__ */ import_react50.default.createElement("span", { style: { fontStyle: "italic" } }, pathToString(patch.path)), " = ", /* @__PURE__ */ import_react50.default.createElement(themedObjectInspector, { data: patch.value, theme: theme3 })),
|
|
9987
|
+
patch.op === "replace" && /* @__PURE__ */ import_react50.default.createElement(import_react50.default.Fragment, null, /* @__PURE__ */ import_react50.default.createElement("span", { style: { fontStyle: "italic" } }, pathToString(patch.path)), " = ", /* @__PURE__ */ import_react50.default.createElement(themedObjectInspector, { data: patch.value, theme: theme3 })),
|
|
9988
|
+
patch.op === "remove" && /* @__PURE__ */ import_react50.default.createElement(import_react50.default.Fragment, null, /* @__PURE__ */ import_react50.default.createElement("span", { style: { color: theme3.OBJECT_VALUE_STRING_COLOR } }, "delete", " "), /* @__PURE__ */ import_react50.default.createElement("span", { style: { fontStyle: "italic" } }, pathToString(patch.path))),
|
|
9989
|
+
patch.op === "move" && /* @__PURE__ */ import_react50.default.createElement(import_react50.default.Fragment, null, /* @__PURE__ */ import_react50.default.createElement("span", { style: { fontStyle: "italic" } }, pathToString(patch.from)), " -> ", /* @__PURE__ */ import_react50.default.createElement("span", { style: { fontStyle: "italic" } }, pathToString(patch.path)))
|
|
9457
9990
|
))
|
|
9458
9991
|
);
|
|
9459
9992
|
}))
|
|
@@ -10006,8 +10539,16 @@ function replaceDeep(obj, replacementMap) {
|
|
|
10006
10539
|
}
|
|
10007
10540
|
}
|
|
10008
10541
|
|
|
10542
|
+
// ../noya-multiplayer-react/src/inspector/StateInspectorTitleLabel.tsx
|
|
10543
|
+
var import_react51 = __toESM(require("react"));
|
|
10544
|
+
function StateInspectorTitleLabel({
|
|
10545
|
+
children
|
|
10546
|
+
}) {
|
|
10547
|
+
return /* @__PURE__ */ import_react51.default.createElement("span", { style: { display: "flex", alignItems: "center", gap: "4px" } }, children);
|
|
10548
|
+
}
|
|
10549
|
+
|
|
10009
10550
|
// ../noya-multiplayer-react/src/inspector/StateInspectorToggleButton.tsx
|
|
10010
|
-
var
|
|
10551
|
+
var import_react52 = __toESM(require("react"));
|
|
10011
10552
|
function StateInspectorToggleButton({
|
|
10012
10553
|
showInspector,
|
|
10013
10554
|
setShowInspector,
|
|
@@ -10015,7 +10556,7 @@ function StateInspectorToggleButton({
|
|
|
10015
10556
|
anchor
|
|
10016
10557
|
}) {
|
|
10017
10558
|
const isRightAnchor = anchor === "right";
|
|
10018
|
-
const rightIcon = /* @__PURE__ */
|
|
10559
|
+
const rightIcon = /* @__PURE__ */ import_react52.default.createElement(
|
|
10019
10560
|
"svg",
|
|
10020
10561
|
{
|
|
10021
10562
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -10025,7 +10566,7 @@ function StateInspectorToggleButton({
|
|
|
10025
10566
|
stroke: "currentColor",
|
|
10026
10567
|
className: "size-6"
|
|
10027
10568
|
},
|
|
10028
|
-
/* @__PURE__ */
|
|
10569
|
+
/* @__PURE__ */ import_react52.default.createElement(
|
|
10029
10570
|
"path",
|
|
10030
10571
|
{
|
|
10031
10572
|
strokeLinecap: "round",
|
|
@@ -10034,7 +10575,7 @@ function StateInspectorToggleButton({
|
|
|
10034
10575
|
}
|
|
10035
10576
|
)
|
|
10036
10577
|
);
|
|
10037
|
-
const leftIcon = /* @__PURE__ */
|
|
10578
|
+
const leftIcon = /* @__PURE__ */ import_react52.default.createElement(
|
|
10038
10579
|
"svg",
|
|
10039
10580
|
{
|
|
10040
10581
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -10044,7 +10585,7 @@ function StateInspectorToggleButton({
|
|
|
10044
10585
|
stroke: "currentColor",
|
|
10045
10586
|
className: "size-6"
|
|
10046
10587
|
},
|
|
10047
|
-
/* @__PURE__ */
|
|
10588
|
+
/* @__PURE__ */ import_react52.default.createElement(
|
|
10048
10589
|
"path",
|
|
10049
10590
|
{
|
|
10050
10591
|
strokeLinecap: "round",
|
|
@@ -10053,7 +10594,7 @@ function StateInspectorToggleButton({
|
|
|
10053
10594
|
}
|
|
10054
10595
|
)
|
|
10055
10596
|
);
|
|
10056
|
-
return /* @__PURE__ */
|
|
10597
|
+
return /* @__PURE__ */ import_react52.default.createElement(
|
|
10057
10598
|
"span",
|
|
10058
10599
|
{
|
|
10059
10600
|
role: "button",
|
|
@@ -10074,15 +10615,15 @@ function StateInspectorToggleButton({
|
|
|
10074
10615
|
setShowInspector(!showInspector);
|
|
10075
10616
|
}
|
|
10076
10617
|
},
|
|
10077
|
-
showInspector ? "Hide Inspector" : /* @__PURE__ */
|
|
10618
|
+
showInspector ? "Hide Inspector" : /* @__PURE__ */ import_react52.default.createElement("span", { style: { width: "12px", height: "12px" } }, isRightAnchor ? rightIcon : leftIcon)
|
|
10078
10619
|
);
|
|
10079
10620
|
}
|
|
10080
10621
|
|
|
10081
10622
|
// ../noya-multiplayer-react/src/inspector/useLocalStorageState.tsx
|
|
10082
|
-
var
|
|
10623
|
+
var import_react53 = __toESM(require("react"));
|
|
10083
10624
|
var localStorage2 = typeof window !== "undefined" ? window.localStorage : null;
|
|
10084
10625
|
function useLocalStorageState(key, defaultValue) {
|
|
10085
|
-
const [state, setState] =
|
|
10626
|
+
const [state, setState] = import_react53.default.useState(() => {
|
|
10086
10627
|
const value = localStorage2?.getItem(key);
|
|
10087
10628
|
let result = defaultValue;
|
|
10088
10629
|
if (value) {
|
|
@@ -10117,16 +10658,19 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
10117
10658
|
ephemeralUserDataManager,
|
|
10118
10659
|
connectionEventManager,
|
|
10119
10660
|
taskManager,
|
|
10120
|
-
ioManager
|
|
10661
|
+
ioManager,
|
|
10662
|
+
resourceManager,
|
|
10663
|
+
activityEventsManager
|
|
10121
10664
|
} = noyaManager;
|
|
10122
|
-
const [didMount, setDidMount] =
|
|
10665
|
+
const [didMount, setDidMount] = import_react54.default.useState(false);
|
|
10123
10666
|
const tasks = useObservable2(taskManager.tasks$);
|
|
10124
10667
|
const inputs = useObservable2(ioManager.inputs$);
|
|
10125
10668
|
const outputTransforms = useObservable2(ioManager.outputTransforms$);
|
|
10126
|
-
(0,
|
|
10669
|
+
(0, import_react54.useLayoutEffect)(() => {
|
|
10127
10670
|
setDidMount(true);
|
|
10128
10671
|
}, []);
|
|
10129
|
-
const eventsContainerRef =
|
|
10672
|
+
const eventsContainerRef = import_react54.default.useRef(null);
|
|
10673
|
+
const activityEventsContainerRef = import_react54.default.useRef(null);
|
|
10130
10674
|
const [showInspector, setShowInspector] = useLocalStorageState(
|
|
10131
10675
|
"noya-multiplayer-react-show-inspector",
|
|
10132
10676
|
true
|
|
@@ -10159,6 +10703,10 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
10159
10703
|
"noya-multiplayer-react-show-assets",
|
|
10160
10704
|
false
|
|
10161
10705
|
);
|
|
10706
|
+
const [showResources, setShowResources] = useLocalStorageState(
|
|
10707
|
+
"noya-multiplayer-react-show-resources",
|
|
10708
|
+
false
|
|
10709
|
+
);
|
|
10162
10710
|
const [showSecrets, setShowSecrets] = useLocalStorageState(
|
|
10163
10711
|
"noya-multiplayer-react-show-secrets",
|
|
10164
10712
|
false
|
|
@@ -10171,8 +10719,12 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
10171
10719
|
"noya-multiplayer-react-show-output-transforms",
|
|
10172
10720
|
false
|
|
10173
10721
|
);
|
|
10722
|
+
const [showActivityEvents, setShowActivityEvents] = useLocalStorageState(
|
|
10723
|
+
"noya-multiplayer-react-show-activity-events",
|
|
10724
|
+
false
|
|
10725
|
+
);
|
|
10174
10726
|
const connectionEvents = useObservable2(connectionEventManager.events$);
|
|
10175
|
-
(0,
|
|
10727
|
+
(0, import_react54.useEffect)(() => {
|
|
10176
10728
|
if (eventsContainerRef.current) {
|
|
10177
10729
|
eventsContainerRef.current.scrollTop = eventsContainerRef.current.scrollHeight;
|
|
10178
10730
|
}
|
|
@@ -10183,6 +10735,8 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
10183
10735
|
const ephemeral = useObservable2(ephemeralUserDataManager.data$);
|
|
10184
10736
|
const historySnapshot = useManagedHistory(multiplayerStateManager.sm);
|
|
10185
10737
|
const assets = useObservable2(assetManager.assets$);
|
|
10738
|
+
const resources = useObservable2(resourceManager.resources$);
|
|
10739
|
+
const resourcesInitialized = useObservable2(resourceManager.isInitialized$);
|
|
10186
10740
|
const assetsInitialized = useObservable2(assetManager.isInitialized$);
|
|
10187
10741
|
const secrets = useObservable2(secretManager.secrets$);
|
|
10188
10742
|
const secretsInitialized = useObservable2(secretManager.isInitialized$);
|
|
@@ -10214,11 +10768,11 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
10214
10768
|
zIndex: 9999,
|
|
10215
10769
|
lineHeight: "13px"
|
|
10216
10770
|
};
|
|
10217
|
-
const handleExportAll = (0,
|
|
10771
|
+
const handleExportAll = (0, import_react54.useCallback)(async () => {
|
|
10218
10772
|
const buffer = await exportAll(noyaManager);
|
|
10219
10773
|
downloadBlob(new Blob([buffer]), "state.zip");
|
|
10220
10774
|
}, [noyaManager]);
|
|
10221
|
-
const handleImportAll = (0,
|
|
10775
|
+
const handleImportAll = (0, import_react54.useCallback)(async () => {
|
|
10222
10776
|
const file = await uploadFile();
|
|
10223
10777
|
const buffer = await file.arrayBuffer();
|
|
10224
10778
|
importAll(buffer, noyaManager, {
|
|
@@ -10231,7 +10785,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
10231
10785
|
}, [noyaManager]);
|
|
10232
10786
|
if (!didMount) return null;
|
|
10233
10787
|
if (!showInspector) {
|
|
10234
|
-
return /* @__PURE__ */
|
|
10788
|
+
return /* @__PURE__ */ import_react54.default.createElement(
|
|
10235
10789
|
"div",
|
|
10236
10790
|
{
|
|
10237
10791
|
...props,
|
|
@@ -10243,7 +10797,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
10243
10797
|
},
|
|
10244
10798
|
onClick: () => setShowInspector(true)
|
|
10245
10799
|
},
|
|
10246
|
-
/* @__PURE__ */
|
|
10800
|
+
/* @__PURE__ */ import_react54.default.createElement(
|
|
10247
10801
|
StateInspectorToggleButton,
|
|
10248
10802
|
{
|
|
10249
10803
|
showInspector,
|
|
@@ -10254,7 +10808,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
10254
10808
|
)
|
|
10255
10809
|
);
|
|
10256
10810
|
}
|
|
10257
|
-
return /* @__PURE__ */
|
|
10811
|
+
return /* @__PURE__ */ import_react54.default.createElement(
|
|
10258
10812
|
"div",
|
|
10259
10813
|
{
|
|
10260
10814
|
...props,
|
|
@@ -10263,7 +10817,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
10263
10817
|
...props.style
|
|
10264
10818
|
}
|
|
10265
10819
|
},
|
|
10266
|
-
/* @__PURE__ */
|
|
10820
|
+
/* @__PURE__ */ import_react54.default.createElement(
|
|
10267
10821
|
StateInspectorDisclosureSection,
|
|
10268
10822
|
{
|
|
10269
10823
|
isFirst: true,
|
|
@@ -10275,7 +10829,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
10275
10829
|
flex: "0 0 auto",
|
|
10276
10830
|
maxHeight: "200px"
|
|
10277
10831
|
},
|
|
10278
|
-
right: /* @__PURE__ */
|
|
10832
|
+
right: /* @__PURE__ */ import_react54.default.createElement(
|
|
10279
10833
|
StateInspectorToggleButton,
|
|
10280
10834
|
{
|
|
10281
10835
|
showInspector,
|
|
@@ -10285,14 +10839,14 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
10285
10839
|
}
|
|
10286
10840
|
)
|
|
10287
10841
|
},
|
|
10288
|
-
/* @__PURE__ */
|
|
10842
|
+
/* @__PURE__ */ import_react54.default.createElement(StateInspectorDisclosureRowInner, { style: { flex: "0 0 auto" } }, connectedUsers?.map((user) => /* @__PURE__ */ import_react54.default.createElement(
|
|
10289
10843
|
StateInspectorRow,
|
|
10290
10844
|
{
|
|
10291
10845
|
key: user.id,
|
|
10292
10846
|
colorScheme,
|
|
10293
10847
|
variant: user.id === userId ? "up" : void 0
|
|
10294
10848
|
},
|
|
10295
|
-
user.image && /* @__PURE__ */
|
|
10849
|
+
user.image && /* @__PURE__ */ import_react54.default.createElement(
|
|
10296
10850
|
"img",
|
|
10297
10851
|
{
|
|
10298
10852
|
src: user.image,
|
|
@@ -10313,7 +10867,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
10313
10867
|
" (",
|
|
10314
10868
|
ellipsis(user.id.toString(), 8, "middle"),
|
|
10315
10869
|
")"
|
|
10316
|
-
)), !connectedUsers && /* @__PURE__ */
|
|
10870
|
+
)), !connectedUsers && /* @__PURE__ */ import_react54.default.createElement(
|
|
10317
10871
|
"div",
|
|
10318
10872
|
{
|
|
10319
10873
|
style: {
|
|
@@ -10324,13 +10878,13 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
10324
10878
|
gap: "4px"
|
|
10325
10879
|
}
|
|
10326
10880
|
},
|
|
10327
|
-
/* @__PURE__ */
|
|
10881
|
+
/* @__PURE__ */ import_react54.default.createElement("span", null, "No connected users")
|
|
10328
10882
|
))
|
|
10329
10883
|
),
|
|
10330
|
-
/* @__PURE__ */
|
|
10884
|
+
/* @__PURE__ */ import_react54.default.createElement(
|
|
10331
10885
|
StateInspectorDisclosureSection,
|
|
10332
10886
|
{
|
|
10333
|
-
title: /* @__PURE__ */
|
|
10887
|
+
title: /* @__PURE__ */ import_react54.default.createElement(StateInspectorTitleLabel, null, "Data", /* @__PURE__ */ import_react54.default.createElement(
|
|
10334
10888
|
ColoredDot,
|
|
10335
10889
|
{
|
|
10336
10890
|
type: multipeerStateInitialized ? "success" : "error"
|
|
@@ -10339,7 +10893,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
10339
10893
|
colorScheme,
|
|
10340
10894
|
setOpen: setShowData,
|
|
10341
10895
|
open: showData,
|
|
10342
|
-
right: /* @__PURE__ */
|
|
10896
|
+
right: /* @__PURE__ */ import_react54.default.createElement(
|
|
10343
10897
|
"span",
|
|
10344
10898
|
{
|
|
10345
10899
|
style: {
|
|
@@ -10347,9 +10901,9 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
10347
10901
|
gap: "12px"
|
|
10348
10902
|
}
|
|
10349
10903
|
},
|
|
10350
|
-
/* @__PURE__ */
|
|
10351
|
-
/* @__PURE__ */
|
|
10352
|
-
/* @__PURE__ */
|
|
10904
|
+
/* @__PURE__ */ import_react54.default.createElement(StateInspectorButton, { theme: theme3, onClick: handleImportAll }, "Import"),
|
|
10905
|
+
/* @__PURE__ */ import_react54.default.createElement(StateInspectorButton, { theme: theme3, onClick: handleExportAll }, "Export"),
|
|
10906
|
+
/* @__PURE__ */ import_react54.default.createElement(
|
|
10353
10907
|
StateInspectorButton,
|
|
10354
10908
|
{
|
|
10355
10909
|
theme: theme3,
|
|
@@ -10361,14 +10915,14 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
10361
10915
|
)
|
|
10362
10916
|
)
|
|
10363
10917
|
},
|
|
10364
|
-
/* @__PURE__ */
|
|
10918
|
+
/* @__PURE__ */ import_react54.default.createElement(StateInspectorDisclosureRowInner, null, /* @__PURE__ */ import_react54.default.createElement(StateInspectorRow, { colorScheme }, /* @__PURE__ */ import_react54.default.createElement(
|
|
10365
10919
|
themedObjectInspector,
|
|
10366
10920
|
{
|
|
10367
10921
|
name: multiplayerStateManager.schema ? "state" : void 0,
|
|
10368
10922
|
data: state,
|
|
10369
10923
|
theme: theme3
|
|
10370
10924
|
}
|
|
10371
|
-
)), multiplayerStateManager.schema && /* @__PURE__ */
|
|
10925
|
+
)), multiplayerStateManager.schema && /* @__PURE__ */ import_react54.default.createElement(StateInspectorRow, { colorScheme }, /* @__PURE__ */ import_react54.default.createElement(
|
|
10372
10926
|
themedObjectInspector,
|
|
10373
10927
|
{
|
|
10374
10928
|
name: "schema",
|
|
@@ -10377,7 +10931,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
10377
10931
|
}
|
|
10378
10932
|
)))
|
|
10379
10933
|
),
|
|
10380
|
-
/* @__PURE__ */
|
|
10934
|
+
/* @__PURE__ */ import_react54.default.createElement(
|
|
10381
10935
|
HistorySection,
|
|
10382
10936
|
{
|
|
10383
10937
|
showHistory,
|
|
@@ -10387,14 +10941,29 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
10387
10941
|
multiplayerStateManager
|
|
10388
10942
|
}
|
|
10389
10943
|
),
|
|
10390
|
-
/* @__PURE__ */
|
|
10944
|
+
/* @__PURE__ */ import_react54.default.createElement(
|
|
10391
10945
|
StateInspectorDisclosureSection,
|
|
10392
10946
|
{
|
|
10393
10947
|
open: showAssets,
|
|
10394
10948
|
setOpen: setShowAssets,
|
|
10395
|
-
title: /* @__PURE__ */
|
|
10949
|
+
title: /* @__PURE__ */ import_react54.default.createElement(StateInspectorTitleLabel, null, "Assets (", assets.length, ")", /* @__PURE__ */ import_react54.default.createElement(ColoredDot, { type: assetsInitialized ? "success" : "error" })),
|
|
10396
10950
|
colorScheme,
|
|
10397
|
-
right: /* @__PURE__ */
|
|
10951
|
+
right: /* @__PURE__ */ import_react54.default.createElement("span", { style: { display: "flex", gap: "10px" } }, /* @__PURE__ */ import_react54.default.createElement(
|
|
10952
|
+
StateInspectorButton,
|
|
10953
|
+
{
|
|
10954
|
+
theme: theme3,
|
|
10955
|
+
onClick: async () => {
|
|
10956
|
+
const ok = confirm(
|
|
10957
|
+
"Are you sure you want to delete all assets?"
|
|
10958
|
+
);
|
|
10959
|
+
if (!ok) return;
|
|
10960
|
+
await Promise.all(
|
|
10961
|
+
assets.map((asset) => assetManager.delete(asset.id))
|
|
10962
|
+
);
|
|
10963
|
+
}
|
|
10964
|
+
},
|
|
10965
|
+
"Delete all"
|
|
10966
|
+
), /* @__PURE__ */ import_react54.default.createElement(
|
|
10398
10967
|
StateInspectorButton,
|
|
10399
10968
|
{
|
|
10400
10969
|
theme: theme3,
|
|
@@ -10407,7 +10976,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
10407
10976
|
}
|
|
10408
10977
|
},
|
|
10409
10978
|
"Reload"
|
|
10410
|
-
), /* @__PURE__ */
|
|
10979
|
+
), /* @__PURE__ */ import_react54.default.createElement(
|
|
10411
10980
|
StateInspectorButton,
|
|
10412
10981
|
{
|
|
10413
10982
|
theme: theme3,
|
|
@@ -10431,7 +11000,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
10431
11000
|
"Upload"
|
|
10432
11001
|
))
|
|
10433
11002
|
},
|
|
10434
|
-
/* @__PURE__ */
|
|
11003
|
+
/* @__PURE__ */ import_react54.default.createElement(StateInspectorDisclosureRowInner, null, assets.map((asset) => /* @__PURE__ */ import_react54.default.createElement(StateInspectorRow, { key: asset.id, colorScheme }, /* @__PURE__ */ import_react54.default.createElement(themedObjectInspector, { name: asset.id, data: asset, theme: theme3 }), /* @__PURE__ */ import_react54.default.createElement(
|
|
10435
11004
|
StateInspectorButton,
|
|
10436
11005
|
{
|
|
10437
11006
|
theme: theme3,
|
|
@@ -10440,14 +11009,98 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
10440
11009
|
"Delete"
|
|
10441
11010
|
))))
|
|
10442
11011
|
),
|
|
10443
|
-
/* @__PURE__ */
|
|
11012
|
+
/* @__PURE__ */ import_react54.default.createElement(
|
|
11013
|
+
StateInspectorDisclosureSection,
|
|
11014
|
+
{
|
|
11015
|
+
title: /* @__PURE__ */ import_react54.default.createElement(StateInspectorTitleLabel, null, "Resources (", resources.length, ")", /* @__PURE__ */ import_react54.default.createElement(ColoredDot, { type: resourcesInitialized ? "success" : "error" })),
|
|
11016
|
+
colorScheme,
|
|
11017
|
+
open: showResources,
|
|
11018
|
+
setOpen: setShowResources,
|
|
11019
|
+
right: /* @__PURE__ */ import_react54.default.createElement("span", { style: { display: "flex", gap: "10px" } }, /* @__PURE__ */ import_react54.default.createElement(
|
|
11020
|
+
StateInspectorButton,
|
|
11021
|
+
{
|
|
11022
|
+
theme: theme3,
|
|
11023
|
+
onClick: async () => {
|
|
11024
|
+
const ok = confirm(
|
|
11025
|
+
"Are you sure you want to delete all resources?"
|
|
11026
|
+
);
|
|
11027
|
+
if (!ok) return;
|
|
11028
|
+
await Promise.all(
|
|
11029
|
+
resources.map(
|
|
11030
|
+
(resource) => resourceManager.deleteResource({ id: resource.id })
|
|
11031
|
+
)
|
|
11032
|
+
);
|
|
11033
|
+
}
|
|
11034
|
+
},
|
|
11035
|
+
"Delete all"
|
|
11036
|
+
), /* @__PURE__ */ import_react54.default.createElement(
|
|
11037
|
+
StateInspectorButton,
|
|
11038
|
+
{
|
|
11039
|
+
theme: theme3,
|
|
11040
|
+
onClick: async () => {
|
|
11041
|
+
const path2 = prompt("Enter directory path") || (0, import_noya_utils14.uuid)();
|
|
11042
|
+
await resourceManager.createResource({
|
|
11043
|
+
type: "directory",
|
|
11044
|
+
path: path2
|
|
11045
|
+
});
|
|
11046
|
+
}
|
|
11047
|
+
},
|
|
11048
|
+
"Create Directory"
|
|
11049
|
+
), /* @__PURE__ */ import_react54.default.createElement(
|
|
11050
|
+
StateInspectorButton,
|
|
11051
|
+
{
|
|
11052
|
+
theme: theme3,
|
|
11053
|
+
onClick: async () => {
|
|
11054
|
+
const file = await uploadFile();
|
|
11055
|
+
resourceManager.createResource({
|
|
11056
|
+
type: "asset",
|
|
11057
|
+
path: file.name || (0, import_noya_utils14.uuid)(),
|
|
11058
|
+
asset: {
|
|
11059
|
+
content: import_noya_utils14.Base64.encode(await file.arrayBuffer()),
|
|
11060
|
+
contentType: file.type,
|
|
11061
|
+
encoding: "base64"
|
|
11062
|
+
}
|
|
11063
|
+
});
|
|
11064
|
+
}
|
|
11065
|
+
},
|
|
11066
|
+
"Create Asset"
|
|
11067
|
+
))
|
|
11068
|
+
},
|
|
11069
|
+
/* @__PURE__ */ import_react54.default.createElement(StateInspectorDisclosureRowInner, null, resources?.map((resource) => /* @__PURE__ */ import_react54.default.createElement(StateInspectorRow, { key: resource.id, colorScheme }, /* @__PURE__ */ import_react54.default.createElement(
|
|
11070
|
+
themedObjectInspector,
|
|
11071
|
+
{
|
|
11072
|
+
name: resource.path,
|
|
11073
|
+
data: resource,
|
|
11074
|
+
theme: theme3
|
|
11075
|
+
}
|
|
11076
|
+
), /* @__PURE__ */ import_react54.default.createElement("div", { style: { display: "flex", gap: "4px" } }, /* @__PURE__ */ import_react54.default.createElement(
|
|
11077
|
+
StateInspectorButton,
|
|
11078
|
+
{
|
|
11079
|
+
theme: theme3,
|
|
11080
|
+
onClick: () => resourceManager.deleteResource({ id: resource.id })
|
|
11081
|
+
},
|
|
11082
|
+
"Delete"
|
|
11083
|
+
), /* @__PURE__ */ import_react54.default.createElement(
|
|
11084
|
+
StateInspectorButton,
|
|
11085
|
+
{
|
|
11086
|
+
theme: theme3,
|
|
11087
|
+
onClick: () => {
|
|
11088
|
+
const path2 = prompt("Enter new path", resource.path);
|
|
11089
|
+
if (!path2) return;
|
|
11090
|
+
resourceManager.updateResource({ id: resource.id, path: path2 });
|
|
11091
|
+
}
|
|
11092
|
+
},
|
|
11093
|
+
"Rename"
|
|
11094
|
+
)))))
|
|
11095
|
+
),
|
|
11096
|
+
/* @__PURE__ */ import_react54.default.createElement(
|
|
10444
11097
|
StateInspectorDisclosureSection,
|
|
10445
11098
|
{
|
|
10446
|
-
title: /* @__PURE__ */
|
|
11099
|
+
title: /* @__PURE__ */ import_react54.default.createElement(StateInspectorTitleLabel, null, "Secrets", /* @__PURE__ */ import_react54.default.createElement(ColoredDot, { type: secretsInitialized ? "success" : "error" })),
|
|
10447
11100
|
colorScheme,
|
|
10448
11101
|
open: showSecrets,
|
|
10449
11102
|
setOpen: setShowSecrets,
|
|
10450
|
-
right: /* @__PURE__ */
|
|
11103
|
+
right: /* @__PURE__ */ import_react54.default.createElement(
|
|
10451
11104
|
StateInspectorButton,
|
|
10452
11105
|
{
|
|
10453
11106
|
theme: theme3,
|
|
@@ -10462,7 +11115,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
10462
11115
|
"Create"
|
|
10463
11116
|
)
|
|
10464
11117
|
},
|
|
10465
|
-
/* @__PURE__ */
|
|
11118
|
+
/* @__PURE__ */ import_react54.default.createElement(StateInspectorDisclosureRowInner, null, secrets.map((secret) => /* @__PURE__ */ import_react54.default.createElement(StateInspectorRow, { key: secret.id, colorScheme }, /* @__PURE__ */ import_react54.default.createElement(themedObjectInspector, { data: secret, theme: theme3 }), /* @__PURE__ */ import_react54.default.createElement(
|
|
10466
11119
|
StateInspectorButton,
|
|
10467
11120
|
{
|
|
10468
11121
|
theme: theme3,
|
|
@@ -10472,15 +11125,15 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
10472
11125
|
))))
|
|
10473
11126
|
),
|
|
10474
11127
|
" ",
|
|
10475
|
-
/* @__PURE__ */
|
|
11128
|
+
/* @__PURE__ */ import_react54.default.createElement(
|
|
10476
11129
|
StateInspectorDisclosureSection,
|
|
10477
11130
|
{
|
|
10478
11131
|
open: showInputs,
|
|
10479
11132
|
setOpen: setShowInputs,
|
|
10480
|
-
title: /* @__PURE__ */
|
|
11133
|
+
title: /* @__PURE__ */ import_react54.default.createElement(StateInspectorTitleLabel, null, "Inputs", /* @__PURE__ */ import_react54.default.createElement(ColoredDot, { type: inputsInitialized ? "success" : "error" })),
|
|
10481
11134
|
colorScheme
|
|
10482
11135
|
},
|
|
10483
|
-
/* @__PURE__ */
|
|
11136
|
+
/* @__PURE__ */ import_react54.default.createElement(StateInspectorDisclosureRowInner, null, inputs?.map((input) => /* @__PURE__ */ import_react54.default.createElement(StateInspectorRow, { key: input.id, colorScheme }, /* @__PURE__ */ import_react54.default.createElement(themedObjectInspector, { data: input, theme: theme3 }))), !inputs?.length && /* @__PURE__ */ import_react54.default.createElement(
|
|
10484
11137
|
"div",
|
|
10485
11138
|
{
|
|
10486
11139
|
style: {
|
|
@@ -10491,15 +11144,15 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
10491
11144
|
gap: "4px"
|
|
10492
11145
|
}
|
|
10493
11146
|
},
|
|
10494
|
-
/* @__PURE__ */
|
|
11147
|
+
/* @__PURE__ */ import_react54.default.createElement("span", null, "No inputs")
|
|
10495
11148
|
))
|
|
10496
11149
|
),
|
|
10497
|
-
/* @__PURE__ */
|
|
11150
|
+
/* @__PURE__ */ import_react54.default.createElement(
|
|
10498
11151
|
StateInspectorDisclosureSection,
|
|
10499
11152
|
{
|
|
10500
11153
|
open: showOutputTransforms,
|
|
10501
11154
|
setOpen: setShowOutputTransforms,
|
|
10502
|
-
title: /* @__PURE__ */
|
|
11155
|
+
title: /* @__PURE__ */ import_react54.default.createElement(StateInspectorTitleLabel, null, "Output Transforms", /* @__PURE__ */ import_react54.default.createElement(
|
|
10503
11156
|
ColoredDot,
|
|
10504
11157
|
{
|
|
10505
11158
|
type: outputTransformsInitialized ? "success" : "error"
|
|
@@ -10507,7 +11160,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
10507
11160
|
)),
|
|
10508
11161
|
colorScheme
|
|
10509
11162
|
},
|
|
10510
|
-
/* @__PURE__ */
|
|
11163
|
+
/* @__PURE__ */ import_react54.default.createElement(StateInspectorDisclosureRowInner, null, outputTransforms?.map((transform) => /* @__PURE__ */ import_react54.default.createElement(StateInspectorRow, { key: transform.id, colorScheme }, /* @__PURE__ */ import_react54.default.createElement(themedObjectInspector, { data: transform, theme: theme3 }))), !outputTransforms?.length && /* @__PURE__ */ import_react54.default.createElement(
|
|
10511
11164
|
"div",
|
|
10512
11165
|
{
|
|
10513
11166
|
style: {
|
|
@@ -10518,10 +11171,10 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
10518
11171
|
gap: "4px"
|
|
10519
11172
|
}
|
|
10520
11173
|
},
|
|
10521
|
-
/* @__PURE__ */
|
|
11174
|
+
/* @__PURE__ */ import_react54.default.createElement("span", null, "No output transforms")
|
|
10522
11175
|
))
|
|
10523
11176
|
),
|
|
10524
|
-
/* @__PURE__ */
|
|
11177
|
+
/* @__PURE__ */ import_react54.default.createElement(
|
|
10525
11178
|
StateInspectorDisclosureSection,
|
|
10526
11179
|
{
|
|
10527
11180
|
title: "Tasks",
|
|
@@ -10529,7 +11182,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
10529
11182
|
open: showTasks,
|
|
10530
11183
|
setOpen: setShowTasks
|
|
10531
11184
|
},
|
|
10532
|
-
/* @__PURE__ */
|
|
11185
|
+
/* @__PURE__ */ import_react54.default.createElement(StateInspectorDisclosureRowInner, null, tasks?.map((task) => /* @__PURE__ */ import_react54.default.createElement(
|
|
10533
11186
|
StateInspectorRow,
|
|
10534
11187
|
{
|
|
10535
11188
|
key: task.id,
|
|
@@ -10538,7 +11191,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
10538
11191
|
backgroundColor: task.status === "done" ? "rgba(0,255,0,0.2)" : task.status === "error" ? "rgba(255,0,0,0.2)" : void 0
|
|
10539
11192
|
}
|
|
10540
11193
|
},
|
|
10541
|
-
/* @__PURE__ */
|
|
11194
|
+
/* @__PURE__ */ import_react54.default.createElement(
|
|
10542
11195
|
themedObjectInspector,
|
|
10543
11196
|
{
|
|
10544
11197
|
name: task.name,
|
|
@@ -10548,7 +11201,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
10548
11201
|
)
|
|
10549
11202
|
)))
|
|
10550
11203
|
),
|
|
10551
|
-
/* @__PURE__ */
|
|
11204
|
+
/* @__PURE__ */ import_react54.default.createElement(
|
|
10552
11205
|
StateInspectorDisclosureSection,
|
|
10553
11206
|
{
|
|
10554
11207
|
open: showEphemeral,
|
|
@@ -10556,7 +11209,7 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
10556
11209
|
title: "Ephemeral User Data",
|
|
10557
11210
|
colorScheme
|
|
10558
11211
|
},
|
|
10559
|
-
/* @__PURE__ */
|
|
11212
|
+
/* @__PURE__ */ import_react54.default.createElement(StateInspectorDisclosureRowInner, null, Object.entries(ephemeral).map(([key, value]) => /* @__PURE__ */ import_react54.default.createElement(StateInspectorRow, { key, colorScheme }, /* @__PURE__ */ import_react54.default.createElement(
|
|
10560
11213
|
themedObjectInspector,
|
|
10561
11214
|
{
|
|
10562
11215
|
name: key,
|
|
@@ -10566,7 +11219,17 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
10566
11219
|
}
|
|
10567
11220
|
))))
|
|
10568
11221
|
),
|
|
10569
|
-
/* @__PURE__ */
|
|
11222
|
+
/* @__PURE__ */ import_react54.default.createElement(
|
|
11223
|
+
ActivityEventsSection,
|
|
11224
|
+
{
|
|
11225
|
+
colorScheme,
|
|
11226
|
+
activityEventsContainerRef,
|
|
11227
|
+
showEvents: showActivityEvents,
|
|
11228
|
+
setShowEvents: setShowActivityEvents,
|
|
11229
|
+
activityEventsManager
|
|
11230
|
+
}
|
|
11231
|
+
),
|
|
11232
|
+
/* @__PURE__ */ import_react54.default.createElement(
|
|
10570
11233
|
EventsSection,
|
|
10571
11234
|
{
|
|
10572
11235
|
connectionEvents,
|
|
@@ -10578,13 +11241,10 @@ var StateInspector = memoGeneric(function StateInspector2({
|
|
|
10578
11241
|
)
|
|
10579
11242
|
);
|
|
10580
11243
|
});
|
|
10581
|
-
function TitleLabel({ children }) {
|
|
10582
|
-
return /* @__PURE__ */ import_react52.default.createElement("span", { style: { display: "flex", alignItems: "center", gap: "4px" } }, children);
|
|
10583
|
-
}
|
|
10584
11244
|
|
|
10585
11245
|
// ../noya-multiplayer-react/src/hooks.ts
|
|
10586
11246
|
function useManagedHistory(stateManager) {
|
|
10587
|
-
return (0,
|
|
11247
|
+
return (0, import_react56.useSyncExternalStore)(
|
|
10588
11248
|
stateManager.historyEmittor.addListener,
|
|
10589
11249
|
stateManager.getHistorySnapshot,
|
|
10590
11250
|
stateManager.getHistorySnapshot
|
|
@@ -10592,13 +11252,29 @@ function useManagedHistory(stateManager) {
|
|
|
10592
11252
|
}
|
|
10593
11253
|
|
|
10594
11254
|
// ../noya-multiplayer-react/src/NoyaStateContext.tsx
|
|
10595
|
-
var AnyNoyaStateContext = (0,
|
|
10596
|
-
var ConnectedUsersContext = (0,
|
|
10597
|
-
var AnyEphemeralUserDataManagerContext = (0,
|
|
11255
|
+
var AnyNoyaStateContext = (0, import_react58.createContext)(void 0);
|
|
11256
|
+
var ConnectedUsersContext = (0, import_react58.createContext)(void 0);
|
|
11257
|
+
var AnyEphemeralUserDataManagerContext = (0, import_react58.createContext)(void 0);
|
|
11258
|
+
var emptyArray = [];
|
|
11259
|
+
function useActivityEventsForManager(streamFilter, activityEventsManager) {
|
|
11260
|
+
const [streamId, setStreamId] = (0, import_react58.useState)(void 0);
|
|
11261
|
+
const stableStreamFilter = useJsonMemo(streamFilter);
|
|
11262
|
+
(0, import_react58.useEffect)(() => {
|
|
11263
|
+
if (!stableStreamFilter) return;
|
|
11264
|
+
const streamId2 = activityEventsManager.subscribe(stableStreamFilter);
|
|
11265
|
+
setStreamId(streamId2);
|
|
11266
|
+
return () => {
|
|
11267
|
+
setStreamId(void 0);
|
|
11268
|
+
activityEventsManager.unsubscribe(streamId2);
|
|
11269
|
+
};
|
|
11270
|
+
}, [activityEventsManager, stableStreamFilter]);
|
|
11271
|
+
const observable = streamId ? activityEventsManager.getStream(streamId) : void 0;
|
|
11272
|
+
return useObservable2(observable) ?? emptyArray;
|
|
11273
|
+
}
|
|
10598
11274
|
|
|
10599
11275
|
// ../noya-multiplayer-react/src/components/UserPointersOverlay.tsx
|
|
10600
|
-
var
|
|
10601
|
-
var
|
|
11276
|
+
var import_observable19 = require("@noya-app/observable");
|
|
11277
|
+
var import_react60 = __toESM(require("react"));
|
|
10602
11278
|
function shouldShow(hideAfter, updatedAt) {
|
|
10603
11279
|
return !!updatedAt && Date.now() - updatedAt < hideAfter;
|
|
10604
11280
|
}
|
|
@@ -10608,18 +11284,18 @@ var UserPointerInternal = memoGeneric(function UserPointerInternal2({
|
|
|
10608
11284
|
hideAfter = 5e3,
|
|
10609
11285
|
renderUserPointer
|
|
10610
11286
|
}) {
|
|
10611
|
-
const observable = (0,
|
|
11287
|
+
const observable = (0, import_react60.useMemo)(() => {
|
|
10612
11288
|
const metadata$ = ephemeralUserDataManager.metadata$.observePath([user.id]).throttle(50);
|
|
10613
11289
|
const data$ = ephemeralUserDataManager.data$.observePath([user.id]).throttle(50);
|
|
10614
|
-
return
|
|
11290
|
+
return import_observable19.Observable.combine([metadata$, data$], ([metadata2, data2]) => {
|
|
10615
11291
|
return { metadata: metadata2, data: data2 };
|
|
10616
11292
|
});
|
|
10617
11293
|
}, [ephemeralUserDataManager, user.id]);
|
|
10618
11294
|
const { metadata, data } = useObservable2(observable);
|
|
10619
|
-
const [, setForceUpdate] = (0,
|
|
11295
|
+
const [, setForceUpdate] = (0, import_react60.useState)(0);
|
|
10620
11296
|
const updatedAt = metadata?.updatedAt ?? 0;
|
|
10621
11297
|
const show = shouldShow(hideAfter, updatedAt);
|
|
10622
|
-
(0,
|
|
11298
|
+
(0, import_react60.useEffect)(() => {
|
|
10623
11299
|
if (!show) return;
|
|
10624
11300
|
const timeoutId = setTimeout(() => {
|
|
10625
11301
|
setForceUpdate((prev) => prev + 1);
|
|
@@ -10641,9 +11317,9 @@ var UserPointersOverlay = memoGeneric(function UserPointers({
|
|
|
10641
11317
|
}) {
|
|
10642
11318
|
const currentUserId = useObservable2(ephemeralUserDataManager.currentUserId$);
|
|
10643
11319
|
const connectedUsers = useObservable2(connectedUsersManager.connectedUsers$);
|
|
10644
|
-
return /* @__PURE__ */
|
|
11320
|
+
return /* @__PURE__ */ import_react60.default.createElement(import_react60.default.Fragment, null, connectedUsers.map((user) => {
|
|
10645
11321
|
if (user.id === currentUserId) return null;
|
|
10646
|
-
return /* @__PURE__ */
|
|
11322
|
+
return /* @__PURE__ */ import_react60.default.createElement(
|
|
10647
11323
|
UserPointerInternal,
|
|
10648
11324
|
{
|
|
10649
11325
|
key: user.id,
|
|
@@ -10656,39 +11332,56 @@ var UserPointersOverlay = memoGeneric(function UserPointers({
|
|
|
10656
11332
|
});
|
|
10657
11333
|
|
|
10658
11334
|
// src/react/tableHooks.ts
|
|
10659
|
-
var
|
|
10660
|
-
|
|
10661
|
-
|
|
10662
|
-
|
|
11335
|
+
var import_observable_store = require("@noya-app/observable-store");
|
|
11336
|
+
var import_react61 = require("react");
|
|
11337
|
+
function useTable(table, {
|
|
11338
|
+
where,
|
|
11339
|
+
select
|
|
11340
|
+
}, options = {}) {
|
|
11341
|
+
const stableSelect = (0, import_react61.useMemo)(() => {
|
|
10663
11342
|
return JSON.stringify(select);
|
|
10664
11343
|
}, [select]);
|
|
10665
|
-
const
|
|
10666
|
-
|
|
10667
|
-
|
|
11344
|
+
const stableWhere = (0, import_react61.useMemo)(() => {
|
|
11345
|
+
let cloneWithNoUndefined = {};
|
|
11346
|
+
for (const [key, value] of Object.entries(where ?? {})) {
|
|
11347
|
+
if (value !== void 0) {
|
|
11348
|
+
cloneWithNoUndefined[key] = value;
|
|
11349
|
+
}
|
|
11350
|
+
}
|
|
11351
|
+
return JSON.stringify(cloneWithNoUndefined);
|
|
11352
|
+
}, [where]);
|
|
11353
|
+
const observable = (0, import_react61.useMemo)(() => {
|
|
11354
|
+
const parsedSelect = JSON.parse(stableSelect);
|
|
11355
|
+
const parsedWhere = JSON.parse(stableWhere);
|
|
11356
|
+
if (!table) {
|
|
11357
|
+
return new import_observable_store.RefetchableObservable({
|
|
11358
|
+
status: "idle",
|
|
11359
|
+
data: []
|
|
11360
|
+
});
|
|
11361
|
+
}
|
|
11362
|
+
if (parsedWhere?.id === null) {
|
|
11363
|
+
return new import_observable_store.RefetchableObservable({
|
|
10668
11364
|
status: "success",
|
|
10669
11365
|
data: []
|
|
10670
11366
|
});
|
|
10671
11367
|
}
|
|
10672
|
-
|
|
10673
|
-
return client.fileList$.query(
|
|
11368
|
+
return table.query(
|
|
10674
11369
|
{
|
|
10675
|
-
$where:
|
|
11370
|
+
$where: parsedWhere,
|
|
10676
11371
|
$select: parsedSelect
|
|
10677
11372
|
},
|
|
10678
11373
|
{
|
|
10679
11374
|
policy: options.policy,
|
|
10680
|
-
debug: options.debug
|
|
11375
|
+
debug: options.debug,
|
|
11376
|
+
autoStart: false
|
|
10681
11377
|
}
|
|
10682
11378
|
);
|
|
10683
|
-
}, [
|
|
10684
|
-
|
|
10685
|
-
|
|
10686
|
-
|
|
10687
|
-
where?.id,
|
|
10688
|
-
options.debug
|
|
10689
|
-
]);
|
|
11379
|
+
}, [stableSelect, stableWhere, table, options.policy, options.debug]);
|
|
11380
|
+
(0, import_react61.useEffect)(() => {
|
|
11381
|
+
observable.start?.();
|
|
11382
|
+
}, [observable]);
|
|
10690
11383
|
const { status, data } = useObservable2(observable);
|
|
10691
|
-
return (0,
|
|
11384
|
+
return (0, import_react61.useMemo)(() => {
|
|
10692
11385
|
return {
|
|
10693
11386
|
status,
|
|
10694
11387
|
data,
|
|
@@ -10697,14 +11390,17 @@ function useFileListTable({ where, select }, options) {
|
|
|
10697
11390
|
}, [status, data, observable]);
|
|
10698
11391
|
}
|
|
10699
11392
|
function useFileList(select, options = {}) {
|
|
10700
|
-
|
|
11393
|
+
const client = useNoyaClientOrFallback();
|
|
11394
|
+
return useTable(client.fileList$, { select }, options);
|
|
10701
11395
|
}
|
|
10702
11396
|
function useFileListItem(id, select, options = {}) {
|
|
10703
|
-
const
|
|
11397
|
+
const client = useNoyaClientOrFallback();
|
|
11398
|
+
const { status, data, refetch } = useTable(
|
|
11399
|
+
client.fileList$,
|
|
10704
11400
|
{ where: { id: id ?? null }, select },
|
|
10705
11401
|
options
|
|
10706
11402
|
);
|
|
10707
|
-
return (0,
|
|
11403
|
+
return (0, import_react61.useMemo)(() => {
|
|
10708
11404
|
return {
|
|
10709
11405
|
data: data.at(0),
|
|
10710
11406
|
status,
|
|
@@ -10712,9 +11408,41 @@ function useFileListItem(id, select, options = {}) {
|
|
|
10712
11408
|
};
|
|
10713
11409
|
}, [data, status, refetch]);
|
|
10714
11410
|
}
|
|
11411
|
+
function useResourcesList(fileId, select, options = {}) {
|
|
11412
|
+
const client = useNoyaClientOrFallback();
|
|
11413
|
+
return useTable(
|
|
11414
|
+
client.resources$,
|
|
11415
|
+
{ select, where: { accessibleByFileId: fileId } },
|
|
11416
|
+
options
|
|
11417
|
+
);
|
|
11418
|
+
}
|
|
11419
|
+
function useUser(id, select, options = {}) {
|
|
11420
|
+
const client = useNoyaClientOrFallback();
|
|
11421
|
+
const { status, data, refetch } = useTable(
|
|
11422
|
+
client.users$,
|
|
11423
|
+
{ select, where: { id: id ?? null } },
|
|
11424
|
+
options
|
|
11425
|
+
);
|
|
11426
|
+
return (0, import_react61.useMemo)(() => {
|
|
11427
|
+
return {
|
|
11428
|
+
status,
|
|
11429
|
+
data: data.at(0),
|
|
11430
|
+
refetch
|
|
11431
|
+
};
|
|
11432
|
+
}, [status, data, refetch]);
|
|
11433
|
+
}
|
|
11434
|
+
function useActivityEventsList(fileId, select, options = {}) {
|
|
11435
|
+
const client = useNoyaClientOrFallback();
|
|
11436
|
+
return useTable(
|
|
11437
|
+
client.activityEvents$,
|
|
11438
|
+
{ select, where: { fileId } },
|
|
11439
|
+
options
|
|
11440
|
+
);
|
|
11441
|
+
}
|
|
10715
11442
|
// Annotate the CommonJS export names for ESM import in node:
|
|
10716
11443
|
0 && (module.exports = {
|
|
10717
11444
|
NoyaAPIProvider,
|
|
11445
|
+
useActivityEventsList,
|
|
10718
11446
|
useFileList,
|
|
10719
11447
|
useFileListItem,
|
|
10720
11448
|
useGeneratedComponentDescription,
|
|
@@ -10726,6 +11454,7 @@ function useFileListItem(id, select, options = {}) {
|
|
|
10726
11454
|
useMetadata,
|
|
10727
11455
|
useNetworkRequests,
|
|
10728
11456
|
useNoyaAssets,
|
|
11457
|
+
useNoyaAssetsByFileVersionId,
|
|
10729
11458
|
useNoyaBilling,
|
|
10730
11459
|
useNoyaClient,
|
|
10731
11460
|
useNoyaClientOrFallback,
|
|
@@ -10754,6 +11483,9 @@ function useFileListItem(id, select, options = {}) {
|
|
|
10754
11483
|
useOptionalNoyaUserData,
|
|
10755
11484
|
useRandomIcons,
|
|
10756
11485
|
useRandomImages,
|
|
11486
|
+
useResourcesList,
|
|
11487
|
+
useTable,
|
|
11488
|
+
useUser,
|
|
10757
11489
|
...require("@noya-app/noya-api")
|
|
10758
11490
|
});
|
|
10759
11491
|
//# sourceMappingURL=index.js.map
|