Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dwelle/excalidraw

Package Overview
Dependencies
Maintainers
1
Versions
396
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dwelle/excalidraw - npm Package Compare versions

Comparing version 0.3.8 to 0.3.9

dist/excalidraw-assets-dev/image-a98d24ea9aa42940a0df.js

64

CHANGELOG.md

@@ -16,8 +16,16 @@ # Changelog

## Excalidraw Library
## Excalidraw API
### Fixes
### Features
- Prevent gradual misalignment of the canvas due to floating point rounding errors [#3833](https://github.com/excalidraw/excalidraw/pull/3833).
- Export `THEME` constant from the package so host can use this when passing the theme
#### BREAKING CHANGE
The `Appearance` type is now removed and renamed to `Theme` so `Theme` type needs to be used.
---
## 0.10.0 (2021-10-13)
## Excalidraw API

@@ -27,8 +35,12 @@

- [`onPaste`](https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README.md#onPaste) prop should return false to prevent the native excalidraw paste action.
- [`onPaste`](https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README.md#onPaste) prop should return false to prevent the native excalidraw paste action [#3974](https://github.com/excalidraw/excalidraw/pull/3974).
#### BREAKING CHANGE
#### BREAKING CHANGE
- Earlier the paste action was prevented when the prop [`onPaste`](https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README.md#onPaste) returned true, but now it should return false to prevent the paste action. This was done to make it semantically more correct and intuitive.
- Earlier the paste action was prevented when the prop [`onPaste`](https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README.md#onPaste) returned true, but now it should return false to prevent the paste action. This was done to make it semantically more correct and intuitive.
### Build
- Enable jsx transform in webpack [#4049](https://github.com/excalidraw/excalidraw/pull/4049)
### Docs

@@ -38,2 +50,42 @@

## Excalidraw Library
**_This section lists the updates made to the excalidraw library and will not affect the integration._**
### Features
- Improve freedraw shape [#3984](https://github.com/excalidraw/excalidraw/pull/3984)
- Make color ARIA labels better [#3871](https://github.com/excalidraw/excalidraw/pull/3871)
- Add origin trial tokens [#3853](https://github.com/excalidraw/excalidraw/pull/3853)
- Re-order zoom buttons [#3837](https://github.com/excalidraw/excalidraw/pull/3837)
- Add undo/redo buttons & tweak footer [#3832](https://github.com/excalidraw/excalidraw/pull/3832)
- Resave to png/svg with metadata if you loaded your scene from a png/svg file [#3645](https://github.com/excalidraw/excalidraw/pull/3645)
### Fixes
- Abstract and fix legacy fs [#4032](https://github.com/excalidraw/excalidraw/pull/4032)
- Context menu positioning [#4025](https://github.com/excalidraw/excalidraw/pull/4025)
- Added alert for bad encryption key [#3998](https://github.com/excalidraw/excalidraw/pull/3998)
- OnPaste should return false to prevent paste action [#3974](https://github.com/excalidraw/excalidraw/pull/3974)
- Help-icon now visible on Safari [#3939](https://github.com/excalidraw/excalidraw/pull/3939)
- Permanent zoom mode [#3931](https://github.com/excalidraw/excalidraw/pull/3931)
- Undo/redo buttons gap in Safari [#3836](https://github.com/excalidraw/excalidraw/pull/3836)
- Prevent gradual canvas misalignment [#3833](https://github.com/excalidraw/excalidraw/pull/3833)
- Color picker shortcuts not working when elements selected [#3817](https://github.com/excalidraw/excalidraw/pull/3817)
---
## 0.9.0 (2021-07-10)

@@ -40,0 +92,0 @@

@@ -0,1 +1,16 @@

/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
/** @license React v17.0.2
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// @license © 2020 Google LLC. Licensed under the Apache License, Version 2.0.

2

package.json
{
"name": "@dwelle/excalidraw",
"version": "0.3.8",
"version": "0.3.9",
"main": "main.js",

@@ -5,0 +5,0 @@ "types": "types/packages/excalidraw/index.d.ts",

@@ -374,3 +374,3 @@ <!-- unstable-readme-start-->

| [`libraryReturnUrl`](#libraryReturnUrl) | string | | What URL should [libraries.excalidraw.com](https://libraries.excalidraw.com) be installed to |
| [`theme`](#theme) | `light` or `dark` | | The theme of the Excalidraw component |
| [`theme`](#theme) | [THEME.LIGHT](#THEME-1) &#124; [THEME.LIGHT](#THEME-1) | [THEME.LIGHT](#THEME-1) | The theme of the Excalidraw component |
| [`name`](#name) | string | | Name of the drawing |

@@ -576,3 +576,3 @@ | [`UIOptions`](#UIOptions) | <pre>{ canvasActions: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L208"> CanvasActions<a/> }</pre> | [DEFAULT UI OPTIONS](https://github.com/excalidraw/excalidraw/blob/master/src/constants.ts#L129) | To customise UI options. Currently we support customising [`canvas actions`](#canvasActions) |

This prop controls Excalidraw's theme. When supplied, the value takes precedence over `intialData.appState.theme`, the theme will be fully controlled by the host app, and users won't be able to toggle it from within the app.
This prop controls Excalidraw's theme. When supplied, the value takes precedence over `intialData.appState.theme`, the theme will be fully controlled by the host app, and users won't be able to toggle it from within the app. You can use [`THEME`](#THEME-1) to specify the theme.

@@ -625,8 +625,4 @@ #### `name`

### Does it support collaboration ?
#### `importLibrary`
No, Excalidraw package doesn't come with collaboration built in, since the implementation is specific to each host app. We expose APIs which you can use to communicate with Excalidraw which you can use to implement it. You can check our own implementation [here](https://github.com/excalidraw/excalidraw/blob/master/src/excalidraw-app/index.tsx).
### importLibrary
Imports library from given URL. You should call this on `hashchange`, passing the `addLibrary` value if you detect it as shown below. Optionally pass a CSRF `token` to skip prompting during installation (retrievable via `token` key from the url coming from [https://libraries.excalidraw.com](https://libraries.excalidraw.com/)).

@@ -652,7 +648,7 @@

### detectScroll
#### `detectScroll`
Indicates whether Excalidraw should listen for `scroll` event on the nearest scrollable container in the DOM tree and recompute the coordinates (e.g. to correctly handle the cursor) when the component's position changes. You can disable this when you either know this doesn't affect your app or you want to take care of it yourself (calling the [`refresh()`](#ref) method).
### handleKeyboardGlobally
#### `handleKeyboardGlobally`

@@ -663,3 +659,3 @@ Indicates whether to bind keyboard events to `document`. Disabled by default, meaning the keyboard events are bound to the Excalidraw component. This allows for multiple Excalidraw components to live on the same page, and ensures that Excalidraw keyboard handling doesn't collide with your app's (or the browser) when the component isn't focused.

### onLibraryChange
#### `onLibraryChange`

@@ -674,11 +670,11 @@ Ths callback if supplied will get triggered when the library is updated and has the below signature.

### id
#### `id`
The unique id of the excalidraw component. This can be used to identify the excalidraw component, for example importing the library items to the excalidraw component from where it was initiated when you have multiple excalidraw components rendered on the same page as shown in [multiple excalidraw demo](https://codesandbox.io/s/multiple-excalidraw-k1xx5).
### autoFocus
#### `autoFocus`
This prop implies whether to focus the Excalidraw component on page load. Defaults to false.
### generateIdForFile
#### `generateIdForFile`

@@ -691,47 +687,6 @@ Allows you to override `id` generation for files added on canvas (images). By default, an SHA-1 digest of the file is used.

### Extra API's
### Does it support collaboration ?
#### `getSceneVersion`
No, Excalidraw package doesn't come with collaboration built in, since the implementation is specific to each host app. We expose APIs which you can use to communicate with Excalidraw which you can use to implement it. You can check our own implementation [here](https://github.com/excalidraw/excalidraw/blob/master/src/excalidraw-app/index.tsx).
**How to use**
<pre>
import { getSceneVersion } from "@excalidraw/excalidraw-next";
getSceneVersion(elements: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L78">ExcalidrawElement[]</a>)
</pre>
This function returns the current scene version.
#### `isInvisiblySmallElement`
**_Signature_**
<pre>
isInvisiblySmallElement(element: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L78">ExcalidrawElement</a>): boolean
</pre>
**How to use**
```js
import { isInvisiblySmallElement } from "@excalidraw/excalidraw-next";
```
Returns `true` if element is invisibly small (e.g. width & height are zero).
#### `getElementMap`
**_Signature_**
<pre>
getElementsMap(elements: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L78">ExcalidrawElement[]</a>): {[id: string]: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L78">ExcalidrawElement</a>}
</pre>
**How to use**
```js
import { getElementsMap } from "@excalidraw/excalidraw-next";
```
This function returns an object where each element is mapped to its id.
### Restore utilities

@@ -793,15 +748,2 @@

#### `serializeAsJSON`
**_Signature_**
<pre>
serializeAsJSON({
elements: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L78">ExcalidrawElement[]</a>,
appState: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L42">AppState</a>,
}): string
</pre>
Takes the scene elements and state and returns a JSON string. Deleted `elements`as well as most properties from `AppState` are removed from the resulting JSON. (see [`serializeAsJSON()`](https://github.com/excalidraw/excalidraw/blob/master/src/data/json.ts#L16) source for details).
### Export utilities

@@ -891,23 +833,63 @@

### FONT_FAMILY
### Extra API's
#### `serializeAsJSON`
**_Signature_**
<pre>
serializeAsJSON({
elements: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L78">ExcalidrawElement[]</a>,
appState: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L42">AppState</a>,
}): string
</pre>
Takes the scene elements and state and returns a JSON string. Deleted `elements`as well as most properties from `AppState` are removed from the resulting JSON. (see [`serializeAsJSON()`](https://github.com/excalidraw/excalidraw/blob/master/src/data/json.ts#L16) source for details).
#### `getSceneVersion`
**How to use**
<pre>
import { getSceneVersion } from "@excalidraw/excalidraw-next";
getSceneVersion(elements: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L78">ExcalidrawElement[]</a>)
</pre>
This function returns the current scene version.
#### `isInvisiblySmallElement`
**_Signature_**
<pre>
isInvisiblySmallElement(element: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L78">ExcalidrawElement</a>): boolean
</pre>
**How to use**
```js
import { FONT_FAMILY } from "@excalidraw/excalidraw-next";
import { isInvisiblySmallElement } from "@excalidraw/excalidraw-next";
```
`FONT_FAMILY` contains all the font families used in `Excalidraw` as explained below
Returns `true` if element is invisibly small (e.g. width & height are zero).
| Font Family | Description |
| ----------- | -------------------- |
| Virgil | The handwritten font |
| Helvetica | The Normal Font |
| Cascadia | The Code Font |
#### `getElementMap`
Defaults to `FONT_FAMILY.Virgil` unless passed in `initialData.appState.currentItemFontFamily`.
**_Signature_**
### loadLibraryFromBlob
<pre>
getElementsMap(elements: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L78">ExcalidrawElement[]</a>): {[id: string]: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L78">ExcalidrawElement</a>}
</pre>
**How to use**
```js
import { getElementsMap } from "@excalidraw/excalidraw-next";
```
This function returns an object where each element is mapped to its id.
#### `loadLibraryFromBlob`
```js
import { loadLibraryFromBlob } from "@excalidraw/excalidraw-next";

@@ -924,3 +906,3 @@ ```

### loadFromBlob
#### `loadFromBlob`

@@ -941,3 +923,3 @@ **How to use**

### getFreeDrawSvgPath
#### `getFreeDrawSvgPath`

@@ -958,4 +940,41 @@ **How to use**

### Exported constants
#### `FONT_FAMILY`
**How to use**
```js
import { FONT_FAMILY } from "@excalidraw/excalidraw-next";
```
`FONT_FAMILY` contains all the font families used in `Excalidraw` as explained below
| Font Family | Description |
| ----------- | -------------------- |
| Virgil | The handwritten font |
| Helvetica | The Normal Font |
| Cascadia | The Code Font |
Defaults to `FONT_FAMILY.Virgil` unless passed in `initialData.appState.currentItemFontFamily`.
#### `THEME`
**How to use**
```js
import { THEME } from "@excalidraw/excalidraw-next";
```
`THEME` contains all the themes supported by `Excalidraw` as explained below
| Theme | Description |
| ----- | --------------- |
| LIGHT | The light theme |
| DARK | The Dark theme |
Defaults to `THEME.LIGHT` unless passed in `initialData.appState.theme`
## Need help?
Check out the existing [Q&A](https://github.com/excalidraw/excalidraw/discussions?discussions_q=label%3Apackage%3Aexcalidraw). If you have any queries or need help, ask us [here](https://github.com/excalidraw/excalidraw/discussions?discussions_q=label%3Apackage%3Aexcalidraw).

@@ -607,3 +607,3 @@ ### Excalidraw

In case you want to prevent the excalidraw paste action you must return `true`, it will stop the native excalidraw clipboard management flow (nothing will be pasted into the scene).
In case you want to prevent the excalidraw paste action you must return `false`, it will stop the native excalidraw clipboard management flow (nothing will be pasted into the scene).

@@ -610,0 +610,0 @@ ### Does it support collaboration ?

@@ -5,3 +5,3 @@ import { ExcalidrawElement } from "./element/types";

export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>, elements: readonly ExcalidrawElement[]) => {
theme?: "light" | "dark" | undefined;
theme?: string | undefined;
zoom?: Readonly<{

@@ -8,0 +8,0 @@ value: NormalizedZoomValue;

/// <reference types="react" />
import "./ToolIcon.scss";
export declare type Appearence = "light" | "dark";
import { Theme } from "../element/types";
export declare const DarkModeToggle: (props: {
value: Appearence;
onChange: (value: Appearence) => void;
value: Theme;
onChange: (value: Theme) => void;
title?: string | undefined;
}) => JSX.Element;
import React from "react";
import { Theme } from "../element/types";
declare type Opts = {

@@ -31,36 +32,36 @@ width?: number;

export declare const BringForwardIcon: React.MemoExoticComponent<({ theme }: {
theme: "light" | "dark";
theme: Theme;
}) => JSX.Element>;
export declare const SendBackwardIcon: React.MemoExoticComponent<({ theme }: {
theme: "light" | "dark";
theme: Theme;
}) => JSX.Element>;
export declare const BringToFrontIcon: React.MemoExoticComponent<({ theme }: {
theme: "light" | "dark";
theme: Theme;
}) => JSX.Element>;
export declare const SendToBackIcon: React.MemoExoticComponent<({ theme }: {
theme: "light" | "dark";
theme: Theme;
}) => JSX.Element>;
export declare const AlignTopIcon: React.MemoExoticComponent<({ theme }: {
theme: "light" | "dark";
theme: Theme;
}) => JSX.Element>;
export declare const AlignBottomIcon: React.MemoExoticComponent<({ theme }: {
theme: "light" | "dark";
theme: Theme;
}) => JSX.Element>;
export declare const AlignLeftIcon: React.MemoExoticComponent<({ theme }: {
theme: "light" | "dark";
theme: Theme;
}) => JSX.Element>;
export declare const AlignRightIcon: React.MemoExoticComponent<({ theme }: {
theme: "light" | "dark";
theme: Theme;
}) => JSX.Element>;
export declare const DistributeHorizontallyIcon: React.MemoExoticComponent<({ theme }: {
theme: "light" | "dark";
theme: Theme;
}) => JSX.Element>;
export declare const DistributeVerticallyIcon: React.MemoExoticComponent<({ theme }: {
theme: "light" | "dark";
theme: Theme;
}) => JSX.Element>;
export declare const CenterVerticallyIcon: React.MemoExoticComponent<({ theme }: {
theme: "light" | "dark";
theme: Theme;
}) => JSX.Element>;
export declare const CenterHorizontallyIcon: React.MemoExoticComponent<({ theme }: {
theme: "light" | "dark";
theme: Theme;
}) => JSX.Element>;

@@ -76,90 +77,90 @@ export declare const users: JSX.Element;

export declare const GroupIcon: React.MemoExoticComponent<({ theme }: {
theme: "light" | "dark";
theme: Theme;
}) => JSX.Element>;
export declare const UngroupIcon: React.MemoExoticComponent<({ theme }: {
theme: "light" | "dark";
theme: Theme;
}) => JSX.Element>;
export declare const FillHachureIcon: React.MemoExoticComponent<({ theme }: {
theme: "light" | "dark";
theme: Theme;
}) => JSX.Element>;
export declare const FillCrossHatchIcon: React.MemoExoticComponent<({ theme }: {
theme: "light" | "dark";
theme: Theme;
}) => JSX.Element>;
export declare const FillSolidIcon: React.MemoExoticComponent<({ theme }: {
theme: "light" | "dark";
theme: Theme;
}) => JSX.Element>;
export declare const StrokeWidthIcon: React.MemoExoticComponent<({ theme, strokeWidth }: {
theme: "light" | "dark";
theme: Theme;
strokeWidth: number;
}) => JSX.Element>;
export declare const StrokeStyleSolidIcon: React.MemoExoticComponent<({ theme }: {
theme: "light" | "dark";
theme: Theme;
}) => JSX.Element>;
export declare const StrokeStyleDashedIcon: React.MemoExoticComponent<({ theme }: {
theme: "light" | "dark";
theme: Theme;
}) => JSX.Element>;
export declare const StrokeStyleDottedIcon: React.MemoExoticComponent<({ theme }: {
theme: "light" | "dark";
theme: Theme;
}) => JSX.Element>;
export declare const SloppinessArchitectIcon: React.MemoExoticComponent<({ theme }: {
theme: "light" | "dark";
theme: Theme;
}) => JSX.Element>;
export declare const SloppinessArtistIcon: React.MemoExoticComponent<({ theme }: {
theme: "light" | "dark";
theme: Theme;
}) => JSX.Element>;
export declare const SloppinessCartoonistIcon: React.MemoExoticComponent<({ theme }: {
theme: "light" | "dark";
theme: Theme;
}) => JSX.Element>;
export declare const EdgeSharpIcon: React.MemoExoticComponent<({ theme }: {
theme: "light" | "dark";
theme: Theme;
}) => JSX.Element>;
export declare const EdgeRoundIcon: React.MemoExoticComponent<({ theme }: {
theme: "light" | "dark";
theme: Theme;
}) => JSX.Element>;
export declare const ArrowheadNoneIcon: React.MemoExoticComponent<({ theme }: {
theme: "light" | "dark";
theme: Theme;
}) => JSX.Element>;
export declare const ArrowheadArrowIcon: React.MemoExoticComponent<({ theme, flip }: {
theme: "light" | "dark";
theme: Theme;
flip?: boolean | undefined;
}) => JSX.Element>;
export declare const ArrowheadDotIcon: React.MemoExoticComponent<({ theme, flip }: {
theme: "light" | "dark";
theme: Theme;
flip?: boolean | undefined;
}) => JSX.Element>;
export declare const ArrowheadBarIcon: React.MemoExoticComponent<({ theme, flip }: {
theme: "light" | "dark";
theme: Theme;
flip?: boolean | undefined;
}) => JSX.Element>;
export declare const FontSizeSmallIcon: React.MemoExoticComponent<({ theme }: {
theme: "light" | "dark";
theme: Theme;
}) => JSX.Element>;
export declare const FontSizeMediumIcon: React.MemoExoticComponent<({ theme }: {
theme: "light" | "dark";
theme: Theme;
}) => JSX.Element>;
export declare const FontSizeLargeIcon: React.MemoExoticComponent<({ theme }: {
theme: "light" | "dark";
theme: Theme;
}) => JSX.Element>;
export declare const FontSizeExtraLargeIcon: React.MemoExoticComponent<({ theme }: {
theme: "light" | "dark";
theme: Theme;
}) => JSX.Element>;
export declare const FontFamilyHandDrawnIcon: React.MemoExoticComponent<({ theme }: {
theme: "light" | "dark";
theme: Theme;
}) => JSX.Element>;
export declare const FontFamilyNormalIcon: React.MemoExoticComponent<({ theme }: {
theme: "light" | "dark";
theme: Theme;
}) => JSX.Element>;
export declare const FontFamilyCodeIcon: React.MemoExoticComponent<({ theme }: {
theme: "light" | "dark";
theme: Theme;
}) => JSX.Element>;
export declare const TextAlignLeftIcon: React.MemoExoticComponent<({ theme }: {
theme: "light" | "dark";
theme: Theme;
}) => JSX.Element>;
export declare const TextAlignCenterIcon: React.MemoExoticComponent<({ theme }: {
theme: "light" | "dark";
theme: Theme;
}) => JSX.Element>;
export declare const TextAlignRightIcon: React.MemoExoticComponent<({ theme }: {
theme: "light" | "dark";
theme: Theme;
}) => JSX.Element>;
export declare const home: JSX.Element;
export {};

@@ -5,13 +5,5 @@ import React from "react";

langCode: Language["code"];
children: React.ReactElement;
}
interface State {
isLoading: boolean;
}
export declare class InitializeApp extends React.Component<Props, State> {
state: {
isLoading: boolean;
};
componentDidMount(): Promise<void>;
render(): React.ReactNode;
}
export declare const InitializeApp: (props: Props) => JSX.Element;
export {};

@@ -64,2 +64,6 @@ import { AppProps, CanvasActions, ExportOpts } from "./types";

};
export declare const THEME: {
LIGHT: string;
DARK: string;
};
export declare const WINDOWS_EMOJI_FALLBACK_FONT = "Segoe UI Emoji";

@@ -120,1 +124,3 @@ export declare const DEFAULT_FONT_SIZE = 20;

export declare const DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT = 1440;
export declare const ALLOWED_IMAGE_MIME_TYPES: readonly ["image/png", "image/jpeg", "image/svg+xml"];
export declare const MAX_ALLOWED_FILE_BYTES: number;

@@ -0,1 +1,2 @@

import { ALLOWED_IMAGE_MIME_TYPES } from "../constants";
import { ExcalidrawElement, FileId } from "../element/types";

@@ -9,6 +10,10 @@ import { AppState, DataURL } from "../types";

export declare const isImageFileHandle: (handle: FileSystemHandle | null) => boolean;
export declare const isImageFile: (blob: Blob | null | undefined) => blob is Blob;
export declare const isSupportedImageFile: (blob: Blob | null | undefined) => blob is Blob & {
type: typeof ALLOWED_IMAGE_MIME_TYPES[number];
};
export declare const loadFromBlob: (blob: Blob, localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null) => Promise<import("./restore").RestoredDataState>;
export declare const loadLibraryFromBlob: (blob: Blob) => Promise<ImportedLibraryData>;
export declare const canvasToBlob: (canvas: HTMLCanvasElement) => Promise<Blob>;
/** generates SHA-1 digest from supplied file (if not supported, falls back
to a 40-char base64 random id) */
export declare const generateIdFromFile: (file: File) => Promise<FileId>;

@@ -18,1 +23,2 @@ export declare const getDataURL: (file: Blob | File) => Promise<DataURL>;

export declare const resizeImageFile: (file: File, maxWidthOrHeight: number) => Promise<File>;
export declare const getDataURLMimeType: (dataURL: DataURL) => string;
import { Point } from "../types";
import { FONT_FAMILY } from "../constants";
import { FONT_FAMILY, THEME } from "../constants";
export declare type ChartType = "bar" | "line";

@@ -7,2 +7,3 @@ export declare type FillStyle = "hachure" | "cross-hatch" | "solid";

export declare type FontFamilyValues = typeof FONT_FAMILY[FontFamilyKeys];
export declare type Theme = typeof THEME[keyof typeof THEME];
export declare type FontString = string & {

@@ -65,3 +66,3 @@ _brand: "fontString";

/** whether respective file is persisted */
status: "pending" | "saved";
status: "pending" | "saved" | "error";
/** X and Y scale factors <-1, 1>, used for image axis flipping */

@@ -68,0 +69,0 @@ scale: [number, number];

@@ -13,3 +13,3 @@ import React from "react";

export { exportToBlob, exportToCanvas, exportToSvg, serializeAsJSON, loadLibraryFromBlob, loadFromBlob, getFreeDrawSvgPath, } from "../../packages/utils";
export { FONT_FAMILY } from "../../constants";
export { FONT_FAMILY, THEME } from "../../constants";
export { exportToClipboard } from "../utils";

@@ -16,0 +16,0 @@ export { getDefaultAppState } from "../../appState";

@@ -46,3 +46,5 @@ import autoprefixer = require("autoprefixer");

options: {
presets: string[];
presets: (string | (string | {
runtime: string;
})[])[];
plugins: string[];

@@ -49,0 +51,0 @@ transpileOnly?: undefined;

/// <reference types="react" />
import { PointerType, ExcalidrawLinearElement, NonDeletedExcalidrawElement, NonDeleted, TextAlign, ExcalidrawElement, GroupId, ExcalidrawBindableElement, Arrowhead, ChartType, FontFamilyValues, FileId, ExcalidrawImageElement } from "./element/types";
import { PointerType, ExcalidrawLinearElement, NonDeletedExcalidrawElement, NonDeleted, TextAlign, ExcalidrawElement, GroupId, ExcalidrawBindableElement, Arrowhead, ChartType, FontFamilyValues, FileId, ExcalidrawImageElement, Theme } from "./element/types";
import { SHAPES } from "./shapes";

@@ -42,2 +42,3 @@ import { Point as RoughPoint } from "roughjs/bin/geometry";

};
export declare type BinaryFileMetadata = Omit<BinaryFileData, "dataURL">;
export declare type AppState = {

@@ -98,3 +99,3 @@ files: Record<ExcalidrawElement["id"], BinaryFileData>;

zenModeEnabled: boolean;
theme: "light" | "dark";
theme: Theme;
gridSize: number | null;

@@ -192,3 +193,3 @@ viewModeEnabled: boolean;

libraryReturnUrl?: string;
theme?: "dark" | "light";
theme?: Theme;
name?: string;

@@ -310,3 +311,3 @@ renderCustomStats?: (elements: readonly NonDeletedExcalidrawElement[], appState: AppState) => JSX.Element;

setToastMessage: InstanceType<typeof App>["setToastMessage"];
addFiles: (data: AppState["files"][number][]) => void;
addFiles: (data: BinaryFileData[]) => void;
readyPromise: ResolvablePromise<ExcalidrawImperativeAPI>;

@@ -313,0 +314,0 @@ ready: true;

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc