@powerhousedao/powerhouse-vetra-packages 6.0.0-dev.157 → 6.0.0-dev.159

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.
Files changed (23) hide show
  1. package/dist/browser/{connect-Cn1Z-bIf.js → connect-CqgC4hVb.js} +46 -18
  2. package/dist/browser/{connect-Cn1Z-bIf.js.map → connect-CqgC4hVb.js.map} +1 -1
  3. package/dist/browser/{editor-CmLdichb.js → editor-Co9C4IUF.js} +3 -3
  4. package/dist/browser/{editor-CmLdichb.js.map → editor-Co9C4IUF.js.map} +1 -1
  5. package/dist/browser/{editor-QWsihnhU.js → editor-DRrbmiEF.js} +2 -2
  6. package/dist/browser/{editor-QWsihnhU.js.map → editor-DRrbmiEF.js.map} +1 -1
  7. package/dist/browser/editors/document-model-editor/module.js +1 -1
  8. package/dist/browser/editors/generic-drive-explorer/index.js +2 -2
  9. package/dist/browser/editors/generic-drive-explorer/module.js +1 -1
  10. package/dist/browser/{folder-view-DBGC4XY_.js → folder-view-CUfNql-u.js} +2 -2
  11. package/dist/browser/{folder-view-DBGC4XY_.js.map → folder-view-CUfNql-u.js.map} +1 -1
  12. package/dist/node/{connect-M_AtbeuW.mjs → connect-BOt-Lao5.mjs} +46 -18
  13. package/dist/node/{connect-M_AtbeuW.mjs.map → connect-BOt-Lao5.mjs.map} +1 -1
  14. package/dist/node/{editor-C98TmHzK.mjs → editor-BfiJY6uk.mjs} +3 -3
  15. package/dist/node/{editor-C98TmHzK.mjs.map → editor-BfiJY6uk.mjs.map} +1 -1
  16. package/dist/node/{editor-CK4faCta.mjs → editor-nb0yEHNl.mjs} +2 -2
  17. package/dist/node/{editor-CK4faCta.mjs.map → editor-nb0yEHNl.mjs.map} +1 -1
  18. package/dist/node/editors/document-model-editor/module.mjs +1 -1
  19. package/dist/node/editors/generic-drive-explorer/index.mjs +2 -2
  20. package/dist/node/editors/generic-drive-explorer/module.mjs +1 -1
  21. package/dist/node/{folder-view-CshxsV4g.mjs → folder-view-CRp2HHSb.mjs} +2 -2
  22. package/dist/node/{folder-view-CshxsV4g.mjs.map → folder-view-CRp2HHSb.mjs.map} +1 -1
  23. package/package.json +5 -5
@@ -45855,7 +45855,7 @@ const AccountPopover = ({ children, content }) => {
45855
45855
  children: content
45856
45856
  })] });
45857
45857
  };
45858
- const ConnectLoaderVideo = new URL("../../../../assets/connect-loader.mp4", import.meta.url).href;
45858
+ const ConnectLoaderVideo = new URL("../assets/connect-loader.mp4", import.meta.url).href;
45859
45859
  function AnimatedLoader(props) {
45860
45860
  const { style, size = 100, ...delegatedProps } = props;
45861
45861
  const dimensions = getDimensions(size);
@@ -74765,14 +74765,44 @@ async function getDocumentExtension(document) {
74765
74765
  }
74766
74766
  return (rawExtension ?? "phdm").replace(/^\.+|\.+$/g, "") || "phdm";
74767
74767
  }
74768
+ const BASE_STATE_KEYS = new Set(["auth", "document"]);
74769
+ /**
74770
+ * Fetches all operations for a document using cursor-based pagination.
74771
+ * The reactor client handles multi-scope cursors transparently via
74772
+ * composite cursors, so all scopes are fetched in a single paginated stream.
74773
+ */
74774
+ async function fetchDocumentOperations(reactorClient, document, pageSize = 100) {
74775
+ const scopes = Object.keys(document.state).filter((k) => !BASE_STATE_KEYS.has(k));
74776
+ const operations = {};
74777
+ for (const scope of scopes) operations[scope] = [];
74778
+ let cursor = "";
74779
+ do {
74780
+ const page = await reactorClient.getOperations(document.header.id, { scopes }, void 0, {
74781
+ cursor,
74782
+ limit: pageSize
74783
+ });
74784
+ for (const op of page.results) {
74785
+ const scope = op.action.scope ?? "global";
74786
+ if (operations[scope]) operations[scope].push(op);
74787
+ }
74788
+ cursor = page.nextCursor ?? "";
74789
+ } while (cursor);
74790
+ return operations;
74791
+ }
74768
74792
  async function exportFile(document, suggestedName) {
74769
- if (!window.ph?.reactorClient) throw new Error("ReactorClient not initialized");
74770
- const extension = await getDocumentExtension(document);
74771
- const name = `${suggestedName || document.header.name || "Untitled"}.${extension}.phd`;
74772
- if (!window.showSaveFilePicker) return downloadFile(document, name);
74793
+ const reactorClient = window.ph?.reactorClient;
74794
+ if (!reactorClient) throw new Error("ReactorClient not initialized");
74795
+ const operations = await fetchDocumentOperations(reactorClient, document);
74796
+ const documentWithOps = {
74797
+ ...document,
74798
+ operations
74799
+ };
74800
+ const extension = await getDocumentExtension(documentWithOps);
74801
+ const name = `${suggestedName || documentWithOps.header.name || "Untitled"}.${extension}.phd`;
74802
+ if (!window.showSaveFilePicker) return downloadFile(documentWithOps, name);
74773
74803
  try {
74774
74804
  const fileHandle = await window.showSaveFilePicker({ suggestedName: name });
74775
- await baseSaveToFileHandle(document, fileHandle);
74805
+ await baseSaveToFileHandle(documentWithOps, fileHandle);
74776
74806
  return fileHandle;
74777
74807
  } catch (e) {
74778
74808
  if (!(e instanceof DOMException && e.name === "AbortError")) throw e;
@@ -74836,9 +74866,7 @@ async function addFile(file, driveId, name, parentFolder) {
74836
74866
  }, {})
74837
74867
  };
74838
74868
  await addDocument(driveId, name || document.header.name, document.header.documentType, parentFolder, initialDocument, documentId, document.header.meta?.preferredEditor);
74839
- uploadOperations(documentId, document.operations, queueOperations).catch((error) => {
74840
- throw error;
74841
- });
74869
+ await uploadOperations(documentId, document.operations, queueOperations);
74842
74870
  }
74843
74871
  async function addFileWithProgress(file, driveId, name, parentFolder, onProgress, documentTypes, resolveConflict) {
74844
74872
  logger.verbose(`addFileWithProgress(drive: ${driveId}, name: ${name}, folder: ${parentFolder})`);
@@ -79081,7 +79109,7 @@ function EditorUndoRedoButtons(props) {
79081
79109
  })]
79082
79110
  });
79083
79111
  }
79084
- const ImgPowerhouse = new URL("../../../../assets/powerhouse-rounded.png", import.meta.url).href;
79112
+ const ImgPowerhouse = new URL("../assets/powerhouse-rounded.png", import.meta.url).href;
79085
79113
  function ENSAvatar(props) {
79086
79114
  const { address, chainId = 1, size = "14px" } = props;
79087
79115
  const style = {
@@ -79273,9 +79301,9 @@ const documentTypes = [
79273
79301
  DEFAULT,
79274
79302
  MAKERDAO_RWA_PORTFOLIO
79275
79303
  ];
79276
- const BudgetStatementImg = new URL("../../../assets/icons/budget.png", import.meta.url).href;
79277
- const MakerdaoRWAPortfolioImg = new URL("../../../assets/icons/rwa-report.png", import.meta.url).href;
79278
- const DefaultImg = new URL("../../../assets/icons/template.png", import.meta.url).href;
79304
+ const BudgetStatementImg = new URL("../assets/icons/budget.png", import.meta.url).href;
79305
+ const MakerdaoRWAPortfolioImg = new URL("../assets/icons/rwa-report.png", import.meta.url).href;
79306
+ const DefaultImg = new URL("../assets/icons/template.png", import.meta.url).href;
79279
79307
  const iconMap = {
79280
79308
  [BUDGET]: BudgetStatementImg,
79281
79309
  [DEFAULT]: DefaultImg,
@@ -79825,8 +79853,8 @@ function AddRemoteDriveForm(props) {
79825
79853
  })] })
79826
79854
  });
79827
79855
  }
79828
- const HomeBgAvif = new URL("../../../../assets/home-bg.avif", import.meta.url).href;
79829
- const HomeBg = new URL("../../../../assets/home-bg.png", import.meta.url).href;
79856
+ const HomeBgAvif = new URL("../assets/home-bg.avif", import.meta.url).href;
79857
+ const HomeBg = new URL("../assets/home-bg.png", import.meta.url).href;
79830
79858
  function HomeBackgroundImage() {
79831
79859
  return /* @__PURE__ */ jsxs("picture", {
79832
79860
  className: "pointer-events-none absolute inset-8 z-0 size-[calc(100%-32px)] object-contain",
@@ -83818,8 +83846,8 @@ const AccountPopoverLogin = ({ onLogin }) => {
83818
83846
  })]
83819
83847
  });
83820
83848
  };
83821
- const renownShort = new URL("../../../../assets/renown-short.png", import.meta.url).href;
83822
- const renownShortHover = new URL("../../../../assets/renown-short-hover.png", import.meta.url).href;
83849
+ const renownShort = new URL("../assets/renown-short.png", import.meta.url).href;
83850
+ const renownShortHover = new URL("../assets/renown-short-hover.png", import.meta.url).href;
83823
83851
  const SidebarLogin = ({ onLogin }) => {
83824
83852
  return /* @__PURE__ */ jsx(AccountPopover, {
83825
83853
  content: /* @__PURE__ */ jsx(AccountPopoverLogin, { onLogin }),
@@ -84157,4 +84185,4 @@ const removeSuccessFiles = (files) => {
84157
84185
  //#endregion
84158
84186
  export { useSelectedFolder$1 as C, useUserPermissions$1 as E, useSelectedDocumentOfType as S, useSetPHDocumentEditorConfig as T, isFolderNodeKind$1 as _, FolderItem as a, useNodesInSelectedDriveOrFolder as b, Controller as c, get as d, set as f, isFileNodeKind as g, cva as h, FileItem as i, FormProvider as l, useFormContext as m, ConnectSearchBar as n, useDrop as o, useForm as p, DocumentToolbar as r, useVirtualizer as s, Breadcrumbs as t, appendErrors as u, showCreateDocumentModal as v, useSetPHAppConfig as w, usePHToast$1 as x, useDocumentModelModules$1 as y };
84159
84187
 
84160
- //# sourceMappingURL=connect-Cn1Z-bIf.js.map
84188
+ //# sourceMappingURL=connect-CqgC4hVb.js.map