---
to: <%- config.kebabCaseName -%>.extension.ts
---
import { extensions } from '<%- builderPackage -%>'
import { LAYOUT } from '@wix/react-component-schema';
import { withEditorElementDefaults } from '@wix/react-component-utils';
import merge from 'deepmerge';
import { editorElement } from './<%- config.kebabCaseName -%>.generated';
import { defaultProps } from './<%- config.kebabCaseName -%>.props';
import componentUrl from './component.tsx?url';
import componentPreviewUrl from './component.preview.tsx?url';

const editorElementWithDefaults = withEditorElementDefaults(editorElement, defaultProps);

export default extensions.editorReactComponent({
  id: '<%- config.id -%>',
  type: '<%- config.type -%>',
  displayName: '<%- config.name -%>',
  description: '<%- config.description -%>',
  editorElement: merge(
    editorElementWithDefaults,
    {
      layout: {
        resizeDirection: LAYOUT.RESIZE_DIRECTION.horizontalAndVertical,
        contentResizeDirection: LAYOUT.CONTENT_RESIZE_DIRECTION.vertical,
      },
    }
  ),
  installation: {
    initialSize: {
      width: {
        sizingType: LAYOUT.SIZING_TYPE.pixels,
        pixels: 250,
      },
      height: {
        sizingType: LAYOUT.SIZING_TYPE.content,
      },
    },
  },
  resources: {
    client: {
      componentUrl,
    },
    editor: {
      componentUrl: componentPreviewUrl,
    },
  },
});
