From d1881ae8facc25203779aa70524780e6aa55d568 Mon Sep 17 00:00:00 2001 From: Guillaume Tauzin Date: Wed, 12 Oct 2022 15:56:00 +0200 Subject: [PATCH] Add DataContract on Models in SVGLDLibs --- .../SVGLDLibs/Models/ActionContainerModel.cs | 1 + .../Models/AddingBehaviorEnumModel.cs | 1 + .../Models/AvailableContainerModel.cs | 1 + .../SVGLDLibs/Models/AvailableSymbolModel.cs | 1 + csharp/SVGLDLibs/SVGLDLibs/Models/CSSStyle.cs | 1 + csharp/SVGLDLibs/SVGLDLibs/Models/Category.cs | 1 + .../SVGLDLibs/Models/Configuration.cs | 3 + .../SVGLDLibs/Models/ContainerModel.cs | 1 + .../SVGLDLibs/Models/ContainerProperties.cs | 1 + .../SVGLDLibs/SVGLDLibs/Models/EditorState.cs | 1 + .../SVGLDLibs/Models/GetFeedbackRequest.cs | 1 + .../SVGLDLibs/Models/GetFeedbackResponse.cs | 1 + .../SVGLDLibs/Models/HistoryState.cs | 1 + .../SVGLDLibs/SVGLDLibs/Models/ImageModel.cs | 1 + csharp/SVGLDLibs/SVGLDLibs/Models/Margin.cs | 1 + csharp/SVGLDLibs/SVGLDLibs/Models/Message.cs | 7 +- .../SVGLDLibs/SVGLDLibs/Models/MessageType.cs | 7 ++ .../SVGLDLibs/SVGLDLibs/Models/Orientation.cs | 1 + csharp/SVGLDLibs/SVGLDLibs/Models/Pattern.cs | 1 + .../SVGLDLibs/SVGLDLibs/Models/PointModel.cs | 1 + csharp/SVGLDLibs/SVGLDLibs/Models/Position.cs | 1 + .../Models/PositionReferenceEnumModel.cs | 1 + .../Models/SetContainerListRequest.cs | 1 + .../Models/SetContainerListResponse.cs | 1 + .../SVGLDLibs/SVGLDLibs/Models/SymbolModel.cs | 1 + public/svgld.d.ts | 112 +++++++++++++----- src/dts/svgld.d.ts | 62 +++++----- 27 files changed, 153 insertions(+), 60 deletions(-) diff --git a/csharp/SVGLDLibs/SVGLDLibs/Models/ActionContainerModel.cs b/csharp/SVGLDLibs/SVGLDLibs/Models/ActionContainerModel.cs index 8e5da1f..4e79f24 100644 --- a/csharp/SVGLDLibs/SVGLDLibs/Models/ActionContainerModel.cs +++ b/csharp/SVGLDLibs/SVGLDLibs/Models/ActionContainerModel.cs @@ -2,6 +2,7 @@ namespace SVGLDLibs.Models { + [DataContract] public class ActionContainerModel { [DataMember(EmitDefaultValue = false)] diff --git a/csharp/SVGLDLibs/SVGLDLibs/Models/AddingBehaviorEnumModel.cs b/csharp/SVGLDLibs/SVGLDLibs/Models/AddingBehaviorEnumModel.cs index da5e4dc..7dc4154 100644 --- a/csharp/SVGLDLibs/SVGLDLibs/Models/AddingBehaviorEnumModel.cs +++ b/csharp/SVGLDLibs/SVGLDLibs/Models/AddingBehaviorEnumModel.cs @@ -2,6 +2,7 @@ namespace SVGLDLibs.Models { + [DataContract] public enum AddingBehaviorEnumModel { [EnumMember] diff --git a/csharp/SVGLDLibs/SVGLDLibs/Models/AvailableContainerModel.cs b/csharp/SVGLDLibs/SVGLDLibs/Models/AvailableContainerModel.cs index 34e44d5..d779007 100644 --- a/csharp/SVGLDLibs/SVGLDLibs/Models/AvailableContainerModel.cs +++ b/csharp/SVGLDLibs/SVGLDLibs/Models/AvailableContainerModel.cs @@ -3,6 +3,7 @@ using System.Runtime.Serialization; namespace SVGLDLibs.Models { + [DataContract] public class AvailableContainerModel { /** type */ diff --git a/csharp/SVGLDLibs/SVGLDLibs/Models/AvailableSymbolModel.cs b/csharp/SVGLDLibs/SVGLDLibs/Models/AvailableSymbolModel.cs index 9736236..5c2c18a 100644 --- a/csharp/SVGLDLibs/SVGLDLibs/Models/AvailableSymbolModel.cs +++ b/csharp/SVGLDLibs/SVGLDLibs/Models/AvailableSymbolModel.cs @@ -2,6 +2,7 @@ namespace SVGLDLibs.Models { + [DataContract] public class AvailableSymbolModel { [DataMember(EmitDefaultValue = false)] diff --git a/csharp/SVGLDLibs/SVGLDLibs/Models/CSSStyle.cs b/csharp/SVGLDLibs/SVGLDLibs/Models/CSSStyle.cs index 217ea28..dd1c4f4 100644 --- a/csharp/SVGLDLibs/SVGLDLibs/Models/CSSStyle.cs +++ b/csharp/SVGLDLibs/SVGLDLibs/Models/CSSStyle.cs @@ -2,6 +2,7 @@ namespace SVGLDLibs.Models { + [DataContract] public class CSSStyle { [DataMember(EmitDefaultValue = false)] diff --git a/csharp/SVGLDLibs/SVGLDLibs/Models/Category.cs b/csharp/SVGLDLibs/SVGLDLibs/Models/Category.cs index 01550a8..aab857b 100644 --- a/csharp/SVGLDLibs/SVGLDLibs/Models/Category.cs +++ b/csharp/SVGLDLibs/SVGLDLibs/Models/Category.cs @@ -2,6 +2,7 @@ using System.Runtime.Serialization; namespace SVGLDLibs.Models { + [DataContract] public class Category { [DataMember(EmitDefaultValue = false)] diff --git a/csharp/SVGLDLibs/SVGLDLibs/Models/Configuration.cs b/csharp/SVGLDLibs/SVGLDLibs/Models/Configuration.cs index 5c44e18..61213a1 100644 --- a/csharp/SVGLDLibs/SVGLDLibs/Models/Configuration.cs +++ b/csharp/SVGLDLibs/SVGLDLibs/Models/Configuration.cs @@ -3,8 +3,11 @@ using System.Runtime.Serialization; namespace SVGLDLibs.Models { + + [DataContract] public class Configuration { + public Configuration(AvailableContainerModel mainContainer) { MainContainer = mainContainer; diff --git a/csharp/SVGLDLibs/SVGLDLibs/Models/ContainerModel.cs b/csharp/SVGLDLibs/SVGLDLibs/Models/ContainerModel.cs index 3ae1a1f..6864ed7 100644 --- a/csharp/SVGLDLibs/SVGLDLibs/Models/ContainerModel.cs +++ b/csharp/SVGLDLibs/SVGLDLibs/Models/ContainerModel.cs @@ -3,6 +3,7 @@ using System.Runtime.Serialization; namespace SVGLDLibs.Models { + [DataContract] public class ContainerModel { [DataMember(EmitDefaultValue = false)] diff --git a/csharp/SVGLDLibs/SVGLDLibs/Models/ContainerProperties.cs b/csharp/SVGLDLibs/SVGLDLibs/Models/ContainerProperties.cs index 799fe69..e973393 100644 --- a/csharp/SVGLDLibs/SVGLDLibs/Models/ContainerProperties.cs +++ b/csharp/SVGLDLibs/SVGLDLibs/Models/ContainerProperties.cs @@ -2,6 +2,7 @@ namespace SVGLDLibs.Models { + [DataContract] public class ContainerProperties { /** id of the container */ diff --git a/csharp/SVGLDLibs/SVGLDLibs/Models/EditorState.cs b/csharp/SVGLDLibs/SVGLDLibs/Models/EditorState.cs index 163620c..b25c7b4 100644 --- a/csharp/SVGLDLibs/SVGLDLibs/Models/EditorState.cs +++ b/csharp/SVGLDLibs/SVGLDLibs/Models/EditorState.cs @@ -3,6 +3,7 @@ using System.Runtime.Serialization; namespace SVGLDLibs.Models { + [DataContract] public class EditorState { diff --git a/csharp/SVGLDLibs/SVGLDLibs/Models/GetFeedbackRequest.cs b/csharp/SVGLDLibs/SVGLDLibs/Models/GetFeedbackRequest.cs index 24c953e..db49263 100644 --- a/csharp/SVGLDLibs/SVGLDLibs/Models/GetFeedbackRequest.cs +++ b/csharp/SVGLDLibs/SVGLDLibs/Models/GetFeedbackRequest.cs @@ -2,6 +2,7 @@ namespace SVGLDLibs.Models { + [DataContract] public class GetFeedbackRequest { [DataMember(EmitDefaultValue = false)] diff --git a/csharp/SVGLDLibs/SVGLDLibs/Models/GetFeedbackResponse.cs b/csharp/SVGLDLibs/SVGLDLibs/Models/GetFeedbackResponse.cs index 55aae84..6897ca9 100644 --- a/csharp/SVGLDLibs/SVGLDLibs/Models/GetFeedbackResponse.cs +++ b/csharp/SVGLDLibs/SVGLDLibs/Models/GetFeedbackResponse.cs @@ -3,6 +3,7 @@ using System.Runtime.Serialization; namespace SVGLDLibs.Models { + [DataContract] public class GetFeedbackResponse { [DataMember(EmitDefaultValue = false)] diff --git a/csharp/SVGLDLibs/SVGLDLibs/Models/HistoryState.cs b/csharp/SVGLDLibs/SVGLDLibs/Models/HistoryState.cs index 7c2cc88..6fa7c73 100644 --- a/csharp/SVGLDLibs/SVGLDLibs/Models/HistoryState.cs +++ b/csharp/SVGLDLibs/SVGLDLibs/Models/HistoryState.cs @@ -3,6 +3,7 @@ using System.Runtime.Serialization; namespace SVGLDLibs.Models { + [DataContract] public class HistoryState { [DataMember(EmitDefaultValue = false)] diff --git a/csharp/SVGLDLibs/SVGLDLibs/Models/ImageModel.cs b/csharp/SVGLDLibs/SVGLDLibs/Models/ImageModel.cs index 6c28cdd..2dba4b2 100644 --- a/csharp/SVGLDLibs/SVGLDLibs/Models/ImageModel.cs +++ b/csharp/SVGLDLibs/SVGLDLibs/Models/ImageModel.cs @@ -2,6 +2,7 @@ namespace SVGLDLibs.Models { + [DataContract] public class ImageModel { [DataMember(EmitDefaultValue = false)] diff --git a/csharp/SVGLDLibs/SVGLDLibs/Models/Margin.cs b/csharp/SVGLDLibs/SVGLDLibs/Models/Margin.cs index db200e8..431cfbd 100644 --- a/csharp/SVGLDLibs/SVGLDLibs/Models/Margin.cs +++ b/csharp/SVGLDLibs/SVGLDLibs/Models/Margin.cs @@ -2,6 +2,7 @@ namespace SVGLDLibs.Models { + [DataContract] public class Margin { [DataMember(EmitDefaultValue = false)] diff --git a/csharp/SVGLDLibs/SVGLDLibs/Models/Message.cs b/csharp/SVGLDLibs/SVGLDLibs/Models/Message.cs index 03b9f33..ac4d5bd 100644 --- a/csharp/SVGLDLibs/SVGLDLibs/Models/Message.cs +++ b/csharp/SVGLDLibs/SVGLDLibs/Models/Message.cs @@ -1,8 +1,13 @@ -namespace SVGLDLibs.Models +using System.Runtime.Serialization; + +namespace SVGLDLibs.Models { + [DataContract] public class Message { + [DataMember(EmitDefaultValue = false)] public string text { get; set; } + [DataMember(EmitDefaultValue = false)] public MessageType type { get; set; } } } \ No newline at end of file diff --git a/csharp/SVGLDLibs/SVGLDLibs/Models/MessageType.cs b/csharp/SVGLDLibs/SVGLDLibs/Models/MessageType.cs index c752104..d16d3f0 100644 --- a/csharp/SVGLDLibs/SVGLDLibs/Models/MessageType.cs +++ b/csharp/SVGLDLibs/SVGLDLibs/Models/MessageType.cs @@ -1,10 +1,17 @@ +using System.Runtime.Serialization; + namespace SVGLDLibs.Models { + [DataContract] public enum MessageType { + [EnumMember] Normal, + [EnumMember] Success, + [EnumMember] Warning, + [EnumMember] Error } } \ No newline at end of file diff --git a/csharp/SVGLDLibs/SVGLDLibs/Models/Orientation.cs b/csharp/SVGLDLibs/SVGLDLibs/Models/Orientation.cs index bdc38ee..c32ef03 100644 --- a/csharp/SVGLDLibs/SVGLDLibs/Models/Orientation.cs +++ b/csharp/SVGLDLibs/SVGLDLibs/Models/Orientation.cs @@ -2,6 +2,7 @@ namespace SVGLDLibs.Models { + [DataContract] public enum Orientation { [EnumMember] diff --git a/csharp/SVGLDLibs/SVGLDLibs/Models/Pattern.cs b/csharp/SVGLDLibs/SVGLDLibs/Models/Pattern.cs index af4ba0b..d9de689 100644 --- a/csharp/SVGLDLibs/SVGLDLibs/Models/Pattern.cs +++ b/csharp/SVGLDLibs/SVGLDLibs/Models/Pattern.cs @@ -3,6 +3,7 @@ using System.Runtime.Serialization; namespace SVGLDLibs.Models { + [DataContract] public class Pattern { diff --git a/csharp/SVGLDLibs/SVGLDLibs/Models/PointModel.cs b/csharp/SVGLDLibs/SVGLDLibs/Models/PointModel.cs index 327ad2e..26b63a8 100644 --- a/csharp/SVGLDLibs/SVGLDLibs/Models/PointModel.cs +++ b/csharp/SVGLDLibs/SVGLDLibs/Models/PointModel.cs @@ -2,6 +2,7 @@ namespace SVGLDLibs.Models { + [DataContract] public class PointModel { [DataMember(EmitDefaultValue = false)] diff --git a/csharp/SVGLDLibs/SVGLDLibs/Models/Position.cs b/csharp/SVGLDLibs/SVGLDLibs/Models/Position.cs index 3436aeb..995965b 100644 --- a/csharp/SVGLDLibs/SVGLDLibs/Models/Position.cs +++ b/csharp/SVGLDLibs/SVGLDLibs/Models/Position.cs @@ -2,6 +2,7 @@ namespace SVGLDLibs.Models { + [DataContract] public enum Position { [EnumMember] diff --git a/csharp/SVGLDLibs/SVGLDLibs/Models/PositionReferenceEnumModel.cs b/csharp/SVGLDLibs/SVGLDLibs/Models/PositionReferenceEnumModel.cs index 7a8e6fd..9c3694e 100644 --- a/csharp/SVGLDLibs/SVGLDLibs/Models/PositionReferenceEnumModel.cs +++ b/csharp/SVGLDLibs/SVGLDLibs/Models/PositionReferenceEnumModel.cs @@ -2,6 +2,7 @@ namespace SVGLDLibs.Models { + [DataContract] public enum PositionReferenceEnumModel { [EnumMember] diff --git a/csharp/SVGLDLibs/SVGLDLibs/Models/SetContainerListRequest.cs b/csharp/SVGLDLibs/SVGLDLibs/Models/SetContainerListRequest.cs index f678cd4..f038d24 100644 --- a/csharp/SVGLDLibs/SVGLDLibs/Models/SetContainerListRequest.cs +++ b/csharp/SVGLDLibs/SVGLDLibs/Models/SetContainerListRequest.cs @@ -2,6 +2,7 @@ namespace SVGLDLibs.Models { + [DataContract] public class SetContainerListRequest { [DataMember(EmitDefaultValue = false)] diff --git a/csharp/SVGLDLibs/SVGLDLibs/Models/SetContainerListResponse.cs b/csharp/SVGLDLibs/SVGLDLibs/Models/SetContainerListResponse.cs index 8da16e9..f4b1139 100644 --- a/csharp/SVGLDLibs/SVGLDLibs/Models/SetContainerListResponse.cs +++ b/csharp/SVGLDLibs/SVGLDLibs/Models/SetContainerListResponse.cs @@ -3,6 +3,7 @@ using System.Runtime.Serialization; namespace SVGLDLibs.Models { + [DataContract] public class SetContainerListResponse { [DataMember(EmitDefaultValue = false)] diff --git a/csharp/SVGLDLibs/SVGLDLibs/Models/SymbolModel.cs b/csharp/SVGLDLibs/SVGLDLibs/Models/SymbolModel.cs index 1b06c00..7cbce20 100644 --- a/csharp/SVGLDLibs/SVGLDLibs/Models/SymbolModel.cs +++ b/csharp/SVGLDLibs/SVGLDLibs/Models/SymbolModel.cs @@ -2,6 +2,7 @@ namespace SVGLDLibs.Models { + [DataContract] public class SymbolModel : AvailableSymbolModel { [DataMember(EmitDefaultValue = false)] diff --git a/public/svgld.d.ts b/public/svgld.d.ts index 6b51b11..a1053ec 100644 --- a/public/svgld.d.ts +++ b/public/svgld.d.ts @@ -9,7 +9,8 @@ declare namespace SVGLD { export enum AddMethod { Append = 0, Insert = 1, - Replace = 2 + Replace = 2, + ReplaceParent = 3 } export enum MessageType { @@ -19,6 +20,30 @@ export enum MessageType { Error = 3 } +export enum Orientation { + Horizontal = 0, + Vertical = 1 +} + +export enum Position { + Left = 0, + Down = 1, + Up = 2, + Right = 3 +} + +export enum PositionReference { + TopLeft = 0, + TopCenter = 1, + TopRight = 2, + CenterLeft = 3, + CenterCenter = 4, + CenterRight = 5, + BottomLeft = 6, + BottomCenter = 7, + BottomRight = 8 +} + /** * Describe the type of the property. * Used for the assignation in the OnPropertyChange function @@ -39,12 +64,6 @@ export enum PropertyType { Margin = 2 } -export enum XPositionReference { - Left = 0, - Center = 1, - Right = 2 -} - export interface IAction { @@ -61,6 +80,8 @@ export interface IAction { + + /** Model of available container used in application configuration */ export interface IAvailableContainer { /** type */ @@ -69,6 +90,8 @@ export interface IAvailableContainer { DisplayedText?: string; /** category */ Category?: string; + /** orientation */ + Orientation?: Orientation; /** horizontal offset */ X?: number; /** vertical offset */ @@ -79,14 +102,20 @@ export interface IAvailableContainer { Height?: number; /** * Minimum width (min=1) - * Allows the container to set isRigidBody to false when it gets squeezed - * by an anchor */ MinWidth?: number; /** * Maximum width */ MaxWidth?: number; + /** + * Minimum height (min=1) + */ + MinHeight?: number; + /** + * Maximum height + */ + MaxHeight?: number; /** margin */ Margin?: IMargin; /** true if anchor, false otherwise */ @@ -96,7 +125,7 @@ export interface IAvailableContainer { /** Method used on container add */ AddMethod?: AddMethod; /** Horizontal alignment, also determines the visual location of x {Left = 0, Center, Right } */ - XPositionReference?: XPositionReference; + PositionReference?: PositionReference; /** * (optional) * Replace a by a customized "SVG". It is not really an svg but it at least allows @@ -135,19 +164,21 @@ export interface IAvailableContainer { * DefaultChildType will be disabled for this container and the children */ Pattern?: string; + /** Hide the children in the treeview */ + HideChildrenInTreeview?: boolean; /** if true, show the dimension of the container */ - ShowSelfDimensions?: boolean; + ShowSelfDimensions?: Position[]; /** if true show the overall dimensions of its children */ - ShowChildrenDimensions?: boolean; + ShowChildrenDimensions?: Position[]; /** * if true, allows a parent dimension borrower to uses its x coordinate for as a reference point for a dimension */ - MarkPositionToDimensionBorrower?: boolean; + MarkPosition?: Orientation[]; /** * if true, show a dimension from the edge of the container to end - * and insert dimensions marks at lift up children (see liftDimensionToBorrower) + * and insert dimensions marks at lift up children (see MarkPosition) */ - IsDimensionBorrower?: boolean; + ShowDimensionWithMarks?: Position[]; /** * if true, hide the entry in the sidebar (default: false) */ @@ -187,7 +218,7 @@ export interface IAvailableSymbol { Image: IImage; Width?: number; Height?: number; - XPositionReference?: XPositionReference; + PositionReference?: PositionReference; } export interface ICategory { @@ -210,7 +241,7 @@ export interface IConfiguration { export interface IContainerModel { - children: IContainerModel[]; + children: string[]; parent: IContainerModel | null; properties: IContainerProperties; userData: Record; @@ -220,16 +251,18 @@ export interface IContainerModel { * Do not add methods since they will be lost during serialization */ export class ContainerModel implements IContainerModel { - children: IContainerModel[]; + children: string[]; parent: IContainerModel | null; properties: IContainerProperties; userData: Record; - constructor(parent: IContainerModel | null, properties: IContainerProperties, children?: IContainerModel[], userData?: {}); + constructor(parent: IContainerModel | null, properties: IContainerProperties, children?: string[], userData?: {}); } + + /** * Properties of a container */ @@ -244,46 +277,56 @@ export interface IContainerProperties { linkedSymbolId: string; /** Text displayed in the container */ displayedText: string; + /** orientation */ + orientation: Orientation; /** horizontal offset */ x: number; /** vertical offset */ y: number; /** margin */ margin: IMargin; + /** width */ + width: number; + /** height */ + height: number; /** * Minimum width (min=1) - * Allows the container to set isRigidBody to false when it gets squeezed - * by an anchor */ minWidth: number; /** * Maximum width */ maxWidth: number; - /** width */ - width: number; - /** height */ - height: number; + /** + * Minimum height (min=1) + */ + minHeight: number; + /** + * Maximum height + */ + maxHeight: number; /** true if anchor, false otherwise */ isAnchor: boolean; /** true if flex, false otherwise */ isFlex: boolean; /** Horizontal alignment, also determines the visual location of x {Left = 0, Center, Right } */ - xPositionReference: XPositionReference; + positionReference: PositionReference; + /** Hide the children in the treeview */ + hideChildrenInTreeview: boolean; /** if true, show the dimension of the container */ - showSelfDimensions: boolean; + showSelfDimensions: Position[]; /** if true show the overall dimensions of its children */ - showChildrenDimensions: boolean; + showChildrenDimensions: Position[]; /** * if true, allows a parent dimension borrower to borrow its x coordinate * as a reference point for a dimension */ - markPositionToDimensionBorrower: boolean; + markPosition: Orientation[]; /** * if true, show a dimension from the edge of the container to end * and insert dimensions marks at lift up children (see liftDimensionToBorrower) */ - isDimensionBorrower: boolean; + showDimensionWithMarks: Position[]; /** * Warnings of a container */ @@ -340,7 +383,8 @@ export interface IHistoryState { /** Last editor action */ lastAction: string; /** Reference to the main container */ - mainContainer: IContainerModel; + mainContainer: string; + containers: Map; /** Id of the selected container */ selectedContainerId: string; /** Counter of type of container. Used for ids. */ @@ -371,6 +415,7 @@ export interface IImage { export interface IInputGroup { + key: string; text: React.ReactNode; value: string; } @@ -420,9 +465,10 @@ export interface IPoint { + export interface ISetContainerListRequest { /** Name of the action declared in the API */ - Action: string; + Action: IAction; /** Selected container */ Container: IContainerModel; /** The previous sibling container */ @@ -434,8 +480,10 @@ export interface ISetContainerListRequest { } + export interface ISetContainerListResponse { Containers: IAvailableContainer[]; + AddingBehavior?: AddMethod; } /** diff --git a/src/dts/svgld.d.ts b/src/dts/svgld.d.ts index ce9f674..a1053ec 100644 --- a/src/dts/svgld.d.ts +++ b/src/dts/svgld.d.ts @@ -9,7 +9,8 @@ declare namespace SVGLD { export enum AddMethod { Append = 0, Insert = 1, - Replace = 2 + Replace = 2, + ReplaceParent = 3 } export enum MessageType { @@ -19,6 +20,18 @@ export enum MessageType { Error = 3 } +export enum Orientation { + Horizontal = 0, + Vertical = 1 +} + +export enum Position { + Left = 0, + Down = 1, + Up = 2, + Right = 3 +} + export enum PositionReference { TopLeft = 0, TopCenter = 1, @@ -51,12 +64,6 @@ export enum PropertyType { Margin = 2 } -export enum XPositionReference { - Left = 0, - Center = 1, - Right = 2 -} - export interface IAction { @@ -74,6 +81,7 @@ export interface IAction { + /** Model of available container used in application configuration */ export interface IAvailableContainer { /** type */ @@ -159,18 +167,18 @@ export interface IAvailableContainer { /** Hide the children in the treeview */ HideChildrenInTreeview?: boolean; /** if true, show the dimension of the container */ - ShowSelfDimensions?: boolean; + ShowSelfDimensions?: Position[]; /** if true show the overall dimensions of its children */ - ShowChildrenDimensions?: boolean; + ShowChildrenDimensions?: Position[]; /** * if true, allows a parent dimension borrower to uses its x coordinate for as a reference point for a dimension */ - MarkPositionToDimensionBorrower?: boolean; + MarkPosition?: Orientation[]; /** * if true, show a dimension from the edge of the container to end - * and insert dimensions marks at lift up children (see liftDimensionToBorrower) + * and insert dimensions marks at lift up children (see MarkPosition) */ - IsDimensionBorrower?: boolean; + ShowDimensionWithMarks?: Position[]; /** * if true, hide the entry in the sidebar (default: false) */ @@ -210,7 +218,7 @@ export interface IAvailableSymbol { Image: IImage; Width?: number; Height?: number; - XPositionReference?: PositionReference; + PositionReference?: PositionReference; } export interface ICategory { @@ -233,7 +241,7 @@ export interface IConfiguration { export interface IContainerModel { - children: IContainerModel[]; + children: string[]; parent: IContainerModel | null; properties: IContainerProperties; userData: Record; @@ -243,17 +251,18 @@ export interface IContainerModel { * Do not add methods since they will be lost during serialization */ export class ContainerModel implements IContainerModel { - children: IContainerModel[]; + children: string[]; parent: IContainerModel | null; properties: IContainerProperties; userData: Record; - constructor(parent: IContainerModel | null, properties: IContainerProperties, children?: IContainerModel[], userData?: {}); + constructor(parent: IContainerModel | null, properties: IContainerProperties, children?: string[], userData?: {}); } + /** * Properties of a container */ @@ -305,19 +314,19 @@ export interface IContainerProperties { /** Hide the children in the treeview */ hideChildrenInTreeview: boolean; /** if true, show the dimension of the container */ - showSelfDimensions: boolean; + showSelfDimensions: Position[]; /** if true show the overall dimensions of its children */ - showChildrenDimensions: boolean; + showChildrenDimensions: Position[]; /** * if true, allows a parent dimension borrower to borrow its x coordinate * as a reference point for a dimension */ - markPositionToDimensionBorrower: boolean; + markPosition: Orientation[]; /** * if true, show a dimension from the edge of the container to end * and insert dimensions marks at lift up children (see liftDimensionToBorrower) */ - isDimensionBorrower: boolean; + showDimensionWithMarks: Position[]; /** * Warnings of a container */ @@ -374,7 +383,8 @@ export interface IHistoryState { /** Last editor action */ lastAction: string; /** Reference to the main container */ - mainContainer: IContainerModel; + mainContainer: string; + containers: Map; /** Id of the selected container */ selectedContainerId: string; /** Counter of type of container. Used for ids. */ @@ -455,9 +465,10 @@ export interface IPoint { + export interface ISetContainerListRequest { /** Name of the action declared in the API */ - Action: string; + Action: IAction; /** Selected container */ Container: IContainerModel; /** The previous sibling container */ @@ -469,8 +480,10 @@ export interface ISetContainerListRequest { } + export interface ISetContainerListResponse { Containers: IAvailableContainer[]; + AddingBehavior?: AddMethod; } /** @@ -501,9 +514,4 @@ export interface ISymbolModel { linkedContainers: Set; } -export enum Orientation { - Horizontal = 0, - Vertical = 1 -} - }