fix(core): ai lit element import (#7257)

Fix ai lit component import error.

f57a665819/packages/frontend/core/package.json (L13-L16)
This commit is contained in:
L-Sun
2024-06-19 04:26:49 +00:00
parent dddfcdbabb
commit 501fa0bb91
47 changed files with 190 additions and 202 deletions

View File

@@ -1,4 +1,4 @@
import './ask-ai-panel.js';
import './ask-ai-panel';
import { type EditorHost, WithDisposable } from '@blocksuite/block-std';
import {
@@ -14,7 +14,7 @@ import { customElement, property, query } from 'lit/decorators.js';
import { ref } from 'lit/directives/ref.js';
import { styleMap } from 'lit/directives/style-map.js';
import { getRootService } from '../../utils/selection-utils.js';
import { getRootService } from '../../utils/selection-utils';
type buttonSize = 'small' | 'middle' | 'large';
type toggleType = 'hover' | 'click';

View File

@@ -7,7 +7,7 @@ import { css, html, LitElement } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import { styleMap } from 'lit/directives/style-map.js';
import { getRootService } from '../../utils/selection-utils.js';
import { getRootService } from '../../utils/selection-utils';
@customElement('ask-ai-panel')
export class AskAIPanel extends WithDisposable(LitElement) {

View File

@@ -9,21 +9,21 @@ import {
} from '@blocksuite/blocks';
import type { TemplateResult } from 'lit';
import { actionToHandler } from '../actions/doc-handler.js';
import { actionToHandler as edgelessActionToHandler } from '../actions/edgeless-handler.js';
import { actionToHandler } from '../actions/doc-handler';
import { actionToHandler as edgelessActionToHandler } from '../actions/edgeless-handler';
import {
imageFilterStyles,
imageProcessingTypes,
textTones,
translateLangs,
} from '../actions/types.js';
import { getAIPanel } from '../ai-panel.js';
import { AIProvider } from '../provider.js';
} from '../actions/types';
import { getAIPanel } from '../ai-panel';
import { AIProvider } from '../provider';
import {
getSelectedImagesAsBlobs,
getSelectedTextContent,
getSelections,
} from '../utils/selection-utils.js';
} from '../utils/selection-utils';
import {
AIDoneIcon,
AIImageIcon,
@@ -45,7 +45,7 @@ import {
SelectionIcon,
ShorterIcon,
ToneIcon,
} from './icons.js';
} from './icons';
export const translateSubItem: AISubItemConfig[] = translateLangs.map(lang => {
return {

View File

@@ -9,7 +9,7 @@ import {
import { assertExists } from '@blocksuite/global/utils';
import { Slice } from '@blocksuite/store';
import { getMarkdownFromSlice } from './markdown-utils.js';
import { getMarkdownFromSlice } from './markdown-utils';
export const getRootService = (host: EditorHost) => {
return host.std.spec.getService('affine:page');

View File

@@ -13,16 +13,16 @@ import {
buildFinishConfig,
buildGeneratingConfig,
getAIPanel,
} from '../ai-panel.js';
import { createTextRenderer } from '../messages/text.js';
import { AIProvider } from '../provider.js';
import { reportResponse } from '../utils/action-reporter.js';
} from '../ai-panel';
import { createTextRenderer } from '../messages/text';
import { AIProvider } from '../provider';
import { reportResponse } from '../utils/action-reporter';
import {
getSelectedImagesAsBlobs,
getSelectedTextContent,
getSelections,
selectAboveBlocks,
} from '../utils/selection-utils.js';
} from '../utils/selection-utils';
export function bindTextStream(
stream: BlockSuitePresets.TextStream,

View File

@@ -17,41 +17,38 @@ import { assertExists } from '@blocksuite/global/utils';
import { Slice } from '@blocksuite/store';
import type { TemplateResult } from 'lit';
import { getAIPanel } from '../ai-panel.js';
import { getAIPanel } from '../ai-panel';
import {
createMindmapExecuteRenderer,
createMindmapRenderer,
} from '../messages/mindmap.js';
import { createSlidesRenderer } from '../messages/slides-renderer.js';
import { createTextRenderer } from '../messages/text.js';
import {
createIframeRenderer,
createImageRenderer,
} from '../messages/wrapper.js';
import { AIProvider } from '../provider.js';
import { reportResponse } from '../utils/action-reporter.js';
} from '../messages/mindmap';
import { createSlidesRenderer } from '../messages/slides-renderer';
import { createTextRenderer } from '../messages/text';
import { createIframeRenderer, createImageRenderer } from '../messages/wrapper';
import { AIProvider } from '../provider';
import { reportResponse } from '../utils/action-reporter';
import {
getEdgelessCopilotWidget,
isMindmapChild,
isMindMapRoot,
} from '../utils/edgeless.js';
import { copyTextAnswer } from '../utils/editor-actions.js';
import { getContentFromSlice } from '../utils/markdown-utils.js';
} from '../utils/edgeless';
import { copyTextAnswer } from '../utils/editor-actions';
import { getContentFromSlice } from '../utils/markdown-utils';
import {
getCopilotSelectedElems,
getSelectedNoteAnchor,
getSelections,
} from '../utils/selection-utils.js';
import { EXCLUDING_COPY_ACTIONS, IMAGE_ACTIONS } from './consts.js';
import { bindTextStream } from './doc-handler.js';
} from '../utils/selection-utils';
import { EXCLUDING_COPY_ACTIONS, IMAGE_ACTIONS } from './consts';
import { bindTextStream } from './doc-handler';
import {
actionToErrorResponse,
actionToGenerating,
actionToResponse,
getElementToolbar,
responses,
} from './edgeless-response.js';
import type { CtxRecord } from './types.js';
} from './edgeless-response';
import type { CtxRecord } from './types';
type AnswerRenderer = NonNullable<
AffineAIPanelWidget['config']

View File

@@ -22,26 +22,26 @@ import {
import { assertExists } from '@blocksuite/global/utils';
import type { TemplateResult } from 'lit';
import { AIPenIcon, ChatWithAIIcon } from '../_common/icons.js';
import { insertFromMarkdown } from '../_common/markdown-utils.js';
import { getSurfaceElementFromEditor } from '../_common/selection-utils.js';
import { getAIPanel } from '../ai-panel.js';
import { AIProvider } from '../provider.js';
import { reportResponse } from '../utils/action-reporter.js';
import { AIPenIcon, ChatWithAIIcon } from '../_common/icons';
import { insertFromMarkdown } from '../_common/markdown-utils';
import { getSurfaceElementFromEditor } from '../_common/selection-utils';
import { getAIPanel } from '../ai-panel';
import { AIProvider } from '../provider';
import { reportResponse } from '../utils/action-reporter';
import {
getEdgelessCopilotWidget,
getService,
isMindMapRoot,
} from '../utils/edgeless.js';
import { preprocessHtml } from '../utils/html.js';
import { fetchImageToFile } from '../utils/image.js';
} from '../utils/edgeless';
import { preprocessHtml } from '../utils/html';
import { fetchImageToFile } from '../utils/image';
import {
getCopilotSelectedElems,
getEdgelessRootFromEditor,
getEdgelessService,
} from '../utils/selection-utils.js';
import { EXCLUDING_INSERT_ACTIONS, generatingStages } from './consts.js';
import type { CtxRecord } from './types.js';
} from '../utils/selection-utils';
import { EXCLUDING_INSERT_ACTIONS, generatingStages } from './consts';
import type { CtxRecord } from './types';
type FinishConfig = Exclude<
AffineAIPanelWidget['config'],

View File

@@ -1,2 +1,2 @@
export * from './doc-handler.js';
export * from './types.js';
export * from './doc-handler';
export * from './types';

View File

@@ -23,20 +23,20 @@ import {
InsertTopIcon,
ReplaceIcon,
RetryIcon,
} from './_common/icons.js';
import { INSERT_ABOVE_ACTIONS } from './actions/consts.js';
import { createTextRenderer } from './messages/text.js';
import { AIProvider } from './provider.js';
import { reportResponse } from './utils/action-reporter.js';
import { findNoteBlockModel, getService } from './utils/edgeless.js';
} from './_common/icons';
import { INSERT_ABOVE_ACTIONS } from './actions/consts';
import { createTextRenderer } from './messages/text';
import { AIProvider } from './provider';
import { reportResponse } from './utils/action-reporter';
import { findNoteBlockModel, getService } from './utils/edgeless';
import {
copyTextAnswer,
insertAbove,
insertBelow,
replace,
} from './utils/editor-actions.js';
import { insertFromMarkdown } from './utils/markdown-utils.js';
import { getSelections } from './utils/selection-utils.js';
} from './utils/editor-actions';
import { insertFromMarkdown } from './utils/markdown-utils';
import { getSelections } from './utils/selection-utils';
function getSelection(host: EditorHost) {
const textSelection = host.selection.find('text');

View File

@@ -19,16 +19,16 @@ import {
import { assertInstanceOf } from '@blocksuite/global/utils';
import { literal, unsafeStatic } from 'lit/static-html.js';
import { buildAIPanelConfig } from './ai-panel.js';
import { setupCodeToolbarEntry } from './entries/code-toolbar/setup-code-toolbar.js';
import { buildAIPanelConfig } from './ai-panel';
import { setupCodeToolbarEntry } from './entries/code-toolbar/setup-code-toolbar';
import {
setupEdgelessCopilot,
setupEdgelessElementToolbarEntry,
} from './entries/edgeless/index.js';
import { setupFormatBarEntry } from './entries/format-bar/setup-format-bar.js';
import { setupImageToolbarEntry } from './entries/image-toolbar/setup-image-toolbar.js';
import { setupSlashMenuEntry } from './entries/slash-menu/setup-slash-menu.js';
import { setupSpaceEntry } from './entries/space/setup-space.js';
} from './entries/edgeless/index';
import { setupFormatBarEntry } from './entries/format-bar/setup-format-bar';
import { setupImageToolbarEntry } from './entries/image-toolbar/setup-image-toolbar';
import { setupSlashMenuEntry } from './entries/slash-menu/setup-slash-menu';
import { setupSpaceEntry } from './entries/space/setup-space';
export const AIPageRootBlockSpec: BlockSpec = {
...PageRootBlockSpec,

View File

@@ -21,11 +21,11 @@ import {
AIPresentationIcon,
ArrowDownIcon,
ArrowUpIcon,
} from '../../_common/icons.js';
import { createTextRenderer } from '../../messages/text.js';
import type { ChatAction } from '../chat-context.js';
import { renderImages } from '../components/images.js';
import { HISTORY_IMAGE_ACTIONS } from '../const.js';
} from '../../_common/icons';
import { createTextRenderer } from '../../messages/text';
import type { ChatAction } from '../chat-context';
import { renderImages } from '../components/images';
import { HISTORY_IMAGE_ACTIONS } from '../const';
const icons: Record<string, TemplateResult<1>> = {
'Fix spelling for it': AIDoneIcon,

View File

@@ -15,14 +15,10 @@ import {
NoteDisplayMode,
} from '@blocksuite/blocks';
import {
CreateIcon,
InsertBelowIcon,
ReplaceIcon,
} from '../../_common/icons.js';
import { reportResponse } from '../../utils/action-reporter.js';
import { insertBelow, replace } from '../../utils/editor-actions.js';
import { insertFromMarkdown } from '../../utils/markdown-utils.js';
import { CreateIcon, InsertBelowIcon, ReplaceIcon } from '../../_common/icons';
import { reportResponse } from '../../utils/action-reporter';
import { insertBelow, replace } from '../../utils/editor-actions';
import { insertFromMarkdown } from '../../utils/markdown-utils';
const { matchFlavours } = BlocksUtils;

View File

@@ -1,12 +1,12 @@
import './action-wrapper.js';
import './action-wrapper';
import type { EditorHost } from '@blocksuite/block-std';
import { ShadowlessElement, WithDisposable } from '@blocksuite/block-std';
import { html, nothing } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import { createTextRenderer } from '../../messages/text.js';
import { renderImages } from '../components/images.js';
import { createTextRenderer } from '../../messages/text';
import { renderImages } from '../components/images';
@customElement('chat-text')
export class ChatText extends WithDisposable(ShadowlessElement) {
@property({ attribute: false })

View File

@@ -10,11 +10,11 @@ import { css, html, LitElement, nothing, type PropertyValues } from 'lit';
import { customElement, property, query, state } from 'lit/decorators.js';
import { repeat } from 'lit/directives/repeat.js';
import { CopyIcon, MoreIcon, RetryIcon } from '../../_common/icons.js';
import { AIProvider } from '../../provider.js';
import { copyText } from '../../utils/editor-actions.js';
import type { ChatContextValue, ChatMessage } from '../chat-context.js';
import { PageEditorActions } from './actions-handle.js';
import { CopyIcon, MoreIcon, RetryIcon } from '../../_common/icons';
import { AIProvider } from '../../provider';
import { copyText } from '../../utils/editor-actions';
import type { ChatContextValue, ChatMessage } from '../chat-context';
import { PageEditorActions } from './actions-handle';
noop(Tooltip);

View File

@@ -1,4 +1,4 @@
import './action-wrapper.js';
import './action-wrapper';
import type { EditorHost } from '@blocksuite/block-std';
import { ShadowlessElement, WithDisposable } from '@blocksuite/block-std';
@@ -6,8 +6,8 @@ import { html, nothing } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import { styleMap } from 'lit/directives/style-map.js';
import type { ChatAction } from '../chat-context.js';
import { renderImages } from '../components/images.js';
import type { ChatAction } from '../chat-context';
import { renderImages } from '../components/images';
@customElement('action-image-to-text')
export class ActionImageToText extends WithDisposable(ShadowlessElement) {

View File

@@ -1,4 +1,4 @@
import './action-wrapper.js';
import './action-wrapper';
import type { EditorHost } from '@blocksuite/block-std';
import { ShadowlessElement, WithDisposable } from '@blocksuite/block-std';
@@ -6,8 +6,8 @@ import { html, nothing } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import { styleMap } from 'lit/directives/style-map.js';
import type { ChatAction } from '../chat-context.js';
import { renderImages } from '../components/images.js';
import type { ChatAction } from '../chat-context';
import { renderImages } from '../components/images';
@customElement('action-image')
export class ActionImage extends WithDisposable(ShadowlessElement) {

View File

@@ -1,4 +1,4 @@
import './action-wrapper.js';
import './action-wrapper';
import type { EditorHost } from '@blocksuite/block-std';
import { ShadowlessElement, WithDisposable } from '@blocksuite/block-std';
@@ -6,8 +6,8 @@ import { html } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import { styleMap } from 'lit/directives/style-map.js';
import { createIframeRenderer } from '../../messages/wrapper.js';
import type { ChatAction } from '../chat-context.js';
import { createIframeRenderer } from '../../messages/wrapper';
import type { ChatAction } from '../chat-context';
@customElement('action-make-real')
export class ActionMakeReal extends WithDisposable(ShadowlessElement) {

View File

@@ -1,4 +1,4 @@
import './action-wrapper.js';
import './action-wrapper';
import type { EditorHost } from '@blocksuite/block-std';
import { ShadowlessElement, WithDisposable } from '@blocksuite/block-std';
@@ -8,7 +8,7 @@ import { html } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import { styleMap } from 'lit/directives/style-map.js';
import type { ChatAction } from '../chat-context.js';
import type { ChatAction } from '../chat-context';
noop(MiniMindmapPreview);

View File

@@ -1,5 +1,5 @@
import './action-wrapper.js';
import '../../messages/slides-renderer.js';
import './action-wrapper';
import '../../messages/slides-renderer';
import type { EditorHost } from '@blocksuite/block-std';
import { ShadowlessElement, WithDisposable } from '@blocksuite/block-std';
@@ -7,7 +7,7 @@ import { html, nothing } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import { styleMap } from 'lit/directives/style-map.js';
import type { ChatAction } from '../chat-context.js';
import type { ChatAction } from '../chat-context';
@customElement('action-slides')
export class ActionSlides extends WithDisposable(ShadowlessElement) {

View File

@@ -1,4 +1,4 @@
import './action-wrapper.js';
import './action-wrapper';
import type { EditorHost } from '@blocksuite/block-std';
import { WithDisposable } from '@blocksuite/block-std';
@@ -6,8 +6,8 @@ import { css, html, LitElement } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import { styleMap } from 'lit/directives/style-map.js';
import { createTextRenderer } from '../../messages/text.js';
import type { ChatAction } from '../chat-context.js';
import { createTextRenderer } from '../../messages/text';
import type { ChatAction } from '../chat-context';
@customElement('action-text')
export class ActionText extends WithDisposable(LitElement) {

View File

@@ -2,7 +2,7 @@ import { WithDisposable } from '@blocksuite/block-std';
import { css, html, LitElement } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import { AIStarIconWithAnimation } from '../_common/icons.js';
import { AIStarIconWithAnimation } from '../_common/icons';
@customElement('ai-loading')
export class AILoading extends WithDisposable(LitElement) {

View File

@@ -17,15 +17,15 @@ import {
CurrentSelectionIcon,
DocIcon,
SmallImageIcon,
} from '../_common/icons.js';
} from '../_common/icons';
import {
getEdgelessRootFromEditor,
getSelectedImagesAsBlobs,
getSelectedTextContent,
getTextContentFromBlockModels,
selectedToCanvas,
} from '../utils/selection-utils.js';
import type { ChatContextValue } from './chat-context.js';
} from '../utils/selection-utils';
import type { ChatContextValue } from './chat-context';
const cardsStyles = css`
.card-wrapper {

View File

@@ -12,11 +12,11 @@ import {
ChatSendIcon,
CloseIcon,
ImageIcon,
} from '../_common/icons.js';
import { AIProvider } from '../provider.js';
import { reportResponse } from '../utils/action-reporter.js';
import { readBlobAsURL } from '../utils/image.js';
import type { ChatContextValue, ChatMessage } from './chat-context.js';
} from '../_common/icons';
import { AIProvider } from '../provider';
import { reportResponse } from '../utils/action-reporter';
import { readBlobAsURL } from '../utils/image';
import type { ChatContextValue, ChatMessage } from './chat-context';
const MaximumImageCount = 8;

View File

@@ -1,16 +1,16 @@
import '../messages/slides-renderer.js';
import './ai-loading.js';
import '../messages/text.js';
import './actions/text.js';
import './actions/action-wrapper.js';
import './actions/make-real.js';
import './actions/slides.js';
import './actions/mindmap.js';
import './actions/chat-text.js';
import './actions/copy-more.js';
import './actions/image-to-text.js';
import './actions/image.js';
import './chat-cards.js';
import '../messages/slides-renderer';
import './ai-loading';
import '../messages/text';
import './actions/text';
import './actions/action-wrapper';
import './actions/make-real';
import './actions/slides';
import './actions/mindmap';
import './actions/chat-text';
import './actions/copy-more';
import './actions/image-to-text';
import './actions/image';
import './chat-cards';
import type {
BaseSelection,
@@ -30,27 +30,19 @@ import { customElement, property, query, state } from 'lit/decorators.js';
import { repeat } from 'lit/directives/repeat.js';
import { styleMap } from 'lit/directives/style-map.js';
import {
AffineAvatarIcon,
AffineIcon,
DownArrowIcon,
} from '../_common/icons.js';
import { AffineAvatarIcon, AffineIcon, DownArrowIcon } from '../_common/icons';
import {
GeneralErrorRenderer,
PaymentRequiredErrorRenderer,
} from '../messages/error.js';
import { AIProvider } from '../provider.js';
import { insertBelow } from '../utils/editor-actions.js';
} from '../messages/error';
import { AIProvider } from '../provider';
import { insertBelow } from '../utils/editor-actions';
import {
EdgelessEditorActions,
PageEditorActions,
} from './actions/actions-handle.js';
import type {
ChatContextValue,
ChatItem,
ChatMessage,
} from './chat-context.js';
import { HISTORY_IMAGE_ACTIONS } from './const.js';
} from './actions/actions-handle';
import type { ChatContextValue, ChatItem, ChatMessage } from './chat-context';
import { HISTORY_IMAGE_ACTIONS } from './const';
@customElement('chat-panel-messages')
export class ChatPanelMessages extends WithDisposable(ShadowlessElement) {

View File

@@ -1,5 +1,5 @@
import './chat-panel-input.js';
import './chat-panel-messages.js';
import './chat-panel-input';
import './chat-panel-messages';
import type { EditorHost } from '@blocksuite/block-std';
import { ShadowlessElement, WithDisposable } from '@blocksuite/block-std';
@@ -9,14 +9,14 @@ import { css, html, type PropertyValues } from 'lit';
import { customElement, property, state } from 'lit/decorators.js';
import { createRef, type Ref, ref } from 'lit/directives/ref.js';
import { AIHelpIcon, SmallHintIcon } from '../_common/icons.js';
import { AIProvider } from '../provider.js';
import { AIHelpIcon, SmallHintIcon } from '../_common/icons';
import { AIProvider } from '../provider';
import {
getSelectedImagesAsBlobs,
getSelectedTextContent,
} from '../utils/selection-utils.js';
import type { ChatAction, ChatContextValue, ChatItem } from './chat-context.js';
import type { ChatPanelMessages } from './chat-panel-messages.js';
} from '../utils/selection-utils';
import type { ChatAction, ChatContextValue, ChatItem } from './chat-context';
import type { ChatPanelMessages } from './chat-panel-messages';
@customElement('chat-panel')
export class ChatPanel extends WithDisposable(ShadowlessElement) {

View File

@@ -2,9 +2,9 @@ import type { EditorHost } from '@blocksuite/block-std';
import type { EdgelessRootService } from '@blocksuite/blocks';
import type { BlockSnapshot } from '@blocksuite/store';
import { markdownToSnapshot } from '../_common/markdown-utils.js';
import { getSurfaceElementFromEditor } from '../_common/selection-utils.js';
import { basicTheme } from '../slides/template.js';
import { markdownToSnapshot } from '../_common/markdown-utils';
import { getSurfaceElementFromEditor } from '../_common/selection-utils';
import { basicTheme } from '../slides/template';
type PPTSection = {
title: string;

View File

@@ -1,4 +1,4 @@
import '../../_common/components/ask-ai-button.js';
import '../../_common/components/ask-ai-button';
import type {
AffineCodeToolbarWidget,
@@ -12,9 +12,9 @@ const buttonOptions: AskAIButtonOptions = {
panelWidth: 240,
};
import type { AskAIButtonOptions } from '../../_common/components/ask-ai-button.js';
import { buildAICodeItemGroups } from '../../_common/config.js';
import { AIStarIcon } from '../../_common/icons.js';
import type { AskAIButtonOptions } from '../../_common/components/ask-ai-button';
import { buildAICodeItemGroups } from '../../_common/config';
import { AIStarIcon } from '../../_common/icons';
export function setupCodeToolbarEntry(codeToolbar: AffineCodeToolbarWidget) {
const onAskAIClick = () => {

View File

@@ -28,7 +28,7 @@ import {
SelectionIcon,
ShorterIcon,
ToneIcon,
} from '../../_common/icons.js';
} from '../../_common/icons';
import {
actionToHandler,
imageOnlyShowWhen,
@@ -36,22 +36,22 @@ import {
mindmapRootShowWhen,
noteBlockOrTextShowWhen,
noteWithCodeBlockShowWen,
} from '../../actions/edgeless-handler.js';
} from '../../actions/edgeless-handler';
import {
imageFilterStyles,
imageProcessingTypes,
textTones,
translateLangs,
} from '../../actions/types.js';
import { getAIPanel } from '../../ai-panel.js';
import { AIProvider } from '../../provider.js';
import { mindMapToMarkdown } from '../../utils/edgeless.js';
import { canvasToBlob, randomSeed } from '../../utils/image.js';
} from '../../actions/types';
import { getAIPanel } from '../../ai-panel';
import { AIProvider } from '../../provider';
import { mindMapToMarkdown } from '../../utils/edgeless';
import { canvasToBlob, randomSeed } from '../../utils/image';
import {
getCopilotSelectedElems,
getEdgelessRootFromEditor,
imageCustomInput,
} from '../../utils/selection-utils.js';
} from '../../utils/selection-utils';
const translateSubItem = translateLangs.map(lang => {
return {

View File

@@ -8,7 +8,7 @@ import { EdgelessCopilotToolbarEntry } from '@blocksuite/blocks';
import { noop } from '@blocksuite/global/utils';
import { html } from 'lit';
import { edgelessActionGroups } from './actions-config.js';
import { edgelessActionGroups } from './actions-config';
noop(EdgelessCopilotToolbarEntry);

View File

@@ -1,4 +1,4 @@
import '../../_common/components/ask-ai-button.js';
import '../../_common/components/ask-ai-button';
import {
type AffineFormatBarWidget,
@@ -6,7 +6,7 @@ import {
} from '@blocksuite/blocks';
import { html, type TemplateResult } from 'lit';
import { AIItemGroups } from '../../_common/config.js';
import { AIItemGroups } from '../../_common/config';
export function setupFormatBarEntry(formatBar: AffineFormatBarWidget) {
toolbarDefaultConfig(formatBar);

View File

@@ -1,4 +1,4 @@
import '../../_common/components/ask-ai-button.js';
import '../../_common/components/ask-ai-button';
import type {
AffineImageToolbarWidget,
@@ -6,8 +6,8 @@ import type {
} from '@blocksuite/blocks';
import { html } from 'lit';
import type { AskAIButtonOptions } from '../../_common/components/ask-ai-button.js';
import { buildAIImageItemGroups } from '../../_common/config.js';
import type { AskAIButtonOptions } from '../../_common/components/ask-ai-button';
import { buildAIImageItemGroups } from '../../_common/config';
const AIImageItemGroups = buildAIImageItemGroups();
const buttonOptions: AskAIButtonOptions = {

View File

@@ -1,2 +1,2 @@
export * from './format-bar/setup-format-bar.js';
export * from './space/setup-space.js';
export * from './format-bar/setup-format-bar';
export * from './space/setup-space';

View File

@@ -15,9 +15,9 @@ import {
import { assertExists } from '@blocksuite/global/utils';
import { html } from 'lit';
import { AIItemGroups } from '../../_common/config.js';
import { handleInlineAskAIAction } from '../../actions/doc-handler.js';
import { AIProvider } from '../../provider.js';
import { AIItemGroups } from '../../_common/config';
import { handleInlineAskAIAction } from '../../actions/doc-handler';
import { AIProvider } from '../../provider';
export function setupSlashMenuEntry(slashMenu: AffineSlashMenuWidget) {
const AIItems = AIItemGroups.map(group => group.items).flat();

View File

@@ -1,7 +1,7 @@
import type { AffineAIPanelWidget } from '@blocksuite/blocks';
import { handleInlineAskAIAction } from '../../actions/doc-handler.js';
import { AIProvider } from '../../provider.js';
import { handleInlineAskAIAction } from '../../actions/doc-handler';
import { AIProvider } from '../../provider';
export function setupSpaceEntry(panel: AffineAIPanelWidget) {
panel.handleEvent('keyDown', ctx => {

View File

@@ -1,7 +1,7 @@
export * from './actions/index.js';
export * from './ai-spec.js';
export { ChatPanel } from './chat-panel/index.js';
export * from './entries/edgeless/actions-config.js';
export * from './entries/index.js';
export * from './messages/index.js';
export * from './provider.js';
export * from './actions/index';
export * from './ai-spec';
export { ChatPanel } from './chat-panel/index';
export * from './entries/edgeless/actions-config';
export * from './entries/index';
export * from './messages/index';
export * from './provider';

View File

@@ -2,8 +2,8 @@ import { type EditorHost, WithDisposable } from '@blocksuite/block-std';
import { html, LitElement, nothing, type TemplateResult } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import { ErrorTipIcon } from '../_common/icons.js';
import { AIProvider } from '../provider.js';
import { ErrorTipIcon } from '../_common/icons';
import { AIProvider } from '../provider';
@customElement('ai-error-wrapper')
class AIErrorWrapper extends WithDisposable(LitElement) {

View File

@@ -1,2 +1,2 @@
export * from './text.js';
export * from './wrapper.js';
export * from './text';
export * from './wrapper';

View File

@@ -7,7 +7,7 @@ import { markdownToMindmap, MiniMindmapPreview } from '@blocksuite/blocks';
import { noop } from '@blocksuite/global/utils';
import { html, nothing } from 'lit';
import { getAIPanel } from '../ai-panel.js';
import { getAIPanel } from '../ai-panel';
noop(MiniMindmapPreview);

View File

@@ -11,8 +11,8 @@ import { css, html, LitElement, nothing } from 'lit';
import { customElement, property, query } from 'lit/decorators.js';
import { createRef, type Ref, ref } from 'lit/directives/ref.js';
import { getAIPanel } from '../ai-panel.js';
import { PPTBuilder } from '../slides/index.js';
import { getAIPanel } from '../ai-panel';
import { PPTBuilder } from '../slides/index';
export const createSlidesRenderer: (
host: EditorHost,

View File

@@ -16,8 +16,8 @@ import { customElement, property, query } from 'lit/decorators.js';
import { classMap } from 'lit/directives/class-map.js';
import { keyed } from 'lit/directives/keyed.js';
import { CustomPageEditorBlockSpecs } from '../utils/custom-specs.js';
import { markDownToDoc } from '../utils/markdown-utils.js';
import { CustomPageEditorBlockSpecs } from '../utils/custom-specs';
import { markDownToDoc } from '../utils/markdown-utils';
const textBlockStyles = css`
${ParagraphBlockComponent.styles}

View File

@@ -3,8 +3,8 @@ import type { AffineAIPanelWidgetConfig } from '@blocksuite/blocks';
import { css, html, LitElement, nothing } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import { getAIPanel } from '../ai-panel.js';
import { preprocessHtml } from '../utils/html.js';
import { getAIPanel } from '../ai-panel';
import { preprocessHtml } from '../utils/html';
type AIAnswerWrapperOptions = {
height: number;

View File

@@ -2,14 +2,14 @@ import type { EditorHost } from '@blocksuite/block-std';
import type { EdgelessRootService } from '@blocksuite/blocks';
import type { BlockSnapshot } from '@blocksuite/store';
import { markdownToSnapshot } from '../_common/markdown-utils.js';
import { getSurfaceElementFromEditor } from '../_common/selection-utils.js';
import { markdownToSnapshot } from '../_common/markdown-utils';
import { getSurfaceElementFromEditor } from '../_common/selection-utils';
import {
basicTheme,
type PPTDoc,
type PPTSection,
type TemplateImage,
} from './template.js';
} from './template';
export const PPTBuilder = (host: EditorHost) => {
const service = host.spec.getService<EdgelessRootService>('affine:page');

View File

@@ -1,7 +1,7 @@
import { Bound } from '@blocksuite/blocks';
import { nanoid } from '@blocksuite/store';
import { AIProvider } from '../provider.js';
import { AIProvider } from '../provider';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const replaceText = (text: Record<string, string>, template: any) => {

View File

@@ -1,4 +1,4 @@
import { type ActionEventType, AIProvider } from '../provider.js';
import { type ActionEventType, AIProvider } from '../provider';
export function reportResponse(event: ActionEventType) {
const lastAction = AIProvider.actionHistory.at(-1);

View File

@@ -11,7 +11,7 @@ import {
insertFromMarkdown,
markDownToDoc,
markdownToSnapshot,
} from './markdown-utils.js';
} from './markdown-utils';
const getNoteId = (blockElement: BlockElement) => {
let element = blockElement;

View File

@@ -14,8 +14,8 @@ import {
toDraftModel,
} from '@blocksuite/store';
import { getEdgelessCopilotWidget, getService } from './edgeless.js';
import { getContentFromSlice } from './markdown-utils.js';
import { getEdgelessCopilotWidget, getService } from './edgeless';
import { getContentFromSlice } from './markdown-utils';
export const getRootService = (host: EditorHost) => {
return host.std.spec.getService('affine:page');