lilact 0.9.0 → 0.10.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 (74) hide show
  1. package/bin/bundle.cjs +1 -1
  2. package/dist/lilact.development.js +345 -194
  3. package/dist/lilact.development.js.map +1 -1
  4. package/dist/lilact.development.min.js +1 -1
  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/assets/hierarchy.js +1 -1
  9. package/docs/assets/navigation.js +1 -1
  10. package/docs/assets/search.js +1 -1
  11. package/docs/classes/accessories.ErrorBoundary.html +7 -7
  12. package/docs/classes/accessories.Suspense.html +4 -5
  13. package/docs/classes/components.Component.html +2 -2
  14. package/docs/classes/components.HTMLComponent.html +1 -1
  15. package/docs/classes/components.RootComponent.html +1 -1
  16. package/docs/functions/errors.globalErrorHandler.html +3 -2
  17. package/docs/functions/errors.traceError.html +4 -3
  18. package/docs/functions/hooks.createContext.html +3 -2
  19. package/docs/functions/hooks.useActionState.html +3 -2
  20. package/docs/functions/hooks.useContext.html +3 -2
  21. package/docs/functions/hooks.useImperativeHandle.html +1 -1
  22. package/docs/functions/hooks.useState.html +3 -2
  23. package/docs/functions/misc.classNames.html +2 -1
  24. package/docs/functions/misc.deepEqual.html +4 -2
  25. package/docs/functions/misc.findDOMNode.html +3 -2
  26. package/docs/functions/misc.forwardRef.html +4 -0
  27. package/docs/functions/misc.getComponentByPointer.html +1 -1
  28. package/docs/functions/misc.isAsync.html +4 -3
  29. package/docs/functions/misc.isClass.html +4 -3
  30. package/docs/functions/misc.isEmpty.html +4 -3
  31. package/docs/functions/misc.isError.html +4 -3
  32. package/docs/functions/misc.isThenable.html +4 -3
  33. package/docs/functions/misc.isValidElement.html +3 -2
  34. package/docs/functions/misc.shallowEqual.html +4 -2
  35. package/docs/functions/misc.toBool.html +4 -3
  36. package/docs/functions/router.NavLink.html +4 -2
  37. package/docs/functions/router.Route.html +1 -1
  38. package/docs/functions/router.Routes.html +1 -1
  39. package/docs/functions/run.lazy.html +1 -1
  40. package/docs/functions/run.require.html +2 -2
  41. package/docs/functions/timers.clearInterval.html +3 -2
  42. package/docs/functions/timers.clearTimeout.html +3 -2
  43. package/docs/functions/timers.setInterval.html +3 -2
  44. package/docs/functions/timers.setTimeout.html +4 -2
  45. package/docs/functions/timers.timeoutPromise.html +2 -2
  46. package/docs/hierarchy.html +1 -1
  47. package/docs/modules/hooks.html +1 -1
  48. package/docs/modules/misc.html +1 -1
  49. package/docs/modules.html +1 -1
  50. package/docs/static/demos/reducer.jsx +29 -23
  51. package/docs/static/lilact.development.js +345 -194
  52. package/docs/static/lilact.development.min.js +1 -1
  53. package/docs/static/lilact.production.min.js +1 -1
  54. package/package.json +1 -1
  55. package/root/demos/reducer.jsx +29 -23
  56. package/root/lilact.development.js +345 -194
  57. package/root/lilact.development.min.js +1 -1
  58. package/root/lilact.production.min.js +1 -1
  59. package/src/accessories.jsx +0 -4
  60. package/src/components.jsx +1 -1
  61. package/src/errors.jsx +36 -32
  62. package/src/events.jsx +194 -66
  63. package/src/hooks.jsx +14 -29
  64. package/src/jsx.js +8 -5
  65. package/src/lilact.jsx +21 -2
  66. package/src/misc.jsx +45 -31
  67. package/src/pane.jsx +2 -2
  68. package/src/router.jsx +3 -1
  69. package/src/run.jsx +5 -5
  70. package/src/timers.jsx +12 -12
  71. package/typedoc.json +1 -1
  72. package/docs/functions/hooks.forwardRef.html +0 -4
  73. package/docs/functions/jsx.transpileJSX.html +0 -6
  74. package/docs/modules/jsx.html +0 -1
package/src/misc.jsx CHANGED
@@ -54,17 +54,17 @@ const typeOf = (input) => {
54
54
  * @param value - Value to inspect.
55
55
  * @returns True if the value is a class component; otherwise false.
56
56
  */
57
- export const isValidElement = (o) => {
58
- return o[CORE]!==undefined || o[TEXT]!==undefined;
57
+ export const isValidElement = (value) => {
58
+ return value[CORE]!==undefined || value[TEXT]!==undefined;
59
59
  }
60
60
 
61
61
  /**
62
62
  * Utility to find the underlying DOM node for a mounted Lilact component.
63
63
  *
64
- * @param element - A Lilact component instance to locate its DOM node.
64
+ * @param component - A Lilact component instance to locate its DOM node.
65
65
  * @returns The corresponding DOM element (or null if unavailable).
66
66
  */
67
- export const findDOMNode = (comp)=>{
67
+ export const findDOMNode = (component)=>{
68
68
 
69
69
  /*
70
70
  When a component renders to null or false, findDOMNode returns null.
@@ -78,8 +78,8 @@ export const findDOMNode = (comp)=>{
78
78
 
79
79
  Unlike React, in Lilact findDOMNode can also be used on function components.
80
80
  */
81
- if(!comp[CORE]?.element?.parentNode) throw new Error("findDOMNode only works on mounted components.");
82
- return comp[CORE].element;
81
+ if(!component[CORE]?.element?.parentNode) throw new Error("findDOMNode only works on mounted components.");
82
+ return component[CORE].element;
83
83
  }
84
84
 
85
85
  /**
@@ -143,6 +143,20 @@ export const Children = {
143
143
  };
144
144
 
145
145
 
146
+ /**
147
+ * Wraps a render function so that a parent can pass a `ref` into it.
148
+ * The forwarded `ref` is provided as the second argument to the render function: `(props, ref)`.
149
+ *
150
+ * @param {function(props: any, ref: any)} render
151
+ * The component render function that receives the props and the forwarded ref.
152
+ * @returns {}
153
+ */
154
+ export function forwardRef(render)
155
+ {
156
+ return (props)=>render({...props, ref: undefined}, props.ref);
157
+ }
158
+
159
+
146
160
  /**
147
161
  * Debug tool to detect the component visible at a point on screen.
148
162
  *
@@ -181,7 +195,7 @@ export function getComponentByPointer()
181
195
  /**
182
196
  * Utility for applying one or more class names to an element.
183
197
  *
184
- * @param classNames - One or more class name values to combine.
198
+ * @param classes - One or more class name values to combine.
185
199
  */
186
200
  export function classNames(classes) {
187
201
  return Object.entries(classes)
@@ -197,8 +211,8 @@ export function classNames(classes) {
197
211
  * @param value - Value to check for emptiness.
198
212
  * @returns True if empty; otherwise false.
199
213
  */
200
- export function isEmpty(o) {
201
- for(let i in o) return false;
214
+ export function isEmpty(value) {
215
+ for(let i in value) return false;
202
216
  return true;
203
217
  }
204
218
 
@@ -206,8 +220,8 @@ export function isEmpty(o) {
206
220
  /**
207
221
  * Determines whether two values are shallowly equal.
208
222
  *
209
- * @param objA - First object to compare.
210
- * @param objB - Second object to compare.
223
+ * @param source - First object to compare.
224
+ * @param target - Second object to compare.
211
225
  * @returns True if shallowly equal; otherwise false.
212
226
  */
213
227
  export const shallowEqual = (source, target) => {
@@ -233,8 +247,8 @@ export const shallowEqual = (source, target) => {
233
247
  /**
234
248
  * Determines whether two values are deeply equal.
235
249
  *
236
- * @param objA - First object to compare.
237
- * @param objB - Second object to compare.
250
+ * @param source - First object to compare.
251
+ * @param target - Second object to compare.
238
252
  * @returns True if deeply equal; otherwise false.
239
253
  */
240
254
  export function deepEqual(source, target) {
@@ -271,13 +285,13 @@ export function deepEqual(source, target) {
271
285
  * @param value - Value to inspect.
272
286
  * @returns True if the value is a js class; otherwise false.
273
287
  */
274
- export function isClass(func) {
288
+ export function isClass(value) {
275
289
  // from https://stackoverflow.com/a/66120819
276
- if(!(func && func.constructor === Function) || func.prototype === undefined)
290
+ if(!(value && value.constructor === Function) || value.prototype === undefined)
277
291
  return false;
278
- if(Function.prototype !== Object.getPrototypeOf(func))
292
+ if(Function.prototype !== Object.getPrototypeOf(value))
279
293
  return true;
280
- return Object.getOwnPropertyNames(func.prototype).length > 1;
294
+ return Object.getOwnPropertyNames(value.prototype).length > 1;
281
295
  }
282
296
 
283
297
  /**
@@ -286,8 +300,8 @@ export function isClass(func) {
286
300
  * @param value - Value to inspect.
287
301
  * @returns True if the value is an async function; otherwise false.
288
302
  */
289
- export function isAsync(fn) {
290
- return typeof fn === 'function' && fn.constructor && fn.constructor.name === 'AsyncFunction';
303
+ export function isAsync(value) {
304
+ return typeof value === 'function' && value.constructor && value.constructor.name === 'AsyncFunction';
291
305
  }
292
306
 
293
307
  /**
@@ -296,8 +310,8 @@ export function isAsync(fn) {
296
310
  * @param value - Value to inspect.
297
311
  * @returns True if thenable; otherwise false.
298
312
  */
299
- export function isThenable(x) {
300
- return x && (typeof x === "object" || typeof x === "function") && typeof x.then === "function";
313
+ export function isThenable(value) {
314
+ return value && (typeof value === "object" || typeof value === "function") && typeof value.then === "function";
301
315
  }
302
316
 
303
317
  /**
@@ -306,8 +320,8 @@ export function isThenable(x) {
306
320
  * @param value - Value to inspect.
307
321
  * @returns True if thenable; otherwise false.
308
322
  */
309
- export function isError(x) {
310
- return x instanceof Error || Object.prototype.toString.call(x) === '[object Error]';
323
+ export function isError(value) {
324
+ return value instanceof Error || Object.prototype.toString.call(value) === '[object Error]';
311
325
  }
312
326
 
313
327
  /**
@@ -316,18 +330,18 @@ export function isError(x) {
316
330
  * @param value - Value to inspect.
317
331
  * @returns boolean value
318
332
  */
319
- export function toBool(x) {
320
- if (typeof x === "boolean") return x;
333
+ export function toBool(value) {
334
+ if (typeof value === "boolean") return value;
321
335
 
322
- if (typeof x === "number") return x !== 0;
336
+ if (typeof value === "number") return value !== 0;
323
337
 
324
- if (typeof x === "string") {
325
- x = x.trim().toLowerCase();
326
- if (x === "true") return true;
327
- if (x === "false") return false;
338
+ if (typeof value === "string") {
339
+ value = value.trim().toLowerCase();
340
+ if (value === "true") return true;
341
+ if (value === "false") return false;
328
342
  }
329
343
 
330
- return Boolean(x);
344
+ return Boolean(value);
331
345
  }
332
346
 
333
347
 
package/src/pane.jsx CHANGED
@@ -1,5 +1,5 @@
1
- import { useEffect, useLayoutEffect, useMemo, useRef, useState, forwardRef, useImperativeHandle } from "./hooks.jsx";
2
- import { Children } from "./misc.jsx";
1
+ import { useEffect, useLayoutEffect, useMemo, useRef, useState, useImperativeHandle } from "./hooks.jsx";
2
+ import { Children, forwardRef } from "./misc.jsx";
3
3
 
4
4
 
5
5
  const clamp = (n, min, max) => {
package/src/router.jsx CHANGED
@@ -185,6 +185,8 @@ export function NavLink({
185
185
  className,
186
186
  activeStyle,
187
187
  style,
188
+ target,
189
+ download,
188
190
  replace = false,
189
191
  state,
190
192
  children,
@@ -210,7 +212,7 @@ export function NavLink({
210
212
  }
211
213
 
212
214
  return (
213
- <a href={href} onClick={handleClick} className={finalClassName} style={mergedStyle} aria-current={isActive ? "page" : undefined} {...rest}>
215
+ <a href={href} onClick={handleClick} target={target} download={download} className={finalClassName} style={mergedStyle} aria-current={isActive ? "page" : undefined} {...rest}>
214
216
  {typeof children === "function" ? children({ isActive }) : children}
215
217
  </a>
216
218
  );
package/src/run.jsx CHANGED
@@ -82,7 +82,7 @@ export function run(jsx, path=`InlineJSX-${++Lilact.eval_num}`, is_inline=true)
82
82
 
83
83
  processed += "\n//# sourceURL=eval:/" + path;
84
84
 
85
- // todo: this seems to be only useful in safari, should be assessed latera
85
+ // todo: this seems to be only useful in safari, should be assessed later
86
86
  Lilact.scanBlockLabels(processed, path);
87
87
 
88
88
  try {
@@ -120,13 +120,13 @@ export function run(jsx, path=`InlineJSX-${++Lilact.eval_num}`, is_inline=true)
120
120
  * @param path - The path to the required file. Must be either absolute path or relative to the current
121
121
  * document’s URL (the page/location that initiated the request).
122
122
  *
123
- * @param force_update - To treat the code as inline. The main difference at the moment is that inline code doesn't include sourcemap.
123
+ * @param forceUpdate - To treat the code as inline. The main difference at the moment is that inline code doesn't include sourcemap.
124
124
  *
125
125
  * @returns An array representation of the children.
126
126
  */
127
- export function require(path, force_update)
127
+ export function require(path, forceUpdate)
128
128
  {
129
- if(Lilact.required_scripts[path] && !force_update) return Lilact.required_scripts[path].module.exports;
129
+ if(Lilact.required_scripts[path] && !forceUpdate) return Lilact.required_scripts[path].module.exports;
130
130
 
131
131
  if(path[0]==='#') {
132
132
 
@@ -178,7 +178,7 @@ export function require(path, force_update)
178
178
  * The promise must resolve to a module whose module.exports.default is a Lilact component
179
179
  * or otherwise it will be whatever the module.exports is set to.
180
180
  *
181
- * @returns A Lilact component that should be rendered inside a {@link Suspense} boundary.
181
+ * @returns A Lilact component that should be rendered inside a `Suspense` boundary.
182
182
  */
183
183
  export function lazy(factory) {
184
184
  let status = "pending"; // pending | success | error
package/src/timers.jsx CHANGED
@@ -209,9 +209,9 @@ export function resumeTimers()
209
209
  */
210
210
 
211
211
 
212
- export function setTimeout(func, interval, ...args)
212
+ export function setTimeout(callback, delay, ...args)
213
213
  {
214
- return add_timer( { [CALLBACK]: func, [INTERVAL]: interval, [DUE]: Date.now()+interval, [REPEAT]: false, [ARGS]: args } );
214
+ return add_timer( { [CALLBACK]: callback, [INTERVAL]: delay, [DUE]: Date.now()+delay, [REPEAT]: false, [ARGS]: args } );
215
215
  }
216
216
 
217
217
  /**
@@ -222,9 +222,9 @@ export function setTimeout(func, interval, ...args)
222
222
  * @returns {any} Interval id.
223
223
  */
224
224
 
225
- export function setInterval(func, interval, ...args)
225
+ export function setInterval(callback, interval, ...args)
226
226
  {
227
- return add_timer( { [CALLBACK]: func, [INTERVAL]: interval, [DUE]: Date.now()+interval, [REPEAT]: true, [ARGS]: args } );
227
+ return add_timer( { [CALLBACK]: callback, [INTERVAL]: interval, [DUE]: Date.now()+interval, [REPEAT]: true, [ARGS]: args } );
228
228
  }
229
229
 
230
230
  /**
@@ -232,9 +232,9 @@ export function setInterval(func, interval, ...args)
232
232
  * @param {any} id - Timeout id returned by `setTimeout`.
233
233
  * @returns {void}
234
234
  */
235
- export function clearTimeout(t)
235
+ export function clearTimeout(id)
236
236
  {
237
- if(all_timers[t]) all_timers[t][CLEARED] = true;
237
+ if(all_timers[id]) all_timers[id][CLEARED] = true;
238
238
  }
239
239
 
240
240
  /**
@@ -242,9 +242,9 @@ export function clearTimeout(t)
242
242
  * @param {any} id - Interval id returned by `setInterval`.
243
243
  * @returns {void}
244
244
  */
245
- export function clearInterval(t)
245
+ export function clearInterval(id)
246
246
  {
247
- if(all_timers[t]) all_timers[t][CLEARED] = true;
247
+ if(all_timers[id]) all_timers[id][CLEARED] = true;
248
248
  }
249
249
 
250
250
  /**
@@ -277,27 +277,27 @@ 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, timer_source=this)
280
+ export function timeoutPromise(duration=0, timerSource=this)
281
281
  {
282
282
  let id, resolve, reject;
283
283
 
284
284
  const promise = new Promise((res, rej) => {
285
285
  resolve = res;
286
286
  reject = rej;
287
- id = timer_source.setTimeout(() => {
287
+ id = timerSource.setTimeout(() => {
288
288
  resolve();
289
289
  }, duration);
290
290
  });
291
291
 
292
292
  // note: proceed interrupts the timer, and continues the flow if used with await.
293
293
  promise.proceed = () => {
294
- timer_source.clearTimeout(id);
294
+ timerSource.clearTimeout(id);
295
295
  resolve();
296
296
  };
297
297
 
298
298
  // note: cancel rejects so it throws exception when using with await, this allows handling it differently.
299
299
  promise.cancel = () => {
300
- timer_source.clearTimeout(id);
300
+ timerSource.clearTimeout(id);
301
301
  reject();
302
302
  };
303
303
 
package/typedoc.json CHANGED
@@ -16,7 +16,7 @@
16
16
  ".tmp/hooks.js",
17
17
  ".tmp/misc.js",
18
18
  ".tmp/run.js",
19
- ".tmp/jsx.js",
19
+ //".tmp/jsx.js",
20
20
  ".tmp/redux.js",
21
21
  ".tmp/timers.js",
22
22
  ".tmp/transition.js",
@@ -1,4 +0,0 @@
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>forwardRef | 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/hooks.html">hooks</a></li><li><a href="" aria-current="page">forwardRef</a></li></ul><h1>Function forwardRef</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="forwardref"><span class="tsd-kind-call-signature">forwardRef</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">render</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> <span class="tsd-signature-type">any</span><a href="#forwardref" 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></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Wraps a render function so that a parent can pass a <code>ref</code> into it.
2
- The forwarded <code>ref</code> is provided as the second argument to the render function: <code>(props, ref)</code>.</p>
3
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">render</span>: <span class="tsd-signature-type">any</span></span><div class="tsd-comment tsd-typography"><p>The component render function that receives the props and the forwarded ref.</p>
4
- </div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4><aside class="tsd-sources"><ul><li>Defined in hooks.js:469</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>
@@ -1,6 +0,0 @@
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>transpileJSX | 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/jsx.html">jsx</a></li><li><a href="" aria-current="page">transpileJSX</a></li></ul><h1>Function transpileJSX</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="transpilejsx"><span class="tsd-kind-call-signature">transpileJSX</span><span class="tsd-signature-symbol">(</span><br/>    <span class="tsd-kind-parameter">jsx</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">__namedParameters</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">{</span><br/>        <span class="tsd-kind-property">appendSourcemap</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br/>        <span class="tsd-kind-property">blocks_info</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">counter</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">labels</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{}</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">;</span><br/>        <span class="tsd-kind-property">discardComments</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br/>        <span class="tsd-kind-property">factory</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>        <span class="tsd-kind-property">fragment</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>        <span class="tsd-kind-property">injectTraceLabels</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br/>        <span class="tsd-kind-property">mappings</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">never</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">;</span><br/>        <span class="tsd-kind-property">path</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>    <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-type">string</span><a href="#transpilejsx" 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></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>This is the function that transpiles jsx code to js. It is not recommended to use directly.</p>
2
- <p>Use <code>Lilact.require</code> instead, or <code>Lilact.run</code> available in <code>run</code>, or add a <code>&lt;scirpt type=&quot;text/jsx&quot; .../&gt;</code> to your html.</p>
3
- <p>Lilact jsx parser doesn't rely on the Lilact itself, and can be used by other engines. The easiest way
4
- is using the <code>bin/transpile.js</code> script. It has its own help.</p>
5
- </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">jsx</span>: <span class="tsd-signature-type">any</span></span></li><li><span><span class="tsd-kind-parameter">__namedParameters</span>: <span class="tsd-signature-symbol">{</span><br/>    <span class="tsd-kind-property">appendSourcemap</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br/>    <span class="tsd-kind-property">blocks_info</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">counter</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">labels</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{}</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">;</span><br/>    <span class="tsd-kind-property">discardComments</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br/>    <span class="tsd-kind-property">factory</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>    <span class="tsd-kind-property">fragment</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/>    <span class="tsd-kind-property">injectTraceLabels</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br/>    <span class="tsd-kind-property">mappings</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">never</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">;</span><br/>    <span class="tsd-kind-property">path</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/><span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol"> = {}</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4><p>The transpiled javascript code.</p>
6
- <aside class="tsd-sources"><ul><li>Defined in jsx.js:967</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>
@@ -1 +0,0 @@
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>jsx | 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="" aria-current="page">jsx</a></li></ul><h1>Module jsx</h1></div><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Functions"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h2>Functions</h2></summary><dl class="tsd-member-summaries"><dt class="tsd-member-summary" id="transpilejsx"><span class="tsd-member-summary-name"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Function"><use href="../assets/icons.svg#icon-64"></use></svg><a href="../functions/jsx.transpileJSX.html">transpileJSX</a><a href="#transpilejsx" 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></span></dt><dd class="tsd-member-summary"></dd></dl></details></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><details open class="tsd-accordion tsd-page-navigation"><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>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Functions"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Functions</summary><div><a href="#transpilejsx"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Function"><use href="../assets/icons.svg#icon-64"></use></svg><span>transpile<wbr/>JSX</span></a></div></details></div></details></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>