mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 13:25:12 +00:00
fix: rebase glitch
This commit is contained in:
@@ -23,7 +23,7 @@ ENV FIREBASE_PROJECT=
|
||||
ENV HOST=0.0.0.0
|
||||
ENV PORT=3000
|
||||
|
||||
# 编码相关
|
||||
# coding
|
||||
ENV TZ 'Asia/Shanghai'
|
||||
ENV LANG en_US.UTF-8
|
||||
ENV LANGUAGE en_US:en
|
||||
|
||||
@@ -67,7 +67,6 @@ Have a look at [the examples to see AFFiNE in action](https://app.affine.pro/).
|
||||
- [how-to-customize-rollup-config.md](docs/how-to-customize-rollup-config.md)
|
||||
- [how-to-auto-download-figma-assets-in-affine.md](docs/how-to-auto-download-figma-assets-in-affine.md)
|
||||
- [affine-icons-user-guide.md](docs/affine-icons-user-guide.md)
|
||||
- [How to develop api server in virgo](./apps/keck/README.md)
|
||||
|
||||
## Community
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
type ReturnUnobserve,
|
||||
} from '@toeverything/datasource/db-service';
|
||||
import { addNewGroup } from './recast-block';
|
||||
import { useIsOnDrag } from './hooks';
|
||||
|
||||
interface RenderRootProps {
|
||||
editor: BlockEditor;
|
||||
@@ -133,6 +134,8 @@ export const RenderRoot: FC<PropsWithChildren<RenderRootProps>> = ({
|
||||
};
|
||||
|
||||
const onDragOver = (event: React.DragEvent<Element>) => {
|
||||
event.dataTransfer.dropEffect = 'move';
|
||||
event.preventDefault();
|
||||
editor.dragDropManager.handlerEditorDragOver(event);
|
||||
if (editor.dragDropManager.isEnabled()) {
|
||||
editor.getHooks().onRootNodeDragOver(event);
|
||||
@@ -140,6 +143,7 @@ export const RenderRoot: FC<PropsWithChildren<RenderRootProps>> = ({
|
||||
};
|
||||
|
||||
const onDragOverCapture = (event: React.DragEvent<Element>) => {
|
||||
event.preventDefault();
|
||||
if (editor.dragDropManager.isEnabled()) {
|
||||
editor.getHooks().onRootNodeDragOver(event);
|
||||
}
|
||||
@@ -177,6 +181,7 @@ export const RenderRoot: FC<PropsWithChildren<RenderRootProps>> = ({
|
||||
onDragOverCapture={onDragOverCapture}
|
||||
onDragEnd={onDragEnd}
|
||||
onDrop={onDrop}
|
||||
isOnDrag={isOnDrag}
|
||||
>
|
||||
<Content style={{ maxWidth: pageWidth + 'px' }}>
|
||||
{children}
|
||||
|
||||
@@ -13,6 +13,7 @@ export function DragDropWrapper({
|
||||
block,
|
||||
}: DragDropWrapperProps) {
|
||||
const handlerDragOver: React.DragEventHandler<HTMLDivElement> = event => {
|
||||
event.preventDefault();
|
||||
if (block.dom) {
|
||||
editor.getHooks().afterOnNodeDragOver(event, {
|
||||
blockId: block.id,
|
||||
|
||||
@@ -15,7 +15,7 @@ type ScrollController = {
|
||||
};
|
||||
|
||||
export class ScrollManager {
|
||||
private _editor: Block_editor;
|
||||
private _editor: BlockEditor;
|
||||
private _scrollContainer: HTMLElement;
|
||||
private _animationFrame: null | number = null;
|
||||
private _eventName = 'scrolling';
|
||||
|
||||
@@ -143,7 +143,7 @@ export const useRecastView = () => {
|
||||
updateView,
|
||||
renameView,
|
||||
removeView,
|
||||
// TODO reorder API
|
||||
// TODO: reorder API
|
||||
|
||||
withKanbanView,
|
||||
};
|
||||
|
||||
@@ -192,7 +192,7 @@ export const CommandMenuContainer = ({
|
||||
useEffect(() => {
|
||||
const sub = hooks
|
||||
.get(HookType.ON_ROOT_NODE_KEYDOWN_CAPTURE)
|
||||
.subscribe(handle_key_down);
|
||||
.subscribe(handleKeyDown);
|
||||
|
||||
return () => {
|
||||
sub.unsubscribe();
|
||||
|
||||
@@ -34,6 +34,7 @@ export const InlineMenuContainer = ({ editor }: InlineMenuContainerProps) => {
|
||||
!editor.blockHelper.getCurrentSelection(anchorNode.id) ||
|
||||
editor.blockHelper.isSelectionCollapsed(anchorNode.id)
|
||||
) {
|
||||
setShowMenu(false);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -43,46 +44,34 @@ export const InlineMenuContainer = ({ editor }: InlineMenuContainerProps) => {
|
||||
setSelectionInfo(info);
|
||||
setShowMenu(true);
|
||||
setContainerStyle({
|
||||
left: rect.left - editor.container.getBoundingClientRect().left,
|
||||
top: anchorNode.dom.offsetTop - 64,
|
||||
left: rect.left - left,
|
||||
top: rect.top - top - 64,
|
||||
});
|
||||
});
|
||||
return unsubscribe;
|
||||
}, [editor]);
|
||||
|
||||
useEffect(() => {
|
||||
const hideInlineMenu = () => {
|
||||
setShowMenu(false);
|
||||
};
|
||||
editor.plugins.observe('hide-inline-menu', hideInlineMenu);
|
||||
|
||||
return () =>
|
||||
editor.plugins.unobserve('hide-inline-menu', hideInlineMenu);
|
||||
}, [editor.plugins]);
|
||||
|
||||
return showMenu && containerStyle ? (
|
||||
<ClickAwayListener onClickAway={() => setShowMenu(false)}>
|
||||
<Grow
|
||||
in={showMenu}
|
||||
style={{ transformOrigin: '0 0 0' }}
|
||||
{...{ timeout: 'auto' }}
|
||||
<Grow
|
||||
in={showMenu}
|
||||
style={{ transformOrigin: '0 0 0' }}
|
||||
{...{ timeout: 'auto' }}
|
||||
>
|
||||
<ToolbarContainer
|
||||
style={containerStyle}
|
||||
onMouseDown={e => {
|
||||
// prevent toolbar from taking focus away from editor
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}}
|
||||
>
|
||||
<ToolbarContainer
|
||||
style={containerStyle}
|
||||
onMouseDown={e => {
|
||||
// prevent toolbar from taking focus away from editor
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}}
|
||||
>
|
||||
<InlineMenuToolbar
|
||||
editor={editor}
|
||||
selectionInfo={selectionInfo}
|
||||
setShow={setShowMenu}
|
||||
/>
|
||||
</ToolbarContainer>
|
||||
</Grow>
|
||||
</ClickAwayListener>
|
||||
<InlineMenuToolbar
|
||||
editor={editor}
|
||||
selectionInfo={selectionInfo}
|
||||
setShow={setShowMenu}
|
||||
/>
|
||||
</ToolbarContainer>
|
||||
</Grow>
|
||||
) : null;
|
||||
};
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ export const Tooltip = forwardRef<
|
||||
>((props, ref) => {
|
||||
const { content, placement = 'top-start' } = props;
|
||||
const style = useTooltipStyle();
|
||||
// 如果没有内容,则永远隐藏
|
||||
// If there is no content, hide forever
|
||||
const visibleProp = content ? {} : { visible: false };
|
||||
return (
|
||||
<Popper
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { IOption } from 'ffc-js-client-side-sdk/esm/types';
|
||||
|
||||
export const config: IOption = {
|
||||
secret: process.env['AFFINE_FEATURE_FLAG_TOKEN'],
|
||||
secret: process.env['AFFINE_FEATURE_FLAG_TOKEN'] || '',
|
||||
anonymous: true,
|
||||
// user: {
|
||||
// userName: 'the user's user name',
|
||||
|
||||
Reference in New Issue
Block a user