lilact 0.14.2 → 0.15.1

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 (79) hide show
  1. package/dist/lilact.development.js +547 -393
  2. package/dist/lilact.development.js.map +1 -1
  3. package/dist/lilact.development.min.js +1 -1
  4. package/dist/lilact.development.min.js.LICENSE.txt +6 -0
  5. package/dist/lilact.development.min.js.map +1 -1
  6. package/dist/lilact.production.min.js +1 -1
  7. package/dist/lilact.production.min.js.map +1 -1
  8. package/docs/classes/accessories.ErrorBoundary.html +11 -11
  9. package/docs/classes/accessories.Suspense.html +10 -10
  10. package/docs/classes/components.Component.html +11 -11
  11. package/docs/classes/components.HTMLComponent.html +11 -11
  12. package/docs/classes/components.RootComponent.html +11 -11
  13. package/docs/functions/accessories.DragHandle.html +1 -1
  14. package/docs/functions/accessories.Spinner.html +1 -1
  15. package/docs/functions/components.createComponent.html +1 -1
  16. package/docs/functions/components.createRoot.html +1 -1
  17. package/docs/functions/components.render.html +1 -1
  18. package/docs/functions/errors.globalErrorHandler.html +1 -1
  19. package/docs/functions/errors.traceError.html +1 -1
  20. package/docs/functions/hooks.createContext.html +1 -1
  21. package/docs/functions/hooks.useActionState.html +1 -1
  22. package/docs/functions/hooks.useCallback.html +1 -1
  23. package/docs/functions/hooks.useContext.html +1 -1
  24. package/docs/functions/hooks.useDeferredValue.html +1 -1
  25. package/docs/functions/hooks.useEffect.html +1 -1
  26. package/docs/functions/hooks.useHook.html +1 -1
  27. package/docs/functions/hooks.useId.html +1 -1
  28. package/docs/functions/hooks.useImperativeHandle.html +1 -1
  29. package/docs/functions/hooks.useLayoutEffect.html +1 -1
  30. package/docs/functions/hooks.useLocalStorage.html +1 -1
  31. package/docs/functions/hooks.useMemo.html +1 -1
  32. package/docs/functions/hooks.useReducer.html +1 -1
  33. package/docs/functions/hooks.useRef.html +1 -1
  34. package/docs/functions/hooks.useState.html +1 -1
  35. package/docs/functions/hooks.useTransition.html +1 -1
  36. package/docs/functions/redux.Provider.html +1 -1
  37. package/docs/functions/redux.combineReducers.html +1 -1
  38. package/docs/functions/redux.connect.html +1 -1
  39. package/docs/functions/redux.useDispatch.html +1 -1
  40. package/docs/functions/redux.useSelector.html +1 -1
  41. package/docs/functions/redux.useStore.html +1 -1
  42. package/docs/functions/router.HashRouter.html +1 -1
  43. package/docs/functions/router.Link.html +1 -1
  44. package/docs/functions/router.NavLink.html +1 -1
  45. package/docs/functions/router.Route.html +1 -1
  46. package/docs/functions/router.Routes.html +1 -1
  47. package/docs/functions/router.useLocation.html +1 -1
  48. package/docs/functions/router.useNavigate.html +1 -1
  49. package/docs/functions/run.lazy.html +1 -1
  50. package/docs/functions/run.require.html +3 -3
  51. package/docs/functions/run.run.html +1 -1
  52. package/docs/functions/run.runScripts.html +3 -3
  53. package/docs/functions/timers.timeoutPromise.html +133 -2
  54. package/docs/functions/transition.CSSTransition.html +1 -1
  55. package/docs/functions/transition.SwitchTransition.html +1 -1
  56. package/docs/functions/transition.Transition.html +1 -1
  57. package/docs/functions/transition.TransitionGroup.html +1 -1
  58. package/docs/static/lilact.development.js +547 -393
  59. package/docs/static/lilact.development.min.js +1 -1
  60. package/docs/static/lilact.production.min.js +1 -1
  61. package/docs/variables/accessories.SplitPane.html +1 -1
  62. package/package.json +1 -1
  63. package/root/lilact.development.js +547 -393
  64. package/root/lilact.development.min.js +1 -1
  65. package/root/lilact.production.min.js +1 -1
  66. package/src/accessories.jsx +14 -17
  67. package/src/components.jsx +87 -27
  68. package/src/errors.jsx +11 -9
  69. package/src/hooks.jsx +32 -30
  70. package/src/lilact.jsx +8 -8
  71. package/src/loader.cjs +1 -1
  72. package/src/misc.jsx +1 -60
  73. package/src/redux.jsx +13 -11
  74. package/src/router.jsx +88 -49
  75. package/src/run.jsx +19 -16
  76. package/src/symbols.jsx +65 -0
  77. package/src/timers.jsx +6 -6
  78. package/src/transition.jsx +6 -4
  79. package/webpack.config.js +7 -3
package/src/redux.jsx CHANGED
@@ -28,8 +28,10 @@
28
28
 
29
29
  */
30
30
 
31
+ import { createContext, useContext, useRef, useState, useEffect } from './hooks.jsx'
32
+ import { shallowEqual } from './misc.jsx'
31
33
 
32
- ʔ defineSymbols ( "LILACT", [ "CORE" ] ) ʔ
34
+ import { CORE } from "./symbols.jsx"
33
35
 
34
36
  let ReduxContext;
35
37
 
@@ -42,7 +44,7 @@ let ReduxContext;
42
44
  */
43
45
  export function Provider({ store, children })
44
46
  {
45
- ReduxContext ??= Lilact.createContext(null);
47
+ ReduxContext ??= createContext(null);
46
48
  return (
47
49
  <ReduxContext.Provider value={store}>{children}</ReduxContext.Provider>
48
50
  );
@@ -55,7 +57,7 @@ export function Provider({ store, children })
55
57
  */
56
58
  export function useStore()
57
59
  {
58
- const store = Lilact.useContext(ReduxContext);
60
+ const store = useContext(ReduxContext);
59
61
  if (!store) {
60
62
  throw new Error("Could not find Redux store in context. <Provider> is missing.");
61
63
  }
@@ -70,7 +72,7 @@ export function useStore()
70
72
  */
71
73
  export function useDispatch()
72
74
  {
73
- const store = Lilact.useStore();
75
+ const store = useStore();
74
76
  return store.dispatch;
75
77
  }
76
78
 
@@ -82,17 +84,17 @@ export function useDispatch()
82
84
  * @returns The selected slice of state.
83
85
  */
84
86
  export function useSelector(selector, equalityFn = (a, b) => a === b) {
85
- const store = Lilact.useStore();
86
- const latestSelected = Lilact.useRef();
87
- const selectorRef = Lilact.useRef(selector);
87
+ const store = useStore();
88
+ const latestSelected = useRef();
89
+ const selectorRef = useRef(selector);
88
90
  selectorRef.current = selector;
89
91
 
90
- const [selected, setSelected] = Lilact.useState(() => selector(store.getState()));
92
+ const [selected, setSelected] = useState(() => selector(store.getState()));
91
93
 
92
94
  // Keep ref in sync for the subscription callback
93
95
  latestSelected.current = selected;
94
96
 
95
- Lilact.useEffect(() => {
97
+ useEffect(() => {
96
98
  function checkForUpdates() {
97
99
  const nextSelected = selectorRef.current(store.getState());
98
100
  if (!equalityFn(latestSelected.current, nextSelected)) {
@@ -127,7 +129,7 @@ export function connect(mapStateToProps, mapDispatchToProps)
127
129
  return function wrapWithConnect(WrappedComponent) {
128
130
 
129
131
  function ConnectedComponent(props) {
130
- const store = Lilact.useStore();
132
+ const store = useStore();
131
133
 
132
134
  let dispatchProps = { dispatch: store.dispatch };
133
135
 
@@ -148,7 +150,7 @@ export function connect(mapStateToProps, mapDispatchToProps)
148
150
  const selector = (state) => mapStateToProps(state, props);
149
151
 
150
152
  // todo: is shallowEqual enough?
151
- stateProps = Lilact.useSelector(selector, Lilact.shallowEqual) || {};
153
+ stateProps = useSelector(selector, shallowEqual) || {};
152
154
  }
153
155
 
154
156
  const mergedProps = { ...props, ...stateProps, ...dispatchProps };
package/src/router.jsx CHANGED
@@ -28,7 +28,7 @@
28
28
 
29
29
  */
30
30
 
31
- ʔ defineSymbols ( "LILACT", [ "CORE", "COMPONENT" ] ) ʔ
31
+ import { CORE, COMPONENT } from "./symbols.jsx"
32
32
 
33
33
  import {createContext, useContext, useState, useCallback, useEffect} from "./hooks.jsx"
34
34
  import {Children} from "./misc.jsx"
@@ -36,8 +36,11 @@ import {Children} from "./misc.jsx"
36
36
  const RouterContext = createContext(null);
37
37
  const RouteContext = createContext({ params: {} });
38
38
 
39
- // --- HashRouter (as before) ---
40
- const createURL = (to) => (typeof to === "string" ? to : (to.pathname || "") + (to.search || "") + (to.hash || ""));
39
+ const createURL = (to) =>
40
+ typeof to === "string" ? to : (to.pathname || "") + (to.search || "") + (to.hash || "");
41
+
42
+ const escapeRegExp = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
43
+
41
44
 
42
45
  /**
43
46
  * Hash-based router component that syncs navigation state with the URL hash (#...).
@@ -47,54 +50,90 @@ const createURL = (to) => (typeof to === "string" ? to : (to.pathname || "") + (
47
50
  * @param [props.basename=""] - Optional base path prefix applied to all route paths.
48
51
  */
49
52
  export function HashRouter({ children, basename = "" }) {
50
- const readLocation = () => {
51
- const raw = window.location.hash || "#/";
52
- const full = raw.slice(1);
53
- const withoutBase = full.replace(new RegExp(`^${basename}`), "") || "/";
54
- const [pathAndSearch, hashPart] = withoutBase.split("#");
55
- const [path, search = ""] = pathAndSearch.split("?");
56
- return {
57
- pathname: path || "/",
58
- search: search ? "?" + search : "",
59
- hash: hashPart ? "#" + hashPart : "",
60
- state: history.state?.__state,
61
- };
62
- };
63
-
64
- const [location, setLocation] = useState(readLocation);
65
- useEffect(() => {
66
- const onChange = () => setLocation(readLocation());
67
-
68
- window.addEventListener("hashchange", onChange);
69
- window.addEventListener("popstate", onChange);
70
-
71
- // initialize once in case hash/state are already set
72
- onChange();
73
-
74
- return () => {
75
- window.removeEventListener("hashchange", onChange);
76
- window.removeEventListener("popstate", onChange);
77
- };
78
- }, [basename]);
79
-
80
- const navigate = useCallback((to, { replace = false, state } = {}) => {
81
- if (typeof to === "number") {
82
- history.go(to);
83
- return;
84
- }
85
-
86
- const url = createURL(to);
87
- const href = "#" + (basename + url);
88
-
89
- if (replace) history.replaceState({ __state: state }, "", href);
90
- else history.pushState({ __state: state }, "", href);
91
-
92
- setLocation(readLocation());
93
- }, [basename]);
94
-
95
- return <RouterContext.Provider value={{ location, navigate, basename }}>{children}</RouterContext.Provider>;
53
+ const readLocation = () => {
54
+ const raw = window.location.hash || "#/";
55
+ const full = raw.slice(1);
56
+
57
+ const baseRe = new RegExp("^" + escapeRegExp(basename));
58
+ const withoutBase = full.replace(baseRe, "") || "/";
59
+
60
+ const [pathAndSearch, hashPart] = withoutBase.split("#");
61
+ const [path, search = ""] = pathAndSearch.split("?");
62
+
63
+ return {
64
+ pathname: path || "/",
65
+ search: search ? "?" + search : "",
66
+ hash: hashPart ? "#" + hashPart : "",
67
+ state: history.state?.__state,
68
+ };
69
+ };
70
+
71
+ const [location, setLocation] = useState(readLocation);
72
+
73
+ useEffect(() => {
74
+ const onChange = () => setLocation(readLocation());
75
+
76
+ window.addEventListener("hashchange", onChange);
77
+ window.addEventListener("popstate", onChange);
78
+
79
+ // initialize once
80
+ onChange();
81
+
82
+ return () => {
83
+ window.removeEventListener("hashchange", onChange);
84
+ window.removeEventListener("popstate", onChange);
85
+ };
86
+ }, [basename]);
87
+
88
+ const navigate = useCallback((to, { replace = false, state } = {}) => {
89
+ if (typeof to === "number") {
90
+ // Wait for the real popstate (don’t rely on synchronous timing)
91
+ return new Promise((resolve) => {
92
+ let done = false;
93
+
94
+ const cleanup = (fn) => {
95
+ if (done) return;
96
+ done = true;
97
+ window.removeEventListener("popstate", onPop);
98
+ window.removeEventListener("hashchange", onHash);
99
+ fn?.();
100
+ resolve();
101
+ };
102
+
103
+ const onPop = () => cleanup(() => setLocation(readLocation()));
104
+ const onHash = () => cleanup(() => setLocation(readLocation()));
105
+
106
+ window.addEventListener("popstate", onPop, { once: true });
107
+ window.addEventListener("hashchange", onHash, { once: true });
108
+
109
+ // Fallback: in case popstate/hashchange timing is weird in a given browser
110
+ setTimeout(() => cleanup(() => setLocation(readLocation())), 0);
111
+
112
+ history.go(to);
113
+ });
114
+ }
115
+
116
+ const url = createURL(to);
117
+ const href = "#" + (basename + url);
118
+
119
+ if (replace) {
120
+ history.replaceState({ __state: state }, "", href);
121
+ } else {
122
+ history.pushState({ __state: state }, "", href);
123
+ }
124
+
125
+ // Update immediately for the initiating navigation.
126
+ setLocation(readLocation());
127
+ }, [basename]);
128
+
129
+ return (
130
+ <RouterContext.Provider value={{ location, navigate, basename }}>
131
+ {children}
132
+ </RouterContext.Provider>
133
+ );
96
134
  }
97
135
 
136
+
98
137
  /**
99
138
  * Hook that returns the current location object (path, search, hash, and navigation state).
100
139
  *
package/src/run.jsx CHANGED
@@ -27,10 +27,13 @@
27
27
  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
28
 
29
29
  */
30
+ import Lilact from './lilact.jsx';
30
31
 
31
- ʔ defineSymbols ( "LILACT", [ "CORE", "COMPONENT", "LAZY" ] ) ʔ
32
+ import { CORE, COMPONENT, LAZY } from "./symbols.jsx"
32
33
 
33
- import Lilact from './lilact.jsx';
34
+
35
+ /** @ignore */
36
+ export const required_scripts = {};
34
37
 
35
38
 
36
39
  /**
@@ -49,7 +52,7 @@ export function run(jsx, path=`InlineJSX-${++Lilact.eval_num}`, is_inline=true)
49
52
  let processed;
50
53
 
51
54
 
52
- Lilact.required_scripts[path] = {
55
+ required_scripts[path] = {
53
56
  mappings,
54
57
  module,
55
58
  is_inline,
@@ -76,9 +79,9 @@ export function run(jsx, path=`InlineJSX-${++Lilact.eval_num}`, is_inline=true)
76
79
  throw e;
77
80
  }
78
81
 
79
- ʔ if(DEBUG) {
80
- Lilact.required_scripts[path].processed = processed;
81
- ʔ }
82
+ if(DEBUG) {
83
+ required_scripts[path].processed = processed;
84
+ }
82
85
 
83
86
  processed += "\n//# sourceURL=eval:/" + path;
84
87
 
@@ -105,11 +108,11 @@ export function run(jsx, path=`InlineJSX-${++Lilact.eval_num}`, is_inline=true)
105
108
  /**
106
109
  * Loads a jsx script from a path. All scripts can access Lilact namespace as a global object.
107
110
  *
108
- * `Lilact.require` loads synchronously, as it is expected to be loaded on the next instruction.
111
+ * `require` loads synchronously, as it is expected to be loaded on the next instruction.
109
112
  *
110
113
  * As running the transpiled scripts rely on `new Function`, it is not possible to use module imports
111
114
  * and exports. So to import you should use `const {useState} = Lilact` convention. And to
112
- * export, you should use `module.exports = ...`. `Lilact.require` returns `module.exports` value
115
+ * export, you should use `module.exports = ...`. `require` returns `module.exports` value
113
116
  * so you can import different modules using the convention above.
114
117
  *
115
118
  * If the path is in the format #id, it will query the document for a script element with the given
@@ -126,14 +129,14 @@ export function run(jsx, path=`InlineJSX-${++Lilact.eval_num}`, is_inline=true)
126
129
  */
127
130
  export function require(path, forceUpdate)
128
131
  {
129
- if(Lilact.required_scripts[path] && !forceUpdate) return Lilact.required_scripts[path].module.exports;
132
+ if(required_scripts[path] && !forceUpdate) return required_scripts[path].module.exports;
130
133
 
131
134
  if(path[0]==='#') {
132
135
 
133
136
  const el = document.getElementById(path);
134
137
 
135
138
  if(el) {
136
- return Lilact.run(el.innerText, path);
139
+ return run(el.innerText, path);
137
140
  }
138
141
 
139
142
  }
@@ -146,7 +149,7 @@ export function require(path, forceUpdate)
146
149
  return res.text();
147
150
  })
148
151
  .then(res => {
149
- res = Lilact.run(res, path, false);
152
+ res = run(res, path, false);
150
153
  // todo: this is for the lazy, so we detect default, should we do it in sync mode too?
151
154
  return res?.default ?? res;
152
155
  })
@@ -162,7 +165,7 @@ export function require(path, forceUpdate)
162
165
  request.open("GET", path, false);
163
166
  request.send(null);
164
167
  if (request.status === 200) {
165
- return Lilact.run(request.responseText, path, false);
168
+ return run(request.responseText, path, false);
166
169
  }
167
170
  }
168
171
 
@@ -230,8 +233,8 @@ function scanScriptTagsWithType() {
230
233
  * Scans the whole documents and runs all the script elements with type `text/jsx`.
231
234
  * It is automatically attached to document.onload when Lilact is loaded.
232
235
  *
233
- * If element src is set, it will be loaded via `Lilact.require`.
234
- * If element has inner content, it will be executed via `Lilact.run`.
236
+ * If element src is set, it will be loaded via `require`.
237
+ * If element has inner content, it will be executed via `run`.
235
238
  *
236
239
  * If both are present, first the src is loaded and then the inner content is executed.
237
240
  *
@@ -244,8 +247,8 @@ export function runScripts()
244
247
  const scripts = scanScriptTagsWithType();
245
248
 
246
249
  for(const s of scripts) {
247
- if(s.src) Lilact.require(s.src);
248
- if(s.content) Lilact.run(s.content);
250
+ if(s.src) require(s.src);
251
+ if(s.content) run(s.content);
249
252
  }
250
253
  }
251
254
 
@@ -0,0 +1,65 @@
1
+ /*
2
+
3
+ Lilact
4
+ Copyright (C) 2024-2026 Arash Kazemi <contact.arash.kazemi@gmail.com>
5
+ All rights reserved.
6
+
7
+ BSD-2-Clause
8
+
9
+ Redistribution and use in source and binary forms, with or without
10
+ modification, are permitted provided that the following conditions are met:
11
+
12
+ * Redistributions of source code must retain the above copyright
13
+ notice, this list of conditions and the following disclaimer.
14
+ * Redistributions in binary form must reproduce the above copyright
15
+ notice, this list of conditions and the following disclaimer in the
16
+ documentation and/or other materials provided with the distribution.
17
+
18
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21
+ ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
22
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
+
29
+ */
30
+
31
+
32
+ export const [
33
+ CORE,
34
+ COMPONENT,
35
+ TEXT,
36
+ IS_ZOMBIE,
37
+ IDX,
38
+ CHILD_CLASS_ADDENDUM,
39
+ MEMOIZED,
40
+ LAZY,
41
+
42
+ DUE,
43
+ REPEAT,
44
+ CLEARED,
45
+ INTERVAL,
46
+ CALLBACK,
47
+ ARGS
48
+ ] =
49
+ [
50
+ Symbol.for('LILACT:CORE'),
51
+ Symbol.for('LILACT:COMPONENT'),
52
+ Symbol.for('LILACT:TEXT'),
53
+ Symbol.for('LILACT:IS_ZOMBIE'),
54
+ Symbol.for('LILACT:IDX'),
55
+ Symbol.for('LILACT:CHILD_CLASS_ADDENDUM'),
56
+ Symbol.for('LILACT:MEMOIZED'),
57
+ Symbol.for('LILACT:LAZY'),
58
+
59
+ Symbol.for('LILACT:TIMERS:DUE'),
60
+ Symbol.for('LILACT:TIMERS:REPEAT'),
61
+ Symbol.for('LILACT:TIMERS:CLEARED'),
62
+ Symbol.for('LILACT:TIMERS:INTERVAL'),
63
+ Symbol.for('LILACT:TIMERS:CALLBACK'),
64
+ Symbol.for('LILACT:TIMERS:ARGS')
65
+ ];
package/src/timers.jsx CHANGED
@@ -33,7 +33,7 @@
33
33
  //ʔ outputJS('./dist/timers.js');
34
34
 
35
35
 
36
- ʔ defineSymbols("LILACT:TIMERS", ["CORE", "IDX", "DUE", "REPEAT", "CLEARED", "INTERVAL", "CALLBACK", "ARGS"] ) ʔ
36
+ import { IDX, DUE, REPEAT, CLEARED, INTERVAL, CALLBACK, ARGS } from "./symbols.jsx"
37
37
 
38
38
  /**
39
39
  * Timer helpers for a promise-friendly timer framework.
@@ -254,10 +254,10 @@ export function clearInterval(id)
254
254
  */
255
255
  export function grabTimers()
256
256
  {
257
- globalThis.setTimeout = this.setTimeout;
258
- globalThis.setInterval = this.setInterval;
259
- globalThis.clearTimeout = this.clearTimeout;
260
- globalThis.clearInterval = this.clearInterval;
257
+ globalThis.setTimeout = Lilact.setTimeout;
258
+ globalThis.setInterval = Lilact.setInterval;
259
+ globalThis.clearTimeout = Lilact.clearTimeout;
260
+ globalThis.clearInterval = Lilact.clearInterval;
261
261
  }
262
262
 
263
263
  /**
@@ -277,7 +277,7 @@ export function releaseTimers()
277
277
  * @param {number} duration - Delay in milliseconds.
278
278
  * @returns {Promise} Promise that resolves after the delay.
279
279
  */
280
- export function timeoutPromise(duration=0, timerSource=this)
280
+ export function timeoutPromise(duration=0, timerSource=Lilact)
281
281
  {
282
282
  let id, resolve, reject;
283
283
 
@@ -27,8 +27,13 @@
27
27
  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
28
 
29
29
  */
30
+ import Lilact from './lilact.jsx';
30
31
 
31
- ʔ defineSymbols ( "LILACT", [ "CORE", "COMPONENT", "CHILD_CLASS_ADDENDUM" ] ) ʔ
32
+ import { setTimeout, clearTimeout } from "./timers.jsx"
33
+ import { Children } from "./misc.jsx"
34
+ import { useEffect, useLayoutEffect, useMemo, useRef, useState } from "./hooks.jsx"
35
+
36
+ import { CORE, COMPONENT, CHILD_CLASS_ADDENDUM } from "./symbols.jsx"
32
37
 
33
38
  /* States */
34
39
  const UNMOUNTED = "unmounted";
@@ -37,9 +42,6 @@ const ENTERING = "entering";
37
42
  const ENTERED = "entered";
38
43
  const EXITING = "exiting";
39
44
 
40
- import { setTimeout, clearTimeout} from "./timers.jsx"
41
- import { Children } from "./misc.jsx"
42
- import { useEffect, useLayoutEffect, useMemo, useRef, useState } from "./hooks.jsx"
43
45
 
44
46
  /**
45
47
  * Transition component that manages enter/exit lifecycle and calls callbacks based on state changes.
package/webpack.config.js CHANGED
@@ -34,8 +34,7 @@ import { fileURLToPath } from 'url';
34
34
  import { dirname, resolve } from 'path';
35
35
 
36
36
  import fs from 'fs';
37
- import 'webpack';
38
-
37
+ import webpack from 'webpack';
39
38
 
40
39
 
41
40
  export default (env, argv) => {
@@ -118,7 +117,12 @@ export default (env, argv) => {
118
117
  }
119
118
  ]
120
119
  },
121
- plugins: [{
120
+ plugins: [
121
+ new webpack.DefinePlugin({
122
+ "DEBUG": mode==='development'
123
+ }),
124
+
125
+ {
122
126
  apply: (compiler) => {
123
127
  compiler.hooks.done.tap('license-plugin', (compilation) => {
124
128
  fs.readFile('./dist/' + filename, 'utf8', function(err, jssc) {