gyosjs 0.5.1 → 0.5.3

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/gyos.auto.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * GyosJS v0.5.1
2
+ * GyosJS v0.5.3
3
3
  * (c) 2026
4
4
  * @license MIT
5
5
  */
@@ -4095,7 +4095,7 @@
4095
4095
  // Set initial value (no pipes in v-model)
4096
4096
  const initialValue = evaluateExpression(expr, currentScope, false);
4097
4097
  if (inputElement.type === 'checkbox') {
4098
- inputElement.checked = !!initialValue;
4098
+ inputElement.checked = !!unref(initialValue);
4099
4099
  }
4100
4100
  else if (inputElement.type === 'radio') {
4101
4101
  inputElement.checked = String(unref(initialValue)) === inputElement.value;
@@ -4141,7 +4141,7 @@
4141
4141
  // No pipes in v-model reactive updates
4142
4142
  const newValue = evaluateExpression(expr, currentScope, false);
4143
4143
  if (inputElement.type === 'checkbox') {
4144
- inputElement.checked = !!newValue;
4144
+ inputElement.checked = !!unref(newValue);
4145
4145
  }
4146
4146
  else if (inputElement.type === 'radio') {
4147
4147
  inputElement.checked = String(unref(newValue)) === inputElement.value;
@@ -4372,6 +4372,15 @@
4372
4372
  // It's a getter - just return value, getter will track its own dependencies
4373
4373
  return value;
4374
4374
  }
4375
+ // Callable reactive values are data, not methods. Binding would drop
4376
+ // their identity and metadata used by g-model and the public APIs.
4377
+ if (isSignal(value) || isComputed(value)) {
4378
+ // Track the field as well as reads of its value so replacing the
4379
+ // signal/computed switches effects away from the old source.
4380
+ if (hasCurrentEffect())
4381
+ getFieldSignal(target, key, value).value;
4382
+ return value;
4383
+ }
4375
4384
  // function -> bind this = proxy
4376
4385
  if (typeof value === "function") {
4377
4386
  return value.bind(proxy);
@@ -6019,8 +6028,9 @@
6019
6028
  if (typeof definition === 'object') {
6020
6029
  instance = makeReactive(definition);
6021
6030
  }
6022
- // Create component context (needs instance for $watch)
6023
- const context = createContext(el, instance);
6031
+ // Factories receive context before their reactive instance exists. Resolve it
6032
+ // when an observer is registered so captured context also works in onMount.
6033
+ const context = createContext(el, () => instance);
6024
6034
  // If function component, call it now with context
6025
6035
  if (typeof definition === 'function' && !instance) {
6026
6036
  const factoryResult = definition(context);
@@ -6077,7 +6087,7 @@
6077
6087
  /**
6078
6088
  * Create component context
6079
6089
  */
6080
- function createContext(el, instance) {
6090
+ function createContext(el, getInstance) {
6081
6091
  const refs = {};
6082
6092
  const events = new Map();
6083
6093
  // Find all refs within this scope only
@@ -6125,6 +6135,7 @@
6125
6135
  },
6126
6136
  $watch: (key, handler, options = {}) => {
6127
6137
  // Watch a reactive property for changes (supports nested paths like 'xxx.count')
6138
+ const instance = getInstance();
6128
6139
  if (!instance) {
6129
6140
  DEBUG() && console.warn('[Component] $watch called before instance created');
6130
6141
  return () => { };
@@ -6191,6 +6202,7 @@
6191
6202
  },
6192
6203
  $effect: (fn) => {
6193
6204
  // Shorthand for effect with auto cleanup on unmount
6205
+ const instance = getInstance();
6194
6206
  if (!instance) {
6195
6207
  DEBUG() && console.warn('[Component] $effect called before instance created');
6196
6208
  return () => { };
@@ -8931,7 +8943,7 @@
8931
8943
  portalCreate,
8932
8944
  portalDestroy,
8933
8945
  setCspNonce,
8934
- version: '0.5.1'
8946
+ version: '0.5.3'
8935
8947
  };
8936
8948
 
8937
8949
  const standardExpressionRuntime = {