@excalidraw/common 0.18.0-063e025 → 0.18.0-1acf66e
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 +9 -5
- package/dist/dev/index.js.map +2 -2
- package/dist/prod/index.js +3 -3
- package/dist/types/common/src/constants.d.ts +2 -0
- package/dist/types/common/src/points.d.ts +1 -1
- package/dist/types/common/src/utils.d.ts +1 -1
- package/dist/types/element/src/arrowEndpointText.d.ts +49 -0
- package/dist/types/element/src/arrows/focus.d.ts +5 -2
- package/dist/types/element/src/binding.d.ts +12 -3
- package/dist/types/element/src/comparisons.d.ts +4 -4
- package/dist/types/element/src/convertToShape.d.ts +23 -0
- package/dist/types/element/src/dragElements.d.ts +27 -0
- package/dist/types/element/src/flowchart.d.ts +6 -6
- package/dist/types/element/src/groups.d.ts +1 -1
- package/dist/types/element/src/index.d.ts +2 -0
- package/dist/types/element/src/linearElementEditor.d.ts +7 -0
- package/dist/types/element/src/newElement.d.ts +13 -0
- package/dist/types/element/src/selection.d.ts +1 -1
- package/dist/types/element/src/textElement.d.ts +6 -3
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +15 -3
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +10 -2
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +99 -565
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +10 -2
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +16 -3
- package/dist/types/excalidraw/actions/actionDeselect.d.ts +2 -1
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +10 -2
- package/dist/types/excalidraw/actions/actionExport.d.ts +15 -7
- package/dist/types/excalidraw/actions/actionFrame.d.ts +15 -178
- package/dist/types/excalidraw/actions/actionGroup.d.ts +10 -2
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +6 -1
- package/dist/types/excalidraw/actions/actionLink.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionMenu.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionProperties.d.ts +10 -2
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionStyles.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +6 -2
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +5 -1
- package/dist/types/excalidraw/actions/index.d.ts +0 -1
- package/dist/types/excalidraw/actions/manager.d.ts +1 -0
- package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
- package/dist/types/excalidraw/actions/types.d.ts +5 -1
- package/dist/types/excalidraw/appState.d.ts +5 -5
- package/dist/types/excalidraw/components/Actions.d.ts +16 -10
- package/dist/types/excalidraw/components/App.arrowText.d.ts +72 -0
- package/dist/types/excalidraw/components/App.cursor.d.ts +31 -0
- package/dist/types/excalidraw/components/App.d.ts +322 -76
- package/dist/types/excalidraw/components/App.drawshape.d.ts +55 -0
- package/dist/types/excalidraw/components/App.flowchart.d.ts +21 -0
- package/dist/types/excalidraw/components/App.viewport.d.ts +73 -0
- package/dist/types/excalidraw/components/{ToolButton.d.ts → IconButton.d.ts} +16 -19
- package/dist/types/excalidraw/components/LaserPointerButton.d.ts +2 -4
- package/dist/types/excalidraw/components/LayerUI.d.ts +4 -2
- package/dist/types/excalidraw/components/LockButton.d.ts +3 -4
- package/dist/types/excalidraw/components/MagicButton.d.ts +0 -2
- package/dist/types/excalidraw/components/MobileMenu.d.ts +4 -4
- package/dist/types/excalidraw/components/MobileToolbar.d.ts +9 -0
- package/dist/types/excalidraw/components/PenModeButton.d.ts +2 -5
- package/dist/types/excalidraw/components/Popover.d.ts +1 -3
- package/dist/types/excalidraw/components/{ButtonIcon.d.ts → RadioButton.d.ts} +2 -5
- package/dist/types/excalidraw/components/ToolPopover.d.ts +3 -6
- package/dist/types/excalidraw/components/Toolbar.d.ts +11 -0
- package/dist/types/excalidraw/components/Tools.d.ts +145 -0
- package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +2 -0
- package/dist/types/excalidraw/components/footer/Footer.d.ts +3 -1
- package/dist/types/excalidraw/components/icons.d.ts +1 -1
- package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +1 -1
- package/dist/types/excalidraw/components/positionElementBesideCursor.d.ts +26 -0
- package/dist/types/excalidraw/components/shapeActionPredicates.d.ts +39 -0
- package/dist/types/excalidraw/data/blob.d.ts +20 -12
- package/dist/types/excalidraw/data/json.d.ts +10 -6
- package/dist/types/excalidraw/drawShapeTrail.d.ts +16 -0
- package/dist/types/excalidraw/scene/types.d.ts +3 -0
- package/dist/types/excalidraw/types.d.ts +199 -13
- package/dist/types/excalidraw/viewport.d.ts +20 -64
- package/dist/types/laser-pointer/src/state.d.ts +1 -0
- package/dist/types/math/src/index.d.ts +1 -0
- package/dist/types/math/src/pca.d.ts +79 -0
- package/dist/types/math/src/polygon.d.ts +25 -1
- package/package.json +1 -1
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +0 -173
- package/dist/types/excalidraw/components/HandButton.d.ts +0 -10
- package/dist/types/excalidraw/components/MobileToolBar.d.ts +0 -10
- package/dist/types/excalidraw/components/shapes.d.ts +0 -270
- package/dist/types/excalidraw/cursor.d.ts +0 -5
- package/dist/types/excalidraw/scene/zoom.d.ts +0 -12
package/dist/dev/index.js
CHANGED
|
@@ -1866,6 +1866,7 @@ var TEXT_ALIGN = {
|
|
|
1866
1866
|
RIGHT: "right"
|
|
1867
1867
|
};
|
|
1868
1868
|
var ELEMENT_READY_TO_ERASE_OPACITY = 20;
|
|
1869
|
+
var ELEMENT_PENDING_DRAW_SHAPE_OPACITY = 70;
|
|
1869
1870
|
var DEFAULT_PROPORTIONAL_RADIUS = 0.25;
|
|
1870
1871
|
var DEFAULT_ADAPTIVE_RADIUS = 32;
|
|
1871
1872
|
var ROUNDNESS = {
|
|
@@ -1949,7 +1950,8 @@ var TOOL_TYPE = {
|
|
|
1949
1950
|
frame: "frame",
|
|
1950
1951
|
magicframe: "magicframe",
|
|
1951
1952
|
embeddable: "embeddable",
|
|
1952
|
-
laser: "laser"
|
|
1953
|
+
laser: "laser",
|
|
1954
|
+
autoshape: "autoshape"
|
|
1953
1955
|
};
|
|
1954
1956
|
var EDITOR_LS_KEYS = {
|
|
1955
1957
|
OAI_API_KEY: "excalidraw-oai-api-key",
|
|
@@ -2362,6 +2364,7 @@ var shouldRotateWithDiscreteAngle = (event) => event.shiftKey;
|
|
|
2362
2364
|
// src/points.ts
|
|
2363
2365
|
init_define_import_meta_env();
|
|
2364
2366
|
import {
|
|
2367
|
+
pointFrom,
|
|
2365
2368
|
pointFromPair
|
|
2366
2369
|
} from "@excalidraw/math";
|
|
2367
2370
|
var getSizeFromPoints = (points) => {
|
|
@@ -2406,12 +2409,12 @@ var rescalePoints = (dimension, newSize, points, normalize) => {
|
|
|
2406
2409
|
};
|
|
2407
2410
|
var getGridPoint = (x, y, gridSize) => {
|
|
2408
2411
|
if (gridSize) {
|
|
2409
|
-
return
|
|
2412
|
+
return pointFrom(
|
|
2410
2413
|
Math.round(x / gridSize) * gridSize,
|
|
2411
2414
|
Math.round(y / gridSize) * gridSize
|
|
2412
|
-
|
|
2415
|
+
);
|
|
2413
2416
|
}
|
|
2414
|
-
return
|
|
2417
|
+
return pointFrom(x, y);
|
|
2415
2418
|
};
|
|
2416
2419
|
|
|
2417
2420
|
// src/promise-pool.ts
|
|
@@ -2637,7 +2640,7 @@ var updateActiveTool = (appState, data) => {
|
|
|
2637
2640
|
}
|
|
2638
2641
|
return {
|
|
2639
2642
|
...appState.activeTool,
|
|
2640
|
-
lastActiveTool: data.
|
|
2643
|
+
lastActiveTool: data.lastActiveTool === void 0 ? appState.activeTool.lastActiveTool : data.lastActiveTool,
|
|
2641
2644
|
type: data.type,
|
|
2642
2645
|
customType: null,
|
|
2643
2646
|
locked: data.locked ?? appState.activeTool.locked,
|
|
@@ -3541,6 +3544,7 @@ export {
|
|
|
3541
3544
|
Debug,
|
|
3542
3545
|
EDITOR_LS_KEYS,
|
|
3543
3546
|
ELEMENT_LINK_KEY,
|
|
3547
|
+
ELEMENT_PENDING_DRAW_SHAPE_OPACITY,
|
|
3544
3548
|
ELEMENT_READY_TO_ERASE_OPACITY,
|
|
3545
3549
|
ELEMENT_SHIFT_TRANSLATE_AMOUNT,
|
|
3546
3550
|
ELEMENT_TRANSLATE_AMOUNT,
|