@myoc/common 0.19.503 → 0.19.505
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/types/element/src/arrange-algorithms/maxRects.d.ts +16 -0
- package/dist/types/element/src/linearElementEditor.d.ts +1 -1
- package/dist/types/element/src/types.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionProperties.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +1 -1
- package/dist/types/excalidraw/appState.d.ts +1 -1
- package/dist/types/excalidraw/components/App.d.ts +10 -1
- package/dist/types/excalidraw/editorPreferences.d.ts +11 -0
- package/dist/types/excalidraw/types.d.ts +23 -0
- package/package.json +1 -1
- package/dist/types/excalidraw/components/DiagramToCodePlugin/DiagramToCodePlugin.d.ts +0 -4
- package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +0 -15
- package/dist/types/excalidraw/components/InitializeApp.d.ts +0 -10
- package/dist/types/excalidraw/components/footer/FooterCenter.d.ts +0 -8
- package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -11
- package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -58
- package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Hints.d.ts +0 -19
- package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.d.ts +0 -84
- package/dist/types/excalidraw/data/reconcile.d.ts +0 -7
- package/dist/types/excalidraw/hooks/useAppStateValue.d.ts +0 -29
- package/dist/types/excalidraw/index.d.ts +0 -64
- package/dist/types/excalidraw/polyfill.d.ts +0 -2
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface Block {
|
|
2
|
+
w: number;
|
|
3
|
+
h: number;
|
|
4
|
+
fit?: {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
} | null;
|
|
8
|
+
}
|
|
9
|
+
export type MaxRectsHeuristic = "best-area-fit" | "center-distance";
|
|
10
|
+
export declare const packBlocksMaxRects: <T extends Block>(blocks: T[], options?: {
|
|
11
|
+
gap?: number;
|
|
12
|
+
heuristic?: MaxRectsHeuristic;
|
|
13
|
+
}) => {
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
} | null;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type GlobalPoint, type LocalPoint } from "@excalidraw/math";
|
|
2
|
-
import { type Store } from "@excalidraw/element";
|
|
3
2
|
import type { AppState, PointerCoords, InteractiveCanvasAppState, AppClassProperties, NullableGridSize, Zoom } from "@excalidraw/excalidraw/types";
|
|
4
3
|
import type { Bounds } from "@excalidraw/common";
|
|
5
4
|
import type { Scene } from "./Scene";
|
|
5
|
+
import type { Store } from "./store";
|
|
6
6
|
import type { NonDeleted, ExcalidrawLinearElement, ExcalidrawElement, ExcalidrawTextElementWithContainer, ElementsMap, NonDeletedSceneElementsMap, FixedPointBinding, ExcalidrawElbowArrowElement, PointsPositionUpdates } from "./types";
|
|
7
7
|
export declare class LinearElementEditor {
|
|
8
8
|
readonly elementId: ExcalidrawElement["id"] & {
|
|
@@ -287,7 +287,7 @@ export type SceneElementsMap = Map<ExcalidrawElement["id"], Ordered<ExcalidrawEl
|
|
|
287
287
|
*/
|
|
288
288
|
export type NonDeletedSceneElementsMap = Map<ExcalidrawElement["id"], Ordered<NonDeletedExcalidrawElement>> & MakeBrand<"NonDeletedSceneElementsMap">;
|
|
289
289
|
export type ElementsMapOrArray = readonly ExcalidrawElement[] | Readonly<ElementsMap>;
|
|
290
|
-
export type ArrangeAlgorithms = "bin-packing";
|
|
290
|
+
export type ArrangeAlgorithms = "bin-packing" | "bin-packing-center" | "bin-packing-max-rects" | "bin-packing-binary-tree";
|
|
291
291
|
export type ExcalidrawLinearElementSubType = "line" | "sharpArrow" | "curvedArrow" | "elbowArrow";
|
|
292
292
|
export type ConvertibleGenericTypes = "rectangle" | "diamond" | "ellipse";
|
|
293
293
|
export type ConvertibleLinearTypes = ExcalidrawLinearElementSubType;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LinearElementEditor } from "@excalidraw/element";
|
|
1
|
+
import { LinearElementEditor } from "@excalidraw/element/linearElementEditor";
|
|
2
2
|
import type { Arrowhead, ExcalidrawBindableElement, ExcalidrawElement, ExcalidrawLinearElement, ExcalidrawTextElement, FontFamilyValues, TextAlign } from "@excalidraw/element/types";
|
|
3
3
|
import type { AppClassProperties, AppState, Primitive } from "../types";
|
|
4
4
|
export declare const changeProperty: (elements: readonly ExcalidrawElement[], appState: AppState, callback: (element: ExcalidrawElement) => ExcalidrawElement, includeBoundText?: boolean) => ExcalidrawElement[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LinearElementEditor } from "@excalidraw/element";
|
|
1
|
+
import { LinearElementEditor } from "@excalidraw/element/linearElementEditor";
|
|
2
2
|
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
3
3
|
export declare const actionSelectAll: {
|
|
4
4
|
name: "selectAll";
|
|
@@ -8,7 +8,7 @@ export declare const actionToggleArrowBinding: {
|
|
|
8
8
|
};
|
|
9
9
|
perform(elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>): {
|
|
10
10
|
appState: {
|
|
11
|
-
bindingPreference: "
|
|
11
|
+
bindingPreference: "disabled" | "enabled";
|
|
12
12
|
isBindingEnabled: boolean;
|
|
13
13
|
contextMenu: {
|
|
14
14
|
items: import("../components/ContextMenu").ContextMenuItems;
|
|
@@ -27,7 +27,7 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
27
27
|
metric: import("./types").NormaliseMetric;
|
|
28
28
|
} | undefined;
|
|
29
29
|
isBindingEnabled?: boolean | undefined;
|
|
30
|
-
bindingPreference?: "
|
|
30
|
+
bindingPreference?: "disabled" | "enabled" | undefined;
|
|
31
31
|
isMidpointSnappingEnabled?: boolean | undefined;
|
|
32
32
|
preferredSelectionTool?: {
|
|
33
33
|
type: "selection" | "lasso";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { AppEventBus, type EXPORT_IMAGE_TYPES, Emitter, type EditorInterface, type StylesPanelMode } from "@excalidraw/common";
|
|
3
|
-
import {
|
|
3
|
+
import { FlowChartCreator, Scene, Store, type ElementUpdate, StoreDelta, type ApplyToOptions } from "@excalidraw/element";
|
|
4
|
+
import { LinearElementEditor } from "@excalidraw/element/linearElementEditor";
|
|
4
5
|
import type { ExcalidrawElement, NonDeleted, NonDeletedExcalidrawElement, ExcalidrawFrameLikeElement, ExcalidrawIframeElement, ExcalidrawEmbeddableElement, Ordered, SceneElementsMap } from "@excalidraw/element/types";
|
|
5
6
|
import type { Mutable } from "@excalidraw/common/utility-types";
|
|
6
7
|
import { ActionManager } from "../actions/manager";
|
|
@@ -381,6 +382,14 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
381
382
|
*/
|
|
382
383
|
value: number) => void;
|
|
383
384
|
private cancelInProgressAnimation;
|
|
385
|
+
scrollToViewport: (target: {
|
|
386
|
+
scrollX: number;
|
|
387
|
+
scrollY: number;
|
|
388
|
+
zoom: number;
|
|
389
|
+
}, opts?: {
|
|
390
|
+
animate?: boolean;
|
|
391
|
+
duration?: number;
|
|
392
|
+
}) => void;
|
|
384
393
|
scrollToContent: (
|
|
385
394
|
/**
|
|
386
395
|
* target to scroll to
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AppState, ArrangePreferences, EditorPreferences, NormalisePreferences, SmartZoomPreferences } from "./types";
|
|
2
|
+
export type ResolvedSmartZoomPreferences = Required<SmartZoomPreferences>;
|
|
3
|
+
export type ResolvedArrangePreferences = Required<ArrangePreferences>;
|
|
4
|
+
export type ResolvedNormalisePreferences = Required<NormalisePreferences>;
|
|
5
|
+
export type ResolvedEditorPreferences = {
|
|
6
|
+
smartZoom: ResolvedSmartZoomPreferences;
|
|
7
|
+
arrange: ResolvedArrangePreferences;
|
|
8
|
+
normalise: ResolvedNormalisePreferences;
|
|
9
|
+
};
|
|
10
|
+
export declare const DEFAULT_SMART_ZOOM_PREFERENCES: ResolvedSmartZoomPreferences;
|
|
11
|
+
export declare const getEffectiveEditorPreferences: (appState: Readonly<Pick<AppState, "arrangeConfiguration" | "normaliseConfiguration">>, editorPreferences?: EditorPreferences) => ResolvedEditorPreferences;
|
|
@@ -174,6 +174,25 @@ export type ObservedElementsAppState = {
|
|
|
174
174
|
};
|
|
175
175
|
export type NormaliseMode = "first" | "average";
|
|
176
176
|
export type NormaliseMetric = "scale" | "height" | "width" | "size";
|
|
177
|
+
export type SmartZoomPreferences = {
|
|
178
|
+
fitToViewport?: boolean;
|
|
179
|
+
animate?: boolean;
|
|
180
|
+
duration?: number;
|
|
181
|
+
viewportZoomFactor?: number;
|
|
182
|
+
};
|
|
183
|
+
export type ArrangePreferences = {
|
|
184
|
+
algorithm?: ArrangeAlgorithms;
|
|
185
|
+
gap?: number;
|
|
186
|
+
};
|
|
187
|
+
export type NormalisePreferences = {
|
|
188
|
+
mode?: NormaliseMode;
|
|
189
|
+
metric?: NormaliseMetric;
|
|
190
|
+
};
|
|
191
|
+
export type EditorPreferences = {
|
|
192
|
+
smartZoom?: SmartZoomPreferences;
|
|
193
|
+
arrange?: ArrangePreferences;
|
|
194
|
+
normalise?: NormalisePreferences;
|
|
195
|
+
};
|
|
177
196
|
export interface AppState {
|
|
178
197
|
contextMenu: {
|
|
179
198
|
items: ContextMenuItems;
|
|
@@ -511,6 +530,8 @@ export interface ExcalidrawProps {
|
|
|
511
530
|
theme?: Theme;
|
|
512
531
|
name?: string;
|
|
513
532
|
renderCustomStats?: (elements: readonly NonDeletedExcalidrawElement[], appState: UIAppState) => JSX.Element;
|
|
533
|
+
editorPreferences?: EditorPreferences;
|
|
534
|
+
onEditorPreferencesChange?: (next: EditorPreferences) => void;
|
|
514
535
|
UIOptions?: Partial<UIOptions>;
|
|
515
536
|
detectScroll?: boolean;
|
|
516
537
|
handleKeyboardGlobally?: boolean;
|
|
@@ -628,6 +649,7 @@ export type AppClassProperties = {
|
|
|
628
649
|
onInsertElements: App["onInsertElements"];
|
|
629
650
|
onExportImage: App["onExportImage"];
|
|
630
651
|
lastViewportPosition: App["lastViewportPosition"];
|
|
652
|
+
scrollToViewport: App["scrollToViewport"];
|
|
631
653
|
scrollToContent: App["scrollToContent"];
|
|
632
654
|
addFiles: App["addFiles"];
|
|
633
655
|
addElementsFromPasteOrLibrary: App["addElementsFromPasteOrLibrary"];
|
|
@@ -740,6 +762,7 @@ export interface ExcalidrawImperativeAPI {
|
|
|
740
762
|
getAppState: () => InstanceType<typeof App>["state"];
|
|
741
763
|
getFiles: () => InstanceType<typeof App>["files"];
|
|
742
764
|
getName: InstanceType<typeof App>["getName"];
|
|
765
|
+
scrollToViewport: InstanceType<typeof App>["scrollToViewport"];
|
|
743
766
|
scrollToContent: InstanceType<typeof App>["scrollToContent"];
|
|
744
767
|
registerAction: (action: Action) => void;
|
|
745
768
|
refresh: InstanceType<typeof App>["refresh"];
|
package/package.json
CHANGED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import "./ExcalidrawLogo.scss";
|
|
2
|
-
type LogoSize = "xs" | "small" | "normal" | "large" | "custom" | "mobile";
|
|
3
|
-
interface LogoProps {
|
|
4
|
-
size?: LogoSize;
|
|
5
|
-
withText?: boolean;
|
|
6
|
-
style?: React.CSSProperties;
|
|
7
|
-
/**
|
|
8
|
-
* If true, the logo will not be wrapped in a Link component.
|
|
9
|
-
* The link prop will be ignored as well.
|
|
10
|
-
* It will merely be a plain div.
|
|
11
|
-
*/
|
|
12
|
-
isNotLink?: boolean;
|
|
13
|
-
}
|
|
14
|
-
export declare const ExcalidrawLogo: ({ style, size, withText, }: LogoProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { Theme } from "@excalidraw/element/types";
|
|
3
|
-
import type { Language } from "../i18n";
|
|
4
|
-
interface Props {
|
|
5
|
-
langCode: Language["code"];
|
|
6
|
-
children: React.ReactElement;
|
|
7
|
-
theme?: Theme;
|
|
8
|
-
}
|
|
9
|
-
export declare const InitializeApp: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type EditorInterface } from "@excalidraw/common";
|
|
2
|
-
import "./LiveCollaborationTrigger.scss";
|
|
3
|
-
declare const LiveCollaborationTrigger: {
|
|
4
|
-
({ isCollaborating, onSelect, editorInterface, ...rest }: {
|
|
5
|
-
isCollaborating: boolean;
|
|
6
|
-
onSelect: () => void;
|
|
7
|
-
editorInterface?: EditorInterface;
|
|
8
|
-
} & React.ButtonHTMLAttributes<HTMLButtonElement>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
displayName: string;
|
|
10
|
-
};
|
|
11
|
-
export default LiveCollaborationTrigger;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import type { JSX } from "react";
|
|
2
|
-
declare const Center: {
|
|
3
|
-
({ children }: {
|
|
4
|
-
children?: React.ReactNode;
|
|
5
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
displayName: string;
|
|
7
|
-
Logo: {
|
|
8
|
-
({ children }: {
|
|
9
|
-
children?: React.ReactNode;
|
|
10
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
displayName: string;
|
|
12
|
-
};
|
|
13
|
-
Heading: {
|
|
14
|
-
({ children }: {
|
|
15
|
-
children: React.ReactNode;
|
|
16
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
displayName: string;
|
|
18
|
-
};
|
|
19
|
-
Menu: {
|
|
20
|
-
({ children }: {
|
|
21
|
-
children?: React.ReactNode;
|
|
22
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
23
|
-
displayName: string;
|
|
24
|
-
};
|
|
25
|
-
MenuItem: {
|
|
26
|
-
({ onSelect, children, icon, shortcut, className, ...props }: {
|
|
27
|
-
onSelect: () => void;
|
|
28
|
-
children: React.ReactNode;
|
|
29
|
-
icon?: JSX.Element;
|
|
30
|
-
shortcut?: string | null;
|
|
31
|
-
} & React.ButtonHTMLAttributes<HTMLButtonElement>): import("react/jsx-runtime").JSX.Element;
|
|
32
|
-
displayName: string;
|
|
33
|
-
};
|
|
34
|
-
MenuItemLink: {
|
|
35
|
-
({ children, href, icon, shortcut, className, ...props }: {
|
|
36
|
-
children: React.ReactNode;
|
|
37
|
-
href: string;
|
|
38
|
-
icon?: JSX.Element;
|
|
39
|
-
shortcut?: string | null;
|
|
40
|
-
} & React.AnchorHTMLAttributes<HTMLAnchorElement>): import("react/jsx-runtime").JSX.Element;
|
|
41
|
-
displayName: string;
|
|
42
|
-
};
|
|
43
|
-
MenuItemHelp: {
|
|
44
|
-
(): import("react/jsx-runtime").JSX.Element;
|
|
45
|
-
displayName: string;
|
|
46
|
-
};
|
|
47
|
-
MenuItemLoadScene: {
|
|
48
|
-
(): import("react/jsx-runtime").JSX.Element | null;
|
|
49
|
-
displayName: string;
|
|
50
|
-
};
|
|
51
|
-
MenuItemLiveCollaborationTrigger: {
|
|
52
|
-
({ onSelect, }: {
|
|
53
|
-
onSelect: () => any;
|
|
54
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
55
|
-
displayName: string;
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
export { Center };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
declare const MenuHint: {
|
|
2
|
-
({ children }: {
|
|
3
|
-
children?: React.ReactNode;
|
|
4
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
displayName: string;
|
|
6
|
-
};
|
|
7
|
-
declare const ToolbarHint: {
|
|
8
|
-
({ children }: {
|
|
9
|
-
children?: React.ReactNode;
|
|
10
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
displayName: string;
|
|
12
|
-
};
|
|
13
|
-
declare const HelpHint: {
|
|
14
|
-
({ children }: {
|
|
15
|
-
children?: React.ReactNode;
|
|
16
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
displayName: string;
|
|
18
|
-
};
|
|
19
|
-
export { HelpHint, MenuHint, ToolbarHint };
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import "./WelcomeScreen.scss";
|
|
2
|
-
declare const WelcomeScreen: {
|
|
3
|
-
(props: {
|
|
4
|
-
children?: React.ReactNode;
|
|
5
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
displayName: string;
|
|
7
|
-
Center: {
|
|
8
|
-
({ children }: {
|
|
9
|
-
children?: React.ReactNode;
|
|
10
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
displayName: string;
|
|
12
|
-
Logo: {
|
|
13
|
-
({ children }: {
|
|
14
|
-
children?: React.ReactNode;
|
|
15
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
displayName: string;
|
|
17
|
-
};
|
|
18
|
-
Heading: {
|
|
19
|
-
({ children }: {
|
|
20
|
-
children: React.ReactNode;
|
|
21
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
displayName: string;
|
|
23
|
-
};
|
|
24
|
-
Menu: {
|
|
25
|
-
({ children }: {
|
|
26
|
-
children?: React.ReactNode;
|
|
27
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
28
|
-
displayName: string;
|
|
29
|
-
};
|
|
30
|
-
MenuItem: {
|
|
31
|
-
({ onSelect, children, icon, shortcut, className, ...props }: {
|
|
32
|
-
onSelect: () => void;
|
|
33
|
-
children: React.ReactNode;
|
|
34
|
-
icon?: import("react").JSX.Element;
|
|
35
|
-
shortcut?: string | null;
|
|
36
|
-
} & React.ButtonHTMLAttributes<HTMLButtonElement>): import("react/jsx-runtime").JSX.Element;
|
|
37
|
-
displayName: string;
|
|
38
|
-
};
|
|
39
|
-
MenuItemLink: {
|
|
40
|
-
({ children, href, icon, shortcut, className, ...props }: {
|
|
41
|
-
children: React.ReactNode;
|
|
42
|
-
href: string;
|
|
43
|
-
icon?: import("react").JSX.Element;
|
|
44
|
-
shortcut?: string | null;
|
|
45
|
-
} & React.AnchorHTMLAttributes<HTMLAnchorElement>): import("react/jsx-runtime").JSX.Element;
|
|
46
|
-
displayName: string;
|
|
47
|
-
};
|
|
48
|
-
MenuItemHelp: {
|
|
49
|
-
(): import("react/jsx-runtime").JSX.Element;
|
|
50
|
-
displayName: string;
|
|
51
|
-
};
|
|
52
|
-
MenuItemLoadScene: {
|
|
53
|
-
(): import("react/jsx-runtime").JSX.Element | null;
|
|
54
|
-
displayName: string;
|
|
55
|
-
};
|
|
56
|
-
MenuItemLiveCollaborationTrigger: {
|
|
57
|
-
({ onSelect, }: {
|
|
58
|
-
onSelect: () => any;
|
|
59
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
60
|
-
displayName: string;
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
Hints: {
|
|
64
|
-
MenuHint: {
|
|
65
|
-
({ children }: {
|
|
66
|
-
children?: React.ReactNode;
|
|
67
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
68
|
-
displayName: string;
|
|
69
|
-
};
|
|
70
|
-
ToolbarHint: {
|
|
71
|
-
({ children }: {
|
|
72
|
-
children?: React.ReactNode;
|
|
73
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
74
|
-
displayName: string;
|
|
75
|
-
};
|
|
76
|
-
HelpHint: {
|
|
77
|
-
({ children }: {
|
|
78
|
-
children?: React.ReactNode;
|
|
79
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
80
|
-
displayName: string;
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
export default WelcomeScreen;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { OrderedExcalidrawElement } from "@excalidraw/element/types";
|
|
2
|
-
import type { MakeBrand } from "@excalidraw/common/utility-types";
|
|
3
|
-
import type { AppState } from "../types";
|
|
4
|
-
export type ReconciledExcalidrawElement = OrderedExcalidrawElement & MakeBrand<"ReconciledElement">;
|
|
5
|
-
export type RemoteExcalidrawElement = OrderedExcalidrawElement & MakeBrand<"RemoteExcalidrawElement">;
|
|
6
|
-
export declare const shouldDiscardRemoteElement: (localAppState: AppState, local: OrderedExcalidrawElement | undefined, remote: RemoteExcalidrawElement) => boolean;
|
|
7
|
-
export declare const reconcileElements: (localElements: readonly OrderedExcalidrawElement[], remoteElements: readonly RemoteExcalidrawElement[], localAppState: AppState) => ReconciledExcalidrawElement[];
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { AppState } from "../types";
|
|
2
|
-
/**
|
|
3
|
-
* Subscribes to specific appState changes. The component re-renders
|
|
4
|
-
* only when the specified prop(s) change — not on every appState update.
|
|
5
|
-
*
|
|
6
|
-
* Works both inside and outside the <Excalidraw> tree, as long as
|
|
7
|
-
* ExcalidrawAPIContext.Provider is an ancestor (automatically provided
|
|
8
|
-
* inside <Excalidraw>, or manually by the host app).
|
|
9
|
-
*
|
|
10
|
-
* Returns the narrowed value depending on prop form:
|
|
11
|
-
* - `keyof AppState` → `AppState[K]`
|
|
12
|
-
* - `(keyof AppState)[]` → whole `AppState`
|
|
13
|
-
* - selector function → selector's return type `T`
|
|
14
|
-
*
|
|
15
|
-
* If excalidrawAPI is not ready yet (host apps), hook is rerendered with latest
|
|
16
|
-
* value once available.
|
|
17
|
-
*/
|
|
18
|
-
export declare function useAppStateValue<K extends keyof AppState>(prop: K, _internal?: boolean): AppState[K];
|
|
19
|
-
export declare function useAppStateValue(props: (keyof AppState)[], _internal?: boolean): AppState;
|
|
20
|
-
export declare function useAppStateValue<T>(selector: (appState: AppState) => T, _internal?: boolean): T;
|
|
21
|
-
/**
|
|
22
|
-
* Subscribes to specific appState changes without causing component rerenders.
|
|
23
|
-
*
|
|
24
|
-
* The callback is called on every matching change, but also on initial render
|
|
25
|
-
* so you can initialize your state.
|
|
26
|
-
*/
|
|
27
|
-
export declare function useOnAppStateChange<K extends keyof AppState>(prop: K, callback: (value: AppState[K], appState: AppState) => void): undefined;
|
|
28
|
-
export declare function useOnAppStateChange(props: (keyof AppState)[], callback: (props: AppState, appState: AppState) => void): undefined;
|
|
29
|
-
export declare function useOnAppStateChange<T>(selector: (appState: AppState) => T, callback: (value: T, appState: AppState) => void): undefined;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import Footer from "./components/footer/FooterCenter";
|
|
3
|
-
import LiveCollaborationTrigger from "./components/live-collaboration/LiveCollaborationTrigger";
|
|
4
|
-
import MainMenu from "./components/main-menu/MainMenu";
|
|
5
|
-
import WelcomeScreen from "./components/welcome-screen/WelcomeScreen";
|
|
6
|
-
import { useOnAppStateChange as _useOnAppStateChange } from "./hooks/useAppStateValue";
|
|
7
|
-
import "./css/app.scss";
|
|
8
|
-
import "./css/styles.scss";
|
|
9
|
-
import "./fonts/fonts.css";
|
|
10
|
-
import type { AppState, ExcalidrawProps } from "./types";
|
|
11
|
-
/**
|
|
12
|
-
* Stateless provider that allows `useExcalidrawAPI()` (and hooks built
|
|
13
|
-
* on it, such as `useAppStateValue()` and `useOnAppStateChange()`) to work
|
|
14
|
-
* outside the <Excalidraw> component tree.
|
|
15
|
-
*/
|
|
16
|
-
export declare const ExcalidrawAPIProvider: ({ children, }: {
|
|
17
|
-
children: React.ReactNode;
|
|
18
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
export declare const Excalidraw: React.MemoExoticComponent<(props: ExcalidrawProps) => import("react/jsx-runtime").JSX.Element>;
|
|
20
|
-
export { getSceneVersion, hashElementsVersion, hashString, getNonDeletedElements, } from "@excalidraw/element";
|
|
21
|
-
export { getTextFromElements } from "@excalidraw/element";
|
|
22
|
-
export { isInvisiblySmallElement } from "@excalidraw/element";
|
|
23
|
-
export { defaultLang, useI18n, languages } from "./i18n";
|
|
24
|
-
export { restoreAppState, restoreElement, restoreElements, restoreLibraryItems, } from "./data/restore";
|
|
25
|
-
export { reconcileElements } from "./data/reconcile";
|
|
26
|
-
export { exportToCanvas, exportToBlob, exportToSvg, exportToClipboard, } from "@excalidraw/utils/export";
|
|
27
|
-
export { serializeAsJSON, serializeLibraryAsJSON } from "./data/json";
|
|
28
|
-
export { loadFromBlob, loadSceneOrLibraryFromBlob, loadLibraryFromBlob, } from "./data/blob";
|
|
29
|
-
export { mergeLibraryItems, getLibraryItemsHash } from "./data/library";
|
|
30
|
-
export { isLinearElement } from "@excalidraw/element";
|
|
31
|
-
export { FONT_FAMILY, THEME, MIME_TYPES, ROUNDNESS, DEFAULT_LASER_COLOR, UserIdleState, normalizeLink, sceneCoordsToViewportCoords, viewportCoordsToSceneCoords, getFormFactor, throttleRAF, } from "@excalidraw/common";
|
|
32
|
-
export { mutateElement, newElementWith, bumpVersion, } from "@excalidraw/element";
|
|
33
|
-
export { CaptureUpdateAction } from "@excalidraw/element";
|
|
34
|
-
export { parseLibraryTokensFromUrl, useHandleLibrary } from "./data/library";
|
|
35
|
-
export { Sidebar } from "./components/Sidebar/Sidebar";
|
|
36
|
-
export { Button } from "./components/Button";
|
|
37
|
-
export { Footer };
|
|
38
|
-
export { MainMenu };
|
|
39
|
-
export { Ellipsify } from "./components/Ellipsify";
|
|
40
|
-
export { useEditorInterface, useStylesPanelMode, useExcalidrawAPI, ExcalidrawAPIContext, } from "./components/App";
|
|
41
|
-
export { WelcomeScreen };
|
|
42
|
-
export { LiveCollaborationTrigger };
|
|
43
|
-
export { Stats } from "./components/Stats";
|
|
44
|
-
export { DefaultSidebar } from "./components/DefaultSidebar";
|
|
45
|
-
export { zoomToFitBounds } from "./actions/actionCanvas";
|
|
46
|
-
export { getCommonBounds, getVisibleSceneBounds, convertToExcalidrawElements, } from "@excalidraw/element";
|
|
47
|
-
export { elementsOverlappingBBox, isElementInsideBBox, elementPartiallyOverlapsWithOrContainsBBox, } from "@excalidraw/utils/withinBounds";
|
|
48
|
-
export { DiagramToCodePlugin } from "./components/DiagramToCodePlugin/DiagramToCodePlugin";
|
|
49
|
-
export { getDataURL } from "./data/blob";
|
|
50
|
-
export { isElementLink } from "@excalidraw/element";
|
|
51
|
-
export { Fonts } from "./fonts/Fonts";
|
|
52
|
-
export { setCustomTextMetricsProvider } from "@excalidraw/element";
|
|
53
|
-
export { CommandPalette } from "./components/CommandPalette/CommandPalette";
|
|
54
|
-
export { renderSpreadsheet, tryParseSpreadsheet, isSpreadsheetValidForChartType, } from "./charts";
|
|
55
|
-
/**
|
|
56
|
-
* hook that subscribes to specific appState prop(s)
|
|
57
|
-
*
|
|
58
|
-
* @param prop - appState prop(s) to subscribe to, or a selector function.
|
|
59
|
-
* NOTE `prop/selector` is memoized and will not change after initial render
|
|
60
|
-
*/
|
|
61
|
-
export declare function useExcalidrawStateValue<K extends keyof AppState>(prop: K): AppState[K] | undefined;
|
|
62
|
-
export declare function useExcalidrawStateValue<T extends keyof AppState>(props: T[]): AppState | undefined;
|
|
63
|
-
export declare function useExcalidrawStateValue<T>(selector: (appState: AppState) => T): T | undefined;
|
|
64
|
-
export { _useOnAppStateChange as useOnExcalidrawStateChange };
|