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