Added new defaults settings
This commit is contained in:
parent
70863261aa
commit
d854218c9d
2 changed files with 25 additions and 16 deletions
|
@ -2,7 +2,7 @@ import * as React from 'react';
|
||||||
import { Interweave, Node } from 'interweave';
|
import { Interweave, Node } from 'interweave';
|
||||||
import { XPositionReference } from '../../../Enums/XPositionReference';
|
import { XPositionReference } from '../../../Enums/XPositionReference';
|
||||||
import { IContainerModel } from '../../../Interfaces/IContainerModel';
|
import { IContainerModel } from '../../../Interfaces/IContainerModel';
|
||||||
import { DIMENSION_MARGIN } from '../../../utils/default';
|
import { DIMENSION_MARGIN, SHOW_CHILDREN_DIMENSIONS, SHOW_PARENT_DIMENSION } from '../../../utils/default';
|
||||||
import { getDepth } from '../../../utils/itertools';
|
import { getDepth } from '../../../utils/itertools';
|
||||||
import { Dimension } from './Dimension';
|
import { Dimension } from './Dimension';
|
||||||
import IProperties from '../../../Interfaces/IProperties';
|
import IProperties from '../../../Interfaces/IProperties';
|
||||||
|
@ -54,7 +54,7 @@ export const Container: React.FC<IContainerProps> = (props: IContainerProps) =>
|
||||||
const text = (props.model.properties.width ?? 0).toString();
|
const text = (props.model.properties.width ?? 0).toString();
|
||||||
|
|
||||||
let dimensionChildren: JSX.Element | null = null;
|
let dimensionChildren: JSX.Element | null = null;
|
||||||
if (props.model.children.length > 1) {
|
if (props.model.children.length > 1 && SHOW_CHILDREN_DIMENSIONS) {
|
||||||
const {
|
const {
|
||||||
childrenId,
|
childrenId,
|
||||||
xChildrenStart,
|
xChildrenStart,
|
||||||
|
@ -79,7 +79,8 @@ export const Container: React.FC<IContainerProps> = (props: IContainerProps) =>
|
||||||
transform={transform}
|
transform={transform}
|
||||||
key={`container-${props.model.properties.id}`}
|
key={`container-${props.model.properties.id}`}
|
||||||
>
|
>
|
||||||
<Dimension
|
{ SHOW_PARENT_DIMENSION
|
||||||
|
? <Dimension
|
||||||
id={id}
|
id={id}
|
||||||
xStart={xStart}
|
xStart={xStart}
|
||||||
xEnd={xEnd}
|
xEnd={xEnd}
|
||||||
|
@ -88,6 +89,8 @@ export const Container: React.FC<IContainerProps> = (props: IContainerProps) =>
|
||||||
strokeWidth={strokeWidth}
|
strokeWidth={strokeWidth}
|
||||||
text={text}
|
text={text}
|
||||||
/>
|
/>
|
||||||
|
: null
|
||||||
|
}
|
||||||
{ dimensionChildren }
|
{ dimensionChildren }
|
||||||
{ svg }
|
{ svg }
|
||||||
<text
|
<text
|
||||||
|
|
|
@ -4,6 +4,17 @@ import { IConfiguration } from '../Interfaces/IConfiguration';
|
||||||
import { IContainerModel } from '../Interfaces/IContainerModel';
|
import { IContainerModel } from '../Interfaces/IContainerModel';
|
||||||
import IProperties from '../Interfaces/IProperties';
|
import IProperties from '../Interfaces/IProperties';
|
||||||
|
|
||||||
|
/// DIMENSIONS DEFAULTS ///
|
||||||
|
|
||||||
|
export const SHOW_PARENT_DIMENSION = true;
|
||||||
|
export const SHOW_CHILDREN_DIMENSIONS = true;
|
||||||
|
export const DIMENSION_MARGIN = 50;
|
||||||
|
export const NOTCHES_LENGTH = 4;
|
||||||
|
|
||||||
|
/// EDITOR DEFAULTS ///
|
||||||
|
|
||||||
|
export const MAX_HISTORY = 200;
|
||||||
|
|
||||||
export const DEFAULT_CONFIG: IConfiguration = {
|
export const DEFAULT_CONFIG: IConfiguration = {
|
||||||
AvailableContainers: [
|
AvailableContainers: [
|
||||||
{
|
{
|
||||||
|
@ -67,8 +78,3 @@ export const GetDefaultContainerProps = (
|
||||||
style: containerConfig.Style,
|
style: containerConfig.Style,
|
||||||
userData: containerConfig.UserData
|
userData: containerConfig.UserData
|
||||||
});
|
});
|
||||||
|
|
||||||
export const DIMENSION_MARGIN = 50;
|
|
||||||
export const NOTCHES_LENGTH = 4;
|
|
||||||
|
|
||||||
export const MAX_HISTORY = 200;
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue