Some checks failed
📦 Build / build (push) Has been cancelled
🧪 CI Test / test shard (1/4) (push) Has been cancelled
🧪 CI Test / test shard (2/4) (push) Has been cancelled
🧪 CI Test / test shard (3/4) (push) Has been cancelled
🧪 CI Test / test shard (4/4) (push) Has been cancelled
🧪 CI Test / test (push) Has been cancelled
🧪 CI Test / eslint (push) Has been cancelled
🧪 CI Test / typecheck (push) Has been cancelled
🔫 Sync to Pro / dispatch-sync (push) Has been cancelled
🔮 Sync Mirror / sync (push) Has been cancelled
45 lines
1.7 KiB
TypeScript
45 lines
1.7 KiB
TypeScript
import { Disposable, Inject } from '@univerjs/core';
|
|
import { ComponentManager } from '@univerjs/ui';
|
|
import { AIButton, FloatButton } from '../components/FloatButton';
|
|
import { ImageDemo } from '../components/Image';
|
|
import { RangeLoading } from '../components/RangeLoading';
|
|
// @ts-ignore
|
|
// import VueComponent from '../components/VueComponent.vue';
|
|
// import { CounterComponent } from '../components/WebComponent';
|
|
import { WatermarkPanel } from '../views/watermark/WatermarkPanel';
|
|
import { WatermarkPanelFooter } from '../views/watermark/WatermarkPanelFooter';
|
|
|
|
export const WATERMARK_PANEL = 'WATERMARK_PANEL';
|
|
export const WATERMARK_PANEL_FOOTER = 'WATERMARK_PANEL_FOOTER';
|
|
|
|
export class ComponentsController extends Disposable {
|
|
constructor(
|
|
@Inject(ComponentManager) private readonly _componentManager: ComponentManager
|
|
) {
|
|
super();
|
|
|
|
this._registerComponents();
|
|
}
|
|
|
|
private _registerComponents(): void {
|
|
([
|
|
['ImageDemo', ImageDemo],
|
|
['RangeLoading', RangeLoading],
|
|
['FloatButton', FloatButton],
|
|
['AIButton', AIButton],
|
|
[WATERMARK_PANEL, WatermarkPanel],
|
|
[WATERMARK_PANEL_FOOTER, WatermarkPanelFooter],
|
|
] as const).forEach(([key, component]) => {
|
|
this.disposeWithMe(this._componentManager.register(key, component));
|
|
});
|
|
|
|
// this.disposeWithMe(this._componentManager.register('VueComponent', VueComponent, {
|
|
// framework: 'vue3',
|
|
// }));
|
|
|
|
// this.disposeWithMe(this._componentManager.register('counter-component', CounterComponent, {
|
|
// framework: 'web-component',
|
|
// }));
|
|
}
|
|
}
|