mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-17 14:27:02 +08:00
fix(core): some artifact styles (#13020)
fix AI-299, AI-296 #### PR Dependency Tree * **PR #13020** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Style** * Improved layout alignment in the artifact preview panel for better visual consistency. * Enforced a minimum width for linked document banners to ensure consistent appearance. * **Bug Fixes** * Updated artifact and document compose tools so that clicking an artifact result always opens the preview panel, instead of toggling or closing it unexpectedly. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -168,6 +168,7 @@ export const styles = css`
|
|||||||
.affine-embed-linked-doc-banner {
|
.affine-embed-linked-doc-banner {
|
||||||
margin: 12px 12px 0px 0px;
|
margin: 12px 12px 0px 0px;
|
||||||
width: 204px;
|
width: 204px;
|
||||||
|
min-width: 204px;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
height: 102px;
|
height: 102px;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ export class ArtifactPreviewPanel extends WithDisposable(ShadowlessElement) {
|
|||||||
.artifact-panel-actions {
|
.artifact-panel-actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
gap: 4px;
|
gap: 4px;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,11 +12,7 @@ import { property, state } from 'lit/decorators.js';
|
|||||||
import { classMap } from 'lit/directives/class-map.js';
|
import { classMap } from 'lit/directives/class-map.js';
|
||||||
import { bundledLanguagesInfo, type ThemedToken } from 'shiki';
|
import { bundledLanguagesInfo, type ThemedToken } from 'shiki';
|
||||||
|
|
||||||
import {
|
import { renderPreviewPanel } from './artifacts-preview-panel';
|
||||||
closePreviewPanel,
|
|
||||||
isPreviewPanelOpen,
|
|
||||||
renderPreviewPanel,
|
|
||||||
} from './artifacts-preview-panel';
|
|
||||||
import type { ToolError } from './type';
|
import type { ToolError } from './type';
|
||||||
|
|
||||||
interface CodeArtifactToolCall {
|
interface CodeArtifactToolCall {
|
||||||
@@ -331,11 +327,6 @@ export class CodeArtifactTool extends WithDisposable(ShadowlessElement) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onClick = () => {
|
const onClick = () => {
|
||||||
if (isPreviewPanelOpen(this)) {
|
|
||||||
closePreviewPanel(this);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const copyHTML = async () => {
|
const copyHTML = async () => {
|
||||||
if (this.std) {
|
if (this.std) {
|
||||||
await navigator.clipboard
|
await navigator.clipboard
|
||||||
|
|||||||
@@ -19,11 +19,7 @@ import { css, html, nothing } from 'lit';
|
|||||||
import { property } from 'lit/decorators.js';
|
import { property } from 'lit/decorators.js';
|
||||||
|
|
||||||
import { getCustomPageEditorBlockSpecs } from '../text-renderer';
|
import { getCustomPageEditorBlockSpecs } from '../text-renderer';
|
||||||
import {
|
import { renderPreviewPanel } from './artifacts-preview-panel';
|
||||||
closePreviewPanel,
|
|
||||||
isPreviewPanelOpen,
|
|
||||||
renderPreviewPanel,
|
|
||||||
} from './artifacts-preview-panel';
|
|
||||||
import type { ToolError } from './type';
|
import type { ToolError } from './type';
|
||||||
|
|
||||||
interface DocComposeToolCall {
|
interface DocComposeToolCall {
|
||||||
@@ -132,11 +128,6 @@ export class DocComposeTool extends WithDisposable(ShadowlessElement) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const onClick = () => {
|
const onClick = () => {
|
||||||
if (isPreviewPanelOpen(this)) {
|
|
||||||
closePreviewPanel(this);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const copyMarkdown = async () => {
|
const copyMarkdown = async () => {
|
||||||
await navigator.clipboard
|
await navigator.clipboard
|
||||||
.writeText(result.markdown)
|
.writeText(result.markdown)
|
||||||
|
|||||||
Reference in New Issue
Block a user