@powerhousedao/powerhouse-vetra-packages 6.2.0-dev.4 → 6.2.0-dev.41

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 (72) hide show
  1. package/dist/browser/assets/{entry-Bzani6_n.js → entry-BHcFjTEd.js} +2 -2
  2. package/dist/browser/assets/{projection-entry-Bpu-8SnI.js → projection-entry-Cs-5j8OX.js} +4 -4
  3. package/dist/browser/{connect-DPNyOTBV.js → connect-CmgZSI0Z.js} +45 -45
  4. package/dist/browser/connect-CmgZSI0Z.js.map +1 -0
  5. package/dist/browser/{dist-Bha1Om6O.js → dist-D1NFJMzm.js} +100 -49
  6. package/dist/browser/dist-D1NFJMzm.js.map +1 -0
  7. package/dist/browser/{document-drive-CDaY4aIj.js → document-drive-sTKoi6L4.js} +310 -3
  8. package/dist/browser/document-drive-sTKoi6L4.js.map +1 -0
  9. package/dist/browser/document-models/index.js +1 -1
  10. package/dist/browser/{editor-CJFM1rC9.js → editor-Bs5C6sAt.js} +21 -21
  11. package/dist/browser/editor-Bs5C6sAt.js.map +1 -0
  12. package/dist/browser/{editor-BtOSWTjb.js → editor-BsVLT-lJ.js} +5 -5
  13. package/dist/browser/{editor-BtOSWTjb.js.map → editor-BsVLT-lJ.js.map} +1 -1
  14. package/dist/browser/editors/document-model-editor/module.js +1 -1
  15. package/dist/browser/editors/generic-drive-explorer/index.js +5 -5
  16. package/dist/browser/editors/generic-drive-explorer/index.js.map +1 -1
  17. package/dist/browser/editors/generic-drive-explorer/module.js +1 -1
  18. package/dist/browser/{folder-view-DAhpWssS.js → folder-view-LYhTe15T.js} +7 -7
  19. package/dist/browser/folder-view-LYhTe15T.js.map +1 -0
  20. package/dist/browser/{graphql-editor-Dwgpm08w.js → graphql-editor-b61MnkEP.js} +3 -3
  21. package/dist/browser/{graphql-editor-Dwgpm08w.js.map → graphql-editor-b61MnkEP.js.map} +1 -1
  22. package/dist/browser/index.js +334 -2
  23. package/dist/browser/index.js.map +1 -1
  24. package/dist/browser/{json-editor-SKLjwlux.js → json-editor-DO_EwDmY.js} +3 -3
  25. package/dist/browser/{json-editor-SKLjwlux.js.map → json-editor-DO_EwDmY.js.map} +1 -1
  26. package/dist/browser/lib-DtwK2kyR.js +200 -0
  27. package/dist/browser/lib-DtwK2kyR.js.map +1 -0
  28. package/dist/browser/{state-schemas-S69fnpVk.js → state-schemas-Cx-QbW5a.js} +12 -12
  29. package/dist/browser/state-schemas-Cx-QbW5a.js.map +1 -0
  30. package/dist/node/{connect-5a3Nx0Jd.mjs → connect-CwDdrOag.mjs} +45 -45
  31. package/dist/node/connect-CwDdrOag.mjs.map +1 -0
  32. package/dist/node/{dist-QOGgRb-y.mjs → dist-RdOXBdt-.mjs} +100 -49
  33. package/dist/node/dist-RdOXBdt-.mjs.map +1 -0
  34. package/dist/node/{document-drive-BK2-EDni.mjs → document-drive-DjL9iikf.mjs} +310 -3
  35. package/dist/node/document-drive-DjL9iikf.mjs.map +1 -0
  36. package/dist/node/document-models/index.mjs +1 -1
  37. package/dist/node/{editor-BNOTRmUU.mjs → editor-CTJUSbjg.mjs} +21 -21
  38. package/dist/node/editor-CTJUSbjg.mjs.map +1 -0
  39. package/dist/node/{editor-C_Gchmop.mjs → editor-DLr8Eb3u.mjs} +5 -5
  40. package/dist/node/{editor-C_Gchmop.mjs.map → editor-DLr8Eb3u.mjs.map} +1 -1
  41. package/dist/node/editors/document-model-editor/module.mjs +1 -1
  42. package/dist/node/editors/generic-drive-explorer/index.mjs +5 -5
  43. package/dist/node/editors/generic-drive-explorer/index.mjs.map +1 -1
  44. package/dist/node/editors/generic-drive-explorer/module.mjs +1 -1
  45. package/dist/node/{folder-view-af4hVjjx.mjs → folder-view-CfvJLoKi.mjs} +7 -7
  46. package/dist/node/folder-view-CfvJLoKi.mjs.map +1 -0
  47. package/dist/node/{graphql-editor-BoTCyC9n.mjs → graphql-editor-C-0f2bX3.mjs} +3 -3
  48. package/dist/node/{graphql-editor-BoTCyC9n.mjs.map → graphql-editor-C-0f2bX3.mjs.map} +1 -1
  49. package/dist/node/index.mjs +335 -2
  50. package/dist/node/index.mjs.map +1 -1
  51. package/dist/node/{json-editor-Bk4_b03g.mjs → json-editor-DJtigEsH.mjs} +3 -3
  52. package/dist/node/{json-editor-Bk4_b03g.mjs.map → json-editor-DJtigEsH.mjs.map} +1 -1
  53. package/dist/node/{dist-C7ZmTHz4.mjs → main-DbTMJyA_.mjs} +45 -340
  54. package/dist/node/main-DbTMJyA_.mjs.map +1 -0
  55. package/dist/node/{state-schemas-DMw1UvT8.mjs → state-schemas-Bv5h5MqY.mjs} +12 -12
  56. package/dist/node/state-schemas-Bv5h5MqY.mjs.map +1 -0
  57. package/package.json +6 -6
  58. package/dist/browser/connect-DPNyOTBV.js.map +0 -1
  59. package/dist/browser/dist-Bha1Om6O.js.map +0 -1
  60. package/dist/browser/dist-DnQpckQ8.js +0 -494
  61. package/dist/browser/dist-DnQpckQ8.js.map +0 -1
  62. package/dist/browser/document-drive-CDaY4aIj.js.map +0 -1
  63. package/dist/browser/editor-CJFM1rC9.js.map +0 -1
  64. package/dist/browser/folder-view-DAhpWssS.js.map +0 -1
  65. package/dist/browser/state-schemas-S69fnpVk.js.map +0 -1
  66. package/dist/node/connect-5a3Nx0Jd.mjs.map +0 -1
  67. package/dist/node/dist-C7ZmTHz4.mjs.map +0 -1
  68. package/dist/node/dist-QOGgRb-y.mjs.map +0 -1
  69. package/dist/node/document-drive-BK2-EDni.mjs.map +0 -1
  70. package/dist/node/editor-BNOTRmUU.mjs.map +0 -1
  71. package/dist/node/folder-view-af4hVjjx.mjs.map +0 -1
  72. package/dist/node/state-schemas-DMw1UvT8.mjs.map +0 -1
@@ -1,7 +1,6 @@
1
1
  import { A as __toCommonJS, D as __esmMin, E as __commonJSMin, O as __exportAll } from "./dist-fA4EItr0.mjs";
2
- import { C as defaultBaseState, O as isDocumentAction, Y as generateId, _ as baseSaveToFileHandle, b as createReducer, g as baseLoadFromInput, h as baseCreateDocument, x as createState } from "./document-drive-BK2-EDni.mjs";
3
2
  import { t as require_graphql } from "./graphql-DskHmkMe.mjs";
4
- //#region ../reactor/dist/drive-container-types-BNpMlgT_.js
3
+ //#region ../reactor/dist/drive-container-types-BuFNr0j0.js
5
4
  /**
6
5
  * Error thrown when a document model module is not found in the registry.
7
6
  */
@@ -19,9 +18,48 @@ var ModuleNotFoundError = class extends Error {
19
18
  return Error.isError(error) && error.name === "ModuleNotFoundError";
20
19
  }
21
20
  };
22
- function driveCollectionId(branch, driveId) {
23
- return `drive.${branch}.${driveId}`;
24
- }
21
+ const DRIVE_COLLECTION_PREFIX = "drive.";
22
+ /**
23
+ * Identifies the collection a remote synchronizes. Collections are drive-level
24
+ * abstractions (document-drive and reactor-drive), so a collection id is the
25
+ * drive document id plus the branch it scopes to rather than an opaque string.
26
+ *
27
+ * The canonical string form (`drive.${branch}.${driveId}`) is produced only by
28
+ * `key` and parsed only by `fromKey`; that string is the wire and storage
29
+ * representation and is byte-for-byte identical to the legacy
30
+ * `driveCollectionId(branch, driveId)` output, so existing `document_collections`
31
+ * rows and persisted remotes remain valid without migration.
32
+ */
33
+ var DriveCollectionId = class DriveCollectionId {
34
+ constructor(driveId, branch) {
35
+ this.driveId = driveId;
36
+ this.branch = branch;
37
+ }
38
+ static forDrive(driveId, branch = "main") {
39
+ return new DriveCollectionId(driveId, branch);
40
+ }
41
+ /**
42
+ * The single deserializer for the wire/storage form. `branch` may contain
43
+ * dots, while `driveId` is a dot-free document id, so the drive id is the
44
+ * final dot-delimited segment.
45
+ */
46
+ static fromKey(key) {
47
+ if (!key.startsWith(DRIVE_COLLECTION_PREFIX)) throw new Error(`Unsupported collection id: ${key}`);
48
+ const rest = key.slice(6);
49
+ const lastDot = rest.lastIndexOf(".");
50
+ if (lastDot === -1 || lastDot === rest.length - 1) throw new Error(`Malformed drive collection id: ${key}`);
51
+ return new DriveCollectionId(rest.slice(lastDot + 1), rest.slice(0, lastDot));
52
+ }
53
+ get key() {
54
+ return `${DRIVE_COLLECTION_PREFIX}${this.branch}.${this.driveId}`;
55
+ }
56
+ toString() {
57
+ return this.key;
58
+ }
59
+ equals(other) {
60
+ return this.driveId === other.driveId && this.branch === other.branch;
61
+ }
62
+ };
25
63
  //#endregion
26
64
  //#region ../reactor/dist/index.js
27
65
  let SyncStatus = /* @__PURE__ */ function(SyncStatus) {
@@ -693,339 +731,6 @@ var require_main = /* @__PURE__ */ __commonJSMin(((exports, module) => {
693
731
  module.exports = require_graphql_tag_umd().gql;
694
732
  }));
695
733
  //#endregion
696
- //#region ../reactor-drive/dist/index.js
697
- var import_main = require_main();
698
- const REACTOR_DRIVE_DOCUMENT_TYPE = "powerhouse/reactor-drive";
699
- const REACTOR_DRIVE_FILE_EXTENSION = "phrd";
700
- function setDriveNameAction(input) {
701
- return {
702
- id: generateId(),
703
- type: "SET_DRIVE_NAME",
704
- scope: "global",
705
- timestampUtcMs: (/* @__PURE__ */ new Date()).toISOString(),
706
- input
707
- };
708
- }
709
- function setDriveIconAction(input) {
710
- return {
711
- id: generateId(),
712
- type: "SET_DRIVE_ICON",
713
- scope: "global",
714
- timestampUtcMs: (/* @__PURE__ */ new Date()).toISOString(),
715
- input
716
- };
717
- }
718
- function setSharingTypeAction(input) {
719
- return {
720
- id: generateId(),
721
- type: "SET_SHARING_TYPE",
722
- scope: "local",
723
- timestampUtcMs: (/* @__PURE__ */ new Date()).toISOString(),
724
- input
725
- };
726
- }
727
- function setAvailableOfflineAction(input) {
728
- return {
729
- id: generateId(),
730
- type: "SET_AVAILABLE_OFFLINE",
731
- scope: "local",
732
- timestampUtcMs: (/* @__PURE__ */ new Date()).toISOString(),
733
- input
734
- };
735
- }
736
- function addFolderAction(input) {
737
- return {
738
- id: generateId(),
739
- type: "ADD_FOLDER",
740
- scope: "document",
741
- timestampUtcMs: (/* @__PURE__ */ new Date()).toISOString(),
742
- input
743
- };
744
- }
745
- function updateFolderAction(input) {
746
- return {
747
- id: generateId(),
748
- type: "UPDATE_FOLDER",
749
- scope: "document",
750
- timestampUtcMs: (/* @__PURE__ */ new Date()).toISOString(),
751
- input
752
- };
753
- }
754
- function removeFolderAction(input) {
755
- return {
756
- id: generateId(),
757
- type: "REMOVE_FOLDER",
758
- scope: "document",
759
- timestampUtcMs: (/* @__PURE__ */ new Date()).toISOString(),
760
- input
761
- };
762
- }
763
- const reactorDriveActions = {
764
- setDriveName: setDriveNameAction,
765
- setDriveIcon: setDriveIconAction,
766
- setSharingType: setSharingTypeAction,
767
- setAvailableOffline: setAvailableOfflineAction,
768
- addFolder: addFolderAction,
769
- updateFolder: updateFolderAction,
770
- removeFolder: removeFolderAction
771
- };
772
- const reactorDriveStateReducer = (state, action) => {
773
- if (isDocumentAction(action)) return state;
774
- const typedAction = action;
775
- switch (typedAction.type) {
776
- case "SET_DRIVE_NAME": {
777
- const input = typedAction.input;
778
- state.global.name = input.name;
779
- return state;
780
- }
781
- case "SET_DRIVE_ICON": {
782
- const input = typedAction.input;
783
- state.global.icon = input.icon;
784
- return state;
785
- }
786
- case "SET_SHARING_TYPE": {
787
- const input = typedAction.input;
788
- state.local.sharingType = input.sharingType;
789
- return state;
790
- }
791
- case "SET_AVAILABLE_OFFLINE": {
792
- const input = typedAction.input;
793
- state.local.availableOffline = input.availableOffline;
794
- return state;
795
- }
796
- case "ADD_FOLDER":
797
- case "UPDATE_FOLDER":
798
- case "REMOVE_FOLDER": return state;
799
- default: return state;
800
- }
801
- };
802
- const initialGlobalState = {
803
- name: "",
804
- icon: null
805
- };
806
- const initialLocalState = {
807
- sharingType: "private",
808
- availableOffline: false
809
- };
810
- const reactorDriveCreateState = (state) => {
811
- return {
812
- ...defaultBaseState(),
813
- global: {
814
- ...initialGlobalState,
815
- ...state?.global
816
- },
817
- local: {
818
- ...initialLocalState,
819
- ...state?.local
820
- }
821
- };
822
- };
823
- const reactorDriveCreateDocument = (state) => {
824
- return baseCreateDocument(reactorDriveCreateState, state, REACTOR_DRIVE_DOCUMENT_TYPE);
825
- };
826
- const reactorDriveSaveToFileHandle = (document, input) => {
827
- return baseSaveToFileHandle(document, input);
828
- };
829
- const reactorDriveLoadFromInput = (input) => {
830
- return baseLoadFromInput(input, reactorDriveDocumentReducer);
831
- };
832
- const isReactorDriveState = (state) => {
833
- return typeof state === "object" && state !== null && "global" in state && "local" in state;
834
- };
835
- const assertIsReactorDriveState = (state) => {
836
- if (!isReactorDriveState(state)) throw new Error("Not a reactor-drive state");
837
- };
838
- const isReactorDriveDocument = (document) => {
839
- return typeof document === "object" && document !== null && "header" in document && document.header.documentType === "powerhouse/reactor-drive";
840
- };
841
- const assertIsReactorDriveDocument = (document) => {
842
- if (!isReactorDriveDocument(document)) throw new Error("Not a reactor-drive document");
843
- };
844
- const reactorDriveDocumentReducer = createReducer(reactorDriveStateReducer);
845
- const reactorDriveDocumentGlobalState = {
846
- id: REACTOR_DRIVE_DOCUMENT_TYPE,
847
- name: "ReactorDrive",
848
- extension: REACTOR_DRIVE_FILE_EXTENSION,
849
- description: "",
850
- author: {
851
- name: "Powerhouse Inc",
852
- website: "https://www.powerhouse.inc/"
853
- },
854
- specifications: [{
855
- version: 1,
856
- changeLog: [],
857
- state: {
858
- global: {
859
- schema: "type ReactorDriveState {\n name: String!\n icon: String\n}",
860
- initialValue: JSON.stringify(JSON.stringify(initialGlobalState)),
861
- examples: []
862
- },
863
- local: {
864
- schema: "type ReactorDriveLocalState {\n sharingType: String!\n availableOffline: Boolean!\n}",
865
- initialValue: JSON.stringify(JSON.stringify(initialLocalState)),
866
- examples: []
867
- }
868
- },
869
- modules: [{
870
- id: "reactor-drive/base-operations",
871
- name: "base_operations",
872
- description: "",
873
- operations: [
874
- {
875
- id: "SET_DRIVE_NAME",
876
- name: "SET_DRIVE_NAME",
877
- description: "",
878
- schema: "input SetDriveNameInput { name: String! }",
879
- template: "",
880
- reducer: "",
881
- errors: [],
882
- examples: [],
883
- scope: "global"
884
- },
885
- {
886
- id: "SET_DRIVE_ICON",
887
- name: "SET_DRIVE_ICON",
888
- description: "",
889
- schema: "input SetDriveIconInput { icon: String }",
890
- template: "",
891
- reducer: "",
892
- errors: [],
893
- examples: [],
894
- scope: "global"
895
- },
896
- {
897
- id: "SET_SHARING_TYPE",
898
- name: "SET_SHARING_TYPE",
899
- description: "",
900
- schema: "input SetSharingTypeInput { sharingType: String! }",
901
- template: "",
902
- reducer: "",
903
- errors: [],
904
- examples: [],
905
- scope: "local"
906
- },
907
- {
908
- id: "SET_AVAILABLE_OFFLINE",
909
- name: "SET_AVAILABLE_OFFLINE",
910
- description: "",
911
- schema: "input SetAvailableOfflineInput { availableOffline: Boolean! }",
912
- template: "",
913
- reducer: "",
914
- errors: [],
915
- examples: [],
916
- scope: "local"
917
- },
918
- {
919
- id: "ADD_FOLDER",
920
- name: "ADD_FOLDER",
921
- description: "",
922
- schema: "input AddFolderInput { folderId: String! parentFolderId: String name: String! }",
923
- template: "",
924
- reducer: "",
925
- errors: [],
926
- examples: [],
927
- scope: "document"
928
- },
929
- {
930
- id: "UPDATE_FOLDER",
931
- name: "UPDATE_FOLDER",
932
- description: "",
933
- schema: "input UpdateFolderInput { folderId: String! name: String parentFolderId: String }",
934
- template: "",
935
- reducer: "",
936
- errors: [],
937
- examples: [],
938
- scope: "document"
939
- },
940
- {
941
- id: "REMOVE_FOLDER",
942
- name: "REMOVE_FOLDER",
943
- description: "",
944
- schema: "input RemoveFolderInput { folderId: String! }",
945
- template: "",
946
- reducer: "",
947
- errors: [],
948
- examples: [],
949
- scope: "document"
950
- }
951
- ]
952
- }]
953
- }]
954
- };
955
- const reactorDriveDocumentModelModule = {
956
- actions: reactorDriveActions,
957
- reducer: reactorDriveDocumentReducer,
958
- documentModel: createState(defaultBaseState(), reactorDriveDocumentGlobalState),
959
- utils: {
960
- fileExtension: REACTOR_DRIVE_FILE_EXTENSION,
961
- createState: reactorDriveCreateState,
962
- createDocument: reactorDriveCreateDocument,
963
- loadFromInput: reactorDriveLoadFromInput,
964
- saveToFileHandle: reactorDriveSaveToFileHandle,
965
- isStateOfType: isReactorDriveState,
966
- assertIsStateOfType: assertIsReactorDriveState,
967
- isDocumentOfType: isReactorDriveDocument,
968
- assertIsDocumentOfType: assertIsReactorDriveDocument
969
- }
970
- };
971
- import_main.gql`
972
- enum ReactorDriveNodeKind {
973
- FILE
974
- FOLDER
975
- }
976
-
977
- input ReactorDrivePagingInput {
978
- cursor: String
979
- limit: Int
980
- }
981
-
982
- type ReactorDriveFileNode {
983
- id: ID!
984
- driveId: ID!
985
- name: String!
986
- parentFolder: ID
987
- documentType: String!
988
- }
989
-
990
- type ReactorDriveFolderNode {
991
- id: ID!
992
- driveId: ID!
993
- name: String!
994
- parentFolder: ID
995
- children(
996
- paging: ReactorDrivePagingInput
997
- kind: ReactorDriveNodeKind
998
- ): ReactorDriveNodePage!
999
- }
1000
-
1001
- union ReactorDriveNode = ReactorDriveFileNode | ReactorDriveFolderNode
1002
-
1003
- type ReactorDriveNodePage {
1004
- results: [ReactorDriveNode!]!
1005
- nextCursor: String
1006
- hasMore: Boolean!
1007
- totalCount: Int
1008
- }
1009
-
1010
- type ReactorDrive {
1011
- id: ID!
1012
- name: String!
1013
- icon: String
1014
- sharingType: String!
1015
- availableOffline: Boolean!
1016
- rootNodes(
1017
- paging: ReactorDrivePagingInput
1018
- kind: ReactorDriveNodeKind
1019
- ): ReactorDriveNodePage!
1020
- }
1021
-
1022
- type Query {
1023
- reactorDrive(id: ID!): ReactorDrive
1024
- reactorDriveNode(driveId: ID!, id: ID!): ReactorDriveNode
1025
- reactorDriveDescendants(driveId: ID!, root: ID!): [ReactorDriveNode!]!
1026
- }
1027
- `;
1028
- //#endregion
1029
- export { SyncStatus as a, tslib_es6_exports as i, require_main as n, ModuleNotFoundError as o, init_tslib_es6 as r, driveCollectionId as s, reactorDriveDocumentModelModule as t };
734
+ export { DriveCollectionId as a, SyncStatus as i, init_tslib_es6 as n, ModuleNotFoundError as o, tslib_es6_exports as r, require_main as t };
1030
735
 
1031
- //# sourceMappingURL=dist-C7ZmTHz4.mjs.map
736
+ //# sourceMappingURL=main-DbTMJyA_.mjs.map