@constela/server 14.0.5 → 14.0.6
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/index.js +6 -17
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/renderer.ts
|
|
2
|
-
import { isCookieInitialExpr
|
|
2
|
+
import { isCookieInitialExpr } from "@constela/core";
|
|
3
3
|
|
|
4
4
|
// src/markdown.ts
|
|
5
5
|
import { marked } from "marked";
|
|
@@ -504,19 +504,15 @@ function evaluate(expr, ctx) {
|
|
|
504
504
|
}
|
|
505
505
|
case "call": {
|
|
506
506
|
const callExpr = expr;
|
|
507
|
-
const args = callExpr.args?.map((arg) => {
|
|
508
|
-
if (arg.expr === "lambda") return arg;
|
|
509
|
-
return evaluate(arg, ctx);
|
|
510
|
-
}) ?? [];
|
|
511
507
|
if (callExpr.target === null) {
|
|
512
|
-
const result = callChartHelper(callExpr.method, args);
|
|
513
|
-
if (result !== void 0) {
|
|
514
|
-
return result;
|
|
515
|
-
}
|
|
516
508
|
return void 0;
|
|
517
509
|
}
|
|
518
510
|
const target = evaluate(callExpr.target, ctx);
|
|
519
511
|
if (target == null) return void 0;
|
|
512
|
+
const args = callExpr.args?.map((arg) => {
|
|
513
|
+
if (arg.expr === "lambda") return arg;
|
|
514
|
+
return evaluate(arg, ctx);
|
|
515
|
+
}) ?? [];
|
|
520
516
|
if (Array.isArray(target)) {
|
|
521
517
|
return callArrayMethod(target, callExpr.method, args, ctx, callExpr.args);
|
|
522
518
|
}
|
|
@@ -808,14 +804,7 @@ async function renderLocalState(node, ctx) {
|
|
|
808
804
|
for (const [name, field] of Object.entries(node.state)) {
|
|
809
805
|
const initial = field.initial;
|
|
810
806
|
if (initial && typeof initial === "object" && "expr" in initial) {
|
|
811
|
-
|
|
812
|
-
...ctx,
|
|
813
|
-
locals: {
|
|
814
|
-
...ctx.locals,
|
|
815
|
-
...localStateValues
|
|
816
|
-
}
|
|
817
|
-
};
|
|
818
|
-
localStateValues[name] = evaluate(initial, evalCtx);
|
|
807
|
+
localStateValues[name] = evaluate(initial, ctx);
|
|
819
808
|
} else {
|
|
820
809
|
localStateValues[name] = initial;
|
|
821
810
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@constela/server",
|
|
3
|
-
"version": "14.0.
|
|
3
|
+
"version": "14.0.6",
|
|
4
4
|
"description": "Server-side rendering for Constela UI framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"dist"
|
|
16
16
|
],
|
|
17
17
|
"peerDependencies": {
|
|
18
|
-
"@constela/compiler": "^0.15.
|
|
19
|
-
"@constela/core": "^0.18.
|
|
18
|
+
"@constela/compiler": "^0.15.11",
|
|
19
|
+
"@constela/core": "^0.18.5"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"isomorphic-dompurify": "^2.35.0",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"tsup": "^8.0.0",
|
|
30
30
|
"typescript": "^5.3.0",
|
|
31
31
|
"vitest": "^2.0.0",
|
|
32
|
-
"@constela/compiler": "0.15.
|
|
33
|
-
"@constela/core": "0.18.
|
|
32
|
+
"@constela/compiler": "0.15.11",
|
|
33
|
+
"@constela/core": "0.18.5"
|
|
34
34
|
},
|
|
35
35
|
"engines": {
|
|
36
36
|
"node": ">=20.0.0"
|