@powerhousedao/reactor-browser 6.0.0-dev.235 → 6.0.0-dev.237

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -6,11 +6,12 @@ import { n as useRelationalQuery, r as useRelationalDb, t as createProcessorQuer
6
6
  import { documentModelDocumentModelModule, logger } from "document-model";
7
7
  import { baseLoadFromInput, baseSaveToFileHandle, createPresignedHeader, createZip, documentModelDocumentType, generateId, replayDocument, setName, validateInitialState, validateModules, validateStateSchemaName } from "@powerhousedao/shared/document-model";
8
8
  import { DriveDocumentSchema, addFolder as addFolder$1, copyNode, driveCreateDocument, generateNodesCopy, handleTargetNameCollisions, isFileNode, isFolderNode, moveNode, setAvailableOffline, setSharingType, updateNode } from "@powerhousedao/shared/document-drive";
9
+ import { allPass, conditional, constant, filter, find, forEach, forEachObj, funnel, hasAtLeast, isArray, isDefined, isIncludedIn, isNot, isStrictEqual, isString, isTruthy, last, map, mapToObj, once, pipe, prop, split, unique } from "remeda";
9
10
  import { ChannelScheme, DocumentChangeType, DocumentIntegrityService, DuplicateManifestError, DuplicateModuleError, GqlRequestChannel, InMemoryQueue, IntervalPollTimer, ModuleNotFoundError, PollBehavior, REACTOR_SCHEMA, REACTOR_SCHEMA as REACTOR_SCHEMA$1, ReactorBuilder, ReactorClientBuilder, RelationalDbProcessor, SyncOperationStatus, SyncStatus, driveCollectionId, driveCollectionId as driveCollectionId$1, driveIdFromUrl, parseDriveUrl } from "@powerhousedao/reactor";
10
- import { filter, forEach, forEachObj, funnel, isIncludedIn, isStrictEqual, isTruthy, map, mapToObj, pipe, prop, unique } from "remeda";
11
11
  import { z } from "zod";
12
12
  import { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
13
13
  import slug from "slug";
14
+ import normalizeException from "normalize-exception";
14
15
  import * as lzString from "lz-string";
15
16
  //#region src/errors.ts
16
17
  var UnsupportedDocumentTypeError = class extends Error {
@@ -293,7 +294,6 @@ async function addFileWithProgress(file, driveId, name, parentFolder, onProgress
293
294
  });
294
295
  return;
295
296
  }
296
- if (duplicateCheck.isDuplicate && resolveConflict === "replace" && duplicateCheck.nodeId) await deleteNode(driveId, duplicateCheck.nodeId);
297
297
  const documentType = getDocumentTypeIcon(document);
298
298
  if (documentType) onProgress?.({
299
299
  stage: "loading",
@@ -435,6 +435,20 @@ async function renameDriveNode(driveId, nodeId, name) {
435
435
  })]);
436
436
  return (await reactorClient.get(driveId)).state.global.nodes.find((n) => n.id === nodeId);
437
437
  }
438
+ async function moveNodeById(args) {
439
+ const { driveId, srcId, targetId } = args;
440
+ if (!driveId || !srcId) return;
441
+ const { isAllowedToCreateDocuments } = getUserPermissions();
442
+ if (!isAllowedToCreateDocuments) throw new Error("User is not allowed to move documents");
443
+ const reactorClient = window.ph?.reactorClient;
444
+ if (!reactorClient) throw new Error("ReactorClient not initialized");
445
+ const targetParentFolder = conditional(targetId, [isNot(isDefined), constant(void 0)], [isStrictEqual(driveId), constant(void 0)], constant(targetId));
446
+ if (isStrictEqual(targetParentFolder, srcId)) return;
447
+ return await reactorClient.execute(driveId, "main", [moveNode({
448
+ srcFolder: srcId,
449
+ targetParentFolder
450
+ })]);
451
+ }
438
452
  async function moveNode$1(driveId, src, target) {
439
453
  const { isAllowedToCreateDocuments } = getUserPermissions();
440
454
  if (!isAllowedToCreateDocuments) throw new Error("User is not allowed to move documents");
@@ -1080,98 +1094,6 @@ const useFeatures = featuresEventFunctions.useValue;
1080
1094
  const setFeatures = featuresEventFunctions.setValue;
1081
1095
  const addFeaturesEventHandler = featuresEventFunctions.addEventHandler;
1082
1096
  //#endregion
1083
- //#region src/hooks/drives.ts
1084
- const drivesEventFunctions = makePHEventFunctions("drives");
1085
- /** Returns all of the drives in the reactor */
1086
- const useDrives = drivesEventFunctions.useValue;
1087
- /** Sets the drives in the reactor */
1088
- const setDrives = drivesEventFunctions.setValue;
1089
- /** Adds an event handler for the drives */
1090
- const addDrivesEventHandler = drivesEventFunctions.addEventHandler;
1091
- //#endregion
1092
- //#region src/hooks/graphql-reactor-client.ts
1093
- const graphQLReactorClientEventFunctions = makePHEventFunctions("reactorGraphQLClient");
1094
- const useGraphQLReactorClient = graphQLReactorClientEventFunctions.useValue;
1095
- const setGraphQLReactorClient = graphQLReactorClientEventFunctions.setValue;
1096
- const addGraphQLReactorClientEventHandler = graphQLReactorClientEventFunctions.addEventHandler;
1097
- //#endregion
1098
- //#region src/hooks/modals.ts
1099
- const modalEventFunctions = makePHEventFunctions("modal");
1100
- /** Returns the current modal */
1101
- const usePHModal = modalEventFunctions.useValue;
1102
- /** Sets the current modal */
1103
- const setPHModal = modalEventFunctions.setValue;
1104
- /** Adds an event handler for the modal */
1105
- const addModalEventHandler = modalEventFunctions.addEventHandler;
1106
- /** Shows a modal */
1107
- function showPHModal(modal) {
1108
- setPHModal(modal);
1109
- }
1110
- /** Closes the current modal */
1111
- function closePHModal() {
1112
- setPHModal(void 0);
1113
- }
1114
- /** Shows the create document modal */
1115
- function showCreateDocumentModal(documentType) {
1116
- setPHModal({
1117
- type: "createDocument",
1118
- documentType
1119
- });
1120
- }
1121
- /** Shows the delete node modal */
1122
- function showDeleteNodeModal(nodeOrId) {
1123
- setPHModal({
1124
- type: "deleteItem",
1125
- id: typeof nodeOrId === "string" ? nodeOrId : nodeOrId.id
1126
- });
1127
- }
1128
- //#endregion
1129
- //#region src/hooks/package-discovery.ts
1130
- const packageDiscoveryFunctions = makePHEventFunctions("packageDiscoveryService");
1131
- const usePackageDiscoveryService = packageDiscoveryFunctions.useValue;
1132
- const setPackageDiscoveryService = packageDiscoveryFunctions.setValue;
1133
- const addPackageDiscoveryServiceEventHandler = packageDiscoveryFunctions.addEventHandler;
1134
- //#endregion
1135
- //#region src/hooks/reactor.ts
1136
- const reactorClientModuleEventFunctions = makePHEventFunctions("reactorClientModule");
1137
- const reactorClientEventFunctions = makePHEventFunctions("reactorClient");
1138
- /** Returns the reactor client module */
1139
- const useReactorClientModule = reactorClientModuleEventFunctions.useValue;
1140
- /** Sets the reactor client module */
1141
- const setReactorClientModule = reactorClientModuleEventFunctions.setValue;
1142
- /** Adds an event handler for the reactor client module */
1143
- const addReactorClientModuleEventHandler = reactorClientModuleEventFunctions.addEventHandler;
1144
- /** Returns the reactor client */
1145
- const useReactorClient = reactorClientEventFunctions.useValue;
1146
- /** Sets the reactor client */
1147
- const setReactorClient = reactorClientEventFunctions.setValue;
1148
- /** Adds an event handler for the reactor client */
1149
- const addReactorClientEventHandler = reactorClientEventFunctions.addEventHandler;
1150
- const useSync = () => useReactorClientModule()?.reactorModule?.syncModule?.syncManager;
1151
- const useSyncList = () => {
1152
- return useSync()?.list() ?? [];
1153
- };
1154
- const useModelRegistry = () => useReactorClientModule()?.reactorModule?.documentModelRegistry;
1155
- const useDatabase = () => useReactorClientModule()?.reactorModule?.database;
1156
- const usePGlite = () => useReactorClientModule()?.pg;
1157
- //#endregion
1158
- //#region src/hooks/revision-history.ts
1159
- const revisionHistoryEventFunctions = makePHEventFunctions("revisionHistoryVisible");
1160
- /** Returns whether revision history is visible */
1161
- const useRevisionHistoryVisible = revisionHistoryEventFunctions.useValue;
1162
- /** Sets revision history visibility */
1163
- const setRevisionHistoryVisible = revisionHistoryEventFunctions.setValue;
1164
- /** Adds event handler for revision history visibility */
1165
- const addRevisionHistoryVisibleEventHandler = revisionHistoryEventFunctions.addEventHandler;
1166
- /** Shows the revision history */
1167
- function showRevisionHistory() {
1168
- setRevisionHistoryVisible(true);
1169
- }
1170
- /** Hides the revision history */
1171
- function hideRevisionHistory() {
1172
- setRevisionHistoryVisible(false);
1173
- }
1174
- //#endregion
1175
1097
  //#region src/utils/url.ts
1176
1098
  function resolveUrlPathname(path) {
1177
1099
  return new URL(path.replace(/^\/+/, ""), window.location.origin + (window.ph?.basePath ?? "/")).pathname;
@@ -1234,6 +1156,15 @@ function createUrlWithPreservedParams(pathname) {
1234
1156
  return search ? `${pathname}${search}` : pathname;
1235
1157
  }
1236
1158
  //#endregion
1159
+ //#region src/hooks/drives.ts
1160
+ const drivesEventFunctions = makePHEventFunctions("drives");
1161
+ /** Returns all of the drives in the reactor */
1162
+ const useDrives = drivesEventFunctions.useValue;
1163
+ /** Sets the drives in the reactor */
1164
+ const setDrives = drivesEventFunctions.setValue;
1165
+ /** Adds an event handler for the drives */
1166
+ const addDrivesEventHandler = drivesEventFunctions.addEventHandler;
1167
+ //#endregion
1237
1168
  //#region src/hooks/selected-drive.ts
1238
1169
  const selectedDriveIdEventFunctions = makePHEventFunctions("selectedDriveId");
1239
1170
  /** Returns the selected drive id */
@@ -1278,6 +1209,209 @@ function addSetSelectedDriveOnPopStateEventHandler() {
1278
1209
  });
1279
1210
  }
1280
1211
  //#endregion
1212
+ //#region src/hooks/use-drop-target.ts
1213
+ function useDropTarget() {
1214
+ const [isDropTarget, setIsDropTarget] = useState(false);
1215
+ const isDragAndDropEnabled = useIsDragAndDropEnabled();
1216
+ const targetSetter = funnel(() => setIsDropTarget(true), {
1217
+ triggerAt: "start",
1218
+ minQuietPeriodMs: 100
1219
+ });
1220
+ const targetUnsetter = funnel(() => setIsDropTarget(false), {
1221
+ triggerAt: "start",
1222
+ minQuietPeriodMs: 100
1223
+ });
1224
+ function setTarget() {
1225
+ if (!isDragAndDropEnabled) return;
1226
+ targetUnsetter.cancel();
1227
+ targetSetter.call();
1228
+ }
1229
+ function unsetTarget() {
1230
+ if (!isDragAndDropEnabled) return;
1231
+ targetSetter.cancel();
1232
+ targetUnsetter.call();
1233
+ }
1234
+ return {
1235
+ isDropTarget,
1236
+ setTarget,
1237
+ unsetTarget
1238
+ };
1239
+ }
1240
+ //#endregion
1241
+ //#region src/hooks/node-drag-and-drop.ts
1242
+ const draggingNodeEventFunctions = makePHEventFunctions("draggingNode");
1243
+ const useDraggingNode = draggingNodeEventFunctions.useValue;
1244
+ const setDraggingNode = draggingNodeEventFunctions.setValue;
1245
+ const addDraggingNodeEventHandler = draggingNodeEventFunctions.addEventHandler;
1246
+ const draggingNodeSetter = funnel((node) => setDraggingNode(node), {
1247
+ reducer: (_, newNode) => newNode,
1248
+ triggerAt: "start",
1249
+ minQuietPeriodMs: 100
1250
+ });
1251
+ const draggingNodeUnsetter = funnel(() => setDraggingNode(void 0), {
1252
+ triggerAt: "start",
1253
+ minQuietPeriodMs: 100
1254
+ });
1255
+ function setDragging(node) {
1256
+ draggingNodeUnsetter.cancel();
1257
+ draggingNodeSetter.call(node);
1258
+ }
1259
+ function unsetDragging() {
1260
+ draggingNodeSetter.cancel();
1261
+ draggingNodeUnsetter.call();
1262
+ }
1263
+ const isNodeDrag = (params) => conditional(params, [({ srcId }) => isNot(isTruthy)(srcId), constant(false)], [({ driveId }) => isNot(isTruthy)(driveId), constant(false)], [({ driveId, srcId }) => isStrictEqual(driveId, srcId), constant(false)], constant(true));
1264
+ function useDragNode(args) {
1265
+ const { srcId, parentId } = args;
1266
+ const driveId = useSelectedDriveId();
1267
+ const draggingNodeId = useDraggingNode()?.srcId;
1268
+ const params = {
1269
+ driveId,
1270
+ srcId,
1271
+ parentId
1272
+ };
1273
+ const draggable = isNodeDrag(params);
1274
+ const isDragging = allPass({
1275
+ srcId,
1276
+ draggingNodeId
1277
+ }, [
1278
+ () => draggable,
1279
+ ({ srcId }) => isString(srcId),
1280
+ ({ draggingNodeId }) => isString(draggingNodeId),
1281
+ ({ srcId, draggingNodeId }) => isStrictEqual(srcId, draggingNodeId)
1282
+ ]);
1283
+ const onDragStart = () => {
1284
+ if (!draggable) return;
1285
+ setDragging(params);
1286
+ };
1287
+ const onDragEnd = () => {
1288
+ if (!draggable) return;
1289
+ unsetDragging();
1290
+ };
1291
+ return {
1292
+ isDragging,
1293
+ draggable,
1294
+ onDragStart,
1295
+ onDragEnd
1296
+ };
1297
+ }
1298
+ const isNodeDrop = (params) => conditional(params, [({ srcId }) => isNot(isTruthy)(srcId), constant(false)], [({ driveId }) => isNot(isDefined)(driveId), constant(false)], [({ srcId, targetId }) => isStrictEqual(srcId, targetId), constant(false)], [({ driveId, parentId, targetId }) => isNot(isTruthy)(parentId) && isStrictEqual(targetId, driveId), constant(false)], [({ targetId, parentId }) => isStrictEqual(targetId, parentId), constant(false)], constant(true));
1299
+ function useDropNode(targetId) {
1300
+ const driveId = useSelectedDriveId();
1301
+ const { srcId, parentId } = useDraggingNode() ?? {};
1302
+ const { isDropTarget, setTarget, unsetTarget } = useDropTarget();
1303
+ const params = {
1304
+ driveId,
1305
+ parentId,
1306
+ targetId,
1307
+ srcId
1308
+ };
1309
+ function handleNodeDrop(event, cb) {
1310
+ if (!isNodeDrop(params)) return;
1311
+ event.preventDefault();
1312
+ event.stopPropagation();
1313
+ cb?.();
1314
+ }
1315
+ const onDragEnter = (event) => handleNodeDrop(event);
1316
+ const onDragOver = (event) => handleNodeDrop(event, once(setTarget));
1317
+ const onDragLeave = (event) => handleNodeDrop(event, once(unsetTarget));
1318
+ const onDrop = (event) => handleNodeDrop(event, once(() => {
1319
+ unsetDragging();
1320
+ unsetTarget();
1321
+ moveNodeById(params).catch(console.error);
1322
+ }));
1323
+ return {
1324
+ isDropTarget,
1325
+ onDragEnter,
1326
+ onDragOver,
1327
+ onDragLeave,
1328
+ onDrop
1329
+ };
1330
+ }
1331
+ //#endregion
1332
+ //#region src/hooks/graphql-reactor-client.ts
1333
+ const graphQLReactorClientEventFunctions = makePHEventFunctions("reactorGraphQLClient");
1334
+ const useGraphQLReactorClient = graphQLReactorClientEventFunctions.useValue;
1335
+ const setGraphQLReactorClient = graphQLReactorClientEventFunctions.setValue;
1336
+ const addGraphQLReactorClientEventHandler = graphQLReactorClientEventFunctions.addEventHandler;
1337
+ //#endregion
1338
+ //#region src/hooks/modals.ts
1339
+ const modalEventFunctions = makePHEventFunctions("modal");
1340
+ /** Returns the current modal */
1341
+ const usePHModal = modalEventFunctions.useValue;
1342
+ /** Sets the current modal */
1343
+ const setPHModal = modalEventFunctions.setValue;
1344
+ /** Adds an event handler for the modal */
1345
+ const addModalEventHandler = modalEventFunctions.addEventHandler;
1346
+ /** Shows a modal */
1347
+ function showPHModal(modal) {
1348
+ setPHModal(modal);
1349
+ }
1350
+ /** Closes the current modal */
1351
+ function closePHModal() {
1352
+ setPHModal(void 0);
1353
+ }
1354
+ /** Shows the create document modal */
1355
+ function showCreateDocumentModal(documentType) {
1356
+ setPHModal({
1357
+ type: "createDocument",
1358
+ documentType
1359
+ });
1360
+ }
1361
+ /** Shows the delete node modal */
1362
+ function showDeleteNodeModal(nodeOrId) {
1363
+ setPHModal({
1364
+ type: "deleteItem",
1365
+ id: typeof nodeOrId === "string" ? nodeOrId : nodeOrId.id
1366
+ });
1367
+ }
1368
+ //#endregion
1369
+ //#region src/hooks/package-discovery.ts
1370
+ const packageDiscoveryFunctions = makePHEventFunctions("packageDiscoveryService");
1371
+ const usePackageDiscoveryService = packageDiscoveryFunctions.useValue;
1372
+ const setPackageDiscoveryService = packageDiscoveryFunctions.setValue;
1373
+ const addPackageDiscoveryServiceEventHandler = packageDiscoveryFunctions.addEventHandler;
1374
+ //#endregion
1375
+ //#region src/hooks/reactor.ts
1376
+ const reactorClientModuleEventFunctions = makePHEventFunctions("reactorClientModule");
1377
+ const reactorClientEventFunctions = makePHEventFunctions("reactorClient");
1378
+ /** Returns the reactor client module */
1379
+ const useReactorClientModule = reactorClientModuleEventFunctions.useValue;
1380
+ /** Sets the reactor client module */
1381
+ const setReactorClientModule = reactorClientModuleEventFunctions.setValue;
1382
+ /** Adds an event handler for the reactor client module */
1383
+ const addReactorClientModuleEventHandler = reactorClientModuleEventFunctions.addEventHandler;
1384
+ /** Returns the reactor client */
1385
+ const useReactorClient = reactorClientEventFunctions.useValue;
1386
+ /** Sets the reactor client */
1387
+ const setReactorClient = reactorClientEventFunctions.setValue;
1388
+ /** Adds an event handler for the reactor client */
1389
+ const addReactorClientEventHandler = reactorClientEventFunctions.addEventHandler;
1390
+ const useSync = () => useReactorClientModule()?.reactorModule?.syncModule?.syncManager;
1391
+ const useSyncList = () => {
1392
+ return useSync()?.list() ?? [];
1393
+ };
1394
+ const useModelRegistry = () => useReactorClientModule()?.reactorModule?.documentModelRegistry;
1395
+ const useDatabase = () => useReactorClientModule()?.reactorModule?.database;
1396
+ const usePGlite = () => useReactorClientModule()?.pg;
1397
+ //#endregion
1398
+ //#region src/hooks/revision-history.ts
1399
+ const revisionHistoryEventFunctions = makePHEventFunctions("revisionHistoryVisible");
1400
+ /** Returns whether revision history is visible */
1401
+ const useRevisionHistoryVisible = revisionHistoryEventFunctions.useValue;
1402
+ /** Sets revision history visibility */
1403
+ const setRevisionHistoryVisible = revisionHistoryEventFunctions.setValue;
1404
+ /** Adds event handler for revision history visibility */
1405
+ const addRevisionHistoryVisibleEventHandler = revisionHistoryEventFunctions.addEventHandler;
1406
+ /** Shows the revision history */
1407
+ function showRevisionHistory() {
1408
+ setRevisionHistoryVisible(true);
1409
+ }
1410
+ /** Hides the revision history */
1411
+ function hideRevisionHistory() {
1412
+ setRevisionHistoryVisible(false);
1413
+ }
1414
+ //#endregion
1281
1415
  //#region src/utils/nodes.ts
1282
1416
  /** Sorts nodes by name. */
1283
1417
  function sortNodesByName(nodes) {
@@ -1450,7 +1584,8 @@ const commonGlobalEventHandlerFunctions = {
1450
1584
  addSetSelectedNodeOnPopStateEventHandler();
1451
1585
  },
1452
1586
  documentCache: addDocumentCacheEventHandler,
1453
- reactorGraphQLClient: addGraphQLReactorClientEventHandler
1587
+ reactorGraphQLClient: addGraphQLReactorClientEventHandler,
1588
+ draggingNode: addDraggingNodeEventHandler
1454
1589
  };
1455
1590
  const phGlobalEventHandlerRegisterFunctions = {
1456
1591
  ...commonGlobalEventHandlerFunctions,
@@ -1828,6 +1963,112 @@ function useDocumentTypes() {
1828
1963
  return allowedDocumentTypes ?? supportedDocumentTypes;
1829
1964
  }
1830
1965
  //#endregion
1966
+ //#region src/hooks/file-drag-and-drop.ts
1967
+ const allowedExtensions = [
1968
+ "zip",
1969
+ "phd",
1970
+ "phdm"
1971
+ ];
1972
+ const hasFilesType = (types) => isDefined(find(types, (type) => isStrictEqual(type, "Files")));
1973
+ const isFileDrop = (event) => allPass(event.dataTransfer.types, [
1974
+ isArray,
1975
+ hasAtLeast(1),
1976
+ hasFilesType
1977
+ ]);
1978
+ const hasAllowedExtension = (file) => pipe(file, (file) => file.name, split("."), last(), isIncludedIn(allowedExtensions));
1979
+ const getFileItems = (event) => pipe([...event.dataTransfer.items], filter((item) => isStrictEqual(item.kind, "file")), map((item) => item.getAsFile()), filter(isTruthy));
1980
+ function useDropFile(handleAddFile) {
1981
+ const { isDropTarget, setTarget, unsetTarget } = useDropTarget();
1982
+ const isDragAndDropEnabled = useIsDragAndDropEnabled();
1983
+ const selectedFolder = useSelectedFolder();
1984
+ function handleDragEvent(event, cb) {
1985
+ if (!isDragAndDropEnabled) return;
1986
+ if (!isFileDrop(event)) return;
1987
+ event.preventDefault();
1988
+ event.stopPropagation();
1989
+ cb?.();
1990
+ }
1991
+ const handleAddFiles = (event) => Promise.all(pipe(event, getFileItems, filter(hasAllowedExtension), map((file) => handleAddFile(file, selectedFolder))));
1992
+ const onDragEnter = (event) => handleDragEvent(event);
1993
+ const onDragOver = (event) => handleDragEvent(event, setTarget);
1994
+ const onDragLeave = (event) => handleDragEvent(event, unsetTarget);
1995
+ const onDrop = (event) => handleDragEvent(event, once(() => {
1996
+ unsetTarget();
1997
+ handleAddFiles(event).catch(console.error);
1998
+ }));
1999
+ return {
2000
+ onDragEnter,
2001
+ onDragOver,
2002
+ onDragLeave,
2003
+ onDrop,
2004
+ isDropTarget
2005
+ };
2006
+ }
2007
+ //#endregion
2008
+ //#region src/utils/validate-document.ts
2009
+ const validateDocument = (document) => {
2010
+ const errors = [];
2011
+ if (document.header.documentType !== "powerhouse/document-model") return errors;
2012
+ const doc = document;
2013
+ const specs = doc.state.global.specifications[0];
2014
+ const initialStateErrors = Object.keys(specs.state).reduce((acc, scopeKey) => {
2015
+ const scope = scopeKey;
2016
+ return [...acc, ...validateInitialState(specs.state[scope].initialValue, scope !== "global").map((err) => ({
2017
+ ...err,
2018
+ message: `${err.message}. Scope: ${scope}`,
2019
+ details: {
2020
+ ...err.details,
2021
+ scope
2022
+ }
2023
+ }))];
2024
+ }, []);
2025
+ const schemaStateErrors = Object.keys(specs.state).reduce((acc, scopeKey) => {
2026
+ const scope = scopeKey;
2027
+ const isGlobalScope = scope === "global";
2028
+ return [...acc, ...validateStateSchemaName(specs.state[scope].schema, doc.state.global?.name || doc.header.name || "", !isGlobalScope ? scope : "", !isGlobalScope).map((err) => ({
2029
+ ...err,
2030
+ message: `${err.message}. Scope: ${scope}`,
2031
+ details: {
2032
+ ...err.details,
2033
+ scope
2034
+ }
2035
+ }))];
2036
+ }, []);
2037
+ const modulesErrors = validateModules(specs.modules);
2038
+ return [
2039
+ ...initialStateErrors,
2040
+ ...schemaStateErrors,
2041
+ ...modulesErrors
2042
+ ];
2043
+ };
2044
+ //#endregion
2045
+ //#region src/utils/download-document.ts
2046
+ function defaultHandleError(error) {
2047
+ console.error(`Failed to export document: ${error.message}`);
2048
+ }
2049
+ function handleDocumentValidation(document) {
2050
+ if (hasAtLeast(validateDocument(document), 1)) return false;
2051
+ return true;
2052
+ }
2053
+ function downloadDocument(document, handleError = defaultHandleError) {
2054
+ if (!document) return;
2055
+ if (!handleDocumentValidation(document)) {
2056
+ showPHModal({
2057
+ type: "downloadDocumentWithErrors",
2058
+ documentId: document.header.id
2059
+ });
2060
+ return;
2061
+ }
2062
+ exportFile(document).catch((error) => handleError(normalizeException(error)));
2063
+ }
2064
+ //#endregion
2065
+ //#region src/hooks/download-document.ts
2066
+ function useDownloadDocument(id) {
2067
+ const [document] = useDocumentById(id);
2068
+ const toast = usePHToast();
2069
+ return () => downloadDocument(document, (error) => toast?.(`Failed to export document: ${error.message}`));
2070
+ }
2071
+ //#endregion
1831
2072
  //#region src/hooks/drive-by-id.ts
1832
2073
  function useDriveById(driveId) {
1833
2074
  const foundDrive = useDrives()?.find((drive) => drive.header.id === driveId);
@@ -2187,53 +2428,6 @@ function getSyncStatusSync(documentId, sharingType) {
2187
2428
  return syncStatusToUI[status];
2188
2429
  }
2189
2430
  //#endregion
2190
- //#region src/utils/validate-document.ts
2191
- const validateDocument = (document) => {
2192
- const errors = [];
2193
- if (document.header.documentType !== "powerhouse/document-model") return errors;
2194
- const doc = document;
2195
- const specs = doc.state.global.specifications[0];
2196
- const initialStateErrors = Object.keys(specs.state).reduce((acc, scopeKey) => {
2197
- const scope = scopeKey;
2198
- return [...acc, ...validateInitialState(specs.state[scope].initialValue, scope !== "global").map((err) => ({
2199
- ...err,
2200
- message: `${err.message}. Scope: ${scope}`,
2201
- details: {
2202
- ...err.details,
2203
- scope
2204
- }
2205
- }))];
2206
- }, []);
2207
- const schemaStateErrors = Object.keys(specs.state).reduce((acc, scopeKey) => {
2208
- const scope = scopeKey;
2209
- const isGlobalScope = scope === "global";
2210
- return [...acc, ...validateStateSchemaName(specs.state[scope].schema, doc.state.global?.name || doc.header.name || "", !isGlobalScope ? scope : "", !isGlobalScope).map((err) => ({
2211
- ...err,
2212
- message: `${err.message}. Scope: ${scope}`,
2213
- details: {
2214
- ...err.details,
2215
- scope
2216
- }
2217
- }))];
2218
- }, []);
2219
- const modulesErrors = validateModules(specs.modules);
2220
- return [
2221
- ...initialStateErrors,
2222
- ...schemaStateErrors,
2223
- ...modulesErrors
2224
- ];
2225
- };
2226
- //#endregion
2227
- //#region src/utils/export-document.ts
2228
- const exportDocument = (document) => {
2229
- if (!document) return;
2230
- if (validateDocument(document).length) showPHModal({
2231
- type: "exportDocumentWithErrors",
2232
- documentId: document.header.id
2233
- });
2234
- else return exportFile(document);
2235
- };
2236
- //#endregion
2237
2431
  //#region src/utils/get-revision-from-date.ts
2238
2432
  const getRevisionFromDate = (startDate, endDate, operations = []) => {
2239
2433
  if (!startDate || !endDate) return 0;
@@ -3244,6 +3438,6 @@ var BrowserLocalStorage = class extends BaseStorage {
3244
3438
  }
3245
3439
  };
3246
3440
  //#endregion
3247
- export { ActionTracker, BaseStorage, BrowserLocalStorage, COMMON_PACKAGE_ID, CREDENTIAL_SCHEMA_EIP712_TYPE, CREDENTIAL_SUBJECT_TYPE, CREDENTIAL_TYPES, ChannelScheme, ChevronDownIcon, ConflictError, CopyIcon, DEFAULT_DRIVE_EDITOR_ID, DEFAULT_DRIVE_ID, DEFAULT_SWITCHBOARD_URL, DOMAIN_TYPE, DisconnectIcon, DocumentCache, DocumentChangeType, DocumentIntegrityService, GqlRequestChannel, GraphQLClientDocumentCache, ISSUER_TYPE, InMemoryQueue, IntervalPollTimer, PollBehavior, PropagationMode, REACTOR_SCHEMA, RENOWN_CHAIN_ID, RENOWN_NETWORK_ID, RENOWN_URL, ReactorBuilder, ReactorClientBuilder, RegistryClient, RelationalDbProcessor, RemoteClient, RemoteDocumentController, Renown, RenownAuthButton, RenownLoginButton, RenownLogo, RenownUserButton, SpinnerIcon, SyncOperationStatus, UserIcon, VERIFIABLE_CREDENTIAL_EIP712_TYPE, addAllowListEventHandler, addAllowedDocumentTypesEventHandler, addAnalyticsDatabaseNameEventHandler, addBasePathEventHandler, addCliVersionEventHandler, addDefaultDrivesUrlEventHandler, addDisabledEditorsEventHandler, addDocument, addDocumentCacheEventHandler, addDrive, addDrivesEventHandler, addDrivesPreserveStrategyEventHandler, addEnabledEditorsEventHandler, addFeaturesEventHandler, addFileUploadOperationsChunkSizeEventHandler, addFolder, addGaTrackingIdEventHandler, addGraphQLReactorClientEventHandler, addIsAddCloudDrivesEnabledEventHandler, addIsAddDriveEnabledEventHandler, addIsAddLocalDrivesEnabledEventHandler, addIsAddPublicDrivesEnabledEventHandler, addIsAnalyticsDatabaseWorkerEnabledEventHandler, addIsAnalyticsEnabledEventHandler, addIsAnalyticsExternalProcessorsEnabledEventHandler, addIsCloudDrivesEnabledEventHandler, addIsDeleteCloudDrivesEnabledEventHandler, addIsDeleteLocalDrivesEnabledEventHandler, addIsDeletePublicDrivesEnabledEventHandler, addIsDiffAnalyticsEnabledEventHandler, addIsDocumentModelSelectionSettingsEnabledEventHandler, addIsDragAndDropEnabledEventHandler, addIsDriveAnalyticsEnabledEventHandler, addIsEditorDebugModeEnabledEventHandler, addIsEditorReadModeEnabledEventHandler, addIsExternalControlsEnabledEventHandler, addIsExternalPackagesEnabledEventHandler, addIsExternalProcessorsEnabledEventHandler, addIsExternalRelationalProcessorsEnabledEventHandler, addIsLocalDrivesEnabledEventHandler, addIsPublicDrivesEnabledEventHandler, addIsRelationalProcessorsEnabledEventHandler, addIsSentryTracingEnabledEventHandler, addLoadingEventHandler, addLocalDrivesEnabledEventHandler, addLogLevelEventHandler, addModalEventHandler, addPHEventHandlers, addPackageDiscoveryServiceEventHandler, addPromiseState, addReactorClientEventHandler, addReactorClientModuleEventHandler, addRemoteDrive, addRenownChainIdEventHandler, addRenownEventHandler, addRenownNetworkIdEventHandler, addRenownUrlEventHandler, addRequiresHardRefreshEventHandler, addResetSelectedNodeEventHandler, addRevisionHistoryVisibleEventHandler, addRouterBasenameEventHandler, addSelectedDriveIdEventHandler, addSelectedNodeIdEventHandler, addSelectedTimelineItemEventHandler, addSelectedTimelineRevisionEventHandler, addSentryDsnEventHandler, addSentryEnvEventHandler, addSentryReleaseEventHandler, addSetSelectedDriveOnPopStateEventHandler, addSetSelectedNodeOnPopStateEventHandler, addStudioModeEventHandler, addToastEventHandler, addVersionCheckIntervalEventHandler, addVersionEventHandler, addVetraPackageManagerEventHandler, addWarnOutdatedAppEventHandler, baseDocumentModels, baseDocumentModelsMap, buildDocumentSubgraphQuery, buildDocumentSubgraphUrl, callEventHandlerRegisterFunctions, callGlobalSetterForKey, clearGlobal, closePHModal, commonGlobalEventHandlerFunctions, convertRemoteOperations, createAnalyticsStore, createClient, createProcessorQuery, createUrlWithPreservedParams, deleteDrive, deleteNode, deriveSystemUrl, dispatchActions, driveCollectionId, driveIdFromUrl, dropAllReactorStorage, exportDocument, exportFile, extractDriveIdFromPath, extractDriveIdFromSlug, extractDriveSlugFromPath, extractNodeIdFromPath, extractNodeIdFromSlug, extractNodeSlugFromPath, findUuid, getAnalyticsStore, getDocumentGraphqlQuery, getDriveIdBySlug, getDrives, getGlobal, getPackages, getPackagesByDocumentType, getPathWithoutBase, getRevisionFromDate, getSlugFromDriveUrl, getSwitchboardGatewayUrlFromDriveUrl, getSyncStatus, getSyncStatusSync, getUserPermissions, graphqlDocumentEvents, graphqlDocumentsEvents, graphqlEventsToSyncDrive, hideRevisionHistory, identifierFromMutateDocumentOperationVariables, initConnectCrypto, initRenownCrypto, isDocumentTypeSupported, isExternalControlsEnabledEventFunctions, isFileNodeKind, isFolderNodeKind, loading, login, logout, makeDriveUrlComponent, makeNodeSlug, makePHEventFunctions, openRenown, parseDriveUrl, phAppConfigHooks, phAppConfigSetters, phDocumentEditorConfigHooks, phDocumentEditorConfigSetters, phDocumentFromQuery, phDocumentsFromQuery, phGlobalConfigHooks, phGlobalConfigSetters, reactorGraphqlBatchFetchDocuments, reactorGraphqlCreateDocument, reactorGraphqlDeleteDocument, reactorGraphqlDeleteDocuments, reactorGraphqlFetchDocument, reactorGraphqlMutateDocument, readPromiseState, refreshReactorData, refreshReactorDataClient, renameDrive, renameDriveNode, resolveUrlPathname, setAllowList, setAllowedDocumentTypes, setAnalyticsDatabaseName, setBasePath, setCliVersion, setDefaultDrivesUrl, setDefaultPHGlobalConfig, setDisabledEditors, setDocumentCache, setDriveAvailableOffline, setDriveSharingType, setDrives, setDrivesPreserveStrategy, setEnabledEditors, setFeatures, setFileUploadOperationsChunkSize, setGaTrackingId, setGlobal, setGraphQLReactorClient, setIsAddCloudDrivesEnabled, setIsAddDriveEnabled, setIsAddLocalDrivesEnabled, setIsAddPublicDrivesEnabled, setIsAnalyticsDatabaseWorkerEnabled, setIsAnalyticsEnabled, setIsAnalyticsExternalProcessorsEnabled, setIsCloudDrivesEnabled, setIsDeleteCloudDrivesEnabled, setIsDeleteLocalDrivesEnabled, setIsDeletePublicDrivesEnabled, setIsDiffAnalyticsEnabled, setIsDocumentModelSelectionSettingsEnabled, setIsDragAndDropEnabled, setIsDriveAnalyticsEnabled, setIsEditorDebugModeEnabled, setIsEditorReadModeEnabled, setIsExternalControlsEnabled, setIsExternalPackagesEnabled, setIsExternalProcessorsEnabled, setIsExternalRelationalProcessorsEnabled, setIsLocalDrivesEnabled, setIsPublicDrivesEnabled, setIsRelationalProcessorsEnabled, setIsSentryTracingEnabled, setLoading, setLocalDrivesEnabled, setLogLevel, setPHAppConfig, setPHAppConfigByKey, setPHDocumentEditorConfig, setPHDocumentEditorConfigByKey, setPHGlobalConfig, setPHGlobalConfigByKey, setPHModal, setPHToast, setPackageDiscoveryService, setReactorClient, setReactorClientModule, setRenown, setRenownChainId, setRenownNetworkId, setRenownUrl, setRequiresHardRefresh, setRevisionHistoryVisible, setRouterBasename, setSelectedDrive, setSelectedDriveId, setSelectedNode, setSelectedTimelineItem, setSelectedTimelineRevision, setSentryDsn, setSentryEnv, setSentryRelease, setStudioMode, setVersion, setVersionCheckInterval, setVetraPackageManager, setWarnOutdatedApp, showCreateDocumentModal, showDeleteNodeModal, showPHModal, showRevisionHistory, sortNodesByName, truncateAllTables, useAllowList, useAllowedDocumentModelModules, useAllowedDocumentTypes, useAnalyticsDatabaseName, useAppModuleById, useAppModules, useBasePath, useCliVersion, useConnectionState, useConnectionStates, useDatabase, useDefaultAppModule, useDefaultDrivesUrl, useDid, useDisabledEditors, useDispatch, useDocument, useDocumentById, useDocumentCache, useDocumentModelModuleById, useDocumentModelModules, useDocumentOfType, useDocumentOperations, useDocumentTypes, useDocumentTypesInSelectedDrive, useDocuments, useDocumentsByIds, useDocumentsInSelectedDrive, useDocumentsInSelectedFolder, useDriveById, useDriveSystemInfo, useDrives, useDrivesPreserveStrategy, useEditorModuleById, useEditorModules, useEditorModulesForDocumentType, useEnabledEditors, useFallbackEditorModule, useFeatures, useFileNodesInSelectedDrive, useFileNodesInSelectedFolder, useFileUploadOperationsChunkSize, useFolderById, useFolderNodesInSelectedDrive, useFolderNodesInSelectedFolder, useGaTrackingId, useGetDocument, useGetDocumentAsync, useGetDocuments, useGetSwitchboardLink, useGraphQLReactorClient, useInitReactorGraphqlClient, useIsAddCloudDrivesEnabled, useIsAddDriveEnabled, useIsAddLocalDrivesEnabled, useIsAddPublicDrivesEnabled, useIsAnalyticsDatabaseWorkerEnabled, useIsAnalyticsEnabled, useIsAnalyticsExternalProcessorsEnabled, useIsCloudDrivesEnabled, useIsDeleteCloudDrivesEnabled, useIsDeleteLocalDrivesEnabled, useIsDeletePublicDrivesEnabled, useIsDiffAnalyticsEnabled, useIsDocumentModelSelectionSettingsEnabled, useIsDragAndDropEnabled, useIsDriveAnalyticsEnabled, useIsEditorDebugModeEnabled, useIsEditorReadModeEnabled, useIsExternalControlsEnabled, useIsExternalPackagesEnabled, useIsExternalProcessorsEnabled, useIsExternalRelationalProcessorsEnabled, useIsLocalDrivesEnabled, useIsPublicDrivesEnabled, useIsRelationalProcessorsEnabled, useIsSentryTracingEnabled, useLoading, useLocalDrivesEnabled, useLogLevel, useLoginStatus, useModelRegistry, useNodeActions, useNodeById, useNodeParentFolderById, useNodePathById, useNodesInSelectedDrive, useNodesInSelectedDriveOrFolder, useNodesInSelectedFolder, useOnDropFile, usePGlite, usePHAppConfigByKey, usePHDocumentEditorConfigByKey, usePHGlobalConfigByKey, usePHModal, usePHToast, usePackageDiscoveryService, useParentFolderForSelectedNode, useReactorClient, useReactorClientModule, useRelationalDb, useRelationalQuery, useRenown, useRenownAuth, useRenownChainId, useRenownInit, useRenownNetworkId, useRenownUrl, useRequiresHardRefresh, useResetPHGlobalConfig, useRevisionHistoryVisible, useRouterBasename, useSelectedDocument, useSelectedDocumentId, useSelectedDocumentOfType, useSelectedDocumentSafe, useSelectedDrive, useSelectedDriveId, useSelectedDriveSafe, useSelectedFolder, useSelectedNode, useSelectedNodePath, useSelectedTimelineItem, useSelectedTimelineRevision, useSentryDsn, useSentryEnv, useSentryRelease, useSetDefaultPHGlobalConfig, useSetPHAppConfig, useSetPHDocumentEditorConfig, useSetPHGlobalConfig, useStudioMode, useSubgraphModules, useSupportedDocumentTypesInReactor, useSync, useSyncList, useUser, useUserPermissions, useVersion, useVersionCheckInterval, useVetraPackageManager, useVetraPackages, useWarnOutdatedApp, validateDocument };
3441
+ export { ActionTracker, BaseStorage, BrowserLocalStorage, COMMON_PACKAGE_ID, CREDENTIAL_SCHEMA_EIP712_TYPE, CREDENTIAL_SUBJECT_TYPE, CREDENTIAL_TYPES, ChannelScheme, ChevronDownIcon, ConflictError, CopyIcon, DEFAULT_DRIVE_EDITOR_ID, DEFAULT_DRIVE_ID, DEFAULT_SWITCHBOARD_URL, DOMAIN_TYPE, DisconnectIcon, DocumentCache, DocumentChangeType, DocumentIntegrityService, GqlRequestChannel, GraphQLClientDocumentCache, ISSUER_TYPE, InMemoryQueue, IntervalPollTimer, PollBehavior, PropagationMode, REACTOR_SCHEMA, RENOWN_CHAIN_ID, RENOWN_NETWORK_ID, RENOWN_URL, ReactorBuilder, ReactorClientBuilder, RegistryClient, RelationalDbProcessor, RemoteClient, RemoteDocumentController, Renown, RenownAuthButton, RenownLoginButton, RenownLogo, RenownUserButton, SpinnerIcon, SyncOperationStatus, UserIcon, VERIFIABLE_CREDENTIAL_EIP712_TYPE, addAllowListEventHandler, addAllowedDocumentTypesEventHandler, addAnalyticsDatabaseNameEventHandler, addBasePathEventHandler, addCliVersionEventHandler, addDefaultDrivesUrlEventHandler, addDisabledEditorsEventHandler, addDocument, addDocumentCacheEventHandler, addDraggingNodeEventHandler, addDrive, addDrivesEventHandler, addDrivesPreserveStrategyEventHandler, addEnabledEditorsEventHandler, addFeaturesEventHandler, addFileUploadOperationsChunkSizeEventHandler, addFolder, addGaTrackingIdEventHandler, addGraphQLReactorClientEventHandler, addIsAddCloudDrivesEnabledEventHandler, addIsAddDriveEnabledEventHandler, addIsAddLocalDrivesEnabledEventHandler, addIsAddPublicDrivesEnabledEventHandler, addIsAnalyticsDatabaseWorkerEnabledEventHandler, addIsAnalyticsEnabledEventHandler, addIsAnalyticsExternalProcessorsEnabledEventHandler, addIsCloudDrivesEnabledEventHandler, addIsDeleteCloudDrivesEnabledEventHandler, addIsDeleteLocalDrivesEnabledEventHandler, addIsDeletePublicDrivesEnabledEventHandler, addIsDiffAnalyticsEnabledEventHandler, addIsDocumentModelSelectionSettingsEnabledEventHandler, addIsDragAndDropEnabledEventHandler, addIsDriveAnalyticsEnabledEventHandler, addIsEditorDebugModeEnabledEventHandler, addIsEditorReadModeEnabledEventHandler, addIsExternalControlsEnabledEventHandler, addIsExternalPackagesEnabledEventHandler, addIsExternalProcessorsEnabledEventHandler, addIsExternalRelationalProcessorsEnabledEventHandler, addIsLocalDrivesEnabledEventHandler, addIsPublicDrivesEnabledEventHandler, addIsRelationalProcessorsEnabledEventHandler, addIsSentryTracingEnabledEventHandler, addLoadingEventHandler, addLocalDrivesEnabledEventHandler, addLogLevelEventHandler, addModalEventHandler, addPHEventHandlers, addPackageDiscoveryServiceEventHandler, addPromiseState, addReactorClientEventHandler, addReactorClientModuleEventHandler, addRemoteDrive, addRenownChainIdEventHandler, addRenownEventHandler, addRenownNetworkIdEventHandler, addRenownUrlEventHandler, addRequiresHardRefreshEventHandler, addResetSelectedNodeEventHandler, addRevisionHistoryVisibleEventHandler, addRouterBasenameEventHandler, addSelectedDriveIdEventHandler, addSelectedNodeIdEventHandler, addSelectedTimelineItemEventHandler, addSelectedTimelineRevisionEventHandler, addSentryDsnEventHandler, addSentryEnvEventHandler, addSentryReleaseEventHandler, addSetSelectedDriveOnPopStateEventHandler, addSetSelectedNodeOnPopStateEventHandler, addStudioModeEventHandler, addToastEventHandler, addVersionCheckIntervalEventHandler, addVersionEventHandler, addVetraPackageManagerEventHandler, addWarnOutdatedAppEventHandler, baseDocumentModels, baseDocumentModelsMap, buildDocumentSubgraphQuery, buildDocumentSubgraphUrl, callEventHandlerRegisterFunctions, callGlobalSetterForKey, clearGlobal, closePHModal, commonGlobalEventHandlerFunctions, convertRemoteOperations, createAnalyticsStore, createClient, createProcessorQuery, createUrlWithPreservedParams, deleteDrive, deleteNode, deriveSystemUrl, dispatchActions, downloadDocument, driveCollectionId, driveIdFromUrl, dropAllReactorStorage, exportFile, extractDriveIdFromPath, extractDriveIdFromSlug, extractDriveSlugFromPath, extractNodeIdFromPath, extractNodeIdFromSlug, extractNodeSlugFromPath, findUuid, getAnalyticsStore, getDocumentGraphqlQuery, getDriveIdBySlug, getDrives, getGlobal, getPackages, getPackagesByDocumentType, getPathWithoutBase, getRevisionFromDate, getSlugFromDriveUrl, getSwitchboardGatewayUrlFromDriveUrl, getSyncStatus, getSyncStatusSync, getUserPermissions, graphqlDocumentEvents, graphqlDocumentsEvents, graphqlEventsToSyncDrive, hideRevisionHistory, identifierFromMutateDocumentOperationVariables, initConnectCrypto, initRenownCrypto, isDocumentTypeSupported, isExternalControlsEnabledEventFunctions, isFileNodeKind, isFolderNodeKind, loading, login, logout, makeDriveUrlComponent, makeNodeSlug, makePHEventFunctions, openRenown, parseDriveUrl, phAppConfigHooks, phAppConfigSetters, phDocumentEditorConfigHooks, phDocumentEditorConfigSetters, phDocumentFromQuery, phDocumentsFromQuery, phGlobalConfigHooks, phGlobalConfigSetters, reactorGraphqlBatchFetchDocuments, reactorGraphqlCreateDocument, reactorGraphqlDeleteDocument, reactorGraphqlDeleteDocuments, reactorGraphqlFetchDocument, reactorGraphqlMutateDocument, readPromiseState, refreshReactorData, refreshReactorDataClient, renameDrive, renameDriveNode, resolveUrlPathname, setAllowList, setAllowedDocumentTypes, setAnalyticsDatabaseName, setBasePath, setCliVersion, setDefaultDrivesUrl, setDefaultPHGlobalConfig, setDisabledEditors, setDocumentCache, setDriveAvailableOffline, setDriveSharingType, setDrives, setDrivesPreserveStrategy, setEnabledEditors, setFeatures, setFileUploadOperationsChunkSize, setGaTrackingId, setGlobal, setGraphQLReactorClient, setIsAddCloudDrivesEnabled, setIsAddDriveEnabled, setIsAddLocalDrivesEnabled, setIsAddPublicDrivesEnabled, setIsAnalyticsDatabaseWorkerEnabled, setIsAnalyticsEnabled, setIsAnalyticsExternalProcessorsEnabled, setIsCloudDrivesEnabled, setIsDeleteCloudDrivesEnabled, setIsDeleteLocalDrivesEnabled, setIsDeletePublicDrivesEnabled, setIsDiffAnalyticsEnabled, setIsDocumentModelSelectionSettingsEnabled, setIsDragAndDropEnabled, setIsDriveAnalyticsEnabled, setIsEditorDebugModeEnabled, setIsEditorReadModeEnabled, setIsExternalControlsEnabled, setIsExternalPackagesEnabled, setIsExternalProcessorsEnabled, setIsExternalRelationalProcessorsEnabled, setIsLocalDrivesEnabled, setIsPublicDrivesEnabled, setIsRelationalProcessorsEnabled, setIsSentryTracingEnabled, setLoading, setLocalDrivesEnabled, setLogLevel, setPHAppConfig, setPHAppConfigByKey, setPHDocumentEditorConfig, setPHDocumentEditorConfigByKey, setPHGlobalConfig, setPHGlobalConfigByKey, setPHModal, setPHToast, setPackageDiscoveryService, setReactorClient, setReactorClientModule, setRenown, setRenownChainId, setRenownNetworkId, setRenownUrl, setRequiresHardRefresh, setRevisionHistoryVisible, setRouterBasename, setSelectedDrive, setSelectedDriveId, setSelectedNode, setSelectedTimelineItem, setSelectedTimelineRevision, setSentryDsn, setSentryEnv, setSentryRelease, setStudioMode, setVersion, setVersionCheckInterval, setVetraPackageManager, setWarnOutdatedApp, showCreateDocumentModal, showDeleteNodeModal, showPHModal, showRevisionHistory, sortNodesByName, truncateAllTables, useAllowList, useAllowedDocumentModelModules, useAllowedDocumentTypes, useAnalyticsDatabaseName, useAppModuleById, useAppModules, useBasePath, useCliVersion, useConnectionState, useConnectionStates, useDatabase, useDefaultAppModule, useDefaultDrivesUrl, useDid, useDisabledEditors, useDispatch, useDocument, useDocumentById, useDocumentCache, useDocumentModelModuleById, useDocumentModelModules, useDocumentOfType, useDocumentOperations, useDocumentTypes, useDocumentTypesInSelectedDrive, useDocuments, useDocumentsByIds, useDocumentsInSelectedDrive, useDocumentsInSelectedFolder, useDownloadDocument, useDragNode, useDriveById, useDriveSystemInfo, useDrives, useDrivesPreserveStrategy, useDropFile, useDropNode, useEditorModuleById, useEditorModules, useEditorModulesForDocumentType, useEnabledEditors, useFallbackEditorModule, useFeatures, useFileNodesInSelectedDrive, useFileNodesInSelectedFolder, useFileUploadOperationsChunkSize, useFolderById, useFolderNodesInSelectedDrive, useFolderNodesInSelectedFolder, useGaTrackingId, useGetDocument, useGetDocumentAsync, useGetDocuments, useGetSwitchboardLink, useGraphQLReactorClient, useInitReactorGraphqlClient, useIsAddCloudDrivesEnabled, useIsAddDriveEnabled, useIsAddLocalDrivesEnabled, useIsAddPublicDrivesEnabled, useIsAnalyticsDatabaseWorkerEnabled, useIsAnalyticsEnabled, useIsAnalyticsExternalProcessorsEnabled, useIsCloudDrivesEnabled, useIsDeleteCloudDrivesEnabled, useIsDeleteLocalDrivesEnabled, useIsDeletePublicDrivesEnabled, useIsDiffAnalyticsEnabled, useIsDocumentModelSelectionSettingsEnabled, useIsDragAndDropEnabled, useIsDriveAnalyticsEnabled, useIsEditorDebugModeEnabled, useIsEditorReadModeEnabled, useIsExternalControlsEnabled, useIsExternalPackagesEnabled, useIsExternalProcessorsEnabled, useIsExternalRelationalProcessorsEnabled, useIsLocalDrivesEnabled, useIsPublicDrivesEnabled, useIsRelationalProcessorsEnabled, useIsSentryTracingEnabled, useLoading, useLocalDrivesEnabled, useLogLevel, useLoginStatus, useModelRegistry, useNodeActions, useNodeById, useNodeParentFolderById, useNodePathById, useNodesInSelectedDrive, useNodesInSelectedDriveOrFolder, useNodesInSelectedFolder, useOnDropFile, usePGlite, usePHAppConfigByKey, usePHDocumentEditorConfigByKey, usePHGlobalConfigByKey, usePHModal, usePHToast, usePackageDiscoveryService, useParentFolderForSelectedNode, useReactorClient, useReactorClientModule, useRelationalDb, useRelationalQuery, useRenown, useRenownAuth, useRenownChainId, useRenownInit, useRenownNetworkId, useRenownUrl, useRequiresHardRefresh, useResetPHGlobalConfig, useRevisionHistoryVisible, useRouterBasename, useSelectedDocument, useSelectedDocumentId, useSelectedDocumentOfType, useSelectedDocumentSafe, useSelectedDrive, useSelectedDriveId, useSelectedDriveSafe, useSelectedFolder, useSelectedNode, useSelectedNodePath, useSelectedTimelineItem, useSelectedTimelineRevision, useSentryDsn, useSentryEnv, useSentryRelease, useSetDefaultPHGlobalConfig, useSetPHAppConfig, useSetPHDocumentEditorConfig, useSetPHGlobalConfig, useStudioMode, useSubgraphModules, useSupportedDocumentTypesInReactor, useSync, useSyncList, useUser, useUserPermissions, useVersion, useVersionCheckInterval, useVetraPackageManager, useVetraPackages, useWarnOutdatedApp, validateDocument };
3248
3442
 
3249
3443
  //# sourceMappingURL=index.js.map