lilact 0.27.0 → 0.27.2

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 (73) hide show
  1. package/dist/lilact.development.js +238 -135
  2. package/dist/lilact.development.js.map +3 -3
  3. package/dist/lilact.development.min.js +57 -57
  4. package/dist/lilact.development.min.js.map +3 -3
  5. package/dist/lilact.production.min.js +57 -57
  6. package/docs/classes/accessories.ErrorBoundary.html +3 -3
  7. package/docs/classes/accessories.Suspense.html +2 -2
  8. package/docs/classes/components.Component.html +3 -3
  9. package/docs/classes/components.HTMLComponent.html +4 -4
  10. package/docs/classes/components.RootComponent.html +5 -5
  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.createContext.html +1 -1
  18. package/docs/functions/hooks.startTransition.html +1 -1
  19. package/docs/functions/hooks.useActionState.html +1 -1
  20. package/docs/functions/hooks.useContext.html +1 -1
  21. package/docs/functions/hooks.useDebugValue.html +1 -1
  22. package/docs/functions/hooks.useDeferredValue.html +1 -1
  23. package/docs/functions/hooks.useEffect.html +1 -1
  24. package/docs/functions/hooks.useId.html +1 -1
  25. package/docs/functions/hooks.useImperativeHandle.html +1 -1
  26. package/docs/functions/hooks.useInsertionEffect.html +1 -1
  27. package/docs/functions/hooks.useLayoutEffect.html +1 -1
  28. package/docs/functions/hooks.useLocalStorage.html +1 -1
  29. package/docs/functions/hooks.useMemo.html +1 -1
  30. package/docs/functions/hooks.useReducer.html +1 -1
  31. package/docs/functions/hooks.useRef.html +1 -1
  32. package/docs/functions/hooks.useTransition.html +1 -1
  33. package/docs/functions/misc.Fragment.html +2 -2
  34. package/docs/functions/misc.Portal.html +2 -2
  35. package/docs/functions/misc.deepEqual.html +1 -1
  36. package/docs/functions/misc.findDOMNode.html +1 -1
  37. package/docs/functions/misc.forwardRef.html +1 -1
  38. package/docs/functions/misc.getComponentByPointer.html +1 -1
  39. package/docs/functions/misc.isAsync.html +1 -1
  40. package/docs/functions/misc.isClass.html +1 -1
  41. package/docs/functions/misc.isEmpty.html +1 -1
  42. package/docs/functions/misc.isError.html +1 -1
  43. package/docs/functions/misc.isThenable.html +1 -1
  44. package/docs/functions/misc.shallowEqual.html +1 -1
  45. package/docs/functions/misc.toBool.html +1 -1
  46. package/docs/functions/run.lazy.html +1 -1
  47. package/docs/functions/run.require.html +1 -1
  48. package/docs/functions/run.run.html +1 -1
  49. package/docs/functions/run.runScripts.html +1 -1
  50. package/docs/functions/timers.timeoutPromise.html +10 -10
  51. package/docs/static/index.html +1 -1
  52. package/docs/static/lilact.development.js +238 -135
  53. package/docs/static/lilact.development.js.map +3 -3
  54. package/docs/static/lilact.development.min.js +57 -57
  55. package/docs/static/lilact.development.min.js.map +3 -3
  56. package/docs/static/lilact.production.min.js +57 -57
  57. package/docs/variables/components.cloneElement.html +1 -1
  58. package/docs/variables/misc.Children.html +10 -10
  59. package/docs/variables/misc.isValidElement.html +1 -1
  60. package/docs/variables/run.required_scripts.html +1 -1
  61. package/examples/index.html +1 -1
  62. package/examples/lilact.development.js +238 -135
  63. package/examples/lilact.development.js.map +3 -3
  64. package/examples/lilact.development.min.js +57 -57
  65. package/examples/lilact.development.min.js.map +3 -3
  66. package/examples/lilact.production.min.js +57 -57
  67. package/package.json +1 -1
  68. package/src/components.jsx +24 -13
  69. package/src/errors.jsx +310 -310
  70. package/src/hooks.jsx +60 -44
  71. package/src/lilact.jsx +4 -2
  72. package/src/misc.jsx +46 -18
  73. package/src/run.jsx +406 -291
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lilact",
3
- "version": "0.27.0",
3
+ "version": "0.27.2",
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/",
@@ -639,9 +639,9 @@ const renderErrorHandler = (c, e) =>
639
639
  }
640
640
 
641
641
  let stack_log = Array.prototype
642
- .map.call(stack, x => (`in ${typeof(x.component.displayName)==='function'?
643
- x.component.displayName():x.component.displayName}` ) )
644
- .join('\n');
642
+ .map.call(stack, x => (`in ${typeof(x.component.displayName)==='function'?
643
+ x.component.displayName():x.component.displayName}` ) )
644
+ .join('\n');
645
645
 
646
646
  e.componentStack = stack;
647
647
  e.componentStackLog = stack_log;
@@ -774,8 +774,8 @@ function doUpdates()
774
774
  - Layout effects (run immediately after insertion effects, still before paint).
775
775
  - Passive effects (useEffect)
776
776
 
777
- schedule them for after paint using requestAnimationFrame, typically:
778
- run the “after paint” work in the next frame or in a callback scheduled such that it runs after the browser has performed the paint.
777
+ schedule them for after paint using requestAnimationFrame, typically:
778
+ run the “after paint” work in the next frame or in a callback scheduled such that it runs after the browser has performed the paint.
779
779
 
780
780
 
781
781
  Current task: render → DOM updates → insertion effects → layout effects
@@ -971,15 +971,26 @@ export class Component
971
971
  * It can also be set for function components.
972
972
  * @type {string}
973
973
  */
974
- displayName()
975
- {
976
- if(this[CORE].entity?.displayName) return this[CORE].entity?.displayName;
977
- if(typeof(this[CORE].entity)==='string') return this[CORE].entity;
978
- if( isClass(this[CORE].entity) ) this[CORE].entity.constructor.name;
979
- if( typeof(this[CORE].entity)==='function' ) return this[CORE].entity.name;
974
+ displayName() {
975
+ const entity = this[CORE].entity;
976
+
977
+ if (entity?.displayName) {
978
+ return typeof entity.displayName === "function"
979
+ ? entity.displayName()
980
+ : entity.displayName;
981
+ }
982
+
983
+ if (typeof entity === "string") {
984
+ return entity;
985
+ }
986
+
987
+ if (typeof entity === "function") {
988
+ return entity.name || "Component";
989
+ }
990
+
980
991
  return "Component";
981
992
  }
982
-
993
+
983
994
  constructor(props)
984
995
  {
985
996
  this[CORE] = new ComponentCore(this, props);
@@ -1385,7 +1396,7 @@ export const events_set = new Set([
1385
1396
  /** @ignore */
1386
1397
  export const capture_events_set = {};
1387
1398
  for (const x of events_set) {
1388
- capture_events_set[x+"capture"] = x;
1399
+ capture_events_set[x+"capture"] = x;
1389
1400
  }
1390
1401
 
1391
1402
  /** @ignore */