lilact 0.31.7 → 0.31.8

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 (36) hide show
  1. package/dist/lilact.development.js +12 -6
  2. package/dist/lilact.development.js.map +2 -2
  3. package/dist/lilact.development.min.js +26 -26
  4. package/dist/lilact.development.min.js.map +3 -3
  5. package/dist/lilact.production.min.js +26 -26
  6. package/docs/classes/accessories.ErrorBoundary.html +8 -8
  7. package/docs/classes/accessories.Suspense.html +7 -7
  8. package/docs/classes/components.Component.html +11 -11
  9. package/docs/classes/components.HTMLComponent.html +11 -11
  10. package/docs/classes/components.RootComponent.html +11 -11
  11. package/docs/functions/components.cloneComponent.html +1 -1
  12. package/docs/functions/components.createComponent.html +1 -1
  13. package/docs/functions/components.createPortal.html +1 -1
  14. package/docs/functions/components.createRoot.html +1 -1
  15. package/docs/functions/components.memo.html +1 -1
  16. package/docs/functions/components.render.html +1 -1
  17. package/docs/functions/hooks.startTransition.html +1 -1
  18. package/docs/functions/hooks.useDebugValue.html +1 -1
  19. package/docs/functions/hooks.useDeferredValue.html +1 -1
  20. package/docs/functions/hooks.useImperativeHandle.html +1 -1
  21. package/docs/functions/hooks.useReducer.html +1 -1
  22. package/docs/static/lilact.development.js +12 -6
  23. package/docs/static/lilact.development.js.map +2 -2
  24. package/docs/static/lilact.development.min.js +26 -26
  25. package/docs/static/lilact.development.min.js.map +3 -3
  26. package/docs/static/lilact.production.min.js +26 -26
  27. package/docs/variables/components.cloneElement.html +1 -1
  28. package/examples/lilact.development.js +12 -6
  29. package/examples/lilact.development.js.map +2 -2
  30. package/examples/lilact.development.min.js +26 -26
  31. package/examples/lilact.development.min.js.map +3 -3
  32. package/examples/lilact.production.min.js +26 -26
  33. package/package.json +1 -1
  34. package/src/components.jsx +9 -5
  35. package/src/hooks.jsx +1 -2
  36. package/src/symbols.jsx +2 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lilact",
3
- "version": "0.31.7",
3
+ "version": "0.31.8",
4
4
  "description": "A Little React/JSX Runtime Implementation for Browser",
5
5
  "repository": "github:arashkazemi/lilact",
6
6
  "homepage": "https://arashkazemi.github.io/lilact/",
@@ -30,7 +30,7 @@
30
30
 
31
31
  import Lilact from './lilact.jsx';
32
32
 
33
- import { CORE, COMPONENT, TEXT, IS_ZOMBIE, IDX, CHILD_CLASS_ADDENDUM, MEMOIZED, LOCATION } from "./symbols.jsx"
33
+ import { CORE, COMPONENT, TEXT, IS_ZOMBIE, IDX, CHILD_CLASS_ADDENDUM, MEMOIZED, LOCATION, CLONED_STYLE } from "./symbols.jsx"
34
34
  import { shallowEqual, toBool, isClass, isThenable } from "./misc.jsx";
35
35
 
36
36
  import { PropTypes } from './proptypes.jsx';
@@ -298,7 +298,7 @@ class ComponentCache
298
298
  ex.cleanup();
299
299
  }
300
300
  else if(ex.element && !ex.portal) {
301
- ex.element.parentElement.removeChild(ex.element);
301
+ ex.element.parentElement?.removeChild?.(ex.element);
302
302
  }
303
303
  });
304
304
  });
@@ -401,6 +401,10 @@ class ComponentCore
401
401
  };
402
402
  }
403
403
 
404
+ if(next_props?.style && typeof next_props.style === 'object' && !next_props.style[CLONED_STYLE]) {
405
+ next_props.style = { ...next_props.style, [CLONED_STYLE]: true };
406
+ }
407
+
404
408
  if(this?.parent?.component?.context || this?.parent?.component?.getChildContext ) {
405
409
  this.context = { ...this.parent.component.context, ...this.parent.component.getChildContext?.() };
406
410
 
@@ -553,7 +557,7 @@ class ComponentCore
553
557
  this.props.ref(null);
554
558
  }
555
559
  else {
556
- this.props.current = null;
560
+ this.props.ref.current = null;
557
561
  }
558
562
  }
559
563
 
@@ -679,7 +683,7 @@ class ComponentCore
679
683
  }
680
684
  else {
681
685
  for(let p in this.props.style) {
682
- if( !patch.style.hasOwnProperty(p) ) {
686
+ if( p!==CLONED_STYLE && !patch.style.hasOwnProperty(p) ) {
683
687
  this.element.style[p] = "";
684
688
  }
685
689
  }
@@ -705,7 +709,7 @@ class ComponentCore
705
709
  else if(a==='autoFocus') { // not lower cased(al), as it is set as a js property
706
710
  this.element['autofocus'] = toBool(patch[a]);
707
711
  }
708
- else if(a==='htmlFor') { // not lower cased(al), as it is set as a js property
712
+ else if(a==='htmlFor' || a==='for') { // not lower cased(al), as it is set as a js property
709
713
  this.element.setAttribute('for', patch[a]);
710
714
  }
711
715
  else if(al!=='value' || ['input', 'textarea', 'select'].indexOf(this.entity)===-1) {
package/src/hooks.jsx CHANGED
@@ -427,8 +427,7 @@ export function useActionState(action, initialState)
427
427
  async ()=> {
428
428
  const form_data = new FormData(event.target, event.submitter);
429
429
  hk.state = await action(hk.state, form_data);
430
- },
431
- []
430
+ }
432
431
  );
433
432
 
434
433
  return false;
package/src/symbols.jsx CHANGED
@@ -40,6 +40,7 @@ export const [
40
40
  CHILD_CLASS_ADDENDUM,
41
41
  MEMOIZED,
42
42
  LAZY,
43
+ CLONED_STYLE,
43
44
 
44
45
  DUE,
45
46
  REPEAT,
@@ -59,6 +60,7 @@ export const [
59
60
  Symbol.for('LILACT:CHILD_CLASS_ADDENDUM'),
60
61
  Symbol.for('LILACT:MEMOIZED'),
61
62
  Symbol.for('LILACT:LAZY'),
63
+ Symbol.for('LILACT:CLONED_STYLE'),
62
64
 
63
65
  Symbol.for('LILACT:TIMERS:DUE'),
64
66
  Symbol.for('LILACT:TIMERS:REPEAT'),