@powerhousedao/vetra 4.1.0-dev.80 → 4.1.0-dev.81

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 (93) hide show
  1. package/dist/document-models/app-module/gen/base-operations/actions.d.ts +6 -2
  2. package/dist/document-models/app-module/gen/base-operations/actions.d.ts.map +1 -1
  3. package/dist/document-models/app-module/gen/base-operations/creators.d.ts +3 -2
  4. package/dist/document-models/app-module/gen/base-operations/creators.d.ts.map +1 -1
  5. package/dist/document-models/app-module/gen/base-operations/creators.js +1 -0
  6. package/dist/document-models/app-module/gen/base-operations/operations.d.ts +2 -1
  7. package/dist/document-models/app-module/gen/base-operations/operations.d.ts.map +1 -1
  8. package/dist/document-models/app-module/gen/document-model.d.ts.map +1 -1
  9. package/dist/document-models/app-module/gen/document-model.js +15 -4
  10. package/dist/document-models/app-module/gen/ph-factories.d.ts.map +1 -1
  11. package/dist/document-models/app-module/gen/ph-factories.js +2 -4
  12. package/dist/document-models/app-module/gen/reducer.d.ts.map +1 -1
  13. package/dist/document-models/app-module/gen/reducer.js +4 -0
  14. package/dist/document-models/app-module/gen/schema/types.d.ts +6 -11
  15. package/dist/document-models/app-module/gen/schema/types.d.ts.map +1 -1
  16. package/dist/document-models/app-module/gen/schema/zod.d.ts +2 -3
  17. package/dist/document-models/app-module/gen/schema/zod.d.ts.map +1 -1
  18. package/dist/document-models/app-module/gen/schema/zod.js +8 -17
  19. package/dist/document-models/app-module/gen/utils.d.ts.map +1 -1
  20. package/dist/document-models/app-module/gen/utils.js +2 -4
  21. package/dist/document-models/app-module/index.d.ts +1 -0
  22. package/dist/document-models/app-module/index.d.ts.map +1 -1
  23. package/dist/document-models/app-module/src/reducers/base-operations.d.ts.map +1 -1
  24. package/dist/document-models/app-module/src/reducers/base-operations.js +12 -9
  25. package/dist/document-models/app-module/src/reducers/dnd-operations.d.ts.map +1 -1
  26. package/dist/document-models/app-module/src/reducers/dnd-operations.js +1 -4
  27. package/dist/editors/app-editor/components/AppEditorForm.d.ts +1 -13
  28. package/dist/editors/app-editor/components/AppEditorForm.d.ts.map +1 -1
  29. package/dist/editors/app-editor/components/AppEditorForm.js +82 -52
  30. package/dist/editors/app-editor/config.d.ts +3 -0
  31. package/dist/editors/app-editor/config.d.ts.map +1 -0
  32. package/dist/editors/app-editor/config.js +3 -0
  33. package/dist/editors/app-editor/editor.d.ts.map +1 -1
  34. package/dist/editors/app-editor/editor.js +4 -24
  35. package/dist/editors/app-editor/index.d.ts.map +1 -1
  36. package/dist/editors/app-editor/index.js +1 -3
  37. package/dist/editors/document-editor/config.d.ts +3 -0
  38. package/dist/editors/document-editor/config.d.ts.map +1 -0
  39. package/dist/editors/document-editor/config.js +3 -0
  40. package/dist/editors/document-editor/editor.d.ts.map +1 -1
  41. package/dist/editors/document-editor/editor.js +3 -0
  42. package/dist/editors/document-editor/index.d.ts.map +1 -1
  43. package/dist/editors/document-editor/index.js +1 -3
  44. package/dist/editors/hooks/useAvailableDocumentTypes.d.ts +1 -1
  45. package/dist/editors/hooks/useAvailableDocumentTypes.d.ts.map +1 -1
  46. package/dist/editors/hooks/useAvailableDocumentTypes.js +17 -36
  47. package/dist/editors/processor-editor/config.d.ts +3 -0
  48. package/dist/editors/processor-editor/config.d.ts.map +1 -0
  49. package/dist/editors/processor-editor/config.js +3 -0
  50. package/dist/editors/processor-editor/editor.d.ts.map +1 -1
  51. package/dist/editors/processor-editor/editor.js +3 -0
  52. package/dist/editors/processor-editor/index.d.ts.map +1 -1
  53. package/dist/editors/processor-editor/index.js +1 -3
  54. package/dist/editors/subgraph-editor/config.d.ts +3 -0
  55. package/dist/editors/subgraph-editor/config.d.ts.map +1 -0
  56. package/dist/editors/subgraph-editor/config.js +3 -0
  57. package/dist/editors/subgraph-editor/editor.d.ts.map +1 -1
  58. package/dist/editors/subgraph-editor/editor.js +3 -0
  59. package/dist/editors/subgraph-editor/index.d.ts.map +1 -1
  60. package/dist/editors/subgraph-editor/index.js +1 -3
  61. package/dist/editors/vetra-drive-app/DriveExplorer.d.ts +0 -2
  62. package/dist/editors/vetra-drive-app/DriveExplorer.d.ts.map +1 -1
  63. package/dist/editors/vetra-drive-app/config.d.ts +3 -0
  64. package/dist/editors/vetra-drive-app/config.d.ts.map +1 -0
  65. package/dist/editors/vetra-drive-app/config.js +11 -0
  66. package/dist/editors/vetra-drive-app/editor.d.ts +3 -4
  67. package/dist/editors/vetra-drive-app/editor.d.ts.map +1 -1
  68. package/dist/editors/vetra-drive-app/editor.js +6 -4
  69. package/dist/editors/vetra-drive-app/index.d.ts +2 -2
  70. package/dist/editors/vetra-drive-app/index.d.ts.map +1 -1
  71. package/dist/editors/vetra-drive-app/index.js +0 -14
  72. package/dist/editors/vetra-package/config.d.ts +3 -0
  73. package/dist/editors/vetra-package/config.d.ts.map +1 -0
  74. package/dist/editors/vetra-package/config.js +3 -0
  75. package/dist/editors/vetra-package/editor.d.ts.map +1 -1
  76. package/dist/editors/vetra-package/editor.js +3 -0
  77. package/dist/editors/vetra-package/index.d.ts.map +1 -1
  78. package/dist/editors/vetra-package/index.js +1 -3
  79. package/dist/index.d.ts +1 -2
  80. package/dist/index.d.ts.map +1 -1
  81. package/dist/processors/codegen/document-handlers/generators/app-generator.d.ts.map +1 -1
  82. package/dist/processors/codegen/document-handlers/generators/app-generator.js +7 -9
  83. package/dist/style.css +0 -3
  84. package/dist/subgraphs/app-module/resolvers.d.ts +1 -1
  85. package/dist/subgraphs/app-module/resolvers.d.ts.map +1 -1
  86. package/dist/subgraphs/app-module/resolvers.js +13 -2
  87. package/dist/subgraphs/app-module/schema.d.ts.map +1 -1
  88. package/dist/subgraphs/app-module/schema.js +11 -13
  89. package/dist/tsconfig.tsbuildinfo +1 -1
  90. package/package.json +14 -14
  91. package/dist/editors/vetra-drive-app/utils/withDropZone.d.ts +0 -4
  92. package/dist/editors/vetra-drive-app/utils/withDropZone.d.ts.map +0 -1
  93. package/dist/editors/vetra-drive-app/utils/withDropZone.js +0 -18
@@ -1,5 +1,5 @@
1
1
  import { type Action } from "document-model";
2
- import type { SetAppNameInput, SetAppStatusInput, AddDocumentTypeInput, RemoveDocumentTypeInput } from "../types.js";
2
+ import type { SetAppNameInput, SetAppStatusInput, AddDocumentTypeInput, RemoveDocumentTypeInput, SetDocumentTypesInput } from "../types.js";
3
3
  export type SetAppNameAction = Action & {
4
4
  type: "SET_APP_NAME";
5
5
  input: SetAppNameInput;
@@ -16,5 +16,9 @@ export type RemoveDocumentTypeAction = Action & {
16
16
  type: "REMOVE_DOCUMENT_TYPE";
17
17
  input: RemoveDocumentTypeInput;
18
18
  };
19
- export type AppModuleBaseOperationsAction = SetAppNameAction | SetAppStatusAction | AddDocumentTypeAction | RemoveDocumentTypeAction;
19
+ export type SetDocumentTypesAction = Action & {
20
+ type: "SET_DOCUMENT_TYPES";
21
+ input: SetDocumentTypesInput;
22
+ };
23
+ export type AppModuleBaseOperationsAction = SetAppNameAction | SetAppStatusAction | AddDocumentTypeAction | RemoveDocumentTypeAction | SetDocumentTypesAction;
20
24
  //# sourceMappingURL=actions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../../../document-models/app-module/gen/base-operations/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EACV,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,uBAAuB,EACxB,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG;IACtC,IAAI,EAAE,cAAc,CAAC;IACrB,KAAK,EAAE,eAAe,CAAC;CACxB,CAAC;AACF,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG;IACxC,IAAI,EAAE,gBAAgB,CAAC;IACvB,KAAK,EAAE,iBAAiB,CAAC;CAC1B,CAAC;AACF,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG;IAC3C,IAAI,EAAE,mBAAmB,CAAC;IAC1B,KAAK,EAAE,oBAAoB,CAAC;CAC7B,CAAC;AACF,MAAM,MAAM,wBAAwB,GAAG,MAAM,GAAG;IAC9C,IAAI,EAAE,sBAAsB,CAAC;IAC7B,KAAK,EAAE,uBAAuB,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,6BAA6B,GACrC,gBAAgB,GAChB,kBAAkB,GAClB,qBAAqB,GACrB,wBAAwB,CAAC"}
1
+ {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../../../document-models/app-module/gen/base-operations/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EACV,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG;IACtC,IAAI,EAAE,cAAc,CAAC;IACrB,KAAK,EAAE,eAAe,CAAC;CACxB,CAAC;AACF,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG;IACxC,IAAI,EAAE,gBAAgB,CAAC;IACvB,KAAK,EAAE,iBAAiB,CAAC;CAC1B,CAAC;AACF,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG;IAC3C,IAAI,EAAE,mBAAmB,CAAC;IAC1B,KAAK,EAAE,oBAAoB,CAAC;CAC7B,CAAC;AACF,MAAM,MAAM,wBAAwB,GAAG,MAAM,GAAG;IAC9C,IAAI,EAAE,sBAAsB,CAAC;IAC7B,KAAK,EAAE,uBAAuB,CAAC;CAChC,CAAC;AACF,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG;IAC5C,IAAI,EAAE,oBAAoB,CAAC;IAC3B,KAAK,EAAE,qBAAqB,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,6BAA6B,GACrC,gBAAgB,GAChB,kBAAkB,GAClB,qBAAqB,GACrB,wBAAwB,GACxB,sBAAsB,CAAC"}
@@ -1,7 +1,8 @@
1
- import { type SetAppNameInput, type SetAppStatusInput, type AddDocumentTypeInput, type RemoveDocumentTypeInput } from "../types.js";
2
- import { type SetAppNameAction, type SetAppStatusAction, type AddDocumentTypeAction, type RemoveDocumentTypeAction } from "./actions.js";
1
+ import { type SetAppNameInput, type SetAppStatusInput, type AddDocumentTypeInput, type RemoveDocumentTypeInput, type SetDocumentTypesInput } from "../types.js";
2
+ import { type SetAppNameAction, type SetAppStatusAction, type AddDocumentTypeAction, type RemoveDocumentTypeAction, type SetDocumentTypesAction } from "./actions.js";
3
3
  export declare const setAppName: (input: SetAppNameInput) => SetAppNameAction;
4
4
  export declare const setAppStatus: (input: SetAppStatusInput) => SetAppStatusAction;
5
5
  export declare const addDocumentType: (input: AddDocumentTypeInput) => AddDocumentTypeAction;
6
6
  export declare const removeDocumentType: (input: RemoveDocumentTypeInput) => RemoveDocumentTypeAction;
7
+ export declare const setDocumentTypes: (input: SetDocumentTypesInput) => SetDocumentTypesAction;
7
8
  //# sourceMappingURL=creators.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"creators.d.ts","sourceRoot":"","sources":["../../../../../document-models/app-module/gen/base-operations/creators.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC7B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC9B,MAAM,cAAc,CAAC;AAEtB,eAAO,MAAM,UAAU,GAAI,OAAO,eAAe,qBAO9C,CAAC;AAEJ,eAAO,MAAM,YAAY,GAAI,OAAO,iBAAiB,uBAOlD,CAAC;AAEJ,eAAO,MAAM,eAAe,GAAI,OAAO,oBAAoB,0BAOxD,CAAC;AAEJ,eAAO,MAAM,kBAAkB,GAAI,OAAO,uBAAuB,6BAO9D,CAAC"}
1
+ {"version":3,"file":"creators.d.ts","sourceRoot":"","sources":["../../../../../document-models/app-module/gen/base-operations/creators.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC3B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC5B,MAAM,cAAc,CAAC;AAEtB,eAAO,MAAM,UAAU,GAAI,OAAO,eAAe,qBAO9C,CAAC;AAEJ,eAAO,MAAM,YAAY,GAAI,OAAO,iBAAiB,uBAOlD,CAAC;AAEJ,eAAO,MAAM,eAAe,GAAI,OAAO,oBAAoB,0BAOxD,CAAC;AAEJ,eAAO,MAAM,kBAAkB,GAAI,OAAO,uBAAuB,6BAO9D,CAAC;AAEJ,eAAO,MAAM,gBAAgB,GAAI,OAAO,qBAAqB,2BAO1D,CAAC"}
@@ -5,3 +5,4 @@ export const setAppName = (input) => createAction("SET_APP_NAME", { ...input },
5
5
  export const setAppStatus = (input) => createAction("SET_APP_STATUS", { ...input }, undefined, z.SetAppStatusInputSchema, "global");
6
6
  export const addDocumentType = (input) => createAction("ADD_DOCUMENT_TYPE", { ...input }, undefined, z.AddDocumentTypeInputSchema, "global");
7
7
  export const removeDocumentType = (input) => createAction("REMOVE_DOCUMENT_TYPE", { ...input }, undefined, z.RemoveDocumentTypeInputSchema, "global");
8
+ export const setDocumentTypes = (input) => createAction("SET_DOCUMENT_TYPES", { ...input }, undefined, z.SetDocumentTypesInputSchema, "global");
@@ -1,10 +1,11 @@
1
1
  import { type SignalDispatch } from "document-model";
2
- import { type SetAppNameAction, type SetAppStatusAction, type AddDocumentTypeAction, type RemoveDocumentTypeAction } from "./actions.js";
2
+ import { type SetAppNameAction, type SetAppStatusAction, type AddDocumentTypeAction, type RemoveDocumentTypeAction, type SetDocumentTypesAction } from "./actions.js";
3
3
  import { type AppModuleState } from "../types.js";
4
4
  export interface AppModuleBaseOperationsOperations {
5
5
  setAppNameOperation: (state: AppModuleState, action: SetAppNameAction, dispatch?: SignalDispatch) => void;
6
6
  setAppStatusOperation: (state: AppModuleState, action: SetAppStatusAction, dispatch?: SignalDispatch) => void;
7
7
  addDocumentTypeOperation: (state: AppModuleState, action: AddDocumentTypeAction, dispatch?: SignalDispatch) => void;
8
8
  removeDocumentTypeOperation: (state: AppModuleState, action: RemoveDocumentTypeAction, dispatch?: SignalDispatch) => void;
9
+ setDocumentTypesOperation: (state: AppModuleState, action: SetDocumentTypesAction, dispatch?: SignalDispatch) => void;
9
10
  }
10
11
  //# sourceMappingURL=operations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../../../document-models/app-module/gen/base-operations/operations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC9B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,WAAW,iCAAiC;IAChD,mBAAmB,EAAE,CACnB,KAAK,EAAE,cAAc,EACrB,MAAM,EAAE,gBAAgB,EACxB,QAAQ,CAAC,EAAE,cAAc,KACtB,IAAI,CAAC;IACV,qBAAqB,EAAE,CACrB,KAAK,EAAE,cAAc,EACrB,MAAM,EAAE,kBAAkB,EAC1B,QAAQ,CAAC,EAAE,cAAc,KACtB,IAAI,CAAC;IACV,wBAAwB,EAAE,CACxB,KAAK,EAAE,cAAc,EACrB,MAAM,EAAE,qBAAqB,EAC7B,QAAQ,CAAC,EAAE,cAAc,KACtB,IAAI,CAAC;IACV,2BAA2B,EAAE,CAC3B,KAAK,EAAE,cAAc,EACrB,MAAM,EAAE,wBAAwB,EAChC,QAAQ,CAAC,EAAE,cAAc,KACtB,IAAI,CAAC;CACX"}
1
+ {"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../../../document-models/app-module/gen/base-operations/operations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC5B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,WAAW,iCAAiC;IAChD,mBAAmB,EAAE,CACnB,KAAK,EAAE,cAAc,EACrB,MAAM,EAAE,gBAAgB,EACxB,QAAQ,CAAC,EAAE,cAAc,KACtB,IAAI,CAAC;IACV,qBAAqB,EAAE,CACrB,KAAK,EAAE,cAAc,EACrB,MAAM,EAAE,kBAAkB,EAC1B,QAAQ,CAAC,EAAE,cAAc,KACtB,IAAI,CAAC;IACV,wBAAwB,EAAE,CACxB,KAAK,EAAE,cAAc,EACrB,MAAM,EAAE,qBAAqB,EAC7B,QAAQ,CAAC,EAAE,cAAc,KACtB,IAAI,CAAC;IACV,2BAA2B,EAAE,CAC3B,KAAK,EAAE,cAAc,EACrB,MAAM,EAAE,wBAAwB,EAChC,QAAQ,CAAC,EAAE,cAAc,KACtB,IAAI,CAAC;IACV,yBAAyB,EAAE,CACzB,KAAK,EAAE,cAAc,EACrB,MAAM,EAAE,sBAAsB,EAC9B,QAAQ,CAAC,EAAE,cAAc,KACtB,IAAI,CAAC;CACX"}
@@ -1 +1 @@
1
- {"version":3,"file":"document-model.d.ts","sourceRoot":"","sources":["../../../../document-models/app-module/gen/document-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAE/D,eAAO,MAAM,aAAa,EAAE,wBAsG3B,CAAC"}
1
+ {"version":3,"file":"document-model.d.ts","sourceRoot":"","sources":["../../../../document-models/app-module/gen/document-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAE/D,eAAO,MAAM,aAAa,EAAE,wBAmH3B,CAAC"}
@@ -13,8 +13,8 @@ export const documentModel = {
13
13
  changeLog: [],
14
14
  state: {
15
15
  global: {
16
- schema: "type AppModuleState {\n name: String!\n status: StatusType!\n documentTypes: [DocumentTypeItem!]\n dragAndDrop: DragAndDropSettings\n}\n\nenum StatusType {\n DRAFT\n CONFIRMED\n}\n\ntype DocumentTypeItem {\n id: OID!\n documentType: String!\n}\n\ntype DragAndDropSettings {\n enabled: Boolean!\n}",
17
- initialValue: '"{\\n \\"name\\": \\"\\",\\n \\"status\\": \\"DRAFT\\",\\n \\"documentTypes\\": [{ \\"id\\": \\"all-documents\\", \\"documentType\\": \\"*\\" }],\\n \\"dragAndDrop\\": {\\n \\"enabled\\": true\\n }\\n}"',
16
+ schema: "type AppModuleState {\n name: String!\n status: StatusType!\n allowedDocumentTypes: [String!]\n isDragAndDropEnabled: Boolean!\n}\n\nenum StatusType {\n DRAFT\n CONFIRMED\n}",
17
+ initialValue: '"{\\n \\"name\\": \\"\\",\\n \\"status\\": \\"DRAFT\\",\\n \\"allowedDocumentTypes\\": null,\\n \\"isDragAndDropEnabled\\": true\\n}"',
18
18
  examples: [],
19
19
  },
20
20
  local: {
@@ -55,7 +55,7 @@ export const documentModel = {
55
55
  id: "7376f168-695f-4aef-94d0-6e381666358c",
56
56
  name: "ADD_DOCUMENT_TYPE",
57
57
  description: "",
58
- schema: "input AddDocumentTypeInput {\n id: OID!\n documentType: String!\n}",
58
+ schema: "input AddDocumentTypeInput {\n documentType: String!\n}",
59
59
  template: "",
60
60
  reducer: "",
61
61
  errors: [],
@@ -66,7 +66,18 @@ export const documentModel = {
66
66
  id: "310e4e5b-3f14-4e9a-8e09-5583c7698a65",
67
67
  name: "REMOVE_DOCUMENT_TYPE",
68
68
  description: "",
69
- schema: "input RemoveDocumentTypeInput {\n id: OID!\n}",
69
+ schema: "input RemoveDocumentTypeInput {\n documentType: String!\n}",
70
+ template: "",
71
+ reducer: "",
72
+ errors: [],
73
+ examples: [],
74
+ scope: "global",
75
+ },
76
+ {
77
+ id: "b365727a-7df3-48f0-a4f8-02362f02ad1d",
78
+ name: "SET_DOCUMENT_TYPES",
79
+ description: "",
80
+ schema: "input SetDocumentTypesInput {\n documentTypes: [String!]!\n}",
70
81
  template: "",
71
82
  reducer: "",
72
83
  errors: [],
@@ -1 +1 @@
1
- {"version":3,"file":"ph-factories.d.ts","sourceRoot":"","sources":["../../../../document-models/app-module/gen/ph-factories.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEhF,OAAO,KAAK,EACV,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAGpB,wBAAgB,kBAAkB,IAAI,oBAAoB,CASzD;AAED,wBAAgB,iBAAiB,IAAI,mBAAmB,CAEvD;AAED,wBAAgB,cAAc,IAAI,gBAAgB,CAMjD;AAED,wBAAgB,iBAAiB,CAC/B,KAAK,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,GACpC,oBAAoB,CAKtB;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,GACnC,mBAAmB,CAKrB;AAED,wBAAgB,WAAW,CACzB,SAAS,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,EAChC,WAAW,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,EAC3C,UAAU,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,GACxC,gBAAgB,CAMlB;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,CAAC,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IACpC,MAAM,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACvC,KAAK,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACtC,CAAC,GACD,iBAAiB,CAYnB"}
1
+ {"version":3,"file":"ph-factories.d.ts","sourceRoot":"","sources":["../../../../document-models/app-module/gen/ph-factories.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEhF,OAAO,KAAK,EACV,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAGpB,wBAAgB,kBAAkB,IAAI,oBAAoB,CAOzD;AAED,wBAAgB,iBAAiB,IAAI,mBAAmB,CAEvD;AAED,wBAAgB,cAAc,IAAI,gBAAgB,CAMjD;AAED,wBAAgB,iBAAiB,CAC/B,KAAK,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,GACpC,oBAAoB,CAKtB;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,GACnC,mBAAmB,CAKrB;AAED,wBAAgB,WAAW,CACzB,SAAS,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,EAChC,WAAW,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,EAC3C,UAAU,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,GACxC,gBAAgB,CAMlB;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,CAAC,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IACpC,MAAM,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACvC,KAAK,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACtC,CAAC,GACD,iBAAiB,CAYnB"}
@@ -4,10 +4,8 @@ export function defaultGlobalState() {
4
4
  return {
5
5
  name: "",
6
6
  status: "DRAFT",
7
- documentTypes: [{ id: "all-documents", documentType: "*" }],
8
- dragAndDrop: {
9
- enabled: true,
10
- },
7
+ allowedDocumentTypes: null,
8
+ isDragAndDropEnabled: true,
11
9
  };
12
10
  }
13
11
  export function defaultLocalState() {
@@ -1 +1 @@
1
- {"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../../../document-models/app-module/gen/reducer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAMnD,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,gBAAgB,CA0DvD,CAAC;AAEF,eAAO,MAAM,OAAO,oDAAgD,CAAC"}
1
+ {"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../../../document-models/app-module/gen/reducer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAMnD,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,gBAAgB,CAmEvD,CAAC;AAEF,eAAO,MAAM,OAAO,oDAAgD,CAAC"}
@@ -23,6 +23,10 @@ export const stateReducer = (state, action, dispatch) => {
23
23
  z.RemoveDocumentTypeInputSchema().parse(action.input);
24
24
  BaseOperationsReducer.removeDocumentTypeOperation(state[action.scope], action, dispatch);
25
25
  break;
26
+ case "SET_DOCUMENT_TYPES":
27
+ z.SetDocumentTypesInputSchema().parse(action.input);
28
+ BaseOperationsReducer.setDocumentTypesOperation(state[action.scope], action, dispatch);
29
+ break;
26
30
  case "SET_DRAG_AND_DROP_ENABLED":
27
31
  z.SetDragAndDropEnabledInputSchema().parse(action.input);
28
32
  DndOperationsReducer.setDragAndDropEnabledOperation(state[action.scope], action, dispatch);
@@ -136,23 +136,15 @@ export type Scalars = {
136
136
  };
137
137
  export type AddDocumentTypeInput = {
138
138
  documentType: Scalars["String"]["input"];
139
- id: Scalars["OID"]["input"];
140
139
  };
141
140
  export type AppModuleState = {
142
- documentTypes: Maybe<Array<DocumentTypeItem>>;
143
- dragAndDrop: Maybe<DragAndDropSettings>;
141
+ allowedDocumentTypes: Maybe<Array<Scalars["String"]["output"]>>;
142
+ isDragAndDropEnabled: Scalars["Boolean"]["output"];
144
143
  name: Scalars["String"]["output"];
145
144
  status: StatusType | `${StatusType}`;
146
145
  };
147
- export type DocumentTypeItem = {
148
- documentType: Scalars["String"]["output"];
149
- id: Scalars["OID"]["output"];
150
- };
151
- export type DragAndDropSettings = {
152
- enabled: Scalars["Boolean"]["output"];
153
- };
154
146
  export type RemoveDocumentTypeInput = {
155
- id: Scalars["OID"]["input"];
147
+ documentType: Scalars["String"]["input"];
156
148
  };
157
149
  export type SetAppNameInput = {
158
150
  name: Scalars["String"]["input"];
@@ -160,6 +152,9 @@ export type SetAppNameInput = {
160
152
  export type SetAppStatusInput = {
161
153
  status: StatusType | `${StatusType}`;
162
154
  };
155
+ export type SetDocumentTypesInput = {
156
+ documentTypes: Array<Scalars["String"]["input"]>;
157
+ };
163
158
  export type SetDragAndDropEnabledInput = {
164
159
  enabled: Scalars["Boolean"]["input"];
165
160
  };
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../document-models/app-module/gen/schema/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;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,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,oBAAoB,EAAE,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAChE,oBAAoB,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC;IACnD,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC;IAClC,MAAM,EAAE,UAAU,GAAG,GAAG,UAAU,EAAE,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,YAAY,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,UAAU,GAAG,GAAG,UAAU,EAAE,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,aAAa,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;CAClD,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,OAAO,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import type { AddDocumentTypeInput, AppModuleState, DocumentTypeItem, DragAndDropSettings, RemoveDocumentTypeInput, SetAppNameInput, SetAppStatusInput, SetDragAndDropEnabledInput } from "./types.js";
2
+ import type { AddDocumentTypeInput, AppModuleState, RemoveDocumentTypeInput, SetAppNameInput, SetAppStatusInput, SetDocumentTypesInput, SetDragAndDropEnabledInput } from "./types.js";
3
3
  type Properties<T> = Required<{
4
4
  [K in keyof T]: z.ZodType<T[K], any, T[K]>;
5
5
  }>;
@@ -9,11 +9,10 @@ export declare const definedNonNullAnySchema: z.ZodEffects<z.ZodAny, definedNonN
9
9
  export declare const StatusTypeSchema: z.ZodEnum<["CONFIRMED", "DRAFT"]>;
10
10
  export declare function AddDocumentTypeInputSchema(): z.ZodObject<Properties<AddDocumentTypeInput>>;
11
11
  export declare function AppModuleStateSchema(): z.ZodObject<Properties<AppModuleState>>;
12
- export declare function DocumentTypeItemSchema(): z.ZodObject<Properties<DocumentTypeItem>>;
13
- export declare function DragAndDropSettingsSchema(): z.ZodObject<Properties<DragAndDropSettings>>;
14
12
  export declare function RemoveDocumentTypeInputSchema(): z.ZodObject<Properties<RemoveDocumentTypeInput>>;
15
13
  export declare function SetAppNameInputSchema(): z.ZodObject<Properties<SetAppNameInput>>;
16
14
  export declare function SetAppStatusInputSchema(): z.ZodObject<Properties<SetAppStatusInput>>;
15
+ export declare function SetDocumentTypesInputSchema(): z.ZodObject<Properties<SetDocumentTypesInput>>;
17
16
  export declare function SetDragAndDropEnabledInputSchema(): z.ZodObject<Properties<SetDragAndDropEnabledInput>>;
18
17
  export {};
19
18
  //# sourceMappingURL=zod.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"zod.d.ts","sourceRoot":"","sources":["../../../../../document-models/app-module/gen/schema/zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EACV,oBAAoB,EACpB,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,uBAAuB,EACvB,eAAe,EACf,iBAAiB,EACjB,0BAA0B,EAE3B,MAAM,YAAY,CAAC;AAEpB,KAAK,UAAU,CAAC,CAAC,IAAI,QAAQ,CAAC;KAC3B,CAAC,IAAI,MAAM,CAAC,GAAG,C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entType: z.string(),
10
- id: z.string(),
11
10
  });
12
11
  }
13
12
  export function AppModuleStateSchema() {
14
13
  return z.object({
15
14
  __typename: z.literal("AppModuleState").optional(),
16
- documentTypes: z.array(DocumentTypeItemSchema()).nullable(),
17
- dragAndDrop: DragAndDropSettingsSchema().nullable(),
15
+ allowedDocumentTypes: z.array(z.string()).nullable(),
16
+ isDragAndDropEnabled: z.boolean(),
18
17
  name: z.string(),
19
18
  status: StatusTypeSchema,
20
19
  });
21
20
  }
22
- export function DocumentTypeItemSchema() {
23
- return z.object({
24
- __typename: z.literal("DocumentTypeItem").optional(),
25
- documentType: z.string(),
26
- id: z.string(),
27
- });
28
- }
29
- export function DragAndDropSettingsSchema() {
30
- return z.object({
31
- __typename: z.literal("DragAndDropSettings").optional(),
32
- enabled: z.boolean(),
33
- });
34
- }
35
21
  export function RemoveDocumentTypeInputSchema() {
36
22
  return z.object({
37
- id: z.string(),
23
+ documentType: z.string(),
38
24
  });
39
25
  }
40
26
  export function SetAppNameInputSchema() {
@@ -47,6 +33,11 @@ export function SetAppStatusInputSchema() {
47
33
  status: StatusTypeSchema,
48
34
  });
49
35
  }
36
+ export function SetDocumentTypesInputSchema() {
37
+ return z.object({
38
+ documentTypes: z.array(z.string()),
39
+ });
40
+ }
50
41
  export function SetDragAndDropEnabledInputSchema() {
51
42
  return z.object({
52
43
  enabled: z.boolean(),
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../document-models/app-module/gen/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAQzD,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAC5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAGnD,eAAO,MAAM,kBAAkB,EAAE,oBAOhC,CAAC;AACF,eAAO,MAAM,iBAAiB,EAAE,mBAAwB,CAAC;AAEzD,QAAA,MAAM,KAAK,EAAE,kBAAkB,CAAC,gBAAgB,CAyB/C,CAAC;AAEF,eAAO,MAAM,cAAc,2DAAuB,CAAC;AACnD,eAAO,MAAM,WAAW,wDAAoB,CAAC;AAC7C,eAAO,MAAM,gBAAgB,2CAAyB,CAAC;AACvD,eAAO,MAAM,aAAa,0DAAsB,CAAC;AAEjD,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../document-models/app-module/gen/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAQzD,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAC5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAGnD,eAAO,MAAM,kBAAkB,EAAE,oBAKhC,CAAC;AACF,eAAO,MAAM,iBAAiB,EAAE,mBAAwB,CAAC;AAEzD,QAAA,MAAM,KAAK,EAAE,kBAAkB,CAAC,gBAAgB,CAyB/C,CAAC;AAEF,eAAO,MAAM,cAAc,2DAAuB,CAAC;AACnD,eAAO,MAAM,WAAW,wDAAoB,CAAC;AAC7C,eAAO,MAAM,gBAAgB,2CAAyB,CAAC;AACvD,eAAO,MAAM,aAAa,0DAAsB,CAAC;AAEjD,eAAe,KAAK,CAAC"}
@@ -3,10 +3,8 @@ import { reducer } from "./reducer.js";
3
3
  export const initialGlobalState = {
4
4
  name: "",
5
5
  status: "DRAFT",
6
- documentTypes: [{ id: "all-documents", documentType: "*" }],
7
- dragAndDrop: {
8
- enabled: true,
9
- },
6
+ allowedDocumentTypes: null,
7
+ isDragAndDropEnabled: true,
10
8
  };
11
9
  export const initialLocalState = {};
12
10
  const utils = {
@@ -18,6 +18,7 @@ declare const actions: {
18
18
  setAppStatus: (input: import("./gen/index.js").SetAppStatusInput) => import("./gen/index.js").SetAppStatusAction;
19
19
  addDocumentType: (input: import("./gen/index.js").AddDocumentTypeInput) => import("./gen/index.js").AddDocumentTypeAction;
20
20
  removeDocumentType: (input: import("./gen/index.js").RemoveDocumentTypeInput) => import("./gen/index.js").RemoveDocumentTypeAction;
21
+ setDocumentTypes: (input: import("./gen/index.js").SetDocumentTypesInput) => import("./gen/index.js").SetDocumentTypesAction;
21
22
  setDragAndDropEnabled: (input: import("./gen/index.js").SetDragAndDropEnabledInput) => import("./gen/index.js").SetDragAndDropEnabledAction;
22
23
  setName: (name: string) => import("document-model").SetNameAction;
23
24
  undo: (skip?: number, scope?: string) => import("document-model").UndoAction;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../document-models/app-module/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEL,KAAK,mBAAmB,EAEzB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,QAAA,MAAM,KAAK;;;;;;CAAkC,CAAC;AAC9C,QAAA,MAAM,OAAO;iBAPqB,+CACtB;mBAG2B,iDAEjC;sBAKA,oDAEO;yBAOM,uDAA8B;4BAtBjD,0DAAiC;;eAsBspM,CAAC,eAAe,CAAC;gBAAkE,CAAC,eAAe,CAAC;iBAAmE,CAAC,aAAa,CAAC,eAAe,CAAC;;;;gBAAqS,CAAC;CAb5mN,CAAC;AAExD,eAAO,MAAM,MAAM,EAAE,mBAAmB,CAAC,gBAAgB,CAKxD,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC;AAElD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../document-models/app-module/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEL,KAAK,mBAAmB,EAEzB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,QAAA,MAAM,KAAK;;;;;;CAAkC,CAAC;AAC9C,QAAA,MAAM,OAAO;iBANsC,+CACnC;mBAI4B,iDACxB;sBAM2B,oDAG1C;yBAI2E,uDAA8B;uBAAsM,qDAA4B;4BAtBhV,0DAAiC;;eAsBspM,CAAC,eAAe,CAAC;gBAAkE,CAAC,eAAe,CAAC;iBAAmE,CAAC,aAAa,CAAC,eAAe,CAAC;;;;gBAAqS,CAAC;CAb5mN,CAAC;AAExD,eAAO,MAAM,MAAM,EAAE,mBAAmB,CAAC,gBAAgB,CAKxD,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC;AAElD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"base-operations.d.ts","sourceRoot":"","sources":["../../../../../document-models/app-module/src/reducers/base-operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,yCAAyC,CAAC;AAEjG,eAAO,MAAM,OAAO,EAAE,iCAsBrB,CAAC"}
1
+ {"version":3,"file":"base-operations.d.ts","sourceRoot":"","sources":["../../../../../document-models/app-module/src/reducers/base-operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,yCAAyC,CAAC;AAEjG,eAAO,MAAM,OAAO,EAAE,iCA2BrB,CAAC"}
@@ -6,16 +6,19 @@ export const reducer = {
6
6
  state.status = action.input.status;
7
7
  },
8
8
  addDocumentTypeOperation(state, action, dispatch) {
9
- const documentTypes = state.documentTypes ?? [];
10
- documentTypes.push({
11
- id: action.input.id,
12
- documentType: action.input.documentType,
13
- });
14
- state.documentTypes = documentTypes;
9
+ const existingAllowedDocumentTypes = state.allowedDocumentTypes ?? [];
10
+ const newDocumentType = action.input.documentType;
11
+ const newAllowedDocumentTypesSet = new Set(existingAllowedDocumentTypes).add(newDocumentType);
12
+ const newAllowedDocumentTypes = [...newAllowedDocumentTypesSet];
13
+ state.allowedDocumentTypes = newAllowedDocumentTypes;
15
14
  },
16
15
  removeDocumentTypeOperation(state, action, dispatch) {
17
- let documentTypes = state.documentTypes ?? [];
18
- documentTypes = documentTypes.filter((documentType) => documentType.id !== action.input.id);
19
- state.documentTypes = documentTypes;
16
+ const existingAllowedDocumentTypes = state.allowedDocumentTypes;
17
+ const documentTypeToRemove = action.input.documentType;
18
+ const newAllowedDocumentTypes = existingAllowedDocumentTypes?.filter((dt) => dt !== documentTypeToRemove);
19
+ state.allowedDocumentTypes = newAllowedDocumentTypes ?? [];
20
+ },
21
+ setDocumentTypesOperation(state, action, dispatch) {
22
+ state.allowedDocumentTypes = action.input.documentTypes;
20
23
  },
21
24
  };
@@ -1 +1 @@
1
- {"version":3,"file":"dnd-operations.d.ts","sourceRoot":"","sources":["../../../../../document-models/app-module/src/reducers/dnd-operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,wCAAwC,CAAC;AAI/F,eAAO,MAAM,OAAO,EAAE,gCAMrB,CAAC"}
1
+ {"version":3,"file":"dnd-operations.d.ts","sourceRoot":"","sources":["../../../../../document-models/app-module/src/reducers/dnd-operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,wCAAwC,CAAC;AAE/F,eAAO,MAAM,OAAO,EAAE,gCAIrB,CAAC"}
@@ -1,8 +1,5 @@
1
- const defaultDragAndDrop = { enabled: false, documentTypes: [] };
2
1
  export const reducer = {
3
2
  setDragAndDropEnabledOperation(state, action, dispatch) {
4
- const dragAndDrop = state.dragAndDrop ?? defaultDragAndDrop;
5
- dragAndDrop.enabled = action.input.enabled;
6
- state.dragAndDrop = dragAndDrop;
3
+ state.isDragAndDropEnabled = action.input.enabled;
7
4
  },
8
5
  };
@@ -1,14 +1,2 @@
1
- import type { DocumentTypeItem } from "../../../document-models/app-module/index.js";
2
- export interface AppEditorFormProps {
3
- appName?: string;
4
- status?: string;
5
- dragAndDropEnabled?: boolean;
6
- documentTypes?: DocumentTypeItem[];
7
- onNameChange?: (name: string) => void;
8
- onDragAndDropToggle?: (enabled: boolean) => void;
9
- onAddDocumentType?: (id: string, documentType: string) => void;
10
- onRemoveDocumentType?: (id: string) => void;
11
- onConfirm?: () => void;
12
- }
13
- export declare const AppEditorForm: React.FC<AppEditorFormProps>;
1
+ export declare const AppEditorForm: () => import("react/jsx-runtime").JSX.Element;
14
2
  //# sourceMappingURL=AppEditorForm.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AppEditorForm.d.ts","sourceRoot":"","sources":["../../../../editors/app-editor/components/AppEditorForm.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAIrF,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,aAAa,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACnC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,mBAAmB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,iBAAiB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/D,oBAAoB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA6MtD,CAAC"}
1
+ {"version":3,"file":"AppEditorForm.d.ts","sourceRoot":"","sources":["../../../../editors/app-editor/components/AppEditorForm.tsx"],"names":[],"mappings":"AAcA,eAAO,MAAM,aAAa,+CAmOzB,CAAC"}
@@ -1,23 +1,39 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useDocumentTypesInSelectedDrive, useSupportedDocumentTypesInReactor, } from "@powerhousedao/reactor-browser";
2
3
  import { useEffect, useState } from "react";
4
+ import { actions } from "../../../document-models/app-module/index.js";
3
5
  import { StatusPill } from "../../components/index.js";
4
- import { useAvailableDocumentTypes, useDebounce } from "../../hooks/index.js";
5
- export const AppEditorForm = ({ appName: initialAppName = "", status = "DRAFT", dragAndDropEnabled = false, documentTypes: initialDocumentTypes = [], onNameChange, onDragAndDropToggle, onAddDocumentType, onRemoveDocumentType, onConfirm, }) => {
6
- const [appName, setAppName] = useState(initialAppName);
7
- const [documentTypes, setDocumentTypes] = useState(initialDocumentTypes);
8
- const [selectedDocumentType, setSelectedDocumentType] = useState("");
9
- const [isConfirmed, setIsConfirmed] = useState(false);
10
- // Get available document types from the hook (combines reactor and vetra drive)
11
- const availableDocumentTypes = useAvailableDocumentTypes();
6
+ import { useDebounce } from "../../hooks/index.js";
7
+ import { useSelectedAppModuleDocument } from "../../hooks/useVetraDocument.js";
8
+ const ALL_IN_DRIVE = "all-in-drive";
9
+ const ALL_IN_REACTOR = "all-in-reactor";
10
+ const ALLOW_ANY = "allow-any";
11
+ export const AppEditorForm = () => {
12
+ const [document, dispatch] = useSelectedAppModuleDocument();
13
+ const documentName = document.state.global.name;
14
+ const status = document.state.global.status;
15
+ const isDragAndDropEnabled = document.state.global.isDragAndDropEnabled;
16
+ const allowedDocumentTypes = document.state.global.allowedDocumentTypes;
17
+ const [appName, setAppName] = useState(documentName);
18
+ const [isConfirmed, setIsConfirmed] = useState(status === "CONFIRMED");
19
+ const documentTypesInSelectedDrive = useDocumentTypesInSelectedDrive();
20
+ const supportedDocumentTypesInReactor = useSupportedDocumentTypesInReactor();
21
+ const [selectedDocumentTypes, setSelectedDocumentTypes] = useState(allowedDocumentTypes ?? []);
12
22
  // Use the debounce hook for name changes
23
+ const onNameChange = (name) => {
24
+ if (name === documentName)
25
+ return;
26
+ dispatch(actions.setAppName({ name }));
27
+ };
13
28
  useDebounce(appName, onNameChange, 300);
14
- // Update local state when initial values change
15
- useEffect(() => {
16
- setAppName(initialAppName);
17
- }, [initialAppName]);
18
- useEffect(() => {
19
- setDocumentTypes(initialDocumentTypes);
20
- }, [initialDocumentTypes]);
29
+ const onConfirm = () => {
30
+ dispatch(actions.setAppStatus({ status: "CONFIRMED" }));
31
+ };
32
+ const onDragAndDropToggle = (enabled) => {
33
+ if (enabled === isDragAndDropEnabled)
34
+ return;
35
+ dispatch(actions.setDragAndDropEnabled({ enabled }));
36
+ };
21
37
  // Reset confirmation state if status changes back to DRAFT
22
38
  useEffect(() => {
23
39
  if (status === "DRAFT") {
@@ -29,46 +45,60 @@ export const AppEditorForm = ({ appName: initialAppName = "", status = "DRAFT",
29
45
  const handleConfirm = () => {
30
46
  if (appName.trim()) {
31
47
  setIsConfirmed(true); // Immediate UI update
32
- onConfirm?.();
48
+ onConfirm();
33
49
  }
34
50
  };
35
- const handleRemoveDocumentType = (id) => {
36
- setDocumentTypes(documentTypes.filter((dt) => dt.id !== id));
37
- onRemoveDocumentType?.(id);
51
+ const handleAddDocumentType = (documentType) => {
52
+ if (!documentType || selectedDocumentTypes.includes(documentType))
53
+ return;
54
+ setSelectedDocumentTypes([...selectedDocumentTypes, documentType]);
55
+ dispatch(actions.addDocumentType({ documentType }));
56
+ };
57
+ const handleRemoveDocumentType = (documentType) => {
58
+ setSelectedDocumentTypes(selectedDocumentTypes.filter((dt) => dt !== documentType));
59
+ dispatch(actions.removeDocumentType({ documentType }));
38
60
  };
39
- const handleAddDocumentType = (selectedValue) => {
40
- if (selectedValue &&
41
- !documentTypes.some((dt) => dt.documentType === selectedValue)) {
42
- if (selectedValue === "all-documents") {
43
- // Special case for "All documents" - clear all individual types and add "*"
44
- const newType = {
45
- id: "all-documents",
46
- documentType: "*",
47
- };
48
- // Remove all existing document types first
49
- documentTypes.forEach((dt) => onRemoveDocumentType?.(dt.id));
50
- setDocumentTypes([newType]);
51
- onAddDocumentType?.("all-documents", "*");
52
- }
53
- else {
54
- // Regular document type - only add if "*" is not already selected
55
- if (!documentTypes.some((dt) => dt.documentType === "*")) {
56
- const id = Date.now().toString();
57
- const newType = {
58
- id,
59
- documentType: selectedValue,
60
- };
61
- setDocumentTypes([...documentTypes, newType]);
62
- onAddDocumentType?.(id, selectedValue);
63
- }
64
- }
61
+ const handleAddAllDocumentTypesInDrive = () => {
62
+ const newDocumentTypes = [
63
+ ...new Set([
64
+ ...selectedDocumentTypes,
65
+ ...(documentTypesInSelectedDrive ?? []),
66
+ ]),
67
+ ];
68
+ setSelectedDocumentTypes(newDocumentTypes);
69
+ dispatch(actions.setDocumentTypes({ documentTypes: newDocumentTypes }));
70
+ };
71
+ const handleAddAllDocumentTypesInReactor = () => {
72
+ const newDocumentTypes = [
73
+ ...new Set([
74
+ ...selectedDocumentTypes,
75
+ ...(supportedDocumentTypesInReactor ?? []),
76
+ ]),
77
+ ];
78
+ setSelectedDocumentTypes(newDocumentTypes);
79
+ dispatch(actions.setDocumentTypes({ documentTypes: newDocumentTypes }));
80
+ };
81
+ const handleAllowAnyDocumentType = () => {
82
+ setSelectedDocumentTypes([]);
83
+ dispatch(actions.setDocumentTypes({ documentTypes: [] }));
84
+ };
85
+ const handleDocumentTypeSelection = (selectedValue) => {
86
+ if (selectedValue === ALL_IN_DRIVE) {
87
+ handleAddAllDocumentTypesInDrive();
88
+ }
89
+ else if (selectedValue === ALL_IN_REACTOR) {
90
+ handleAddAllDocumentTypesInReactor();
91
+ }
92
+ else if (selectedValue === ALLOW_ANY) {
93
+ handleAllowAnyDocumentType();
94
+ }
95
+ else {
96
+ handleAddDocumentType(selectedValue);
65
97
  }
66
- setSelectedDocumentType("");
67
98
  };
68
- return (_jsxs("div", { className: "space-y-6 bg-white p-6", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("h2", { className: "text-lg font-medium text-gray-900", children: "App Configuration" }), _jsx(StatusPill, { status: status === "CONFIRMED" ? "confirmed" : "draft", label: status === "CONFIRMED" ? "Confirmed" : "Draft" })] }), _jsxs("div", { children: [_jsx("label", { className: "mb-2 block text-sm font-medium text-gray-700", children: "App Name" }), _jsx("input", { type: "text", value: appName, onChange: (e) => setAppName(e.target.value), disabled: isReadOnly, className: `w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:outline-none focus:ring-2 focus:ring-blue-500 ${isReadOnly ? "cursor-not-allowed bg-gray-100" : ""}`, placeholder: "Enter app name" })] }), _jsxs("div", { children: [_jsx("label", { className: "mb-2 block text-sm font-medium text-gray-700", children: "Document Types" }), _jsxs("div", { className: "space-y-2", children: [!isReadOnly &&
69
- !documentTypes.some((dt) => dt.documentType === "*") && (_jsxs("select", { value: selectedDocumentType, onChange: (e) => handleAddDocumentType(e.target.value), className: "w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:outline-none focus:ring-2 focus:ring-blue-500", children: [_jsx("option", { value: "", children: "Select a document type to add" }), _jsx("option", { value: "all-documents", children: "All documents" }), availableDocumentTypes
70
- .filter((docType) => !documentTypes.some((dt) => dt.documentType === docType))
71
- .map((docType) => (_jsx("option", { value: docType, children: docType }, docType)))] })), _jsx("div", { className: "space-y-1", children: documentTypes.map((type) => (_jsxs("div", { className: "flex items-center py-1", children: [_jsx("span", { className: "text-sm text-gray-700", children: type.documentType === "*"
72
- ? "All documents (*)"
73
- : type.documentType }), !isReadOnly && (_jsx("button", { onClick: () => handleRemoveDocumentType(type.id), className: "ml-2 text-gray-400 hover:text-gray-600 focus:outline-none", children: "\u00D7" }))] }, type.id))) }), documentTypes.some((dt) => dt.documentType === "*") && (_jsx("p", { className: "text-sm italic text-gray-500", children: "Wildcard (*) matches all document types" }))] })] }), _jsxs("div", { children: [_jsx("h3", { className: "text-md mb-4 font-medium text-gray-900", children: "Drag and Drop Settings" }), _jsx("div", { className: "mb-4", children: _jsxs("label", { className: "flex items-center", children: [_jsx("input", { type: "checkbox", checked: dragAndDropEnabled, onChange: (e) => onDragAndDropToggle?.(e.target.checked), disabled: isReadOnly, className: `mr-2 h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500 ${isReadOnly ? "cursor-not-allowed" : ""}` }), _jsx("span", { className: "text-sm font-medium text-gray-700", children: "Enable drag and drop" })] }) })] }), !isReadOnly && (_jsx("div", { children: _jsx("button", { onClick: handleConfirm, disabled: !appName.trim(), className: "rounded-md bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 disabled:cursor-not-allowed disabled:bg-gray-300", children: "Confirm" }) }))] }));
99
+ return (_jsxs("div", { className: "space-y-6 bg-white p-6", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("h2", { className: "text-lg font-medium text-gray-900", children: "App Configuration" }), _jsx(StatusPill, { status: status === "CONFIRMED" ? "confirmed" : "draft", label: status === "CONFIRMED" ? "Confirmed" : "Draft" })] }), _jsxs("div", { children: [_jsx("label", { className: "mb-2 block text-sm font-medium text-gray-700", children: "App Name" }), _jsx("input", { type: "text", value: appName, onChange: (e) => setAppName(e.target.value), disabled: isReadOnly, className: `w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:outline-none focus:ring-2 focus:ring-blue-500 ${isReadOnly ? "cursor-not-allowed bg-gray-100" : ""}`, placeholder: "Enter app name" })] }), _jsxs("div", { children: [_jsx("label", { className: "mb-2 block text-sm font-medium text-gray-700", children: "Document Types" }), _jsxs("div", { className: "space-y-2", children: [!isReadOnly && (_jsxs("select", { onChange: (e) => handleDocumentTypeSelection(e.target.value), className: "w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:outline-none focus:ring-2 focus:ring-blue-500", children: [_jsx("option", { children: "Select a document type to add" }), _jsx("option", { children: "--- Vetra drive document types ---" }), _jsx("option", { value: ALL_IN_DRIVE, children: "Add all document types in Vetra drive" }), documentTypesInSelectedDrive
100
+ ?.filter((dt) => !selectedDocumentTypes.includes(dt))
101
+ .map((docType) => (_jsx("option", { value: docType, children: docType }, docType))), _jsx("option", { children: "--- Reactor document types ---" }), _jsx("option", { value: ALL_IN_REACTOR, children: "Add all document types in Reactor" }), supportedDocumentTypesInReactor
102
+ ?.filter((dt) => !selectedDocumentTypes.includes(dt))
103
+ .map((docType) => (_jsx("option", { value: docType, children: docType }, docType))), _jsx("option", { children: "--- Allow any document type ---" }), _jsx("option", { value: ALLOW_ANY, children: "Allow any document type" })] })), _jsx("div", { className: "space-y-1", children: selectedDocumentTypes.length > 0 ? (selectedDocumentTypes.map((type) => (_jsxs("div", { className: "flex items-center py-1", children: [_jsx("span", { className: "text-sm text-gray-700", children: type }), !isReadOnly && (_jsx("button", { onClick: () => handleRemoveDocumentType(type), className: "ml-2 text-gray-400 hover:text-gray-600 focus:outline-none", children: "\u00D7" }))] }, type)))) : (_jsx("span", { className: "text-sm text-gray-700", children: "All documents (*)" })) })] })] }), _jsxs("div", { children: [_jsx("h3", { className: "text-md mb-4 font-medium text-gray-900", children: "Drag and Drop Settings" }), _jsx("div", { className: "mb-4", children: _jsxs("label", { className: "flex items-center", children: [_jsx("input", { type: "checkbox", checked: isDragAndDropEnabled, onChange: (e) => onDragAndDropToggle(e.target.checked), disabled: isReadOnly, className: `mr-2 h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500 ${isReadOnly ? "cursor-not-allowed" : ""}` }), _jsx("span", { className: "text-sm font-medium text-gray-700", children: "Enable drag and drop" })] }) })] }), !isReadOnly && (_jsx("div", { children: _jsx("button", { onClick: handleConfirm, disabled: !appName.trim(), className: "rounded-md bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 disabled:cursor-not-allowed disabled:bg-gray-300", children: "Confirm" }) }))] }));
74
104
  };
@@ -0,0 +1,3 @@
1
+ import type { PHDocumentEditorConfig } from "@powerhousedao/reactor-browser";
2
+ export declare const editorConfig: PHDocumentEditorConfig;
3
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../editors/app-editor/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAE7E,eAAO,MAAM,YAAY,EAAE,sBAE1B,CAAC"}
@@ -0,0 +1,3 @@
1
+ export const editorConfig = {
2
+ isExternalControlsEnabled: false,
3
+ };