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:
parent
ec3fddec9d
commit
7f3f6a489a
43 changed files with 1127 additions and 453 deletions
|
@ -68,7 +68,7 @@ export const DEFAULT_CONFIG: IConfiguration = {
|
|||
AvailableContainers: [
|
||||
{
|
||||
Type: 'Container',
|
||||
Width: 75,
|
||||
MaxWidth: 200,
|
||||
Height: 100,
|
||||
Style: {
|
||||
fillOpacity: 0,
|
||||
|
@ -79,7 +79,7 @@ export const DEFAULT_CONFIG: IConfiguration = {
|
|||
AvailableSymbols: [],
|
||||
MainContainer: {
|
||||
Type: 'Container',
|
||||
Width: 2000,
|
||||
Width: 800,
|
||||
Height: 100,
|
||||
Style: {
|
||||
fillOpacity: 0,
|
||||
|
@ -93,16 +93,19 @@ export const DEFAULT_CONFIG: IConfiguration = {
|
|||
*/
|
||||
export const DEFAULT_MAINCONTAINER_PROPS: IContainerProperties = {
|
||||
id: 'main',
|
||||
type: 'container',
|
||||
parentId: '',
|
||||
linkedSymbolId: '',
|
||||
displayedText: 'main',
|
||||
x: 0,
|
||||
y: 0,
|
||||
margin: {},
|
||||
minWidth: 1,
|
||||
maxWidth: Number.MAX_SAFE_INTEGER,
|
||||
width: Number(DEFAULT_CONFIG.MainContainer.Width),
|
||||
height: Number(DEFAULT_CONFIG.MainContainer.Height),
|
||||
isRigidBody: false,
|
||||
isAnchor: false,
|
||||
isFlex: false,
|
||||
XPositionReference: XPositionReference.Left,
|
||||
style: {
|
||||
stroke: 'black',
|
||||
|
@ -126,20 +129,25 @@ export const GetDefaultContainerProps = (
|
|||
parent: IContainerModel,
|
||||
x: number,
|
||||
y: number,
|
||||
width: number,
|
||||
height: number,
|
||||
containerConfig: IAvailableContainer
|
||||
): IContainerProperties => ({
|
||||
id: `${type}-${typeCount}`,
|
||||
type,
|
||||
parentId: parent.properties.id,
|
||||
linkedSymbolId: '',
|
||||
displayedText: `${type}-${typeCount}`,
|
||||
x,
|
||||
y,
|
||||
width: containerConfig.Width ?? containerConfig.MinWidth ?? parent.properties.width,
|
||||
height: containerConfig.Height ?? parent.properties.height,
|
||||
isRigidBody: false, // set this to true to replicate Florian's project
|
||||
margin: containerConfig.Margin ?? {},
|
||||
width,
|
||||
height,
|
||||
isAnchor: false,
|
||||
isFlex: containerConfig.IsFlex ?? containerConfig.Width === undefined,
|
||||
XPositionReference: containerConfig.XPositionReference ?? XPositionReference.Left,
|
||||
minWidth: containerConfig.MinWidth ?? 1,
|
||||
maxWidth: containerConfig.MaxWidth ?? Number.MAX_SAFE_INTEGER,
|
||||
customSVG: containerConfig.CustomSVG,
|
||||
style: structuredClone(containerConfig.Style),
|
||||
userData: structuredClone(containerConfig.UserData)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue