@myoc/common 0.19.536 → 0.19.538
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 +18 -6
- package/dist/dev/index.js.map +2 -2
- package/dist/prod/index.js +3 -3
- package/dist/types/common/src/utils.d.ts +15 -12
- package/dist/types/element/src/align.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionAlign.d.ts +192 -0
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +8 -0
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +24 -0
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +8 -0
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +4 -0
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +12 -0
- package/dist/types/excalidraw/actions/actionDeselect.d.ts +4 -1
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +8 -1
- package/dist/types/excalidraw/actions/actionExport.d.ts +8 -0
- package/dist/types/excalidraw/actions/actionFlipViewpoint.d.ts +43 -0
- package/dist/types/excalidraw/actions/actionFrame.d.ts +12 -0
- package/dist/types/excalidraw/actions/actionGroup.d.ts +8 -0
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +4 -0
- package/dist/types/excalidraw/actions/actionLink.d.ts +4 -0
- package/dist/types/excalidraw/actions/actionMenu.d.ts +4 -0
- package/dist/types/excalidraw/actions/actionProperties.d.ts +8 -0
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +4 -0
- package/dist/types/excalidraw/actions/actionStyles.d.ts +4 -0
- package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +4 -0
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +4 -0
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +4 -0
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +4 -0
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +4 -0
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +4 -0
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +4 -0
- package/dist/types/excalidraw/actions/index.d.ts +2 -1
- package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
- package/dist/types/excalidraw/actions/types.d.ts +1 -3
- package/dist/types/excalidraw/appState.d.ts +3 -0
- package/dist/types/excalidraw/components/App.d.ts +0 -1
- package/dist/types/excalidraw/components/Tools.d.ts +0 -1
- package/dist/types/excalidraw/data/blob.d.ts +4 -0
- package/dist/types/excalidraw/data/json.d.ts +4 -0
- package/dist/types/excalidraw/editorPreferences.d.ts +5 -2
- package/dist/types/excalidraw/renderer/viewpoint.d.ts +8 -0
- package/dist/types/excalidraw/types.d.ts +12 -7
- package/dist/types/excalidraw/viewport.d.ts +4 -0
- package/package.json +1 -1
- package/dist/types/excalidraw/keyboardShortcuts.d.ts +0 -27
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IMAGE_MIME_TYPES, UserIdleState, throttleRAF, MIME_TYPES, ColorTuple, EditorInterface, StrokeWidthKey } from "@excalidraw/common";
|
|
1
|
+
import type { IMAGE_MIME_TYPES, UserIdleState, throttleRAF, MIME_TYPES, ColorTuple, EditorInterface, StrokeWidthKey, ViewpointFlip } from "@excalidraw/common";
|
|
2
2
|
import type { LinearElementEditor } from "@excalidraw/element";
|
|
3
3
|
import type { MaybeTransformHandleType } from "@excalidraw/element";
|
|
4
4
|
import type { PointerType, ExcalidrawLinearElement, NonDeletedExcalidrawElement, NonDeleted, TextAlign, ExcalidrawElement, GroupId, ExcalidrawBindableElement, ExcalidrawArrowElement, Arrowhead, FontFamilyValues, FileId, Theme, StrokeRoundness, ExcalidrawEmbeddableElement, ExcalidrawMagicFrameElement, ExcalidrawFrameLikeElement, ExcalidrawElementType, ExcalidrawIframeLikeElement, OrderedExcalidrawElement, ExcalidrawNonSelectionElement, ArrangeAlgorithms, BindMode, ExcalidrawTextElement, StrokeVariability, ExcalidrawGifCache } from "@excalidraw/element/types";
|
|
@@ -18,6 +18,7 @@ import type { isOverScrollBars } from "./scene/scrollbars";
|
|
|
18
18
|
import type React from "react";
|
|
19
19
|
import type { JSX } from "react";
|
|
20
20
|
export type { App };
|
|
21
|
+
export type { ViewpointFlip } from "@excalidraw/common";
|
|
21
22
|
export type SocketId = string & {
|
|
22
23
|
_brand: "SocketId";
|
|
23
24
|
};
|
|
@@ -144,6 +145,7 @@ type _CommonCanvasAppState = {
|
|
|
144
145
|
scrollY: AppState["scrollY"];
|
|
145
146
|
width: AppState["width"];
|
|
146
147
|
height: AppState["height"];
|
|
148
|
+
viewpointFlip: AppState["viewpointFlip"];
|
|
147
149
|
viewModeEnabled: AppState["viewModeEnabled"];
|
|
148
150
|
openDialog: AppState["openDialog"];
|
|
149
151
|
editingGroupId: AppState["editingGroupId"];
|
|
@@ -226,12 +228,16 @@ export type ArrangePreferences = {
|
|
|
226
228
|
algorithm?: ArrangeAlgorithms;
|
|
227
229
|
gap?: number;
|
|
228
230
|
};
|
|
231
|
+
export type AlignPreferences = {
|
|
232
|
+
stacking?: boolean;
|
|
233
|
+
};
|
|
229
234
|
export type NormalisePreferences = {
|
|
230
235
|
mode?: NormaliseMode;
|
|
231
236
|
metric?: NormaliseMetric;
|
|
232
237
|
};
|
|
233
238
|
export type EditorPreferences = {
|
|
234
239
|
smartZoom?: SmartZoomPreferences;
|
|
240
|
+
align?: AlignPreferences;
|
|
235
241
|
arrange?: ArrangePreferences;
|
|
236
242
|
normalise?: NormalisePreferences;
|
|
237
243
|
};
|
|
@@ -283,6 +289,10 @@ export interface AppState {
|
|
|
283
289
|
dontResizeLimitMBs: number;
|
|
284
290
|
hideMainMenus: boolean;
|
|
285
291
|
wheelZoomsOnDefault?: boolean;
|
|
292
|
+
viewpointFlip: ViewpointFlip;
|
|
293
|
+
alignConfiguration: {
|
|
294
|
+
stacking: boolean;
|
|
295
|
+
};
|
|
286
296
|
arrangeConfiguration: {
|
|
287
297
|
algorithm: ArrangeAlgorithms;
|
|
288
298
|
gap: number;
|
|
@@ -687,12 +697,6 @@ export type UIConfig = {
|
|
|
687
697
|
};
|
|
688
698
|
export interface ExcalidrawProps {
|
|
689
699
|
className?: string;
|
|
690
|
-
/**
|
|
691
|
-
* Controlled keyboard shortcut overrides. Omitted commands retain their
|
|
692
|
-
* Excalidraw defaults; pass an empty array to disable a command. Excalidraw
|
|
693
|
-
* does not persist this value.
|
|
694
|
-
*/
|
|
695
|
-
keyboardShortcuts?: import("./keyboardShortcuts").KeyboardShortcutOverrides;
|
|
696
700
|
onChange?: (elements: readonly OrderedExcalidrawElement[], appState: AppState, files: BinaryFiles) => void;
|
|
697
701
|
onThemeChange?: (theme: Theme | "system") => void;
|
|
698
702
|
/**
|
|
@@ -1171,6 +1175,7 @@ export type FrameNameBoundsCache = {
|
|
|
1171
1175
|
get: (frameElement: ExcalidrawFrameLikeElement | ExcalidrawMagicFrameElement) => FrameNameBounds | null;
|
|
1172
1176
|
_cache: Map<string, FrameNameBounds & {
|
|
1173
1177
|
zoom: AppState["zoom"]["value"];
|
|
1178
|
+
viewpointFlip: AppState["viewpointFlip"];
|
|
1174
1179
|
versionNonce: ExcalidrawFrameLikeElement["versionNonce"];
|
|
1175
1180
|
}>;
|
|
1176
1181
|
};
|
|
@@ -105,6 +105,10 @@ export declare const zoomToFitBounds: ({ bounds, appState, canvasOffsets, fit, m
|
|
|
105
105
|
dontResizeLimitMBs: number;
|
|
106
106
|
hideMainMenus: boolean;
|
|
107
107
|
wheelZoomsOnDefault?: boolean;
|
|
108
|
+
viewpointFlip: import("@excalidraw/common").ViewpointFlip;
|
|
109
|
+
alignConfiguration: {
|
|
110
|
+
stacking: boolean;
|
|
111
|
+
};
|
|
108
112
|
arrangeConfiguration: {
|
|
109
113
|
algorithm: import("@excalidraw/element/types").ArrangeAlgorithms;
|
|
110
114
|
gap: number;
|
package/package.json
CHANGED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { ActionName } from "./actions/types";
|
|
2
|
-
type KeyboardShortcutModifiers = {
|
|
3
|
-
ctrlOrCmd?: boolean;
|
|
4
|
-
ctrl?: boolean;
|
|
5
|
-
meta?: boolean;
|
|
6
|
-
alt?: boolean;
|
|
7
|
-
shift?: boolean;
|
|
8
|
-
};
|
|
9
|
-
export type KeyboardShortcut = KeyboardShortcutModifiers & ({
|
|
10
|
-
/** `KeyboardEvent.key` (case-insensitive for single letters). */
|
|
11
|
-
key: string;
|
|
12
|
-
code?: never;
|
|
13
|
-
} | {
|
|
14
|
-
/** `KeyboardEvent.code`, useful for layout-independent shortcuts. */
|
|
15
|
-
code: string;
|
|
16
|
-
key?: never;
|
|
17
|
-
});
|
|
18
|
-
export type KeyboardShortcutCommand = ActionName | `tool:${"hand" | "selection" | "rectangle" | "diamond" | "ellipse" | "arrow" | "line" | "freedraw" | "text" | "image" | "eraser" | "frame" | "autoshape" | "embeddable" | "laser" | "bucketfill" | "lasso"}` | "toolLock" | "strokeEyeDropper" | "backgroundEyeDropper" | "helpDialog" | "imageExport" | "elementStroke" | "elementBackground" | "fontFamily";
|
|
19
|
-
/**
|
|
20
|
-
* A partial, controlled set of shortcut overrides. Missing commands retain
|
|
21
|
-
* Excalidraw's defaults; an empty array explicitly disables a command.
|
|
22
|
-
*/
|
|
23
|
-
export type KeyboardShortcutOverrides = Partial<Record<KeyboardShortcutCommand, readonly KeyboardShortcut[]>>;
|
|
24
|
-
export declare const matchesKeyboardShortcut: (event: Pick<KeyboardEvent, "key" | "code" | "ctrlKey" | "metaKey" | "altKey" | "shiftKey">, shortcut: KeyboardShortcut) => boolean;
|
|
25
|
-
export declare const matchesKeyboardShortcuts: (event: Parameters<typeof matchesKeyboardShortcut>[0], shortcuts: readonly KeyboardShortcut[]) => boolean;
|
|
26
|
-
export declare const formatKeyboardShortcut: (shortcut: KeyboardShortcut) => string;
|
|
27
|
-
export {};
|