fix: use react-resizable-panels (#2679)

This commit is contained in:
Himself65
2023-06-04 23:33:36 +08:00
committed by GitHub
parent acda594cba
commit 1716e7a397
6 changed files with 88 additions and 165 deletions

View File

@@ -10,7 +10,6 @@ import type { Workspace } from '@blocksuite/store';
import type { Page } from '@playwright/test';
import type { WritableAtom } from 'jotai';
import type { ReactElement } from 'react';
import type { MosaicDirection, MosaicNode } from 'react-mosaic-component';
/**
* A code loader interface of the plugin API.
@@ -81,14 +80,23 @@ export enum ReleaseStage {
DEV = 'dev',
}
export type LayoutDirection = 'horizontal' | 'vertical';
export type LayoutNode = LayoutParentNode | string;
export type LayoutParentNode = {
direction: LayoutDirection;
splitPercentage: number; // 0 - 100
first: LayoutNode;
second: LayoutNode;
};
export type ExpectedLayout =
| {
direction: MosaicDirection;
direction: LayoutDirection;
// the first element is always the editor
first: 'editor';
second: MosaicNode<string>;
second: LayoutNode;
// the percentage should be greater than 70
splitPercentage?: number;
splitPercentage: number;
}
| 'editor';