@servlyadmin/runtime-core 0.1.35 → 0.1.36

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.cjs CHANGED
@@ -3475,6 +3475,27 @@ function resolveComponentViewInputs(bindings, context, parentInputs) {
3475
3475
  if (resolvedValue !== void 0 && typeof resolvedValue === "function") {
3476
3476
  resolved[key] = resolvedValue;
3477
3477
  }
3478
+ } else if (binding.binding?.type === "servly" && binding.binding?.plugins) {
3479
+ const plugins = binding.binding.plugins;
3480
+ resolved[key] = (event) => {
3481
+ for (const plugin of plugins) {
3482
+ const pluginType = plugin.type || plugin.key;
3483
+ if (pluginType === "executeCode" && plugin.code) {
3484
+ try {
3485
+ const fn = new Function(
3486
+ "event",
3487
+ "props",
3488
+ "state",
3489
+ "context",
3490
+ plugin.code
3491
+ );
3492
+ fn(event, context.props || {}, context.state || {}, context.context || {});
3493
+ } catch (error) {
3494
+ console.error("[Servly] executeCode error:", error);
3495
+ }
3496
+ }
3497
+ }
3498
+ };
3478
3499
  }
3479
3500
  break;
3480
3501
  default:
package/dist/index.js CHANGED
@@ -2984,6 +2984,27 @@ function resolveComponentViewInputs(bindings, context, parentInputs) {
2984
2984
  if (resolvedValue !== void 0 && typeof resolvedValue === "function") {
2985
2985
  resolved[key] = resolvedValue;
2986
2986
  }
2987
+ } else if (binding.binding?.type === "servly" && binding.binding?.plugins) {
2988
+ const plugins = binding.binding.plugins;
2989
+ resolved[key] = (event) => {
2990
+ for (const plugin of plugins) {
2991
+ const pluginType = plugin.type || plugin.key;
2992
+ if (pluginType === "executeCode" && plugin.code) {
2993
+ try {
2994
+ const fn = new Function(
2995
+ "event",
2996
+ "props",
2997
+ "state",
2998
+ "context",
2999
+ plugin.code
3000
+ );
3001
+ fn(event, context.props || {}, context.state || {}, context.context || {});
3002
+ } catch (error) {
3003
+ console.error("[Servly] executeCode error:", error);
3004
+ }
3005
+ }
3006
+ }
3007
+ };
2987
3008
  }
2988
3009
  break;
2989
3010
  default:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servlyadmin/runtime-core",
3
- "version": "0.1.35",
3
+ "version": "0.1.36",
4
4
  "description": "Framework-agnostic core renderer for Servly components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",