Merged PR 167: Add Flex and fix bugs (read desc)

Note: The branch name does not fit the new features.

- Implement Flex with simplex
- Enable rigid body by default (removed IsRigidBody property) <=== possibly a bad idea
- Sort children in add and update properties
- Implement MaxWidth
- Add more docs

Fixes :
- .env.production url
- Symbols: not blocking the linked container when the parent is moving
This commit is contained in:
Eric Nguyen 2022-08-25 13:28:32 +00:00
parent ec3fddec9d
commit 7f3f6a489a
43 changed files with 1127 additions and 453 deletions

View file

@ -9,6 +9,7 @@
import Swal from 'sweetalert2';
import { IContainerModel } from '../../../Interfaces/IContainerModel';
import { ISizePointer } from '../../../Interfaces/ISizePointer';
import { PushContainers } from './FlexBehaviors';
/**
* "Transform the container into a rigid body"
@ -23,6 +24,7 @@ export function ApplyRigidBody(
container: IContainerModel
): IContainerModel {
container = constraintBodyInsideParent(container);
container = PushContainers(container);
container = constraintBodyInsideUnallocatedWidth(container);
return container;
}
@ -183,7 +185,6 @@ export function constraintBodyInsideUnallocatedWidth(
showConfirmButton: false,
timer: 5000
});
container.properties.isRigidBody = false;
return container;
}
@ -238,8 +239,7 @@ function getAvailableWidths(
// Ignore the exception
// And we will also only uses containers that also are rigid or are anchors
if (child === exception ||
(!child.properties.isRigidBody && !child.properties.isAnchor)) {
if (child === exception) {
continue;
}
const childX = child.properties.x;