refactor: remove unused bridge wrappers
This commit is contained in:
@@ -83,7 +83,6 @@ const MINDMAP_SHELL_PANEL_EVENT: &str = "mnote:mindmap-shell:panel";
|
||||
const MINDMAP_SHELL_MINIMAP_EVENT: &str = "mnote:mindmap-shell:minimap";
|
||||
const MINDMAP_SHELL_ZOOM_EVENT: &str = "mnote:mindmap-shell:zoom";
|
||||
const MINDMAP_SHELL_TOOLBAR_OVERFLOW_EVENT: &str = "mnote:mindmap-shell:toolbar-overflow";
|
||||
const STANDALONE_ROOT_ID: &str = "mnote-leptos-tiptap-standalone-root";
|
||||
mod editor_runtime;
|
||||
|
||||
#[wasm_bindgen(inline_js = r#"
|
||||
@@ -3507,10 +3506,6 @@ fn set_runtime_mount_options(options: Option<RuntimeMountOptions>) {
|
||||
});
|
||||
}
|
||||
|
||||
fn runtime_mount_options() -> Option<RuntimeMountOptions> {
|
||||
RUNTIME_MOUNT_OPTIONS.with(|cell| cell.borrow().clone())
|
||||
}
|
||||
|
||||
fn runtime_editor_instance_id(mount_id: Option<u32>) -> String {
|
||||
mount_id
|
||||
.filter(|value| *value > 0)
|
||||
@@ -3670,10 +3665,6 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
fn dispatch_ready_event(payload: &ReadyPayload) {
|
||||
dispatch_runtime_event(READY_EVENT, payload);
|
||||
}
|
||||
|
||||
fn dispatch_ready_event_to_target(target: &EventTarget, payload: &ReadyPayload) {
|
||||
dispatch_custom_event_to_target(target, READY_EVENT, payload);
|
||||
}
|
||||
@@ -3702,10 +3693,6 @@ fn dispatch_status_event_to_target(target: &EventTarget, payload: &HostStatusPay
|
||||
dispatch_custom_event_to_target(target, STATUS_EVENT, payload);
|
||||
}
|
||||
|
||||
fn dispatch_selection_event(payload: &SelectionPayload) {
|
||||
dispatch_runtime_event(SELECTION_EVENT, payload);
|
||||
}
|
||||
|
||||
fn dispatch_selection_event_to_target(target: &EventTarget, payload: &SelectionPayload) {
|
||||
dispatch_custom_event_to_target(target, SELECTION_EVENT, payload);
|
||||
}
|
||||
@@ -5696,30 +5683,6 @@ fn apply_host_document_payload(
|
||||
}
|
||||
}
|
||||
|
||||
fn bridge_ready_payload() -> ReadyPayload {
|
||||
ReadyPayload {
|
||||
runtime_name: RUNTIME_NAME,
|
||||
selectors: BridgeSelectorsPayload {
|
||||
root: "[data-testid=\"mnote-leptos-tiptap-host\"]",
|
||||
stage: "[data-testid=\"mnote-leptos-tiptap-editor-stage\"]",
|
||||
editor: "[data-testid=\"mnote-leptos-tiptap-editor-root\"]",
|
||||
toolbar: "[data-testid=\"mnote-leptos-tiptap-toolbar\"]",
|
||||
slash_menu: "[data-testid=\"mnote-leptos-tiptap-slash-menu\"]",
|
||||
handle: "[data-testid=\"mnote-leptos-tiptap-handle\"]",
|
||||
},
|
||||
supported_commands: vec![
|
||||
"replaceContent",
|
||||
"setPageOptions",
|
||||
"setEditable",
|
||||
"undo",
|
||||
"redo",
|
||||
"focus",
|
||||
"requestCurrentBlockId",
|
||||
],
|
||||
supports_embedded_mode: true,
|
||||
}
|
||||
}
|
||||
|
||||
fn apply_text_color(editor: TiptapEditorHandle, color: &str) -> Result<&'static str, String> {
|
||||
editor
|
||||
.set_color(TiptapColorAttributes {
|
||||
|
||||
Reference in New Issue
Block a user