Merge remote-tracking branch 'upstream/master' into rjhear/chore/fix-spelling

This commit is contained in:
Raymond Hear 2025-03-31 09:31:27 -04:00
commit e7ab347f15
No known key found for this signature in database
GPG key ID: 356C46FDED878433
10 changed files with 68 additions and 51 deletions

View file

@ -48,3 +48,6 @@ UNWEjuqNMi/lwAErS9fFa2oJlWyT8U7zzv/5kQREkxZI6y9v0AF3qcbsy2731FnD
s9ChJvOUW9toIab2gsIdrKW8ZNpu084ZFVKb6LNjvIXI1Se4oMTHeszXzNptzlot
kdxxjOoaQMAyfljFSot1F1FlU6MQlag7UnFGvFjRHN1JI5q4K+n3a67DX+TMyRqS
HQIDAQAB'
# set to true in .env.development.local to disable the prevent unload dialog
VITE_APP_DISABLE_PREVENT_UNLOAD=

View file

@ -608,7 +608,13 @@ const ExcalidrawWrapper = () => {
excalidrawAPI.getSceneElements(),
)
) {
preventUnload(event);
if (import.meta.env.VITE_APP_DISABLE_PREVENT_UNLOAD !== "true") {
preventUnload(event);
} else {
console.warn(
"preventing unload disabled (VITE_APP_DISABLE_PREVENT_UNLOAD)",
);
}
}
};
window.addEventListener(EVENT.BEFORE_UNLOAD, unloadHandler);

View file

@ -301,7 +301,13 @@ class Collab extends PureComponent<CollabProps, CollabState> {
// the purpose is to run in immediately after user decides to stay
this.saveCollabRoomToFirebase(syncableElements);
preventUnload(event);
if (import.meta.env.VITE_APP_DISABLE_PREVENT_UNLOAD !== "true") {
preventUnload(event);
} else {
console.warn(
"preventing unload disabled (VITE_APP_DISABLE_PREVENT_UNLOAD)",
);
}
}
});

View file

@ -15,7 +15,7 @@
.color-picker-container {
display: grid;
grid-template-columns: 1fr 20px 1.625rem;
grid-template-columns: 1fr 8px 1.625rem;
padding: 0.25rem 0px;
align-items: center;
@ -30,13 +30,14 @@
}
.color-picker__button {
--radius: 0.25rem;
--radius: 6px;
--size: 1.375rem;
padding: 0;
margin: 0;
width: 1.35rem;
height: 1.35rem;
border: 1px solid var(--color-gray-30);
margin: 1px;
width: var(--size);
height: var(--size);
border: 0;
border-radius: var(--radius);
filter: var(--theme-filter);
background-color: var(--swatch-color);
@ -45,16 +46,16 @@
font-family: inherit;
box-sizing: border-box;
&:hover {
&:hover:not(.active) {
&::after {
content: "";
position: absolute;
top: -2px;
left: -2px;
right: -2px;
bottom: -2px;
box-shadow: 0 0 0 1px var(--color-gray-30);
border-radius: calc(var(--radius) + 1px);
top: 0;
left: 0;
right: 0;
bottom: 0;
box-shadow: 0 0 0 1px var(--swatch-color);
border-radius: var(--radius);
filter: var(--theme-filter);
}
}
@ -62,10 +63,11 @@
&.active {
.color-picker__button-outline {
position: absolute;
top: -2px;
left: -2px;
right: -2px;
bottom: -2px;
--offset: -1px;
top: var(--offset);
left: var(--offset);
right: var(--offset);
bottom: var(--offset);
box-shadow: 0 0 0 1px var(--color-primary-darkest);
z-index: 1; // due hover state so this has preference
border-radius: calc(var(--radius) + 1px);

View file

@ -6,7 +6,7 @@
.range-wrapper {
position: relative;
padding-top: 10px;
padding-bottom: 30px;
padding-bottom: 25px;
}
.range-input {

View file

@ -2,10 +2,12 @@
.drag-input-container {
display: flex;
width: 100%;
border-radius: var(--border-radius-lg);
&:focus-within {
box-shadow: 0 0 0 1px var(--color-primary-darkest);
border-radius: var(--border-radius-md);
background: transparent;
}
}
@ -16,24 +18,14 @@
.drag-input-label {
flex-shrink: 0;
border: 1px solid var(--default-border-color);
border-right: 0;
padding: 0 0.5rem 0 0.75rem;
border: 0;
padding: 0 0.5rem 0 0.25rem;
min-width: 1rem;
width: 1.5rem;
height: 2rem;
box-sizing: border-box;
box-sizing: content-box;
color: var(--popup-text-color);
:root[dir="ltr"] & {
border-radius: var(--border-radius-md) 0 0 var(--border-radius-md);
}
:root[dir="rtl"] & {
border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
border-right: 1px solid var(--default-border-color);
border-left: 0;
}
display: flex;
align-items: center;
justify-content: center;
@ -51,20 +43,8 @@
border: 0;
outline: none;
height: 2rem;
border: 1px solid var(--default-border-color);
border-left: 0;
letter-spacing: 0.4px;
:root[dir="ltr"] & {
border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
}
:root[dir="rtl"] & {
border-radius: var(--border-radius-md) 0 0 var(--border-radius-md);
border-left: 1px solid var(--default-border-color);
border-right: 0;
}
padding: 0.5rem;
padding-left: 0.25rem;
appearance: none;

View file

@ -41,6 +41,10 @@
div + div {
text-align: right;
}
&:empty {
display: none;
}
}
&__row--heading {

View file

@ -289,7 +289,11 @@ export const StatsInner = memo(
</StatsRow>
)}
<StatsRow heading data-testid="stats-element-type">
<StatsRow
heading
data-testid="stats-element-type"
style={{ margin: "0.3125rem 0" }}
>
{appState.croppingElementId
? t("labels.imageCropping")
: t(`element.${singleElement.type}`)}

View file

@ -173,7 +173,7 @@ body.excalidraw-cursor-resize * {
.buttonList {
flex-wrap: wrap;
display: flex;
column-gap: 0.5rem;
column-gap: 0.375rem;
row-gap: 0.5rem;
label {
@ -386,10 +386,16 @@ body.excalidraw-cursor-resize * {
.App-menu__left {
overflow-y: auto;
padding: 0.75rem;
width: 12.5rem;
padding: 0.75rem 0.75rem 0.25rem 0.75rem;
width: 11.875rem;
box-sizing: border-box;
position: absolute;
.buttonList label,
.buttonList button,
.buttonList .zIndexButton {
--button-bg: transparent;
}
}
.dropdown-select {

View file

@ -221,7 +221,7 @@ const restoreElementWithProperties = <
"customData" in extra ? extra.customData : element.customData;
}
return {
const ret = {
// spread the original element properties to not lose unknown ones
// for forward-compatibility
...element,
@ -230,6 +230,12 @@ const restoreElementWithProperties = <
...getNormalizedDimensions(base),
...extra,
} as unknown as T;
// strip legacy props (migrated in previous steps)
delete ret.strokeSharpness;
delete ret.boundElementIds;
return ret;
};
const restoreElement = (