This commit is contained in:
Feng 2025-04-18 07:41:36 +05:00 committed by GitHub
commit b7d3ce0c79
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 2 deletions

View file

@ -326,7 +326,7 @@ export const actionChangeStrokeColor = register({
<> <>
<h3 aria-hidden="true">{t("labels.stroke")}</h3> <h3 aria-hidden="true">{t("labels.stroke")}</h3>
<ColorPicker <ColorPicker
topPicks={DEFAULT_ELEMENT_STROKE_PICKS} topPicks={appProps.strokeColorTopPicks ?? DEFAULT_ELEMENT_STROKE_PICKS}
palette={DEFAULT_ELEMENT_STROKE_COLOR_PALETTE} palette={DEFAULT_ELEMENT_STROKE_COLOR_PALETTE}
type="elementStroke" type="elementStroke"
label={t("labels.stroke")} label={t("labels.stroke")}
@ -372,7 +372,9 @@ export const actionChangeBackgroundColor = register({
<> <>
<h3 aria-hidden="true">{t("labels.background")}</h3> <h3 aria-hidden="true">{t("labels.background")}</h3>
<ColorPicker <ColorPicker
topPicks={DEFAULT_ELEMENT_BACKGROUND_PICKS} topPicks={
appProps.backgroundColorTopPicks ?? DEFAULT_ELEMENT_BACKGROUND_PICKS
}
palette={DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE} palette={DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE}
type="elementBackground" type="elementBackground"
label={t("labels.background")} label={t("labels.background")}

View file

@ -53,6 +53,8 @@ const ExcalidrawBase = (props: ExcalidrawProps) => {
renderEmbeddable, renderEmbeddable,
aiEnabled, aiEnabled,
showDeprecatedFonts, showDeprecatedFonts,
strokeColorTopPicks,
backgroundColorTopPicks,
} = props; } = props;
const canvasActions = props.UIOptions?.canvasActions; const canvasActions = props.UIOptions?.canvasActions;
@ -143,6 +145,8 @@ const ExcalidrawBase = (props: ExcalidrawProps) => {
renderEmbeddable={renderEmbeddable} renderEmbeddable={renderEmbeddable}
aiEnabled={aiEnabled !== false} aiEnabled={aiEnabled !== false}
showDeprecatedFonts={showDeprecatedFonts} showDeprecatedFonts={showDeprecatedFonts}
strokeColorTopPicks={strokeColorTopPicks}
backgroundColorTopPicks={backgroundColorTopPicks}
> >
{children} {children}
</App> </App>

View file

@ -3,6 +3,7 @@ import type {
UserIdleState, UserIdleState,
throttleRAF, throttleRAF,
MIME_TYPES, MIME_TYPES,
ColorTuple,
} from "@excalidraw/common"; } from "@excalidraw/common";
import type { SuggestedBinding } from "@excalidraw/element/binding"; import type { SuggestedBinding } from "@excalidraw/element/binding";
@ -601,6 +602,8 @@ export interface ExcalidrawProps {
) => JSX.Element | null; ) => JSX.Element | null;
aiEnabled?: boolean; aiEnabled?: boolean;
showDeprecatedFonts?: boolean; showDeprecatedFonts?: boolean;
strokeColorTopPicks?: ColorTuple;
backgroundColorTopPicks?: ColorTuple;
} }
export type SceneData = { export type SceneData = {