@myoc/common 0.19.517 → 0.19.519
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/dev/index.js +4 -1
- package/dist/dev/index.js.map +2 -2
- package/dist/prod/index.js +1 -1
- package/dist/types/common/src/colors.d.ts +1 -1
- package/dist/types/element/src/bounds.d.ts +18 -1
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +2 -0
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +11 -0
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +2 -0
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +3 -0
- package/dist/types/excalidraw/actions/actionDeselect.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +2 -0
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionExport.d.ts +2 -0
- package/dist/types/excalidraw/actions/actionFrame.d.ts +4 -0
- package/dist/types/excalidraw/actions/actionGroup.d.ts +2 -0
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionLink.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionMenu.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionProperties.d.ts +2 -0
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionStyles.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +3 -2
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +1 -0
- package/dist/types/excalidraw/components/App.d.ts +1 -0
- package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +7 -4
- package/dist/types/excalidraw/data/blob.d.ts +1 -0
- package/dist/types/excalidraw/data/json.d.ts +1 -0
- package/dist/types/excalidraw/types.d.ts +8 -0
- package/dist/types/utils/src/index.d.ts +1 -2
- package/package.json +1 -1
- package/dist/types/utils/src/bbox.d.ts +0 -9
- package/dist/types/utils/src/withinBounds.d.ts +0 -19
|
@@ -7,7 +7,7 @@ export declare const actionToggleViewMode: {
|
|
|
7
7
|
category: "canvas";
|
|
8
8
|
predicate: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
9
9
|
};
|
|
10
|
-
perform(elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>): {
|
|
10
|
+
perform(elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>): false | {
|
|
11
11
|
appState: {
|
|
12
12
|
viewModeEnabled: boolean;
|
|
13
13
|
contextMenu: {
|
|
@@ -136,6 +136,7 @@ export declare const actionToggleViewMode: {
|
|
|
136
136
|
gridSize: number;
|
|
137
137
|
gridStep: number;
|
|
138
138
|
gridModeEnabled: boolean;
|
|
139
|
+
viewModeOnly: boolean;
|
|
139
140
|
selectedGroupIds: {
|
|
140
141
|
[groupId: string]: boolean;
|
|
141
142
|
};
|
|
@@ -177,7 +178,7 @@ export declare const actionToggleViewMode: {
|
|
|
177
178
|
checked: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
178
179
|
predicate: (elements: readonly import("@excalidraw/element/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps) => boolean;
|
|
179
180
|
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
180
|
-
PanelComponent: ({ data, updateData, appState }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
181
|
+
PanelComponent: ({ data, updateData, appState, appProps }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
181
182
|
} & {
|
|
182
183
|
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
|
|
183
184
|
};
|
|
@@ -502,6 +502,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
502
502
|
private handleCanvasClick;
|
|
503
503
|
private getElementLinkAtPosition;
|
|
504
504
|
private handleElementLinkClick;
|
|
505
|
+
private openElementLink;
|
|
505
506
|
/**
|
|
506
507
|
* finds candidate frame under cursor (when dragging frame children/elements
|
|
507
508
|
* inside frames)
|
|
@@ -25,11 +25,14 @@ export declare const Help: {
|
|
|
25
25
|
export declare const ToggleTheme: {
|
|
26
26
|
(props: {
|
|
27
27
|
allowSystemTheme: true;
|
|
28
|
+
/**
|
|
29
|
+
* Controls the theme of this UI component only.
|
|
30
|
+
* You should subscribe to `props.onThemeChange` and control the theme
|
|
31
|
+
* upstream.
|
|
32
|
+
*/
|
|
28
33
|
theme: Theme | "system";
|
|
29
|
-
onSelect: (theme: Theme | "system") => void;
|
|
30
34
|
} | {
|
|
31
|
-
allowSystemTheme
|
|
32
|
-
onSelect?: (theme: Theme) => void;
|
|
35
|
+
allowSystemTheme: false;
|
|
33
36
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
34
37
|
displayName: string;
|
|
35
38
|
};
|
|
@@ -66,7 +69,7 @@ export declare const Preferences: {
|
|
|
66
69
|
ToggleMidpointSnapping: () => import("react/jsx-runtime").JSX.Element;
|
|
67
70
|
ToggleGridMode: () => import("react/jsx-runtime").JSX.Element;
|
|
68
71
|
ToggleZenMode: () => import("react/jsx-runtime").JSX.Element;
|
|
69
|
-
ToggleViewMode: () => import("react/jsx-runtime").JSX.Element;
|
|
72
|
+
ToggleViewMode: () => import("react/jsx-runtime").JSX.Element | null;
|
|
70
73
|
ToggleElementProperties: () => import("react/jsx-runtime").JSX.Element;
|
|
71
74
|
displayName: string;
|
|
72
75
|
};
|
|
@@ -18,6 +18,7 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
|
|
|
18
18
|
elements: import("@excalidraw/element/types").OrderedExcalidrawElement[];
|
|
19
19
|
appState: {
|
|
20
20
|
viewModeEnabled: boolean;
|
|
21
|
+
viewModeOnly: boolean;
|
|
21
22
|
zenModeEnabled: boolean;
|
|
22
23
|
gridModeEnabled: boolean;
|
|
23
24
|
objectsSnapModeEnabled: boolean;
|
|
@@ -19,6 +19,7 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
|
|
|
19
19
|
elements: import("@excalidraw/element/types").OrderedExcalidrawElement[];
|
|
20
20
|
appState: {
|
|
21
21
|
viewModeEnabled: boolean;
|
|
22
|
+
viewModeOnly: boolean;
|
|
22
23
|
zenModeEnabled: boolean;
|
|
23
24
|
gridModeEnabled: boolean;
|
|
24
25
|
objectsSnapModeEnabled: boolean;
|
|
@@ -365,6 +365,7 @@ export interface AppState {
|
|
|
365
365
|
gridStep: number;
|
|
366
366
|
gridModeEnabled: boolean;
|
|
367
367
|
viewModeEnabled: boolean;
|
|
368
|
+
viewModeOnly: boolean;
|
|
368
369
|
/** top-most selected groups (i.e. does not include nested groups) */
|
|
369
370
|
selectedGroupIds: {
|
|
370
371
|
[groupId: string]: boolean;
|
|
@@ -464,6 +465,7 @@ export type CompressImageFileOpts = {
|
|
|
464
465
|
export type CompressImageFile = (file: File, opts: CompressImageFileOpts) => Promise<File>;
|
|
465
466
|
export interface ExcalidrawProps {
|
|
466
467
|
onChange?: (elements: readonly OrderedExcalidrawElement[], appState: AppState, files: BinaryFiles) => void;
|
|
468
|
+
onThemeChange?: (theme: Theme | "system") => void;
|
|
467
469
|
/**
|
|
468
470
|
* note: only subscribes if the props.onIncrement is defined on initial render
|
|
469
471
|
*/
|
|
@@ -514,6 +516,7 @@ export interface ExcalidrawProps {
|
|
|
514
516
|
renderTopRightUI?: (isMobile: boolean, appState: UIAppState) => JSX.Element | null;
|
|
515
517
|
langCode?: Language["code"];
|
|
516
518
|
viewModeEnabled?: boolean;
|
|
519
|
+
viewModeOnly?: boolean;
|
|
517
520
|
zenModeEnabled?: boolean;
|
|
518
521
|
gridModeEnabled?: boolean;
|
|
519
522
|
objectsSnapModeEnabled?: boolean;
|
|
@@ -593,6 +596,11 @@ export type CanvasActions = Partial<{
|
|
|
593
596
|
export: false | ExportOpts;
|
|
594
597
|
loadScene: boolean;
|
|
595
598
|
saveToActiveFile: boolean;
|
|
599
|
+
/**
|
|
600
|
+
* defaults to true if `props.theme` is omitted or `props.onThemeChange`
|
|
601
|
+
* is supplied (at which point the theme is considered as host-app controlled),
|
|
602
|
+
* else default to false
|
|
603
|
+
* */
|
|
596
604
|
toggleTheme: boolean | null;
|
|
597
605
|
saveAsImage: boolean;
|
|
598
606
|
}>;
|
package/package.json
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type GlobalPoint, type LocalPoint } from "@excalidraw/math";
|
|
2
|
-
import type { Bounds } from "@excalidraw/common";
|
|
3
|
-
export type LineSegment<P extends LocalPoint | GlobalPoint> = [P, P];
|
|
4
|
-
export declare function getBBox<P extends LocalPoint | GlobalPoint>(line: LineSegment<P>): Bounds;
|
|
5
|
-
export declare function doBBoxesIntersect(a: Bounds, b: Bounds): boolean;
|
|
6
|
-
export declare function isPointOnLine<P extends GlobalPoint | LocalPoint>(l: LineSegment<P>, p: P): boolean;
|
|
7
|
-
export declare function isPointRightOfLine<P extends GlobalPoint | LocalPoint>(l: LineSegment<P>, p: P): boolean;
|
|
8
|
-
export declare function isLineSegmentTouchingOrCrossingLine<P extends GlobalPoint | LocalPoint>(a: LineSegment<P>, b: LineSegment<P>): boolean;
|
|
9
|
-
export declare function doLineSegmentsIntersect<P extends GlobalPoint | LocalPoint>(a: LineSegment<P>, b: LineSegment<P>): boolean;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { type Bounds } from "@excalidraw/common";
|
|
2
|
-
import type { ExcalidrawElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
3
|
-
type Element = NonDeletedExcalidrawElement;
|
|
4
|
-
type Elements = readonly NonDeletedExcalidrawElement[];
|
|
5
|
-
export declare const isElementInsideBBox: (element: Element, bbox: Bounds, eitherDirection?: boolean) => boolean;
|
|
6
|
-
export declare const elementPartiallyOverlapsWithOrContainsBBox: (element: Element, bbox: Bounds) => boolean;
|
|
7
|
-
export declare const elementsOverlappingBBox: ({ elements, bounds, type, errorMargin, }: {
|
|
8
|
-
elements: Elements;
|
|
9
|
-
bounds: Bounds | ExcalidrawElement;
|
|
10
|
-
/** safety offset. Defaults to 0. */
|
|
11
|
-
errorMargin?: number;
|
|
12
|
-
/**
|
|
13
|
-
* - overlap: elements overlapping or inside bounds
|
|
14
|
-
* - contain: elements inside bounds or bounds inside elements
|
|
15
|
-
* - inside: elements inside bounds
|
|
16
|
-
**/
|
|
17
|
-
type: "overlap" | "contain" | "inside";
|
|
18
|
-
}) => NonDeletedExcalidrawElement[];
|
|
19
|
-
export {};
|