feat(editor): feature flag store extension builder (#12235)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **New Features**
  - Introduced feature flag synchronization for enhanced control over feature availability.
  - Added new configuration options for store management, allowing initialization and feature flag setup.

- **Improvements**
  - Updated how store extensions are accessed throughout the app for more robust initialization and configuration.
  - Enhanced workspace entities to support feature flag services, improving flexibility for workspace-specific features.
  - Centralized configuration of storage implementations for Electron environments.

- **Refactor**
  - Simplified editor module by removing direct feature flag synchronization logic.
  - Streamlined imports and configuration for storage modules, especially in Electron-based apps.

- **Bug Fixes**
  - Ensured consistent retrieval of store extensions across various modules and platforms.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Saul-Mirone
2025-05-12 09:29:14 +00:00
parent ef3775e8a9
commit bc00a58ae1
23 changed files with 178 additions and 68 deletions

View File

@@ -61,7 +61,7 @@ export class IntegrationWriter extends Entity {
schema: getAFFiNEWorkspaceSchema(),
markdown,
fileName: title,
extensions: getStoreManager().get('store'),
extensions: getStoreManager().config.init().value.get('store'),
});
if (!newDocId) throw new Error('Failed to create a new doc');
@@ -85,7 +85,7 @@ export class IntegrationWriter extends Entity {
doc,
blockId: noteBlockId,
markdown,
extensions: getStoreManager().get('store'),
extensions: getStoreManager().config.init().value.get('store'),
});
} else if (updateStrategy === 'append') {
const pageBlockId = doc.getBlocksByFlavour('affine:page')[0]?.id;
@@ -94,7 +94,7 @@ export class IntegrationWriter extends Entity {
doc,
blockId,
markdown: `---\n${markdown}`,
extensions: getStoreManager().get('store'),
extensions: getStoreManager().config.init().value.get('store'),
});
} else {
throw new Error('Invalid update strategy');