Skip to content

Commit 5cb5cb6

Browse files
L-SunSaul-Mirone
andauthored
chore: sync affine blocksuite to packages (#9149)
Co-authored-by: Saul-Mirone <10047788+Saul-Mirone@users.noreply.github.com>
1 parent a5091e7 commit 5cb5cb6

File tree

119 files changed

+1804
-480
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+1804
-480
lines changed

packages/affine/all/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"@blocksuite/affine-gfx-template": "workspace:*",
4949
"@blocksuite/affine-gfx-text": "workspace:*",
5050
"@blocksuite/affine-gfx-turbo-renderer": "workspace:*",
51+
"@blocksuite/affine-inline-comment": "workspace:*",
5152
"@blocksuite/affine-inline-footnote": "workspace:*",
5253
"@blocksuite/affine-inline-latex": "workspace:*",
5354
"@blocksuite/affine-inline-link": "workspace:*",
@@ -173,6 +174,7 @@
173174
"./inlines/footnote": "./src/inlines/footnote/index.ts",
174175
"./inlines/footnote/view": "./src/inlines/footnote/view.ts",
175176
"./inlines/footnote/store": "./src/inlines/footnote/store.ts",
177+
"./inlines/comment": "./src/inlines/comment/index.ts",
176178
"./inlines/latex": "./src/inlines/latex/index.ts",
177179
"./inlines/latex/store": "./src/inlines/latex/store.ts",
178180
"./inlines/latex/view": "./src/inlines/latex/view.ts",
@@ -283,6 +285,7 @@
283285
"./sync": "./src/sync/index.ts",
284286
"./extensions/store": "./src/extensions/store.ts",
285287
"./extensions/view": "./src/extensions/view.ts",
288+
"./foundation/clipboard": "./src/foundation/clipboard.ts",
286289
"./foundation/store": "./src/foundation/store.ts",
287290
"./foundation/view": "./src/foundation/view.ts"
288291
},

packages/affine/all/src/extensions/view.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import { PointerViewExtension } from '@blocksuite/affine-gfx-pointer/view';
3333
import { ShapeViewExtension } from '@blocksuite/affine-gfx-shape/view';
3434
import { TemplateViewExtension } from '@blocksuite/affine-gfx-template/view';
3535
import { TextViewExtension } from '@blocksuite/affine-gfx-text/view';
36+
import { InlineCommentViewExtension } from '@blocksuite/affine-inline-comment/view';
3637
import { FootnoteViewExtension } from '@blocksuite/affine-inline-footnote/view';
3738
import { LatexViewExtension as InlineLatexViewExtension } from '@blocksuite/affine-inline-latex/view';
3839
import { LinkViewExtension } from '@blocksuite/affine-inline-link/view';
@@ -95,6 +96,7 @@ export function getInternalViewExtensions() {
9596
RootViewExtension,
9697

9798
// Inline
99+
InlineCommentViewExtension,
98100
FootnoteViewExtension,
99101
LinkViewExtension,
100102
ReferenceViewExtension,
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from '@blocksuite/affine-foundation/clipboard';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from '@blocksuite/affine-inline-comment';

packages/affine/all/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
{ "path": "../gfx/template" },
4646
{ "path": "../gfx/text" },
4747
{ "path": "../gfx/turbo-renderer" },
48+
{ "path": "../inlines/comment" },
4849
{ "path": "../inlines/footnote" },
4950
{ "path": "../inlines/latex" },
5051
{ "path": "../inlines/link" },

packages/affine/blocks/attachment/src/attachment-block.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
AttachmentBlockStyles,
1818
} from '@blocksuite/affine-model';
1919
import {
20+
BlockCommentManager,
2021
CitationProvider,
2122
DocModeProvider,
2223
FileSizeLimitProvider,
@@ -92,6 +93,14 @@ export class AttachmentBlockComponent extends CaptionedBlockComponent<Attachment
9293
return this.citationService.isCitationModel(this.model);
9394
}
9495

96+
get isCommentHighlighted() {
97+
return (
98+
this.std
99+
.getOptional(BlockCommentManager)
100+
?.isBlockCommentHighlighted(this.model) ?? false
101+
);
102+
}
103+
95104
convertTo = () => {
96105
return this.std
97106
.get(AttachmentEmbedProvider)
@@ -499,6 +508,7 @@ export class AttachmentBlockComponent extends CaptionedBlockComponent<Attachment
499508
class=${classMap({
500509
'affine-attachment-container': true,
501510
focused: this.selected$.value,
511+
'comment-highlighted': this.isCommentHighlighted,
502512
})}
503513
style=${this.containerStyleMap}
504514
>

packages/affine/blocks/attachment/src/configs/toolbar.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
} from '@blocksuite/affine-shared/consts';
1111
import {
1212
ActionPlacement,
13+
blockCommentToolbarButton,
1314
type ToolbarAction,
1415
type ToolbarActionGroup,
1516
type ToolbarModuleConfig,
@@ -240,6 +241,10 @@ const builtinToolbarConfig = {
240241
replaceAction,
241242
downloadAction,
242243
captionAction,
244+
{
245+
id: 'f.comment',
246+
...blockCommentToolbarButton,
247+
},
243248
{
244249
placement: ActionPlacement.More,
245250
id: 'a.clipboard',

packages/affine/blocks/attachment/src/styles.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ export const styles = css`
1515
}
1616
}
1717
18+
.affine-attachment-container.comment-highlighted {
19+
outline: 2px solid ${unsafeCSSVarV2('block/comment/highlightUnderline')};
20+
}
21+
1822
.affine-attachment-card {
1923
display: flex;
2024
gap: 12px;

packages/affine/blocks/bookmark/src/bookmark-block.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import type {
88
} from '@blocksuite/affine-model';
99
import { ImageProxyService } from '@blocksuite/affine-shared/adapters';
1010
import {
11+
BlockCommentManager,
1112
CitationProvider,
1213
DocModeProvider,
1314
LinkPreviewServiceIdentifier,
@@ -128,6 +129,14 @@ export class BookmarkBlockComponent extends CaptionedBlockComponent<BookmarkBloc
128129
return this.std.get(ImageProxyService);
129130
}
130131

132+
get isCommentHighlighted() {
133+
return (
134+
this.std
135+
.getOptional(BlockCommentManager)
136+
?.isBlockCommentHighlighted(this.model) ?? false
137+
);
138+
}
139+
131140
handleClick = (event: MouseEvent) => {
132141
event.stopPropagation();
133142

packages/affine/blocks/bookmark/src/components/bookmark-card.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export class BookmarkCard extends SignalWatcher(
4545
[style]: true,
4646
selected: this.bookmark.selected$.value,
4747
edgeless: isGfxBlockComponent(this.bookmark),
48+
'comment-highlighted': this.bookmark.isCommentHighlighted,
4849
});
4950

5051
const domainName = url.match(

0 commit comments

Comments
 (0)