@excalidraw/excalidraw 0.18.0-rc.3 → 0.18.0-rc.4
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/README.md +3 -2
- package/dist/dev/{chunk-CI27YPGF.js → chunk-3O3BNMYV.js} +71 -8
- package/dist/dev/chunk-3O3BNMYV.js.map +7 -0
- package/dist/dev/data/{image-TC7JM54G.js → image-EN763OZS.js} +2 -2
- package/dist/dev/index.js +7 -5
- package/dist/dev/index.js.map +3 -3
- package/dist/prod/{chunk-FZ2HZXXI.js → chunk-ELWWJGPE.js} +16 -16
- package/dist/prod/data/{image-QTHH6XLL.js → image-XQM6YLGO.js} +1 -1
- package/dist/prod/index.js +9 -9
- package/dist/types/excalidraw/actions/actionAlign.d.ts +12 -12
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +13 -13
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +4 -4
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionDistribute.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionExport.d.ts +8 -8
- package/dist/types/excalidraw/actions/actionFinalize.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionFlip.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionFrame.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionGroup.d.ts +4 -4
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionLink.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionMenu.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionNavigate.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionProperties.d.ts +16 -16
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionStyles.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionZindex.d.ts +8 -8
- package/dist/types/excalidraw/actions/manager.d.ts +1 -1
- package/dist/types/excalidraw/components/Actions.d.ts +6 -7
- package/dist/types/excalidraw/components/ActiveConfirmDialog.d.ts +1 -2
- package/dist/types/excalidraw/components/App.d.ts +1 -1
- package/dist/types/excalidraw/components/Avatar.d.ts +1 -1
- package/dist/types/excalidraw/components/BraveMeasureTextError.d.ts +1 -2
- package/dist/types/excalidraw/components/Button.d.ts +1 -1
- package/dist/types/excalidraw/components/ButtonIcon.d.ts +1 -1
- package/dist/types/excalidraw/components/ButtonIconCycle.d.ts +2 -2
- package/dist/types/excalidraw/components/ButtonIconSelect.d.ts +2 -2
- package/dist/types/excalidraw/components/ButtonSelect.d.ts +1 -2
- package/dist/types/excalidraw/components/ButtonSeparator.d.ts +1 -2
- package/dist/types/excalidraw/components/ColorPicker/ColorInput.d.ts +1 -2
- package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +1 -2
- package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +1 -2
- package/dist/types/excalidraw/components/ColorPicker/HotkeyLabel.d.ts +1 -2
- package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +1 -1
- package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +1 -2
- package/dist/types/excalidraw/components/ColorPicker/PickerHeading.d.ts +1 -1
- package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +1 -2
- package/dist/types/excalidraw/components/ColorPicker/TopPicks.d.ts +1 -2
- package/dist/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +1 -2
- package/dist/types/excalidraw/components/ConfirmDialog.d.ts +1 -2
- package/dist/types/excalidraw/components/ContextMenu.d.ts +1 -1
- package/dist/types/excalidraw/components/DarkModeToggle.d.ts +1 -2
- package/dist/types/excalidraw/components/DefaultSidebar.d.ts +1 -1
- package/dist/types/excalidraw/components/Dialog.d.ts +1 -1
- package/dist/types/excalidraw/components/DialogActionButton.d.ts +1 -1
- package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +1 -2
- package/dist/types/excalidraw/components/ErrorDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +1 -1
- package/dist/types/excalidraw/components/FixedSideContainer.d.ts +1 -1
- package/dist/types/excalidraw/components/FollowMode/FollowMode.d.ts +1 -2
- package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +2 -2
- package/dist/types/excalidraw/components/FontPicker/FontPickerList.d.ts +2 -1
- package/dist/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +1 -2
- package/dist/types/excalidraw/components/FontPicker/keyboardNavHandlers.d.ts +1 -1
- package/dist/types/excalidraw/components/HandButton.d.ts +1 -2
- package/dist/types/excalidraw/components/HelpButton.d.ts +1 -2
- package/dist/types/excalidraw/components/HelpDialog.d.ts +1 -2
- package/dist/types/excalidraw/components/HintViewer.d.ts +1 -2
- package/dist/types/excalidraw/components/IconPicker.d.ts +2 -2
- package/dist/types/excalidraw/components/ImageExportDialog.d.ts +2 -3
- package/dist/types/excalidraw/components/InitializeApp.d.ts +1 -1
- package/dist/types/excalidraw/components/InlineIcon.d.ts +1 -2
- package/dist/types/excalidraw/components/JSONExportDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/LaserPointerButton.d.ts +1 -2
- package/dist/types/excalidraw/components/LayerUI.d.ts +1 -1
- package/dist/types/excalidraw/components/LibraryMenu.d.ts +1 -1
- package/dist/types/excalidraw/components/LibraryMenuBrowseButton.d.ts +1 -2
- package/dist/types/excalidraw/components/LibraryMenuControlButtons.d.ts +1 -2
- package/dist/types/excalidraw/components/LibraryMenuHeaderContent.d.ts +1 -1
- package/dist/types/excalidraw/components/LibraryMenuItems.d.ts +1 -2
- package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +2 -2
- package/dist/types/excalidraw/components/LibraryUnit.d.ts +2 -2
- package/dist/types/excalidraw/components/LockButton.d.ts +1 -2
- package/dist/types/excalidraw/components/MagicButton.d.ts +2 -2
- package/dist/types/excalidraw/components/MobileMenu.d.ts +2 -1
- package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirm.d.ts +4 -4
- package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirmActions.d.ts +6 -6
- package/dist/types/excalidraw/components/Paragraph.d.ts +1 -2
- package/dist/types/excalidraw/components/PasteChartDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/PenModeButton.d.ts +1 -2
- package/dist/types/excalidraw/components/Popover.d.ts +1 -1
- package/dist/types/excalidraw/components/ProjectName.d.ts +1 -2
- package/dist/types/excalidraw/components/PublishLibrary.d.ts +1 -2
- package/dist/types/excalidraw/components/RadioGroup.d.ts +1 -1
- package/dist/types/excalidraw/components/Range.d.ts +1 -2
- package/dist/types/excalidraw/components/SVGLayer.d.ts +1 -2
- package/dist/types/excalidraw/components/ScrollableList.d.ts +1 -1
- package/dist/types/excalidraw/components/SearchMenu.d.ts +1 -2
- package/dist/types/excalidraw/components/ShareableLinkDialog.d.ts +1 -2
- package/dist/types/excalidraw/components/Sidebar/Sidebar.d.ts +6 -6
- package/dist/types/excalidraw/components/Sidebar/SidebarHeader.d.ts +1 -2
- package/dist/types/excalidraw/components/Sidebar/SidebarTab.d.ts +1 -1
- package/dist/types/excalidraw/components/Sidebar/SidebarTabTrigger.d.ts +1 -1
- package/dist/types/excalidraw/components/Sidebar/SidebarTabTriggers.d.ts +1 -1
- package/dist/types/excalidraw/components/Sidebar/SidebarTabs.d.ts +1 -1
- package/dist/types/excalidraw/components/Sidebar/SidebarTrigger.d.ts +1 -2
- package/dist/types/excalidraw/components/Sidebar/common.d.ts +1 -0
- package/dist/types/excalidraw/components/Spinner.d.ts +1 -2
- package/dist/types/excalidraw/components/Stack.d.ts +2 -3
- package/dist/types/excalidraw/components/Stats/Angle.d.ts +1 -2
- package/dist/types/excalidraw/components/Stats/CanvasGrid.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/Collapsible.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/Dimension.d.ts +1 -2
- package/dist/types/excalidraw/components/Stats/DragInput.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/FontSize.d.ts +1 -2
- package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +1 -2
- package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +1 -2
- package/dist/types/excalidraw/components/Stats/MultiFontSize.d.ts +1 -2
- package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +1 -2
- package/dist/types/excalidraw/components/Stats/Position.d.ts +1 -2
- package/dist/types/excalidraw/components/Stats/index.d.ts +4 -4
- package/dist/types/excalidraw/components/Switch.d.ts +1 -2
- package/dist/types/excalidraw/components/TTDDialog/MermaidToExcalidraw.d.ts +1 -2
- package/dist/types/excalidraw/components/TTDDialog/TTDDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogInput.d.ts +1 -1
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +2 -2
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogPanel.d.ts +1 -1
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogPanels.d.ts +1 -1
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogSubmitShortcut.d.ts +1 -2
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTab.d.ts +1 -1
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabTrigger.d.ts +1 -1
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabTriggers.d.ts +1 -1
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabs.d.ts +1 -1
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +2 -1
- package/dist/types/excalidraw/components/TTDDialog/common.d.ts +1 -1
- package/dist/types/excalidraw/components/Toast.d.ts +1 -1
- package/dist/types/excalidraw/components/Tooltip.d.ts +1 -1
- package/dist/types/excalidraw/components/UserList.d.ts +1 -1
- package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +2 -2
- package/dist/types/excalidraw/components/canvases/NewElementCanvas.d.ts +1 -2
- package/dist/types/excalidraw/components/canvases/StaticCanvas.d.ts +1 -1
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +11 -11
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +1 -1
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuGroup.d.ts +1 -1
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +4 -3
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContent.d.ts +2 -2
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +1 -1
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCustom.d.ts +1 -1
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemLink.d.ts +2 -1
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSeparator.d.ts +1 -2
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuTrigger.d.ts +1 -1
- package/dist/types/excalidraw/components/dropdownMenu/dropdownMenuUtils.d.ts +2 -2
- package/dist/types/excalidraw/components/footer/Footer.d.ts +1 -2
- package/dist/types/excalidraw/components/footer/FooterCenter.d.ts +1 -2
- package/dist/types/excalidraw/components/hyperlink/Hyperlink.d.ts +1 -2
- package/dist/types/excalidraw/components/icons.d.ts +178 -178
- package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +1 -1
- package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +12 -13
- package/dist/types/excalidraw/components/main-menu/MainMenu.d.ts +9 -9
- package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Center.d.ts +10 -10
- package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Hints.d.ts +3 -4
- package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.d.ts +15 -15
- package/dist/types/excalidraw/element/ElementCanvasButtons.d.ts +1 -2
- package/dist/types/excalidraw/element/types.d.ts +1 -1
- package/dist/types/excalidraw/fonts/FontMetadata.d.ts +1 -1
- package/dist/types/excalidraw/hooks/useOutsideClick.d.ts +1 -1
- package/dist/types/excalidraw/hooks/useScrollPosition.d.ts +1 -1
- package/dist/types/excalidraw/index.d.ts +1 -1
- package/dist/types/excalidraw/shapes.d.ts +10 -11
- package/dist/types/excalidraw/types.d.ts +1 -0
- package/package.json +5 -5
- package/dist/dev/chunk-CI27YPGF.js.map +0 -7
- /package/dist/dev/data/{image-TC7JM54G.js.map → image-EN763OZS.js.map} +0 -0
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ yarn add react react-dom @excalidraw/excalidraw
|
|
|
16
16
|
|
|
17
17
|
#### Self-hosting fonts
|
|
18
18
|
|
|
19
|
-
By default,
|
|
19
|
+
By default, Excalidraw will try to download all the used fonts from the [CDN](https://esm.run/@excalidraw/excalidraw/dist/prod).
|
|
20
20
|
|
|
21
21
|
For self-hosting purposes, you'll have to copy the content of the folder `node_modules/@excalidraw/excalidraw/dist/prod/fonts` to the path where your assets should be served from (i.e. `public/` directory in your project). In that case, you should also set `window.EXCALIDRAW_ASSET_PATH` to the very same path, i.e. `/` in case it's in the root:
|
|
22
22
|
|
|
@@ -30,7 +30,8 @@ Excalidraw takes _100%_ of `width` and `height` of the containing block so make
|
|
|
30
30
|
|
|
31
31
|
## Demo
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
<!-- // TODO_V18: temp -->
|
|
34
|
+
Go to [CodeSandbox](https://codesandbox.io/p/sandbox/github/excalidraw/excalidraw/tree/mrazator/release-v18/examples/with-script-in-browser) example.
|
|
34
35
|
|
|
35
36
|
## Integration
|
|
36
37
|
|
|
@@ -14726,6 +14726,16 @@ var _newElementBase = (type, {
|
|
|
14726
14726
|
locked = DEFAULT_ELEMENT_PROPS.locked,
|
|
14727
14727
|
...rest
|
|
14728
14728
|
}) => {
|
|
14729
|
+
if (x < -1e6 || x > 1e6 || y < -1e6 || y > 1e6 || width < -1e6 || width > 1e6 || height < -1e6 || height > 1e6) {
|
|
14730
|
+
console.error("New element size or position is too large", {
|
|
14731
|
+
x,
|
|
14732
|
+
y,
|
|
14733
|
+
width,
|
|
14734
|
+
height,
|
|
14735
|
+
// @ts-ignore
|
|
14736
|
+
points: rest.points
|
|
14737
|
+
});
|
|
14738
|
+
}
|
|
14729
14739
|
const element = {
|
|
14730
14740
|
id: rest.id || randomId(),
|
|
14731
14741
|
type,
|
|
@@ -18660,6 +18670,12 @@ var restoreElementWithProperties = (element, extra) => {
|
|
|
18660
18670
|
if ("customData" in element || "customData" in extra) {
|
|
18661
18671
|
base.customData = "customData" in extra ? extra.customData : element.customData;
|
|
18662
18672
|
}
|
|
18673
|
+
if (element.x < -1e6 || element.x > 1e6 || element.y < -1e6 || element.y > 1e6 || element.width < -1e6 || element.width > 1e6 || element.height < -1e6 || element.height > 1e6) {
|
|
18674
|
+
console.error(
|
|
18675
|
+
"Restore element with properties size or position is too large",
|
|
18676
|
+
{ element }
|
|
18677
|
+
);
|
|
18678
|
+
}
|
|
18663
18679
|
return {
|
|
18664
18680
|
// spread the original element properties to not lose unknown ones
|
|
18665
18681
|
// for forward-compatibility
|
|
@@ -18671,6 +18687,9 @@ var restoreElementWithProperties = (element, extra) => {
|
|
|
18671
18687
|
};
|
|
18672
18688
|
};
|
|
18673
18689
|
var restoreElement = (element) => {
|
|
18690
|
+
if (element.x < -1e6 || element.x > 1e6 || element.y < -1e6 || element.y > 1e6 || element.width < -1e6 || element.width > 1e6 || element.height < -1e6 || element.height > 1e6) {
|
|
18691
|
+
console.error("Restore element size or position is too large", { element });
|
|
18692
|
+
}
|
|
18674
18693
|
switch (element.type) {
|
|
18675
18694
|
case "text":
|
|
18676
18695
|
let fontSize = element.fontSize;
|
|
@@ -20979,7 +20998,7 @@ var BinaryHeap = class {
|
|
|
20979
20998
|
var DEDUP_TRESHOLD = 1;
|
|
20980
20999
|
var BASE_PADDING = 40;
|
|
20981
21000
|
var handleSegmentRenormalization = (arrow, elementsMap) => {
|
|
20982
|
-
const nextFixedSegments = arrow.fixedSegments ?
|
|
21001
|
+
const nextFixedSegments = arrow.fixedSegments ? arrow.fixedSegments.slice() : null;
|
|
20983
21002
|
if (nextFixedSegments) {
|
|
20984
21003
|
const _nextPoints = [];
|
|
20985
21004
|
arrow.points.map((p) => pointFrom(arrow.x + p[0], arrow.y + p[1])).forEach((p, i, points) => {
|
|
@@ -21505,10 +21524,30 @@ var handleEndpointDrag = (arrow, updatedPoints, fixedSegments, startHeading, end
|
|
|
21505
21524
|
endIsSpecial
|
|
21506
21525
|
);
|
|
21507
21526
|
};
|
|
21527
|
+
var MAX_POS = 1e6;
|
|
21508
21528
|
var updateElbowArrowPoints = (arrow, elementsMap, updates, options) => {
|
|
21509
21529
|
if (arrow.points.length < 2) {
|
|
21510
21530
|
return { points: updates.points ?? arrow.points };
|
|
21511
21531
|
}
|
|
21532
|
+
if (arrow.x < -MAX_POS || arrow.x > MAX_POS || arrow.y < -MAX_POS || arrow.y > MAX_POS || arrow.x + (updates?.points?.[updates?.points?.length - 1]?.[0] ?? 0) < -MAX_POS || arrow.x + (updates?.points?.[updates?.points?.length - 1]?.[0] ?? 0) > MAX_POS || arrow.y + (updates?.points?.[updates?.points?.length - 1]?.[1] ?? 0) < -MAX_POS || arrow.y + (updates?.points?.[updates?.points?.length - 1]?.[1] ?? 0) > MAX_POS || arrow.x + (arrow?.points?.[arrow?.points?.length - 1]?.[0] ?? 0) < -MAX_POS || arrow.x + (arrow?.points?.[arrow?.points?.length - 1]?.[0] ?? 0) > MAX_POS || arrow.y + (arrow?.points?.[arrow?.points?.length - 1]?.[1] ?? 0) < -MAX_POS || arrow.y + (arrow?.points?.[arrow?.points?.length - 1]?.[1] ?? 0) > MAX_POS) {
|
|
21533
|
+
console.error(
|
|
21534
|
+
"Elbow arrow (or update) is outside reasonable bounds (> 1e6)",
|
|
21535
|
+
{
|
|
21536
|
+
arrow,
|
|
21537
|
+
updates
|
|
21538
|
+
}
|
|
21539
|
+
);
|
|
21540
|
+
}
|
|
21541
|
+
arrow.x = clamp(arrow.x, -MAX_POS, MAX_POS);
|
|
21542
|
+
arrow.y = clamp(arrow.y, -MAX_POS, MAX_POS);
|
|
21543
|
+
if (updates.points) {
|
|
21544
|
+
updates.points = updates.points.map(
|
|
21545
|
+
([x, y]) => pointFrom(
|
|
21546
|
+
clamp(x, -MAX_POS, MAX_POS),
|
|
21547
|
+
clamp(y, -MAX_POS, MAX_POS)
|
|
21548
|
+
)
|
|
21549
|
+
);
|
|
21550
|
+
}
|
|
21512
21551
|
if (!define_import_meta_env_default.PROD) {
|
|
21513
21552
|
invariant(
|
|
21514
21553
|
!updates.points || updates.points.length >= 2,
|
|
@@ -21541,7 +21580,7 @@ var updateElbowArrowPoints = (arrow, elementsMap, updates, options) => {
|
|
|
21541
21580
|
}
|
|
21542
21581
|
const updatedPoints = updates.points ? updates.points && updates.points.length === 2 ? arrow.points.map(
|
|
21543
21582
|
(p, idx) => idx === 0 ? updates.points[0] : idx === arrow.points.length - 1 ? updates.points[1] : p
|
|
21544
|
-
) :
|
|
21583
|
+
) : updates.points.slice() : arrow.points.slice();
|
|
21545
21584
|
const {
|
|
21546
21585
|
startHeading,
|
|
21547
21586
|
endHeading,
|
|
@@ -22189,16 +22228,30 @@ var getBindableElementForId = (id, elementsMap) => {
|
|
|
22189
22228
|
var normalizeArrowElementUpdate = (global, nextFixedSegments, startIsSpecial, endIsSpecial) => {
|
|
22190
22229
|
const offsetX = global[0][0];
|
|
22191
22230
|
const offsetY = global[0][1];
|
|
22192
|
-
|
|
22231
|
+
let points = global.map(
|
|
22193
22232
|
(p) => pointTranslate(
|
|
22194
22233
|
p,
|
|
22195
22234
|
vectorScale(vectorFromPoint(global[0]), -1)
|
|
22196
22235
|
)
|
|
22197
22236
|
);
|
|
22237
|
+
if (offsetX < -MAX_POS || offsetX > MAX_POS || offsetY < -MAX_POS || offsetY > MAX_POS || offsetX + points[points.length - 1][0] < -MAX_POS || offsetY + points[points.length - 1][0] > MAX_POS || offsetX + points[points.length - 1][1] < -MAX_POS || offsetY + points[points.length - 1][1] > MAX_POS) {
|
|
22238
|
+
console.error(
|
|
22239
|
+
"Elbow arrow normalization is outside reasonable bounds (> 1e6)",
|
|
22240
|
+
{
|
|
22241
|
+
x: offsetX,
|
|
22242
|
+
y: offsetY,
|
|
22243
|
+
points,
|
|
22244
|
+
...getSizeFromPoints(points)
|
|
22245
|
+
}
|
|
22246
|
+
);
|
|
22247
|
+
}
|
|
22248
|
+
points = points.map(
|
|
22249
|
+
([x, y]) => pointFrom(clamp(x, -1e6, 1e6), clamp(y, -1e6, 1e6))
|
|
22250
|
+
);
|
|
22198
22251
|
return {
|
|
22199
22252
|
points,
|
|
22200
|
-
x: offsetX,
|
|
22201
|
-
y: offsetY,
|
|
22253
|
+
x: clamp(offsetX, -1e6, 1e6),
|
|
22254
|
+
y: clamp(offsetY, -1e6, 1e6),
|
|
22202
22255
|
fixedSegments: (nextFixedSegments?.length ?? 0) > 0 ? nextFixedSegments : null,
|
|
22203
22256
|
...getSizeFromPoints(points),
|
|
22204
22257
|
startIsSpecial,
|
|
@@ -23436,9 +23489,19 @@ var getResizedOrigin = (prevOrigin, prevWidth, prevHeight, newWidth, newHeight,
|
|
|
23436
23489
|
y: y - (newHeight - prevHeight) / 2
|
|
23437
23490
|
};
|
|
23438
23491
|
case "east-side":
|
|
23492
|
+
if (Math.abs(
|
|
23493
|
+
y + (prevWidth - newWidth) / 2 * Math.sin(angle) + (prevHeight - newHeight) / 2
|
|
23494
|
+
) > 1e6) {
|
|
23495
|
+
console.error(
|
|
23496
|
+
"getResizedOrigin() new calculation creates extremely large (> 1e6) y value where the old calculation resulted in",
|
|
23497
|
+
{
|
|
23498
|
+
result: y + (newHeight - prevHeight) / 2 + (prevWidth - newWidth) / 2 * Math.sin(angle)
|
|
23499
|
+
}
|
|
23500
|
+
);
|
|
23501
|
+
}
|
|
23439
23502
|
return {
|
|
23440
23503
|
x: x + (prevWidth - newWidth) / 2 * (Math.cos(angle) + 1),
|
|
23441
|
-
y: y + (
|
|
23504
|
+
y: y + (newHeight - prevHeight) / 2 + (prevWidth - newWidth) / 2 * Math.sin(angle)
|
|
23442
23505
|
};
|
|
23443
23506
|
case "west-side":
|
|
23444
23507
|
return {
|
|
@@ -24179,7 +24242,7 @@ var parseFileContents = async (blob) => {
|
|
|
24179
24242
|
let contents;
|
|
24180
24243
|
if (blob.type === MIME_TYPES.png) {
|
|
24181
24244
|
try {
|
|
24182
|
-
return await (await import("./data/image-
|
|
24245
|
+
return await (await import("./data/image-EN763OZS.js")).decodePngMetadata(blob);
|
|
24183
24246
|
} catch (error) {
|
|
24184
24247
|
if (error.message === "INVALID") {
|
|
24185
24248
|
throw new ImageSceneDataError(
|
|
@@ -25253,4 +25316,4 @@ export {
|
|
|
25253
25316
|
getNormalizedZoom,
|
|
25254
25317
|
getNormalizedGridStep
|
|
25255
25318
|
};
|
|
25256
|
-
//# sourceMappingURL=chunk-
|
|
25319
|
+
//# sourceMappingURL=chunk-3O3BNMYV.js.map
|