- {/* Completed */}
{completedItems.map((item) => (
diff --git a/frontend/apps/editor3d/app/pages/PageEnigma/comps/PromptBox/PromptBox.tsx b/frontend/apps/editor3d/app/pages/PageEnigma/comps/PromptBox/PromptBox.tsx
index 3644b9e996..84bf473958 100644
--- a/frontend/apps/editor3d/app/pages/PageEnigma/comps/PromptBox/PromptBox.tsx
+++ b/frontend/apps/editor3d/app/pages/PageEnigma/comps/PromptBox/PromptBox.tsx
@@ -48,6 +48,7 @@ import {
updateCamera,
focalLengthDragging,
} from "~/pages/PageEnigma/signals/camera";
+import { toast } from "@storyteller/ui-toaster";
interface ReferenceImage {
id: string;
@@ -430,7 +431,7 @@ export const PromptBox = () => {
screenshot: snapshot.file,
sceneMediaToken: "",
});
-
+
console.log("useSystemPrompt", useSystemPrompt);
await engineApi.enqueueImageGeneration({
disableSystemPrompt: !useSystemPrompt,
@@ -451,6 +452,7 @@ export const PromptBox = () => {
await new Promise((resolve) => setTimeout(resolve, 2000));
} finally {
setisEnqueueing(false);
+ toast.success("Image added to queue");
}
}
setisEnqueueing(false);
diff --git a/frontend/apps/editor3d/tsconfig.json b/frontend/apps/editor3d/tsconfig.json
index 490787456a..df44f96589 100644
--- a/frontend/apps/editor3d/tsconfig.json
+++ b/frontend/apps/editor3d/tsconfig.json
@@ -23,6 +23,9 @@
"references": [
{
"path": "../../libs/login"
+ },
+ {
+ "path": "../../libs/components/toaster"
}
]
}
diff --git a/frontend/libs/components/toaster/.babelrc b/frontend/libs/components/toaster/.babelrc
new file mode 100644
index 0000000000..1ea870ead4
--- /dev/null
+++ b/frontend/libs/components/toaster/.babelrc
@@ -0,0 +1,12 @@
+{
+ "presets": [
+ [
+ "@nx/react/babel",
+ {
+ "runtime": "automatic",
+ "useBuiltIns": "usage"
+ }
+ ]
+ ],
+ "plugins": []
+}
diff --git a/frontend/libs/components/toaster/README.md b/frontend/libs/components/toaster/README.md
new file mode 100644
index 0000000000..e0f957ed25
--- /dev/null
+++ b/frontend/libs/components/toaster/README.md
@@ -0,0 +1,7 @@
+# @storyteller/ui-toaster
+
+This library was generated with [Nx](https://nx.dev).
+
+## Running unit tests
+
+Run `nx test @storyteller/ui-toaster` to execute the unit tests via [Vitest](https://vitest.dev/).
diff --git a/frontend/libs/components/toaster/package.json b/frontend/libs/components/toaster/package.json
new file mode 100644
index 0000000000..9912d73084
--- /dev/null
+++ b/frontend/libs/components/toaster/package.json
@@ -0,0 +1,17 @@
+{
+ "name": "@storyteller/ui-toaster",
+ "version": "0.0.1",
+ "type": "module",
+ "main": "./dist/index.js",
+ "module": "./dist/index.js",
+ "types": "./dist/index.d.ts",
+ "exports": {
+ "./package.json": "./package.json",
+ ".": {
+ "development": "./src/index.ts",
+ "types": "./dist/index.d.ts",
+ "import": "./dist/index.js",
+ "default": "./dist/index.js"
+ }
+ }
+}
diff --git a/frontend/libs/components/toaster/src/index.ts b/frontend/libs/components/toaster/src/index.ts
new file mode 100644
index 0000000000..6405a47fbe
--- /dev/null
+++ b/frontend/libs/components/toaster/src/index.ts
@@ -0,0 +1,2 @@
+
+export * from './lib/toaster';
diff --git a/frontend/libs/components/toaster/src/lib/toaster.module.css b/frontend/libs/components/toaster/src/lib/toaster.module.css
new file mode 100644
index 0000000000..d0246c74b9
--- /dev/null
+++ b/frontend/libs/components/toaster/src/lib/toaster.module.css
@@ -0,0 +1,7 @@
+/*
+ * Replace this with your own classes
+ *
+ * e.g.
+ * .container {
+ * }
+*/
\ No newline at end of file
diff --git a/frontend/libs/components/toaster/src/lib/toaster.spec.tsx b/frontend/libs/components/toaster/src/lib/toaster.spec.tsx
new file mode 100644
index 0000000000..6ff83ed6e1
--- /dev/null
+++ b/frontend/libs/components/toaster/src/lib/toaster.spec.tsx
@@ -0,0 +1,12 @@
+import { render } from '@testing-library/react';
+
+import Toaster from './toaster';
+
+describe('Toaster', () => {
+
+ it('should render successfully', () => {
+ const { baseElement } = render();
+ expect(baseElement).toBeTruthy();
+ });
+
+});
diff --git a/frontend/libs/components/toaster/src/lib/toaster.tsx b/frontend/libs/components/toaster/src/lib/toaster.tsx
new file mode 100644
index 0000000000..f18da7150a
--- /dev/null
+++ b/frontend/libs/components/toaster/src/lib/toaster.tsx
@@ -0,0 +1,49 @@
+import toast, { Toaster as RHToaster } from "react-hot-toast";
+
+interface ToasterProps {
+ position?: "top-right" | "top-left" | "bottom-right" | "bottom-left";
+ offsetTop?: number;
+ offsetBottom?: number;
+ offsetLeft?: number;
+ offsetRight?: number;
+ zIndex?: number;
+}
+
+export function Toaster({
+ position = "top-right",
+ offsetTop = 12,
+ offsetBottom = 12,
+ offsetLeft = 12,
+ offsetRight = 12,
+ zIndex = 9,
+}: ToasterProps) {
+ return (
+
+ );
+}
+
+export default Toaster;
+
+export { toast };
diff --git a/frontend/libs/components/toaster/tsconfig.json b/frontend/libs/components/toaster/tsconfig.json
new file mode 100644
index 0000000000..b3d19d8f5e
--- /dev/null
+++ b/frontend/libs/components/toaster/tsconfig.json
@@ -0,0 +1,13 @@
+{
+ "files": [],
+ "include": [],
+ "references": [
+ {
+ "path": "./tsconfig.lib.json"
+ },
+ {
+ "path": "./tsconfig.spec.json"
+ }
+ ],
+ "extends": "../../../tsconfig.base.json"
+}
diff --git a/frontend/libs/components/toaster/tsconfig.lib.json b/frontend/libs/components/toaster/tsconfig.lib.json
new file mode 100644
index 0000000000..f0782e3dd8
--- /dev/null
+++ b/frontend/libs/components/toaster/tsconfig.lib.json
@@ -0,0 +1,45 @@
+{
+ "extends": "../../../tsconfig.base.json",
+ "compilerOptions": {
+ "outDir": "dist",
+ "types": [
+ "node",
+ "@nx/react/typings/cssmodule.d.ts",
+ "@nx/react/typings/image.d.ts",
+ "vite/client"
+ ],
+ "rootDir": "src",
+ "jsx": "react-jsx",
+ "tsBuildInfoFile": "dist/tsconfig.lib.tsbuildinfo"
+ },
+ "exclude": [
+ "out-tsc",
+ "dist",
+ "**/*.spec.ts",
+ "**/*.test.ts",
+ "**/*.spec.tsx",
+ "**/*.test.tsx",
+ "**/*.spec.js",
+ "**/*.test.js",
+ "**/*.spec.jsx",
+ "**/*.test.jsx",
+ "vite.config.ts",
+ "vite.config.mts",
+ "vitest.config.ts",
+ "vitest.config.mts",
+ "src/**/*.test.ts",
+ "src/**/*.spec.ts",
+ "src/**/*.test.tsx",
+ "src/**/*.spec.tsx",
+ "src/**/*.test.js",
+ "src/**/*.spec.js",
+ "src/**/*.test.jsx",
+ "src/**/*.spec.jsx"
+ ],
+ "include": [
+ "src/**/*.js",
+ "src/**/*.jsx",
+ "src/**/*.ts",
+ "src/**/*.tsx"
+ ]
+}
diff --git a/frontend/libs/components/toaster/tsconfig.spec.json b/frontend/libs/components/toaster/tsconfig.spec.json
new file mode 100644
index 0000000000..18b7de51b8
--- /dev/null
+++ b/frontend/libs/components/toaster/tsconfig.spec.json
@@ -0,0 +1,34 @@
+{
+ "extends": "../../../tsconfig.base.json",
+ "compilerOptions": {
+ "outDir": "./out-tsc/vitest",
+ "types": [
+ "vitest/globals",
+ "vitest/importMeta",
+ "vite/client",
+ "node",
+ "vitest"
+ ],
+ "jsx": "react-jsx"
+ },
+ "include": [
+ "vite.config.ts",
+ "vite.config.mts",
+ "vitest.config.ts",
+ "vitest.config.mts",
+ "src/**/*.test.ts",
+ "src/**/*.spec.ts",
+ "src/**/*.test.tsx",
+ "src/**/*.spec.tsx",
+ "src/**/*.test.js",
+ "src/**/*.spec.js",
+ "src/**/*.test.jsx",
+ "src/**/*.spec.jsx",
+ "src/**/*.d.ts"
+ ],
+ "references": [
+ {
+ "path": "./tsconfig.lib.json"
+ }
+ ]
+}
diff --git a/frontend/libs/components/toaster/vite.config.ts b/frontend/libs/components/toaster/vite.config.ts
new file mode 100644
index 0000000000..a0453aa36a
--- /dev/null
+++ b/frontend/libs/components/toaster/vite.config.ts
@@ -0,0 +1,49 @@
+///
+import { defineConfig } from 'vite';
+import react from '@vitejs/plugin-react';
+import dts from 'vite-plugin-dts';
+import * as path from 'path';
+
+export default defineConfig(() => ({
+ root: __dirname,
+ cacheDir: '../../../node_modules/.vite/libs/components/toaster',
+ plugins: [react(), dts({ entryRoot: 'src', tsconfigPath: path.join(__dirname, 'tsconfig.lib.json') })],
+ // Uncomment this if you are using workers.
+ // worker: {
+ // plugins: [ nxViteTsPaths() ],
+ // },
+ // Configuration for building your library.
+ // See: https://vitejs.dev/guide/build.html#library-mode
+ build: {
+ outDir: './dist',
+ emptyOutDir: true,
+ reportCompressedSize: true,
+ commonjsOptions: {
+ transformMixedEsModules: true,
+ },
+ lib: {
+ // Could also be a dictionary or array of multiple entry points.
+ entry: 'src/index.ts',
+ name: '@storyteller/ui-toaster',
+ fileName: 'index',
+ // Change this to the formats you want to support.
+ // Don't forget to update your package.json as well.
+ formats: ['es' as const]
+ },
+ rollupOptions: {
+ // External packages that should not be bundled into your library.
+ external: ['react','react-dom','react/jsx-runtime']
+ },
+ },
+ test: {
+ watch: false,
+ globals: true,
+ environment: 'jsdom',
+ include: ['{src,tests}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
+ reporters: ['default'],
+ coverage: {
+ reportsDirectory: './test-output/vitest/coverage',
+ provider: 'v8' as const,
+ }
+ },
+}));
diff --git a/frontend/package.json b/frontend/package.json
index aae035da80..424e8d0f7d 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -10,6 +10,7 @@
"pnpm": "^10.8.1",
"react": "18.3.1",
"react-dom": "18.3.1",
+ "react-hot-toast": "^2.5.2",
"react-router-dom": "6.29.0"
},
"devDependencies": {
diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json
index 752d3150e4..0ae454dda8 100644
--- a/frontend/tsconfig.json
+++ b/frontend/tsconfig.json
@@ -14,6 +14,9 @@
},
{
"path": "./apps/my-app"
+ },
+ {
+ "path": "./libs/components/toaster"
}
]
}