feat(editor): add feature flag service (#9592)

This commit is contained in:
Saul-Mirone
2025-01-08 15:46:31 +00:00
parent fd26b72255
commit 3683297ccf
55 changed files with 283 additions and 188 deletions

View File

@@ -3,6 +3,7 @@ import {
EMBED_CARD_HEIGHT,
EMBED_CARD_WIDTH,
} from '@blocksuite/affine-shared/consts';
import { FeatureFlagService } from '@blocksuite/affine-shared/services';
import { cloneReferenceInfoWithoutAliases } from '@blocksuite/affine-shared/utils';
import { Bound } from '@blocksuite/global/utils';
@@ -15,10 +16,10 @@ export class EmbedEdgelessLinkedDocBlockComponent extends toEdgelessEmbedBlock(
override convertToEmbed = () => {
const { id, doc, caption, xywh } = this.model;
// synced doc entry controlled by awareness flag
const isSyncedDocEnabled = doc.awarenessStore.getFlag(
'enable_synced_doc_block'
);
// synced doc entry controlled by flag
const isSyncedDocEnabled = doc
.get(FeatureFlagService)
.getFlag('enable_synced_doc_block');
if (!isSyncedDocEnabled) {
return;
}

View File

@@ -13,6 +13,7 @@ import {
import {
DocDisplayMetaProvider,
DocModeProvider,
FeatureFlagService,
ThemeProvider,
} from '@blocksuite/affine-shared/services';
import {
@@ -129,10 +130,10 @@ export class EmbedLinkedDocBlockComponent extends EmbedBlockComponent<EmbedLinke
const { doc, caption } = this.model;
// synced doc entry controlled by awareness flag
const isSyncedDocEnabled = doc.awarenessStore.getFlag(
'enable_synced_doc_block'
);
// synced doc entry controlled by flag
const isSyncedDocEnabled = doc
.get(FeatureFlagService)
.getFlag('enable_synced_doc_block');
if (!isSyncedDocEnabled) {
return;
}