import { nodeTypeFactory } from "../../../../utils/schema.js";
import { VideoAttr, videoNodeName } from "./const.js";
export const videoType = nodeTypeFactory(videoNodeName);
export function serializeNodeToString(node) {
    const service = node.attrs[VideoAttr.Service];
    const videoId = node.attrs[VideoAttr.VideoID];
    return `@[${service}](${videoId})`;
}
export function createViewStub(node) {
    const elem = document.createElement('span');
    elem.setAttribute(VideoAttr.Service, node.attrs[VideoAttr.Service]);
    elem.setAttribute(VideoAttr.VideoID, node.attrs[VideoAttr.VideoID]);
    elem.contentEditable = 'false';
    elem.textContent = serializeNodeToString(node);
    return elem;
}
//# sourceMappingURL=utils.js.map
