@blocksuite/affine-shared
Advanced tools
Comparing version 0.0.0-canary-20241209001608 to 0.0.0-canary-20241210001545
# @blocksuite/affine-shared | ||
## 0.0.0-canary-20241209001608 | ||
## 0.0.0-canary-20241210001545 | ||
@@ -9,8 +9,49 @@ ### Patch Changes | ||
- Updated dependencies | ||
- @blocksuite/affine-model@0.0.0-canary-20241209001608 | ||
- @blocksuite/block-std@0.0.0-canary-20241209001608 | ||
- @blocksuite/global@0.0.0-canary-20241209001608 | ||
- @blocksuite/inline@0.0.0-canary-20241209001608 | ||
- @blocksuite/store@0.0.0-canary-20241209001608 | ||
- @blocksuite/affine-model@0.0.0-canary-20241210001545 | ||
- @blocksuite/block-std@0.0.0-canary-20241210001545 | ||
- @blocksuite/global@0.0.0-canary-20241210001545 | ||
- @blocksuite/inline@0.0.0-canary-20241210001545 | ||
- @blocksuite/store@0.0.0-canary-20241210001545 | ||
## 0.18.5 | ||
### Patch Changes | ||
- ec2956c: ## Feat | ||
- feat: api for encode and decode dnd data (#8909) | ||
- feat(blocks): add event tracking for linked doc (#8876) | ||
- feat(playground): outside click to close docs panel (#8885) | ||
## Fix | ||
- fix(store): fix awareness destroy (#8904) | ||
- fix: switch card view style does not work (#8886) | ||
- fix: no need to save aliases on embed synced doc model (#8884) | ||
- fix: should differentiate between internal and external links when pasting links (#8896) | ||
- fix(presets): incorrectly adding page root widgets to edgeless (#8897) | ||
- fix: sentry-0f7fafa98f7c483ca95c04c188f485b8 (#8892) | ||
- fix: sentry-2d6423fce9c242ec9e63364243a6cf59 (#8891) | ||
- fix: sentry-d6ecba020e5047e394de05bf0ff77e71 (#8890) | ||
- fix: sentry-6d40eee6cbcd4704bb2dff3d5347544c (#8889) | ||
- fix: sentry-f25281abb20a4260aa424741c30e5756 (#8888) | ||
- fix(playground): starter debug menu theming (#8883) | ||
- fix(playground): adapt docs panel to dark mode (#8881) | ||
- fix: should show alias icon when title has alias (#8880) | ||
## Chore | ||
- chore: lock file maintenance (#8895) | ||
## Refactor | ||
- refactor(playground): remove redundant doc init logic (#8906) | ||
- Updated dependencies [ec2956c] | ||
- @blocksuite/affine-model@0.18.5 | ||
- @blocksuite/block-std@0.18.5 | ||
- @blocksuite/global@0.18.5 | ||
- @blocksuite/inline@0.18.5 | ||
- @blocksuite/store@0.18.5 | ||
## 0.18.4 | ||
@@ -17,0 +58,0 @@ |
@@ -32,2 +32,8 @@ import type { BlockComponent, DndEventState, EditorHost, ExtensionType } from '@blocksuite/block-std'; | ||
export declare function DragHandleConfigExtension(option: DragHandleOption): ExtensionType; | ||
export type DndApi = { | ||
decodeSnapshot: (dataTransfer: DataTransfer) => any | null; | ||
encodeSnapshot: (json: Record<string, unknown>, dataTransfer: DataTransfer, html?: string) => void; | ||
}; | ||
export declare const DndApiExtensionIdentifier: import("@blocksuite/global/di").ServiceIdentifier<DndApi> & ((variant: import("@blocksuite/global/di").ServiceVariant) => import("@blocksuite/global/di").ServiceIdentifier<DndApi>); | ||
export declare function DNDAPIExtension(): ExtensionType; | ||
//# sourceMappingURL=drag-handle-config.d.ts.map |
@@ -13,2 +13,27 @@ import { createIdentifier } from '@blocksuite/global/di'; | ||
} | ||
export const DndApiExtensionIdentifier = createIdentifier('AffineDndApiIdentifier'); | ||
export function DNDAPIExtension() { | ||
return { | ||
setup: di => { | ||
di.addImpl(DndApiExtensionIdentifier, () => ({ | ||
decodeSnapshot: dataTransfer => { | ||
const html = dataTransfer.getData('text/html'); | ||
if (!html) | ||
return null; | ||
const parser = new DOMParser(); | ||
const doc = parser.parseFromString(html, 'text/html'); | ||
const dom = doc.querySelector('[data-blocksuite-snapshot]'); | ||
if (!dom) | ||
return null; | ||
const json = JSON.parse(decodeURIComponent(dom.dataset.blocksuiteSnapshot)); | ||
return json; | ||
}, | ||
encodeSnapshot: (json, dataTransfer, htmlBody = '') => { | ||
const snapshot = JSON.stringify(json); | ||
dataTransfer.setData('text/html', `<div data-blocksuite-snapshot="${encodeURIComponent(snapshot)}">${htmlBody}</div>`); | ||
}, | ||
})); | ||
}, | ||
}; | ||
} | ||
//# sourceMappingURL=drag-handle-config.js.map |
export * from './database.js'; | ||
export * from './link.js'; | ||
export * from './telemetry-service.js'; | ||
export * from './types.js'; | ||
//# sourceMappingURL=index.d.ts.map |
export * from './database.js'; | ||
export * from './link.js'; | ||
export * from './telemetry-service.js'; | ||
export * from './types.js'; | ||
//# sourceMappingURL=index.js.map |
import type { OutDatabaseAllEvents } from './database.js'; | ||
import type { LinkToolbarEvents } from './link.js'; | ||
import type { DocCreatedEvent, ElementCreationEvent, TelemetryEvent } from './types.js'; | ||
export type TelemetryEventMap = OutDatabaseAllEvents & { | ||
export type TelemetryEventMap = OutDatabaseAllEvents & LinkToolbarEvents & { | ||
DocCreated: DocCreatedEvent; | ||
@@ -5,0 +6,0 @@ LinkedDocCreated: TelemetryEvent; |
{ | ||
"name": "@blocksuite/affine-shared", | ||
"version": "0.0.0-canary-20241209001608", | ||
"version": "0.0.0-canary-20241210001545", | ||
"description": "Default BlockSuite editable blocks.", | ||
@@ -22,7 +22,7 @@ "type": "module", | ||
"dependencies": { | ||
"@blocksuite/affine-model": "0.0.0-canary-20241209001608", | ||
"@blocksuite/block-std": "0.0.0-canary-20241209001608", | ||
"@blocksuite/global": "0.0.0-canary-20241209001608", | ||
"@blocksuite/inline": "0.0.0-canary-20241209001608", | ||
"@blocksuite/store": "0.0.0-canary-20241209001608", | ||
"@blocksuite/affine-model": "0.0.0-canary-20241210001545", | ||
"@blocksuite/block-std": "0.0.0-canary-20241210001545", | ||
"@blocksuite/global": "0.0.0-canary-20241210001545", | ||
"@blocksuite/inline": "0.0.0-canary-20241210001545", | ||
"@blocksuite/store": "0.0.0-canary-20241210001545", | ||
"@floating-ui/dom": "^1.6.10", | ||
@@ -29,0 +29,0 @@ "@lit/context": "^1.1.2", |
@@ -64,1 +64,47 @@ import type { | ||
} | ||
export type DndApi = { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
decodeSnapshot: (dataTransfer: DataTransfer) => any | null; | ||
encodeSnapshot: ( | ||
json: Record<string, unknown>, | ||
dataTransfer: DataTransfer, | ||
html?: string | ||
) => void; | ||
}; | ||
export const DndApiExtensionIdentifier = createIdentifier<DndApi>( | ||
'AffineDndApiIdentifier' | ||
); | ||
export function DNDAPIExtension(): ExtensionType { | ||
return { | ||
setup: di => { | ||
di.addImpl(DndApiExtensionIdentifier, () => ({ | ||
decodeSnapshot: dataTransfer => { | ||
const html = dataTransfer.getData('text/html'); | ||
if (!html) return null; | ||
const parser = new DOMParser(); | ||
const doc = parser.parseFromString(html, 'text/html'); | ||
const dom = doc.querySelector<HTMLDivElement>( | ||
'[data-blocksuite-snapshot]' | ||
); | ||
if (!dom) return null; | ||
const json = JSON.parse( | ||
decodeURIComponent(dom.dataset.blocksuiteSnapshot as string) | ||
); | ||
return json; | ||
}, | ||
encodeSnapshot: (json, dataTransfer, htmlBody = '') => { | ||
const snapshot = JSON.stringify(json); | ||
dataTransfer.setData( | ||
'text/html', | ||
`<div data-blocksuite-snapshot="${encodeURIComponent(snapshot)}">${htmlBody}</div>` | ||
); | ||
}, | ||
})); | ||
}, | ||
}; | ||
} |
export * from './database.js'; | ||
export * from './link.js'; | ||
export * from './telemetry-service.js'; | ||
export * from './types.js'; |
import { createIdentifier } from '@blocksuite/global/di'; | ||
import type { OutDatabaseAllEvents } from './database.js'; | ||
import type { LinkToolbarEvents } from './link.js'; | ||
import type { | ||
@@ -10,8 +11,9 @@ DocCreatedEvent, | ||
export type TelemetryEventMap = OutDatabaseAllEvents & { | ||
DocCreated: DocCreatedEvent; | ||
LinkedDocCreated: TelemetryEvent; | ||
SplitNote: TelemetryEvent; | ||
CanvasElementAdded: ElementCreationEvent; | ||
}; | ||
export type TelemetryEventMap = OutDatabaseAllEvents & | ||
LinkToolbarEvents & { | ||
DocCreated: DocCreatedEvent; | ||
LinkedDocCreated: TelemetryEvent; | ||
SplitNote: TelemetryEvent; | ||
CanvasElementAdded: ElementCreationEvent; | ||
}; | ||
@@ -18,0 +20,0 @@ export interface TelemetryService { |
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
973362
524
16208
+ Added@blocksuite/affine-model@0.0.0-canary-20241210001545(transitive)
+ Added@blocksuite/block-std@0.0.0-canary-20241210001545(transitive)
+ Added@blocksuite/global@0.0.0-canary-20241210001545(transitive)
+ Added@blocksuite/inline@0.0.0-canary-20241210001545(transitive)
+ Added@blocksuite/store@0.0.0-canary-20241210001545(transitive)
+ Added@blocksuite/sync@0.0.0-canary-20241210001545(transitive)
- Removed@blocksuite/affine-model@0.0.0-canary-20241209001608(transitive)
- Removed@blocksuite/block-std@0.0.0-canary-20241209001608(transitive)
- Removed@blocksuite/global@0.0.0-canary-20241209001608(transitive)
- Removed@blocksuite/inline@0.0.0-canary-20241209001608(transitive)
- Removed@blocksuite/store@0.0.0-canary-20241209001608(transitive)
- Removed@blocksuite/sync@0.0.0-canary-20241209001608(transitive)