diff --git a/dev-docs/docs/@excalidraw/excalidraw/api/constants.mdx b/dev-docs/docs/@excalidraw/excalidraw/api/constants.mdx index 36fbfa7582..56df321dae 100644 --- a/dev-docs/docs/@excalidraw/excalidraw/api/constants.mdx +++ b/dev-docs/docs/@excalidraw/excalidraw/api/constants.mdx @@ -10,11 +10,11 @@ import { FONT_FAMILY } from "@excalidraw/excalidraw"; `FONT_FAMILY` contains all the font families used in `Excalidraw`. The default families are the following: -| Font Family | Description | -| ----------- | ---------------------- | -| `Excalifont` | The `Hand-drawn` font | -| `Nunito` | The `Normal` Font | -| `Comic Shanns` | The `Code` Font | +| Font Family | Description | +| -------------- | --------------------- | +| `Excalifont` | The `Hand-drawn` font | +| `Nunito` | The `Normal` Font | +| `Comic Shanns` | The `Code` Font | Pre-selected family is `FONT_FAMILY.Excalifont`, unless it's overriden with `initialData.appState.currentItemFontFamily`. diff --git a/dev-docs/docs/@excalidraw/excalidraw/api/props/excalidraw-api.mdx b/dev-docs/docs/@excalidraw/excalidraw/api/props/excalidraw-api.mdx index c9580b66b6..761fe1c691 100644 --- a/dev-docs/docs/@excalidraw/excalidraw/api/props/excalidraw-api.mdx +++ b/dev-docs/docs/@excalidraw/excalidraw/api/props/excalidraw-api.mdx @@ -13,7 +13,7 @@ Once the callback is triggered, you will need to store the api in state to acces ```jsx showLineNumbers export default function App() { const [excalidrawAPI, setExcalidrawAPI] = useState(null); - return setExcalidrawAPI(api)} />; + return setExcalidrawAPI(api)} />; } ``` @@ -362,10 +362,9 @@ This API has the below signature. It sets the `tool` passed in param as the acti ```ts ( - tool: ( - | { type: ToolType } - | { type: "custom"; customType: string } - ) & { locked?: boolean }, + tool: ({ type: ToolType } | { type: "custom"; customType: string }) & { + locked?: boolean; + }, ) => {}; ``` diff --git a/dev-docs/docs/@excalidraw/excalidraw/api/props/initialdata.mdx b/dev-docs/docs/@excalidraw/excalidraw/api/props/initialdata.mdx index 0fec6ea029..e20f7d0d7d 100644 --- a/dev-docs/docs/@excalidraw/excalidraw/api/props/initialdata.mdx +++ b/dev-docs/docs/@excalidraw/excalidraw/api/props/initialdata.mdx @@ -1,7 +1,15 @@ # initialData
-{ elements?: ExcalidrawElement[], appState?: AppState }
+  { elements?:{" "}
+  
+    ExcalidrawElement[]
+  
+  , appState?:{" "}
+  
+    AppState
+  {" "}
+  }
 
This helps to load Excalidraw with `initialData`. It must be an object or a [promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise) which resolves to an object containing the below optional fields. @@ -46,7 +54,7 @@ function App() { }, ], appState: { zenModeEnabled: true, viewBackgroundColor: "#a5d8ff" }, - scrollToContent: true + scrollToContent: true, }} /> diff --git a/dev-docs/docs/@excalidraw/excalidraw/api/props/props.mdx b/dev-docs/docs/@excalidraw/excalidraw/api/props/props.mdx index 607e971826..070bac17d2 100644 --- a/dev-docs/docs/@excalidraw/excalidraw/api/props/props.mdx +++ b/dev-docs/docs/@excalidraw/excalidraw/api/props/props.mdx @@ -3,7 +3,7 @@ All `props` are _optional_. | Name | Type | Default | Description | -| --- | --- | --- | --- | +| --- | --- | --- | --- | --- | | [`initialData`](/docs/@excalidraw/excalidraw/api/props/initialdata) | `object` | `null` | Promise | `null` | The initial data with which app loads. | | [`excalidrawAPI`](/docs/@excalidraw/excalidraw/api/props/excalidraw-api) | `function` | \_ | Callback triggered with the excalidraw api once rendered | | [`isCollaborating`](#iscollaborating) | `boolean` | \_ | This indicates if the app is in `collaboration` mode | @@ -31,7 +31,7 @@ All `props` are _optional_. | [`generateIdForFile`](#generateidforfile) | `function` | \_ | Allows you to override `id` generation for files added on canvas | | [`validateEmbeddable`](#validateembeddable) | `string[]` \| `boolean` \| `RegExp` \| `RegExp[]` \| ((link: string) => boolean | undefined) | \_ | use for custom src url validation | | [`renderEmbeddable`](/docs/@excalidraw/excalidraw/api/props/render-props#renderEmbeddable) | `function` | \_ | Render function that can override the built-in `