@coherent.js/core 1.0.0-beta.6 → 1.0.0-beta.7

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.
Files changed (108) hide show
  1. package/dist/coherent.d.ts +150 -10
  2. package/dist/coherent.d.ts.map +1 -1
  3. package/dist/coherent.js +166 -33
  4. package/dist/coherent.js.map +1 -1
  5. package/dist/components/component-system.js +109 -109
  6. package/dist/components/lifecycle.d.ts +212 -0
  7. package/dist/components/lifecycle.d.ts.map +1 -0
  8. package/dist/components/lifecycle.js +525 -0
  9. package/dist/components/lifecycle.js.map +1 -0
  10. package/dist/core/html-utils.js +5 -5
  11. package/dist/core/object-factory.js +21 -21
  12. package/dist/core/object-utils.js +2 -2
  13. package/dist/dev/dev-tools.d.ts +1 -1
  14. package/dist/dev/dev-tools.js +28 -28
  15. package/dist/forms/validation.d.ts +271 -0
  16. package/dist/forms/validation.d.ts.map +1 -0
  17. package/dist/forms/validation.js +573 -0
  18. package/dist/forms/validation.js.map +1 -0
  19. package/dist/index.cjs +157 -4
  20. package/dist/index.cjs.map +4 -4
  21. package/dist/index.js +153 -4
  22. package/dist/index.js.map +4 -4
  23. package/dist/performance/bundle-optimizer.js +11 -11
  24. package/dist/performance/cache-manager.js +6 -6
  25. package/dist/performance/component-cache.d.ts +120 -0
  26. package/dist/performance/component-cache.d.ts.map +1 -0
  27. package/dist/performance/component-cache.js +364 -0
  28. package/dist/performance/component-cache.js.map +1 -0
  29. package/dist/performance/monitor.js +10 -10
  30. package/dist/performance/monitor.js.map +1 -1
  31. package/dist/rendering/base-renderer.js +13 -13
  32. package/dist/rendering/css-manager.d.ts +73 -0
  33. package/dist/rendering/css-manager.d.ts.map +1 -0
  34. package/dist/rendering/css-manager.js +176 -0
  35. package/dist/rendering/css-manager.js.map +1 -0
  36. package/dist/rendering/dom-renderer.d.ts +23 -0
  37. package/dist/rendering/dom-renderer.d.ts.map +1 -1
  38. package/dist/rendering/dom-renderer.js +77 -9
  39. package/dist/rendering/dom-renderer.js.map +1 -1
  40. package/dist/rendering/html-renderer.d.ts +15 -0
  41. package/dist/rendering/html-renderer.d.ts.map +1 -1
  42. package/dist/rendering/html-renderer.js +85 -4
  43. package/dist/rendering/html-renderer.js.map +1 -1
  44. package/dist/rendering/streaming-renderer.js +12 -12
  45. package/dist/rendering/vdom-diff.d.ts +47 -0
  46. package/dist/rendering/vdom-diff.d.ts.map +1 -0
  47. package/dist/rendering/vdom-diff.js +416 -0
  48. package/dist/rendering/vdom-diff.js.map +1 -0
  49. package/dist/routing/router.d.ts +241 -0
  50. package/dist/routing/router.d.ts.map +1 -0
  51. package/dist/routing/router.js +648 -0
  52. package/dist/routing/router.js.map +1 -0
  53. package/dist/state/reactive-state.d.ts +166 -0
  54. package/dist/state/reactive-state.d.ts.map +1 -0
  55. package/dist/state/reactive-state.js +546 -0
  56. package/dist/state/reactive-state.js.map +1 -0
  57. package/dist/utils/dependency-utils.js +2 -2
  58. package/dist/utils/error-handler.d.ts +148 -0
  59. package/dist/utils/error-handler.d.ts.map +1 -0
  60. package/dist/utils/error-handler.js +468 -0
  61. package/dist/utils/error-handler.js.map +1 -0
  62. package/dist/utils/normalization.js +1 -1
  63. package/dist/utils/validation.js +1 -1
  64. package/package.json +5 -1
  65. package/dist/database/adapters/mongodb.d.ts +0 -15
  66. package/dist/database/adapters/mongodb.d.ts.map +0 -1
  67. package/dist/database/adapters/mongodb.js +0 -216
  68. package/dist/database/adapters/mongodb.js.map +0 -1
  69. package/dist/database/adapters/mysql.d.ts +0 -12
  70. package/dist/database/adapters/mysql.d.ts.map +0 -1
  71. package/dist/database/adapters/mysql.js +0 -171
  72. package/dist/database/adapters/mysql.js.map +0 -1
  73. package/dist/database/adapters/postgresql.d.ts +0 -12
  74. package/dist/database/adapters/postgresql.d.ts.map +0 -1
  75. package/dist/database/adapters/postgresql.js +0 -177
  76. package/dist/database/adapters/postgresql.js.map +0 -1
  77. package/dist/database/adapters/sqlite.d.ts +0 -15
  78. package/dist/database/adapters/sqlite.d.ts.map +0 -1
  79. package/dist/database/adapters/sqlite.js +0 -241
  80. package/dist/database/adapters/sqlite.js.map +0 -1
  81. package/dist/database/connection-manager.d.ts +0 -135
  82. package/dist/database/connection-manager.d.ts.map +0 -1
  83. package/dist/database/connection-manager.js +0 -362
  84. package/dist/database/connection-manager.js.map +0 -1
  85. package/dist/database/index.d.ts +0 -38
  86. package/dist/database/index.d.ts.map +0 -1
  87. package/dist/database/index.js +0 -60
  88. package/dist/database/index.js.map +0 -1
  89. package/dist/database/middleware.d.ts +0 -122
  90. package/dist/database/middleware.d.ts.map +0 -1
  91. package/dist/database/middleware.js +0 -390
  92. package/dist/database/middleware.js.map +0 -1
  93. package/dist/database/migration.d.ts +0 -62
  94. package/dist/database/migration.d.ts.map +0 -1
  95. package/dist/database/migration.js +0 -423
  96. package/dist/database/migration.js.map +0 -1
  97. package/dist/database/model.d.ts +0 -8
  98. package/dist/database/model.d.ts.map +0 -1
  99. package/dist/database/model.js +0 -167
  100. package/dist/database/model.js.map +0 -1
  101. package/dist/database/query-builder.d.ts +0 -111
  102. package/dist/database/query-builder.d.ts.map +0 -1
  103. package/dist/database/query-builder.js +0 -187
  104. package/dist/database/query-builder.js.map +0 -1
  105. package/dist/database/utils.d.ts +0 -196
  106. package/dist/database/utils.d.ts.map +0 -1
  107. package/dist/database/utils.js +0 -372
  108. package/dist/database/utils.js.map +0 -1
@@ -85,8 +85,8 @@ class ComponentState {
85
85
  try {
86
86
  listener(newState, oldState);
87
87
  }
88
- catch (_error) {
89
- console._error('State listener _error:', _error);
88
+ catch (error) {
89
+ console.error('State listener error:', error);
90
90
  }
91
91
  });
92
92
  this.isUpdating = false;
@@ -215,20 +215,20 @@ export class Component {
215
215
  return this.hooks[hookName].call(this, ...args);
216
216
  }
217
217
  }
218
- catch (_error) {
219
- this.handleError(_error, `${hookName} hook`);
218
+ catch (error) {
219
+ this.handleError(error, `${hookName} hook`);
220
220
  }
221
221
  }
222
222
  /**
223
223
  * Handle component errors
224
224
  */
225
- handleError(_error) {
226
- console._error(`Component Error in ${this.name}:`, _error);
227
- // Call _error hook
228
- this.callHook('errorCaptured', _error);
225
+ handleError(error) {
226
+ console.error(`Component Error in ${this.name}:`, error);
227
+ // Call error hook
228
+ this.callHook('errorCaptured', error);
229
229
  // Propagate to parent
230
230
  if (this.parent && this.parent.handleError) {
231
- this.parent.handleError(_error, `${this.name} -> ${context}`);
231
+ this.parent.handleError(error, `${this.name} -> ${context}`);
232
232
  }
233
233
  }
234
234
  /**
@@ -263,9 +263,9 @@ export class Component {
263
263
  }
264
264
  return this.rendered;
265
265
  }
266
- catch (_error) {
267
- this.handleError(_error);
268
- return { div: { className: 'component-_error', text: `Error in ${this.name}` } };
266
+ catch (error) {
267
+ this.handleError(error);
268
+ return { div: { className: 'component-error', text: `Error in ${this.name}` } };
269
269
  }
270
270
  }
271
271
  /**
@@ -384,9 +384,9 @@ export function createComponent(definition) {
384
384
  * Create a component factory
385
385
  */
386
386
  export function defineComponent(definition) {
387
- const componentFactory = (props) => {
387
+ const componentFactory = (_props) => {
388
388
  const component = new Component(definition);
389
- return component.render(props);
389
+ return component.render(_props);
390
390
  };
391
391
  // Add static properties
392
392
  componentFactory.componentName = definition.name || 'Component';
@@ -425,8 +425,8 @@ export function createHOC(enhancer) {
425
425
  return (WrappedComponent) => {
426
426
  return defineComponent({
427
427
  name: `HOC(${WrappedComponent.componentName || 'Component'})`,
428
- render(props) {
429
- return enhancer(WrappedComponent, props);
428
+ render(_props) {
429
+ return enhancer(WrappedComponent, _props);
430
430
  }
431
431
  });
432
432
  };
@@ -472,8 +472,8 @@ export const compose = {
472
472
  combine: (...components) => {
473
473
  return defineComponent({
474
474
  name: 'ComposedComponent',
475
- render(props) {
476
- return components.map(comp => typeof comp === 'function' ? comp(props) : comp);
475
+ render(_props) {
476
+ return components.map(comp => typeof comp === 'function' ? comp(_props) : comp);
477
477
  }
478
478
  });
479
479
  },
@@ -483,16 +483,16 @@ export const compose = {
483
483
  conditional: (condition, trueComponent, falseComponent = null) => {
484
484
  return defineComponent({
485
485
  name: 'ConditionalComponent',
486
- render(props) {
486
+ render(_props) {
487
487
  const shouldRender = typeof condition === 'function' ?
488
- condition(props) : condition;
488
+ condition(_props) : condition;
489
489
  if (shouldRender) {
490
490
  return typeof trueComponent === 'function' ?
491
- trueComponent(props) : trueComponent;
491
+ trueComponent(_props) : trueComponent;
492
492
  }
493
493
  else if (falseComponent) {
494
494
  return typeof falseComponent === 'function' ?
495
- falseComponent(props) : falseComponent;
495
+ falseComponent(_props) : falseComponent;
496
496
  }
497
497
  return null;
498
498
  }
@@ -504,8 +504,8 @@ export const compose = {
504
504
  loop: (data, itemComponent, keyFn = (item, index) => index) => {
505
505
  return defineComponent({
506
506
  name: 'LoopComponent',
507
- render(props) {
508
- const items = typeof data === 'function' ? data(props) : data;
507
+ render(_props) {
508
+ const items = typeof data === 'function' ? data(_props) : data;
509
509
  if (!Array.isArray(items)) {
510
510
  console.warn('Loop component expects array data');
511
511
  return null;
@@ -692,9 +692,9 @@ export function lazy(factory, options = {}) {
692
692
  }
693
693
  // Handle promises
694
694
  if (result && typeof result.then === 'function') {
695
- return result.catch(_error => {
695
+ return result.catch(error => {
696
696
  if (onError)
697
- onError(_error);
697
+ onError(error);
698
698
  return fallback;
699
699
  });
700
700
  }
@@ -705,12 +705,12 @@ export function lazy(factory, options = {}) {
705
705
  }
706
706
  return result;
707
707
  }
708
- catch (_error) {
708
+ catch (error) {
709
709
  if (onError) {
710
- onError(_error);
710
+ onError(error);
711
711
  }
712
712
  else {
713
- console._error('Lazy evaluation _error:', _error);
713
+ console.error('Lazy evaluation error:', error);
714
714
  }
715
715
  return fallback;
716
716
  }
@@ -831,7 +831,7 @@ export function batchEvaluate(lazyValues, ...args) {
831
831
  const result = lazyValue.evaluate(...args);
832
832
  if (result && typeof result.then === 'function') {
833
833
  promises.push(result.then(value => ({ key, value }))
834
- .catch(_error => ({ key, _error })));
834
+ .catch(error => ({ key, error })));
835
835
  }
836
836
  else {
837
837
  results[key] = result;
@@ -845,9 +845,9 @@ export function batchEvaluate(lazyValues, ...args) {
845
845
  return results;
846
846
  }
847
847
  return Promise.all(promises).then(asyncResults => {
848
- asyncResults.forEach(({ key, value, _error }) => {
849
- if (_error) {
850
- console._error(`Batch evaluation _error for ${key}:`, _error);
848
+ asyncResults.forEach(({ key, value, error }) => {
849
+ if (error) {
850
+ console.error(`Batch evaluation error for ${key}:`, error);
851
851
  results[key] = null;
852
852
  }
853
853
  else {
@@ -884,9 +884,9 @@ function evaluateWithTimeout(factory, timeout, args, fallback) {
884
884
  clearTimeout(timer);
885
885
  resolve(value);
886
886
  })
887
- .catch(_error => {
887
+ .catch(error => {
888
888
  clearTimeout(timer);
889
- reject(_error);
889
+ reject(error);
890
890
  });
891
891
  }
892
892
  else {
@@ -894,9 +894,9 @@ function evaluateWithTimeout(factory, timeout, args, fallback) {
894
894
  resolve(result);
895
895
  }
896
896
  }
897
- catch (_error) {
897
+ catch (error) {
898
898
  clearTimeout(timer);
899
- reject(_error);
899
+ reject(error);
900
900
  }
901
901
  }).catch(() => fallback);
902
902
  }
@@ -1091,16 +1091,16 @@ export function memoComponent(component, options = {}) {
1091
1091
  const { propsEqual = shallowEqual, stateEqual = shallowEqual, name = component.name || 'AnonymousComponent' } = options;
1092
1092
  return memo((props = {}, state = {}, context = {}) => {
1093
1093
  return typeof component === 'function' ?
1094
- component(props, state, context) :
1094
+ component(props, state, _context) :
1095
1095
  component;
1096
1096
  }, {
1097
1097
  keyFn: (props, state) => {
1098
1098
  // Create key based on props and state
1099
- return `${name}:${JSON.stringify(props)}:${JSON.stringify(state)}`;
1099
+ return `${name}:${JSON.stringify(_props)}:${JSON.stringify(state)}`;
1100
1100
  },
1101
1101
  compareFn: (a, b) => {
1102
1102
  // Custom comparison for component args
1103
- return propsEqual(a.props, b.props) &&
1103
+ return propsEqual(a.props, b._props) &&
1104
1104
  stateEqual(a.state, b.state);
1105
1105
  },
1106
1106
  ...options
@@ -1120,10 +1120,10 @@ export function memoAsync(asyncFn, options = {}) {
1120
1120
  return promiseCache.get(key);
1121
1121
  }
1122
1122
  // Start new async operation
1123
- const promise = asyncFn(...args).catch(_error => {
1123
+ const promise = asyncFn(...args).catch(error => {
1124
1124
  // Remove failed promise from cache
1125
1125
  promiseCache.delete(key);
1126
- throw _error;
1126
+ throw error;
1127
1127
  });
1128
1128
  promiseCache.set(key, promise);
1129
1129
  // Clean up resolved promise
@@ -1200,7 +1200,7 @@ class TTLCache {
1200
1200
  }
1201
1201
  get(key) {
1202
1202
  if (this.cache.has(key)) {
1203
- const entry = this.cache.get(key);
1203
+ const _entry = this.cache.get(key);
1204
1204
  if (Date.now() < entry.expires) {
1205
1205
  return entry.value;
1206
1206
  }
@@ -1226,7 +1226,7 @@ class TTLCache {
1226
1226
  }
1227
1227
  has(key) {
1228
1228
  if (this.cache.has(key)) {
1229
- const entry = this.cache.get(key);
1229
+ const _entry = this.cache.get(key);
1230
1230
  return Date.now() < entry.expires;
1231
1231
  }
1232
1232
  return false;
@@ -1234,7 +1234,7 @@ class TTLCache {
1234
1234
  delete(key) {
1235
1235
  const had = this.cache.has(key);
1236
1236
  if (had) {
1237
- const entry = this.cache.get(key);
1237
+ const _entry = this.cache.get(key);
1238
1238
  this.cache.delete(key);
1239
1239
  if (this.timers.has(key)) {
1240
1240
  clearTimeout(this.timers.get(key));
@@ -1367,7 +1367,7 @@ export function withProps(propsTransform, options = {}) {
1367
1367
  memoOptions = {}, // Memoization options
1368
1368
  // Error handling
1369
1369
  onError = null, // Error handler for transformation
1370
- fallbackProps = {}, // Fallback props on _error
1370
+ fallbackProps = {}, // Fallback props on error
1371
1371
  // Development
1372
1372
  displayName = null, // Component name for debugging
1373
1373
  debug = false, // Debug logging
@@ -1382,7 +1382,7 @@ export function withProps(propsTransform, options = {}) {
1382
1382
  // Transform props
1383
1383
  let transformedProps;
1384
1384
  if (typeof propsTransform === 'function') {
1385
- transformedProps = propsTransform(originalProps, state, context);
1385
+ transformedProps = propsTransform(originalProps, state, _context);
1386
1386
  }
1387
1387
  else if (typeof propsTransform === 'object') {
1388
1388
  transformedProps = propsTransform;
@@ -1393,26 +1393,26 @@ export function withProps(propsTransform, options = {}) {
1393
1393
  // Handle async transformations
1394
1394
  if (transformedProps && typeof transformedProps.then === 'function') {
1395
1395
  return transformedProps.then(resolved => {
1396
- return processProps(resolved, originalProps, WrappedComponent, state, context);
1397
- }).catch(_error => {
1396
+ return processProps(resolved, originalProps, WrappedComponent, state, _context);
1397
+ }).catch(error => {
1398
1398
  if (onError)
1399
- onError(_error, originalProps);
1400
- return processProps(fallbackProps, originalProps, WrappedComponent, state, context);
1399
+ onError(error, originalProps);
1400
+ return processProps(fallbackProps, originalProps, WrappedComponent, state, _context);
1401
1401
  });
1402
1402
  }
1403
- return processProps(transformedProps, originalProps, WrappedComponent, state, context);
1403
+ return processProps(transformedProps, originalProps, WrappedComponent, state, _context);
1404
1404
  }
1405
- catch (_error) {
1405
+ catch (error) {
1406
1406
  if (debug)
1407
- console._error('withProps _error:', _error);
1407
+ console.error('withProps error:', error);
1408
1408
  if (onError)
1409
- onError(_error, originalProps);
1409
+ onError(error, originalProps);
1410
1410
  // Use fallback props
1411
- return processProps(fallbackProps, originalProps, WrappedComponent, state, context);
1411
+ return processProps(fallbackProps, originalProps, WrappedComponent, state, _context);
1412
1412
  }
1413
1413
  }
1414
1414
  // Process and merge props
1415
- function processProps(transformed, original, component, state, context) {
1415
+ function processProps(transformed, original, component, state, _context) {
1416
1416
  let finalProps;
1417
1417
  if (merge) {
1418
1418
  if (override) {
@@ -1449,7 +1449,7 @@ export function withProps(propsTransform, options = {}) {
1449
1449
  }
1450
1450
  // Render wrapped component
1451
1451
  return typeof component === 'function' ?
1452
- component(finalProps, state, context) :
1452
+ component(finalProps, state, _context) :
1453
1453
  component;
1454
1454
  }
1455
1455
  // Set display name for debugging
@@ -1480,16 +1480,16 @@ export const withPropsUtils = {
1480
1480
  /**
1481
1481
  * Transform props based on conditions
1482
1482
  */
1483
- conditional: (condition, trueProps, falseProps = {}) => withProps((props, state, context) => {
1483
+ conditional: (condition, trueProps, falseProps = {}) => withProps((props, state, _context) => {
1484
1484
  const shouldApply = typeof condition === 'function' ?
1485
- condition(props, state, context) :
1485
+ condition(props, state, _context) :
1486
1486
  condition;
1487
1487
  return shouldApply ? trueProps : falseProps;
1488
1488
  }),
1489
1489
  /**
1490
1490
  * Map specific props to new names/values
1491
1491
  */
1492
- map: (mapping) => withProps((props) => {
1492
+ map: (mapping) => withProps((_props) => {
1493
1493
  const result = {};
1494
1494
  Object.entries(mapping).forEach(([newKey, mapper]) => {
1495
1495
  if (typeof mapper === 'string') {
@@ -1498,7 +1498,7 @@ export const withPropsUtils = {
1498
1498
  }
1499
1499
  else if (typeof mapper === 'function') {
1500
1500
  // Transform function
1501
- result[newKey] = mapper(props);
1501
+ result[newKey] = mapper(_props);
1502
1502
  }
1503
1503
  else {
1504
1504
  // Static value
@@ -1510,7 +1510,7 @@ export const withPropsUtils = {
1510
1510
  /**
1511
1511
  * Pick only specific props
1512
1512
  */
1513
- pick: (keys) => withProps((props) => {
1513
+ pick: (keys) => withProps((_props) => {
1514
1514
  const result = {};
1515
1515
  keys.forEach(key => {
1516
1516
  if (props.hasOwnProperty(key)) {
@@ -1522,7 +1522,7 @@ export const withPropsUtils = {
1522
1522
  /**
1523
1523
  * Omit specific props
1524
1524
  */
1525
- omit: (keys) => withProps((props) => {
1525
+ omit: (keys) => withProps((_props) => {
1526
1526
  const result = { ...props };
1527
1527
  keys.forEach(key => delete result[key]);
1528
1528
  return result;
@@ -1530,7 +1530,7 @@ export const withPropsUtils = {
1530
1530
  /**
1531
1531
  * Default values for missing props
1532
1532
  */
1533
- defaults: (defaultProps) => withProps((props) => ({
1533
+ defaults: (defaultProps) => withProps((_props) => ({
1534
1534
  ...defaultProps,
1535
1535
  ...props
1536
1536
  }), { merge: false }),
@@ -1539,17 +1539,17 @@ export const withPropsUtils = {
1539
1539
  */
1540
1540
  validated: (transform, validator) => withProps(transform, {
1541
1541
  validate: validator,
1542
- onError: (_error) => console.warn('Prop validation failed:', _error)
1542
+ onError: (error) => console.warn('Prop validation failed:', error)
1543
1543
  }),
1544
1544
  /**
1545
1545
  * Async prop transformation
1546
1546
  */
1547
- async: (asyncTransform, loadingProps = {}) => withProps(async (props, state, context) => {
1547
+ async: (asyncTransform, loadingProps = {}) => withProps(async (props, state, _context) => {
1548
1548
  try {
1549
- return await asyncTransform(props, state, context);
1549
+ return await asyncTransform(props, state, _context);
1550
1550
  }
1551
- catch (_error) {
1552
- console._error('Async prop transform failed:', _error);
1551
+ catch (error) {
1552
+ console.error('Async prop transform failed:', error);
1553
1553
  return loadingProps;
1554
1554
  }
1555
1555
  }, {
@@ -1558,11 +1558,11 @@ export const withPropsUtils = {
1558
1558
  /**
1559
1559
  * Computed props based on other props
1560
1560
  */
1561
- computed: (computedProps) => withProps((props) => {
1561
+ computed: (computedProps) => withProps((_props) => {
1562
1562
  const computed = {};
1563
1563
  Object.entries(computedProps).forEach(([key, compute]) => {
1564
1564
  computed[key] = typeof compute === 'function' ?
1565
- compute(props) :
1565
+ compute(_props) :
1566
1566
  compute;
1567
1567
  });
1568
1568
  return computed;
@@ -1570,7 +1570,7 @@ export const withPropsUtils = {
1570
1570
  /**
1571
1571
  * Props with context injection
1572
1572
  */
1573
- withContext: (contextKeys) => withProps((props, state, context) => {
1573
+ withContext: (contextKeys) => withProps((props, state, _context) => {
1574
1574
  const contextProps = {};
1575
1575
  contextKeys.forEach(key => {
1576
1576
  if (context && context[key] !== undefined) {
@@ -1584,7 +1584,7 @@ export const withPropsUtils = {
1584
1584
  */
1585
1585
  withState: (stateMapping) => withProps((props, state) => {
1586
1586
  if (typeof stateMapping === 'function') {
1587
- return stateMapping(state, props);
1587
+ return stateMapping(state, _props);
1588
1588
  }
1589
1589
  const stateProps = {};
1590
1590
  Object.entries(stateMapping).forEach(([propKey, stateKey]) => {
@@ -1605,9 +1605,9 @@ export const withPropsUtils = {
1605
1605
  /**
1606
1606
  * Props with performance measurement
1607
1607
  */
1608
- timed: (transform, name = 'PropTransform') => withProps((props, state, context) => {
1608
+ timed: (transform, name = 'PropTransform') => withProps((props, state, _context) => {
1609
1609
  const start = performance.now();
1610
- const result = transform(props, state, context);
1610
+ const result = transform(props, state, _context);
1611
1611
  const end = performance.now();
1612
1612
  if (end - start > 1) { // Log if > 1ms
1613
1613
  console.log(`${name} took ${(end - start).toFixed(2)}ms`);
@@ -1617,13 +1617,13 @@ export const withPropsUtils = {
1617
1617
  /**
1618
1618
  * Chain multiple prop transformations
1619
1619
  */
1620
- chain: (...transforms) => withProps((props, state, context) => {
1620
+ chain: (...transforms) => withProps((props, state, _context) => {
1621
1621
  return transforms.reduce((acc, transform) => {
1622
1622
  if (typeof transform === 'function') {
1623
- return { ...acc, ...transform(acc, state, context) };
1623
+ return { ...acc, ...transform(acc, state, _context) };
1624
1624
  }
1625
1625
  return { ...acc, ...transform };
1626
- }, props);
1626
+ }, _props);
1627
1627
  })
1628
1628
  };
1629
1629
  /**
@@ -1631,12 +1631,12 @@ export const withPropsUtils = {
1631
1631
  */
1632
1632
  export function createPropTransformer(config) {
1633
1633
  const { transforms = [], validators = [], defaults = {}, options = {} } = config;
1634
- return withProps((props, state, context) => {
1634
+ return withProps((props, state, _context) => {
1635
1635
  let result = { ...defaults, ...props };
1636
1636
  // Apply transforms in sequence
1637
1637
  for (const transform of transforms) {
1638
1638
  if (typeof transform === 'function') {
1639
- result = { ...result, ...transform(result, state, context) };
1639
+ result = { ...result, ...transform(result, state, _context) };
1640
1640
  }
1641
1641
  else {
1642
1642
  result = { ...result, ...transform };
@@ -1656,12 +1656,12 @@ export function createPropTransformer(config) {
1656
1656
  */
1657
1657
  export function withPropsDebug(component, debugOptions = {}) {
1658
1658
  const { logProps = true, logChanges = true, breakOnError = false } = debugOptions;
1659
- return withProps((props, state, context) => {
1659
+ return withProps((props, state, _context) => {
1660
1660
  if (logProps) {
1661
1661
  console.group(`Props Debug: ${component.name || 'Component'}`);
1662
- console.log('Props:', props);
1662
+ console.log('Props:', _props);
1663
1663
  console.log('State:', state);
1664
- console.log('Context:', context);
1664
+ console.log('Context:', _context);
1665
1665
  console.groupEnd();
1666
1666
  }
1667
1667
  return props;
@@ -1738,7 +1738,7 @@ export function withState(initialState = {}, options = {}) {
1738
1738
  if (!stateContainer.initialized) {
1739
1739
  stateContainer.initialize();
1740
1740
  if (onMount) {
1741
- onMount(stateContainer.getState(), props, context);
1741
+ onMount(stateContainer.getState(), props, _context);
1742
1742
  }
1743
1743
  }
1744
1744
  // Get current state
@@ -1746,7 +1746,7 @@ export function withState(initialState = {}, options = {}) {
1746
1746
  // Transform state if needed
1747
1747
  let transformedState = currentState;
1748
1748
  if (stateTransform) {
1749
- transformedState = stateTransform(currentState, props, context);
1749
+ transformedState = stateTransform(currentState, props, _context);
1750
1750
  }
1751
1751
  // Create actions bound to this state container
1752
1752
  const boundActions = createBoundActions(actions, stateContainer, {
@@ -1818,7 +1818,7 @@ export function withState(initialState = {}, options = {}) {
1818
1818
  }
1819
1819
  // Render wrapped component
1820
1820
  return typeof WrappedComponent === 'function' ?
1821
- WrappedComponent(enhancedProps, globalState, context) :
1821
+ WrappedComponent(enhancedProps, globalState, _context) :
1822
1822
  WrappedComponent;
1823
1823
  }
1824
1824
  // Set display name
@@ -1861,9 +1861,9 @@ function createStateContainer(initialState, options) {
1861
1861
  state = { ...state, ...parsed };
1862
1862
  }
1863
1863
  }
1864
- catch (_error) {
1864
+ catch (error) {
1865
1865
  if (debug)
1866
- console.warn('Failed to load persisted state:', _error);
1866
+ console.warn('Failed to load persisted state:', error);
1867
1867
  }
1868
1868
  }
1869
1869
  container.initialized = true;
@@ -1896,9 +1896,9 @@ function createStateContainer(initialState, options) {
1896
1896
  try {
1897
1897
  storage.setItem(storageKey, JSON.stringify(state));
1898
1898
  }
1899
- catch (_error) {
1899
+ catch (error) {
1900
1900
  if (debug)
1901
- console.warn('Failed to persist state:', _error);
1901
+ console.warn('Failed to persist state:', error);
1902
1902
  }
1903
1903
  }
1904
1904
  // Notify listeners
@@ -1907,9 +1907,9 @@ function createStateContainer(initialState, options) {
1907
1907
  try {
1908
1908
  listener(state, prevState);
1909
1909
  }
1910
- catch (_error) {
1910
+ catch (error) {
1911
1911
  if (debug)
1912
- console._error('State listener _error:', _error);
1912
+ console.error('State listener error:', error);
1913
1913
  }
1914
1914
  });
1915
1915
  if (onStateChange) {
@@ -1943,9 +1943,9 @@ function createStateContainer(initialState, options) {
1943
1943
  try {
1944
1944
  storage.removeItem(storageKey);
1945
1945
  }
1946
- catch (_error) {
1946
+ catch (error) {
1947
1947
  if (debug)
1948
- console.warn('Failed to remove persisted state:', _error);
1948
+ console.warn('Failed to remove persisted state:', error);
1949
1949
  }
1950
1950
  }
1951
1951
  }
@@ -1964,18 +1964,18 @@ function createBoundActions(actions, stateContainer, options) {
1964
1964
  const result = actionCreator(stateContainer.getState(), stateContainer.setState.bind(stateContainer), { props, context, args });
1965
1965
  // Handle async actions
1966
1966
  if (supportAsync && result && typeof result.then === 'function') {
1967
- return result.catch(_error => {
1967
+ return result.catch(error => {
1968
1968
  if (debug)
1969
- console._error(`Async action ${actionName} failed:`, _error);
1970
- throw _error;
1969
+ console.error(`Async action ${actionName} failed:`, error);
1970
+ throw error;
1971
1971
  });
1972
1972
  }
1973
1973
  return result;
1974
1974
  }
1975
- catch (_error) {
1975
+ catch (error) {
1976
1976
  if (debug)
1977
- console._error(`Action ${actionName} failed:`, _error);
1978
- throw _error;
1977
+ console.error(`Action ${actionName} failed:`, error);
1978
+ throw error;
1979
1979
  }
1980
1980
  };
1981
1981
  });
@@ -2027,7 +2027,7 @@ export const withStateUtils = {
2027
2027
  }
2028
2028
  return (WrappedComponent) => {
2029
2029
  const sharedContainer = sharedStates.get(sharedKey);
2030
- function SharedStateComponent(props, globalState, context) {
2030
+ function SharedStateComponent(props, globalState, _context) {
2031
2031
  const currentState = sharedContainer.getState();
2032
2032
  const enhancedProps = {
2033
2033
  ...props,
@@ -2036,7 +2036,7 @@ export const withStateUtils = {
2036
2036
  subscribe: sharedContainer.subscribe.bind(sharedContainer)
2037
2037
  };
2038
2038
  return typeof WrappedComponent === 'function' ?
2039
- WrappedComponent(enhancedProps, globalState, context) :
2039
+ WrappedComponent(enhancedProps, globalState, _context) :
2040
2040
  WrappedComponent;
2041
2041
  }
2042
2042
  SharedStateComponent.displayName = `withSharedState(${getComponentName(WrappedComponent)})`;
@@ -2065,7 +2065,7 @@ export const withStateUtils = {
2065
2065
  }
2066
2066
  }),
2067
2067
  /**
2068
- * State with loading/_error handling
2068
+ * State with loading/error handling
2069
2069
  */
2070
2070
  withLoading: async (initialState) => withState({
2071
2071
  ...initialState,
@@ -2077,8 +2077,8 @@ export const withStateUtils = {
2077
2077
  setLoading: (state, setState, { args: [loading] }) => {
2078
2078
  setState({ _loading: loading });
2079
2079
  },
2080
- setError: (state, setState, { args: [_error] }) => {
2081
- setState({ _error: _error, _loading: false });
2080
+ setError: (state, setState, { args: [error] }) => {
2081
+ setState({ _error: error, _loading: false });
2082
2082
  },
2083
2083
  clearError: (state, setState) => {
2084
2084
  setState({ _error: null });
@@ -2090,9 +2090,9 @@ export const withStateUtils = {
2090
2090
  setState({ _loading: false });
2091
2091
  return result;
2092
2092
  }
2093
- catch (_error) {
2094
- setState({ _loading: false, _error: _error });
2095
- throw _error;
2093
+ catch (error) {
2094
+ setState({ _loading: false, _error: error });
2095
+ throw error;
2096
2096
  }
2097
2097
  }
2098
2098
  }