@servlyadmin/runtime-core 0.1.29 → 0.1.30

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
@@ -19565,17 +19565,6 @@ function attachEventHandlers(domElement, element, eventHandlers, context, elemen
19565
19565
  }
19566
19566
  }
19567
19567
  }
19568
- if (isRootElement && context.props && state?.renderingStack?.size === 0) {
19569
- for (const [propName, value] of Object.entries(context.props)) {
19570
- if (propName.startsWith("on") && typeof value === "function") {
19571
- const domEventName = propName.slice(2).toLowerCase();
19572
- if (!elementState.eventListeners.has(domEventName)) {
19573
- elementState.eventListeners.set(domEventName, value);
19574
- domElement.addEventListener(domEventName, value);
19575
- }
19576
- }
19577
- }
19578
- }
19579
19568
  if (!isRootElement && elementState.eventListeners.size > 0) {
19580
19569
  for (const [eventName, originalHandler] of elementState.eventListeners) {
19581
19570
  const wrappedHandler = (e) => {
@@ -19775,11 +19764,17 @@ function renderElement(element, tree, context, eventHandlers, elementStates, sta
19775
19764
  }
19776
19765
  const elementBindings = element.configuration?.bindings?.inputs;
19777
19766
  const resolvedInputs = elementBindings ? resolveComponentViewInputs(elementBindings, context, context.props) : {};
19778
- const nonFunctionInputs = Object.fromEntries(
19779
- Object.entries(resolvedInputs).filter(([, v]) => typeof v !== "function")
19780
- );
19767
+ const functionInputs = {};
19768
+ const nonFunctionInputs = {};
19769
+ for (const [key, value] of Object.entries(resolvedInputs)) {
19770
+ if (typeof value === "function") {
19771
+ functionInputs[key] = value;
19772
+ } else {
19773
+ nonFunctionInputs[key] = value;
19774
+ }
19775
+ }
19781
19776
  const elementContext = {
19782
- props: { ...context.props, ...nonFunctionInputs },
19777
+ props: { ...context.props, ...nonFunctionInputs, ...functionInputs },
19783
19778
  state: context.state,
19784
19779
  context: context.context
19785
19780
  };
package/dist/index.js CHANGED
@@ -2769,17 +2769,6 @@ function attachEventHandlers(domElement, element, eventHandlers, context, elemen
2769
2769
  }
2770
2770
  }
2771
2771
  }
2772
- if (isRootElement && context.props && state?.renderingStack?.size === 0) {
2773
- for (const [propName, value] of Object.entries(context.props)) {
2774
- if (propName.startsWith("on") && typeof value === "function") {
2775
- const domEventName = propName.slice(2).toLowerCase();
2776
- if (!elementState.eventListeners.has(domEventName)) {
2777
- elementState.eventListeners.set(domEventName, value);
2778
- domElement.addEventListener(domEventName, value);
2779
- }
2780
- }
2781
- }
2782
- }
2783
2772
  if (!isRootElement && elementState.eventListeners.size > 0) {
2784
2773
  for (const [eventName, originalHandler] of elementState.eventListeners) {
2785
2774
  const wrappedHandler = (e) => {
@@ -2979,11 +2968,17 @@ function renderElement(element, tree, context, eventHandlers, elementStates, sta
2979
2968
  }
2980
2969
  const elementBindings = element.configuration?.bindings?.inputs;
2981
2970
  const resolvedInputs = elementBindings ? resolveComponentViewInputs(elementBindings, context, context.props) : {};
2982
- const nonFunctionInputs = Object.fromEntries(
2983
- Object.entries(resolvedInputs).filter(([, v]) => typeof v !== "function")
2984
- );
2971
+ const functionInputs = {};
2972
+ const nonFunctionInputs = {};
2973
+ for (const [key, value] of Object.entries(resolvedInputs)) {
2974
+ if (typeof value === "function") {
2975
+ functionInputs[key] = value;
2976
+ } else {
2977
+ nonFunctionInputs[key] = value;
2978
+ }
2979
+ }
2985
2980
  const elementContext = {
2986
- props: { ...context.props, ...nonFunctionInputs },
2981
+ props: { ...context.props, ...nonFunctionInputs, ...functionInputs },
2987
2982
  state: context.state,
2988
2983
  context: context.context
2989
2984
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servlyadmin/runtime-core",
3
- "version": "0.1.29",
3
+ "version": "0.1.30",
4
4
  "description": "Framework-agnostic core renderer for Servly components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",