lilact 0.21.1 → 0.23.0

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 (120) hide show
  1. package/README.md +17 -4
  2. package/dist/lilact.development.js +498 -38
  3. package/dist/lilact.development.js.map +4 -4
  4. package/dist/lilact.development.min.js +34 -23
  5. package/dist/lilact.development.min.js.map +4 -4
  6. package/dist/lilact.production.min.js +33 -22
  7. package/docs/assets/hierarchy.js +1 -1
  8. package/docs/assets/highlight.css +20 -20
  9. package/docs/assets/navigation.js +1 -1
  10. package/docs/assets/search.js +1 -1
  11. package/docs/classes/accessories.ErrorBoundary.html +8 -8
  12. package/docs/classes/accessories.Suspense.html +7 -7
  13. package/docs/classes/components.Component.html +11 -11
  14. package/docs/classes/components.HTMLComponent.html +12 -12
  15. package/docs/classes/components.RootComponent.html +12 -12
  16. package/docs/functions/components.cloneComponent.html +1 -0
  17. package/docs/functions/components.createComponent.html +1 -1
  18. package/docs/functions/components.createPortal.html +1 -1
  19. package/docs/functions/components.createRoot.html +1 -1
  20. package/docs/functions/components.memo.html +1 -1
  21. package/docs/functions/components.render.html +1 -1
  22. package/docs/functions/run.lazy.html +7 -1
  23. package/docs/functions/run.require.html +5 -9
  24. package/docs/functions/run.run.html +1 -1
  25. package/docs/functions/run.runScripts.html +1 -1
  26. package/docs/functions/timers.animationFramePromise.html +1 -1
  27. package/docs/functions/timers.clearInterval.html +1 -1
  28. package/docs/functions/timers.clearTimeout.html +1 -1
  29. package/docs/functions/timers.grabTimers.html +1 -1
  30. package/docs/functions/timers.pauseTimers.html +1 -1
  31. package/docs/functions/timers.releaseTimers.html +1 -1
  32. package/docs/functions/timers.resetTimers.html +1 -1
  33. package/docs/functions/timers.resumeTimers.html +1 -1
  34. package/docs/functions/timers.setInterval.html +1 -1
  35. package/docs/functions/timers.setTimeout.html +1 -1
  36. package/docs/functions/timers.timeoutPromise.html +6 -6
  37. package/docs/hierarchy.html +1 -1
  38. package/docs/index.html +17 -10
  39. package/docs/modules/components.html +1 -1
  40. package/docs/static/demos/actionstate.jsx +2 -2
  41. package/docs/static/demos/capture.jsx +2 -2
  42. package/docs/static/demos/cloneelement.jsx +66 -0
  43. package/docs/static/demos/context.jsx +3 -3
  44. package/docs/static/demos/css-transition.jsx +3 -3
  45. package/docs/static/demos/error-boundary.jsx +2 -2
  46. package/docs/static/demos/error-callback.jsx +1 -1
  47. package/docs/static/demos/error-component-stack.jsx +2 -2
  48. package/docs/static/demos/error-init.jsx +1 -1
  49. package/docs/static/demos/error-parser.jsx +1 -1
  50. package/docs/static/demos/form-elements.jsx +1 -1
  51. package/docs/static/demos/forwardref.jsx +2 -2
  52. package/docs/static/demos/lazy.jsx +3 -3
  53. package/docs/static/demos/legacy-context.jsx +2 -2
  54. package/docs/static/demos/memo.jsx +2 -2
  55. package/docs/static/demos/modal.jsx +2 -2
  56. package/docs/static/demos/pane.jsx +2 -2
  57. package/docs/static/demos/portal.jsx +4 -2
  58. package/docs/static/demos/priorities.jsx +2 -2
  59. package/docs/static/demos/proptypes.jsx +2 -2
  60. package/docs/static/demos/reducer.jsx +4 -2
  61. package/docs/static/demos/redux.jsx +3 -3
  62. package/docs/static/demos/router.jsx +3 -3
  63. package/docs/static/demos/stopwatch.jsx +2 -2
  64. package/docs/static/demos/suspense.jsx +2 -2
  65. package/docs/static/demos/switch-transition.jsx +2 -2
  66. package/docs/static/demos/transition.jsx +2 -2
  67. package/docs/static/demos/usedefered.jsx +2 -2
  68. package/docs/static/demos/usetransition.jsx +3 -3
  69. package/docs/static/index.html +34 -33
  70. package/docs/static/lilact.development.js +498 -38
  71. package/docs/static/lilact.development.js.map +4 -4
  72. package/docs/static/lilact.development.min.js +34 -23
  73. package/docs/static/lilact.development.min.js.map +4 -4
  74. package/docs/static/lilact.production.min.js +33 -22
  75. package/docs/variables/accessories.SplitPane.html +1 -1
  76. package/docs/variables/components.cloneElement.html +1 -0
  77. package/examples/demos/actionstate.jsx +2 -2
  78. package/examples/demos/capture.jsx +2 -2
  79. package/examples/demos/cloneelement.jsx +66 -0
  80. package/examples/demos/context.jsx +3 -3
  81. package/examples/demos/css-transition.jsx +3 -3
  82. package/examples/demos/error-boundary.jsx +2 -2
  83. package/examples/demos/error-callback.jsx +1 -1
  84. package/examples/demos/error-component-stack.jsx +2 -2
  85. package/examples/demos/error-init.jsx +1 -1
  86. package/examples/demos/error-parser.jsx +1 -1
  87. package/examples/demos/form-elements.jsx +1 -1
  88. package/examples/demos/forwardref.jsx +2 -2
  89. package/examples/demos/lazy.jsx +3 -3
  90. package/examples/demos/legacy-context.jsx +2 -2
  91. package/examples/demos/memo.jsx +2 -2
  92. package/examples/demos/modal.jsx +2 -2
  93. package/examples/demos/pane.jsx +2 -2
  94. package/examples/demos/portal.jsx +4 -2
  95. package/examples/demos/priorities.jsx +2 -2
  96. package/examples/demos/proptypes.jsx +2 -2
  97. package/examples/demos/reducer.jsx +4 -2
  98. package/examples/demos/redux.jsx +3 -3
  99. package/examples/demos/router.jsx +3 -3
  100. package/examples/demos/stopwatch.jsx +2 -2
  101. package/examples/demos/suspense.jsx +2 -2
  102. package/examples/demos/switch-transition.jsx +2 -2
  103. package/examples/demos/transition.jsx +2 -2
  104. package/examples/demos/usedefered.jsx +2 -2
  105. package/examples/demos/usetransition.jsx +3 -3
  106. package/examples/index.html +34 -33
  107. package/examples/lilact.development.js +498 -38
  108. package/examples/lilact.development.js.map +4 -4
  109. package/examples/lilact.development.min.js +34 -23
  110. package/examples/lilact.development.min.js.map +4 -4
  111. package/examples/lilact.production.min.js +33 -22
  112. package/impexptest.js +51 -0
  113. package/package.json +4 -4
  114. package/src/components.jsx +7 -5
  115. package/src/expscan.js +408 -0
  116. package/src/jsx.js +26 -28
  117. package/src/lilact.jsx +12 -3
  118. package/src/run.jsx +92 -45
  119. package/src/timers.jsx +0 -5
  120. package/src/jsx.addons.js +0 -70
@@ -42,7 +42,7 @@ If provided, the component uses this value instead of internal state.</p>
42
42
  </div><div class="tsd-tag-param"><h4 class="tsd-anchor-link" id="param-rightpanestyle">Param: rightPaneStyle<a href="#param-rightpanestyle" 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><p>Optional styles applied to the right pane (or bottom pane in vertical mode).</p>
43
43
  </div><div class="tsd-tag-param"><h4 class="tsd-anchor-link" id="param-splitterstyle">Param: splitterStyle<a href="#param-splitterstyle" 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><p>Optional styles applied to the splitter element.</p>
44
44
  </div><div class="tsd-tag-param"><h4 class="tsd-anchor-link" id="param-children">Param: children<a href="#param-children" 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><p>Children to be rendered into the two pane containers.</p>
45
- </div><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example">Example<a href="#example" 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="tsx"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">ref</span><span class="hl-1"> = </span><span class="hl-0">useRef</span><span class="hl-1">&lt;</span><span class="hl-6">SplitPaneHandle</span><span class="hl-1">&gt;(</span><span class="hl-3">null</span><span class="hl-1">);</span><br/><br/><span class="hl-7">&lt;</span><span class="hl-6">SplitPane</span><br/><span class="hl-1"> </span><span class="hl-10">ref</span><span class="hl-1">=</span><span class="hl-3">{</span><span class="hl-5">ref</span><span class="hl-3">}</span><br/><span class="hl-1"> </span><span class="hl-10">mode</span><span class="hl-1">=</span><span class="hl-2">&quot;horizontal&quot;</span><br/><span class="hl-1"> </span><span class="hl-10">defaultPosition</span><span class="hl-1">=</span><span class="hl-3">{</span><span class="hl-13">0.5</span><span class="hl-3">}</span><br/><span class="hl-1"> </span><span class="hl-10">min</span><span class="hl-1">=</span><span class="hl-3">{</span><span class="hl-13">0.1</span><span class="hl-3">}</span><br/><span class="hl-1"> </span><span class="hl-10">max</span><span class="hl-1">=</span><span class="hl-3">{</span><span class="hl-13">0.9</span><span class="hl-3">}</span><br/><span class="hl-1"> </span><span class="hl-10">onSizeChange</span><span class="hl-1">=</span><span class="hl-3">{</span><span class="hl-9">(</span><span class="hl-5">pos</span><span class="hl-9">) </span><span class="hl-3">=&gt;</span><span class="hl-9"> </span><span class="hl-5">console</span><span class="hl-9">.</span><span class="hl-0">log</span><span class="hl-9">(</span><span class="hl-5">pos</span><span class="hl-9">)</span><span class="hl-3">}</span><br/><span class="hl-7">&gt;</span><br/><span class="hl-1"> </span><span class="hl-7">&lt;</span><span class="hl-8">div</span><span class="hl-1"> </span><span class="hl-7">/&gt;</span><span class="hl-1"> </span><span class="hl-7">&lt;</span><span class="hl-8">div</span><span class="hl-1"> </span><span class="hl-7">/&gt;</span><br/><span class="hl-7">&lt;/</span><span class="hl-6">SplitPane</span><span class="hl-7">&gt;</span>
45
+ </div><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example">Example<a href="#example" 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="tsx"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-7">ref</span><span class="hl-1"> = </span><span class="hl-0">useRef</span><span class="hl-1">&lt;</span><span class="hl-8">SplitPaneHandle</span><span class="hl-1">&gt;(</span><span class="hl-3">null</span><span class="hl-1">);</span><br/><br/><span class="hl-9">&lt;</span><span class="hl-8">SplitPane</span><br/><span class="hl-1"> </span><span class="hl-12">ref</span><span class="hl-1">=</span><span class="hl-3">{</span><span class="hl-5">ref</span><span class="hl-3">}</span><br/><span class="hl-1"> </span><span class="hl-12">mode</span><span class="hl-1">=</span><span class="hl-2">&quot;horizontal&quot;</span><br/><span class="hl-1"> </span><span class="hl-12">defaultPosition</span><span class="hl-1">=</span><span class="hl-3">{</span><span class="hl-14">0.5</span><span class="hl-3">}</span><br/><span class="hl-1"> </span><span class="hl-12">min</span><span class="hl-1">=</span><span class="hl-3">{</span><span class="hl-14">0.1</span><span class="hl-3">}</span><br/><span class="hl-1"> </span><span class="hl-12">max</span><span class="hl-1">=</span><span class="hl-3">{</span><span class="hl-14">0.9</span><span class="hl-3">}</span><br/><span class="hl-1"> </span><span class="hl-12">onSizeChange</span><span class="hl-1">=</span><span class="hl-3">{</span><span class="hl-11">(</span><span class="hl-5">pos</span><span class="hl-11">) </span><span class="hl-3">=&gt;</span><span class="hl-11"> </span><span class="hl-5">console</span><span class="hl-11">.</span><span class="hl-0">log</span><span class="hl-11">(</span><span class="hl-5">pos</span><span class="hl-11">)</span><span class="hl-3">}</span><br/><span class="hl-9">&gt;</span><br/><span class="hl-1"> </span><span class="hl-9">&lt;</span><span class="hl-10">div</span><span class="hl-1"> </span><span class="hl-9">/&gt;</span><span class="hl-1"> </span><span class="hl-9">&lt;</span><span class="hl-10">div</span><span class="hl-1"> </span><span class="hl-9">/&gt;</span><br/><span class="hl-9">&lt;/</span><span class="hl-8">SplitPane</span><span class="hl-9">&gt;</span>
46
46
  </code><button type="button">Copy</button></pre>
47
47
 
48
48
  </div></div><aside class="tsd-sources"><ul><li>Defined in accessories.jsx:425</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>
@@ -0,0 +1 @@
1
+ <!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>cloneElement | Lilact</title><meta name="description" content="Documentation for Lilact"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">Lilact</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="../modules/components.html">components</a></li><li><a href="" aria-current="page">cloneElement</a></li></ul><h1>Variable cloneElement<code class="tsd-tag">Const</code></h1></div><div class="tsd-signature"><span class="tsd-kind-variable">cloneElement</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><br/>    <span class="tsd-kind-parameter">component</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/>    <span class="tsd-kind-parameter">propsPatch</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/>    <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">children</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=&gt;</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">entity</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">props</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol"> = cloneComponent</span></div><div class="tsd-type-declaration"><h4>Type Declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature" id="__type"><span class="tsd-signature-symbol">(</span><br/>    <span class="tsd-kind-parameter">component</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/>    <span class="tsd-kind-parameter">propsPatch</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/>    <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">children</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">entity</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">props</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span> <span class="tsd-signature-symbol">}</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">component</span>: <span class="tsd-signature-type">any</span></span></li><li><span><span class="tsd-kind-parameter">propsPatch</span>: <span class="tsd-signature-type">any</span></span></li><li><span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">children</span>: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">entity</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">props</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span> <span class="tsd-signature-symbol">}</span></h4></li></ul></li></ul></div><aside class="tsd-sources"><ul><li>Defined in components.jsx:1214</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>
@@ -1,4 +1,4 @@
1
- const { useActionState, Spinner } = Lilact;
1
+ import { useActionState, Spinner } from "lilact";
2
2
 
3
3
  async function addToCart(prevState, queryData) {
4
4
 
@@ -36,4 +36,4 @@ function Demo() {
36
36
  }
37
37
 
38
38
 
39
- module.exports = Demo;
39
+ export default Demo;
@@ -1,6 +1,6 @@
1
- const { useEffect } = Lilact;
1
+ import { useEffect } from "lilact";
2
2
 
3
- module.exports = function Demo() {
3
+ export default function Demo() {
4
4
  useEffect(() => {
5
5
  // Just to make it obvious in the console that this is running once
6
6
  console.log("mount");
@@ -0,0 +1,66 @@
1
+ import React from "lilact";
2
+
3
+ function FancyButton({ label, variant, onClick, children }) {
4
+ return (
5
+ <button
6
+ className={`btn btn--${variant}`}
7
+ onClick={onClick}
8
+ style={{ marginRight: 12 }}
9
+ >
10
+ {label}
11
+ {children ? <span style={{ marginLeft: 8 }}>{children}</span> : null}
12
+ </button>
13
+ );
14
+ }
15
+
16
+ export default function Demo() {
17
+ const original = (
18
+ <FancyButton
19
+ label="Original"
20
+ variant="primary"
21
+ onClick={() => alert("Original clicked")}
22
+ >
23
+ (child)
24
+ </FancyButton>
25
+ );
26
+
27
+ const cloned = React.cloneElement(original, {
28
+ // Override props:
29
+ label: "Cloned!",
30
+ variant: "success",
31
+
32
+ // You can override event handlers too:
33
+ onClick: () => alert("Cloned clicked"),
34
+ });
35
+
36
+ const clonedWithNewChildren = React.cloneElement(
37
+ original,
38
+ {
39
+ // Override just one prop; leave others as-is
40
+ variant: "warning",
41
+ },
42
+
43
+ <span style={{ fontStyle: "italic" }}>(new child)</span>
44
+ );
45
+
46
+ return (
47
+ <div style={{ padding: 16 }}>
48
+ <h2>React.cloneElement behavior</h2>
49
+
50
+ <div style={{ marginBottom: 16 }}>
51
+ <div>1) Original element (unchanged):</div>
52
+ {original}
53
+ </div>
54
+
55
+ <div style={{ marginBottom: 16 }}>
56
+ <div>2) Cloned with overridden props:</div>
57
+ {cloned}
58
+ </div>
59
+
60
+ <div>
61
+ <div>3) Cloned with overridden props + replaced children:</div>
62
+ {clonedWithNewChildren}
63
+ </div>
64
+ </div>
65
+ );
66
+ }
@@ -1,5 +1,5 @@
1
- const { createContext, useContext, useState } = Lilact;
2
- const { css, cx } = Lilact.emotion;
1
+ import { createContext, useContext, useState } from "lilact";
2
+ import { css, cx } from "@emotion/css";
3
3
 
4
4
  const ThemeContext = createContext(null);
5
5
 
@@ -63,4 +63,4 @@ function Demo() {
63
63
  </ThemeContext.Provider>
64
64
  }
65
65
 
66
- module.exports = Demo;
66
+ export default Demo;
@@ -1,4 +1,4 @@
1
- const { CSSTransition, useState, useRef } = Lilact;
1
+ import { CSSTransition, useState, useRef } from "lilact";
2
2
 
3
3
 
4
4
  Lilact.emotion.injectGlobal(`
@@ -29,7 +29,7 @@ function Demo()
29
29
 
30
30
  const chs = [];
31
31
 
32
- for(let i=0; i<10;i++) chs.push( <div className='test'>{i}</div> );
32
+ for(let i=1; i<10;i++) chs.push( <div className='test'>{i}</div> );
33
33
 
34
34
  return (
35
35
  <div style={{overflow:"hidden", textAlign: "center"}}>
@@ -62,4 +62,4 @@ function Demo()
62
62
  );
63
63
  }
64
64
 
65
- module.exports = Demo;
65
+ export default Demo;
@@ -1,4 +1,4 @@
1
- const { ErrorBoundary, useState } = Lilact;
1
+ import { ErrorBoundary, useState } from "lilact";
2
2
 
3
3
  function Demo() {
4
4
  const [mode, setMode] = useState("safe"); // "safe" | "direct" | "deep"
@@ -56,4 +56,4 @@ function MyFallback({ error, reset }) {
56
56
  );
57
57
  }
58
58
 
59
- module.exports = Demo;
59
+ export default Demo;
@@ -1,4 +1,4 @@
1
- module.exports = function() {
1
+ export default function() {
2
2
 
3
3
  return <center>
4
4
  <button onClick={()=>{doUnknown()}}>
@@ -1,4 +1,4 @@
1
- const { useState } = Lilact;
1
+ import { useState } from "lilact";
2
2
 
3
3
  function Demo() {
4
4
  const [mode, setMode] = useState("safe"); // "safe" | "direct" | "deep"
@@ -36,4 +36,4 @@ function DeepTree() {
36
36
  return <section><Middle /></section>;
37
37
  }
38
38
 
39
- module.exports = Demo;
39
+ export default Demo;
@@ -1,4 +1,4 @@
1
- module.exports = function Demo() {
1
+ export default function Demo() {
2
2
 
3
3
  return <>
4
4
  <NotDefined/>
@@ -1,4 +1,4 @@
1
- module.exports = function() {
1
+ export default function() {
2
2
 
3
3
  return <>
4
4
 
@@ -1,4 +1,4 @@
1
- module.exports = function() {
1
+ export default function() {
2
2
 
3
3
  return <>
4
4
 
@@ -1,4 +1,4 @@
1
- const { forwardRef, useImperativeHandle, useRef } = Lilact;
1
+ import { forwardRef, useImperativeHandle, useRef } from "lilact";
2
2
 
3
3
  const Child = forwardRef(function Child({ id }, ref) {
4
4
  // Each child exposes a custom imperative API on its *own* ref
@@ -11,7 +11,7 @@ const Child = forwardRef(function Child({ id }, ref) {
11
11
  return <div>Child {id}</div>;
12
12
  });
13
13
 
14
- module.exports = function Demo() {
14
+ export default function Demo() {
15
15
  const childRefs = useRef([]);
16
16
 
17
17
  // helper: store the function ref for each child index
@@ -1,6 +1,6 @@
1
- const {Suspense, Spinner, lazy, require} = Lilact;
1
+ import {Suspense, Spinner, lazy } from "lilact";
2
2
 
3
- const StopWatch = lazy( ()=>require('demos/stopwatch.jsx') );
3
+ const StopWatch = lazy( () => require('./stopwatch.jsx') );
4
4
 
5
5
  function Demo({file})
6
6
  {
@@ -12,4 +12,4 @@ function Demo({file})
12
12
  </div>
13
13
  }
14
14
 
15
- module.exports = Demo;
15
+ export default Demo;
@@ -4,7 +4,7 @@
4
4
  // - static contextTypes
5
5
  // - instance.context available during render
6
6
 
7
- const { Component, PropTypes, render } = Lilact;
7
+ import { Component, PropTypes, render } from "lilact";
8
8
 
9
9
 
10
10
  // ----- Consumer -----
@@ -74,6 +74,6 @@ function Demo() {
74
74
  </>
75
75
  }
76
76
 
77
- module.exports = Demo;
77
+ export default Demo;
78
78
 
79
79
 
@@ -1,11 +1,11 @@
1
- const { useState, memo } = Lilact;
1
+ import { useState, memo } from "lilact"
2
2
 
3
3
  const Child = memo(function Child({ count }) {
4
4
  console.log("Child render. count =", count);
5
5
  return <div>Child count: {count}</div>;
6
6
  });
7
7
 
8
- module.exports = function Demo() {
8
+ export default function Demo() {
9
9
  const [tick, setTick] = useState(0);
10
10
  const [count] = useState(5); // never changes
11
11
 
@@ -1,4 +1,4 @@
1
- const { useEffect, useRef, useState } = Lilact;
1
+ import { useEffect, useRef, useState } from "lilact";
2
2
 
3
3
  function ModalDialog({ isOpen, children }) {
4
4
  const ref = useRef();
@@ -37,4 +37,4 @@ function Demo() {
37
37
  </>;
38
38
  }
39
39
 
40
- module.exports = Demo;
40
+ export default Demo;
@@ -1,6 +1,6 @@
1
- const { useRef, useState, SplitPane } = Lilact;
1
+ import { useRef, useState, SplitPane } from "lilact";
2
2
 
3
- module.exports = function Demo() {
3
+ export default function Demo() {
4
4
  const ref = useRef(null);
5
5
  const [mode, setMode] = useState("horizontal");
6
6
  const [position, setPosition] = useState(0.35);
@@ -1,4 +1,4 @@
1
- const { createPortal, useState } = Lilact;
1
+ import { createPortal, useState } from "lilact";
2
2
 
3
3
  function Modal({ open, onClose, children }) {
4
4
  if (!open) return null;
@@ -41,11 +41,13 @@ function Modal({ open, onClose, children }) {
41
41
  );
42
42
  }
43
43
 
44
- module.exports = function Demo() {
44
+ export default function Demo() {
45
45
  const [open, setOpen] = useState(false);
46
46
 
47
47
  return (
48
48
  <>
49
+ <p>This example creates a modal, but uses a portal for it.</p>
50
+ <p>Notice that the modal close button style does not obey this container CSS rules as it is rendered outside.</p>
49
51
  <button onClick={() => setOpen(true)}>Open modal</button>
50
52
  <Modal open={open} onClose={() => setOpen(false)}>
51
53
  <b>Hello World!</b><br/>
@@ -1,4 +1,4 @@
1
- const {useEffect, useLayoutEffect, useInsertionEffect, useState, startTransition} = Lilact;
1
+ import {useEffect, useLayoutEffect, useInsertionEffect, useState, startTransition} from "lilact";
2
2
 
3
3
  function Demo() {
4
4
  const [n, setN] = useState(0);
@@ -65,4 +65,4 @@ function Demo() {
65
65
  </>);
66
66
  }
67
67
 
68
- module.exports = Demo;
68
+ export default Demo;
@@ -1,4 +1,4 @@
1
- const { PropTypes } = Lilact;
1
+ import { PropTypes } from "lilact";
2
2
 
3
3
  function UserCard({ name, age, tags, onClick }) {
4
4
  return (
@@ -31,4 +31,4 @@ function Demo() {
31
31
  </div>
32
32
  }
33
33
 
34
- module.exports = Demo;
34
+ export default Demo;
@@ -1,4 +1,4 @@
1
- const { useReducer } = Lilact;
1
+ import { useReducer } from "lilact";
2
2
 
3
3
  function createInitialState(username) {
4
4
  const initialTodos = [];
@@ -37,6 +37,8 @@ function reducer(state, action) {
37
37
 
38
38
  function Demo({ username })
39
39
  {
40
+ username ??= "Tester";
41
+
40
42
  const [state, dispatch] = useReducer(
41
43
  reducer,
42
44
  username,
@@ -73,4 +75,4 @@ function Demo({ username })
73
75
  </>
74
76
  }
75
77
 
76
- module.exports = Demo;
78
+ export default Demo;
@@ -1,5 +1,5 @@
1
- const { Provider, useSelector, useDispatch, connect } = Lilact;
2
- const { createStore } = Lilact.redux;
1
+ import { Provider, useSelector, useDispatch, connect } from "lilact";
2
+ import { createStore } from "redux";
3
3
 
4
4
  // Reducer + store
5
5
  function counterReducer(state = { count: 0 }, action) {
@@ -54,5 +54,5 @@ function Demo({ username })
54
54
  </Provider>;
55
55
  }
56
56
 
57
- module.exports = Demo;
57
+ export default Demo;
58
58
 
@@ -1,4 +1,4 @@
1
- const { HashRouter, NavLink, Routes, Route, useNavigate, useLocation } = Lilact;
1
+ import { HashRouter, NavLink, Routes, Route, useNavigate, useLocation } from "lilact";
2
2
 
3
3
  /* Simple pages */
4
4
  function Home() {
@@ -79,7 +79,7 @@ function NavControls() {
79
79
  }
80
80
  style={{ marginLeft: 8 }}
81
81
  >
82
- Go Profile (replace + state)
82
+ Go Profile (replace + state) (Clears History)
83
83
  </button>
84
84
  <button onClick={() => navigate(-1)} style={{ marginLeft: 8 }}>
85
85
  Back
@@ -143,4 +143,4 @@ function Demo() {
143
143
  );
144
144
  }
145
145
 
146
- module.exports = Demo;
146
+ export default Demo;
@@ -1,4 +1,4 @@
1
- const { useState, useRef } = Lilact;
1
+ import { useState, useRef } from "lilact";
2
2
 
3
3
  function Demo()
4
4
  {
@@ -39,4 +39,4 @@ function Demo()
39
39
  );
40
40
  }
41
41
 
42
- module.exports = Demo;
42
+ export default Demo;
@@ -1,4 +1,4 @@
1
- const { Suspense, Spinner } = Lilact;
1
+ import { Suspense, Spinner } from "lilact";
2
2
 
3
3
  // resource factory that throws its internal promise until resolved
4
4
  function createResource(delay, value) {
@@ -43,4 +43,4 @@ function Demo() {
43
43
  }
44
44
 
45
45
 
46
- module.exports = Demo;
46
+ export default Demo;
@@ -1,4 +1,4 @@
1
- const { useState, SwitchTransition } = Lilact;
1
+ import { useState, SwitchTransition } from "lilact";
2
2
 
3
3
  Lilact.emotion.injectGlobal(`
4
4
  .switch-enter,
@@ -51,4 +51,4 @@ function Demo() {
51
51
  );
52
52
  }
53
53
 
54
- module.exports = Demo;
54
+ export default Demo;
@@ -1,4 +1,4 @@
1
- const { useState, Transition } = Lilact;
1
+ import { useState, Transition } from "lilact";
2
2
 
3
3
  function Demo() {
4
4
  const [inProp, setInProp] = useState(false);
@@ -38,4 +38,4 @@ function Demo() {
38
38
  </>;
39
39
  };
40
40
 
41
- module.exports = Demo;
41
+ export default Demo;
@@ -1,4 +1,4 @@
1
- const { useState, useDeferredValue } = Lilact;
1
+ import { useState, useDeferredValue } from "lilact";
2
2
 
3
3
  function ExpensiveList({ query }) {
4
4
  const items = Array.from({ length: 5000 }, (_, i) => `${query} item ${i}`);
@@ -30,4 +30,4 @@ function Demo() {
30
30
  );
31
31
  }
32
32
 
33
- module.exports = Demo;
33
+ export default Demo;
@@ -1,5 +1,5 @@
1
- const { useTransition, useState, useCallback, useId } = Lilact;
2
- const { css, cx } = Lilact.emotion;
1
+ import { useTransition, useState, useCallback, useId } from "lilact";
2
+ import { css, cx } from "@emotion/css";
3
3
 
4
4
  const Demo = ()=>{
5
5
 
@@ -32,4 +32,4 @@ const Demo = ()=>{
32
32
  );
33
33
  };
34
34
 
35
- module.exports = Demo;
35
+ export default Demo;
@@ -20,8 +20,8 @@
20
20
 
21
21
  <script type='text/jsx'>
22
22
 
23
- const { useRef, useEffect, useState, Suspense, Spinner, run, render } = Lilact;
24
- const { css,cx,keyframes,injectGlobal } = Lilact.emotion;
23
+ import { useRef, useEffect, useState, Suspense, Spinner, run, render } from "lilact";
24
+ import { css,cx,keyframes,injectGlobal } from "@emotion/css";
25
25
 
26
26
 
27
27
  const cache = new Map();
@@ -161,7 +161,7 @@ function DemoView({ entry })
161
161
  //console.log(code);
162
162
  if(isOpen) {
163
163
  useEffect(() => {
164
- const Comp = run(code, "demos/"+entry[0]);
164
+ const Comp = run(code, "demos/"+entry[0]).default;
165
165
  Lilact.render(<Comp/>, viewRef.current);
166
166
  });
167
167
 
@@ -172,8 +172,8 @@ function DemoView({ entry })
172
172
 
173
173
  return <>
174
174
  <button onClick={()=>setOpen(!isOpen)} className={collapsible} type="button">
175
- <span className={left}>{ (isOpen?'- ':'+ ') + entry[0] + ' '}</span>
176
- <b className={right}>{entry[1]}</b>
175
+ <b className={left}>{ (isOpen?'- ':'+ ') + entry[1] + ' '}</b>
176
+ <span className={right}>{entry[0]}</span>
177
177
  </button>
178
178
  {isOpen &&
179
179
  <div style={{width:"100%"}}>
@@ -216,40 +216,41 @@ function App()
216
216
  {
217
217
  const demos =[
218
218
  "Hooks",
219
- ['stopwatch.jsx', '( useState, useRef )'],
220
- ['actionstate.jsx', '( useActionState, Spinner )'],
221
- ['usedefered.jsx', '( useState, useDeferredValue )'],
222
- ['usetransition.jsx', '( useTransition, useState, useCallback, useId ), emotion:( css, cx )'],
223
- ['reducer.jsx', '( useReducer )'],
224
- ['context.jsx', '( createContext, useContext, useState ), emotion:( css, cx )'],
219
+ ['stopwatch.jsx', 'Stop Watch ( useState, useRef )'],
220
+ ['actionstate.jsx', 'Action State ( useActionState, Spinner )'],
221
+ ['usedefered.jsx', 'Deferred List Update ( useState, useDeferredValue )'],
222
+ ['usetransition.jsx', 'Transition ( useTransition, useState, useCallback, useId ), emotion:( css, cx )'],
223
+ ['reducer.jsx', 'Todo List: ( useReducer )'],
224
+ ['context.jsx', 'Modern Context API ( createContext, useContext, useState ), emotion:( css, cx )'],
225
225
 
226
226
  "API",
227
- ['capture.jsx', '-- Event Capture and Bubble --'],
228
- ['priorities.jsx', '-- Effect Priorities --'],
229
- ['forwardref.jsx', '( forwardRef, useImperativeHandle, useRef )'],
230
- ['memo.jsx', '( memo, useState )'],
231
- ['lazy.jsx', '( lazy, require, Suspene, Spinner )'],
232
- ['proptypes.jsx', '( PropTypes )'],
233
- ['legacy-context.jsx', '-- Legacy Context API --'],
234
- ['redux.jsx', '( Provider, useSelector, useDispatch, connect ), redux:( createStore )'],
235
- ['transition.jsx', '( useState, Transition )'],
227
+ ['capture.jsx', 'Event Capture and Bubble'],
228
+ ['priorities.jsx', 'Effect Priorities'],
229
+ ['forwardref.jsx', 'ForwardRef with Function Refs ( forwardRef, useImperativeHandle, useRef )'],
230
+ ['memo.jsx', 'Component Memoization ( memo, useState )'],
231
+ ['lazy.jsx', 'Lazy Loading ( lazy, require, Suspene, Spinner )'],
232
+ ['proptypes.jsx', 'PropTypes Validation'],
233
+ ['legacy-context.jsx', 'Legacy Context API'],
234
+ ['redux.jsx', 'Redux and Despatch ( Provider, useSelector, useDispatch, connect ), redux:( createStore )'],
235
+ ['transition.jsx', 'Transition States ( useState, Transition )'],
236
+ ['cloneelement.jsx', 'Cloning Components ( cloneElement, import as React )'],
236
237
 
237
238
  "Components",
238
- ['router.jsx', '( HashRouter, NavLink, Routes, Route, useNavigate, useLocation )'],
239
- ['modal.jsx', '( useEffect, useRef, useState )'],
240
- ['portal.jsx', '(createPortal, useState )'],
241
- ['pane.jsx', '( useRef, useState, SplitPane )'],
242
- ['css-transition.jsx', '( CSSTransition, useState, useRef )'],
243
- ['switch-transition.jsx', '( SwitchTransition )'],
244
- ['suspense.jsx', '( Suspense, Spinner )'],
245
- ['form-elements.jsx', '()'],
239
+ ['router.jsx', 'Hash Router ( HashRouter, NavLink, Routes, Route, useNavigate, useLocation )'],
240
+ ['modal.jsx', 'Simple Modal ( useEffect, useRef, useState )'],
241
+ ['portal.jsx', 'Portal (createPortal, useState )'],
242
+ ['pane.jsx', 'SplitPane ( useRef, useState, SplitPane )'],
243
+ ['css-transition.jsx', 'CSSTransition ( CSSTransition, useState, useRef )'],
244
+ ['switch-transition.jsx', 'SwitchTransition'],
245
+ ['suspense.jsx', 'Suspense and Spinner'],
246
+ ['form-elements.jsx', 'Form Elements'],
246
247
 
247
248
  "Error Report and Handling",
248
- ['error-boundary.jsx', '( ErrorBoundary, useState )'],
249
- ['error-parser.jsx', '-- JSX Parser Error --'],
250
- ['error-init.jsx', '-- Error in Component initialization --'],
251
- ['error-component-stack.jsx', '-- Error Component Stack --'],
252
- ['error-callback.jsx', '-- Error in Callback --'],
249
+ ['error-boundary.jsx', 'Error Boundary'],
250
+ ['error-parser.jsx', 'JSX Parser Error'],
251
+ ['error-init.jsx', 'Error in Component initialization'],
252
+ ['error-component-stack.jsx', 'Error Component Stack'],
253
+ ['error-callback.jsx', 'Error in Callback'],
253
254
  ];
254
255
 
255
256
  return<>