@zsviczian/excalidraw 0.17.6-3 → 0.17.6-31
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/dist/excalidraw.development.js +13100 -1540
- package/dist/excalidraw.production.min.js +1 -1
- package/dist/excalidraw.production.min.js.LICENSE.txt +21 -1
- package/dist/styles.development.css +490 -376
- package/dist/styles.production.css +10 -8
- package/package.json +5 -4
- package/types/excalidraw/actions/actionAddToLibrary.d.ts +27 -3
- package/types/excalidraw/actions/actionAlign.d.ts +7 -6
- package/types/excalidraw/actions/actionBoundText.d.ts +18 -2
- package/types/excalidraw/actions/actionCanvas.d.ts +126 -14
- package/types/excalidraw/actions/actionClipboard.d.ts +61 -9
- package/types/excalidraw/actions/actionCropEditor.d.ts +222 -0
- package/types/excalidraw/actions/actionDeleteSelected.d.ts +34 -6
- package/types/excalidraw/actions/actionElementLink.d.ts +244 -0
- package/types/excalidraw/actions/actionElementLock.d.ts +18 -2
- package/types/excalidraw/actions/actionExport.d.ts +77 -8
- package/types/excalidraw/actions/actionFinalize.d.ts +18 -2
- package/types/excalidraw/actions/actionFrame.d.ts +533 -4
- package/types/excalidraw/actions/actionGroup.d.ts +18 -2
- package/types/excalidraw/actions/actionLinearEditor.d.ts +9 -1
- package/types/excalidraw/actions/actionLink.d.ts +10 -2
- package/types/excalidraw/actions/actionMenu.d.ts +23 -2
- package/types/excalidraw/actions/actionNavigate.d.ts +18 -2
- package/types/excalidraw/actions/actionProperties.d.ts +135 -15
- package/types/excalidraw/actions/actionSelectAll.d.ts +9 -1
- package/types/excalidraw/actions/actionStyles.d.ts +9 -1
- package/types/excalidraw/actions/actionToggleGridMode.d.ts +9 -1
- package/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +9 -1
- package/types/excalidraw/actions/actionToggleSearchMenu.d.ts +14 -1
- package/types/excalidraw/actions/actionToggleStats.d.ts +9 -1
- package/types/excalidraw/actions/actionToggleViewMode.d.ts +9 -1
- package/types/excalidraw/actions/actionToggleZenMode.d.ts +9 -1
- package/types/excalidraw/actions/index.d.ts +1 -0
- package/types/excalidraw/actions/shortcuts.d.ts +1 -1
- package/types/excalidraw/actions/types.d.ts +1 -1
- package/types/excalidraw/align.d.ts +2 -1
- package/types/excalidraw/change.d.ts +2 -2
- package/types/excalidraw/clipboard.d.ts +27 -5
- package/types/excalidraw/components/Actions.d.ts +2 -1
- package/types/excalidraw/components/ActiveConfirmDialog.d.ts +1 -1
- package/types/excalidraw/components/App.d.ts +21 -5
- package/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -1
- package/types/excalidraw/components/ElementLinkDialog.d.ts +11 -0
- package/types/excalidraw/components/EyeDropper.d.ts +1 -1
- package/types/excalidraw/components/IconPicker.d.ts +2 -2
- package/types/excalidraw/components/LayerUI.d.ts +2 -1
- package/types/excalidraw/components/LibraryMenu.d.ts +1 -1
- package/types/excalidraw/components/OverwriteConfirm/OverwriteConfirmState.d.ts +1 -1
- package/types/excalidraw/components/Range.d.ts +8 -0
- package/types/excalidraw/components/SearchMenu.d.ts +1 -1
- package/types/excalidraw/components/Sidebar/Sidebar.d.ts +1 -1
- package/types/excalidraw/components/Stats/Collapsible.d.ts +2 -1
- package/types/excalidraw/components/Stats/utils.d.ts +1 -1
- package/types/excalidraw/components/TTDDialog/MermaidToExcalidraw.d.ts +1 -7
- package/types/excalidraw/components/TTDDialog/MermaidToExcalidrawLib.d.ts +10 -0
- package/types/excalidraw/components/TTDDialog/common.d.ts +2 -2
- package/types/excalidraw/components/hyperlink/Hyperlink.d.ts +1 -1
- package/types/excalidraw/components/hyperlink/helpers.d.ts +1 -0
- package/types/excalidraw/components/icons.d.ts +11 -0
- package/types/excalidraw/constants.d.ts +5 -1
- package/types/excalidraw/context/tunnels.d.ts +2 -1
- package/types/excalidraw/data/blob.d.ts +4 -0
- package/types/excalidraw/data/encode.d.ts +6 -5
- package/types/excalidraw/data/filesystem.d.ts +2 -1
- package/types/excalidraw/data/image.d.ts +0 -6
- package/types/excalidraw/data/library.d.ts +9 -3
- package/types/excalidraw/data/url.d.ts +0 -1
- package/types/excalidraw/dist/excalidraw.production.min.d.ts +3 -1
- package/types/excalidraw/editor-jotai.d.ts +56 -0
- package/types/excalidraw/element/binding.d.ts +10 -7
- package/types/excalidraw/element/cropElement.d.ts +19 -0
- package/types/excalidraw/element/elbowArrow.d.ts +16 -0
- package/types/excalidraw/element/elementLink.d.ts +13 -0
- package/types/excalidraw/element/embeddable.d.ts +9 -1
- package/types/excalidraw/element/flowchart.d.ts +1 -1
- package/types/excalidraw/element/heading.d.ts +5 -1
- package/types/excalidraw/element/image.d.ts +1 -1
- package/types/excalidraw/element/linearElementEditor.d.ts +9 -10
- package/types/excalidraw/element/mutateElement.d.ts +3 -1
- package/types/excalidraw/element/newElement.d.ts +9 -7
- package/types/excalidraw/element/resizeElements.d.ts +27 -5
- package/types/excalidraw/element/textElement.d.ts +14 -4
- package/types/excalidraw/element/textWrapping.d.ts +13 -0
- package/types/excalidraw/element/transformHandles.d.ts +1 -1
- package/types/excalidraw/element/types.d.ts +33 -1
- package/types/excalidraw/errors.d.ts +7 -0
- package/types/excalidraw/fonts/{woff2/Cascadia → Cascadia}/index.d.ts +1 -1
- package/types/excalidraw/fonts/ComicShanns/index.d.ts +2 -0
- package/types/excalidraw/fonts/{woff2/Emoji → Emoji}/index.d.ts +1 -1
- package/types/excalidraw/fonts/ExcalidrawFontFace.d.ts +2 -8
- package/types/excalidraw/fonts/{woff2/Excalifont → Excalifont}/index.d.ts +1 -1
- package/types/excalidraw/fonts/Fonts.d.ts +100 -0
- package/types/excalidraw/fonts/{woff2/Helvetica → Helvetica}/index.d.ts +1 -1
- package/types/excalidraw/fonts/{woff2/Liberation → Liberation}/index.d.ts +1 -1
- package/types/excalidraw/fonts/{woff2/Lilita → Lilita}/index.d.ts +1 -1
- package/types/excalidraw/fonts/{woff2/Nunito → Nunito}/index.d.ts +1 -1
- package/types/excalidraw/fonts/{woff2/Virgil → Virgil}/index.d.ts +1 -1
- package/types/excalidraw/fonts/{woff2/Xiaolai → Xiaolai}/index.d.ts +1 -1
- package/types/excalidraw/fonts/index.d.ts +1 -87
- package/types/excalidraw/frame.d.ts +11 -5
- package/types/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
- package/types/excalidraw/index.d.ts +4 -3
- package/types/excalidraw/keys.d.ts +107 -0
- package/types/excalidraw/obsidianUtils.d.ts +9 -4
- package/types/excalidraw/renderer/renderElement.d.ts +3 -2
- package/types/excalidraw/scene/Scene.d.ts +1 -0
- package/types/excalidraw/scene/comparisons.d.ts +1 -0
- package/types/excalidraw/scene/export.d.ts +8 -0
- package/types/excalidraw/scene/types.d.ts +7 -0
- package/types/excalidraw/types.d.ts +25 -1
- package/types/excalidraw/utils.d.ts +7 -1
- package/types/excalidraw/visualdebug.d.ts +8 -1
- package/types/math/line.d.ts +19 -0
- package/types/math/point.d.ts +10 -0
- package/types/math/utils.d.ts +1 -0
- package/types/math/vector.d.ts +4 -0
- package/types/utils/export.d.ts +6 -4
- package/types/excalidraw/components/MagicSettings.d.ts +0 -8
- package/types/excalidraw/components/Stats.d.ts +0 -11
- package/types/excalidraw/data/magic.d.ts +0 -23
- package/types/excalidraw/element/routing.d.ts +0 -12
- package/types/excalidraw/fonts/ExcalidrawFont.d.ts +0 -37
- package/types/excalidraw/fonts/wasm/hb-subset.bindings.d.ts +0 -45
- package/types/excalidraw/fonts/wasm/hb-subset.loader.d.ts +0 -5
- package/types/excalidraw/fonts/wasm/hb-subset.wasm.d.ts +0 -2
- package/types/excalidraw/fonts/wasm/woff2.bindings.d.ts +0 -31
- package/types/excalidraw/fonts/wasm/woff2.loader.d.ts +0 -6
- package/types/excalidraw/fonts/wasm/woff2.wasm.d.ts +0 -2
- package/types/excalidraw/fonts/woff2/Comic/index.d.ts +0 -2
- package/types/excalidraw/ga.d.ts +0 -63
- package/types/excalidraw/gadirections.d.ts +0 -8
- package/types/excalidraw/galines.d.ts +0 -22
- package/types/excalidraw/gapoints.d.ts +0 -7
- package/types/excalidraw/gatransforms.d.ts +0 -10
- package/types/excalidraw/jotai.d.ts +0 -34
- package/types/excalidraw/math.d.ts +0 -79
- package/types/excalidraw/scene/Fonts.d.ts +0 -19
- package/types/utils/geometry/geometry.d.ts +0 -89
- /package/types/excalidraw/fonts/{metadata.d.ts → FontMetadata.d.ts} +0 -0
- /package/types/excalidraw/{fonts/wasm/hb-subset-bindings.d.ts → subset/harfbuzz/harfbuzz-bindings.d.ts} +0 -0
- /package/types/excalidraw/{fonts/wasm/hb-subset-loader.d.ts → subset/harfbuzz/harfbuzz-loader.d.ts} +0 -0
- /package/types/excalidraw/{fonts/wasm/hb-subset-wasm.d.ts → subset/harfbuzz/harfbuzz-wasm.d.ts} +0 -0
- /package/types/excalidraw/{fonts/subset → subset}/subset-main.d.ts +0 -0
- /package/types/excalidraw/{fonts/subset → subset}/subset-shared.chunk.d.ts +0 -0
- /package/types/excalidraw/{fonts/subset → subset}/subset-worker.chunk.d.ts +0 -0
- /package/types/excalidraw/{fonts/wasm → subset/woff2}/woff2-bindings.d.ts +0 -0
- /package/types/excalidraw/{fonts/wasm → subset/woff2}/woff2-loader.d.ts +0 -0
- /package/types/excalidraw/{fonts/wasm → subset/woff2}/woff2-wasm.d.ts +0 -0
|
@@ -120,6 +120,14 @@ export type IframeData = ({
|
|
|
120
120
|
type: "document";
|
|
121
121
|
srcdoc: (theme: Theme) => string;
|
|
122
122
|
}));
|
|
123
|
+
export type ImageCrop = {
|
|
124
|
+
x: number;
|
|
125
|
+
y: number;
|
|
126
|
+
width: number;
|
|
127
|
+
height: number;
|
|
128
|
+
naturalWidth: number;
|
|
129
|
+
naturalHeight: number;
|
|
130
|
+
};
|
|
123
131
|
export type ExcalidrawImageElement = _ExcalidrawElementBase & Readonly<{
|
|
124
132
|
type: "image";
|
|
125
133
|
fileId: FileId | null;
|
|
@@ -127,6 +135,8 @@ export type ExcalidrawImageElement = _ExcalidrawElementBase & Readonly<{
|
|
|
127
135
|
status: "pending" | "saved" | "error";
|
|
128
136
|
/** X and Y scale factors <-1, 1>, used for image axis flipping */
|
|
129
137
|
scale: [number, number];
|
|
138
|
+
/** whether an element is cropped */
|
|
139
|
+
crop: ImageCrop | null;
|
|
130
140
|
}>;
|
|
131
141
|
export type InitializedExcalidrawImageElement = MarkNonNullable<ExcalidrawImageElement, "fileId">;
|
|
132
142
|
export type ExcalidrawFrameElement = _ExcalidrawElementBase & {
|
|
@@ -198,7 +208,7 @@ export type PointBinding = {
|
|
|
198
208
|
export type FixedPointBinding = Merge<PointBinding, {
|
|
199
209
|
fixedPoint: FixedPoint;
|
|
200
210
|
}>;
|
|
201
|
-
export type Arrowhead = "arrow" | "bar" | "dot" | "circle" | "circle_outline" | "triangle" | "triangle_outline" | "diamond" | "diamond_outline";
|
|
211
|
+
export type Arrowhead = "arrow" | "bar" | "dot" | "circle" | "circle_outline" | "triangle" | "triangle_outline" | "diamond" | "diamond_outline" | "crowfoot_one" | "crowfoot_many" | "crowfoot_one_or_many";
|
|
202
212
|
export type ExcalidrawLinearElement = _ExcalidrawElementBase & Readonly<{
|
|
203
213
|
type: "line" | "arrow";
|
|
204
214
|
points: readonly LocalPoint[];
|
|
@@ -208,6 +218,11 @@ export type ExcalidrawLinearElement = _ExcalidrawElementBase & Readonly<{
|
|
|
208
218
|
startArrowhead: Arrowhead | null;
|
|
209
219
|
endArrowhead: Arrowhead | null;
|
|
210
220
|
}>;
|
|
221
|
+
export type FixedSegment = {
|
|
222
|
+
start: LocalPoint;
|
|
223
|
+
end: LocalPoint;
|
|
224
|
+
index: number;
|
|
225
|
+
};
|
|
211
226
|
export type ExcalidrawArrowElement = ExcalidrawLinearElement & Readonly<{
|
|
212
227
|
type: "arrow";
|
|
213
228
|
elbowed: boolean;
|
|
@@ -216,6 +231,23 @@ export type ExcalidrawElbowArrowElement = Merge<ExcalidrawArrowElement, {
|
|
|
216
231
|
elbowed: true;
|
|
217
232
|
startBinding: FixedPointBinding | null;
|
|
218
233
|
endBinding: FixedPointBinding | null;
|
|
234
|
+
fixedSegments: FixedSegment[] | null;
|
|
235
|
+
/**
|
|
236
|
+
* Marks that the 3rd point should be used as the 2nd point of the arrow in
|
|
237
|
+
* order to temporarily hide the first segment of the arrow without losing
|
|
238
|
+
* the data from the points array. It allows creating the expected arrow
|
|
239
|
+
* path when the arrow with fixed segments is bound on a horizontal side and
|
|
240
|
+
* moved to a vertical and vica versa.
|
|
241
|
+
*/
|
|
242
|
+
startIsSpecial: boolean | null;
|
|
243
|
+
/**
|
|
244
|
+
* Marks that the 3rd point backwards from the end should be used as the 2nd
|
|
245
|
+
* point of the arrow in order to temporarily hide the last segment of the
|
|
246
|
+
* arrow without losing the data from the points array. It allows creating
|
|
247
|
+
* the expected arrow path when the arrow with fixed segments is bound on a
|
|
248
|
+
* horizontal side and moved to a vertical and vica versa.
|
|
249
|
+
*/
|
|
250
|
+
endIsSpecial: boolean | null;
|
|
219
251
|
}>;
|
|
220
252
|
export type ExcalidrawFreeDrawElement = _ExcalidrawElementBase & Readonly<{
|
|
221
253
|
type: "freedraw";
|
|
@@ -22,4 +22,11 @@ export declare class WorkerInTheMainChunkError extends Error {
|
|
|
22
22
|
code: WorkerErrorCodes;
|
|
23
23
|
constructor(message?: string, code?: WorkerErrorCodes);
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Use this for generic, handled errors, so you can check against them
|
|
27
|
+
* and rethrow if needed
|
|
28
|
+
*/
|
|
29
|
+
export declare class ExcalidrawError extends Error {
|
|
30
|
+
constructor(message: string);
|
|
31
|
+
}
|
|
25
32
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ExcalidrawFontFaceDescriptor } from "
|
|
1
|
+
import { type ExcalidrawFontFaceDescriptor } from "../Fonts";
|
|
2
2
|
export declare const CascadiaFontFaces: ExcalidrawFontFaceDescriptor[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ExcalidrawFontFaceDescriptor } from "
|
|
1
|
+
import { type ExcalidrawFontFaceDescriptor } from "../Fonts";
|
|
2
2
|
export declare const EmojiFontFaces: ExcalidrawFontFaceDescriptor[];
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
type DataURL = string;
|
|
2
|
-
export
|
|
3
|
-
urls: URL[] | DataURL[];
|
|
4
|
-
fontFace: FontFace;
|
|
5
|
-
toCSS(characters: string, codePoints: Array<number>): Promise<string> | undefined;
|
|
6
|
-
getContentLegacy(): Promise<string>;
|
|
7
|
-
}
|
|
8
|
-
export declare class ExcalidrawFontFace implements IExcalidrawFontFace {
|
|
2
|
+
export declare class ExcalidrawFontFace {
|
|
9
3
|
readonly urls: URL[] | DataURL[];
|
|
10
4
|
readonly fontFace: FontFace;
|
|
11
5
|
private static readonly UNPKG_FALLBACK_URL;
|
|
@@ -15,7 +9,7 @@ export declare class ExcalidrawFontFace implements IExcalidrawFontFace {
|
|
|
15
9
|
*
|
|
16
10
|
* Retrieves `undefined` otherwise.
|
|
17
11
|
*/
|
|
18
|
-
toCSS(characters: string
|
|
12
|
+
toCSS(characters: string): Promise<string> | undefined;
|
|
19
13
|
/**
|
|
20
14
|
* Tries to fetch woff2 content, based on the registered urls (from first to last, treated as fallbacks).
|
|
21
15
|
*
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ExcalidrawFontFaceDescriptor } from "
|
|
1
|
+
import { type ExcalidrawFontFaceDescriptor } from "../Fonts";
|
|
2
2
|
export declare const ExcalifontFontFaces: ExcalidrawFontFaceDescriptor[];
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { ExcalidrawFontFace } from "./ExcalidrawFontFace";
|
|
2
|
+
import { type FontMetadata } from "./FontMetadata";
|
|
3
|
+
import type { ExcalidrawElement, ExcalidrawTextElement, FontFamilyValues } from "../element/types";
|
|
4
|
+
import type Scene from "../scene/Scene";
|
|
5
|
+
export declare class Fonts {
|
|
6
|
+
static readonly loadedFontsCache: Set<string>;
|
|
7
|
+
private static _registered;
|
|
8
|
+
private static _initialized;
|
|
9
|
+
static get registered(): Map<number, {
|
|
10
|
+
metadata: FontMetadata;
|
|
11
|
+
fontFaces: ExcalidrawFontFace[];
|
|
12
|
+
}>;
|
|
13
|
+
get registered(): Map<number, {
|
|
14
|
+
metadata: FontMetadata;
|
|
15
|
+
fontFaces: ExcalidrawFontFace[];
|
|
16
|
+
}>;
|
|
17
|
+
private readonly scene;
|
|
18
|
+
constructor(scene: Scene);
|
|
19
|
+
/**
|
|
20
|
+
* Get all the font families for the given scene.
|
|
21
|
+
*/
|
|
22
|
+
getSceneFamilies: () => number[];
|
|
23
|
+
/**
|
|
24
|
+
* if we load a (new) font, it's likely that text elements using it have
|
|
25
|
+
* already been rendered using a fallback font. Thus, we want invalidate
|
|
26
|
+
* their shapes and rerender. See #637.
|
|
27
|
+
*
|
|
28
|
+
* Invalidates text elements and rerenders scene, provided that at least one
|
|
29
|
+
* of the supplied fontFaces has not already been processed.
|
|
30
|
+
*/
|
|
31
|
+
onLoaded: (fontFaces: readonly FontFace[]) => void;
|
|
32
|
+
/**
|
|
33
|
+
* Load font faces for a given scene and trigger scene update.
|
|
34
|
+
*/
|
|
35
|
+
loadSceneFonts: () => Promise<FontFace[]>;
|
|
36
|
+
/**
|
|
37
|
+
* Load font faces for passed elements - use when the scene is unavailable (i.e. export).
|
|
38
|
+
*/
|
|
39
|
+
static loadElementsFonts: (elements: readonly ExcalidrawElement[]) => Promise<FontFace[]>;
|
|
40
|
+
/**
|
|
41
|
+
* Generate CSS @font-face declarations for the given elements.
|
|
42
|
+
*/
|
|
43
|
+
static generateFontFaceDeclarations(elements: readonly ExcalidrawElement[]): Promise<string[]>;
|
|
44
|
+
static loadFontFaces(fontFamilies: Array<ExcalidrawTextElement["fontFamily"]>, charsPerFamily: Record<number, Set<string>>): Promise<FontFace[]>;
|
|
45
|
+
private static fontFacesLoader;
|
|
46
|
+
private static fontFacesStylesGenerator;
|
|
47
|
+
/**
|
|
48
|
+
* Register a new font.
|
|
49
|
+
*
|
|
50
|
+
* @param family font family
|
|
51
|
+
* @param metadata font metadata
|
|
52
|
+
* @param fontFacesDecriptors font faces descriptors
|
|
53
|
+
*/
|
|
54
|
+
static register(this: Fonts | {
|
|
55
|
+
registered: Map<number, {
|
|
56
|
+
metadata: FontMetadata;
|
|
57
|
+
fontFaces: ExcalidrawFontFace[];
|
|
58
|
+
}>;
|
|
59
|
+
}, family: string, metadata: FontMetadata, ...fontFacesDecriptors: ExcalidrawFontFaceDescriptor[]): Map<number, {
|
|
60
|
+
metadata: FontMetadata;
|
|
61
|
+
fontFaces: ExcalidrawFontFace[];
|
|
62
|
+
}> | Map<number, {
|
|
63
|
+
metadata: FontMetadata;
|
|
64
|
+
fontFaces: ExcalidrawFontFace[];
|
|
65
|
+
}>;
|
|
66
|
+
/**
|
|
67
|
+
* WARN: should be called just once on init, even across multiple instances.
|
|
68
|
+
*/
|
|
69
|
+
private static init;
|
|
70
|
+
/**
|
|
71
|
+
* Get all the unique font families for the given elements.
|
|
72
|
+
*/
|
|
73
|
+
static getUniqueFamilies(elements: ReadonlyArray<ExcalidrawElement>): Array<ExcalidrawTextElement["fontFamily"]>;
|
|
74
|
+
/**
|
|
75
|
+
* Get all the unique characters per font family for the given scene.
|
|
76
|
+
*/
|
|
77
|
+
private static getCharsPerFamily;
|
|
78
|
+
/**
|
|
79
|
+
* Get characters for a given family.
|
|
80
|
+
*/
|
|
81
|
+
private static getCharacters;
|
|
82
|
+
/**
|
|
83
|
+
* Get all registered font families.
|
|
84
|
+
*/
|
|
85
|
+
private static getAllFamilies;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Calculates vertical offset for a text with alphabetic baseline.
|
|
89
|
+
*/
|
|
90
|
+
export declare const getVerticalOffset: (fontFamily: ExcalidrawTextElement["fontFamily"], fontSize: ExcalidrawTextElement["fontSize"], lineHeightPx: number) => number;
|
|
91
|
+
/**
|
|
92
|
+
* Gets line height forr a selected family.
|
|
93
|
+
*/
|
|
94
|
+
export declare const getLineHeight: (fontFamily: FontFamilyValues) => number & {
|
|
95
|
+
_brand: "unitlessLineHeight";
|
|
96
|
+
};
|
|
97
|
+
export interface ExcalidrawFontFaceDescriptor {
|
|
98
|
+
uri: string;
|
|
99
|
+
descriptors?: FontFaceDescriptors;
|
|
100
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ExcalidrawFontFaceDescriptor } from "
|
|
1
|
+
import { type ExcalidrawFontFaceDescriptor } from "../Fonts";
|
|
2
2
|
export declare const HelveticaFontFaces: ExcalidrawFontFaceDescriptor[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ExcalidrawFontFaceDescriptor } from "
|
|
1
|
+
import { type ExcalidrawFontFaceDescriptor } from "../Fonts";
|
|
2
2
|
export declare const LiberationFontFaces: ExcalidrawFontFaceDescriptor[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ExcalidrawFontFaceDescriptor } from "
|
|
1
|
+
import { type ExcalidrawFontFaceDescriptor } from "../Fonts";
|
|
2
2
|
export declare const LilitaFontFaces: ExcalidrawFontFaceDescriptor[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ExcalidrawFontFaceDescriptor } from "
|
|
1
|
+
import { type ExcalidrawFontFaceDescriptor } from "../Fonts";
|
|
2
2
|
export declare const NunitoFontFaces: ExcalidrawFontFaceDescriptor[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ExcalidrawFontFaceDescriptor } from "
|
|
1
|
+
import { type ExcalidrawFontFaceDescriptor } from "../Fonts";
|
|
2
2
|
export declare const VirgilFontFaces: ExcalidrawFontFaceDescriptor[];
|
|
@@ -1,87 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import type { ExcalidrawElement, ExcalidrawTextElement, FontFamilyValues } from "../element/types";
|
|
3
|
-
import { type FontMetadata } from "./metadata";
|
|
4
|
-
import { type IExcalidrawFontFace } from "./ExcalidrawFontFace";
|
|
5
|
-
export declare class Fonts {
|
|
6
|
-
static readonly loadedFontsCache: Set<string>;
|
|
7
|
-
private static _registered;
|
|
8
|
-
private static _initialized;
|
|
9
|
-
static get registered(): Map<number, {
|
|
10
|
-
metadata: FontMetadata;
|
|
11
|
-
fontFaces: IExcalidrawFontFace[];
|
|
12
|
-
}>;
|
|
13
|
-
get registered(): Map<number, {
|
|
14
|
-
metadata: FontMetadata;
|
|
15
|
-
fontFaces: IExcalidrawFontFace[];
|
|
16
|
-
}>;
|
|
17
|
-
private readonly scene;
|
|
18
|
-
constructor({ scene }: {
|
|
19
|
-
scene: Scene;
|
|
20
|
-
});
|
|
21
|
-
/**
|
|
22
|
-
* if we load a (new) font, it's likely that text elements using it have
|
|
23
|
-
* already been rendered using a fallback font. Thus, we want invalidate
|
|
24
|
-
* their shapes and rerender. See #637.
|
|
25
|
-
*
|
|
26
|
-
* Invalidates text elements and rerenders scene, provided that at least one
|
|
27
|
-
* of the supplied fontFaces has not already been processed.
|
|
28
|
-
*/
|
|
29
|
-
onLoaded: (fontFaces: readonly FontFace[]) => void;
|
|
30
|
-
/**
|
|
31
|
-
* Load font faces for a given scene and trigger scene update.
|
|
32
|
-
*/
|
|
33
|
-
loadSceneFonts: () => Promise<FontFace[]>;
|
|
34
|
-
/**
|
|
35
|
-
* Load all registered font faces.
|
|
36
|
-
*/
|
|
37
|
-
static loadAllFonts: () => Promise<FontFace[]>;
|
|
38
|
-
/**
|
|
39
|
-
* Load font faces for passed elements - use when the scene is unavailable (i.e. export).
|
|
40
|
-
*/
|
|
41
|
-
static loadElementsFonts: (elements: readonly ExcalidrawElement[]) => Promise<FontFace[]>;
|
|
42
|
-
static loadFontFaces(fontFamilies: Array<ExcalidrawTextElement["fontFamily"]>): Promise<FontFace[]>;
|
|
43
|
-
/**
|
|
44
|
-
* WARN: should be called just once on init, even across multiple instances.
|
|
45
|
-
*/
|
|
46
|
-
private static init;
|
|
47
|
-
/**
|
|
48
|
-
* Gets all the font families for the given scene.
|
|
49
|
-
*/
|
|
50
|
-
getSceneFamilies: () => number[];
|
|
51
|
-
private static getAllFamilies;
|
|
52
|
-
static getElementsFamilies(elements: ReadonlyArray<ExcalidrawElement>): Array<ExcalidrawTextElement["fontFamily"]>;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Register a new font.
|
|
56
|
-
*
|
|
57
|
-
* @param family font family
|
|
58
|
-
* @param metadata font metadata
|
|
59
|
-
* @param fontFacesDecriptors font faces descriptors
|
|
60
|
-
*/
|
|
61
|
-
export declare function register(//zsviczian (changed from private to export)
|
|
62
|
-
this: Fonts | {
|
|
63
|
-
registered: Map<number, {
|
|
64
|
-
metadata: FontMetadata;
|
|
65
|
-
fontFaces: IExcalidrawFontFace[];
|
|
66
|
-
}>;
|
|
67
|
-
}, family: string, metadata: FontMetadata, ...fontFacesDecriptors: ExcalidrawFontFaceDescriptor[]): Map<number, {
|
|
68
|
-
metadata: FontMetadata;
|
|
69
|
-
fontFaces: IExcalidrawFontFace[];
|
|
70
|
-
}> | Map<number, {
|
|
71
|
-
metadata: FontMetadata;
|
|
72
|
-
fontFaces: IExcalidrawFontFace[];
|
|
73
|
-
}>;
|
|
74
|
-
/**
|
|
75
|
-
* Calculates vertical offset for a text with alphabetic baseline.
|
|
76
|
-
*/
|
|
77
|
-
export declare const getVerticalOffset: (fontFamily: ExcalidrawTextElement["fontFamily"], fontSize: ExcalidrawTextElement["fontSize"], lineHeightPx: number) => number;
|
|
78
|
-
/**
|
|
79
|
-
* Gets line height forr a selected family.
|
|
80
|
-
*/
|
|
81
|
-
export declare const getLineHeight: (fontFamily: FontFamilyValues) => number & {
|
|
82
|
-
_brand: "unitlessLineHeight";
|
|
83
|
-
};
|
|
84
|
-
export interface ExcalidrawFontFaceDescriptor {
|
|
85
|
-
uri: string;
|
|
86
|
-
descriptors?: FontFaceDescriptors;
|
|
87
|
-
}
|
|
1
|
+
export * from "./Fonts";
|
|
@@ -5,7 +5,7 @@ import type { ReadonlySetLike } from "./utility-types";
|
|
|
5
5
|
export declare const bindElementsToFramesAfterDuplication: (nextElements: readonly ExcalidrawElement[], oldElements: readonly ExcalidrawElement[], oldIdToDuplicatedId: Map<ExcalidrawElement["id"], ExcalidrawElement["id"]>) => void;
|
|
6
6
|
export declare function isElementIntersectingFrame(element: ExcalidrawElement, frame: ExcalidrawFrameLikeElement, elementsMap: ElementsMap): boolean;
|
|
7
7
|
export declare const getElementsCompletelyInFrame: (elements: readonly ExcalidrawElement[], frame: ExcalidrawFrameLikeElement, elementsMap: ElementsMap) => ExcalidrawElement[];
|
|
8
|
-
export declare const isElementContainingFrame: (
|
|
8
|
+
export declare const isElementContainingFrame: (element: ExcalidrawElement, frame: ExcalidrawFrameLikeElement, elementsMap: ElementsMap) => boolean;
|
|
9
9
|
export declare const getElementsIntersectingFrame: (elements: readonly ExcalidrawElement[], frame: ExcalidrawFrameLikeElement) => ExcalidrawElement[];
|
|
10
10
|
export declare const elementsAreInFrameBounds: (elements: readonly ExcalidrawElement[], frame: ExcalidrawFrameLikeElement, elementsMap: ElementsMap) => boolean;
|
|
11
11
|
export declare const elementOverlapsWithFrame: (element: ExcalidrawElement, frame: ExcalidrawFrameLikeElement, elementsMap: ElementsMap) => boolean;
|
|
@@ -31,7 +31,8 @@ export declare const getFrameLikeElements: (allElements: ExcalidrawElementsInclu
|
|
|
31
31
|
*/
|
|
32
32
|
export declare const getRootElements: (allElements: ExcalidrawElementsIncludingDeleted) => ExcalidrawElement[];
|
|
33
33
|
export declare const getElementsInResizingFrame: (allElements: ExcalidrawElementsIncludingDeleted, frame: ExcalidrawFrameLikeElement, appState: AppState, elementsMap: ElementsMap) => ExcalidrawElement[];
|
|
34
|
-
export declare const getElementsInNewFrame: (elements: ExcalidrawElementsIncludingDeleted, frame: ExcalidrawFrameLikeElement, elementsMap: ElementsMap) =>
|
|
34
|
+
export declare const getElementsInNewFrame: (elements: ExcalidrawElementsIncludingDeleted, frame: ExcalidrawFrameLikeElement, elementsMap: ElementsMap) => (import("./element/types").ExcalidrawSelectionElement | import("./element/types").ExcalidrawRectangleElement | import("./element/types").ExcalidrawDiamondElement | import("./element/types").ExcalidrawEllipseElement | import("./element/types").ExcalidrawTextElement | import("./element/types").ExcalidrawLinearElement | import("./element/types").ExcalidrawFreeDrawElement | import("./element/types").ExcalidrawImageElement | import("./element/types").ExcalidrawFrameElement | import("./element/types").ExcalidrawMagicFrameElement | import("./element/types").ExcalidrawIframeElement | import("./element/types").ExcalidrawEmbeddableElement)[];
|
|
35
|
+
export declare const omitPartialGroups: (elements: ExcalidrawElement[], frame: ExcalidrawFrameLikeElement, allElementsMap: ElementsMap) => (import("./element/types").ExcalidrawSelectionElement | import("./element/types").ExcalidrawRectangleElement | import("./element/types").ExcalidrawDiamondElement | import("./element/types").ExcalidrawEllipseElement | import("./element/types").ExcalidrawTextElement | import("./element/types").ExcalidrawLinearElement | import("./element/types").ExcalidrawFreeDrawElement | import("./element/types").ExcalidrawImageElement | import("./element/types").ExcalidrawFrameElement | import("./element/types").ExcalidrawMagicFrameElement | import("./element/types").ExcalidrawIframeElement | import("./element/types").ExcalidrawEmbeddableElement)[];
|
|
35
36
|
export declare const getContainingFrame: (element: ExcalidrawElement, elementsMap: ElementsMap) => ExcalidrawFrameLikeElement | null;
|
|
36
37
|
/** */
|
|
37
38
|
export declare const filterElementsEligibleAsFrameChildren: (elements: readonly ExcalidrawElement[], frame: ExcalidrawFrameLikeElement) => ExcalidrawElement[];
|
|
@@ -42,7 +43,7 @@ export declare const filterElementsEligibleAsFrameChildren: (elements: readonly
|
|
|
42
43
|
*
|
|
43
44
|
* @returns mutated allElements (same data structure)
|
|
44
45
|
*/
|
|
45
|
-
export declare const addElementsToFrame: <T extends ElementsMapOrArray>(allElements: T, elementsToAdd: NonDeletedExcalidrawElement[], frame: ExcalidrawFrameLikeElement) => T;
|
|
46
|
+
export declare const addElementsToFrame: <T extends ElementsMapOrArray>(allElements: T, elementsToAdd: NonDeletedExcalidrawElement[], frame: ExcalidrawFrameLikeElement, appState: AppState) => T;
|
|
46
47
|
export declare const removeElementsFromFrame: (elementsToRemove: ReadonlySetLike<NonDeletedExcalidrawElement>, elementsMap: ElementsMap) => void;
|
|
47
48
|
export declare const removeAllElementsFromFrame: <T extends ExcalidrawElement>(allElements: readonly T[], frame: ExcalidrawFrameLikeElement) => readonly T[];
|
|
48
49
|
export declare const replaceAllElementsInFrame: <T extends ExcalidrawElement>(allElements: readonly T[], nextElementsInFrame: ExcalidrawElement[], frame: ExcalidrawFrameLikeElement, app: AppClassProperties) => T[];
|
|
@@ -57,7 +58,12 @@ export declare const omitGroupsContainingFrameLikes: (allElements: ElementsMapOr
|
|
|
57
58
|
* depending on the appState, return target frame, which is the frame the given element
|
|
58
59
|
* is going to be added to or remove from
|
|
59
60
|
*/
|
|
60
|
-
export declare const getTargetFrame: (element: ExcalidrawElement, elementsMap: ElementsMap, appState: StaticCanvasAppState) =>
|
|
61
|
-
export declare const isElementInFrame: (element: ExcalidrawElement, allElementsMap: ElementsMap, appState: StaticCanvasAppState
|
|
61
|
+
export declare const getTargetFrame: (element: ExcalidrawElement, elementsMap: ElementsMap, appState: StaticCanvasAppState) => ExcalidrawFrameLikeElement | null;
|
|
62
|
+
export declare const isElementInFrame: (element: ExcalidrawElement, allElementsMap: ElementsMap, appState: StaticCanvasAppState, opts?: {
|
|
63
|
+
targetFrame?: ExcalidrawFrameLikeElement;
|
|
64
|
+
checkedGroups?: Map<string, boolean>;
|
|
65
|
+
}) => boolean;
|
|
66
|
+
export declare const shouldApplyFrameClip: (element: ExcalidrawElement, frame: ExcalidrawFrameLikeElement, appState: StaticCanvasAppState, elementsMap: ElementsMap, checkedGroups?: Map<string, boolean>) => boolean;
|
|
62
67
|
export declare const getFrameLikeTitle: (element: ExcalidrawFrameLikeElement) => string;
|
|
63
68
|
export declare const getElementsOverlappingFrame: (elements: readonly ExcalidrawElement[], frame: ExcalidrawFrameLikeElement) => NonDeletedExcalidrawElement[];
|
|
69
|
+
export declare const frameAndChildrenSelectedTogether: (selectedElements: readonly ExcalidrawElement[]) => boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LibraryItem } from "../types";
|
|
2
2
|
export type SvgCache = Map<LibraryItem["id"], SVGSVGElement>;
|
|
3
|
-
export declare const libraryItemSvgsCache: import("jotai").PrimitiveAtom<SvgCache> & {
|
|
3
|
+
export declare const libraryItemSvgsCache: import("jotai/vanilla/atom").PrimitiveAtom<SvgCache> & {
|
|
4
4
|
init: SvgCache;
|
|
5
5
|
};
|
|
6
6
|
export declare const useLibraryItemSvg: (id: LibraryItem["id"] | null, elements: LibraryItem["elements"] | undefined, svgCache: SvgCache) => SVGSVGElement | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "./css/app.scss";
|
|
3
3
|
import "./css/styles.scss";
|
|
4
|
-
import "./fonts/
|
|
4
|
+
import "./fonts/fonts.css";
|
|
5
5
|
import type { ExcalidrawProps } from "./types";
|
|
6
6
|
import Footer from "./components/footer/FooterCenter";
|
|
7
7
|
import MainMenu from "./components/main-menu/MainMenu";
|
|
@@ -23,13 +23,13 @@ getFontString, //zsviczian
|
|
|
23
23
|
getBoundTextMaxWidth, //zsviczian
|
|
24
24
|
mermaidToExcalidraw, //zsviczian
|
|
25
25
|
destroyObsidianUtils, //zsviczian
|
|
26
|
-
initializeObsidianUtils, //zsviczian
|
|
27
26
|
registerLocalFont, //zsviczian
|
|
28
27
|
getFontFamilies, //zsviczian
|
|
29
28
|
getFontFamilyString, //zsviczian
|
|
30
29
|
registerFontsInCSS, //zsviczian
|
|
31
30
|
getCSSFontDefinition, //zsviczian
|
|
32
|
-
loadSceneFonts,
|
|
31
|
+
loadSceneFonts, //zsviczian
|
|
32
|
+
loadMermaid, } from "../utils/export";
|
|
33
33
|
export { refreshTextDimensions } from "./element/newElement";
|
|
34
34
|
export { getContainerElement } from "./element/textElement";
|
|
35
35
|
export { serializeAsJSON, serializeLibraryAsJSON } from "./data/json";
|
|
@@ -61,3 +61,4 @@ export { getCommonBounds, getVisibleSceneBounds } from "./element/bounds";
|
|
|
61
61
|
export { elementsOverlappingBBox, isElementInsideBBox, elementPartiallyOverlapsWithOrContainsBBox, } from "../utils/withinBounds";
|
|
62
62
|
export { DiagramToCodePlugin } from "./components/DiagramToCodePlugin/DiagramToCodePlugin";
|
|
63
63
|
export { getDataURL } from "./data/blob";
|
|
64
|
+
export { isElementLink } from "./element/elementLink";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ValueOf } from "./utility-types";
|
|
1
2
|
export declare const CODES: {
|
|
2
3
|
readonly EQUAL: "Equal";
|
|
3
4
|
readonly MINUS: "Minus";
|
|
@@ -18,6 +19,7 @@ export declare const CODES: {
|
|
|
18
19
|
readonly H: "KeyH";
|
|
19
20
|
readonly V: "KeyV";
|
|
20
21
|
readonly Z: "KeyZ";
|
|
22
|
+
readonly Y: "KeyY";
|
|
21
23
|
readonly R: "KeyR";
|
|
22
24
|
readonly S: "KeyS";
|
|
23
25
|
};
|
|
@@ -76,6 +78,111 @@ export declare const KEYS: {
|
|
|
76
78
|
readonly 9: "9";
|
|
77
79
|
};
|
|
78
80
|
export type Key = keyof typeof KEYS;
|
|
81
|
+
export declare const KeyCodeMap: Map<ValueOf<{
|
|
82
|
+
readonly ARROW_DOWN: "ArrowDown";
|
|
83
|
+
readonly ARROW_LEFT: "ArrowLeft";
|
|
84
|
+
readonly ARROW_RIGHT: "ArrowRight";
|
|
85
|
+
readonly ARROW_UP: "ArrowUp";
|
|
86
|
+
readonly PAGE_UP: "PageUp";
|
|
87
|
+
readonly PAGE_DOWN: "PageDown";
|
|
88
|
+
readonly BACKSPACE: "Backspace";
|
|
89
|
+
readonly ALT: "Alt";
|
|
90
|
+
readonly CTRL_OR_CMD: "metaKey" | "ctrlKey";
|
|
91
|
+
readonly DELETE: "Delete";
|
|
92
|
+
readonly ENTER: "Enter";
|
|
93
|
+
readonly ESCAPE: "Escape";
|
|
94
|
+
readonly QUESTION_MARK: "?";
|
|
95
|
+
readonly SPACE: " ";
|
|
96
|
+
readonly TAB: "Tab";
|
|
97
|
+
readonly CHEVRON_LEFT: "<";
|
|
98
|
+
readonly CHEVRON_RIGHT: ">";
|
|
99
|
+
readonly PERIOD: ".";
|
|
100
|
+
readonly COMMA: ",";
|
|
101
|
+
readonly SUBTRACT: "-";
|
|
102
|
+
readonly SLASH: "/";
|
|
103
|
+
readonly A: "a";
|
|
104
|
+
readonly C: "c";
|
|
105
|
+
readonly D: "d";
|
|
106
|
+
readonly E: "e";
|
|
107
|
+
readonly F: "f";
|
|
108
|
+
readonly G: "g";
|
|
109
|
+
readonly H: "h";
|
|
110
|
+
readonly I: "i";
|
|
111
|
+
readonly L: "l";
|
|
112
|
+
readonly O: "o";
|
|
113
|
+
readonly P: "p";
|
|
114
|
+
readonly Q: "q";
|
|
115
|
+
readonly R: "r";
|
|
116
|
+
readonly S: "s";
|
|
117
|
+
readonly T: "t";
|
|
118
|
+
readonly V: "v";
|
|
119
|
+
readonly X: "x";
|
|
120
|
+
readonly Y: "y";
|
|
121
|
+
readonly Z: "z";
|
|
122
|
+
readonly K: "k";
|
|
123
|
+
readonly W: "w";
|
|
124
|
+
readonly 0: "0";
|
|
125
|
+
readonly 1: "1";
|
|
126
|
+
readonly 2: "2";
|
|
127
|
+
readonly 3: "3";
|
|
128
|
+
readonly 4: "4";
|
|
129
|
+
readonly 5: "5";
|
|
130
|
+
readonly 6: "6";
|
|
131
|
+
readonly 7: "7";
|
|
132
|
+
readonly 8: "8";
|
|
133
|
+
readonly 9: "9";
|
|
134
|
+
}>, ValueOf<{
|
|
135
|
+
readonly EQUAL: "Equal";
|
|
136
|
+
readonly MINUS: "Minus";
|
|
137
|
+
readonly NUM_ADD: "NumpadAdd";
|
|
138
|
+
readonly NUM_SUBTRACT: "NumpadSubtract";
|
|
139
|
+
readonly NUM_ZERO: "Numpad0";
|
|
140
|
+
readonly BRACKET_RIGHT: "BracketRight";
|
|
141
|
+
readonly BRACKET_LEFT: "BracketLeft";
|
|
142
|
+
readonly ONE: "Digit1";
|
|
143
|
+
readonly TWO: "Digit2";
|
|
144
|
+
readonly THREE: "Digit3";
|
|
145
|
+
readonly NINE: "Digit9";
|
|
146
|
+
readonly QUOTE: "Quote";
|
|
147
|
+
readonly ZERO: "Digit0";
|
|
148
|
+
readonly SLASH: "Slash";
|
|
149
|
+
readonly C: "KeyC";
|
|
150
|
+
readonly D: "KeyD";
|
|
151
|
+
readonly H: "KeyH";
|
|
152
|
+
readonly V: "KeyV";
|
|
153
|
+
readonly Z: "KeyZ";
|
|
154
|
+
readonly Y: "KeyY";
|
|
155
|
+
readonly R: "KeyR";
|
|
156
|
+
readonly S: "KeyS";
|
|
157
|
+
}>>;
|
|
158
|
+
export declare const isLatinChar: (key: string) => boolean;
|
|
159
|
+
/**
|
|
160
|
+
* Used to match key events for any keyboard layout, especially on Windows and Linux,
|
|
161
|
+
* where non-latin character with modified (CMD) is not substituted with latin-based alternative.
|
|
162
|
+
*
|
|
163
|
+
* Uses `event.key` when it's latin, otherwise fallbacks to `event.code` (if mapping exists).
|
|
164
|
+
*
|
|
165
|
+
* Example of pressing "z" on different layouts, with the chosen key or code highlighted in []:
|
|
166
|
+
*
|
|
167
|
+
* Layout | Code | Key | Comment
|
|
168
|
+
* --------------------- | ----- | --- | -------
|
|
169
|
+
* U.S. | KeyZ | [z] |
|
|
170
|
+
* Czech | KeyY | [z] |
|
|
171
|
+
* Turkish | KeyN | [z] |
|
|
172
|
+
* French | KeyW | [z] |
|
|
173
|
+
* Macedonian | [KeyZ] | з | z with cmd; з is Cyrillic equivalent of z
|
|
174
|
+
* Russian | [KeyZ] | я | z with cmd
|
|
175
|
+
* Serbian | [KeyZ] | ѕ | z with cmd
|
|
176
|
+
* Greek | [KeyZ] | ζ | z with cmd; also ζ is Greek equivalent of z
|
|
177
|
+
* Hebrew | [KeyZ] | ז | z with cmd; also ז is Hebrew equivalent of z
|
|
178
|
+
* Pinyin - Simplified | KeyZ | [z] | due to IME
|
|
179
|
+
* Cangije - Traditional | [KeyZ] | 重 | z with cmd
|
|
180
|
+
* Japanese | [KeyZ] | つ | z with cmd
|
|
181
|
+
* 2-Set Korean | [KeyZ] | ㅋ | z with cmd
|
|
182
|
+
*
|
|
183
|
+
* More details in https://github.com/excalidraw/excalidraw/pull/5944
|
|
184
|
+
*/
|
|
185
|
+
export declare const matchKey: (event: KeyboardEvent | React.KeyboardEvent<Element>, key: ValueOf<typeof KEYS>) => boolean;
|
|
79
186
|
export declare const isArrowKey: (key: string) => boolean;
|
|
80
187
|
export declare const shouldResizeFromCenter: (event: MouseEvent | KeyboardEvent) => boolean;
|
|
81
188
|
export declare const shouldMaintainAspectRatio: (event: MouseEvent | KeyboardEvent) => boolean;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
1
|
+
import type { MermaidToExcalidrawLibProps } from "./components/TTDDialog/common";
|
|
2
|
+
import type { NonDeletedExcalidrawElement } from "./element/types";
|
|
3
|
+
import type { FontMetadata } from "./fonts/FontMetadata";
|
|
4
|
+
import type { AppState } from "./types";
|
|
3
5
|
export declare let hostPlugin: any;
|
|
4
6
|
export declare function destroyObsidianUtils(): void;
|
|
5
|
-
export declare function initializeObsidianUtils(
|
|
7
|
+
export declare function initializeObsidianUtils(): void;
|
|
6
8
|
export declare function getAreaLimit(): any;
|
|
7
9
|
export declare function getWidthHeightLimit(): any;
|
|
8
10
|
export declare function allowDoubleTapEraser(): any;
|
|
@@ -17,5 +19,8 @@ export declare function registerLocalFont(fontMetrics: FontMetadata & {
|
|
|
17
19
|
export declare function getFontFamilies(): string[];
|
|
18
20
|
export declare function registerFontsInCSS(): Promise<void>;
|
|
19
21
|
export declare function getCSSFontDefinition(fontFamily: number): Promise<string>;
|
|
20
|
-
export declare function loadSceneFonts(elements: NonDeletedExcalidrawElement[]): Promise<
|
|
22
|
+
export declare function loadSceneFonts(elements: NonDeletedExcalidrawElement[]): Promise<FontFace[]>;
|
|
21
23
|
export declare function fetchFontFromVault(url: string | URL): Promise<ArrayBuffer | undefined>;
|
|
24
|
+
export declare function isTouchInPenMode(appState: AppState, event: React.PointerEvent<HTMLElement> | MouseEvent): boolean;
|
|
25
|
+
export declare function getSharedMermaidInstance(): Promise<MermaidToExcalidrawLibProps>;
|
|
26
|
+
export declare function loadMermaid(): Promise<MermaidToExcalidrawLibProps>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { ExcalidrawElement, ExcalidrawTextElement, NonDeletedExcalidrawElement, ExcalidrawFreeDrawElement, ExcalidrawFrameLikeElement, NonDeletedSceneElementsMap } from "../element/types";
|
|
1
|
+
import type { ExcalidrawElement, ExcalidrawTextElement, NonDeletedExcalidrawElement, ExcalidrawFreeDrawElement, ExcalidrawImageElement, ExcalidrawFrameLikeElement, NonDeletedSceneElementsMap } from "../element/types";
|
|
2
2
|
import type { RoughCanvas } from "roughjs/bin/canvas";
|
|
3
3
|
import type { StaticCanvasRenderConfig, RenderableElementsMap, InteractiveCanvasRenderConfig } from "../scene/types";
|
|
4
4
|
import type { AppState, StaticCanvasAppState, InteractiveCanvasAppState, ElementsPendingErasure, PendingExcalidrawElements } from "../types";
|
|
5
5
|
export declare const IMAGE_INVERT_FILTER = "invert(100%) hue-rotate(180deg) saturate(1.25)";
|
|
6
|
-
export declare const getRenderOpacity: (element: ExcalidrawElement, containingFrame: ExcalidrawFrameLikeElement | null, elementsPendingErasure: ElementsPendingErasure, pendingNodes: Readonly<PendingExcalidrawElements> | null) => number;
|
|
6
|
+
export declare const getRenderOpacity: (element: ExcalidrawElement, containingFrame: ExcalidrawFrameLikeElement | null, elementsPendingErasure: ElementsPendingErasure, pendingNodes: Readonly<PendingExcalidrawElements> | null, globalAlpha?: number) => number;
|
|
7
7
|
export interface ExcalidrawElementWithCanvas {
|
|
8
8
|
element: ExcalidrawElement | ExcalidrawTextElement;
|
|
9
9
|
canvas: HTMLCanvasElement;
|
|
@@ -14,6 +14,7 @@ export interface ExcalidrawElementWithCanvas {
|
|
|
14
14
|
canvasOffsetX: number;
|
|
15
15
|
canvasOffsetY: number;
|
|
16
16
|
boundTextElementVersion: number | null;
|
|
17
|
+
imageCrop: ExcalidrawImageElement["crop"] | null;
|
|
17
18
|
containingFrameOpacity: number;
|
|
18
19
|
boundTextCanvas: HTMLCanvasElement;
|
|
19
20
|
}
|
|
@@ -74,5 +74,6 @@ declare class Scene {
|
|
|
74
74
|
getContainerElement: (element: (ExcalidrawElement & {
|
|
75
75
|
containerId: ExcalidrawElement["id"] | null;
|
|
76
76
|
}) | null) => import("../element/types").ExcalidrawSelectionElement | import("../element/types").ExcalidrawRectangleElement | import("../element/types").ExcalidrawDiamondElement | import("../element/types").ExcalidrawEllipseElement | import("../element/types").ExcalidrawTextElement | import("../element/types").ExcalidrawLinearElement | import("../element/types").ExcalidrawFreeDrawElement | import("../element/types").ExcalidrawImageElement | import("../element/types").ExcalidrawFrameElement | import("../element/types").ExcalidrawMagicFrameElement | import("../element/types").ExcalidrawIframeElement | import("../element/types").ExcalidrawEmbeddableElement | null;
|
|
77
|
+
getElementsFromId: (id: string) => ExcalidrawElement[];
|
|
77
78
|
}
|
|
78
79
|
export default Scene;
|
|
@@ -289,6 +289,7 @@ export declare const getElementAtPosition: (elements: readonly NonDeletedExcalid
|
|
|
289
289
|
fileId: import("../element/types").FileId | null;
|
|
290
290
|
status: "pending" | "saved" | "error";
|
|
291
291
|
scale: [number, number];
|
|
292
|
+
crop: import("../element/types").ImageCrop | null;
|
|
292
293
|
}> & {
|
|
293
294
|
isDeleted: boolean;
|
|
294
295
|
}) | (Readonly<{
|
|
@@ -25,5 +25,13 @@ export declare const exportToSvg: (elements: readonly NonDeletedExcalidrawElemen
|
|
|
25
25
|
renderEmbeddables?: boolean;
|
|
26
26
|
exportingFrame?: ExcalidrawFrameLikeElement | null;
|
|
27
27
|
skipInliningFonts?: true;
|
|
28
|
+
reuseImages?: boolean;
|
|
28
29
|
}) => Promise<SVGSVGElement>;
|
|
30
|
+
export declare const encodeSvgBase64Payload: ({ payload, metadataElement, }: {
|
|
31
|
+
payload: string;
|
|
32
|
+
metadataElement: SVGMetadataElement;
|
|
33
|
+
}) => void;
|
|
34
|
+
export declare const decodeSvgBase64Payload: ({ svg }: {
|
|
35
|
+
svg: string;
|
|
36
|
+
}) => string;
|
|
29
37
|
export declare const getExportSize: (elements: readonly NonDeletedExcalidrawElement[], exportPadding: number, scale: number) => [number, number];
|