@mintjamsinc/ichigojs 0.1.31 → 0.1.33

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/ichigo.cjs CHANGED
@@ -7299,10 +7299,19 @@
7299
7299
  newClasses = value.split(/\s+/).filter(Boolean);
7300
7300
  }
7301
7301
  else if (Array.isArray(value)) {
7302
- // Flatten array elements that may contain space-separated class names
7302
+ // Flatten array elements that may contain strings or objects
7303
7303
  newClasses = value
7304
7304
  .filter(Boolean)
7305
- .flatMap(cls => typeof cls === 'string' ? cls.split(/\s+/).filter(Boolean) : []);
7305
+ .flatMap(cls => {
7306
+ if (typeof cls === 'string') {
7307
+ return cls.split(/\s+/).filter(Boolean);
7308
+ }
7309
+ else if (typeof cls === 'object' && cls !== null) {
7310
+ // Handle object format within array: { className: condition }
7311
+ return Object.keys(cls).filter(key => cls[key]);
7312
+ }
7313
+ return [];
7314
+ });
7306
7315
  }
7307
7316
  else if (typeof value === 'object' && value !== null) {
7308
7317
  newClasses = Object.keys(value).filter(key => value[key]);
@@ -7968,6 +7977,15 @@
7968
7977
  this.#suppressOnChange = false;
7969
7978
  }
7970
7979
  }
7980
+ /**
7981
+ * Manually adds an identifier to the set of changed identifiers.
7982
+ * This is useful for computed properties that need to mark themselves as changed
7983
+ * without triggering a new update cycle.
7984
+ * @param key The identifier to mark as changed.
7985
+ */
7986
+ markChanged(key) {
7987
+ this.#changes.add(key);
7988
+ }
7971
7989
  }
7972
7990
 
7973
7991
  // Copyright (c) 2025 MintJams Inc. Licensed under MIT License.
@@ -12177,7 +12195,9 @@
12177
12195
  }
12178
12196
  if (hasChanged) {
12179
12197
  // Use setSilent to avoid triggering onChange during computed property updates
12198
+ // Then mark the computed property as changed so UI depending on it will update
12180
12199
  this.#bindings?.setSilent(key, newValue);
12200
+ this.#bindings?.markChanged(key);
12181
12201
  allChanges.add(key);
12182
12202
  }
12183
12203
  }