mirror of https://github.com/artf/grapesjs.git
nocodeframeworkdrag-and-dropsite-buildersite-generatortemplate-builderui-builderweb-builderweb-builder-frameworkwebsite-builderno-codepage-builder
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
683 B
24 lines
683 B
import Component from './Component';
|
|
import { toLowerCase } from '../../utils/mixins';
|
|
import { DraggableDroppableFn } from './types';
|
|
|
|
export const type = 'head';
|
|
const droppable = ['title', 'style', 'base', 'link', 'meta', 'script', 'noscript'];
|
|
|
|
export default class ComponentHead extends Component {
|
|
get defaults() {
|
|
return {
|
|
// @ts-ignore
|
|
...super.defaults,
|
|
type,
|
|
tagName: type,
|
|
draggable: false,
|
|
highlightable: false,
|
|
droppable: (({ tagName }) => !tagName || droppable.includes(toLowerCase(tagName))) as DraggableDroppableFn,
|
|
};
|
|
}
|
|
|
|
static isComponent(el: HTMLElement) {
|
|
return toLowerCase(el.tagName) === type;
|
|
}
|
|
}
|
|
|