feat(block-editor): add Save Block As

Create a new named definition from current session edits, restore the source checkpoint, and continue editing the copy with fresh local history. Add the name dialog and Save dropdown, clone supported owned metadata onto independent handles, and refuse unsupported relationships atomically.
This commit is contained in:
Karim Jerbi committed 2026-10-14 09:11:55 +01:00
1 parent da8e976a60
commit 78bdfa3c74
13 files changed
+1364 -8

No files matched your search

+22 -5
View File
@@ -36,11 +36,28 @@ impl CadModule for BlockEditorModule {
"Edit Block",
include_bytes!("../../../assets/icons/edit_block.svg"),
),
command(
"BSAVE",
"Save Block",
include_bytes!("../../../assets/icons/mt_ok.svg"),
),
RibbonItem::LargeDropdown {
id: "BLOCK_SAVE",
label: "Save Block",
icon: IconKind::Svg(include_bytes!("../../../assets/icons/mt_ok.svg")),
items: vec![
(
"BSAVE",
"Save Block",
IconKind::Svg(include_bytes!(
"../../../assets/icons/mt_ok.svg"
)),
),
(
"BSAVEAS",
"Save Block As",
IconKind::Svg(include_bytes!(
"../../../assets/icons/ui/save.svg"
)),
),
],
default: "BSAVE",
},
command(
"BCLOSE",
"Close Block Editor",
+7 -1
View File
@@ -31,6 +31,12 @@ pub fn block_edit_tools() -> Vec<ToolDef> {
icon: IconKind::Svg(include_bytes!("../../../../assets/icons/mt_ok.svg")),
event: ModuleEvent::Command("BSAVE".to_string()),
},
ToolDef {
id: "BSAVEAS",
label: "Save Block As",
icon: IconKind::Svg(include_bytes!("../../../../assets/icons/ui/save.svg")),
event: ModuleEvent::Command("BSAVEAS".to_string()),
},
ToolDef {
id: "BCLOSE",
label: "Close Block Editor",
@@ -111,5 +117,5 @@ inventory::submit!(crate::command::CommandRegistration {
names: &["BEDIT_DISCARD"]
});
inventory::submit!(crate::command::CommandRegistration {
names: &["BSAVE", "BCLOSE"]
names: &["BSAVE", "BSAVEAS", "BCLOSE"]
});