@excalidraw/common 0.18.0-c65b684e9 → 0.18.0-d1f3982
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 +178 -44
- package/dist/dev/index.js.map +3 -3
- package/dist/prod/index.js +3 -3
- package/dist/types/common/src/constants.d.ts +18 -15
- package/dist/types/common/src/editorInterface.d.ts +34 -0
- package/dist/types/common/src/index.d.ts +1 -0
- package/dist/types/common/src/utils.d.ts +2 -1
- package/dist/types/element/src/Scene.d.ts +6 -2
- package/dist/types/element/src/bounds.d.ts +1 -1
- package/dist/types/element/src/delta.d.ts +6 -4
- package/dist/types/element/src/index.d.ts +1 -0
- package/dist/types/element/src/positionElementsOnGrid.d.ts +2 -0
- package/dist/types/element/src/renderElement.d.ts +4 -1
- package/dist/types/element/src/resizeTest.d.ts +5 -4
- package/dist/types/element/src/store.d.ts +6 -1
- package/dist/types/element/src/textElement.d.ts +1 -1
- package/dist/types/element/src/transformHandles.d.ts +5 -4
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +21 -9
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +14 -6
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +94 -54
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +42 -18
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +7 -3
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +22 -10
- package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +7 -3
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +14 -6
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +7 -3
- package/dist/types/excalidraw/actions/actionExport.d.ts +63 -27
- package/dist/types/excalidraw/actions/actionFinalize.d.ts +14 -6
- package/dist/types/excalidraw/actions/actionFrame.d.ts +28 -12
- package/dist/types/excalidraw/actions/actionGroup.d.ts +14 -6
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +8 -4
- package/dist/types/excalidraw/actions/actionLink.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionMenu.d.ts +7 -369
- package/dist/types/excalidraw/actions/actionNavigate.d.ts +14 -6
- package/dist/types/excalidraw/actions/actionProperties.d.ts +122 -53
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +7 -3
- package/dist/types/excalidraw/actions/actionStyles.d.ts +7 -3
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +7 -3
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +7 -3
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +7 -3
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +7 -3
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +7 -3
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +7 -3
- package/dist/types/excalidraw/actions/index.d.ts +2 -2
- package/dist/types/excalidraw/actions/types.d.ts +1 -1
- package/dist/types/excalidraw/appState.d.ts +5 -1
- package/dist/types/excalidraw/clipboard.d.ts +64 -1
- package/dist/types/excalidraw/components/Actions.d.ts +17 -3
- package/dist/types/excalidraw/components/App.d.ts +28 -23
- package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +2 -0
- package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +2 -1
- package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +2 -1
- package/dist/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +1 -0
- package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +1 -1
- package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +2 -1
- package/dist/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +3 -1
- package/dist/types/excalidraw/components/HintViewer.d.ts +4 -3
- package/dist/types/excalidraw/components/InlineIcon.d.ts +3 -1
- package/dist/types/excalidraw/components/LayerUI.d.ts +2 -1
- package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +1 -1
- package/dist/types/excalidraw/components/MobileMenu.d.ts +3 -5
- package/dist/types/excalidraw/components/MobileToolBar.d.ts +11 -0
- package/dist/types/excalidraw/components/Popover.d.ts +2 -1
- package/dist/types/excalidraw/components/PropertiesPopover.d.ts +1 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +1 -2
- package/dist/types/excalidraw/components/TextField.d.ts +1 -0
- package/dist/types/excalidraw/components/ToolPopover.d.ts +25 -0
- package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +3 -2
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +4 -2
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +2 -1
- package/dist/types/excalidraw/components/icons.d.ts +5 -0
- package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +13 -1
- package/dist/types/excalidraw/components/main-menu/MainMenu.d.ts +0 -3
- package/dist/types/excalidraw/components/shapes.d.ts +129 -1
- package/dist/types/excalidraw/data/blob.d.ts +3 -7
- package/dist/types/excalidraw/data/reconcile.d.ts +1 -0
- package/dist/types/excalidraw/data/restore.d.ts +6 -1
- package/dist/types/excalidraw/data/types.d.ts +4 -1
- package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
- package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +14 -0
- package/dist/types/excalidraw/index.d.ts +3 -4
- package/dist/types/excalidraw/renderer/interactiveScene.d.ts +1 -1
- package/dist/types/excalidraw/scene/types.d.ts +3 -3
- package/dist/types/excalidraw/shortcut.d.ts +1 -0
- package/dist/types/excalidraw/types.d.ts +23 -17
- package/dist/types/math/src/segment.d.ts +1 -0
- package/package.json +1 -1
package/dist/dev/index.js
CHANGED
|
@@ -281,49 +281,48 @@ var BinaryHeap = class {
|
|
|
281
281
|
content = [];
|
|
282
282
|
sinkDown(idx) {
|
|
283
283
|
const node = this.content[idx];
|
|
284
|
+
const nodeScore = this.scoreFunction(node);
|
|
284
285
|
while (idx > 0) {
|
|
285
286
|
const parentN = (idx + 1 >> 1) - 1;
|
|
286
287
|
const parent = this.content[parentN];
|
|
287
|
-
if (
|
|
288
|
-
this.content[parentN] = node;
|
|
288
|
+
if (nodeScore < this.scoreFunction(parent)) {
|
|
289
289
|
this.content[idx] = parent;
|
|
290
290
|
idx = parentN;
|
|
291
291
|
} else {
|
|
292
292
|
break;
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
|
+
this.content[idx] = node;
|
|
295
296
|
}
|
|
296
297
|
bubbleUp(idx) {
|
|
297
298
|
const length = this.content.length;
|
|
298
299
|
const node = this.content[idx];
|
|
299
300
|
const score = this.scoreFunction(node);
|
|
300
301
|
while (true) {
|
|
301
|
-
const
|
|
302
|
-
const
|
|
303
|
-
let
|
|
304
|
-
let
|
|
302
|
+
const child1N = (idx + 1 << 1) - 1;
|
|
303
|
+
const child2N = child1N + 1;
|
|
304
|
+
let smallestIdx = idx;
|
|
305
|
+
let smallestScore = score;
|
|
305
306
|
if (child1N < length) {
|
|
306
|
-
const
|
|
307
|
-
child1Score
|
|
308
|
-
|
|
309
|
-
|
|
307
|
+
const child1Score = this.scoreFunction(this.content[child1N]);
|
|
308
|
+
if (child1Score < smallestScore) {
|
|
309
|
+
smallestIdx = child1N;
|
|
310
|
+
smallestScore = child1Score;
|
|
310
311
|
}
|
|
311
312
|
}
|
|
312
313
|
if (child2N < length) {
|
|
313
|
-
const
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
swap = child2N;
|
|
314
|
+
const child2Score = this.scoreFunction(this.content[child2N]);
|
|
315
|
+
if (child2Score < smallestScore) {
|
|
316
|
+
smallestIdx = child2N;
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
|
-
if (
|
|
320
|
-
this.content[idx] = this.content[swap];
|
|
321
|
-
this.content[swap] = node;
|
|
322
|
-
idx = swap;
|
|
323
|
-
} else {
|
|
319
|
+
if (smallestIdx === idx) {
|
|
324
320
|
break;
|
|
325
321
|
}
|
|
322
|
+
this.content[idx] = this.content[smallestIdx];
|
|
323
|
+
idx = smallestIdx;
|
|
326
324
|
}
|
|
325
|
+
this.content[idx] = node;
|
|
327
326
|
}
|
|
328
327
|
push(node) {
|
|
329
328
|
this.content.push(node);
|
|
@@ -641,15 +640,6 @@ var rgbToHex = (r, g, b) => `#${((1 << 24) + (r << 16) + (g << 8) + b).toString(
|
|
|
641
640
|
|
|
642
641
|
// src/constants.ts
|
|
643
642
|
init_define_import_meta_env();
|
|
644
|
-
var isDarwin = /Mac|iPod|iPhone|iPad/.test(navigator.platform);
|
|
645
|
-
var isWindows = /^Win/.test(navigator.platform);
|
|
646
|
-
var isAndroid = /\b(android)\b/i.test(navigator.userAgent);
|
|
647
|
-
var isFirefox = typeof window !== "undefined" && "netscape" in window && navigator.userAgent.indexOf("rv:") > 1 && navigator.userAgent.indexOf("Gecko") > 1;
|
|
648
|
-
var isChrome = navigator.userAgent.indexOf("Chrome") !== -1;
|
|
649
|
-
var isSafari = !isChrome && navigator.userAgent.indexOf("Safari") !== -1;
|
|
650
|
-
var isIOS = /iPad|iPhone/.test(navigator.platform) || // iPadOS 13+
|
|
651
|
-
navigator.userAgent.includes("Mac") && "ontouchend" in document;
|
|
652
|
-
var isBrave = () => navigator.brave?.isBrave?.name === "isBrave";
|
|
653
643
|
var supportsResizeObserver = typeof window !== "undefined" && "ResizeObserver" in window;
|
|
654
644
|
var APP_NAME = "Excalidraw";
|
|
655
645
|
var TEXT_AUTOWRAP_THRESHOLD = 36;
|
|
@@ -731,10 +721,12 @@ var ENV = {
|
|
|
731
721
|
PRODUCTION: "production"
|
|
732
722
|
};
|
|
733
723
|
var CLASSES = {
|
|
724
|
+
SIDEBAR: "sidebar",
|
|
734
725
|
SHAPE_ACTIONS_MENU: "App-menu__left",
|
|
735
726
|
ZOOM_ACTIONS: "zoom-actions",
|
|
736
727
|
SEARCH_MENU_INPUT_WRAPPER: "layer-ui__search-inputWrapper",
|
|
737
|
-
CONVERT_ELEMENT_TYPE_POPUP: "ConvertElementTypePopup"
|
|
728
|
+
CONVERT_ELEMENT_TYPE_POPUP: "ConvertElementTypePopup",
|
|
729
|
+
SHAPE_ACTIONS_THEME_SCOPE: "shape-actions-theme-scope"
|
|
738
730
|
};
|
|
739
731
|
var CJK_HAND_DRAWN_FALLBACK_FONT = "Xiaolai";
|
|
740
732
|
var WINDOWS_EMOJI_FALLBACK_FONT = "Segoe UI Emoji";
|
|
@@ -829,13 +821,19 @@ var IMAGE_MIME_TYPES = {
|
|
|
829
821
|
avif: "image/avif",
|
|
830
822
|
jfif: "image/jfif"
|
|
831
823
|
};
|
|
832
|
-
var
|
|
824
|
+
var STRING_MIME_TYPES = {
|
|
833
825
|
text: "text/plain",
|
|
834
826
|
html: "text/html",
|
|
835
827
|
json: "application/json",
|
|
836
828
|
// excalidraw data
|
|
837
829
|
excalidraw: "application/vnd.excalidraw+json",
|
|
830
|
+
// LEGACY: fully-qualified library JSON data
|
|
838
831
|
excalidrawlib: "application/vnd.excalidrawlib+json",
|
|
832
|
+
// list of excalidraw library item ids
|
|
833
|
+
excalidrawlibIds: "application/vnd.excalidrawlib.ids+json"
|
|
834
|
+
};
|
|
835
|
+
var MIME_TYPES = {
|
|
836
|
+
...STRING_MIME_TYPES,
|
|
839
837
|
// image-encoded excalidraw data
|
|
840
838
|
"excalidraw.svg": "image/svg+xml",
|
|
841
839
|
"excalidraw.png": "image/png",
|
|
@@ -894,10 +892,6 @@ var DEFAULT_UI_OPTIONS = {
|
|
|
894
892
|
image: true
|
|
895
893
|
}
|
|
896
894
|
};
|
|
897
|
-
var MQ_MAX_WIDTH_PORTRAIT = 730;
|
|
898
|
-
var MQ_MAX_WIDTH_LANDSCAPE = 1e3;
|
|
899
|
-
var MQ_MAX_HEIGHT_LANDSCAPE = 500;
|
|
900
|
-
var MQ_RIGHT_SIDEBAR_MIN_WIDTH = 1229;
|
|
901
895
|
var MAX_DECIMALS_FOR_SVG_EXPORT = 2;
|
|
902
896
|
var EXPORT_SCALES = [1, 2, 3];
|
|
903
897
|
var DEFAULT_EXPORT_PADDING = 10;
|
|
@@ -1017,6 +1011,10 @@ var UserIdleState = /* @__PURE__ */ ((UserIdleState2) => {
|
|
|
1017
1011
|
return UserIdleState2;
|
|
1018
1012
|
})(UserIdleState || {});
|
|
1019
1013
|
var LINE_POLYGON_POINT_MERGE_DISTANCE = 20;
|
|
1014
|
+
var DOUBLE_TAP_POSITION_THRESHOLD = 35;
|
|
1015
|
+
var MOBILE_ACTION_BUTTON_BG = {
|
|
1016
|
+
background: "var(--mobile-action-button-bg)"
|
|
1017
|
+
};
|
|
1020
1018
|
|
|
1021
1019
|
// src/font-metadata.ts
|
|
1022
1020
|
init_define_import_meta_env();
|
|
@@ -1172,6 +1170,133 @@ var Queue = class {
|
|
|
1172
1170
|
|
|
1173
1171
|
// src/keys.ts
|
|
1174
1172
|
init_define_import_meta_env();
|
|
1173
|
+
|
|
1174
|
+
// src/editorInterface.ts
|
|
1175
|
+
init_define_import_meta_env();
|
|
1176
|
+
var DESKTOP_UI_MODE_STORAGE_KEY = "excalidraw.desktopUIMode";
|
|
1177
|
+
var MQ_MAX_MOBILE = 599;
|
|
1178
|
+
var MQ_MAX_WIDTH_LANDSCAPE = 1e3;
|
|
1179
|
+
var MQ_MAX_HEIGHT_LANDSCAPE = 500;
|
|
1180
|
+
var MQ_MIN_TABLET = MQ_MAX_MOBILE + 1;
|
|
1181
|
+
var MQ_MAX_TABLET = 1400;
|
|
1182
|
+
var MQ_MIN_WIDTH_DESKTOP = 1440;
|
|
1183
|
+
var MQ_RIGHT_SIDEBAR_MIN_WIDTH = 1229;
|
|
1184
|
+
var isDarwin = /Mac|iPod|iPhone|iPad/.test(navigator.platform);
|
|
1185
|
+
var isWindows = /^Win/.test(navigator.platform);
|
|
1186
|
+
var isAndroid = /\b(android)\b/i.test(navigator.userAgent);
|
|
1187
|
+
var isFirefox = typeof window !== "undefined" && "netscape" in window && navigator.userAgent.indexOf("rv:") > 1 && navigator.userAgent.indexOf("Gecko") > 1;
|
|
1188
|
+
var isChrome = navigator.userAgent.indexOf("Chrome") !== -1;
|
|
1189
|
+
var isSafari = !isChrome && navigator.userAgent.indexOf("Safari") !== -1;
|
|
1190
|
+
var isIOS = /iPad|iPhone/i.test(navigator.platform) || // iPadOS 13+
|
|
1191
|
+
navigator.userAgent.includes("Mac") && "ontouchend" in document;
|
|
1192
|
+
var isBrave = () => navigator.brave?.isBrave?.name === "isBrave";
|
|
1193
|
+
var isMobileBreakpoint = (width, height) => {
|
|
1194
|
+
return width <= MQ_MAX_MOBILE || height < MQ_MAX_HEIGHT_LANDSCAPE && width < MQ_MAX_WIDTH_LANDSCAPE;
|
|
1195
|
+
};
|
|
1196
|
+
var isTabletBreakpoint = (editorWidth, editorHeight) => {
|
|
1197
|
+
const minSide = Math.min(editorWidth, editorHeight);
|
|
1198
|
+
const maxSide = Math.max(editorWidth, editorHeight);
|
|
1199
|
+
return minSide >= MQ_MIN_TABLET && maxSide <= MQ_MAX_TABLET;
|
|
1200
|
+
};
|
|
1201
|
+
var isMobileOrTablet = () => {
|
|
1202
|
+
const ua = navigator.userAgent || "";
|
|
1203
|
+
const platform = navigator.platform || "";
|
|
1204
|
+
const uaData = navigator.userAgentData;
|
|
1205
|
+
if (uaData) {
|
|
1206
|
+
const plat = (uaData.platform || "").toLowerCase();
|
|
1207
|
+
const isDesktopOS = plat === "windows" || plat === "macos" || plat === "linux" || plat === "chrome os";
|
|
1208
|
+
if (uaData.mobile === true) {
|
|
1209
|
+
return true;
|
|
1210
|
+
}
|
|
1211
|
+
if (uaData.mobile === false && plat === "android") {
|
|
1212
|
+
const looksTouchTablet = matchMedia?.("(hover: none)").matches && matchMedia?.("(pointer: coarse)").matches;
|
|
1213
|
+
return looksTouchTablet;
|
|
1214
|
+
}
|
|
1215
|
+
if (isDesktopOS) {
|
|
1216
|
+
return false;
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
if (isIOS) {
|
|
1220
|
+
return true;
|
|
1221
|
+
}
|
|
1222
|
+
if (isAndroid) {
|
|
1223
|
+
const isAndroidPhone = /Mobile/i.test(ua);
|
|
1224
|
+
const isAndroidTablet = !isAndroidPhone;
|
|
1225
|
+
if (isAndroidPhone || isAndroidTablet) {
|
|
1226
|
+
const looksTouchTablet = matchMedia?.("(hover: none)").matches && matchMedia?.("(pointer: coarse)").matches;
|
|
1227
|
+
return looksTouchTablet;
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
const looksDesktopPlatform = /Win|Linux|CrOS|Mac/.test(platform) || /Windows NT|X11|CrOS|Macintosh/.test(ua);
|
|
1231
|
+
if (looksDesktopPlatform) {
|
|
1232
|
+
return false;
|
|
1233
|
+
}
|
|
1234
|
+
return false;
|
|
1235
|
+
};
|
|
1236
|
+
var getFormFactor = (editorWidth, editorHeight) => {
|
|
1237
|
+
if (isMobileBreakpoint(editorWidth, editorHeight)) {
|
|
1238
|
+
return "phone";
|
|
1239
|
+
}
|
|
1240
|
+
if (isTabletBreakpoint(editorWidth, editorHeight)) {
|
|
1241
|
+
return "tablet";
|
|
1242
|
+
}
|
|
1243
|
+
return "desktop";
|
|
1244
|
+
};
|
|
1245
|
+
var deriveStylesPanelMode = (editorInterface) => {
|
|
1246
|
+
if (editorInterface.formFactor === "phone") {
|
|
1247
|
+
return "mobile";
|
|
1248
|
+
}
|
|
1249
|
+
if (editorInterface.formFactor === "tablet") {
|
|
1250
|
+
return "compact";
|
|
1251
|
+
}
|
|
1252
|
+
return editorInterface.desktopUIMode;
|
|
1253
|
+
};
|
|
1254
|
+
var createUserAgentDescriptor = (userAgentString) => {
|
|
1255
|
+
const normalizedUA = userAgentString ?? "";
|
|
1256
|
+
let platform = "unknown";
|
|
1257
|
+
if (isIOS) {
|
|
1258
|
+
platform = "ios";
|
|
1259
|
+
} else if (isAndroid) {
|
|
1260
|
+
platform = "android";
|
|
1261
|
+
} else if (normalizedUA) {
|
|
1262
|
+
platform = "other";
|
|
1263
|
+
}
|
|
1264
|
+
return {
|
|
1265
|
+
isMobileDevice: isMobileOrTablet(),
|
|
1266
|
+
platform
|
|
1267
|
+
};
|
|
1268
|
+
};
|
|
1269
|
+
var loadDesktopUIModePreference = () => {
|
|
1270
|
+
if (typeof window === "undefined") {
|
|
1271
|
+
return null;
|
|
1272
|
+
}
|
|
1273
|
+
try {
|
|
1274
|
+
const stored = window.localStorage.getItem(DESKTOP_UI_MODE_STORAGE_KEY);
|
|
1275
|
+
if (stored === "compact" || stored === "full") {
|
|
1276
|
+
return stored;
|
|
1277
|
+
}
|
|
1278
|
+
} catch (error) {
|
|
1279
|
+
}
|
|
1280
|
+
return null;
|
|
1281
|
+
};
|
|
1282
|
+
var persistDesktopUIMode = (mode) => {
|
|
1283
|
+
if (typeof window === "undefined") {
|
|
1284
|
+
return;
|
|
1285
|
+
}
|
|
1286
|
+
try {
|
|
1287
|
+
window.localStorage.setItem(DESKTOP_UI_MODE_STORAGE_KEY, mode);
|
|
1288
|
+
} catch (error) {
|
|
1289
|
+
}
|
|
1290
|
+
};
|
|
1291
|
+
var setDesktopUIMode = (mode) => {
|
|
1292
|
+
if (mode !== "compact" && mode !== "full") {
|
|
1293
|
+
return;
|
|
1294
|
+
}
|
|
1295
|
+
persistDesktopUIMode(mode);
|
|
1296
|
+
return mode;
|
|
1297
|
+
};
|
|
1298
|
+
|
|
1299
|
+
// src/keys.ts
|
|
1175
1300
|
var CODES = {
|
|
1176
1301
|
EQUAL: "Equal",
|
|
1177
1302
|
MINUS: "Minus",
|
|
@@ -1417,7 +1542,7 @@ var isInteractive = (target) => {
|
|
|
1417
1542
|
return isInputLike(target) || target instanceof Element && !!target.closest("label, button");
|
|
1418
1543
|
};
|
|
1419
1544
|
var isWritableElement = (target) => target instanceof HTMLElement && target.dataset.type === "wysiwyg" || target instanceof HTMLBRElement || // newline in wysiwyg
|
|
1420
|
-
target instanceof HTMLTextAreaElement || target instanceof HTMLInputElement && (target.type === "text" || target.type === "number" || target.type === "password");
|
|
1545
|
+
target instanceof HTMLTextAreaElement || target instanceof HTMLInputElement && (target.type === "text" || target.type === "number" || target.type === "password" || target.type === "search");
|
|
1421
1546
|
var getFontFamilyString = ({
|
|
1422
1547
|
fontFamily
|
|
1423
1548
|
}) => {
|
|
@@ -1434,6 +1559,9 @@ var getFontString = ({
|
|
|
1434
1559
|
}) => {
|
|
1435
1560
|
return `${fontSize}px ${getFontFamilyString({ fontFamily })}`;
|
|
1436
1561
|
};
|
|
1562
|
+
var nextAnimationFrame = async (cb) => {
|
|
1563
|
+
requestAnimationFrame(() => requestAnimationFrame(cb));
|
|
1564
|
+
};
|
|
1437
1565
|
var debounce = (fn, timeout) => {
|
|
1438
1566
|
let handle = 0;
|
|
1439
1567
|
let lastArgs = null;
|
|
@@ -1619,13 +1747,6 @@ var updateActiveTool = (appState, data) => {
|
|
|
1619
1747
|
var isFullScreen = () => document.fullscreenElement?.nodeName === "HTML";
|
|
1620
1748
|
var allowFullScreen = () => document.documentElement.requestFullscreen();
|
|
1621
1749
|
var exitFullScreen = () => document.exitFullscreen();
|
|
1622
|
-
var getShortcutKey = (shortcut) => {
|
|
1623
|
-
shortcut = shortcut.replace(/\bAlt\b/i, "Alt").replace(/\bShift\b/i, "Shift").replace(/\b(Enter|Return)\b/i, "Enter");
|
|
1624
|
-
if (isDarwin) {
|
|
1625
|
-
return shortcut.replace(/\bCtrlOrCmd\b/gi, "Cmd").replace(/\bAlt\b/i, "Option");
|
|
1626
|
-
}
|
|
1627
|
-
return shortcut.replace(/\bCtrlOrCmd\b/gi, "Ctrl");
|
|
1628
|
-
};
|
|
1629
1750
|
var viewportCoordsToSceneCoords = ({ clientX, clientY }, {
|
|
1630
1751
|
zoom,
|
|
1631
1752
|
offsetLeft,
|
|
@@ -2189,6 +2310,7 @@ export {
|
|
|
2189
2310
|
DEFAULT_UI_OPTIONS,
|
|
2190
2311
|
DEFAULT_VERSION,
|
|
2191
2312
|
DEFAULT_VERTICAL_ALIGN,
|
|
2313
|
+
DOUBLE_TAP_POSITION_THRESHOLD,
|
|
2192
2314
|
DRAGGING_THRESHOLD,
|
|
2193
2315
|
EDITOR_LS_KEYS,
|
|
2194
2316
|
ELEMENTS_PALETTE_SHADE_INDEXES,
|
|
@@ -2230,10 +2352,14 @@ export {
|
|
|
2230
2352
|
MIN_FONT_SIZE,
|
|
2231
2353
|
MIN_WIDTH_OR_HEIGHT,
|
|
2232
2354
|
MIN_ZOOM,
|
|
2355
|
+
MOBILE_ACTION_BUTTON_BG,
|
|
2233
2356
|
MONOSPACE_GENERIC_FONT,
|
|
2234
2357
|
MQ_MAX_HEIGHT_LANDSCAPE,
|
|
2358
|
+
MQ_MAX_MOBILE,
|
|
2359
|
+
MQ_MAX_TABLET,
|
|
2235
2360
|
MQ_MAX_WIDTH_LANDSCAPE,
|
|
2236
|
-
|
|
2361
|
+
MQ_MIN_TABLET,
|
|
2362
|
+
MQ_MIN_WIDTH_DESKTOP,
|
|
2237
2363
|
MQ_RIGHT_SIDEBAR_MIN_WIDTH,
|
|
2238
2364
|
ORIG_ID,
|
|
2239
2365
|
POINTER_BUTTON,
|
|
@@ -2247,6 +2373,7 @@ export {
|
|
|
2247
2373
|
SHIFT_LOCKING_ANGLE,
|
|
2248
2374
|
SIDE_RESIZING_THRESHOLD,
|
|
2249
2375
|
STATS_PANELS,
|
|
2376
|
+
STRING_MIME_TYPES,
|
|
2250
2377
|
STROKE_WIDTH,
|
|
2251
2378
|
SVG_DOCUMENT_PREAMBLE,
|
|
2252
2379
|
SVG_NS,
|
|
@@ -2281,7 +2408,9 @@ export {
|
|
|
2281
2408
|
chunk,
|
|
2282
2409
|
cloneJSON,
|
|
2283
2410
|
composeEventHandlers,
|
|
2411
|
+
createUserAgentDescriptor,
|
|
2284
2412
|
debounce,
|
|
2413
|
+
deriveStylesPanelMode,
|
|
2285
2414
|
distance,
|
|
2286
2415
|
easeOut,
|
|
2287
2416
|
easeToValuesRAF,
|
|
@@ -2296,13 +2425,13 @@ export {
|
|
|
2296
2425
|
getFontFamilyFallbacks,
|
|
2297
2426
|
getFontFamilyString,
|
|
2298
2427
|
getFontString,
|
|
2428
|
+
getFormFactor,
|
|
2299
2429
|
getFrame,
|
|
2300
2430
|
getGenericFontFamilyFallback,
|
|
2301
2431
|
getGlobalCSSVariable,
|
|
2302
2432
|
getGridPoint,
|
|
2303
2433
|
getLineHeight,
|
|
2304
2434
|
getNearestScrollableContainer,
|
|
2305
|
-
getShortcutKey,
|
|
2306
2435
|
getSizeFromPoints,
|
|
2307
2436
|
getSpecificColorShades,
|
|
2308
2437
|
getSvgPathFromStroke,
|
|
@@ -2326,6 +2455,7 @@ export {
|
|
|
2326
2455
|
isLatinChar,
|
|
2327
2456
|
isLocalLink,
|
|
2328
2457
|
isMemberOf,
|
|
2458
|
+
isMobileBreakpoint,
|
|
2329
2459
|
isPrimitive,
|
|
2330
2460
|
isProdEnv,
|
|
2331
2461
|
isPromiseLike,
|
|
@@ -2335,16 +2465,19 @@ export {
|
|
|
2335
2465
|
isSafari,
|
|
2336
2466
|
isServerEnv,
|
|
2337
2467
|
isShallowEqual,
|
|
2468
|
+
isTabletBreakpoint,
|
|
2338
2469
|
isTestEnv,
|
|
2339
2470
|
isToolIcon,
|
|
2340
2471
|
isTransparent,
|
|
2341
2472
|
isWindows,
|
|
2342
2473
|
isWritableElement,
|
|
2474
|
+
loadDesktopUIModePreference,
|
|
2343
2475
|
mapFind,
|
|
2344
2476
|
matchKey,
|
|
2345
2477
|
memoize,
|
|
2346
2478
|
muteFSAbortError,
|
|
2347
2479
|
nFormatter,
|
|
2480
|
+
nextAnimationFrame,
|
|
2348
2481
|
normalizeEOL,
|
|
2349
2482
|
normalizeLink,
|
|
2350
2483
|
preventUnload,
|
|
@@ -2362,6 +2495,7 @@ export {
|
|
|
2362
2495
|
sceneCoordsToViewportCoords,
|
|
2363
2496
|
selectNode,
|
|
2364
2497
|
setDateTimeForTests,
|
|
2498
|
+
setDesktopUIMode,
|
|
2365
2499
|
shouldMaintainAspectRatio,
|
|
2366
2500
|
shouldResizeFromCenter,
|
|
2367
2501
|
shouldRotateWithDiscreteAngle,
|