@e1011/es-kit 1.1.38 → 1.1.40

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 (32) hide show
  1. package/dist/hooks/esm/index.css +208 -208
  2. package/dist/hooks/esm/src/core/hooks/index.js +1 -1
  3. package/dist/hooks/esm/src/core/hooks/useSetTimeout.js +2 -0
  4. package/dist/hooks/esm/src/core/hooks/useSetTimeout.js.map +1 -0
  5. package/dist/hooks/index.css +208 -208
  6. package/dist/hooks/src/core/hooks/index.js +1 -1
  7. package/dist/hooks/src/core/hooks/useSetTimeout.js +2 -0
  8. package/dist/hooks/src/core/hooks/useSetTimeout.js.map +1 -0
  9. package/dist/lib/cjs/src/core/hooks/useSetTimeout.js +2 -0
  10. package/dist/lib/cjs/src/core/hooks/useSetTimeout.js.map +1 -0
  11. package/dist/lib/cjs/src/core/utils/helpers/other.js.map +1 -1
  12. package/dist/lib/cjs/src/index.js +1 -1
  13. package/dist/lib/esm/src/core/hooks/useSetTimeout.js +2 -0
  14. package/dist/lib/esm/src/core/hooks/useSetTimeout.js.map +1 -0
  15. package/dist/lib/esm/src/core/utils/helpers/other.js.map +1 -1
  16. package/dist/lib/esm/src/index.js +1 -1
  17. package/dist/lib/tsconfig.tsbuildinfo +1 -1
  18. package/dist/types/src/core/hooks/hooks.stories.d.ts +5 -0
  19. package/dist/types/src/core/hooks/hooks.stories.d.ts.map +1 -0
  20. package/dist/types/src/core/hooks/index.d.ts +1 -0
  21. package/dist/types/src/core/hooks/index.d.ts.map +1 -1
  22. package/dist/types/src/core/hooks/useSetTimeout.d.ts +5 -0
  23. package/dist/types/src/core/hooks/useSetTimeout.d.ts.map +1 -0
  24. package/dist/types/src/core/utils/helpers/other.d.ts +1 -1
  25. package/dist/types/src/core/utils/helpers/other.d.ts.map +1 -1
  26. package/dist/utils/esm/index.css +208 -208
  27. package/dist/utils/esm/src/core/utils/helpers/other.js.map +1 -1
  28. package/dist/utils/index.css +208 -208
  29. package/dist/utils/src/core/utils/helpers/other.js.map +1 -1
  30. package/package.json +1 -1
  31. package/dist/types/src/core/utils/appState/store/asyncFunc.spec.d.ts +0 -2
  32. package/dist/types/src/core/utils/appState/store/asyncFunc.spec.d.ts.map +0 -1
@@ -1,35 +1,30 @@
1
- .CollapsibleContainer-module_collapsible-container__u0Jmm {
2
- transform-origin: 0% 0%;
3
- opacity: 0;
4
- overflow: clip;
5
- }
6
- .CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_vertical__w7MVN {
7
- transition: opacity 0.2s ease-in-out, height 0.2s ease-in-out, max-height 0.2s ease-in-out;
8
- will-change: opacity, height, max-height;
9
- }
10
- .CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_vertical__w7MVN.CollapsibleContainer-module_collapsed__q8fs8 {
11
- height: 0;
12
- max-height: 0;
13
- opacity: 0;
1
+ .divider-module_divider-line__6CesR {
2
+ position: relative;
3
+ display: block;
4
+ transition: opacity, width, height 250ms ease-in-out;
5
+ background-color: var(--color);
6
+ opacity: var(--opacity);
14
7
  }
15
- .CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_vertical__w7MVN.CollapsibleContainer-module_expanded__O6Vh8 {
16
- height: var(--prop-value);
17
- max-height: var(--prop-value);
18
- opacity: 1;
8
+ .divider-module_divider-line__6CesR.divider-module_vertical__qSVWD {
9
+ height: var(--length);
10
+ left: var(--left);
11
+ width: var(--width);
12
+ margin: var(--margin);
19
13
  }
20
- .CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_horizontal__QJWI- {
21
- transition: opacity 0.2s ease-in-out, width 0.2s ease-in-out, max-width 0.2s ease-in-out;
22
- will-change: opacity, width, max-width;
14
+ .divider-module_divider-line__6CesR.divider-module_horizontal__Gz-Oj {
15
+ width: var(--length);
16
+ left: var(--left);
17
+ height: var(--height);
18
+ margin: var(--margin);
23
19
  }
24
- .CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_horizontal__QJWI-.CollapsibleContainer-module_collapsed__q8fs8 {
25
- width: 0;
26
- max-width: 0;
27
- opacity: 0;
20
+ .errorBoundary-module_errorBoundary__gk9ps {
21
+ background: #EFEFEF;
22
+ width: 100%;
23
+ height: 100%;
28
24
  }
29
- .CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_horizontal__QJWI-.CollapsibleContainer-module_expanded__O6Vh8 {
30
- width: var(--prop-value);
31
- max-width: var(--prop-value);
32
- opacity: 1;
25
+
26
+ .errorBoundary-module_StyledIcon__IYHiU {
27
+ margin-right: 10px;
33
28
  }
34
29
  .icon-module_icon-base-parent__nOMvW {
35
30
  line-height: 1px !important;
@@ -61,14 +56,38 @@
61
56
  width: var(--height);
62
57
  height: var(--width);
63
58
  }
64
- .errorBoundary-module_errorBoundary__gk9ps {
65
- background: #EFEFEF;
66
- width: 100%;
67
- height: 100%;
59
+ .CollapsibleContainer-module_collapsible-container__u0Jmm {
60
+ transform-origin: 0% 0%;
61
+ opacity: 0;
62
+ overflow: clip;
68
63
  }
69
-
70
- .errorBoundary-module_StyledIcon__IYHiU {
71
- margin-right: 10px;
64
+ .CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_vertical__w7MVN {
65
+ transition: opacity 0.2s ease-in-out, height 0.2s ease-in-out, max-height 0.2s ease-in-out;
66
+ will-change: opacity, height, max-height;
67
+ }
68
+ .CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_vertical__w7MVN.CollapsibleContainer-module_collapsed__q8fs8 {
69
+ height: 0;
70
+ max-height: 0;
71
+ opacity: 0;
72
+ }
73
+ .CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_vertical__w7MVN.CollapsibleContainer-module_expanded__O6Vh8 {
74
+ height: var(--prop-value);
75
+ max-height: var(--prop-value);
76
+ opacity: 1;
77
+ }
78
+ .CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_horizontal__QJWI- {
79
+ transition: opacity 0.2s ease-in-out, width 0.2s ease-in-out, max-width 0.2s ease-in-out;
80
+ will-change: opacity, width, max-width;
81
+ }
82
+ .CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_horizontal__QJWI-.CollapsibleContainer-module_collapsed__q8fs8 {
83
+ width: 0;
84
+ max-width: 0;
85
+ opacity: 0;
86
+ }
87
+ .CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_horizontal__QJWI-.CollapsibleContainer-module_expanded__O6Vh8 {
88
+ width: var(--prop-value);
89
+ max-width: var(--prop-value);
90
+ opacity: 1;
72
91
  }
73
92
  .field-module_field__UfKm3 {
74
93
  opacity: 1;
@@ -144,49 +163,6 @@
144
163
  .field-module_field__UfKm3 label {
145
164
  text-align: left;
146
165
  }
147
- .divider-module_divider-line__6CesR {
148
- position: relative;
149
- display: block;
150
- transition: opacity, width, height 250ms ease-in-out;
151
- background-color: var(--color);
152
- opacity: var(--opacity);
153
- }
154
- .divider-module_divider-line__6CesR.divider-module_vertical__qSVWD {
155
- height: var(--length);
156
- left: var(--left);
157
- width: var(--width);
158
- margin: var(--margin);
159
- }
160
- .divider-module_divider-line__6CesR.divider-module_horizontal__Gz-Oj {
161
- width: var(--length);
162
- left: var(--left);
163
- height: var(--height);
164
- margin: var(--margin);
165
- }
166
- .layoutBox-module_layout-box__ZIID8 {
167
- display: flex;
168
- position: relative;
169
- flex-direction: row;
170
- flex: 0;
171
- flex-grow: 0;
172
- flex-shrink: 0;
173
- flex-basis: auto;
174
- flex-wrap: nowrap;
175
- gap: 0;
176
- text-align: left;
177
- justify-content: flex-start;
178
- align-items: flex-start;
179
- align-self: auto;
180
- margin: 0;
181
- padding: 0;
182
- width: auto;
183
- height: auto;
184
- max-width: none;
185
- max-height: none;
186
- min-width: 0;
187
- min-height: 0;
188
- border-radius: initial;
189
- }
190
166
  .lazyComponent-module_loader__brMEW {
191
167
  position: relative;
192
168
  width: 100px;
@@ -230,124 +206,29 @@
230
206
  stroke-dashoffset: -124;
231
207
  }
232
208
  }
233
- :root {
234
- --divider-line: #4a4b4b;
235
- }
236
-
237
- .button-module_overflow-hidden__Vc5AU, .button-module_text-truncate__a89Bp {
238
- overflow: hidden !important;
239
- }
240
-
241
- .button-module_text-nowrap__tR-VJ, .button-module_text-truncate__a89Bp {
242
- white-space: nowrap !important;
243
- }
244
-
245
- .button-module_text-ellipsis__5MFA9, .button-module_text-truncate__a89Bp {
246
- text-overflow: ellipsis !important;
247
- }
248
-
249
- .button-module_button__NDMQS {
250
- border: none;
251
- color: #090A0A;
252
- padding: 0.5rem 1rem;
253
- text-align: center;
254
- text-decoration: none;
255
- font-size: 1rem;
256
- overflow: hidden;
209
+ .layoutBox-module_layout-box__ZIID8 {
257
210
  display: flex;
258
- align-items: center;
259
- justify-content: center;
260
- min-width: "auto";
261
- width: "auto";
262
- user-select: all;
263
- pointer-events: auto;
264
- cursor: pointer;
265
- }
266
- .button-module_button__NDMQS > span {
267
- overflow: hidden;
268
- white-space: nowrap;
269
- display: inline-block;
270
- }
271
- .button-module_button__NDMQS.button-module_info__O6gEW {
272
- background-color: #2D8EFF;
273
- }
274
- .button-module_button__NDMQS.button-module_info__O6gEW.button-module_transparent__zbeBu {
275
- border: 1px solid #2D8EFF !important;
276
- }
277
- .button-module_button__NDMQS.button-module_success__gM25y {
278
- background-color: #13CE66;
279
- }
280
- .button-module_button__NDMQS.button-module_success__gM25y.button-module_transparent__zbeBu {
281
- border: 1px solid #13CE66 !important;
282
- }
283
- .button-module_button__NDMQS.button-module_error__q9qqo {
284
- background-color: #FF4949;
285
- }
286
- .button-module_button__NDMQS.button-module_error__q9qqo.button-module_transparent__zbeBu {
287
- border: 1px solid #FF4949 !important;
288
- }
289
- .button-module_button__NDMQS.button-module_warning__MdmiZ {
290
- background-color: #FFCC3D;
291
- }
292
- .button-module_button__NDMQS.button-module_warning__MdmiZ.button-module_transparent__zbeBu {
293
- border: 1px solid #FFCC3D !important;
294
- }
295
- .button-module_button__NDMQS.button-module_transparent__zbeBu {
296
- border: none !important;
297
- background-color: transparent !important;
298
- background: transparent !important;
299
- }
300
- .button-module_button__NDMQS.button-module_tiny__pBNwo {
301
- height: 1.4rem;
302
- min-width: 1.5rem;
303
- width: 1.5rem;
304
- padding: 0.2rem;
305
- font-size: 0.8rem;
306
- }
307
- .button-module_button__NDMQS.button-module_fluid__GXxID {
308
- width: 100%;
309
- }
310
- .button-module_button__NDMQS.button-module_truncate__c-G9k > span {
311
- overflow: hidden !important;
312
- white-space: nowrap !important;
313
- text-overflow: ellipsis !important;
314
- }
315
- .button-module_button__NDMQS.button-module_animated__gLwPl {
316
- transition: transform 250ms ease-out;
317
- }
318
- .button-module_button__NDMQS.button-module_hasShadow__42BQv {
319
- box-shadow: 0 5px 15px 0 rgba(28, 37, 39, 0.1), 0 0 2px 0 rgba(0, 0, 0, 0.1);
320
- }
321
- .button-module_button__NDMQS.button-module_hasIcon__dXLlJ {
322
- padding: 0.4rem;
323
- border: none !important;
324
- line-height: 1px;
325
- }
326
- .button-module_button__NDMQS.button-module_hasIcon__dXLlJ.button-module_tiny__pBNwo {
327
- padding: 0px;
328
- }
329
- .button-module_button__NDMQS:hover {
330
- background-color: #c5c5c5 !important;
331
- }
332
- .button-module_button__NDMQS:hover.button-module_animated__gLwPl {
333
- transform: scale(1.2);
334
- }
335
- .button-module_button__NDMQS.button-module_disabled__hEydO {
336
- user-select: none;
337
- pointer-events: none;
338
- cursor: not-allowed;
339
- }
340
-
341
- .cui-theme-dark .button-module_button__NDMQS {
342
- color: #F4F4F4;
343
- }
344
- .cui-theme-light .button-module_button__NDMQS {
345
- color: #090A0A;
346
- }
347
- .textAndContent-module_textAndContent__X5P1n {
348
- align-items: baseline;
349
- flex-shrink: 1;
350
- gap: 8px;
211
+ position: relative;
212
+ flex-direction: row;
213
+ flex: 0;
214
+ flex-grow: 0;
215
+ flex-shrink: 0;
216
+ flex-basis: auto;
217
+ flex-wrap: nowrap;
218
+ gap: 0;
219
+ text-align: left;
220
+ justify-content: flex-start;
221
+ align-items: flex-start;
222
+ align-self: auto;
223
+ margin: 0;
224
+ padding: 0;
225
+ width: auto;
226
+ height: auto;
227
+ max-width: none;
228
+ max-height: none;
229
+ min-width: 0;
230
+ min-height: 0;
231
+ border-radius: initial;
351
232
  }
352
233
  :root {
353
234
  --divider-line: #4a4b4b;
@@ -415,19 +296,6 @@
415
296
  pointer-events: none;
416
297
  opacity: 0.6;
417
298
  }
418
- .flowLayout-module_flowLayout__VHpnY {
419
- overflow: auto;
420
- }
421
- .flowLayout-module_flowLayout__VHpnY .flowLayout-module_beforeContent__rY-mW {
422
- display: flex;
423
- width: 100%;
424
- min-width: 0;
425
- }
426
- .flowLayout-module_flowLayout__VHpnY .flowLayout-module_afterContent__Hlh8v {
427
- display: flex;
428
- width: 100%;
429
- min-width: 0;
430
- }
431
299
  :root {
432
300
  --divider-line: #4a4b4b;
433
301
  }
@@ -592,6 +460,120 @@
592
460
  border-color: #FD8F3E;
593
461
  color: #632E03;
594
462
  }
463
+ :root {
464
+ --divider-line: #4a4b4b;
465
+ }
466
+
467
+ .button-module_overflow-hidden__Vc5AU, .button-module_text-truncate__a89Bp {
468
+ overflow: hidden !important;
469
+ }
470
+
471
+ .button-module_text-nowrap__tR-VJ, .button-module_text-truncate__a89Bp {
472
+ white-space: nowrap !important;
473
+ }
474
+
475
+ .button-module_text-ellipsis__5MFA9, .button-module_text-truncate__a89Bp {
476
+ text-overflow: ellipsis !important;
477
+ }
478
+
479
+ .button-module_button__NDMQS {
480
+ border: none;
481
+ color: #090A0A;
482
+ padding: 0.5rem 1rem;
483
+ text-align: center;
484
+ text-decoration: none;
485
+ font-size: 1rem;
486
+ overflow: hidden;
487
+ display: flex;
488
+ align-items: center;
489
+ justify-content: center;
490
+ min-width: "auto";
491
+ width: "auto";
492
+ user-select: all;
493
+ pointer-events: auto;
494
+ cursor: pointer;
495
+ }
496
+ .button-module_button__NDMQS > span {
497
+ overflow: hidden;
498
+ white-space: nowrap;
499
+ display: inline-block;
500
+ }
501
+ .button-module_button__NDMQS.button-module_info__O6gEW {
502
+ background-color: #2D8EFF;
503
+ }
504
+ .button-module_button__NDMQS.button-module_info__O6gEW.button-module_transparent__zbeBu {
505
+ border: 1px solid #2D8EFF !important;
506
+ }
507
+ .button-module_button__NDMQS.button-module_success__gM25y {
508
+ background-color: #13CE66;
509
+ }
510
+ .button-module_button__NDMQS.button-module_success__gM25y.button-module_transparent__zbeBu {
511
+ border: 1px solid #13CE66 !important;
512
+ }
513
+ .button-module_button__NDMQS.button-module_error__q9qqo {
514
+ background-color: #FF4949;
515
+ }
516
+ .button-module_button__NDMQS.button-module_error__q9qqo.button-module_transparent__zbeBu {
517
+ border: 1px solid #FF4949 !important;
518
+ }
519
+ .button-module_button__NDMQS.button-module_warning__MdmiZ {
520
+ background-color: #FFCC3D;
521
+ }
522
+ .button-module_button__NDMQS.button-module_warning__MdmiZ.button-module_transparent__zbeBu {
523
+ border: 1px solid #FFCC3D !important;
524
+ }
525
+ .button-module_button__NDMQS.button-module_transparent__zbeBu {
526
+ border: none !important;
527
+ background-color: transparent !important;
528
+ background: transparent !important;
529
+ }
530
+ .button-module_button__NDMQS.button-module_tiny__pBNwo {
531
+ height: 1.4rem;
532
+ min-width: 1.5rem;
533
+ width: 1.5rem;
534
+ padding: 0.2rem;
535
+ font-size: 0.8rem;
536
+ }
537
+ .button-module_button__NDMQS.button-module_fluid__GXxID {
538
+ width: 100%;
539
+ }
540
+ .button-module_button__NDMQS.button-module_truncate__c-G9k > span {
541
+ overflow: hidden !important;
542
+ white-space: nowrap !important;
543
+ text-overflow: ellipsis !important;
544
+ }
545
+ .button-module_button__NDMQS.button-module_animated__gLwPl {
546
+ transition: transform 250ms ease-out;
547
+ }
548
+ .button-module_button__NDMQS.button-module_hasShadow__42BQv {
549
+ box-shadow: 0 5px 15px 0 rgba(28, 37, 39, 0.1), 0 0 2px 0 rgba(0, 0, 0, 0.1);
550
+ }
551
+ .button-module_button__NDMQS.button-module_hasIcon__dXLlJ {
552
+ padding: 0.4rem;
553
+ border: none !important;
554
+ line-height: 1px;
555
+ }
556
+ .button-module_button__NDMQS.button-module_hasIcon__dXLlJ.button-module_tiny__pBNwo {
557
+ padding: 0px;
558
+ }
559
+ .button-module_button__NDMQS:hover {
560
+ background-color: #c5c5c5 !important;
561
+ }
562
+ .button-module_button__NDMQS:hover.button-module_animated__gLwPl {
563
+ transform: scale(1.2);
564
+ }
565
+ .button-module_button__NDMQS.button-module_disabled__hEydO {
566
+ user-select: none;
567
+ pointer-events: none;
568
+ cursor: not-allowed;
569
+ }
570
+
571
+ .cui-theme-dark .button-module_button__NDMQS {
572
+ color: #F4F4F4;
573
+ }
574
+ .cui-theme-light .button-module_button__NDMQS {
575
+ color: #090A0A;
576
+ }
595
577
  .popup-overlay-module_popup-modal-overlay__dlJqM {
596
578
  z-index: 1;
597
579
  position: fixed;
@@ -615,6 +597,19 @@
615
597
  opacity: 0;
616
598
  visibility: hidden;
617
599
  }
600
+ .flowLayout-module_flowLayout__VHpnY {
601
+ overflow: auto;
602
+ }
603
+ .flowLayout-module_flowLayout__VHpnY .flowLayout-module_beforeContent__rY-mW {
604
+ display: flex;
605
+ width: 100%;
606
+ min-width: 0;
607
+ }
608
+ .flowLayout-module_flowLayout__VHpnY .flowLayout-module_afterContent__Hlh8v {
609
+ display: flex;
610
+ width: 100%;
611
+ min-width: 0;
612
+ }
618
613
  :root {
619
614
  --divider-line: #4a4b4b;
620
615
  }
@@ -711,6 +706,11 @@
711
706
  background-color: #090A0A;
712
707
  color: #F4F4F4;
713
708
  }
709
+ .textAndContent-module_textAndContent__X5P1n {
710
+ align-items: baseline;
711
+ flex-shrink: 1;
712
+ gap: 8px;
713
+ }
714
714
  :root {
715
715
  --divider-line: #4a4b4b;
716
716
  }
@@ -1,2 +1,2 @@
1
- export{useApi}from"./useApi.js";export{useToggle}from"./useToggle.js";export{outsideClickHandler,useOutsideClick}from"./useOutsideClick.js";export{useResize}from"./useResize.js";export{useClassNames}from"./useClassNames.js";export{useParseProps}from"./useParseProps.js";export{getBaseThemes,observeThemePreference,setThemeClassNames,switchColorTheme,updateColorTheme,useThemePreference}from"./useThemePreference.js";export{useAnimation}from"./useAnimation.js";export{useIntersectionObserver}from"./useIntersectionObserver.js";
1
+ export{useApi}from"./useApi.js";export{useToggle}from"./useToggle.js";export{outsideClickHandler,useOutsideClick}from"./useOutsideClick.js";export{useResize}from"./useResize.js";export{useClassNames}from"./useClassNames.js";export{useParseProps}from"./useParseProps.js";export{getBaseThemes,observeThemePreference,setThemeClassNames,switchColorTheme,updateColorTheme,useThemePreference}from"./useThemePreference.js";export{useAnimation}from"./useAnimation.js";export{useIntersectionObserver}from"./useIntersectionObserver.js";export{useTimeoutFn}from"./useSetTimeout.js";
2
2
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,2 @@
1
+ import{useRef as t,useCallback as r,useEffect as e}from"react";const u=function(u){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=t({ready:null,timeout:null,callback:u}),l=r((()=>n.current.ready),[]),o=r((()=>{n.current.ready=null,n.current.timeout&&clearTimeout(n.current.timeout)}),[]),a=r((()=>{n.current.ready=!1,n.current.timeout&&clearTimeout(n.current.timeout),n.current.timeout=setTimeout((()=>{n.current.ready=!0,n.current.callback()}),c)}),[c]);return e((()=>{n.current.callback=u}),[u]),e((()=>(a(),o)),[o,c,a]),[l,o,a]};export{u as useTimeoutFn};
2
+ //# sourceMappingURL=useSetTimeout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSetTimeout.js","sources":["../../../../../../src/core/hooks/useSetTimeout.ts"],"sourcesContent":["import { useCallback, useEffect, useRef } from 'react'\n\nexport type UseTimeoutFnReturn = [() => boolean | null, () => void, () => void];\n\ntype CallBackType = (...args: unknown[]) => unknown\n\ntype LocalStateType = {\n ready: boolean | null\n timeout: ReturnType<typeof setTimeout> | null\n callback: CallBackType\n}\n\nexport const useTimeoutFn = (fn: CallBackType, ms: number = 0): UseTimeoutFnReturn => {\n const store = useRef<LocalStateType>({\n ready: null,\n timeout: null,\n callback: fn,\n })\n\n const isReady = useCallback(() => store.current.ready, [])\n\n const clear = useCallback(() => {\n store.current.ready = null\n store.current.timeout && clearTimeout(store.current.timeout)\n }, [])\n\n const set = useCallback(() => {\n store.current.ready = false\n store.current.timeout && clearTimeout(store.current.timeout)\n\n store.current.timeout = setTimeout(() => {\n store.current.ready = true\n store.current.callback()\n }, ms)\n }, [ms])\n\n // update ref when function changes\n useEffect(() => {\n store.current.callback = fn\n }, [fn])\n\n // set on mount, clear on unmount\n useEffect(() => {\n set()\n\n return clear\n }, [clear, ms, set])\n\n return [isReady, clear, set]\n}\n"],"names":["useTimeoutFn","fn","ms","arguments","length","undefined","store","useRef","ready","timeout","callback","isReady","useCallback","current","clear","clearTimeout","set","setTimeout","useEffect"],"mappings":"qEAYaA,EAAe,SAACC,GAAyD,IAAvCC,EAAUC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,EAC1D,MAAMG,EAAQC,EAAuB,CACnCC,MAAO,KACPC,QAAS,KACTC,SAAUT,IAGNU,EAAUC,GAAY,IAAMN,EAAMO,QAAQL,OAAO,IAEjDM,EAAQF,GAAY,KACxBN,EAAMO,QAAQL,MAAQ,KACtBF,EAAMO,QAAQJ,SAAWM,aAAaT,EAAMO,QAAQJ,QAAQ,GAC3D,IAEGO,EAAMJ,GAAY,KACtBN,EAAMO,QAAQL,OAAQ,EACtBF,EAAMO,QAAQJ,SAAWM,aAAaT,EAAMO,QAAQJ,SAEpDH,EAAMO,QAAQJ,QAAUQ,YAAW,KACjCX,EAAMO,QAAQL,OAAQ,EACtBF,EAAMO,QAAQH,UAAU,GACvBR,EAAG,GACL,CAACA,IAcJ,OAXAgB,GAAU,KACRZ,EAAMO,QAAQH,SAAWT,CAAE,GAC1B,CAACA,IAGJiB,GAAU,KACRF,IAEOF,IACN,CAACA,EAAOZ,EAAIc,IAER,CAACL,EAASG,EAAOE,EAC1B"}