import { ReactRenderer as r } from "../../../../../node_modules/.pnpm/@tiptap_react@2.14.0_@tiptap_core@2.14.0_@tiptap_pm@2.14.0__@tiptap_pm@2.14.0_react-dom_ed8bf96066084acdc2699d834a628075/node_modules/@tiptap/react/dist/index.js";
import o from "../../../../../node_modules/.pnpm/tippy.js@6.3.7/node_modules/tippy.js/dist/tippy.esm.js";
import i from "./DatasourceFieldList.js";
const d = {
  char: "{{",
  // Allow all previous characters
  allowedPrefixes: null,
  render: () => {
    let t, n;
    return {
      onStart: (e) => {
        t = new r(i, {
          props: e,
          editor: e.editor
        }), e.clientRect && (n = o("body", {
          getReferenceClientRect: e.clientRect,
          appendTo: () => document.body,
          content: t.element,
          showOnCreate: !0,
          interactive: !0,
          trigger: "manual",
          placement: "bottom-start"
        }));
      },
      onUpdate(e) {
        t.updateProps(e), e.clientRect && n[0].setProps({
          getReferenceClientRect: e.clientRect
        });
      },
      onKeyDown(e) {
        return e.event.key === "Escape" ? (n[0].hide(), !0) : t.ref?.onKeyDown(e);
      },
      onExit() {
        n[0].destroy(), t.destroy();
      }
    };
  }
};
export {
  d as default
};
//# sourceMappingURL=datasourceFieldSuggestions.js.map
