deploy: v0.12 存档迁移+考古日志滚动条

This commit is contained in:
2026-06-24 03:04:38 +00:00
parent 4831505ef9
commit b4c6111516
58986 changed files with 7569452 additions and 31667 deletions
+43
View File
@@ -0,0 +1,43 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import type { LexicalEditor } from 'lexical';
import * as React from 'react';
export type ContentEditableElementProps = {
editor: LexicalEditor;
ariaActiveDescendant?: React.AriaAttributes['aria-activedescendant'];
ariaAutoComplete?: React.AriaAttributes['aria-autocomplete'];
ariaControls?: React.AriaAttributes['aria-controls'];
ariaDescribedBy?: React.AriaAttributes['aria-describedby'];
ariaErrorMessage?: React.AriaAttributes['aria-errormessage'];
ariaExpanded?: React.AriaAttributes['aria-expanded'];
ariaInvalid?: React.AriaAttributes['aria-invalid'];
ariaLabel?: React.AriaAttributes['aria-label'];
ariaLabelledBy?: React.AriaAttributes['aria-labelledby'];
ariaMultiline?: React.AriaAttributes['aria-multiline'];
ariaOwns?: React.AriaAttributes['aria-owns'];
ariaRequired?: React.AriaAttributes['aria-required'];
autoCapitalize?: HTMLDivElement['autocapitalize'];
'data-testid'?: string | null | undefined;
} & Omit<React.AllHTMLAttributes<HTMLDivElement>, 'placeholder'>;
export declare const ContentEditableElement: React.ForwardRefExoticComponent<{
editor: LexicalEditor;
ariaActiveDescendant?: React.AriaAttributes['aria-activedescendant'];
ariaAutoComplete?: React.AriaAttributes['aria-autocomplete'];
ariaControls?: React.AriaAttributes['aria-controls'];
ariaDescribedBy?: React.AriaAttributes['aria-describedby'];
ariaErrorMessage?: React.AriaAttributes['aria-errormessage'];
ariaExpanded?: React.AriaAttributes['aria-expanded'];
ariaInvalid?: React.AriaAttributes['aria-invalid'];
ariaLabel?: React.AriaAttributes['aria-label'];
ariaLabelledBy?: React.AriaAttributes['aria-labelledby'];
ariaMultiline?: React.AriaAttributes['aria-multiline'];
ariaOwns?: React.AriaAttributes['aria-owns'];
ariaRequired?: React.AriaAttributes['aria-required'];
autoCapitalize?: string | undefined;
'data-testid'?: string | null | undefined;
} & Omit<React.AllHTMLAttributes<HTMLDivElement>, "placeholder"> & React.RefAttributes<HTMLDivElement>>;
+52
View File
@@ -0,0 +1,52 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import type { JSX } from 'react';
import { CommandListenerPriority, LexicalCommand, LexicalEditor, TextNode } from 'lexical';
import { MutableRefObject, ReactPortal } from 'react';
export type MenuTextMatch = {
leadOffset: number;
matchingString: string;
replaceableString: string;
};
export type MenuResolution = {
match?: MenuTextMatch;
getRect: () => DOMRect;
};
export declare const PUNCTUATION = "\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%'\"~=<>_:;";
export declare class MenuOption {
key: string;
ref?: MutableRefObject<HTMLElement | null>;
constructor(key: string);
setRefElement(element: HTMLElement | null): void;
}
export type MenuRenderFn<TOption extends MenuOption> = (anchorElementRef: MutableRefObject<HTMLElement | null>, itemProps: {
selectedIndex: number | null;
selectOptionAndCleanUp: (option: TOption) => void;
setHighlightedIndex: (index: number) => void;
options: Array<TOption>;
}, matchingString: string | null) => ReactPortal | JSX.Element | null;
export declare function getScrollParent(element: HTMLElement, includeHidden: boolean): HTMLElement | HTMLBodyElement;
export declare function useDynamicPositioning(resolution: MenuResolution | null, targetElement: HTMLElement | null, onReposition: () => void, onVisibilityChange?: (isInView: boolean) => void): void;
export declare const SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND: LexicalCommand<{
index: number;
option: MenuOption;
}>;
export declare function LexicalMenu<TOption extends MenuOption>({ close, editor, anchorElementRef, resolution, options, menuRenderFn, onSelectOption, shouldSplitNodeWithQuery, commandPriority, preselectFirstItem, }: {
close: () => void;
editor: LexicalEditor;
anchorElementRef: MutableRefObject<HTMLElement | null>;
resolution: MenuResolution;
options: Array<TOption>;
shouldSplitNodeWithQuery?: boolean;
menuRenderFn: MenuRenderFn<TOption>;
onSelectOption: (option: TOption, textNodeContainingQuery: TextNode | null, closeMenu: () => void, matchingString: string) => void;
commandPriority?: CommandListenerPriority;
preselectFirstItem?: boolean;
}): JSX.Element | null;
export declare function useMenuAnchorRef(resolution: MenuResolution | null, setResolution: (r: MenuResolution | null) => void, className?: string, parent?: HTMLElement | undefined, shouldIncludePageYOffset__EXPERIMENTAL?: boolean): MutableRefObject<HTMLElement | null>;
export type TriggerFn = (text: string, editor: LexicalEditor) => MenuTextMatch | null;
+9
View File
@@ -0,0 +1,9 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
/// <reference types="react" />
export declare function mergeRefs<T>(...refs: Array<React.MutableRefObject<T> | React.LegacyRef<T> | undefined | null>): React.RefCallback<T>;
+21
View File
@@ -0,0 +1,21 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
export declare class Point {
private readonly _x;
private readonly _y;
constructor(x: number, y: number);
get x(): number;
get y(): number;
equals({ x, y }: Point): boolean;
calcDeltaXTo({ x }: Point): number;
calcDeltaYTo({ y }: Point): number;
calcHorizontalDistanceTo(point: Point): number;
calcVerticalDistance(point: Point): number;
calcDistanceTo(point: Point): number;
}
export declare function isPoint(x: unknown): x is Point;
+45
View File
@@ -0,0 +1,45 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import { Point } from './point';
type ContainsPointReturn = {
result: boolean;
reason: {
isOnTopSide: boolean;
isOnBottomSide: boolean;
isOnLeftSide: boolean;
isOnRightSide: boolean;
};
};
export declare class Rectangle {
private readonly _left;
private readonly _top;
private readonly _right;
private readonly _bottom;
constructor(left: number, top: number, right: number, bottom: number);
get top(): number;
get right(): number;
get bottom(): number;
get left(): number;
get width(): number;
get height(): number;
equals({ top, left, bottom, right }: Rectangle): boolean;
contains({ x, y }: Point): ContainsPointReturn;
contains({ top, left, bottom, right }: Rectangle): boolean;
intersectsWith(rect: Rectangle): boolean;
generateNewRect({ left, top, right, bottom, }: {
left?: number | undefined;
top?: number | undefined;
right?: number | undefined;
bottom?: number | undefined;
}): Rectangle;
static fromLTRB(left: number, top: number, right: number, bottom: number): Rectangle;
static fromLWTH(left: number, width: number, top: number, height: number): Rectangle;
static fromPoints(startPoint: Point, endPoint: Point): Rectangle;
static fromDOM(dom: HTMLElement): Rectangle;
}
export {};
+9
View File
@@ -0,0 +1,9 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import type { LexicalEditor } from 'lexical';
export declare function useCanShowPlaceholder(editor: LexicalEditor): boolean;
+16
View File
@@ -0,0 +1,16 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import type { LexicalEditor } from 'lexical';
import { OverflowNode } from '@lexical/overflow';
type OptionalProps = {
remainingCharacters?: (characters: number) => void;
strlen?: (input: string) => number;
};
export declare function useCharacterLimit(editor: LexicalEditor, maxCharacters: number, optional?: OptionalProps): void;
export declare function $mergePrevious(overflowNode: OverflowNode): void;
export {};
+17
View File
@@ -0,0 +1,17 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import type { LexicalEditor } from 'lexical';
import type { JSX } from 'react';
import * as React from 'react';
type ErrorBoundaryProps = {
children: JSX.Element;
onError: (error: Error) => void;
};
export type ErrorBoundaryType = React.ComponentClass<ErrorBoundaryProps> | React.FC<ErrorBoundaryProps>;
export declare function useDecorators(editor: LexicalEditor, ErrorBoundary: ErrorBoundaryType): Array<JSX.Element>;
export {};
+10
View File
@@ -0,0 +1,10 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import type { HistoryState } from '@lexical/history';
import type { LexicalEditor } from 'lexical';
export declare function useHistory(editor: LexicalEditor, externalHistoryState?: HistoryState, delay?: number): void;
+9
View File
@@ -0,0 +1,9 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import type { LexicalEditor } from 'lexical';
export declare function useList(editor: LexicalEditor): void;
+9
View File
@@ -0,0 +1,9 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import type { LexicalEditor } from 'lexical';
export declare function usePlainTextSetup(editor: LexicalEditor): void;
+9
View File
@@ -0,0 +1,9 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import type { LexicalEditor } from 'lexical';
export declare function useRichTextSetup(editor: LexicalEditor): void;
+17
View File
@@ -0,0 +1,17 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import type { Binding, Provider, SyncCursorPositionsFn } from '@lexical/yjs';
import type { LexicalEditor } from 'lexical';
import type { JSX } from 'react';
import * as React from 'react';
import { Doc } from 'yjs';
import { InitialEditorStateType } from '../LexicalComposer';
export type CursorsContainerRef = React.MutableRefObject<HTMLElement | null>;
export declare function useYjsCollaboration(editor: LexicalEditor, id: string, provider: Provider, docMap: Map<string, Doc>, name: string, color: string, shouldBootstrap: boolean, binding: Binding, setDoc: React.Dispatch<React.SetStateAction<Doc | undefined>>, cursorsContainerRef?: CursorsContainerRef, initialEditorState?: InitialEditorStateType, awarenessData?: object, syncCursorPositionsFn?: SyncCursorPositionsFn): JSX.Element;
export declare function useYjsFocusTracking(editor: LexicalEditor, provider: Provider, name: string, color: string, awarenessData?: object): void;
export declare function useYjsHistory(editor: LexicalEditor, binding: Binding): () => void;