lilact 0.22.0 → 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 (55) hide show
  1. package/dist/lilact.development.js +21 -8
  2. package/dist/lilact.development.js.map +2 -2
  3. package/dist/lilact.development.min.js +26 -25
  4. package/dist/lilact.development.min.js.map +3 -3
  5. package/dist/lilact.production.min.js +26 -25
  6. package/docs/assets/hierarchy.js +1 -1
  7. package/docs/assets/navigation.js +1 -1
  8. package/docs/assets/search.js +1 -1
  9. package/docs/classes/components.Component.html +1 -1
  10. package/docs/classes/components.HTMLComponent.html +1 -1
  11. package/docs/classes/components.RootComponent.html +1 -1
  12. package/docs/functions/accessories.DragHandle.html +2 -2
  13. package/docs/functions/accessories.Spinner.html +2 -2
  14. package/docs/functions/components.cloneComponent.html +1 -0
  15. package/docs/functions/components.memo.html +1 -1
  16. package/docs/functions/components.render.html +1 -1
  17. package/docs/functions/redux.Provider.html +2 -2
  18. package/docs/functions/redux.connect.html +2 -2
  19. package/docs/functions/router.HashRouter.html +2 -2
  20. package/docs/functions/router.Link.html +2 -2
  21. package/docs/functions/router.NavLink.html +2 -2
  22. package/docs/functions/router.Routes.html +2 -2
  23. package/docs/functions/run.lazy.html +3 -3
  24. package/docs/functions/run.require.html +3 -7
  25. package/docs/functions/run.runScripts.html +1 -1
  26. package/docs/functions/timers.timeoutPromise.html +144 -2
  27. package/docs/functions/transition.CSSTransition.html +4 -4
  28. package/docs/functions/transition.SwitchTransition.html +2 -2
  29. package/docs/functions/transition.Transition.html +3 -3
  30. package/docs/hierarchy.html +1 -1
  31. package/docs/modules/components.html +1 -1
  32. package/docs/static/demos/cloneelement.jsx +66 -0
  33. package/docs/static/demos/reducer.jsx +2 -0
  34. package/docs/static/demos/router.jsx +1 -1
  35. package/docs/static/index.html +31 -30
  36. package/docs/static/lilact.development.js +21 -8
  37. package/docs/static/lilact.development.js.map +2 -2
  38. package/docs/static/lilact.development.min.js +26 -25
  39. package/docs/static/lilact.development.min.js.map +3 -3
  40. package/docs/static/lilact.production.min.js +26 -25
  41. package/docs/variables/components.cloneElement.html +1 -0
  42. package/examples/demos/cloneelement.jsx +66 -0
  43. package/examples/demos/reducer.jsx +2 -0
  44. package/examples/demos/router.jsx +1 -1
  45. package/examples/index.html +31 -30
  46. package/examples/lilact.development.js +21 -8
  47. package/examples/lilact.development.js.map +2 -2
  48. package/examples/lilact.development.min.js +26 -25
  49. package/examples/lilact.development.min.js.map +3 -3
  50. package/examples/lilact.production.min.js +26 -25
  51. package/package.json +1 -1
  52. package/src/components.jsx +7 -0
  53. package/src/expscan.js +7 -3
  54. package/src/lilact.jsx +5 -5
  55. package/src/run.jsx +6 -8
@@ -1973,6 +1973,8 @@ __export(components_exports, {
1973
1973
  RootComponent: () => RootComponent,
1974
1974
  boolean_html_attributes_set: () => boolean_html_attributes_set,
1975
1975
  capture_events_set: () => capture_events_set,
1976
+ cloneComponent: () => cloneComponent,
1977
+ cloneElement: () => cloneElement,
1976
1978
  createComponent: () => createComponent2,
1977
1979
  createElement: () => createElement,
1978
1980
  createPortal: () => createPortal,
@@ -3071,6 +3073,10 @@ function createRoot(element) {
3071
3073
  function createPortal(children, element) {
3072
3074
  return createComponent2(lilact_default.Portal, { "view": element }, children);
3073
3075
  }
3076
+ function cloneComponent(component, propsPatch, ...children) {
3077
+ return { entity: component.entity, props: { ...component.props, ...propsPatch, children } };
3078
+ }
3079
+ var cloneElement = cloneComponent;
3074
3080
  function render(component, element) {
3075
3081
  if (component[CORE] && (component[CORE].container || component[CORE].parent)) {
3076
3082
  throw new Error("Component is already in use");
@@ -5316,19 +5322,20 @@ function processImportExports(node3, jsx2) {
5316
5322
  const src = jsx2.substring(node3.out[m.index + imp.length - 1].begin, node3.out[m.index + imp.length - 1].end);
5317
5323
  const imports = {};
5318
5324
  let star_imports = [];
5325
+ let import_alls = [];
5319
5326
  for (i2 = m.index + 1; i2 < m.index + imp.length - 1; i2++) {
5320
5327
  node3.out.splice(m.index, 1, {
5321
5328
  type: "import",
5322
5329
  begin: begins[m.index],
5323
- end: begins[m.index + imp.length]
5330
+ end: begins[m.index + imp.length],
5331
+ cjs: ""
5324
5332
  });
5325
5333
  skip_spaces();
5326
5334
  switch (s[i2]) {
5327
5335
  case ",":
5328
5336
  break;
5329
5337
  case "I": {
5330
- const prop = node3.out[i2];
5331
- imports[prop] = "default";
5338
+ import_alls.push(node3.out[i2]);
5332
5339
  continue;
5333
5340
  }
5334
5341
  case "J": {
@@ -5371,8 +5378,12 @@ function processImportExports(node3, jsx2) {
5371
5378
  node3.out[i2] = null;
5372
5379
  }
5373
5380
  let cjs = "";
5374
- for (const s2 of star_imports) {
5381
+ for (const s2 of import_alls) {
5375
5382
  cjs += `const ${s2} = require(${src},{requirer:module});
5383
+ `;
5384
+ }
5385
+ for (const s2 of star_imports) {
5386
+ cjs += `const ${s2} = require(${src},{requirer:module, checkExport: ['default']}).default;
5376
5387
  `;
5377
5388
  }
5378
5389
  if (Object.keys(imports).length) {
@@ -6387,7 +6398,7 @@ function transpileJSX(jsx2, {
6387
6398
 
6388
6399
  // .tmp/src/lilact.jsx
6389
6400
  var Lilact2 = {
6390
- VERSION: "beta.22",
6401
+ VERSION: "beta.23",
6391
6402
  // Configuration
6392
6403
  defaultTransitionTimeout: 300,
6393
6404
  defaultIsEqual: Object.is,
@@ -6409,9 +6420,10 @@ var Lilact2 = {
6409
6420
  // Dependencies
6410
6421
  PropTypes,
6411
6422
  redux: redux_exports,
6412
- emotion: emotion_css_esm_exports,
6413
- default: Lilact2
6423
+ emotion: emotion_css_esm_exports
6414
6424
  };
6425
+ Lilact2.default = Lilact2;
6426
+ var lilact_default = Lilact2;
6415
6427
  Lilact2.importObjectPaths = {
6416
6428
  "lilact": Lilact2,
6417
6429
  "@emotion/css": Lilact2.emotion,
@@ -6433,7 +6445,6 @@ if (true) {
6433
6445
  console.log(`Lilact (Version: ${Lilact2.VERSION}) - Debug Mode`);
6434
6446
  console.log(`Copyright(C) 2024-2026 Arash Kazemi <contact.arash.kazemi@gmail.com>`);
6435
6447
  }
6436
- var lilact_default = Lilact2;
6437
6448
  export {
6438
6449
  CSSTransition,
6439
6450
  Children,
@@ -6465,6 +6476,8 @@ export {
6465
6476
  capture_events_set,
6466
6477
  clearInterval,
6467
6478
  clearTimeout2 as clearTimeout,
6479
+ cloneComponent,
6480
+ cloneElement,
6468
6481
  combineReducers2 as combineReducers,
6469
6482
  connect,
6470
6483
  createComponent2 as createComponent,