Virtual whiteboard for sketching hand-drawn like diagrams
refactor: Rename appearance to theme (#3237)
Aakansha Doshif1daff243735
diff --git a/src/actions/actionAlign.tsx b/src/actions/actionAlign.tsxindex 5397df9b4b..3c60703cd3 100644--- a/src/actions/actionAlign.tsx+++ b/src/actions/actionAlign.tsx@@ -58,7 +58,7 @@ export const actionAlignTop = register({<ToolButtonhidden={!enableActionGroup(elements, appState)}type="button"- icon={<AlignTopIcon appearance={appState.appearance} />}+ icon={<AlignTopIcon theme={appState.theme} />}onClick={() => updateData(null)}title={`${t("labels.alignTop")} — ${getShortcutKey("CtrlOrCmd+Shift+Up",@@ -87,7 +87,7 @@ export const actionAlignBottom = register({<ToolButtonhidden={!enableActionGroup(elements, appState)}type="button"- icon={<AlignBottomIcon appearance={appState.appearance} />}+ icon={<AlignBottomIcon theme={appState.theme} />}onClick={() => updateData(null)}title={`${t("labels.alignBottom")} — ${getShortcutKey("CtrlOrCmd+Shift+Down",@@ -116,7 +116,7 @@ export const actionAlignLeft = register({<ToolButtonhidden={!enableActionGroup(elements, appState)}type="button"- icon={<AlignLeftIcon appearance={appState.appearance} />}+ icon={<AlignLeftIcon theme={appState.theme} />}onClick={() => updateData(null)}title={`${t("labels.alignLeft")} — ${getShortcutKey("CtrlOrCmd+Shift+Left",@@ -145,7 +145,7 @@ export const actionAlignRight = register({<ToolButtonhidden={!enableActionGroup(elements, appState)}type="button"- icon={<AlignRightIcon appearance={appState.appearance} />}+ icon={<AlignRightIcon theme={appState.theme} />}onClick={() => updateData(null)}title={`${t("labels.alignRight")} — ${getShortcutKey("CtrlOrCmd+Shift+Right",@@ -172,7 +172,7 @@ export const actionAlignVerticallyCentered = register({<ToolButtonhidden={!enableActionGroup(elements, appState)}type="button"- icon={<CenterVerticallyIcon appearance={appState.appearance} />}+ icon={<CenterVerticallyIcon theme={appState.theme} />}onClick={() => updateData(null)}title={t("labels.centerVertically")}aria-label={t("labels.centerVertically")}@@ -197,7 +197,7 @@ export const actionAlignHorizontallyCentered = register({<ToolButtonhidden={!enableActionGroup(elements, appState)}type="button"- icon={<CenterHorizontallyIcon appearance={appState.appearance} />}+ icon={<CenterHorizontallyIcon theme={appState.theme} />}onClick={() => updateData(null)}title={t("labels.centerHorizontally")}aria-label={t("labels.centerHorizontally")}diff --git a/src/actions/actionCanvas.tsx b/src/actions/actionCanvas.tsxindex 4a82008598..9f23ef0400 100644--- a/src/actions/actionCanvas.tsx+++ b/src/actions/actionCanvas.tsx@@ -48,7 +48,7 @@ export const actionClearCanvas = register({),appState: {...getDefaultAppState(),- appearance: appState.appearance,+ theme: appState.theme,elementLocked: appState.elementLocked,exportBackground: appState.exportBackground,exportEmbedScene: appState.exportEmbedScene,diff --git a/src/actions/actionDistribute.tsx b/src/actions/actionDistribute.tsxindex fdd8267c1f..b197575b01 100644--- a/src/actions/actionDistribute.tsx+++ b/src/actions/actionDistribute.tsx@@ -53,7 +53,7 @@ export const distributeHorizontally = register({<ToolButtonhidden={!enableActionGroup(elements, appState)}type="button"- icon={<DistributeHorizontallyIcon appearance={appState.appearance} />}+ icon={<DistributeHorizontallyIcon theme={appState.theme} />}onClick={() => updateData(null)}title={`${t("labels.distributeHorizontally")} — ${getShortcutKey("Alt+H",@@ -81,7 +81,7 @@ export const distributeVertically = register({<ToolButtonhidden={!enableActionGroup(elements, appState)}type="button"- icon={<DistributeVerticallyIcon appearance={appState.appearance} />}+ icon={<DistributeVerticallyIcon theme={appState.theme} />}onClick={() => updateData(null)}title={`${t("labels.distributeVertically")} — ${getShortcutKey("Alt+V")}`}aria-label={t("labels.distributeVertically")}diff --git a/src/actions/actionExport.tsx b/src/actions/actionExport.tsxindex cf303f79b3..9ad5d73272 100644--- a/src/actions/actionExport.tsx+++ b/src/actions/actionExport.tsx@@ -225,8 +225,8 @@ export const actionExportWithDarkMode = register({><DarkModeTogglevalue={appState.exportWithDarkMode ? "dark" : "light"}- onChange={(appearance: Appearence) => {- updateData(appearance === "dark");+ onChange={(theme: Appearence) => {+ updateData(theme === "dark");}}title={t("labels.toggleExportColorScheme")}/>diff --git a/src/actions/actionGroup.tsx b/src/actions/actionGroup.tsxindex a5d8e226e5..2e4a8a34b1 100644--- a/src/actions/actionGroup.tsx+++ b/src/actions/actionGroup.tsx@@ -134,7 +134,7 @@ export const actionGroup = register({<ToolButtonhidden={!enableActionGroup(elements, appState)}type="button"- icon={<GroupIcon appearance={appState.appearance} />}+ icon={<GroupIcon theme={appState.theme} />}onClick={() => updateData(null)}title={`${t("labels.group")} — ${getShortcutKey("CtrlOrCmd+G")}`}aria-label={t("labels.group")}@@ -181,7 +181,7 @@ export const actionUngroup = register({<ToolButtontype="button"hidden={getSelectedGroupIds(appState).length === 0}- icon={<UngroupIcon appearance={appState.appearance} />}+ icon={<UngroupIcon theme={appState.theme} />}onClick={() => updateData(null)}title={`${t("labels.ungroup")} — ${getShortcutKey("CtrlOrCmd+Shift+G")}`}aria-label={t("labels.ungroup")}diff --git a/src/actions/actionProperties.tsx b/src/actions/actionProperties.tsxindex b6e39fa323..b70e55f1f4 100644--- a/src/actions/actionProperties.tsx+++ b/src/actions/actionProperties.tsx@@ -169,17 +169,17 @@ export const actionChangeFillStyle = register({{value: "hachure",text: t("labels.hachure"),- icon: <FillHachureIcon appearance={appState.appearance} />,+ icon: <FillHachureIcon theme={appState.theme} />,},{value: "cross-hatch",text: t("labels.crossHatch"),- icon: <FillCrossHatchIcon appearance={appState.appearance} />,+ icon: <FillCrossHatchIcon theme={appState.theme} />,},{value: "solid",text: t("labels.solid"),- icon: <FillSolidIcon appearance={appState.appearance} />,+ icon: <FillSolidIcon theme={appState.theme} />,},]}group="fill"@@ -219,32 +219,17 @@ export const actionChangeStrokeWidth = register({{value: 1,text: t("labels.thin"),- icon: (- <StrokeWidthIcon- appearance={appState.appearance}- strokeWidth={2}- />- ),+ icon: <StrokeWidthIcon theme={appState.theme} strokeWidth={2} />,},{value: 2,text: t("labels.bold"),- icon: (- <StrokeWidthIcon- appearance={appState.appearance}- strokeWidth={6}- />- ),+ icon: <StrokeWidthIcon theme={appState.theme} strokeWidth={6} />,},{value: 4,text: t("labels.extraBold"),- icon: (- <StrokeWidthIcon- appearance={appState.appearance}- strokeWidth={10}- />- ),+ icon: <StrokeWidthIcon theme={appState.theme} strokeWidth={10} />,},]}value={getFormValue(@@ -282,17 +267,17 @@ export const actionChangeSloppiness = register({{value: 0,text: t("labels.architect"),- icon: <SloppinessArchitectIcon appearance={appState.appearance} />,+ icon: <SloppinessArchitectIcon theme={appState.theme} />,},{value: 1,text: t("labels.artist"),- icon: <SloppinessArtistIcon appearance={appState.appearance} />,+ icon: <SloppinessArtistIcon theme={appState.theme} />,},{value: 2,text: t("labels.cartoonist"),- icon: <SloppinessCartoonistIcon appearance={appState.appearance} />,+ icon: <SloppinessCartoonistIcon theme={appState.theme} />,},]}value={getFormValue(@@ -329,17 +314,17 @@ export const actionChangeStrokeStyle = register({{value: "solid",text: t("labels.strokeStyle_solid"),- icon: <StrokeStyleSolidIcon appearance={appState.appearance} />,+ icon: <StrokeStyleSolidIcon theme={appState.theme} />,},{value: "dashed",text: t("labels.strokeStyle_dashed"),- icon: <StrokeStyleDashedIcon appearance={appState.appearance} />,+ icon: <StrokeStyleDashedIcon theme={appState.theme} />,},{value: "dotted",text: t("labels.strokeStyle_dotted"),- icon: <StrokeStyleDottedIcon appearance={appState.appearance} />,+ icon: <StrokeStyleDottedIcon theme={appState.theme} />,},]}value={getFormValue(@@ -580,12 +565,12 @@ export const actionChangeSharpness = register({{value: "sharp",text: t("labels.sharp"),- icon: <EdgeSharpIcon appearance={appState.appearance} />,+ icon: <EdgeSharpIcon theme={appState.theme} />,},{value: "round",text: t("labels.round"),- icon: <EdgeRoundIcon appearance={appState.appearance} />,+ icon: <EdgeRoundIcon theme={appState.theme} />,},]}value={getFormValue(@@ -653,40 +638,27 @@ export const actionChangeArrowhead = register({{value: null,text: t("labels.arrowhead_none"),- icon: <ArrowheadNoneIcon appearance={appState.appearance} />,+ icon: <ArrowheadNoneIcon theme={appState.theme} />,keyBinding: "q",},{value: "arrow",text: t("labels.arrowhead_arrow"),icon: (- <ArrowheadArrowIcon- appearance={appState.appearance}- flip={!isRTL}- />+ <ArrowheadArrowIcon theme={appState.theme} flip={!isRTL} />),keyBinding: "w",},{value: "bar",text: t("labels.arrowhead_bar"),- icon: (- <ArrowheadBarIcon- appearance={appState.appearance}- flip={!isRTL}- />- ),+ icon: <ArrowheadBarIcon theme={appState.theme} flip={!isRTL} />,keyBinding: "e",},{value: "dot",text: t("labels.arrowhead_dot"),- icon: (- <ArrowheadDotIcon- appearance={appState.appearance}- flip={!isRTL}- />- ),+ icon: <ArrowheadDotIcon theme={appState.theme} flip={!isRTL} />,keyBinding: "r",},]}@@ -709,40 +681,27 @@ export const actionChangeArrowhead = register({value: null,text: t("labels.arrowhead_none"),keyBinding: "q",- icon: <ArrowheadNoneIcon appearance={appState.appearance} />,+ icon: <ArrowheadNoneIcon theme={appState.theme} />,},{value: "arrow",text: t("labels.arrowhead_arrow"),keyBinding: "w",icon: (- <ArrowheadArrowIcon- appearance={appState.appearance}- flip={isRTL}- />+ <ArrowheadArrowIcon theme={appState.theme} flip={isRTL} />),},{value: "bar",text: t("labels.arrowhead_bar"),keyBinding: "e",- icon: (- <ArrowheadBarIcon- appearance={appState.appearance}- flip={isRTL}- />- ),+ icon: <ArrowheadBarIcon theme={appState.theme} flip={isRTL} />,},{value: "dot",text: t("labels.arrowhead_dot"),keyBinding: "r",- icon: (- <ArrowheadDotIcon- appearance={appState.appearance}- flip={isRTL}- />- ),+ icon: <ArrowheadDotIcon theme={appState.theme} flip={isRTL} />,},]}value={getFormValue<Arrowhead | null>(diff --git a/src/actions/actionZindex.tsx b/src/actions/actionZindex.tsxindex 8d02d02ac6..f1cdcfeab6 100644--- a/src/actions/actionZindex.tsx+++ b/src/actions/actionZindex.tsx@@ -38,7 +38,7 @@ export const actionSendBackward = register({onClick={() => updateData(null)}title={`${t("labels.sendBackward")} — ${getShortcutKey("CtrlOrCmd+[")}`}>- <SendBackwardIcon appearance={appState.appearance} />+ <SendBackwardIcon theme={appState.theme} /></button>),});@@ -65,7 +65,7 @@ export const actionBringForward = register({onClick={() => updateData(null)}title={`${t("labels.bringForward")} — ${getShortcutKey("CtrlOrCmd+]")}`}>- <BringForwardIcon appearance={appState.appearance} />+ <BringForwardIcon theme={appState.theme} /></button>),});@@ -99,7 +99,7 @@ export const actionSendToBack = register({: getShortcutKey("CtrlOrCmd+Shift+[")}`}>- <SendToBackIcon appearance={appState.appearance} />+ <SendToBackIcon theme={appState.theme} /></button>),});@@ -133,7 +133,7 @@ export const actionBringToFront = register({: getShortcutKey("CtrlOrCmd+Shift+]")}`}>- <BringToFrontIcon appearance={appState.appearance} />+ <BringToFrontIcon theme={appState.theme} /></button>),});diff --git a/src/appState.ts b/src/appState.tsindex dc418fbc78..6b763e0c32 100644--- a/src/appState.ts+++ b/src/appState.ts@@ -13,7 +13,7 @@ export const getDefaultAppState = (): Omit<"offsetTop" | "offsetLeft"> => {return {- appearance: "light",+ theme: "light",collaborators: new Map(),currentChartType: "bar",currentItemBackgroundColor: "transparent",@@ -92,7 +92,7 @@ const APP_STATE_STORAGE_CONF = (<>(config: { [K in keyof T]: K extends keyof AppState ? T[K] : never },) => config)({- appearance: { browser: true, export: false },+ theme: { browser: true, export: false },collaborators: { browser: false, export: false },currentChartType: { browser: true, export: false },currentItemBackgroundColor: { browser: true, export: false },diff --git a/src/components/App.tsx b/src/components/App.tsxindex 82f8207d0b..f9f9dc4ec8 100644--- a/src/components/App.tsx+++ b/src/components/App.tsx@@ -625,7 +625,7 @@ class App extends React.Component<ExcalidrawProps, AppState> {this.setState((state) => ({...getDefaultAppState(),isLoading: opts?.resetLoadingState ? false : state.isLoading,- appearance: this.state.appearance,+ theme: this.state.theme,}));this.resetHistory();},@@ -884,7 +884,7 @@ class App extends React.Component<ExcalidrawProps, AppState> {}document.querySelector(".excalidraw")- ?.classList.toggle("Appearance_dark", this.state.appearance === "dark");+ ?.classList.toggle("theme--dark", this.state.theme === "dark");if (this.state.editingLinearElement &&diff --git a/src/components/BackgroundPickerAndDarkModeToggle.tsx b/src/components/BackgroundPickerAndDarkModeToggle.tsxindex f2eba1315a..3fb03a70e5 100644--- a/src/components/BackgroundPickerAndDarkModeToggle.tsx+++ b/src/components/BackgroundPickerAndDarkModeToggle.tsx@@ -16,9 +16,9 @@ export const BackgroundPickerAndDarkModeToggle = ({{actionManager.renderAction("changeViewBackgroundColor")}<div style={{ marginInlineStart: "0.25rem" }}><DarkModeToggle- value={appState.appearance}- onChange={(appearance) => {- setAppState({ appearance });+ value={appState.theme}+ onChange={(theme) => {+ setAppState({ theme });}}/></div>diff --git a/src/components/ColorPicker.scss b/src/components/ColorPicker.scssindex cc65592e53..fb960c9fff 100644--- a/src/components/ColorPicker.scss+++ b/src/components/ColorPicker.scss@@ -73,7 +73,7 @@box-sizing: border-box;border: 1px solid #ddd;background-color: currentColor !important;- filter: var(--appearance-filter);+ filter: var(--theme-filter);&:focus {/* TODO: only show the border when the color is too light to see as a shadow */@@ -192,7 +192,7 @@position: relative;overflow: hidden;background-color: transparent !important;- filter: var(--appearance-filter);+ filter: var(--theme-filter);&:after {content: "";@@ -239,7 +239,7 @@color: #d4d4d4;}- &.Appearance_dark {+ &.theme--dark {.color-picker-type-elementBackground .color-picker-keybinding {color: $oc-black;}diff --git a/src/components/ContextMenu.tsx b/src/components/ContextMenu.tsxindex 2a2c9b96e8..508502d1f0 100644--- a/src/components/ContextMenu.tsx+++ b/src/components/ContextMenu.tsx@@ -34,11 +34,11 @@ const ContextMenu = ({}: ContextMenuProps) => {const isDarkTheme = !!document.querySelector(".excalidraw")- ?.classList.contains("Appearance_dark");+ ?.classList.contains("theme--dark");return (<divclassName={clsx("excalidraw", {- "Appearance_dark Appearance_dark-background-none": isDarkTheme,+ "theme--dark theme--dark-background-none": isDarkTheme,})}><Popoverdiff --git a/src/components/ExportDialog.scss b/src/components/ExportDialog.scssindex c47cdf400a..d313689f5b 100644--- a/src/components/ExportDialog.scss+++ b/src/components/ExportDialog.scss@@ -16,7 +16,7 @@max-height: 25rem;}- &.Appearance_dark .ExportDialog__preview canvas {+ &.theme--dark .ExportDialog__preview canvas {filter: none;}diff --git a/src/components/GitHubCorner.tsx b/src/components/GitHubCorner.tsxindex e7c2206fed..a5b995e3fe 100644--- a/src/components/GitHubCorner.tsx+++ b/src/components/GitHubCorner.tsx@@ -3,7 +3,7 @@ import React from "react";// https://github.com/tholman/github-cornersexport const GitHubCorner = React.memo(- ({ appearance }: { appearance: "light" | "dark" }) => (+ ({ theme }: { theme: "light" | "dark" }) => (<svgxmlns="http://www.w3.org/2000/svg"width="40"@@ -19,18 +19,18 @@ export const GitHubCorner = React.memo(><pathd="M0 0l115 115h15l12 27 108 108V0z"- fill={appearance === "light" ? oc.gray[6] : oc.gray[8]}+ fill={theme === "light" ? oc.gray[6] : oc.gray[8]}/><pathclassName="octo-arm"d="M128 109c-15-9-9-19-9-19 3-7 2-11 2-11-1-7 3-2 3-2 4 5 2 11 2 11-3 10 5 15 9 16"style={{ transformOrigin: "130px 106px" }}- fill={appearance === "light" ? oc.white : oc.black}+ fill={theme === "light" ? oc.white : oc.black}/><pathclassName="octo-body"d="M115 115s4 2 5 0l14-14c3-2 6-3 8-3-8-11-15-24 2-41 5-5 10-7 16-7 1-2 3-7 12-11 0 0 5 3 7 16 4 2 8 5 12 9s7 8 9 12c14 3 17 7 17 7-4 8-9 11-11 11 0 6-2 11-7 16-16 16-30 10-41 2 0 3-1 7-5 11l-12 11c-1 1 1 5 1 5z"- fill={appearance === "light" ? oc.white : oc.black}+ fill={theme === "light" ? oc.white : oc.black}/></a></svg>diff --git a/src/components/IconPicker.scss b/src/components/IconPicker.scssindex c79f3569d2..b83fb7e86e 100644--- a/src/components/IconPicker.scss+++ b/src/components/IconPicker.scss@@ -132,7 +132,7 @@color: #d4d4d4;}- &.Appearance_dark {+ &.theme--dark {.picker-type-elementBackground .picker-keybinding {color: $oc-black;}diff --git a/src/components/LayerUI.tsx b/src/components/LayerUI.tsxindex 848f6b9ec4..368fb4219e 100644--- a/src/components/LayerUI.tsx+++ b/src/components/LayerUI.tsx@@ -603,7 +603,7 @@ const LayerUI = ({},)}>- <GitHubCorner appearance={appState.appearance} />+ <GitHubCorner theme={appState.theme} /></aside>);};diff --git a/src/components/LibraryUnit.scss b/src/components/LibraryUnit.scssindex 26404cecda..4b9b5208e4 100644--- a/src/components/LibraryUnit.scss+++ b/src/components/LibraryUnit.scss@@ -16,7 +16,7 @@}.library-unit__dragger > svg {- filter: var(--appearance-filter);+ filter: var(--theme-filter);flex-grow: 1;max-height: 100%;max-width: 100%;diff --git a/src/components/Modal.tsx b/src/components/Modal.tsxindex 9dcff1add9..03421b3bbf 100644--- a/src/components/Modal.tsx+++ b/src/components/Modal.tsx@@ -51,14 +51,14 @@ const useBodyRoot = () => {useLayoutEffect(() => {const isDarkTheme = !!document.querySelector(".excalidraw")- ?.classList.contains("Appearance_dark");+ ?.classList.contains("theme--dark");const div = document.createElement("div");div.classList.add("excalidraw", "excalidraw-modal-container");if (isDarkTheme) {- div.classList.add("Appearance_dark");- div.classList.add("Appearance_dark-background-none");+ div.classList.add("theme--dark");+ div.classList.add("theme--dark-background-none");}document.body.appendChild(div);diff --git a/src/components/icons.tsx b/src/components/icons.tsxindex d9d2798f80..df2dffcccb 100644--- a/src/components/icons.tsx+++ b/src/components/icons.tsx@@ -11,12 +11,12 @@ import React from "react";import oc from "open-color";import clsx from "clsx";-const activeElementColor = (appearance: "light" | "dark") =>- appearance === "light" ? oc.orange[4] : oc.orange[9];-const iconFillColor = (appearance: "light" | "dark") =>- appearance === "light" ? oc.black : oc.gray[4];-const handlerColor = (appearance: "light" | "dark") =>- appearance === "light" ? oc.white : "#1e1e1e";+const activeElementColor = (theme: "light" | "dark") =>+ theme === "light" ? oc.orange[4] : oc.orange[9];+const iconFillColor = (theme: "light" | "dark") =>+ theme === "light" ? oc.black : oc.gray[4];+const handlerColor = (theme: "light" | "dark") =>+ theme === "light" ? oc.white : "#1e1e1e";type Opts = {width?: number;@@ -136,19 +136,19 @@ export const resetZoom = createIcon();export const BringForwardIcon = React.memo(- ({ appearance }: { appearance: "light" | "dark" }) =>+ ({ theme }: { theme: "light" | "dark" }) =>createIcon(<><pathd="M22 9.556C22 8.696 21.303 8 20.444 8H16v8H8v4.444C8 21.304 8.697 22 9.556 22h10.888c.86 0 1.556-.697 1.556-1.556V9.556z"- fill={iconFillColor(appearance)}- stroke={iconFillColor(appearance)}+ fill={iconFillColor(theme)}+ stroke={iconFillColor(theme)}strokeWidth="2"/><pathd="M16 3.556C16 2.696 15.303 2 14.444 2H3.556C2.696 2 2 2.697 2 3.556v10.888C2 15.304 2.697 16 3.556 16h10.888c.86 0 1.556-.697 1.556-1.556V3.556z"- fill={activeElementColor(appearance)}- stroke={activeElementColor(appearance)}+ fill={activeElementColor(theme)}+ stroke={activeElementColor(theme)}strokeWidth="2"/></>,@@ -157,19 +157,19 @@ export const BringForwardIcon = React.memo();export const SendBackwardIcon = React.memo(- ({ appearance }: { appearance: "light" | "dark" }) =>+ ({ theme }: { theme: "light" | "dark" }) =>createIcon(<><pathd="M16 3.556C16 2.696 15.303 2 14.444 2H3.556C2.696 2 2 2.697 2 3.556v10.888C2 15.304 2.697 16 3.556 16h10.888c.86 0 1.556-.697 1.556-1.556V3.556z"- fill={activeElementColor(appearance)}- stroke={activeElementColor(appearance)}+ fill={activeElementColor(theme)}+ stroke={activeElementColor(theme)}strokeWidth="2"/><pathd="M22 9.556C22 8.696 21.303 8 20.444 8H9.556C8.696 8 8 8.697 8 9.556v10.888C8 21.304 8.697 22 9.556 22h10.888c.86 0 1.556-.697 1.556-1.556V9.556z"- fill={iconFillColor(appearance)}- stroke={iconFillColor(appearance)}+ fill={iconFillColor(theme)}+ stroke={iconFillColor(theme)}strokeWidth="2"/></>,@@ -178,19 +178,19 @@ export const SendBackwardIcon = React.memo();export const BringToFrontIcon = React.memo(- ({ appearance }: { appearance: "light" | "dark" }) =>+ ({ theme }: { theme: "light" | "dark" }) =>createIcon(<><pathd="M13 21a1 1 0 001 1h7a1 1 0 001-1v-7a1 1 0 00-1-1h-3v5h-5v3zM11 3a1 1 0 00-1-1H3a1 1 0 00-1 1v7a1 1 0 001 1h3V6h5V3z"- fill={iconFillColor(appearance)}- stroke={iconFillColor(appearance)}+ fill={iconFillColor(theme)}+ stroke={iconFillColor(theme)}strokeWidth="2"/><pathd="M18 7.333C18 6.597 17.403 6 16.667 6H7.333C6.597 6 6 6.597 6 7.333v9.334C6 17.403 6.597 18 7.333 18h9.334c.736 0 1.333-.597 1.333-1.333V7.333z"- fill={activeElementColor(appearance)}- stroke={activeElementColor(appearance)}+ fill={activeElementColor(theme)}+ stroke={activeElementColor(theme)}strokeWidth="2"/></>,@@ -199,20 +199,20 @@ export const BringToFrontIcon = React.memo();export const SendToBackIcon = React.memo(- ({ appearance }: { appearance: "light" | "dark" }) =>+ ({ theme }: { theme: "light" | "dark" }) =>createIcon(<><pathd="M18 7.333C18 6.597 17.403 6 16.667 6H7.333C6.597 6 6 6.597 6 7.333v9.334C6 17.403 6.597 18 7.333 18h9.334c.736 0 1.333-.597 1.333-1.333V7.333z"- fill={activeElementColor(appearance)}- stroke={activeElementColor(appearance)}+ fill={activeElementColor(theme)}+ stroke={activeElementColor(theme)}strokeLinejoin="round"strokeWidth="2"/><pathd="M11 3a1 1 0 00-1-1H3a1 1 0 00-1 1v7a1 1 0 001 1h8V3zM22 14a1 1 0 00-1-1h-7a1 1 0 00-1 1v7a1 1 0 001 1h8v-8z"- fill={iconFillColor(appearance)}- stroke={iconFillColor(appearance)}+ fill={iconFillColor(theme)}+ stroke={iconFillColor(theme)}strokeLinejoin="round"strokeWidth="2"/>@@ -228,20 +228,20 @@ export const SendToBackIcon = React.memo(// that would make them lie about their function.//export const AlignTopIcon = React.memo(- ({ appearance }: { appearance: "light" | "dark" }) =>+ ({ theme }: { theme: "light" | "dark" }) =>createIcon(<><pathd="M 2,5 H 22"- fill={iconFillColor(appearance)}- stroke={iconFillColor(appearance)}+ fill={iconFillColor(theme)}+ stroke={iconFillColor(theme)}strokeWidth="2"strokeLinecap="round"/><pathd="M 6,7 C 5.446,7 5,7.446 5,8 v 9.999992 c 0,0.554 0.446,1 1,1 h 3.0000001 c 0.554,0 0.9999999,-0.446 0.9999999,-1 V 8 C 10,7.446 9.5540001,7 9.0000001,7 Z m 9,0 c -0.554,0 -1,0.446 -1,1 v 5.999992 c 0,0.554 0.446,1 1,1 h 3 c 0.554,0 1,-0.446 1,-1 V 8 C 19,7.446 18.554,7 18,7 Z"- fill={activeElementColor(appearance)}- stroke={activeElementColor(appearance)}+ fill={activeElementColor(theme)}+ stroke={activeElementColor(theme)}strokeWidth="2"/></>,@@ -250,20 +250,20 @@ export const AlignTopIcon = React.memo();export const AlignBottomIcon = React.memo(- ({ appearance }: { appearance: "light" | "dark" }) =>+ ({ theme }: { theme: "light" | "dark" }) =>createIcon(<><pathd="M 2,19 H 22"- fill={iconFillColor(appearance)}- stroke={iconFillColor(appearance)}+ fill={iconFillColor(theme)}+ stroke={iconFillColor(theme)}strokeWidth="2"strokeLinecap="round"/><pathd="m 6,16.999992 c -0.554,0 -1,-0.446 -1,-1 V 6 C 5,5.446 5.446,5 6,5 H 9.0000001 C 9.5540001,5 10,5.446 10,6 v 9.999992 c 0,0.554 -0.4459999,1 -0.9999999,1 z m 9,0 c -0.554,0 -1,-0.446 -1,-1 V 10 c 0,-0.554 0.446,-1 1,-1 h 3 c 0.554,0 1,0.446 1,1 v 5.999992 c 0,0.554 -0.446,1 -1,1 z"- fill={activeElementColor(appearance)}- stroke={activeElementColor(appearance)}+ fill={activeElementColor(theme)}+ stroke={activeElementColor(theme)}strokeWidth="2"/></>,@@ -272,20 +272,20 @@ export const AlignBottomIcon = React.memo();export const AlignLeftIcon = React.memo(- ({ appearance }: { appearance: "light" | "dark" }) =>+ ({ theme }: { theme: "light" | "dark" }) =>createIcon(<><pathd="M 5,2 V 22"- fill={iconFillColor(appearance)}- stroke={iconFillColor(appearance)}+ fill={iconFillColor(theme)}+ stroke={iconFillColor(theme)}strokeWidth="2"strokeLinecap="round"/><pathd="m 7.000004,5.999996 c 0,-0.554 0.446,-1 1,-1 h 9.999992 c 0.554,0 1,0.446 1,1 v 3.0000001 c 0,0.554 -0.446,0.9999999 -1,0.9999999 H 8.000004 c -0.554,0 -1,-0.4459999 -1,-0.9999999 z m 0,9 c 0,-0.554 0.446,-1 1,-1 h 5.999992 c 0.554,0 1,0.446 1,1 v 3 c 0,0.554 -0.446,1 -1,1 H 8.000004 c -0.554,0 -1,-0.446 -1,-1 z"- fill={activeElementColor(appearance)}- stroke={activeElementColor(appearance)}+ fill={activeElementColor(theme)}+ stroke={activeElementColor(theme)}strokeWidth="2"/></>,@@ -294,20 +294,20 @@ export const AlignLeftIcon = React.memo();export const AlignRightIcon = React.memo(- ({ appearance }: { appearance: "light" | "dark" }) =>+ ({ theme }: { theme: "light" | "dark" }) =>createIcon(<><pathd="M 19,2 V 22"- fill={iconFillColor(appearance)}- stroke={iconFillColor(appearance)}+ fill={iconFillColor(theme)}+ stroke={iconFillColor(theme)}strokeWidth="2"strokeLinecap="round"/><pathd="m 16.999996,5.999996 c 0,-0.554 -0.446,-1 -1,-1 H 6.000004 c -0.554,0 -1,0.446 -1,1 v 3.0000001 c 0,0.554 0.446,0.9999999 1,0.9999999 h 9.999992 c 0.554,0 1,-0.4459999 1,-0.9999999 z m 0,9 c 0,-0.554 -0.446,-1 -1,-1 h -5.999992 c -0.554,0 -1,0.446 -1,1 v 3 c 0,0.554 0.446,1 1,1 h 5.999992 c 0.554,0 1,-0.446 1,-1 z"- fill={activeElementColor(appearance)}- stroke={activeElementColor(appearance)}+ fill={activeElementColor(theme)}+ stroke={activeElementColor(theme)}strokeWidth="2"/></>,@@ -316,20 +316,20 @@ export const AlignRightIcon = React.memo();export const DistributeHorizontallyIcon = React.memo(- ({ appearance }: { appearance: "light" | "dark" }) =>+ ({ theme }: { theme: "light" | "dark" }) =>createIcon(<><path d="M5 5V19Z" fill="black" /><pathd="M19 5V19M5 5V19"- stroke={iconFillColor(appearance)}+ stroke={iconFillColor(theme)}strokeWidth="2"strokeLinecap="round"/><pathd="M15 9C15.554 9 16 9.446 16 10V14C16 14.554 15.554 15 15 15H9C8.446 15 8 14.554 8 14V10C8 9.446 8.446 9 9 9H15Z"- fill={activeElementColor(appearance)}- stroke={activeElementColor(appearance)}+ fill={activeElementColor(theme)}+ stroke={activeElementColor(theme)}strokeWidth="2"/></>,@@ -346,20 +346,20 @@ export const DistributeHorizontallyIcon = React.memo(></svg>;export const DistributeVerticallyIcon = React.memo(- ({ appearance }: { appearance: "light" | "dark" }) =>+ ({ theme }: { theme: "light" | "dark" }) =>createIcon(<><pathd="M5 5L19 5M5 19H19"- fill={iconFillColor(appearance)}- stroke={iconFillColor(appearance)}+ fill={iconFillColor(theme)}+ stroke={iconFillColor(theme)}strokeWidth="2"strokeLinecap="round"/><pathd="M15 9C15.554 9 16 9.446 16 10V14C16 14.554 15.554 15 15 15H9C8.446 15 8 14.554 8 14V10C8 9.446 8.446 9 9 9H15Z"- fill={activeElementColor(appearance)}- stroke={activeElementColor(appearance)}+ fill={activeElementColor(theme)}+ stroke={activeElementColor(theme)}strokeWidth="2"/></>,@@ -368,19 +368,19 @@ export const DistributeVerticallyIcon = React.memo();export const CenterVerticallyIcon = React.memo(- ({ appearance }: { appearance: "light" | "dark" }) =>+ ({ theme }: { theme: "light" | "dark" }) =>createIcon(<><pathd="m 5.000004,16.999996 c 0,0.554 0.446,1 1,1 h 3 c 0.554,0 1,-0.446 1,-1 v -10 c 0,-0.554 -0.446,-1 -1,-1 h -3 c -0.554,0 -1,0.446 -1,1 z m 9,-2 c 0,0.554 0.446,1 1,1 h 3 c 0.554,0 1,-0.446 1,-1 v -6 c 0,-0.554 -0.446,-1 -1,-1 h -3 c -0.554,0 -1,0.446 -1,1 z"- fill={activeElementColor(appearance)}- stroke={activeElementColor(appearance)}+ fill={activeElementColor(theme)}+ stroke={activeElementColor(theme)}strokeWidth="2"/><pathd="M 2,12 H 22"- fill={iconFillColor(appearance)}- stroke={iconFillColor(appearance)}+ fill={iconFillColor(theme)}+ stroke={iconFillColor(theme)}strokeWidth="2"strokeDasharray="1, 2.8"strokeLinecap="round"@@ -391,19 +391,19 @@ export const CenterVerticallyIcon = React.memo();export const CenterHorizontallyIcon = React.memo(- ({ appearance }: { appearance: "light" | "dark" }) =>+ ({ theme }: { theme: "light" | "dark" }) =>createIcon(<><pathd="M 7 5 C 6.446 5 6 5.446 6 6 L 6 9 C 6 9.554 6.446 10 7 10 L 17 10 C 17.554 10 18 9.554 18 9 L 18 6 C 18 5.446 17.554 5 17 5 L 7 5 z M 9 14 C 8.446 14 8 14.446 8 15 L 8 18 C 8 18.554 8.446 19 9 19 L 15 19 C 15.554 19 16 18.554 16 18 L 16 15 C 16 14.446 15.554 14 15 14 L 9 14 z "- fill={activeElementColor(appearance)}- stroke={activeElementColor(appearance)}+ fill={activeElementColor(theme)}+ stroke={activeElementColor(theme)}strokeWidth="2"/><pathd="M 12,2 V 22"- fill={iconFillColor(appearance)}- stroke={iconFillColor(appearance)}+ fill={iconFillColor(theme)}+ stroke={iconFillColor(theme)}strokeWidth="2"strokeDasharray="1, 2.8"strokeLinecap="round"@@ -448,77 +448,76 @@ export const shield = createIcon({ width: 24 },);-export const GroupIcon = React.memo(- ({ appearance }: { appearance: "light" | "dark" }) =>- createIcon(- <>- <path d="M25 26H111V111H25" fill={iconFillColor(appearance)} />- <path- d="M25 111C25 80.2068 25 49.4135 25 26M25 26C48.6174 26 72.2348 26 111 26H25ZM25 26C53.3671 26 81.7343 26 111 26H25ZM111 26C111 52.303 111 78.606 111 111V26ZM111 26C111 51.2947 111 76.5893 111 111V26ZM111 111C87.0792 111 63.1585 111 25 111H111ZM111 111C87.4646 111 63.9293 111 25 111H111ZM25 111C25 81.1514 25 51.3028 25 26V111Z"- stroke={iconFillColor(appearance)}- strokeWidth="2"- />- <path d="M100 100H160V160H100" fill={iconFillColor(appearance)} />- <path- d="M100 160C100 144.106 100 128.211 100 100M100 100C117.706 100 135.412 100 160 100H100ZM100 100C114.214 100 128.428 100 160 100H100ZM160 100C160 120.184 160 140.369 160 160V100ZM160 100C160 113.219 160 126.437 160 160V100ZM160 160C145.534 160 131.068 160 100 160H160ZM160 160C143.467 160 126.934 160 100 160H160ZM100 160C100 143.661 100 127.321 100 100V160Z"- stroke={iconFillColor(appearance)}- strokeWidth="2"- />- <rect- x="2.5"- y="2.5"- width="30"- height="30"- fill={handlerColor(appearance)}- stroke={iconFillColor(appearance)}- strokeWidth="6"- />- <rect- x="2.5"- y="149.5"- width="30"- height="30"- fill={handlerColor(appearance)}- stroke={iconFillColor(appearance)}- strokeWidth="6"- />- <rect- x="147.5"- y="149.5"- width="30"- height="30"- fill={handlerColor(appearance)}- stroke={iconFillColor(appearance)}- strokeWidth="6"- />- <rect- x="147.5"- y="2.5"- width="30"- height="30"- fill={handlerColor(appearance)}- stroke={iconFillColor(appearance)}- strokeWidth="6"- />- </>,- { width: 182, height: 182, mirror: true },- ),+export const GroupIcon = React.memo(({ theme }: { theme: "light" | "dark" }) =>+ createIcon(+ <>+ <path d="M25 26H111V111H25" fill={iconFillColor(theme)} />+ <path+ d="M25 111C25 80.2068 25 49.4135 25 26M25 26C48.6174 26 72.2348 26 111 26H25ZM25 26C53.3671 26 81.7343 26 111 26H25ZM111 26C111 52.303 111 78.606 111 111V26ZM111 26C111 51.2947 111 76.5893 111 111V26ZM111 111C87.0792 111 63.1585 111 25 111H111ZM111 111C87.4646 111 63.9293 111 25 111H111ZM25 111C25 81.1514 25 51.3028 25 26V111Z"+ stroke={iconFillColor(theme)}+ strokeWidth="2"+ />+ <path d="M100 100H160V160H100" fill={iconFillColor(theme)} />+ <path+ d="M100 160C100 144.106 100 128.211 100 100M100 100C117.706 100 135.412 100 160 100H100ZM100 100C114.214 100 128.428 100 160 100H100ZM160 100C160 120.184 160 140.369 160 160V100ZM160 100C160 113.219 160 126.437 160 160V100ZM160 160C145.534 160 131.068 160 100 160H160ZM160 160C143.467 160 126.934 160 100 160H160ZM100 160C100 143.661 100 127.321 100 100V160Z"+ stroke={iconFillColor(theme)}+ strokeWidth="2"+ />+ <rect+ x="2.5"+ y="2.5"+ width="30"+ height="30"+ fill={handlerColor(theme)}+ stroke={iconFillColor(theme)}+ strokeWidth="6"+ />+ <rect+ x="2.5"+ y="149.5"+ width="30"+ height="30"+ fill={handlerColor(theme)}+ stroke={iconFillColor(theme)}+ strokeWidth="6"+ />+ <rect+ x="147.5"+ y="149.5"+ width="30"+ height="30"+ fill={handlerColor(theme)}+ stroke={iconFillColor(theme)}+ strokeWidth="6"+ />+ <rect+ x="147.5"+ y="2.5"+ width="30"+ height="30"+ fill={handlerColor(theme)}+ stroke={iconFillColor(theme)}+ strokeWidth="6"+ />+ </>,+ { width: 182, height: 182, mirror: true },+ ),);export const UngroupIcon = React.memo(- ({ appearance }: { appearance: "light" | "dark" }) =>+ ({ theme }: { theme: "light" | "dark" }) =>createIcon(<>- <path d="M25 26H111V111H25" fill={iconFillColor(appearance)} />+ <path d="M25 26H111V111H25" fill={iconFillColor(theme)} /><pathd="M25 111C25 80.2068 25 49.4135 25 26M25 26C48.6174 26 72.2348 26 111 26H25ZM25 26C53.3671 26 81.7343 26 111 26H25ZM111 26C111 52.303 111 78.606 111 111V26ZM111 26C111 51.2947 111 76.5893 111 111V26ZM111 111C87.0792 111 63.1585 111 25 111H111ZM111 111C87.4646 111 63.9293 111 25 111H111ZM25 111C25 81.1514 25 51.3028 25 26V111Z"- stroke={iconFillColor(appearance)}+ stroke={iconFillColor(theme)}strokeWidth="2"/>- <path d="M100 100H160V160H100" fill={iconFillColor(appearance)} />+ <path d="M100 100H160V160H100" fill={iconFillColor(theme)} /><pathd="M100 160C100 144.106 100 128.211 100 100M100 100C117.706 100 135.412 100 160 100H100ZM100 100C114.214 100 128.428 100 160 100H100ZM160 100C160 120.184 160 140.369 160 160V100ZM160 100C160 113.219 160 126.437 160 160V100ZM160 160C145.534 160 131.068 160 100 160H160ZM160 160C143.467 160 126.934 160 100 160H160ZM100 160C100 143.661 100 127.321 100 100V160Z"- stroke={iconFillColor(appearance)}+ stroke={iconFillColor(theme)}strokeWidth="2"/><rect@@ -526,8 +525,8 @@ export const UngroupIcon = React.memo(y="2.5"width="30"height="30"- fill={handlerColor(appearance)}- stroke={iconFillColor(appearance)}+ fill={handlerColor(theme)}+ stroke={iconFillColor(theme)}strokeWidth="6"/><rect@@ -535,8 +534,8 @@ export const UngroupIcon = React.memo(y="149.5"width="30"height="30"- fill={handlerColor(appearance)}- stroke={iconFillColor(appearance)}+ fill={handlerColor(theme)}+ stroke={iconFillColor(theme)}strokeWidth="6"/><rect@@ -544,8 +543,8 @@ export const UngroupIcon = React.memo(y="149.5"width="30"height="30"- fill={handlerColor(appearance)}- stroke={iconFillColor(appearance)}+ fill={handlerColor(theme)}+ stroke={iconFillColor(theme)}strokeWidth="6"/><rect@@ -553,8 +552,8 @@ export const UngroupIcon = React.memo(y="78.5"width="30"height="30"- fill={handlerColor(appearance)}- stroke={iconFillColor(appearance)}+ fill={handlerColor(theme)}+ stroke={iconFillColor(theme)}strokeWidth="6"/><rect@@ -562,8 +561,8 @@ export const UngroupIcon = React.memo(y="2.5"width="30"height="30"- fill={handlerColor(appearance)}- stroke={iconFillColor(appearance)}+ fill={handlerColor(theme)}+ stroke={iconFillColor(theme)}strokeWidth="6"/><rect@@ -571,8 +570,8 @@ export const UngroupIcon = React.memo(y="102.5"width="30"height="30"- fill={handlerColor(appearance)}- stroke={iconFillColor(appearance)}+ fill={handlerColor(theme)}+ stroke={iconFillColor(theme)}strokeWidth="6"/></>,@@ -581,22 +580,22 @@ export const UngroupIcon = React.memo();export const FillHachureIcon = React.memo(- ({ appearance }: { appearance: "light" | "dark" }) =>+ ({ theme }: { theme: "light" | "dark" }) =>createIcon(<pathfillRule="evenodd"clipRule="evenodd"d="M20.101 16H28.0934L36 8.95989V4H33.5779L20.101 16ZM30.5704 4L17.0935 16H9.10101L22.5779 4H30.5704ZM19.5704 4L6.09349 16H4V10.7475L11.5779 4H19.5704ZM8.57036 4H4V8.06952L8.57036 4ZM36 11.6378L31.101 16H36V11.6378ZM2 2V18H38V2H2Z"- fill={iconFillColor(appearance)}+ fill={iconFillColor(theme)}/>,{ width: 40, height: 20 },),);export const FillCrossHatchIcon = React.memo(- ({ appearance }: { appearance: "light" | "dark" }) =>+ ({ theme }: { theme: "light" | "dark" }) =>createIcon(- <g fill={iconFillColor(appearance)} fillRule="evenodd" clipRule="evenodd">+ <g fill={iconFillColor(theme)} fillRule="evenodd" clipRule="evenodd"><path d="M20.101 16H28.0934L36 8.95989V4H33.5779L20.101 16ZM30.5704 4L17.0935 16H9.10101L22.5779 4H30.5704ZM19.5704 4L6.09349 16H4V10.7475L11.5779 4H19.5704ZM8.57036 4H4V8.06952L8.57036 4ZM36 11.6378L31.101 16H36V11.6378ZM2 2V18H38V2H2Z" /><path d="M14.0001 18L3.00006 4.00002L4.5727 2.76438L15.5727 16.7644L14.0001 18ZM25.0001 18L14.0001 4.00002L15.5727 2.76438L26.5727 16.7644L25.0001 18ZM36.0001 18L25.0001 4.00002L26.5727 2.76438L37.5727 16.7644L36.0001 18Z" /></g>,@@ -605,25 +604,19 @@ export const FillCrossHatchIcon = React.memo();export const FillSolidIcon = React.memo(- ({ appearance }: { appearance: "light" | "dark" }) =>- createIcon(<path d="M2 2H38V18H2V2Z" fill={iconFillColor(appearance)} />, {+ ({ theme }: { theme: "light" | "dark" }) =>+ createIcon(<path d="M2 2H38V18H2V2Z" fill={iconFillColor(theme)} />, {width: 40,height: 20,}),);export const StrokeWidthIcon = React.memo(- ({- appearance,- strokeWidth,- }: {- appearance: "light" | "dark";- strokeWidth: number;- }) =>+ ({ theme, strokeWidth }: { theme: "light" | "dark"; strokeWidth: number }) =>createIcon(<pathd="M6 10H34"- stroke={iconFillColor(appearance)}+ stroke={iconFillColor(theme)}strokeWidth={strokeWidth}fill="none"/>,@@ -632,11 +625,11 @@ export const StrokeWidthIcon = React.memo();export const StrokeStyleSolidIcon = React.memo(- ({ appearance }: { appearance: "light" | "dark" }) =>+ ({ theme }: { theme: "light" | "dark" }) =>createIcon(<pathd="M6 10H34"- stroke={iconFillColor(appearance)}+ stroke={iconFillColor(theme)}strokeWidth={2}fill="none"/>,@@ -648,11 +641,11 @@ export const StrokeStyleSolidIcon = React.memo();export const StrokeStyleDashedIcon = React.memo(- ({ appearance }: { appearance: "light" | "dark" }) =>+ ({ theme }: { theme: "light" | "dark" }) =>createIcon(<pathd="M6 10H34"- stroke={iconFillColor(appearance)}+ stroke={iconFillColor(theme)}strokeWidth={2.5}strokeDasharray={"10, 8"}fill="none"@@ -662,11 +655,11 @@ export const StrokeStyleDashedIcon = React.memo();export const StrokeStyleDottedIcon = React.memo(- ({ appearance }: { appearance: "light" | "dark" }) =>+ ({ theme }: { theme: "light" | "dark" }) =>createIcon(<pathd="M6 10H34"- stroke={iconFillColor(appearance)}+ stroke={iconFillColor(theme)}strokeWidth={2.5}strokeDasharray={"4, 4"}fill="none"@@ -676,11 +669,11 @@ export const StrokeStyleDottedIcon = React.memo();export const SloppinessArchitectIcon = React.memo(- ({ appearance }: { appearance: "light" | "dark" }) =>+ ({ theme }: { theme: "light" | "dark" }) =>createIcon(<pathd="M3.00098 16.1691C6.28774 13.9744 19.6399 2.8905 22.7215 3.00082C25.8041 3.11113 19.1158 15.5488 21.4962 16.8309C23.8757 18.1131 34.4155 11.7148 37.0001 10.6919"- stroke={iconFillColor(appearance)}+ stroke={iconFillColor(theme)}strokeWidth={2}fill="none"/>,@@ -689,11 +682,11 @@ export const SloppinessArchitectIcon = React.memo();export const SloppinessArtistIcon = React.memo(- ({ appearance }: { appearance: "light" | "dark" }) =>+ ({ theme }: { theme: "light" | "dark" }) =>createIcon(<pathd="M3 17C6.68158 14.8752 16.1296 9.09849 22.0648 6.54922C28 3.99995 22.2896 13.3209 25 14C27.7104 14.6791 36.3757 9.6471 36.3757 9.6471M6.40706 15C13 11.1918 20.0468 1.51045 23.0234 3.0052C26 4.49995 20.457 12.8659 22.7285 16.4329C25 20 36.3757 13 36.3757 13"- stroke={iconFillColor(appearance)}+ stroke={iconFillColor(theme)}strokeWidth={2}fill="none"/>,@@ -702,11 +695,11 @@ export const SloppinessArtistIcon = React.memo();export const SloppinessCartoonistIcon = React.memo(- ({ appearance }: { appearance: "light" | "dark" }) =>+ ({ theme }: { theme: "light" | "dark" }) =>createIcon(<pathd="M3 15.6468C6.93692 13.5378 22.5544 2.81528 26.6206 3.00242C30.6877 3.18956 25.6708 15.3346 27.4009 16.7705C29.1309 18.2055 35.4001 12.4762 37 11.6177M3.97143 10.4917C6.61158 9.24563 16.3706 2.61886 19.8104 3.01724C23.2522 3.41472 22.0773 12.2013 24.6181 12.8783C27.1598 13.5536 33.3179 8.04068 35.0571 7.07244"- stroke={iconFillColor(appearance)}+ stroke={iconFillColor(theme)}strokeWidth={2}fill="none"/>,@@ -715,11 +708,11 @@ export const SloppinessCartoonistIcon = React.memo();export const EdgeSharpIcon = React.memo(- ({ appearance }: { appearance: "light" | "dark" }) =>+ ({ theme }: { theme: "light" | "dark" }) =>createIcon(<pathd="M10 17L10 5L35 5"- stroke={iconFillColor(appearance)}+ stroke={iconFillColor(theme)}strokeWidth={2}fill="none"/>,@@ -728,11 +721,11 @@ export const EdgeSharpIcon = React.memo();export const EdgeRoundIcon = React.memo(- ({ appearance }: { appearance: "light" | "dark" }) =>+ ({ theme }: { theme: "light" | "dark" }) =>createIcon(<pathd="M10 17V15C10 8 13 5 21 5L33.5 5"- stroke={iconFillColor(appearance)}+ stroke={iconFillColor(theme)}strokeWidth={2}fill="none"/>,@@ -741,11 +734,11 @@ export const EdgeRoundIcon = React.memo();export const ArrowheadNoneIcon = React.memo(- ({ appearance }: { appearance: "light" | "dark" }) =>+ ({ theme }: { theme: "light" | "dark" }) =>createIcon(<pathd="M6 10H34"- stroke={iconFillColor(appearance)}+ stroke={iconFillColor(theme)}strokeWidth={2}fill="none"/>,@@ -757,17 +750,11 @@ export const ArrowheadNoneIcon = React.memo();export const ArrowheadArrowIcon = React.memo(- ({- appearance,- flip = false,- }: {- appearance: "light" | "dark";- flip?: boolean;- }) =>+ ({ theme, flip = false }: { theme: "light" | "dark"; flip?: boolean }) =>createIcon(<gtransform={flip ? "translate(40, 0) scale(-1, 1)" : ""}- stroke={iconFillColor(appearance)}+ stroke={iconFillColor(theme)}strokeWidth={2}fill="none">@@ -779,17 +766,11 @@ export const ArrowheadArrowIcon = React.memo();export const ArrowheadDotIcon = React.memo(- ({- appearance,- flip = false,- }: {- appearance: "light" | "dark";- flip?: boolean;- }) =>+ ({ theme, flip = false }: { theme: "light" | "dark"; flip?: boolean }) =>createIcon(<g- stroke={iconFillColor(appearance)}- fill={iconFillColor(appearance)}+ stroke={iconFillColor(theme)}+ fill={iconFillColor(theme)}transform={flip ? "translate(40, 0) scale(-1, 1)" : ""}><path d="M32 10L6 10" strokeWidth={2} />@@ -800,18 +781,12 @@ export const ArrowheadDotIcon = React.memo();export const ArrowheadBarIcon = React.memo(- ({- appearance,- flip = false,- }: {- appearance: "light" | "dark";- flip?: boolean;- }) =>+ ({ theme, flip = false }: { theme: "light" | "dark"; flip?: boolean }) =>createIcon(<g transform={flip ? "translate(40, 0) scale(-1, 1)" : ""}><pathd="M34 10H5.99996M34 10L34 5M34 10L34 15"- stroke={iconFillColor(appearance)}+ stroke={iconFillColor(theme)}strokeWidth={2}fill="none"/>diff --git a/src/constants.ts b/src/constants.tsindex 9471135454..aff57e309e 100644--- a/src/constants.ts+++ b/src/constants.ts@@ -109,4 +109,4 @@ export const MODES = {GRID: "gridMode",};-export const APPEARANCE_FILTER = cssVariables.appearanceFilter;+export const THEME_FILTER = cssVariables.themeFilter;diff --git a/src/css/styles.scss b/src/css/styles.scssindex 164230e262..dbe9ae8274 100644--- a/src/css/styles.scss+++ b/src/css/styles.scss@@ -41,13 +41,13 @@z-index: var(--zIndex-canvas);}- &.Appearance_dark {+ &.theme--dark {// The percentage is inspired by// https://material.io/design/color/dark-theme.html#properties, which// recommends surface color of #121212, 93% yields #111111 for #FFFcanvas {- filter: var(--appearance-filter);+ filter: var(--theme-filter);}}diff --git a/src/css/theme.scss b/src/css/theme.scssindex beabe1bb15..2cd6a6c396 100644--- a/src/css/theme.scss+++ b/src/css/theme.scss@@ -2,7 +2,7 @@@import "./variables.module.scss";.excalidraw {- --appearance-filter: none;+ --theme-filter: none;--button-destructive-bg-color: #{$oc-red-1};--button-destructive-color: #{$oc-red-9};--button-gray-1: #{$oc-gray-2};@@ -35,16 +35,16 @@--space-factor: 0.25rem;--text-primary-color: #{$oc-gray-8};- &.Appearance_dark {+ &.theme--dark {background: $oc-black;- &.Appearance_dark-background-none {+ &.theme--dark-background-none {background: none;}}- &.Appearance_dark {- --appearance-filter: #{$appearance-filter};+ &.theme--dark {+ --theme-filter: #{$theme-filter};--button-destructive-bg-color: #5a0000;--button-destructive-color: #{$oc-red-3};--button-gray-1: #363636;diff --git a/src/css/variables.module.scss b/src/css/variables.module.scssindex a35aa6513f..f60b0d9d52 100644--- a/src/css/variables.module.scss+++ b/src/css/variables.module.scss@@ -2,9 +2,9 @@// keep up to date with is-mobile.tsx$is-mobile-query: "(max-width: 600px), (max-height: 500px) and (max-width: 1000px)";-$appearance-filter: "invert(93%) hue-rotate(180deg)";+$theme-filter: "invert(93%) hue-rotate(180deg)";:export {isMobileQuery: unquote($is-mobile-query);- appearanceFilter: unquote($appearance-filter);+ themeFilter: unquote($theme-filter);}diff --git a/src/data/blob.ts b/src/data/blob.tsindex 3e1da47692..81e01dded2 100644--- a/src/data/blob.ts+++ b/src/data/blob.ts@@ -94,7 +94,7 @@ export const loadFromBlob = async ({elements: clearElementsForExport(data.elements || []),appState: {- appearance: localAppState?.appearance,+ theme: localAppState?.theme,fileHandle:blob.handle &&["application/json", MIME_TYPES.excalidraw].includes(diff --git a/src/element/textWysiwyg.tsx b/src/element/textWysiwyg.tsxindex 1e748a324f..5f0ca55a92 100644--- a/src/element/textWysiwyg.tsx+++ b/src/element/textWysiwyg.tsx@@ -93,7 +93,7 @@ export const textWysiwyg = ({textAlign,color: updatedElement.strokeColor,opacity: updatedElement.opacity / 100,- filter: "var(--appearance-filter)",+ filter: "var(--theme-filter)",maxWidth: `${maxWidth}px`,});}diff --git a/src/packages/excalidraw/CHANGELOG.md b/src/packages/excalidraw/CHANGELOG.mdindex 4689bf1252..b6eba3a6d5 100644--- a/src/packages/excalidraw/CHANGELOG.md+++ b/src/packages/excalidraw/CHANGELOG.md@@ -20,9 +20,17 @@ Please add the latest change on the top under the correct section.- Support `libraryReturnUrl` prop to indicate what URL to install libraries to [#3227](https://github.com/excalidraw/excalidraw/pull/3227).+### Refactor++- Rename appearance to theme [#3237](https://github.com/excalidraw/excalidraw/pull/3237).+ #### BREAKING CHANGE+ - Since `appState.appearance` is renamed to `appState.theme` so wherever `appState.appearance` including `initialData.appState.appearance` should be renamed to `appState.theme` and `initialData.appState.theme` respectively. If the `appearance` was persisted earlier, now it needs to passed as `theme`.+ - The class `Appearance_dark` is renamed to `theme--dark`.+ - The class `Appearance_dark-background-none` is renamed to `theme--dark-background-none`.+----## 0.4.3+## 0.4.3 (2021-03-12)## Excalidraw APIdiff --git a/src/renderer/renderScene.ts b/src/renderer/renderScene.tsindex e0228464c9..ae6a54335a 100644--- a/src/renderer/renderScene.ts+++ b/src/renderer/renderScene.ts@@ -49,7 +49,7 @@ import {} from "../element/transformHandles";import { viewportCoordsToSceneCoords, supportsEmoji } from "../utils";import { UserIdleState } from "../excalidraw-app/collab/types";-import { APPEARANCE_FILTER } from "../constants";+import { THEME_FILTER } from "../constants";const hasEmojiSupport = supportsEmoji();@@ -213,7 +213,7 @@ export const renderScene = (const normalizedCanvasHeight = canvas.height / scale;if (sceneState.exportWithDarkMode) {- context.filter = APPEARANCE_FILTER;+ context.filter = THEME_FILTER;}// Paint backgrounddiff --git a/src/scene/export.ts b/src/scene/export.tsindex 43a2c5a588..fdf0f85c05 100644--- a/src/scene/export.ts+++ b/src/scene/export.ts@@ -10,7 +10,7 @@ import { t } from "../i18n";import {DEFAULT_FONT_FAMILY,DEFAULT_VERTICAL_ALIGN,- APPEARANCE_FILTER,+ THEME_FILTER,} from "../constants";import { getDefaultAppState } from "../appState";@@ -122,7 +122,7 @@ export const exportToSvg = (svgRoot.setAttribute("width", `${width * scale}`);svgRoot.setAttribute("height", `${height * scale}`);if (exportWithDarkMode) {- svgRoot.setAttribute("filter", APPEARANCE_FILTER);+ svgRoot.setAttribute("filter", THEME_FILTER);}svgRoot.innerHTML = `diff --git a/src/tests/__snapshots__/regressionTests.test.tsx.snap b/src/tests/__snapshots__/regressionTests.test.tsx.snapindex 34883c6877..ee0f830c5f 100644--- a/src/tests/__snapshots__/regressionTests.test.tsx.snap+++ b/src/tests/__snapshots__/regressionTests.test.tsx.snap@@ -2,7 +2,6 @@exports[`given element A and group of elements B and given both are selected when user clicks on B, on pointer up only elements from B should be selected: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -75,6 +74,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -463,7 +463,6 @@ exports[`given element A and group of elements B and given both are selected wheexports[`given element A and group of elements B and given both are selected when user shift-clicks on B, on pointer up only element A should be selected: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -543,6 +542,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -930,7 +930,6 @@ exports[`given element A and group of elements B and given both are selected wheexports[`regression tests Cmd/Ctrl-click exclusively select element under pointer: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -993,6 +992,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -1706,7 +1706,6 @@ exports[`regression tests Cmd/Ctrl-click exclusively select element under pointeexports[`regression tests Drags selected element when hitting only bounding box and keeps element selected: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -1771,6 +1770,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -1910,7 +1910,6 @@ exports[`regression tests Drags selected element when hitting only bounding boxexports[`regression tests adjusts z order when grouping: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -1980,6 +1979,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -2368,7 +2368,6 @@ exports[`regression tests adjusts z order when grouping: [end of test] number ofexports[`regression tests alt-drag duplicates an element: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -2433,6 +2432,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -2621,7 +2621,6 @@ exports[`regression tests alt-drag duplicates an element: [end of test] number oexports[`regression tests arrow keys: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -2683,6 +2682,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -2785,7 +2785,6 @@ exports[`regression tests arrow keys: [end of test] number of renders 1`] = `19`exports[`regression tests can drag element that covers another element, while another elem is selected: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -2850,6 +2849,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -3262,7 +3262,6 @@ exports[`regression tests can drag element that covers another element, while anexports[`regression tests change the properties of a shape: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "#fa5252",@@ -3324,6 +3323,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -3570,7 +3570,6 @@ exports[`regression tests change the properties of a shape: [end of test] numberexports[`regression tests click on an element and drag it: [dragged] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -3635,6 +3634,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -3774,7 +3774,6 @@ exports[`regression tests click on an element and drag it: [dragged] number of rexports[`regression tests click on an element and drag it: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -3841,6 +3840,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -4018,7 +4018,6 @@ exports[`regression tests click on an element and drag it: [end of test] numberexports[`regression tests click to select a shape: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -4083,6 +4082,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -4270,7 +4270,6 @@ exports[`regression tests click to select a shape: [end of test] number of rendeexports[`regression tests click-drag to select a group: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -4336,6 +4335,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -4631,7 +4631,6 @@ exports[`regression tests click-drag to select a group: [end of test] number ofexports[`regression tests deselects group of selected elements on pointer down when pointer doesn't hit any element: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -4739,6 +4738,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -4926,7 +4926,6 @@ exports[`regression tests deselects group of selected elements on pointer down wexports[`regression tests deselects group of selected elements on pointer up when pointer hits common bounding box without hitting any element: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -5012,6 +5011,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -5233,7 +5233,6 @@ exports[`regression tests deselects group of selected elements on pointer up wheexports[`regression tests deselects selected element on pointer down when pointer doesn't hit any element: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -5339,6 +5338,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -5441,7 +5441,6 @@ exports[`regression tests deselects selected element on pointer down when pointeexports[`regression tests deselects selected element, on pointer up, when click hits element bounding box but doesn't hit the element: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -5525,6 +5524,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -5627,7 +5627,6 @@ exports[`regression tests deselects selected element, on pointer up, when clickexports[`regression tests double click to edit a group: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -5689,6 +5688,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -6080,7 +6080,6 @@ exports[`regression tests double click to edit a group: [end of test] number ofexports[`regression tests drags selected elements from point inside common bounding box that doesn't hit any element and keeps elements selected after dragging: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -6149,6 +6148,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -6398,7 +6398,6 @@ exports[`regression tests drags selected elements from point inside common boundexports[`regression tests draw every type of shape: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -6460,6 +6459,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -8432,7 +8432,6 @@ exports[`regression tests draw every type of shape: [end of test] number of rendexports[`regression tests given a group of selected elements with an element that is not selected inside the group common bounding box when element that is not selected is clicked should switch selection to not selected element on pointer up: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -8499,6 +8498,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -8794,7 +8794,6 @@ exports[`regression tests given a group of selected elements with an element thaexports[`regression tests given a selected element A and a not selected element B with higher z-index than A and given B partialy overlaps A when there's a shift-click on the overlapped section B is added to the selection: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "#fa5252",@@ -8862,6 +8861,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -9049,7 +9049,6 @@ exports[`regression tests given a selected element A and a not selected elementexports[`regression tests given selected element A with lower z-index than unselected element B and given B is partially over A when clicking intersection between A and B B should be selected on pointer up: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "#fa5252",@@ -9115,6 +9114,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -9302,7 +9302,6 @@ exports[`regression tests given selected element A with lower z-index than unselexports[`regression tests given selected element A with lower z-index than unselected element B and given B is partially over A when dragging on intersection between A and B A should be dragged and keep being selected: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "#fa5252",@@ -9369,6 +9368,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -9617,7 +9617,6 @@ exports[`regression tests given selected element A with lower z-index than unselexports[`regression tests key 2 selects rectangle tool: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -9679,6 +9678,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -9781,7 +9781,6 @@ exports[`regression tests key 2 selects rectangle tool: [end of test] number ofexports[`regression tests key 3 selects diamond tool: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -9843,6 +9842,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -9945,7 +9945,6 @@ exports[`regression tests key 3 selects diamond tool: [end of test] number of reexports[`regression tests key 4 selects ellipse tool: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -10007,6 +10006,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -10109,7 +10109,6 @@ exports[`regression tests key 4 selects ellipse tool: [end of test] number of reexports[`regression tests key 5 selects arrow tool: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -10171,6 +10170,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -10303,7 +10303,6 @@ exports[`regression tests key 5 selects arrow tool: [end of test] number of rendexports[`regression tests key 6 selects line tool: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -10365,6 +10364,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -10497,7 +10497,6 @@ exports[`regression tests key 6 selects line tool: [end of test] number of rendeexports[`regression tests key 7 selects draw tool: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -10559,6 +10558,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -10691,7 +10691,6 @@ exports[`regression tests key 7 selects draw tool: [end of test] number of rendeexports[`regression tests key a selects arrow tool: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -10753,6 +10752,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -10885,7 +10885,6 @@ exports[`regression tests key a selects arrow tool: [end of test] number of rendexports[`regression tests key d selects diamond tool: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -10947,6 +10946,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -11049,7 +11049,6 @@ exports[`regression tests key d selects diamond tool: [end of test] number of reexports[`regression tests key e selects ellipse tool: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -11111,6 +11110,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -11213,7 +11213,6 @@ exports[`regression tests key e selects ellipse tool: [end of test] number of reexports[`regression tests key l selects line tool: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -11275,6 +11274,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -11407,7 +11407,6 @@ exports[`regression tests key l selects line tool: [end of test] number of rendeexports[`regression tests key r selects rectangle tool: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -11469,6 +11468,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -11571,7 +11571,6 @@ exports[`regression tests key r selects rectangle tool: [end of test] number ofexports[`regression tests key x selects draw tool: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -11633,6 +11632,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -11765,7 +11765,6 @@ exports[`regression tests key x selects draw tool: [end of test] number of rendeexports[`regression tests make a group and duplicate it: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -11838,6 +11837,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -12481,7 +12481,6 @@ exports[`regression tests make a group and duplicate it: [end of test] number ofexports[`regression tests noop interaction after undo shouldn't create history entry: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -12547,6 +12546,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -12734,7 +12734,6 @@ exports[`regression tests noop interaction after undo shouldn't create history eexports[`regression tests pinch-to-zoom works: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -12796,6 +12795,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -12836,7 +12836,6 @@ exports[`regression tests pinch-to-zoom works: [end of test] number of renders 1exports[`regression tests rerenders UI on language change: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -12896,6 +12895,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -12936,7 +12936,6 @@ exports[`regression tests rerenders UI on language change: [end of test] numberexports[`regression tests selecting 'Add to library' in context menu adds element to library: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -12998,6 +12997,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -13100,7 +13100,6 @@ exports[`regression tests selecting 'Add to library' in context menu adds elemenexports[`regression tests selecting 'Bring forward' in context menu brings element forward: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -13162,6 +13161,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -13408,7 +13408,6 @@ exports[`regression tests selecting 'Bring forward' in context menu brings elemeexports[`regression tests selecting 'Bring to front' in context menu brings element to front: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -13470,6 +13469,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -13716,7 +13716,6 @@ exports[`regression tests selecting 'Bring to front' in context menu brings elemexports[`regression tests selecting 'Copy styles' in context menu copies styles: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -13778,6 +13777,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": "Copied styles.","viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -13880,7 +13880,6 @@ exports[`regression tests selecting 'Copy styles' in context menu copies styles:exports[`regression tests selecting 'Delete' in context menu deletes element: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -13940,6 +13939,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -14076,7 +14076,6 @@ exports[`regression tests selecting 'Delete' in context menu deletes element: [eexports[`regression tests selecting 'Duplicate' in context menu duplicates element: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -14138,6 +14137,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -14325,7 +14325,6 @@ exports[`regression tests selecting 'Duplicate' in context menu duplicates elemeexports[`regression tests selecting 'Group selection' in context menu groups selected elements: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -14393,6 +14392,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -14649,7 +14649,6 @@ exports[`regression tests selecting 'Group selection' in context menu groups selexports[`regression tests selecting 'Paste styles' in context menu pastes styles: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "#e64980",@@ -14711,6 +14710,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": "Copied styles.","viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -15488,7 +15488,6 @@ exports[`regression tests selecting 'Paste styles' in context menu pastes stylesexports[`regression tests selecting 'Send backward' in context menu sends element backward: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -15550,6 +15549,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -15796,7 +15796,6 @@ exports[`regression tests selecting 'Send backward' in context menu sends elemenexports[`regression tests selecting 'Send to back' in context menu sends element to back: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -15858,6 +15857,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -16104,7 +16104,6 @@ exports[`regression tests selecting 'Send to back' in context menu sends elementexports[`regression tests selecting 'Ungroup selection' in context menu ungroups selected group: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -16170,6 +16169,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -16483,7 +16483,6 @@ exports[`regression tests selecting 'Ungroup selection' in context menu ungroupsexports[`regression tests shift click on selected element should deselect it on pointer up: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -16548,6 +16547,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -16650,7 +16650,6 @@ exports[`regression tests shift click on selected element should deselect it onexports[`regression tests shift-click to multiselect, then drag: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -16721,6 +16720,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -16971,7 +16971,6 @@ exports[`regression tests shift-click to multiselect, then drag: [end of test] nexports[`regression tests should show fill icons when element has non transparent background: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "#fa5252",@@ -17036,6 +17035,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -17210,7 +17210,6 @@ exports[`regression tests should show fill icons when element has non transparenexports[`regression tests shows 'Group selection' in context menu for multiple selected elements: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -17278,6 +17277,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -17465,7 +17465,6 @@ exports[`regression tests shows 'Group selection' in context menu for multiple sexports[`regression tests shows 'Ungroup selection' in context menu for group inside selected elements: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -17535,6 +17534,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -17792,7 +17792,6 @@ exports[`regression tests shows 'Ungroup selection' in context menu for group inexports[`regression tests shows context menu for canvas: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -17852,6 +17851,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -17892,7 +17892,6 @@ exports[`regression tests shows context menu for canvas: [end of test] number ofexports[`regression tests shows context menu for element: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -17954,6 +17953,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -18056,7 +18056,6 @@ exports[`regression tests shows context menu for element: [end of test] number oexports[`regression tests single-clicking on a subgroup of a selected group should not alter selection: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -18129,6 +18128,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -18877,7 +18877,6 @@ exports[`regression tests single-clicking on a subgroup of a selected group shouexports[`regression tests spacebar + drag scrolls the canvas: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -18937,6 +18936,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -18977,7 +18977,6 @@ exports[`regression tests spacebar + drag scrolls the canvas: [end of test] numbexports[`regression tests supports nested groups: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -19041,6 +19040,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -19709,7 +19709,6 @@ exports[`regression tests supports nested groups: [end of test] number of renderexports[`regression tests switches from group of selected elements to another element on pointer down: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -19819,6 +19818,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -20114,7 +20114,6 @@ exports[`regression tests switches from group of selected elements to another elexports[`regression tests switches selected element on pointer down: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -20222,6 +20221,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -20409,7 +20409,6 @@ exports[`regression tests switches selected element on pointer down: [end of tesexports[`regression tests two-finger scroll works: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -20471,6 +20470,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -20511,7 +20511,6 @@ exports[`regression tests two-finger scroll works: [end of test] number of rendeexports[`regression tests undo/redo drawing an element: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -20573,6 +20572,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -21009,7 +21009,6 @@ exports[`regression tests undo/redo drawing an element: [end of test] number ofexports[`regression tests updates fontSize & fontFamily appState: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -21069,6 +21068,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,@@ -21109,7 +21109,6 @@ exports[`regression tests updates fontSize & fontFamily appState: [end of test]exports[`regression tests zoom hotkeys: [end of test] appState 1`] = `Object {- "appearance": "light","collaborators": Map {},"currentChartType": "bar","currentItemBackgroundColor": "transparent",@@ -21169,6 +21168,7 @@ Object {"showStats": false,"startBoundElement": null,"suggestedBindings": Array [],+ "theme": "light","toastMessage": null,"viewBackgroundColor": "#ffffff","viewModeEnabled": false,diff --git a/src/types.ts b/src/types.tsindex 1813b0181b..5876134399 100644--- a/src/types.ts+++ b/src/types.ts@@ -90,7 +90,7 @@ export type AppState = {showHelpDialog: boolean;toastMessage: string | null;zenModeEnabled: boolean;- appearance: "light" | "dark";+ theme: "light" | "dark";gridSize: number | null;viewModeEnabled: boolean;