@powerhousedao/codegen 5.1.0-dev.32 → 5.1.0-dev.34
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/src/codegen/.hygen/templates/powerhouse/generate-editor/editor.esm.t +2 -0
- package/dist/src/codegen/generate.d.ts.map +1 -1
- package/dist/src/codegen/generate.js +8 -4
- package/dist/src/codegen/generate.js.map +1 -1
- package/dist/src/codegen/hygen.d.ts.map +1 -1
- package/dist/src/codegen/hygen.js +1 -4
- package/dist/src/codegen/hygen.js.map +1 -1
- package/dist/src/templates/boilerplate/document-models.d.ts +2 -0
- package/dist/src/templates/boilerplate/document-models.d.ts.map +1 -0
- package/dist/src/templates/boilerplate/document-models.js +7 -0
- package/dist/src/templates/boilerplate/document-models.js.map +1 -0
- package/dist/src/templates/boilerplate/editors.d.ts +2 -0
- package/dist/src/templates/boilerplate/editors.d.ts.map +1 -0
- package/dist/src/templates/boilerplate/editors.js +7 -0
- package/dist/src/templates/boilerplate/editors.js.map +1 -0
- package/dist/src/templates/boilerplate/index.d.ts +2 -0
- package/dist/src/templates/boilerplate/index.d.ts.map +1 -0
- package/dist/src/templates/boilerplate/index.html.d.ts +2 -0
- package/dist/src/templates/boilerplate/index.html.d.ts.map +1 -0
- package/dist/src/templates/boilerplate/index.html.js +33 -0
- package/dist/src/templates/boilerplate/index.html.js.map +1 -0
- package/dist/src/templates/boilerplate/index.js +9 -0
- package/dist/src/templates/boilerplate/index.js.map +1 -0
- package/dist/src/templates/boilerplate/package.json.d.ts +55 -0
- package/dist/src/templates/boilerplate/package.json.d.ts.map +1 -0
- package/dist/src/templates/boilerplate/package.json.js +55 -0
- package/dist/src/templates/boilerplate/package.json.js.map +1 -0
- package/dist/src/templates/boilerplate/tsconfig.json.d.ts +2 -0
- package/dist/src/templates/boilerplate/tsconfig.json.d.ts.map +1 -0
- package/dist/src/templates/boilerplate/tsconfig.json.js +46 -0
- package/dist/src/templates/boilerplate/tsconfig.json.js.map +1 -0
- package/dist/src/templates/document-editor/editor.d.ts +5 -0
- package/dist/src/templates/document-editor/editor.d.ts.map +1 -0
- package/dist/src/templates/document-editor/editor.js +80 -0
- package/dist/src/templates/document-editor/editor.js.map +1 -0
- package/dist/src/templates/document-editor/module.d.ts +7 -0
- package/dist/src/templates/document-editor/module.d.ts.map +1 -0
- package/dist/src/templates/document-editor/module.js +16 -0
- package/dist/src/templates/document-editor/module.js.map +1 -0
- package/dist/src/templates/document-model/actions.d.ts +3 -0
- package/dist/src/templates/document-model/actions.d.ts.map +1 -0
- package/dist/src/templates/document-model/actions.js.map +1 -0
- package/dist/src/templates/document-model/gen/actions.d.ts +3 -0
- package/dist/src/templates/document-model/gen/actions.d.ts.map +1 -0
- package/dist/src/templates/document-model/gen/actions.js.map +1 -0
- package/dist/src/templates/document-model/gen/creators.d.ts +3 -0
- package/dist/src/templates/document-model/gen/creators.d.ts.map +1 -0
- package/dist/src/templates/document-model/gen/creators.js.map +1 -0
- package/dist/src/templates/document-model/gen/document-schema.d.ts +3 -0
- package/dist/src/templates/document-model/gen/document-schema.d.ts.map +1 -0
- package/dist/src/templates/document-model/gen/document-schema.js.map +1 -0
- package/dist/src/templates/document-model/gen/document-type.d.ts +3 -0
- package/dist/src/templates/document-model/gen/document-type.d.ts.map +1 -0
- package/dist/src/templates/document-model/gen/document-type.js.map +1 -0
- package/dist/src/templates/document-model/gen/index.d.ts +3 -0
- package/dist/src/templates/document-model/gen/index.d.ts.map +1 -0
- package/dist/src/templates/document-model/gen/index.js.map +1 -0
- package/dist/src/{ts-morph-utils/templates → templates}/document-model/gen/modules/actions.d.ts +1 -1
- package/dist/src/templates/document-model/gen/modules/actions.d.ts.map +1 -0
- package/dist/src/templates/document-model/gen/modules/actions.js.map +1 -0
- package/dist/src/templates/document-model/gen/modules/creators.d.ts +3 -0
- package/dist/src/templates/document-model/gen/modules/creators.d.ts.map +1 -0
- package/dist/src/templates/document-model/gen/modules/creators.js.map +1 -0
- package/dist/src/templates/document-model/gen/modules/error.d.ts +3 -0
- package/dist/src/templates/document-model/gen/modules/error.d.ts.map +1 -0
- package/dist/src/templates/document-model/gen/modules/error.js.map +1 -0
- package/dist/src/templates/document-model/gen/modules/operations.d.ts +3 -0
- package/dist/src/templates/document-model/gen/modules/operations.d.ts.map +1 -0
- package/dist/src/templates/document-model/gen/modules/operations.js.map +1 -0
- package/dist/src/templates/document-model/gen/ph-factories.d.ts +3 -0
- package/dist/src/templates/document-model/gen/ph-factories.d.ts.map +1 -0
- package/dist/src/templates/document-model/gen/ph-factories.js.map +1 -0
- package/dist/src/templates/document-model/gen/reducer.d.ts +3 -0
- package/dist/src/templates/document-model/gen/reducer.d.ts.map +1 -0
- package/dist/src/templates/document-model/gen/reducer.js.map +1 -0
- package/dist/src/templates/document-model/gen/schema/index.d.ts.map +1 -0
- package/dist/src/templates/document-model/gen/schema/index.js.map +1 -0
- package/dist/src/templates/document-model/gen/types.d.ts +3 -0
- package/dist/src/templates/document-model/gen/types.d.ts.map +1 -0
- package/dist/src/templates/document-model/gen/types.js.map +1 -0
- package/dist/src/templates/document-model/gen/utils.d.ts +3 -0
- package/dist/src/templates/document-model/gen/utils.d.ts.map +1 -0
- package/dist/src/templates/document-model/gen/utils.js.map +1 -0
- package/dist/src/templates/document-model/hooks.d.ts +3 -0
- package/dist/src/templates/document-model/hooks.d.ts.map +1 -0
- package/dist/src/templates/document-model/hooks.js.map +1 -0
- package/dist/src/templates/document-model/index.d.ts.map +1 -0
- package/dist/src/templates/document-model/index.js.map +1 -0
- package/dist/src/templates/document-model/module.d.ts.map +1 -0
- package/dist/src/templates/document-model/module.js.map +1 -0
- package/dist/src/templates/document-model/src/index.d.ts.map +1 -0
- package/dist/src/templates/document-model/src/index.js.map +1 -0
- package/dist/src/templates/document-model/src/tests/document-model.test.d.ts +3 -0
- package/dist/src/templates/document-model/src/tests/document-model.test.d.ts.map +1 -0
- package/dist/src/templates/document-model/src/tests/document-model.test.js.map +1 -0
- package/dist/src/{ts-morph-utils/templates → templates}/document-model/src/tests/module.test.d.ts +1 -1
- package/dist/src/templates/document-model/src/tests/module.test.d.ts.map +1 -0
- package/dist/src/templates/document-model/src/tests/module.test.js.map +1 -0
- package/dist/src/templates/document-model/src/utils.d.ts.map +1 -0
- package/dist/src/templates/document-model/src/utils.js.map +1 -0
- package/dist/src/templates/document-model/upgrades/upgrade-transition.d.ts.map +1 -0
- package/dist/src/templates/document-model/upgrades/upgrade-transition.js.map +1 -0
- package/dist/src/{ts-morph-utils/templates → templates}/document-model/utils.d.ts +1 -1
- package/dist/src/templates/document-model/utils.d.ts.map +1 -0
- package/dist/src/templates/document-model/utils.js.map +1 -0
- package/dist/src/templates/drive-editor/components/CreateDocument.d.ts +2 -0
- package/dist/src/templates/drive-editor/components/CreateDocument.d.ts.map +1 -0
- package/dist/src/templates/drive-editor/components/CreateDocument.js +58 -0
- package/dist/src/templates/drive-editor/components/CreateDocument.js.map +1 -0
- package/dist/src/templates/drive-editor/components/DriveContents.d.ts +2 -0
- package/dist/src/templates/drive-editor/components/DriveContents.d.ts.map +1 -0
- package/dist/src/templates/drive-editor/components/DriveContents.js +24 -0
- package/dist/src/templates/drive-editor/components/DriveContents.js.map +1 -0
- package/dist/src/templates/drive-editor/components/DriveExplorer.d.ts +2 -0
- package/dist/src/templates/drive-editor/components/DriveExplorer.d.ts.map +1 -0
- package/dist/src/templates/drive-editor/components/DriveExplorer.js +32 -0
- package/dist/src/templates/drive-editor/components/DriveExplorer.js.map +1 -0
- package/dist/src/templates/drive-editor/components/EmptyState.d.ts +2 -0
- package/dist/src/templates/drive-editor/components/EmptyState.d.ts.map +1 -0
- package/dist/src/templates/drive-editor/components/EmptyState.js +19 -0
- package/dist/src/templates/drive-editor/components/EmptyState.js.map +1 -0
- package/dist/src/templates/drive-editor/components/Files.d.ts +2 -0
- package/dist/src/templates/drive-editor/components/Files.d.ts.map +1 -0
- package/dist/src/templates/drive-editor/components/Files.js +30 -0
- package/dist/src/templates/drive-editor/components/Files.js.map +1 -0
- package/dist/src/templates/drive-editor/components/FolderTree.d.ts +2 -0
- package/dist/src/templates/drive-editor/components/FolderTree.d.ts.map +1 -0
- package/dist/src/templates/drive-editor/components/FolderTree.js +108 -0
- package/dist/src/templates/drive-editor/components/FolderTree.js.map +1 -0
- package/dist/src/templates/drive-editor/components/Folders.d.ts +2 -0
- package/dist/src/templates/drive-editor/components/Folders.d.ts.map +1 -0
- package/dist/src/templates/drive-editor/components/Folders.js +28 -0
- package/dist/src/templates/drive-editor/components/Folders.js.map +1 -0
- package/dist/src/templates/drive-editor/components/NavigationBreadcrumbs.d.ts +2 -0
- package/dist/src/templates/drive-editor/components/NavigationBreadcrumbs.d.ts.map +1 -0
- package/dist/src/templates/drive-editor/components/NavigationBreadcrumbs.js +14 -0
- package/dist/src/templates/drive-editor/components/NavigationBreadcrumbs.js.map +1 -0
- package/dist/src/templates/drive-editor/config.d.ts +5 -0
- package/dist/src/templates/drive-editor/config.d.ts.map +1 -0
- package/dist/src/templates/drive-editor/config.js +11 -0
- package/dist/src/templates/drive-editor/config.js.map +1 -0
- package/dist/src/templates/drive-editor/editor.d.ts +2 -0
- package/dist/src/templates/drive-editor/editor.d.ts.map +1 -0
- package/dist/src/templates/drive-editor/editor.js +18 -0
- package/dist/src/templates/drive-editor/editor.js.map +1 -0
- package/dist/src/templates/index.d.ts +43 -0
- package/dist/src/templates/index.d.ts.map +1 -0
- package/dist/src/templates/index.js +43 -0
- package/dist/src/templates/index.js.map +1 -0
- package/dist/src/templates/unsafe-utils.d.ts.map +1 -0
- package/dist/src/templates/unsafe-utils.js.map +1 -0
- package/dist/src/{ts-morph-utils/templates → templates}/utils.d.ts +1 -1
- package/dist/src/templates/utils.d.ts.map +1 -0
- package/dist/src/templates/utils.js.map +1 -0
- package/dist/src/ts-morph-utils/constants.d.ts +4 -11
- package/dist/src/ts-morph-utils/constants.d.ts.map +1 -1
- package/dist/src/ts-morph-utils/constants.js +4 -11
- package/dist/src/ts-morph-utils/constants.js.map +1 -1
- package/dist/src/ts-morph-utils/document-type-metadata.d.ts +15 -0
- package/dist/src/ts-morph-utils/document-type-metadata.d.ts.map +1 -0
- package/dist/src/ts-morph-utils/document-type-metadata.js +67 -0
- package/dist/src/ts-morph-utils/document-type-metadata.js.map +1 -0
- package/dist/src/ts-morph-utils/file-builders/document-editor.d.ts +3 -19
- package/dist/src/ts-morph-utils/file-builders/document-editor.d.ts.map +1 -1
- package/dist/src/ts-morph-utils/file-builders/document-editor.js +25 -239
- package/dist/src/ts-morph-utils/file-builders/document-editor.js.map +1 -1
- package/dist/src/ts-morph-utils/file-builders/document-model/gen-dir.d.ts +1 -1
- package/dist/src/ts-morph-utils/file-builders/document-model/gen-dir.d.ts.map +1 -1
- package/dist/src/ts-morph-utils/file-builders/document-model/gen-dir.js +5 -20
- package/dist/src/ts-morph-utils/file-builders/document-model/gen-dir.js.map +1 -1
- package/dist/src/ts-morph-utils/file-builders/document-model/root-dir.d.ts +1 -1
- package/dist/src/ts-morph-utils/file-builders/document-model/root-dir.d.ts.map +1 -1
- package/dist/src/ts-morph-utils/file-builders/document-model/root-dir.js +2 -6
- package/dist/src/ts-morph-utils/file-builders/document-model/root-dir.js.map +1 -1
- package/dist/src/ts-morph-utils/file-builders/document-model/src-dir.d.ts +1 -1
- package/dist/src/ts-morph-utils/file-builders/document-model/src-dir.d.ts.map +1 -1
- package/dist/src/ts-morph-utils/file-builders/document-model/src-dir.js +3 -7
- package/dist/src/ts-morph-utils/file-builders/document-model/src-dir.js.map +1 -1
- package/dist/src/ts-morph-utils/file-builders/document-model/upgrades-dir.d.ts.map +1 -1
- package/dist/src/ts-morph-utils/file-builders/document-model/upgrades-dir.js +2 -3
- package/dist/src/ts-morph-utils/file-builders/document-model/upgrades-dir.js.map +1 -1
- package/dist/src/ts-morph-utils/file-builders/document-model.d.ts +6 -6
- package/dist/src/ts-morph-utils/file-builders/document-model.d.ts.map +1 -1
- package/dist/src/ts-morph-utils/file-builders/document-model.js +92 -109
- package/dist/src/ts-morph-utils/file-builders/document-model.js.map +1 -1
- package/dist/src/ts-morph-utils/file-builders/drive-editor.d.ts +2 -49
- package/dist/src/ts-morph-utils/file-builders/drive-editor.d.ts.map +1 -1
- package/dist/src/ts-morph-utils/file-builders/drive-editor.js +80 -257
- package/dist/src/ts-morph-utils/file-builders/drive-editor.js.map +1 -1
- package/dist/src/ts-morph-utils/file-builders/editor-common.d.ts +11 -1
- package/dist/src/ts-morph-utils/file-builders/editor-common.d.ts.map +1 -1
- package/dist/src/ts-morph-utils/file-builders/editor-common.js +23 -12
- package/dist/src/ts-morph-utils/file-builders/editor-common.js.map +1 -1
- package/dist/src/ts-morph-utils/file-builders/index-files.d.ts.map +1 -1
- package/dist/src/ts-morph-utils/file-builders/index-files.js +2 -2
- package/dist/src/ts-morph-utils/file-builders/index-files.js.map +1 -1
- package/dist/src/ts-morph-utils/file-builders/module-files.d.ts +7 -0
- package/dist/src/ts-morph-utils/file-builders/module-files.d.ts.map +1 -1
- package/dist/src/ts-morph-utils/file-builders/module-files.js +36 -8
- package/dist/src/ts-morph-utils/file-builders/module-files.js.map +1 -1
- package/dist/src/ts-morph-utils/format-with-prettier.d.ts +4 -0
- package/dist/src/ts-morph-utils/format-with-prettier.d.ts.map +1 -0
- package/dist/src/ts-morph-utils/format-with-prettier.js +16 -0
- package/dist/src/ts-morph-utils/format-with-prettier.js.map +1 -0
- package/dist/src/ts-morph-utils/index.d.ts +8 -0
- package/dist/src/ts-morph-utils/index.d.ts.map +1 -0
- package/dist/src/ts-morph-utils/index.js +7 -0
- package/dist/src/ts-morph-utils/index.js.map +1 -0
- package/dist/src/ts-morph-utils/name-builders/get-variable-names.d.ts +15 -4
- package/dist/src/ts-morph-utils/name-builders/get-variable-names.d.ts.map +1 -1
- package/dist/src/ts-morph-utils/name-builders/get-variable-names.js +11 -13
- package/dist/src/ts-morph-utils/name-builders/get-variable-names.js.map +1 -1
- package/dist/src/ts-morph-utils/name-builders/index.d.ts +2 -0
- package/dist/src/ts-morph-utils/name-builders/index.d.ts.map +1 -0
- package/dist/src/ts-morph-utils/name-builders/index.js +2 -0
- package/dist/src/ts-morph-utils/name-builders/index.js.map +1 -0
- package/dist/src/ts-morph-utils/syntax-builders.d.ts +5 -72
- package/dist/src/ts-morph-utils/syntax-builders.d.ts.map +1 -1
- package/dist/src/ts-morph-utils/syntax-builders.js +24 -167
- package/dist/src/ts-morph-utils/syntax-builders.js.map +1 -1
- package/dist/src/ts-morph-utils/syntax-getters.d.ts +6 -8
- package/dist/src/ts-morph-utils/syntax-getters.d.ts.map +1 -1
- package/dist/src/ts-morph-utils/syntax-getters.js +9 -34
- package/dist/src/ts-morph-utils/syntax-getters.js.map +1 -1
- package/dist/src/ts-morph-utils/ts-morph-project.d.ts +24 -1
- package/dist/src/ts-morph-utils/ts-morph-project.d.ts.map +1 -1
- package/dist/src/ts-morph-utils/ts-morph-project.js +52 -4
- package/dist/src/ts-morph-utils/ts-morph-project.js.map +1 -1
- package/dist/src/ts-morph-utils/types.d.ts +56 -24
- package/dist/src/ts-morph-utils/types.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +25 -9
- package/dist/src/ts-morph-utils/file-builders/document-model/types.d.ts +0 -32
- package/dist/src/ts-morph-utils/file-builders/document-model/types.d.ts.map +0 -1
- package/dist/src/ts-morph-utils/file-builders/document-model/types.js +0 -2
- package/dist/src/ts-morph-utils/file-builders/document-model/types.js.map +0 -1
- package/dist/src/ts-morph-utils/file-builders/types.d.ts +0 -13
- package/dist/src/ts-morph-utils/file-builders/types.d.ts.map +0 -1
- package/dist/src/ts-morph-utils/file-builders/types.js +0 -2
- package/dist/src/ts-morph-utils/file-builders/types.js.map +0 -1
- package/dist/src/ts-morph-utils/file-utils.d.ts +0 -28
- package/dist/src/ts-morph-utils/file-utils.d.ts.map +0 -1
- package/dist/src/ts-morph-utils/file-utils.js +0 -102
- package/dist/src/ts-morph-utils/file-utils.js.map +0 -1
- package/dist/src/ts-morph-utils/name-builders/common-files.d.ts +0 -5
- package/dist/src/ts-morph-utils/name-builders/common-files.d.ts.map +0 -1
- package/dist/src/ts-morph-utils/name-builders/common-files.js +0 -15
- package/dist/src/ts-morph-utils/name-builders/common-files.js.map +0 -1
- package/dist/src/ts-morph-utils/name-builders/document-model-files.d.ts +0 -4
- package/dist/src/ts-morph-utils/name-builders/document-model-files.d.ts.map +0 -1
- package/dist/src/ts-morph-utils/name-builders/document-model-files.js +0 -12
- package/dist/src/ts-morph-utils/name-builders/document-model-files.js.map +0 -1
- package/dist/src/ts-morph-utils/name-builders/editor-files.d.ts +0 -10
- package/dist/src/ts-morph-utils/name-builders/editor-files.d.ts.map +0 -1
- package/dist/src/ts-morph-utils/name-builders/editor-files.js +0 -37
- package/dist/src/ts-morph-utils/name-builders/editor-files.js.map +0 -1
- package/dist/src/ts-morph-utils/name-builders/get-file-paths.d.ts +0 -4
- package/dist/src/ts-morph-utils/name-builders/get-file-paths.d.ts.map +0 -1
- package/dist/src/ts-morph-utils/name-builders/get-file-paths.js +0 -21
- package/dist/src/ts-morph-utils/name-builders/get-file-paths.js.map +0 -1
- package/dist/src/ts-morph-utils/name-builders/types.d.ts +0 -19
- package/dist/src/ts-morph-utils/name-builders/types.d.ts.map +0 -1
- package/dist/src/ts-morph-utils/name-builders/types.js +0 -2
- package/dist/src/ts-morph-utils/name-builders/types.js.map +0 -1
- package/dist/src/ts-morph-utils/name-builders/variables.d.ts +0 -12
- package/dist/src/ts-morph-utils/name-builders/variables.d.ts.map +0 -1
- package/dist/src/ts-morph-utils/name-builders/variables.js +0 -35
- package/dist/src/ts-morph-utils/name-builders/variables.js.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/actions.d.ts +0 -3
- package/dist/src/ts-morph-utils/templates/document-model/actions.d.ts.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/actions.js.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/gen/actions.d.ts +0 -3
- package/dist/src/ts-morph-utils/templates/document-model/gen/actions.d.ts.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/gen/actions.js.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/gen/creators.d.ts +0 -3
- package/dist/src/ts-morph-utils/templates/document-model/gen/creators.d.ts.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/gen/creators.js.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/gen/document-schema.d.ts +0 -3
- package/dist/src/ts-morph-utils/templates/document-model/gen/document-schema.d.ts.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/gen/document-schema.js.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/gen/document-type.d.ts +0 -3
- package/dist/src/ts-morph-utils/templates/document-model/gen/document-type.d.ts.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/gen/document-type.js.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/gen/index.d.ts +0 -3
- package/dist/src/ts-morph-utils/templates/document-model/gen/index.d.ts.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/gen/index.js.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/gen/modules/actions.d.ts.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/gen/modules/actions.js.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/gen/modules/creators.d.ts +0 -3
- package/dist/src/ts-morph-utils/templates/document-model/gen/modules/creators.d.ts.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/gen/modules/creators.js.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/gen/modules/error.d.ts +0 -3
- package/dist/src/ts-morph-utils/templates/document-model/gen/modules/error.d.ts.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/gen/modules/error.js.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/gen/modules/operations.d.ts +0 -3
- package/dist/src/ts-morph-utils/templates/document-model/gen/modules/operations.d.ts.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/gen/modules/operations.js.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/gen/ph-factories.d.ts +0 -3
- package/dist/src/ts-morph-utils/templates/document-model/gen/ph-factories.d.ts.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/gen/ph-factories.js.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/gen/reducer.d.ts +0 -3
- package/dist/src/ts-morph-utils/templates/document-model/gen/reducer.d.ts.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/gen/reducer.js.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/gen/schema/index.d.ts.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/gen/schema/index.js.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/gen/types.d.ts +0 -3
- package/dist/src/ts-morph-utils/templates/document-model/gen/types.d.ts.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/gen/types.js.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/gen/utils.d.ts +0 -3
- package/dist/src/ts-morph-utils/templates/document-model/gen/utils.d.ts.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/gen/utils.js.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/hooks.d.ts +0 -3
- package/dist/src/ts-morph-utils/templates/document-model/hooks.d.ts.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/hooks.js.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/index.d.ts.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/index.js.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/module.d.ts.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/module.js.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/src/index.d.ts.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/src/index.js.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/src/tests/document-model.test.d.ts +0 -3
- package/dist/src/ts-morph-utils/templates/document-model/src/tests/document-model.test.d.ts.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/src/tests/document-model.test.js.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/src/tests/module.test.d.ts.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/src/tests/module.test.js.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/src/utils.d.ts.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/src/utils.js.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/upgrades/upgrade-transition.d.ts.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/upgrades/upgrade-transition.js.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/utils.d.ts.map +0 -1
- package/dist/src/ts-morph-utils/templates/document-model/utils.js.map +0 -1
- package/dist/src/ts-morph-utils/templates/drive-editor.d.ts +0 -5
- package/dist/src/ts-morph-utils/templates/drive-editor.d.ts.map +0 -1
- package/dist/src/ts-morph-utils/templates/drive-editor.js +0 -211
- package/dist/src/ts-morph-utils/templates/drive-editor.js.map +0 -1
- package/dist/src/ts-morph-utils/templates/unsafe-utils.d.ts.map +0 -1
- package/dist/src/ts-morph-utils/templates/unsafe-utils.js.map +0 -1
- package/dist/src/ts-morph-utils/templates/utils.d.ts.map +0 -1
- package/dist/src/ts-morph-utils/templates/utils.js.map +0 -1
- /package/dist/src/{ts-morph-utils/templates → templates}/document-model/actions.js +0 -0
- /package/dist/src/{ts-morph-utils/templates → templates}/document-model/gen/actions.js +0 -0
- /package/dist/src/{ts-morph-utils/templates → templates}/document-model/gen/creators.js +0 -0
- /package/dist/src/{ts-morph-utils/templates → templates}/document-model/gen/document-schema.js +0 -0
- /package/dist/src/{ts-morph-utils/templates → templates}/document-model/gen/document-type.js +0 -0
- /package/dist/src/{ts-morph-utils/templates → templates}/document-model/gen/index.js +0 -0
- /package/dist/src/{ts-morph-utils/templates → templates}/document-model/gen/modules/actions.js +0 -0
- /package/dist/src/{ts-morph-utils/templates → templates}/document-model/gen/modules/creators.js +0 -0
- /package/dist/src/{ts-morph-utils/templates → templates}/document-model/gen/modules/error.js +0 -0
- /package/dist/src/{ts-morph-utils/templates → templates}/document-model/gen/modules/operations.js +0 -0
- /package/dist/src/{ts-morph-utils/templates → templates}/document-model/gen/ph-factories.js +0 -0
- /package/dist/src/{ts-morph-utils/templates → templates}/document-model/gen/reducer.js +0 -0
- /package/dist/src/{ts-morph-utils/templates → templates}/document-model/gen/schema/index.d.ts +0 -0
- /package/dist/src/{ts-morph-utils/templates → templates}/document-model/gen/schema/index.js +0 -0
- /package/dist/src/{ts-morph-utils/templates → templates}/document-model/gen/types.js +0 -0
- /package/dist/src/{ts-morph-utils/templates → templates}/document-model/gen/utils.js +0 -0
- /package/dist/src/{ts-morph-utils/templates → templates}/document-model/hooks.js +0 -0
- /package/dist/src/{ts-morph-utils/templates → templates}/document-model/index.d.ts +0 -0
- /package/dist/src/{ts-morph-utils/templates → templates}/document-model/index.js +0 -0
- /package/dist/src/{ts-morph-utils/templates → templates}/document-model/module.d.ts +0 -0
- /package/dist/src/{ts-morph-utils/templates → templates}/document-model/module.js +0 -0
- /package/dist/src/{ts-morph-utils/templates → templates}/document-model/src/index.d.ts +0 -0
- /package/dist/src/{ts-morph-utils/templates → templates}/document-model/src/index.js +0 -0
- /package/dist/src/{ts-morph-utils/templates → templates}/document-model/src/tests/document-model.test.js +0 -0
- /package/dist/src/{ts-morph-utils/templates → templates}/document-model/src/tests/module.test.js +0 -0
- /package/dist/src/{ts-morph-utils/templates → templates}/document-model/src/utils.d.ts +0 -0
- /package/dist/src/{ts-morph-utils/templates → templates}/document-model/src/utils.js +0 -0
- /package/dist/src/{ts-morph-utils/templates → templates}/document-model/upgrades/upgrade-transition.d.ts +0 -0
- /package/dist/src/{ts-morph-utils/templates → templates}/document-model/upgrades/upgrade-transition.js +0 -0
- /package/dist/src/{ts-morph-utils/templates → templates}/document-model/utils.js +0 -0
- /package/dist/src/{ts-morph-utils/templates → templates}/unsafe-utils.d.ts +0 -0
- /package/dist/src/{ts-morph-utils/templates → templates}/unsafe-utils.js +0 -0
- /package/dist/src/{ts-morph-utils/templates → templates}/utils.js +0 -0
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createDocumentFileTemplate, driveEditorConfigFileTemplate, driveEditorDriveContentsFileTemplate, driveEditorEditorFileTemplate, driveEditorFilesFileTemplate, driveEditorFoldersFileTemplate, driveExplorerFileTemplate, driveExplorerNavigationBreadcrumbsFileTemplate, emptyStateFileTemplate, folderTreeFileTemplate, } from "@powerhousedao/codegen/templates";
|
|
2
|
+
import { buildTsMorphProject, formatSourceFileWithPrettier, getOrCreateSourceFile, } from "@powerhousedao/codegen/ts-morph";
|
|
2
3
|
import path from "path";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import { getObjectLiteral } from "../syntax-getters.js";
|
|
8
|
-
import { createDocumentFileTemplate, driveExplorerFileTemplate, emptyStateFileTemplate, folderTreeFileTemplate, } from "../templates/drive-editor.js";
|
|
9
|
-
import { buildTsMorphProject } from "../ts-morph-project.js";
|
|
10
|
-
import { makeEditorModuleFile } from "./document-editor.js";
|
|
11
|
-
import { makeEditorsModulesFile } from "./editor-common.js";
|
|
4
|
+
import {} from "ts-morph";
|
|
5
|
+
import { makeEditorModuleFile } from "./editor-common.js";
|
|
6
|
+
import { makeEditorsModulesFile } from "./module-files.js";
|
|
7
|
+
/** Generates a drive editor with the configs for `allowedDocumentModelIds` and `isDragAndDropEnabled` */
|
|
12
8
|
export function tsMorphGenerateDriveEditor({ projectDir, editorDir, editorName, editorId, allowedDocumentModelIds, isDragAndDropEnabled, }) {
|
|
13
|
-
const
|
|
14
|
-
const
|
|
9
|
+
const documentModelsSourceFilesPath = path.join(projectDir, "document-models/**/*");
|
|
10
|
+
const editorsDirPath = path.join(projectDir, "editors");
|
|
11
|
+
const editorSourceFilesPath = path.join(editorsDirPath, "/**/*");
|
|
12
|
+
const editorDirPath = path.join(editorsDirPath, editorDir);
|
|
13
|
+
const editorComponentsDirPath = path.join(editorDirPath, "components");
|
|
15
14
|
const project = buildTsMorphProject(projectDir);
|
|
16
15
|
project.addSourceFilesAtPaths(documentModelsSourceFilesPath);
|
|
17
16
|
project.addSourceFilesAtPaths(editorSourceFilesPath);
|
|
18
17
|
makeNavigationBreadcrumbsFile({
|
|
19
18
|
project,
|
|
20
|
-
|
|
19
|
+
editorComponentsDirPath,
|
|
21
20
|
});
|
|
22
21
|
makeCreateDocumentFile({
|
|
23
22
|
project,
|
|
24
|
-
|
|
23
|
+
editorComponentsDirPath,
|
|
25
24
|
});
|
|
26
25
|
makeEmptyStateFile({
|
|
27
26
|
project,
|
|
28
|
-
|
|
27
|
+
editorComponentsDirPath,
|
|
29
28
|
});
|
|
30
29
|
makeFoldersFile({
|
|
31
30
|
project,
|
|
32
|
-
|
|
31
|
+
editorComponentsDirPath,
|
|
33
32
|
});
|
|
34
33
|
makeFolderTreeFile({
|
|
35
34
|
project,
|
|
36
|
-
|
|
35
|
+
editorComponentsDirPath,
|
|
37
36
|
});
|
|
38
37
|
makeFilesFile({
|
|
39
38
|
project,
|
|
40
|
-
|
|
39
|
+
editorComponentsDirPath,
|
|
41
40
|
});
|
|
42
41
|
makeDriveExplorerFile({
|
|
43
42
|
project,
|
|
44
|
-
|
|
43
|
+
editorComponentsDirPath,
|
|
45
44
|
});
|
|
46
45
|
makeDriveContentsFile({
|
|
47
46
|
project,
|
|
48
|
-
|
|
47
|
+
editorComponentsDirPath,
|
|
49
48
|
});
|
|
50
49
|
makeDriveEditorComponent({
|
|
51
50
|
project,
|
|
52
|
-
|
|
51
|
+
editorDirPath,
|
|
53
52
|
});
|
|
54
53
|
makeDriveEditorConfigFile({
|
|
55
54
|
project,
|
|
56
55
|
allowedDocumentModelIds,
|
|
57
56
|
isDragAndDropEnabled,
|
|
58
|
-
|
|
57
|
+
editorDirPath,
|
|
59
58
|
});
|
|
60
59
|
makeEditorModuleFile({
|
|
61
60
|
project,
|
|
62
61
|
editorName,
|
|
63
62
|
editorId,
|
|
63
|
+
editorDirPath,
|
|
64
64
|
documentModelId: "powerhouse/document-drive",
|
|
65
|
-
...editorFilePaths,
|
|
66
65
|
});
|
|
67
66
|
makeEditorsModulesFile(project, projectDir);
|
|
68
67
|
project.saveSync();
|
|
69
68
|
}
|
|
70
|
-
|
|
71
|
-
const
|
|
69
|
+
function makeDriveEditorComponent({ project, editorDirPath, }) {
|
|
70
|
+
const filePath = path.join(editorDirPath, "editor.tsx");
|
|
71
|
+
const { alreadyExists, sourceFile } = getOrCreateSourceFile(project, filePath);
|
|
72
72
|
if (alreadyExists) {
|
|
73
|
-
const editorFunction =
|
|
73
|
+
const editorFunction = sourceFile.getFunction("Editor");
|
|
74
74
|
if (editorFunction) {
|
|
75
75
|
if (!editorFunction.isDefaultExport()) {
|
|
76
76
|
editorFunction.setIsDefaultExport(true);
|
|
@@ -78,264 +78,87 @@ export function makeDriveEditorComponent({ project, editorFilePath, }) {
|
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
{
|
|
85
|
-
namedImports: ["useSetPHDriveEditorConfig"],
|
|
86
|
-
moduleSpecifier: "@powerhousedao/reactor-browser",
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
namedImports: ["EditorProps"],
|
|
90
|
-
moduleSpecifier: "document-model",
|
|
91
|
-
isTypeOnly: true,
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
namedImports: ["DriveExplorer"],
|
|
95
|
-
moduleSpecifier: "./components/DriveExplorer.js",
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
namedImports: ["editorConfig"],
|
|
99
|
-
moduleSpecifier: "./config.js",
|
|
100
|
-
},
|
|
101
|
-
];
|
|
102
|
-
driveEditorComponentSourceFile.addImportDeclarations(importDeclarations);
|
|
103
|
-
const useSetPHDriveEditorConfigHookCall = buildFunctionCall({
|
|
104
|
-
functionName: "useSetPHDriveEditorConfig",
|
|
105
|
-
argumentsArray: ["editorConfig"],
|
|
106
|
-
});
|
|
107
|
-
const driveExplorerComponent = buildSelfClosingJsxElement("DriveExplorer", [
|
|
108
|
-
buildJsxSpreadAttribute("props"),
|
|
109
|
-
]);
|
|
110
|
-
const returnStatement = buildReturn(driveExplorerComponent);
|
|
111
|
-
const statements = [useSetPHDriveEditorConfigHookCall, returnStatement].map(printNode);
|
|
112
|
-
driveEditorComponentSourceFile.addFunction({
|
|
113
|
-
name: "Editor",
|
|
114
|
-
isDefaultExport: true,
|
|
115
|
-
parameters: [{ name: "props", type: "EditorProps" }],
|
|
116
|
-
statements,
|
|
117
|
-
docs: ["Implement your drive explorer behavior here"],
|
|
118
|
-
});
|
|
119
|
-
formatSourceFileWithPrettier(driveEditorComponentSourceFile);
|
|
81
|
+
const template = driveEditorEditorFileTemplate();
|
|
82
|
+
sourceFile.replaceWithText(template);
|
|
83
|
+
formatSourceFileWithPrettier(sourceFile);
|
|
120
84
|
}
|
|
121
|
-
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
declarationKind: VariableDeclarationKind.Const,
|
|
133
|
-
isExported: true,
|
|
134
|
-
declarations: [
|
|
135
|
-
{
|
|
136
|
-
name: "editorConfig",
|
|
137
|
-
type: "PHDriveEditorConfig",
|
|
138
|
-
initializer: "{}",
|
|
139
|
-
},
|
|
140
|
-
],
|
|
141
|
-
});
|
|
142
|
-
const objectLiteral = getObjectLiteral(configObjectVariableStatement);
|
|
143
|
-
if (!objectLiteral) {
|
|
144
|
-
throw new Error("Object literal not found");
|
|
145
|
-
}
|
|
146
|
-
objectLiteral.addPropertyAssignment({
|
|
147
|
-
name: "isDragAndDropEnabled",
|
|
148
|
-
initializer: isDragAndDropEnabled ? "true" : "false",
|
|
149
|
-
});
|
|
150
|
-
objectLiteral.addPropertyAssignment({
|
|
151
|
-
name: "allowedDocumentTypes",
|
|
152
|
-
initializer: printNode(buildArrayLiteralWithStringElements(allowedDocumentModelIds)),
|
|
153
|
-
});
|
|
85
|
+
function makeDriveEditorConfigFile({ project, editorDirPath, allowedDocumentModelIds, isDragAndDropEnabled, }) {
|
|
86
|
+
const filePath = path.join(editorDirPath, "config.ts");
|
|
87
|
+
const { sourceFile } = getOrCreateSourceFile(project, filePath);
|
|
88
|
+
const allowedDocumentTypesString = JSON.stringify(allowedDocumentModelIds);
|
|
89
|
+
const isDragAndDropEnabledString = isDragAndDropEnabled ? "true" : "false";
|
|
90
|
+
const template = driveEditorConfigFileTemplate({
|
|
91
|
+
isDragAndDropEnabledString,
|
|
92
|
+
allowedDocumentTypesString,
|
|
93
|
+
});
|
|
94
|
+
sourceFile.replaceWithText(template);
|
|
95
|
+
formatSourceFileWithPrettier(sourceFile);
|
|
154
96
|
}
|
|
155
|
-
|
|
156
|
-
const
|
|
97
|
+
function makeDriveContentsFile({ project, editorComponentsDirPath, }) {
|
|
98
|
+
const filePath = path.join(editorComponentsDirPath, "DriveContents.tsx");
|
|
99
|
+
const { alreadyExists, sourceFile } = getOrCreateSourceFile(project, filePath);
|
|
157
100
|
if (alreadyExists)
|
|
158
101
|
return;
|
|
159
|
-
const
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
namedImports: ["CreateDocument"],
|
|
163
|
-
moduleSpecifier: "./CreateDocument.js",
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
namedImports: ["EmptyState"],
|
|
167
|
-
moduleSpecifier: "./EmptyState.js",
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
namedImports: ["Files"],
|
|
171
|
-
moduleSpecifier: "./Files.js",
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
namedImports: ["Folders"],
|
|
175
|
-
moduleSpecifier: "./Folders.js",
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
namedImports: ["NavigationBreadcrumbs"],
|
|
179
|
-
moduleSpecifier: "./NavigationBreadcrumbs.js",
|
|
180
|
-
},
|
|
181
|
-
];
|
|
182
|
-
driveContentsSourceFile.addImportDeclarations(importDeclarations);
|
|
183
|
-
const navigationBreadcrumbs = buildSelfClosingJsxElement("NavigationBreadcrumbs");
|
|
184
|
-
const folders = buildSelfClosingJsxElement("Folders");
|
|
185
|
-
const files = buildSelfClosingJsxElement("Files");
|
|
186
|
-
const emptyState = buildSelfClosingJsxElement("EmptyState");
|
|
187
|
-
const createDocument = buildSelfClosingJsxElement("CreateDocument");
|
|
188
|
-
const wrapperDiv = buildJsxElement("div", [navigationBreadcrumbs, folders, files, emptyState, createDocument], [buildClassNameAttribute("space-y-6 px-6")]);
|
|
189
|
-
const returnStatement = buildReturn(wrapperDiv);
|
|
190
|
-
const statements = [returnStatement].map(printNode);
|
|
191
|
-
driveContentsSourceFile.addFunction({
|
|
192
|
-
name: "DriveContents",
|
|
193
|
-
isExported: true,
|
|
194
|
-
docs: ["Shows the documents and folders in the selected drive"],
|
|
195
|
-
parameters: [],
|
|
196
|
-
statements,
|
|
197
|
-
});
|
|
198
|
-
formatSourceFileWithPrettier(driveContentsSourceFile);
|
|
102
|
+
const template = driveEditorDriveContentsFileTemplate();
|
|
103
|
+
sourceFile.replaceWithText(template);
|
|
104
|
+
formatSourceFileWithPrettier(sourceFile);
|
|
199
105
|
}
|
|
200
|
-
|
|
201
|
-
const
|
|
202
|
-
const { alreadyExists, sourceFile
|
|
106
|
+
function makeNavigationBreadcrumbsFile({ project, editorComponentsDirPath, }) {
|
|
107
|
+
const filePath = path.join(editorComponentsDirPath, "NavigationBreadcrumbs.tsx");
|
|
108
|
+
const { alreadyExists, sourceFile } = getOrCreateSourceFile(project, filePath);
|
|
203
109
|
if (alreadyExists)
|
|
204
110
|
return;
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
{
|
|
208
|
-
namedImports: ["Breadcrumbs"],
|
|
209
|
-
moduleSpecifier: "@powerhousedao/design-system/connect",
|
|
210
|
-
},
|
|
211
|
-
];
|
|
212
|
-
navigationBreadcrumbsSourceFile.addImportDeclarations(importDeclarations);
|
|
213
|
-
const breadcrumbs = buildSelfClosingJsxElement("Breadcrumbs");
|
|
214
|
-
const wrapperDiv = buildJsxElement("div", [breadcrumbs], [buildClassNameAttribute("border-b border-gray-200 pb-3 space-y-3")]);
|
|
215
|
-
const returnStatement = buildReturn(wrapperDiv);
|
|
216
|
-
const statements = [returnStatement].map(printNode);
|
|
217
|
-
navigationBreadcrumbsSourceFile.addFunction({
|
|
218
|
-
name: "NavigationBreadcrumbs",
|
|
219
|
-
isExported: true,
|
|
220
|
-
docs: ["Shows the navigation breadcrumbs for the selected drive or folder"],
|
|
221
|
-
parameters: [],
|
|
222
|
-
statements,
|
|
223
|
-
});
|
|
224
|
-
formatSourceFileWithPrettier(navigationBreadcrumbsSourceFile);
|
|
111
|
+
sourceFile.replaceWithText(driveExplorerNavigationBreadcrumbsFileTemplate());
|
|
112
|
+
formatSourceFileWithPrettier(sourceFile);
|
|
225
113
|
}
|
|
226
|
-
|
|
114
|
+
function makeFoldersFile({ project, editorComponentsDirPath, }) {
|
|
227
115
|
const foldersFilePath = path.join(editorComponentsDirPath, "Folders.tsx");
|
|
228
|
-
const { alreadyExists, sourceFile
|
|
116
|
+
const { alreadyExists, sourceFile } = getOrCreateSourceFile(project, foldersFilePath);
|
|
229
117
|
if (alreadyExists)
|
|
230
118
|
return;
|
|
231
|
-
const
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
moduleSpecifier: "@powerhousedao/design-system/connect",
|
|
235
|
-
},
|
|
236
|
-
{
|
|
237
|
-
namedImports: ["useNodesInSelectedDriveOrFolder", "isFolderNodeKind"],
|
|
238
|
-
moduleSpecifier: "@powerhousedao/reactor-browser",
|
|
239
|
-
},
|
|
240
|
-
];
|
|
241
|
-
foldersSourceFile.addImportDeclarations(importDeclarations);
|
|
242
|
-
foldersSourceFile.addFunction({
|
|
243
|
-
name: "Folders",
|
|
244
|
-
isExported: true,
|
|
245
|
-
docs: ["Shows the folders in the selected drive or folder"],
|
|
246
|
-
parameters: [],
|
|
247
|
-
statements: [
|
|
248
|
-
tsx `
|
|
249
|
-
const nodes = useNodesInSelectedDriveOrFolder();
|
|
250
|
-
const folderNodes = nodes.filter((n) => isFolderNodeKind(n));
|
|
251
|
-
const hasFolders = folderNodes.length > 0;
|
|
252
|
-
if (!hasFolders) return null;
|
|
253
|
-
|
|
254
|
-
return (
|
|
255
|
-
<div>
|
|
256
|
-
<h3 className="mb-2 text-sm font-bold text-gray-600">Folders</h3>
|
|
257
|
-
<div className="flex flex-wrap gap-4">
|
|
258
|
-
{folderNodes.map((folderNode) => (
|
|
259
|
-
<FolderItem key={folderNode.id} folderNode={folderNode} />
|
|
260
|
-
))}
|
|
261
|
-
</div>
|
|
262
|
-
</div>
|
|
263
|
-
);`.raw,
|
|
264
|
-
],
|
|
265
|
-
});
|
|
266
|
-
formatSourceFileWithPrettier(foldersSourceFile);
|
|
119
|
+
const template = driveEditorFoldersFileTemplate();
|
|
120
|
+
sourceFile.replaceWithText(template);
|
|
121
|
+
formatSourceFileWithPrettier(sourceFile);
|
|
267
122
|
}
|
|
268
|
-
|
|
123
|
+
function makeFilesFile({ project, editorComponentsDirPath, }) {
|
|
269
124
|
const filesFilePath = path.join(editorComponentsDirPath, "Files.tsx");
|
|
270
|
-
const { alreadyExists, sourceFile
|
|
125
|
+
const { alreadyExists, sourceFile } = getOrCreateSourceFile(project, filesFilePath);
|
|
271
126
|
if (alreadyExists)
|
|
272
127
|
return;
|
|
273
|
-
const
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
moduleSpecifier: "@powerhousedao/design-system/connect",
|
|
277
|
-
},
|
|
278
|
-
{
|
|
279
|
-
namedImports: ["useNodesInSelectedDriveOrFolder", "isFileNodeKind"],
|
|
280
|
-
moduleSpecifier: "@powerhousedao/reactor-browser",
|
|
281
|
-
},
|
|
282
|
-
];
|
|
283
|
-
filesSourceFile.addImportDeclarations(importDeclarations);
|
|
284
|
-
const statements = [
|
|
285
|
-
tsx `const nodes = useNodesInSelectedDriveOrFolder();`.raw,
|
|
286
|
-
tsx `const fileNodes = nodes.filter((n) => isFileNodeKind(n));`.raw,
|
|
287
|
-
tsx `const hasFiles = fileNodes.length > 0;`.raw,
|
|
288
|
-
tsx `if (!hasFiles) return null;`.raw,
|
|
289
|
-
tsx `return (
|
|
290
|
-
<div>
|
|
291
|
-
<h3 className="mb-2 text-sm font-semibold text-gray-600">Documents</h3>
|
|
292
|
-
<div className="flex flex-wrap gap-4">
|
|
293
|
-
{fileNodes.map((fileNode) => (
|
|
294
|
-
<FileItem key={fileNode.id} fileNode={fileNode} />
|
|
295
|
-
))}
|
|
296
|
-
</div>
|
|
297
|
-
</div>
|
|
298
|
-
);`.raw,
|
|
299
|
-
];
|
|
300
|
-
filesSourceFile.addFunction({
|
|
301
|
-
name: "Files",
|
|
302
|
-
isExported: true,
|
|
303
|
-
docs: ["Shows the files in the selected drive or folder"],
|
|
304
|
-
parameters: [],
|
|
305
|
-
statements,
|
|
306
|
-
});
|
|
307
|
-
formatSourceFileWithPrettier(filesSourceFile);
|
|
128
|
+
const template = driveEditorFilesFileTemplate();
|
|
129
|
+
sourceFile.replaceWithText(template);
|
|
130
|
+
formatSourceFileWithPrettier(sourceFile);
|
|
308
131
|
}
|
|
309
132
|
function makeDriveExplorerFile({ project, editorComponentsDirPath, }) {
|
|
310
|
-
const
|
|
311
|
-
const { alreadyExists, sourceFile
|
|
133
|
+
const filePath = path.join(editorComponentsDirPath, "DriveExplorer.tsx");
|
|
134
|
+
const { alreadyExists, sourceFile } = getOrCreateSourceFile(project, filePath);
|
|
312
135
|
if (alreadyExists)
|
|
313
136
|
return;
|
|
314
|
-
|
|
315
|
-
formatSourceFileWithPrettier(
|
|
137
|
+
sourceFile.replaceWithText(driveExplorerFileTemplate);
|
|
138
|
+
formatSourceFileWithPrettier(sourceFile);
|
|
316
139
|
}
|
|
317
|
-
|
|
318
|
-
const
|
|
319
|
-
const { alreadyExists, sourceFile
|
|
140
|
+
function makeFolderTreeFile({ project, editorComponentsDirPath, }) {
|
|
141
|
+
const filePath = path.join(editorComponentsDirPath, "FolderTree.tsx");
|
|
142
|
+
const { alreadyExists, sourceFile } = getOrCreateSourceFile(project, filePath);
|
|
320
143
|
if (alreadyExists)
|
|
321
144
|
return;
|
|
322
|
-
|
|
323
|
-
formatSourceFileWithPrettier(
|
|
145
|
+
sourceFile.replaceWithText(folderTreeFileTemplate);
|
|
146
|
+
formatSourceFileWithPrettier(sourceFile);
|
|
324
147
|
}
|
|
325
|
-
|
|
326
|
-
const
|
|
327
|
-
const { alreadyExists, sourceFile
|
|
148
|
+
function makeEmptyStateFile({ project, editorComponentsDirPath, }) {
|
|
149
|
+
const filePath = path.join(editorComponentsDirPath, "EmptyState.tsx");
|
|
150
|
+
const { alreadyExists, sourceFile } = getOrCreateSourceFile(project, filePath);
|
|
328
151
|
if (alreadyExists)
|
|
329
152
|
return;
|
|
330
|
-
|
|
331
|
-
formatSourceFileWithPrettier(
|
|
153
|
+
sourceFile.replaceWithText(emptyStateFileTemplate);
|
|
154
|
+
formatSourceFileWithPrettier(sourceFile);
|
|
332
155
|
}
|
|
333
|
-
|
|
334
|
-
const
|
|
335
|
-
const { alreadyExists, sourceFile
|
|
156
|
+
function makeCreateDocumentFile({ project, editorComponentsDirPath, }) {
|
|
157
|
+
const filePath = path.join(editorComponentsDirPath, "CreateDocument.tsx");
|
|
158
|
+
const { alreadyExists, sourceFile } = getOrCreateSourceFile(project, filePath);
|
|
336
159
|
if (alreadyExists)
|
|
337
160
|
return;
|
|
338
|
-
|
|
339
|
-
formatSourceFileWithPrettier(
|
|
161
|
+
sourceFile.replaceWithText(createDocumentFileTemplate);
|
|
162
|
+
formatSourceFileWithPrettier(sourceFile);
|
|
340
163
|
}
|
|
341
164
|
//# sourceMappingURL=drive-editor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drive-editor.js","sourceRoot":"","sources":["../../../../src/ts-morph-utils/file-builders/drive-editor.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"drive-editor.js","sourceRoot":"","sources":["../../../../src/ts-morph-utils/file-builders/drive-editor.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,6BAA6B,EAC7B,oCAAoC,EACpC,6BAA6B,EAC7B,4BAA4B,EAC5B,8BAA8B,EAC9B,yBAAyB,EACzB,8CAA8C,EAC9C,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EACL,mBAAmB,EACnB,4BAA4B,EAC5B,qBAAqB,GACtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAgB,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAM3D,yGAAyG;AACzG,MAAM,UAAU,0BAA0B,CAAC,EACzC,UAAU,EACV,SAAS,EACT,UAAU,EACV,QAAQ,EACR,uBAAuB,EACvB,oBAAoB,GACI;IACxB,MAAM,6BAA6B,GAAG,IAAI,CAAC,IAAI,CAC7C,UAAU,EACV,sBAAsB,CACvB,CAAC;IACF,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;IACxD,MAAM,qBAAqB,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IACjE,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC;IAC3D,MAAM,uBAAuB,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;IAEvE,MAAM,OAAO,GAAG,mBAAmB,CAAC,UAAU,CAAC,CAAC;IAChD,OAAO,CAAC,qBAAqB,CAAC,6BAA6B,CAAC,C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IAC3B,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,uBAAuB,EAAE,oBAAoB,CAAC,CAAC;IAC1E,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,qBAAqB,CACzD,OAAO,EACP,QAAQ,CACT,CAAC;IAEF,IAAI,aAAa;QAAE,OAAO;IAE1B,UAAU,CAAC,eAAe,CAAC,0BAA0B,CAAC,CAAC;IACvD,4BAA4B,CAAC,UAAU,CAAC,CAAC;AAC3C,CAAC"}
|
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
import type { Project } from "ts-morph";
|
|
2
|
-
|
|
2
|
+
type MakeEditorModuleFileArgs = {
|
|
3
|
+
project: Project;
|
|
4
|
+
editorName: string;
|
|
5
|
+
editorId: string;
|
|
6
|
+
documentModelId?: string;
|
|
7
|
+
editorDirPath: string;
|
|
8
|
+
legacyMultipleDocumentTypes?: string[];
|
|
9
|
+
};
|
|
10
|
+
/** Generates the `module.ts` file for a document editor or drive editor */
|
|
11
|
+
export declare function makeEditorModuleFile({ project, editorDirPath, editorName, documentModelId, editorId, legacyMultipleDocumentTypes, }: MakeEditorModuleFileArgs): void;
|
|
12
|
+
export {};
|
|
3
13
|
//# sourceMappingURL=editor-common.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor-common.d.ts","sourceRoot":"","sources":["../../../../src/ts-morph-utils/file-builders/editor-common.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"editor-common.d.ts","sourceRoot":"","sources":["../../../../src/ts-morph-utils/file-builders/editor-common.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAGxC,KAAK,wBAAwB,GAAG;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,2BAA2B,CAAC,EAAE,MAAM,EAAE,CAAC;CACxC,CAAC;AACF,2EAA2E;AAC3E,wBAAgB,oBAAoB,CAAC,EACnC,OAAO,EACP,aAAa,EACb,UAAU,EACV,eAAe,EACf,QAAQ,EACR,2BAA2B,GAC5B,EAAE,wBAAwB,QAwB1B"}
|
|
@@ -1,15 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { documentEditorModuleFileTemplate } from "@powerhousedao/codegen/templates";
|
|
2
|
+
import { pascalCase } from "change-case";
|
|
3
|
+
import path from "path";
|
|
4
|
+
import { getOrCreateSourceFile } from "../ts-morph-project.js";
|
|
5
|
+
/** Generates the `module.ts` file for a document editor or drive editor */
|
|
6
|
+
export function makeEditorModuleFile({ project, editorDirPath, editorName, documentModelId, editorId, legacyMultipleDocumentTypes, }) {
|
|
7
|
+
if (documentModelId && !!legacyMultipleDocumentTypes) {
|
|
8
|
+
throw new Error("Cannot specify both documentModelId and legacyMultipleDocumentTypes");
|
|
9
|
+
}
|
|
10
|
+
const filePath = path.join(editorDirPath, "module.ts");
|
|
11
|
+
const { sourceFile } = getOrCreateSourceFile(project, filePath);
|
|
12
|
+
sourceFile.replaceWithText("");
|
|
13
|
+
const pascalCaseEditorName = pascalCase(editorName);
|
|
14
|
+
const documentTypes = documentModelId
|
|
15
|
+
? `["${documentModelId}"]`
|
|
16
|
+
: JSON.stringify(legacyMultipleDocumentTypes);
|
|
17
|
+
const template = documentEditorModuleFileTemplate({
|
|
18
|
+
editorName,
|
|
19
|
+
editorId,
|
|
20
|
+
pascalCaseEditorName,
|
|
21
|
+
documentTypes,
|
|
13
22
|
});
|
|
23
|
+
sourceFile.replaceWithText(template);
|
|
24
|
+
project.saveSync();
|
|
14
25
|
}
|
|
15
26
|
//# sourceMappingURL=editor-common.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor-common.js","sourceRoot":"","sources":["../../../../src/ts-morph-utils/file-builders/editor-common.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"editor-common.js","sourceRoot":"","sources":["../../../../src/ts-morph-utils/file-builders/editor-common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,kCAAkC,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAU/D,2EAA2E;AAC3E,MAAM,UAAU,oBAAoB,CAAC,EACnC,OAAO,EACP,aAAa,EACb,UAAU,EACV,eAAe,EACf,QAAQ,EACR,2BAA2B,GACF;IACzB,IAAI,eAAe,IAAI,CAAC,CAAC,2BAA2B,EAAE,CAAC;QACrD,MAAM,IAAI,KAAK,CACb,qEAAqE,CACtE,CAAC;IACJ,CAAC;IACD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;IACvD,MAAM,EAAE,UAAU,EAAE,GAAG,qBAAqB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAEhE,UAAU,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;IAE/B,MAAM,oBAAoB,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;IACpD,MAAM,aAAa,GAAG,eAAe;QACnC,CAAC,CAAC,KAAK,eAAe,IAAI;QAC1B,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,2BAA2B,CAAC,CAAC;IAEhD,MAAM,QAAQ,GAAG,gCAAgC,CAAC;QAChD,UAAU;QACV,QAAQ;QACR,oBAAoB;QACpB,aAAa;KACd,CAAC,CAAC;IACH,UAAU,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;IACrC,OAAO,CAAC,QAAQ,EAAE,CAAC;AACrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-files.d.ts","sourceRoot":"","sources":["../../../../src/ts-morph-utils/file-builders/index-files.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index-files.d.ts","sourceRoot":"","sources":["../../../../src/ts-morph-utils/file-builders/index-files.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC,KAAK,uBAAuB,GAAG;IAC7B,oDAAoD;IACpD,OAAO,EAAE,OAAO,CAAC;IACjB,oEAAoE;IACpE,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE;QACP,eAAe,EAAE,MAAM,CAAC;QACxB,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;QAClC,eAAe,EAAE,MAAM,CAAC;KACzB,EAAE,CAAC;CACL,CAAC;AAEF;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,OAAO,EACP,cAAc,EACd,OAAO,GACR,EAAE,uBAAuB,QAsBzB"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import path from "node:path";
|
|
2
2
|
/**
|
|
3
3
|
* Makes a legacy index.ts file for the modules file which exports the modules as individual exports instead of an array of named exports.
|
|
4
4
|
*/
|
|
5
5
|
export function makeLegacyIndexFile({ project, modulesDirPath, modules, }) {
|
|
6
|
-
const indexSourceFilePath =
|
|
6
|
+
const indexSourceFilePath = path.join(modulesDirPath, "index.ts");
|
|
7
7
|
// get the source file for the index.ts file if it exists
|
|
8
8
|
let indexSourceFile = project.getSourceFile(indexSourceFilePath);
|
|
9
9
|
// if the index.ts file doesn't exist, create it
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-files.js","sourceRoot":"","sources":["../../../../src/ts-morph-utils/file-builders/index-files.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index-files.js","sourceRoot":"","sources":["../../../../src/ts-morph-utils/file-builders/index-files.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAe7B;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAClC,OAAO,EACP,cAAc,EACd,OAAO,GACiB;IACxB,MAAM,mBAAmB,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;IAElE,yDAAyD;IACzD,IAAI,eAAe,GAAG,OAAO,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC;IACjE,gDAAgD;IAChD,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC;IACtE,CAAC;SAAM,CAAC;QACN,eAAe,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;IACtC,CAAC;IAED,eAAe,CAAC,qBAAqB,CACnC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,EAAE,EAAE,EAAE,CAAC,CAAC;QACpE,YAAY,EAAE;YACZ,aAAa;gBACX,CAAC,CAAC,GAAG,eAAe,OAAO,aAAa,EAAE;gBAC1C,CAAC,CAAC,eAAe;SACpB;QACD,eAAe;KAChB,CAAC,CAAC,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -21,5 +21,12 @@ type MakeModuleFileArgs = {
|
|
|
21
21
|
* Makes a file which exports the modules from the module.ts files in the given directory as a variable declaration.
|
|
22
22
|
*/
|
|
23
23
|
export declare function makeModulesFile({ project, modulesDirPath, modulesSourceFilesPath, outputFileName, typeName, variableName, variableType, shouldMakeLegacyIndexFile, }: MakeModuleFileArgs): void;
|
|
24
|
+
/** Generates the `document-models.ts` file which exports the document models defined in each document model dir's `module.ts` file */
|
|
25
|
+
export declare function makeDocumentModelModulesFile({ project, projectDir, }: {
|
|
26
|
+
project: Project;
|
|
27
|
+
projectDir: string;
|
|
28
|
+
}): void;
|
|
29
|
+
/** Generates the `editors.ts` file which exports the editors defined in each editor dir's `module.ts` file */
|
|
30
|
+
export declare function makeEditorsModulesFile(project: Project, projectDir: string): void;
|
|
24
31
|
export {};
|
|
25
32
|
//# sourceMappingURL=module-files.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-files.d.ts","sourceRoot":"","sources":["../../../../src/ts-morph-utils/file-builders/module-files.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"module-files.d.ts","sourceRoot":"","sources":["../../../../src/ts-morph-utils/file-builders/module-files.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAIxC,KAAK,kBAAkB,GAAG;IACxB,+CAA+C;IAC/C,OAAO,EAAE,OAAO,CAAC;IACjB,oEAAoE;IACpE,cAAc,EAAE,MAAM,CAAC;IACvB,uDAAuD;IACvD,sBAAsB,EAAE,MAAM,CAAC;IAC/B,uGAAuG;IACvG,cAAc,EAAE,MAAM,CAAC;IACvB,iHAAiH;IACjH,QAAQ,EAAE,MAAM,CAAC;IACjB,4FAA4F;IAC5F,YAAY,EAAE,MAAM,CAAC;IACrB,+GAA+G;IAC/G,YAAY,EAAE,MAAM,CAAC;IACrB,0FAA0F;IAC1F,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC,CAAC;AACF;;GAEG;AACH,wBAAgB,eAAe,CAAC,EAC9B,OAAO,EACP,cAAc,EACd,sBAAsB,EACtB,cAAc,EACd,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,yBAAgC,GACjC,EAAE,kBAAkB,QAkHpB;AAED,sIAAsI;AACtI,wBAAgB,4BAA4B,CAAC,EAC3C,OAAO,EACP,UAAU,GACX,EAAE;IACD,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB,QAeA;AAED,8GAA8G;AAC9G,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,QAY1E"}
|