@excalidraw/excalidraw 0.15.2-b57b3b5 → 0.15.2-bb985eb

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/dist/excalidraw-assets/locales/{es-ES-json-f2467c6a875a9e288756.js → es-ES-json-4f3da97feff33cb00e6d.js} +1 -1
  2. package/dist/excalidraw-assets/locales/{hi-IN-json-e22f4ad73126c2971850.js → hi-IN-json-3898c9c1216b44476529.js} +1 -1
  3. package/dist/excalidraw-assets/locales/{id-ID-json-0e69caf5d919807ed234.js → id-ID-json-43d505d7071a0e359681.js} +1 -1
  4. package/dist/excalidraw-assets/locales/{kk-KZ-json-106d2a41c68f69765668.js → kk-KZ-json-f648362328b839e9313f.js} +1 -1
  5. package/dist/excalidraw-assets/{vendor-53d1c69ef585b6dd219b.js → vendor-ef3c5d81a00ef582b871.js} +2 -2
  6. package/dist/excalidraw-assets-dev/{vendor-e6df8519da951026ff69.js → vendor-a14cd58fa2db417e42b2.js} +6 -6
  7. package/dist/excalidraw.development.js +1382 -1382
  8. package/dist/excalidraw.production.min.js +1 -1
  9. package/package.json +2 -1
  10. package/types/actions/actionAddToLibrary.d.ts +0 -1
  11. package/types/actions/actionAlign.d.ts +0 -1
  12. package/types/actions/actionBoundText.d.ts +0 -1
  13. package/types/actions/actionCanvas.d.ts +0 -1
  14. package/types/actions/actionClipboard.d.ts +0 -1
  15. package/types/actions/actionDeleteSelected.d.ts +0 -1
  16. package/types/actions/actionDistribute.d.ts +0 -1
  17. package/types/actions/actionDuplicateSelection.d.ts +0 -1
  18. package/types/actions/actionElementLock.d.ts +0 -1
  19. package/types/actions/actionExport.d.ts +0 -1
  20. package/types/actions/actionFinalize.d.ts +0 -1
  21. package/types/actions/actionFlip.d.ts +0 -1
  22. package/types/actions/actionFrame.d.ts +0 -1
  23. package/types/actions/actionGroup.d.ts +0 -1
  24. package/types/actions/actionLinearEditor.d.ts +0 -1
  25. package/types/actions/actionMenu.d.ts +0 -1
  26. package/types/actions/actionProperties.d.ts +0 -1
  27. package/types/actions/actionSelectAll.d.ts +0 -1
  28. package/types/actions/actionStyles.d.ts +0 -1
  29. package/types/actions/actionToggleGridMode.d.ts +0 -1
  30. package/types/actions/actionToggleStats.d.ts +0 -1
  31. package/types/actions/actionToggleViewMode.d.ts +0 -1
  32. package/types/actions/actionToggleZenMode.d.ts +0 -1
  33. package/types/components/Button.d.ts +0 -1
  34. package/types/components/Card.d.ts +0 -1
  35. package/types/components/ColorPicker/keyboardNavHandlers.d.ts +0 -1
  36. package/types/components/DefaultSidebar.d.ts +0 -1
  37. package/types/components/EyeDropper.d.ts +0 -1
  38. package/types/components/LibraryMenuHeaderContent.d.ts +0 -1
  39. package/types/components/LibraryUnit.d.ts +0 -1
  40. package/types/components/LoadingMessage.d.ts +0 -1
  41. package/types/components/Sidebar/SidebarTab.d.ts +0 -1
  42. package/types/components/Sidebar/SidebarTabTrigger.d.ts +0 -1
  43. package/types/components/Sidebar/SidebarTabTriggers.d.ts +0 -1
  44. package/types/components/Sidebar/SidebarTabs.d.ts +0 -1
  45. package/types/components/dropdownMenu/DropdownMenuTrigger.d.ts +0 -1
  46. package/types/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -1
  47. package/types/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -1
  48. package/types/components/welcome-screen/WelcomeScreen.d.ts +0 -1
  49. package/types/constants.d.ts +3 -0
  50. package/types/element/Hyperlink.d.ts +0 -1
  51. package/types/element/embeddable.d.ts +0 -1
  52. package/types/element/linearElementEditor.d.ts +0 -1
  53. package/types/element/textElement.d.ts +2 -6
  54. package/types/hooks/useOutsideClick.d.ts +0 -1
  55. package/types/hooks/useScrollPosition.d.ts +0 -1
  56. package/types/packages/excalidraw/webpack.dev.config.d.ts +5 -2
  57. package/types/packages/excalidraw/webpack.prod.config.d.ts +3 -0
  58. package/types/utility-types.d.ts +0 -1
  59. /package/dist/excalidraw-assets/{vendor-53d1c69ef585b6dd219b.js.LICENSE.txt → vendor-ef3c5d81a00ef582b871.js.LICENSE.txt} +0 -0
  60. /package/types/packages/excalidraw/dist/excalidraw-assets/locales/{es-ES-json-f2467c6a875a9e288756.d.ts → es-ES-json-4f3da97feff33cb00e6d.d.ts} +0 -0
  61. /package/types/packages/excalidraw/dist/excalidraw-assets/locales/{hi-IN-json-e22f4ad73126c2971850.d.ts → hi-IN-json-3898c9c1216b44476529.d.ts} +0 -0
  62. /package/types/packages/excalidraw/dist/excalidraw-assets/locales/{id-ID-json-0e69caf5d919807ed234.d.ts → id-ID-json-43d505d7071a0e359681.d.ts} +0 -0
  63. /package/types/packages/excalidraw/dist/excalidraw-assets/locales/{kk-KZ-json-106d2a41c68f69765668.d.ts → kk-KZ-json-f648362328b839e9313f.d.ts} +0 -0
  64. /package/types/packages/excalidraw/dist/excalidraw-assets/{vendor-53d1c69ef585b6dd219b.d.ts → vendor-ef3c5d81a00ef582b871.d.ts} +0 -0
  65. /package/types/packages/excalidraw/dist/excalidraw-assets-dev/{vendor-e6df8519da951026ff69.d.ts → vendor-a14cd58fa2db417e42b2.d.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@excalidraw/excalidraw",
3
- "version": "0.15.2-b57b3b5",
3
+ "version": "0.15.2-bb985eb",
4
4
  "main": "main.js",
5
5
  "types": "types/packages/excalidraw/index.d.ts",
6
6
  "files": [
@@ -59,6 +59,7 @@
59
59
  "cross-env": "7.0.3",
60
60
  "css-loader": "6.7.1",
61
61
  "dotenv": "16.0.1",
62
+ "import-meta-loader": "1.1.0",
62
63
  "mini-css-extract-plugin": "2.6.1",
63
64
  "postcss-loader": "7.0.1",
64
65
  "sass-loader": "13.0.2",
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const actionAddToLibrary: {
3
2
  name: "addToLibrary";
4
3
  trackEvent: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ExcalidrawElement } from "../element/types";
3
2
  import { AppClassProperties, AppState } from "../types";
4
3
  export declare const actionAlignTop: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ExcalidrawElement, ExcalidrawLinearElement } from "../element/types";
3
2
  import { AppState } from "../types";
4
3
  import { Mutable } from "../utility-types";
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ExcalidrawElement } from "../element/types";
3
2
  import { AppState, NormalizedZoomValue } from "../types";
4
3
  export declare const actionChangeViewBackgroundColor: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const actionCopy: {
3
2
  name: "copy";
4
3
  trackEvent: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ExcalidrawElement } from "../element/types";
3
2
  import { AppState } from "../types";
4
3
  import { LinearElementEditor } from "../element/linearElementEditor";
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ExcalidrawElement } from "../element/types";
3
2
  import { AppClassProperties, AppState } from "../types";
4
3
  export declare const distributeHorizontally: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ExcalidrawElement } from "../element/types";
3
2
  import { AppState } from "../types";
4
3
  export declare const actionDuplicateSelection: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ExcalidrawElement } from "../element/types";
3
2
  export declare const actionToggleElementLock: {
4
3
  name: "toggleElementLock";
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Theme } from "../element/types";
3
2
  import "../components/ToolIcon.scss";
4
3
  export declare const actionChangeProjectName: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { LinearElementEditor } from "../element/linearElementEditor";
3
2
  import { AppState } from "../types";
4
3
  export declare const actionFinalize: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ExcalidrawElement } from "../element/types";
3
2
  import { AppState } from "../types";
4
3
  export declare const actionFlipHorizontal: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ExcalidrawElement } from "../element/types";
3
2
  import { AppClassProperties, AppState } from "../types";
4
3
  export declare const actionSelectAllElementsInFrame: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ExcalidrawElement } from "../element/types";
3
2
  import { AppClassProperties, AppState } from "../types";
4
3
  export declare const actionGroup: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { LinearElementEditor } from "../element/linearElementEditor";
3
2
  import { ExcalidrawLinearElement } from "../element/types";
4
3
  export declare const actionToggleLinearEditor: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const actionToggleCanvasMenu: {
3
2
  name: "toggleCanvasMenu";
4
3
  trackEvent: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { AppState } from "../../src/types";
3
2
  import { Arrowhead, ExcalidrawElement, ExcalidrawLinearElement } from "../element/types";
4
3
  export declare const actionChangeStrokeColor: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ExcalidrawElement } from "../element/types";
3
2
  export declare const actionSelectAll: {
4
3
  name: "selectAll";
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare let copiedStyles: string;
3
2
  export declare const actionCopyStyles: {
4
3
  name: "copyStyles";
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { AppState } from "../types";
3
2
  export declare const actionToggleGridMode: {
4
3
  name: "gridMode";
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const actionToggleStats: {
3
2
  name: "stats";
4
3
  viewMode: true;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const actionToggleViewMode: {
3
2
  name: "viewMode";
4
3
  viewMode: true;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const actionToggleZenMode: {
3
2
  name: "zenMode";
4
3
  viewMode: true;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./Button.scss";
3
2
  interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
4
3
  type?: "button" | "submit" | "reset";
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import OpenColor from "open-color";
3
2
  import "./Card.scss";
4
3
  export declare const Card: React.FC<{
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ColorPaletteCustom } from "../../colors";
3
2
  import { ActiveColorPickerSectionAtomType } from "./colorPickerUtils";
4
3
  interface ColorPickerKeyNavHandlerProps {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { MarkOptional } from "../utility-types";
3
2
  import { SidebarProps, SidebarTriggerProps } from "./Sidebar/common";
4
3
  export declare const DefaultSidebar: import("react").FC<Omit<MarkOptional<Omit<{
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./EyeDropper.scss";
3
2
  type EyeDropperProperties = {
4
3
  keepOpenOnAlt: boolean;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { LibraryItem, UIAppState } from "../types";
3
2
  import Library from "../data/library";
4
3
  export declare const LibraryDropdownMenuButton: React.FC<{
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { LibraryItem } from "../types";
3
2
  import "./LibraryUnit.scss";
4
3
  import { SvgCache } from "../hooks/useLibraryItemSvg";
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Theme } from "../element/types";
3
2
  export declare const LoadingMessage: React.FC<{
4
3
  delay?: number;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { SidebarTabName } from "../../types";
3
2
  export declare const SidebarTab: {
4
3
  ({ tab, children, ...rest }: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { SidebarTabName } from "../../types";
3
2
  export declare const SidebarTabTrigger: {
4
3
  ({ children, tab, onSelect, ...rest }: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const SidebarTabTriggers: {
3
2
  ({ children, ...rest }: {
4
3
  children: React.ReactNode;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const SidebarTabs: {
3
2
  ({ children, ...rest }: {
4
3
  children: React.ReactNode;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const MenuTrigger: {
3
2
  ({ className, children, onToggle, title, ...rest }: {
4
3
  className?: string | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./LiveCollaborationTrigger.scss";
3
2
  declare const LiveCollaborationTrigger: {
4
3
  ({ isCollaborating, onSelect, ...rest }: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const Center: {
3
2
  ({ children }: {
4
3
  children?: React.ReactNode;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./WelcomeScreen.scss";
3
2
  declare const WelcomeScreen: {
4
3
  (props: {
@@ -98,6 +98,7 @@ export declare const FRAME_STYLE: {
98
98
  radius: number;
99
99
  };
100
100
  export declare const WINDOWS_EMOJI_FALLBACK_FONT = "Segoe UI Emoji";
101
+ export declare const MIN_FONT_SIZE = 1;
101
102
  export declare const DEFAULT_FONT_SIZE = 20;
102
103
  export declare const DEFAULT_FONT_FAMILY: FontFamilyValues;
103
104
  export declare const DEFAULT_TEXT_ALIGN = "left";
@@ -181,6 +182,8 @@ export declare const VERSIONS: {
181
182
  readonly excalidrawLibrary: 2;
182
183
  };
183
184
  export declare const BOUND_TEXT_PADDING = 5;
185
+ export declare const ARROW_LABEL_WIDTH_FRACTION = 0.7;
186
+ export declare const ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO = 11;
184
187
  export declare const VERTICAL_ALIGN: {
185
188
  TOP: string;
186
189
  MIDDLE: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { AppState, ExcalidrawProps, UIAppState } from "../types";
3
2
  import { NonDeletedExcalidrawElement } from "./types";
4
3
  import { Bounds } from "./bounds";
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ExcalidrawProps } from "../types";
3
2
  import { ExcalidrawElement, ExcalidrawEmbeddableElement, NonDeletedExcalidrawElement, Theme } from "./types";
4
3
  type EmbeddedLink = ({
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { NonDeleted, ExcalidrawLinearElement, ExcalidrawElement, PointBinding, ExcalidrawBindableElement, ExcalidrawTextElementWithContainer } from "./types";
3
2
  import { Point, AppState, PointerCoords } from "../types";
4
3
  import History from "../history";
@@ -6,7 +6,7 @@ export declare const normalizeText: (text: string) => string;
6
6
  export declare const splitIntoLines: (text: string) => string[];
7
7
  export declare const redrawTextBoundingBox: (textElement: ExcalidrawTextElement, container: ExcalidrawElement | null) => void;
8
8
  export declare const bindTextToShapeAfterDuplication: (sceneElements: ExcalidrawElement[], oldElements: ExcalidrawElement[], oldIdToDuplicatedId: Map<ExcalidrawElement["id"], ExcalidrawElement["id"]>) => void;
9
- export declare const handleBindTextResize: (container: NonDeletedExcalidrawElement, transformHandleType: MaybeTransformHandleType) => void;
9
+ export declare const handleBindTextResize: (container: NonDeletedExcalidrawElement, transformHandleType: MaybeTransformHandleType, shouldMaintainAspectRatio?: boolean) => void;
10
10
  export declare const computeBoundTextPosition: (container: ExcalidrawElement, boundTextElement: ExcalidrawTextElementWithContainer) => {
11
11
  x: number;
12
12
  y: number;
@@ -47,10 +47,6 @@ export declare const getBoundTextElement: (element: ExcalidrawElement | null) =>
47
47
  export declare const getContainerElement: (element: (ExcalidrawElement & {
48
48
  containerId: ExcalidrawElement["id"] | null;
49
49
  }) | null) => ExcalidrawElement | null;
50
- export declare const getContainerDims: (element: ExcalidrawElement) => {
51
- width: number;
52
- height: number;
53
- };
54
50
  export declare const getContainerCenter: (container: ExcalidrawElement, appState: AppState) => {
55
51
  x: number;
56
52
  y: number;
@@ -71,7 +67,7 @@ export declare const getTextBindableContainerAtPosition: (elements: readonly Exc
71
67
  declare const VALID_CONTAINER_TYPES: Set<string>;
72
68
  export declare const isValidTextContainer: (element: ExcalidrawElement) => boolean;
73
69
  export declare const computeContainerDimensionForBoundText: (dimension: number, containerType: ExtractSetType<typeof VALID_CONTAINER_TYPES>) => number;
74
- export declare const getBoundTextMaxWidth: (container: ExcalidrawElement) => number;
70
+ export declare const getBoundTextMaxWidth: (container: ExcalidrawElement, boundTextElement?: ExcalidrawTextElement | null) => number;
75
71
  export declare const getBoundTextMaxHeight: (container: ExcalidrawElement, boundTextElement: ExcalidrawTextElementWithContainer) => number;
76
72
  export declare const isMeasureTextSupported: () => boolean;
77
73
  export declare const getDefaultLineHeight: (fontFamily: FontFamilyValues) => number & {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare function useOutsideClick<T extends HTMLElement>(ref: React.RefObject<T>,
3
2
  /** if performance is of concern, memoize the callback */
4
3
  callback: (event: Event) => void,
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const useScrollPosition: <T extends HTMLElement>(elementRef: import("react").RefObject<T>) => number;
@@ -36,13 +36,16 @@ export namespace module {
36
36
  } | {
37
37
  test: RegExp;
38
38
  exclude: RegExp;
39
- use: {
39
+ use: ({
40
+ loader: string;
41
+ options?: undefined;
42
+ } | {
40
43
  loader: string;
41
44
  options: {
42
45
  transpileOnly: boolean;
43
46
  configFile: string;
44
47
  };
45
- }[];
48
+ })[];
46
49
  type?: undefined;
47
50
  } | {
48
51
  test: RegExp;
@@ -36,6 +36,9 @@ export namespace module {
36
36
  test: RegExp;
37
37
  exclude: RegExp;
38
38
  use: ({
39
+ loader: string;
40
+ options?: undefined;
41
+ } | {
39
42
  loader: string;
40
43
  options: {
41
44
  transpileOnly: boolean;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type Mutable<T> = {
3
2
  -readonly [P in keyof T]: T[P];
4
3
  };