ui-layout-manager-dev 0.0.4 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import TRANSFORMATION_TYPES from "./TRANSFORMATION_TYPES";
1
+ import TRANSFORMATION_TYPES from "../TRANSFORMATION_TYPES";
2
2
  /**
3
3
  * This class generates transformations based on the handle
4
4
  * bars movements. It sets up thresholds at which it collapses
@@ -1,5 +1,5 @@
1
- import LAYOUT_WORKER_PROTOCOL from "./LAYOUT_WORKER_PROTOCOL";
2
- import TRANSFORMATION_TYPES from "./TRANSFORMATION_TYPES";
1
+ import LAYOUT_WORKER_PROTOCOL from "../LAYOUT_WORKER_PROTOCOL";
2
+ import TRANSFORMATION_TYPES from "../TRANSFORMATION_TYPES";
3
3
  import { ParentRuleEnforcer } from "./ParentRuleEnforcer";
4
4
  import { HandleRulesEnforcer } from "./HandleRulesEnforcer";
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { LayoutEditor } from "./LayoutEditor";
2
- import LAYOUT_WORKER_PROTOCOL from "./LAYOUT_WORKER_PROTOCOL";
2
+ import LAYOUT_WORKER_PROTOCOL from "../LAYOUT_WORKER_PROTOCOL";
3
3
 
4
4
  /**
5
5
  * This function receives messages from the main thread and executes
@@ -1,4 +1,4 @@
1
- import TRANSFORMATION_TYPES from "./TRANSFORMATION_TYPES";
1
+ import TRANSFORMATION_TYPES from "../TRANSFORMATION_TYPES";
2
2
  /**
3
3
  * This class generates transformations based on the
4
4
  * parents layout configuration. For example, it collapses
@@ -10,17 +10,33 @@
10
10
  {
11
11
  "containerId": "header",
12
12
  "type": "container",
13
- "size": { "initial": { "value": 25, "unit": "px", "type": "fixed" }}
13
+ "size": {
14
+ "initial": {
15
+ "value": 25,
16
+ "unit": "px",
17
+ "type": "fixed"
18
+ }
19
+ }
14
20
  },
15
21
  {
16
22
  "containerId": "mainBody",
17
23
  "type": "container",
18
- "size": { "initial": { "type": "fill" }}
24
+ "size": {
25
+ "initial": {
26
+ "type": "fill"
27
+ }
28
+ }
19
29
  },
20
30
  {
21
31
  "containerId": "footer",
22
32
  "type": "container",
23
- "size": { "initial": { "value": 25, "unit": "px", "type": "fixed" }}
33
+ "size": {
34
+ "initial": {
35
+ "value": 25,
36
+ "unit": "px",
37
+ "type": "fixed"
38
+ }
39
+ }
24
40
  }
25
41
  ]
26
42
  },
@@ -36,25 +52,69 @@
36
52
  {
37
53
  "containerId": "leftMenu",
38
54
  "type": "container",
39
- "size": { "initial": { "value": 250, "unit": "px", "type": "fixed" }},
40
- "collapse": { "value": 500, "condition": "lessThan" }
55
+ "size": {
56
+ "initial": {
57
+ "value": 200,
58
+ "unit": "px",
59
+ "type": "fixed"
60
+ },
61
+ "min": {
62
+ "value": 150,
63
+ "unit": "px"
64
+ },
65
+ "max": {
66
+ "value": 400,
67
+ "unit": "px"
68
+ }
69
+ },
70
+ "collapse": {
71
+ "value": 500,
72
+ "condition": "lessThan",
73
+ "relative": "parent"
74
+ }
41
75
  },
42
76
  {
43
- "type": "handleBar"
77
+ "type": "handleBar",
78
+ "sibling1": "leftMenu",
79
+ "sibling2": "treeView"
44
80
  },
45
81
  {
46
82
  "containerId": "treeView",
47
83
  "type": "container",
48
- "size": { "initial": { "type": "fill" }}
84
+ "size": {
85
+ "initial": {
86
+ "type": "fill"
87
+ }
88
+ }
49
89
  },
50
90
  {
51
- "type": "handleBar"
91
+ "type": "handleBar",
92
+ "sibling1": "treeView",
93
+ "sibling2": "rightMenu"
52
94
  },
53
95
  {
54
96
  "containerId": "rightMenu",
55
97
  "type": "container",
56
- "size": { "initial": { "value": 250, "unit": "px", "type": "fixed" }},
57
- "collapse": { "value": 800, "condition": "lessThan" }
98
+ "size": {
99
+ "initial": {
100
+ "value": 200,
101
+ "unit": "px",
102
+ "type": "fixed"
103
+ },
104
+ "min": {
105
+ "value": 150,
106
+ "unit": "px"
107
+ },
108
+ "max": {
109
+ "value": 400,
110
+ "unit": "px"
111
+ }
112
+ },
113
+ "collapse": {
114
+ "value": 700,
115
+ "condition": "lessThan",
116
+ "relative": "parent"
117
+ }
58
118
  }
59
119
  ]
60
120
  },
@@ -70,23 +130,41 @@
70
130
  {
71
131
  "containerId": "leftMenuContainer1",
72
132
  "type": "container",
73
- "size": { "initial": { "type": "fill" }}
133
+ "size": {
134
+ "initial": {
135
+ "value": 200,
136
+ "unit": "px",
137
+ "type": "fixed"
138
+ }
139
+ }
74
140
  },
75
141
  {
76
- "type": "handleBar"
142
+ "type": "handleBar",
143
+ "sibling1": "leftMenuContainer1",
144
+ "sibling2": "leftMenuContainer2"
77
145
  },
78
146
  {
79
147
  "containerId": "leftMenuContainer2",
80
148
  "type": "container",
81
- "size": { "initial": { "type": "fill" }}
149
+ "size": {
150
+ "initial": {
151
+ "type": "fill"
152
+ }
153
+ }
82
154
  },
83
155
  {
84
- "type": "handleBar"
156
+ "type": "handleBar",
157
+ "sibling1": "leftMenuContainer2",
158
+ "sibling2": "leftMenuContainer3"
85
159
  },
86
160
  {
87
161
  "containerId": "leftMenuContainer3",
88
162
  "type": "container",
89
- "size": { "initial": { "type": "fill" }}
163
+ "size": {
164
+ "initial": {
165
+ "type": "fill"
166
+ }
167
+ }
90
168
  }
91
169
  ]
92
170
  },
@@ -103,7 +181,11 @@
103
181
  {
104
182
  "containerId": "rightMenuContainer1",
105
183
  "type": "container",
106
- "size": { "initial": { "type": "fill" }}
184
+ "size": {
185
+ "initial": {
186
+ "type": "fill"
187
+ }
188
+ }
107
189
  },
108
190
  {
109
191
  "type": "handleBar"
@@ -111,7 +193,11 @@
111
193
  {
112
194
  "containerId": "rightMenuContainer2",
113
195
  "type": "container",
114
- "size": { "initial": { "type": "fill" }}
196
+ "size": {
197
+ "initial": {
198
+ "type": "fill"
199
+ }
200
+ }
115
201
  },
116
202
  {
117
203
  "type": "handleBar"
@@ -119,7 +205,11 @@
119
205
  {
120
206
  "containerId": "rightMenuContainer3",
121
207
  "type": "container",
122
- "size": { "initial": { "type": "fill" }}
208
+ "size": {
209
+ "initial": {
210
+ "type": "fill"
211
+ }
212
+ }
123
213
  }
124
214
  ]
125
215
  },
@@ -129,7 +219,7 @@
129
219
  },
130
220
  "leftMenuContainer2": {
131
221
  "id": "leftMenuContainer2",
132
- "background": "#444"
222
+ "background": "#333"
133
223
  },
134
224
  "leftMenuContainer3": {
135
225
  "id": "leftMenuContainer3",
@@ -1,7 +1,7 @@
1
1
  import { describe, it, expect } from "vitest";
2
2
  import {readFile, unlink, writeFile} from "fs/promises"
3
3
  import {resolve} from "path"
4
- import {LayoutEditor} from "../../src/components/LayoutManager/Controller/LayoutEditor"
4
+ import {LayoutEditor} from "../../src/components/LayoutManager/Controller/Worker/LayoutEditor"
5
5
 
6
6
  describe("LayoutEditor", () => {
7
7
  it("initialize editor and check ldf file", async () => {