lilact 0.31.1 → 0.31.3

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 (34) hide show
  1. package/dist/lilact.development.js +13 -9
  2. package/dist/lilact.development.js.map +2 -2
  3. package/dist/lilact.development.min.js +8 -8
  4. package/dist/lilact.development.min.js.map +3 -3
  5. package/dist/lilact.production.min.js +8 -8
  6. package/docs/assets/navigation.js +1 -1
  7. package/docs/assets/search.js +1 -1
  8. package/docs/functions/misc.deepEqual.html +1 -1
  9. package/docs/functions/{misc.getComponentByPointer.html → misc.getComponentUnderPointer.html} +1 -1
  10. package/docs/functions/misc.isAsync.html +1 -1
  11. package/docs/functions/misc.isClass.html +1 -1
  12. package/docs/functions/misc.isEmpty.html +1 -1
  13. package/docs/functions/misc.isError.html +1 -1
  14. package/docs/functions/misc.isThenable.html +1 -1
  15. package/docs/functions/misc.shallowEqual.html +1 -1
  16. package/docs/functions/misc.toBool.html +1 -1
  17. package/docs/functions/run.lazy.html +1 -1
  18. package/docs/functions/run.runScripts.html +1 -1
  19. package/docs/modules/misc.html +1 -1
  20. package/docs/static/index.html +1 -1
  21. package/docs/static/lilact.development.js +13 -9
  22. package/docs/static/lilact.development.js.map +2 -2
  23. package/docs/static/lilact.development.min.js +8 -8
  24. package/docs/static/lilact.development.min.js.map +3 -3
  25. package/docs/static/lilact.production.min.js +8 -8
  26. package/examples/index.html +1 -1
  27. package/examples/lilact.development.js +13 -9
  28. package/examples/lilact.development.js.map +2 -2
  29. package/examples/lilact.development.min.js +8 -8
  30. package/examples/lilact.development.min.js.map +3 -3
  31. package/examples/lilact.production.min.js +8 -8
  32. package/package.json +1 -1
  33. package/src/misc.jsx +24 -17
  34. package/src/run.jsx +92 -93
@@ -1689,7 +1689,7 @@ __export(misc_exports, {
1689
1689
  eval_num: () => eval_num,
1690
1690
  findDOMNode: () => findDOMNode,
1691
1691
  forwardRef: () => forwardRef,
1692
- getComponentByPointer: () => getComponentByPointer,
1692
+ getComponentUnderPointer: () => getComponentUnderPointer,
1693
1693
  id_num: () => id_num,
1694
1694
  isAsync: () => isAsync,
1695
1695
  isClass: () => isClass,
@@ -1929,15 +1929,20 @@ var forwardRef = (render2) => {
1929
1929
  forwarded.displayName = "Forwarded " + render2.displayName;
1930
1930
  return forwarded;
1931
1931
  };
1932
- function getComponentByPointer() {
1932
+ function getComponentUnderPointer() {
1933
1933
  let resolve_func;
1934
1934
  const pr = new Promise((res, rej) => {
1935
1935
  resolve_func = res;
1936
1936
  });
1937
+ const overlay = document.createElement("div");
1938
+ overlay.style.cssText = "position:fixed;inset:0;z-index:2147483647;cursor:crosshair;background:transparent;";
1939
+ document.body.appendChild(overlay);
1937
1940
  function click_handler(event) {
1938
1941
  event.stopImmediatePropagation();
1939
1942
  window.removeEventListener("click", click_handler, true);
1940
- let t = event.target;
1943
+ overlay.style.display = "none";
1944
+ let t = document.elementFromPoint(event.clientX, event.clientY);
1945
+ overlay.remove();
1941
1946
  while (!t[COMPONENT] && t.parentNode) {
1942
1947
  t = t.parentNode;
1943
1948
  }
@@ -4074,6 +4079,8 @@ function lazy(factory) {
4074
4079
  } catch (error2) {
4075
4080
  status = "error";
4076
4081
  result2 = error2;
4082
+ } finally {
4083
+ lilact_default[LAZY] = false;
4077
4084
  }
4078
4085
  if (lilact_default.isThenable(result2)) {
4079
4086
  result2.then(
@@ -4090,13 +4097,10 @@ function lazy(factory) {
4090
4097
  status = "success";
4091
4098
  }
4092
4099
  function LazyComponent(props) {
4093
- if (status === "pending") {
4094
- throw result2;
4095
- }
4096
- if (status === "error") {
4100
+ if (status === "pending" || status === "error") {
4097
4101
  throw result2;
4098
4102
  }
4099
- const Component2 = result2;
4103
+ const Component2 = result2?.default ?? result2;
4100
4104
  return createComponent(Component2, { ...props });
4101
4105
  }
4102
4106
  return LazyComponent;
@@ -7245,7 +7249,7 @@ export {
7245
7249
  events_set,
7246
7250
  findDOMNode,
7247
7251
  forwardRef,
7248
- getComponentByPointer,
7252
+ getComponentUnderPointer,
7249
7253
  globalErrorHandler,
7250
7254
  grabTimers,
7251
7255
  id_num,