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
@@ -3,4 +3,4 @@
3
3
  </div></li><li><span><span class="tsd-kind-parameter">initialArg</span>: <span class="tsd-signature-type">any</span></span><div class="tsd-comment tsd-typography"><p>Initial state value (or initializer arg).</p>
4
4
  </div></li><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">init</span>: <span class="tsd-signature-type">Function</span></span><div class="tsd-comment tsd-typography"><p>Optional initializer function for lazy initial state.</p>
5
5
  </div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4><p>Hook result <code>[state, dispatch]</code>.</p>
6
- <aside class="tsd-sources"><ul><li>Defined in hooks.jsx:449</li></ul></aside></div></li></ul></section></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>
6
+ <aside class="tsd-sources"><ul><li>Defined in hooks.jsx:448</li></ul></aside></div></li></ul></section></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"),
@@ -2543,7 +2546,7 @@ var ComponentCache = class {
2543
2546
  if (ex.cleanup) {
2544
2547
  ex.cleanup();
2545
2548
  } else if (ex.element && !ex.portal) {
2546
- ex.element.parentElement.removeChild(ex.element);
2549
+ ex.element.parentElement?.removeChild?.(ex.element);
2547
2550
  }
2548
2551
  });
2549
2552
  });
@@ -2610,6 +2613,9 @@ var ComponentCore = class {
2610
2613
  ...next_props || {}
2611
2614
  };
2612
2615
  }
2616
+ if (next_props?.style && typeof next_props.style === "object" && !next_props.style[CLONED_STYLE]) {
2617
+ next_props.style = { ...next_props.style, [CLONED_STYLE]: true };
2618
+ }
2613
2619
  if (this?.parent?.component?.context || this?.parent?.component?.getChildContext) {
2614
2620
  this.context = { ...this.parent.component.context, ...this.parent.component.getChildContext?.() };
2615
2621
  if (this.component.constructor.contextTypes) {
@@ -2717,7 +2723,7 @@ var ComponentCore = class {
2717
2723
  if (typeof this.props.ref === "function") {
2718
2724
  this.props.ref(null);
2719
2725
  } else {
2720
- this.props.current = null;
2726
+ this.props.ref.current = null;
2721
2727
  }
2722
2728
  }
2723
2729
  if (this.component.componentWillUnmount) {
@@ -2811,7 +2817,7 @@ var ComponentCore = class {
2811
2817
  this.element.style = "";
2812
2818
  } else {
2813
2819
  for (let p in this.props.style) {
2814
- if (!patch.style.hasOwnProperty(p)) {
2820
+ if (p !== CLONED_STYLE && !patch.style.hasOwnProperty(p)) {
2815
2821
  this.element.style[p] = "";
2816
2822
  }
2817
2823
  }
@@ -2833,7 +2839,7 @@ var ComponentCore = class {
2833
2839
  }
2834
2840
  } else if (a === "autoFocus") {
2835
2841
  this.element["autofocus"] = toBool(patch[a]);
2836
- } else if (a === "htmlFor") {
2842
+ } else if (a === "htmlFor" || a === "for") {
2837
2843
  this.element.setAttribute("for", patch[a]);
2838
2844
  } else if (al !== "value" || ["input", "textarea", "select"].indexOf(this.entity) === -1) {
2839
2845
  this.element.setAttribute(al, patch[a]);
@@ -3719,8 +3725,7 @@ function useActionState(action, initialState) {
3719
3725
  async () => {
3720
3726
  const form_data = new FormData(event.target, event.submitter);
3721
3727
  hk.state = await action(hk.state, form_data);
3722
- },
3723
- []
3728
+ }
3724
3729
  );
3725
3730
  return false;
3726
3731
  };
@@ -7221,6 +7226,7 @@ export {
7221
7226
  CALLBACK,
7222
7227
  CHILD_CLASS_ADDENDUM,
7223
7228
  CLEARED,
7229
+ CLONED_STYLE,
7224
7230
  COMPONENT,
7225
7231
  CORE,
7226
7232
  CSSTransition,