Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(editor): remove embed iframe toolbar edit item (#11396)

donteatfriedriceb8fd6370f882
diff --git a/blocksuite/affine/blocks/block-embed/src/embed-iframe-block/components/embed-iframe-error-card.ts b/blocksuite/affine/blocks/block-embed/src/embed-iframe-block/components/embed-iframe-error-card.ts
index 0ec87fdd88..a74a0362a7 100644
--- a/blocksuite/affine/blocks/block-embed/src/embed-iframe-block/components/embed-iframe-error-card.ts
+++ b/blocksuite/affine/blocks/block-embed/src/embed-iframe-block/components/embed-iframe-error-card.ts
@@ -197,10 +197,7 @@ export class EmbedIframeErrorCard extends WithDisposable(LitElement) {
.std=${this.std}
.inSurface=${this.inSurface}
></embed-iframe-link-edit-popup>`,
- portalStyles: {
- zIndex: 'var(--affine-z-index-popover)',
- },
- container: this.host,
+ container: document.body,
computePosition: {
referenceElement: this._editButton,
placement: 'bottom-start',
diff --git a/blocksuite/affine/blocks/block-embed/src/embed-iframe-block/components/embed-iframe-link-input-popup.ts b/blocksuite/affine/blocks/block-embed/src/embed-iframe-block/components/embed-iframe-link-input-popup.ts
index 61be4ea13d..0115fcd58f 100644
--- a/blocksuite/affine/blocks/block-embed/src/embed-iframe-block/components/embed-iframe-link-input-popup.ts
+++ b/blocksuite/affine/blocks/block-embed/src/embed-iframe-block/components/embed-iframe-link-input-popup.ts
@@ -41,7 +41,6 @@ export class EmbedIframeLinkInputPopup extends EmbedIframeLinkInputBase {
border-radius: 8px;
background: ${unsafeCSSVarV2('layer/background/overlayPanel')};
box-shadow: ${unsafeCSSVar('overlayPanelShadow')};
- z-index: var(--affine-z-index-modal);
font-family: ${unsafeCSS(baseTheme.fontSansFamily)};
}
diff --git a/blocksuite/affine/blocks/block-embed/src/embed-iframe-block/embed-iframe-block.ts b/blocksuite/affine/blocks/block-embed/src/embed-iframe-block/embed-iframe-block.ts
index 6c82df5e95..91e408b4b7 100644
--- a/blocksuite/affine/blocks/block-embed/src/embed-iframe-block/embed-iframe-block.ts
+++ b/blocksuite/affine/blocks/block-embed/src/embed-iframe-block/embed-iframe-block.ts
@@ -228,10 +228,7 @@ export class EmbedIframeBlockComponent extends CaptionedBlockComponent<EmbedIfra
.inSurface=${this.inSurface}
.options=${options}
></embed-iframe-link-input-popup>`,
- portalStyles: {
- zIndex: 'var(--affine-z-index-popover)',
- },
- container: this.host,
+ container: document.body,
computePosition: {
referenceElement: this._blockContainer,
placement: 'bottom',
diff --git a/packages/frontend/core/src/blocksuite/extensions/editor-config/toolbar/index.ts b/packages/frontend/core/src/blocksuite/extensions/editor-config/toolbar/index.ts
index 1634fb0dec..c5eec6bc4f 100644
--- a/packages/frontend/core/src/blocksuite/extensions/editor-config/toolbar/index.ts
+++ b/packages/frontend/core/src/blocksuite/extensions/editor-config/toolbar/index.ts
@@ -971,11 +971,11 @@ const embedIframeToolbarConfig = {
},
actions: [
{
- id: 'a.copy-link-and-edit',
+ id: 'b.copy-link',
actions: [
{
id: 'copy-link',
- tooltip: 'Copy link',
+ tooltip: 'Copy original link',
icon: CopyIcon(),
run(ctx) {
const model = ctx.getCurrentBlockByType(
@@ -989,52 +989,14 @@ const embedIframeToolbarConfig = {
toast(ctx.host, 'Copied link to clipboard');
ctx.track('CopiedLink', {
- category: matchModels(model, [BookmarkBlockModel])
- ? 'bookmark'
+ category: matchModels(model, [EmbedIframeBlockModel])
+ ? 'embed iframe block'
: 'link',
type: 'card view',
control: 'copy link',
});
},
},
- {
- id: 'edit',
- tooltip: 'Edit',
- icon: EditIcon(),
- run(ctx) {
- const component = ctx.getCurrentBlockByType(
- EmbedIframeBlockComponent
- );
- if (!component) return;
-
- ctx.hide();
-
- const model = component.model;
- const abortController = new AbortController();
- abortController.signal.onabort = () => ctx.show();
-
- toggleEmbedCardEditModal(
- ctx.host,
- model,
- 'card',
- undefined,
- undefined,
- (_std, _component, props) => {
- ctx.store.updateBlock(model, props);
- component.requestUpdate();
- },
- abortController
- );
-
- ctx.track('OpenedAliasPopup', {
- category: matchModels(model, [BookmarkBlockModel])
- ? 'bookmark'
- : 'link',
- type: 'card view',
- control: 'edit',
- });
- },
- },
],
},
],