Support handling CustomEvents in LiveView

I don’t like solutions that rely on magic separators like : or ,, because they always restrict what event names can be accepted. As I don’t think there are any restrictions on event names, I can already see bug report incoming from someone, e.g., having a new CustomEvent("foo:bar"). This is of course also an issue with phx-ce-foo="bar" as not all symbols are allowed in attribute names…

Maybe instead we could do a <my-custom-element phx-custom-events={JS.custom_event_mapping(%{"foo:bar" => "foo-bar"})}>. That is then json encoded and decoded on the client. That would have no restrictions on event names. I’m not saying that the JS module is the perfect place for this, it’s just to demonstrate the idea.