File manager - Edit - /var/www/payraty/helpdesk/common/resources/client/text-editor/extensions/embed.ts
Back
import {mergeAttributes, Node} from '@tiptap/react'; declare module '@tiptap/core' { interface Commands<ReturnType> { embed: { setEmbed: (options: {src: string}) => ReturnType; }; } } export const Embed = Node.create({ name: 'embed', group: 'block', atom: true, addAttributes() { return { allowfullscreen: { default: null, }, allow: { default: 'autoplay; fullscreen; picture-in-picture', }, src: { default: null, }, }; }, parseHTML() { return [ { tag: 'iframe', }, ]; }, renderHTML({HTMLAttributes}) { return [ 'iframe', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), ]; }, addCommands() { return { setEmbed: options => ({commands}) => { return commands.insertContent({ type: this.name, attrs: options, }); }, }; }, });
| ver. 1.4 |
Github
|
.
| PHP 8.3.30 | Generation time: 0 |
proxy
|
phpinfo
|
Settings