重构基线
This commit is contained in:
@@ -15,7 +15,6 @@ path = "src/main.rs"
|
||||
|
||||
[dependencies]
|
||||
console_error_panic_hook = "0.1.7"
|
||||
radix-leptos-primitives = "0.9.0"
|
||||
leptos = { version = "0.8.19", features = ["csr"] }
|
||||
leptos_dom = "0.8.8"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
@@ -25,7 +24,7 @@ send_wrapper = "0.6"
|
||||
js-sys = "0.3.77"
|
||||
wasm-bindgen = "0.2"
|
||||
wasm-bindgen-futures = "0.4"
|
||||
web-sys = { version = "0.3.77", features = ["CustomEvent", "CustomEventInit", "DataTransfer", "Document", "DomRect", "DragEvent", "Element", "EventTarget", "HtmlElement", "MessageEvent", "MouseEvent", "Node", "Range", "RequestInit", "RequestMode", "Response", "Selection", "Storage", "Window"] }
|
||||
web-sys = { version = "0.3.77", features = ["CustomEvent", "CustomEventInit", "DataTransfer", "Document", "DomRect", "DragEvent", "Element", "EventTarget", "HtmlElement", "KeyboardEvent", "MessageEvent", "MouseEvent", "Node", "NodeList", "Range", "RequestInit", "RequestMode", "Response", "Selection", "Storage", "Window"] }
|
||||
|
||||
[dependencies.leptos-tiptap]
|
||||
path = "../../../reference-code/leptos-tiptap"
|
||||
|
||||
+20
-20
@@ -48,33 +48,33 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
||||
|
||||
export interface InitOutput {
|
||||
readonly memory: WebAssembly.Memory;
|
||||
readonly mount_mindmap_shell: (a: any, b: any) => [number, number, number];
|
||||
readonly unmount_mindmap_shell: (a: number) => [number, number];
|
||||
readonly mount: (a: any, b: any) => [number, number, number];
|
||||
readonly mount_mindmap_shell: (a: any, b: any) => [number, number, number];
|
||||
readonly unmount: (a: number) => [number, number];
|
||||
readonly __wbg_intounderlyingsink_free: (a: number, b: number) => void;
|
||||
readonly intounderlyingsink_write: (a: number, b: any) => any;
|
||||
readonly intounderlyingsink_close: (a: number) => any;
|
||||
readonly intounderlyingsink_abort: (a: number, b: any) => any;
|
||||
readonly unmount_mindmap_shell: (a: number) => [number, number];
|
||||
readonly __wbg_intounderlyingbytesource_free: (a: number, b: number) => void;
|
||||
readonly intounderlyingbytesource_type: (a: number) => number;
|
||||
readonly intounderlyingbytesource_autoAllocateChunkSize: (a: number) => number;
|
||||
readonly intounderlyingbytesource_start: (a: number, b: any) => void;
|
||||
readonly intounderlyingbytesource_pull: (a: number, b: any) => any;
|
||||
readonly intounderlyingbytesource_cancel: (a: number) => void;
|
||||
readonly intounderlyingbytesource_pull: (a: number, b: any) => any;
|
||||
readonly intounderlyingbytesource_start: (a: number, b: any) => void;
|
||||
readonly intounderlyingbytesource_type: (a: number) => number;
|
||||
readonly __wbg_intounderlyingsink_free: (a: number, b: number) => void;
|
||||
readonly intounderlyingsink_abort: (a: number, b: any) => any;
|
||||
readonly intounderlyingsink_close: (a: number) => any;
|
||||
readonly intounderlyingsink_write: (a: number, b: any) => any;
|
||||
readonly __wbg_intounderlyingsource_free: (a: number, b: number) => void;
|
||||
readonly intounderlyingsource_pull: (a: number, b: any) => any;
|
||||
readonly intounderlyingsource_cancel: (a: number) => void;
|
||||
readonly wasm_bindgen__convert__closures_____invoke__h3a3182d847094e12: (a: number, b: number, c: any) => [number, number];
|
||||
readonly wasm_bindgen__convert__closures_____invoke__h0accad0f5d87788a: (a: number, b: number, c: any, d: any) => void;
|
||||
readonly wasm_bindgen__convert__closures_____invoke__h396914cf76a9e7a5: (a: number, b: number, c: any) => void;
|
||||
readonly wasm_bindgen__convert__closures_____invoke__had771ddc65647798: (a: number, b: number, c: any) => void;
|
||||
readonly wasm_bindgen__convert__closures_____invoke__h0abd2b2fe4652e2a: (a: number, b: number, c: any) => void;
|
||||
readonly wasm_bindgen__convert__closures_____invoke__h396914cf76a9e7a5_4: (a: number, b: number, c: any) => void;
|
||||
readonly wasm_bindgen__convert__closures_____invoke__hd90af689bc3e71bf: (a: number, b: number, c: any) => void;
|
||||
readonly wasm_bindgen__convert__closures_____invoke__h794babeffd4f821f: (a: number, b: number) => void;
|
||||
readonly wasm_bindgen__convert__closures_____invoke__h2b648e7ac8ec1fb5: (a: number, b: number) => void;
|
||||
readonly wasm_bindgen__convert__closures_____invoke__h0b7fb40a8610550c: (a: number, b: number) => void;
|
||||
readonly intounderlyingsource_pull: (a: number, b: any) => any;
|
||||
readonly wasm_bindgen__convert__closures_____invoke__h854f4676fa692669: (a: number, b: number, c: any) => [number, number];
|
||||
readonly wasm_bindgen__convert__closures_____invoke__h1a94ffe1b1ed8350: (a: number, b: number, c: any, d: any) => void;
|
||||
readonly wasm_bindgen__convert__closures_____invoke__h8eb6fe4c74941e76: (a: number, b: number, c: any) => void;
|
||||
readonly wasm_bindgen__convert__closures_____invoke__h62d2a368ae4b53af: (a: number, b: number, c: any) => void;
|
||||
readonly wasm_bindgen__convert__closures_____invoke__h11eca4a91ce748ff: (a: number, b: number, c: any) => void;
|
||||
readonly wasm_bindgen__convert__closures_____invoke__h62d2a368ae4b53af_4: (a: number, b: number, c: any) => void;
|
||||
readonly wasm_bindgen__convert__closures_____invoke__hc1d64d6259b30403: (a: number, b: number, c: any) => void;
|
||||
readonly wasm_bindgen__convert__closures_____invoke__hdc3cd9a3517d1395: (a: number, b: number) => void;
|
||||
readonly wasm_bindgen__convert__closures_____invoke__h4fb07e4e902e51ce: (a: number, b: number) => void;
|
||||
readonly wasm_bindgen__convert__closures_____invoke__hec6d5749a9244252: (a: number, b: number) => void;
|
||||
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
||||
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
||||
readonly __externref_table_alloc: () => number;
|
||||
|
||||
+37
-37
@@ -812,7 +812,7 @@ function __wbg_get_imports() {
|
||||
const a = state0.a;
|
||||
state0.a = 0;
|
||||
try {
|
||||
return wasm_bindgen__convert__closures_____invoke__h0accad0f5d87788a(a, state0.b, arg0, arg1);
|
||||
return wasm_bindgen__convert__closures_____invoke__h1a94ffe1b1ed8350(a, state0.b, arg0, arg1);
|
||||
} finally {
|
||||
state0.a = a;
|
||||
}
|
||||
@@ -1232,48 +1232,48 @@ function __wbg_get_imports() {
|
||||
}
|
||||
}, arguments); },
|
||||
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
||||
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1140, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
||||
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h396914cf76a9e7a5);
|
||||
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1011, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
|
||||
const ret = makeClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h8eb6fe4c74941e76);
|
||||
return ret;
|
||||
},
|
||||
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
||||
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1192, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
||||
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3a3182d847094e12);
|
||||
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1140, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
||||
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h62d2a368ae4b53af);
|
||||
return ret;
|
||||
},
|
||||
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
||||
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 969, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
|
||||
const ret = makeClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__had771ddc65647798);
|
||||
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1202, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
||||
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h854f4676fa692669);
|
||||
return ret;
|
||||
},
|
||||
__wbindgen_cast_0000000000000004: function(arg0, arg1) {
|
||||
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 1090, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
||||
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h0abd2b2fe4652e2a);
|
||||
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 1110, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
||||
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h11eca4a91ce748ff);
|
||||
return ret;
|
||||
},
|
||||
__wbindgen_cast_0000000000000005: function(arg0, arg1) {
|
||||
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 1140, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
||||
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h396914cf76a9e7a5_4);
|
||||
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h62d2a368ae4b53af_4);
|
||||
return ret;
|
||||
},
|
||||
__wbindgen_cast_0000000000000006: function(arg0, arg1) {
|
||||
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("KeyboardEvent")], shim_idx: 637, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
||||
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hd90af689bc3e71bf);
|
||||
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("KeyboardEvent")], shim_idx: 563, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
||||
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hc1d64d6259b30403);
|
||||
return ret;
|
||||
},
|
||||
__wbindgen_cast_0000000000000007: function(arg0, arg1) {
|
||||
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 1092, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
||||
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h794babeffd4f821f);
|
||||
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 1108, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
||||
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hdc3cd9a3517d1395);
|
||||
return ret;
|
||||
},
|
||||
__wbindgen_cast_0000000000000008: function(arg0, arg1) {
|
||||
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 1107, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
|
||||
const ret = makeClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h2b648e7ac8ec1fb5);
|
||||
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 1125, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
|
||||
const ret = makeClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h4fb07e4e902e51ce);
|
||||
return ret;
|
||||
},
|
||||
__wbindgen_cast_0000000000000009: function(arg0, arg1) {
|
||||
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 1143, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
||||
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h0b7fb40a8610550c);
|
||||
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hec6d5749a9244252);
|
||||
return ret;
|
||||
},
|
||||
__wbindgen_cast_000000000000000a: function(arg0) {
|
||||
@@ -1316,47 +1316,47 @@ function __wbg_get_imports() {
|
||||
};
|
||||
}
|
||||
|
||||
function wasm_bindgen__convert__closures_____invoke__h794babeffd4f821f(arg0, arg1) {
|
||||
wasm.wasm_bindgen__convert__closures_____invoke__h794babeffd4f821f(arg0, arg1);
|
||||
function wasm_bindgen__convert__closures_____invoke__hdc3cd9a3517d1395(arg0, arg1) {
|
||||
wasm.wasm_bindgen__convert__closures_____invoke__hdc3cd9a3517d1395(arg0, arg1);
|
||||
}
|
||||
|
||||
function wasm_bindgen__convert__closures_____invoke__h2b648e7ac8ec1fb5(arg0, arg1) {
|
||||
wasm.wasm_bindgen__convert__closures_____invoke__h2b648e7ac8ec1fb5(arg0, arg1);
|
||||
function wasm_bindgen__convert__closures_____invoke__h4fb07e4e902e51ce(arg0, arg1) {
|
||||
wasm.wasm_bindgen__convert__closures_____invoke__h4fb07e4e902e51ce(arg0, arg1);
|
||||
}
|
||||
|
||||
function wasm_bindgen__convert__closures_____invoke__h0b7fb40a8610550c(arg0, arg1) {
|
||||
wasm.wasm_bindgen__convert__closures_____invoke__h0b7fb40a8610550c(arg0, arg1);
|
||||
function wasm_bindgen__convert__closures_____invoke__hec6d5749a9244252(arg0, arg1) {
|
||||
wasm.wasm_bindgen__convert__closures_____invoke__hec6d5749a9244252(arg0, arg1);
|
||||
}
|
||||
|
||||
function wasm_bindgen__convert__closures_____invoke__h396914cf76a9e7a5(arg0, arg1, arg2) {
|
||||
wasm.wasm_bindgen__convert__closures_____invoke__h396914cf76a9e7a5(arg0, arg1, arg2);
|
||||
function wasm_bindgen__convert__closures_____invoke__h8eb6fe4c74941e76(arg0, arg1, arg2) {
|
||||
wasm.wasm_bindgen__convert__closures_____invoke__h8eb6fe4c74941e76(arg0, arg1, arg2);
|
||||
}
|
||||
|
||||
function wasm_bindgen__convert__closures_____invoke__had771ddc65647798(arg0, arg1, arg2) {
|
||||
wasm.wasm_bindgen__convert__closures_____invoke__had771ddc65647798(arg0, arg1, arg2);
|
||||
function wasm_bindgen__convert__closures_____invoke__h62d2a368ae4b53af(arg0, arg1, arg2) {
|
||||
wasm.wasm_bindgen__convert__closures_____invoke__h62d2a368ae4b53af(arg0, arg1, arg2);
|
||||
}
|
||||
|
||||
function wasm_bindgen__convert__closures_____invoke__h0abd2b2fe4652e2a(arg0, arg1, arg2) {
|
||||
wasm.wasm_bindgen__convert__closures_____invoke__h0abd2b2fe4652e2a(arg0, arg1, arg2);
|
||||
function wasm_bindgen__convert__closures_____invoke__h11eca4a91ce748ff(arg0, arg1, arg2) {
|
||||
wasm.wasm_bindgen__convert__closures_____invoke__h11eca4a91ce748ff(arg0, arg1, arg2);
|
||||
}
|
||||
|
||||
function wasm_bindgen__convert__closures_____invoke__h396914cf76a9e7a5_4(arg0, arg1, arg2) {
|
||||
wasm.wasm_bindgen__convert__closures_____invoke__h396914cf76a9e7a5_4(arg0, arg1, arg2);
|
||||
function wasm_bindgen__convert__closures_____invoke__h62d2a368ae4b53af_4(arg0, arg1, arg2) {
|
||||
wasm.wasm_bindgen__convert__closures_____invoke__h62d2a368ae4b53af_4(arg0, arg1, arg2);
|
||||
}
|
||||
|
||||
function wasm_bindgen__convert__closures_____invoke__hd90af689bc3e71bf(arg0, arg1, arg2) {
|
||||
wasm.wasm_bindgen__convert__closures_____invoke__hd90af689bc3e71bf(arg0, arg1, arg2);
|
||||
function wasm_bindgen__convert__closures_____invoke__hc1d64d6259b30403(arg0, arg1, arg2) {
|
||||
wasm.wasm_bindgen__convert__closures_____invoke__hc1d64d6259b30403(arg0, arg1, arg2);
|
||||
}
|
||||
|
||||
function wasm_bindgen__convert__closures_____invoke__h3a3182d847094e12(arg0, arg1, arg2) {
|
||||
const ret = wasm.wasm_bindgen__convert__closures_____invoke__h3a3182d847094e12(arg0, arg1, arg2);
|
||||
function wasm_bindgen__convert__closures_____invoke__h854f4676fa692669(arg0, arg1, arg2) {
|
||||
const ret = wasm.wasm_bindgen__convert__closures_____invoke__h854f4676fa692669(arg0, arg1, arg2);
|
||||
if (ret[1]) {
|
||||
throw takeFromExternrefTable0(ret[0]);
|
||||
}
|
||||
}
|
||||
|
||||
function wasm_bindgen__convert__closures_____invoke__h0accad0f5d87788a(arg0, arg1, arg2, arg3) {
|
||||
wasm.wasm_bindgen__convert__closures_____invoke__h0accad0f5d87788a(arg0, arg1, arg2, arg3);
|
||||
function wasm_bindgen__convert__closures_____invoke__h1a94ffe1b1ed8350(arg0, arg1, arg2, arg3) {
|
||||
wasm.wasm_bindgen__convert__closures_____invoke__h1a94ffe1b1ed8350(arg0, arg1, arg2, arg3);
|
||||
}
|
||||
|
||||
|
||||
|
||||
BIN
Binary file not shown.
Vendored
+20
-20
@@ -1,33 +1,33 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const memory: WebAssembly.Memory;
|
||||
export const mount_mindmap_shell: (a: any, b: any) => [number, number, number];
|
||||
export const unmount_mindmap_shell: (a: number) => [number, number];
|
||||
export const mount: (a: any, b: any) => [number, number, number];
|
||||
export const mount_mindmap_shell: (a: any, b: any) => [number, number, number];
|
||||
export const unmount: (a: number) => [number, number];
|
||||
export const __wbg_intounderlyingsink_free: (a: number, b: number) => void;
|
||||
export const intounderlyingsink_write: (a: number, b: any) => any;
|
||||
export const intounderlyingsink_close: (a: number) => any;
|
||||
export const intounderlyingsink_abort: (a: number, b: any) => any;
|
||||
export const unmount_mindmap_shell: (a: number) => [number, number];
|
||||
export const __wbg_intounderlyingbytesource_free: (a: number, b: number) => void;
|
||||
export const intounderlyingbytesource_type: (a: number) => number;
|
||||
export const intounderlyingbytesource_autoAllocateChunkSize: (a: number) => number;
|
||||
export const intounderlyingbytesource_start: (a: number, b: any) => void;
|
||||
export const intounderlyingbytesource_pull: (a: number, b: any) => any;
|
||||
export const intounderlyingbytesource_cancel: (a: number) => void;
|
||||
export const intounderlyingbytesource_pull: (a: number, b: any) => any;
|
||||
export const intounderlyingbytesource_start: (a: number, b: any) => void;
|
||||
export const intounderlyingbytesource_type: (a: number) => number;
|
||||
export const __wbg_intounderlyingsink_free: (a: number, b: number) => void;
|
||||
export const intounderlyingsink_abort: (a: number, b: any) => any;
|
||||
export const intounderlyingsink_close: (a: number) => any;
|
||||
export const intounderlyingsink_write: (a: number, b: any) => any;
|
||||
export const __wbg_intounderlyingsource_free: (a: number, b: number) => void;
|
||||
export const intounderlyingsource_pull: (a: number, b: any) => any;
|
||||
export const intounderlyingsource_cancel: (a: number) => void;
|
||||
export const wasm_bindgen__convert__closures_____invoke__h3a3182d847094e12: (a: number, b: number, c: any) => [number, number];
|
||||
export const wasm_bindgen__convert__closures_____invoke__h0accad0f5d87788a: (a: number, b: number, c: any, d: any) => void;
|
||||
export const wasm_bindgen__convert__closures_____invoke__h396914cf76a9e7a5: (a: number, b: number, c: any) => void;
|
||||
export const wasm_bindgen__convert__closures_____invoke__had771ddc65647798: (a: number, b: number, c: any) => void;
|
||||
export const wasm_bindgen__convert__closures_____invoke__h0abd2b2fe4652e2a: (a: number, b: number, c: any) => void;
|
||||
export const wasm_bindgen__convert__closures_____invoke__h396914cf76a9e7a5_4: (a: number, b: number, c: any) => void;
|
||||
export const wasm_bindgen__convert__closures_____invoke__hd90af689bc3e71bf: (a: number, b: number, c: any) => void;
|
||||
export const wasm_bindgen__convert__closures_____invoke__h794babeffd4f821f: (a: number, b: number) => void;
|
||||
export const wasm_bindgen__convert__closures_____invoke__h2b648e7ac8ec1fb5: (a: number, b: number) => void;
|
||||
export const wasm_bindgen__convert__closures_____invoke__h0b7fb40a8610550c: (a: number, b: number) => void;
|
||||
export const intounderlyingsource_pull: (a: number, b: any) => any;
|
||||
export const wasm_bindgen__convert__closures_____invoke__h854f4676fa692669: (a: number, b: number, c: any) => [number, number];
|
||||
export const wasm_bindgen__convert__closures_____invoke__h1a94ffe1b1ed8350: (a: number, b: number, c: any, d: any) => void;
|
||||
export const wasm_bindgen__convert__closures_____invoke__h8eb6fe4c74941e76: (a: number, b: number, c: any) => void;
|
||||
export const wasm_bindgen__convert__closures_____invoke__h62d2a368ae4b53af: (a: number, b: number, c: any) => void;
|
||||
export const wasm_bindgen__convert__closures_____invoke__h11eca4a91ce748ff: (a: number, b: number, c: any) => void;
|
||||
export const wasm_bindgen__convert__closures_____invoke__h62d2a368ae4b53af_4: (a: number, b: number, c: any) => void;
|
||||
export const wasm_bindgen__convert__closures_____invoke__hc1d64d6259b30403: (a: number, b: number, c: any) => void;
|
||||
export const wasm_bindgen__convert__closures_____invoke__hdc3cd9a3517d1395: (a: number, b: number) => void;
|
||||
export const wasm_bindgen__convert__closures_____invoke__h4fb07e4e902e51ce: (a: number, b: number) => void;
|
||||
export const wasm_bindgen__convert__closures_____invoke__hec6d5749a9244252: (a: number, b: number) => void;
|
||||
export const __wbindgen_malloc: (a: number, b: number) => number;
|
||||
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
||||
export const __externref_table_alloc: () => number;
|
||||
|
||||
@@ -132,7 +132,6 @@ impl EditorButtonProps {
|
||||
/// - data-testid
|
||||
/// - tooltip(data-tooltip)
|
||||
/// - onClick 阻止默认并调用回调
|
||||
#[component]
|
||||
pub(crate) fn EditorButton(props: EditorButtonProps) -> impl IntoView {
|
||||
let on_click = props.on_click.clone();
|
||||
let click_handler = move |event: ev::MouseEvent| {
|
||||
|
||||
@@ -9,10 +9,9 @@
|
||||
//! 这些函数替代原 lib.rs / overlays.rs / view 中的手写 Escape keydown 和
|
||||
//! document mousedown listener,对齐 Radix DismissableLayer + FocusScope 语义。
|
||||
|
||||
use std::{cell::RefCell, rc::Rc};
|
||||
use wasm_bindgen::{closure::Closure, JsCast};
|
||||
use web_sys::{
|
||||
window, Document, Element, EventTarget, HtmlElement, KeyboardEvent, MouseEvent,
|
||||
};
|
||||
use web_sys::{window, Element, HtmlElement, KeyboardEvent, MouseEvent};
|
||||
|
||||
use crate::editor_runtime::dom_events::target_element;
|
||||
|
||||
@@ -24,18 +23,20 @@ pub(crate) fn register_dismissable_layer(
|
||||
container_id: &str,
|
||||
on_dismiss: Box<dyn FnMut()>,
|
||||
) -> DismissHandle {
|
||||
let dismiss = std::cell::RefCell::new(on_dismiss);
|
||||
let dismiss = Rc::new(RefCell::new(on_dismiss));
|
||||
let win = window();
|
||||
let doc = win.as_ref().and_then(|w| w.document());
|
||||
|
||||
// Escape keydown(捕获阶段,确保在 Tiptap 之前处理)
|
||||
let container_id_esc = container_id.to_string();
|
||||
let doc_esc = doc.clone();
|
||||
let dismiss_for_esc = Rc::clone(&dismiss);
|
||||
let dismiss_esc = Closure::wrap(Box::new(move |event: KeyboardEvent| {
|
||||
if event.key() != "Escape" {
|
||||
return;
|
||||
}
|
||||
// 只处理 container 可见的情况
|
||||
if let Some(ref doc) = doc {
|
||||
if let Some(ref doc) = doc_esc {
|
||||
if let Ok(Some(el)) = doc.query_selector(&format!("#{container_id_esc}")) {
|
||||
if !is_element_visible(&el) {
|
||||
return;
|
||||
@@ -44,7 +45,7 @@ pub(crate) fn register_dismissable_layer(
|
||||
event.stop_propagation();
|
||||
}
|
||||
}
|
||||
if let Ok(mut f) = dismiss.try_borrow_mut() {
|
||||
if let Ok(mut f) = dismiss_for_esc.try_borrow_mut() {
|
||||
f();
|
||||
}
|
||||
}) as Box<dyn FnMut(_)>);
|
||||
@@ -59,6 +60,7 @@ pub(crate) fn register_dismissable_layer(
|
||||
|
||||
// 点击外部 handler(mousedown,因为 click 可能在 focus 转移之后才触发)
|
||||
let container_id_click = container_id.to_string();
|
||||
let dismiss_for_click = Rc::clone(&dismiss);
|
||||
let dismiss_click = Closure::wrap(Box::new(move |event: MouseEvent| {
|
||||
let target = event.target();
|
||||
let Some(target_el) = target.and_then(target_element) else {
|
||||
@@ -72,7 +74,7 @@ pub(crate) fn register_dismissable_layer(
|
||||
if let Ok(Some(_)) = target_el.closest(".ProseMirror") {
|
||||
return;
|
||||
}
|
||||
if let Ok(mut f) = dismiss.try_borrow_mut() {
|
||||
if let Ok(mut f) = dismiss_for_click.try_borrow_mut() {
|
||||
f();
|
||||
}
|
||||
}) as Box<dyn FnMut(_)>);
|
||||
|
||||
@@ -49,6 +49,7 @@ pub(crate) const ICON_MAP: &[(&str, &str)] = &[
|
||||
("autorenew", "autorenew"),
|
||||
("link", "link"),
|
||||
("arrow_outward", "arrow_outward"),
|
||||
("arrow_drop_down", "arrow_drop_down"),
|
||||
("history", "history"),
|
||||
("chat", "chat"),
|
||||
("palette", "palette"),
|
||||
@@ -76,7 +77,7 @@ pub(crate) fn icon_ligature(name: &str) -> Option<&'static str> {
|
||||
///
|
||||
/// The `name` parameter must be a Material Symbols ligature name
|
||||
/// (e.g. `"auto_awesome"`, `"chevron_right"`, `"looks_one"`).
|
||||
pub(crate) fn material_icon(name: &str) -> impl IntoView {
|
||||
pub(crate) fn material_icon(name: &'static str) -> impl IntoView {
|
||||
view! {
|
||||
<span class="material-symbols-outlined" aria-hidden="true">{name}</span>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user