@dwelle/excalidraw 0.3.33 → 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/CHANGELOG.md +3 -0
- package/README_NEXT.md +18 -0
- package/dist/excalidraw.development.js +16 -16
- package/dist/excalidraw.production.min.js +1 -1
- package/package.json +11 -8
- package/types/constants.d.ts +1 -1
- package/types/element/textElement.d.ts +2 -3
- package/types/packages/excalidraw/example/App.d.ts +1 -0
- package/types/packages/excalidraw/example/index.d.ts +1 -0
- package/types/packages/excalidraw/example/initialData.d.ts +138 -0
- package/types/packages/excalidraw/example/sidebar/Sidebar.d.ts +1 -0
- package/types/packages/excalidraw/webpack.dev-server.config.d.ts +19 -0
- package/types/scene/comparisons.d.ts +1 -1
- package/types/utils.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dwelle/excalidraw",
|
|
3
|
-
"version": "0.3.
|
|
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.
|
|
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.
|
|
46
|
-
"@babel/preset-react": "7.16.
|
|
47
|
-
"@babel/preset-typescript": "7.16.
|
|
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.
|
|
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/constants.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ExcalidrawElement, ExcalidrawTextElement, FontString, NonDeletedExcalidrawElement } from "./types";
|
|
2
2
|
import { MaybeTransformHandleType } from "./transformHandles";
|
|
3
|
-
|
|
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;
|
|
@@ -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
|
|
11
|
+
export declare const getElementContainingPosition: (elements: readonly ExcalidrawElement[], x: number, y: number) => ExcalidrawElement | null;
|
package/types/utils.d.ts
CHANGED