mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-26 10:45:57 +08:00
fix(editor): remove embed iframe toolbar edit item (#11396)
This commit is contained in:
@@ -197,10 +197,7 @@ export class EmbedIframeErrorCard extends WithDisposable(LitElement) {
|
|||||||
.std=${this.std}
|
.std=${this.std}
|
||||||
.inSurface=${this.inSurface}
|
.inSurface=${this.inSurface}
|
||||||
></embed-iframe-link-edit-popup>`,
|
></embed-iframe-link-edit-popup>`,
|
||||||
portalStyles: {
|
container: document.body,
|
||||||
zIndex: 'var(--affine-z-index-popover)',
|
|
||||||
},
|
|
||||||
container: this.host,
|
|
||||||
computePosition: {
|
computePosition: {
|
||||||
referenceElement: this._editButton,
|
referenceElement: this._editButton,
|
||||||
placement: 'bottom-start',
|
placement: 'bottom-start',
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ export class EmbedIframeLinkInputPopup extends EmbedIframeLinkInputBase {
|
|||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
background: ${unsafeCSSVarV2('layer/background/overlayPanel')};
|
background: ${unsafeCSSVarV2('layer/background/overlayPanel')};
|
||||||
box-shadow: ${unsafeCSSVar('overlayPanelShadow')};
|
box-shadow: ${unsafeCSSVar('overlayPanelShadow')};
|
||||||
z-index: var(--affine-z-index-modal);
|
|
||||||
font-family: ${unsafeCSS(baseTheme.fontSansFamily)};
|
font-family: ${unsafeCSS(baseTheme.fontSansFamily)};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -228,10 +228,7 @@ export class EmbedIframeBlockComponent extends CaptionedBlockComponent<EmbedIfra
|
|||||||
.inSurface=${this.inSurface}
|
.inSurface=${this.inSurface}
|
||||||
.options=${options}
|
.options=${options}
|
||||||
></embed-iframe-link-input-popup>`,
|
></embed-iframe-link-input-popup>`,
|
||||||
portalStyles: {
|
container: document.body,
|
||||||
zIndex: 'var(--affine-z-index-popover)',
|
|
||||||
},
|
|
||||||
container: this.host,
|
|
||||||
computePosition: {
|
computePosition: {
|
||||||
referenceElement: this._blockContainer,
|
referenceElement: this._blockContainer,
|
||||||
placement: 'bottom',
|
placement: 'bottom',
|
||||||
|
|||||||
@@ -971,11 +971,11 @@ const embedIframeToolbarConfig = {
|
|||||||
},
|
},
|
||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
id: 'a.copy-link-and-edit',
|
id: 'b.copy-link',
|
||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
id: 'copy-link',
|
id: 'copy-link',
|
||||||
tooltip: 'Copy link',
|
tooltip: 'Copy original link',
|
||||||
icon: CopyIcon(),
|
icon: CopyIcon(),
|
||||||
run(ctx) {
|
run(ctx) {
|
||||||
const model = ctx.getCurrentBlockByType(
|
const model = ctx.getCurrentBlockByType(
|
||||||
@@ -989,52 +989,14 @@ const embedIframeToolbarConfig = {
|
|||||||
toast(ctx.host, 'Copied link to clipboard');
|
toast(ctx.host, 'Copied link to clipboard');
|
||||||
|
|
||||||
ctx.track('CopiedLink', {
|
ctx.track('CopiedLink', {
|
||||||
category: matchModels(model, [BookmarkBlockModel])
|
category: matchModels(model, [EmbedIframeBlockModel])
|
||||||
? 'bookmark'
|
? 'embed iframe block'
|
||||||
: 'link',
|
: 'link',
|
||||||
type: 'card view',
|
type: 'card view',
|
||||||
control: 'copy link',
|
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',
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user