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

refactor: migrate slash menu to widget component #3128

Merged
merged 8 commits into from
Jul 3, 2023

Conversation

lawvs
Copy link
Member

@lawvs lawvs commented Jun 15, 2023

Design

THIS DESIGN IS OUTDATED!

const editor = document.querySelector("editor-container");
const defaultPage = editor.querySelector("affine-default-page");
const edgelessPage = editor.querySelector("affine-edgeless-page");

// import { SlashMenu } from '@blocksuite/blocks'
const SlashMenu = defaultPage.components.SlashMenu;

class CustomSlashMenu extends SlashMenu {
  override get menuGroups() {
    return super.menuGroups.slice(0, 1);
  }
}
// Fix `Illegal constructor` error
// see https://stackoverflow.com/questions/41521812/illegal-constructor-with-ecmascript-6
customElements.define("custom-slash-menu", CustomSlashMenu);

defaultPage.components.SlashMenu = CustomSlashMenu;
edgelessPage.components.SlashMenu = CustomSlashMenu;

Screenshot 2023-06-16 at 3 43 30 AM

@vercel
Copy link

vercel bot commented Jun 15, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
blocksuite 🛑 Canceled (Inspect) Jul 3, 2023 10:49am
blocksuite-docs 🛑 Canceled (Inspect) Jul 3, 2023 10:49am

@codesandbox
Copy link

codesandbox bot commented Jun 15, 2023

This branch is running in CodeSandbox. Use the links below to review this PR faster.


CodeSandbox logoCodeSandbox logo  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders | Preview

@lawvs lawvs force-pushed the feat/customize-slash-menu branch from 54e23d8 to 3a9a12d Compare June 19, 2023 03:21
@lawvs lawvs force-pushed the feat/customize-slash-menu branch from 9c52b10 to 35e36b0 Compare June 26, 2023 07:51
@lawvs lawvs force-pushed the feat/customize-slash-menu branch from 35e36b0 to fb2ea39 Compare June 30, 2023 09:16
@lawvs lawvs force-pushed the feat/customize-slash-menu branch 2 times, most recently from 1ac2503 to 63600cc Compare July 3, 2023 08:05
@lawvs lawvs changed the title feat: supports customizing the slash menu refactor: migrate slash menu to widget component Jul 3, 2023
@lawvs lawvs requested a review from Saul-Mirone July 3, 2023 08:40
@lawvs lawvs marked this pull request as ready for review July 3, 2023 08:41
@lawvs lawvs force-pushed the feat/customize-slash-menu branch from e07cfe4 to d987e5a Compare July 3, 2023 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants