refactor(core): use lit customelement decorator (#7560)

Close: [BS-585](https://linear.app/affine-design/issue/BS-585/更新affine侧lit自定义yuan素的写法)

### What changes:
- using `@customElement(xxx)` instead of `window.customElements.define(xxx)`
- remove `registerOutlinePanelComponents` and `registerFramePanelComponents`, Related PR https://github.com/toeverything/blocksuite/pull/7700
This commit is contained in:
L-Sun
2024-07-25 07:45:41 +00:00
parent dd6901fe15
commit 662a3d4b76
2 changed files with 7 additions and 5 deletions
@@ -1,8 +1,10 @@
import { LitElement, type TemplateResult } from 'lit';
import { customElement } from 'lit/decorators.js';
import React, { createElement, type ReactNode } from 'react';
import { createComponent } from './create-component';
@customElement('affine-lit-template-wrapper')
export class LitTemplateWrapper extends LitElement {
static override get properties() {
return {
@@ -20,8 +22,6 @@ export class LitTemplateWrapper extends LitElement {
}
}
window.customElements.define('affine-lit-template-wrapper', LitTemplateWrapper);
const TemplateWrapper = createComponent({
elementClass: LitTemplateWrapper,
react: React,