UNPKG

on-codemerge

Version:

A WYSIWYG editor for on-codemerge is a user-friendly interface that allows users to edit and view their code in real time, exactly as it will appear in the final product

51 lines (50 loc) 1.61 kB
/*! on-codemerge v1.3.1 @author Pavel Kuzmin @license MIT @homepage https://s00d.github.io/on-codemerge/ @repository git+https://github.com/s00d/on-codemerge.git Copyright (c) 2026 Pavel Kuzmin - Built on 2026-07-02T13:39:17.947Z */ var o = Object.defineProperty; var p = (u, t, l) => t in u ? o(u, t, { enumerable: !0, configurable: !0, writable: !0, value: l }) : u[t] = l; var e = (u, t, l) => p(u, typeof t != "symbol" ? t + "" : t, l); import { PopupManager as s } from "../../../core/ui/PopupManager.mjs"; class c { constructor(t) { e(this, "popup"); e(this, "callback", null); e(this, "url", ""); this.popup = new s(t, { title: t.t("Insert YouTube Video"), className: "youtube-video-menu", closeOnClickOutside: !0, buttons: [ { label: t.t("Cancel"), variant: "secondary", onClick: () => this.popup.hide() }, { label: t.t("Insert"), variant: "primary", onClick: () => this.handleSubmit() } ], items: [ { type: "input", id: "youtube-url", label: t.t("YouTube Video URL"), placeholder: "https://www.youtube.com/watch?v=...", onChange: (l) => this.url = l.toString() } ] }); } handleSubmit() { this.callback && (this.callback(this.url), this.popup.hide()); } show(t) { this.callback = t, this.popup.show(), this.popup.setFocus("youtube-url"); } destroy() { this.popup.destroy(), this.popup = null, this.callback = null; } } export { c as YouTubeVideoMenu };