lilact 0.31.7 → 0.31.9

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 (47) hide show
  1. package/dist/lilact.development.js +18 -10
  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.useActionState.html +1 -1
  19. package/docs/functions/hooks.useDebugValue.html +1 -1
  20. package/docs/functions/hooks.useDeferredValue.html +1 -1
  21. package/docs/functions/hooks.useImperativeHandle.html +1 -1
  22. package/docs/functions/hooks.useReducer.html +1 -1
  23. package/docs/functions/misc.deepEqual.html +1 -1
  24. package/docs/functions/misc.isAsync.html +1 -1
  25. package/docs/functions/misc.isClass.html +1 -1
  26. package/docs/functions/misc.isEmpty.html +1 -1
  27. package/docs/functions/misc.isError.html +1 -1
  28. package/docs/functions/misc.isThenable.html +1 -1
  29. package/docs/functions/misc.shallowEqual.html +1 -1
  30. package/docs/functions/misc.toBool.html +1 -1
  31. package/docs/static/lilact.development.js +18 -10
  32. package/docs/static/lilact.development.js.map +2 -2
  33. package/docs/static/lilact.development.min.js +26 -26
  34. package/docs/static/lilact.development.min.js.map +3 -3
  35. package/docs/static/lilact.production.min.js +26 -26
  36. package/docs/variables/components.cloneElement.html +1 -1
  37. package/examples/lilact.development.js +18 -10
  38. package/examples/lilact.development.js.map +2 -2
  39. package/examples/lilact.development.min.js +26 -26
  40. package/examples/lilact.development.min.js.map +3 -3
  41. package/examples/lilact.production.min.js +26 -26
  42. package/package.json +1 -1
  43. package/src/components.jsx +9 -5
  44. package/src/hooks.jsx +6 -7
  45. package/src/lilact.jsx +2 -2
  46. package/src/misc.jsx +4 -2
  47. package/src/symbols.jsx +2 -0
@@ -20,4 +20,4 @@ children.</p>
20
20
  </div><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example-1">Example<a href="#example-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="ts"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-7">panel</span><span class="hl-1"> = &lt;</span><span class="hl-8">Panel</span><span class="hl-1"> </span><span class="hl-8">className</span><span class="hl-1">=</span><span class="hl-2">&quot;compact&quot;</span><span class="hl-1">&gt;</span><span class="hl-5">Old</span><span class="hl-1"> </span><span class="hl-5">content</span><span class="hl-1">&lt;/</span><span class="hl-5">Panel</span><span class="hl-1">&gt;;</span><br/><br/><span class="hl-6">// Existing children are replaced when children are provided.</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-7">updatedPanel</span><span class="hl-1"> = </span><span class="hl-0">cloneComponent</span><span class="hl-1">(</span><br/><span class="hl-1"> </span><span class="hl-5">panel</span><span class="hl-1">,</span><br/><span class="hl-1"> { </span><span class="hl-5">className:</span><span class="hl-1"> </span><span class="hl-2">&#39;expanded&#39;</span><span class="hl-1"> },</span><br/><span class="hl-1"> &lt;</span><span class="hl-8">Heading</span><span class="hl-1">&gt;</span><span class="hl-5">New</span><span class="hl-1"> </span><span class="hl-5">content</span><span class="hl-1">&lt;/</span><span class="hl-5">Heading</span><span class="hl-1">&gt;</span><br/><span class="hl-1">);</span>
21
21
  </code><button type="button">Copy</button></pre>
22
22
 
23
- </div></div></li></ul></li></ul></div><aside class="tsd-sources"><ul><li>Defined in components.jsx:1572</li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">Lilact</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
23
+ </div></div></li></ul></li></ul></div><aside class="tsd-sources"><ul><li>Defined in components.jsx:1576</li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">Lilact</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
@@ -1709,6 +1709,7 @@ __export(symbols_exports, {
1709
1709
  CALLBACK: () => CALLBACK,
1710
1710
  CHILD_CLASS_ADDENDUM: () => CHILD_CLASS_ADDENDUM,
1711
1711
  CLEARED: () => CLEARED,
1712
+ CLONED_STYLE: () => CLONED_STYLE,
1712
1713
  COMPONENT: () => COMPONENT,
1713
1714
  CORE: () => CORE,
1714
1715
  DUE: () => DUE,
@@ -1731,6 +1732,7 @@ var [
1731
1732
  CHILD_CLASS_ADDENDUM,
1732
1733
  MEMOIZED,
1733
1734
  LAZY,
1735
+ CLONED_STYLE,
1734
1736
  DUE,
1735
1737
  REPEAT,
1736
1738
  CLEARED,
@@ -1747,6 +1749,7 @@ var [
1747
1749
  /* @__PURE__ */ Symbol.for("LILACT:CHILD_CLASS_ADDENDUM"),
1748
1750
  /* @__PURE__ */ Symbol.for("LILACT:MEMOIZED"),
1749
1751
  /* @__PURE__ */ Symbol.for("LILACT:LAZY"),
1752
+ /* @__PURE__ */ Symbol.for("LILACT:CLONED_STYLE"),
1750
1753
  /* @__PURE__ */ Symbol.for("LILACT:TIMERS:DUE"),
1751
1754
  /* @__PURE__ */ Symbol.for("LILACT:TIMERS:REPEAT"),
1752
1755
  /* @__PURE__ */ Symbol.for("LILACT:TIMERS:CLEARED"),
@@ -1936,7 +1939,6 @@ function getComponentUnderPointer() {
1936
1939
  });
1937
1940
  const overlay = document.createElement("div");
1938
1941
  overlay.style.cssText = "position:fixed;inset:0;z-index:2147483647;cursor:crosshair;background:transparent;";
1939
- document.body.appendChild(overlay);
1940
1942
  function click_handler(event) {
1941
1943
  event.stopImmediatePropagation();
1942
1944
  window.removeEventListener("click", click_handler, true);
@@ -1949,7 +1951,10 @@ function getComponentUnderPointer() {
1949
1951
  resolve_func(t[COMPONENT]);
1950
1952
  return false;
1951
1953
  }
1952
- window.addEventListener("click", click_handler, true);
1954
+ setTimeout(() => {
1955
+ document.body.appendChild(overlay);
1956
+ window.addEventListener("click", click_handler, true);
1957
+ }, 50);
1953
1958
  return pr;
1954
1959
  }
1955
1960
  function isEmpty(value) {
@@ -2543,7 +2548,7 @@ var ComponentCache = class {
2543
2548
  if (ex.cleanup) {
2544
2549
  ex.cleanup();
2545
2550
  } else if (ex.element && !ex.portal) {
2546
- ex.element.parentElement.removeChild(ex.element);
2551
+ ex.element.parentElement?.removeChild?.(ex.element);
2547
2552
  }
2548
2553
  });
2549
2554
  });
@@ -2610,6 +2615,9 @@ var ComponentCore = class {
2610
2615
  ...next_props || {}
2611
2616
  };
2612
2617
  }
2618
+ if (next_props?.style && typeof next_props.style === "object" && !next_props.style[CLONED_STYLE]) {
2619
+ next_props.style = { ...next_props.style, [CLONED_STYLE]: true };
2620
+ }
2613
2621
  if (this?.parent?.component?.context || this?.parent?.component?.getChildContext) {
2614
2622
  this.context = { ...this.parent.component.context, ...this.parent.component.getChildContext?.() };
2615
2623
  if (this.component.constructor.contextTypes) {
@@ -2717,7 +2725,7 @@ var ComponentCore = class {
2717
2725
  if (typeof this.props.ref === "function") {
2718
2726
  this.props.ref(null);
2719
2727
  } else {
2720
- this.props.current = null;
2728
+ this.props.ref.current = null;
2721
2729
  }
2722
2730
  }
2723
2731
  if (this.component.componentWillUnmount) {
@@ -2811,7 +2819,7 @@ var ComponentCore = class {
2811
2819
  this.element.style = "";
2812
2820
  } else {
2813
2821
  for (let p in this.props.style) {
2814
- if (!patch.style.hasOwnProperty(p)) {
2822
+ if (p !== CLONED_STYLE && !patch?.style?.hasOwnProperty?.(p)) {
2815
2823
  this.element.style[p] = "";
2816
2824
  }
2817
2825
  }
@@ -2833,7 +2841,7 @@ var ComponentCore = class {
2833
2841
  }
2834
2842
  } else if (a === "autoFocus") {
2835
2843
  this.element["autofocus"] = toBool(patch[a]);
2836
- } else if (a === "htmlFor") {
2844
+ } else if (a === "htmlFor" || a === "for") {
2837
2845
  this.element.setAttribute("for", patch[a]);
2838
2846
  } else if (al !== "value" || ["input", "textarea", "select"].indexOf(this.entity) === -1) {
2839
2847
  this.element.setAttribute(al, patch[a]);
@@ -3719,8 +3727,7 @@ function useActionState(action, initialState) {
3719
3727
  async () => {
3720
3728
  const form_data = new FormData(event.target, event.submitter);
3721
3729
  hk.state = await action(hk.state, form_data);
3722
- },
3723
- []
3730
+ }
3724
3731
  );
3725
3732
  return false;
3726
3733
  };
@@ -7213,14 +7220,15 @@ if (true) {
7213
7220
  });
7214
7221
  }
7215
7222
  if (true) {
7216
- console.log(`Lilact (Version: ${Lilact2.VERSION}) - Debug Mode`);
7217
- console.log(`Copyright(C) 2024-2026 Arash Kazemi <contact.arash.kazemi@gmail.com>`);
7223
+ console.info(`Lilact (Version: ${Lilact2.VERSION}) - Debug Mode`);
7224
+ console.info(`Copyright(C) 2024-2026 Arash Kazemi <contact.arash.kazemi@gmail.com>`);
7218
7225
  }
7219
7226
  export {
7220
7227
  ARGS,
7221
7228
  CALLBACK,
7222
7229
  CHILD_CLASS_ADDENDUM,
7223
7230
  CLEARED,
7231
+ CLONED_STYLE,
7224
7232
  COMPONENT,
7225
7233
  CORE,
7226
7234
  CSSTransition,