This commit is contained in:
Feng 2025-04-14 10:27:27 +09:00 committed by GitHub
commit 899e94f3e2
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>
<ColorPicker
topPicks={DEFAULT_ELEMENT_STROKE_PICKS}
topPicks={appProps.strokeColorTopPicks ?? DEFAULT_ELEMENT_STROKE_PICKS}
palette={DEFAULT_ELEMENT_STROKE_COLOR_PALETTE}
type="elementStroke"
label={t("labels.stroke")}
@ -372,7 +372,9 @@ export const actionChangeBackgroundColor = register({
<>
<h3 aria-hidden="true">{t("labels.background")}</h3>
<ColorPicker
topPicks={DEFAULT_ELEMENT_BACKGROUND_PICKS}
topPicks={
appProps.backgroundColorTopPicks ?? DEFAULT_ELEMENT_BACKGROUND_PICKS
}
palette={DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE}
type="elementBackground"
label={t("labels.background")}

View file

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

View file

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