Debian Codegraph @

addons/html_editor/static/src/main/link/link_selection_odoo_plugin.js

raw
1 import { Plugin } from "@html_editor/plugin";
2 import { isBlock } from "@html_editor/utils/blocks";
3
4 export class OdooLinkSelectionPlugin extends Plugin {
5 static id = "odooLinkSelection";
6 /** @type {import("plugins").EditorResources} */
7 resources = {
8 ineligible_link_for_zwnbsp_predicates: [
9 (link) =>
10 [link, ...link.querySelectorAll("*")].some(
11 (el) => el.nodeName === "IMG" || isBlock(el)
12 ),
13 (link) => link.matches("a.nav-link"),
14 ],
15 ineligible_link_for_selection_indication_predicates: (link) => link.matches(".btn"),
16 };
17 }