mirror of
https://github.com/storytold/storyteller-bevy.git
synced 2026-10-09 00:09:55 +00:00
03f87b2544
This PR adds a new "Add to Scene" dropdown menu for adding elements to the current scene, and a new Media Library dialog for importing and/or adding Storyteller Engine assets (characters, scenes, animations, etc.) associated with the user's Storyteller.ai account. The scope of this PR is limited to the UI — actual asset importing behavior, and adding elements other than primitive shapes to the current scene, will be implemented in follow-up PRs. ### Technical Details In order to facilitate these changes, a new "overlay" abstraction has been added to `@storyteller/studio-ui` (loosely modeled after [`@angular/cdk/overlay`](https://material.angular.io/cdk/overlay/overview)) for managing DOM elements which should render in a self-contained stacking context "above" the rest of the application. Two new base UI components — `<sts-menu>` and `<sts-dialog>` — have also been added to make use of this overlay system, but it's worth noting that these new components have not yet been exhaustively tested or thoroughly fleshed out, so they may require significant changes in order to accommodate future use cases or address unforeseen bugs. ### Testing The Media Library makes some API calls which will run into CORS errors in a normal browser. This can be bypassed by running Chrome with the following command-line flags: ``` --disable-web-security --ignore-certificate-errors --user-data-dir=path/to/some/temporary/directory ``` Verify all of the following: * The "Add to Scene" menu opens and closes as expected * The primitive-shape menu items (Cube, Sphere, etc.) add the corresponding elements to the scene * The "Media Library..." menu item correctly opens the Media Library dialog * The Media Library's search bar and category filters work as expected * A single asset can be selected by clicking on it * Multiple assets can be selected by holding the "Ctrl" or "Cmd" key * The selection can be cleared by clicking in an empty space in the results grid * An "Add to Scene" button appears if (and only if) one or more assets are selected * The Media Library dialog can be closed by: - Clicking the "X" in the upper right-hand corner - Pressing the "Esc" key - Clicking anywhere outside of the dialog boundaries Additionally, ensure that the Media Library dialog handles all of the following situations gracefully: * User is not logged in to fakeyou.com * User is logged in but does not have any engine-compatible assets uploaded (this can be tested by selecting any of the categories from the sidebar, since the database has not yet been migrated to use the new `media_file_class` field, so all of those categories should currently yield an empty list) * User is logged in and there are engine-compatible assets to list (this can be tested by pressing the "Save" button in the main application toolbar to save the current scene to your account, and selecting the "Home" entry from the Media Library sidebar)
46 lines
2.5 KiB
JSON
46 lines
2.5 KiB
JSON
{
|
|
"compileOnSave": false,
|
|
"compilerOptions": {
|
|
"rootDir": ".",
|
|
"sourceMap": true,
|
|
"declaration": false,
|
|
"moduleResolution": "node",
|
|
"emitDecoratorMetadata": true,
|
|
"experimentalDecorators": true,
|
|
"importHelpers": true,
|
|
"target": "es2015",
|
|
"module": "esnext",
|
|
"lib": ["es2021", "dom"],
|
|
"skipLibCheck": true,
|
|
"skipDefaultLibCheck": true,
|
|
"baseUrl": ".",
|
|
"paths": {
|
|
"@storyteller/framework": ["framework/src/index.ts"],
|
|
"@storyteller/studio": ["dist/studio"],
|
|
"@storyteller/studio-ui": ["studio-ui/src/index.ts"],
|
|
"@storyteller/studio-ui/button": ["studio-ui/src/lib/button.element.ts"],
|
|
"@storyteller/studio-ui/dialog": ["studio-ui/src/lib/dialog.element.ts"],
|
|
"@storyteller/studio-ui/icon": ["studio-ui/src/lib/icon.element.ts"],
|
|
"@storyteller/studio-ui/menu": ["studio-ui/src/lib/menu.element.ts"],
|
|
"@storyteller/studio-ui/overlay-provider": ["studio-ui/src/lib/overlay-provider.element.ts"],
|
|
"@storyteller/studio-ui/progress": ["studio-ui/src/lib/progress.element.ts"],
|
|
"@storyteller/studio-ui/toolbar": ["studio-ui/src/lib/toolbar.element.ts"],
|
|
"@storyteller/studio-ui/tree": ["studio-ui/src/lib/tree.element.ts"],
|
|
"@storyteller/studio-ui/forms/text-field": ["studio-ui/src/lib/forms/text-field.element.ts"],
|
|
"@storyteller/studio-web": ["studio-web/src/index.ts"],
|
|
"@storyteller/studio-web/add-to-scene-menu": ["studio-web/src/lib/add-to-scene-menu.element.ts"],
|
|
"@storyteller/studio-web/canvas-provider": ["studio-web/src/lib/canvas-provider.element.ts"],
|
|
"@storyteller/studio-web/entity-inspector": ["studio-web/src/lib/inspector/entity-inspector.element.ts"],
|
|
"@storyteller/studio-web/iframe-messaging-bridge": ["studio-web/src/lib/iframe-messaging-bridge.element.ts"],
|
|
"@storyteller/studio-web/loading": ["studio-web/src/lib/loading.element.ts"],
|
|
"@storyteller/studio-web/media-library-dialog": ["studio-web/src/lib/media-library-dialog.element.ts"],
|
|
"@storyteller/studio-web/scene-data-provider": ["studio-web/src/lib/scene-data-provider.element.ts"],
|
|
"@storyteller/studio-web/scene-hierarchy": ["studio-web/src/lib/scene-hierarchy.element.ts"],
|
|
"@storyteller/studio-web/studio": ["studio-web/src/lib/studio.element.ts"],
|
|
"@storyteller/studio-web/transform-toolbar": ["studio-web/src/lib/transform-toolbar.element.ts"],
|
|
"@storyteller/utility": ["utility/src/index.ts"]
|
|
}
|
|
},
|
|
"exclude": ["node_modules", "tmp"]
|
|
}
|