@powerhousedao/connect 1.0.21-dev.0 → 1.0.22-dev.0

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 (28) hide show
  1. package/dist/assets/{app-5pzhkdPA.js → app-DOR_8r1B.js} +13 -13
  2. package/dist/assets/{app-5pzhkdPA.js.map → app-DOR_8r1B.js.map} +1 -1
  3. package/dist/assets/{app-loader-DMIJ7HEl.js → app-loader-uXeiy6sl.js} +121 -149
  4. package/dist/assets/app-loader-uXeiy6sl.js.map +1 -0
  5. package/dist/assets/{browser-C3ZBRkVS.js → browser-B5bfipse.js} +4 -4
  6. package/dist/assets/{browser-C3ZBRkVS.js.map → browser-B5bfipse.js.map} +1 -1
  7. package/dist/assets/{ccip-B3SqXqYN.js → ccip-Cu6cyUtU.js} +4 -4
  8. package/dist/assets/{ccip-B3SqXqYN.js.map → ccip-Cu6cyUtU.js.map} +1 -1
  9. package/dist/assets/{content-CS3pyItT.js → content-Cxj0K1dm.js} +5 -5
  10. package/dist/assets/{content-CS3pyItT.js.map → content-Cxj0K1dm.js.map} +1 -1
  11. package/dist/assets/{index-CS_ENEm9.js → index-B7pq58I6.js} +4 -4
  12. package/dist/assets/{index-CS_ENEm9.js.map → index-B7pq58I6.js.map} +1 -1
  13. package/dist/assets/{index-CTQoMeBS.js → index-BBO5Ckrr.js} +5 -5
  14. package/dist/assets/{index-CTQoMeBS.js.map → index-BBO5Ckrr.js.map} +1 -1
  15. package/dist/assets/{index-CgD_N1bp.js → index-CT91u5m_.js} +4 -4
  16. package/dist/assets/{index-CgD_N1bp.js.map → index-CT91u5m_.js.map} +1 -1
  17. package/dist/assets/{index-BMVX6QN3.js → index-Ct3xGcDm.js} +4 -4
  18. package/dist/assets/{index-BMVX6QN3.js.map → index-Ct3xGcDm.js.map} +1 -1
  19. package/dist/assets/{main.D_01qktv.js → main.CMSwP7lX.js} +2 -2
  20. package/dist/assets/{main.D_01qktv.js.map → main.CMSwP7lX.js.map} +1 -1
  21. package/dist/assets/{reactor-analytics-Byaaas4F.js → reactor-analytics-CrWekgnx.js} +6 -6
  22. package/dist/assets/{reactor-analytics-Byaaas4F.js.map → reactor-analytics-CrWekgnx.js.map} +1 -1
  23. package/dist/assets/{router-BMJPZDcx.js → router-BDGkWvYS.js} +6 -6
  24. package/dist/assets/{router-BMJPZDcx.js.map → router-BDGkWvYS.js.map} +1 -1
  25. package/dist/index.html +1 -1
  26. package/dist/vite-envs.sh +1 -1
  27. package/package.json +7 -7
  28. package/dist/assets/app-loader-DMIJ7HEl.js.map +0 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-5pzhkdPA.js","assets/main.D_01qktv.js","assets/app-CmlD3Pwe.css"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-DOR_8r1B.js","assets/main.CMSwP7lX.js","assets/app-CmlD3Pwe.css"])))=>i.map(i=>d[i]);
2
2
  var __defProp = Object.defineProperty;
3
3
  var __typeError = (msg) => {
4
4
  throw TypeError(msg);
@@ -11,7 +11,7 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
11
11
  var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
12
12
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
13
13
  var _tags, _levelString, _errorHandler, _ConsoleLogger_instances, levelValue_get, _getDocumentModelModule, _drives, _ReadModeService_instances, parseGraphQLErrors_fn, fetchDrive_fn, _a, _ServiceWorkerManager_instances, handleServiceWorkerMessage_fn, handleServiceWorker_fn;
14
- import { _ as __vitePreload } from "./main.D_01qktv.js";
14
+ import { _ as __vitePreload } from "./main.CMSwP7lX.js";
15
15
  import { jsx, jsxs } from "react/jsx-runtime";
16
16
  import { useState, useEffect, Suspense, lazy } from "react";
17
17
  function _mergeNamespaces(n, m) {
@@ -425,8 +425,8 @@ function isBE() {
425
425
  return buf[0] === 254;
426
426
  }
427
427
  const FileSystemError = new Error("File system not available.");
428
- function generateUUID$1() {
429
- if (!crypto.randomUUID) {
428
+ function generateUUID() {
429
+ if (typeof crypto === "undefined" || !crypto.randomUUID) {
430
430
  throw new Error("generateUUID is not available in unsecure contexts.");
431
431
  }
432
432
  return crypto.randomUUID();
@@ -6814,7 +6814,7 @@ function loadStateOperation(oldDocument, newDocument) {
6814
6814
  };
6815
6815
  }
6816
6816
  function generateId(method) {
6817
- return generateUUID$1();
6817
+ return generateUUID();
6818
6818
  }
6819
6819
  function getUnixTimestamp(date) {
6820
6820
  return (new Date(date).getTime() / 1e3).toFixed(0);
@@ -7230,6 +7230,9 @@ function replayDocument(initialState, operations, reducer2, dispatch, header, sk
7230
7230
  operationsToReplay.push(...Object.values(operations).flat());
7231
7231
  }
7232
7232
  const document = baseCreateDocument(documentState);
7233
+ if (header == null ? void 0 : header.slug) {
7234
+ document.slug = header.slug;
7235
+ }
7233
7236
  document.initialState = initialState;
7234
7237
  document.operations = initialOperations;
7235
7238
  let result = document;
@@ -10994,40 +10997,6 @@ class SynchronizationUnitNotFoundError extends Error {
10994
10997
  }
10995
10998
  const isValidDocumentId = (id) => /^[a-zA-Z0-9_-]+$/.test(id);
10996
10999
  const isValidSlug = (slug) => /^[a-zA-Z0-9_-]+$/.test(slug);
10997
- const byteToHex = [];
10998
- for (let i = 0; i < 256; ++i) {
10999
- byteToHex.push((i + 256).toString(16).slice(1));
11000
- }
11001
- function unsafeStringify(arr, offset = 0) {
11002
- return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
11003
- }
11004
- let getRandomValues;
11005
- const rnds8 = new Uint8Array(16);
11006
- function rng() {
11007
- if (!getRandomValues) {
11008
- if (typeof crypto === "undefined" || !crypto.getRandomValues) {
11009
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
11010
- }
11011
- getRandomValues = crypto.getRandomValues.bind(crypto);
11012
- }
11013
- return getRandomValues(rnds8);
11014
- }
11015
- const randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
11016
- const native = { randomUUID };
11017
- function v4(options, buf, offset) {
11018
- var _a2;
11019
- if (native.randomUUID && true && !options) {
11020
- return native.randomUUID();
11021
- }
11022
- options = options || {};
11023
- const rnds = options.random ?? ((_a2 = options.rng) == null ? void 0 : _a2.call(options)) ?? rng();
11024
- if (rnds.length < 16) {
11025
- throw new Error("Random bytes length must be >= 16");
11026
- }
11027
- rnds[6] = rnds[6] & 15 | 64;
11028
- rnds[8] = rnds[8] & 63 | 128;
11029
- return unsafeStringify(rnds);
11030
- }
11031
11000
  function isFileNode(node) {
11032
11001
  return node.kind === "file";
11033
11002
  }
@@ -11091,7 +11060,7 @@ function generateNodesCopy(src, idGenerator, nodes) {
11091
11060
  function generateSynchronizationUnitId(nodes) {
11092
11061
  let syncId = "";
11093
11062
  while (!syncId || nodes.find((node) => isFileNode(node) && node.synchronizationUnits.find((unit) => unit.syncId === syncId))) {
11094
- syncId = v4();
11063
+ syncId = generateId();
11095
11064
  }
11096
11065
  return syncId;
11097
11066
  }
@@ -11278,8 +11247,9 @@ const reducer$1 = {
11278
11247
  });
11279
11248
  const newNode = {
11280
11249
  ...node,
11281
- name: name2,
11282
11250
  id: action.input.targetId,
11251
+ slug: action.input.targetId,
11252
+ name: name2,
11283
11253
  parentFolder: action.input.targetParentFolder || null
11284
11254
  };
11285
11255
  const isFile = isFileNode(newNode);
@@ -11924,9 +11894,6 @@ function mergeOperations(currentOperations, newOperations) {
11924
11894
  return { ...acc, [curr.scope]: [...existingOperations, curr] };
11925
11895
  }, currentOperations);
11926
11896
  }
11927
- function generateUUID() {
11928
- return generateId();
11929
- }
11930
11897
  function isBefore(dateA, dateB) {
11931
11898
  return new Date(dateA) < new Date(dateB);
11932
11899
  }
@@ -12027,7 +11994,7 @@ class BaseQueueManager {
12027
11994
  if (!this.delegate) {
12028
11995
  throw new Error("No server delegate defined");
12029
11996
  }
12030
- const jobId = generateUUID();
11997
+ const jobId = generateId();
12031
11998
  const queue = this.getQueue(job.driveId, job.documentId);
12032
11999
  if (await queue.isDeleted()) {
12033
12000
  throw new Error("Queue is deleted");
@@ -23080,7 +23047,7 @@ class PullResponderTransmitter {
23080
23047
  };
23081
23048
  const listenerId = await PullResponderTransmitter.registerPullResponder(driveId, url, filter);
23082
23049
  const pullTrigger = {
23083
- id: generateUUID(),
23050
+ id: generateId(),
23084
23051
  type: "PullResponder",
23085
23052
  driveId,
23086
23053
  filter,
@@ -23589,7 +23556,7 @@ class BaseDocumentDriveServer {
23589
23556
  return [...this.documentModelModules];
23590
23557
  }
23591
23558
  async addDrive(input, preferredEditor) {
23592
- const id = input.global.id || generateUUID();
23559
+ const id = input.global.id || generateId();
23593
23560
  if (!id) {
23594
23561
  throw new Error("Invalid Drive Id");
23595
23562
  }
@@ -23880,12 +23847,18 @@ class BaseDocumentDriveServer {
23880
23847
  handler = () => this.deleteDocument(driveId, signal.input.id);
23881
23848
  break;
23882
23849
  case "COPY_CHILD_DOCUMENT":
23883
- handler = () => this.getDocument(driveId, signal.input.id).then((documentToCopy) => this.createDocument(driveId, {
23884
- id: signal.input.newId,
23885
- documentType: documentToCopy.documentType,
23886
- document: documentToCopy,
23887
- synchronizationUnits: signal.input.synchronizationUnits
23888
- }));
23850
+ handler = () => this.getDocument(driveId, signal.input.id).then((documentToCopy) => {
23851
+ const doc = {
23852
+ ...documentToCopy,
23853
+ slug: signal.input.newId
23854
+ };
23855
+ return this.createDocument(driveId, {
23856
+ id: signal.input.newId,
23857
+ documentType: documentToCopy.documentType,
23858
+ document: doc,
23859
+ synchronizationUnits: signal.input.synchronizationUnits
23860
+ });
23861
+ });
23889
23862
  break;
23890
23863
  }
23891
23864
  if (handler) {
@@ -26073,7 +26046,7 @@ const nodeOptionsMap = {
26073
26046
  };
26074
26047
  const name = "@powerhousedao/connect";
26075
26048
  const productName = "Powerhouse-Connect";
26076
- const version$1 = "1.0.21-dev.0";
26049
+ const version$1 = "1.0.22-dev.0";
26077
26050
  const description = "Powerhouse Connect";
26078
26051
  const main = "./dist/index.html";
26079
26052
  const type = "module";
@@ -31764,7 +31737,7 @@ if (window.__VITE_ENVS.MODE === "development") {
31764
31737
  } else {
31765
31738
  serviceWorkerManager.registerServiceWorker(false);
31766
31739
  }
31767
- const App = lazy(() => __vitePreload(() => import("./app-5pzhkdPA.js").then((n) => n.bu), true ? __vite__mapDeps([0,1,2]) : void 0));
31740
+ const App = lazy(() => __vitePreload(() => import("./app-DOR_8r1B.js").then((n) => n.bu), true ? __vite__mapDeps([0,1,2]) : void 0));
31768
31741
  const AppLoader = /* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(App, {}) });
31769
31742
  const appLoader = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
31770
31743
  __proto__: null,
@@ -31800,7 +31773,7 @@ export {
31800
31773
  pascalCase as Z,
31801
31774
  logger$1 as _,
31802
31775
  createReducer as a,
31803
- getNamedType as a$,
31776
+ invariant as a$,
31804
31777
  getDefaultExportFromCjs as a0,
31805
31778
  LOCAL as a1,
31806
31779
  commonjsGlobal as a2,
@@ -31822,22 +31795,22 @@ export {
31822
31795
  setSharingType as aI,
31823
31796
  SynchronizationUnitNotFoundError as aJ,
31824
31797
  removeTrigger as aK,
31825
- generateUUID as aL,
31826
- PullResponderTransmitter as aM,
31827
- addTrigger as aN,
31828
- ReadDriveNotFoundError as aO,
31829
- openUrl as aP,
31830
- getNodeOptions as aQ,
31831
- DRIVE as aR,
31832
- FOLDER as aS,
31833
- requestPublicDrive as aT,
31834
- serviceWorkerManager as aU,
31835
- packageJson as aV,
31836
- t as aW,
31837
- gql as aX,
31838
- request as aY,
31839
- inspect as aZ,
31840
- GraphQLError as a_,
31798
+ PullResponderTransmitter as aL,
31799
+ addTrigger as aM,
31800
+ ReadDriveNotFoundError as aN,
31801
+ openUrl as aO,
31802
+ getNodeOptions as aP,
31803
+ DRIVE as aQ,
31804
+ FOLDER as aR,
31805
+ requestPublicDrive as aS,
31806
+ serviceWorkerManager as aT,
31807
+ packageJson as aU,
31808
+ t as aV,
31809
+ gql as aW,
31810
+ request as aX,
31811
+ inspect as aY,
31812
+ GraphQLError as aZ,
31813
+ getNamedType as a_,
31841
31814
  capitalCase as aa,
31842
31815
  CLOUD as ab,
31843
31816
  createZip as ac,
@@ -31865,83 +31838,82 @@ export {
31865
31838
  isFolderNode as ay,
31866
31839
  deleteNode as az,
31867
31840
  SetStateSchemaInputSchema as b,
31868
- defaultFileOptions as b$,
31869
- invariant as b0,
31870
- isInputObjectType as b1,
31871
- isScalarType as b2,
31872
- isObjectType as b3,
31873
- isInterfaceType as b4,
31874
- isUnionType as b5,
31875
- isEnumType as b6,
31876
- print as b7,
31877
- isPrintableAsBlockString as b8,
31878
- Kind as b9,
31879
- isOutputType as bA,
31880
- isInputType as bB,
31881
- GraphQLBoolean as bC,
31882
- assertAbstractType as bD,
31883
- doTypesOverlap as bE,
31884
- DirectiveLocation as bF,
31885
- specifiedRules as bG,
31886
- NoUnusedFragmentsRule as bH,
31887
- ExecutableDefinitionsRule as bI,
31888
- validate as bJ,
31889
- validateSchema as bK,
31890
- GraphQLID as bL,
31891
- GraphQLString as bM,
31892
- GraphQLFloat as bN,
31893
- GraphQLInt as bO,
31894
- GraphQLDirective as bP,
31895
- GraphQLUnionType as bQ,
31896
- isNonNullType as bR,
31897
- GraphQLNonNull as bS,
31898
- isNamedType as bT,
31899
- isLeafType as bU,
31900
- GraphQLSchema as bV,
31901
- buildSchema as bW,
31902
- sentenceCase as bX,
31903
- getDimensions as bY,
31904
- READ as bZ,
31905
- nodeOptionsMap as b_,
31906
- astFromValue as ba,
31907
- DEFAULT_DEPRECATION_REASON as bb,
31908
- isSpecifiedDirective as bc,
31909
- isSpecifiedScalarType as bd,
31910
- isIntrospectionType as be,
31911
- z as bf,
31912
- GraphQLScalarType as bg,
31913
- parse as bh,
31914
- visit as bi,
31915
- buildASTSchema as bj,
31916
- extendSchema as bk,
31917
- getNullableType as bl,
31918
- isListType as bm,
31919
- snakeCase as bn,
31920
- constantCase as bo,
31921
- isAbstractType as bp,
31922
- BREAK as bq,
31923
- GraphQLInputObjectType as br,
31924
- GraphQLList as bs,
31925
- GraphQLEnumType as bt,
31926
- GraphQLObjectType as bu,
31927
- GraphQLInterfaceType as bv,
31928
- SchemaMetaFieldDef as bw,
31929
- TypeMetaFieldDef as bx,
31930
- TypeNameMetaFieldDef as by,
31931
- isCompositeType as bz,
31841
+ DELETE as b$,
31842
+ isInputObjectType as b0,
31843
+ isScalarType as b1,
31844
+ isObjectType as b2,
31845
+ isInterfaceType as b3,
31846
+ isUnionType as b4,
31847
+ isEnumType as b5,
31848
+ print as b6,
31849
+ isPrintableAsBlockString as b7,
31850
+ Kind as b8,
31851
+ astFromValue as b9,
31852
+ isInputType as bA,
31853
+ GraphQLBoolean as bB,
31854
+ assertAbstractType as bC,
31855
+ doTypesOverlap as bD,
31856
+ DirectiveLocation as bE,
31857
+ specifiedRules as bF,
31858
+ NoUnusedFragmentsRule as bG,
31859
+ ExecutableDefinitionsRule as bH,
31860
+ validate as bI,
31861
+ validateSchema as bJ,
31862
+ GraphQLID as bK,
31863
+ GraphQLString as bL,
31864
+ GraphQLFloat as bM,
31865
+ GraphQLInt as bN,
31866
+ GraphQLDirective as bO,
31867
+ GraphQLUnionType as bP,
31868
+ isNonNullType as bQ,
31869
+ GraphQLNonNull as bR,
31870
+ isNamedType as bS,
31871
+ isLeafType as bT,
31872
+ GraphQLSchema as bU,
31873
+ buildSchema as bV,
31874
+ sentenceCase as bW,
31875
+ getDimensions as bX,
31876
+ READ as bY,
31877
+ nodeOptionsMap as bZ,
31878
+ defaultFileOptions as b_,
31879
+ DEFAULT_DEPRECATION_REASON as ba,
31880
+ isSpecifiedDirective as bb,
31881
+ isSpecifiedScalarType as bc,
31882
+ isIntrospectionType as bd,
31883
+ z as be,
31884
+ GraphQLScalarType as bf,
31885
+ parse as bg,
31886
+ visit as bh,
31887
+ buildASTSchema as bi,
31888
+ extendSchema as bj,
31889
+ getNullableType as bk,
31890
+ isListType as bl,
31891
+ snakeCase as bm,
31892
+ constantCase as bn,
31893
+ isAbstractType as bo,
31894
+ BREAK as bp,
31895
+ GraphQLInputObjectType as bq,
31896
+ GraphQLList as br,
31897
+ GraphQLEnumType as bs,
31898
+ GraphQLObjectType as bt,
31899
+ GraphQLInterfaceType as bu,
31900
+ SchemaMetaFieldDef as bv,
31901
+ TypeMetaFieldDef as bw,
31902
+ TypeNameMetaFieldDef as bx,
31903
+ isCompositeType as by,
31904
+ isOutputType as bz,
31932
31905
  createAction as c,
31933
- DELETE as c0,
31934
- RENAME as c1,
31935
- WRITE as c2,
31936
- DUPLICATE as c3,
31937
- defaultFolderOptions as c4,
31938
- garbageCollect as c5,
31939
- sortOperations as c6,
31940
- UI_NODE as c7,
31941
- undo as c8,
31942
- redo as c9,
31943
- useDocumentDispatch as ca,
31944
- appLoader as cb,
31906
+ RENAME as c0,
31907
+ WRITE as c1,
31908
+ DUPLICATE as c2,
31909
+ defaultFolderOptions as c3,
31910
+ garbageCollect as c4,
31911
+ sortOperations as c5,
31912
+ UI_NODE as c6,
31913
+ undo as c7,
31914
+ redo as c8,
31915
+ useDocumentDispatch as c9,
31916
+ appLoader as ca,
31945
31917
  ReorderModuleOperationsInputSchema as d,
31946
31918
  DeleteOperationInputSchema as e,
31947
31919
  SetOperationReducerInputSchema as f,
@@ -31966,4 +31938,4 @@ export {
31966
31938
  ReorderModulesInputSchema as y,
31967
31939
  DeleteModuleInputSchema as z
31968
31940
  };
31969
- //# sourceMappingURL=app-loader-DMIJ7HEl.js.map
31941
+ //# sourceMappingURL=app-loader-uXeiy6sl.js.map