/**
 * register `activate` and `deactivate` for this whole extension
 */
import Localize, {
  localize
} from '@datawind/extension-localize'

import {
  Rect,
  RectSettings,
  Ellipse,
  EllipseSettings,
  Line,
  LineSettings,
  Arrow,
  ArrowSettings,
  PlusSign,
  PlusSignSettings,
  MinusSign,
  MinusSignSettings,
  TimesSign,
  TimesSignSettings,
  DivisionSign,
  DivisionSignSettings,
  EqualSign,
  EqualSignSettings,
  LeftParenthesis,
  LeftParenthesisSettings,
  RightParenthesis,
  RightParenthesisSettings,
} from 'src/components'

import { ContributeContext } from '@datawind/extension-context'
export const activate = (context: ContributeContext) => {
  Localize.init(context.language)
  context.dashboardComponentRenderer.register({
    id: '@datawind/extension-graphics-component',
    name: localize("extension.Form&Sign"),
    children: [
      {
        id: '@datawind/extension-rect-component',
        name: localize("extension.rect"),
        Component: Rect,
        settings: RectSettings(),
      },
      {
        id: '@datawind/extension-ellipse-component',
        name: localize("extension.ellipse"),
        Component: Ellipse,
        settings: EllipseSettings(),
      },
      {
        id: '@datawind/extension-line-component',
        name: localize("extension.line"),
        Component: Line,
        settings: LineSettings(),
      },
      {
        id: "@datawind/extension-arrow-component",
        name: localize("extension.arrow"),
        Component: Arrow,
        settings: ArrowSettings(),
      },
      {
        id: "@datawind/extension-plusSign-component",
        name: localize("extension.plusSign"),
        Component: PlusSign,
        settings: PlusSignSettings(),
      },
      {
        id: "@datawind/extension-minusSign-component",
        name: localize("extension.minusSign"),
        Component: MinusSign,
        settings: MinusSignSettings(),
      },
      {
        id: "@datawind/extension-timesSign-component",
        name: localize("extension.timesSign"),
        Component: TimesSign,
        settings: TimesSignSettings(),
      },
      {
        id: "@datawind/extension-divisionSign-component",
        name: localize("extension.divisionSign"),
        Component: DivisionSign,
        settings: DivisionSignSettings(),
      },
      {
        id: "@datawind/extension-equalSign-component",
        name: localize("extension.equalSign"),
        Component: EqualSign,
        settings: EqualSignSettings(),
      },
      {
        id: "@datawind/extension-leftParenthesis-component",
        name: localize("extension.leftParenthesis"),
        Component: LeftParenthesis,
        settings: LeftParenthesisSettings(),
      },
      {
        id: "@datawind/extension-rightParenthesis-component",
        name: localize("extension.rightParenthesis"),
        Component: RightParenthesis,
        settings: RightParenthesisSettings(),
      }
    ]
  })
}
export const deactivate = () => { }