mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-05 01:38:44 +00:00
Saving and Loading of Scenes: - loading scenes from URL (aka the scenetoken) is fixed - URL changes according to the changing of loaded scene - scene signal is created for storing the metadata of a scene - editor can hydrate the scene signal data - options in the file menu changes states according to scene status Editor Changes and Fixes: - fixes the way Editor Engine is constructed and initialized for stability - fixes typing issues on all that is passed to Editor Engine from react-land Other Fixes, Bells & Whistles: - changed "back to dashboard" button to "back to editor", and the correct behavior of it - cleaned up routes and page files so routes designation are actually mutually exclusive Co-authored-by: wil <wil@storyteller.ai>
18 lines
480 B
TypeScript
18 lines
480 B
TypeScript
import { Params} from "@remix-run/react";
|
|
|
|
export const kebabCase = (str:string) => str
|
|
.replace(/([a-z])([A-Z])/g, "$1-$2")
|
|
.replace(/[\s_]+/g, '-')
|
|
.toLowerCase();
|
|
|
|
export const getCurrentLocationWithoutParams = (
|
|
path:string,
|
|
params:Readonly<Params<string>>
|
|
)=>{
|
|
let result = path;
|
|
Object.keys(params).forEach((key)=>{
|
|
result = result.replace(("/"+params[key]) || "", "")
|
|
});
|
|
if (result[result.length -1] !== "/") result = result + "/";
|
|
return result;
|
|
} |