@nextcloud/excalidraw-common 0.18.0-8fb6b24 → 0.18.0-nc.1
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 +204 -85
- package/dist/dev/index.js.map +3 -3
- package/dist/prod/index.js +3 -3
- package/dist/types/common/src/colors.d.ts +23 -1
- package/dist/types/common/src/constants.d.ts +66 -7
- package/dist/types/common/src/keys.d.ts +4 -0
- package/dist/types/common/src/points.d.ts +1 -1
- package/dist/types/common/src/random.d.ts +7 -0
- package/dist/types/common/src/utils.d.ts +6 -43
- package/dist/types/element/src/Scene.d.ts +16 -5
- package/dist/types/element/src/align.d.ts +2 -2
- 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 +28 -13
- package/dist/types/element/src/bounds.d.ts +24 -7
- package/dist/types/element/src/bucketFill.d.ts +110 -0
- package/dist/types/element/src/collision.d.ts +14 -5
- package/dist/types/element/src/comparisons.d.ts +8 -5
- package/dist/types/element/src/convertToShape.d.ts +23 -0
- package/dist/types/element/src/cropElement.d.ts +36 -4
- package/dist/types/element/src/delta.d.ts +23 -1
- package/dist/types/element/src/distribute.d.ts +2 -2
- package/dist/types/element/src/dragElements.d.ts +27 -0
- package/dist/types/element/src/duplicate.d.ts +64 -3
- package/dist/types/element/src/embeddable.d.ts +2 -2
- package/dist/types/element/src/flowchart.d.ts +11 -7
- package/dist/types/element/src/fractionalIndex.d.ts +2 -2
- package/dist/types/element/src/frame.d.ts +11 -10
- package/dist/types/element/src/groups.d.ts +10 -15
- package/dist/types/element/src/index.d.ts +6 -1
- package/dist/types/element/src/linearElementEditor.d.ts +27 -10
- package/dist/types/element/src/listMarker.d.ts +34 -0
- package/dist/types/element/src/mutateElement.d.ts +1 -1
- package/dist/types/element/src/newElement.d.ts +53 -3
- package/dist/types/element/src/renderElement.d.ts +21 -7
- package/dist/types/element/src/resizeElements.d.ts +8 -1
- package/dist/types/element/src/selection.d.ts +6 -12
- package/dist/types/element/src/shape.d.ts +27 -1
- package/dist/types/element/src/sizeHelpers.d.ts +6 -0
- package/dist/types/element/src/sortElements.d.ts +10 -0
- package/dist/types/element/src/stickyNote.d.ts +183 -0
- package/dist/types/element/src/textElement.d.ts +20 -9
- package/dist/types/element/src/transform.d.ts +26 -7
- package/dist/types/element/src/typeChecks.d.ts +29 -27
- package/dist/types/element/src/types.d.ts +43 -7
- package/dist/types/element/src/utils.d.ts +15 -4
- package/dist/types/element/src/zindex.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +87 -18
- package/dist/types/excalidraw/actions/actionAlign.d.ts +6 -6
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +74 -203
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +266 -941
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +58 -12
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +29 -6
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +4 -518
- package/dist/types/excalidraw/actions/actionDeselect.d.ts +30 -7
- package/dist/types/excalidraw/actions/actionDistribute.d.ts +2 -3
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +29 -6
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +59 -13
- package/dist/types/excalidraw/actions/actionExport.d.ts +64 -18
- package/dist/types/excalidraw/actions/actionFinalize.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionFrame.d.ts +114 -651
- package/dist/types/excalidraw/actions/actionGroup.d.ts +73 -27
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +84 -9
- package/dist/types/excalidraw/actions/actionLink.d.ts +30 -7
- package/dist/types/excalidraw/actions/actionMenu.d.ts +29 -6
- package/dist/types/excalidraw/actions/actionProperties.d.ts +96 -34
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +34 -11
- package/dist/types/excalidraw/actions/actionStyles.d.ts +30 -7
- package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +30 -7
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +33 -11
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +30 -7
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +30 -7
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +33 -11
- package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +1 -1
- package/dist/types/excalidraw/actions/{actionEmbeddable.d.ts → actionToggleShowHints.d.ts} +45 -19
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +30 -7
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +31 -8
- package/dist/types/excalidraw/actions/actionToggleWrap.d.ts +12 -0
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +30 -7
- package/dist/types/excalidraw/actions/colorTargets.d.ts +39 -0
- package/dist/types/excalidraw/actions/index.d.ts +3 -2
- 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 +8 -4
- package/dist/types/excalidraw/{animated-trail.d.ts → animatedTrail.d.ts} +4 -3
- package/dist/types/excalidraw/appState.d.ts +34 -10
- package/dist/types/excalidraw/components/Actions.d.ts +17 -12
- package/dist/types/excalidraw/components/ActiveConfirmDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/App.arrowText.d.ts +70 -0
- package/dist/types/excalidraw/components/App.bucketFill.d.ts +48 -0
- package/dist/types/excalidraw/components/App.clipboard.d.ts +31 -0
- package/dist/types/excalidraw/components/App.cursor.d.ts +38 -0
- package/dist/types/excalidraw/components/App.d.ts +324 -111
- package/dist/types/excalidraw/components/App.drawshape.d.ts +55 -0
- package/dist/types/excalidraw/components/App.duplicate.d.ts +101 -0
- package/dist/types/excalidraw/components/App.flowchart.d.ts +21 -0
- package/dist/types/excalidraw/components/App.modifiers.d.ts +38 -0
- package/dist/types/excalidraw/components/App.pan.d.ts +62 -0
- package/dist/types/excalidraw/components/App.selection.d.ts +265 -0
- package/dist/types/excalidraw/components/App.selectionTool.d.ts +93 -0
- package/dist/types/excalidraw/components/App.text.d.ts +146 -0
- package/dist/types/excalidraw/components/App.textTool.d.ts +140 -0
- package/dist/types/excalidraw/components/App.toolDrag.d.ts +63 -0
- package/dist/types/excalidraw/components/App.viewport.d.ts +113 -0
- package/dist/types/excalidraw/components/App.wheel.d.ts +26 -0
- package/dist/types/excalidraw/components/App.wrap.d.ts +31 -0
- package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +9 -3
- package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +3 -1
- package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +5 -1
- package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +9 -2
- package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +4 -2
- package/dist/types/excalidraw/components/ColorPicker/TopPicks.d.ts +8 -1
- package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -1
- package/dist/types/excalidraw/components/ColorPicker/colorTopPicksDnD.d.ts +11 -0
- package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +2 -1
- package/dist/types/excalidraw/components/CommandPalette/defaultCommandPaletteItems.d.ts +1 -2
- package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +2 -2
- package/dist/types/excalidraw/components/CursorHint.d.ts +46 -0
- package/dist/types/excalidraw/components/EyeDropper.d.ts +1 -1
- package/dist/types/excalidraw/components/FileDropOverlay.d.ts +2 -0
- package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +4 -1
- package/dist/types/excalidraw/components/FontPicker/FontPickerList.d.ts +6 -1
- package/dist/types/excalidraw/components/FontPicker/fontTopPicksDnD.d.ts +12 -0
- package/dist/types/excalidraw/components/IconButton.d.ts +48 -0
- package/dist/types/excalidraw/components/Island.d.ts +7 -0
- package/dist/types/excalidraw/components/LaserPointerButton.d.ts +2 -4
- package/dist/types/excalidraw/components/LayerUI.d.ts +5 -2
- package/dist/types/excalidraw/components/LibraryMenu.d.ts +1 -1
- package/dist/types/excalidraw/components/LibraryMenuHeaderContent.d.ts +3 -1
- package/dist/types/excalidraw/components/LibraryMenuItems.d.ts +3 -1
- package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +6 -2
- package/dist/types/excalidraw/components/LibraryUnit.d.ts +7 -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/OverwriteConfirm/OverwriteConfirmState.d.ts +1 -1
- 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/SVGLayer.d.ts +1 -1
- package/dist/types/excalidraw/components/SearchMenu.d.ts +1 -1
- package/dist/types/excalidraw/components/Sidebar/Sidebar.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/Angle.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/Dimension.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/DragInput.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/Position.d.ts +3 -3
- package/dist/types/excalidraw/components/Stats/utils.d.ts +1 -1
- package/dist/types/excalidraw/components/TTDDialog/TTDContext.d.ts +4 -4
- package/dist/types/excalidraw/components/TTDDialog/useTTDChatStorage.d.ts +3 -3
- 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 +151 -0
- package/dist/types/excalidraw/components/Tooltip.d.ts +15 -1
- package/dist/types/excalidraw/components/TopPicksDnD/TopPicksContextMenu.d.ts +14 -0
- package/dist/types/excalidraw/components/TopPicksDnD/TopPicksTip.d.ts +11 -0
- package/dist/types/excalidraw/components/TopPicksDnD/topPicksDnD.d.ts +58 -0
- package/dist/types/excalidraw/components/UserList.d.ts +3 -2
- package/dist/types/excalidraw/components/ViewportStatusFrame/ViewportStatusFrame.d.ts +11 -0
- package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +3 -1
- package/dist/types/excalidraw/components/canvases/NewElementCanvas.d.ts +3 -0
- package/dist/types/excalidraw/components/canvases/StaticCanvas.d.ts +1 -1
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +2 -1
- package/dist/types/excalidraw/components/footer/Footer.d.ts +3 -1
- package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +2 -2
- package/dist/types/excalidraw/components/icons.d.ts +7 -1
- package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +10 -4
- 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 +70 -24
- package/dist/types/excalidraw/data/index.d.ts +4 -4
- package/dist/types/excalidraw/data/json.d.ts +41 -18
- package/dist/types/excalidraw/data/library.d.ts +1 -1
- package/dist/types/excalidraw/drawShapeTrail.d.ts +16 -0
- package/dist/types/excalidraw/eraser/index.d.ts +2 -3
- package/dist/types/excalidraw/fonts/Fonts.d.ts +3 -2
- package/dist/types/excalidraw/hooks/useAppStateValue.d.ts +29 -0
- package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
- package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +5 -5
- package/dist/types/excalidraw/{laser-trails.d.ts → laserTrails.d.ts} +5 -7
- package/dist/types/excalidraw/lasso/index.d.ts +2 -3
- package/dist/types/excalidraw/lasso/utils.d.ts +2 -0
- package/dist/types/excalidraw/renderOverrides.d.ts +9 -0
- package/dist/types/excalidraw/renderer/animation.d.ts +5 -1
- package/dist/types/excalidraw/renderer/helpers.d.ts +25 -0
- package/dist/types/excalidraw/renderer/interactiveScene.d.ts +2 -4
- package/dist/types/excalidraw/scene/Renderer.d.ts +489 -20
- package/dist/types/excalidraw/scene/export.d.ts +3 -3
- package/dist/types/excalidraw/scene/index.d.ts +2 -2
- package/dist/types/excalidraw/scene/types.d.ts +7 -4
- package/dist/types/excalidraw/snapping.d.ts +7 -7
- package/dist/types/excalidraw/types.d.ts +574 -29
- package/dist/types/excalidraw/viewport.d.ts +302 -0
- package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +13 -3
- package/dist/types/fractional-indexing/src/index.d.ts +29 -0
- package/dist/types/laser-pointer/src/index.d.ts +2 -0
- package/dist/types/laser-pointer/src/math.d.ts +16 -0
- package/dist/types/laser-pointer/src/simplify.d.ts +2 -0
- package/dist/types/laser-pointer/src/state.d.ts +36 -0
- package/dist/types/math/src/constants.d.ts +0 -1
- package/dist/types/math/src/curve.d.ts +23 -13
- 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/point.d.ts +1 -0
- package/dist/types/math/src/polygon.d.ts +25 -1
- package/dist/types/math/src/segment.d.ts +6 -0
- package/dist/types/utils/src/export.d.ts +4 -3
- package/dist/types/utils/src/index.d.ts +1 -2
- package/dist/types/utils/src/shape.d.ts +2 -2
- package/package.json +1 -1
- package/dist/types/excalidraw/animation-frame-handler.d.ts +0 -16
- package/dist/types/excalidraw/components/FollowMode/FollowMode.d.ts +0 -10
- 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/ToolButton.d.ts +0 -49
- package/dist/types/excalidraw/components/shapes.d.ts +0 -263
- package/dist/types/excalidraw/cursor.d.ts +0 -5
- package/dist/types/excalidraw/scene/scroll.d.ts +0 -18
- package/dist/types/excalidraw/scene/zoom.d.ts +0 -12
- package/dist/types/utils/src/bbox.d.ts +0 -9
- package/dist/types/utils/src/withinBounds.d.ts +0 -19
package/dist/dev/index.js
CHANGED
|
@@ -1356,6 +1356,8 @@ function validateWCAG2Parms(parms) {
|
|
|
1356
1356
|
import { clamp } from "@nextcloud/excalidraw-math";
|
|
1357
1357
|
import { degreesToRadians } from "@nextcloud/excalidraw-math";
|
|
1358
1358
|
var DARK_MODE_COLORS_CACHE = typeof window !== "undefined" ? /* @__PURE__ */ new Map() : null;
|
|
1359
|
+
var DARK_MODE_FILTER_INVERT_PERCENT = 93;
|
|
1360
|
+
var DARK_MODE_FILTER_HUE_ROTATE_DEGREES = 180;
|
|
1359
1361
|
function cssHueRotate(red, green, blue, degrees) {
|
|
1360
1362
|
const r = red / 255;
|
|
1361
1363
|
const g = green / 255;
|
|
@@ -1394,7 +1396,10 @@ var cssInvert = (r, g, b, percent) => {
|
|
|
1394
1396
|
const invertedB = invertComponent(b);
|
|
1395
1397
|
return { r: invertedR, g: invertedG, b: invertedB };
|
|
1396
1398
|
};
|
|
1397
|
-
var applyDarkModeFilter = (color) => {
|
|
1399
|
+
var applyDarkModeFilter = (color, enable = true) => {
|
|
1400
|
+
if (!enable) {
|
|
1401
|
+
return color;
|
|
1402
|
+
}
|
|
1398
1403
|
const cached = DARK_MODE_COLORS_CACHE?.get(color);
|
|
1399
1404
|
if (cached) {
|
|
1400
1405
|
return cached;
|
|
@@ -1402,12 +1407,17 @@ var applyDarkModeFilter = (color) => {
|
|
|
1402
1407
|
const tc = tinycolor(color);
|
|
1403
1408
|
const alpha = tc.getAlpha();
|
|
1404
1409
|
const rgb = tc.toRgb();
|
|
1405
|
-
const inverted = cssInvert(
|
|
1410
|
+
const inverted = cssInvert(
|
|
1411
|
+
rgb.r,
|
|
1412
|
+
rgb.g,
|
|
1413
|
+
rgb.b,
|
|
1414
|
+
DARK_MODE_FILTER_INVERT_PERCENT
|
|
1415
|
+
);
|
|
1406
1416
|
const rotated = cssHueRotate(
|
|
1407
1417
|
inverted.r,
|
|
1408
1418
|
inverted.g,
|
|
1409
1419
|
inverted.b,
|
|
1410
|
-
|
|
1420
|
+
DARK_MODE_FILTER_HUE_ROTATE_DEGREES
|
|
1411
1421
|
);
|
|
1412
1422
|
const result = rgbToHex2(rotated.r, rotated.g, rotated.b, alpha);
|
|
1413
1423
|
if (DARK_MODE_COLORS_CACHE) {
|
|
@@ -1415,6 +1425,33 @@ var applyDarkModeFilter = (color) => {
|
|
|
1415
1425
|
}
|
|
1416
1426
|
return result;
|
|
1417
1427
|
};
|
|
1428
|
+
var _reverseDarkModeInvert = (r, g, b) => {
|
|
1429
|
+
const p = DARK_MODE_FILTER_INVERT_PERCENT / 100;
|
|
1430
|
+
const denominator = 1 - 2 * p;
|
|
1431
|
+
const restore = (color) => Math.round(clamp((color - 255 * p) / denominator, 0, 255));
|
|
1432
|
+
return {
|
|
1433
|
+
r: restore(r),
|
|
1434
|
+
g: restore(g),
|
|
1435
|
+
b: restore(b)
|
|
1436
|
+
};
|
|
1437
|
+
};
|
|
1438
|
+
var removeDarkModeFilter = (color) => {
|
|
1439
|
+
const tc = tinycolor(color);
|
|
1440
|
+
const alpha = tc.getAlpha();
|
|
1441
|
+
const rgb = tc.toRgb();
|
|
1442
|
+
const rotatedBack = cssHueRotate(
|
|
1443
|
+
rgb.r,
|
|
1444
|
+
rgb.g,
|
|
1445
|
+
rgb.b,
|
|
1446
|
+
DARK_MODE_FILTER_HUE_ROTATE_DEGREES
|
|
1447
|
+
);
|
|
1448
|
+
const restored = _reverseDarkModeInvert(
|
|
1449
|
+
rotatedBack.r,
|
|
1450
|
+
rotatedBack.g,
|
|
1451
|
+
rotatedBack.b
|
|
1452
|
+
);
|
|
1453
|
+
return rgbToHex2(restored.r, restored.g, restored.b, alpha);
|
|
1454
|
+
};
|
|
1418
1455
|
var pick = (source, keys) => {
|
|
1419
1456
|
return keys.reduce((acc, key) => {
|
|
1420
1457
|
if (key in source) {
|
|
@@ -1460,6 +1497,7 @@ var COMMON_ELEMENT_SHADES = pick(COLOR_PALETTE, [
|
|
|
1460
1497
|
"orange",
|
|
1461
1498
|
"red"
|
|
1462
1499
|
]);
|
|
1500
|
+
var COLOR_TOP_PICKS_SLOTS = 5;
|
|
1463
1501
|
var DEFAULT_ELEMENT_STROKE_PICKS = [
|
|
1464
1502
|
COLOR_PALETTE.black,
|
|
1465
1503
|
COLOR_PALETTE.red[DEFAULT_ELEMENT_STROKE_COLOR_INDEX],
|
|
@@ -1474,6 +1512,22 @@ var DEFAULT_ELEMENT_BACKGROUND_PICKS = [
|
|
|
1474
1512
|
COLOR_PALETTE.blue[DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX],
|
|
1475
1513
|
COLOR_PALETTE.yellow[DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX]
|
|
1476
1514
|
];
|
|
1515
|
+
var BUCKET_FILL_BACKGROUND_PICKS = [
|
|
1516
|
+
COLOR_PALETTE.white,
|
|
1517
|
+
COLOR_PALETTE.red[DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX],
|
|
1518
|
+
COLOR_PALETTE.green[DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX],
|
|
1519
|
+
COLOR_PALETTE.blue[DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX],
|
|
1520
|
+
COLOR_PALETTE.yellow[DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX]
|
|
1521
|
+
];
|
|
1522
|
+
var DEFAULT_STICKY_NOTE_BG = "#ffdf6b";
|
|
1523
|
+
var STICKY_NOTE_STROKE_PICKS = DEFAULT_ELEMENT_STROKE_PICKS;
|
|
1524
|
+
var STICKY_NOTE_BACKGROUND_PICKS = [
|
|
1525
|
+
DEFAULT_STICKY_NOTE_BG,
|
|
1526
|
+
COLOR_PALETTE.pink[1],
|
|
1527
|
+
COLOR_PALETTE.green[1],
|
|
1528
|
+
COLOR_PALETTE.blue[1],
|
|
1529
|
+
COLOR_PALETTE.orange[1]
|
|
1530
|
+
];
|
|
1477
1531
|
var DEFAULT_CANVAS_BACKGROUND_PICKS = [
|
|
1478
1532
|
COLOR_PALETTE.white,
|
|
1479
1533
|
// radix slate2
|
|
@@ -1525,6 +1579,14 @@ var rgbToHex2 = (r, g, b, a) => {
|
|
|
1525
1579
|
}
|
|
1526
1580
|
return hex6;
|
|
1527
1581
|
};
|
|
1582
|
+
var setColorAlpha = (color, alpha) => {
|
|
1583
|
+
const tc = tinycolor(color);
|
|
1584
|
+
if (!tc.isValid()) {
|
|
1585
|
+
return color;
|
|
1586
|
+
}
|
|
1587
|
+
const { r, g, b } = tc.toRgb();
|
|
1588
|
+
return rgbToHex2(r, g, b, alpha);
|
|
1589
|
+
};
|
|
1528
1590
|
var colorToHex = (color) => {
|
|
1529
1591
|
const tc = tinycolor(color);
|
|
1530
1592
|
if (!tc.isValid()) {
|
|
@@ -1536,6 +1598,9 @@ var colorToHex = (color) => {
|
|
|
1536
1598
|
var isTransparent = (color) => {
|
|
1537
1599
|
return tinycolor(color).getAlpha() === 0;
|
|
1538
1600
|
};
|
|
1601
|
+
var isOpaqueColor = (color) => {
|
|
1602
|
+
return tinycolor(color).getAlpha() === 1;
|
|
1603
|
+
};
|
|
1539
1604
|
var COLOR_OUTLINE_CONTRAST_THRESHOLD = 240;
|
|
1540
1605
|
var calculateContrast = (r, g, b) => {
|
|
1541
1606
|
const yiq = (r * 299 + g * 587 + b * 114) / 1e3;
|
|
@@ -1575,6 +1640,8 @@ init_define_import_meta_env();
|
|
|
1575
1640
|
var supportsResizeObserver = typeof window !== "undefined" && "ResizeObserver" in window;
|
|
1576
1641
|
var APP_NAME = "Excalidraw";
|
|
1577
1642
|
var TEXT_AUTOWRAP_THRESHOLD = 36;
|
|
1643
|
+
var TEXT_VIEWPORT_PADDING = 20;
|
|
1644
|
+
var TEXT_MAX_WRAP_WIDTH = 800;
|
|
1578
1645
|
var DRAGGING_THRESHOLD = 10;
|
|
1579
1646
|
var MINIMUM_ARROW_SIZE = 20;
|
|
1580
1647
|
var LINE_CONFIRM_THRESHOLD = 8;
|
|
@@ -1626,6 +1693,7 @@ var EVENT = /* @__PURE__ */ ((EVENT2) => {
|
|
|
1626
1693
|
EVENT2["POINTER_MOVE"] = "pointermove";
|
|
1627
1694
|
EVENT2["POINTER_DOWN"] = "pointerdown";
|
|
1628
1695
|
EVENT2["POINTER_UP"] = "pointerup";
|
|
1696
|
+
EVENT2["POINTER_CANCEL"] = "pointercancel";
|
|
1629
1697
|
EVENT2["STATE_CHANGE"] = "statechange";
|
|
1630
1698
|
EVENT2["WHEEL"] = "wheel";
|
|
1631
1699
|
EVENT2["TOUCH_START"] = "touchstart";
|
|
@@ -1737,7 +1805,28 @@ var FRAME_STYLE = {
|
|
|
1737
1805
|
};
|
|
1738
1806
|
var MIN_FONT_SIZE = 1;
|
|
1739
1807
|
var DEFAULT_FONT_SIZE = 20;
|
|
1808
|
+
var STICKY_NOTE_MIN_FONT_SIZE = 16;
|
|
1809
|
+
var STICKY_NOTE_MAX_FONT_SIZE = 512;
|
|
1810
|
+
var STICKY_NOTE_FALLBACK_FONT_SIZE = 28;
|
|
1811
|
+
var STICKY_NOTE_FONT_STEP = 2;
|
|
1812
|
+
var STICKY_NOTE_PADDING = 16;
|
|
1813
|
+
var STICKY_NOTE_FOOTER = {
|
|
1814
|
+
height: 20,
|
|
1815
|
+
fontSize: 12,
|
|
1816
|
+
fontFamily: "Helvetica, Arial, sans-serif",
|
|
1817
|
+
baselineFromBottom: 14,
|
|
1818
|
+
opacity: 1,
|
|
1819
|
+
minBodyWidthForYear: 80
|
|
1820
|
+
};
|
|
1821
|
+
var STICKY_NOTE_BODY_INSET_Y = STICKY_NOTE_PADDING * 2 + STICKY_NOTE_FOOTER.height;
|
|
1822
|
+
var DEFAULT_STICKY_NOTE_SIZE = 250;
|
|
1823
|
+
var STICKY_NOTE_MIN_SIZE = 75;
|
|
1824
|
+
var STICKY_NOTE_SHADOW_OFFSET = 3;
|
|
1825
|
+
var STICKY_NOTE_SHADOW_OPACITY = 0.16;
|
|
1826
|
+
var STICKY_NOTE_EDGE_SHADOW_WIDTH = 0.5;
|
|
1827
|
+
var STICKY_NOTE_EDGE_SHADOW_OPACITY = 0.08;
|
|
1740
1828
|
var DEFAULT_FONT_FAMILY = FONT_FAMILY.Excalifont;
|
|
1829
|
+
var FONT_TOP_PICKS_SLOTS = 3;
|
|
1741
1830
|
var DEFAULT_TEXT_ALIGN = "left";
|
|
1742
1831
|
var DEFAULT_VERTICAL_ALIGN = "top";
|
|
1743
1832
|
var DEFAULT_VERSION = "{version}";
|
|
@@ -1807,9 +1896,13 @@ var TOUCH_CTX_MENU_TIMEOUT = 500;
|
|
|
1807
1896
|
var TITLE_TIMEOUT = 1e4;
|
|
1808
1897
|
var VERSION_TIMEOUT = 3e4;
|
|
1809
1898
|
var SCROLL_TIMEOUT = 100;
|
|
1899
|
+
var ZEN_MODE_TRANSITION_DURATION = 250;
|
|
1810
1900
|
var ZOOM_STEP = 0.1;
|
|
1811
1901
|
var MIN_ZOOM = 0.1;
|
|
1812
1902
|
var MAX_ZOOM = 30;
|
|
1903
|
+
var DEFAULT_ZOOM = Object.freeze({
|
|
1904
|
+
value: 1
|
|
1905
|
+
});
|
|
1813
1906
|
var HYPERLINK_TOOLTIP_DELAY = 300;
|
|
1814
1907
|
var IDLE_THRESHOLD = 6e4;
|
|
1815
1908
|
var ACTIVE_THRESHOLD = 3e3;
|
|
@@ -1836,8 +1929,10 @@ var DEFAULT_UI_OPTIONS = {
|
|
|
1836
1929
|
var MAX_DECIMALS_FOR_SVG_EXPORT = 2;
|
|
1837
1930
|
var EXPORT_SCALES = [1, 2, 3];
|
|
1838
1931
|
var DEFAULT_EXPORT_PADDING = 10;
|
|
1839
|
-
var
|
|
1840
|
-
|
|
1932
|
+
var DEFAULT_IMAGE_OPTIONS = {
|
|
1933
|
+
maxWidthOrHeight: 1440,
|
|
1934
|
+
maxFileSizeBytes: 4 * 1024 * 1024
|
|
1935
|
+
};
|
|
1841
1936
|
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
1842
1937
|
var SVG_DOCUMENT_PREAMBLE = `<?xml version="1.0" standalone="no"?>
|
|
1843
1938
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
@@ -1861,6 +1956,7 @@ var TEXT_ALIGN = {
|
|
|
1861
1956
|
RIGHT: "right"
|
|
1862
1957
|
};
|
|
1863
1958
|
var ELEMENT_READY_TO_ERASE_OPACITY = 20;
|
|
1959
|
+
var ELEMENT_PENDING_DRAW_SHAPE_OPACITY = 70;
|
|
1864
1960
|
var DEFAULT_PROPORTIONAL_RADIUS = 0.25;
|
|
1865
1961
|
var DEFAULT_ADAPTIVE_RADIUS = 32;
|
|
1866
1962
|
var ROUNDNESS = {
|
|
@@ -1884,16 +1980,34 @@ var ROUGHNESS = {
|
|
|
1884
1980
|
artist: 1,
|
|
1885
1981
|
cartoonist: 2
|
|
1886
1982
|
};
|
|
1983
|
+
var STROKE_WIDTH_KEYS = [
|
|
1984
|
+
"thin",
|
|
1985
|
+
"medium",
|
|
1986
|
+
"bold"
|
|
1987
|
+
];
|
|
1887
1988
|
var STROKE_WIDTH = {
|
|
1888
1989
|
thin: 1,
|
|
1990
|
+
medium: 2,
|
|
1991
|
+
bold: 4,
|
|
1992
|
+
extraBold: 8
|
|
1993
|
+
// unused (may be introduced in the future)
|
|
1994
|
+
};
|
|
1995
|
+
var FREEDRAW_STROKE_WIDTH = {
|
|
1996
|
+
thin: 0.5,
|
|
1997
|
+
medium: 1,
|
|
1889
1998
|
bold: 2,
|
|
1890
1999
|
extraBold: 4
|
|
2000
|
+
// legacy (may be used again in the future)
|
|
1891
2001
|
};
|
|
2002
|
+
var getStrokeWidthByKey = (elementType, strokeWidthKey) => {
|
|
2003
|
+
return elementType === "freedraw" ? FREEDRAW_STROKE_WIDTH[strokeWidthKey] : STROKE_WIDTH[strokeWidthKey];
|
|
2004
|
+
};
|
|
2005
|
+
var DEFAULT_ELEMENT_STROKE_WIDTH_KEY = "medium";
|
|
1892
2006
|
var DEFAULT_ELEMENT_PROPS = {
|
|
1893
2007
|
strokeColor: COLOR_PALETTE.black,
|
|
1894
2008
|
backgroundColor: COLOR_PALETTE.transparent,
|
|
1895
2009
|
fillStyle: "solid",
|
|
1896
|
-
strokeWidth:
|
|
2010
|
+
strokeWidth: STROKE_WIDTH[DEFAULT_ELEMENT_STROKE_WIDTH_KEY],
|
|
1897
2011
|
strokeStyle: "solid",
|
|
1898
2012
|
roughness: ROUGHNESS.artist,
|
|
1899
2013
|
opacity: 100,
|
|
@@ -1925,8 +2039,11 @@ var TOOL_TYPE = {
|
|
|
1925
2039
|
hand: "hand",
|
|
1926
2040
|
frame: "frame",
|
|
1927
2041
|
magicframe: "magicframe",
|
|
2042
|
+
stickynote: "stickynote",
|
|
1928
2043
|
embeddable: "embeddable",
|
|
1929
|
-
laser: "laser"
|
|
2044
|
+
laser: "laser",
|
|
2045
|
+
autoshape: "autoshape",
|
|
2046
|
+
bucketfill: "bucketfill"
|
|
1930
2047
|
};
|
|
1931
2048
|
var EDITOR_LS_KEYS = {
|
|
1932
2049
|
OAI_API_KEY: "excalidraw-oai-api-key",
|
|
@@ -1957,6 +2074,8 @@ var BIND_MODE_TIMEOUT = 700;
|
|
|
1957
2074
|
var MOBILE_ACTION_BUTTON_BG = {
|
|
1958
2075
|
background: "var(--mobile-action-button-bg)"
|
|
1959
2076
|
};
|
|
2077
|
+
var DEFAULT_STROKE_STREAMLINE = 0.5;
|
|
2078
|
+
var DEFAULT_STROKE_STREAMLINE_PRECISE = 0.2;
|
|
1960
2079
|
|
|
1961
2080
|
// src/font-metadata.ts
|
|
1962
2081
|
init_define_import_meta_env();
|
|
@@ -2286,6 +2405,7 @@ var KEYS = {
|
|
|
2286
2405
|
SUBTRACT: "-",
|
|
2287
2406
|
SLASH: "/",
|
|
2288
2407
|
A: "a",
|
|
2408
|
+
B: "b",
|
|
2289
2409
|
C: "c",
|
|
2290
2410
|
D: "d",
|
|
2291
2411
|
E: "e",
|
|
@@ -2294,6 +2414,7 @@ var KEYS = {
|
|
|
2294
2414
|
H: "h",
|
|
2295
2415
|
I: "i",
|
|
2296
2416
|
L: "l",
|
|
2417
|
+
N: "n",
|
|
2297
2418
|
O: "o",
|
|
2298
2419
|
P: "p",
|
|
2299
2420
|
Q: "q",
|
|
@@ -2337,6 +2458,7 @@ var shouldRotateWithDiscreteAngle = (event) => event.shiftKey;
|
|
|
2337
2458
|
// src/points.ts
|
|
2338
2459
|
init_define_import_meta_env();
|
|
2339
2460
|
import {
|
|
2461
|
+
pointFrom,
|
|
2340
2462
|
pointFromPair
|
|
2341
2463
|
} from "@nextcloud/excalidraw-math";
|
|
2342
2464
|
var getSizeFromPoints = (points) => {
|
|
@@ -2381,12 +2503,12 @@ var rescalePoints = (dimension, newSize, points, normalize) => {
|
|
|
2381
2503
|
};
|
|
2382
2504
|
var getGridPoint = (x, y, gridSize) => {
|
|
2383
2505
|
if (gridSize) {
|
|
2384
|
-
return
|
|
2506
|
+
return pointFrom(
|
|
2385
2507
|
Math.round(x / gridSize) * gridSize,
|
|
2386
2508
|
Math.round(y / gridSize) * gridSize
|
|
2387
|
-
|
|
2509
|
+
);
|
|
2388
2510
|
}
|
|
2389
|
-
return
|
|
2511
|
+
return pointFrom(x, y);
|
|
2390
2512
|
};
|
|
2391
2513
|
|
|
2392
2514
|
// src/promise-pool.ts
|
|
@@ -2477,14 +2599,25 @@ var getDateTime = () => {
|
|
|
2477
2599
|
return `${year}-${month}-${day}-${hr}${min}`;
|
|
2478
2600
|
};
|
|
2479
2601
|
var capitalizeString = (str) => str.charAt(0).toUpperCase() + str.slice(1);
|
|
2480
|
-
var
|
|
2481
|
-
var
|
|
2482
|
-
|
|
2602
|
+
var getTargetWindow = (target) => target?.ownerDocument?.defaultView ?? (typeof window === "undefined" ? null : window);
|
|
2603
|
+
var isToolIcon = (target) => {
|
|
2604
|
+
const targetWindow = getTargetWindow(target);
|
|
2605
|
+
return !!targetWindow && target instanceof targetWindow.HTMLElement && target.className.includes("ToolIcon");
|
|
2606
|
+
};
|
|
2607
|
+
var isInputLike = (target) => {
|
|
2608
|
+
const targetWindow = getTargetWindow(target);
|
|
2609
|
+
return !!targetWindow && (target instanceof targetWindow.HTMLElement && target.dataset.type === "wysiwyg" || target instanceof targetWindow.HTMLBRElement || // newline in wysiwyg
|
|
2610
|
+
target instanceof targetWindow.HTMLInputElement || target instanceof targetWindow.HTMLTextAreaElement || target instanceof targetWindow.HTMLSelectElement);
|
|
2611
|
+
};
|
|
2483
2612
|
var isInteractive = (target) => {
|
|
2484
|
-
|
|
2613
|
+
const targetWindow = getTargetWindow(target);
|
|
2614
|
+
return isInputLike(target) || !!targetWindow && target instanceof targetWindow.Element && !!target.closest("label, button");
|
|
2615
|
+
};
|
|
2616
|
+
var isWritableElement = (target) => {
|
|
2617
|
+
const targetWindow = getTargetWindow(target);
|
|
2618
|
+
return !!targetWindow && (target instanceof targetWindow.HTMLElement && target.dataset.type === "wysiwyg" || target instanceof targetWindow.HTMLBRElement || // newline in wysiwyg
|
|
2619
|
+
target instanceof targetWindow.HTMLTextAreaElement || target instanceof targetWindow.HTMLInputElement && (target.type === "text" || target.type === "number" || target.type === "password" || target.type === "search") || target instanceof targetWindow.HTMLElement && target.closest(".cm-editor") !== null);
|
|
2485
2620
|
};
|
|
2486
|
-
var isWritableElement = (target) => target instanceof HTMLElement && target.dataset.type === "wysiwyg" || target instanceof HTMLBRElement || // newline in wysiwyg
|
|
2487
|
-
target instanceof HTMLTextAreaElement || target instanceof HTMLInputElement && (target.type === "text" || target.type === "number" || target.type === "password" || target.type === "search") || target instanceof HTMLElement && target.closest(".cm-editor") !== null;
|
|
2488
2621
|
var getFontFamilyString = ({
|
|
2489
2622
|
fontFamily
|
|
2490
2623
|
}) => {
|
|
@@ -2570,67 +2703,6 @@ var throttleRAF = (fn) => {
|
|
|
2570
2703
|
var easeOut = (k) => {
|
|
2571
2704
|
return 1 - Math.pow(1 - k, 4);
|
|
2572
2705
|
};
|
|
2573
|
-
var easeOutInterpolate = (from, to, progress) => {
|
|
2574
|
-
return (to - from) * easeOut(progress) + from;
|
|
2575
|
-
};
|
|
2576
|
-
var easeToValuesRAF = ({
|
|
2577
|
-
fromValues,
|
|
2578
|
-
toValues,
|
|
2579
|
-
onStep,
|
|
2580
|
-
duration = 250,
|
|
2581
|
-
interpolateValue,
|
|
2582
|
-
onStart,
|
|
2583
|
-
onEnd,
|
|
2584
|
-
onCancel
|
|
2585
|
-
}) => {
|
|
2586
|
-
let canceled = false;
|
|
2587
|
-
let frameId = 0;
|
|
2588
|
-
let startTime;
|
|
2589
|
-
function step(timestamp) {
|
|
2590
|
-
if (canceled) {
|
|
2591
|
-
return;
|
|
2592
|
-
}
|
|
2593
|
-
if (startTime === void 0) {
|
|
2594
|
-
startTime = timestamp;
|
|
2595
|
-
onStart?.();
|
|
2596
|
-
}
|
|
2597
|
-
const elapsed = Math.min(timestamp - startTime, duration);
|
|
2598
|
-
const factor = easeOut(elapsed / duration);
|
|
2599
|
-
const newValues = {};
|
|
2600
|
-
Object.keys(fromValues).forEach((key) => {
|
|
2601
|
-
const _key = key;
|
|
2602
|
-
const result = (toValues[_key] - fromValues[_key]) * factor + fromValues[_key];
|
|
2603
|
-
newValues[_key] = result;
|
|
2604
|
-
});
|
|
2605
|
-
onStep(newValues);
|
|
2606
|
-
if (elapsed < duration) {
|
|
2607
|
-
const progress = elapsed / duration;
|
|
2608
|
-
const newValues2 = {};
|
|
2609
|
-
Object.keys(fromValues).forEach((key) => {
|
|
2610
|
-
const _key = key;
|
|
2611
|
-
const startValue = fromValues[_key];
|
|
2612
|
-
const endValue = toValues[_key];
|
|
2613
|
-
let result;
|
|
2614
|
-
result = interpolateValue ? interpolateValue(startValue, endValue, progress, _key) : easeOutInterpolate(startValue, endValue, progress);
|
|
2615
|
-
if (result == null) {
|
|
2616
|
-
result = easeOutInterpolate(startValue, endValue, progress);
|
|
2617
|
-
}
|
|
2618
|
-
newValues2[_key] = result;
|
|
2619
|
-
});
|
|
2620
|
-
onStep(newValues2);
|
|
2621
|
-
frameId = window.requestAnimationFrame(step);
|
|
2622
|
-
} else {
|
|
2623
|
-
onStep(toValues);
|
|
2624
|
-
onEnd?.();
|
|
2625
|
-
}
|
|
2626
|
-
}
|
|
2627
|
-
frameId = window.requestAnimationFrame(step);
|
|
2628
|
-
return () => {
|
|
2629
|
-
onCancel?.();
|
|
2630
|
-
canceled = true;
|
|
2631
|
-
window.cancelAnimationFrame(frameId);
|
|
2632
|
-
};
|
|
2633
|
-
};
|
|
2634
2706
|
var chunk = (array, size) => {
|
|
2635
2707
|
if (!array.length || size < 1) {
|
|
2636
2708
|
return [];
|
|
@@ -2673,7 +2745,7 @@ var updateActiveTool = (appState, data) => {
|
|
|
2673
2745
|
}
|
|
2674
2746
|
return {
|
|
2675
2747
|
...appState.activeTool,
|
|
2676
|
-
lastActiveTool: data.
|
|
2748
|
+
lastActiveTool: data.lastActiveTool === void 0 ? appState.activeTool.lastActiveTool : data.lastActiveTool,
|
|
2677
2749
|
type: data.type,
|
|
2678
2750
|
customType: null,
|
|
2679
2751
|
locked: data.locked ?? appState.activeTool.locked,
|
|
@@ -2710,6 +2782,8 @@ var RS_LTR_CHARS = "A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FF
|
|
|
2710
2782
|
var RS_RTL_CHARS = "\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC";
|
|
2711
2783
|
var RE_RTL_CHECK = new RegExp(`^[^${RS_LTR_CHARS}]*[${RS_RTL_CHARS}]`);
|
|
2712
2784
|
var isRTL = (text) => RE_RTL_CHECK.test(text);
|
|
2785
|
+
var RE_RTL_CHARS = new RegExp(`[${RS_RTL_CHARS}]`);
|
|
2786
|
+
var hasRTLChars = (text) => RE_RTL_CHARS.test(text);
|
|
2713
2787
|
var tupleToCoors = (xyTuple) => {
|
|
2714
2788
|
const [x, y] = xyTuple;
|
|
2715
2789
|
return { x, y };
|
|
@@ -2800,19 +2874,21 @@ var supportsEmoji = () => {
|
|
|
2800
2874
|
return ctx.getImageData(offset, offset, 1, 1).data[0] !== 0;
|
|
2801
2875
|
};
|
|
2802
2876
|
var getNearestScrollableContainer = (element) => {
|
|
2877
|
+
const ownerDocument = element.ownerDocument;
|
|
2878
|
+
const ownerWindow = ownerDocument.defaultView ?? window;
|
|
2803
2879
|
let parent = element.parentElement;
|
|
2804
2880
|
while (parent) {
|
|
2805
|
-
if (parent ===
|
|
2806
|
-
return
|
|
2881
|
+
if (parent === ownerDocument.body) {
|
|
2882
|
+
return ownerDocument;
|
|
2807
2883
|
}
|
|
2808
|
-
const { overflowY } =
|
|
2884
|
+
const { overflowY } = ownerWindow.getComputedStyle(parent);
|
|
2809
2885
|
const hasScrollableContent = parent.scrollHeight > parent.clientHeight;
|
|
2810
2886
|
if (hasScrollableContent && (overflowY === "auto" || overflowY === "scroll" || overflowY === "overlay")) {
|
|
2811
2887
|
return parent;
|
|
2812
2888
|
}
|
|
2813
2889
|
parent = parent.parentElement;
|
|
2814
2890
|
}
|
|
2815
|
-
return
|
|
2891
|
+
return ownerDocument;
|
|
2816
2892
|
};
|
|
2817
2893
|
var focusNearestParent = (element) => {
|
|
2818
2894
|
let parent = element.parentElement;
|
|
@@ -3163,6 +3239,16 @@ var reseed = (seed) => {
|
|
|
3163
3239
|
testIdBase = 0;
|
|
3164
3240
|
};
|
|
3165
3241
|
var randomId = () => isTestEnv() ? `id${testIdBase++}` : nanoid();
|
|
3242
|
+
var seededRandom = (seed) => {
|
|
3243
|
+
let value = seed >>> 0;
|
|
3244
|
+
return () => {
|
|
3245
|
+
value += 1831565813;
|
|
3246
|
+
let next = value;
|
|
3247
|
+
next = Math.imul(next ^ next >>> 15, next | 1);
|
|
3248
|
+
next ^= next + Math.imul(next ^ next >>> 7, next | 61);
|
|
3249
|
+
return ((next ^ next >>> 14) >>> 0) / 4294967296;
|
|
3250
|
+
};
|
|
3251
|
+
};
|
|
3166
3252
|
|
|
3167
3253
|
// src/url.ts
|
|
3168
3254
|
init_define_import_meta_env();
|
|
@@ -3528,6 +3614,7 @@ export {
|
|
|
3528
3614
|
AppEventBus,
|
|
3529
3615
|
BIND_MODE_TIMEOUT,
|
|
3530
3616
|
BOUND_TEXT_PADDING,
|
|
3617
|
+
BUCKET_FILL_BACKGROUND_PICKS,
|
|
3531
3618
|
BinaryHeap,
|
|
3532
3619
|
CANVAS_ONLY_ACTIONS,
|
|
3533
3620
|
CANVAS_SEARCH_TAB,
|
|
@@ -3538,6 +3625,7 @@ export {
|
|
|
3538
3625
|
COLOR_CHARCOAL_BLACK,
|
|
3539
3626
|
COLOR_OUTLINE_CONTRAST_THRESHOLD,
|
|
3540
3627
|
COLOR_PALETTE,
|
|
3628
|
+
COLOR_TOP_PICKS_SLOTS,
|
|
3541
3629
|
COLOR_VOICE_CALL,
|
|
3542
3630
|
COLOR_WHITE,
|
|
3543
3631
|
CURSOR_TYPE,
|
|
@@ -3553,27 +3641,34 @@ export {
|
|
|
3553
3641
|
DEFAULT_ELEMENT_STROKE_COLOR_INDEX,
|
|
3554
3642
|
DEFAULT_ELEMENT_STROKE_COLOR_PALETTE,
|
|
3555
3643
|
DEFAULT_ELEMENT_STROKE_PICKS,
|
|
3644
|
+
DEFAULT_ELEMENT_STROKE_WIDTH_KEY,
|
|
3556
3645
|
DEFAULT_EXPORT_PADDING,
|
|
3557
3646
|
DEFAULT_FILENAME,
|
|
3558
3647
|
DEFAULT_FONT_FAMILY,
|
|
3559
3648
|
DEFAULT_FONT_SIZE,
|
|
3560
3649
|
DEFAULT_GRID_SIZE,
|
|
3561
3650
|
DEFAULT_GRID_STEP,
|
|
3651
|
+
DEFAULT_IMAGE_OPTIONS,
|
|
3562
3652
|
DEFAULT_LASER_COLOR,
|
|
3563
|
-
DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT,
|
|
3564
3653
|
DEFAULT_PROPORTIONAL_RADIUS,
|
|
3565
3654
|
DEFAULT_REDUCED_GLOBAL_ALPHA,
|
|
3566
3655
|
DEFAULT_SIDEBAR,
|
|
3656
|
+
DEFAULT_STICKY_NOTE_BG,
|
|
3657
|
+
DEFAULT_STICKY_NOTE_SIZE,
|
|
3658
|
+
DEFAULT_STROKE_STREAMLINE,
|
|
3659
|
+
DEFAULT_STROKE_STREAMLINE_PRECISE,
|
|
3567
3660
|
DEFAULT_TEXT_ALIGN,
|
|
3568
3661
|
DEFAULT_TRANSFORM_HANDLE_SPACING,
|
|
3569
3662
|
DEFAULT_UI_OPTIONS,
|
|
3570
3663
|
DEFAULT_VERSION,
|
|
3571
3664
|
DEFAULT_VERTICAL_ALIGN,
|
|
3665
|
+
DEFAULT_ZOOM,
|
|
3572
3666
|
DOUBLE_TAP_POSITION_THRESHOLD,
|
|
3573
3667
|
DRAGGING_THRESHOLD,
|
|
3574
3668
|
Debug,
|
|
3575
3669
|
EDITOR_LS_KEYS,
|
|
3576
3670
|
ELEMENT_LINK_KEY,
|
|
3671
|
+
ELEMENT_PENDING_DRAW_SHAPE_OPACITY,
|
|
3577
3672
|
ELEMENT_READY_TO_ERASE_OPACITY,
|
|
3578
3673
|
ELEMENT_SHIFT_TRANSLATE_AMOUNT,
|
|
3579
3674
|
ELEMENT_TRANSLATE_AMOUNT,
|
|
@@ -3590,7 +3685,9 @@ export {
|
|
|
3590
3685
|
FONT_FAMILY_GENERIC_FALLBACKS,
|
|
3591
3686
|
FONT_METADATA,
|
|
3592
3687
|
FONT_SIZES,
|
|
3688
|
+
FONT_TOP_PICKS_SLOTS,
|
|
3593
3689
|
FRAME_STYLE,
|
|
3690
|
+
FREEDRAW_STROKE_WIDTH,
|
|
3594
3691
|
GOOGLE_FONTS_RANGES,
|
|
3595
3692
|
HYPERLINK_TOOLTIP_DELAY,
|
|
3596
3693
|
IDLE_THRESHOLD,
|
|
@@ -3603,7 +3700,6 @@ export {
|
|
|
3603
3700
|
LINE_CONFIRM_THRESHOLD,
|
|
3604
3701
|
LINE_POLYGON_POINT_MERGE_DISTANCE,
|
|
3605
3702
|
LOCAL_FONT_PROTOCOL,
|
|
3606
|
-
MAX_ALLOWED_FILE_BYTES,
|
|
3607
3703
|
MAX_CUSTOM_COLORS_USED_IN_CANVAS,
|
|
3608
3704
|
MAX_DECIMALS_FOR_SVG_EXPORT,
|
|
3609
3705
|
MAX_ZOOM,
|
|
@@ -3633,14 +3729,31 @@ export {
|
|
|
3633
3729
|
SHIFT_LOCKING_ANGLE,
|
|
3634
3730
|
SIDE_RESIZING_THRESHOLD,
|
|
3635
3731
|
STATS_PANELS,
|
|
3732
|
+
STICKY_NOTE_BACKGROUND_PICKS,
|
|
3733
|
+
STICKY_NOTE_BODY_INSET_Y,
|
|
3734
|
+
STICKY_NOTE_EDGE_SHADOW_OPACITY,
|
|
3735
|
+
STICKY_NOTE_EDGE_SHADOW_WIDTH,
|
|
3736
|
+
STICKY_NOTE_FALLBACK_FONT_SIZE,
|
|
3737
|
+
STICKY_NOTE_FONT_STEP,
|
|
3738
|
+
STICKY_NOTE_FOOTER,
|
|
3739
|
+
STICKY_NOTE_MAX_FONT_SIZE,
|
|
3740
|
+
STICKY_NOTE_MIN_FONT_SIZE,
|
|
3741
|
+
STICKY_NOTE_MIN_SIZE,
|
|
3742
|
+
STICKY_NOTE_PADDING,
|
|
3743
|
+
STICKY_NOTE_SHADOW_OFFSET,
|
|
3744
|
+
STICKY_NOTE_SHADOW_OPACITY,
|
|
3745
|
+
STICKY_NOTE_STROKE_PICKS,
|
|
3636
3746
|
STRING_MIME_TYPES,
|
|
3637
3747
|
STROKE_WIDTH,
|
|
3748
|
+
STROKE_WIDTH_KEYS,
|
|
3638
3749
|
SVG_DOCUMENT_PREAMBLE,
|
|
3639
3750
|
SVG_NS,
|
|
3640
3751
|
TAP_TWICE_TIMEOUT,
|
|
3641
3752
|
TEXT_ALIGN,
|
|
3642
3753
|
TEXT_AUTOWRAP_THRESHOLD,
|
|
3754
|
+
TEXT_MAX_WRAP_WIDTH,
|
|
3643
3755
|
TEXT_TO_CENTER_SNAP_THRESHOLD,
|
|
3756
|
+
TEXT_VIEWPORT_PADDING,
|
|
3644
3757
|
THEME,
|
|
3645
3758
|
TITLE_TIMEOUT,
|
|
3646
3759
|
TOOL_TYPE,
|
|
@@ -3654,6 +3767,7 @@ export {
|
|
|
3654
3767
|
VersionedSnapshotStore,
|
|
3655
3768
|
WINDOWS_EMOJI_FALLBACK_FONT,
|
|
3656
3769
|
YOUTUBE_STATES,
|
|
3770
|
+
ZEN_MODE_TRANSITION_DURATION,
|
|
3657
3771
|
ZOOM_STEP,
|
|
3658
3772
|
addEventListener,
|
|
3659
3773
|
allowFullScreen,
|
|
@@ -3675,7 +3789,6 @@ export {
|
|
|
3675
3789
|
deriveStylesPanelMode,
|
|
3676
3790
|
distance,
|
|
3677
3791
|
easeOut,
|
|
3678
|
-
easeToValuesRAF,
|
|
3679
3792
|
escapeDoubleQuotes,
|
|
3680
3793
|
exitFullScreen,
|
|
3681
3794
|
findIndex,
|
|
@@ -3696,10 +3809,12 @@ export {
|
|
|
3696
3809
|
getLineHeight,
|
|
3697
3810
|
getNearestScrollableContainer,
|
|
3698
3811
|
getSizeFromPoints,
|
|
3812
|
+
getStrokeWidthByKey,
|
|
3699
3813
|
getSvgPathFromStroke,
|
|
3700
3814
|
getUpdatedTimestamp,
|
|
3701
3815
|
getVersion,
|
|
3702
3816
|
getVerticalOffset,
|
|
3817
|
+
hasRTLChars,
|
|
3703
3818
|
invariant,
|
|
3704
3819
|
isAndroid,
|
|
3705
3820
|
isAnyTrue,
|
|
@@ -3719,6 +3834,7 @@ export {
|
|
|
3719
3834
|
isLocalLink,
|
|
3720
3835
|
isMemberOf,
|
|
3721
3836
|
isMobileBreakpoint,
|
|
3837
|
+
isOpaqueColor,
|
|
3722
3838
|
isPrimitive,
|
|
3723
3839
|
isProdEnv,
|
|
3724
3840
|
isPromiseLike,
|
|
@@ -3752,6 +3868,7 @@ export {
|
|
|
3752
3868
|
randomId,
|
|
3753
3869
|
randomInteger,
|
|
3754
3870
|
reduceToCommonValue,
|
|
3871
|
+
removeDarkModeFilter,
|
|
3755
3872
|
removeSelection,
|
|
3756
3873
|
rescalePoints,
|
|
3757
3874
|
reseed,
|
|
@@ -3759,7 +3876,9 @@ export {
|
|
|
3759
3876
|
rgbToHex2 as rgbToHex,
|
|
3760
3877
|
safelyParseJSON,
|
|
3761
3878
|
sceneCoordsToViewportCoords,
|
|
3879
|
+
seededRandom,
|
|
3762
3880
|
selectNode,
|
|
3881
|
+
setColorAlpha,
|
|
3763
3882
|
setDateTimeForTests,
|
|
3764
3883
|
setDesktopUIMode,
|
|
3765
3884
|
setFeatureFlag,
|