-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(editor): extract attachment block (#9308)
- Loading branch information
1 parent
d8bc145
commit ebd9775
Showing
35 changed files
with
272 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"name": "@blocksuite/affine-block-attachment", | ||
"description": "Attachment block for BlockSuite.", | ||
"type": "module", | ||
"scripts": { | ||
"build": "tsc", | ||
"test:unit": "nx vite:test --run --passWithNoTests", | ||
"test:unit:coverage": "nx vite:test --run --coverage", | ||
"test:e2e": "playwright test" | ||
}, | ||
"sideEffects": false, | ||
"keywords": [], | ||
"author": "toeverything", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@blocksuite/affine-block-embed": "workspace:*", | ||
"@blocksuite/affine-components": "workspace:*", | ||
"@blocksuite/affine-model": "workspace:*", | ||
"@blocksuite/affine-shared": "workspace:*", | ||
"@blocksuite/block-std": "workspace:*", | ||
"@blocksuite/global": "workspace:*", | ||
"@blocksuite/icons": "^2.1.75", | ||
"@blocksuite/inline": "workspace:*", | ||
"@blocksuite/store": "workspace:*", | ||
"@floating-ui/dom": "^1.6.10", | ||
"@lit/context": "^1.1.2", | ||
"@preact/signals-core": "^1.8.0", | ||
"@toeverything/theme": "^1.1.1", | ||
"file-type": "^19.5.0", | ||
"lit": "^3.2.0", | ||
"minimatch": "^10.0.1", | ||
"zod": "^3.23.8" | ||
}, | ||
"exports": { | ||
".": "./src/index.ts", | ||
"./effects": "./src/effects.ts" | ||
}, | ||
"files": [ | ||
"src", | ||
"dist", | ||
"!src/__tests__", | ||
"!dist/__tests__" | ||
] | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { AttachmentBlockComponent } from './attachment-block'; | ||
import { AttachmentEdgelessBlockComponent } from './attachment-edgeless-block'; | ||
import type { AttachmentBlockService } from './attachment-service'; | ||
|
||
export function effects() { | ||
customElements.define( | ||
'affine-edgeless-attachment', | ||
AttachmentEdgelessBlockComponent | ||
); | ||
customElements.define('affine-attachment', AttachmentBlockComponent); | ||
} | ||
|
||
declare global { | ||
namespace BlockSuite { | ||
interface BlockServices { | ||
'affine:attachment': AttachmentBlockService; | ||
} | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export * from './adapters/notion-html'; | ||
export * from './attachment-block'; | ||
export * from './attachment-service'; | ||
export * from './attachment-spec'; | ||
export { attachmentViewToggleMenu } from './components/options'; | ||
export { | ||
type AttachmentEmbedConfig, | ||
AttachmentEmbedConfigIdentifier, | ||
AttachmentEmbedProvider, | ||
} from './embed'; | ||
export { addAttachments, addSiblingAttachmentBlocks } from './utils'; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"compilerOptions": { | ||
"rootDir": "./src/", | ||
"outDir": "./dist/", | ||
"noEmit": false | ||
}, | ||
"include": ["./src"], | ||
"references": [ | ||
{ | ||
"path": "../../framework/global" | ||
}, | ||
{ | ||
"path": "../../framework/store" | ||
}, | ||
{ | ||
"path": "../../framework/block-std" | ||
}, | ||
{ | ||
"path": "../../framework/inline" | ||
}, | ||
{ | ||
"path": "../model" | ||
}, | ||
{ | ||
"path": "../components" | ||
}, | ||
{ | ||
"path": "../shared" | ||
}, | ||
{ | ||
"path": "../block-embed" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.