@dwelle/excalidraw 0.3.30 → 0.3.34

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": "@dwelle/excalidraw",
3
- "version": "0.3.30",
3
+ "version": "0.3.34",
4
4
  "main": "main.js",
5
5
  "types": "types/packages/excalidraw/index.d.ts",
6
6
  "files": [
@@ -38,13 +38,13 @@
38
38
  },
39
39
  "devDependencies": {
40
40
  "@babel/core": "7.16.0",
41
- "@babel/plugin-transform-arrow-functions": "7.16.0",
41
+ "@babel/plugin-transform-arrow-functions": "7.16.7",
42
42
  "@babel/plugin-transform-async-to-generator": "7.16.0",
43
43
  "@babel/plugin-transform-runtime": "7.16.4",
44
44
  "@babel/plugin-transform-typescript": "7.16.1",
45
- "@babel/preset-env": "7.16.4",
46
- "@babel/preset-react": "7.16.0",
47
- "@babel/preset-typescript": "7.16.0",
45
+ "@babel/preset-env": "7.16.7",
46
+ "@babel/preset-react": "7.16.7",
47
+ "@babel/preset-typescript": "7.16.7",
48
48
  "autoprefixer": "10.4.0",
49
49
  "babel-loader": "8.2.3",
50
50
  "babel-plugin-transform-class-properties": "6.24.1",
@@ -53,12 +53,14 @@
53
53
  "mini-css-extract-plugin": "2.4.5",
54
54
  "postcss-loader": "6.2.1",
55
55
  "sass-loader": "12.4.0",
56
- "terser-webpack-plugin": "5.2.5",
56
+ "terser-webpack-plugin": "5.3.0",
57
57
  "ts-loader": "9.2.6",
58
58
  "typescript": "4.5.3",
59
59
  "webpack": "5.65.0",
60
60
  "webpack-bundle-analyzer": "4.5.0",
61
- "webpack-cli": "4.9.1"
61
+ "webpack-cli": "4.9.1",
62
+ "webpack-dev-server": "4.7.1",
63
+ "webpack-merge": "5.8.0"
62
64
  },
63
65
  "repository": "https://github.com/dwelle/excalidraw",
64
66
  "homepage": "https://github.com/excalidraw/excalidraw/tree/master/src/packages/excalidraw",
@@ -66,7 +68,8 @@
66
68
  "gen:types": "tsc --project ../../../tsconfig-types.json",
67
69
  "build:umd": "rm -rf dist && cross-env NODE_ENV=production webpack --config webpack.prod.config.js && cross-env NODE_ENV=development webpack --config webpack.dev.config.js && yarn gen:types",
68
70
  "build:umd:withAnalyzer": "cross-env NODE_ENV=production ANALYZER=true webpack --config webpack.prod.config.js",
69
- "pack": "yarn build:umd && yarn pack"
71
+ "pack": "yarn build:umd && yarn pack",
72
+ "start": "webpack serve --config webpack.dev-server.config.js "
70
73
  },
71
74
  "dependencies": {
72
75
  "dotenv": "10.0.0"
package/types/align.d.ts CHANGED
@@ -4,4 +4,3 @@ export interface Alignment {
4
4
  axis: "x" | "y";
5
5
  }
6
6
  export declare const alignElements: (selectedElements: ExcalidrawElement[], alignment: Alignment) => ExcalidrawElement[];
7
- export declare const getMaximumGroups: (elements: ExcalidrawElement[]) => ExcalidrawElement[][];
@@ -134,4 +134,4 @@ export declare const VERSIONS: {
134
134
  readonly excalidraw: 2;
135
135
  readonly excalidrawLibrary: 2;
136
136
  };
137
- export declare const PADDING = 30;
137
+ export declare const BOUND_TEXT_PADDING = 5;
@@ -4,4 +4,3 @@ export interface Distribution {
4
4
  axis: "x" | "y";
5
5
  }
6
6
  export declare const distributeElements: (selectedElements: ExcalidrawElement[], distribution: Distribution) => ExcalidrawElement[];
7
- export declare const getMaximumGroups: (elements: ExcalidrawElement[]) => ExcalidrawElement[][];
@@ -19,5 +19,9 @@ export interface Box {
19
19
  minY: number;
20
20
  maxX: number;
21
21
  maxY: number;
22
+ midX: number;
23
+ midY: number;
24
+ width: number;
25
+ height: number;
22
26
  }
23
27
  export declare const getCommonBoundingBox: (elements: ExcalidrawElement[] | readonly NonDeleted<ExcalidrawElement>[]) => Box;
@@ -1,6 +1,6 @@
1
1
  import { SHAPES } from "../shapes";
2
2
  import { NonDeletedExcalidrawElement } from "./types";
3
- import { PointerDownState } from "../types";
4
- export declare const dragSelectedElements: (pointerDownState: PointerDownState, selectedElements: NonDeletedExcalidrawElement[], pointerX: number, pointerY: number, lockDirection?: boolean, distanceX?: number, distanceY?: number) => void;
3
+ import { AppState, PointerDownState } from "../types";
4
+ export declare const dragSelectedElements: (pointerDownState: PointerDownState, selectedElements: NonDeletedExcalidrawElement[], pointerX: number, pointerY: number, lockDirection: boolean | undefined, distanceX: number | undefined, distanceY: number | undefined, appState: AppState) => void;
5
5
  export declare const getDragOffsetXY: (selectedElements: NonDeletedExcalidrawElement[], x: number, y: number) => [number, number];
6
6
  export declare const dragNewElement: (draggingElement: NonDeletedExcalidrawElement, elementType: typeof SHAPES[number]["value"], originX: number, originY: number, x: number, y: number, width: number, height: number, shouldMaintainAspectRatio: boolean, shouldResizeFromCenter: boolean, widthAspectRatio?: number | null | undefined) => void;
@@ -1,6 +1,7 @@
1
1
  import { ExcalidrawElement, ExcalidrawTextElement, FontString, NonDeletedExcalidrawElement } from "./types";
2
2
  import { MaybeTransformHandleType } from "./transformHandles";
3
- export declare const redrawTextBoundingBox: (element: ExcalidrawTextElement) => void;
3
+ import { AppState } from "../types";
4
+ export declare const redrawTextBoundingBox: (element: ExcalidrawTextElement, container: ExcalidrawElement | null, appState: AppState) => void;
4
5
  export declare const bindTextToShapeAfterDuplication: (sceneElements: ExcalidrawElement[], oldElements: ExcalidrawElement[], oldIdToDuplicatedId: Map<ExcalidrawElement["id"], ExcalidrawElement["id"]>) => void;
5
6
  export declare const handleBindTextResize: (elements: readonly NonDeletedExcalidrawElement[], transformHandleType: MaybeTransformHandleType) => void;
6
7
  export declare const measureText: (text: string, font: FontString, maxWidth?: number | null | undefined) => {
@@ -12,8 +13,6 @@ export declare const getApproxLineHeight: (font: FontString) => number;
12
13
  export declare const wrapText: (text: string, font: FontString, containerWidth: number) => string;
13
14
  export declare const charWidth: {
14
15
  calculate: (char: string, font: FontString) => number;
15
- updateCache: (char: string, font: FontString) => void;
16
- clearCacheforFont: (font: FontString) => void;
17
16
  getCache: (font: FontString) => number[];
18
17
  };
19
18
  export declare const getApproxMinLineWidth: (font: FontString) => number;
package/types/groups.d.ts CHANGED
@@ -24,3 +24,4 @@ export declare const addToGroup: (prevGroupIds: ExcalidrawElement["groupIds"], n
24
24
  export declare const removeFromSelectedGroups: (groupIds: ExcalidrawElement["groupIds"], selectedGroupIds: {
25
25
  [groupId: string]: boolean;
26
26
  }) => string[];
27
+ export declare const getMaximumGroups: (elements: ExcalidrawElement[]) => ExcalidrawElement[][];
@@ -0,0 +1 @@
1
+ export default function App(): JSX.Element;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,138 @@
1
+ declare namespace _default {
2
+ const elements: {
3
+ type: string;
4
+ version: number;
5
+ versionNonce: number;
6
+ isDeleted: boolean;
7
+ id: string;
8
+ fillStyle: string;
9
+ strokeWidth: number;
10
+ strokeStyle: string;
11
+ roughness: number;
12
+ opacity: number;
13
+ angle: number;
14
+ x: number;
15
+ y: number;
16
+ strokeColor: string;
17
+ backgroundColor: string;
18
+ width: number;
19
+ height: number;
20
+ seed: number;
21
+ groupIds: never[];
22
+ }[];
23
+ namespace appState {
24
+ const viewBackgroundColor: string;
25
+ const currentItemFontFamily: number;
26
+ }
27
+ const scrollToContent: boolean;
28
+ const libraryItems: (({
29
+ type: string;
30
+ version: number;
31
+ versionNonce: number;
32
+ isDeleted: boolean;
33
+ id: string;
34
+ fillStyle: string;
35
+ strokeWidth: number;
36
+ strokeStyle: string;
37
+ roughness: number;
38
+ opacity: number;
39
+ angle: number;
40
+ x: number;
41
+ y: number;
42
+ strokeColor: string;
43
+ backgroundColor: string;
44
+ width: number;
45
+ height: number;
46
+ seed: number;
47
+ groupIds: string[];
48
+ strokeSharpness: string;
49
+ boundElementIds: never[];
50
+ startBinding: null;
51
+ endBinding: null;
52
+ points: number[][];
53
+ lastCommittedPoint: null;
54
+ startArrowhead: null;
55
+ endArrowhead: null;
56
+ } | {
57
+ type: string;
58
+ version: number;
59
+ versionNonce: number;
60
+ isDeleted: boolean;
61
+ id: string;
62
+ fillStyle: string;
63
+ strokeWidth: number;
64
+ strokeStyle: string;
65
+ roughness: number;
66
+ opacity: number;
67
+ angle: number;
68
+ x: number;
69
+ y: number;
70
+ strokeColor: string;
71
+ backgroundColor: string;
72
+ width: number;
73
+ height: number;
74
+ seed: number;
75
+ groupIds: string[];
76
+ strokeSharpness: string;
77
+ boundElementIds: string[];
78
+ startBinding?: undefined;
79
+ endBinding?: undefined;
80
+ points?: undefined;
81
+ lastCommittedPoint?: undefined;
82
+ startArrowhead?: undefined;
83
+ endArrowhead?: undefined;
84
+ })[] | ({
85
+ type: string;
86
+ version: number;
87
+ versionNonce: number;
88
+ isDeleted: boolean;
89
+ id: string;
90
+ fillStyle: string;
91
+ strokeWidth: number;
92
+ strokeStyle: string;
93
+ roughness: number;
94
+ opacity: number;
95
+ angle: number;
96
+ x: number;
97
+ y: number;
98
+ strokeColor: string;
99
+ backgroundColor: string;
100
+ width: number;
101
+ height: number;
102
+ seed: number;
103
+ groupIds: string[];
104
+ strokeSharpness: string;
105
+ boundElementIds: string[];
106
+ points?: undefined;
107
+ lastCommittedPoint?: undefined;
108
+ startArrowhead?: undefined;
109
+ endArrowhead?: undefined;
110
+ } | {
111
+ type: string;
112
+ version: number;
113
+ versionNonce: number;
114
+ isDeleted: boolean;
115
+ id: string;
116
+ fillStyle: string;
117
+ strokeWidth: number;
118
+ strokeStyle: string;
119
+ roughness: number;
120
+ opacity: number;
121
+ angle: number;
122
+ x: number;
123
+ y: number;
124
+ strokeColor: string;
125
+ backgroundColor: string;
126
+ width: number;
127
+ height: number;
128
+ seed: number;
129
+ groupIds: string[];
130
+ strokeSharpness: string;
131
+ boundElementIds: never[];
132
+ points: number[][];
133
+ lastCommittedPoint: null;
134
+ startArrowhead: null;
135
+ endArrowhead: null;
136
+ })[])[];
137
+ }
138
+ export default _default;
@@ -0,0 +1 @@
1
+ export default function Sidebar(props: any): JSX.Element;
@@ -0,0 +1,19 @@
1
+ export namespace entry {
2
+ const bundle: string;
3
+ }
4
+ export namespace devServer {
5
+ export const port: number;
6
+ export const host: string;
7
+ export const hot: boolean;
8
+ export const compress: boolean;
9
+ export namespace _static {
10
+ const directory: string;
11
+ }
12
+ export { _static as static };
13
+ export namespace client {
14
+ const progress: boolean;
15
+ const logging: string;
16
+ const overlay: boolean;
17
+ }
18
+ export const open: string[];
19
+ }
@@ -8,4 +8,4 @@ export declare const hasText: (type: string) => boolean;
8
8
  export declare const canHaveArrowheads: (type: string) => boolean;
9
9
  export declare const getElementAtPosition: (elements: readonly NonDeletedExcalidrawElement[], isAtPositionFn: (element: NonDeletedExcalidrawElement) => boolean) => NonDeletedExcalidrawElement | null;
10
10
  export declare const getElementsAtPosition: (elements: readonly NonDeletedExcalidrawElement[], isAtPositionFn: (element: NonDeletedExcalidrawElement) => boolean) => NonDeletedExcalidrawElement[];
11
- export declare const getElementContainingPosition: (elements: readonly ExcalidrawElement[], x: number, y: number, excludedType?: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | undefined) => ExcalidrawElement | null;
11
+ export declare const getElementContainingPosition: (elements: readonly ExcalidrawElement[], x: number, y: number) => ExcalidrawElement | null;
package/types/utils.d.ts CHANGED
@@ -97,3 +97,4 @@ export declare const getUpdatedTimestamp: () => number;
97
97
  export declare const arrayToMap: <T extends string | {
98
98
  id: string;
99
99
  }>(items: readonly T[]) => Map<string, T>;
100
+ export declare const isTestEnv: () => boolean;