Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: color of canvas element under embed whiteboard is wrong #8712

Open
wants to merge 1 commit into
base: canary
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/common/env/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"private": true,
"type": "module",
"devDependencies": {
"@blocksuite/affine": "0.17.26",
"@blocksuite/affine": "0.17.27",
"vitest": "2.1.4"
},
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion packages/common/infra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@affine/debug": "workspace:*",
"@affine/env": "workspace:*",
"@affine/templates": "workspace:*",
"@blocksuite/affine": "0.17.26",
"@blocksuite/affine": "0.17.27",
"@datastructures-js/binary-search-tree": "^5.3.2",
"foxact": "^0.2.33",
"fractional-indexing": "^3.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/apps/android/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@affine/component": "workspace:*",
"@affine/core": "workspace:*",
"@affine/i18n": "workspace:*",
"@blocksuite/affine": "0.17.26",
"@blocksuite/affine": "0.17.27",
"@blocksuite/icons": "^2.1.67",
"@capacitor/android": "^6.1.2",
"@capacitor/core": "^6.1.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/apps/electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@affine/core": "workspace:*",
"@affine/i18n": "workspace:*",
"@affine/native": "workspace:*",
"@blocksuite/affine": "0.17.26",
"@blocksuite/affine": "0.17.27",
"@electron-forge/cli": "^7.3.0",
"@electron-forge/core": "^7.3.0",
"@electron-forge/core-utils": "^7.3.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/apps/ios/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@affine/component": "workspace:*",
"@affine/core": "workspace:*",
"@affine/i18n": "workspace:*",
"@blocksuite/affine": "0.17.26",
"@blocksuite/affine": "0.17.27",
"@blocksuite/icons": "^2.1.67",
"@capacitor/app": "^6.0.1",
"@capacitor/browser": "^6.0.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/apps/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@affine/component": "workspace:*",
"@affine/core": "workspace:*",
"@affine/i18n": "workspace:*",
"@blocksuite/affine": "0.17.26",
"@blocksuite/affine": "0.17.27",
"@blocksuite/icons": "^2.1.67",
"@sentry/react": "^8.0.0",
"react": "^18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"zod": "^3.22.4"
},
"devDependencies": {
"@blocksuite/affine": "0.17.26",
"@blocksuite/affine": "0.17.27",
"@blocksuite/icons": "2.1.69",
"@chromatic-com/storybook": "^3.0.0",
"@storybook/addon-essentials": "^8.2.9",
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@affine/i18n": "workspace:*",
"@affine/templates": "workspace:*",
"@affine/track": "workspace:*",
"@blocksuite/affine": "0.17.26",
"@blocksuite/affine": "0.17.27",
"@blocksuite/icons": "2.1.69",
"@capacitor/app": "^6.0.1",
"@capacitor/browser": "^6.0.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {
type DocCustomPropertyInfo,
DocService,
DocsService,
FeatureFlagService,
useFramework,
useLiveData,
useService,
Expand Down Expand Up @@ -95,14 +94,12 @@ const usePatchSpecs = (shared: boolean, mode: DocMode) => {
docsService,
editorService,
workspaceService,
featureFlagService,
} = useServices({
PeekViewService,
DocService,
DocsService,
WorkspaceService,
EditorService,
FeatureFlagService,
});
const framework = useFramework();
const referenceRenderer: ReferenceReactRenderer = useMemo(() => {
Expand Down Expand Up @@ -130,11 +127,10 @@ const usePatchSpecs = (shared: boolean, mode: DocMode) => {
}, [workspaceService]);

const specs = useMemo(() => {
const enableAI = featureFlagService.flags.enable_ai.value;
return mode === 'edgeless'
? createEdgelessModeSpecs(framework, !!enableAI)
: createPageModeSpecs(framework, !!enableAI);
}, [featureFlagService.flags.enable_ai.value, mode, framework]);
? createEdgelessModeSpecs(framework)
: createPageModeSpecs(framework);
}, [mode, framework]);

const confirmModal = useConfirmModal();
const patchedSpecs = useMemo(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ import {
import {
createSignalFromObservable,
type Signal,
SpecProvider,
} from '@blocksuite/affine-shared/utils';
import type { Container } from '@blocksuite/global/di';
import {
DocService,
DocsService,
FeatureFlagService,
type FrameworkProvider,
} from '@toeverything/infra';
import type { Observable } from 'rxjs';
Expand Down Expand Up @@ -155,10 +157,29 @@ function getEditorConfigExtension(
];
}

export const extendEdgelessPreviewSpec = (function () {
let _extension: ExtensionType;
let _framework: FrameworkProvider;
return function (framework: FrameworkProvider) {
if (framework === _framework && _extension) {
return _extension;
} else {
_extension &&
SpecProvider.getInstance().omitSpec('edgeless:preview', _extension);
Copy link
Member

@EYHN EYHN Nov 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make edgeless:preview auto-inherit the themeExtension from root ?

_extension = createThemeExtension(framework);
_framework = framework;
SpecProvider.getInstance().extendSpec('edgeless:preview', [_extension]);
return _extension;
}
};
})();

export function createPageRootBlockSpec(
framework: FrameworkProvider,
enableAI: boolean
framework: FrameworkProvider
): ExtensionType[] {
const featureFlagService = framework.get(FeatureFlagService);
const enableAI = featureFlagService.flags.enable_ai.value;
extendEdgelessPreviewSpec(framework);
return [
enableAI ? AIPageRootBlockSpec : PageRootBlockSpec,
FontLoaderService,
Expand All @@ -170,9 +191,11 @@ export function createPageRootBlockSpec(
}

export function createEdgelessRootBlockSpec(
framework: FrameworkProvider,
enableAI: boolean
framework: FrameworkProvider
): ExtensionType[] {
const featureFlagService = framework.get(FeatureFlagService);
const enableAI = featureFlagService.flags.enable_ai.value;
extendEdgelessPreviewSpec(framework);
return [
enableAI ? AIEdgelessRootBlockSpec : EdgelessRootBlockSpec,
FontLoaderService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,19 @@ import {
EdgelessTextBlockSpec,
FrameBlockSpec,
} from '@blocksuite/affine/blocks';
import type { FrameworkProvider } from '@toeverything/infra';
import {
FeatureFlagService,
type FrameworkProvider,
} from '@toeverything/infra';

import { AIBlockSpecs, DefaultBlockSpecs } from './common';
import { createEdgelessRootBlockSpec } from './custom/root-block';

export function createEdgelessModeSpecs(
framework: FrameworkProvider,
enableAI: boolean
framework: FrameworkProvider
): ExtensionType[] {
const featureFlagService = framework.get(FeatureFlagService);
const enableAI = featureFlagService.flags.enable_ai.value;
return [
...(enableAI ? AIBlockSpecs : DefaultBlockSpecs),
EdgelessSurfaceBlockSpec,
Expand All @@ -27,7 +31,7 @@ export function createEdgelessModeSpecs(
EdgelessTextBlockSpec,
EdgelessNoteBlockSpec,
// special
createEdgelessRootBlockSpec(framework, enableAI),
createEdgelessRootBlockSpec(framework),
].flat();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,25 @@ import {
PageSurfaceBlockSpec,
PageSurfaceRefBlockSpec,
} from '@blocksuite/affine/blocks';
import { type FrameworkProvider } from '@toeverything/infra';
import {
FeatureFlagService,
type FrameworkProvider,
} from '@toeverything/infra';

import { AIBlockSpecs, DefaultBlockSpecs } from './common';
import { createPageRootBlockSpec } from './custom/root-block';

export function createPageModeSpecs(
framework: FrameworkProvider,
enableAI: boolean
framework: FrameworkProvider
): ExtensionType[] {
const featureFlagService = framework.get(FeatureFlagService);
const enableAI = featureFlagService.flags.enable_ai.value;
return [
...(enableAI ? AIBlockSpecs : DefaultBlockSpecs),
PageSurfaceBlockSpec,
PageSurfaceRefBlockSpec,
NoteBlockSpec,
// special
createPageRootBlockSpec(framework, enableAI),
createPageRootBlockSpec(framework),
].flat();
}
2 changes: 1 addition & 1 deletion tools/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"@affine/env": "workspace:*",
"@affine/templates": "workspace:*",
"@aws-sdk/client-s3": "^3.620.0",
"@blocksuite/affine": "0.17.26",
"@blocksuite/affine": "0.17.27",
"@clack/core": "^0.3.4",
"@clack/prompts": "^0.7.0",
"@magic-works/i18n-codegen": "^0.6.0",
Expand Down
Loading
Loading