@powerhousedao/powerhouse-vetra-packages 6.2.0-dev.2 → 6.2.0-dev.21
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/browser/assets/{entry-Bzani6_n.js → entry-BzMQu_A8.js} +2 -2
- package/dist/browser/assets/{projection-entry-Bpu-8SnI.js → projection-entry-CQb9a2Bz.js} +2 -2
- package/dist/browser/{connect-ZnLjvmRt.js → connect-Bo3FDnsW.js} +45 -45
- package/dist/browser/connect-Bo3FDnsW.js.map +1 -0
- package/dist/browser/{dist-C1nRM9t2.js → dist-8DwGBjee.js} +72 -58
- package/dist/browser/dist-8DwGBjee.js.map +1 -0
- package/dist/browser/{dist-DLFI75Zd.js → dist-DXM8ccKa.js} +46 -7
- package/dist/browser/dist-DXM8ccKa.js.map +1 -0
- package/dist/browser/{document-drive-oqv68jDU.js → document-drive-sTKoi6L4.js} +314 -9
- package/dist/browser/document-drive-sTKoi6L4.js.map +1 -0
- package/dist/browser/document-models/index.js +1 -1
- package/dist/browser/{editor-CoTq6fqT.js → editor-B4oNCwiL.js} +21 -21
- package/dist/browser/editor-B4oNCwiL.js.map +1 -0
- package/dist/browser/{editor-DC3bigBu.js → editor-IU5iuNBj.js} +5 -5
- package/dist/browser/{editor-DC3bigBu.js.map → editor-IU5iuNBj.js.map} +1 -1
- package/dist/browser/editors/document-model-editor/module.js +1 -1
- package/dist/browser/editors/generic-drive-explorer/index.js +5 -5
- package/dist/browser/editors/generic-drive-explorer/index.js.map +1 -1
- package/dist/browser/editors/generic-drive-explorer/module.js +1 -1
- package/dist/browser/{folder-view-DmYBf2pP.js → folder-view-BhY9Mjgv.js} +7 -7
- package/dist/browser/folder-view-BhY9Mjgv.js.map +1 -0
- package/dist/browser/{graphql-editor-CiGd_Li7.js → graphql-editor-Cz-MK2uE.js} +3 -3
- package/dist/browser/{graphql-editor-CiGd_Li7.js.map → graphql-editor-Cz-MK2uE.js.map} +1 -1
- package/dist/browser/index.js +2 -2
- package/dist/browser/{json-editor-sEqd5piI.js → json-editor-BoQLblBv.js} +3 -3
- package/dist/browser/{json-editor-sEqd5piI.js.map → json-editor-BoQLblBv.js.map} +1 -1
- package/dist/browser/{state-schemas-DJmzG_M8.js → state-schemas-C5GjGnKu.js} +12 -12
- package/dist/browser/state-schemas-C5GjGnKu.js.map +1 -0
- package/dist/node/{connect-BLC4PXD9.mjs → connect-CTnyQiGd.mjs} +45 -45
- package/dist/node/connect-CTnyQiGd.mjs.map +1 -0
- package/dist/node/{dist-Cn3iExnV.mjs → dist-C88eUERe.mjs} +46 -7
- package/dist/node/dist-C88eUERe.mjs.map +1 -0
- package/dist/node/{dist-Bm05eoTg.mjs → dist-DUNKfQX4.mjs} +72 -58
- package/dist/node/dist-DUNKfQX4.mjs.map +1 -0
- package/dist/node/{document-drive-sM33juXr.mjs → document-drive-DjL9iikf.mjs} +314 -9
- package/dist/node/document-drive-DjL9iikf.mjs.map +1 -0
- package/dist/node/document-models/index.mjs +1 -1
- package/dist/node/{editor-BFBa9nsO.mjs → editor-BckQifh7.mjs} +21 -21
- package/dist/node/editor-BckQifh7.mjs.map +1 -0
- package/dist/node/{editor-BrS98lEH.mjs → editor-m0rY3A7P.mjs} +5 -5
- package/dist/node/{editor-BrS98lEH.mjs.map → editor-m0rY3A7P.mjs.map} +1 -1
- package/dist/node/editors/document-model-editor/module.mjs +1 -1
- package/dist/node/editors/generic-drive-explorer/index.mjs +5 -5
- package/dist/node/editors/generic-drive-explorer/index.mjs.map +1 -1
- package/dist/node/editors/generic-drive-explorer/module.mjs +1 -1
- package/dist/node/{folder-view-DHph3Yuu.mjs → folder-view-ClopFdxe.mjs} +7 -7
- package/dist/node/folder-view-ClopFdxe.mjs.map +1 -0
- package/dist/node/{graphql-editor-CPq7oIbf.mjs → graphql-editor-DXkhnv8j.mjs} +3 -3
- package/dist/node/{graphql-editor-CPq7oIbf.mjs.map → graphql-editor-DXkhnv8j.mjs.map} +1 -1
- package/dist/node/index.mjs +2 -2
- package/dist/node/{json-editor-L32CP7TS.mjs → json-editor-Dr57NX3w.mjs} +3 -3
- package/dist/node/{json-editor-L32CP7TS.mjs.map → json-editor-Dr57NX3w.mjs.map} +1 -1
- package/dist/node/{state-schemas-XTTjQZOe.mjs → state-schemas-D6aPAH4x.mjs} +12 -12
- package/dist/node/state-schemas-D6aPAH4x.mjs.map +1 -0
- package/package.json +6 -6
- package/dist/browser/connect-ZnLjvmRt.js.map +0 -1
- package/dist/browser/dist-C1nRM9t2.js.map +0 -1
- package/dist/browser/dist-DLFI75Zd.js.map +0 -1
- package/dist/browser/document-drive-oqv68jDU.js.map +0 -1
- package/dist/browser/editor-CoTq6fqT.js.map +0 -1
- package/dist/browser/folder-view-DmYBf2pP.js.map +0 -1
- package/dist/browser/state-schemas-DJmzG_M8.js.map +0 -1
- package/dist/node/connect-BLC4PXD9.mjs.map +0 -1
- package/dist/node/dist-Bm05eoTg.mjs.map +0 -1
- package/dist/node/dist-Cn3iExnV.mjs.map +0 -1
- package/dist/node/document-drive-sM33juXr.mjs.map +0 -1
- package/dist/node/editor-BFBa9nsO.mjs.map +0 -1
- package/dist/node/folder-view-DHph3Yuu.mjs.map +0 -1
- package/dist/node/state-schemas-XTTjQZOe.mjs.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { E as __commonJSMin, j as __toESM, t as capitalCase } from "./dist-fA4EItr0.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { a as SyncStatus, n as require_main, o as
|
|
2
|
+
import { B as setName, C as createZip, J as validateModules, X as generateId, Y as validateStateSchemaName, _ as baseLoadFromInputVersioned, a as handleTargetNameCollisions, b as createPresignedHeader, c as moveNode, d as logger, g as baseLoadFromInput, i as generateNodesCopy, j as replayDocumentVersioned, l as updateNode, n as copyNode, o as isFileNode, q as validateInitialState, r as driveDocumentModelModule, s as isFolderNode, t as addFolder$1, u as documentModelDocumentModelModule, v as baseSaveToFileHandle, y as buildSignedAction } from "./document-drive-DjL9iikf.mjs";
|
|
3
|
+
import { a as SyncStatus, n as require_main, o as DriveCollectionId, s as ModuleNotFoundError, t as reactorDriveDocumentModelModule } from "./dist-C88eUERe.mjs";
|
|
4
4
|
import { Children, cloneElement, forwardRef, isValidElement, use, useEffect, useMemo, useState, useSyncExternalStore } from "react";
|
|
5
5
|
import "react/jsx-runtime";
|
|
6
|
-
//#region ../reactor-browser/dist/make-ph-event-functions-
|
|
6
|
+
//#region ../reactor-browser/dist/make-ph-event-functions-BHoLPif5.js
|
|
7
7
|
const isServer$1 = typeof window === "undefined";
|
|
8
8
|
function makePHEventFunctions(key) {
|
|
9
9
|
const setEventName = `ph:set${capitalCase(key)}`;
|
|
@@ -51,7 +51,7 @@ function makePHEventFunctions(key) {
|
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
53
|
//#endregion
|
|
54
|
-
//#region ../reactor-browser/dist/document-by-id-
|
|
54
|
+
//#region ../reactor-browser/dist/document-by-id-dLYFX-xz.js
|
|
55
55
|
async function queueActions(document, actionOrActions) {
|
|
56
56
|
if (!document) throw new Error("No document provided");
|
|
57
57
|
if (!actionOrActions) throw new Error("No actions provided");
|
|
@@ -214,7 +214,7 @@ function useDocumentById(id) {
|
|
|
214
214
|
return [document, dispatch];
|
|
215
215
|
}
|
|
216
216
|
//#endregion
|
|
217
|
-
//#region ../reactor-browser/dist/client-
|
|
217
|
+
//#region ../reactor-browser/dist/client-_Gh2Uf0E.js
|
|
218
218
|
var import_main = require_main();
|
|
219
219
|
const PhDocumentFieldsFragmentDoc = import_main.gql`
|
|
220
220
|
fragment PHDocumentFields on PHDocument {
|
|
@@ -283,13 +283,6 @@ const GetDocumentWithOperationsDocument = import_main.gql`
|
|
|
283
283
|
timestampUtcMs
|
|
284
284
|
input
|
|
285
285
|
scope
|
|
286
|
-
attachments {
|
|
287
|
-
data
|
|
288
|
-
mimeType
|
|
289
|
-
hash
|
|
290
|
-
extension
|
|
291
|
-
fileName
|
|
292
|
-
}
|
|
293
286
|
context {
|
|
294
287
|
signer {
|
|
295
288
|
user {
|
|
@@ -402,13 +395,6 @@ const GetDocumentOperationsDocument = import_main.gql`
|
|
|
402
395
|
timestampUtcMs
|
|
403
396
|
input
|
|
404
397
|
scope
|
|
405
|
-
attachments {
|
|
406
|
-
data
|
|
407
|
-
mimeType
|
|
408
|
-
hash
|
|
409
|
-
extension
|
|
410
|
-
fileName
|
|
411
|
-
}
|
|
412
398
|
context {
|
|
413
399
|
signer {
|
|
414
400
|
user {
|
|
@@ -659,13 +645,6 @@ import_main.gql`
|
|
|
659
645
|
timestampUtcMs
|
|
660
646
|
input
|
|
661
647
|
scope
|
|
662
|
-
attachments {
|
|
663
|
-
data
|
|
664
|
-
mimeType
|
|
665
|
-
hash
|
|
666
|
-
extension
|
|
667
|
-
fileName
|
|
668
|
-
}
|
|
669
648
|
context {
|
|
670
649
|
signer {
|
|
671
650
|
user {
|
|
@@ -747,7 +726,7 @@ function extractQueryParts(doc, fallbackBody) {
|
|
|
747
726
|
extractSelectionSet(GetDocumentOperationsDocument, "documentOperations", "{ items { index } }");
|
|
748
727
|
extractQueryParts(GetDocumentDocument, "document(identifier: $identifier) { document { id name documentType state revisionsList { scope revision } createdAtUtcIso lastModifiedAtUtcIso } childIds }");
|
|
749
728
|
//#endregion
|
|
750
|
-
//#region ../reactor-browser/dist/renown-
|
|
729
|
+
//#region ../reactor-browser/dist/renown-D-1c_Bvx.js
|
|
751
730
|
const { useValue: useLoading, setValue: setLoading, addEventHandler: addLoadingEventHandler } = makePHEventFunctions("loading");
|
|
752
731
|
const renownEventFunctions = makePHEventFunctions("renown");
|
|
753
732
|
renownEventFunctions.addEventHandler;
|
|
@@ -2510,14 +2489,30 @@ async function exportFile(document, suggestedName) {
|
|
|
2510
2489
|
if (!(e instanceof DOMException && e.name === "AbortError")) throw e;
|
|
2511
2490
|
}
|
|
2512
2491
|
}
|
|
2492
|
+
/**
|
|
2493
|
+
* Loads a document file and replays it with version-aware reducers from the registry.
|
|
2494
|
+
* Falls back to single-version legacy replay when no upgrade manifest is registered for
|
|
2495
|
+
* the document type.
|
|
2496
|
+
*/
|
|
2513
2497
|
async function loadFile(path) {
|
|
2514
2498
|
const baseDocument = await baseLoadFromInput(path, (state) => state, { checkHashes: true });
|
|
2515
2499
|
const reactorClient = window.ph?.reactorClient;
|
|
2516
2500
|
if (!reactorClient) throw new Error("ReactorClient not initialized");
|
|
2501
|
+
const documentType = baseDocument.header.documentType;
|
|
2517
2502
|
const { results: documentModelModules } = await reactorClient.getDocumentModelModules();
|
|
2518
|
-
const
|
|
2519
|
-
if (
|
|
2520
|
-
|
|
2503
|
+
const modulesForType = documentModelModules.filter((module) => module.documentModel.global.id === documentType);
|
|
2504
|
+
if (modulesForType.length === 0) throw new DocumentModelNotFoundError(documentType);
|
|
2505
|
+
const reducers = {};
|
|
2506
|
+
for (const module of modulesForType) reducers[module.version ?? 1] = module.reducer;
|
|
2507
|
+
const registry = window.ph?.reactorClientModule?.reactorModule?.documentModelRegistry;
|
|
2508
|
+
let upgradeManifest;
|
|
2509
|
+
if (registry) try {
|
|
2510
|
+
upgradeManifest = registry.getUpgradeManifest(documentType);
|
|
2511
|
+
} catch {}
|
|
2512
|
+
return baseLoadFromInputVersioned(path, {
|
|
2513
|
+
reducers,
|
|
2514
|
+
upgradeManifest
|
|
2515
|
+
});
|
|
2521
2516
|
}
|
|
2522
2517
|
async function addDocument(driveId, name, documentType, parentFolder, document, id, preferredEditor) {
|
|
2523
2518
|
const { isAllowedToCreateDocuments } = getUserPermissions();
|
|
@@ -2639,9 +2634,28 @@ async function moveNode$1(driveId, src, target) {
|
|
|
2639
2634
|
targetParentFolder: target?.id
|
|
2640
2635
|
})]);
|
|
2641
2636
|
}
|
|
2637
|
+
/**
|
|
2638
|
+
* Duplicates a document under a new id using version-aware replay.
|
|
2639
|
+
* Falls back gracefully when no upgrade manifest is registered for the document type.
|
|
2640
|
+
*/
|
|
2642
2641
|
async function _duplicateDocument(reactor, document, newId = generateId()) {
|
|
2643
|
-
const
|
|
2644
|
-
|
|
2642
|
+
const documentType = document.header.documentType;
|
|
2643
|
+
const { results: allModules } = await reactor.getDocumentModelModules();
|
|
2644
|
+
const modulesForType = allModules.filter((m) => m.documentModel.global.id === documentType);
|
|
2645
|
+
const reducers = {};
|
|
2646
|
+
for (const m of modulesForType) reducers[m.version ?? 1] = m.reducer;
|
|
2647
|
+
if (Object.keys(reducers).length === 0) throw new Error(`Document model module not found for type: ${documentType}`);
|
|
2648
|
+
const registry = window.ph?.reactorClientModule?.reactorModule?.documentModelRegistry;
|
|
2649
|
+
let upgradeManifest;
|
|
2650
|
+
if (registry) try {
|
|
2651
|
+
upgradeManifest = registry.getUpgradeManifest(documentType);
|
|
2652
|
+
} catch {}
|
|
2653
|
+
const config = {
|
|
2654
|
+
reducers,
|
|
2655
|
+
upgradeManifest
|
|
2656
|
+
};
|
|
2657
|
+
const header = createPresignedHeader(newId, documentType);
|
|
2658
|
+
return replayDocumentVersioned(document.initialState, document.operations, config, header);
|
|
2645
2659
|
}
|
|
2646
2660
|
async function copyNode$1(driveId, src, target) {
|
|
2647
2661
|
const reactor = window.ph?.reactorClient;
|
|
@@ -2681,6 +2695,29 @@ async function copyNode$1(driveId, src, target) {
|
|
|
2681
2695
|
}
|
|
2682
2696
|
return await queueActions(drive, copyNodesInput.map((copyNodeInput) => copyNode(copyNodeInput)));
|
|
2683
2697
|
}
|
|
2698
|
+
const modalEventFunctions = makePHEventFunctions("modal");
|
|
2699
|
+
modalEventFunctions.useValue;
|
|
2700
|
+
/** Sets the current modal */
|
|
2701
|
+
const setPHModal = modalEventFunctions.setValue;
|
|
2702
|
+
modalEventFunctions.addEventHandler;
|
|
2703
|
+
/** Shows a modal */
|
|
2704
|
+
function showPHModal(modal) {
|
|
2705
|
+
setPHModal(modal);
|
|
2706
|
+
}
|
|
2707
|
+
/** Shows the create document modal */
|
|
2708
|
+
function showCreateDocumentModal(documentType) {
|
|
2709
|
+
setPHModal({
|
|
2710
|
+
type: "createDocument",
|
|
2711
|
+
documentType
|
|
2712
|
+
});
|
|
2713
|
+
}
|
|
2714
|
+
/** Shows the delete node modal */
|
|
2715
|
+
function showDeleteNodeModal(nodeOrId) {
|
|
2716
|
+
setPHModal({
|
|
2717
|
+
type: "deleteItem",
|
|
2718
|
+
id: typeof nodeOrId === "string" ? nodeOrId : nodeOrId.id
|
|
2719
|
+
});
|
|
2720
|
+
}
|
|
2684
2721
|
const baseDocumentModelsMap = {
|
|
2685
2722
|
DocumentModel: documentModelDocumentModelModule,
|
|
2686
2723
|
DocumentDrive: driveDocumentModelModule,
|
|
@@ -3205,29 +3242,6 @@ const graphQLReactorClientEventFunctions = makePHEventFunctions("reactorGraphQLC
|
|
|
3205
3242
|
graphQLReactorClientEventFunctions.useValue;
|
|
3206
3243
|
graphQLReactorClientEventFunctions.setValue;
|
|
3207
3244
|
graphQLReactorClientEventFunctions.addEventHandler;
|
|
3208
|
-
const modalEventFunctions = makePHEventFunctions("modal");
|
|
3209
|
-
modalEventFunctions.useValue;
|
|
3210
|
-
/** Sets the current modal */
|
|
3211
|
-
const setPHModal = modalEventFunctions.setValue;
|
|
3212
|
-
modalEventFunctions.addEventHandler;
|
|
3213
|
-
/** Shows a modal */
|
|
3214
|
-
function showPHModal(modal) {
|
|
3215
|
-
setPHModal(modal);
|
|
3216
|
-
}
|
|
3217
|
-
/** Shows the create document modal */
|
|
3218
|
-
function showCreateDocumentModal(documentType) {
|
|
3219
|
-
setPHModal({
|
|
3220
|
-
type: "createDocument",
|
|
3221
|
-
documentType
|
|
3222
|
-
});
|
|
3223
|
-
}
|
|
3224
|
-
/** Shows the delete node modal */
|
|
3225
|
-
function showDeleteNodeModal(nodeOrId) {
|
|
3226
|
-
setPHModal({
|
|
3227
|
-
type: "deleteItem",
|
|
3228
|
-
id: typeof nodeOrId === "string" ? nodeOrId : nodeOrId.id
|
|
3229
|
-
});
|
|
3230
|
-
}
|
|
3231
3245
|
const packageDiscoveryFunctions = makePHEventFunctions("packageDiscoveryService");
|
|
3232
3246
|
packageDiscoveryFunctions.useValue;
|
|
3233
3247
|
packageDiscoveryFunctions.setValue;
|
|
@@ -3670,12 +3684,12 @@ function useGetSwitchboardLink(document) {
|
|
|
3670
3684
|
const remotes = useSyncList();
|
|
3671
3685
|
const isRemoteDrive = useMemo(() => {
|
|
3672
3686
|
if (!e$4(drive)) return false;
|
|
3673
|
-
return remotes.some((remote) => remote.collectionId
|
|
3687
|
+
return remotes.some((remote) => remote.collectionId.equals(DriveCollectionId.forDrive(drive.header.id)));
|
|
3674
3688
|
}, [remotes, drive]);
|
|
3675
3689
|
const remoteUrl = useMemo(() => {
|
|
3676
3690
|
if (!e$4(drive)) return null;
|
|
3677
3691
|
try {
|
|
3678
|
-
const channelUrl = (remotes.find((remote) => remote.collectionId
|
|
3692
|
+
const channelUrl = (remotes.find((remote) => remote.collectionId.equals(DriveCollectionId.forDrive(drive.header.id)))?.channel)?.config.url;
|
|
3679
3693
|
if (typeof channelUrl === "string") return channelUrl;
|
|
3680
3694
|
return null;
|
|
3681
3695
|
} catch (error) {
|
|
@@ -3766,4 +3780,4 @@ createDebouncedRefreshReactorDataClient();
|
|
|
3766
3780
|
//#endregion
|
|
3767
3781
|
export { e$4 as A, useSelectedDriveSafe as C, useTheme as D, useSetPHDocumentEditorConfig as E, t$5 as M, useDocumentById as N, useUserPermissions as O, useSelectedDriveId as S, useSetPHAppConfig as T, useNodeParentFolderById as _, setSelectedDrive as a, useSelectedDocumentOfType as b, showDeleteNodeModal as c, useDownloadDocument as d, useDragNode as f, useNodeById as g, useNodeActions as h, isFolderNodeKind as i, t$2 as j, e$1 as k, showRevisionHistory as l, useGetSwitchboardLink as m, getSyncStatusSync as n, setSelectedNode as o, useDropNode as p, isFileNodeKind as r, showCreateDocumentModal as s, addFolder as t, useDocumentModelModules as u, useNodesInSelectedDriveOrFolder as v, useSelectedNodePath as w, useSelectedDocumentSafe as x, usePHToast as y };
|
|
3768
3782
|
|
|
3769
|
-
//# sourceMappingURL=dist-
|
|
3783
|
+
//# sourceMappingURL=dist-DUNKfQX4.mjs.map
|