juxscript 1.1.286 → 1.1.288

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.
@@ -1 +1 @@
1
- {"version":3,"file":"pageState.d.ts","sourceRoot":"","sources":["../../../lib/state/pageState.ts"],"names":[],"mappings":"AAeA,cAAM,SAAS;IACX,OAAO,CAAC,SAAS,CAA0C;IAC3D,OAAO,CAAC,MAAM,CAAsB;IAEpC,MAAM,CAAC,QAAQ,CAAC,WAAW,mKAQhB;;IA2BX,OAAO,CAAC,qBAAqB;IAoF7B,OAAO,CAAC,SAAS;IA+DjB,OAAO,CAAC,UAAU;IAwBlB,OAAO,CAAC,YAAY;IAkBpB,OAAO,CAAC,cAAc;IAuBtB,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,OAAO;IAqBf,OAAO,CAAC,MAAM;IAcd,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAGlC;AAID,eAAO,MAAM,SAAS,qBAAuB,CAAC;AAE9C,OAAO,EAAE,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"pageState.d.ts","sourceRoot":"","sources":["../../../lib/state/pageState.ts"],"names":[],"mappings":"AAeA,cAAM,SAAS;IACX,OAAO,CAAC,SAAS,CAA0C;IAC3D,OAAO,CAAC,MAAM,CAAsB;IAEpC,MAAM,CAAC,QAAQ,CAAC,WAAW,mKAQhB;;IA2BX,OAAO,CAAC,qBAAqB;IAsG7B,OAAO,CAAC,SAAS;IA+DjB,OAAO,CAAC,UAAU;IAwBlB,OAAO,CAAC,YAAY;IAkBpB,OAAO,CAAC,cAAc;IAuBtB,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,OAAO;IAqBf,OAAO,CAAC,MAAM;IAmBd,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAGlC;AAID,eAAO,MAAM,SAAS,qBAAuB,CAAC;AAE9C,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -81,20 +81,40 @@ class PageState {
81
81
  comp[setterName](value);
82
82
  }
83
83
  // Fallback: direct DOM manipulation for known props
84
- else if (prop === 'content' || prop === 'value') {
84
+ else if (prop === 'value') {
85
85
  if (typeof comp.setValue === 'function') {
86
86
  comp.setValue(value);
87
87
  }
88
- else if (typeof comp.setContent === 'function') {
88
+ else {
89
+ const el = this._findElement(comp);
90
+ if (el && 'value' in el) {
91
+ el.value = value;
92
+ }
93
+ }
94
+ }
95
+ else if (prop === 'content') {
96
+ if (typeof comp.setContent === 'function') {
89
97
  comp.setContent(value);
90
98
  }
99
+ else {
100
+ // Direct DOM update for elements that don't have setContent
101
+ const el = this._findElement(comp);
102
+ if (el) {
103
+ el.textContent = value;
104
+ }
105
+ }
91
106
  }
92
107
  else if (prop === 'innerHTML') {
93
108
  if (typeof comp.setInnerHTML === 'function') {
94
109
  comp.setInnerHTML(value);
95
110
  }
111
+ else {
112
+ const el = this._findElement(comp);
113
+ if (el) {
114
+ el.innerHTML = value;
115
+ }
116
+ }
96
117
  }
97
- // Don't call fluent methods as setters — they return `this`
98
118
  // Update tracked props
99
119
  entry.props[prop] = value;
100
120
  // Notify listeners
@@ -252,7 +272,12 @@ class PageState {
252
272
  reactionDeps.set(reaction, new Set());
253
273
  activeReaction = reaction;
254
274
  try {
255
- fn();
275
+ const result = fn();
276
+ if (result && typeof result.catch === 'function') {
277
+ result.catch((err) => {
278
+ console.error('[pageState] async watch error:', err);
279
+ });
280
+ }
256
281
  }
257
282
  finally {
258
283
  activeReaction = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "juxscript",
3
- "version": "1.1.286",
3
+ "version": "1.1.288",
4
4
  "type": "module",
5
5
  "description": "A JavaScript UX authorship platform",
6
6
  "main": "./dist/lib/index.js",