@lowdefy/engine 0.0.0-experimental-20250625124206 → 0.0.0-experimental-20250903141200
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.
- package/dist/Areas.js +4 -4
- package/dist/Block.js +10 -13
- package/dist/index.js +3 -3
- package/package.json +7 -7
package/dist/Areas.js
CHANGED
|
@@ -74,19 +74,19 @@ let Areas = class Areas {
|
|
|
74
74
|
});
|
|
75
75
|
_define_property(this, "updateState", ()=>{
|
|
76
76
|
const toDelete = new Set();
|
|
77
|
+
const toSet = new Set(); // If block with duplicate blockId is visible, we preserve the state for it.
|
|
77
78
|
this.loopBlocks((block)=>{
|
|
78
|
-
if (block.
|
|
79
|
+
if (!block.isVisible()) {
|
|
79
80
|
if (block.isContainer()) {
|
|
80
81
|
block.loopSubAreas((subAreasClass)=>subAreasClass.recContainerDelState(toDelete));
|
|
81
82
|
}
|
|
82
83
|
toDelete.add(block.blockId);
|
|
83
84
|
} else {
|
|
84
|
-
|
|
85
|
-
toDelete.delete(block.blockId);
|
|
85
|
+
block.updateState(toSet);
|
|
86
86
|
}
|
|
87
87
|
});
|
|
88
88
|
toDelete.forEach((field)=>{
|
|
89
|
-
this.context._internal.State.del(field);
|
|
89
|
+
if (!toSet.has(field)) this.context._internal.State.del(field);
|
|
90
90
|
});
|
|
91
91
|
});
|
|
92
92
|
_define_property(this, "recContainerDelState", (toDelete)=>{
|
package/dist/Block.js
CHANGED
|
@@ -126,24 +126,17 @@ let Block = class Block {
|
|
|
126
126
|
this.subAreas.forEach(fn);
|
|
127
127
|
}
|
|
128
128
|
});
|
|
129
|
-
_define_property(this, "isHybrid", ()=>{
|
|
130
|
-
return this.meta?.category === 'hybrid';
|
|
131
|
-
});
|
|
132
129
|
_define_property(this, "isDisplay", ()=>{
|
|
133
|
-
if (this.isHybrid()) return this.meta.categories.includes('display');
|
|
134
130
|
return this.meta?.category === 'display';
|
|
135
131
|
});
|
|
136
132
|
_define_property(this, "isList", ()=>{
|
|
137
|
-
if (this.isHybrid()) return this.meta.categories.includes('list');
|
|
138
133
|
return this.meta?.category === 'list';
|
|
139
134
|
});
|
|
140
135
|
_define_property(this, "isInput", ()=>{
|
|
141
|
-
|
|
142
|
-
return this.meta?.category === 'input';
|
|
136
|
+
return this.meta?.category === 'input' || this.meta?.category === 'input-container';
|
|
143
137
|
});
|
|
144
138
|
_define_property(this, "isContainer", ()=>{
|
|
145
|
-
|
|
146
|
-
return this.meta?.category === 'container';
|
|
139
|
+
return this.meta?.category === 'container' || this.meta?.category === 'input-container';
|
|
147
140
|
});
|
|
148
141
|
_define_property(this, "registerMethod", (methodName, method)=>{
|
|
149
142
|
this.methods[methodName] = method;
|
|
@@ -317,11 +310,12 @@ let Block = class Block {
|
|
|
317
310
|
visibleEval: this.visibleEval
|
|
318
311
|
});
|
|
319
312
|
});
|
|
320
|
-
_define_property(this, "
|
|
321
|
-
if (this.
|
|
313
|
+
_define_property(this, "updateState", (toSet)=>{
|
|
314
|
+
if (!this.isVisible()) return;
|
|
322
315
|
if (this.isContainer() || this.isList()) {
|
|
323
316
|
if (this.subAreas && this.subAreas.length > 0) {
|
|
324
317
|
this.loopSubAreas((subAreasClass)=>subAreasClass.updateState());
|
|
318
|
+
return; // Don't add to set
|
|
325
319
|
} else {
|
|
326
320
|
this.context._internal.State.set(this.blockId, type.enforceType(this.meta.valueType, null));
|
|
327
321
|
}
|
|
@@ -329,7 +323,10 @@ let Block = class Block {
|
|
|
329
323
|
if (this.isInput()) {
|
|
330
324
|
this.context._internal.State.set(this.blockId, this.value);
|
|
331
325
|
}
|
|
332
|
-
|
|
326
|
+
toSet.add(this.blockId);
|
|
327
|
+
});
|
|
328
|
+
_define_property(this, "isVisible", ()=>{
|
|
329
|
+
return this.visibleEval.output !== false;
|
|
333
330
|
});
|
|
334
331
|
_define_property(this, "updateArrayIndices", ()=>{
|
|
335
332
|
this.blockId = applyArrayIndices(this.arrayIndices, this.blockIdPattern);
|
|
@@ -409,7 +406,7 @@ let Block = class Block {
|
|
|
409
406
|
throw new Error(`Block type ${this.type} not found at ${this.blockId}. Check your plugins to make sure the block is installed. For more info, see https://docs.lowdefy.com/plugins.`);
|
|
410
407
|
}
|
|
411
408
|
if (!this.isContainer() && !this.isDisplay() && !this.isInput() && !this.isList()) {
|
|
412
|
-
throw new Error(`Block type ${this.type}.meta.category must be either "container", "display", "input" or "
|
|
409
|
+
throw new Error(`Block type ${this.type}.meta.category must be either "container", "display", "input", "list", or "input-container".`);
|
|
413
410
|
}
|
|
414
411
|
if (!type.isNone(areas)) {
|
|
415
412
|
this.areasLayout = {};
|
package/dist/index.js
CHANGED
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import Actions from './Actions.js';
|
|
16
|
-
import Events from './Events.js';
|
|
17
16
|
import Areas from './Areas.js';
|
|
18
17
|
import createLink from './createLink.js';
|
|
18
|
+
import Events from './Events.js';
|
|
19
|
+
import getContext from './getContext.js';
|
|
19
20
|
import Requests from './Requests.js';
|
|
20
21
|
import State from './State.js';
|
|
21
|
-
|
|
22
|
-
export { Actions, Events, Areas, createLink, Requests, State };
|
|
22
|
+
export { Actions, Areas, createLink, Events, Requests, State };
|
|
23
23
|
export default getContext;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/engine",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-20250903141200",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -30,15 +30,15 @@
|
|
|
30
30
|
"dist/*"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@lowdefy/helpers": "0.0.0-experimental-
|
|
34
|
-
"@lowdefy/operators": "0.0.0-experimental-
|
|
33
|
+
"@lowdefy/helpers": "0.0.0-experimental-20250903141200",
|
|
34
|
+
"@lowdefy/operators": "0.0.0-experimental-20250903141200"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@jest/globals": "28.1.3",
|
|
38
|
-
"@lowdefy/actions-core": "0.0.0-experimental-
|
|
39
|
-
"@lowdefy/build": "0.0.0-experimental-
|
|
40
|
-
"@lowdefy/operators-js": "0.0.0-experimental-
|
|
41
|
-
"@lowdefy/operators-mql": "0.0.0-experimental-
|
|
38
|
+
"@lowdefy/actions-core": "0.0.0-experimental-20250903141200",
|
|
39
|
+
"@lowdefy/build": "0.0.0-experimental-20250903141200",
|
|
40
|
+
"@lowdefy/operators-js": "0.0.0-experimental-20250903141200",
|
|
41
|
+
"@lowdefy/operators-mql": "0.0.0-experimental-20250903141200",
|
|
42
42
|
"@swc/cli": "0.1.63",
|
|
43
43
|
"@swc/core": "1.3.99",
|
|
44
44
|
"@swc/jest": "0.2.29",
|