export default (grapesjs) => {
  grapesjs.plugins.add('plugin-sp-config', (editor, opt = {}) => {
    const config = editor.getConfig();

    // 不显示 toolbar
    config.showToolbar = false;
    
    config.protectedCss += " *:focus { outline-offset: 2px; outline-color: rgba(0,132,255,0.2);} [data-gjs-type='wrapper'] .no-events > * {pointer-events: none} [loader=in] {overflow: hidden;} .loader{position: absolute; top: 0; right:0; bottom: 0; left: 0; z-index: 99; display: flex;justify-content: center;align-items: center; background-color: rgba(255,255,255,0.2);} .loader>.dot {margin: 5px; width: 24px; height: 24px; flex-shrink: 0; background: #0084ff; border-radius: 100%; display: inline-block; animation: slide 1s infinite;} .loader>.dot:nth-child(1) { animation-delay: 0.1s; background: #0084ff; } .loader>.dot:nth-child(2) { animation-delay: 0.2s; background: #339cff; } .loader>.dot:nth-child(3) { animation-delay: 0.3s; background: #66b5ff; } .loader>.dot:nth-child(4) { animation-delay: 0.4s; background: #99ceff; } .loader>.dot:nth-child(5) { animation-delay: 0.5s; background: #cce6ff; } @-moz-keyframes slide { 0% { transform: scale(1); } 50% { opacity: 0.3; transform: scale(1.6); } 100% { transform: scale(1); }  } @-webkit-keyframes slide { 0% { transform: scale(1); } 50% { opacity: 0.3; transform: scale(1.6); } 100% { transform: scale(1); }  } @-o-keyframes slide { 0% { transform: scale(1); } 50% { opacity: 0.3; transform: scale(1.6); } 100% { transform: scale(1); }  } @keyframes slide { 0% { transform: scale(1); } 50% { opacity: 0.3; transform: scale(1.6); } 100% { transform: scale(1); } } ";
  
    // 设置组件拖动模式为 'absolute'
    config.dragMode = 'absolute';
    editor.getModel().set('dmode', 'absolute');
  });
}
