kode-team / easylogic.studio

Fantastic Web Design Tool
https://editor.easylogic.studio
MIT License
495 stars 54 forks source link

Support module to embed all edtior feature #38

Closed easylogic closed 3 years ago

easylogic commented 4 years ago

에디터 자체를 모듈로서 임베드 할 수 있도록 한다.

  1. editor 객체를 글로벌 에서 instance 베이스로 변경해야함
easylogic commented 4 years ago

모듈 하나에 거대한 공용의 자료 공유 형태가 필요한데.

  1. $store - 이벤트 정의 , 메세지 전달용
  2. $editor - 글로벌 데이타 정의용
easylogic commented 4 years ago

외부 주입 모듈 만들기


export default {
    command: 'setAttribute',
    title: 'Set Attribute for Item',
    description: '',
    execute (editor, a, b, c ) {
            editor.emit('refresh', a, b, c);
    }
}

// shortcuts 
export default [
    { key: 'cmd+m', command: `setAttribute`},
    { key: 'cmd+m', command: `setAttribute`},
    { key: 'cmd+m', command: `setAttribute`},
    { key: 'cmd+m', command: `setAttribute`},
    { key: 'cmd+m', command: `setAttribute`},
]

editor.commands.registerCommand('name', command.execute)
editor.components.registerComponent('name', CubeLayer);
editor.shortcuts.registerShortcut({
    key: 'cmd+m',
    when: 'textInputFocus',  // 상태 정의가 필요하군요. vscode 를 참고해봅시다. 
    command : `command's name`
}); 
easylogic commented 4 years ago
easylogic commented 4 years ago

이걸 사전에 정의할려면 render 시점을 뒤로 할 수 있도록 해야겠군.

easylogic commented 3 years ago

이건 안하는걸로 하자.

에디터를 하나의 단위로 만들지 않으면 인터랙션을 제어하기도 힘들고

store 를 제어하기도 힘들다.

그냥 화면 하나 단위로 하자.