lilact 0.21.0 → 0.22.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 (122) hide show
  1. package/README.md +17 -4
  2. package/dist/lilact.development.js +486 -39
  3. package/dist/lilact.development.js.map +4 -4
  4. package/dist/lilact.development.min.js +33 -23
  5. package/dist/lilact.development.min.js.map +4 -4
  6. package/dist/lilact.production.min.js +32 -22
  7. package/docs/assets/highlight.css +20 -20
  8. package/docs/classes/accessories.ErrorBoundary.html +8 -8
  9. package/docs/classes/accessories.Suspense.html +7 -7
  10. package/docs/classes/components.Component.html +11 -11
  11. package/docs/classes/components.HTMLComponent.html +12 -12
  12. package/docs/classes/components.RootComponent.html +12 -12
  13. package/docs/functions/accessories.DragHandle.html +2 -2
  14. package/docs/functions/accessories.Spinner.html +2 -2
  15. package/docs/functions/components.createComponent.html +1 -1
  16. package/docs/functions/components.createPortal.html +1 -1
  17. package/docs/functions/components.createRoot.html +1 -1
  18. package/docs/functions/components.memo.html +1 -1
  19. package/docs/functions/components.render.html +1 -1
  20. package/docs/functions/redux.Provider.html +2 -2
  21. package/docs/functions/redux.connect.html +2 -2
  22. package/docs/functions/router.HashRouter.html +2 -2
  23. package/docs/functions/router.Link.html +2 -2
  24. package/docs/functions/router.NavLink.html +2 -2
  25. package/docs/functions/router.Routes.html +2 -2
  26. package/docs/functions/run.lazy.html +9 -3
  27. package/docs/functions/run.require.html +4 -4
  28. package/docs/functions/run.run.html +1 -1
  29. package/docs/functions/run.runScripts.html +1 -1
  30. package/docs/functions/timers.animationFramePromise.html +1 -1
  31. package/docs/functions/timers.clearInterval.html +1 -1
  32. package/docs/functions/timers.clearTimeout.html +1 -1
  33. package/docs/functions/timers.grabTimers.html +1 -1
  34. package/docs/functions/timers.pauseTimers.html +1 -1
  35. package/docs/functions/timers.releaseTimers.html +1 -1
  36. package/docs/functions/timers.resetTimers.html +1 -1
  37. package/docs/functions/timers.resumeTimers.html +1 -1
  38. package/docs/functions/timers.setInterval.html +1 -1
  39. package/docs/functions/timers.setTimeout.html +1 -1
  40. package/docs/functions/timers.timeoutPromise.html +3 -145
  41. package/docs/functions/transition.CSSTransition.html +4 -4
  42. package/docs/functions/transition.SwitchTransition.html +2 -2
  43. package/docs/functions/transition.Transition.html +3 -3
  44. package/docs/index.html +17 -10
  45. package/docs/static/demos/actionstate.jsx +2 -2
  46. package/docs/static/demos/capture.jsx +2 -2
  47. package/docs/static/demos/context.jsx +3 -3
  48. package/docs/static/demos/css-transition.jsx +3 -3
  49. package/docs/static/demos/error-boundary.jsx +2 -2
  50. package/docs/static/demos/error-callback.jsx +1 -1
  51. package/docs/static/demos/error-component-stack.jsx +2 -2
  52. package/docs/static/demos/error-init.jsx +1 -1
  53. package/docs/static/demos/error-parser.jsx +1 -1
  54. package/docs/static/demos/form-elements.jsx +1 -1
  55. package/docs/static/demos/forwardref.jsx +2 -2
  56. package/docs/static/demos/lazy.jsx +3 -3
  57. package/docs/static/demos/legacy-context.jsx +2 -2
  58. package/docs/static/demos/memo.jsx +2 -2
  59. package/docs/static/demos/modal.jsx +2 -2
  60. package/docs/static/demos/pane.jsx +2 -2
  61. package/docs/static/demos/portal.jsx +4 -2
  62. package/docs/static/demos/priorities.jsx +2 -2
  63. package/docs/static/demos/proptypes.jsx +2 -2
  64. package/docs/static/demos/reducer.jsx +2 -2
  65. package/docs/static/demos/redux.jsx +3 -3
  66. package/docs/static/demos/router.jsx +2 -2
  67. package/docs/static/demos/stopwatch.jsx +2 -2
  68. package/docs/static/demos/suspense.jsx +2 -2
  69. package/docs/static/demos/switch-transition.jsx +2 -2
  70. package/docs/static/demos/transition.jsx +2 -2
  71. package/docs/static/demos/usedefered.jsx +2 -2
  72. package/docs/static/demos/usetransition.jsx +3 -3
  73. package/docs/static/index.html +3 -3
  74. package/docs/static/lilact.development.js +486 -39
  75. package/docs/static/lilact.development.js.map +4 -4
  76. package/docs/static/lilact.development.min.js +33 -23
  77. package/docs/static/lilact.development.min.js.map +4 -4
  78. package/docs/static/lilact.production.min.js +32 -22
  79. package/docs/variables/accessories.SplitPane.html +1 -1
  80. package/examples/demos/actionstate.jsx +2 -2
  81. package/examples/demos/capture.jsx +2 -2
  82. package/examples/demos/context.jsx +3 -3
  83. package/examples/demos/css-transition.jsx +3 -3
  84. package/examples/demos/error-boundary.jsx +2 -2
  85. package/examples/demos/error-callback.jsx +1 -1
  86. package/examples/demos/error-component-stack.jsx +2 -2
  87. package/examples/demos/error-init.jsx +1 -1
  88. package/examples/demos/error-parser.jsx +1 -1
  89. package/examples/demos/form-elements.jsx +1 -1
  90. package/examples/demos/forwardref.jsx +2 -2
  91. package/examples/demos/lazy.jsx +3 -3
  92. package/examples/demos/legacy-context.jsx +2 -2
  93. package/examples/demos/memo.jsx +2 -2
  94. package/examples/demos/modal.jsx +2 -2
  95. package/examples/demos/pane.jsx +2 -2
  96. package/examples/demos/portal.jsx +4 -2
  97. package/examples/demos/priorities.jsx +2 -2
  98. package/examples/demos/proptypes.jsx +2 -2
  99. package/examples/demos/reducer.jsx +2 -2
  100. package/examples/demos/redux.jsx +3 -3
  101. package/examples/demos/router.jsx +2 -2
  102. package/examples/demos/stopwatch.jsx +2 -2
  103. package/examples/demos/suspense.jsx +2 -2
  104. package/examples/demos/switch-transition.jsx +2 -2
  105. package/examples/demos/transition.jsx +2 -2
  106. package/examples/demos/usedefered.jsx +2 -2
  107. package/examples/demos/usetransition.jsx +3 -3
  108. package/examples/index.html +3 -3
  109. package/examples/lilact.development.js +486 -39
  110. package/examples/lilact.development.js.map +4 -4
  111. package/examples/lilact.development.min.js +33 -23
  112. package/examples/lilact.development.min.js.map +4 -4
  113. package/examples/lilact.production.min.js +32 -22
  114. package/impexptest.js +51 -0
  115. package/package.json +4 -4
  116. package/src/components.jsx +1 -6
  117. package/src/expscan.js +404 -0
  118. package/src/jsx.js +26 -28
  119. package/src/lilact.jsx +10 -1
  120. package/src/run.jsx +86 -37
  121. package/src/timers.jsx +0 -5
  122. package/src/jsx.addons.js +0 -70
@@ -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 = [];
@@ -73,4 +73,4 @@ function Demo({ username })
73
73
  </>
74
74
  }
75
75
 
76
- module.exports = Demo;
76
+ 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() {
@@ -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