@blocksuite/affine-shared
Advanced tools
Comparing version 0.17.26 to 0.17.27
# @blocksuite/affine-shared | ||
## 0.17.27 | ||
### Patch Changes | ||
- f70b950: fix: color of canvas element under embed dark theme whiteboard is wrong (#8677) | ||
## Fix | ||
- fix: color of canvas element under embed dark theme whiteboard is wrong (#8677) | ||
- fix(edgeless): tool controller potential problem (#8675) | ||
- fix: typeError: f.\_def.innerType.shape[e] is undefined (#8676) | ||
- fix: whiteboard is first loaded, size of the linked doc card is scaled to wrong size (#8674) | ||
- Updated dependencies [f70b950] | ||
- @blocksuite/affine-model@0.17.27 | ||
- @blocksuite/block-std@0.17.27 | ||
- @blocksuite/global@0.17.27 | ||
- @blocksuite/inline@0.17.27 | ||
- @blocksuite/store@0.17.27 | ||
## 0.17.26 | ||
@@ -4,0 +24,0 @@ |
@@ -131,2 +131,4 @@ import { LifeCycleWatcher } from '@blocksuite/block-std'; | ||
const schema = OptionalPropsSchema._def.innerType.shape[key]; | ||
if (!schema) | ||
return; | ||
const overrideProps = schema.parse(props); | ||
@@ -133,0 +135,0 @@ if (Object.keys(overrideProps).length === 0) |
@@ -5,3 +5,2 @@ import { type Color, ColorScheme } from '@blocksuite/affine-model'; | ||
import { type Signal } from '@preact/signals-core'; | ||
import { type DocModeService } from './doc-mode-service.js'; | ||
export declare const ThemeExtensionIdentifier: import("@blocksuite/global/di").ServiceIdentifier<ThemeExtension> & ((variant: import("@blocksuite/global/di").ServiceVariant) => import("@blocksuite/global/di").ServiceIdentifier<ThemeExtension>); | ||
@@ -16,3 +15,2 @@ export interface ThemeExtension { | ||
private std; | ||
private docMode; | ||
app$: Signal<ColorScheme>; | ||
@@ -24,3 +22,3 @@ edgeless$: Signal<ColorScheme>; | ||
get theme$(): Signal<ColorScheme>; | ||
constructor(std: BlockStdScope, docMode: DocModeService); | ||
constructor(std: BlockStdScope); | ||
static setup(di: Container): void; | ||
@@ -27,0 +25,0 @@ /** |
@@ -7,3 +7,3 @@ import { ColorScheme } from '@blocksuite/affine-model'; | ||
import { unsafeCSS } from 'lit'; | ||
import { DocModeProvider } from './doc-mode-service.js'; | ||
import { isInsideEdgelessEditor } from '../utils/index.js'; | ||
const TRANSPARENT = 'transparent'; | ||
@@ -27,20 +27,20 @@ export const ThemeExtensionIdentifier = createIdentifier('AffineThemeExtension'); | ||
get theme() { | ||
return this.docMode.getEditorMode() === 'page' | ||
? this.appTheme | ||
: this.edgelessTheme; | ||
return isInsideEdgelessEditor(this.std.host) | ||
? this.edgelessTheme | ||
: this.appTheme; | ||
} | ||
get theme$() { | ||
return this.docMode.getEditorMode() === 'page' ? this.app$ : this.edgeless$; | ||
return isInsideEdgelessEditor(this.std.host) ? this.edgeless$ : this.app$; | ||
} | ||
constructor(std, docMode) { | ||
constructor(std) { | ||
super(); | ||
this.std = std; | ||
this.docMode = docMode; | ||
const extension = this.std.getOptional(ThemeExtensionIdentifier); | ||
this.app$ = extension?.getAppTheme?.() || getThemeObserver().theme$; | ||
this.edgeless$ = | ||
extension?.getEdgelessTheme?.() || getThemeObserver().theme$; | ||
extension?.getEdgelessTheme?.(this.std.doc.id) || | ||
getThemeObserver().theme$; | ||
} | ||
static setup(di) { | ||
di.addImpl(ThemeProvider, ThemeService, [StdIdentifier, DocModeProvider]); | ||
di.addImpl(ThemeProvider, ThemeService, [StdIdentifier]); | ||
} | ||
@@ -47,0 +47,0 @@ /** |
@@ -5,4 +5,5 @@ export function isInsidePageEditor(host) { | ||
export function isInsideEdgelessEditor(host) { | ||
return Array.from(host.children).some(v => v.tagName.toLowerCase() === 'affine-edgeless-root'); | ||
return Array.from(host.children).some(v => v.tagName.toLowerCase() === 'affine-edgeless-root' || | ||
v.tagName.toLowerCase() === 'affine-edgeless-root-preview'); | ||
} | ||
//# sourceMappingURL=checker.js.map |
@@ -13,3 +13,4 @@ import type { ExtensionType } from '@blocksuite/block-std'; | ||
hasSpec(id: string): boolean; | ||
omitSpec(id: string, targetSpec: ExtensionType): void; | ||
} | ||
//# sourceMappingURL=spec-provider.d.ts.map |
@@ -37,3 +37,11 @@ import { assertExists } from '@blocksuite/global/utils'; | ||
} | ||
omitSpec(id, targetSpec) { | ||
const existingSpec = this.specMap.get(id); | ||
if (!existingSpec) { | ||
console.error(`Spec not found for ${id}`); | ||
return; | ||
} | ||
this.specMap.set(id, existingSpec.filter(spec => spec !== targetSpec)); | ||
} | ||
} | ||
//# sourceMappingURL=spec-provider.js.map |
{ | ||
"name": "@blocksuite/affine-shared", | ||
"version": "0.17.26", | ||
"version": "0.17.27", | ||
"description": "Default BlockSuite editable blocks.", | ||
@@ -22,7 +22,7 @@ "type": "module", | ||
"dependencies": { | ||
"@blocksuite/affine-model": "0.17.26", | ||
"@blocksuite/block-std": "0.17.26", | ||
"@blocksuite/global": "0.17.26", | ||
"@blocksuite/inline": "0.17.26", | ||
"@blocksuite/store": "0.17.26", | ||
"@blocksuite/affine-model": "0.17.27", | ||
"@blocksuite/block-std": "0.17.27", | ||
"@blocksuite/global": "0.17.27", | ||
"@blocksuite/inline": "0.17.27", | ||
"@blocksuite/store": "0.17.27", | ||
"@floating-ui/dom": "^1.6.10", | ||
@@ -29,0 +29,0 @@ "@lit/context": "^1.1.2", |
@@ -183,2 +183,4 @@ import { type BlockStdScope, LifeCycleWatcher } from '@blocksuite/block-std'; | ||
const schema = OptionalPropsSchema._def.innerType.shape[key]; | ||
if (!schema) return; | ||
const overrideProps = schema.parse(props); | ||
@@ -185,0 +187,0 @@ if (Object.keys(overrideProps).length === 0) return; |
@@ -17,3 +17,3 @@ import { type Color, ColorScheme } from '@blocksuite/affine-model'; | ||
import { DocModeProvider, type DocModeService } from './doc-mode-service.js'; | ||
import { isInsideEdgelessEditor } from '../utils/index.js'; | ||
@@ -57,15 +57,12 @@ const TRANSPARENT = 'transparent'; | ||
get theme() { | ||
return this.docMode.getEditorMode() === 'page' | ||
? this.appTheme | ||
: this.edgelessTheme; | ||
return isInsideEdgelessEditor(this.std.host) | ||
? this.edgelessTheme | ||
: this.appTheme; | ||
} | ||
get theme$() { | ||
return this.docMode.getEditorMode() === 'page' ? this.app$ : this.edgeless$; | ||
return isInsideEdgelessEditor(this.std.host) ? this.edgeless$ : this.app$; | ||
} | ||
constructor( | ||
private std: BlockStdScope, | ||
private docMode: DocModeService | ||
) { | ||
constructor(private std: BlockStdScope) { | ||
super(); | ||
@@ -75,7 +72,8 @@ const extension = this.std.getOptional(ThemeExtensionIdentifier); | ||
this.edgeless$ = | ||
extension?.getEdgelessTheme?.() || getThemeObserver().theme$; | ||
extension?.getEdgelessTheme?.(this.std.doc.id) || | ||
getThemeObserver().theme$; | ||
} | ||
static override setup(di: Container) { | ||
di.addImpl(ThemeProvider, ThemeService, [StdIdentifier, DocModeProvider]); | ||
di.addImpl(ThemeProvider, ThemeService, [StdIdentifier]); | ||
} | ||
@@ -82,0 +80,0 @@ |
@@ -11,4 +11,6 @@ import type { EditorHost } from '@blocksuite/block-std'; | ||
return Array.from(host.children).some( | ||
v => v.tagName.toLowerCase() === 'affine-edgeless-root' | ||
v => | ||
v.tagName.toLowerCase() === 'affine-edgeless-root' || | ||
v.tagName.toLowerCase() === 'affine-edgeless-root-preview' | ||
); | ||
} |
@@ -49,2 +49,15 @@ import type { ExtensionType } from '@blocksuite/block-std'; | ||
} | ||
omitSpec(id: string, targetSpec: ExtensionType) { | ||
const existingSpec = this.specMap.get(id); | ||
if (!existingSpec) { | ||
console.error(`Spec not found for ${id}`); | ||
return; | ||
} | ||
this.specMap.set( | ||
id, | ||
existingSpec.filter(spec => spec !== targetSpec) | ||
); | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
791553
13808
+ Added@blocksuite/affine-model@0.17.27(transitive)
+ Added@blocksuite/block-std@0.17.27(transitive)
+ Added@blocksuite/global@0.17.27(transitive)
+ Added@blocksuite/inline@0.17.27(transitive)
+ Added@blocksuite/store@0.17.27(transitive)
+ Added@blocksuite/sync@0.17.27(transitive)
- Removed@blocksuite/affine-model@0.17.26(transitive)
- Removed@blocksuite/block-std@0.17.26(transitive)
- Removed@blocksuite/global@0.17.26(transitive)
- Removed@blocksuite/inline@0.17.26(transitive)
- Removed@blocksuite/store@0.17.26(transitive)
- Removed@blocksuite/sync@0.17.26(transitive)
Updated@blocksuite/global@0.17.27
Updated@blocksuite/inline@0.17.27
Updated@blocksuite/store@0.17.27