lilact 0.27.2 → 0.27.3

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.
@@ -2635,7 +2635,7 @@ var ComponentCore = class {
2635
2635
  }
2636
2636
  } else if (this.entity === "select") {
2637
2637
  if ((patch == null ? void 0 : patch.value) !== this.element.value) {
2638
- lilact_default.setTimeout(() => this.element.value = String(patch.value), 0);
2638
+ lilact_default._setTimeout(() => this.element.value = String(patch.value), 0);
2639
2639
  }
2640
2640
  }
2641
2641
  for (let a in this.props) {
@@ -3027,10 +3027,10 @@ var Component = class {
3027
3027
  * @returns {void}
3028
3028
  */
3029
3029
  forceUpdate(callback) {
3030
- lilact_default.clearTimeout(lilact_default.update_timeout);
3030
+ lilact_default._clearTimeout(lilact_default.update_timeout);
3031
3031
  lilact_default.update_set.add(this[CORE].container || this[CORE]);
3032
3032
  if (callback) lilact_default.update_cbs.add(callback.bind(this));
3033
- lilact_default.update_timeout = lilact_default.setTimeout(doUpdates, lilact_default.update_interval_margin);
3033
+ lilact_default.update_timeout = lilact_default._setTimeout(doUpdates, lilact_default.update_interval_margin);
3034
3034
  }
3035
3035
  /**
3036
3036
  * Update component state.
@@ -3480,8 +3480,8 @@ async function useLayoutEffect(effect, deps = void 0) {
3480
3480
  lilact_default.layout_effects.add(async () => {
3481
3481
  hk.cleanup = await effect();
3482
3482
  });
3483
- lilact_default.clearTimeout(lilact_default.effect_timeout);
3484
- lilact_default.setTimeout(lilact_default.processEffects, 0);
3483
+ lilact_default._clearTimeout(lilact_default.effect_timeout);
3484
+ lilact_default._setTimeout(lilact_default.processEffects, 0);
3485
3485
  }
3486
3486
  async function useEffect(effect, deps = void 0) {
3487
3487
  if (deps !== void 0 && !Array.isArray(deps) && deps !== null && typeof deps !== "object") {
@@ -3499,8 +3499,8 @@ async function useEffect(effect, deps = void 0) {
3499
3499
  lilact_default.passive_effects.add(async () => {
3500
3500
  hk.cleanup = await effect();
3501
3501
  });
3502
- lilact_default.clearTimeout(lilact_default.effect_timeout);
3503
- lilact_default.setTimeout(lilact_default.processEffects, 0);
3502
+ lilact_default._clearTimeout(lilact_default.effect_timeout);
3503
+ lilact_default._setTimeout(lilact_default.processEffects, 0);
3504
3504
  }
3505
3505
  async function useInsertionEffect(effect, deps = void 0) {
3506
3506
  if (deps !== void 0 && !Array.isArray(deps) && deps !== null && typeof deps !== "object") {
@@ -3518,8 +3518,8 @@ async function useInsertionEffect(effect, deps = void 0) {
3518
3518
  lilact_default.insertion_effects.add(async () => {
3519
3519
  hk.cleanup = await effect();
3520
3520
  });
3521
- lilact_default.clearTimeout(lilact_default.effect_timeout);
3522
- lilact_default.setTimeout(lilact_default.processEffects, 0);
3521
+ lilact_default._clearTimeout(lilact_default.effect_timeout);
3522
+ lilact_default._setTimeout(lilact_default.processEffects, 0);
3523
3523
  }
3524
3524
  function useMemo(factory, deps = void 0) {
3525
3525
  if (deps !== void 0 && !Array.isArray(deps) && deps !== null && typeof deps !== "object") {
@@ -3953,167 +3953,6 @@ __export(transition_exports, {
3953
3953
  Transition: () => Transition,
3954
3954
  TransitionGroup: () => TransitionGroup
3955
3955
  });
3956
-
3957
- // .tmp/src/timers.jsx
3958
- var timers_exports = {};
3959
- __export(timers_exports, {
3960
- animationFramePromise: () => animationFramePromise,
3961
- clearInterval: () => clearInterval,
3962
- clearTimeout: () => clearTimeout2,
3963
- grabTimers: () => grabTimers,
3964
- pauseTimers: () => pauseTimers,
3965
- releaseTimers: () => releaseTimers,
3966
- resetTimers: () => resetTimers,
3967
- resumeTimers: () => resumeTimers,
3968
- setInterval: () => setInterval,
3969
- setTimeout: () => setTimeout2,
3970
- timeoutPromise: () => timeoutPromise
3971
- });
3972
- var timer_pause_time = void 0;
3973
- var current_timer_idx = -1;
3974
- var timer_list = [];
3975
- var timer_timeout = -1;
3976
- var all_timers = {};
3977
- var _setTimeout = window.setTimeout;
3978
- var _setInterval = window.setInterval;
3979
- var _clearTimeout = window.clearTimeout;
3980
- var _clearInterval = window.clearInterval;
3981
- function get_bucket(target) {
3982
- let left = 0;
3983
- let right = timer_list.length - 1;
3984
- while (left <= right) {
3985
- const mid = Math.floor((left + right) / 2);
3986
- const mid_val = timer_list[mid][DUE];
3987
- if (mid_val === target) {
3988
- return [mid, timer_list[mid]];
3989
- } else if (mid_val < target) {
3990
- left = mid + 1;
3991
- } else {
3992
- right = mid - 1;
3993
- }
3994
- }
3995
- const bucket = [];
3996
- bucket[DUE] = target;
3997
- timer_list.splice(left, 0, bucket);
3998
- return [left, bucket];
3999
- }
4000
- function add_timer(t, is_repeat = false) {
4001
- const [i2, bucket] = get_bucket(t[DUE]);
4002
- if (!is_repeat) {
4003
- current_timer_idx++;
4004
- all_timers[current_timer_idx] = t;
4005
- t[IDX] = current_timer_idx;
4006
- }
4007
- bucket.push(t);
4008
- if (timer_list[0][0] === t) {
4009
- _clearTimeout(timer_timeout);
4010
- timer_timeout = _setTimeout(run_timer, t[INTERVAL]);
4011
- }
4012
- return current_timer_idx;
4013
- }
4014
- function run_timer() {
4015
- const now = Date.now();
4016
- let i2 = 0;
4017
- let buck = timer_list[i2];
4018
- while (buck && buck[DUE] - now <= 0) {
4019
- for (const t of buck) {
4020
- if (!t[CLEARED]) {
4021
- t[CALLBACK](...t[ARGS]);
4022
- if (t[REPEAT]) {
4023
- t[DUE] = Date.now() + t[INTERVAL];
4024
- add_timer(t, true);
4025
- } else {
4026
- delete all_timers[t[IDX]];
4027
- }
4028
- } else {
4029
- delete all_timers[t[IDX]];
4030
- }
4031
- }
4032
- i2++;
4033
- buck = timer_list[i2];
4034
- }
4035
- timer_list.splice(0, i2);
4036
- if (timer_list.length > 0) {
4037
- _clearTimeout(timer_timeout);
4038
- timer_timeout = _setTimeout(run_timer, timer_list[0][DUE] - now);
4039
- }
4040
- }
4041
- function resetTimers() {
4042
- _clearTimeout(timer_timeout);
4043
- timer_pause_time = void 0;
4044
- current_timer_idx = -1;
4045
- timer_list = [];
4046
- timer_timeout = -1;
4047
- all_timers = {};
4048
- }
4049
- function pauseTimers() {
4050
- _clearTimeout(timer_timeout);
4051
- timer_pause_time = Date.now();
4052
- }
4053
- function resumeTimers() {
4054
- if (!timer_pause_time) return;
4055
- if (timer_list.length > 0) {
4056
- const now = Date.now();
4057
- timer_pause_time -= now;
4058
- for (const t of timer_list) {
4059
- t[DUE] -= timer_pause_time;
4060
- }
4061
- timer_timeout = _setTimeout(run_timer, timer_list[0][DUE] - now);
4062
- }
4063
- timer_pause_time = void 0;
4064
- }
4065
- function setTimeout2(callback, delay, ...args) {
4066
- return add_timer({ [CALLBACK]: callback, [INTERVAL]: delay, [DUE]: Date.now() + delay, [REPEAT]: false, [ARGS]: args });
4067
- }
4068
- function setInterval(callback, interval, ...args) {
4069
- return add_timer({ [CALLBACK]: callback, [INTERVAL]: interval, [DUE]: Date.now() + interval, [REPEAT]: true, [ARGS]: args });
4070
- }
4071
- function clearTimeout2(id) {
4072
- if (all_timers[id]) all_timers[id][CLEARED] = true;
4073
- }
4074
- function clearInterval(id) {
4075
- if (all_timers[id]) all_timers[id][CLEARED] = true;
4076
- }
4077
- function grabTimers() {
4078
- globalThis.setTimeout = Lilact.setTimeout;
4079
- globalThis.setInterval = Lilact.setInterval;
4080
- globalThis.clearTimeout = Lilact.clearTimeout;
4081
- globalThis.clearInterval = Lilact.clearInterval;
4082
- }
4083
- function releaseTimers() {
4084
- globalThis.setTimeout = _setTimeout;
4085
- globalThis.setInterval = _setInterval;
4086
- globalThis.clearTimeout = _clearTimeout;
4087
- globalThis.clearInterval = _clearInterval;
4088
- }
4089
- function timeoutPromise(duration = 0, timerSource = Lilact) {
4090
- let id, resolve, reject;
4091
- const promise = new Promise((res, rej) => {
4092
- resolve = res;
4093
- reject = rej;
4094
- id = timerSource.setTimeout(() => {
4095
- resolve();
4096
- }, duration);
4097
- });
4098
- promise.proceed = () => {
4099
- timerSource.clearTimeout(id);
4100
- resolve();
4101
- };
4102
- promise.cancel = () => {
4103
- timerSource.clearTimeout(id);
4104
- reject();
4105
- };
4106
- return promise;
4107
- }
4108
- function animationFramePromise() {
4109
- return new Promise((resolve) => {
4110
- requestAnimationFrame(() => {
4111
- resolve();
4112
- });
4113
- });
4114
- }
4115
-
4116
- // .tmp/src/transition.jsx
4117
3956
  var UNMOUNTED = "unmounted";
4118
3957
  var EXITED = "exited";
4119
3958
  var ENTERING = "entering";
@@ -4151,15 +3990,15 @@ function Transition({
4151
3990
  } else this[CORE].mount_state = EXITED;
4152
3991
  }
4153
3992
  useEffect(() => {
4154
- return () => clearTimeout2(this[CORE].timer);
3993
+ return () => clearTimeout(this[CORE].timer);
4155
3994
  }, []);
4156
3995
  useEffect(() => {
4157
3996
  if (!this[CORE].is_appeared && appear && this[CORE].mount_state === ENTERING && inProp) {
4158
3997
  onEnter == null ? void 0 : onEnter();
4159
3998
  requestAnimationFrame(() => {
4160
3999
  onEntering == null ? void 0 : onEntering(!this[CORE].is_appeared);
4161
- clearTimeout2(this[CORE].timer);
4162
- this[CORE].timer = setTimeout2(() => {
4000
+ clearTimeout(this[CORE].timer);
4001
+ this[CORE].timer = setTimeout(() => {
4163
4002
  this[CORE].mount_state = ENTERED;
4164
4003
  this.forceUpdate();
4165
4004
  this[CORE].is_appeared = true;
@@ -4176,8 +4015,8 @@ function Transition({
4176
4015
  this[CORE].mount_state = ENTERING;
4177
4016
  this.forceUpdate(() => {
4178
4017
  onEntering == null ? void 0 : onEntering(!this[CORE].is_appeared);
4179
- clearTimeout2(this[CORE].timer);
4180
- this[CORE].timer = setTimeout2(() => {
4018
+ clearTimeout(this[CORE].timer);
4019
+ this[CORE].timer = setTimeout(() => {
4181
4020
  this[CORE].mount_state = ENTERED;
4182
4021
  this.forceUpdate();
4183
4022
  this[CORE].is_appeared = true;
@@ -4190,8 +4029,8 @@ function Transition({
4190
4029
  this[CORE].mount_state = EXITING;
4191
4030
  this.forceUpdate(() => {
4192
4031
  onExiting == null ? void 0 : onExiting();
4193
- clearTimeout2(this[CORE].timer);
4194
- this[CORE].timer = setTimeout2(() => {
4032
+ clearTimeout(this[CORE].timer);
4033
+ this[CORE].timer = setTimeout(() => {
4195
4034
  this[CORE].mount_state = EXITED;
4196
4035
  this.forceUpdate();
4197
4036
  onExited == null ? void 0 : onExited();
@@ -4607,6 +4446,167 @@ function combineReducers2(reducers) {
4607
4446
  };
4608
4447
  }
4609
4448
 
4449
+ // .tmp/src/timers.jsx
4450
+ var timers_exports = {};
4451
+ __export(timers_exports, {
4452
+ animationFramePromise: () => animationFramePromise,
4453
+ clearInterval: () => clearInterval,
4454
+ clearTimeout: () => clearTimeout2,
4455
+ grabTimers: () => grabTimers,
4456
+ pauseTimers: () => pauseTimers,
4457
+ releaseTimers: () => releaseTimers,
4458
+ resetTimers: () => resetTimers,
4459
+ resumeTimers: () => resumeTimers,
4460
+ setInterval: () => setInterval,
4461
+ setTimeout: () => setTimeout2,
4462
+ timeoutPromise: () => timeoutPromise
4463
+ });
4464
+ var timer_pause_time = void 0;
4465
+ var current_timer_idx = -1;
4466
+ var timer_list = [];
4467
+ var timer_timeout = -1;
4468
+ var all_timers = {};
4469
+ var _setTimeout = window.setTimeout;
4470
+ var _setInterval = window.setInterval;
4471
+ var _clearTimeout = window.clearTimeout;
4472
+ var _clearInterval = window.clearInterval;
4473
+ function get_bucket(target) {
4474
+ let left = 0;
4475
+ let right = timer_list.length - 1;
4476
+ while (left <= right) {
4477
+ const mid = Math.floor((left + right) / 2);
4478
+ const mid_val = timer_list[mid][DUE];
4479
+ if (mid_val === target) {
4480
+ return [mid, timer_list[mid]];
4481
+ } else if (mid_val < target) {
4482
+ left = mid + 1;
4483
+ } else {
4484
+ right = mid - 1;
4485
+ }
4486
+ }
4487
+ const bucket = [];
4488
+ bucket[DUE] = target;
4489
+ timer_list.splice(left, 0, bucket);
4490
+ return [left, bucket];
4491
+ }
4492
+ function add_timer(t, is_repeat = false) {
4493
+ const [i2, bucket] = get_bucket(t[DUE]);
4494
+ if (!is_repeat) {
4495
+ current_timer_idx++;
4496
+ all_timers[current_timer_idx] = t;
4497
+ t[IDX] = current_timer_idx;
4498
+ }
4499
+ bucket.push(t);
4500
+ if (timer_list[0][0] === t) {
4501
+ _clearTimeout(timer_timeout);
4502
+ timer_timeout = _setTimeout(run_timer, t[INTERVAL]);
4503
+ }
4504
+ return current_timer_idx;
4505
+ }
4506
+ function run_timer() {
4507
+ const now = Date.now();
4508
+ let i2 = 0;
4509
+ let buck = timer_list[i2];
4510
+ while (buck && buck[DUE] - now <= 0) {
4511
+ for (const t of buck) {
4512
+ if (!t[CLEARED]) {
4513
+ t[CALLBACK](...t[ARGS]);
4514
+ if (t[REPEAT]) {
4515
+ t[DUE] = Date.now() + t[INTERVAL];
4516
+ add_timer(t, true);
4517
+ } else {
4518
+ delete all_timers[t[IDX]];
4519
+ }
4520
+ } else {
4521
+ delete all_timers[t[IDX]];
4522
+ }
4523
+ }
4524
+ i2++;
4525
+ buck = timer_list[i2];
4526
+ }
4527
+ timer_list.splice(0, i2);
4528
+ if (timer_list.length > 0) {
4529
+ _clearTimeout(timer_timeout);
4530
+ timer_timeout = _setTimeout(run_timer, timer_list[0][DUE] - now);
4531
+ }
4532
+ }
4533
+ function resetTimers() {
4534
+ _clearTimeout(timer_timeout);
4535
+ timer_pause_time = void 0;
4536
+ current_timer_idx = -1;
4537
+ timer_list = [];
4538
+ timer_timeout = -1;
4539
+ all_timers = {};
4540
+ }
4541
+ function pauseTimers() {
4542
+ _clearTimeout(timer_timeout);
4543
+ timer_pause_time = Date.now();
4544
+ }
4545
+ function resumeTimers() {
4546
+ if (!timer_pause_time) return;
4547
+ if (timer_list.length > 0) {
4548
+ const now = Date.now();
4549
+ timer_pause_time -= now;
4550
+ for (const t of timer_list) {
4551
+ t[DUE] -= timer_pause_time;
4552
+ }
4553
+ timer_timeout = _setTimeout(run_timer, timer_list[0][DUE] - now);
4554
+ }
4555
+ timer_pause_time = void 0;
4556
+ }
4557
+ function setTimeout2(callback, delay, ...args) {
4558
+ return add_timer({ [CALLBACK]: callback, [INTERVAL]: delay, [DUE]: Date.now() + delay, [REPEAT]: false, [ARGS]: args });
4559
+ }
4560
+ function setInterval(callback, interval, ...args) {
4561
+ return add_timer({ [CALLBACK]: callback, [INTERVAL]: interval, [DUE]: Date.now() + interval, [REPEAT]: true, [ARGS]: args });
4562
+ }
4563
+ function clearTimeout2(id) {
4564
+ if (all_timers[id]) all_timers[id][CLEARED] = true;
4565
+ else _clearTimeout(id);
4566
+ }
4567
+ function clearInterval(id) {
4568
+ if (all_timers[id]) all_timers[id][CLEARED] = true;
4569
+ else _clearInterval(id);
4570
+ }
4571
+ function grabTimers() {
4572
+ globalThis.setTimeout = Lilact.setTimeout;
4573
+ globalThis.setInterval = Lilact.setInterval;
4574
+ globalThis.clearTimeout = Lilact.clearTimeout;
4575
+ globalThis.clearInterval = Lilact.clearInterval;
4576
+ }
4577
+ function releaseTimers() {
4578
+ globalThis.setTimeout = _setTimeout;
4579
+ globalThis.setInterval = _setInterval;
4580
+ globalThis.clearTimeout = _clearTimeout;
4581
+ globalThis.clearInterval = _clearInterval;
4582
+ }
4583
+ function timeoutPromise(duration = 0, timerSource = Lilact) {
4584
+ let id, resolve, reject;
4585
+ const promise = new Promise((res, rej) => {
4586
+ resolve = res;
4587
+ reject = rej;
4588
+ id = timerSource.setTimeout(() => {
4589
+ resolve();
4590
+ }, duration);
4591
+ });
4592
+ promise.proceed = () => {
4593
+ timerSource.clearTimeout(id);
4594
+ resolve();
4595
+ };
4596
+ promise.cancel = () => {
4597
+ timerSource.clearTimeout(id);
4598
+ reject();
4599
+ };
4600
+ return promise;
4601
+ }
4602
+ function animationFramePromise() {
4603
+ return new Promise((resolve) => {
4604
+ requestAnimationFrame(() => {
4605
+ resolve();
4606
+ });
4607
+ });
4608
+ }
4609
+
4610
4610
  // .tmp/src/errors.jsx
4611
4611
  var errors_exports = {};
4612
4612
  __export(errors_exports, {
@@ -5115,11 +5115,11 @@ var Suspense = class extends Component {
5115
5115
  /** @ignore */
5116
5116
  _clearTimers() {
5117
5117
  if (this._delayTimer) {
5118
- clearTimeout2(this._delayTimer);
5118
+ clearTimeout(this._delayTimer);
5119
5119
  this._delayTimer = null;
5120
5120
  }
5121
5121
  if (this._minShowTimer) {
5122
- clearTimeout2(this._minShowTimer);
5122
+ clearTimeout(this._minShowTimer);
5123
5123
  this._minShowTimer = null;
5124
5124
  }
5125
5125
  }
@@ -5130,10 +5130,10 @@ var Suspense = class extends Component {
5130
5130
  if (this._pending.size === 1) {
5131
5131
  const delay = Math.max(0, this.props.minDelay);
5132
5132
  if (this._delayTimer) {
5133
- clearTimeout2(this._delayTimer);
5133
+ clearTimeout(this._delayTimer);
5134
5134
  this._delayTimer = null;
5135
5135
  }
5136
- this._delayTimer = setTimeout2(() => {
5136
+ this._delayTimer = setTimeout(() => {
5137
5137
  this._delayTimer = null;
5138
5138
  this._fallbackShownAt = Date.now();
5139
5139
  this.setState({ showingFallback: true });
@@ -5145,7 +5145,7 @@ var Suspense = class extends Component {
5145
5145
  }
5146
5146
  if (this._pending.size === 0) {
5147
5147
  if (this._delayTimer) {
5148
- clearTimeout2(this._delayTimer);
5148
+ clearTimeout(this._delayTimer);
5149
5149
  this._delayTimer = null;
5150
5150
  this.setState({ showingFallback: false });
5151
5151
  return;
@@ -5156,10 +5156,10 @@ var Suspense = class extends Component {
5156
5156
  this.setState({ showingFallback: false });
5157
5157
  } else {
5158
5158
  if (this._minShowTimer) {
5159
- clearTimeout2(this._minShowTimer);
5159
+ clearTimeout(this._minShowTimer);
5160
5160
  this._minShowTimer = null;
5161
5161
  }
5162
- this._minShowTimer = setTimeout2(() => {
5162
+ this._minShowTimer = setTimeout(() => {
5163
5163
  this._minShowTimer = null;
5164
5164
  this.setState({ showingFallback: false });
5165
5165
  }, remaining);
@@ -5839,11 +5839,11 @@ function processImportExports(node3, jsx2) {
5839
5839
  node3.out[i2] = null;
5840
5840
  }
5841
5841
  let cjs = "";
5842
- for (const s2 of import_alls) {
5842
+ for (const s2 of star_imports) {
5843
5843
  cjs += `const ${s2} = require(${src},{requirer:module});
5844
5844
  `;
5845
5845
  }
5846
- for (const s2 of star_imports) {
5846
+ for (const s2 of import_alls) {
5847
5847
  cjs += `const ${s2} = require(${src},{requirer:module, checkExport: ['default']}).default;
5848
5848
  `;
5849
5849
  }
@@ -6891,7 +6891,11 @@ var Lilact2 = {
6891
6891
  // Dependencies
6892
6892
  PropTypes,
6893
6893
  redux: redux_exports,
6894
- emotion: emotion_css_esm_exports
6894
+ emotion: emotion_css_esm_exports,
6895
+ _setTimeout: window.setTimeout.bind(window),
6896
+ _setInterval: window.setInterval.bind(window),
6897
+ _clearTimeout: window.clearTimeout.bind(window),
6898
+ _clearInterval: window.clearInterval.bind(window)
6895
6899
  };
6896
6900
  Lilact2.default = Lilact2;
6897
6901
  var lilact_default = Lilact2;
@@ -6905,6 +6909,7 @@ globalThis.createComponent = Lilact2.createComponent;
6905
6909
  globalThis.Fragment = Lilact2.Fragment;
6906
6910
  globalThis.require = Lilact2.require;
6907
6911
  document.addEventListener("DOMContentLoaded", () => {
6912
+ Lilact2.grabTimers();
6908
6913
  Lilact2.runScripts().catch((error2) => {
6909
6914
  var _a;
6910
6915
  (_a = Lilact2.globalErrorHandler) == null ? void 0 : _a.call(Lilact2, error2);