@zsviczian/excalidraw 0.18.0-12 → 0.18.0-13
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 +49 -16
- package/dist/excalidraw.production.min.js +1 -1
- package/dist/styles.development.css +16 -0
- package/dist/styles.production.css +1 -0
- package/package.json +1 -1
- package/types/common/src/constants.d.ts +1 -0
- package/types/element/src/binding.d.ts +10 -2
- package/types/element/src/newElement.d.ts +2 -2
- package/types/element/src/typeChecks.d.ts +3 -0
- package/types/element/src/types.d.ts +3 -0
- package/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +19 -0
- package/types/excalidraw/actions/types.d.ts +2 -2
- package/types/excalidraw/components/App.d.ts +2 -0
- package/types/excalidraw/components/ConvertElementTypePopup.d.ts +49 -0
- package/types/excalidraw/components/Stats/utils.d.ts +1 -8
- package/types/excalidraw/editor-jotai.d.ts +6 -6
- package/types/excalidraw/types.d.ts +1 -0
- package/types/excalidraw/wysiwyg/textWysiwyg.d.ts +3 -1
|
@@ -1493,6 +1493,22 @@
|
|
|
1493
1493
|
.excalidraw-hyperlinkContainer__buttons {
|
|
1494
1494
|
flex: 0 0 auto;
|
|
1495
1495
|
}
|
|
1496
|
+
/*!********************************************************************************************************************************************************************************************************************!*\
|
|
1497
|
+
!*** css ../../node_modules/css-loader/dist/cjs.js!../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[2]!../../node_modules/sass-loader/dist/cjs.js!./components/ConvertElementTypePopup.scss ***!
|
|
1498
|
+
\********************************************************************************************************************************************************************************************************************/
|
|
1499
|
+
.excalidraw .ConvertElementTypePopup {
|
|
1500
|
+
display: flex;
|
|
1501
|
+
flex-wrap: wrap;
|
|
1502
|
+
justify-content: center;
|
|
1503
|
+
gap: 0.2rem;
|
|
1504
|
+
border-radius: 0.5rem;
|
|
1505
|
+
background: var(--island-bg-color);
|
|
1506
|
+
box-shadow: var(--shadow-island);
|
|
1507
|
+
padding: 0.5rem;
|
|
1508
|
+
}
|
|
1509
|
+
.excalidraw .ConvertElementTypePopup:focus {
|
|
1510
|
+
outline: none;
|
|
1511
|
+
}
|
|
1496
1512
|
/*!***************************************************************************************************************************************************************************************************************!*\
|
|
1497
1513
|
!*** css ../../node_modules/css-loader/dist/cjs.js!../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[2]!../../node_modules/sass-loader/dist/cjs.js!./components/DialogActionButton.scss ***!
|
|
1498
1514
|
\***************************************************************************************************************************************************************************************************************/
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
.excalidraw-tooltip{--ui-font: Assistant, system-ui, BlinkMacSystemFont, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;font-family:var(--ui-font);position:absolute;z-index:var(--zIndex-popup);padding:8px;border-radius:6px;box-sizing:border-box;pointer-events:none;word-wrap:break-word;background:#000;line-height:1.5;text-align:center;font-size:13px;font-weight:500;color:#fff;display:none}.excalidraw-tooltip.excalidraw-tooltip--visible{display:block}.excalidraw-tooltip-wrapper{display:flex}.excalidraw-tooltip-icon{width:.9em;height:.9em;margin-left:5px;margin-top:1px;display:flex}.excalidraw--mobile.excalidraw-tooltip-icon{display:none}
|
|
17
17
|
.excalidraw .Avatar{width:var(--avatar-size, 1.5rem);height:var(--avatar-size, 1.5rem);position:relative;border-radius:100%;outline-offset:2px;display:flex;justify-content:center;align-items:center;cursor:pointer;font-size:.75rem;font-weight:700;line-height:1;color:var(--color-gray-90);flex:0 0 auto}.excalidraw .Avatar:active{transform:scale(0.94)}.excalidraw .Avatar-img{width:100%;height:100%;border-radius:100%}.excalidraw .Avatar::before{content:"";position:absolute;top:-3px;right:-3px;bottom:-3px;left:-3px;border-radius:100%}.excalidraw .Avatar.is-followed::before{border-color:var(--color-primary-hover);box-shadow:0 0 0 1px var(--color-primary-hover)}.excalidraw .Avatar.is-current-user{cursor:auto}
|
|
18
18
|
.excalidraw-hyperlinkContainer{display:flex;align-items:center;justify-content:space-between;position:absolute;box-shadow:0px 2px 4px 0 rgba(0,0,0,.3);z-index:var(--zIndex-hyperlinkContainer);background:var(--island-bg-color);border-radius:var(--border-radius-md);box-sizing:border-box;min-height:42px}.excalidraw-hyperlinkContainer-input,.excalidraw-hyperlinkContainer button{z-index:100}.excalidraw-hyperlinkContainer-input,.excalidraw-hyperlinkContainer-link{height:24px;padding:0 8px;line-height:24px;font-size:.9rem;font-weight:500;font-family:var(--ui-font)}.excalidraw-hyperlinkContainer-input{width:18rem;border:none;background-color:rgba(0,0,0,0);color:var(--text-primary-color);outline:none;border:none;box-shadow:none !important}.excalidraw-hyperlinkContainer-link{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:15rem}.excalidraw-hyperlinkContainer button{color:#228be6;background-color:rgba(0,0,0,0) !important;font-weight:500}.excalidraw-hyperlinkContainer button.excalidraw-hyperlinkContainer--remove{color:#c92a2a}.excalidraw-hyperlinkContainer--remove .ToolIcon__icon svg{color:#fa5252}.excalidraw-hyperlinkContainer .ToolIcon__icon{width:2rem;height:2rem}.excalidraw-hyperlinkContainer__buttons{flex:0 0 auto}
|
|
19
|
+
.excalidraw .ConvertElementTypePopup{display:flex;flex-wrap:wrap;justify-content:center;gap:.2rem;border-radius:.5rem;background:var(--island-bg-color);box-shadow:var(--shadow-island);padding:.5rem}.excalidraw .ConvertElementTypePopup:focus{outline:none}
|
|
19
20
|
.excalidraw .Dialog__action-button{position:relative;display:flex;column-gap:.5rem;align-items:center;padding:.5rem 1.5rem;border:1px solid var(--default-border-color);background-color:rgba(0,0,0,0);height:3rem;border-radius:var(--border-radius-lg);letter-spacing:.4px;color:inherit;font-family:inherit;font-size:.875rem;font-weight:600;-webkit-user-select:none;user-select:none}.excalidraw .Dialog__action-button svg{display:block;width:1rem;height:1rem}.excalidraw .Dialog__action-button--danger{background-color:var(--color-danger);border-color:var(--color-danger);color:#fff}.excalidraw .Dialog__action-button--primary{background-color:var(--color-primary);border-color:var(--color-primary);color:#fff}.excalidraw.theme--dark .Dialog__action-button--danger{color:var(--color-gray-100)}.excalidraw.theme--dark .Dialog__action-button--primary{color:var(--color-gray-100)}
|
|
20
21
|
.excalidraw .confirm-dialog-buttons{display:flex;column-gap:.5rem;justify-content:flex-end}
|
|
21
22
|
.excalidraw .publish-library__fields{display:flex;flex-direction:column}.excalidraw .publish-library__fields label{padding:1em 0;display:flex;justify-content:space-between;align-items:center}.excalidraw .publish-library__fields label span{font-weight:500;font-size:1rem;color:#868e96}.excalidraw .publish-library__fields label input,.excalidraw .publish-library__fields label textarea{width:70%;padding:.6em;font-family:var(--ui-font)}.excalidraw .publish-library__fields label .required{color:#e03131;margin:.2rem}.excalidraw .publish-library__buttons{display:flex;padding:.2rem 0;justify-content:flex-end;gap:.5rem}.excalidraw .publish-library__buttons .ToolIcon__icon{min-width:2.5rem;width:auto;font-size:1rem}.excalidraw .publish-library__buttons .ToolIcon_type_button{margin-left:1rem;padding:0 .5rem}.excalidraw .publish-library__buttons--confirm.ToolIcon_type_button{background-color:#228be6}.excalidraw .publish-library__buttons--confirm.ToolIcon_type_button:hover{background-color:#1971c2}.excalidraw .publish-library__buttons--cancel.ToolIcon_type_button{background-color:#adb5bd}.excalidraw .publish-library__buttons--cancel.ToolIcon_type_button:hover{background-color:#868e96}.excalidraw .publish-library__buttons .ToolIcon__icon{color:#fff}.excalidraw .publish-library__buttons .ToolIcon__icon .Spinner{--spinner-color: #fff}.excalidraw .publish-library__buttons .ToolIcon__icon .Spinner svg{padding:.5rem}.excalidraw .publish-library .selected-library-items{display:flex;flex-wrap:wrap}.excalidraw .publish-library .selected-library-items .single-library-item-wrapper{width:9rem}.excalidraw .publish-library-warning{color:#fa5252}.excalidraw .publish-library-note{padding:1em 0;font-style:italic;font-size:14px;display:block}.excalidraw .single-library-item{position:relative}.excalidraw .single-library-item-status{position:absolute;top:.3rem;left:.3rem;font-size:.7rem;color:#f03e3e;background:rgba(255,255,255,.9);padding:.1rem .2rem;border-radius:.2rem}.excalidraw .single-library-item__svg{background-color:#fff;padding:.3rem;width:7.5rem;height:7.5rem;border:1px solid var(--button-gray-2)}.excalidraw .single-library-item__svg svg{width:100%;height:100%}.excalidraw .single-library-item .ToolIcon__icon{background-color:#fff;width:auto;height:auto;margin:0 .5rem}.excalidraw .single-library-item .ToolIcon,.excalidraw .single-library-item .ToolIcon_type_button:hover{background-color:#fff}.excalidraw .single-library-item .required,.excalidraw .single-library-item .error{color:#e03131;font-weight:700;font-size:1rem;margin:.2rem}.excalidraw .single-library-item .error{font-weight:500;margin:0;padding:.3em 0}.excalidraw .single-library-item--remove{position:absolute;top:.2rem;right:1rem}.excalidraw .single-library-item--remove .ToolIcon__icon{margin:0}.excalidraw .single-library-item--remove .ToolIcon__icon{background-color:#fa5252}.excalidraw .single-library-item--remove .ToolIcon__icon:hover{background-color:#f03e3e}.excalidraw .single-library-item--remove .ToolIcon__icon:active{background-color:#e03131}.excalidraw .single-library-item--remove svg{color:#fff;padding:.26rem;border-radius:.3em;width:1rem;height:1rem}
|
package/package.json
CHANGED
|
@@ -90,6 +90,7 @@ export declare const CLASSES: {
|
|
|
90
90
|
MOBILE_TOOLBAR: string;
|
|
91
91
|
ZOOM_ACTIONS: string;
|
|
92
92
|
SEARCH_MENU_INPUT_WRAPPER: string;
|
|
93
|
+
CONVERT_ELEMENT_TYPE_POPUP: string;
|
|
93
94
|
};
|
|
94
95
|
export declare const CJK_HAND_DRAWN_FALLBACK_FONT = "Xiaolai";
|
|
95
96
|
export declare const WINDOWS_EMOJI_FALLBACK_FONT = "Segoe UI Emoji";
|
|
@@ -5,7 +5,7 @@ import { type Heading } from "./heading";
|
|
|
5
5
|
import type Scene from "./Scene";
|
|
6
6
|
import type { Bounds } from "./bounds";
|
|
7
7
|
import type { ElementUpdate } from "./mutateElement";
|
|
8
|
-
import type { ExcalidrawBindableElement, ExcalidrawElement, NonDeleted, ExcalidrawLinearElement, NonDeletedExcalidrawElement, ElementsMap, NonDeletedSceneElementsMap,
|
|
8
|
+
import type { ExcalidrawBindableElement, ExcalidrawElement, NonDeleted, ExcalidrawLinearElement, NonDeletedExcalidrawElement, ElementsMap, NonDeletedSceneElementsMap, ExcalidrawElbowArrowElement, FixedPoint } from "./types";
|
|
9
9
|
export type SuggestedBinding = NonDeleted<ExcalidrawBindableElement> | SuggestedPointBinding;
|
|
10
10
|
export type SuggestedPointBinding = [
|
|
11
11
|
NonDeleted<ExcalidrawLinearElement>,
|
|
@@ -36,7 +36,15 @@ export declare const updateBoundElements: (changedElement: NonDeletedExcalidrawE
|
|
|
36
36
|
width: number;
|
|
37
37
|
height: number;
|
|
38
38
|
};
|
|
39
|
-
changedElements?: Map<string,
|
|
39
|
+
changedElements?: Map<string, ExcalidrawElement>;
|
|
40
|
+
}) => void;
|
|
41
|
+
export declare const updateBindings: (latestElement: ExcalidrawElement, scene: Scene, options?: {
|
|
42
|
+
simultaneouslyUpdated?: readonly ExcalidrawElement[];
|
|
43
|
+
newSize?: {
|
|
44
|
+
width: number;
|
|
45
|
+
height: number;
|
|
46
|
+
};
|
|
47
|
+
zoom?: AppState["zoom"];
|
|
40
48
|
}) => void;
|
|
41
49
|
export declare const getHeadingForElbowArrowSnap: (p: Readonly<GlobalPoint>, otherPoint: Readonly<GlobalPoint>, bindableElement: ExcalidrawBindableElement | undefined | null, aabb: Bounds | undefined | null, origPoint: GlobalPoint, zoom?: AppState["zoom"]) => Heading;
|
|
42
50
|
export declare const bindPointToSnapToElementOutline: (arrow: ExcalidrawElbowArrowElement, bindableElement: ExcalidrawBindableElement, startOrEnd: "start" | "end") => GlobalPoint;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MarkOptional } from "@excalidraw/common/utility-types";
|
|
2
|
-
import type { ExcalidrawImageElement, ExcalidrawTextElement, ExcalidrawLinearElement, ExcalidrawGenericElement, NonDeleted, TextAlign, VerticalAlign, Arrowhead, ExcalidrawFreeDrawElement, FontFamilyValues, ExcalidrawTextContainer, ExcalidrawFrameElement, ExcalidrawEmbeddableElement, ExcalidrawMagicFrameElement, ExcalidrawIframeElement, ElementsMap, ExcalidrawArrowElement,
|
|
2
|
+
import type { ExcalidrawImageElement, ExcalidrawTextElement, ExcalidrawLinearElement, ExcalidrawGenericElement, NonDeleted, TextAlign, VerticalAlign, Arrowhead, ExcalidrawFreeDrawElement, FontFamilyValues, ExcalidrawTextContainer, ExcalidrawFrameElement, ExcalidrawEmbeddableElement, ExcalidrawMagicFrameElement, ExcalidrawIframeElement, ElementsMap, ExcalidrawArrowElement, ExcalidrawElbowArrowElement } from "./types";
|
|
3
3
|
export type ElementConstructorOpts = MarkOptional<Omit<ExcalidrawGenericElement, "id" | "type" | "isDeleted" | "updated">, "width" | "height" | "angle" | "groupIds" | "frameId" | "index" | "boundElements" | "seed" | "version" | "versionNonce" | "link" | "strokeStyle" | "fillStyle" | "strokeColor" | "backgroundColor" | "roughness" | "strokeWidth" | "roundness" | "locked" | "opacity" | "customData">;
|
|
4
4
|
export declare const newElement: (opts: {
|
|
5
5
|
type: ExcalidrawGenericElement["type"];
|
|
@@ -51,7 +51,7 @@ export declare const newArrowElement: <T extends boolean>(opts: {
|
|
|
51
51
|
endArrowhead?: Arrowhead | null | undefined;
|
|
52
52
|
points?: readonly import("@excalidraw/math").LocalPoint[] | undefined;
|
|
53
53
|
elbowed?: T | undefined;
|
|
54
|
-
fixedSegments?: FixedSegment[] | null | undefined;
|
|
54
|
+
fixedSegments?: readonly import("./types").FixedSegment[] | null | undefined;
|
|
55
55
|
} & Omit<Omit<ExcalidrawGenericElement, "id" | "isDeleted" | "updated" | "type">, "link" | "angle" | "strokeColor" | "backgroundColor" | "fillStyle" | "strokeWidth" | "strokeStyle" | "roundness" | "roughness" | "opacity" | "width" | "height" | "seed" | "version" | "versionNonce" | "index" | "groupIds" | "frameId" | "boundElements" | "locked" | "customData"> & Partial<Pick<Omit<ExcalidrawGenericElement, "id" | "isDeleted" | "updated" | "type">, "link" | "angle" | "strokeColor" | "backgroundColor" | "fillStyle" | "strokeWidth" | "strokeStyle" | "roundness" | "roughness" | "opacity" | "width" | "height" | "seed" | "version" | "versionNonce" | "index" | "groupIds" | "frameId" | "boundElements" | "locked" | "customData">>) => T extends true ? NonDeleted<ExcalidrawElbowArrowElement> : NonDeleted<ExcalidrawArrowElement>;
|
|
56
56
|
export declare const newImageElement: (opts: {
|
|
57
57
|
type: ExcalidrawImageElement["type"];
|
|
@@ -16,6 +16,8 @@ export declare const isFreeDrawElementType: (elementType: ExcalidrawElementType)
|
|
|
16
16
|
export declare const isLinearElement: (element?: ExcalidrawElement | null) => element is ExcalidrawLinearElement;
|
|
17
17
|
export declare const isArrowElement: (element?: ExcalidrawElement | null) => element is ExcalidrawArrowElement;
|
|
18
18
|
export declare const isElbowArrow: (element?: ExcalidrawElement) => element is ExcalidrawElbowArrowElement;
|
|
19
|
+
export declare const isSharpArrow: (element?: ExcalidrawElement) => element is ExcalidrawArrowElement;
|
|
20
|
+
export declare const isCurvedArrow: (element?: ExcalidrawElement) => element is ExcalidrawArrowElement;
|
|
19
21
|
export declare const isLinearElementType: (elementType: ElementOrToolType) => boolean;
|
|
20
22
|
export declare const isBindingElement: (element?: ExcalidrawElement | null, includeLocked?: boolean) => element is ExcalidrawLinearElement;
|
|
21
23
|
export declare const isBindingElementType: (elementType: ElementOrToolType) => boolean;
|
|
@@ -27,6 +29,7 @@ export declare const isExcalidrawElement: (element: any) => element is Excalidra
|
|
|
27
29
|
export declare const isFlowchartNodeElement: (element: ExcalidrawElement) => element is ExcalidrawFlowchartNodeElement;
|
|
28
30
|
export declare const hasBoundTextElement: (element: ExcalidrawElement | null) => element is MarkNonNullable<ExcalidrawBindableElement, "boundElements">;
|
|
29
31
|
export declare const isBoundToContainer: (element: ExcalidrawElement | null) => element is ExcalidrawTextElementWithContainer;
|
|
32
|
+
export declare const isArrowBoundToElement: (element: ExcalidrawArrowElement) => boolean;
|
|
30
33
|
export declare const isUsingAdaptiveRadius: (type: string) => boolean;
|
|
31
34
|
export declare const isUsingProportionalRadius: (type: string) => boolean;
|
|
32
35
|
export declare const canApplyRoundnessTypeToElement: (roundnessType: RoundnessType, element: ExcalidrawElement) => boolean;
|
|
@@ -282,4 +282,7 @@ export type SceneElementsMap = Map<ExcalidrawElement["id"], Ordered<ExcalidrawEl
|
|
|
282
282
|
*/
|
|
283
283
|
export type NonDeletedSceneElementsMap = Map<ExcalidrawElement["id"], Ordered<NonDeletedExcalidrawElement>> & MakeBrand<"NonDeletedSceneElementsMap">;
|
|
284
284
|
export type ElementsMapOrArray = readonly ExcalidrawElement[] | Readonly<ElementsMap>;
|
|
285
|
+
export type ConvertibleGenericTypes = "rectangle" | "diamond" | "ellipse";
|
|
286
|
+
export type ConvertibleLinearTypes = "line" | "sharpArrow" | "curvedArrow" | "elbowArrow";
|
|
287
|
+
export type ConvertibleTypes = ConvertibleGenericTypes | ConvertibleLinearTypes;
|
|
285
288
|
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
2
|
+
export declare const actionToggleShapeSwitch: {
|
|
3
|
+
name: "toggleShapeSwitch";
|
|
4
|
+
label: string;
|
|
5
|
+
icon: () => null;
|
|
6
|
+
viewMode: true;
|
|
7
|
+
trackEvent: {
|
|
8
|
+
category: "shape_switch";
|
|
9
|
+
action: string;
|
|
10
|
+
};
|
|
11
|
+
keywords: string[];
|
|
12
|
+
perform(elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>, _: any, app: import("../types").AppClassProperties): {
|
|
13
|
+
captureUpdate: "NEVER";
|
|
14
|
+
};
|
|
15
|
+
checked: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
16
|
+
predicate: (elements: readonly ExcalidrawElement[], appState: import("../types").AppState, props: import("../types").ExcalidrawProps) => boolean;
|
|
17
|
+
} & {
|
|
18
|
+
keyTest?: undefined;
|
|
19
|
+
};
|
|
@@ -14,7 +14,7 @@ export type ActionResult = {
|
|
|
14
14
|
type ActionFn = (elements: readonly OrderedExcalidrawElement[], appState: Readonly<AppState>, formData: any, app: AppClassProperties) => ActionResult | Promise<ActionResult>;
|
|
15
15
|
export type UpdaterFn = (res: ActionResult) => void;
|
|
16
16
|
export type ActionFilterFn = (action: Action) => void;
|
|
17
|
-
export type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "objectsSnapMode" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeArrowType" | "changeOpacity" | "changeFontSize" | "toggleCanvasMenu" | "toggleEditMenu" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "clearCanvas" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToFitSelection" | "zoomToFitSelectionInViewport" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "addToLibrary" | "changeRoundness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "flipHorizontal" | "flipVertical" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "bindText" | "unlockAllElements" | "toggleElementLock" | "toggleLinearEditor" | "toggleEraserTool" | "toggleHandTool" | "selectAllElementsInFrame" | "removeAllElementsFromFrame" | "updateFrameRendering" | "setFrameAsActiveTool" | "setEmbeddableAsActiveTool" | "createContainerFromText" | "wrapTextInContainer" | "toggleLaserPointerTool" | "commandPalette" | "autoResize" | "elementStats" | "searchMenu" | "copyElementLink" | "linkToElement" | "cropEditor" | "wrapSelectionInFrame" | "toggleLassoTool";
|
|
17
|
+
export type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "objectsSnapMode" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeArrowType" | "changeOpacity" | "changeFontSize" | "toggleCanvasMenu" | "toggleEditMenu" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "clearCanvas" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToFitSelection" | "zoomToFitSelectionInViewport" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "addToLibrary" | "changeRoundness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "flipHorizontal" | "flipVertical" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "bindText" | "unlockAllElements" | "toggleElementLock" | "toggleLinearEditor" | "toggleEraserTool" | "toggleHandTool" | "selectAllElementsInFrame" | "removeAllElementsFromFrame" | "updateFrameRendering" | "setFrameAsActiveTool" | "setEmbeddableAsActiveTool" | "createContainerFromText" | "wrapTextInContainer" | "toggleLaserPointerTool" | "commandPalette" | "autoResize" | "elementStats" | "searchMenu" | "copyElementLink" | "linkToElement" | "cropEditor" | "wrapSelectionInFrame" | "toggleLassoTool" | "toggleShapeSwitch";
|
|
18
18
|
export type PanelComponentProps = {
|
|
19
19
|
elements: readonly ExcalidrawElement[];
|
|
20
20
|
appState: AppState;
|
|
@@ -35,7 +35,7 @@ export interface Action {
|
|
|
35
35
|
predicate?: (elements: readonly ExcalidrawElement[], appState: AppState, appProps: ExcalidrawProps, app: AppClassProperties) => boolean;
|
|
36
36
|
checked?: (appState: Readonly<AppState>) => boolean;
|
|
37
37
|
trackEvent: false | {
|
|
38
|
-
category: "toolbar" | "element" | "canvas" | "export" | "history" | "menu" | "collab" | "hyperlink" | "search_menu";
|
|
38
|
+
category: "toolbar" | "element" | "canvas" | "export" | "history" | "menu" | "collab" | "hyperlink" | "search_menu" | "shape_switch";
|
|
39
39
|
action?: string;
|
|
40
40
|
predicate?: (appState: Readonly<AppState>, elements: readonly ExcalidrawElement[], value: any) => boolean;
|
|
41
41
|
};
|
|
@@ -9,6 +9,7 @@ import type { Mutable } from "@excalidraw/common/utility-types";
|
|
|
9
9
|
import { ActionManager } from "../actions/manager";
|
|
10
10
|
import { AnimationFrameHandler } from "../animation-frame-handler";
|
|
11
11
|
import { Fonts } from "../fonts";
|
|
12
|
+
import { type WritableAtom } from "../editor-jotai";
|
|
12
13
|
import { Renderer } from "../scene/Renderer";
|
|
13
14
|
import { Emitter } from "../emitter";
|
|
14
15
|
import { LaserTrails } from "../laser-trails";
|
|
@@ -247,6 +248,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
247
248
|
missingPointerEventCleanupEmitter: Emitter<[event: PointerEvent | null]>;
|
|
248
249
|
onRemoveEventListenersEmitter: Emitter<[]>;
|
|
249
250
|
constructor(props: AppProps);
|
|
251
|
+
updateEditorAtom: <Value, Args extends unknown[], Result>(atom: WritableAtom<Value, Args, Result>, ...args: Args) => Result;
|
|
250
252
|
private onWindowMessage;
|
|
251
253
|
private cacheEmbeddableRef;
|
|
252
254
|
/**
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { ConvertibleGenericTypes, ConvertibleLinearTypes, ConvertibleTypes, ExcalidrawElbowArrowElement, ExcalidrawElement, ExcalidrawLinearElement, ExcalidrawTextContainer, ExcalidrawTextElementWithContainer } from "@excalidraw/element/types";
|
|
2
|
+
import type Scene from "@excalidraw/element/Scene";
|
|
3
|
+
import "./ConvertElementTypePopup.scss";
|
|
4
|
+
import type App from "./App";
|
|
5
|
+
export declare const convertElementTypePopupAtom: import("jotai/vanilla/atom").PrimitiveAtom<{
|
|
6
|
+
type: "panel";
|
|
7
|
+
} | null> & {
|
|
8
|
+
init: {
|
|
9
|
+
type: "panel";
|
|
10
|
+
} | null;
|
|
11
|
+
};
|
|
12
|
+
export declare const fontSize_conversionCacheAtom: import("jotai/vanilla/atom").PrimitiveAtom<{
|
|
13
|
+
[id: string]: {
|
|
14
|
+
fontSize: number;
|
|
15
|
+
elementType: ConvertibleGenericTypes;
|
|
16
|
+
};
|
|
17
|
+
} | null> & {
|
|
18
|
+
init: {
|
|
19
|
+
[id: string]: {
|
|
20
|
+
fontSize: number;
|
|
21
|
+
elementType: ConvertibleGenericTypes;
|
|
22
|
+
};
|
|
23
|
+
} | null;
|
|
24
|
+
};
|
|
25
|
+
export declare const linearElement_conversionCacheAtom: import("jotai/vanilla/atom").PrimitiveAtom<{
|
|
26
|
+
[id: string]: {
|
|
27
|
+
properties: Partial<ExcalidrawLinearElement> | Partial<ExcalidrawElbowArrowElement>;
|
|
28
|
+
initialType: ConvertibleLinearTypes;
|
|
29
|
+
};
|
|
30
|
+
} | null> & {
|
|
31
|
+
init: {
|
|
32
|
+
[id: string]: {
|
|
33
|
+
properties: Partial<ExcalidrawLinearElement> | Partial<ExcalidrawElbowArrowElement>;
|
|
34
|
+
initialType: ConvertibleLinearTypes;
|
|
35
|
+
};
|
|
36
|
+
} | null;
|
|
37
|
+
};
|
|
38
|
+
declare const ConvertElementTypePopup: ({ app }: {
|
|
39
|
+
app: App;
|
|
40
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
export declare const adjustBoundTextSize: (container: ExcalidrawTextContainer, boundText: ExcalidrawTextElementWithContainer, scene: Scene) => void;
|
|
42
|
+
type ConversionType = "generic" | "linear" | null;
|
|
43
|
+
export declare const convertElementTypes: (app: App, { conversionType, nextType, direction, }: {
|
|
44
|
+
conversionType: ConversionType;
|
|
45
|
+
nextType?: ConvertibleTypes | undefined;
|
|
46
|
+
direction?: "left" | "right" | undefined;
|
|
47
|
+
}) => boolean;
|
|
48
|
+
export declare const getConversionTypeFromElements: (elements: ExcalidrawElement[]) => ConversionType;
|
|
49
|
+
export default ConvertElementTypePopup;
|
|
@@ -3,6 +3,7 @@ import type Scene from "@excalidraw/element/Scene";
|
|
|
3
3
|
import type { AppState } from "../../types";
|
|
4
4
|
export type StatsInputProperty = "x" | "y" | "width" | "height" | "angle" | "fontSize" | "gridStep" | "gridSize";
|
|
5
5
|
export declare const SMALLEST_DELTA = 0.01;
|
|
6
|
+
export declare const STEP_SIZE = 10;
|
|
6
7
|
export declare const isPropertyEditable: (element: ExcalidrawElement, property: keyof ExcalidrawElement) => boolean;
|
|
7
8
|
export declare const getStepSizedValue: (value: number, stepSize: number) => number;
|
|
8
9
|
export type AtomicUnit = Record<string, true>;
|
|
@@ -16,11 +17,3 @@ export declare const newOrigin: (x1: number, y1: number, w1: number, h1: number,
|
|
|
16
17
|
};
|
|
17
18
|
export declare const moveElement: (newTopLeftX: number, newTopLeftY: number, originalElement: ExcalidrawElement, scene: Scene, originalElementsMap: ElementsMap, shouldInformMutation?: boolean) => void;
|
|
18
19
|
export declare const getAtomicUnits: (targetElements: readonly ExcalidrawElement[], appState: AppState) => AtomicUnit[];
|
|
19
|
-
export declare const updateBindings: (latestElement: ExcalidrawElement, scene: Scene, options?: {
|
|
20
|
-
simultaneouslyUpdated?: readonly ExcalidrawElement[];
|
|
21
|
-
newSize?: {
|
|
22
|
-
width: number;
|
|
23
|
-
height: number;
|
|
24
|
-
};
|
|
25
|
-
zoom?: AppState["zoom"];
|
|
26
|
-
}) => void;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { atom, createStore, type PrimitiveAtom } from "jotai";
|
|
1
|
+
import { atom, createStore, type PrimitiveAtom, type WritableAtom } from "jotai";
|
|
2
2
|
import { createIsolation } from "jotai-scope";
|
|
3
|
-
export { atom, PrimitiveAtom };
|
|
3
|
+
export { atom, PrimitiveAtom, WritableAtom };
|
|
4
4
|
export declare const useAtom: typeof import("jotai").useAtom, useSetAtom: typeof import("jotai").useSetAtom, useAtomValue: typeof import("jotai").useAtomValue, useStore: (options?: {
|
|
5
5
|
store?: {
|
|
6
6
|
get: <Value>(atom: import("jotai").Atom<Value>) => Value;
|
|
7
|
-
set: <Value_1, Args extends unknown[], Result>(atom:
|
|
7
|
+
set: <Value_1, Args extends unknown[], Result>(atom: WritableAtom<Value_1, Args, Result>, ...args: Args) => Result;
|
|
8
8
|
sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
|
|
9
9
|
} | ({
|
|
10
10
|
get: <Value_2>(atom: import("jotai").Atom<Value_2>) => Value_2;
|
|
11
|
-
set: <Value_1_1, Args_1 extends unknown[], Result_1>(atom:
|
|
11
|
+
set: <Value_1_1, Args_1 extends unknown[], Result_1>(atom: WritableAtom<Value_1_1, Args_1, Result_1>, ...args: Args_1) => Result_1;
|
|
12
12
|
sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
|
|
13
13
|
} & {
|
|
14
14
|
dev4_get_internal_weak_map: () => WeakMap<import("jotai").Atom<unknown>, {
|
|
@@ -29,11 +29,11 @@ export declare const useAtom: typeof import("jotai").useAtom, useSetAtom: typeof
|
|
|
29
29
|
}) | undefined;
|
|
30
30
|
} | undefined) => {
|
|
31
31
|
get: <Value_3>(atom: import("jotai").Atom<Value_3>) => Value_3;
|
|
32
|
-
set: <Value_1_2, Args_2 extends unknown[], Result_2>(atom:
|
|
32
|
+
set: <Value_1_2, Args_2 extends unknown[], Result_2>(atom: WritableAtom<Value_1_2, Args_2, Result_2>, ...args: Args_2) => Result_2;
|
|
33
33
|
sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
|
|
34
34
|
} | ({
|
|
35
35
|
get: <Value_4>(atom: import("jotai").Atom<Value_4>) => Value_4;
|
|
36
|
-
set: <Value_1_3, Args_3 extends unknown[], Result_3>(atom:
|
|
36
|
+
set: <Value_1_3, Args_3 extends unknown[], Result_3>(atom: WritableAtom<Value_1_3, Args_3, Result_3>, ...args: Args_3) => Result_3;
|
|
37
37
|
sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
|
|
38
38
|
} & {
|
|
39
39
|
dev4_get_internal_weak_map: () => WeakMap<import("jotai").Atom<unknown>, {
|
|
@@ -605,6 +605,7 @@ export type AppClassProperties = {
|
|
|
605
605
|
visibleElements: App["visibleElements"];
|
|
606
606
|
excalidrawContainerValue: App["excalidrawContainerValue"];
|
|
607
607
|
onPointerUpEmitter: App["onPointerUpEmitter"];
|
|
608
|
+
updateEditorAtom: App["updateEditorAtom"];
|
|
608
609
|
};
|
|
609
610
|
export type PointerDownState = Readonly<{
|
|
610
611
|
origin: Readonly<{
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ExcalidrawElement, ExcalidrawTextElement } from "@excalidraw/element/types";
|
|
2
2
|
import type App from "../components/App";
|
|
3
|
+
type SubmitHandler = () => void;
|
|
3
4
|
export declare const textWysiwyg: ({ id, onChange, onSubmit, getViewportCoords, element, canvas, excalidrawContainer, app, autoSelect, }: {
|
|
4
5
|
id: ExcalidrawElement["id"];
|
|
5
6
|
/**
|
|
@@ -19,4 +20,5 @@ export declare const textWysiwyg: ({ id, onChange, onSubmit, getViewportCoords,
|
|
|
19
20
|
excalidrawContainer: HTMLDivElement | null;
|
|
20
21
|
app: App;
|
|
21
22
|
autoSelect?: boolean | undefined;
|
|
22
|
-
}) =>
|
|
23
|
+
}) => SubmitHandler;
|
|
24
|
+
export {};
|