update at 2025-10-09 12:39:24

This commit is contained in:
douboer
2025-10-09 12:39:24 +08:00
parent a891153be0
commit 6f51916b50
44 changed files with 332 additions and 226 deletions

View File

@@ -53,7 +53,7 @@ export class PlatformChooser {
constructor(container: HTMLElement, options: PlatformChooserOptions = {}) {
this.container = container;
this.currentPlatform = options.defaultPlatform || 'wechat';
this.currentPlatform = options.defaultPlatform || 'xiaohongshu';
if (options.onPlatformChange) {
this.onChange = (platform) => {
options.onPlatformChange!(platform);
@@ -72,15 +72,16 @@ export class PlatformChooser {
* 渲染平台选择器 UI
*/
render(): void {
// 创建平台选择行
const lineDiv = this.container.createDiv({ cls: 'toolbar-line platform-selector-line' });
// 将容器作为单层 Grid 行使用
this.container.addClass('platform-selector-line');
this.container.addClass('platform-chooser-grid');
// 创建标签
const platformLabel = lineDiv.createDiv({ cls: 'style-label' });
const platformLabel = this.container.createDiv({ cls: 'style-label' });
platformLabel.innerText = '发布平台';
// 创建选择器
const platformSelect = lineDiv.createEl('select', { cls: 'platform-select' });
const platformSelect = this.container.createEl('select', { cls: 'platform-select' });
this.selectElement = platformSelect;
// 添加平台选项