Skip to content

Commit

Permalink
refactor(blocks): group effects of linked doc to single file
Browse files Browse the repository at this point in the history
  • Loading branch information
L-Sun committed Nov 7, 2024
1 parent 23cc62d commit 3ad9629
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/blocks/src/effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ import {
AffineFormatBarWidget,
AffineImageToolbarWidget,
AffineInnerModalWidget,
AffineLinkedDocWidget,
AffineModalWidget,
AffinePageDraggingAreaWidget,
AffinePieMenuWidget,
Expand Down Expand Up @@ -278,9 +277,7 @@ import { AffineImageToolbar } from './root-block/widgets/image-toolbar/component
import { AFFINE_IMAGE_TOOLBAR_WIDGET } from './root-block/widgets/image-toolbar/index.js';
import { AFFINE_INNER_MODAL_WIDGET } from './root-block/widgets/inner-modal/inner-modal.js';
import { effects as widgetMobileToolbarEffects } from './root-block/widgets/keyboard-toolbar/effects.js';
import { ImportDoc } from './root-block/widgets/linked-doc/import-doc/import-doc.js';
import { AFFINE_LINKED_DOC_WIDGET } from './root-block/widgets/linked-doc/index.js';
import { LinkedDocPopover } from './root-block/widgets/linked-doc/linked-doc-popover.js';
import { effects as widgetLinkedDocEffects } from './root-block/widgets/linked-doc/effects.js';
import { AffineCustomModal } from './root-block/widgets/modal/custom-modal.js';
import { AFFINE_MODAL_WIDGET } from './root-block/widgets/modal/modal.js';
import { AFFINE_PAGE_DRAGGING_AREA_WIDGET } from './root-block/widgets/page-dragging-area/page-dragging-area.js';
Expand Down Expand Up @@ -341,6 +338,7 @@ export function effects() {

widgetScrollAnchoringEffects();
widgetMobileToolbarEffects();
widgetLinkedDocEffects();

customElements.define('affine-database-title', DatabaseTitle);
customElements.define(
Expand Down Expand Up @@ -378,7 +376,6 @@ export function effects() {
customElements.define('edgeless-note-mask', EdgelessNoteMask);
customElements.define('affine-edgeless-note', EdgelessNoteBlockComponent);
customElements.define('affine-preview-root', PreviewRootBlockComponent);
customElements.define('affine-linked-doc-popover', LinkedDocPopover);
customElements.define('affine-page-image', ImageBlockPageComponent);
customElements.define('affine-code', CodeBlockComponent);
customElements.define('affine-image-fallback-card', ImageBlockFallbackCard);
Expand Down Expand Up @@ -657,7 +654,6 @@ export function effects() {
customElements.define(AFFINE_PIE_MENU_WIDGET, AffinePieMenuWidget);
customElements.define(AFFINE_EDGELESS_COPILOT_WIDGET, EdgelessCopilotWidget);

customElements.define(AFFINE_LINKED_DOC_WIDGET, AffineLinkedDocWidget);
customElements.define(
EDGELESS_ELEMENT_TOOLBAR_WIDGET,
EdgelessElementToolbarWidget
Expand Down
7 changes: 7 additions & 0 deletions packages/blocks/src/root-block/widgets/linked-doc/effects.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { AFFINE_LINKED_DOC_WIDGET, AffineLinkedDocWidget } from './index.js';
import { LinkedDocPopover } from './linked-doc-popover.js';

export function effects() {
customElements.define('affine-linked-doc-popover', LinkedDocPopover);
customElements.define(AFFINE_LINKED_DOC_WIDGET, AffineLinkedDocWidget);
}

0 comments on commit 3ad9629

Please sign in to comment.