Remove all use of document indices (#406)

* removed all use of document indicies

* -add u64 support for wasm bridge

* fixed rust formating

* Cleaned up FrontendDocumentState in js-messages

* Tiny tweaks from code review

* - moved more of closeDocumentWithConfirmation to rust
- updated serde_wasm_bindgen to add feature flag

* changed to upsteam version of serde_wasm_bindgen

* cargo fmt

* -fix event propigation on delete
- Js message change class extention to typedef

* changed another typedef

* cargo fmt

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
mfish33
2021-12-24 19:07:19 -05:00
committed by Keavon Chambers
parent 1594b9c61d
commit 04c1b2ed03
13 changed files with 213 additions and 184 deletions

View File

@@ -5,17 +5,24 @@ use crate::tool::tool_options::ToolOptions;
use crate::Color;
use serde::{Deserialize, Serialize};
#[derive(PartialEq, Clone, Deserialize, Serialize, Debug)]
pub struct FrontendDocumentDetails {
pub is_saved: bool,
pub name: String,
pub id: u64,
}
#[impl_message(Message, Frontend)]
#[derive(PartialEq, Clone, Deserialize, Serialize, Debug)]
pub enum FrontendMessage {
DisplayFolderTreeStructure { data_buffer: RawBuffer },
SetActiveTool { tool_name: String, tool_options: Option<ToolOptions> },
SetActiveDocument { document_index: usize },
UpdateOpenDocumentsList { open_documents: Vec<(String, bool)> },
SetActiveDocument { document_id: u64 },
UpdateOpenDocumentsList { open_documents: Vec<FrontendDocumentDetails> },
UpdateInputHints { hint_data: HintData },
DisplayError { title: String, description: String },
DisplayPanic { panic_info: String, title: String, description: String },
DisplayConfirmationToCloseDocument { document_index: usize },
DisplayConfirmationToCloseDocument { document_id: u64 },
DisplayConfirmationToCloseAllDocuments,
DisplayAboutGraphiteDialog,
UpdateLayer { data: LayerPanelEntry },