mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
@@ -1,5 +1,5 @@
|
||||
import { cssVar } from '@toeverything/theme';
|
||||
import { style } from '@vanilla-extract/css';
|
||||
import { globalStyle, style } from '@vanilla-extract/css';
|
||||
|
||||
export const root = style({
|
||||
containerType: 'inline-size',
|
||||
@@ -7,12 +7,18 @@ export const root = style({
|
||||
|
||||
export const editor = style({
|
||||
vars: {
|
||||
'--affine-editor-width': '100%',
|
||||
'--affine-editor-side-padding': '160px',
|
||||
},
|
||||
minHeight: '100%',
|
||||
});
|
||||
|
||||
globalStyle(`[data-full-width-layout="true"] ${editor}`, {
|
||||
vars: {
|
||||
'--affine-editor-width': '100%',
|
||||
'--affine-editor-side-padding': '24px',
|
||||
},
|
||||
});
|
||||
|
||||
export const affineDocViewport = style({
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
|
||||
@@ -33,9 +33,9 @@ export const modalContentContainer = style({
|
||||
borderRadius: 12,
|
||||
selectors: {
|
||||
'[data-padding="true"] &': {
|
||||
width: '90%',
|
||||
height: '90%',
|
||||
maxWidth: 1248,
|
||||
width: 'calc(100% - 64px)',
|
||||
height: 'calc(100% - 64px)',
|
||||
paddingRight: 48,
|
||||
},
|
||||
'&[data-anime-state="animating"]': {
|
||||
opacity: 0,
|
||||
@@ -73,7 +73,7 @@ export const modalContent = style({
|
||||
|
||||
export const modalControls = style({
|
||||
position: 'absolute',
|
||||
left: '100%',
|
||||
right: 0,
|
||||
top: 0,
|
||||
zIndex: -1,
|
||||
minWidth: '48px',
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { useAppSettingHelper } from '@affine/core/hooks/affine/use-app-setting-helper';
|
||||
import * as Dialog from '@radix-ui/react-dialog';
|
||||
import anime, { type AnimeInstance, type AnimeParams } from 'animejs';
|
||||
import clsx from 'clsx';
|
||||
@@ -89,6 +90,7 @@ export const PeekViewModalContainer = forwardRef<
|
||||
const overlayRef = useRef<HTMLDivElement>(null);
|
||||
const controlsRef = useRef<HTMLDivElement>(null);
|
||||
const prevAnimeMap = useRef<Record<string, AnimeInstance | undefined>>({});
|
||||
const { appSettings } = useAppSettingHelper();
|
||||
|
||||
const animateControls = useCallback((animateIn = false) => {
|
||||
const controls = controlsRef.current;
|
||||
@@ -318,6 +320,7 @@ export const PeekViewModalContainer = forwardRef<
|
||||
>
|
||||
<div
|
||||
data-anime-state={animeState}
|
||||
data-full-width-layout={appSettings.fullWidthLayout}
|
||||
ref={contentClipRef}
|
||||
className={styles.modalContentContainer}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user