mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-02 15:55:41 -05:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad4027b873 |
@@ -369,7 +369,7 @@ const PageDraw = () => {
|
||||
input.click();
|
||||
}}
|
||||
onDelete={(): void => {
|
||||
store.RESET();
|
||||
store.deleteSelectedItems();
|
||||
}}
|
||||
activeToolId={store.activeTool}
|
||||
currentShape={store.currentShape}
|
||||
|
||||
@@ -196,7 +196,6 @@ interface SceneState {
|
||||
|
||||
// Action for deleting selected items
|
||||
deleteSelectedItems: () => void;
|
||||
RESET: () => void;
|
||||
|
||||
// Clipboard actions
|
||||
copySelectedItems: () => void;
|
||||
@@ -235,8 +234,10 @@ interface SceneState {
|
||||
sendBackward: (nodeIds: string[]) => void;
|
||||
|
||||
// Start background removal (enqueues task with Tauri)
|
||||
beginRemoveBackground: (nodeIds: string[]) => Promise<void>;
|
||||
|
||||
beginRemoveBackground: (
|
||||
nodeIds: string[],
|
||||
) => Promise<void>;
|
||||
|
||||
// Finish background removal (handoff back from a Tauri-sent event)
|
||||
finishRemoveBackground: (
|
||||
nodeId: string,
|
||||
@@ -272,7 +273,7 @@ const getNextZIndex = (nodes: Node[], lineNodes: LineNode[]): number => {
|
||||
return allZIndices.length > 0 ? Math.max(...allZIndices) + 1 : 1;
|
||||
};
|
||||
|
||||
export const useSceneStore = create<SceneState>((set, get, store) => ({
|
||||
export const useSceneStore = create<SceneState>((set, get) => ({
|
||||
// Initial state
|
||||
nodes: [],
|
||||
lineNodes: [],
|
||||
@@ -288,7 +289,7 @@ export const useSceneStore = create<SceneState>((set, get, store) => ({
|
||||
fillColor: "white",
|
||||
currentShape: null,
|
||||
shapeColor: "#4d79b3",
|
||||
|
||||
|
||||
// Cursor initial state
|
||||
cursorPosition: null,
|
||||
cursorVisible: false,
|
||||
@@ -336,6 +337,7 @@ export const useSceneStore = create<SceneState>((set, get, store) => ({
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
updateNode: (
|
||||
id: string,
|
||||
updates: Partial<Node>,
|
||||
@@ -836,10 +838,6 @@ export const useSceneStore = create<SceneState>((set, get, store) => ({
|
||||
}
|
||||
},
|
||||
|
||||
RESET: () => {
|
||||
set(store.getInitialState());
|
||||
},
|
||||
|
||||
// Clipboard actions
|
||||
copySelectedItems: () => {
|
||||
set((state) => {
|
||||
@@ -1439,7 +1437,9 @@ export const useSceneStore = create<SceneState>((set, get, store) => ({
|
||||
});
|
||||
get().saveState();
|
||||
},
|
||||
beginRemoveBackground: async (nodeIds: string[]) => {
|
||||
beginRemoveBackground: async (
|
||||
nodeIds: string[],
|
||||
) => {
|
||||
const hasImageNodes = nodeIds.some((id) => {
|
||||
const node = get().nodes.find((n) => n.id === id);
|
||||
return node ? node.type === "image" : false;
|
||||
@@ -1455,7 +1455,7 @@ export const useSceneStore = create<SceneState>((set, get, store) => ({
|
||||
}
|
||||
try {
|
||||
const base64Image = await convertFileToBase64(firstNode.imageFile);
|
||||
// NB: This handler is async, so we subscribe (externally) and
|
||||
// NB: This handler is async, so we subscribe (externally) and
|
||||
// wait for the bg removal to complete.
|
||||
const _response = await EnqueueImageBgRemoval({
|
||||
base64_image: base64Image,
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
"build": "vite build",
|
||||
"preview": "vite preview --port 8080",
|
||||
"dev": "echo 'editor3d' && vite dev",
|
||||
"production-preview": "echo 'editor3d dev with production preview' && vite build --debug --emptyOutDir --logLevel info && vite preview --port 5173",
|
||||
"production-preview": "echo 'editor3d dev with production preview' && vite build && vite preview --port 5173",
|
||||
"staging-build": "vite build",
|
||||
"lint": "eslint --ignore-path .gitignore --cache --cache-location ./node_modules/.cache/eslint playground/* .",
|
||||
"typecheck": "tsc",
|
||||
@@ -65,7 +65,6 @@
|
||||
"react-dom": "^18.2.0",
|
||||
"react-drag-drop-files": "^2.3.10",
|
||||
"react-helmet": "^6.1.0",
|
||||
"react-hot-toast": "^2.5.2",
|
||||
"react-image-crop": "^11.0.5",
|
||||
"react-konva": "^18.2.10",
|
||||
"react-router": "^6.26.1",
|
||||
|
||||
@@ -7,13 +7,7 @@ import * as path from 'path';
|
||||
export default defineConfig(() => ({
|
||||
root: __dirname,
|
||||
cacheDir: '../../../node_modules/.vite/libs/components/login-modal',
|
||||
plugins: [
|
||||
react(),
|
||||
dts({
|
||||
entryRoot: 'src',
|
||||
tsconfigPath: path.join(__dirname, 'tsconfig.lib.json')
|
||||
})
|
||||
],
|
||||
plugins: [react(), dts({ entryRoot: 'src', tsconfigPath: path.join(__dirname, 'tsconfig.lib.json') })],
|
||||
// Uncomment this if you are using workers.
|
||||
// worker: {
|
||||
// plugins: [ nxViteTsPaths() ],
|
||||
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
JobContextType,
|
||||
MaybeCanvasRenderBitmapType,
|
||||
UploaderState,
|
||||
UploaderStates,
|
||||
} from "@storyteller/common";
|
||||
import { PopoverMenu, PopoverItem } from "@storyteller/ui-popover";
|
||||
import { Tooltip } from "@storyteller/ui-tooltip";
|
||||
@@ -31,7 +32,7 @@ import {
|
||||
EnqueueContextualEditImage,
|
||||
EnqueueContextualEditImageSize,
|
||||
} from "@storyteller/tauri-api";
|
||||
import { usePrompt2DStore } from "./promptStore";
|
||||
import { usePrompt2DStore, RefImage } from "./promptStore";
|
||||
import { gtagEvent } from "@storyteller/google-analytics";
|
||||
import { getCapabilitiesForModel } from "@storyteller/model-list";
|
||||
import { ImageModel } from "@storyteller/model-list";
|
||||
|
||||
@@ -39,8 +39,11 @@ import { Signal } from "@preact/signals-react";
|
||||
import {
|
||||
CommandSuccessStatus,
|
||||
EnqueueContextualEditImage,
|
||||
EnqueueContextualEditImageModel,
|
||||
EnqueueContextualEditImageSize,
|
||||
// waitForSoraLogin,
|
||||
} from "@storyteller/tauri-api";
|
||||
// import { showActionReminder } from "@storyteller/ui-action-reminder-modal";
|
||||
import { usePrompt3DStore } from "./promptStore";
|
||||
import { gtagEvent } from "@storyteller/google-analytics";
|
||||
import { ImageModel } from "@storyteller/model-list";
|
||||
@@ -95,7 +98,7 @@ export const PromptBox3D = ({
|
||||
snapshotCurrentFrame,
|
||||
}: PromptBox3DProps) => {
|
||||
useSignals();
|
||||
//const fileInputRef = useRef<HTMLInputElement>(null);
|
||||
const fileInputRef = useRef<HTMLInputElement>(null);
|
||||
const textareaRef = useRef<HTMLTextAreaElement>(null);
|
||||
const [content, setContent] = useState<React.ReactNode>(null);
|
||||
const [isModalOpen, setIsModalOpen] = useState(false);
|
||||
|
||||
@@ -235,8 +235,8 @@ export const PromptBoxImage = ({
|
||||
return;
|
||||
}
|
||||
|
||||
console.debug("Selected model:", selectedModel)
|
||||
console.debug("Prompt:", prompt)
|
||||
console.log("Selected model:", selectedModel)
|
||||
console.log("Prompt:", prompt)
|
||||
|
||||
setIsEnqueueing(true);
|
||||
|
||||
@@ -274,7 +274,7 @@ export const PromptBoxImage = ({
|
||||
}
|
||||
|
||||
const generateResponse = await EnqueueTextToImage(request);
|
||||
console.debug("PromptBoxImage - generateResponse", generateResponse);
|
||||
console.log("PromptBoxImage - generateResponse", generateResponse);
|
||||
|
||||
await onEnqueuePressed?.(prompt, generationCount, subscriberId);
|
||||
} catch (err) {
|
||||
|
||||
@@ -7,13 +7,7 @@ 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')
|
||||
})
|
||||
],
|
||||
plugins: [react(), dts({ entryRoot: 'src', tsconfigPath: path.join(__dirname, 'tsconfig.lib.json') })],
|
||||
// Uncomment this if you are using workers.
|
||||
// worker: {
|
||||
// plugins: [ nxViteTsPaths() ],
|
||||
@@ -38,18 +32,7 @@ export default defineConfig(() => ({
|
||||
},
|
||||
rollupOptions: {
|
||||
// External packages that should not be bundled into your library.
|
||||
external: [
|
||||
'react',
|
||||
'react-dom',
|
||||
'react/jsx-runtime',
|
||||
'react-hot-toast'
|
||||
],
|
||||
output: {
|
||||
globals: {
|
||||
'react-hot-toast': 'react-hot-toast',
|
||||
},
|
||||
preserveModules: false,
|
||||
},
|
||||
external: ['react','react-dom','react/jsx-runtime']
|
||||
},
|
||||
},
|
||||
test: {
|
||||
|
||||
@@ -7,13 +7,7 @@ import * as path from 'path';
|
||||
export default defineConfig(() => ({
|
||||
root: __dirname,
|
||||
cacheDir: '../../node_modules/.vite/libs/tauri-events',
|
||||
plugins: [
|
||||
react(),
|
||||
dts({
|
||||
entryRoot: 'src',
|
||||
tsconfigPath: path.join(__dirname, 'tsconfig.lib.json')
|
||||
})
|
||||
],
|
||||
plugins: [react(), dts({ entryRoot: 'src', tsconfigPath: path.join(__dirname, 'tsconfig.lib.json') })],
|
||||
// Uncomment this if you are using workers.
|
||||
// worker: {
|
||||
// plugins: [ nxViteTsPaths() ],
|
||||
@@ -38,12 +32,7 @@ export default defineConfig(() => ({
|
||||
},
|
||||
rollupOptions: {
|
||||
// External packages that should not be bundled into your library.
|
||||
external: [
|
||||
'react',
|
||||
'react-dom',
|
||||
'react/jsx-runtime',
|
||||
'react-hot-toast',
|
||||
]
|
||||
external: ['react','react-dom','react/jsx-runtime']
|
||||
},
|
||||
},
|
||||
test: {
|
||||
|
||||
Generated
-1
@@ -206,7 +206,6 @@
|
||||
"react-dom": "^18.2.0",
|
||||
"react-drag-drop-files": "^2.3.10",
|
||||
"react-helmet": "^6.1.0",
|
||||
"react-hot-toast": "^2.5.2",
|
||||
"react-image-crop": "^11.0.5",
|
||||
"react-konva": "^18.2.10",
|
||||
"react-router": "^6.26.1",
|
||||
|
||||
@@ -39,12 +39,6 @@
|
||||
{
|
||||
"path": "./libs/components/tooltip"
|
||||
},
|
||||
{
|
||||
"path": "./libs/tauri-api"
|
||||
},
|
||||
{
|
||||
"path": "./libs/tauri-events"
|
||||
},
|
||||
{
|
||||
"path": "./libs/tauri-utils"
|
||||
},
|
||||
@@ -84,6 +78,9 @@
|
||||
{
|
||||
"path": "./libs/common"
|
||||
},
|
||||
{
|
||||
"path": "./libs/tauri-api"
|
||||
},
|
||||
{
|
||||
"path": "./libs/components/login-modal"
|
||||
},
|
||||
@@ -153,6 +150,9 @@
|
||||
{
|
||||
"path": "./libs/analytics/google-analytics"
|
||||
},
|
||||
{
|
||||
"path": "./libs/tauri-events"
|
||||
},
|
||||
{
|
||||
"path": "./libs/components/provider-setup-modal"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user