@excalidraw/excalidraw 0.16.1-afea0df → 0.16.1-d1f8eec

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@excalidraw/excalidraw",
3
- "version": "0.16.1-afea0df",
3
+ "version": "0.16.1-d1f8eec",
4
4
  "main": "main.js",
5
5
  "types": "types/packages/excalidraw/index.d.ts",
6
6
  "files": [
@@ -1,7 +1,7 @@
1
- import { AppState } from "../../src/types";
1
+ import { AppState, Primitive } from "../../src/types";
2
2
  import { Arrowhead, ExcalidrawElement, ExcalidrawLinearElement } from "../element/types";
3
3
  export declare const changeProperty: (elements: readonly ExcalidrawElement[], appState: AppState, callback: (element: ExcalidrawElement) => ExcalidrawElement, includeBoundText?: boolean) => ExcalidrawElement[];
4
- export declare const getFormValue: <T>(elements: readonly ExcalidrawElement[], appState: AppState, getAttribute: (element: ExcalidrawElement) => T, defaultValue: T) => T;
4
+ export declare const getFormValue: <T extends Primitive>(elements: readonly ExcalidrawElement[], appState: AppState, getAttribute: (element: ExcalidrawElement) => T, isRelevantElement: true | ((element: ExcalidrawElement) => boolean), defaultValue: T | ((isSomeElementSelected: boolean) => T)) => T;
5
5
  export declare const actionChangeStrokeColor: {
6
6
  name: "changeStrokeColor";
7
7
  trackEvent: false;
@@ -39,7 +39,7 @@ export declare const actionSendToBack: {
39
39
  category: "element";
40
40
  };
41
41
  perform: (elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
42
- elements: import("../element/types").ExcalidrawElement[];
42
+ elements: readonly import("../element/types").ExcalidrawElement[] | import("../element/types").ExcalidrawElement[];
43
43
  appState: Readonly<import("../types").AppState>;
44
44
  commitToHistory: true;
45
45
  };
@@ -55,7 +55,7 @@ export declare const actionBringToFront: {
55
55
  category: "element";
56
56
  };
57
57
  perform: (elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
58
- elements: import("../element/types").ExcalidrawElement[];
58
+ elements: readonly import("../element/types").ExcalidrawElement[] | import("../element/types").ExcalidrawElement[];
59
59
  appState: Readonly<import("../types").AppState>;
60
60
  commitToHistory: true;
61
61
  };
@@ -216,6 +216,11 @@ export declare const ROUGHNESS: {
216
216
  readonly artist: 1;
217
217
  readonly cartoonist: 2;
218
218
  };
219
+ export declare const STROKE_WIDTH: {
220
+ readonly thin: 1;
221
+ readonly bold: 2;
222
+ readonly extraBold: 4;
223
+ };
219
224
  export declare const DEFAULT_ELEMENT_PROPS: {
220
225
  strokeColor: ExcalidrawElement["strokeColor"];
221
226
  backgroundColor: ExcalidrawElement["backgroundColor"];
package/types/frame.d.ts CHANGED
@@ -17,13 +17,10 @@ export declare const groupsAreCompletelyOutOfFrame: (elements: readonly NonDelet
17
17
  * Returns a map of frameId to frame elements. Includes empty frames.
18
18
  */
19
19
  export declare const groupByFrames: (elements: readonly ExcalidrawElement[]) => Map<string, ExcalidrawElement[]>;
20
- export declare const getFrameElements: (allElements: ExcalidrawElementsIncludingDeleted, frameId: string, opts?: {
21
- includeBoundArrows?: boolean;
22
- }) => ExcalidrawElement[];
20
+ export declare const getFrameElements: (allElements: ExcalidrawElementsIncludingDeleted, frameId: string) => ExcalidrawElement[];
23
21
  export declare const getElementsInResizingFrame: (allElements: ExcalidrawElementsIncludingDeleted, frame: ExcalidrawFrameElement, appState: AppState) => ExcalidrawElement[];
24
22
  export declare const getElementsInNewFrame: (allElements: ExcalidrawElementsIncludingDeleted, frame: ExcalidrawFrameElement) => ExcalidrawElement[];
25
23
  export declare const getContainingFrame: (element: ExcalidrawElement, elementsMap?: Map<string, ExcalidrawElement>) => ExcalidrawFrameElement | null;
26
- export declare const isValidFrameChild: (element: ExcalidrawElement) => boolean;
27
24
  /**
28
25
  * Retains (or repairs for target frame) the ordering invriant where children
29
26
  * elements come right before the parent frame:
@@ -4,7 +4,6 @@ export declare const hasStrokeColor: (type: string) => boolean;
4
4
  export declare const hasStrokeWidth: (type: string) => boolean;
5
5
  export declare const hasStrokeStyle: (type: string) => boolean;
6
6
  export declare const canChangeRoundness: (type: string) => boolean;
7
- export declare const hasText: (type: string) => boolean;
8
7
  export declare const canHaveArrowheads: (type: string) => boolean;
9
8
  export declare const getElementAtPosition: (elements: readonly NonDeletedExcalidrawElement[], isAtPositionFn: (element: NonDeletedExcalidrawElement) => boolean) => NonDeletedExcalidrawElement | null;
10
9
  export declare const getElementsAtPosition: (elements: readonly NonDeletedExcalidrawElement[], isAtPositionFn: (element: NonDeletedExcalidrawElement) => boolean) => NonDeletedExcalidrawElement[];
@@ -1,5 +1,5 @@
1
1
  export { isOverScrollBars } from "./scrollbars";
2
2
  export { isSomeElementSelected, getElementsWithinSelection, getCommonAttributeOfSelectedElements, getSelectedElements, getTargetElements, } from "./selection";
3
3
  export { calculateScrollCenter } from "./scroll";
4
- export { hasBackground, hasStrokeWidth, hasStrokeStyle, canHaveArrowheads, canChangeRoundness, getElementAtPosition, hasText, getElementsAtPosition, } from "./comparisons";
4
+ export { hasBackground, hasStrokeWidth, hasStrokeStyle, canHaveArrowheads, canChangeRoundness, getElementAtPosition, getElementsAtPosition, } from "./comparisons";
5
5
  export { getNormalizedZoom } from "./zoom";
package/types/types.d.ts CHANGED
@@ -515,4 +515,5 @@ export type KeyboardModifiersObject = {
515
515
  altKey: boolean;
516
516
  metaKey: boolean;
517
517
  };
518
+ export type Primitive = number | string | boolean | bigint | symbol | null | undefined;
518
519
  export {};
package/types/zindex.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ExcalidrawElement } from "./element/types";
2
2
  import { AppState } from "./types";
3
- export declare const moveOneLeft: (elements: readonly ExcalidrawElement[], appState: AppState, elementsToBeMoved?: readonly ExcalidrawElement[]) => ExcalidrawElement[];
4
- export declare const moveOneRight: (elements: readonly ExcalidrawElement[], appState: AppState, elementsToBeMoved?: readonly ExcalidrawElement[]) => ExcalidrawElement[];
5
- export declare const moveAllLeft: (elements: readonly ExcalidrawElement[], appState: AppState, elementsToBeMoved?: readonly ExcalidrawElement[]) => ExcalidrawElement[];
6
- export declare const moveAllRight: (elements: readonly ExcalidrawElement[], appState: AppState, elementsToBeMoved?: readonly ExcalidrawElement[]) => ExcalidrawElement[];
3
+ export declare const moveOneLeft: (allElements: readonly ExcalidrawElement[], appState: AppState) => ExcalidrawElement[];
4
+ export declare const moveOneRight: (allElements: readonly ExcalidrawElement[], appState: AppState) => ExcalidrawElement[];
5
+ export declare const moveAllLeft: (allElements: readonly ExcalidrawElement[], appState: AppState) => readonly ExcalidrawElement[] | ExcalidrawElement[];
6
+ export declare const moveAllRight: (allElements: readonly ExcalidrawElement[], appState: AppState) => readonly ExcalidrawElement[] | ExcalidrawElement[];