@powerhousedao/vetra 5.0.0 → 5.0.1-staging.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/document-models/app-module/actions.d.ts +18 -0
- package/dist/document-models/app-module/actions.d.ts.map +1 -0
- package/dist/document-models/app-module/actions.js +8 -0
- package/dist/document-models/app-module/gen/base-operations/creators.d.ts +2 -2
- package/dist/document-models/app-module/gen/base-operations/creators.d.ts.map +1 -1
- package/dist/document-models/app-module/gen/base-operations/creators.js +6 -7
- package/dist/document-models/app-module/gen/creators.d.ts +2 -0
- package/dist/document-models/app-module/gen/creators.d.ts.map +1 -1
- package/dist/document-models/app-module/gen/creators.js +2 -0
- package/dist/document-models/app-module/gen/dnd-operations/creators.d.ts +2 -2
- package/dist/document-models/app-module/gen/dnd-operations/creators.d.ts.map +1 -1
- package/dist/document-models/app-module/gen/dnd-operations/creators.js +2 -3
- package/dist/document-models/app-module/gen/document-schema.d.ts +199 -0
- package/dist/document-models/app-module/gen/document-schema.d.ts.map +1 -0
- package/dist/document-models/app-module/gen/document-schema.js +33 -0
- package/dist/document-models/app-module/gen/document-type.d.ts +2 -0
- package/dist/document-models/app-module/gen/document-type.d.ts.map +1 -0
- package/dist/document-models/app-module/gen/document-type.js +1 -0
- package/dist/document-models/app-module/gen/index.d.ts +8 -1
- package/dist/document-models/app-module/gen/index.d.ts.map +1 -1
- package/dist/document-models/app-module/gen/index.js +8 -1
- package/dist/document-models/app-module/gen/reducer.d.ts +1 -3
- package/dist/document-models/app-module/gen/reducer.d.ts.map +1 -1
- package/dist/document-models/app-module/gen/reducer.js +16 -16
- package/dist/document-models/app-module/gen/schema/index.d.ts +1 -1
- package/dist/document-models/app-module/gen/schema/index.d.ts.map +1 -1
- package/dist/document-models/app-module/gen/schema/index.js +1 -1
- package/dist/document-models/app-module/gen/types.d.ts +1 -2
- package/dist/document-models/app-module/gen/types.d.ts.map +1 -1
- package/dist/document-models/app-module/gen/types.js +0 -1
- package/dist/document-models/app-module/gen/utils.d.ts +5 -2
- package/dist/document-models/app-module/gen/utils.d.ts.map +1 -1
- package/dist/document-models/app-module/gen/utils.js +20 -3
- package/dist/document-models/app-module/hooks.d.ts +11 -0
- package/dist/document-models/app-module/hooks.d.ts.map +1 -0
- package/dist/document-models/app-module/hooks.js +26 -0
- package/dist/document-models/app-module/index.d.ts +5 -31
- package/dist/document-models/app-module/index.d.ts.map +1 -1
- package/dist/document-models/app-module/index.js +5 -18
- package/dist/document-models/app-module/module.d.ts +5 -0
- package/dist/document-models/app-module/module.d.ts.map +1 -0
- package/dist/document-models/app-module/module.js +10 -0
- package/dist/document-models/app-module/src/index.d.ts +2 -0
- package/dist/document-models/app-module/src/index.d.ts.map +1 -0
- package/dist/document-models/app-module/src/index.js +1 -0
- package/dist/document-models/app-module/src/reducers/base-operations.d.ts +2 -2
- package/dist/document-models/app-module/src/reducers/base-operations.d.ts.map +1 -1
- package/dist/document-models/app-module/src/reducers/base-operations.js +1 -1
- package/dist/document-models/app-module/src/reducers/dnd-operations.d.ts +2 -2
- package/dist/document-models/app-module/src/reducers/dnd-operations.d.ts.map +1 -1
- package/dist/document-models/app-module/src/reducers/dnd-operations.js +1 -1
- package/dist/document-models/app-module/src/tests/base-operations.test.js +32 -34
- package/dist/document-models/app-module/src/tests/dnd-operations.test.js +10 -13
- package/dist/document-models/app-module/src/tests/document-model.test.js +22 -21
- package/dist/document-models/app-module/utils.d.ts +14 -0
- package/dist/document-models/app-module/utils.d.ts.map +1 -0
- package/dist/document-models/app-module/utils.js +7 -0
- package/dist/document-models/document-editor/actions.d.ts +16 -0
- package/dist/document-models/document-editor/actions.d.ts.map +1 -0
- package/dist/document-models/document-editor/actions.js +4 -0
- package/dist/document-models/document-editor/gen/base-operations/creators.d.ts +2 -2
- package/dist/document-models/document-editor/gen/base-operations/creators.d.ts.map +1 -1
- package/dist/document-models/document-editor/gen/base-operations/creators.js +5 -6
- package/dist/document-models/document-editor/gen/creators.d.ts +1 -0
- package/dist/document-models/document-editor/gen/creators.d.ts.map +1 -1
- package/dist/document-models/document-editor/gen/creators.js +1 -0
- package/dist/document-models/document-editor/gen/document-schema.d.ts +180 -0
- package/dist/document-models/document-editor/gen/document-schema.d.ts.map +1 -0
- package/dist/document-models/document-editor/gen/document-schema.js +33 -0
- package/dist/document-models/document-editor/gen/document-type.d.ts +2 -0
- package/dist/document-models/document-editor/gen/document-type.d.ts.map +1 -0
- package/dist/document-models/document-editor/gen/document-type.js +1 -0
- package/dist/document-models/document-editor/gen/index.d.ts +7 -1
- package/dist/document-models/document-editor/gen/index.d.ts.map +1 -1
- package/dist/document-models/document-editor/gen/index.js +7 -1
- package/dist/document-models/document-editor/gen/reducer.d.ts +1 -3
- package/dist/document-models/document-editor/gen/reducer.d.ts.map +1 -1
- package/dist/document-models/document-editor/gen/reducer.js +11 -11
- package/dist/document-models/document-editor/gen/schema/index.d.ts +1 -1
- package/dist/document-models/document-editor/gen/schema/index.d.ts.map +1 -1
- package/dist/document-models/document-editor/gen/schema/index.js +1 -1
- package/dist/document-models/document-editor/gen/types.d.ts +1 -2
- package/dist/document-models/document-editor/gen/types.d.ts.map +1 -1
- package/dist/document-models/document-editor/gen/types.js +0 -1
- package/dist/document-models/document-editor/gen/utils.d.ts +5 -2
- package/dist/document-models/document-editor/gen/utils.d.ts.map +1 -1
- package/dist/document-models/document-editor/gen/utils.js +20 -3
- package/dist/document-models/document-editor/hooks.d.ts +11 -0
- package/dist/document-models/document-editor/hooks.d.ts.map +1 -0
- package/dist/document-models/document-editor/hooks.js +26 -0
- package/dist/document-models/document-editor/index.d.ts +5 -29
- package/dist/document-models/document-editor/index.d.ts.map +1 -1
- package/dist/document-models/document-editor/index.js +5 -18
- package/dist/document-models/document-editor/module.d.ts +5 -0
- package/dist/document-models/document-editor/module.d.ts.map +1 -0
- package/dist/document-models/document-editor/module.js +10 -0
- package/dist/document-models/document-editor/src/index.d.ts +2 -0
- package/dist/document-models/document-editor/src/index.d.ts.map +1 -0
- package/dist/document-models/document-editor/src/index.js +1 -0
- package/dist/document-models/document-editor/src/reducers/base-operations.d.ts +2 -2
- package/dist/document-models/document-editor/src/reducers/base-operations.d.ts.map +1 -1
- package/dist/document-models/document-editor/src/reducers/base-operations.js +1 -1
- package/dist/document-models/document-editor/src/tests/base-operations.test.js +22 -24
- package/dist/document-models/document-editor/src/tests/document-model.test.js +24 -22
- package/dist/document-models/document-editor/utils.d.ts +14 -0
- package/dist/document-models/document-editor/utils.d.ts.map +1 -0
- package/dist/document-models/document-editor/utils.js +7 -0
- package/dist/document-models/document-models.d.ts +3 -0
- package/dist/document-models/document-models.d.ts.map +1 -0
- package/dist/document-models/document-models.js +12 -0
- package/dist/document-models/index.d.ts +9 -5
- package/dist/document-models/index.d.ts.map +1 -1
- package/dist/document-models/index.js +9 -5
- package/dist/document-models/processor-module/actions.d.ts +17 -0
- package/dist/document-models/processor-module/actions.d.ts.map +1 -0
- package/dist/document-models/processor-module/actions.js +4 -0
- package/dist/document-models/processor-module/gen/base-operations/creators.d.ts +2 -2
- package/dist/document-models/processor-module/gen/base-operations/creators.d.ts.map +1 -1
- package/dist/document-models/processor-module/gen/base-operations/creators.js +6 -7
- package/dist/document-models/processor-module/gen/creators.d.ts +1 -0
- package/dist/document-models/processor-module/gen/creators.d.ts.map +1 -1
- package/dist/document-models/processor-module/gen/creators.js +1 -0
- package/dist/document-models/processor-module/gen/document-schema.d.ts +199 -0
- package/dist/document-models/processor-module/gen/document-schema.d.ts.map +1 -0
- package/dist/document-models/processor-module/gen/document-schema.js +33 -0
- package/dist/document-models/processor-module/gen/document-type.d.ts +2 -0
- package/dist/document-models/processor-module/gen/document-type.d.ts.map +1 -0
- package/dist/document-models/processor-module/gen/document-type.js +1 -0
- package/dist/document-models/processor-module/gen/index.d.ts +7 -1
- package/dist/document-models/processor-module/gen/index.d.ts.map +1 -1
- package/dist/document-models/processor-module/gen/index.js +7 -1
- package/dist/document-models/processor-module/gen/reducer.d.ts +1 -3
- package/dist/document-models/processor-module/gen/reducer.d.ts.map +1 -1
- package/dist/document-models/processor-module/gen/reducer.js +13 -13
- package/dist/document-models/processor-module/gen/schema/index.d.ts +1 -1
- package/dist/document-models/processor-module/gen/schema/index.d.ts.map +1 -1
- package/dist/document-models/processor-module/gen/schema/index.js +1 -1
- package/dist/document-models/processor-module/gen/types.d.ts +1 -2
- package/dist/document-models/processor-module/gen/types.d.ts.map +1 -1
- package/dist/document-models/processor-module/gen/types.js +0 -1
- package/dist/document-models/processor-module/gen/utils.d.ts +5 -2
- package/dist/document-models/processor-module/gen/utils.d.ts.map +1 -1
- package/dist/document-models/processor-module/gen/utils.js +20 -3
- package/dist/document-models/processor-module/hooks.d.ts +11 -0
- package/dist/document-models/processor-module/hooks.d.ts.map +1 -0
- package/dist/document-models/processor-module/hooks.js +26 -0
- package/dist/document-models/processor-module/index.d.ts +5 -30
- package/dist/document-models/processor-module/index.d.ts.map +1 -1
- package/dist/document-models/processor-module/index.js +5 -18
- package/dist/document-models/processor-module/module.d.ts +5 -0
- package/dist/document-models/processor-module/module.d.ts.map +1 -0
- package/dist/document-models/processor-module/module.js +10 -0
- package/dist/document-models/processor-module/src/index.d.ts +2 -0
- package/dist/document-models/processor-module/src/index.d.ts.map +1 -0
- package/dist/document-models/processor-module/src/index.js +1 -0
- package/dist/document-models/processor-module/src/reducers/base-operations.d.ts +2 -2
- package/dist/document-models/processor-module/src/reducers/base-operations.d.ts.map +1 -1
- package/dist/document-models/processor-module/src/reducers/base-operations.js +1 -1
- package/dist/document-models/processor-module/src/tests/base-operations.test.js +24 -26
- package/dist/document-models/processor-module/src/tests/document-model.test.js +26 -24
- package/dist/document-models/processor-module/utils.d.ts +14 -0
- package/dist/document-models/processor-module/utils.d.ts.map +1 -0
- package/dist/document-models/processor-module/utils.js +7 -0
- package/dist/document-models/subgraph-module/actions.d.ts +14 -0
- package/dist/document-models/subgraph-module/actions.d.ts.map +1 -0
- package/dist/document-models/subgraph-module/actions.js +4 -0
- package/dist/document-models/subgraph-module/gen/base-operations/creators.d.ts +2 -2
- package/dist/document-models/subgraph-module/gen/base-operations/creators.d.ts.map +1 -1
- package/dist/document-models/subgraph-module/gen/base-operations/creators.js +3 -4
- package/dist/document-models/subgraph-module/gen/creators.d.ts +1 -0
- package/dist/document-models/subgraph-module/gen/creators.d.ts.map +1 -1
- package/dist/document-models/subgraph-module/gen/creators.js +1 -0
- package/dist/document-models/subgraph-module/gen/document-schema.d.ts +161 -0
- package/dist/document-models/subgraph-module/gen/document-schema.d.ts.map +1 -0
- package/dist/document-models/subgraph-module/gen/document-schema.js +33 -0
- package/dist/document-models/subgraph-module/gen/document-type.d.ts +2 -0
- package/dist/document-models/subgraph-module/gen/document-type.d.ts.map +1 -0
- package/dist/document-models/subgraph-module/gen/document-type.js +1 -0
- package/dist/document-models/subgraph-module/gen/index.d.ts +7 -1
- package/dist/document-models/subgraph-module/gen/index.d.ts.map +1 -1
- package/dist/document-models/subgraph-module/gen/index.js +7 -1
- package/dist/document-models/subgraph-module/gen/reducer.d.ts +1 -3
- package/dist/document-models/subgraph-module/gen/reducer.d.ts.map +1 -1
- package/dist/document-models/subgraph-module/gen/reducer.js +7 -7
- package/dist/document-models/subgraph-module/gen/schema/index.d.ts +1 -1
- package/dist/document-models/subgraph-module/gen/schema/index.d.ts.map +1 -1
- package/dist/document-models/subgraph-module/gen/schema/index.js +1 -1
- package/dist/document-models/subgraph-module/gen/types.d.ts +1 -2
- package/dist/document-models/subgraph-module/gen/types.d.ts.map +1 -1
- package/dist/document-models/subgraph-module/gen/types.js +0 -1
- package/dist/document-models/subgraph-module/gen/utils.d.ts +5 -2
- package/dist/document-models/subgraph-module/gen/utils.d.ts.map +1 -1
- package/dist/document-models/subgraph-module/gen/utils.js +20 -3
- package/dist/document-models/subgraph-module/hooks.d.ts +11 -0
- package/dist/document-models/subgraph-module/hooks.d.ts.map +1 -0
- package/dist/document-models/subgraph-module/hooks.js +26 -0
- package/dist/document-models/subgraph-module/index.d.ts +5 -27
- package/dist/document-models/subgraph-module/index.d.ts.map +1 -1
- package/dist/document-models/subgraph-module/index.js +5 -18
- package/dist/document-models/subgraph-module/module.d.ts +5 -0
- package/dist/document-models/subgraph-module/module.d.ts.map +1 -0
- package/dist/document-models/subgraph-module/module.js +10 -0
- package/dist/document-models/subgraph-module/src/index.d.ts +2 -0
- package/dist/document-models/subgraph-module/src/index.d.ts.map +1 -0
- package/dist/document-models/subgraph-module/src/index.js +1 -0
- package/dist/document-models/subgraph-module/src/reducers/base-operations.d.ts +2 -2
- package/dist/document-models/subgraph-module/src/reducers/base-operations.d.ts.map +1 -1
- package/dist/document-models/subgraph-module/src/reducers/base-operations.js +1 -1
- package/dist/document-models/subgraph-module/src/tests/base-operations.test.js +7 -9
- package/dist/document-models/subgraph-module/src/tests/document-model.test.js +9 -7
- package/dist/document-models/subgraph-module/utils.d.ts +14 -0
- package/dist/document-models/subgraph-module/utils.d.ts.map +1 -0
- package/dist/document-models/subgraph-module/utils.js +7 -0
- package/dist/document-models/vetra-package/actions.d.ts +22 -0
- package/dist/document-models/vetra-package/actions.d.ts.map +1 -0
- package/dist/document-models/vetra-package/actions.js +4 -0
- package/dist/document-models/vetra-package/gen/base-operations/creators.d.ts +2 -2
- package/dist/document-models/vetra-package/gen/base-operations/creators.d.ts.map +1 -1
- package/dist/document-models/vetra-package/gen/base-operations/creators.js +11 -12
- package/dist/document-models/vetra-package/gen/creators.d.ts +1 -0
- package/dist/document-models/vetra-package/gen/creators.d.ts.map +1 -1
- package/dist/document-models/vetra-package/gen/creators.js +1 -0
- package/dist/document-models/vetra-package/gen/document-schema.d.ts +256 -0
- package/dist/document-models/vetra-package/gen/document-schema.d.ts.map +1 -0
- package/dist/document-models/vetra-package/gen/document-schema.js +33 -0
- package/dist/document-models/vetra-package/gen/document-type.d.ts +2 -0
- package/dist/document-models/vetra-package/gen/document-type.d.ts.map +1 -0
- package/dist/document-models/vetra-package/gen/document-type.js +1 -0
- package/dist/document-models/vetra-package/gen/index.d.ts +7 -1
- package/dist/document-models/vetra-package/gen/index.d.ts.map +1 -1
- package/dist/document-models/vetra-package/gen/index.js +7 -1
- package/dist/document-models/vetra-package/gen/reducer.d.ts +1 -3
- package/dist/document-models/vetra-package/gen/reducer.d.ts.map +1 -1
- package/dist/document-models/vetra-package/gen/reducer.js +23 -23
- package/dist/document-models/vetra-package/gen/schema/index.d.ts +1 -1
- package/dist/document-models/vetra-package/gen/schema/index.d.ts.map +1 -1
- package/dist/document-models/vetra-package/gen/schema/index.js +1 -1
- package/dist/document-models/vetra-package/gen/types.d.ts +1 -2
- package/dist/document-models/vetra-package/gen/types.d.ts.map +1 -1
- package/dist/document-models/vetra-package/gen/types.js +0 -1
- package/dist/document-models/vetra-package/gen/utils.d.ts +5 -2
- package/dist/document-models/vetra-package/gen/utils.d.ts.map +1 -1
- package/dist/document-models/vetra-package/gen/utils.js +20 -3
- package/dist/document-models/vetra-package/hooks.d.ts +11 -0
- package/dist/document-models/vetra-package/hooks.d.ts.map +1 -0
- package/dist/document-models/vetra-package/hooks.js +26 -0
- package/dist/document-models/vetra-package/index.d.ts +5 -35
- package/dist/document-models/vetra-package/index.d.ts.map +1 -1
- package/dist/document-models/vetra-package/index.js +5 -18
- package/dist/document-models/vetra-package/module.d.ts +5 -0
- package/dist/document-models/vetra-package/module.d.ts.map +1 -0
- package/dist/document-models/vetra-package/module.js +10 -0
- package/dist/document-models/vetra-package/src/index.d.ts +2 -0
- package/dist/document-models/vetra-package/src/index.d.ts.map +1 -0
- package/dist/document-models/vetra-package/src/index.js +1 -0
- package/dist/document-models/vetra-package/src/reducers/base-operations.d.ts +2 -2
- package/dist/document-models/vetra-package/src/reducers/base-operations.d.ts.map +1 -1
- package/dist/document-models/vetra-package/src/reducers/base-operations.js +1 -1
- package/dist/document-models/vetra-package/src/tests/base-operations.test.js +1 -1
- package/dist/document-models/vetra-package/src/tests/document-model.test.js +27 -25
- package/dist/document-models/vetra-package/utils.d.ts +14 -0
- package/dist/document-models/vetra-package/utils.d.ts.map +1 -0
- package/dist/document-models/vetra-package/utils.js +7 -0
- package/dist/editors/app-editor/components/AppEditorForm.d.ts.map +1 -1
- package/dist/editors/app-editor/components/AppEditorForm.js +4 -3
- package/dist/editors/app-editor/components/EditName.d.ts +3 -0
- package/dist/editors/app-editor/components/EditName.d.ts.map +1 -0
- package/dist/editors/app-editor/components/EditName.js +31 -0
- package/dist/editors/app-editor/editor.d.ts +1 -1
- package/dist/editors/app-editor/editor.d.ts.map +1 -1
- package/dist/editors/app-editor/editor.js +2 -2
- package/dist/editors/app-editor/editor.test.js +1 -1
- package/dist/editors/app-editor/module.d.ts +4 -0
- package/dist/editors/app-editor/module.d.ts.map +1 -0
- package/dist/editors/app-editor/module.js +10 -0
- package/dist/editors/document-editor/editor.d.ts +1 -1
- package/dist/editors/document-editor/editor.d.ts.map +1 -1
- package/dist/editors/document-editor/editor.js +2 -2
- package/dist/editors/document-editor/editor.test.js +1 -1
- package/dist/editors/document-editor/module.d.ts +3 -0
- package/dist/editors/document-editor/module.d.ts.map +1 -0
- package/dist/editors/document-editor/{index.js → module.js} +3 -4
- package/dist/editors/editors.d.ts +3 -0
- package/dist/editors/editors.d.ts.map +1 -0
- package/dist/editors/editors.js +14 -0
- package/dist/editors/hooks/useVetraDocument.d.ts +9 -9
- package/dist/editors/hooks/useVetraDocument.d.ts.map +1 -1
- package/dist/editors/index.d.ts +6 -6
- package/dist/editors/index.d.ts.map +1 -1
- package/dist/editors/index.js +6 -6
- package/dist/editors/processor-editor/editor.d.ts +1 -1
- package/dist/editors/processor-editor/editor.d.ts.map +1 -1
- package/dist/editors/processor-editor/editor.js +2 -2
- package/dist/editors/processor-editor/editor.test.js +1 -1
- package/dist/editors/processor-editor/module.d.ts +3 -0
- package/dist/editors/processor-editor/module.d.ts.map +1 -0
- package/dist/editors/processor-editor/{index.js → module.js} +3 -4
- package/dist/editors/subgraph-editor/editor.d.ts +1 -1
- package/dist/editors/subgraph-editor/editor.d.ts.map +1 -1
- package/dist/editors/subgraph-editor/editor.js +2 -2
- package/dist/editors/subgraph-editor/editor.test.js +1 -1
- package/dist/editors/subgraph-editor/module.d.ts +3 -0
- package/dist/editors/subgraph-editor/module.d.ts.map +1 -0
- package/dist/editors/subgraph-editor/{index.js → module.js} +3 -4
- package/dist/editors/vetra-drive-app/components/EditorContainer.js +1 -1
- package/dist/editors/vetra-drive-app/components/ModuleItem.d.ts.map +1 -1
- package/dist/editors/vetra-drive-app/components/ModuleItem.js +2 -1
- package/dist/editors/vetra-drive-app/editor.d.ts +1 -1
- package/dist/editors/vetra-drive-app/editor.d.ts.map +1 -1
- package/dist/editors/vetra-drive-app/editor.js +3 -6
- package/dist/editors/vetra-drive-app/module.d.ts +3 -0
- package/dist/editors/vetra-drive-app/module.d.ts.map +1 -0
- package/dist/editors/vetra-drive-app/{index.js → module.js} +3 -4
- package/dist/editors/vetra-package/editor.d.ts +1 -1
- package/dist/editors/vetra-package/editor.d.ts.map +1 -1
- package/dist/editors/vetra-package/editor.js +2 -2
- package/dist/editors/vetra-package/editor.test.js +1 -1
- package/dist/editors/vetra-package/module.d.ts +4 -0
- package/dist/editors/vetra-package/module.d.ts.map +1 -0
- package/dist/editors/vetra-package/module.js +10 -0
- package/dist/index.d.ts +3 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -5
- package/dist/processors/codegen/document-handlers/document-codegen-manager.js +1 -1
- package/dist/processors/codegen/document-handlers/generators/app-generator.d.ts.map +1 -1
- package/dist/processors/codegen/document-handlers/generators/app-generator.js +3 -0
- package/dist/processors/codegen/document-handlers/generators/document-editor-generator.d.ts.map +1 -1
- package/dist/processors/codegen/document-handlers/generators/document-editor-generator.js +3 -0
- package/dist/processors/codegen/document-handlers/generators/document-model-generator.d.ts.map +1 -1
- package/dist/processors/codegen/document-handlers/generators/document-model-generator.js +4 -0
- package/dist/processors/codegen/document-handlers/generators/package-generator.d.ts.map +1 -1
- package/dist/processors/codegen/document-handlers/generators/package-generator.js +3 -0
- package/dist/processors/codegen/document-handlers/generators/processor-generator.d.ts.map +1 -1
- package/dist/processors/codegen/document-handlers/generators/processor-generator.js +3 -0
- package/dist/processors/codegen/document-handlers/generators/subgraph-generator.d.ts.map +1 -1
- package/dist/processors/codegen/document-handlers/generators/subgraph-generator.js +3 -0
- package/dist/processors/codegen/document-handlers/generators/utils.d.ts +13 -0
- package/dist/processors/codegen/document-handlers/generators/utils.d.ts.map +1 -0
- package/dist/processors/codegen/document-handlers/generators/utils.js +29 -0
- package/dist/processors/vetra-read-model/migrations.d.ts.map +1 -1
- package/dist/processors/vetra-read-model/migrations.js +0 -1
- package/dist/style.css +5 -1
- package/dist/subgraphs/vetra-package/schema.d.ts.map +1 -1
- package/dist/subgraphs/vetra-package/schema.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/vite.config.d.ts.map +1 -1
- package/dist/vite.config.js +11 -1
- package/package.json +25 -18
- package/dist/editors/app-editor/index.d.ts +0 -4
- package/dist/editors/app-editor/index.d.ts.map +0 -1
- package/dist/editors/app-editor/index.js +0 -10
- package/dist/editors/document-editor/index.d.ts +0 -4
- package/dist/editors/document-editor/index.d.ts.map +0 -1
- package/dist/editors/processor-editor/index.d.ts +0 -4
- package/dist/editors/processor-editor/index.d.ts.map +0 -1
- package/dist/editors/subgraph-editor/index.d.ts +0 -4
- package/dist/editors/subgraph-editor/index.d.ts.map +0 -1
- package/dist/editors/vetra-drive-app/index.d.ts +0 -4
- package/dist/editors/vetra-drive-app/index.d.ts.map +0 -1
- package/dist/editors/vetra-package/index.d.ts +0 -5
- package/dist/editors/vetra-package/index.d.ts.map +0 -1
- package/dist/editors/vetra-package/index.js +0 -10
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useDocumentsInSelectedDrive, useDocumentsInSelectedFolder, useDocumentById, useSelectedDocument, } from "@powerhousedao/reactor-browser";
|
|
2
|
+
import { isAppModuleDocument } from "./gen/document-schema.js";
|
|
3
|
+
/** Hook to get a AppModule document by its id */
|
|
4
|
+
export function useAppModuleDocumentById(documentId) {
|
|
5
|
+
const [document, dispatch] = useDocumentById(documentId);
|
|
6
|
+
if (!isAppModuleDocument(document))
|
|
7
|
+
return [undefined, undefined];
|
|
8
|
+
return [document, dispatch];
|
|
9
|
+
}
|
|
10
|
+
/** Hook to get the selected AppModule document */
|
|
11
|
+
export function useSelectedAppModuleDocument() {
|
|
12
|
+
const [document, dispatch] = useSelectedDocument();
|
|
13
|
+
if (!isAppModuleDocument(document))
|
|
14
|
+
return [undefined, undefined];
|
|
15
|
+
return [document, dispatch];
|
|
16
|
+
}
|
|
17
|
+
/** Hook to get all AppModule documents in the selected drive */
|
|
18
|
+
export function useAppModuleDocumentsInSelectedDrive() {
|
|
19
|
+
const documentsInSelectedDrive = useDocumentsInSelectedDrive();
|
|
20
|
+
return documentsInSelectedDrive?.filter(isAppModuleDocument);
|
|
21
|
+
}
|
|
22
|
+
/** Hook to get all AppModule documents in the selected folder */
|
|
23
|
+
export function useAppModuleDocumentsInSelectedFolder() {
|
|
24
|
+
const documentsInSelectedFolder = useDocumentsInSelectedFolder();
|
|
25
|
+
return documentsInSelectedFolder?.filter(isAppModuleDocument);
|
|
26
|
+
}
|
|
@@ -2,35 +2,9 @@
|
|
|
2
2
|
* This is a scaffold file meant for customization.
|
|
3
3
|
* Delete the file and run the code generator again to have it reset
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
fileExtension: string;
|
|
11
|
-
createState: import("document-model").CreateState<AppModulePHState>;
|
|
12
|
-
createDocument: import("document-model").CreateDocument<AppModulePHState>;
|
|
13
|
-
loadFromInput: import("document-model").LoadFromInput<AppModulePHState>;
|
|
14
|
-
saveToFileHandle: import("document-model").SaveToFileHandle;
|
|
15
|
-
};
|
|
16
|
-
declare const actions: {
|
|
17
|
-
setAppName: (input: import("./gen/index.js").SetAppNameInput) => import("./gen/index.js").SetAppNameAction;
|
|
18
|
-
setAppStatus: (input: import("./gen/index.js").SetAppStatusInput) => import("./gen/index.js").SetAppStatusAction;
|
|
19
|
-
addDocumentType: (input: import("./gen/index.js").AddDocumentTypeInput) => import("./gen/index.js").AddDocumentTypeAction;
|
|
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;
|
|
22
|
-
setDragAndDropEnabled: (input: import("./gen/index.js").SetDragAndDropEnabledInput) => import("./gen/index.js").SetDragAndDropEnabledAction;
|
|
23
|
-
setName: (name: string) => import("document-model").SetNameAction;
|
|
24
|
-
undo: (skip?: number, scope?: string) => import("document-model").UndoAction;
|
|
25
|
-
redo: (count?: number, scope?: string) => import("document-model").RedoAction;
|
|
26
|
-
prune: (start?: number, end?: number, scope?: string) => import("document-model").SchemaPruneAction;
|
|
27
|
-
loadState: <TState extends import("document-model").PHBaseState = import("document-model").PHBaseState>(state: TState & {
|
|
28
|
-
name: string;
|
|
29
|
-
}, operations: number) => import("document-model").LoadStateAction;
|
|
30
|
-
noop: (scope?: string) => import("document-model").NOOPAction;
|
|
31
|
-
};
|
|
32
|
-
export declare const module: DocumentModelModule<AppModulePHState>;
|
|
33
|
-
export { reducer, actions, utils, documentModel };
|
|
34
|
-
export * from "./gen/types.js";
|
|
35
|
-
export * from "./src/utils.js";
|
|
5
|
+
export * from "./gen/index.js";
|
|
6
|
+
export * from "./src/index.js";
|
|
7
|
+
export * from "./hooks.js";
|
|
8
|
+
export { actions } from "./actions.js";
|
|
9
|
+
export { utils } from "./utils.js";
|
|
36
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../document-models/app-module/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../document-models/app-module/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -2,21 +2,8 @@
|
|
|
2
2
|
* This is a scaffold file meant for customization.
|
|
3
3
|
* Delete the file and run the code generator again to have it reset
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import genUtils from "./gen/utils.js";
|
|
11
|
-
import * as customUtils from "./src/utils.js";
|
|
12
|
-
const utils = { ...genUtils, ...customUtils };
|
|
13
|
-
const actions = { ...baseActions, ...AppModuleActions };
|
|
14
|
-
export const module = {
|
|
15
|
-
reducer,
|
|
16
|
-
actions,
|
|
17
|
-
utils,
|
|
18
|
-
documentModel: createState(defaultBaseState(), documentModel),
|
|
19
|
-
};
|
|
20
|
-
export { reducer, actions, utils, documentModel };
|
|
21
|
-
export * from "./gen/types.js";
|
|
22
|
-
export * from "./src/utils.js";
|
|
5
|
+
export * from "./gen/index.js";
|
|
6
|
+
export * from "./src/index.js";
|
|
7
|
+
export * from "./hooks.js";
|
|
8
|
+
export { actions } from "./actions.js";
|
|
9
|
+
export { utils } from "./utils.js";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DocumentModelModule } from "document-model";
|
|
2
|
+
import type { AppModulePHState } from "@powerhousedao/vetra/document-models/app-module";
|
|
3
|
+
/** Document model module for the Todo List document type */
|
|
4
|
+
export declare const AppModule: DocumentModelModule<AppModulePHState>;
|
|
5
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../document-models/app-module/module.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAG1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iDAAiD,CAAC;AAQxF,4DAA4D;AAC5D,eAAO,MAAM,SAAS,EAAE,mBAAmB,CAAC,gBAAgB,CAK3D,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createState } from "document-model";
|
|
2
|
+
import { defaultBaseState } from "document-model/core";
|
|
3
|
+
import { actions, documentModel, reducer, utils, } from "@powerhousedao/vetra/document-models/app-module";
|
|
4
|
+
/** Document model module for the Todo List document type */
|
|
5
|
+
export const AppModule = {
|
|
6
|
+
reducer,
|
|
7
|
+
actions,
|
|
8
|
+
utils,
|
|
9
|
+
documentModel: createState(defaultBaseState(), documentModel),
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../document-models/app-module/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./utils.js";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { AppModuleBaseOperationsOperations } from "
|
|
2
|
-
export declare const
|
|
1
|
+
import type { AppModuleBaseOperationsOperations } from "@powerhousedao/vetra/document-models/app-module";
|
|
2
|
+
export declare const appModuleBaseOperationsOperations: AppModuleBaseOperationsOperations;
|
|
3
3
|
//# sourceMappingURL=base-operations.d.ts.map
|
|
@@ -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,
|
|
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,iDAAiD,CAAC;AAEzG,eAAO,MAAM,iCAAiC,EAAE,iCAgC7C,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { AppModuleDndOperationsOperations } from "
|
|
2
|
-
export declare const
|
|
1
|
+
import type { AppModuleDndOperationsOperations } from "@powerhousedao/vetra/document-models/app-module";
|
|
2
|
+
export declare const appModuleDndOperationsOperations: AppModuleDndOperationsOperations;
|
|
3
3
|
//# sourceMappingURL=dnd-operations.d.ts.map
|
|
@@ -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,
|
|
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,iDAAiD,CAAC;AAExG,eAAO,MAAM,gCAAgC,EAAE,gCAK5C,CAAC"}
|
|
@@ -2,10 +2,8 @@
|
|
|
2
2
|
* This is a scaffold file meant for customization:
|
|
3
3
|
* - change it by adding new tests or modifying the existing ones
|
|
4
4
|
*/
|
|
5
|
+
import { addDocumentType, reducer, removeDocumentType, setAppName, setAppStatus, utils, } from "@powerhousedao/vetra/document-models/app-module";
|
|
5
6
|
import { beforeEach, describe, expect, it } from "vitest";
|
|
6
|
-
import * as creators from "../../gen/base-operations/creators.js";
|
|
7
|
-
import { reducer } from "../../gen/reducer.js";
|
|
8
|
-
import utils from "../../gen/utils.js";
|
|
9
7
|
describe("BaseOperations Operations", () => {
|
|
10
8
|
let document;
|
|
11
9
|
beforeEach(() => {
|
|
@@ -14,12 +12,12 @@ describe("BaseOperations Operations", () => {
|
|
|
14
12
|
describe("setAppName", () => {
|
|
15
13
|
it("should mutate state with new name", () => {
|
|
16
14
|
const input = { name: "My Test App" };
|
|
17
|
-
const updatedDocument = reducer(document,
|
|
15
|
+
const updatedDocument = reducer(document, setAppName(input));
|
|
18
16
|
expect(updatedDocument.state.global.name).toBe("My Test App");
|
|
19
17
|
});
|
|
20
18
|
it("should reject empty string and store error in operation", () => {
|
|
21
19
|
const input = { name: "" };
|
|
22
|
-
const updatedDocument = reducer(document,
|
|
20
|
+
const updatedDocument = reducer(document, setAppName(input));
|
|
23
21
|
// The operation should be recorded but with an error
|
|
24
22
|
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
25
23
|
expect(updatedDocument.operations.global[0].error).toBe("App name cannot be empty");
|
|
@@ -28,7 +26,7 @@ describe("BaseOperations Operations", () => {
|
|
|
28
26
|
});
|
|
29
27
|
it("should reject whitespace-only name and store error in operation", () => {
|
|
30
28
|
const input = { name: " " };
|
|
31
|
-
const updatedDocument = reducer(document,
|
|
29
|
+
const updatedDocument = reducer(document, setAppName(input));
|
|
32
30
|
// The operation should be recorded but with an error
|
|
33
31
|
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
34
32
|
expect(updatedDocument.operations.global[0].error).toBe("App name cannot be empty");
|
|
@@ -39,22 +37,22 @@ describe("BaseOperations Operations", () => {
|
|
|
39
37
|
describe("setAppStatus", () => {
|
|
40
38
|
it("should mutate state with new status", () => {
|
|
41
39
|
const input = { status: "CONFIRMED" };
|
|
42
|
-
const updatedDocument = reducer(document,
|
|
40
|
+
const updatedDocument = reducer(document, setAppStatus(input));
|
|
43
41
|
expect(updatedDocument.state.global.status).toBe("CONFIRMED");
|
|
44
42
|
});
|
|
45
43
|
it("should transition from DRAFT to CONFIRMED", () => {
|
|
46
44
|
expect(document.state.global.status).toBe("DRAFT");
|
|
47
|
-
const updatedDocument = reducer(document,
|
|
45
|
+
const updatedDocument = reducer(document, setAppStatus({ status: "CONFIRMED" }));
|
|
48
46
|
expect(updatedDocument.state.global.status).toBe("CONFIRMED");
|
|
49
47
|
});
|
|
50
48
|
it("should transition from CONFIRMED to DRAFT", () => {
|
|
51
|
-
const confirmedDoc = reducer(document,
|
|
52
|
-
const updatedDocument = reducer(confirmedDoc,
|
|
49
|
+
const confirmedDoc = reducer(document, setAppStatus({ status: "CONFIRMED" }));
|
|
50
|
+
const updatedDocument = reducer(confirmedDoc, setAppStatus({ status: "DRAFT" }));
|
|
53
51
|
expect(updatedDocument.state.global.status).toBe("DRAFT");
|
|
54
52
|
});
|
|
55
53
|
it("should handle setting same status twice", () => {
|
|
56
|
-
const firstUpdate = reducer(document,
|
|
57
|
-
const secondUpdate = reducer(firstUpdate,
|
|
54
|
+
const firstUpdate = reducer(document, setAppStatus({ status: "CONFIRMED" }));
|
|
55
|
+
const secondUpdate = reducer(firstUpdate, setAppStatus({ status: "CONFIRMED" }));
|
|
58
56
|
expect(secondUpdate.state.global.status).toBe("CONFIRMED");
|
|
59
57
|
expect(secondUpdate.operations.global).toHaveLength(2);
|
|
60
58
|
});
|
|
@@ -64,7 +62,7 @@ describe("BaseOperations Operations", () => {
|
|
|
64
62
|
const input = {
|
|
65
63
|
documentType: "powerhouse/test",
|
|
66
64
|
};
|
|
67
|
-
const updatedDocument = reducer(document,
|
|
65
|
+
const updatedDocument = reducer(document, addDocumentType(input));
|
|
68
66
|
expect(updatedDocument.state.global.allowedDocumentTypes).toContain("powerhouse/test");
|
|
69
67
|
});
|
|
70
68
|
it("should initialize array when allowedDocumentTypes is null", () => {
|
|
@@ -73,19 +71,19 @@ describe("BaseOperations Operations", () => {
|
|
|
73
71
|
const input = {
|
|
74
72
|
documentType: "powerhouse/first",
|
|
75
73
|
};
|
|
76
|
-
const updatedDocument = reducer(document,
|
|
74
|
+
const updatedDocument = reducer(document, addDocumentType(input));
|
|
77
75
|
expect(updatedDocument.state.global.allowedDocumentTypes).toEqual([
|
|
78
76
|
"powerhouse/first",
|
|
79
77
|
]);
|
|
80
78
|
});
|
|
81
79
|
it("should add multiple document types sequentially", () => {
|
|
82
|
-
let updatedDoc = reducer(document,
|
|
80
|
+
let updatedDoc = reducer(document, addDocumentType({
|
|
83
81
|
documentType: "powerhouse/a",
|
|
84
82
|
}));
|
|
85
|
-
updatedDoc = reducer(updatedDoc,
|
|
83
|
+
updatedDoc = reducer(updatedDoc, addDocumentType({
|
|
86
84
|
documentType: "powerhouse/b",
|
|
87
85
|
}));
|
|
88
|
-
updatedDoc = reducer(updatedDoc,
|
|
86
|
+
updatedDoc = reducer(updatedDoc, addDocumentType({
|
|
89
87
|
documentType: "powerhouse/c",
|
|
90
88
|
}));
|
|
91
89
|
expect(updatedDoc.state.global.allowedDocumentTypes).toHaveLength(3);
|
|
@@ -98,10 +96,10 @@ describe("BaseOperations Operations", () => {
|
|
|
98
96
|
documentType: "powerhouse/duplicate",
|
|
99
97
|
};
|
|
100
98
|
// First addition should succeed
|
|
101
|
-
let updatedDoc = reducer(document,
|
|
99
|
+
let updatedDoc = reducer(document, addDocumentType(input));
|
|
102
100
|
expect(updatedDoc.state.global.allowedDocumentTypes).toHaveLength(1);
|
|
103
101
|
// Second addition with same documentType should not add duplicate (uses Set)
|
|
104
|
-
updatedDoc = reducer(updatedDoc,
|
|
102
|
+
updatedDoc = reducer(updatedDoc, addDocumentType({
|
|
105
103
|
documentType: "powerhouse/duplicate",
|
|
106
104
|
}));
|
|
107
105
|
// Should still only have 1 item (no duplicates in a Set)
|
|
@@ -109,9 +107,9 @@ describe("BaseOperations Operations", () => {
|
|
|
109
107
|
expect(updatedDoc.state.global.allowedDocumentTypes).toContain("powerhouse/duplicate");
|
|
110
108
|
});
|
|
111
109
|
it("should handle adding various documentType values", () => {
|
|
112
|
-
let updatedDoc = reducer(document,
|
|
113
|
-
updatedDoc = reducer(updatedDoc,
|
|
114
|
-
updatedDoc = reducer(updatedDoc,
|
|
110
|
+
let updatedDoc = reducer(document, addDocumentType({ documentType: "powerhouse/budget" }));
|
|
111
|
+
updatedDoc = reducer(updatedDoc, addDocumentType({ documentType: "powerhouse/document-model" }));
|
|
112
|
+
updatedDoc = reducer(updatedDoc, addDocumentType({ documentType: "custom/type" }));
|
|
115
113
|
expect(updatedDoc.state.global.allowedDocumentTypes).toContain("powerhouse/budget");
|
|
116
114
|
expect(updatedDoc.state.global.allowedDocumentTypes).toContain("powerhouse/document-model");
|
|
117
115
|
expect(updatedDoc.state.global.allowedDocumentTypes).toContain("custom/type");
|
|
@@ -120,52 +118,52 @@ describe("BaseOperations Operations", () => {
|
|
|
120
118
|
describe("removeDocumentType", () => {
|
|
121
119
|
it("should mutate state by removing document type from array", () => {
|
|
122
120
|
// First add a document type
|
|
123
|
-
let updatedDoc = reducer(document,
|
|
121
|
+
let updatedDoc = reducer(document, addDocumentType({
|
|
124
122
|
documentType: "powerhouse/to-remove",
|
|
125
123
|
}));
|
|
126
124
|
expect(updatedDoc.state.global.allowedDocumentTypes).toContain("powerhouse/to-remove");
|
|
127
125
|
// Then remove it
|
|
128
|
-
updatedDoc = reducer(updatedDoc,
|
|
126
|
+
updatedDoc = reducer(updatedDoc, removeDocumentType({ documentType: "powerhouse/to-remove" }));
|
|
129
127
|
expect(updatedDoc.state.global.allowedDocumentTypes).not.toContain("powerhouse/to-remove");
|
|
130
128
|
});
|
|
131
129
|
it("should remove existing document type", () => {
|
|
132
|
-
let updatedDoc = reducer(document,
|
|
130
|
+
let updatedDoc = reducer(document, addDocumentType({
|
|
133
131
|
documentType: "powerhouse/existing",
|
|
134
132
|
}));
|
|
135
133
|
const lengthBefore = updatedDoc.state.global.allowedDocumentTypes?.length ?? 0;
|
|
136
|
-
updatedDoc = reducer(updatedDoc,
|
|
134
|
+
updatedDoc = reducer(updatedDoc, removeDocumentType({ documentType: "powerhouse/existing" }));
|
|
137
135
|
expect(updatedDoc.state.global.allowedDocumentTypes?.length).toBe(lengthBefore - 1);
|
|
138
136
|
expect(updatedDoc.state.global.allowedDocumentTypes?.includes("powerhouse/existing")).toBe(false);
|
|
139
137
|
});
|
|
140
138
|
it("should gracefully handle non-existent document type", () => {
|
|
141
|
-
const updatedDocument = reducer(document,
|
|
139
|
+
const updatedDocument = reducer(document, removeDocumentType({ documentType: "non-existent-type" }));
|
|
142
140
|
// Should result in empty array
|
|
143
141
|
expect(updatedDocument.state.global.allowedDocumentTypes).toEqual([]);
|
|
144
142
|
});
|
|
145
143
|
it("should handle null array gracefully", () => {
|
|
146
144
|
expect(document.state.global.allowedDocumentTypes).toBeNull();
|
|
147
|
-
const updatedDocument = reducer(document,
|
|
145
|
+
const updatedDocument = reducer(document, removeDocumentType({ documentType: "any-type" }));
|
|
148
146
|
expect(updatedDocument.state.global.allowedDocumentTypes).toEqual([]);
|
|
149
147
|
});
|
|
150
148
|
it("should add then immediately remove item", () => {
|
|
151
|
-
let updatedDoc = reducer(document,
|
|
149
|
+
let updatedDoc = reducer(document, addDocumentType({
|
|
152
150
|
documentType: "powerhouse/temp",
|
|
153
151
|
}));
|
|
154
|
-
updatedDoc = reducer(updatedDoc,
|
|
152
|
+
updatedDoc = reducer(updatedDoc, removeDocumentType({ documentType: "powerhouse/temp" }));
|
|
155
153
|
expect(updatedDoc.state.global.allowedDocumentTypes?.includes("powerhouse/temp")).toBe(false);
|
|
156
154
|
expect(updatedDoc.operations.global).toHaveLength(2);
|
|
157
155
|
});
|
|
158
156
|
it("should remove from list and preserve other items", () => {
|
|
159
|
-
let updatedDoc = reducer(document,
|
|
157
|
+
let updatedDoc = reducer(document, addDocumentType({
|
|
160
158
|
documentType: "powerhouse/a",
|
|
161
159
|
}));
|
|
162
|
-
updatedDoc = reducer(updatedDoc,
|
|
160
|
+
updatedDoc = reducer(updatedDoc, addDocumentType({
|
|
163
161
|
documentType: "powerhouse/b",
|
|
164
162
|
}));
|
|
165
|
-
updatedDoc = reducer(updatedDoc,
|
|
163
|
+
updatedDoc = reducer(updatedDoc, addDocumentType({
|
|
166
164
|
documentType: "powerhouse/c",
|
|
167
165
|
}));
|
|
168
|
-
updatedDoc = reducer(updatedDoc,
|
|
166
|
+
updatedDoc = reducer(updatedDoc, removeDocumentType({ documentType: "powerhouse/b" }));
|
|
169
167
|
expect(updatedDoc.state.global.allowedDocumentTypes).toHaveLength(2);
|
|
170
168
|
expect(updatedDoc.state.global.allowedDocumentTypes).toContain("powerhouse/a");
|
|
171
169
|
expect(updatedDoc.state.global.allowedDocumentTypes).toContain("powerhouse/c");
|
|
@@ -3,11 +3,8 @@
|
|
|
3
3
|
* - change it by adding new tests or modifying the existing ones
|
|
4
4
|
*/
|
|
5
5
|
import { generateMock } from "@powerhousedao/codegen";
|
|
6
|
+
import { reducer, setDragAndDropEnabled, SetDragAndDropEnabledInputSchema, utils, } from "@powerhousedao/vetra/document-models/app-module";
|
|
6
7
|
import { beforeEach, describe, expect, it } from "vitest";
|
|
7
|
-
import * as creators from "../../gen/dnd-operations/creators.js";
|
|
8
|
-
import { reducer } from "../../gen/reducer.js";
|
|
9
|
-
import { z } from "../../gen/schema/index.js";
|
|
10
|
-
import utils from "../../gen/utils.js";
|
|
11
8
|
describe("DndOperations Operations", () => {
|
|
12
9
|
let document;
|
|
13
10
|
beforeEach(() => {
|
|
@@ -15,8 +12,8 @@ describe("DndOperations Operations", () => {
|
|
|
15
12
|
});
|
|
16
13
|
describe("setDragAndDropEnabled", () => {
|
|
17
14
|
it("should handle setDragAndDropEnabled operation", () => {
|
|
18
|
-
const input = generateMock(
|
|
19
|
-
const updatedDocument = reducer(document,
|
|
15
|
+
const input = generateMock(SetDragAndDropEnabledInputSchema());
|
|
16
|
+
const updatedDocument = reducer(document, setDragAndDropEnabled(input));
|
|
20
17
|
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
21
18
|
expect(updatedDocument.operations.global[0].action.type).toBe("SET_DRAG_AND_DROP_ENABLED");
|
|
22
19
|
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
@@ -24,30 +21,30 @@ describe("DndOperations Operations", () => {
|
|
|
24
21
|
});
|
|
25
22
|
it("should mutate state with new enabled value", () => {
|
|
26
23
|
const input = { enabled: false };
|
|
27
|
-
const updatedDocument = reducer(document,
|
|
24
|
+
const updatedDocument = reducer(document, setDragAndDropEnabled(input));
|
|
28
25
|
expect(updatedDocument.state.global.isDragAndDropEnabled).toBe(false);
|
|
29
26
|
});
|
|
30
27
|
it("should enable drag and drop from initial state", () => {
|
|
31
28
|
// Initial state has isDragAndDropEnabled = true
|
|
32
29
|
expect(document.state.global.isDragAndDropEnabled).toBe(true);
|
|
33
|
-
const updatedDocument = reducer(document,
|
|
30
|
+
const updatedDocument = reducer(document, setDragAndDropEnabled({ enabled: true }));
|
|
34
31
|
expect(updatedDocument.state.global.isDragAndDropEnabled).toBe(true);
|
|
35
32
|
});
|
|
36
33
|
it("should disable drag and drop", () => {
|
|
37
|
-
const updatedDocument = reducer(document,
|
|
34
|
+
const updatedDocument = reducer(document, setDragAndDropEnabled({ enabled: false }));
|
|
38
35
|
expect(updatedDocument.state.global.isDragAndDropEnabled).toBe(false);
|
|
39
36
|
});
|
|
40
37
|
it("should toggle drag and drop in sequence", () => {
|
|
41
|
-
let updatedDoc = reducer(document,
|
|
38
|
+
let updatedDoc = reducer(document, setDragAndDropEnabled({ enabled: false }));
|
|
42
39
|
expect(updatedDoc.state.global.isDragAndDropEnabled).toBe(false);
|
|
43
|
-
updatedDoc = reducer(updatedDoc,
|
|
40
|
+
updatedDoc = reducer(updatedDoc, setDragAndDropEnabled({ enabled: true }));
|
|
44
41
|
expect(updatedDoc.state.global.isDragAndDropEnabled).toBe(true);
|
|
45
|
-
updatedDoc = reducer(updatedDoc,
|
|
42
|
+
updatedDoc = reducer(updatedDoc, setDragAndDropEnabled({ enabled: false }));
|
|
46
43
|
expect(updatedDoc.state.global.isDragAndDropEnabled).toBe(false);
|
|
47
44
|
expect(updatedDoc.operations.global).toHaveLength(3);
|
|
48
45
|
});
|
|
49
46
|
it("should update boolean field directly", () => {
|
|
50
|
-
const updatedDocument = reducer(document,
|
|
47
|
+
const updatedDocument = reducer(document, setDragAndDropEnabled({ enabled: false }));
|
|
51
48
|
expect(updatedDocument.state.global.isDragAndDropEnabled).toBeDefined();
|
|
52
49
|
expect(typeof updatedDocument.state.global.isDragAndDropEnabled).toBe("boolean");
|
|
53
50
|
});
|
|
@@ -2,11 +2,8 @@
|
|
|
2
2
|
* This is a scaffold file meant for customization:
|
|
3
3
|
* - change it by adding new tests or modifying the existing ones
|
|
4
4
|
*/
|
|
5
|
+
import { addDocumentType, reducer, removeDocumentType, setAppName, setAppStatus, setDragAndDropEnabled, utils, } from "@powerhousedao/vetra/document-models/app-module";
|
|
5
6
|
import { describe, expect, it } from "vitest";
|
|
6
|
-
import * as baseCreators from "../../gen/base-operations/creators.js";
|
|
7
|
-
import * as dndCreators from "../../gen/dnd-operations/creators.js";
|
|
8
|
-
import { reducer } from "../../gen/reducer.js";
|
|
9
|
-
import utils from "../../gen/utils.js";
|
|
10
7
|
describe("App Module Document Model", () => {
|
|
11
8
|
it("should have correct initial values", () => {
|
|
12
9
|
const document = utils.createDocument();
|
|
@@ -14,12 +11,16 @@ describe("App Module Document Model", () => {
|
|
|
14
11
|
expect(document.state.global.status).toBe("DRAFT");
|
|
15
12
|
expect(document.state.global.allowedDocumentTypes).toBeNull();
|
|
16
13
|
expect(document.state.global.isDragAndDropEnabled).toBe(true);
|
|
14
|
+
expect(utils.isStateOfType(document.state)).toBe(true);
|
|
15
|
+
expect(utils.assertIsStateOfType(document.state)).toBeUndefined();
|
|
16
|
+
expect(utils.isDocumentOfType(document)).toBe(true);
|
|
17
|
+
expect(utils.assertIsDocumentOfType(document)).toBeUndefined();
|
|
17
18
|
});
|
|
18
19
|
it("should handle multiple operations and maintain consistency", () => {
|
|
19
20
|
const document = utils.createDocument();
|
|
20
|
-
let updatedDoc = reducer(document,
|
|
21
|
-
updatedDoc = reducer(updatedDoc,
|
|
22
|
-
updatedDoc = reducer(updatedDoc,
|
|
21
|
+
let updatedDoc = reducer(document, setAppName({ name: "Test App" }));
|
|
22
|
+
updatedDoc = reducer(updatedDoc, setAppStatus({ status: "CONFIRMED" }));
|
|
23
|
+
updatedDoc = reducer(updatedDoc, addDocumentType({
|
|
23
24
|
documentType: "powerhouse/test",
|
|
24
25
|
}));
|
|
25
26
|
// Verify state consistency
|
|
@@ -31,17 +32,17 @@ describe("App Module Document Model", () => {
|
|
|
31
32
|
it("should handle locked configuration: disable DnD and clear document types", () => {
|
|
32
33
|
const document = utils.createDocument();
|
|
33
34
|
// Add some document types first
|
|
34
|
-
let updatedDoc = reducer(document,
|
|
35
|
-
updatedDoc = reducer(updatedDoc,
|
|
35
|
+
let updatedDoc = reducer(document, addDocumentType({ documentType: "powerhouse/type1" }));
|
|
36
|
+
updatedDoc = reducer(updatedDoc, addDocumentType({ documentType: "powerhouse/type2" }));
|
|
36
37
|
// Disable drag and drop
|
|
37
|
-
updatedDoc = reducer(updatedDoc,
|
|
38
|
+
updatedDoc = reducer(updatedDoc, setDragAndDropEnabled({ enabled: false }));
|
|
38
39
|
expect(updatedDoc.state.global.isDragAndDropEnabled).toBe(false);
|
|
39
40
|
// Remove all document types
|
|
40
|
-
updatedDoc = reducer(updatedDoc,
|
|
41
|
-
updatedDoc = reducer(updatedDoc,
|
|
41
|
+
updatedDoc = reducer(updatedDoc, removeDocumentType({ documentType: "powerhouse/type1" }));
|
|
42
|
+
updatedDoc = reducer(updatedDoc, removeDocumentType({ documentType: "powerhouse/type2" }));
|
|
42
43
|
expect(updatedDoc.state.global.allowedDocumentTypes).toEqual([]);
|
|
43
44
|
// Set as confirmed to "lock" it
|
|
44
|
-
updatedDoc = reducer(updatedDoc,
|
|
45
|
+
updatedDoc = reducer(updatedDoc, setAppStatus({ status: "CONFIRMED" }));
|
|
45
46
|
// Verify locked configuration
|
|
46
47
|
expect(updatedDoc.state.global.isDragAndDropEnabled).toBe(false);
|
|
47
48
|
expect(updatedDoc.state.global.allowedDocumentTypes).toHaveLength(0);
|
|
@@ -52,13 +53,13 @@ describe("App Module Document Model", () => {
|
|
|
52
53
|
// Start with null allowedDocumentTypes
|
|
53
54
|
expect(document.state.global.allowedDocumentTypes).toBeNull();
|
|
54
55
|
// Add new types from scratch
|
|
55
|
-
let updatedDoc = reducer(document,
|
|
56
|
+
let updatedDoc = reducer(document, addDocumentType({
|
|
56
57
|
documentType: "powerhouse/new1",
|
|
57
58
|
}));
|
|
58
|
-
updatedDoc = reducer(updatedDoc,
|
|
59
|
+
updatedDoc = reducer(updatedDoc, addDocumentType({
|
|
59
60
|
documentType: "powerhouse/new2",
|
|
60
61
|
}));
|
|
61
|
-
updatedDoc = reducer(updatedDoc,
|
|
62
|
+
updatedDoc = reducer(updatedDoc, addDocumentType({
|
|
62
63
|
documentType: "powerhouse/new3",
|
|
63
64
|
}));
|
|
64
65
|
// Verify reset completed
|
|
@@ -70,15 +71,15 @@ describe("App Module Document Model", () => {
|
|
|
70
71
|
it("should maintain state integrity with complex add/remove sequences", () => {
|
|
71
72
|
const document = utils.createDocument();
|
|
72
73
|
// Add multiple types
|
|
73
|
-
let updatedDoc = reducer(document,
|
|
74
|
-
updatedDoc = reducer(updatedDoc,
|
|
75
|
-
updatedDoc = reducer(updatedDoc,
|
|
74
|
+
let updatedDoc = reducer(document, addDocumentType({ documentType: "type-a" }));
|
|
75
|
+
updatedDoc = reducer(updatedDoc, addDocumentType({ documentType: "type-b" }));
|
|
76
|
+
updatedDoc = reducer(updatedDoc, addDocumentType({ documentType: "type-c" }));
|
|
76
77
|
expect(updatedDoc.state.global.allowedDocumentTypes).toHaveLength(3);
|
|
77
78
|
// Remove middle one
|
|
78
|
-
updatedDoc = reducer(updatedDoc,
|
|
79
|
+
updatedDoc = reducer(updatedDoc, removeDocumentType({ documentType: "type-b" }));
|
|
79
80
|
expect(updatedDoc.state.global.allowedDocumentTypes).toHaveLength(2);
|
|
80
81
|
// Add it back with different name
|
|
81
|
-
updatedDoc = reducer(updatedDoc,
|
|
82
|
+
updatedDoc = reducer(updatedDoc, addDocumentType({ documentType: "type-b-new" }));
|
|
82
83
|
expect(updatedDoc.state.global.allowedDocumentTypes).toHaveLength(3);
|
|
83
84
|
// Verify content
|
|
84
85
|
expect(updatedDoc.state.global.allowedDocumentTypes?.includes("type-a")).toBe(true);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AppModulePHState } from "./gen/types.js";
|
|
2
|
+
/** Utils for the AppModule document model */
|
|
3
|
+
export declare const utils: {
|
|
4
|
+
fileExtension: string;
|
|
5
|
+
createState: import("document-model").CreateState<AppModulePHState>;
|
|
6
|
+
createDocument: import("document-model").CreateDocument<AppModulePHState>;
|
|
7
|
+
loadFromInput: import("document-model").LoadFromInput<AppModulePHState>;
|
|
8
|
+
saveToFileHandle: import("document-model").SaveToFileHandle;
|
|
9
|
+
isStateOfType: import("document-model").IsStateOfType<AppModulePHState>;
|
|
10
|
+
assertIsStateOfType: import("document-model").AssertIsStateOfType<AppModulePHState>;
|
|
11
|
+
isDocumentOfType: import("document-model").IsDocumentOfType<AppModulePHState>;
|
|
12
|
+
assertIsDocumentOfType: import("document-model").AssertIsDocumentOfType<AppModulePHState>;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../document-models/app-module/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAIvD,6CAA6C;AAC7C,eAAO,MAAM,KAAK;;;;;;;;;;CAG8B,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Actions for the DocumentEditor document model */
|
|
2
|
+
export declare const actions: {
|
|
3
|
+
setEditorName: (input: import("./index.js").SetEditorNameInput) => import("./index.js").SetEditorNameAction;
|
|
4
|
+
addDocumentType: (input: import("./index.js").AddDocumentTypeInput) => import("./index.js").AddDocumentTypeAction;
|
|
5
|
+
removeDocumentType: (input: import("./index.js").RemoveDocumentTypeInput) => import("./index.js").RemoveDocumentTypeAction;
|
|
6
|
+
setEditorStatus: (input: import("./index.js").SetEditorStatusInput) => import("./index.js").SetEditorStatusAction;
|
|
7
|
+
setName: (name: string) => import("document-model").SetNameAction;
|
|
8
|
+
undo: (skip?: number, scope?: string) => import("document-model").UndoAction;
|
|
9
|
+
redo: (count?: number, scope?: string) => import("document-model").RedoAction;
|
|
10
|
+
prune: (start?: number, end?: number, scope?: string) => import("document-model").SchemaPruneAction;
|
|
11
|
+
loadState: <TState extends import("document-model").PHBaseState = import("document-model").PHBaseState>(state: TState & {
|
|
12
|
+
name: string;
|
|
13
|
+
}, operations: number) => import("document-model").LoadStateAction;
|
|
14
|
+
noop: (scope?: string) => import("document-model").NOOPAction;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../document-models/document-editor/actions.ts"],"names":[],"mappings":"AAGA,oDAAoD;AACpD,eAAO,MAAM,OAAO;oBACuQ,8CAAyB;sBAAoL,gDAA2B;yBAA6L,mDAA8B;sBAAmM,gDAA2B;;eAA+9L,CAAC,eAAe,CAAC;gBAAkE,CAAC,eAAe,CAAC;iBAAmE,CAAC,aAAa,CAAC,eAAe,CAAC;;;;gBAAqS,CAAC;CADp0O,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { SetEditorNameInput, AddDocumentTypeInput, RemoveDocumentTypeInput, SetEditorStatusInput } from "../types.js";
|
|
2
|
+
import type { SetEditorNameAction, AddDocumentTypeAction, RemoveDocumentTypeAction, SetEditorStatusAction } from "./actions.js";
|
|
3
3
|
export declare const setEditorName: (input: SetEditorNameInput) => SetEditorNameAction;
|
|
4
4
|
export declare const addDocumentType: (input: AddDocumentTypeInput) => AddDocumentTypeAction;
|
|
5
5
|
export declare const removeDocumentType: (input: RemoveDocumentTypeInput) => RemoveDocumentTypeAction;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creators.d.ts","sourceRoot":"","sources":["../../../../../document-models/document-editor/gen/base-operations/creators.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"creators.d.ts","sourceRoot":"","sources":["../../../../../document-models/document-editor/gen/base-operations/creators.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACV,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,EACxB,qBAAqB,EACtB,MAAM,cAAc,CAAC;AAEtB,eAAO,MAAM,aAAa,GAAI,OAAO,kBAAkB,wBAOpD,CAAC;AAEJ,eAAO,MAAM,eAAe,GAAI,OAAO,oBAAoB,0BAOxD,CAAC;AAEJ,eAAO,MAAM,kBAAkB,GAAI,OAAO,uBAAuB,6BAO9D,CAAC;AAEJ,eAAO,MAAM,eAAe,GAAI,OAAO,oBAAoB,0BAOxD,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createAction } from "document-model/core";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export const
|
|
5
|
-
export const
|
|
6
|
-
export const
|
|
7
|
-
export const setEditorStatus = (input) => createAction("SET_EDITOR_STATUS", { ...input }, undefined, z.SetEditorStatusInputSchema, "global");
|
|
2
|
+
import { SetEditorNameInputSchema, AddDocumentTypeInputSchema, RemoveDocumentTypeInputSchema, SetEditorStatusInputSchema, } from "../schema/zod.js";
|
|
3
|
+
export const setEditorName = (input) => createAction("SET_EDITOR_NAME", { ...input }, undefined, SetEditorNameInputSchema, "global");
|
|
4
|
+
export const addDocumentType = (input) => createAction("ADD_DOCUMENT_TYPE", { ...input }, undefined, AddDocumentTypeInputSchema, "global");
|
|
5
|
+
export const removeDocumentType = (input) => createAction("REMOVE_DOCUMENT_TYPE", { ...input }, undefined, RemoveDocumentTypeInputSchema, "global");
|
|
6
|
+
export const setEditorStatus = (input) => createAction("SET_EDITOR_STATUS", { ...input }, undefined, SetEditorStatusInputSchema, "global");
|