feat(core): support create new template in starter-bar (#10570)

This commit is contained in:
CatsJuice
2025-03-06 02:05:29 +00:00
parent fbb6df3da8
commit 6b08e3f5d4
3 changed files with 51 additions and 37 deletions
@@ -1,3 +1,4 @@
import { MenuSeparator } from '@affine/component';
import {
handleInlineAskAIAction,
pageAIGroups,
@@ -6,7 +7,10 @@ import { DocsService } from '@affine/core/modules/doc';
import { EditorService } from '@affine/core/modules/editor';
import { FeatureFlagService } from '@affine/core/modules/feature-flag';
import { TemplateDocService } from '@affine/core/modules/template-doc';
import { TemplateListMenu } from '@affine/core/modules/template-doc/view/template-list-menu';
import {
TemplateListMenu,
TemplateListMenuAdd,
} from '@affine/core/modules/template-doc/view/template-list-menu';
import { useI18n } from '@affine/i18n';
import track from '@affine/track';
import { PageRootBlockComponent } from '@blocksuite/affine/blocks';
@@ -134,6 +138,12 @@ const StarterBarNotEmpty = ({ doc }: { doc: Store }) => {
open: templateMenuOpen,
onOpenChange: onTemplateMenuOpenChange,
}}
suffixItems={
<>
<MenuSeparator />
<TemplateListMenuAdd />
</>
}
>
<Badge
data-testid="template-docs-badge"