How does the prompt for parameters get called for Image?
Image.attachCommand("insertImage", type => ({
label: "Insert image",
run(pm, src, alt, title) {
return pm.tr.replaceSelection(type.create({src, title, alt})).apply(andScroll)
},
params: [
{name: "Image URL", type: "text"},
{name: "Description / alternative text", type: "text", default: ""},
{name: "Title", type: "text", default: ""}
],
select(pm) {
return pm.doc.path(pm.selection.from.path).type.canContainType(type)
},
menuGroup: "inline",
menuRank: 40,
prefillParams(pm) {
let {node} = pm.selection
if (node && node.type == type)
return [node.attrs.src, node.attrs.alt, node.attrs.title]
}
}))