// customPanel/fallbackPalette.js
export default class FallbackPalette {
    constructor(create, elementFactory, palette, translate) {
      this.create = create
      this.elementFactory = elementFactory
      this.translate = translate
  
      palette.registerProvider(this)
    }
  
    getPaletteEntries() {
      return {
        'create.start-event': {
          group: 'tool',
          className: 'bpmn-icon-start-event-none',
          title: '创建开始事件',
          action: {
            click: (event) => {
              const shape = this.elementFactory.createShape({
                type: 'bpmn:StartEvent'
              })
              this.create.start(event, shape)
            }
          }
        },
        'create.task': {
          group: 'tool',
          className: 'bpmn-icon-task',
          title: '创建任务',
          action: {
            click: (event) => {
              const shape = this.elementFactory.createShape({
                type: 'bpmn:Task'
              })
              this.create.start(event, shape)
            }
          }
        }
      }
    }
  }
  
  FallbackPalette.$inject = ['create', 'elementFactory', 'palette', 'translate']