tippy: Use namespace import for tippy.js.

Names like “delegate”, “Instance”, “Placement”, “Props”, and
“ReferenceElement” are much too generic to make sense as named
imports.

The downside is that we now need to write tippy.default(…) instead of
tippy(…) (because ES module namespace objects cannot be callable), but
that cost is worthwhile.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2024-05-30 12:51:29 -07:00
committed by Tim Abbott
parent 87d36d24c9
commit 9b711cda20
24 changed files with 131 additions and 135 deletions

View File

@@ -1,5 +1,5 @@
import $ from "jquery";
import {delegate} from "tippy.js";
import * as tippy from "tippy.js";
import render_send_later_popover from "../templates/popovers/send_later_popover.hbs";
import render_send_later_modal from "../templates/send_later_modal.hbs";
@@ -142,7 +142,7 @@ export function toggle() {
}
export function initialize() {
delegate("body", {
tippy.delegate("body", {
...popover_menus.default_popover_props,
target: "#send_later i",
onUntrigger() {