mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Merge branch 'master' into mrazator/separate-element-into-standalone-package
This commit is contained in:
commit
e50f78e9d2
15 changed files with 50 additions and 48 deletions
|
@ -1,6 +1,6 @@
|
|||
import throttle from "lodash.throttle";
|
||||
|
||||
import { ENV, arrayToMap } from "@excalidraw/common";
|
||||
import { arrayToMap, isDevEnv, isTestEnv } from "@excalidraw/common";
|
||||
|
||||
import {
|
||||
orderByFractionalIndex,
|
||||
|
@ -49,11 +49,7 @@ const validateIndicesThrottled = throttle(
|
|||
localElements: readonly OrderedExcalidrawElement[],
|
||||
remoteElements: readonly RemoteExcalidrawElement[],
|
||||
) => {
|
||||
if (
|
||||
import.meta.env.DEV ||
|
||||
import.meta.env.MODE === ENV.TEST ||
|
||||
window?.DEBUG_FRACTIONAL_INDICES
|
||||
) {
|
||||
if (isDevEnv() || isTestEnv() || window?.DEBUG_FRACTIONAL_INDICES) {
|
||||
// create new instances due to the mutation
|
||||
const elements = syncInvalidIndices(
|
||||
orderedElements.map((x) => ({ ...x })),
|
||||
|
@ -61,9 +57,7 @@ const validateIndicesThrottled = throttle(
|
|||
|
||||
validateFractionalIndices(elements, {
|
||||
// throw in dev & test only, to remain functional on `DEBUG_FRACTIONAL_INDICES`
|
||||
shouldThrow: Boolean(
|
||||
import.meta.env.DEV || import.meta.env.MODE === ENV.TEST,
|
||||
),
|
||||
shouldThrow: isTestEnv() || isDevEnv(),
|
||||
includeBoundTextValidation: true,
|
||||
reconciliationContext: {
|
||||
localElements,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue